@pisell/pisellos 2.2.43 → 2.2.44

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.
@@ -25,6 +25,15 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
25
25
  setOtherProductsIds(ids: number[]): void;
26
26
  getOtherProductsIds(): number[];
27
27
  storeChange(): void;
28
+ /**
29
+ * 传入一个时间, 判断改时间是否在schedule 内
30
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
31
+ * @returns
32
+ */
33
+ isInScheduleByDate({ date, schedule, }: {
34
+ date: string;
35
+ schedule: any;
36
+ }): boolean | undefined;
28
37
  /**
29
38
  * 传入一个时间, 判断改时间是否在schedule 内
30
39
  * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
@@ -248,12 +248,28 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
248
248
  * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
249
249
  * @returns
250
250
  */
251
- }], [{
251
+ }, {
252
252
  key: "isInScheduleByDate",
253
253
  value: function isInScheduleByDate(_ref2) {
254
- var _schedule$repeat_rule, _schedule$repeat_rule2;
255
254
  var date = _ref2.date,
256
255
  schedule = _ref2.schedule;
256
+ return ScheduleModule.isInScheduleByDate({
257
+ date: date,
258
+ schedule: schedule
259
+ });
260
+ }
261
+
262
+ /**
263
+ * 传入一个时间, 判断改时间是否在schedule 内
264
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
265
+ * @returns
266
+ */
267
+ }], [{
268
+ key: "isInScheduleByDate",
269
+ value: function isInScheduleByDate(_ref3) {
270
+ var _schedule$repeat_rule, _schedule$repeat_rule2;
271
+ var date = _ref3.date,
272
+ schedule = _ref3.schedule;
257
273
  if (schedule.start_time && schedule.end_time) {
258
274
  var isBeforeStartTime = dayjs(date).isBefore(dayjs(schedule.start_time));
259
275
  var isAfterEndTime = dayjs(date).isAfter(dayjs(schedule.end_time));
@@ -1802,7 +1802,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1802
1802
  case 6:
1803
1803
  paymentItems = _context18.sent;
1804
1804
  if (!(!voucherPaymentItems || (voucherPaymentItems === null || voucherPaymentItems === void 0 ? void 0 : voucherPaymentItems.length) === 0)) {
1805
- _context18.next = 12;
1805
+ _context18.next = 13;
1806
1806
  break;
1807
1807
  }
1808
1808
  savedVoucherPaymentItems = (paymentItems === null || paymentItems === void 0 ? void 0 : paymentItems.filter(function (item) {
@@ -1813,22 +1813,23 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1813
1813
  savedVoucherPaymentItems: savedVoucherPaymentItems
1814
1814
  });
1815
1815
  if (!((savedVoucherPaymentItems === null || savedVoucherPaymentItems === void 0 ? void 0 : savedVoucherPaymentItems.length) === 0)) {
1816
- _context18.next = 12;
1816
+ _context18.next = 13;
1817
1817
  break;
1818
1818
  }
1819
+ this.updateStateAmountToRemaining(false);
1819
1820
  return _context18.abrupt("return");
1820
- case 12:
1821
+ case 13:
1821
1822
  allPaymentItemsSynced = paymentItems.every(function (item) {
1822
1823
  return item.isSynced;
1823
1824
  });
1824
- _context18.next = 15;
1825
+ _context18.next = 16;
1825
1826
  return this.calculateRemainingAmountAsync();
1826
- case 15:
1827
+ case 16:
1827
1828
  remainingAmount = _context18.sent;
1828
1829
  remainingValue = new Decimal(remainingAmount);
1829
1830
  isOrderSynced = this.store.isOrderSynced;
1830
1831
  if (!(remainingValue.lte(0) && isOrderSynced && voucherPaymentItems.length === 0 && allPaymentItemsSynced)) {
1831
- _context18.next = 21;
1832
+ _context18.next = 22;
1832
1833
  break;
1833
1834
  }
1834
1835
  this.logInfo('订单已同步且支付完成,跳过清空代金券操作避免重复同步:', {
@@ -1840,7 +1841,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1840
1841
  reason: 'Order synced and payment completed, skip clear vouchers to avoid duplicate sync'
1841
1842
  });
1842
1843
  return _context18.abrupt("return");
1843
- case 21:
1844
+ case 22:
1844
1845
  this.logInfo('开始批量更新代金券支付项:', {
1845
1846
  voucherPaymentItems: voucherPaymentItems
1846
1847
  });
@@ -1862,18 +1863,18 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1862
1863
  metadata: metadata
1863
1864
  });
1864
1865
  }); // 调用 Payment 模块的批量更新方法
1865
- _context18.next = 26;
1866
+ _context18.next = 27;
1866
1867
  return this.payment.updateVoucherPaymentItemsAsync(this.store.currentOrder.uuid, voucherPaymentItemsWithType);
1867
- case 26:
1868
+ case 27:
1868
1869
  // 🚀 清除计算缓存,确保获取最新数据
1869
1870
  this.clearCalculationCache();
1870
1871
 
1871
1872
  // 重新从Payment模块获取最新的订单数据,确保支付项同步
1872
1873
  currentOrderId = this.store.currentOrder.order_id; // 保存当前的订单ID
1873
1874
  isCurrentOrderReal = currentOrderId && !isVirtualOrderId(currentOrderId);
1874
- _context18.next = 31;
1875
+ _context18.next = 32;
1875
1876
  return this.payment.getPaymentOrderByUuidAsync(this.store.currentOrder.uuid);
1876
- case 31:
1877
+ case 32:
1877
1878
  updatedOrder = _context18.sent;
1878
1879
  if (updatedOrder) {
1879
1880
  // 如果当前订单ID是真实ID,但获取到的订单ID是虚拟ID,需要保护真实ID
@@ -1888,10 +1889,10 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1888
1889
  }
1889
1890
 
1890
1891
  // 更新 stateAmount 为剩余未支付金额
1891
- _context18.next = 35;
1892
+ _context18.next = 36;
1892
1893
  return this.updateStateAmountToRemaining(false);
1893
- case 35:
1894
- _context18.next = 37;
1894
+ case 36:
1895
+ _context18.next = 38;
1895
1896
  return this.core.effects.emit("".concat(this.name, ":onPaymentStarted"), {
1896
1897
  orderUuid: this.store.currentOrder.uuid,
1897
1898
  paymentMethodCode: 'VOUCHER_BATCH',
@@ -1900,23 +1901,23 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1900
1901
  }, 0).toFixed(2),
1901
1902
  timestamp: Date.now()
1902
1903
  });
