diff --git a/package-lock.json b/package-lock.json index c37610c..5de8532 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,13 +8,13 @@ "name": "@restorecommerce/fulfillments-srv", "version": "0.2.5", "dependencies": { - "@restorecommerce/acs-client": "3.0.7", + "@restorecommerce/acs-client": "3.0.8", "@restorecommerce/cart": "^1.0.9", "@restorecommerce/chassis-srv": "1.6.4", "@restorecommerce/grpc-client": "^2.2.4", - "@restorecommerce/kafka-client": "1.2.20", + "@restorecommerce/kafka-client": "1.2.21", "@restorecommerce/logger": "^1.3.1", - "@restorecommerce/rc-grpc-clients": "^5.1.42", + "@restorecommerce/rc-grpc-clients": "^5.1.43", "@restorecommerce/resource-base-interface": "1.6.4", "@restorecommerce/service-config": "^1.0.15", "@types/soap": "0.18.0", @@ -1969,15 +1969,15 @@ } }, "node_modules/@restorecommerce/acs-client": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@restorecommerce/acs-client/-/acs-client-3.0.7.tgz", - "integrity": "sha512-ZXWItLckviszZDDa8kbL8aa9Fgm1tRgVSSnfVX6jShZyzV+JbccDYod7vmgzlno52JSfp34xmNJxGOS/zq5WYw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@restorecommerce/acs-client/-/acs-client-3.0.8.tgz", + "integrity": "sha512-GyRHqtrSv/sBtSYh2QWG513O5nubIKEw1lhI0nAZGk8AGBC4IoG8DgHCO/XPpIT5/SvAywoHabE3WEW6MVmznA==", "license": "MIT", "dependencies": { "@restorecommerce/grpc-client": "^2.2.5", - "@restorecommerce/kafka-client": "^1.2.20", + "@restorecommerce/kafka-client": "^1.2.21", "@restorecommerce/logger": "^1.3.2", - "@restorecommerce/rc-grpc-clients": "^5.1.42", + "@restorecommerce/rc-grpc-clients": "^5.1.43", "@restorecommerce/service-config": "^1.0.16", "deepdash": "^5.3.9", "lodash": "^4.17.21", @@ -2086,13 +2086,13 @@ } }, "node_modules/@restorecommerce/kafka-client": { - "version": "1.2.20", - "resolved": "https://registry.npmjs.org/@restorecommerce/kafka-client/-/kafka-client-1.2.20.tgz", - "integrity": "sha512-EFdgX7JxMZhxWuKgrxy+E6Z/XTVaE2cS/v99K/8nSwDG0ZDqHkKOFXGvBOqTv2X5HWjIAdWHjjZLB03n+89ydg==", + "version": "1.2.21", + "resolved": "https://registry.npmjs.org/@restorecommerce/kafka-client/-/kafka-client-1.2.21.tgz", + "integrity": "sha512-zBHmPJ6abPa5d0wQFZhIyTh+7XOmXFsvsFbP+8dn7ci4W0/B5M9vU7FY4PCP9HoJVvExolB1DOXyIXJu9YraKA==", "license": "MIT", "dependencies": { "@restorecommerce/logger": "^1.3.2", - "@restorecommerce/rc-grpc-clients": "^5.1.42", + "@restorecommerce/rc-grpc-clients": "^5.1.43", "async": "^3.2.6", "cls-rtracer": "^2.6.3", "events": "^3.3.0", @@ -2130,9 +2130,9 @@ "license": "MIT" }, "node_modules/@restorecommerce/rc-grpc-clients": { - "version": "5.1.42", - "resolved": "https://registry.npmjs.org/@restorecommerce/rc-grpc-clients/-/rc-grpc-clients-5.1.42.tgz", - "integrity": "sha512-6WZGgVrkDSGdUobETGR8+rFrANNL9JCk5vEFIJnV5gSl/RTNKVSSvCONiIfC6eT06NG3u0xRQQ9QU+lqBY3sHw==", + "version": "5.1.43", + "resolved": "https://registry.npmjs.org/@restorecommerce/rc-grpc-clients/-/rc-grpc-clients-5.1.43.tgz", + "integrity": "sha512-+laN74luKWEt4yxefPELgvDxpbYDKlMyzQ9/o0oaFyf0tkRt0YkM8FY6gtogJZ5XxqBfrhZw8B6XT9+j5MJlIg==", "license": "MIT", "dependencies": { "@grpc/grpc-js": "^1.12.2", diff --git a/package.json b/package.json index 1a3a726..1596c3c 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,13 @@ }, "type": "module", "dependencies": { - "@restorecommerce/acs-client": "3.0.7", + "@restorecommerce/acs-client": "3.0.8", "@restorecommerce/cart": "^1.0.9", - "@restorecommerce/chassis-srv": "1.6.4", + "@restorecommerce/chassis-srv": "^1.6.4", "@restorecommerce/grpc-client": "^2.2.4", - "@restorecommerce/kafka-client": "1.2.20", "@restorecommerce/logger": "^1.3.1", - "@restorecommerce/rc-grpc-clients": "^5.1.42", - "@restorecommerce/resource-base-interface": "1.6.4", + "@restorecommerce/rc-grpc-clients": "^5.1.43", + "@restorecommerce/resource-base-interface": "^1.6.4", "@restorecommerce/service-config": "^1.0.15", "@types/soap": "0.18.0", "@types/xml-js": "0.9.0", diff --git a/src/services/fulfillment.ts b/src/services/fulfillment.ts index 1a3678e..2d805a0 100644 --- a/src/services/fulfillment.ts +++ b/src/services/fulfillment.ts @@ -1056,7 +1056,7 @@ export class FulfillmentService ): Promise { try { await this.getFulfillmentsByIds( - request.items.map(item => item.id), + request.items?.map(item => item.id), request.subject, context, ).then( @@ -1065,8 +1065,8 @@ export class FulfillmentService throw response.operation_status; } else { - const result_map = new Map(response.items.map(item => [item.payload.id, item])); - request.items = request.items.map( + const result_map = new Map(response.items?.map(item => [item.payload.id, item])); + request.items = request.items?.map( item => ({ ...result_map.get(item.id)?.payload, ...item diff --git a/src/services/fulfillment_courier.ts b/src/services/fulfillment_courier.ts index 6aafe7b..92ab6ae 100644 --- a/src/services/fulfillment_courier.ts +++ b/src/services/fulfillment_courier.ts @@ -66,7 +66,7 @@ export class FulfillmentCourierService cfg.get('database:main:collections:1') ?? 'fulfillment_couriers', cfg.get('fieldHandlers:fulfillment_courier') ), - cfg.get('events:enableEvents')?.toString() === 'true' + cfg.get('events:enableEvents')?.toString() === 'true', ); } diff --git a/src/services/fulfillment_product.ts b/src/services/fulfillment_product.ts index 8832f17..79d6ebd 100644 --- a/src/services/fulfillment_product.ts +++ b/src/services/fulfillment_product.ts @@ -225,7 +225,7 @@ export class FulfillmentProductService cfg.get('database:main:collections:2') ?? 'fulfillment_products', cfg.get('fieldHandlers:fulfillment_product') ), - cfg.get('events:enableEvents')?.toString() === 'true' + cfg.get('events:enableEvents')?.toString() === 'true', ); this.status_codes = { @@ -559,7 +559,7 @@ export class FulfillmentProductService } const ids = [...new Set( - query.preferences?.courier_ids?.map(id => id) ?? [] + query.preferences?.fulfillment_product_ids?.map(id => id) ?? [] ).values()]; const call = ReadRequest.fromPartial({ filters: [{ diff --git a/src/utils.ts b/src/utils.ts index 6a06c4d..0141aaa 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -56,6 +56,7 @@ import { Status } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/status.js'; import { Attribute } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/attribute.js'; +import { PhysicalProduct, PhysicalVariant } from '@restorecommerce/rc-grpc-clients/dist/generated-server/io/restorecommerce/product.js'; export type CRUDClient = Client | Client diff --git a/src/worker.ts b/src/worker.ts index ca95498..6cf3edf 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -287,8 +287,9 @@ export class Worker { }); // start server + this.logger.info('Server starting...'); await this.server.start(); - this.logger.info('server started successfully'); + this.logger.info('Server started and ready to use.'); } async stop(): Promise {