@pisell/pisellos 0.0.6 → 0.0.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.
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +7 -1
- package/dist/effects/index.d.ts +1 -1
- package/dist/effects/index.js +4 -5
- package/dist/modules/Account/index.d.ts +7 -1
- package/dist/modules/Account/index.js +67 -17
- package/dist/modules/Account/types.d.ts +2 -1
- package/dist/modules/AccountList/index.d.ts +18 -0
- package/dist/modules/AccountList/index.js +264 -0
- package/dist/modules/AccountList/types.d.ts +37 -0
- package/dist/modules/AccountList/types.js +17 -0
- package/dist/modules/BaseModule.js +1 -0
- package/dist/modules/Cart/index.d.ts +3 -1
- package/dist/modules/Cart/index.js +53 -12
- package/dist/modules/Cart/types.d.ts +3 -3
- package/dist/modules/Date/types.d.ts +2 -1
- package/dist/modules/Date/types.js +1 -0
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +20 -12
- package/dist/modules/Resource/index.d.ts +7 -5
- package/dist/modules/Resource/index.js +17 -20
- package/dist/modules/Resource/utils.d.ts +23 -0
- package/dist/modules/Resource/utils.js +28 -0
- package/dist/modules/Step/index.d.ts +19 -0
- package/dist/modules/Step/index.js +107 -0
- package/dist/modules/Step/tyeps.d.ts +18 -0
- package/dist/modules/Step/tyeps.js +1 -0
- package/dist/solution/BookingByStep/index.d.ts +29 -1
- package/dist/solution/BookingByStep/index.js +363 -12
- package/dist/solution/BookingByStep/types.d.ts +6 -2
- package/dist/solution/BookingByStep/types.js +29 -0
- package/dist/solution/BookingByStep/utils/resources.d.ts +61 -0
- package/dist/solution/BookingByStep/utils/resources.js +380 -0
- package/dist/store/createStore.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.js +5 -1
- package/lib/effects/index.d.ts +1 -1
- package/lib/effects/index.js +1 -2
- package/lib/modules/Account/index.d.ts +7 -1
- package/lib/modules/Account/index.js +34 -18
- package/lib/modules/Account/types.d.ts +2 -1
- package/lib/modules/AccountList/index.d.ts +18 -0
- package/lib/modules/AccountList/index.js +126 -0
- package/lib/modules/AccountList/types.d.ts +37 -0
- package/lib/modules/AccountList/types.js +33 -0
- package/lib/modules/BaseModule.js +1 -0
- package/lib/modules/Cart/index.d.ts +3 -1
- package/lib/modules/Cart/index.js +13 -3
- package/lib/modules/Cart/types.d.ts +3 -3
- package/lib/modules/Date/types.d.ts +2 -1
- package/lib/modules/Date/types.js +1 -0
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +8 -7
- package/lib/modules/Resource/index.d.ts +7 -5
- package/lib/modules/Resource/index.js +16 -20
- package/lib/modules/Resource/utils.d.ts +23 -0
- package/lib/modules/Resource/utils.js +39 -0
- package/lib/modules/Step/index.d.ts +19 -0
- package/lib/modules/Step/index.js +76 -0
- package/lib/modules/Step/tyeps.d.ts +18 -0
- package/lib/modules/Step/tyeps.js +17 -0
- package/lib/solution/BookingByStep/index.d.ts +29 -1
- package/lib/solution/BookingByStep/index.js +99 -5
- package/lib/solution/BookingByStep/types.d.ts +6 -2
- package/lib/solution/BookingByStep/types.js +33 -2
- package/lib/solution/BookingByStep/utils/resources.d.ts +61 -0
- package/lib/solution/BookingByStep/utils/resources.js +215 -0
- package/lib/store/createStore.js +1 -1
- package/lib/types/index.d.ts +2 -1
- package/package.json +9 -8
package/dist/core/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare class PisellOSCore implements PisellCore {
|
|
|
17
17
|
getPlugin<T extends Plugin>(name: string): T | null;
|
|
18
18
|
hasPlugin(name: string): boolean;
|
|
19
19
|
registerModule(module: Module, options?: ModuleOptions): void;
|
|
20
|
+
unregisterModule(module: Module): void;
|
|
20
21
|
getModule<T extends Module>(name: string): T | null;
|
|
21
22
|
getModuleExports<T = any>(name: string): T | null;
|
|
22
23
|
hasModule(name: string): boolean;
|
package/dist/core/index.js
CHANGED
|
@@ -175,7 +175,7 @@ var PisellOSCore = /*#__PURE__*/function () {
|
|
|
175
175
|
// 预先给模块初始化值系统
|
|
176
176
|
var _createStore = createStore((options === null || options === void 0 ? void 0 : options.initialState) || {}, module.name, function (path, value) {
|
|
177
177
|
console.log('core 检测到模块值更新', module.name, path, value);
|
|
178
|
-
_this3.effects.emit("".concat(module.name, ":changed"), value);
|
|
178
|
+
_this3.effects.emit("".concat(module.name, ":changed"), path, value);
|
|
179
179
|
if (module.storeChange) module.storeChange(path, value);
|
|
180
180
|
}),
|
|
181
181
|
proxy = _createStore.proxy;
|
|
@@ -198,6 +198,12 @@ var PisellOSCore = /*#__PURE__*/function () {
|
|
|
198
198
|
throw error;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
+
}, {
|
|
202
|
+
key: "unregisterModule",
|
|
203
|
+
value: function unregisterModule(module) {
|
|
204
|
+
this.stores.delete(module.name);
|
|
205
|
+
this.modules.delete(module.name);
|
|
206
|
+
}
|
|
201
207
|
}, {
|
|
202
208
|
key: "getModule",
|
|
203
209
|
value: function getModule(name) {
|
package/dist/effects/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare class EffectsManager {
|
|
|
8
8
|
off(event: string, callback: EffectCallback): void;
|
|
9
9
|
offByModuleDestroy(module: string): void;
|
|
10
10
|
once(event: string, callback: EffectCallback): void;
|
|
11
|
-
emit(event: string, payload: any): Promise<{
|
|
11
|
+
emit(event: string, payload: any, value: any): Promise<{
|
|
12
12
|
status: boolean;
|
|
13
13
|
data: any;
|
|
14
14
|
}>;
|
package/dist/effects/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
69
69
|
}, {
|
|
70
70
|
key: "emit",
|
|
71
71
|
value: function () {
|
|
72
|
-
var _emit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(event, payload) {
|
|
72
|
+
var _emit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(event, payload, value) {
|
|
73
73
|
var callbacks;
|
|
74
74
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
75
75
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -122,7 +122,6 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
122
122
|
_iterator.f();
|
|
123
123
|
return _context2.finish(17);
|
|
124
124
|
case 20:
|
|
125
|
-
console.log(res);
|
|
126
125
|
isAllPass = res.every(function (r) {
|
|
127
126
|
return (r === null || r === void 0 ? void 0 : r.status) !== false;
|
|
128
127
|
});
|
|
@@ -130,13 +129,13 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
130
129
|
status: isAllPass,
|
|
131
130
|
data: res
|
|
132
131
|
});
|
|
133
|
-
case
|
|
132
|
+
case 22:
|
|
134
133
|
case "end":
|
|
135
134
|
return _context2.stop();
|
|
136
135
|
}
|
|
137
136
|
}, _callee2, null, [[2, 14, 17, 20]]);
|
|
138
137
|
}));
|
|
139
|
-
return function (
|
|
138
|
+
return function (_x5) {
|
|
140
139
|
return _ref2.apply(this, arguments);
|
|
141
140
|
};
|
|
142
141
|
}()));
|
|
@@ -146,7 +145,7 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
146
145
|
}
|
|
147
146
|
}, _callee3, this);
|
|
148
147
|
}));
|
|
149
|
-
function emit(_x2, _x3) {
|
|
148
|
+
function emit(_x2, _x3, _x4) {
|
|
150
149
|
return _emit.apply(this, arguments);
|
|
151
150
|
}
|
|
152
151
|
return emit;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
3
|
import { Account, AccountModuleAPI } from './types';
|
|
4
|
+
export * from './types';
|
|
4
5
|
export declare class AccountModule extends BaseModule implements Module, AccountModuleAPI {
|
|
5
6
|
protected defaultName: string;
|
|
6
7
|
protected defaultVersion: string;
|
|
7
|
-
|
|
8
|
+
isGuest: boolean;
|
|
9
|
+
private store;
|
|
8
10
|
constructor(name?: string, version?: string);
|
|
9
11
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
12
|
+
getId(): string;
|
|
10
13
|
login(credentials: {
|
|
11
14
|
username: string;
|
|
12
15
|
password: string;
|
|
@@ -18,4 +21,7 @@ export declare class AccountModule extends BaseModule implements Module, Account
|
|
|
18
21
|
isLoggedIn(): boolean;
|
|
19
22
|
resetPassword(email: string): Promise<void>;
|
|
20
23
|
updatePassword(oldPassword: string, newPassword: string): Promise<void>;
|
|
24
|
+
getLoginStatus(): Promise<boolean>;
|
|
25
|
+
getAccount(): Promise<Account | null>;
|
|
26
|
+
setAccountInfo(account: Account): void;
|
|
21
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
2
|
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
3
|
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; }
|
|
4
|
+
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; }
|
|
5
5
|
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); } }
|
|
6
6
|
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); }); }; }
|
|
7
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -19,6 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
19
19
|
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); }
|
|
20
20
|
import { BaseModule } from "../BaseModule";
|
|
21
21
|
import { AccountHooks } from "./types";
|
|
22
|
+
export * from "./types";
|
|
22
23
|
export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
23
24
|
_inherits(AccountModule, _BaseModule);
|
|
24
25
|
var _super = _createSuper(AccountModule);
|
|
@@ -28,7 +29,8 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
28
29
|
_this = _super.call(this, name, version);
|
|
29
30
|
_defineProperty(_assertThisInitialized(_this), "defaultName", 'account');
|
|
30
31
|
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "isGuest", false);
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "store", {
|
|
32
34
|
currentAccount: null,
|
|
33
35
|
isLoggedIn: false
|
|
34
36
|
});
|
|
@@ -42,9 +44,7 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
42
44
|
while (1) switch (_context.prev = _context.next) {
|
|
43
45
|
case 0:
|
|
44
46
|
this.core = core;
|
|
45
|
-
|
|
46
|
-
this.state = _objectSpread(_objectSpread({}, this.state), options.initialState);
|
|
47
|
-
}
|
|
47
|
+
this.store = options === null || options === void 0 ? void 0 : options.store;
|
|
48
48
|
case 2:
|
|
49
49
|
case "end":
|
|
50
50
|
return _context.stop();
|
|
@@ -56,6 +56,12 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
56
56
|
}
|
|
57
57
|
return initialize;
|
|
58
58
|
}()
|
|
59
|
+
}, {
|
|
60
|
+
key: "getId",
|
|
61
|
+
value: function getId() {
|
|
62
|
+
var _this$store$currentAc;
|
|
63
|
+
return ((_this$store$currentAc = this.store.currentAccount) === null || _this$store$currentAc === void 0 ? void 0 : _this$store$currentAc.id) || '';
|
|
64
|
+
}
|
|
59
65
|
}, {
|
|
60
66
|
key: "login",
|
|
61
67
|
value: function () {
|
|
@@ -70,10 +76,11 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
70
76
|
// 实际应该从 API 返回
|
|
71
77
|
username: credentials.username,
|
|
72
78
|
email: "".concat(credentials.username, "@example.com"),
|
|
73
|
-
name: credentials.username
|
|
79
|
+
name: credentials.username,
|
|
80
|
+
isGuest: false
|
|
74
81
|
};
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
82
|
+
this.store.currentAccount = account;
|
|
83
|
+
this.store.isLoggedIn = true;
|
|
77
84
|
_context2.next = 5;
|
|
78
85
|
return this.core.effects.emit(AccountHooks.OnLogin, account);
|
|
79
86
|
case 5:
|
|
@@ -94,8 +101,8 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
94
101
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
95
102
|
while (1) switch (_context3.prev = _context3.next) {
|
|
96
103
|
case 0:
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
104
|
+
this.store.currentAccount = null;
|
|
105
|
+
this.store.isLoggedIn = false;
|
|
99
106
|
_context3.next = 4;
|
|
100
107
|
return this.core.effects.emit(AccountHooks.OnLogout, {});
|
|
101
108
|
case 4:
|
|
@@ -121,8 +128,8 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
121
128
|
newAccount = _objectSpread({
|
|
122
129
|
id: '1'
|
|
123
130
|
}, account);
|
|
124
|
-
this.
|
|
125
|
-
this.
|
|
131
|
+
this.store.currentAccount = newAccount;
|
|
132
|
+
this.store.isLoggedIn = true;
|
|
126
133
|
_context4.next = 5;
|
|
127
134
|
return this.core.effects.emit(AccountHooks.OnRegister, newAccount);
|
|
128
135
|
case 5:
|
|
@@ -139,7 +146,7 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
139
146
|
}, {
|
|
140
147
|
key: "getCurrentAccount",
|
|
141
148
|
value: function getCurrentAccount() {
|
|
142
|
-
return this.
|
|
149
|
+
return this.store.currentAccount;
|
|
143
150
|
}
|
|
144
151
|
}, {
|
|
145
152
|
key: "updateProfile",
|
|
@@ -148,15 +155,15 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
148
155
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
149
156
|
while (1) switch (_context5.prev = _context5.next) {
|
|
150
157
|
case 0:
|
|
151
|
-
if (this.
|
|
158
|
+
if (this.store.currentAccount) {
|
|
152
159
|
_context5.next = 2;
|
|
153
160
|
break;
|
|
154
161
|
}
|
|
155
162
|
return _context5.abrupt("return");
|
|
156
163
|
case 2:
|
|
157
|
-
this.
|
|
164
|
+
this.store.currentAccount = _objectSpread(_objectSpread({}, this.store.currentAccount), updates);
|
|
158
165
|
_context5.next = 5;
|
|
159
|
-
return this.core.effects.emit(AccountHooks.OnProfileUpdate, this.
|
|
166
|
+
return this.core.effects.emit(AccountHooks.OnProfileUpdate, this.store.currentAccount);
|
|
160
167
|
case 5:
|
|
161
168
|
case "end":
|
|
162
169
|
return _context5.stop();
|
|
@@ -171,7 +178,7 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
171
178
|
}, {
|
|
172
179
|
key: "isLoggedIn",
|
|
173
180
|
value: function isLoggedIn() {
|
|
174
|
-
return this.
|
|
181
|
+
return this.store.isLoggedIn;
|
|
175
182
|
}
|
|
176
183
|
}, {
|
|
177
184
|
key: "resetPassword",
|
|
@@ -207,6 +214,49 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
207
214
|
}
|
|
208
215
|
return updatePassword;
|
|
209
216
|
}()
|
|
217
|
+
}, {
|
|
218
|
+
key: "getLoginStatus",
|
|
219
|
+
value: function () {
|
|
220
|
+
var _getLoginStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
221
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
222
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
223
|
+
case 0:
|
|
224
|
+
return _context8.abrupt("return", this.store.isLoggedIn);
|
|
225
|
+
case 1:
|
|
226
|
+
case "end":
|
|
227
|
+
return _context8.stop();
|
|
228
|
+
}
|
|
229
|
+
}, _callee8, this);
|
|
230
|
+
}));
|
|
231
|
+
function getLoginStatus() {
|
|
232
|
+
return _getLoginStatus.apply(this, arguments);
|
|
233
|
+
}
|
|
234
|
+
return getLoginStatus;
|
|
235
|
+
}()
|
|
236
|
+
}, {
|
|
237
|
+
key: "getAccount",
|
|
238
|
+
value: function () {
|
|
239
|
+
var _getAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
240
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
241
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
242
|
+
case 0:
|
|
243
|
+
return _context9.abrupt("return", this.store.currentAccount);
|
|
244
|
+
case 1:
|
|
245
|
+
case "end":
|
|
246
|
+
return _context9.stop();
|
|
247
|
+
}
|
|
248
|
+
}, _callee9, this);
|
|
249
|
+
}));
|
|
250
|
+
function getAccount() {
|
|
251
|
+
return _getAccount.apply(this, arguments);
|
|
252
|
+
}
|
|
253
|
+
return getAccount;
|
|
254
|
+
}()
|
|
255
|
+
}, {
|
|
256
|
+
key: "setAccountInfo",
|
|
257
|
+
value: function setAccountInfo(account) {
|
|
258
|
+
this.store.currentAccount = account;
|
|
259
|
+
}
|
|
210
260
|
}]);
|
|
211
261
|
return AccountModule;
|
|
212
262
|
}(BaseModule);
|
|
@@ -10,11 +10,12 @@ export declare enum AccountHooks {
|
|
|
10
10
|
export interface Account {
|
|
11
11
|
id: string;
|
|
12
12
|
username: string;
|
|
13
|
-
email
|
|
13
|
+
email?: string;
|
|
14
14
|
phone?: string;
|
|
15
15
|
name?: string;
|
|
16
16
|
avatar?: string;
|
|
17
17
|
metadata?: Record<string, any>;
|
|
18
|
+
isGuest?: boolean;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* 账户模块状态
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
|
+
import { AccountModule, Account } from '../Account';
|
|
3
|
+
import { BaseModule } from '../BaseModule';
|
|
4
|
+
import { AccountListState } from './types';
|
|
5
|
+
export declare class AccountListModule extends BaseModule implements Module {
|
|
6
|
+
protected defaultName: string;
|
|
7
|
+
protected defaultVersion: string;
|
|
8
|
+
private store;
|
|
9
|
+
constructor(name?: string, version?: string);
|
|
10
|
+
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
11
|
+
addAccount(account: Account): Promise<void>;
|
|
12
|
+
updateAccount(id: string, updates: Partial<Account>): Promise<void>;
|
|
13
|
+
removeAccount(id: string): Promise<void>;
|
|
14
|
+
getAccounts(): AccountModule[];
|
|
15
|
+
getAccount(id: string): AccountModule | null;
|
|
16
|
+
clearAccounts(): Promise<void>;
|
|
17
|
+
getState(): AccountListState;
|
|
18
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
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 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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
+
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; }
|
|
11
|
+
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); } }
|
|
12
|
+
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); }); }; }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
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); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
+
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; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
25
|
+
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); }
|
|
26
|
+
import { AccountModule } from "../Account";
|
|
27
|
+
import { BaseModule } from "../BaseModule";
|
|
28
|
+
import { AccountListHooks } from "./types";
|
|
29
|
+
export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
30
|
+
_inherits(AccountListModule, _BaseModule);
|
|
31
|
+
var _super = _createSuper(AccountListModule);
|
|
32
|
+
function AccountListModule(name, version) {
|
|
33
|
+
var _this;
|
|
34
|
+
_classCallCheck(this, AccountListModule);
|
|
35
|
+
_this = _super.call(this, name, version);
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "defaultName", 'accountList');
|
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "store", {
|
|
39
|
+
accounts: [],
|
|
40
|
+
isLoading: false,
|
|
41
|
+
error: null
|
|
42
|
+
});
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
_createClass(AccountListModule, [{
|
|
46
|
+
key: "initialize",
|
|
47
|
+
value: function () {
|
|
48
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
49
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
50
|
+
while (1) switch (_context.prev = _context.next) {
|
|
51
|
+
case 0:
|
|
52
|
+
this.core = core;
|
|
53
|
+
this.store = options === null || options === void 0 ? void 0 : options.store;
|
|
54
|
+
this.store.accounts = [];
|
|
55
|
+
case 3:
|
|
56
|
+
case "end":
|
|
57
|
+
return _context.stop();
|
|
58
|
+
}
|
|
59
|
+
}, _callee, this);
|
|
60
|
+
}));
|
|
61
|
+
function initialize(_x, _x2) {
|
|
62
|
+
return _initialize.apply(this, arguments);
|
|
63
|
+
}
|
|
64
|
+
return initialize;
|
|
65
|
+
}()
|
|
66
|
+
}, {
|
|
67
|
+
key: "addAccount",
|
|
68
|
+
value: function () {
|
|
69
|
+
var _addAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(account) {
|
|
70
|
+
var accountModule;
|
|
71
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
72
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
_context2.prev = 0;
|
|
75
|
+
this.store.isLoading = true;
|
|
76
|
+
this.store.error = null;
|
|
77
|
+
if (!this.store.accounts.some(function (a) {
|
|
78
|
+
return a.getId() === account.id;
|
|
79
|
+
})) {
|
|
80
|
+
_context2.next = 5;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
throw new Error("Account with id ".concat(account.id, " already exists"));
|
|
84
|
+
case 5:
|
|
85
|
+
accountModule = new AccountModule("account_".concat(account.id));
|
|
86
|
+
this.core.registerModule(accountModule);
|
|
87
|
+
this.store.accounts = [].concat(_toConsumableArray(this.store.accounts), [accountModule]);
|
|
88
|
+
_context2.next = 10;
|
|
89
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListUpdate, this.store);
|
|
90
|
+
case 10:
|
|
91
|
+
_context2.next = 17;
|
|
92
|
+
break;
|
|
93
|
+
case 12:
|
|
94
|
+
_context2.prev = 12;
|
|
95
|
+
_context2.t0 = _context2["catch"](0);
|
|
96
|
+
this.store.error = _context2.t0 instanceof Error ? _context2.t0.message : 'Failed to add account';
|
|
97
|
+
_context2.next = 17;
|
|
98
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListError, this.store.error);
|
|
99
|
+
case 17:
|
|
100
|
+
_context2.prev = 17;
|
|
101
|
+
this.store.isLoading = false;
|
|
102
|
+
return _context2.finish(17);
|
|
103
|
+
case 20:
|
|
104
|
+
case "end":
|
|
105
|
+
return _context2.stop();
|
|
106
|
+
}
|
|
107
|
+
}, _callee2, this, [[0, 12, 17, 20]]);
|
|
108
|
+
}));
|
|
109
|
+
function addAccount(_x3) {
|
|
110
|
+
return _addAccount.apply(this, arguments);
|
|
111
|
+
}
|
|
112
|
+
return addAccount;
|
|
113
|
+
}()
|
|
114
|
+
}, {
|
|
115
|
+
key: "updateAccount",
|
|
116
|
+
value: function () {
|
|
117
|
+
var _updateAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(id, updates) {
|
|
118
|
+
var account;
|
|
119
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
120
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
_context3.prev = 0;
|
|
123
|
+
this.store.isLoading = true;
|
|
124
|
+
this.store.error = null;
|
|
125
|
+
account = this.getAccount(id);
|
|
126
|
+
if (account) {
|
|
127
|
+
_context3.next = 6;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
throw new Error("Account with id ".concat(id, " not found"));
|
|
131
|
+
case 6:
|
|
132
|
+
// Update the account module directly
|
|
133
|
+
Object.assign(account, updates);
|
|
134
|
+
_context3.next = 9;
|
|
135
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListUpdate, this.store);
|
|
136
|
+
case 9:
|
|
137
|
+
_context3.next = 16;
|
|
138
|
+
break;
|
|
139
|
+
case 11:
|
|
140
|
+
_context3.prev = 11;
|
|
141
|
+
_context3.t0 = _context3["catch"](0);
|
|
142
|
+
this.store.error = _context3.t0 instanceof Error ? _context3.t0.message : 'Failed to update account';
|
|
143
|
+
_context3.next = 16;
|
|
144
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListError, this.store.error);
|
|
145
|
+
case 16:
|
|
146
|
+
_context3.prev = 16;
|
|
147
|
+
this.store.isLoading = false;
|
|
148
|
+
return _context3.finish(16);
|
|
149
|
+
case 19:
|
|
150
|
+
case "end":
|
|
151
|
+
return _context3.stop();
|
|
152
|
+
}
|
|
153
|
+
}, _callee3, this, [[0, 11, 16, 19]]);
|
|
154
|
+
}));
|
|
155
|
+
function updateAccount(_x4, _x5) {
|
|
156
|
+
return _updateAccount.apply(this, arguments);
|
|
157
|
+
}
|
|
158
|
+
return updateAccount;
|
|
159
|
+
}()
|
|
160
|
+
}, {
|
|
161
|
+
key: "removeAccount",
|
|
162
|
+
value: function () {
|
|
163
|
+
var _removeAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(id) {
|
|
164
|
+
var index;
|
|
165
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
166
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
167
|
+
case 0:
|
|
168
|
+
_context4.prev = 0;
|
|
169
|
+
this.store.isLoading = true;
|
|
170
|
+
this.store.error = null;
|
|
171
|
+
index = this.store.accounts.findIndex(function (a) {
|
|
172
|
+
return a.getId() === id;
|
|
173
|
+
});
|
|
174
|
+
if (!(index === -1)) {
|
|
175
|
+
_context4.next = 6;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
throw new Error("Account with id ".concat(id, " not found"));
|
|
179
|
+
case 6:
|
|
180
|
+
this.store.accounts[index].destory();
|
|
181
|
+
this.store.accounts = [].concat(_toConsumableArray(this.store.accounts.slice(0, index)), _toConsumableArray(this.store.accounts.slice(index + 1)));
|
|
182
|
+
_context4.next = 10;
|
|
183
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListUpdate, this.store);
|
|
184
|
+
case 10:
|
|
185
|
+
_context4.next = 17;
|
|
186
|
+
break;
|
|
187
|
+
case 12:
|
|
188
|
+
_context4.prev = 12;
|
|
189
|
+
_context4.t0 = _context4["catch"](0);
|
|
190
|
+
this.store.error = _context4.t0 instanceof Error ? _context4.t0.message : 'Failed to remove account';
|
|
191
|
+
_context4.next = 17;
|
|
192
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListError, this.store.error);
|
|
193
|
+
case 17:
|
|
194
|
+
_context4.prev = 17;
|
|
195
|
+
this.store.isLoading = false;
|
|
196
|
+
return _context4.finish(17);
|
|
197
|
+
case 20:
|
|
198
|
+
case "end":
|
|
199
|
+
return _context4.stop();
|
|
200
|
+
}
|
|
201
|
+
}, _callee4, this, [[0, 12, 17, 20]]);
|
|
202
|
+
}));
|
|
203
|
+
function removeAccount(_x6) {
|
|
204
|
+
return _removeAccount.apply(this, arguments);
|
|
205
|
+
}
|
|
206
|
+
return removeAccount;
|
|
207
|
+
}()
|
|
208
|
+
}, {
|
|
209
|
+
key: "getAccounts",
|
|
210
|
+
value: function getAccounts() {
|
|
211
|
+
return _toConsumableArray(this.store.accounts);
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
key: "getAccount",
|
|
215
|
+
value: function getAccount(id) {
|
|
216
|
+
return this.store.accounts.find(function (account) {
|
|
217
|
+
return account.getId() === id;
|
|
218
|
+
}) || null;
|
|
219
|
+
}
|
|
220
|
+
}, {
|
|
221
|
+
key: "clearAccounts",
|
|
222
|
+
value: function () {
|
|
223
|
+
var _clearAccounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
224
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
225
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
226
|
+
case 0:
|
|
227
|
+
_context5.prev = 0;
|
|
228
|
+
this.store.isLoading = true;
|
|
229
|
+
this.store.error = null;
|
|
230
|
+
this.store.accounts = [];
|
|
231
|
+
_context5.next = 6;
|
|
232
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListUpdate, this.store);
|
|
233
|
+
case 6:
|
|
234
|
+
_context5.next = 13;
|
|
235
|
+
break;
|
|
236
|
+
case 8:
|
|
237
|
+
_context5.prev = 8;
|
|
238
|
+
_context5.t0 = _context5["catch"](0);
|
|
239
|
+
this.store.error = _context5.t0 instanceof Error ? _context5.t0.message : 'Failed to clear accounts';
|
|
240
|
+
_context5.next = 13;
|
|
241
|
+
return this.core.effects.emit(AccountListHooks.OnAccountListError, this.store.error);
|
|
242
|
+
case 13:
|
|
243
|
+
_context5.prev = 13;
|
|
244
|
+
this.store.isLoading = false;
|
|
245
|
+
return _context5.finish(13);
|
|
246
|
+
case 16:
|
|
247
|
+
case "end":
|
|
248
|
+
return _context5.stop();
|
|
249
|
+
}
|
|
250
|
+
}, _callee5, this, [[0, 8, 13, 16]]);
|
|
251
|
+
}));
|
|
252
|
+
function clearAccounts() {
|
|
253
|
+
return _clearAccounts.apply(this, arguments);
|
|
254
|
+
}
|
|
255
|
+
return clearAccounts;
|
|
256
|
+
}()
|
|
257
|
+
}, {
|
|
258
|
+
key: "getState",
|
|
259
|
+
value: function getState() {
|
|
260
|
+
return _objectSpread({}, this.store);
|
|
261
|
+
}
|
|
262
|
+
}]);
|
|
263
|
+
return AccountListModule;
|
|
264
|
+
}(BaseModule);
|