1903
- case 37:
1904
+ case 38:
1904
1905
  this.logInfo('代金券支付项批量更新成功');
1905
- _context18.next = 46;
1906
+ _context18.next = 47;
1906
1907
  break;
1907
- case 40:
1908
- _context18.prev = 40;
1908
+ case 41:
1909
+ _context18.prev = 41;
1909
1910
  _context18.t0 = _context18["catch"](0);
1910
1911
  this.logError('[Checkout] 批量更新代金券支付项失败:', _context18.t0);
1911
- _context18.next = 45;
1912
+ _context18.next = 46;
1912
1913
  return this.handleError(_context18.t0, CheckoutErrorType.PaymentFailed);
1913
- case 45:
1914
- throw _context18.t0;
1915
1914
  case 46:
1915
+ throw _context18.t0;
1916
+ case 47:
1916
1917
  case "end":
1917
1918
  return _context18.stop();
1918
1919
  }
1919
- }, _callee18, this, [[0, 40]]);
1920
+ }, _callee18, this, [[0, 41]]);
1920
1921
  }));
1921
1922
  function updateVoucherPaymentItemsAsync(_x18) {
1922
1923
  return _updateVoucherPaymentItemsAsync.apply(this, arguments);
@@ -1012,13 +1012,351 @@ var webposConfig = {
1012
1012
  }
1013
1013
  };
1014
1014
 
