diff --git a/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.spec.ts b/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.spec.ts index cf3c8924..2bc05612 100644 --- a/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.spec.ts +++ b/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.spec.ts @@ -228,6 +228,34 @@ describe('AJV factory', () => { required: ['type', 'id'], }); + expect( + dataProperty['relationships']['properties']['notes']['properties'][ + 'data' + ]['type'] + ).toBe('array'); + expect( + dataProperty['relationships']['properties']['notes']['properties'][ + 'data' + ]['items'] + ).toEqual({ + type: 'object', + properties: { + id: { + type: 'string', + description: 'Use string should be as uuid string', + pattern: + '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$', + maxLength: 36, + minLength: 36, + }, + type: { + type: 'string', + enum: ['notes'], + }, + }, + required: ['type', 'id'], + }); + expect(Object.keys(dataProperty['relationships']['properties'])).toEqual( relationField ); diff --git a/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.ts b/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.ts index c3bad01c..b2adfbe8 100644 --- a/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.ts +++ b/libs/json-api-nestjs/src/lib/factory/ajv/ajv.factory.ts @@ -26,8 +26,10 @@ export function AjvCallFactory( for (const entity of options.entities) { const arrayProps: { [key: string]: boolean } = {}; + const uuidProps: { [key: string]: boolean } = {}; const relationArrayProps: { [key: string]: { [key: string]: boolean } } = {}; + const relationUuids: { [key: string]: { [key: string]: boolean } } = {}; const repository = dataSource.getRepository(entity); const relations = repository.metadata.relations.map((i) => { return i.propertyName; @@ -36,6 +38,7 @@ export function AjvCallFactory( .filter((i) => !relations.includes(i.propertyName)) .map((i) => { arrayProps[i.propertyName] = i.isArray; + uuidProps[i.propertyName] = i.generationStrategy === 'uuid'; return i.propertyName; }); const relationType = repository.metadata.relations.reduce((acum, i) => { @@ -63,6 +66,15 @@ export function AjvCallFactory( relationArrayProps[item.propertyName] = relationArrayProps[item.propertyName] || {}; relationArrayProps[item.propertyName][i.propertyName] = i.isArray; + + relationUuids[item.propertyName] = + relationUuids[item.propertyName] || {}; + + if (i.isPrimary) { + relationUuids[item.propertyName][i.propertyName] = + i.generationStrategy === 'uuid'; + } + return i.propertyName; }); const fakeObject = columns.reduce>( @@ -110,6 +122,7 @@ export function AjvCallFactory( arrayProps, relationArrayProps, relationType, + relationUuids, } ), `inputBodyPostSchema-${schemaName}` @@ -122,8 +135,10 @@ export function AjvCallFactory( `inputBodyPatchSchema-${schemaName}`, { arrayProps, + uuidProps, relationArrayProps, relationType, + relationUuids, } ), `inputBodyPatchSchema-${schemaName}` diff --git a/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-patch-schema.ts b/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-patch-schema.ts index bd756f59..a88ba4f6 100644 --- a/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-patch-schema.ts +++ b/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-patch-schema.ts @@ -8,10 +8,12 @@ export function inputBodyPatchSchema( schemaName: string, arrayPropsConfig: { arrayProps: { [key: string]: boolean }; + uuidProps: { [key: string]: boolean }; relationArrayProps: { [key: string]: { [key: string]: boolean } }; relationType: { [key: string]: Function | string; }; + relationUuids: { [key: string]: { [key: string]: boolean } }; } ): ReturnType { const json = inputBodyPostSchema( @@ -21,13 +23,18 @@ export function inputBodyPatchSchema( schemaName, arrayPropsConfig ); - const patternObject: Record = {}; - if ( - Reflect.getMetadata('design:type', entity['prototype'], 'id') === Number - ) { - patternObject.pattern = '^\\d+$'; - patternObject.description = 'Use string should be as number string'; + const patternObject: Record = {}; + patternObject.pattern = '^\\d+$'; + patternObject.description = 'Use string should be as number string'; + + if (arrayPropsConfig.uuidProps.id) { + patternObject.pattern = + '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$'; + patternObject.maxLength = 36; + patternObject.minLength = 36; + patternObject.description = 'Use string should be as uuid string'; } + json.properties.data.properties = { ...{ id: { diff --git a/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-post-schema.ts b/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-post-schema.ts index 2a912f38..bbe8a682 100644 --- a/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-post-schema.ts +++ b/libs/json-api-nestjs/src/lib/factory/ajv/utils/input-body-post-schema.ts @@ -13,6 +13,7 @@ export function inputBodyPostSchema( relationType: { [key: string]: Function | string; }; + relationUuids: { [key: string]: { [key: string]: boolean } }; } ): typeof inputBodySchemaJson { const json: typeof inputBodySchemaJson = JSON.parse( @@ -23,7 +24,7 @@ export function inputBodyPostSchema( camelToKebab(getEntityName(entity)) ); - const relDataType = { + const baseRelDataType: Record = { type: 'object', properties: { data: { @@ -103,13 +104,44 @@ export function inputBodyPostSchema( ...attributes, }; + const uuidRelations = arrayPropsConfig.relationUuids || {}; const relationships = Object.keys(relationsField).reduce((acum, item) => { + const relDataType = { + [item]: { + ...baseRelDataType, + properties: { + ...baseRelDataType.properties, + data: { + ...baseRelDataType.properties.data, + properties: { + ...baseRelDataType.properties.data.properties, + id: { + ...baseRelDataType.properties.data.properties.id, + pattern: uuidRelations[item]?.id + ? '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' + : '^\\d+$', + ...(uuidRelations[item]?.id + ? { + minLength: 36, + maxLength: 36, + } + : {}), + description: uuidRelations[item]?.id + ? 'Use string should be as uuid string' + : 'Use string should be as number string', + }, + }, + }, + }, + }, + }; + const resultSchema = { - ...relDataType.properties.data, + ...relDataType[item].properties.data, properties: { - ...relDataType.properties.data.properties, + ...relDataType[item].properties.data.properties, type: { - ...relDataType.properties.data.properties.type, + ...relDataType[item].properties.data.properties.type, ...(arrayPropsConfig.relationType[item] ? { enum: [ @@ -124,9 +156,9 @@ export function inputBodyPostSchema( }; acum[item] = { - ...relDataType, + ...relDataType[item], properties: { - ...relDataType.properties, + ...relDataType[item].properties, data: Reflect.getMetadata('design:type', entity['prototype'], item) === Array @@ -138,6 +170,7 @@ export function inputBodyPostSchema( : resultSchema, }, }; + return acum; }, {}); diff --git a/libs/json-api-nestjs/src/lib/mock-utils/db-for-test b/libs/json-api-nestjs/src/lib/mock-utils/db-for-test index 31409ce4..f6daecb3 100644 --- a/libs/json-api-nestjs/src/lib/mock-utils/db-for-test +++ b/libs/json-api-nestjs/src/lib/mock-utils/db-for-test @@ -16,6 +16,8 @@ SET xmloption = content; SET client_min_messages = warning; SET row_security = off; +create extension "uuid-ossp"; + -- -- Name: comment_kind_enum; Type: TYPE; Schema: public; Owner: - -- @@ -103,7 +105,7 @@ ALTER SEQUENCE public.comments_id_seq OWNED BY public.comments.id; -- CREATE TABLE public.notes ( - id integer NOT NULL, + id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), text text NOT NULL, created_by integer, created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP, @@ -111,25 +113,6 @@ CREATE TABLE public.notes ( ); --- --- Name: notes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.notes_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.notes_id_seq OWNED BY public.notes.id; - -- -- Name: migrations; Type: TABLE; Schema: public; Owner: - @@ -421,13 +404,6 @@ ALTER TABLE ONLY public.addresses ALTER COLUMN id SET DEFAULT nextval('public.ad ALTER TABLE ONLY public.comments ALTER COLUMN id SET DEFAULT nextval('public.comments_id_seq'::regclass); --- --- Name: notes id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.notes ALTER COLUMN id SET DEFAULT nextval('public.notes_id_seq'::regclass); - - -- -- Name: migrations id; Type: DEFAULT; Schema: public; Owner: - -- @@ -508,13 +484,6 @@ ALTER TABLE ONLY public.comments ADD CONSTRAINT "PK_8bf68bc960f2b69e818bdb90dcb" PRIMARY KEY (id); --- --- Name: notes PK_notes; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.notes - ADD CONSTRAINT "PK_notes" PRIMARY KEY (id); - -- -- Name: migrations PK_8c82d7f526340ab734260ea46be; Type: CONSTRAINT; Schema: public; Owner: - -- diff --git a/libs/json-api-nestjs/src/lib/mock-utils/entities/notes.ts b/libs/json-api-nestjs/src/lib/mock-utils/entities/notes.ts index 7ad8000d..49339179 100644 --- a/libs/json-api-nestjs/src/lib/mock-utils/entities/notes.ts +++ b/libs/json-api-nestjs/src/lib/mock-utils/entities/notes.ts @@ -12,8 +12,8 @@ import { Users, IUsers } from '.'; @Entity('notes') export class Notes { - @PrimaryGeneratedColumn() - public id: number; + @PrimaryGeneratedColumn('uuid') + public id: string; @IsNotEmpty() @Column({ diff --git a/libs/json-api-nestjs/src/lib/mock-utils/index.ts b/libs/json-api-nestjs/src/lib/mock-utils/index.ts index 0842e188..505aa4e1 100644 --- a/libs/json-api-nestjs/src/lib/mock-utils/index.ts +++ b/libs/json-api-nestjs/src/lib/mock-utils/index.ts @@ -1,6 +1,6 @@ import { TypeOrmModule } from '@nestjs/typeorm'; import { DynamicModule } from '@nestjs/common'; -import { newDb } from 'pg-mem'; +import { DataType, newDb } from 'pg-mem'; import { readFileSync } from 'fs'; import { join } from 'path'; @@ -17,6 +17,8 @@ import { } from './entities'; import { DataSource } from 'typeorm'; +import { v4 } from 'uuid'; + export * from './entities'; export const entities = [ @@ -48,6 +50,15 @@ export function mockDBTestModule(): DynamicModule { 'PostgreSQL 12.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.2.1_pre1) 10.2.1 20201203, 64-bit', }); + db.registerExtension('uuid-ossp', (schema) => { + schema.registerFunction({ + name: 'uuid_generate_v4', + returns: DataType.uuid, + implementation: v4, + impure: true, + }); + }); + db.public.none(dump); const backup = db.backup(); return TypeOrmModule.forRootAsync({ diff --git a/package-lock.json b/package-lock.json index 77fea90c..7fd06b93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,6 +76,7 @@ "@types/node": "16.11.7", "@types/react": "18.0.20", "@types/react-dom": "18.0.6", + "@types/uuid": "^9.0.1", "@typescript-eslint/eslint-plugin": "^5.36.1", "@typescript-eslint/parser": "^5.36.1", "babel-jest": "28.1.1", @@ -105,7 +106,8 @@ "semantic-release": "^19.0.5", "ts-jest": "28.0.5", "ts-node": "10.9.1", - "typescript": "~4.8.2" + "typescript": "~4.8.2", + "uuid": "^9.0.0" } }, "node_modules/@adobe/css-tools": { @@ -1509,6 +1511,15 @@ "yarn": ">= 1.13.0" } }, + "node_modules/@angular/cli/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==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@angular/common": { "version": "14.2.5", "resolved": "https://registry.npmjs.org/@angular/common/-/common-14.2.5.tgz", @@ -3961,6 +3972,15 @@ "node": ">=0.6" } }, + "node_modules/@cypress/request/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==", + "devOptional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@cypress/webpack-preprocessor": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/@cypress/webpack-preprocessor/-/webpack-preprocessor-5.14.0.tgz", @@ -5132,14 +5152,6 @@ } } }, - "node_modules/@nestjs/common/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@nestjs/core": { "version": "9.1.4", "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-9.1.4.tgz", @@ -5183,14 +5195,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==" }, - "node_modules/@nestjs/core/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@nestjs/mapped-types": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-1.1.0.tgz", @@ -5412,6 +5416,14 @@ "typeorm": "^0.3.0" } }, + "node_modules/@nestjs/typeorm/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==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@ngtools/webpack": { "version": "14.2.5", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-14.2.5.tgz", @@ -9228,6 +9240,12 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, + "node_modules/@types/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", + "dev": true + }, "node_modules/@types/ws": { "version": "8.5.3", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", @@ -29243,6 +29261,14 @@ "websocket-driver": "^0.7.4" } }, + "node_modules/sockjs/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==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", @@ -30898,6 +30924,14 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/typeorm/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==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/typescript": { "version": "4.8.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", @@ -31299,9 +31333,9 @@ } }, "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": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "bin": { "uuid": "dist/bin/uuid" } @@ -33068,6 +33102,14 @@ "symbol-observable": "4.0.0", "uuid": "8.3.2", "yargs": "17.5.1" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } } }, "@angular/common": { @@ -34683,6 +34725,12 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "devOptional": true + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "devOptional": true } } }, @@ -35527,13 +35575,6 @@ "iterare": "1.2.1", "tslib": "2.4.0", "uuid": "9.0.0" - }, - "dependencies": { - "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" - } } }, "@nestjs/core": { @@ -35554,11 +35595,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==" - }, - "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" } } }, @@ -35705,6 +35741,13 @@ "integrity": "sha512-A2BgLIPsMtmMI0bPKEf4bmzgFPsnvHqNBx3KkvaJ7hJrBQy0OqYOb+Rr06ifblKWDWS2tUPNrAFQbZjtk3PI+g==", "requires": { "uuid": "8.3.2" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } } }, "@ngtools/webpack": { @@ -38776,6 +38819,12 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, + "@types/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", + "dev": true + }, "@types/ws": { "version": "8.5.3", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", @@ -53434,6 +53483,13 @@ "faye-websocket": "^0.11.3", "uuid": "^8.3.2", "websocket-driver": "^0.7.4" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } } }, "socks": { @@ -54602,6 +54658,11 @@ "requires": { "argparse": "^2.0.1" } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" } } }, @@ -54892,9 +54953,9 @@ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" }, "v8-compile-cache": { "version": "2.3.0", diff --git a/package.json b/package.json index ce36f9b6..c435ab0d 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "@types/node": "16.11.7", "@types/react": "18.0.20", "@types/react-dom": "18.0.6", + "@types/uuid": "^9.0.1", "@typescript-eslint/eslint-plugin": "^5.36.1", "@typescript-eslint/parser": "^5.36.1", "babel-jest": "28.1.1", @@ -113,7 +114,8 @@ "semantic-release": "^19.0.5", "ts-jest": "28.0.5", "ts-node": "10.9.1", - "typescript": "~4.8.2" + "typescript": "~4.8.2", + "uuid": "^9.0.0" }, "config": { "commitizen": {