@pisell/pisellos 2.2.5 → 2.2.7

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.
Files changed (44) hide show
  1. package/dist/modules/Customer/index.js +7 -1
  2. package/dist/modules/Order/index.js +4 -4
  3. package/dist/modules/Order/types.d.ts +1 -0
  4. package/dist/modules/Product/index.d.ts +1 -1
  5. package/dist/modules/ProductList/index.js +11 -3
  6. package/dist/plugins/request.d.ts +1 -0
  7. package/dist/plugins/request.js +1 -1
  8. package/dist/solution/BookingByStep/index.d.ts +22 -2
  9. package/dist/solution/BookingByStep/index.js +502 -29
  10. package/dist/solution/BookingByStep/utils/capacity.d.ts +7 -2
  11. package/dist/solution/BookingByStep/utils/capacity.js +24 -8
  12. package/dist/solution/RegisterAndLogin/config.d.ts +87 -0
  13. package/dist/solution/RegisterAndLogin/config.js +1140 -0
  14. package/dist/solution/RegisterAndLogin/index.d.ts +189 -0
  15. package/dist/solution/RegisterAndLogin/index.js +2667 -0
  16. package/dist/solution/RegisterAndLogin/types.d.ts +445 -0
  17. package/dist/solution/RegisterAndLogin/types.js +231 -0
  18. package/dist/solution/RegisterAndLogin/utils.d.ts +95 -0
  19. package/dist/solution/RegisterAndLogin/utils.js +322 -0
  20. package/dist/solution/ShopDiscount/index.js +27 -9
  21. package/dist/solution/index.d.ts +1 -0
  22. package/dist/solution/index.js +1 -0
  23. package/lib/modules/Customer/index.js +7 -1
  24. package/lib/modules/Order/index.js +5 -2
  25. package/lib/modules/Order/types.d.ts +1 -0
  26. package/lib/modules/Product/index.d.ts +1 -1
  27. package/lib/modules/ProductList/index.js +10 -2
  28. package/lib/plugins/request.d.ts +1 -0
  29. package/lib/solution/BookingByStep/index.d.ts +22 -2
  30. package/lib/solution/BookingByStep/index.js +321 -42
  31. package/lib/solution/BookingByStep/utils/capacity.d.ts +7 -2
  32. package/lib/solution/BookingByStep/utils/capacity.js +21 -8
  33. package/lib/solution/RegisterAndLogin/config.d.ts +87 -0
  34. package/lib/solution/RegisterAndLogin/config.js +866 -0
  35. package/lib/solution/RegisterAndLogin/index.d.ts +189 -0
  36. package/lib/solution/RegisterAndLogin/index.js +1593 -0
  37. package/lib/solution/RegisterAndLogin/types.d.ts +445 -0
  38. package/lib/solution/RegisterAndLogin/types.js +78 -0
  39. package/lib/solution/RegisterAndLogin/utils.d.ts +95 -0
  40. package/lib/solution/RegisterAndLogin/utils.js +279 -0
  41. package/lib/solution/ShopDiscount/index.js +9 -0
  42. package/lib/solution/index.d.ts +1 -0
  43. package/lib/solution/index.js +2 -0
  44. package/package.json +1 -1