1015
+ /**
1016
+ * webpos 租户登录 渠道配置
1017
+ */
1018
+ var shopWebposConfig = {
1019
+ sendEmailVerificationCode: {
1020
+ url: '/auth/email/register-code',
1021
+ method: 'GET',
1022
+ transformParams: function transformParams(params) {
1023
+ return {
1024
+ email: params.target
1025
+ };
1026
+ }
1027
+ },
1028
+ sendEmailLoginCode: {
1029
+ url: '/auth/send-email-code',
1030
+ method: 'POST',
1031
+ transformParams: function transformParams(params) {
1032
+ return {
1033
+ email: params.target,
1034
+ purpose: params.purpose,
1035
+ type: params.type
1036
+ };
1037
+ }
1038
+ },
1039
+ sendSmsRegisterCode: {
1040
+ url: '/auth/mobile/sms-register',
1041
+ method: 'POST',
1042
+ transformParams: function transformParams(params) {
1043
+ return {
1044
+ phone: String(params.phone),
1045
+ country_calling_code: String(params.country_calling_code)
1046
+ };
1047
+ }
1048
+ },
1049
+ sendEmailRegisterLink: {
1050
+ url: '/auth/email/link/new-send-register-link',
1051
+ method: 'POST',
1052
+ transformParams: function transformParams(email) {
1053
+ return {
1054
+ email: email
1055
+ };
1056
+ }
1057
+ },
1058
+ verifyEmailRegistrationLink: {
1059
+ url: '/auth/email/link/new-register',
1060
+ method: 'POST',
1061
+ transformParams: function transformParams(params) {
1062
+ return {
1063
+ code: params.code,
1064
+ password: params.password
1065
+ };
1066
+ }
1067
+ },
1068
+ emailPasswordLogin: {
1069
+ url: '/tenant/auth/login/email',
1070
+ method: 'POST',
1071
+ transformParams: function transformParams(params) {
1072
+ return {
1073
+ email: params.email,
1074
+ password: params.password,
1075
+ device: "webpos" + new Date().getTime()
1076
+ };
1077
+ },
1078
+ options: function options(values) {
1079
+ return {
1080
+ // withCredentials: true,
1081
+ prefix: false,
1082
+ cache: {
1083
+ mode: "remote_local",
1084
+ type: "indexDB",
1085
+ cacheKeyData: values
1086
+ }
1087
+ };
1088
+ }
1089
+ },
1090
+ emailCodeRegister: {
1091
+ url: '/auth/email/register',
1092
+ method: 'POST',
1093
+ transformParams: function transformParams(params) {
1094
+ return {
1095
+ email: params.email,
1096
+ code: params.code,
1097
+ password: params.password
1098
+ };
1099
+ }
1100
+ },
1101
+ phoneCodeRegister: {
1102
+ url: '/auth/mobile/register',
1103
+ method: 'POST',
1104
+ transformParams: function transformParams(params) {
1105
+ return {
1106
+ phone: String(params.phone),
1107
+ password: params.password,
1108
+ code: params.code,
1109
+ country_calling_code: String(params.country_calling_code)
1110
+ };
1111
+ }
1112
+ },
1113
+ resendEmailRegisterLink: {
1114
+ url: '/auth/email/link/resend_register_link',
1115
+ method: 'POST',
1116
+ transformParams: function transformParams(params) {
1117
+ return {
1118
+ code: params.code
1119
+ };
1120
+ }
1121
+ },
1122
+ checkEmailLinkCode: {
1123
+ url: '/auth/email/link/new-register-check-code',
1124
+ method: 'GET',
1125
+ transformParams: function transformParams(params) {
1126
+ return {
1127
+ code: params.code
1128
+ };
1129
+ }
1130
+ },
1131
+ sendSmsLoginCode: {
1132
+ url: '/auth/send-login-msg',
1133
+ method: 'POST',
1134
+ transformParams: function transformParams(params) {
1135
+ return {
1136
+ phone: String(params.phone),
1137
+ country_calling_code: String(params.country_calling_code)
1138
+ };
1139
+ }
1140
+ },
1141
+ phoneCodeLogin: {
1142
+ url: '/auth/mobile-login',
1143
+ method: 'POST',
1144
+ transformParams: function transformParams(params) {
1145
+ return {
1146
+ phone: String(params.phone),
1147
+ country_calling_code: String(params.country_calling_code),
1148
+ code: params.code
1149
+ };
1150
+ }
1151
+ },
1152
+ guestLogin: {
1153
+ url: '/auth/guest/login',
1154
+ method: 'POST',
1155
+ transformParams: function transformParams(params) {
1156
+ return {
1157
+ login_channel: params.login_channel,
1158
+ guest_code: params.guest_code
1159
+ };
1160
+ }
1161
+ },
1162
+ checkEmailExists: {
1163
+ url: '/auth/email/check-email',
1164
+ method: 'GET',
1165
+ transformParams: function transformParams(params) {
1166
+ return {
1167
+ email: params.email,
1168
+ sales_channel: 'online_store'
1169
+ };
1170
+ }
1171
+ },
1172
+ checkEmailCode: {
1173
+ url: '/auth/email/check-email-code',
1174
+ method: 'GET',
1175
+ transformParams: function transformParams(params) {
1176
+ return {
1177
+ email: params.email,
1178
+ code: params.code,
1179
+ action: params.action
1180
+ };
1181
+ }
1182
+ },
1183
+ checkMobileCode: {
1184
+ url: '/auth/mobile/check-mobile-code',
1185
+ method: 'GET',
1186
+ transformParams: function transformParams(params) {
1187
+ return {
1188
+ phone: String(params.phone),
1189
+ code: params.code,
1190
+ country_calling_code: String(params.country_calling_code),
1191
+ action: params.action
1192
+ };
1193
+ }
1194
+ },
1195
+ phonePasswordLogin: {
1196
+ url: '/auth/mobile/login',
1197
+ method: 'POST',
1198
+ transformParams: function transformParams(params) {
1199
+ return {
1200
+ phone: String(params.phone),
1201
+ password: params.password,
1202
+ country_calling_code: String(params.country_calling_code)
1203
+ };
1204
+ }
1205
+ },
1206
+ sendPasswordResetEmail: {
1207
+ url: '/auth/email/reset-password-code',
1208
+ method: 'GET',
1209
+ transformParams: function transformParams(params) {
1210
+ return {
1211
+ email: params.email
1212
+ };
1213
+ }
1214
+ },
1215
+ sendPasswordResetSms: {
1216
+ url: '/auth/mobile/sms-forget',
1217
+ method: 'POST',
1218
+ transformParams: function transformParams(params) {
1219
+ return {
1220
+ phone: String(params.phone),
1221
+ country_calling_code: String(params.country_calling_code)
1222
+ };
1223
+ }
1224
+ },
1225
+ sendResetPasswordLink: {
1226
+ url: '/auth/email/link/send_reset_pwd_link',
1227
+ method: 'POST',
1228
+ transformParams: function transformParams(params) {
1229
+ return {
1230
+ email: params.email
1231
+ };
1232
+ }
1233
+ },
1234
+ checkResetPasswordCode: {
1235
+ url: '/auth/email/link/check_code',
1236
+ method: 'GET',
1237
+ transformParams: function transformParams(params) {
1238
+ return {
1239
+ code: params.code
1240
+ };
1241
+ }
1242
+ },
1243
+ resetPasswordByCode: {
1244
+ url: '/auth/email/link/reset_pwd_by_code',
1245
+ method: 'POST',
1246
+ transformParams: function transformParams(params) {
1247
+ return {
1248
+ code: params.code,
1249
+ password: params.password
1250
+ };
1251
+ }
1252
+ },
1253
+ resetPasswordByEmail: {
1254
+ url: '/auth/email/reset-password',
1255
+ method: 'POST',
1256
+ transformParams: function transformParams(params) {
1257
+ return {
1258
+ email: params.email,
1259
+ password: params.password,
1260
+ code: params.code
1261
+ };
1262
+ }
1263
+ },
1264
+ resetPasswordByPhone: {
1265
+ url: '/auth/mobile/reset-password',
1266
+ method: 'POST',
1267
+ transformParams: function transformParams(params) {
1268
+ return {
1269
+ phone: String(params.phone),
1270
+ password: params.password,
1271
+ code: params.code,
1272
+ country_calling_code: String(params.country_calling_code)
1273
+ };
1274
+ }
1275
+ },
1276
+ verifyCode: {
1277
+ url: '/auth/verify-code',
1278
+ method: 'POST',
1279
+ transformParams: function transformParams(params) {
1280
+ return params;
1281
+ }
1282
+ },
1283
+ register: {
1284
+ url: '/auth/register',
1285
+ method: 'POST',
1286
+ transformParams: function transformParams(params) {
1287
+ return params;
1288
+ }
1289
+ },
1290
+ login: {
1291
+ url: '/auth/login',
1292
+ method: 'POST',
1293
+ transformParams: function transformParams(params) {
1294
+ return params;
1295
+ }
1296
+ },
1297
+ oauthLogin: {
1298
+ url: '/auth/oauth-login',
1299
+ method: 'POST',
1300
+ transformParams: function transformParams(params) {
1301
+ return params;
1302
+ }
1303
+ },
1304
+ validateToken: {
1305
+ url: '/auth/validate',
1306
+ method: 'GET',
1307
+ transformParams: function transformParams(token) {
1308
+ return {};
1309
+ },
1310
+ options: {
1311
+ headers: function headers(token) {
1312
+ return {
1313
+ Authorization: "Bearer ".concat(token)
1314
+ };
1315
+ }
1316
+ }
1317
+ },
1318
+ logout: {
1319
+ url: '/auth/logout',
1320
+ method: 'POST',
1321
+ transformParams: function transformParams() {
1322
+ return {};
1323
+ }
1324
+ },
1325
+ getCountries: {
1326
+ url: '/area/country',
1327
+ method: 'GET',
1328
+ transformParams: function transformParams() {
1329
+ return {};
1330
+ }
1331
+ },
1332
+ facebookLogin: {
1333
+ url: '/auth/facebook/login',
1334
+ method: 'POST',
1335
+ transformParams: function transformParams(params) {
1336
+ return {
1337
+ token: params.token
1338
+ };
1339
+ }
1340
+ },
1341
+ appleLogin: {
1342
+ url: '/auth/apple/login',
1343
+ method: 'POST',
1344
+ transformParams: function transformParams(params) {
1345
+ return {
1346
+ code: params.code
1347
+ };
1348
+ }
1349
+ }
1350
+ };
1351
+
1015
1352
  /**
1016
1353
  * 渠道配置映射
1017
1354
  */
