diff --git a/package-lock.json b/package-lock.json index 02169661..643d26d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,8 +16,8 @@ "log4js": "6.3.0", "long": "5.2.0", "luxon": "2.2.0", - "nice-grpc": "1.0.4", - "nice-grpc-client-middleware-deadline": "1.0.4", + "nice-grpc": "1.0.6", + "nice-grpc-client-middleware-deadline": "1.0.6", "protobufjs": "6.8.8", "utility-types": "3.10.0" }, @@ -1154,9 +1154,9 @@ } }, "node_modules/@grpc/grpc-js": { - "version": "1.4.4", + "version": "1.5.5", "resolved": "https://gitpkg.now.sh/DavyJohnes/grpc-node/packages/grpc-js?fix-class-options-issue-with-dist", - "integrity": "sha512-RzhxaO5zpygPvFLKiWu24lb3lYlEdQBeZJAYlEgoB+OaqIZLFDeG/833v+lInxVYvPiNB/GMCfQrhktzsereiw==", + "integrity": "sha512-GrWZNWxbvWNKOWphkYZGiilHZvRHFzOyrSNTc52ZckQDVRG17obLd8L/eZPLZA+4OqHWLqiPSgA7cK3jqVKhkA==", "license": "Apache-2.0", "dependencies": { "@grpc/proto-loader": "^0.6.4", @@ -1166,16 +1166,16 @@ "node": "^8.13.0 || >=10.10.0" } }, - "node_modules/@grpc/grpc-js/node_modules/@grpc/proto-loader": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.7.tgz", - "integrity": "sha512-QzTPIyJxU0u+r2qGe8VMl3j/W2ryhEvBv7hc42OjYfthSj370fUrb7na65rG6w3YLZS/fb8p89iTBobfWGDgdw==", + "node_modules/@grpc/proto-loader": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.9.tgz", + "integrity": "sha512-UlcCS8VbsU9d3XTXGiEVFonN7hXk+oMXZtoHHG2oSA1/GcDP1q6OUgs20PzHDGizzyi8ufGSUDlk3O2NyY7leg==", "dependencies": { "@types/long": "^4.0.1", "lodash.camelcase": "^4.3.0", "long": "^4.0.0", "protobufjs": "^6.10.0", - "yargs": "^16.1.1" + "yargs": "^16.2.0" }, "bin": { "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" @@ -1184,12 +1184,12 @@ "node": ">=6" } }, - "node_modules/@grpc/grpc-js/node_modules/long": { + "node_modules/@grpc/proto-loader/node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, - "node_modules/@grpc/grpc-js/node_modules/protobufjs": { + "node_modules/@grpc/proto-loader/node_modules/protobufjs": { "version": "6.11.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", @@ -1214,7 +1214,7 @@ "pbts": "bin/pbts" } }, - "node_modules/@grpc/grpc-js/node_modules/yargs": { + "node_modules/@grpc/proto-loader/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", @@ -7401,22 +7401,22 @@ "dev": true }, "node_modules/nice-grpc": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-grpc/-/nice-grpc-1.0.4.tgz", - "integrity": "sha512-/1fAKywTdwHzVxt1Ski6120lx6S++RpGjXp7y0OUTZze4wHrwgC64xuuRTT6COz5BcX+Pch7gTc2m5fz7+M4nA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/nice-grpc/-/nice-grpc-1.0.6.tgz", + "integrity": "sha512-cRImN+SpnPaTAqWSbuU5ixq/wo1Jr1QOv0IZjmcb40XNU0og4JEyt7VCtTM7SAbeLAjdFxd65wiIid696kVTJA==", "dependencies": { - "@grpc/grpc-js": "^1.2.6", + "@grpc/grpc-js": "^1.5.1", "abort-controller-x": "^0.2.4", - "nice-grpc-common": "^1.0.3", + "nice-grpc-common": "^1.0.4", "node-abort-controller": "^1.2.1" } }, "node_modules/nice-grpc-client-middleware-deadline": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-grpc-client-middleware-deadline/-/nice-grpc-client-middleware-deadline-1.0.4.tgz", - "integrity": "sha512-IYLEzWkLI0ij41WVDLBjBJohmlh2cI+2ttMDawK8h7G209vrAndEJ4iiN9gQUqtguVzq4S3e8BzQgJ26hBMQtw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/nice-grpc-client-middleware-deadline/-/nice-grpc-client-middleware-deadline-1.0.6.tgz", + "integrity": "sha512-AokugSveg+2IPohuLbGR5OITgh3W4yZvAmLhuqistjwSRLchzQI4CwQEL1Tj4R0wscreSFoiHkXyG4qtKygOug==", "dependencies": { - "nice-grpc-common": "^1.0.3", + "nice-grpc-common": "^1.0.4", "node-abort-controller": "^2.0.0" } }, @@ -7426,9 +7426,9 @@ "integrity": "sha512-L8RfEgjBTHAISTuagw51PprVAqNZoG6KSB6LQ6H1bskMVkFs5E71IyjauLBv3XbuomJlguWF/VnRHdJ1gqiAqA==" }, "node_modules/nice-grpc-common": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/nice-grpc-common/-/nice-grpc-common-1.0.3.tgz", - "integrity": "sha512-bFETAyaUxcPgcNL6ZW+aOxzrBig9t/3I6ikKBw5dpxzthd9gfNPOG3W8+KPbIMxnHi6ANmbj57wwPoOI6m0qNg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-grpc-common/-/nice-grpc-common-1.0.4.tgz", + "integrity": "sha512-cpKGONNYqi2XP+5z4B4bzhLNrJu5lPbIScM0sqsht6sG9TgdN7ws3qCH82Fht94CfOifL6pQlvkgnEJp5nl2cQ==", "dependencies": { "node-abort-controller": "^2.0.0" } @@ -13645,24 +13645,24 @@ }, "@grpc/grpc-js": { "version": "https://gitpkg.now.sh/DavyJohnes/grpc-node/packages/grpc-js?fix-class-options-issue-with-dist", - "integrity": "sha512-RzhxaO5zpygPvFLKiWu24lb3lYlEdQBeZJAYlEgoB+OaqIZLFDeG/833v+lInxVYvPiNB/GMCfQrhktzsereiw==", + "integrity": "sha512-GrWZNWxbvWNKOWphkYZGiilHZvRHFzOyrSNTc52ZckQDVRG17obLd8L/eZPLZA+4OqHWLqiPSgA7cK3jqVKhkA==", "requires": { "@grpc/proto-loader": "^0.6.4", "@types/node": ">=12.12.47" + } + }, + "@grpc/proto-loader": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.9.tgz", + "integrity": "sha512-UlcCS8VbsU9d3XTXGiEVFonN7hXk+oMXZtoHHG2oSA1/GcDP1q6OUgs20PzHDGizzyi8ufGSUDlk3O2NyY7leg==", + "requires": { + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^6.10.0", + "yargs": "^16.2.0" }, "dependencies": { - "@grpc/proto-loader": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.7.tgz", - "integrity": "sha512-QzTPIyJxU0u+r2qGe8VMl3j/W2ryhEvBv7hc42OjYfthSj370fUrb7na65rG6w3YLZS/fb8p89iTBobfWGDgdw==", - "requires": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^6.10.0", - "yargs": "^16.1.1" - } - }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -18525,22 +18525,22 @@ "dev": true }, "nice-grpc": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-grpc/-/nice-grpc-1.0.4.tgz", - "integrity": "sha512-/1fAKywTdwHzVxt1Ski6120lx6S++RpGjXp7y0OUTZze4wHrwgC64xuuRTT6COz5BcX+Pch7gTc2m5fz7+M4nA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/nice-grpc/-/nice-grpc-1.0.6.tgz", + "integrity": "sha512-cRImN+SpnPaTAqWSbuU5ixq/wo1Jr1QOv0IZjmcb40XNU0og4JEyt7VCtTM7SAbeLAjdFxd65wiIid696kVTJA==", "requires": { - "@grpc/grpc-js": "^1.2.6", + "@grpc/grpc-js": "^1.5.1", "abort-controller-x": "^0.2.4", - "nice-grpc-common": "^1.0.3", + "nice-grpc-common": "^1.0.4", "node-abort-controller": "^1.2.1" } }, "nice-grpc-client-middleware-deadline": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/nice-grpc-client-middleware-deadline/-/nice-grpc-client-middleware-deadline-1.0.4.tgz", - "integrity": "sha512-IYLEzWkLI0ij41WVDLBjBJohmlh2cI+2ttMDawK8h7G209vrAndEJ4iiN9gQUqtguVzq4S3e8BzQgJ26hBMQtw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/nice-grpc-client-middleware-deadline/-/nice-grpc-client-middleware-deadline-1.0.6.tgz", + "integrity": "sha512-AokugSveg+2IPohuLbGR5OITgh3W4yZvAmLhuqistjwSRLchzQI4CwQEL1Tj4R0wscreSFoiHkXyG4qtKygOug==", "requires": { - "nice-grpc-common": "^1.0.3", + "nice-grpc-common": "^1.0.4", "node-abort-controller": "^2.0.0" }, "dependencies": { @@ -18552,9 +18552,9 @@ } }, "nice-grpc-common": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/nice-grpc-common/-/nice-grpc-common-1.0.3.tgz", - "integrity": "sha512-bFETAyaUxcPgcNL6ZW+aOxzrBig9t/3I6ikKBw5dpxzthd9gfNPOG3W8+KPbIMxnHi6ANmbj57wwPoOI6m0qNg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-grpc-common/-/nice-grpc-common-1.0.4.tgz", + "integrity": "sha512-cpKGONNYqi2XP+5z4B4bzhLNrJu5lPbIScM0sqsht6sG9TgdN7ws3qCH82Fht94CfOifL6pQlvkgnEJp5nl2cQ==", "requires": { "node-abort-controller": "^2.0.0" }, diff --git a/package.json b/package.json index 8d41cf1d..15c88c40 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ "log4js": "6.3.0", "long": "5.2.0", "luxon": "2.2.0", - "nice-grpc": "1.0.4", - "nice-grpc-client-middleware-deadline": "1.0.4", + "nice-grpc": "1.0.6", + "nice-grpc-client-middleware-deadline": "1.0.6", "protobufjs": "6.8.8", "utility-types": "3.10.0" }, diff --git a/src/service-endpoints.test.ts b/src/service-endpoints.test.ts index d3f485c4..e40b369a 100644 --- a/src/service-endpoints.test.ts +++ b/src/service-endpoints.test.ts @@ -21,13 +21,13 @@ describe('service endpoints', () => { const serviceName = 'myCustomService'; expect(() => { - getServiceClientEndpoint({ options: { serviceName } } as unknown as MockServiceClientCtor); + getServiceClientEndpoint({ serviceName } as unknown as MockServiceClientCtor); }).toThrow(`Endpoint for service ${serviceName} is no defined`); }); it('should throw exception if client class has no serviceName option', () => { expect(() => { - getServiceClientEndpoint({ options: {} } as unknown as MockServiceClientCtor); + getServiceClientEndpoint({} as unknown as MockServiceClientCtor); }).toThrow('Unable to retrieve serviceName of provided service client class'); }); }); diff --git a/src/service-endpoints.ts b/src/service-endpoints.ts index f9d3e010..726a8726 100644 --- a/src/service-endpoints.ts +++ b/src/service-endpoints.ts @@ -317,8 +317,7 @@ const SERVICE_ENDPOINTS_LIST: ServiceEndpointsList = [ export const getServiceClientEndpoint = (generatedClientCtor: GeneratedServiceClientCtor): string => { const clientCtor = generatedClientCtor as unknown as ServiceClientConstructor; - // eslint-disable-next-line prefer-destructuring - const serviceName: string = clientCtor.options.serviceName as string; + const serviceName: string = clientCtor.serviceName as string; if (!serviceName) { throw new Error('Unable to retrieve serviceName of provided service client class');