@@ -0,0 +1,1140 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
7
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ /**
14
+ * 注册登录解决方案配置
15
+ * 根据不同渠道配置不同的接口地址和参数
16
+ */
17
+
18
+ /**
19
+ * API 配置接口
20
+ */
21
+
22
+ /**
23
+ * 渠道配置接口
24
+ */
25
+
26
+ /**
27
+ * online-store 渠道配置
28
+ */
29
+ var onlineStoreConfig = {
30
+ sendEmailVerificationCode: {
31
+ url: '/auth/email/register-code',
32
+ method: 'GET',
33
+ transformParams: function transformParams(params) {
34
+ return {
35
+ email: params.target
36
+ };
37
+ }
38
+ },
39
+ sendEmailLoginCode: {
40
+ url: '/auth/send-email-code',
41
+ method: 'POST',
42
+ transformParams: function transformParams(params) {
43
+ return {
44
+ email: params.target,
45
+ purpose: params.purpose,
46
+ type: params.type
47
+ };
48
+ }
49
+ },
50
+ sendSmsRegisterCode: {
51
+ url: '/auth/mobile/sms-register',
52
+ method: 'POST',
53
+ transformParams: function transformParams(params) {
54
+ return {
55
+ phone: String(params.phone),
56
+ country_calling_code: String(params.country_calling_code)
57
+ };
58
+ }
59
+ },
60
+ sendEmailRegisterLink: {
61
+ url: '/auth/email/link/new-send-register-link',
62
+ method: 'POST',
63
+ transformParams: function transformParams(email) {
64
+ return {
65
+ email: email
66
+ };
67
+ }
68
+ },
69
+ verifyEmailRegistrationLink: {
70
+ url: '/auth/email/link/new-register',
71
+ method: 'POST',
72
+ transformParams: function transformParams(params) {
73
+ return {
74
+ code: params.code,
75
+ password: params.password
76
+ };
77
+ }
78
+ },
79
+ emailPasswordLogin: {
80
+ url: '/auth/email/login',
81
+ method: 'POST',
82
+ transformParams: function transformParams(params) {
83
+ return {
84
+ email: params.email,
85
+ password: params.password
86
+ };
87
+ },
88
+ options: {
89
+ withCredentials: true
90
+ }
91
+ },
92
+ emailCodeRegister: {
93
+ url: '/auth/email/register',
94
+ method: 'POST',
95
+ transformParams: function transformParams(params) {
96
+ return {
97
+ email: params.email,
98
+ code: params.code,
99
+ password: params.password
100
+ };
101
+ }
102
+ },
103
+ phoneCodeRegister: {
104
+ url: '/auth/mobile/register',
105
+ method: 'POST',
106
+ transformParams: function transformParams(params) {
107
+ return {
108
+ phone: String(params.phone),
109
+ password: params.password,
110
+ code: params.code,
111
+ country_calling_code: String(params.country_calling_code)
112
+ };
113
+ }
114
+ },
115
+ resendEmailRegisterLink: {
116
+ url: '/auth/email/link/resend_register_link',
117
+ method: 'POST',
118
+ transformParams: function transformParams(params) {
119
+ return {
120
+ code: params.code
121
+ };
122
+ }
123
+ },
124
+ checkEmailLinkCode: {
125
+ url: '/auth/email/link/new-register-check-code',
126
+ method: 'GET',
127
+ transformParams: function transformParams(params) {
128
+ return {
129
+ code: params.code
130
+ };
131
+ }
132
+ },
133
+ sendSmsLoginCode: {
134
+ url: '/auth/send-login-msg',
135
+ method: 'POST',
136
+ transformParams: function transformParams(params) {
137
+ return {
138
+ phone: String(params.phone),
139
+ country_calling_code: String(params.country_calling_code)
140
+ };
141
+ }
142
+ },
143
+ phoneCodeLogin: {
144
+ url: '/auth/mobile-login',
145
+ method: 'POST',
146
+ transformParams: function transformParams(params) {
147
+ return {
148
+ phone: String(params.phone),
149
+ country_calling_code: String(params.country_calling_code),
150
+ code: params.code
151
+ };
152
+ }
153
+ },
154
+ guestLogin: {
155
+ url: '/auth/guest/login',
156
+ method: 'POST',
157
+ transformParams: function transformParams(params) {
158
+ return {
159
+ login_channel: params.login_channel,
160
+ guest_code: params.guest_code
161
+ };
162
+ }
163
+ },
164
+ checkEmailExists: {
165
+ url: '/auth/email/check-email',
166
+ method: 'GET',
167
+ transformParams: function transformParams(params) {
168
+ return {
169
+ email: params.email,
170
+ sales_channel: 'online_store'
171
+ };
172
+ }
173
+ },
174
+ checkEmailCode: {
175
+ url: '/auth/email/check-email-code',
176
+ method: 'GET',
177
+ transformParams: function transformParams(params) {
178
+ return {
179
+ email: params.email,
180
+ code: params.code,
181
+ action: params.action
182
+ };
183
+ }
184
+ },
185
+ checkMobileCode: {
186
+ url: '/auth/mobile/check-mobile-code',
187
+ method: 'GET',
188
+ transformParams: function transformParams(params) {
189
+ return {
190
+ phone: String(params.phone),
191
+ code: params.code,
192
+ country_calling_code: String(params.country_calling_code),
193
+ action: params.action
194
+ };
195
+ }
196
+ },
197
+ phonePasswordLogin: {
198
+ url: '/auth/mobile/login',
199
+ method: 'POST',
200
+ transformParams: function transformParams(params) {
201
+ return {
202
+ phone: String(params.phone),
203
+ password: params.password,
204
+ country_calling_code: String(params.country_calling_code)
205
+ };
206
+ }
207
+ },
208
+ sendPasswordResetEmail: {
209
+ url: '/auth/email/reset-password-code',
210
+ method: 'GET',
211
+ transformParams: function transformParams(params) {
212
+ return {
213
+ email: params.email
214
+ };
215
+ }
216
+ },
217
+ sendPasswordResetSms: {
218
+ url: '/auth/mobile/sms-forget',
219
+ method: 'POST',
220
+ transformParams: function transformParams(params) {
221
+ return {
222
+ phone: String(params.phone),
223
+ country_calling_code: String(params.country_calling_code)
224
+ };
225
+ }
226
+ },
227
+ sendResetPasswordLink: {
228
+ url: '/auth/email/link/send_reset_pwd_link',
229
+ method: 'POST',
230
+ transformParams: function transformParams(params) {
231
+ return {
232
+ email: params.email
233
+ };
234
+ }
235
+ },
236
+ checkResetPasswordCode: {
237
+ url: '/auth/email/link/check_code',
238
+ method: 'GET',
239
+ transformParams: function transformParams(params) {
240
+ return {
241
+ code: params.code
242
+ };
243
+ }
244
+ },
245
+ resetPasswordByCode: {
246
+ url: '/auth/email/link/reset_pwd_by_code',
247
+ method: 'POST',
248
+ transformParams: function transformParams(params) {
249
+ return {
250
+ code: params.code,
251
+ password: params.password
252
+ };
253
+ }
254
+ },
255
+ resetPasswordByEmail: {
256
+ url: '/auth/email/reset-password',
257
+ method: 'POST',
258
+ transformParams: function transformParams(params) {
259
+ return {
260
+ email: params.email,
261
+ password: params.password,
262
+ code: params.code
263
+ };
264
+ }
265
+ },
266
+ resetPasswordByPhone: {
267
+ url: '/auth/mobile/reset-password',
268
+ method: 'POST',
269
+ transformParams: function transformParams(params) {
270
+ return {
271
+ phone: String(params.phone),
272
+ password: params.password,
273
+ code: params.code,
274
+ country_calling_code: String(params.country_calling_code)
275
+ };
276
+ }
277
+ },
278
+ verifyCode: {
279
+ url: '/auth/verify-code',
280
+ method: 'POST',
281
+ transformParams: function transformParams(params) {
282
+ return params;
283
+ }
284
+ },
285
+ register: {
286
+ url: '/auth/register',
287
+ method: 'POST',
288
+ transformParams: function transformParams(params) {
289
+ return params;
290
+ }
291
+ },
292
+ login: {
293
+ url: '/auth/login',
294
+ method: 'POST',
295
+ transformParams: function transformParams(params) {
296
+ return params;
297
+ }
298
+ },
299
+ oauthLogin: {
300
+ url: '/auth/oauth-login',
301
+ method: 'POST',
302
+ transformParams: function transformParams(params) {
303
+ return params;
304
+ }
305
+ },
306
+ validateToken: {
307
+ url: '/auth/validate',
308
+ method: 'GET',
309
+ transformParams: function transformParams(token) {
310
+ return {};
311
+ },
312
+ options: {
313
+ headers: function headers(token) {
314
+ return {
315
+ Authorization: "Bearer ".concat(token)
316
+ };
317
+ }
318
+ }
319
+ },
320
+ logout: {
321
+ url: '/auth/logout',
322
+ method: 'POST',
323
+ transformParams: function transformParams() {
324
+ return {};
325
+ }
326
+ },
327
+ getCountries: {
328
+ url: '/area/country',
329
+ method: 'GET',
330
+ transformParams: function transformParams() {
331
+ return {};
332
+ }
333
+ },
334
+ facebookLogin: {
335
+ url: '/auth/facebook/login',
336
+ method: 'POST',
337
+ transformParams: function transformParams(params) {
338
+ return {
339
+ token: params.token
340
+ };
341
+ }
342
+ },
343
+ appleLogin: {
344
+ url: '/auth/apple/login',
345
+ method: 'POST',
346
+ transformParams: function transformParams(params) {
347
+ return {
348
+ code: params.code
349
+ };
350
+ }
351
+ }
352
+ };
353
+
354
+ /**
355
+ * 默认配置(通用配置)
356
+ */
357
+ var defaultConfig = {
358
+ sendEmailVerificationCode: {
359
+ url: '/auth/send-email-code',
360
+ method: 'POST',
361
+ transformParams: function transformParams(params) {
362
+ return {
363
+ email: params.target,
364
+ purpose: params.purpose,
365
+ type: params.type
366
+ };
367
+ }
368
+ },
369
+ sendEmailLoginCode: {
370
+ url: '/auth/send-email-code',
371
+ method: 'POST',
372
+ transformParams: function transformParams(params) {
373
+ return {
374
+ email: params.target,
375
+ purpose: params.purpose,
376
+ type: params.type
377
+ };
378
+ }
379
+ },
380
+ sendSmsRegisterCode: {
381
+ url: '/auth/send-sms-register',
382
+ method: 'POST',
383
+ transformParams: function transformParams(params) {
384
+ return {
385
+ phone: String(params.phone),
386
+ country_calling_code: String(params.country_calling_code)
387
+ };
388
+ }
389
+ },
390
+ sendEmailRegisterLink: {
391
+ url: '/auth/send-email-register-link',
392
+ method: 'POST',
393
+ transformParams: function transformParams(email) {
394
+ return {
395
+ email: email
396
+ };
397
+ }
398
+ },
399
+ verifyEmailRegistrationLink: {
400
+ url: '/auth/verify-email-registration-link',
401
+ method: 'POST',
402
+ transformParams: function transformParams(code) {
403
+ return {
404
+ code: code
405
+ };
406
+ }
407
+ },
408
+ emailPasswordLogin: {
409
+ url: '/auth/email-password-login',
410
+ method: 'POST',
411
+ transformParams: function transformParams(params) {
412
+ return {
413
+ email: params.email,
414
+ password: params.password
415
+ };
416
+ }
417
+ },
418
+ emailCodeRegister: {
419
+ url: '/auth/email/register',
420
+ method: 'POST',
421
+ transformParams: function transformParams(params) {
422
+ return {
423
+ email: params.email,
424
+ code: params.code,
425
+ password: params.password
426
+ };
427
+ }
428
+ },
429
+ phoneCodeRegister: {
430
+ url: '/auth/mobile/register',
431
+ method: 'POST',
432
+ transformParams: function transformParams(params) {
433
+ return {
434
+ phone: String(params.phone),
435
+ password: params.password,
436
+ code: params.code,
437
+ country_calling_code: String(params.country_calling_code)
438
+ };
439
+ }
440
+ },
441
+ resendEmailRegisterLink: {
442
+ url: '/auth/resend-email-register-link',
443
+ method: 'POST',
444
+ transformParams: function transformParams(params) {
445
+ return {
446
+ code: params.code
447
+ };
448
+ }
449
+ },
450
+ checkEmailLinkCode: {
451
+ url: '/email/link/check_code',
452
+ method: 'GET',
453
+ transformParams: function transformParams(params) {
454
+ return {
455
+ code: params.code
456
+ };
457
+ }
458
+ },
459
+ sendSmsLoginCode: {
460
+ url: '/auth/send-sms-login-code',
461
+ method: 'POST',
462
+ transformParams: function transformParams(params) {
463
+ return {
464
+ phone: String(params.phone),
465
+ country_calling_code: String(params.country_calling_code)
466
+ };
467
+ }
468
+ },
469
+ phoneCodeLogin: {
470
+ url: '/auth/phone-code-login',
471
+ method: 'POST',
472
+ transformParams: function transformParams(params) {
473
+ return {
474
+ phone: String(params.phone),
475
+ country_calling_code: String(params.country_calling_code),
476
+ code: params.code
477
+ };
478
+ }
479
+ },
480
+ guestLogin: {
481
+ url: '/auth/guest-login',
482
+ method: 'POST',
483
+ transformParams: function transformParams(channel) {
484
+ return {
485
+ login_channel: channel
486
+ };
487
+ }
488
+ },
489
+ checkEmailExists: {
490
+ url: '/auth/check-email-exists',
491
+ method: 'GET',
492
+ transformParams: function transformParams(params) {
493
+ return {
494
+ email: params.email
495
+ };
496
+ }
497
+ },
498
+ checkEmailCode: {
499
+ url: '/auth/check-email-code',
500
+ method: 'GET',
501
+ transformParams: function transformParams(params) {
502
+ return {
503
+ email: params.email,
504
+ code: params.code
505
+ };
506
+ }
507
+ },
508
+ checkMobileCode: {
509
+ url: '/auth/check-mobile-code',
510
+ method: 'GET',
511
+ transformParams: function transformParams(params) {
512
+ return {
513
+ phone: String(params.phone),
514
+ code: params.code,
515
+ country_calling_code: String(params.country_calling_code),
516
+ action: params.action
517
+ };
518
+ }
519
+ },
520
+ phonePasswordLogin: {
521
+ url: '/auth/mobile-password-login',
522
+ method: 'POST',
523
+ transformParams: function transformParams(params) {
524
+ return {
525
+ phone: String(params.phone),
526
+ password: params.password,
527
+ country_calling_code: String(params.country_calling_code)
528
+ };
529
+ }
530
+ },
531
+ sendPasswordResetEmail: {
532
+ url: '/auth/send-password-reset-email',
533
+ method: 'GET',
534
+ transformParams: function transformParams(params) {
535
+ return {
536
+ email: params.email
537
+ };
538
+ }
539
+ },
540
+ sendPasswordResetSms: {
541
+ url: '/auth/send-password-reset-sms',
542
+ method: 'POST',
543
+ transformParams: function transformParams(params) {
544
+ return {
545
+ phone: String(params.phone),
546
+ country_calling_code: String(params.country_calling_code)
547
+ };
548
+ }
549
+ },
550
+ sendResetPasswordLink: {
551
+ url: '/auth/send-reset-password-link',
552
+ method: 'POST',
553
+ transformParams: function transformParams(params) {
554
+ return {
555
+ email: params.email
556
+ };
557
+ }
558
+ },
559
+ checkResetPasswordCode: {
560
+ url: '/auth/check-reset-password-code',
561
+ method: 'GET',
562
+ transformParams: function transformParams(params) {
563
+ return {
564
+ code: params.code
565
+ };
566
+ }
567
+ },
568
+ resetPasswordByCode: {
569
+ url: '/auth/reset-password-by-code',
570
+ method: 'GET',
571
+ transformParams: function transformParams(params) {
572
+ return {
573
+ code: params.code,
574
+ password: params.password
575
+ };
576
+ }
577
+ },
578
+ resetPasswordByEmail: {
579
+ url: '/auth/reset-password-email',
580
+ method: 'POST',
581
+ transformParams: function transformParams(params) {
582
+ return {
583
+ email: params.email,
584
+ password: params.password,
585
+ code: params.code
586
+ };
587
+ }
588
+ },
589
+ resetPasswordByPhone: {
590
+ url: '/auth/reset-password-phone',
591
+ method: 'POST',
592
+ transformParams: function transformParams(params) {
593
+ return {
594
+ phone: String(params.phone),
595
+ password: params.password,
596
+ code: params.code,
597
+ country_calling_code: String(params.country_calling_code)
598
+ };
599
+ }
600
+ },
601
+ verifyCode: {
602
+ url: '/auth/verify-code',
603
+ method: 'POST',
604
+ transformParams: function transformParams(params) {
605
+ return params;
606
+ }
607
+ },
608
+ register: {
609
+ url: '/auth/register',
610
+ method: 'POST',
611
+ transformParams: function transformParams(params) {
612
+ return params;
613
+ }
614
+ },
615
+ login: {
616
+ url: '/auth/login',
617
+ method: 'POST',
618
+ transformParams: function transformParams(params) {
619
+ return params;
620
+ }
621
+ },
622
+ oauthLogin: {
623
+ url: '/auth/oauth-login',
624
+ method: 'POST',
625
+ transformParams: function transformParams(params) {
626
+ return params;
627
+ }
628
+ },
629
+ validateToken: {
630
+ url: '/auth/validate',
631
+ method: 'GET',
632
+ transformParams: function transformParams(token) {
633
+ return {};
634
+ },
635
+ options: {
636
+ headers: function headers(token) {
637
+ return {
638
+ Authorization: "Bearer ".concat(token)
639
+ };
640
+ }
641
+ }
642
+ },
643
+ logout: {
644
+ url: '/auth/logout',
645
+ method: 'POST',
646
+ transformParams: function transformParams() {
647
+ return {};
648
+ }
649
+ },
650
+ getCountries: {
651
+ url: '/auth/countries',
652
+ method: 'GET',
653
+ transformParams: function transformParams() {
654
+ return {};
655
+ }
656
+ },
657
+ facebookLogin: {
658
+ url: '/auth/facebook/login',
659
+ method: 'POST',
660
+ transformParams: function transformParams(params) {
661
+ return {
662
+ token: params.token
663
+ };
664
+ }
665
+ },
666
+ appleLogin: {
667
+ url: '/auth/apple/login',
668
+ method: 'POST',
669
+ transformParams: function transformParams(params) {
670
+ return {
671
+ code: params.code
672
+ };
673
+ }
674
+ }
675
+ };
676
+
677
+ /**
678
+ * webpos 渠道配置
679
+ */
680
+ var webposConfig = {
681
+ sendEmailVerificationCode: {
682
+ url: '/auth/email/register-code',
683
+ method: 'GET',
684
+ transformParams: function transformParams(params) {
685
+ return {
686
+ email: params.target
687
+ };
688
+ }
689
+ },
690
+ sendEmailLoginCode: {
691
+ url: '/auth/send-email-code',
692
+ method: 'POST',
693
+ transformParams: function transformParams(params) {
694
+ return {
695
+ email: params.target,
696
+ purpose: params.purpose,
697
+ type: params.type
698
+ };
699
+ }
700
+ },
701
+ sendSmsRegisterCode: {
702
+ url: '/auth/mobile/sms-register',
703
+ method: 'POST',
704
+ transformParams: function transformParams(params) {
705
+ return {
706
+ phone: String(params.phone),
707
+ country_calling_code: String(params.country_calling_code)
708
+ };
709
+ }
710
+ },
711
+ sendEmailRegisterLink: {
712
+ url: '/auth/email/link/new-send-register-link',
713
+ method: 'POST',
714
+ transformParams: function transformParams(email) {
715
+ return {
716
+ email: email
717
+ };
718
+ }
719
+ },
720
+ verifyEmailRegistrationLink: {
721
+ url: '/auth/email/link/new-register',
722
+ method: 'POST',
723
+ transformParams: function transformParams(params) {
724
+ return {
725
+ code: params.code,
726
+ password: params.password
727
+ };
728
+ }
729
+ },
730
+ emailPasswordLogin: {
731
+ url: '/tenant/auth/login/email',
732
+ method: 'POST',
733
+ transformParams: function transformParams(params) {
734
+ return {
735
+ email: params.email,
736
+ password: params.password,
737
+ device: "webpos" + new Date().getTime()
738
+ };
739
+ },
740
+ options: function options(values) {
741
+ return {
742
+ // withCredentials: true,
743
+ prefix: false,
744
+ cache: {
745
+ mode: "remote_local",
746
+ type: "indexDB",
747
+ cacheKeyData: values
748
+ }
749
+ };
750
+ }
751
+ },
752
+ emailCodeRegister: {
753
+ url: '/auth/email/register',
754
+ method: 'POST',
755
+ transformParams: function transformParams(params) {
756
+ return {
757
+ email: params.email,
758
+ code: params.code,
759
+ password: params.password
760
+ };
761
+ }
762
+ },
763
+ phoneCodeRegister: {
764
+ url: '/auth/mobile/register',
765
+ method: 'POST',
766
+ transformParams: function transformParams(params) {
767
+ return {
768
+ phone: String(params.phone),
769
+ password: params.password,
770
+ code: params.code,
771
+ country_calling_code: String(params.country_calling_code)
772
+ };
773
+ }
774
+ },
775
+ resendEmailRegisterLink: {
776
+ url: '/auth/email/link/resend_register_link',
777
+ method: 'POST',
778
+ transformParams: function transformParams(params) {
779
+ return {
780
+ code: params.code
781
+ };
782
+ }
783
+ },
784
+ checkEmailLinkCode: {
785
+ url: '/auth/email/link/new-register-check-code',
786
+ method: 'GET',
787
+ transformParams: function transformParams(params) {
788
+ return {
789
+ code: params.code
790
+ };
791
+ }
792
+ },
793
+ sendSmsLoginCode: {
794
+ url: '/auth/send-login-msg',
795
+ method: 'POST',
796
+ transformParams: function transformParams(params) {
797
+ return {
798
+ phone: String(params.phone),
799
+ country_calling_code: String(params.country_calling_code)
800
+ };
801
+ }
802
+ },
803
+ phoneCodeLogin: {
804
+ url: '/auth/mobile-login',
805
+ method: 'POST',
806
+ transformParams: function transformParams(params) {
807
+ return {
808
+ phone: String(params.phone),
809
+ country_calling_code: String(params.country_calling_code),
810
+ code: params.code
811
+ };
812
+ }
813
+ },
814
+ guestLogin: {
815
+ url: '/auth/guest/login',
816
+ method: 'POST',
817
+ transformParams: function transformParams(params) {
818
+ return {
819
+ login_channel: params.login_channel,
820
+ guest_code: params.guest_code
821
+ };
822
+ }
823
+ },
824
+ checkEmailExists: {
825
+ url: '/auth/email/check-email',
826
+ method: 'GET',
827
+ transformParams: function transformParams(params) {
828
+ return {
829
+ email: params.email,
830
+ sales_channel: 'online_store'
831
+ };
832
+ }
833
+ },
834
+ checkEmailCode: {
835
+ url: '/auth/email/check-email-code',
836
+ method: 'GET',
837
+ transformParams: function transformParams(params) {
838
+ return {
839
+ email: params.email,
840
+ code: params.code,
841
+ action: params.action
842
+ };
843
+ }
844
+ },
845
+ checkMobileCode: {
846
+ url: '/auth/mobile/check-mobile-code',
847
+ method: 'GET',
848
+ transformParams: function transformParams(params) {
849
+ return {
850
+ phone: String(params.phone),
851
+ code: params.code,
852
+ country_calling_code: String(params.country_calling_code),
853
+ action: params.action
854
+ };
855
+ }
856
+ },
857
+ phonePasswordLogin: {
858
+ url: '/auth/mobile/login',
859
+ method: 'POST',
860
+ transformParams: function transformParams(params) {
861
+ return {
862
+ phone: String(params.phone),
863
+ password: params.password,
864
+ country_calling_code: String(params.country_calling_code)
865
+ };
866
+ }
867
+ },
868
+ sendPasswordResetEmail: {
869
+ url: '/auth/email/reset-password-code',
870
+ method: 'GET',
871
+ transformParams: function transformParams(params) {
872
+ return {
873
+ email: params.email
874
+ };
875
+ }
876
+ },
877
+ sendPasswordResetSms: {
878
+ url: '/auth/mobile/sms-forget',
879
+ method: 'POST',
880
+ transformParams: function transformParams(params) {
881
+ return {
882
+ phone: String(params.phone),
883
+ country_calling_code: String(params.country_calling_code)
884
+ };
885
+ }
886
+ },
887
+ sendResetPasswordLink: {
888
+ url: '/auth/email/link/send_reset_pwd_link',
889
+ method: 'POST',
890
+ transformParams: function transformParams(params) {
891
+ return {
892
+ email: params.email
893
+ };
894
+ }
895
+ },
896
+ checkResetPasswordCode: {
897
+ url: '/auth/email/link/check_code',
898
+ method: 'GET',
899
+ transformParams: function transformParams(params) {
900
+ return {
901
+ code: params.code
902
+ };
903
+ }
904
+ },
905
+ resetPasswordByCode: {
906
+ url: '/auth/email/link/reset_pwd_by_code',
907
+ method: 'POST',
908
+ transformParams: function transformParams(params) {
909
+ return {
910
+ code: params.code,
911
+ password: params.password
912
+ };
913
+ }
914
+ },
915
+ resetPasswordByEmail: {
916
+ url: '/auth/email/reset-password',
917
+ method: 'POST',
918
+ transformParams: function transformParams(params) {
919
+ return {
920
+ email: params.email,
921
+ password: params.password,
922
+ code: params.code
923
+ };
924
+ }
925
+ },
926
+ resetPasswordByPhone: {
927
+ url: '/auth/mobile/reset-password',
928
+ method: 'POST',
929
+ transformParams: function transformParams(params) {
930
+ return {
931
+ phone: String(params.phone),
932
+ password: params.password,
933
+ code: params.code,
934
+ country_calling_code: String(params.country_calling_code)
935
+ };
936
+ }
937
+ },
938
+ verifyCode: {
939
+ url: '/auth/verify-code',
940
+ method: 'POST',
941
+ transformParams: function transformParams(params) {
942
+ return params;
943
+ }
944
+ },
945
+ register: {
946
+ url: '/auth/register',
947
+ method: 'POST',
948
+ transformParams: function transformParams(params) {
949
+ return params;
950
+ }
951
+ },
952
+ login: {
953
+ url: '/auth/login',
954
+ method: 'POST',
955
+ transformParams: function transformParams(params) {
956
+ return params;
957
+ }
958
+ },
959
+ oauthLogin: {
960
+ url: '/auth/oauth-login',
961
+ method: 'POST',
962
+ transformParams: function transformParams(params) {
963
+ return params;
964
+ }
965
+ },
966
+ validateToken: {
967
+ url: '/auth/validate',
968
+ method: 'GET',
969
+ transformParams: function transformParams(token) {
970
+ return {};
971
+ },
972
+ options: {
973
+ headers: function headers(token) {
974
+ return {
975
+ Authorization: "Bearer ".concat(token)
976
+ };
977
+ }
978
+ }
979
+ },
980
+ logout: {
981
+ url: '/auth/logout',
982
+ method: 'POST',
983
+ transformParams: function transformParams() {
984
+ return {};
985
+ }
986
+ },
987
+ getCountries: {
988
+ url: '/area/country',
989
+ method: 'GET',
990
+ transformParams: function transformParams() {
991
+ return {};
992
+ }
993
+ },
994
+ facebookLogin: {
995
+ url: '/auth/facebook/login',
996
+ method: 'POST',
997
+ transformParams: function transformParams(params) {
998
+ return {
999
+ token: params.token
1000
+ };
1001
+ }
1002
+ },
1003
+ appleLogin: {
1004
+ url: '/auth/apple/login',
1005
+ method: 'POST',
1006
+ transformParams: function transformParams(params) {
1007
+ return {
1008
+ code: params.code
1009
+ };
1010
+ }
1011
+ }
1012
+ };
1013
+
1014
+ /**
1015
+ * 渠道配置映射
1016
+ */
1017
+ export var channelConfigMap = {
1018
+ 'online-store': onlineStoreConfig,
1019
+ 'default': defaultConfig,
1020
+ 'webpos': webposConfig
1021
+ };
1022
+
1023
+ /**
1024
+ * 获取渠道配置
1025
+ */
1026
+ export function getChannelConfig(channel) {
1027
+ return channelConfigMap[channel] || channelConfigMap['default'];
1028
+ }
1029
+
1030
+ /**
1031
+ * API 调用器类
1032
+ * 负责根据配置执行 API 调用
1033
+ */
1034
+ export var ApiCaller = /*#__PURE__*/function () {
1035
+ function ApiCaller(request, config) {
1036
+ _classCallCheck(this, ApiCaller);
1037
+ this.request = request;
1038
+ this.config = config;
1039
+ }
1040
+
1041
+ /**
1042
+ * 执行 API 调用
1043
+ */
1044
+ _createClass(ApiCaller, [{
1045
+ key: "call",
1046
+ value: (function () {
1047
+ var _call = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(apiName, params, additionalOptions) {
1048
+ var apiConfig, transformedParams, options, requestOptions, response;
1049
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1050
+ while (1) switch (_context.prev = _context.next) {
1051
+ case 0:
1052
+ apiConfig = this.config[apiName];
1053
+ if (apiConfig) {
1054
+ _context.next = 3;
1055
+ break;
1056
+ }
1057
+ throw new Error("API \u914D\u7F6E\u672A\u627E\u5230: ".concat(String(apiName)));
1058
+ case 3:
1059
+ // 转换参数
1060
+ transformedParams = apiConfig.transformParams ? apiConfig.transformParams(params) : params;
1061
+ options = {};
1062
+ if (typeof apiConfig.options === 'function') {
1063
+ options = apiConfig.options(params);
1064
+ } else {
1065
+ options = (apiConfig === null || apiConfig === void 0 ? void 0 : apiConfig.options) || {};
1066
+ }
1067
+
1068
+ // 构建请求选项
1069
+ requestOptions = _objectSpread(_objectSpread({}, options), additionalOptions); // 处理动态 headers
1070
+ if (requestOptions.headers && typeof requestOptions.headers === 'function') {
1071
+ requestOptions.headers = requestOptions.headers(params);
1072
+ }
1073
+ requestOptions.customToast = function () {};
1074
+
1075
+ // 根据 HTTP 方法调用对应的请求方法
1076
+ _context.t0 = apiConfig.method;
1077
+ _context.next = _context.t0 === 'GET' ? 12 : _context.t0 === 'POST' ? 22 : _context.t0 === 'PUT' ? 26 : _context.t0 === 'DELETE' ? 30 : 34;
1078
+ break;
1079
+ case 12:
1080
+ if (!(transformedParams && Object.keys(transformedParams).length > 0)) {
1081
+ _context.next = 18;
1082
+ break;
1083
+ }
1084
+ _context.next = 15;
1085
+ return this.request.get(apiConfig.url, transformedParams, requestOptions);
1086
+ case 15:
1087
+ response = _context.sent;
1088
+ _context.next = 21;
1089
+ break;
1090
+ case 18:
1091
+ _context.next = 20;
1092
+ return this.request.get(apiConfig.url, undefined, requestOptions);
1093
+ case 20:
1094
+ response = _context.sent;
1095
+ case 21:
1096
+ return _context.abrupt("break", 35);
1097
+ case 22:
1098
+ _context.next = 24;
1099
+ return this.request.post(apiConfig.url, transformedParams, requestOptions);
1100
+ case 24:
1101
+ response = _context.sent;
1102
+ return _context.abrupt("break", 35);
1103
+ case 26:
1104
+ _context.next = 28;
1105
+ return this.request.put(apiConfig.url, transformedParams, requestOptions);
1106
+ case 28:
1107
+ response = _context.sent;
1108
+ return _context.abrupt("break", 35);
1109
+ case 30:
1110
+ _context.next = 32;
1111
+ return this.request.delete(apiConfig.url, requestOptions);
1112
+ case 32:
1113
+ response = _context.sent;
1114
+ return _context.abrupt("break", 35);
1115
+ case 34:
1116
+ throw new Error("\u4E0D\u652F\u6301\u7684 HTTP \u65B9\u6CD5: ".concat(apiConfig.method));
1117
+ case 35:
1118
+ return _context.abrupt("return", apiConfig.transformResponse ? apiConfig.transformResponse(response) : response);
1119
+ case 36:
1120
+ case "end":
1121
+ return _context.stop();
1122
+ }
1123
+ }, _callee, this);
1124
+ }));
1125
+ function call(_x, _x2, _x3) {
1126
+ return _call.apply(this, arguments);
1127
+ }
1128
+ return call;
1129
+ }())
1130
+ }]);
1131
+ return ApiCaller;
1132
+ }();
1133
+
1134
+ /**
1135
+ * 创建 API 调用器
1136
+ */
1137
+ export function createApiCaller(request, channel) {
1138
+ var config = getChannelConfig(channel);
1139
+ return new ApiCaller(request, config);
1140
+ }