From 6a72881c6c4190a7e8ce8e2861505d0e4254b64a Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Fri, 11 Apr 2025 09:53:39 +0100 Subject: [PATCH] chore: update uuid lib --- new-lamassu-admin/package-lock.json | 16 ++++++++++------ new-lamassu-admin/package.json | 2 +- .../src/components/editableTable/Table.jsx | 4 ++-- .../src/pages/Commissions/helper.jsx | 4 ++-- new-lamassu-admin/src/pages/Customers/helper.jsx | 6 +++--- .../src/pages/Triggers/TriggerView.jsx | 4 ++-- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/new-lamassu-admin/package-lock.json b/new-lamassu-admin/package-lock.json index d1c96d0f..ca06c752 100644 --- a/new-lamassu-admin/package-lock.json +++ b/new-lamassu-admin/package-lock.json @@ -42,8 +42,8 @@ "react-router-dom": "5.1.2", "react-use": "15.3.2", "react-virtualized": "^9.21.2", - "ua-parser-js": "^1.0.2", - "uuid": "^8.3.2", + "ua-parser-js": "1.0.40", + "uuid": "11.1.0", "yup": "1.4.0" }, "devDependencies": { @@ -8474,12 +8474,16 @@ "license": "MIT" }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/value-equal": { diff --git a/new-lamassu-admin/package.json b/new-lamassu-admin/package.json index 974912c0..47a0c572 100644 --- a/new-lamassu-admin/package.json +++ b/new-lamassu-admin/package.json @@ -38,7 +38,7 @@ "react-use": "15.3.2", "react-virtualized": "^9.21.2", "ua-parser-js": "1.0.40", - "uuid": "^8.3.2", + "uuid": "11.1.0", "yup": "1.4.0" }, "devDependencies": { diff --git a/new-lamassu-admin/src/components/editableTable/Table.jsx b/new-lamassu-admin/src/components/editableTable/Table.jsx index 58e77cc2..770b9449 100644 --- a/new-lamassu-admin/src/components/editableTable/Table.jsx +++ b/new-lamassu-admin/src/components/editableTable/Table.jsx @@ -6,7 +6,7 @@ import PromptWhenDirty from 'src/components/PromptWhenDirty' import Link from 'src/components/buttons/Link' import { TBody, Table } from 'src/components/fake-table/Table' import { Info2, TL1 } from 'src/components/typography' -import { v4 } from 'uuid' +import { v4 as uuidv4 } from 'uuid' import { AddButton } from 'src/components/buttons/index' @@ -191,7 +191,7 @@ const ETable = ({ diff --git a/new-lamassu-admin/src/pages/Commissions/helper.jsx b/new-lamassu-admin/src/pages/Commissions/helper.jsx index c4944095..d15f9184 100644 --- a/new-lamassu-admin/src/pages/Commissions/helper.jsx +++ b/new-lamassu-admin/src/pages/Commissions/helper.jsx @@ -2,7 +2,7 @@ import * as R from 'ramda' import React from 'react' import TxInIcon from 'src/styling/icons/direction/cash-in.svg?react' import TxOutIcon from 'src/styling/icons/direction/cash-out.svg?react' -import { v4 } from 'uuid' +import { v4 as uuidv4 } from 'uuid' import * as Yup from 'yup' import { Autocomplete, NumberInput } from 'src/components/inputs/formik' @@ -426,7 +426,7 @@ const createCommissions = (cryptoCode, deviceId, isDefault, config) => { machine: deviceId, cryptoCurrencies: [cryptoCode], default: isDefault, - id: v4() + id: uuidv4() } } diff --git a/new-lamassu-admin/src/pages/Customers/helper.jsx b/new-lamassu-admin/src/pages/Customers/helper.jsx index 20262137..86285b94 100644 --- a/new-lamassu-admin/src/pages/Customers/helper.jsx +++ b/new-lamassu-admin/src/pages/Customers/helper.jsx @@ -6,7 +6,7 @@ import { Field, useFormikContext } from 'formik' import { parsePhoneNumberFromString } from 'libphonenumber-js' import * as R from 'ramda' import { H4 } from 'src/components/typography' -import * as uuid from 'uuid' +import { validate as uuidValidate } from 'uuid'; import * as Yup from 'yup' import { @@ -84,7 +84,7 @@ const getAuthorizedStatus = (it, triggers, customRequests) => { const pendingFieldStatus = R.map(ite => { if (isManualField(ite)) { - if (uuid.validate(ite)) { + if (uuidValidate(ite)) { const request = R.find( iter => iter.infoRequestId === ite, it.customInfoRequests @@ -103,7 +103,7 @@ const getAuthorizedStatus = (it, triggers, customRequests) => { const rejectedFieldStatus = R.map(ite => { if (isManualField(ite)) { - if (uuid.validate(ite)) { + if (uuidValidate(ite)) { const request = R.find( iter => iter.infoRequestId === ite, it.customInfoRequests diff --git a/new-lamassu-admin/src/pages/Triggers/TriggerView.jsx b/new-lamassu-admin/src/pages/Triggers/TriggerView.jsx index ce019a14..1af0c181 100644 --- a/new-lamassu-admin/src/pages/Triggers/TriggerView.jsx +++ b/new-lamassu-admin/src/pages/Triggers/TriggerView.jsx @@ -3,7 +3,7 @@ import { makeStyles, Box } from '@material-ui/core' import * as R from 'ramda' import React, { useState } from 'react' import { H2 } from 'src/components/typography' -import { v4 } from 'uuid' +import { v4 as uuidv4 } from 'uuid' import { Button } from 'src/components/buttons' import { Table as EditableTable } from 'src/components/editableTable' @@ -51,7 +51,7 @@ const TriggerView = ({ } const add = rawConfig => { - const toSave = R.concat([{ id: v4(), direction: 'both', ...rawConfig }])( + const toSave = R.concat([{ id: uuidv4(), direction: 'both', ...rawConfig }])( triggers ) return saveConfig({ variables: { config: { triggers: toServer(toSave) } } })