@pinelab/vendure-plugin-qls-fulfillment 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/config/sync-products-scheduled-task.d.ts +5 -0
- package/dist/config/{full-product-sync-task.js → sync-products-scheduled-task.js} +9 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/services/qls-product.service.js +2 -2
- package/package.json +2 -2
- package/dist/config/full-product-sync-task.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# 1.1.3 (2026-01-28)
|
|
2
|
+
|
|
3
|
+
- Gracefully handle missing variants from incoming webhooks by logging instead of throwing an error.
|
|
4
|
+
|
|
5
|
+
# 1.1.2 (2026-01-14)
|
|
6
|
+
|
|
7
|
+
- Run scheduled full sync without job queue, because scheduled tasks already run in the worker only.
|
|
8
|
+
- Export scheduled task instead of automatically adding it to the config.
|
|
9
|
+
|
|
1
10
|
# 1.1.1 (2026-01-07)
|
|
2
11
|
|
|
3
12
|
- Ignoring non-existing order codes in order status updates, instead of throwing an error.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.qlsSyncAllProductsTask = void 0;
|
|
4
4
|
const core_1 = require("@vendure/core");
|
|
5
5
|
const qls_product_service_1 = require("../services/qls-product.service");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Synchronize all products to QLS for all channels, every day at 3:00 AM.
|
|
9
|
+
*/
|
|
10
|
+
exports.qlsSyncAllProductsTask = new core_1.ScheduledTask({
|
|
8
11
|
id: 'full-sync-qls-products',
|
|
9
12
|
description: 'Trigger a full sync of products to QLS',
|
|
10
13
|
params: {},
|
|
@@ -16,7 +19,7 @@ exports.fullProductSyncTask = new core_1.ScheduledTask({
|
|
|
16
19
|
apiType: 'admin',
|
|
17
20
|
});
|
|
18
21
|
const channels = await injector.get(core_1.ChannelService).findAll(ctx);
|
|
19
|
-
let
|
|
22
|
+
let fullSyncCompleted = 0;
|
|
20
23
|
for (const channel of channels.items) {
|
|
21
24
|
// Create ctx for channel
|
|
22
25
|
const channelCtx = new core_1.RequestContext({
|
|
@@ -32,11 +35,11 @@ exports.fullProductSyncTask = new core_1.ScheduledTask({
|
|
|
32
35
|
core_1.Logger.info(`QLS not enabled for channel ${channel.token}`, constants_1.loggerCtx);
|
|
33
36
|
continue;
|
|
34
37
|
}
|
|
35
|
-
await qlsProductService.
|
|
36
|
-
|
|
38
|
+
await qlsProductService.runFullSync(channelCtx);
|
|
39
|
+
fullSyncCompleted += 1;
|
|
37
40
|
}
|
|
38
41
|
return {
|
|
39
|
-
message: `
|
|
42
|
+
message: `Finnished full sync for ${fullSyncCompleted} channels`,
|
|
40
43
|
};
|
|
41
44
|
},
|
|
42
45
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./api/generated/graphql"), exports);
|
|
18
|
-
__exportStar(require("./config/
|
|
18
|
+
__exportStar(require("./config/sync-products-scheduled-task"), exports);
|
|
19
19
|
__exportStar(require("./custom-fields"), exports);
|
|
20
20
|
__exportStar(require("./lib/client-types"), exports);
|
|
21
21
|
__exportStar(require("./lib/qls-client"), exports);
|
|
@@ -261,13 +261,13 @@ let QlsProductService = class QlsProductService {
|
|
|
261
261
|
filter: { sku: { eq: sku } },
|
|
262
262
|
});
|
|
263
263
|
if (!result.items.length) {
|
|
264
|
-
|
|
264
|
+
return core_1.Logger.info(`Variant with sku '${sku}' not found, not updating stock`, constants_1.loggerCtx);
|
|
265
265
|
}
|
|
266
266
|
const variant = result.items[0];
|
|
267
267
|
if (result.items.length > 1) {
|
|
268
268
|
core_1.Logger.error(`Multiple variants found for sku '${sku}', using '${variant.id}'`, constants_1.loggerCtx);
|
|
269
269
|
}
|
|
270
|
-
|
|
270
|
+
await this.updateStock(ctx, variant.id, availableStock);
|
|
271
271
|
}
|
|
272
272
|
/**
|
|
273
273
|
* Determines if a product needs to be created or updated in QLS based on the given variant and existing QLS product.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinelab/vendure-plugin-qls-fulfillment",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Vendure plugin to fulfill orders via QLS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fulfillment",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"catch-unknown": "^2.0.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "66c42bd2e4a1e623049df0c17136a0eee58fa712"
|
|
36
36
|
}
|