From 6c425a56e227235c3adf8889966954aad99a9121 Mon Sep 17 00:00:00 2001 From: antonio Date: Thu, 15 Aug 2024 20:46:18 -0300 Subject: [PATCH] 4.0.9 --- package.json | 10 +- packages/accounts/package.json | 2 +- packages/babel-plugins/package.json | 2 +- packages/boilerplate/babel-config.cjs | 25 +- packages/boilerplate/package.json | 2 +- packages/entity/package.json | 2 +- packages/entity/setupTests.cjs | 4 +- packages/entity/src/Entity.ts | 3 +- packages/entity/src/__tests__/Aliases.spec.ts | 248 +++++++++--------- packages/entity/src/__tests__/Product.spec.ts | 175 ++++++------ .../src/__tests__/ProductResolver.spec.ts | 9 +- packages/logstorm/package.json | 2 +- packages/mongo/package.json | 2 +- .../src/__tests__/mongoTransporter.spec.ts | 60 ++--- packages/plugin-engine/package.json | 2 +- packages/powership/package.json | 2 +- packages/runmate/package.json | 2 +- packages/runmate/src/handleJSON.ts | 11 +- packages/schema/package.json | 2 +- packages/schema/src/GraphType/GraphType.ts | 7 +- packages/schema/src/ObjectType.ts | 4 +- .../schema/src/__tests__/FieldTypes.spec.ts | 6 +- packages/schema/src/createGraphQLSchema.ts | 10 +- packages/schema/src/index.ts | 64 ++++- packages/schema/src/internal.ts | 11 - packages/schema/src/writeTypes.ts | 6 +- packages/server/package.json | 2 +- packages/server/src/graphql/generateTypes.ts | 5 +- packages/transporter/package.json | 2 +- packages/utils/package.json | 2 +- packages/utils/src/jsonToTypescript.ts | 19 +- pnpm-lock.yaml | 169 +----------- 32 files changed, 376 insertions(+), 496 deletions(-) diff --git a/package.json b/package.json index eb3bed6f..acca9a6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powership", - "version": "4.0.7", + "version": "4.0.10", "private": true, "scripts": { "pack": "run-s pack:*", @@ -34,6 +34,7 @@ "@types/shelljs": "0.8.11", "@typescript-eslint/eslint-plugin": "4.15.2", "@typescript-eslint/parser": "4.15.2", + "bun-safe": "1.0.7", "bun-types": "1.0.26", "conditional-type-checks": "1.0.6", "eslint": "7.20.0", @@ -48,15 +49,14 @@ "prettier": "2.4.0", "prettier-plugin-multiline-arrays": "^1.1.3", "rimraf": "3.0.2", + "runmate": "latest", + "semver": "7.5.2", "shelljs": "0.8.5", "ts-jest": "29.1.2", "ts-node": "10.9.1", - "runmate": "latest", + "typedoc": "0.23.24", "typedoc-plugin-markdown": "3.14.0", "typescript": "4.8.2", - "bun-safe": "1.0.7", - "semver": "7.5.2", - "typedoc": "0.23.24", "zx": "7.2.3" }, "xworkspaces": [ diff --git a/packages/accounts/package.json b/packages/accounts/package.json index ae30ef79..609fdcc7 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -1,6 +1,6 @@ { "name": "@powership/accounts", - "version": "4.0.7", + "version": "4.0.10", "description": "Powership accounts", "type": "module", "main": "./out/index.cjs", diff --git a/packages/babel-plugins/package.json b/packages/babel-plugins/package.json index bac0586a..cec3b620 100644 --- a/packages/babel-plugins/package.json +++ b/packages/babel-plugins/package.json @@ -1,6 +1,6 @@ { "name": "@powership/babel-plugins", - "version": "4.0.7", + "version": "4.0.10", "main": "./out/index.js", "sideEffects": false, "typings": "./out/index.d.ts", diff --git a/packages/boilerplate/babel-config.cjs b/packages/boilerplate/babel-config.cjs index 71c65f49..89e2b050 100644 --- a/packages/boilerplate/babel-config.cjs +++ b/packages/boilerplate/babel-config.cjs @@ -21,11 +21,7 @@ const browserConfig = { useBuiltIns: 'entry', corejs: '3.22', targets: { - browsers: [ - "last 1 versions", - "not dead", - "not < 50%" - ] + browsers: ['last 1 versions', 'not dead', 'not < 50%'], }, }; @@ -43,10 +39,6 @@ const envConfig = { 'module-browser': { ...browserConfig, modules: false, - targets: { - ...browserConfig.targets, - esmodules: true, - }, }, node: { @@ -56,8 +48,11 @@ const envConfig = { 'module-node': { ...nodeConfig, modules: false, + }, + + module: { + modules: false, targets: { - ...nodeConfig.targets, esmodules: true, }, }, @@ -66,10 +61,7 @@ const envConfig = { module.exports = function (api) { api.cache(true); - const presets = [ - '@babel/preset-typescript', // - ['@babel/preset-env', envConfig], - ]; + const presets = ['@babel/preset-typescript', ['@babel/preset-env', envConfig]]; const plugins = [ ['babel-plugin-add-import-extension', { extension: destinationExtension, replace: true }], @@ -94,9 +86,6 @@ module.exports = function (api) { return { presets, plugins, - ignore: [ - /node_modules/, - '**/__tests__', // - ], + ignore: [/node_modules/, '**/__tests__'], }; }; diff --git a/packages/boilerplate/package.json b/packages/boilerplate/package.json index 1c1f64c3..87e5e1cc 100644 --- a/packages/boilerplate/package.json +++ b/packages/boilerplate/package.json @@ -1,6 +1,6 @@ { "name": "@powership/boilerplate", - "version": "4.0.7", + "version": "4.0.10", "author": "antoniopresto ", "sideEffects": false, "type": "module", diff --git a/packages/entity/package.json b/packages/entity/package.json index c7c68831..6077f0e9 100644 --- a/packages/entity/package.json +++ b/packages/entity/package.json @@ -1,6 +1,6 @@ { "name": "@powership/entity", - "version": "4.0.7", + "version": "4.0.10", "type": "module", "main": "./out/index.cjs", "module": "./out/index.mjs", diff --git a/packages/entity/setupTests.cjs b/packages/entity/setupTests.cjs index bfc390d7..7cf33e8e 100644 --- a/packages/entity/setupTests.cjs +++ b/packages/entity/setupTests.cjs @@ -1,4 +1,4 @@ -const { MongoMemoryServer } = require('mongodb-memory-server-core'); +// const { MongoMemoryServer } = require('mongodb-memory-server-core'); process.env.LOG_LEVEL = '1'; process.env.NODE_ENV = 'test'; @@ -6,5 +6,5 @@ process.env.IS_LOCAL = 'true'; beforeAll(async () => { // ensure mongo bins are downloaded - await MongoMemoryServer.create(); + // await MongoMemoryServer.create(); }); diff --git a/packages/entity/src/Entity.ts b/packages/entity/src/Entity.ts index 515cebd7..675b25bd 100644 --- a/packages/entity/src/Entity.ts +++ b/packages/entity/src/Entity.ts @@ -4,7 +4,6 @@ import { FinalFieldDefinition, FinalObjectDefinition, GraphType, - Internal, isFieldTypeName, ObjectDefinitionInput, } from '@powership/schema'; @@ -762,7 +761,7 @@ function _registerPKSKHook(input: { doc.ulid = (() => { if (doc.ulid) return doc.ulid; - return Internal.create.ulid({ autoCreate: true }).parse(undefined); + return ulid(); })(); doc.createdAt = new Date(); diff --git a/packages/entity/src/__tests__/Aliases.spec.ts b/packages/entity/src/__tests__/Aliases.spec.ts index b6320442..bad1048b 100644 --- a/packages/entity/src/__tests__/Aliases.spec.ts +++ b/packages/entity/src/__tests__/Aliases.spec.ts @@ -7,6 +7,130 @@ import { tupleEnum } from '@powership/utils'; import { createEntity } from '../Entity'; describe('Aliases', () => { + const AccountType = createType('Account', { + object: { + username: 'string', + providers: { string: {}, list: true, optional: true }, + }, + } as const); + + const accessTypesEnum = tupleEnum('phone', 'email', 'oauth', 'custom'); + + const AccessTypeBase = createSchema({ + createdAt: { date: { autoCreate: true } }, + meta: 'record?', + updatedAt: { date: { autoCreate: true } }, + } as const); + + const AccessTypeSchema = createType({ + union: [ + { + object: { + ...AccessTypeBase.definition, + kind: { literal: accessTypesEnum.phone }, + value: accessTypesEnum.phone, + verified: 'boolean', + }, + }, + + { + object: { + ...AccessTypeBase.definition, + kind: { literal: accessTypesEnum.email }, + value: accessTypesEnum.email, + verified: 'boolean', + }, + }, + + { + object: { + ...AccessTypeBase.definition, + kind: { literal: accessTypesEnum.oauth }, + provider: { description: 'Provider name', string: {} }, + authToken: 'string', + value: { alias: 'provider' }, + }, + }, + + { + object: { + ...AccessTypeBase.definition, + kind: { literal: accessTypesEnum.custom }, + meta: 'record', + value: 'string', + }, + }, + ], + } as const); + + type AccessType = Infer; + + const UserType = AccountType.clone((t) => + t + .extendObjectDefinition({ + firstName: 'string', + lastName: 'string', + access: { array: { of: AccessTypeSchema } }, + email: { + alias: { + type: 'email', + aggregate: [ + { $pick: 'access' }, // + { $sort: { createdAt: -1 } }, + { $matchOne: { kind: 'email' } }, + { $pick: 'value' }, // + ], + }, + }, + + phone: { + description: 'First user phone', + optional: true, + alias: { + type: 'phone', + aggregate: [ + { $pick: 'access' }, // + { $sort: { createdAt: -1 } }, + { $matchOne: { kind: 'phone' } }, + { $pick: 'value' }, // + ], + }, + }, + }) + .graphType('User') + ); + + function _getEntity(transporter: MongoTransporter) { + return createEntity({ + name: 'User', + transporter, + type: UserType, + indexes: [ + { + name: '_id', + PK: ['.username'], + }, + ], + }); + } + + function userMock() { + const access: AccessType = { + kind: 'email', + value: 'antonio@mail.com', + updatedAt: new Date(), + createdAt: new Date(), + verified: false, + }; + + return UserType.parse({ + firstName: 'antonio', + lastName: 'Silva', + username: 'antonio', + access: [access], + }); + } + let mockApp: AppMock; let transporter: MongoTransporter; @@ -233,127 +357,3 @@ describe('Aliases', () => { }); }); }); - -export const AccountType = createType('Account', { - object: { - username: 'string', - providers: { string: {}, list: true, optional: true }, - }, -} as const); - -const accessTypesEnum = tupleEnum('phone', 'email', 'oauth', 'custom'); - -const AccessTypeBase = createSchema({ - createdAt: { date: { autoCreate: true } }, - meta: 'record?', - updatedAt: { date: { autoCreate: true } }, -} as const); - -const AccessTypeSchema = createType({ - union: [ - { - object: { - ...AccessTypeBase.definition, - kind: { literal: accessTypesEnum.phone }, - value: accessTypesEnum.phone, - verified: 'boolean', - }, - }, - - { - object: { - ...AccessTypeBase.definition, - kind: { literal: accessTypesEnum.email }, - value: accessTypesEnum.email, - verified: 'boolean', - }, - }, - - { - object: { - ...AccessTypeBase.definition, - kind: { literal: accessTypesEnum.oauth }, - provider: { description: 'Provider name', string: {} }, - authToken: 'string', - value: { alias: 'provider' }, - }, - }, - - { - object: { - ...AccessTypeBase.definition, - kind: { literal: accessTypesEnum.custom }, - meta: 'record', - value: 'string', - }, - }, - ], -} as const); - -type AccessType = Infer; - -const UserType = AccountType.clone((t) => - t - .extendObjectDefinition({ - firstName: 'string', - lastName: 'string', - access: { array: { of: AccessTypeSchema } }, - email: { - alias: { - type: 'email', - aggregate: [ - { $pick: 'access' }, // - { $sort: { createdAt: -1 } }, - { $matchOne: { kind: 'email' } }, - { $pick: 'value' }, // - ], - }, - }, - - phone: { - description: 'First user phone', - optional: true, - alias: { - type: 'phone', - aggregate: [ - { $pick: 'access' }, // - { $sort: { createdAt: -1 } }, - { $matchOne: { kind: 'phone' } }, - { $pick: 'value' }, // - ], - }, - }, - }) - .graphType('User') -); - -function _getEntity(transporter: MongoTransporter) { - return createEntity({ - name: 'User', - transporter, - type: UserType, - indexes: [ - { - name: '_id', - PK: ['.username'], - }, - ], - }); -} - -function userMock() { - const access: AccessType = { - kind: 'email', - value: 'antonio@mail.com', - updatedAt: new Date(), - createdAt: new Date(), - verified: false, - }; - - return UserType.parse({ - firstName: 'antonio', - lastName: 'Silva', - username: 'antonio', - access: [access], - }); -} diff --git a/packages/entity/src/__tests__/Product.spec.ts b/packages/entity/src/__tests__/Product.spec.ts index 8e542466..e0e00ff1 100644 --- a/packages/entity/src/__tests__/Product.spec.ts +++ b/packages/entity/src/__tests__/Product.spec.ts @@ -11,6 +11,59 @@ import { import { createEntity } from '../Entity'; describe('Product', () => { + function mokit() { + const res = { + mockApp: {} as AppMock, + transporter: {} as MongoTransporter, + getOptions() { + return { + transporter: res.transporter, + name: 'Product', + indexes: [ + { + name: '_id', + PK: ['.storeId'], + SK: ['.ulid'], + }, + { + name: '_id1', + PK: ['.storeId'], + SK: ['.SKU'], + }, + ], + type, + } as const; + }, + getEntity() { + return createEntity(res.getOptions()); + }, + async before() { + await ObjectType.reset(); + res.mockApp = createAppMock(); + await res.mockApp.start(); + + res.transporter = new MongoTransporter({ + collection: 'temp1', + client: res.mockApp.client!, + }); + }, + async after() { + await res.mockApp.reset(); + }, + }; + + const type = createType('Product', { + object: { + title: { string: { min: 2 } }, + storeId: { ID: { autoCreate: false } }, + SKU: { string: { min: 3 } }, + category: 'string?', + }, + }); + + return res; + } + const { getEntity, getOptions, after, before } = mokit(); beforeEach(before); @@ -526,99 +579,47 @@ describe('Product', () => { expect(found).toMatchObject({ item: null }); }); -}); -describe('Product GraphQL utils', () => { - const { getEntity, after, before } = mokit(); - beforeEach(before); - afterEach(after); + describe('Product GraphQL utils', () => { + const { getEntity, after, before } = mokit(); - test('indexGraphTypes', () => { - const entity = getEntity(); - expect(entity.indexGraphTypes._id.clone((it) => it.def())).toEqual({ - storeId: expect.objectContaining({ type: 'ID' }), - ulid: expect.objectContaining({ type: 'ulid' }), - }); - }); + beforeEach(before); + afterEach(after); - test('toFilterFields', async () => { - const entity = getEntity(); - expect(entity.findOne.filterDef.def()).toEqual({ - SKU: { - def: { - min: 3, - }, - optional: true, - type: 'string', - }, - id: { - optional: true, - type: 'ID', - }, - storeId: { - def: { - autoCreate: false, - }, - optional: true, - type: 'ID', - }, - ulid: { - optional: true, - type: 'ulid', - }, + test('indexGraphTypes', () => { + const entity = getEntity(); + expect(entity.indexGraphTypes._id.clone((it) => it.def())).toEqual({ + storeId: expect.objectContaining({ type: 'ID' }), + ulid: expect.objectContaining({ type: 'ulid' }), + }); }); - }); -}); -function mokit() { - const res = { - mockApp: {} as AppMock, - transporter: {} as MongoTransporter, - getOptions() { - return { - transporter: res.transporter, - name: 'Product', - indexes: [ - { - name: '_id', - PK: ['.storeId'], - SK: ['.ulid'], + test('toFilterFields', async () => { + const entity = getEntity(); + expect(entity.findOne.filterDef.def()).toEqual({ + SKU: { + def: { + min: 3, }, - { - name: '_id1', - PK: ['.storeId'], - SK: ['.SKU'], + optional: true, + type: 'string', + }, + id: { + optional: true, + type: 'ID', + }, + storeId: { + def: { + autoCreate: false, }, - ], - type, - } as const; - }, - getEntity() { - return createEntity(res.getOptions()); - }, - async before() { - await ObjectType.reset(); - res.mockApp = createAppMock(); - await res.mockApp.start(); - - res.transporter = new MongoTransporter({ - collection: 'temp1', - client: res.mockApp.client!, + optional: true, + type: 'ID', + }, + ulid: { + optional: true, + type: 'ulid', + }, }); - }, - async after() { - await res.mockApp.reset(); - }, - }; - - const type = createType('Product', { - object: { - title: { string: { min: 2 } }, - storeId: { ID: { autoCreate: false } }, - SKU: { string: { min: 3 } }, - category: 'string?', - }, + }); }); - - return res; -} +}); diff --git a/packages/entity/src/__tests__/ProductResolver.spec.ts b/packages/entity/src/__tests__/ProductResolver.spec.ts index e39f06dc..c6bbcf72 100644 --- a/packages/entity/src/__tests__/ProductResolver.spec.ts +++ b/packages/entity/src/__tests__/ProductResolver.spec.ts @@ -1,10 +1,11 @@ -import { Internal, createResolver, Infer } from '@powership/schema'; +import { createResolver, Infer } from '@powership/schema'; import { createGraphQLSchema } from '@powership/schema'; import { PaginationResult } from '@powership/transporter'; import { notNull, NullableToPartial, PromiseType } from '@powership/utils'; import { assert, IsExact } from 'conditional-type-checks'; import { setupProductTest } from './setupProductTest'; +import { graphql } from 'graphql/graphql'; describe('ProductResolver', () => { const { getMocks } = setupProductTest(); @@ -120,7 +121,7 @@ describe('ProductResolver', () => { const schema = createGraphQLSchema(); - const resp = await Internal.graphql({ + const resp = await graphql({ schema, contextValue: { userId: () => '123' }, source: @@ -154,7 +155,7 @@ describe('ProductResolver', () => { const schema = createGraphQLSchema(); - const response = await Internal.graphql({ + const response = await graphql({ schema, contextValue: { userId: () => '123' }, source: @@ -191,7 +192,7 @@ describe('ProductResolver', () => { const schema = createGraphQLSchema(); - const invalidCondition = await Internal.graphql({ + const invalidCondition = await graphql({ schema, contextValue: { userId: () => '123' }, source: diff --git a/packages/logstorm/package.json b/packages/logstorm/package.json index 24e91e8b..362f620a 100644 --- a/packages/logstorm/package.json +++ b/packages/logstorm/package.json @@ -1,6 +1,6 @@ { "name": "logstorm", - "version": "4.0.7", + "version": "4.0.10", "typings": "out", "author": "antoniopresto ", "type": "module", diff --git a/packages/mongo/package.json b/packages/mongo/package.json index f13a0464..9ad9b398 100644 --- a/packages/mongo/package.json +++ b/packages/mongo/package.json @@ -1,6 +1,6 @@ { "name": "@powership/mongo", - "version": "4.0.7", + "version": "4.0.10", "type": "module", "main": "./out/index.cjs", "module": "./out/index.mjs", diff --git a/packages/mongo/src/__tests__/mongoTransporter.spec.ts b/packages/mongo/src/__tests__/mongoTransporter.spec.ts index fd7af58c..e75c7f97 100644 --- a/packages/mongo/src/__tests__/mongoTransporter.spec.ts +++ b/packages/mongo/src/__tests__/mongoTransporter.spec.ts @@ -89,7 +89,7 @@ describe('createOne', () => { let mockApp: AppMock; let transporter: MongoTransporter; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: '_id', PK: ['.PK'], SK: ['.SK'] }], }; @@ -140,9 +140,9 @@ describe('createOne', () => { item: { PK: 'ranking', SK: 0, - _e: 'entity_foo', - _id: 'entity_foo⋮_id⋮ranking⋮5⋮', - _idPK: 'entity_foo⋮_id⋮ranking⋮', + _e: 'entity_zaz', + _id: 'entity_zaz⋮_id⋮ranking⋮5⋮', + _idPK: 'entity_zaz⋮_id⋮ranking⋮', _idSK: '5', _c: expect.any(String), }, @@ -161,7 +161,7 @@ describe('createOne', () => { item: { PK: 'ranking', SK: 10, - _id: 'entity_foo⋮_id⋮ranking⋮721⋮', + _id: 'entity_zaz⋮_id⋮ranking⋮721⋮', }, updated: false, }); @@ -179,11 +179,11 @@ describe('createOne', () => { item: { PK: 'ranking', SK: 12000000000000000000000000000000000000, - _id: 'entity_foo⋮_id⋮ranking⋮7z412⋮', - _idPK: 'entity_foo⋮_id⋮ranking⋮', + _id: 'entity_zaz⋮_id⋮ranking⋮7z412⋮', + _idPK: 'entity_zaz⋮_id⋮ranking⋮', _idSK: '7z412', _c: expect.any(String), - _e: 'entity_foo', + _e: 'entity_zaz', }, updated: false, }); @@ -203,10 +203,10 @@ describe('createOne', () => { item: { PK: 'users', SK: 'users', - _id: 'entity_foo⋮_id⋮users⋮users⋮', - _idPK: 'entity_foo⋮_id⋮users⋮', + _id: 'entity_zaz⋮_id⋮users⋮users⋮', + _idPK: 'entity_zaz⋮_id⋮users⋮', _idSK: 'users', - _e: 'entity_foo', + _e: 'entity_zaz', _c: expect.any(String), }, updated: false, @@ -224,9 +224,9 @@ describe('createOne', () => { item: { PK: 'users', SK: '5', - _e: 'entity_foo', - _id: 'entity_foo⋮_id⋮users⋮5⋮', - _idPK: 'entity_foo⋮_id⋮users⋮', + _e: 'entity_zaz', + _id: 'entity_zaz⋮_id⋮users⋮5⋮', + _idPK: 'entity_zaz⋮_id⋮users⋮', _c: expect.any(String), }, updated: false, @@ -241,7 +241,7 @@ describe('createOne', () => { item: { PK: 'users', SK: '123', - _id: 'entity_foo⋮_id⋮users⋮123⋮', + _id: 'entity_zaz⋮_id⋮users⋮123⋮', email: 'fulano@gmail.com', name: 'fulano', }, @@ -254,7 +254,7 @@ describe('createOne', () => { item: { PK: 'users', SK: '123', - _id: 'entity_foo⋮_id⋮users⋮123⋮', + _id: 'entity_zaz⋮_id⋮users⋮123⋮', email: 'fulano@gmail.com', name: 'fulano', }, @@ -367,7 +367,7 @@ describe('updateOne', () => { let mockApp: AppMock; let transporter: MongoTransporter; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: '_id', PK: ['.PK'], SK: ['.SK'] }], }; @@ -453,11 +453,11 @@ describe('updateOne', () => { expect(await update('a', { $inc: { num: 1, newNum: 2 } })).toHaveProperty( 'item', expect.objectContaining({ - _id: 'entity_foo⋮_id⋮a⋮a⋮', + _id: 'entity_zaz⋮_id⋮a⋮a⋮', PK: 'a', SK: 'a', - _e: 'entity_foo', - _idPK: 'entity_foo⋮_id⋮a⋮', + _e: 'entity_zaz', + _idPK: 'entity_zaz⋮_id⋮a⋮', _idSK: 'a', _c: expect.any(String), list: ['b', 'c', 'd', 'e'], @@ -542,7 +542,7 @@ describe('updateMany', () => { let mockApp: AppMock; let transporter: MongoTransporter; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: '_id', PK: ['.PK'], SK: ['.SK'] }], }; beforeEach(async () => { @@ -602,7 +602,7 @@ describe('deleteOne', () => { let mockApp: AppMock; let transporter: MongoTransporter; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: '_id', PK: ['.PK'], SK: ['.SK'] }], }; beforeEach(async () => { @@ -654,7 +654,7 @@ describe('deleteOne', () => { }, }); - expect(removed).toHaveProperty('item._id', 'entity_foo⋮_id⋮a⋮b⋮'); + expect(removed).toHaveProperty('item._id', 'entity_zaz⋮_id⋮a⋮b⋮'); const removed2 = await transporter.deleteOne({ indexConfig, @@ -719,7 +719,7 @@ describe('deleteMany', () => { let mockApp: AppMock; let transporter: MongoTransporter; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: '_id', PK: ['.PK'], SK: ['.SK'] }], }; @@ -839,7 +839,7 @@ describe('findMany', () => { let collection: Collection; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: 'PK', PK: ['.PK'], SK: ['.SK'] }], }; @@ -1001,7 +1001,7 @@ describe('findMany', () => { expect(spy).toBeCalledWith( { - _id: 'entity_foo⋮PK⋮users⋮B⋮', + _id: 'entity_zaz⋮PK⋮users⋮B⋮', }, { projection: ['sub.attr'], sort: { SK: 1 } } ); @@ -1039,11 +1039,11 @@ describe('findMany', () => { expect(sut.items).toHaveLength(3); expect(sut.items[0]).toEqual({ - _id: 'entity_foo⋮PK⋮users⋮D⋮', + _id: 'entity_zaz⋮PK⋮users⋮D⋮', sub: { attr: 4 }, }); expect(sut.items[1]).toEqual({ - _id: 'entity_foo⋮PK⋮users⋮C⋮', + _id: 'entity_zaz⋮PK⋮users⋮C⋮', sub: { attr: 3 }, }); @@ -1143,7 +1143,7 @@ describe('findOne', () => { let mockApp: AppMock; let transporter: MongoTransporter; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: '_id', PK: ['.PK'], SK: ['.SK'] }], }; @@ -1260,7 +1260,7 @@ describe('findById', () => { let mockApp: AppMock; let transporter: MongoTransporter; const indexConfig: AnyCollectionIndexConfig = { - entity: 'entity_foo', + entity: 'entity_zaz', indexes: [{ name: '_id', PK: ['.PK'], SK: ['.SK'] }], }; diff --git a/packages/plugin-engine/package.json b/packages/plugin-engine/package.json index e27c2d22..65d27814 100644 --- a/packages/plugin-engine/package.json +++ b/packages/plugin-engine/package.json @@ -1,6 +1,6 @@ { "name": "plugin-engine", - "version": "4.0.7", + "version": "4.0.10", "type": "module", "main": "./out/index.cjs", "module": "./out/index.mjs", diff --git a/packages/powership/package.json b/packages/powership/package.json index 7d6e66c8..afe69bd6 100644 --- a/packages/powership/package.json +++ b/packages/powership/package.json @@ -1,6 +1,6 @@ { "name": "powership", - "version": "4.0.7", + "version": "4.0.10", "author": "antoniopresto ", "type": "module", "main": "./out/index.cjs", diff --git a/packages/runmate/package.json b/packages/runmate/package.json index 33e64d20..2c1867c3 100644 --- a/packages/runmate/package.json +++ b/packages/runmate/package.json @@ -1,6 +1,6 @@ { "name": "runmate", - "version": "4.0.7", + "version": "4.0.10", "typings": "out", "author": "antoniopresto ", "license": "MIT", diff --git a/packages/runmate/src/handleJSON.ts b/packages/runmate/src/handleJSON.ts index 00615879..019cb399 100644 --- a/packages/runmate/src/handleJSON.ts +++ b/packages/runmate/src/handleJSON.ts @@ -6,14 +6,15 @@ import { nonNullValues } from '@powership/utils'; export function readPackageJSON(path: string): PackageJson { const packageJSON = fs.readJSONSync(path); try { - nonNullValues({ + nonNullValues( + { name: packageJSON?.name, - version: packageJSON.version + version: packageJSON.version, }, // `Invalid package found in "${path}"` - ) - }catch (e: any){ - console.error(e.message) + ); + } catch (e: any) { + console.error(e.message); } return packageJSON; } diff --git a/packages/schema/package.json b/packages/schema/package.json index 8d215929..71844ea8 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@powership/schema", - "version": "4.0.7", + "version": "4.0.10", "type": "module", "main": "./out/index.cjs", "module": "./out/index.mjs", diff --git a/packages/schema/src/GraphType/GraphType.ts b/packages/schema/src/GraphType/GraphType.ts index ed5e8b66..35e2fc77 100644 --- a/packages/schema/src/GraphType/GraphType.ts +++ b/packages/schema/src/GraphType/GraphType.ts @@ -13,7 +13,10 @@ import type { import type { GraphTypeLike } from '../fields/IObjectLike'; import type { ObjectFieldInput } from '../fields/_parseFields'; import * as Internal from '../internal'; -import type { ObjectToTypescriptOptions } from '../objectToTypescript'; +import { + objectToTypescript, + ObjectToTypescriptOptions, +} from '../objectToTypescript'; // @only-server import type { ConvertFieldResult, GraphQLParserResult } from './GraphQLParser'; @@ -268,7 +271,7 @@ export class GraphType { }); // @only-server - return Internal.objectToTypescript(name, object, options) as any; + return objectToTypescript(name, object, options) as any; }; optionalType = ( diff --git a/packages/schema/src/ObjectType.ts b/packages/schema/src/ObjectType.ts index 13ce798d..8d4cf26c 100644 --- a/packages/schema/src/ObjectType.ts +++ b/packages/schema/src/ObjectType.ts @@ -21,6 +21,8 @@ import type { FinalObjectDefinition, } from './fields/_parseFields'; import * as Internal from './internal'; +import { cleanMetaField } from './internal'; +import { objectToTypescript } from './objectToTypescript'; import { withCache, WithCache } from './withCache'; export class ObjectType< @@ -480,7 +482,7 @@ export class ObjectType< options?: Internal.ObjectToTypescriptOptions ): Promise => { // @only-server - return Internal.objectToTypescript( + return objectToTypescript( this.nonNullId, // @ts-ignore this, diff --git a/packages/schema/src/__tests__/FieldTypes.spec.ts b/packages/schema/src/__tests__/FieldTypes.spec.ts index 254ce085..c7154f2d 100644 --- a/packages/schema/src/__tests__/FieldTypes.spec.ts +++ b/packages/schema/src/__tests__/FieldTypes.spec.ts @@ -6,6 +6,7 @@ import type { CursorType } from '../fields/_fieldDefinitions'; import { objectToGQL } from '../objectToGQL'; import type { InferObjectDefinition } from '../fields/Infer'; +import { objectToTypescript } from '../objectToTypescript'; describe('FieldTypes', () => { const { createObjectType, createType } = Internal; @@ -600,10 +601,7 @@ describe('FieldTypes', () => { r3: '[record]?', }); // @only-server - const sut = await Internal.objectToTypescript( - 'records', - object.definition - ); + const sut = await objectToTypescript('records', object.definition); expect(sut).toEqual(''); }); diff --git a/packages/schema/src/createGraphQLSchema.ts b/packages/schema/src/createGraphQLSchema.ts index 44101ade..9b6fd16c 100644 --- a/packages/schema/src/createGraphQLSchema.ts +++ b/packages/schema/src/createGraphQLSchema.ts @@ -14,7 +14,10 @@ import { _resolvers, Resolver } from './Resolver'; import { cleanMetaField } from './fields/MetaFieldField'; import * as Internal from './internal'; import { objectMock, ObjectMockOptions } from './mockObject'; -import type { ObjectToTypescriptOptions } from './objectToTypescript'; +import { + objectToTypescript, + ObjectToTypescriptOptions, +} from './objectToTypescript'; export type CreateGraphQLObjectOptions = Partial; @@ -310,8 +313,9 @@ async function convertType(options: { const { description } = parsed; - // @ts-ignore circular // @only-server - const result = (await Internal.objectToTypescript( + // @ts-ignore circular + // @only-server + const result = (await objectToTypescript( entryName, { CONVERT__REPLACE: { diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index 693f9577..58f0ffb2 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -1,13 +1,13 @@ export * from './Infer'; export * from './TObjectConfig'; -export * from './ObjectType'; + export * from './fields/Infer'; export * from './Durable/IDurable'; export * from './CustomFieldConfig'; export * from './assertType'; export { objectMetaFieldKey } from './fields/MetaFieldField'; -export * from './GraphType/GraphType'; + export * from './fields/IObjectLike'; export * from './applyValidator'; export * from './mockObject'; @@ -19,6 +19,8 @@ export * from './extendType'; export * from './isHiddenFieldName'; export * from './createSimpleRouter'; +export * from './fields/_parseFields'; + // @only-server export * from './Resolver'; @@ -28,9 +30,59 @@ export * from './createGraphQLSchema'; // @only-server export type { ResolverKind } from './createGraphQLSchema'; -import * as Internal from './internal'; +import { createType, getType, GraphType } from './GraphType/GraphType'; +import type { + GraphTypeArgs, + LazyParseGraphTypePayload, +} from './GraphType/GraphType'; + +export { createType, getType, GraphType }; +export type { GraphTypeArgs, LazyParseGraphTypePayload }; + +import { + createObjectType, + ObjectType, + createPowershipObject, + PowershipObject, + createSchema, + resetTypesCache, +} from './ObjectType'; + +import type { ObjectTypeFromInput } from './ObjectType'; +export type { ObjectTypeFromInput }; + +export { + createObjectType, + ObjectType, + createPowershipObject, + PowershipObject, + createSchema, + resetTypesCache, +}; + +import { + parseObjectDefinition, + CACHED_FIELD_INSTANCE_KEY, + __getCachedFieldInstance, + deleteCachedFieldInstance, + isObjectAsTypeDefinition, + parseField, + parseFieldDefinitionConfig, + parseFlattenFieldDefinition, + parseObjectField, +} from './parseObjectDefinition'; -export { Internal }; +export { + parseObjectDefinition, + CACHED_FIELD_INSTANCE_KEY, + __getCachedFieldInstance, + deleteCachedFieldInstance, + isObjectAsTypeDefinition, + parseField, + parseFieldDefinitionConfig, + parseFlattenFieldDefinition, + parseObjectField, +}; -export * from './internal'; -export * from './__alias__'; +import type { ParseFieldOptions } from './parseObjectDefinition'; +export type { ParseFieldOptions }; diff --git a/packages/schema/src/internal.ts b/packages/schema/src/internal.ts index 6175dd1c..b67bc4e1 100644 --- a/packages/schema/src/internal.ts +++ b/packages/schema/src/internal.ts @@ -18,17 +18,6 @@ export async function formatWithPrettier( // @only-server export type { ObjectToTypescriptOptions } from './objectToTypescript'; -// @only-server -export async function objectToTypescript( - ...args: Parameters< - typeof import('./objectToTypescript')['objectToTypescript'] - > -) { - // too big - return import('./objectToTypescript').then(({ objectToTypescript }): any => { - return objectToTypescript(...args); - }); -} // @only-server export { parsePhoneNumber as parsePhoneNumberServerSide }; diff --git a/packages/schema/src/writeTypes.ts b/packages/schema/src/writeTypes.ts index c2424af2..bff99742 100644 --- a/packages/schema/src/writeTypes.ts +++ b/packages/schema/src/writeTypes.ts @@ -10,6 +10,7 @@ import { Resolver } from './Resolver'; import { GraphTypeLike } from './fields/IObjectLike'; import { LiteralField } from './fields/LiteralField'; import * as Internal from './internal'; +import { objectToTypescript } from './objectToTypescript'; const { serialize } = LiteralField.utils; @@ -118,10 +119,7 @@ export async function writeTypes(options?: WriteTypesOptions) { item.footer && head.push(...item.footer); }); // @only-server - const typesInterface = await Internal.objectToTypescript( - 'RuntimeTypes', - typesRecord - ); + const typesInterface = await objectToTypescript('RuntimeTypes', typesRecord); let definitions = Object.entries(typesRecord).reduce((acc, [id, next]) => { acc += `\n"${id}": ${serialize(next.definition)}\n;`; diff --git a/packages/server/package.json b/packages/server/package.json index 5e260074..43b0d884 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@powership/server", - "version": "4.0.7", + "version": "4.0.10", "type": "module", "main": "./out/index.cjs", "module": "./out/index.mjs", diff --git a/packages/server/src/graphql/generateTypes.ts b/packages/server/src/graphql/generateTypes.ts index a7982b60..48a34d67 100644 --- a/packages/server/src/graphql/generateTypes.ts +++ b/packages/server/src/graphql/generateTypes.ts @@ -1,4 +1,5 @@ -import { GraphQLSchemaWithUtils, Internal } from '@powership/schema'; +import { GraphQLSchemaWithUtils } from '@powership/schema'; +import { formatWithPrettier } from '@powership/schema/out/internal'; export let gql_utils = ''; @@ -11,7 +12,7 @@ export async function generateTypes( gql_utils = await schema.utils.generateClientUtils(); gql_utils = `${gql_utils}\n\n${extendedUtils}`; - gql_utils = await Internal.formatWithPrettier(gql_utils, { + gql_utils = await formatWithPrettier(gql_utils, { singleQuote: true, parser: 'typescript', }); diff --git a/packages/transporter/package.json b/packages/transporter/package.json index c4b9775c..c13fb952 100644 --- a/packages/transporter/package.json +++ b/packages/transporter/package.json @@ -1,6 +1,6 @@ { "name": "@powership/transporter", - "version": "4.0.7", + "version": "4.0.10", "type": "module", "main": "./out/index.cjs", "module": "./out/index.mjs", diff --git a/packages/utils/package.json b/packages/utils/package.json index 8e645a4b..5e15d57d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@powership/utils", - "version": "4.0.7", + "version": "4.0.10", "typings": "out", "author": "antoniopresto ", "license": "MIT", diff --git a/packages/utils/src/jsonToTypescript.ts b/packages/utils/src/jsonToTypescript.ts index ec583796..c967101a 100644 --- a/packages/utils/src/jsonToTypescript.ts +++ b/packages/utils/src/jsonToTypescript.ts @@ -1,6 +1,8 @@ import type { JSONSchema4 as JSONObject4 } from 'json-schema'; import type { JSONSchema4 } from 'json-schema'; import type { Options } from 'json-schema-to-typescript'; +//@only-server +import { compile } from 'json-schema-to-typescript'; export { JSONSchema4, JSONObject4 }; @@ -10,20 +12,5 @@ export async function jsonToTypescript( options: Partial = {} ): Promise { // @only-server - const json_ts = await dynamicRequire< - typeof import('json-schema-to-typescript') - >('json-schema-to-typescript'); - // @only-server - return await json_ts.compile(schema, name, options); -} - -async function dynamicRequire(name: string): Promise { - // @only-server - const text = `require('${name}');`; - /** - * Using "eval" to prevent webpack warning - * about "Import trace for requested module" - */ - // @only-server - return await eval(text); + return await compile(schema, name, options); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1be96add..68697fec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -325,136 +325,6 @@ importers: specifier: 2.8.8 version: 2.8.8 - packages/deepstate: - dependencies: - '@powership/schema': - specifier: workspace:* - version: link:../schema - '@powership/utils': - specifier: workspace:* - version: link:../utils - immer: - specifier: 10.0.2 - version: 10.0.2 - yjs: - specifier: 13.6.0 - version: 13.6.0 - devDependencies: - '@babel/cli': - specifier: 7.23.9 - version: 7.23.9(@babel/core@7.23.7) - '@babel/core': - specifier: 7.23.7 - version: 7.23.7 - '@babel/plugin-transform-typescript': - specifier: 7.23.6 - version: 7.23.6(@babel/core@7.23.7) - '@babel/preset-env': - specifier: 7.24.0 - version: 7.24.0(@babel/core@7.23.7) - '@babel/preset-typescript': - specifier: 7.23.3 - version: 7.23.3(@babel/core@7.23.7) - '@powership/babel-plugins': - specifier: workspace:* - version: link:../babel-plugins - '@powership/boilerplate': - specifier: workspace:* - version: link:../boilerplate - '@types/babel__core': - specifier: 7.20.5 - version: 7.20.5 - '@types/babel__helper-plugin-utils': - specifier: 7.10.0 - version: 7.10.0 - '@types/express': - specifier: 4.17.14 - version: 4.17.14 - '@types/jest': - specifier: 29.5.12 - version: 29.5.12 - '@types/json-schema': - specifier: 7.0.11 - version: 7.0.11 - '@types/lodash': - specifier: 4.14.191 - version: 4.14.191 - '@types/lodash-es': - specifier: 4.17.12 - version: 4.17.12 - '@types/node': - specifier: 20.11.25 - version: 20.11.25 - '@types/supertest': - specifier: 2.0.12 - version: 2.0.12 - '@typescript-eslint/eslint-plugin': - specifier: 7.1.1 - version: 7.1.1(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.2))(eslint@8.57.0)(typescript@5.4.2) - '@typescript-eslint/parser': - specifier: 7.1.1 - version: 7.1.1(eslint@8.57.0)(typescript@5.4.2) - babel-preset-minify: - specifier: 0.5.2 - version: 0.5.2 - conditional-type-checks: - specifier: 1.0.6 - version: 1.0.6 - esbuild: - specifier: 0.20.1 - version: 0.20.1 - eslint: - specifier: 8.57.0 - version: 8.57.0 - eslint-config-prettier: - specifier: 9.1.0 - version: 9.1.0(eslint@8.57.0) - eslint-plugin-eslint-comments: - specifier: 3.2.0 - version: 3.2.0(eslint@8.57.0) - eslint-plugin-import: - specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.2))(eslint@8.57.0) - eslint-plugin-sort-keys-fix: - specifier: 1.1.2 - version: 1.1.2 - eslint-plugin-typescript-sort-keys: - specifier: 3.2.0 - version: 3.2.0(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.2))(eslint@8.57.0)(typescript@5.4.2) - express: - specifier: 4.18.2 - version: 4.18.2 - graphql: - specifier: 16.8.1 - version: 16.8.1 - jest: - specifier: 29.7.0 - version: 29.7.0(@types/node@20.11.25)(ts-node@10.9.1(@types/node@20.11.25)(typescript@5.4.2)) - npm-run-all: - specifier: 4.1.5 - version: 4.1.5 - prettier: - specifier: 2.8.8 - version: 2.8.8 - prettier-plugin-multiline-arrays: - specifier: 3.0.4 - version: 3.0.4(prettier@2.8.8) - rimraf: - specifier: 5.0.5 - version: 5.0.5 - supertest: - specifier: 6.3.0 - version: 6.3.0 - ts-jest: - specifier: 29.1.2 - version: 29.1.2(@babel/core@7.23.7)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.7))(esbuild@0.20.1)(jest@29.7.0(@types/node@20.11.25)(ts-node@10.9.1(@types/node@20.11.25)(typescript@5.4.2)))(typescript@5.4.2) - typedoc: - specifier: 0.25.11 - version: 0.25.11(typescript@5.4.2) - typescript: - specifier: 5.4.2 - version: 5.4.2 - packages/entity: dependencies: '@powership/schema': @@ -3154,6 +3024,7 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -3161,6 +3032,7 @@ packages: '@humanwhocodes/object-schema@2.0.2': resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + deprecated: Use @eslint/object-schema instead '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -4063,6 +3935,7 @@ packages: bson@6.4.0: resolution: {integrity: sha512-6/gSSEdbkuFlSb+ufj5jUSU4+wo8xQOwm2bDSqwmxiPE17JTpsP63eAwoN8iF8Oy4gJYj+PAL3zdRCTdaw5Y1g==} engines: {node: '>=16.20.1'} + deprecated: a critical bug affecting zSeries s390x big-endian systems is fixed in bson@6.5.0 buffer-crc32@0.2.13: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} @@ -4086,8 +3959,8 @@ packages: bun-types@1.0.33: resolution: {integrity: sha512-L5tBIf9g6rBBkvshqysi5NoLQ9NnhSPU1pfJ9FzqoSfofYdyac3WLUnOIuQ+M5za/sooVUOP2ko+E6Tco0OLIA==} - bun-types@1.1.20: - resolution: {integrity: sha512-2u84HciDR3E7Uc0t0AEeXHmQAWe9uzRKTz120D3silIJOQlbGIMJMJiGaM8Yx7nEvMyfV0LfSdkEGnb77AN5AA==} + bun-types@1.1.24: + resolution: {integrity: sha512-UNEcYawHWOVw9GYQdOgjJvTQduYlPckmRMqpBqfkWpUzeK2CZfEP/JOYBH6SMypyfkNg/Zsqf0olN6vMrSPg3w==} bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} @@ -4872,6 +4745,7 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -5023,6 +4897,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -5143,9 +5018,6 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - isomorphic.js@0.2.5: - resolution: {integrity: sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==} - istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -5412,11 +5284,6 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lib0@0.2.91: - resolution: {integrity: sha512-LRcTp8RmdHexL8olb7qErdROnJ2L6Js5Am99WQo0hiTRDWtk6vyUJJjTB6I/RcW8jwNQshM3NqH598DdhSOajA==} - engines: {node: '>=16'} - hasBin: true - lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -6105,6 +5972,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rimraf@5.0.5: @@ -6354,6 +6222,7 @@ packages: superagent@8.1.2: resolution: {integrity: sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==} engines: {node: '>=6.4.0 <13 || >=14'} + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supertest@6.3.0: resolution: {integrity: sha512-QgWju1cNoacP81Rv88NKkQ4oXTzGg0eNZtOoxp1ROpbS4OHY/eK5b8meShuFtdni161o5X0VQvgo7ErVyKK+Ow==} @@ -6760,10 +6629,6 @@ packages: yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} - yjs@13.6.0: - resolution: {integrity: sha512-tFZtuQV6XamtDa9SfZhUsxchUcTBWe7fzpo1UWZDLXGejTZ5t9MCswGYzyvq7+BDzfEc9oX54QEbzI/4NyS6+g==} - engines: {node: '>=16.0.0', npm: '>=8.0.0'} - yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} @@ -6892,7 +6757,7 @@ snapshots: debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 7.6.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -10477,7 +10342,7 @@ snapshots: bun-safe@1.0.7: dependencies: - bun-types: 1.1.20 + bun-types: 1.1.24 bun-types@1.0.26: dependencies: @@ -10494,7 +10359,7 @@ snapshots: '@types/node': 20.11.25 '@types/ws': 8.5.10 - bun-types@1.1.20: + bun-types@1.1.24: dependencies: '@types/node': 20.12.14 '@types/ws': 8.5.10 @@ -11826,8 +11691,6 @@ snapshots: isexe@2.0.0: {} - isomorphic.js@0.2.5: {} - istanbul-lib-coverage@3.2.2: {} istanbul-lib-instrument@5.2.1: @@ -12481,10 +12344,6 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - lib0@0.2.91: - dependencies: - isomorphic.js: 0.2.5 - lines-and-columns@1.2.4: {} load-json-file@2.0.0: @@ -13899,10 +13758,6 @@ snapshots: buffer-crc32: 0.2.13 fd-slicer: 1.1.0 - yjs@13.6.0: - dependencies: - lib0: 0.2.91 - yn@3.1.1: {} yocto-queue@0.1.0: {}