@pinelab/vendure-plugin-qls-fulfillment 1.8.0 → 1.8.1
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 +4 -0
- package/dist/custom-fields.js +0 -14
- package/dist/qls-plugin.js +0 -1
- package/dist/services/qls-product.service.js +9 -9
- package/dist/types.d.ts +6 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/custom-fields.js
CHANGED
|
@@ -15,20 +15,6 @@ function getVariantCustomFields(uiTab) {
|
|
|
15
15
|
readonly: true,
|
|
16
16
|
ui: { tab: uiTab },
|
|
17
17
|
},
|
|
18
|
-
{
|
|
19
|
-
name: 'qlsRawWarehouseStockData',
|
|
20
|
-
type: 'text',
|
|
21
|
-
label: [
|
|
22
|
-
{
|
|
23
|
-
value: 'QLS Raw Warehouse Stock Data',
|
|
24
|
-
languageCode: core_1.LanguageCode.en,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
nullable: true,
|
|
28
|
-
public: false,
|
|
29
|
-
readonly: true,
|
|
30
|
-
ui: { tab: uiTab },
|
|
31
|
-
},
|
|
32
18
|
];
|
|
33
19
|
}
|
|
34
20
|
exports.orderCustomFields = [
|
package/dist/qls-plugin.js
CHANGED
|
@@ -218,15 +218,15 @@ let QlsProductService = class QlsProductService {
|
|
|
218
218
|
else if (result.status === 'updated') {
|
|
219
219
|
updatedInQls.push(variant);
|
|
220
220
|
}
|
|
221
|
-
if (result.qlsProductId && this.options.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
});
|
|
221
|
+
if (result.qlsProductId && this.options.saveAdditionalData) {
|
|
222
|
+
try {
|
|
223
|
+
const qlsProduct = await client.getFulfillmentProductById(result.qlsProductId);
|
|
224
|
+
if (qlsProduct) {
|
|
225
|
+
await this.options.saveAdditionalData(ctx, new core_1.Injector(this.moduleRef), qlsProduct);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
core_1.Logger.error(`Error in saveAdditionalData for variant '${variant.sku}': ${(0, catch_unknown_1.asError)(e).message}`, constants_1.loggerCtx);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ID, Injector, Order, ProductVariant, RequestContext, SerializedRequestContext } from '@vendure/core';
|
|
2
|
-
import { CustomValue, FulfillmentOrderInput, FulfillmentOrderLineInput, FulfillmentProductInput } from './lib/client-types';
|
|
2
|
+
import { CustomValue, FulfillmentOrderInput, FulfillmentOrderLineInput, FulfillmentProduct, FulfillmentProductInput } from './lib/client-types';
|
|
3
3
|
export interface QlsPluginOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Get the QLS client config for the current channel based on given context
|
|
@@ -54,11 +54,12 @@ export interface QlsPluginOptions {
|
|
|
54
54
|
*/
|
|
55
55
|
qlsProductIdUiTab?: string | null;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
58
|
-
* the
|
|
59
|
-
*
|
|
57
|
+
* Optional hook called after syncing a variant to QLS.
|
|
58
|
+
* Receives the full QLS product, a RequestContext, and an Injector, allowing
|
|
59
|
+
* you to save any additional data to your own database. The saving itself
|
|
60
|
+
* happens inside this hook — if not provided, nothing is persisted.
|
|
60
61
|
*/
|
|
61
|
-
|
|
62
|
+
saveAdditionalData?: (ctx: RequestContext, injector: Injector, qlsProduct: FulfillmentProduct) => Promise<void> | void;
|
|
62
63
|
/**
|
|
63
64
|
* Additional order items to add to the QLS order.
|
|
64
65
|
*/
|