diff --git a/libraries/grpc-sdk/package.json b/libraries/grpc-sdk/package.json index 56ccae1bc..4616cf404 100644 --- a/libraries/grpc-sdk/package.json +++ b/libraries/grpc-sdk/package.json @@ -78,7 +78,7 @@ "ts-node": "^10.9.2", "ts-proto": "^1.167.1", "tslib": "^2.6.3", - "typescript": "~5.3.3" + "typescript": "~5.6.2" }, "peerDependencies": { "@grpc/grpc-js": "^1.10.9" diff --git a/libraries/hermes/package.json b/libraries/hermes/package.json index c77520a03..b86bfaae6 100644 --- a/libraries/hermes/package.json +++ b/libraries/hermes/package.json @@ -64,6 +64,6 @@ "@types/node": "20.11.24", "@types/object-hash": "^3.0.6", "rimraf": "^5.0.5", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/libraries/hermes/src/Rest/util.ts b/libraries/hermes/src/Rest/util.ts index 9046f97ba..6ee7a6626 100644 --- a/libraries/hermes/src/Rest/util.ts +++ b/libraries/hermes/src/Rest/util.ts @@ -65,9 +65,9 @@ export function validateParams(params: Params, routeDefinedParams: Params) { if (routeDefinedParams[key].hasOwnProperty('type')) { params[key] = validateType( key, - routeDefinedParams[key].type, + (routeDefinedParams[key] as { type: string }).type, params[key], - routeDefinedParams[key]?.required || false, + (routeDefinedParams[key] as { required?: boolean })?.required || false, ); } else { validateObject(key, params[key], routeDefinedParams[key]); diff --git a/libraries/module-tools/package.json b/libraries/module-tools/package.json index 7f55da530..bfadef5b2 100644 --- a/libraries/module-tools/package.json +++ b/libraries/module-tools/package.json @@ -72,7 +72,7 @@ "ts-node": "^10.9.2", "ts-proto": "^1.167.1", "tslib": "^2.6.3", - "typescript": "~5.3.3" + "typescript": "~5.6.2" }, "peerDependencies": { "@conduitplatform/grpc-sdk": "*", diff --git a/libraries/node-2fa/package.json b/libraries/node-2fa/package.json index 097e8602d..0a2e3d676 100644 --- a/libraries/node-2fa/package.json +++ b/libraries/node-2fa/package.json @@ -34,6 +34,6 @@ "jest": "^29.7.0", "prettier": "^3.0.3", "ts-jest": "^29.1.2", - "typescript": "^5.3.3" + "typescript": "^5.6.2" } } diff --git a/libraries/testing-tools/package.json b/libraries/testing-tools/package.json index 580b2d52a..294711e8a 100644 --- a/libraries/testing-tools/package.json +++ b/libraries/testing-tools/package.json @@ -33,6 +33,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/authentication/package.json b/modules/authentication/package.json index 05c16dbe8..6748c6f68 100644 --- a/modules/authentication/package.json +++ b/modules/authentication/package.json @@ -54,6 +54,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/authentication/src/handlers/biometric.ts b/modules/authentication/src/handlers/biometric.ts index 7aad9dc56..751aef7c0 100644 --- a/modules/authentication/src/handlers/biometric.ts +++ b/modules/authentication/src/handlers/biometric.ts @@ -106,7 +106,7 @@ export class BiometricHandlers implements IAuthenticationStrategy { throw new GrpcError(status.INVALID_ARGUMENT, 'Key not found!'); } const verifier = crypto.createVerify('sha256WithRSAEncryption'); - verifier.update(Buffer.from((key.user as User)._id)); + verifier.update(new Uint8Array(Buffer.from((key.user as User)._id))); const cryptoKey = crypto.createPublicKey({ key: key.publicKey, format: 'der', @@ -177,7 +177,7 @@ export class BiometricHandlers implements IAuthenticationStrategy { user: user._id, }); const verifier = crypto.createVerify('sha256WithRSAEncryption'); - verifier.update(Buffer.from(existingToken.data.challenge)); + verifier.update(new Uint8Array(Buffer.from(existingToken.data.challenge))); const cryptoKey = crypto.createPublicKey({ key: existingToken.data.publicKey, format: 'der', diff --git a/modules/authorization/package.json b/modules/authorization/package.json index 6c7d0db85..7ed1d6492 100644 --- a/modules/authorization/package.json +++ b/modules/authorization/package.json @@ -52,6 +52,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/chat/package.json b/modules/chat/package.json index 1f62d0e6e..461c8b7e5 100644 --- a/modules/chat/package.json +++ b/modules/chat/package.json @@ -43,6 +43,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/database/package.json b/modules/database/package.json index 7096dc08e..5b0b583bf 100644 --- a/modules/database/package.json +++ b/modules/database/package.json @@ -55,6 +55,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/database/src/adapters/mongoose-adapter/utils.ts b/modules/database/src/adapters/mongoose-adapter/utils.ts index ea04cebac..771929ec0 100644 --- a/modules/database/src/adapters/mongoose-adapter/utils.ts +++ b/modules/database/src/adapters/mongoose-adapter/utils.ts @@ -41,6 +41,7 @@ async function _createWithPopulations( if (!fields.hasOwnProperty(key)) continue; if (!isObject(fields[key])) continue; + // @ts-expect-error if (fields[key] === 'JSON' || fields[key].type === 'JSON') continue; if (isArray(document[key])) { @@ -50,10 +51,14 @@ async function _createWithPopulations( continue; } let field = fields[key]; + // @ts-expect-error if (!isArray(field) && field.type && isArray(field.type)) { + // @ts-expect-error field = field.type; } + // @ts-expect-error if (field[0].hasOwnProperty('model')) { + // @ts-expect-error const { model } = adapter.getSchemaModel(field[0].model); if (validate) { await model.model.validate(val); @@ -61,11 +66,13 @@ async function _createWithPopulations( document[key][i] = await _createOrUpdate(val, model); } } else { + // @ts-expect-error await _createWithPopulations(field[0], val, adapter, validate); } } } else if (isObject(document[key])) { if (fields[key].hasOwnProperty('model')) { + // @ts-expect-error const { model } = adapter.getSchemaModel(fields[key].model); if (validate) { await model.model.validate(document[key]); diff --git a/modules/database/src/adapters/sequelize-adapter/utils/extractors/index.ts b/modules/database/src/adapters/sequelize-adapter/utils/extractors/index.ts index cbc5a3b35..dd8a87092 100644 --- a/modules/database/src/adapters/sequelize-adapter/utils/extractors/index.ts +++ b/modules/database/src/adapters/sequelize-adapter/utils/extractors/index.ts @@ -30,7 +30,9 @@ export function extractRelations(ogSchema: ConduitModel, schema: any) { } } } else if (isObject(schema[key])) { + // @ts-expect-error if (schema[key].hasOwnProperty('type') && schema[key].type === 'Relation') { + // @ts-expect-error extracted[key] = { ...schema[key] }; delete schema[key]; delete ogSchema[key]; diff --git a/modules/database/src/adapters/utils/database-transform-utils.ts b/modules/database/src/adapters/utils/database-transform-utils.ts index d2f6b86e5..6ec5768d0 100644 --- a/modules/database/src/adapters/utils/database-transform-utils.ts +++ b/modules/database/src/adapters/utils/database-transform-utils.ts @@ -121,6 +121,7 @@ export function extractFieldProperties( res.unique = objectField.unique ?? false; res.allowNull = false; } else if (objectField.hasOwnProperty('required') && objectField.required) { + // @ts-expect-error res.allowNull = !objectField.required ?? true; } diff --git a/modules/email/package.json b/modules/email/package.json index 288d51232..6f1d1b777 100644 --- a/modules/email/package.json +++ b/modules/email/package.json @@ -62,6 +62,6 @@ "rimraf": "^5.0.5", "smtp-server": "^3.11.0", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/forms/package.json b/modules/forms/package.json index 36ce424e7..5513d69b5 100644 --- a/modules/forms/package.json +++ b/modules/forms/package.json @@ -42,6 +42,6 @@ "@types/node": "20.11.24", "copyfiles": "^2.4.1", "rimraf": "^5.0.5", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/functions/package.json b/modules/functions/package.json index b34cfd8c7..2cde783b9 100644 --- a/modules/functions/package.json +++ b/modules/functions/package.json @@ -45,6 +45,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/push-notifications/package.json b/modules/push-notifications/package.json index fd91604dd..504eb9698 100644 --- a/modules/push-notifications/package.json +++ b/modules/push-notifications/package.json @@ -47,6 +47,6 @@ "copyfiles": "^2.4.1", "ts-proto": "^1.167.1", "rimraf": "^5.0.5", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/router/package.json b/modules/router/package.json index d375e08cb..ff1a4e2d1 100644 --- a/modules/router/package.json +++ b/modules/router/package.json @@ -53,6 +53,6 @@ "express": "~4.19.2", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/sms/package.json b/modules/sms/package.json index 5eacd031f..77d1a4348 100644 --- a/modules/sms/package.json +++ b/modules/sms/package.json @@ -47,6 +47,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/storage/package.json b/modules/storage/package.json index 66bed237b..2e71f7058 100644 --- a/modules/storage/package.json +++ b/modules/storage/package.json @@ -56,6 +56,6 @@ "copyfiles": "^2.4.1", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/modules/storage/src/providers/aws/index.ts b/modules/storage/src/providers/aws/index.ts index 1db985af9..3f8e7af72 100644 --- a/modules/storage/src/providers/aws/index.ts +++ b/modules/storage/src/providers/aws/index.ts @@ -72,7 +72,7 @@ export class AWSS3Storage implements IStorageProvider { const data = await streamToBuffer(stream.Body as Readable); if (downloadPath) { - fs.writeFileSync(downloadPath, data); + fs.writeFileSync(downloadPath, new Uint8Array(data)); } return data; } diff --git a/modules/storage/src/providers/azure/index.ts b/modules/storage/src/providers/azure/index.ts index 1a81f1380..3de3935c1 100644 --- a/modules/storage/src/providers/azure/index.ts +++ b/modules/storage/src/providers/azure/index.ts @@ -117,7 +117,7 @@ export class AzureStorage implements IStorageProvider { .download(0); const data: Buffer = await streamToBuffer(promise.readableStreamBody); if (downloadPath) { - fs.writeFileSync(downloadPath, data); + fs.writeFileSync(downloadPath, new Uint8Array(data)); } return data; } diff --git a/modules/storage/src/utils/index.ts b/modules/storage/src/utils/index.ts index 6b46f2ff8..d281f66fc 100644 --- a/modules/storage/src/utils/index.ts +++ b/modules/storage/src/utils/index.ts @@ -15,6 +15,8 @@ export async function streamToBuffer(readableStream: any): Promise { chunks.push(data instanceof Buffer ? data : Buffer.from(data)); }); readableStream.on('end', () => { + // shouldn't really provide an error + // @ts-expect-error resolve(Buffer.concat(chunks)); }); readableStream.on('error', reject); diff --git a/packages/admin/package.json b/packages/admin/package.json index cc698b648..cab5e1b94 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -56,6 +56,6 @@ "rimraf": "^5.0.5", "ts-jest": "^29.1.2", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/packages/commons/package.json b/packages/commons/package.json index 24911e39f..3d18b5d13 100644 --- a/packages/commons/package.json +++ b/packages/commons/package.json @@ -41,6 +41,6 @@ "express": "~4.19.2", "rimraf": "^5.0.5", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/packages/core/package.json b/packages/core/package.json index 72f94355d..091873744 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -43,6 +43,6 @@ "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "ts-proto": "^1.167.1", - "typescript": "~5.3.3" + "typescript": "~5.6.2" } } diff --git a/yarn.lock b/yarn.lock index bf477ad03..452b293e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15454,10 +15454,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -"typescript@>=3 < 6", "typescript@^4.6.4 || ^5.0.0", typescript@^5.3.3, typescript@~5.3.3: - version "5.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" - integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== +"typescript@>=3 < 6", "typescript@^4.6.4 || ^5.0.0", typescript@^5.6.2, typescript@~5.6.2: + version "5.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0" + integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw== uglify-js@^3.1.4: version "3.17.4"