@pinelab/vendure-plugin-sendcloud 1.2.5 → 1.3.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 +8 -0
- package/dist/util/src/order-state-util.js +4 -5
- package/dist/util/src/raw-body.middleware.d.ts +0 -1
- package/dist/vendure-plugin-sendcloud/src/api/additional-parcel-input-items.js +2 -3
- package/dist/vendure-plugin-sendcloud/src/api/sendcloud-config.entity.js +2 -2
- package/dist/vendure-plugin-sendcloud/src/api/sendcloud.adapter.js +3 -4
- package/dist/vendure-plugin-sendcloud/src/api/sendcloud.controller.js +2 -2
- package/dist/vendure-plugin-sendcloud/src/api/sendcloud.resolver.js +2 -2
- package/dist/vendure-plugin-sendcloud/src/api/sendcloud.service.js +2 -2
- package/dist/vendure-plugin-sendcloud/src/sendcloud.plugin.js +4 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fulfillAll = fulfillAll;
|
|
4
|
+
exports.transitionToShipped = transitionToShipped;
|
|
5
|
+
exports.transitionToDelivered = transitionToDelivered;
|
|
6
|
+
exports.throwIfTransitionFailed = throwIfTransitionFailed;
|
|
4
7
|
/**
|
|
5
8
|
* Create a fulfillment for all orderlines. Returns fulfillments[0] if already fulfilled
|
|
6
9
|
*/
|
|
@@ -21,7 +24,6 @@ async function fulfillAll(ctx, orderService, order, handler) {
|
|
|
21
24
|
throwIfTransitionFailed(fulfillment);
|
|
22
25
|
return fulfillment;
|
|
23
26
|
}
|
|
24
|
-
exports.fulfillAll = fulfillAll;
|
|
25
27
|
/**
|
|
26
28
|
* Fulfills all items to shipped using transitionFulfillmentToState
|
|
27
29
|
*/
|
|
@@ -31,7 +33,6 @@ async function transitionToShipped(orderService, ctx, order, handler) {
|
|
|
31
33
|
throwIfTransitionFailed(result);
|
|
32
34
|
return result;
|
|
33
35
|
}
|
|
34
|
-
exports.transitionToShipped = transitionToShipped;
|
|
35
36
|
/**
|
|
36
37
|
* Fulfills all items to shipped, then to delivered using transitionFulfillmentToState
|
|
37
38
|
*/
|
|
@@ -53,7 +54,6 @@ async function transitionToDelivered(orderService, ctx, order, handler) {
|
|
|
53
54
|
}
|
|
54
55
|
return results;
|
|
55
56
|
}
|
|
56
|
-
exports.transitionToDelivered = transitionToDelivered;
|
|
57
57
|
/**
|
|
58
58
|
* Throws the error result if the transition failed
|
|
59
59
|
* Ignores transition errors where from and to state are the same,
|
|
@@ -71,4 +71,3 @@ function throwIfTransitionFailed(result) {
|
|
|
71
71
|
throw error;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
exports.throwIfTransitionFailed = throwIfTransitionFailed;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getNrOfOrders = getNrOfOrders;
|
|
4
|
+
exports.getCouponCodes = getCouponCodes;
|
|
4
5
|
const core_1 = require("@vendure/core");
|
|
5
6
|
/**
|
|
6
7
|
* Add nr of previously placed orders for this customer as parcelItem
|
|
@@ -27,7 +28,6 @@ async function getNrOfOrders(ctx, injector, order) {
|
|
|
27
28
|
value: '0',
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
exports.getNrOfOrders = getNrOfOrders;
|
|
31
31
|
/**
|
|
32
32
|
* Return couponCodes as Sendcloud parcelInputItem
|
|
33
33
|
*/
|
|
@@ -44,4 +44,3 @@ function getCouponCodes(order) {
|
|
|
44
44
|
value: '0',
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
exports.getCouponCodes = getCouponCodes;
|
|
@@ -17,6 +17,7 @@ let SendcloudConfigEntity = class SendcloudConfigEntity extends core_1.VendureEn
|
|
|
17
17
|
super(input);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
+
exports.SendcloudConfigEntity = SendcloudConfigEntity;
|
|
20
21
|
__decorate([
|
|
21
22
|
(0, typeorm_1.Column)({ unique: true }),
|
|
22
23
|
__metadata("design:type", String)
|
|
@@ -33,8 +34,7 @@ __decorate([
|
|
|
33
34
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
34
35
|
__metadata("design:type", String)
|
|
35
36
|
], SendcloudConfigEntity.prototype, "defaultPhoneNr", void 0);
|
|
36
|
-
SendcloudConfigEntity = __decorate([
|
|
37
|
+
exports.SendcloudConfigEntity = SendcloudConfigEntity = __decorate([
|
|
37
38
|
(0, typeorm_1.Entity)(),
|
|
38
39
|
__metadata("design:paramtypes", [Object])
|
|
39
40
|
], SendcloudConfigEntity);
|
|
40
|
-
exports.SendcloudConfigEntity = SendcloudConfigEntity;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toParcelInput = toParcelInput;
|
|
4
|
+
exports.toParcelInputItem = toParcelInputItem;
|
|
5
|
+
exports.getTotalWeight = getTotalWeight;
|
|
4
6
|
/**
|
|
5
7
|
* Transforms order and variants to ParcelInput
|
|
6
8
|
* @param order including lines, shippingaddress and customer
|
|
@@ -27,7 +29,6 @@ function toParcelInput(order, options, defaultPhoneNr) {
|
|
|
27
29
|
shipping_method_checkout_name: order.shippingLines?.[0].shippingMethod?.code,
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
|
-
exports.toParcelInput = toParcelInput;
|
|
31
32
|
function toParcelInputItem(line, options) {
|
|
32
33
|
const variant = line.productVariant;
|
|
33
34
|
let weightPerUnit = options.weightFn?.(line) || 0;
|
|
@@ -51,7 +52,6 @@ function toParcelInputItem(line, options) {
|
|
|
51
52
|
}
|
|
52
53
|
return parcelInput;
|
|
53
54
|
}
|
|
54
|
-
exports.toParcelInputItem = toParcelInputItem;
|
|
55
55
|
function getTotalWeight(items) {
|
|
56
56
|
let totalWeight = 0;
|
|
57
57
|
items.forEach((item) => {
|
|
@@ -59,4 +59,3 @@ function getTotalWeight(items) {
|
|
|
59
59
|
});
|
|
60
60
|
return totalWeight.toFixed(3);
|
|
61
61
|
}
|
|
62
|
-
exports.getTotalWeight = getTotalWeight;
|
|
@@ -64,6 +64,7 @@ let SendcloudController = class SendcloudController {
|
|
|
64
64
|
await this.sendcloudService.updateOrderStatus(ctx, status, body.parcel.order_number);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
+
exports.SendcloudController = SendcloudController;
|
|
67
68
|
__decorate([
|
|
68
69
|
(0, common_1.Post)('webhook/:channelToken'),
|
|
69
70
|
__param(0, (0, common_1.Req)()),
|
|
@@ -73,8 +74,7 @@ __decorate([
|
|
|
73
74
|
__metadata("design:paramtypes", [Object, String, String]),
|
|
74
75
|
__metadata("design:returntype", Promise)
|
|
75
76
|
], SendcloudController.prototype, "webhook", null);
|
|
76
|
-
SendcloudController = __decorate([
|
|
77
|
+
exports.SendcloudController = SendcloudController = __decorate([
|
|
77
78
|
(0, common_1.Controller)('sendcloud'),
|
|
78
79
|
__metadata("design:paramtypes", [sendcloud_service_1.SendcloudService])
|
|
79
80
|
], SendcloudController);
|
|
80
|
-
exports.SendcloudController = SendcloudController;
|
|
@@ -41,6 +41,7 @@ let SendcloudResolver = class SendcloudResolver {
|
|
|
41
41
|
return this.service.upsertConfig(ctx, input);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
+
exports.SendcloudResolver = SendcloudResolver;
|
|
44
45
|
__decorate([
|
|
45
46
|
(0, graphql_1.Mutation)(),
|
|
46
47
|
(0, core_1.Allow)(core_1.Permission.UpdateOrder),
|
|
@@ -67,9 +68,8 @@ __decorate([
|
|
|
67
68
|
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
68
69
|
__metadata("design:returntype", Promise)
|
|
69
70
|
], SendcloudResolver.prototype, "updateSendCloudConfig", null);
|
|
70
|
-
SendcloudResolver = __decorate([
|
|
71
|
+
exports.SendcloudResolver = SendcloudResolver = __decorate([
|
|
71
72
|
(0, graphql_1.Resolver)(),
|
|
72
73
|
__metadata("design:paramtypes", [sendcloud_service_1.SendcloudService,
|
|
73
74
|
core_1.OrderService])
|
|
74
75
|
], SendcloudResolver);
|
|
75
|
-
exports.SendcloudResolver = SendcloudResolver;
|
|
@@ -239,7 +239,8 @@ let SendcloudService = class SendcloudService {
|
|
|
239
239
|
}, false);
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
|
-
SendcloudService =
|
|
242
|
+
exports.SendcloudService = SendcloudService;
|
|
243
|
+
exports.SendcloudService = SendcloudService = __decorate([
|
|
243
244
|
(0, common_1.Injectable)(),
|
|
244
245
|
__param(6, (0, common_1.Inject)(constants_1.PLUGIN_OPTIONS)),
|
|
245
246
|
__metadata("design:paramtypes", [core_2.EventBus,
|
|
@@ -250,4 +251,3 @@ SendcloudService = __decorate([
|
|
|
250
251
|
core_1.ModuleRef, Object, core_2.EntityHydrator,
|
|
251
252
|
core_2.HistoryService])
|
|
252
253
|
], SendcloudService);
|
|
253
|
-
exports.SendcloudService = SendcloudService;
|
|
@@ -27,6 +27,7 @@ let SendcloudPlugin = SendcloudPlugin_1 = class SendcloudPlugin {
|
|
|
27
27
|
return SendcloudPlugin_1;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
+
exports.SendcloudPlugin = SendcloudPlugin;
|
|
30
31
|
SendcloudPlugin.ui = {
|
|
31
32
|
extensionPath: path_1.default.join(__dirname, 'ui'),
|
|
32
33
|
ngModules: [
|
|
@@ -43,7 +44,7 @@ SendcloudPlugin.ui = {
|
|
|
43
44
|
},
|
|
44
45
|
],
|
|
45
46
|
};
|
|
46
|
-
SendcloudPlugin = SendcloudPlugin_1 = __decorate([
|
|
47
|
+
exports.SendcloudPlugin = SendcloudPlugin = SendcloudPlugin_1 = __decorate([
|
|
47
48
|
(0, core_1.VendurePlugin)({
|
|
48
49
|
adminApiExtensions: {
|
|
49
50
|
schema: (0, graphql_tag_1.gql) `
|
|
@@ -75,7 +76,7 @@ SendcloudPlugin = SendcloudPlugin_1 = __decorate([
|
|
|
75
76
|
sendcloud_service_1.SendcloudService,
|
|
76
77
|
{
|
|
77
78
|
provide: constants_1.PLUGIN_OPTIONS,
|
|
78
|
-
useFactory: () =>
|
|
79
|
+
useFactory: () => SendcloudPlugin.options,
|
|
79
80
|
},
|
|
80
81
|
],
|
|
81
82
|
imports: [core_1.PluginCommonModule],
|
|
@@ -91,7 +92,6 @@ SendcloudPlugin = SendcloudPlugin_1 = __decorate([
|
|
|
91
92
|
config.authOptions.customPermissions.push(sendcloud_resolver_1.sendcloudPermission);
|
|
92
93
|
return config;
|
|
93
94
|
},
|
|
94
|
-
compatibility: '
|
|
95
|
+
compatibility: '>=2.2.0',
|
|
95
96
|
})
|
|
96
97
|
], SendcloudPlugin);
|
|
97
|
-
exports.SendcloudPlugin = SendcloudPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinelab/vendure-plugin-sendcloud",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Vendure plugin for syncing orders with SendCloud",
|
|
5
5
|
"author": "Martijn van de Brug <martijn@pinelab.studio>",
|
|
6
6
|
"homepage": "https://pinelab-plugins.com/",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"start": "yarn ts-node test/dev-server.ts",
|
|
24
24
|
"lint": "echo 'No linting configured'"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "2414f11eb04b280eea1a2c937a96dbf3696195dc"
|
|
27
27
|
}
|