1018
1355
  export var channelConfigMap = {
1019
1356
  'online-store': onlineStoreConfig,
1020
1357
  'default': defaultConfig,
1021
- 'webpos': webposConfig
1358
+ 'webpos': webposConfig,
1359
+ 'shop.webpos': shopWebposConfig
1022
1360
  };
1023
1361
 
1024
1362
  /**
@@ -25,6 +25,15 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
25
25
  setOtherProductsIds(ids: number[]): void;
26
26
  getOtherProductsIds(): number[];
27
27
  storeChange(): void;
28
+ /**
29
+ * 传入一个时间, 判断改时间是否在schedule 内
30
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
31
+ * @returns
32
+ */
33
+ isInScheduleByDate({ date, schedule, }: {
34
+ date: string;
35
+ schedule: any;
36
+ }): boolean | undefined;
28
37
  /**
29
38
  * 传入一个时间, 判断改时间是否在schedule 内
30
39
  * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
@@ -159,6 +159,17 @@ var ScheduleModule = class extends import_BaseModule.BaseModule {
159
159
  });
160
160
  }
161
161
  }
162
+ /**
163
+ * 传入一个时间, 判断改时间是否在schedule 内
164
+ * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
165
+ * @returns
166
+ */
167
+ isInScheduleByDate({
168
+ date,
169
+ schedule
170
+ }) {
171
+ return ScheduleModule.isInScheduleByDate({ date, schedule });
172
+ }
162
173
  /**
163
174
  * 传入一个时间, 判断改时间是否在schedule 内
164
175
  * @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
@@ -1214,8 +1214,10 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
1214
1214
  voucherPaymentItems,
1215
1215
  savedVoucherPaymentItems
1216
1216
  });
1217
- if ((savedVoucherPaymentItems == null ? void 0 : savedVoucherPaymentItems.length) === 0)
1217
+ if ((savedVoucherPaymentItems == null ? void 0 : savedVoucherPaymentItems.length) === 0) {
1218
+ this.updateStateAmountToRemaining(false);
1218
1219
  return;
1220
+ }
1219
1221
  }
1220
1222
  const allPaymentItemsSynced = paymentItems.every((item) => item.isSynced);
1221
1223
  const remainingAmount = await this.calculateRemainingAmountAsync();
@@ -796,10 +796,274 @@ var webposConfig = {
796
796
  })
797
797
  }
798
798
  };
799
+ var shopWebposConfig = {
800
+ sendEmailVerificationCode: {
801
+ url: "/auth/email/register-code",
802
+ method: "GET",
803
+ transformParams: (params) => ({
804
+ email: params.target
805
+ })
806
+ },
807
+ sendEmailLoginCode: {
808
+ url: "/auth/send-email-code",
809
+ method: "POST",
810
+ transformParams: (params) => ({
811
+ email: params.target,
812
+ purpose: params.purpose,
813
+ type: params.type
814
+ })
815
+ },
816
+ sendSmsRegisterCode: {
817
+ url: "/auth/mobile/sms-register",
818
+ method: "POST",
819
+ transformParams: (params) => ({
820
+ phone: String(params.phone),
821
+ country_calling_code: String(params.country_calling_code)
822
+ })
823
+ },
824
+ sendEmailRegisterLink: {
825
+ url: "/auth/email/link/new-send-register-link",
826
+ method: "POST",
827
+ transformParams: (email) => ({
828
+ email
829
+ })
830
+ },
831
+ verifyEmailRegistrationLink: {
832
+ url: "/auth/email/link/new-register",
833
+ method: "POST",
834
+ transformParams: (params) => ({
835
+ code: params.code,
836
+ password: params.password
837
+ })
838
+ },
839
+ emailPasswordLogin: {
840
+ url: "/tenant/auth/login/email",
841
+ method: "POST",
842
+ transformParams: (params) => ({
843
+ email: params.email,
844
+ password: params.password,
845
+ device: "webpos" + (/* @__PURE__ */ new Date()).getTime()
846
+ }),
847
+ options: (values) => ({
848
+ // withCredentials: true,
849
+ prefix: false,
850
+ cache: {
851
+ mode: "remote_local",
852
+ type: "indexDB",
853
+ cacheKeyData: values
854
+ }
855
+ })
856
+ },
857
+ emailCodeRegister: {
858
+ url: "/auth/email/register",
859
+ method: "POST",
860
+ transformParams: (params) => ({
861
+ email: params.email,
862
+ code: params.code,
863
+ password: params.password
864
+ })
865
+ },
866
+ phoneCodeRegister: {
867
+ url: "/auth/mobile/register",
868
+ method: "POST",
869
+ transformParams: (params) => ({
870
+ phone: String(params.phone),
871
+ password: params.password,
872
+ code: params.code,
873
+ country_calling_code: String(params.country_calling_code)
874
+ })
875
+ },
876
+ resendEmailRegisterLink: {
877
+ url: "/auth/email/link/resend_register_link",
878
+ method: "POST",
879
+ transformParams: (params) => ({
880
+ code: params.code
881
+ })
882
+ },
883
+ checkEmailLinkCode: {
884
+ url: "/auth/email/link/new-register-check-code",
885
+ method: "GET",
886
+ transformParams: (params) => ({
887
+ code: params.code
888
+ })
889
+ },
890
+ sendSmsLoginCode: {
891
+ url: "/auth/send-login-msg",
892
+ method: "POST",
893
+ transformParams: (params) => ({
894
+ phone: String(params.phone),
895
+ country_calling_code: String(params.country_calling_code)
896
+ })
897
+ },
898
+ phoneCodeLogin: {
899
+ url: "/auth/mobile-login",
900
+ method: "POST",
901
+ transformParams: (params) => ({
902
+ phone: String(params.phone),
903
+ country_calling_code: String(params.country_calling_code),
904
+ code: params.code
905
+ })
906
+ },
907
+ guestLogin: {
908
+ url: "/auth/guest/login",
909
+ method: "POST",
910
+ transformParams: (params) => ({
911
+ login_channel: params.login_channel,
912
+ guest_code: params.guest_code
913
+ })
914
+ },
915
+ checkEmailExists: {
916
+ url: "/auth/email/check-email",
917
+ method: "GET",
918
+ transformParams: (params) => ({
919
+ email: params.email,
920
+ sales_channel: "online_store"
921
+ })
922
+ },
923
+ checkEmailCode: {
924
+ url: "/auth/email/check-email-code",
925
+ method: "GET",
926
+ transformParams: (params) => ({
927
+ email: params.email,
928
+ code: params.code,
929
+ action: params.action
930
+ })
931
+ },
932
+ checkMobileCode: {
933
+ url: "/auth/mobile/check-mobile-code",
934
+ method: "GET",
935
+ transformParams: (params) => ({
936
+ phone: String(params.phone),
937
+ code: params.code,
938
+ country_calling_code: String(params.country_calling_code),
939
+ action: params.action
940
+ })
941
+ },
942
+ phonePasswordLogin: {
943
+ url: "/auth/mobile/login",
944
+ method: "POST",
945
+ transformParams: (params) => ({
946
+ phone: String(params.phone),
947
+ password: params.password,
948
+ country_calling_code: String(params.country_calling_code)
949
+ })
950
+ },
951
+ sendPasswordResetEmail: {
952
+ url: "/auth/email/reset-password-code",
953
+ method: "GET",
954
+ transformParams: (params) => ({
955
+ email: params.email
956
+ })
957
+ },
958
+ sendPasswordResetSms: {
959
+ url: "/auth/mobile/sms-forget",
960
+ method: "POST",
961
+ transformParams: (params) => ({
962
+ phone: String(params.phone),
963
+ country_calling_code: String(params.country_calling_code)
964
+ })
965
+ },
966
+ sendResetPasswordLink: {
967
+ url: "/auth/email/link/send_reset_pwd_link",
968
+ method: "POST",
969
+ transformParams: (params) => ({
970
+ email: params.email
971
+ })
972
+ },
973
+ checkResetPasswordCode: {
974
+ url: "/auth/email/link/check_code",
975
+ method: "GET",
976
+ transformParams: (params) => ({
977
+ code: params.code
978
+ })
979
+ },
980
+ resetPasswordByCode: {
981
+ url: "/auth/email/link/reset_pwd_by_code",
982
+ method: "POST",
983
+ transformParams: (params) => ({
984
+ code: params.code,
985
+ password: params.password
986
+ })
987
+ },
988
+ resetPasswordByEmail: {
989
+ url: "/auth/email/reset-password",
990
+ method: "POST",
991
+ transformParams: (params) => ({
992
+ email: params.email,
993
+ password: params.password,
994
+ code: params.code
995
+ })
996
+ },
997
+ resetPasswordByPhone: {
998
+ url: "/auth/mobile/reset-password",
999
+ method: "POST",
1000
+ transformParams: (params) => ({
1001
+ phone: String(params.phone),
1002
+ password: params.password,
1003
+ code: params.code,
1004
+ country_calling_code: String(params.country_calling_code)
1005
+ })
1006
+ },
1007
+ verifyCode: {
1008
+ url: "/auth/verify-code",
1009
+ method: "POST",
1010
+ transformParams: (params) => params
1011
+ },
1012
+ register: {
1013
+ url: "/auth/register",
1014
+ method: "POST",
1015
+ transformParams: (params) => params
1016
+ },
1017
+ login: {
1018
+ url: "/auth/login",
1019
+ method: "POST",
1020
+ transformParams: (params) => params
1021
+ },
1022
+ oauthLogin: {
1023
+ url: "/auth/oauth-login",
1024
+ method: "POST",
1025
+ transformParams: (params) => params
1026
+ },
1027
+ validateToken: {
1028
+ url: "/auth/validate",
1029
+ method: "GET",
1030
+ transformParams: (token) => ({}),
1031
+ options: {
1032
+ headers: (token) => ({
1033
+ Authorization: `Bearer ${token}`
1034
+ })
1035
+ }
1036
+ },
1037
+ logout: {
1038
+ url: "/auth/logout",
1039
+ method: "POST",
1040
+ transformParams: () => ({})
1041
+ },
1042
+ getCountries: {
1043
+ url: "/area/country",
1044
+ method: "GET",
1045
+ transformParams: () => ({})
1046
+ },
1047
+ facebookLogin: {
1048
+ url: "/auth/facebook/login",
1049
+ method: "POST",
1050
+ transformParams: (params) => ({
1051
+ token: params.token
1052
+ })
1053
+ },
1054
+ appleLogin: {
1055
+ url: "/auth/apple/login",
1056
+ method: "POST",
1057
+ transformParams: (params) => ({
1058
+ code: params.code
1059
+ })
1060
+ }
1061
+ };
799
1062
  var channelConfigMap = {
800
1063
  "online-store": onlineStoreConfig,
801
1064
  "default": defaultConfig,
802
- "webpos": webposConfig
1065
+ "webpos": webposConfig,
1066
+ "shop.webpos": shopWebposConfig
803
1067
  };
804
1068
  function getChannelConfig(channel) {
805
1069
  return channelConfigMap[channel] || channelConfigMap["default"];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.43",
4
+ "version": "2.2.44",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",