ts-glitter 21.7.8 → 21.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/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/shopping-information.js +3 -0
- package/lowcode/cms-plugin/shopping-information.ts +3 -0
- package/lowcode/cms-plugin/shopping-order-manager.js +2 -2
- package/lowcode/cms-plugin/shopping-order-manager.ts +2 -2
- package/lowcode/glitterBundle/plugins/editor-elem.js +1 -1
- package/lowcode/glitterBundle/plugins/editor-elem.ts +1 -1
- package/package.json +2 -3
- package/src/api-public/services/checkout-event.js +7 -24
- package/src/api-public/services/checkout-event.js.map +1 -5
- package/src/api-public/services/checkout-event.ts +0 -7
- package/src/api-public/services/customer-sessions.js +0 -8
- package/src/api-public/services/customer-sessions.js.map +1 -1
- package/src/api-public/services/customer-sessions.ts +0 -8
- package/src/api-public/services/shopee.js +18 -21
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +11 -4
- package/src/api-public/services/shopping.js +6 -23
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +8 -28
- package/src/api-public/services/user.js +9 -20
- package/src/api-public/services/user.js.map +1 -5
- package/src/api-public/services/user.ts +2 -4
- package/src/index.js +8 -18
- package/src/index.js.map +1 -1
- package/src/index.ts +4 -1
- package/src/services/ses.d.ts +2 -0
- package/src/services/ses.js +28 -3
- package/src/services/ses.js.map +1 -1
- package/src/services/ses.ts +37 -3
|
@@ -3173,27 +3173,6 @@ export class Shopping {
|
|
|
3173
3173
|
await this.setOrderCustomizeTagConifg(update.orderData.tags);
|
|
3174
3174
|
}
|
|
3175
3175
|
|
|
3176
|
-
// 同步蝦皮商品
|
|
3177
|
-
await Promise.all(
|
|
3178
|
-
origin.orderData.lineItems.map(async (lineItem: any) => {
|
|
3179
|
-
const shopping = new Shopping(this.app, this.token);
|
|
3180
|
-
const shopee = new Shopee(this.app, this.token);
|
|
3181
|
-
|
|
3182
|
-
const pd = await shopping.getProduct({
|
|
3183
|
-
id: lineItem.id as string,
|
|
3184
|
-
page: 0,
|
|
3185
|
-
limit: 10,
|
|
3186
|
-
skip_shopee_check: true,
|
|
3187
|
-
});
|
|
3188
|
-
|
|
3189
|
-
if (pd.data?.shopee_id) {
|
|
3190
|
-
await shopee.asyncStockToShopee({
|
|
3191
|
-
product: pd.data,
|
|
3192
|
-
callback: () => {},
|
|
3193
|
-
});
|
|
3194
|
-
}
|
|
3195
|
-
})
|
|
3196
|
-
);
|
|
3197
3176
|
|
|
3198
3177
|
// 加入到索引欄位
|
|
3199
3178
|
await CheckoutService.updateAndMigrateToTableColumn({
|
|
@@ -4498,6 +4477,13 @@ export class Shopping {
|
|
|
4498
4477
|
`,
|
|
4499
4478
|
[{ content: JSON.stringify(content) }, content.id]
|
|
4500
4479
|
);
|
|
4480
|
+
// 同步更新蝦皮
|
|
4481
|
+
if (content.shopee_id) {
|
|
4482
|
+
await new Shopee(this.app, this.token).asyncStockToShopee({
|
|
4483
|
+
product: { content },
|
|
4484
|
+
callback: () => {},
|
|
4485
|
+
});
|
|
4486
|
+
}
|
|
4501
4487
|
} catch (error) {
|
|
4502
4488
|
console.error(error);
|
|
4503
4489
|
throw exception.BadRequestError('BAD_REQUEST', 'postVariantsAndPriceValue Error: ' + error, null);
|
|
@@ -5407,13 +5393,7 @@ export class Shopping {
|
|
|
5407
5393
|
// 更新商品 Variant
|
|
5408
5394
|
await new Shopping(this.app, this.token).postVariantsAndPriceValue(content);
|
|
5409
5395
|
|
|
5410
|
-
|
|
5411
|
-
if (content.shopee_id) {
|
|
5412
|
-
await new Shopee(this.app, this.token).asyncStockToShopee({
|
|
5413
|
-
product: { content },
|
|
5414
|
-
callback: () => {},
|
|
5415
|
-
});
|
|
5416
|
-
}
|
|
5396
|
+
|
|
5417
5397
|
|
|
5418
5398
|
return content.insertId;
|
|
5419
5399
|
} catch (e) {
|
|
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
35
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
27
|
};
|
|
@@ -1180,7 +1170,7 @@ class User {
|
|
|
1180
1170
|
(
|
|
1181
1171
|
SELECT MAX(shipment_date)
|
|
1182
1172
|
FROM \`${this.app}\`.t_checkout
|
|
1183
|
-
WHERE email = u.phone
|
|
1173
|
+
WHERE email = u.phone
|
|
1184
1174
|
)
|
|
1185
1175
|
BETWEEN ${startDate} AND ${endDate}
|
|
1186
1176
|
`;
|
|
@@ -1188,7 +1178,7 @@ class User {
|
|
|
1188
1178
|
(
|
|
1189
1179
|
SELECT MAX(shipment_date)
|
|
1190
1180
|
FROM \`${this.app}\`.t_checkout
|
|
1191
|
-
WHERE email = u.email
|
|
1181
|
+
WHERE email = u.email
|
|
1192
1182
|
)
|
|
1193
1183
|
BETWEEN ${startDate} AND ${endDate}
|
|
1194
1184
|
`;
|
|
@@ -1382,7 +1372,6 @@ class User {
|
|
|
1382
1372
|
user.last_order_total = user.last_order_total || 0;
|
|
1383
1373
|
user.order_count = user.order_count || 0;
|
|
1384
1374
|
user.total_amount = user.total_amount || 0;
|
|
1385
|
-
console.log('shipmentOrder', user.email);
|
|
1386
1375
|
const shipmentOrder = await _shopping.getCheckOut({
|
|
1387
1376
|
page: 0,
|
|
1388
1377
|
limit: 1,
|