@thescaffold/jsx-core 0.2.21 → 0.2.31
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/jsx-core.cjs.development.js +323 -517
- package/jsx-core.cjs.development.js.map +1 -1
- package/jsx-core.cjs.production.min.js +1 -1
- package/jsx-core.cjs.production.min.js.map +1 -1
- package/jsx-core.esm.js +324 -518
- package/jsx-core.esm.js.map +1 -1
- package/package.json +3 -2
- package/storage/session.storage.d.ts +1 -1
- package/store/file.store.d.ts +3 -2
- package/store/store.d.ts +4 -0
package/jsx-core.esm.js
CHANGED
|
@@ -46,306 +46,113 @@ function _extends() {
|
|
|
46
46
|
return n;
|
|
47
47
|
}, _extends.apply(null, arguments);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return o(a, "_invoke", {
|
|
84
|
-
value: makeInvokeMethod(t, r, c)
|
|
85
|
-
}), a;
|
|
86
|
-
}
|
|
87
|
-
function tryCatch(t, e, r) {
|
|
88
|
-
try {
|
|
89
|
-
return {
|
|
90
|
-
type: "normal",
|
|
91
|
-
arg: t.call(e, r)
|
|
92
|
-
};
|
|
93
|
-
} catch (t) {
|
|
94
|
-
return {
|
|
95
|
-
type: "throw",
|
|
96
|
-
arg: t
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
e.wrap = wrap;
|
|
101
|
-
var h = "suspendedStart",
|
|
102
|
-
l = "suspendedYield",
|
|
103
|
-
f = "executing",
|
|
104
|
-
s = "completed",
|
|
105
|
-
y = {};
|
|
106
|
-
function Generator() {}
|
|
107
|
-
function GeneratorFunction() {}
|
|
108
|
-
function GeneratorFunctionPrototype() {}
|
|
109
|
-
var p = {};
|
|
110
|
-
define(p, a, function () {
|
|
111
|
-
return this;
|
|
112
|
-
});
|
|
113
|
-
var d = Object.getPrototypeOf,
|
|
114
|
-
v = d && d(d(values([])));
|
|
115
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
116
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
117
|
-
function defineIteratorMethods(t) {
|
|
118
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
119
|
-
define(t, e, function (t) {
|
|
120
|
-
return this._invoke(e, t);
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function AsyncIterator(t, e) {
|
|
125
|
-
function invoke(r, o, i, a) {
|
|
126
|
-
var c = tryCatch(t[r], t, o);
|
|
127
|
-
if ("throw" !== c.type) {
|
|
128
|
-
var u = c.arg,
|
|
129
|
-
h = u.value;
|
|
130
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
131
|
-
invoke("next", t, i, a);
|
|
132
|
-
}, function (t) {
|
|
133
|
-
invoke("throw", t, i, a);
|
|
134
|
-
}) : e.resolve(h).then(function (t) {
|
|
135
|
-
u.value = t, i(u);
|
|
136
|
-
}, function (t) {
|
|
137
|
-
return invoke("throw", t, i, a);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
a(c.arg);
|
|
141
|
-
}
|
|
142
|
-
var r;
|
|
143
|
-
o(this, "_invoke", {
|
|
144
|
-
value: function (t, n) {
|
|
145
|
-
function callInvokeWithMethodAndArg() {
|
|
146
|
-
return new e(function (e, r) {
|
|
147
|
-
invoke(t, n, e, r);
|
|
148
|
-
});
|
|
49
|
+
function _regenerator() {
|
|
50
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
51
|
+
var e,
|
|
52
|
+
t,
|
|
53
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
54
|
+
n = r.iterator || "@@iterator",
|
|
55
|
+
o = r.toStringTag || "@@toStringTag";
|
|
56
|
+
function i(r, n, o, i) {
|
|
57
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
58
|
+
u = Object.create(c.prototype);
|
|
59
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
60
|
+
var i,
|
|
61
|
+
c,
|
|
62
|
+
u,
|
|
63
|
+
f = 0,
|
|
64
|
+
p = o || [],
|
|
65
|
+
y = !1,
|
|
66
|
+
G = {
|
|
67
|
+
p: 0,
|
|
68
|
+
n: 0,
|
|
69
|
+
v: e,
|
|
70
|
+
a: d,
|
|
71
|
+
f: d.bind(e, 4),
|
|
72
|
+
d: function (t, r) {
|
|
73
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
function d(r, n) {
|
|
77
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
78
|
+
var o,
|
|
79
|
+
i = p[t],
|
|
80
|
+
d = G.p,
|
|
81
|
+
l = i[2];
|
|
82
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
149
83
|
}
|
|
150
|
-
|
|
84
|
+
if (o || r > 1) return a;
|
|
85
|
+
throw y = !0, n;
|
|
151
86
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
87
|
+
return function (o, p, l) {
|
|
88
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
89
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
90
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
91
|
+
try {
|
|
92
|
+
if (f = 2, i) {
|
|
93
|
+
if (c || (o = "next"), t = i[o]) {
|
|
94
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
95
|
+
if (!t.done) return t;
|
|
96
|
+
u = t.value, c < 2 && (c = 0);
|
|
97
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
98
|
+
i = e;
|
|
99
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
100
|
+
} catch (t) {
|
|
101
|
+
i = e, c = 1, u = t;
|
|
102
|
+
} finally {
|
|
103
|
+
f = 1;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
160
106
|
return {
|
|
161
107
|
value: t,
|
|
162
|
-
done:
|
|
108
|
+
done: y
|
|
163
109
|
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
var c = n.delegate;
|
|
167
|
-
if (c) {
|
|
168
|
-
var u = maybeInvokeDelegate(c, n);
|
|
169
|
-
if (u) {
|
|
170
|
-
if (u === y) continue;
|
|
171
|
-
return u;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
175
|
-
if (o === h) throw o = s, n.arg;
|
|
176
|
-
n.dispatchException(n.arg);
|
|
177
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
178
|
-
o = f;
|
|
179
|
-
var p = tryCatch(e, r, n);
|
|
180
|
-
if ("normal" === p.type) {
|
|
181
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
182
|
-
return {
|
|
183
|
-
value: p.arg,
|
|
184
|
-
done: n.done
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
function maybeInvokeDelegate(e, r) {
|
|
192
|
-
var n = r.method,
|
|
193
|
-
o = e.iterator[n];
|
|
194
|
-
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;
|
|
195
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
196
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
197
|
-
var a = i.arg;
|
|
198
|
-
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);
|
|
199
|
-
}
|
|
200
|
-
function pushTryEntry(t) {
|
|
201
|
-
var e = {
|
|
202
|
-
tryLoc: t[0]
|
|
203
|
-
};
|
|
204
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
205
|
-
}
|
|
206
|
-
function resetTryEntry(t) {
|
|
207
|
-
var e = t.completion || {};
|
|
208
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
209
|
-
}
|
|
210
|
-
function Context(t) {
|
|
211
|
-
this.tryEntries = [{
|
|
212
|
-
tryLoc: "root"
|
|
213
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
110
|
+
};
|
|
111
|
+
}(r, o, i), !0), u;
|
|
214
112
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return i.next = i;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
113
|
+
var a = {};
|
|
114
|
+
function Generator() {}
|
|
115
|
+
function GeneratorFunction() {}
|
|
116
|
+
function GeneratorFunctionPrototype() {}
|
|
117
|
+
t = Object.getPrototypeOf;
|
|
118
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
119
|
+
return this;
|
|
120
|
+
}), t),
|
|
121
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
122
|
+
function f(e) {
|
|
123
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
230
124
|
}
|
|
231
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
232
|
-
value: GeneratorFunctionPrototype,
|
|
233
|
-
configurable: !0
|
|
234
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
235
|
-
value: GeneratorFunction,
|
|
236
|
-
configurable: !0
|
|
237
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
238
|
-
var e = "function" == typeof t && t.constructor;
|
|
239
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
240
|
-
}, e.mark = function (t) {
|
|
241
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
242
|
-
}, e.awrap = function (t) {
|
|
243
|
-
return {
|
|
244
|
-
__await: t
|
|
245
|
-
};
|
|
246
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
247
|
-
return this;
|
|
248
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
249
|
-
void 0 === i && (i = Promise);
|
|
250
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
251
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
252
|
-
return t.done ? t.value : a.next();
|
|
253
|
-
});
|
|
254
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
125
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
255
126
|
return this;
|
|
256
|
-
}),
|
|
127
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
257
128
|
return "[object Generator]";
|
|
258
|
-
}),
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return r.reverse(), function next() {
|
|
263
|
-
for (; r.length;) {
|
|
264
|
-
var t = r.pop();
|
|
265
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
266
|
-
}
|
|
267
|
-
return next.done = !0, next;
|
|
129
|
+
}), (_regenerator = function () {
|
|
130
|
+
return {
|
|
131
|
+
w: i,
|
|
132
|
+
m: f
|
|
268
133
|
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
function handle(n, o) {
|
|
284
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
285
|
-
}
|
|
286
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
287
|
-
var i = this.tryEntries[o],
|
|
288
|
-
a = i.completion;
|
|
289
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
290
|
-
if (i.tryLoc <= this.prev) {
|
|
291
|
-
var c = n.call(i, "catchLoc"),
|
|
292
|
-
u = n.call(i, "finallyLoc");
|
|
293
|
-
if (c && u) {
|
|
294
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
295
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
296
|
-
} else if (c) {
|
|
297
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
298
|
-
} else {
|
|
299
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
300
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
abrupt: function (t, e) {
|
|
306
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
307
|
-
var o = this.tryEntries[r];
|
|
308
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
309
|
-
var i = o;
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
314
|
-
var a = i ? i.completion : {};
|
|
315
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
316
|
-
},
|
|
317
|
-
complete: function (t, e) {
|
|
318
|
-
if ("throw" === t.type) throw t.arg;
|
|
319
|
-
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;
|
|
320
|
-
},
|
|
321
|
-
finish: function (t) {
|
|
322
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
323
|
-
var r = this.tryEntries[e];
|
|
324
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
catch: function (t) {
|
|
328
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
329
|
-
var r = this.tryEntries[e];
|
|
330
|
-
if (r.tryLoc === t) {
|
|
331
|
-
var n = r.completion;
|
|
332
|
-
if ("throw" === n.type) {
|
|
333
|
-
var o = n.arg;
|
|
334
|
-
resetTryEntry(r);
|
|
335
|
-
}
|
|
336
|
-
return o;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
throw Error("illegal catch attempt");
|
|
340
|
-
},
|
|
341
|
-
delegateYield: function (e, r, n) {
|
|
342
|
-
return this.delegate = {
|
|
343
|
-
iterator: values(e),
|
|
344
|
-
resultName: r,
|
|
345
|
-
nextLoc: n
|
|
346
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
134
|
+
})();
|
|
135
|
+
}
|
|
136
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
137
|
+
var i = Object.defineProperty;
|
|
138
|
+
try {
|
|
139
|
+
i({}, "", {});
|
|
140
|
+
} catch (e) {
|
|
141
|
+
i = 0;
|
|
142
|
+
}
|
|
143
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
144
|
+
function o(r, n) {
|
|
145
|
+
_regeneratorDefine(e, r, function (e) {
|
|
146
|
+
return this._invoke(r, n, e);
|
|
147
|
+
});
|
|
347
148
|
}
|
|
348
|
-
|
|
149
|
+
r ? i ? i(e, r, {
|
|
150
|
+
value: n,
|
|
151
|
+
enumerable: !t,
|
|
152
|
+
configurable: !t,
|
|
153
|
+
writable: !t
|
|
154
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
155
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
349
156
|
}
|
|
350
157
|
|
|
351
158
|
var axios = /*#__PURE__*/require('axios');
|
|
@@ -368,12 +175,12 @@ var RequestService = /*#__PURE__*/function () {
|
|
|
368
175
|
};
|
|
369
176
|
var _proto = RequestService.prototype;
|
|
370
177
|
_proto.request = /*#__PURE__*/function () {
|
|
371
|
-
var _request = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
372
|
-
var _response$data$title, _response$data, _response$data$messag, _response$data2, _response$data$data, _response$data3, _request2, response, _response$data$title2, _response$data4, _response$data$messag2, _response$data5, _response$data$data2, _response$data6, _response;
|
|
373
|
-
return
|
|
374
|
-
while (1) switch (_context.
|
|
178
|
+
var _request = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(method, url, body, queries, headers) {
|
|
179
|
+
var _response$data$title, _response$data, _response$data$messag, _response$data2, _response$data$data, _response$data3, _request2, response, _response$data$title2, _response$data4, _response$data$messag2, _response$data5, _response$data$data2, _response$data6, _response, _t;
|
|
180
|
+
return _regenerator().w(function (_context) {
|
|
181
|
+
while (1) switch (_context.p = _context.n) {
|
|
375
182
|
case 0:
|
|
376
|
-
_context.
|
|
183
|
+
_context.p = 0;
|
|
377
184
|
_request2 = {
|
|
378
185
|
method: method,
|
|
379
186
|
url: url,
|
|
@@ -383,39 +190,38 @@ var RequestService = /*#__PURE__*/function () {
|
|
|
383
190
|
data: body,
|
|
384
191
|
params: queries
|
|
385
192
|
};
|
|
386
|
-
_context.
|
|
193
|
+
_context.n = 1;
|
|
387
194
|
return this.http.request(_request2, {
|
|
388
195
|
validateStatus: function validateStatus(status) {
|
|
389
196
|
return !(response.status < 200 || response.status > 299);
|
|
390
197
|
}
|
|
391
198
|
});
|
|
392
|
-
case
|
|
393
|
-
response = _context.
|
|
394
|
-
return _context.
|
|
395
|
-
case
|
|
396
|
-
_context.
|
|
397
|
-
|
|
398
|
-
if (!
|
|
399
|
-
_context.
|
|
199
|
+
case 1:
|
|
200
|
+
response = _context.v;
|
|
201
|
+
return _context.a(2, [true, response.status, (_response$data$title = (_response$data = response.data) == null ? void 0 : _response$data.title) != null ? _response$data$title : response.statusText, (_response$data$messag = (_response$data2 = response.data) == null ? void 0 : _response$data2.message) != null ? _response$data$messag : response.status + " - " + response.statusText, (_response$data$data = (_response$data3 = response.data) == null ? void 0 : _response$data3.data) != null ? _response$data$data : response.data]);
|
|
202
|
+
case 2:
|
|
203
|
+
_context.p = 2;
|
|
204
|
+
_t = _context.v;
|
|
205
|
+
if (!_t.response) {
|
|
206
|
+
_context.n = 3;
|
|
400
207
|
break;
|
|
401
208
|
}
|
|
402
209
|
// The request was made and the server responded with a status code
|
|
403
210
|
// that falls out of the range of 2xx
|
|
404
|
-
_response =
|
|
405
|
-
return _context.
|
|
406
|
-
case
|
|
407
|
-
if (!
|
|
408
|
-
_context.
|
|
211
|
+
_response = _t.response;
|
|
212
|
+
return _context.a(2, [false, _response.status, (_response$data$title2 = (_response$data4 = _response.data) == null ? void 0 : _response$data4.title) != null ? _response$data$title2 : _response.statusText, (_response$data$messag2 = (_response$data5 = _response.data) == null ? void 0 : _response$data5.message) != null ? _response$data$messag2 : _response.status + " - " + _response.statusText, (_response$data$data2 = (_response$data6 = _response.data) == null ? void 0 : _response$data6.data) != null ? _response$data$data2 : _response.data]);
|
|
213
|
+
case 3:
|
|
214
|
+
if (!_t.request) {
|
|
215
|
+
_context.n = 4;
|
|
409
216
|
break;
|
|
410
217
|
}
|
|
411
|
-
return _context.
|
|
412
|
-
case
|
|
413
|
-
return _context.
|
|
414
|
-
case
|
|
415
|
-
|
|
416
|
-
return _context.stop();
|
|
218
|
+
return _context.a(2, [false, 503, 'Service is Down', 'Unable to get any response from the ', _t]);
|
|
219
|
+
case 4:
|
|
220
|
+
return _context.a(2, [false, 403, 'Service is Down', 'Could not make the request, check and try again.', _t]);
|
|
221
|
+
case 5:
|
|
222
|
+
return _context.a(2);
|
|
417
223
|
}
|
|
418
|
-
}, _callee, this, [[0,
|
|
224
|
+
}, _callee, this, [[0, 2]]);
|
|
419
225
|
}));
|
|
420
226
|
function request(_x, _x2, _x3, _x4, _x5) {
|
|
421
227
|
return _request.apply(this, arguments);
|
|
@@ -423,34 +229,31 @@ var RequestService = /*#__PURE__*/function () {
|
|
|
423
229
|
return request;
|
|
424
230
|
}();
|
|
425
231
|
_proto.requestWithError = /*#__PURE__*/function () {
|
|
426
|
-
var _requestWithError = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
232
|
+
var _requestWithError = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(method, url, body, queries, headers) {
|
|
427
233
|
var _yield$this$request, status, httpStatus, title, message, response, _response$message;
|
|
428
|
-
return
|
|
429
|
-
while (1) switch (_context2.
|
|
234
|
+
return _regenerator().w(function (_context2) {
|
|
235
|
+
while (1) switch (_context2.n) {
|
|
430
236
|
case 0:
|
|
431
|
-
_context2.
|
|
237
|
+
_context2.n = 1;
|
|
432
238
|
return this.request(method, url, body, queries, headers);
|
|
433
|
-
case
|
|
434
|
-
_yield$this$request = _context2.
|
|
239
|
+
case 1:
|
|
240
|
+
_yield$this$request = _context2.v;
|
|
435
241
|
status = _yield$this$request[0];
|
|
436
242
|
httpStatus = _yield$this$request[1];
|
|
437
243
|
title = _yield$this$request[2];
|
|
438
244
|
message = _yield$this$request[3];
|
|
439
245
|
response = _yield$this$request[4];
|
|
440
246
|
if (!(status !== true)) {
|
|
441
|
-
_context2.
|
|
247
|
+
_context2.n = 2;
|
|
442
248
|
break;
|
|
443
249
|
}
|
|
444
250
|
throw new Error(httpStatus + ": " + title + " " + ((_response$message = response == null ? void 0 : response.message) != null ? _response$message : message));
|
|
445
|
-
case
|
|
446
|
-
return _context2.
|
|
447
|
-
case 11:
|
|
448
|
-
case "end":
|
|
449
|
-
return _context2.stop();
|
|
251
|
+
case 2:
|
|
252
|
+
return _context2.a(2, response);
|
|
450
253
|
}
|
|
451
254
|
}, _callee2, this);
|
|
452
255
|
}));
|
|
453
|
-
function requestWithError(_x6, _x7, _x8, _x9,
|
|
256
|
+
function requestWithError(_x6, _x7, _x8, _x9, _x0) {
|
|
454
257
|
return _requestWithError.apply(this, arguments);
|
|
455
258
|
}
|
|
456
259
|
return requestWithError;
|
|
@@ -507,34 +310,54 @@ var requestService = function requestService(interceptors) {
|
|
|
507
310
|
return RequestService.singleton(interceptors);
|
|
508
311
|
};
|
|
509
312
|
|
|
313
|
+
var StoreType;
|
|
314
|
+
(function (StoreType) {
|
|
315
|
+
StoreType["File"] = "file";
|
|
316
|
+
StoreType["Memory"] = "memory";
|
|
317
|
+
})(StoreType || (StoreType = {}));
|
|
318
|
+
var StoreFileType;
|
|
319
|
+
(function (StoreFileType) {
|
|
320
|
+
StoreFileType["JSON"] = "json";
|
|
321
|
+
StoreFileType["YAML"] = "yaml";
|
|
322
|
+
})(StoreFileType || (StoreFileType = {}));
|
|
323
|
+
|
|
324
|
+
var YAML = /*#__PURE__*/require('js-yaml');
|
|
510
325
|
var FileStore = /*#__PURE__*/function () {
|
|
511
|
-
function FileStore(path) {
|
|
326
|
+
function FileStore(path, type) {
|
|
327
|
+
if (type === void 0) {
|
|
328
|
+
type = StoreFileType.JSON;
|
|
329
|
+
}
|
|
512
330
|
this.path = void 0;
|
|
331
|
+
this.type = StoreFileType.JSON;
|
|
513
332
|
this.path = path;
|
|
333
|
+
this.type = type;
|
|
514
334
|
}
|
|
515
335
|
var _proto = FileStore.prototype;
|
|
516
336
|
_proto.save = /*#__PURE__*/function () {
|
|
517
|
-
var _save = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
518
|
-
var
|
|
519
|
-
return
|
|
520
|
-
while (1) switch (_context.
|
|
337
|
+
var _save = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data) {
|
|
338
|
+
var fileData, _t;
|
|
339
|
+
return _regenerator().w(function (_context) {
|
|
340
|
+
while (1) switch (_context.p = _context.n) {
|
|
521
341
|
case 0:
|
|
522
|
-
_context.
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
342
|
+
_context.p = 0;
|
|
343
|
+
if (this.type === StoreFileType.YAML) {
|
|
344
|
+
fileData = YAML.dump(data);
|
|
345
|
+
} else {
|
|
346
|
+
fileData = JSON.stringify(data, null, 2);
|
|
347
|
+
}
|
|
348
|
+
_context.n = 1;
|
|
349
|
+
return writeFile(this.path, fileData, 'utf8');
|
|
350
|
+
case 1:
|
|
351
|
+
_context.n = 3;
|
|
528
352
|
break;
|
|
529
|
-
case
|
|
530
|
-
_context.
|
|
531
|
-
|
|
532
|
-
throw new Error("Failed to save data: " +
|
|
533
|
-
case
|
|
534
|
-
|
|
535
|
-
return _context.stop();
|
|
353
|
+
case 2:
|
|
354
|
+
_context.p = 2;
|
|
355
|
+
_t = _context.v;
|
|
356
|
+
throw new Error("Failed to save data: " + _t.message);
|
|
357
|
+
case 3:
|
|
358
|
+
return _context.a(2);
|
|
536
359
|
}
|
|
537
|
-
}, _callee, this, [[0,
|
|
360
|
+
}, _callee, this, [[0, 2]]);
|
|
538
361
|
}));
|
|
539
362
|
function save(_x) {
|
|
540
363
|
return _save.apply(this, arguments);
|
|
@@ -542,32 +365,40 @@ var FileStore = /*#__PURE__*/function () {
|
|
|
542
365
|
return save;
|
|
543
366
|
}();
|
|
544
367
|
_proto.retrieve = /*#__PURE__*/function () {
|
|
545
|
-
var _retrieve = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
546
|
-
var data;
|
|
547
|
-
return
|
|
548
|
-
while (1) switch (_context2.
|
|
368
|
+
var _retrieve = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
369
|
+
var data, _t2;
|
|
370
|
+
return _regenerator().w(function (_context2) {
|
|
371
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
549
372
|
case 0:
|
|
550
|
-
_context2.
|
|
551
|
-
_context2.
|
|
373
|
+
_context2.p = 0;
|
|
374
|
+
_context2.n = 1;
|
|
552
375
|
return readFile(this.path, 'utf8');
|
|
376
|
+
case 1:
|
|
377
|
+
data = _context2.v;
|
|
378
|
+
if (!(this.type === StoreFileType.YAML)) {
|
|
379
|
+
_context2.n = 2;
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
return _context2.a(2, YAML.load(data));
|
|
383
|
+
case 2:
|
|
384
|
+
return _context2.a(2, JSON.parse(data));
|
|
553
385
|
case 3:
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
case
|
|
557
|
-
_context2.
|
|
558
|
-
|
|
559
|
-
if (!(
|
|
560
|
-
_context2.
|
|
386
|
+
_context2.n = 6;
|
|
387
|
+
break;
|
|
388
|
+
case 4:
|
|
389
|
+
_context2.p = 4;
|
|
390
|
+
_t2 = _context2.v;
|
|
391
|
+
if (!(_t2.code === 'ENOENT')) {
|
|
392
|
+
_context2.n = 5;
|
|
561
393
|
break;
|
|
562
394
|
}
|
|
563
|
-
return _context2.
|
|
564
|
-
case
|
|
565
|
-
throw new Error("Failed to retrieve data: " +
|
|
566
|
-
case
|
|
567
|
-
|
|
568
|
-
return _context2.stop();
|
|
395
|
+
return _context2.a(2, null);
|
|
396
|
+
case 5:
|
|
397
|
+
throw new Error("Failed to retrieve data: " + _t2.message);
|
|
398
|
+
case 6:
|
|
399
|
+
return _context2.a(2);
|
|
569
400
|
}
|
|
570
|
-
}, _callee2, this, [[0,
|
|
401
|
+
}, _callee2, this, [[0, 4]]);
|
|
571
402
|
}));
|
|
572
403
|
function retrieve() {
|
|
573
404
|
return _retrieve.apply(this, arguments);
|
|
@@ -586,14 +417,13 @@ var MemoryStore = /*#__PURE__*/function () {
|
|
|
586
417
|
}
|
|
587
418
|
var _proto = MemoryStore.prototype;
|
|
588
419
|
_proto.save = /*#__PURE__*/function () {
|
|
589
|
-
var _save = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
590
|
-
return
|
|
591
|
-
while (1) switch (_context.
|
|
420
|
+
var _save = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data) {
|
|
421
|
+
return _regenerator().w(function (_context) {
|
|
422
|
+
while (1) switch (_context.n) {
|
|
592
423
|
case 0:
|
|
593
424
|
this.storage[this.path] = data;
|
|
594
425
|
case 1:
|
|
595
|
-
|
|
596
|
-
return _context.stop();
|
|
426
|
+
return _context.a(2);
|
|
597
427
|
}
|
|
598
428
|
}, _callee, this);
|
|
599
429
|
}));
|
|
@@ -603,14 +433,11 @@ var MemoryStore = /*#__PURE__*/function () {
|
|
|
603
433
|
return save;
|
|
604
434
|
}();
|
|
605
435
|
_proto.retrieve = /*#__PURE__*/function () {
|
|
606
|
-
var _retrieve = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
607
|
-
return
|
|
608
|
-
while (1) switch (_context2.
|
|
436
|
+
var _retrieve = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
437
|
+
return _regenerator().w(function (_context2) {
|
|
438
|
+
while (1) switch (_context2.n) {
|
|
609
439
|
case 0:
|
|
610
|
-
return _context2.
|
|
611
|
-
case 1:
|
|
612
|
-
case "end":
|
|
613
|
-
return _context2.stop();
|
|
440
|
+
return _context2.a(2, this.storage[this.path]);
|
|
614
441
|
}
|
|
615
442
|
}, _callee2, this);
|
|
616
443
|
}));
|
|
@@ -622,12 +449,6 @@ var MemoryStore = /*#__PURE__*/function () {
|
|
|
622
449
|
return MemoryStore;
|
|
623
450
|
}();
|
|
624
451
|
|
|
625
|
-
var StoreType;
|
|
626
|
-
(function (StoreType) {
|
|
627
|
-
StoreType["File"] = "file";
|
|
628
|
-
StoreType["Memory"] = "memory";
|
|
629
|
-
})(StoreType || (StoreType = {}));
|
|
630
|
-
|
|
631
452
|
var LocalStorage = /*#__PURE__*/function () {
|
|
632
453
|
function LocalStorage(domain, path, storeType) {
|
|
633
454
|
if (storeType === void 0) {
|
|
@@ -641,6 +462,8 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
641
462
|
this.store = new FileStore(path);
|
|
642
463
|
break;
|
|
643
464
|
case StoreType.Memory:
|
|
465
|
+
this.store = new MemoryStore(path);
|
|
466
|
+
break;
|
|
644
467
|
default:
|
|
645
468
|
this.store = new MemoryStore(path);
|
|
646
469
|
break;
|
|
@@ -648,24 +471,22 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
648
471
|
}
|
|
649
472
|
var _proto = LocalStorage.prototype;
|
|
650
473
|
_proto.getStorage = /*#__PURE__*/function () {
|
|
651
|
-
var _getStorage = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
652
|
-
|
|
653
|
-
|
|
474
|
+
var _getStorage = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
475
|
+
var _t;
|
|
476
|
+
return _regenerator().w(function (_context) {
|
|
477
|
+
while (1) switch (_context.n) {
|
|
654
478
|
case 0:
|
|
655
|
-
_context.
|
|
479
|
+
_context.n = 1;
|
|
656
480
|
return this.store.retrieve();
|
|
657
|
-
case
|
|
658
|
-
|
|
659
|
-
if (
|
|
660
|
-
_context.
|
|
481
|
+
case 1:
|
|
482
|
+
_t = _context.v;
|
|
483
|
+
if (_t) {
|
|
484
|
+
_context.n = 2;
|
|
661
485
|
break;
|
|
662
486
|
}
|
|
663
|
-
|
|
664
|
-
case
|
|
665
|
-
return _context.
|
|
666
|
-
case 6:
|
|
667
|
-
case "end":
|
|
668
|
-
return _context.stop();
|
|
487
|
+
_t = {};
|
|
488
|
+
case 2:
|
|
489
|
+
return _context.a(2, _t);
|
|
669
490
|
}
|
|
670
491
|
}, _callee, this);
|
|
671
492
|
}));
|
|
@@ -675,24 +496,23 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
675
496
|
return getStorage;
|
|
676
497
|
}();
|
|
677
498
|
_proto.setItem = /*#__PURE__*/function () {
|
|
678
|
-
var _setItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
499
|
+
var _setItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(key, value) {
|
|
679
500
|
var storage;
|
|
680
|
-
return
|
|
681
|
-
while (1) switch (_context2.
|
|
501
|
+
return _regenerator().w(function (_context2) {
|
|
502
|
+
while (1) switch (_context2.n) {
|
|
682
503
|
case 0:
|
|
683
|
-
_context2.
|
|
504
|
+
_context2.n = 1;
|
|
684
505
|
return this.getStorage();
|
|
685
|
-
case
|
|
686
|
-
storage = _context2.
|
|
506
|
+
case 1:
|
|
507
|
+
storage = _context2.v;
|
|
687
508
|
if (!storage[this.domain]) {
|
|
688
509
|
storage[this.domain] = {};
|
|
689
510
|
}
|
|
690
511
|
storage[this.domain][key] = value;
|
|
691
|
-
_context2.
|
|
512
|
+
_context2.n = 2;
|
|
692
513
|
return this.store.save(storage);
|
|
693
|
-
case
|
|
694
|
-
|
|
695
|
-
return _context2.stop();
|
|
514
|
+
case 2:
|
|
515
|
+
return _context2.a(2);
|
|
696
516
|
}
|
|
697
517
|
}, _callee2, this);
|
|
698
518
|
}));
|
|
@@ -702,20 +522,17 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
702
522
|
return setItem;
|
|
703
523
|
}();
|
|
704
524
|
_proto.getItem = /*#__PURE__*/function () {
|
|
705
|
-
var _getItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
525
|
+
var _getItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(key) {
|
|
706
526
|
var _storage$this$domain;
|
|
707
527
|
var storage;
|
|
708
|
-
return
|
|
709
|
-
while (1) switch (_context3.
|
|
528
|
+
return _regenerator().w(function (_context3) {
|
|
529
|
+
while (1) switch (_context3.n) {
|
|
710
530
|
case 0:
|
|
711
|
-
_context3.
|
|
531
|
+
_context3.n = 1;
|
|
712
532
|
return this.getStorage();
|
|
713
|
-
case
|
|
714
|
-
storage = _context3.
|
|
715
|
-
return _context3.
|
|
716
|
-
case 4:
|
|
717
|
-
case "end":
|
|
718
|
-
return _context3.stop();
|
|
533
|
+
case 1:
|
|
534
|
+
storage = _context3.v;
|
|
535
|
+
return _context3.a(2, ((_storage$this$domain = storage[this.domain]) == null ? void 0 : _storage$this$domain[key]) || null);
|
|
719
536
|
}
|
|
720
537
|
}, _callee3, this);
|
|
721
538
|
}));
|
|
@@ -725,19 +542,16 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
725
542
|
return getItem;
|
|
726
543
|
}();
|
|
727
544
|
_proto.getAll = /*#__PURE__*/function () {
|
|
728
|
-
var _getAll = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
545
|
+
var _getAll = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
729
546
|
var storage;
|
|
730
|
-
return
|
|
731
|
-
while (1) switch (_context4.
|
|
547
|
+
return _regenerator().w(function (_context4) {
|
|
548
|
+
while (1) switch (_context4.n) {
|
|
732
549
|
case 0:
|
|
733
|
-
_context4.
|
|
550
|
+
_context4.n = 1;
|
|
734
551
|
return this.getStorage();
|
|
735
|
-
case
|
|
736
|
-
storage = _context4.
|
|
737
|
-
return _context4.
|
|
738
|
-
case 4:
|
|
739
|
-
case "end":
|
|
740
|
-
return _context4.stop();
|
|
552
|
+
case 1:
|
|
553
|
+
storage = _context4.v;
|
|
554
|
+
return _context4.a(2, storage[this.domain]);
|
|
741
555
|
}
|
|
742
556
|
}, _callee4, this);
|
|
743
557
|
}));
|
|
@@ -747,25 +561,24 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
747
561
|
return getAll;
|
|
748
562
|
}();
|
|
749
563
|
_proto.removeItem = /*#__PURE__*/function () {
|
|
750
|
-
var _removeItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
564
|
+
var _removeItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(key) {
|
|
751
565
|
var storage;
|
|
752
|
-
return
|
|
753
|
-
while (1) switch (_context5.
|
|
566
|
+
return _regenerator().w(function (_context5) {
|
|
567
|
+
while (1) switch (_context5.n) {
|
|
754
568
|
case 0:
|
|
755
|
-
_context5.
|
|
569
|
+
_context5.n = 1;
|
|
756
570
|
return this.getStorage();
|
|
757
|
-
case
|
|
758
|
-
storage = _context5.
|
|
571
|
+
case 1:
|
|
572
|
+
storage = _context5.v;
|
|
759
573
|
if (!storage[this.domain]) {
|
|
760
|
-
_context5.
|
|
574
|
+
_context5.n = 2;
|
|
761
575
|
break;
|
|
762
576
|
}
|
|
763
577
|
delete storage[this.domain][key];
|
|
764
|
-
_context5.
|
|
578
|
+
_context5.n = 2;
|
|
765
579
|
return this.store.save(storage);
|
|
766
|
-
case
|
|
767
|
-
|
|
768
|
-
return _context5.stop();
|
|
580
|
+
case 2:
|
|
581
|
+
return _context5.a(2);
|
|
769
582
|
}
|
|
770
583
|
}, _callee5, this);
|
|
771
584
|
}));
|
|
@@ -775,25 +588,24 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
775
588
|
return removeItem;
|
|
776
589
|
}();
|
|
777
590
|
_proto.clear = /*#__PURE__*/function () {
|
|
778
|
-
var _clear = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
591
|
+
var _clear = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
779
592
|
var storage;
|
|
780
|
-
return
|
|
781
|
-
while (1) switch (_context6.
|
|
593
|
+
return _regenerator().w(function (_context6) {
|
|
594
|
+
while (1) switch (_context6.n) {
|
|
782
595
|
case 0:
|
|
783
|
-
_context6.
|
|
596
|
+
_context6.n = 1;
|
|
784
597
|
return this.getStorage();
|
|
785
|
-
case
|
|
786
|
-
storage = _context6.
|
|
598
|
+
case 1:
|
|
599
|
+
storage = _context6.v;
|
|
787
600
|
if (!storage[this.domain]) {
|
|
788
|
-
_context6.
|
|
601
|
+
_context6.n = 2;
|
|
789
602
|
break;
|
|
790
603
|
}
|
|
791
604
|
delete storage[this.domain];
|
|
792
|
-
_context6.
|
|
605
|
+
_context6.n = 2;
|
|
793
606
|
return this.store.save(storage);
|
|
794
|
-
case
|
|
795
|
-
|
|
796
|
-
return _context6.stop();
|
|
607
|
+
case 2:
|
|
608
|
+
return _context6.a(2);
|
|
797
609
|
}
|
|
798
610
|
}, _callee6, this);
|
|
799
611
|
}));
|
|
@@ -807,6 +619,9 @@ var LocalStorage = /*#__PURE__*/function () {
|
|
|
807
619
|
|
|
808
620
|
var SessionStorage = /*#__PURE__*/function () {
|
|
809
621
|
function SessionStorage(domain, sessionId, path, storeType) {
|
|
622
|
+
if (storeType === void 0) {
|
|
623
|
+
storeType = StoreType.Memory;
|
|
624
|
+
}
|
|
810
625
|
this.store = void 0;
|
|
811
626
|
this.domain = void 0;
|
|
812
627
|
this.sessionId = void 0;
|
|
@@ -817,6 +632,8 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
817
632
|
this.store = new FileStore(path);
|
|
818
633
|
break;
|
|
819
634
|
case StoreType.Memory:
|
|
635
|
+
this.store = new MemoryStore(path);
|
|
636
|
+
break;
|
|
820
637
|
default:
|
|
821
638
|
this.store = new MemoryStore(path);
|
|
822
639
|
break;
|
|
@@ -824,24 +641,22 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
824
641
|
}
|
|
825
642
|
var _proto = SessionStorage.prototype;
|
|
826
643
|
_proto.getStorage = /*#__PURE__*/function () {
|
|
827
|
-
var _getStorage = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
828
|
-
|
|
829
|
-
|
|
644
|
+
var _getStorage = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
645
|
+
var _t;
|
|
646
|
+
return _regenerator().w(function (_context) {
|
|
647
|
+
while (1) switch (_context.n) {
|
|
830
648
|
case 0:
|
|
831
|
-
_context.
|
|
649
|
+
_context.n = 1;
|
|
832
650
|
return this.store.retrieve();
|
|
833
|
-
case
|
|
834
|
-
|
|
835
|
-
if (
|
|
836
|
-
_context.
|
|
651
|
+
case 1:
|
|
652
|
+
_t = _context.v;
|
|
653
|
+
if (_t) {
|
|
654
|
+
_context.n = 2;
|
|
837
655
|
break;
|
|
838
656
|
}
|
|
839
|
-
|
|
840
|
-
case
|
|
841
|
-
return _context.
|
|
842
|
-
case 6:
|
|
843
|
-
case "end":
|
|
844
|
-
return _context.stop();
|
|
657
|
+
_t = {};
|
|
658
|
+
case 2:
|
|
659
|
+
return _context.a(2, _t);
|
|
845
660
|
}
|
|
846
661
|
}, _callee, this);
|
|
847
662
|
}));
|
|
@@ -851,15 +666,15 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
851
666
|
return getStorage;
|
|
852
667
|
}();
|
|
853
668
|
_proto.setItem = /*#__PURE__*/function () {
|
|
854
|
-
var _setItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
669
|
+
var _setItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(key, value) {
|
|
855
670
|
var storage;
|
|
856
|
-
return
|
|
857
|
-
while (1) switch (_context2.
|
|
671
|
+
return _regenerator().w(function (_context2) {
|
|
672
|
+
while (1) switch (_context2.n) {
|
|
858
673
|
case 0:
|
|
859
|
-
_context2.
|
|
674
|
+
_context2.n = 1;
|
|
860
675
|
return this.getStorage();
|
|
861
|
-
case
|
|
862
|
-
storage = _context2.
|
|
676
|
+
case 1:
|
|
677
|
+
storage = _context2.v;
|
|
863
678
|
if (!storage[this.domain]) {
|
|
864
679
|
storage[this.domain] = {};
|
|
865
680
|
}
|
|
@@ -867,11 +682,10 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
867
682
|
storage[this.domain][this.sessionId] = {};
|
|
868
683
|
}
|
|
869
684
|
storage[this.domain][this.sessionId][key] = value;
|
|
870
|
-
_context2.
|
|
685
|
+
_context2.n = 2;
|
|
871
686
|
return this.store.save(storage);
|
|
872
|
-
case
|
|
873
|
-
|
|
874
|
-
return _context2.stop();
|
|
687
|
+
case 2:
|
|
688
|
+
return _context2.a(2);
|
|
875
689
|
}
|
|
876
690
|
}, _callee2, this);
|
|
877
691
|
}));
|
|
@@ -881,20 +695,17 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
881
695
|
return setItem;
|
|
882
696
|
}();
|
|
883
697
|
_proto.getItem = /*#__PURE__*/function () {
|
|
884
|
-
var _getItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
698
|
+
var _getItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(key) {
|
|
885
699
|
var _storage$this$domain;
|
|
886
700
|
var storage;
|
|
887
|
-
return
|
|
888
|
-
while (1) switch (_context3.
|
|
701
|
+
return _regenerator().w(function (_context3) {
|
|
702
|
+
while (1) switch (_context3.n) {
|
|
889
703
|
case 0:
|
|
890
|
-
_context3.
|
|
704
|
+
_context3.n = 1;
|
|
891
705
|
return this.getStorage();
|
|
892
|
-
case
|
|
893
|
-
storage = _context3.
|
|
894
|
-
return _context3.
|
|
895
|
-
case 4:
|
|
896
|
-
case "end":
|
|
897
|
-
return _context3.stop();
|
|
706
|
+
case 1:
|
|
707
|
+
storage = _context3.v;
|
|
708
|
+
return _context3.a(2, ((_storage$this$domain = storage[this.domain]) == null || (_storage$this$domain = _storage$this$domain[this.sessionId]) == null ? void 0 : _storage$this$domain[key]) || null);
|
|
898
709
|
}
|
|
899
710
|
}, _callee3, this);
|
|
900
711
|
}));
|
|
@@ -904,20 +715,17 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
904
715
|
return getItem;
|
|
905
716
|
}();
|
|
906
717
|
_proto.getAll = /*#__PURE__*/function () {
|
|
907
|
-
var _getAll = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
718
|
+
var _getAll = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
908
719
|
var _storage$this$domain2;
|
|
909
720
|
var storage;
|
|
910
|
-
return
|
|
911
|
-
while (1) switch (_context4.
|
|
721
|
+
return _regenerator().w(function (_context4) {
|
|
722
|
+
while (1) switch (_context4.n) {
|
|
912
723
|
case 0:
|
|
913
|
-
_context4.
|
|
724
|
+
_context4.n = 1;
|
|
914
725
|
return this.getStorage();
|
|
915
|
-
case
|
|
916
|
-
storage = _context4.
|
|
917
|
-
return _context4.
|
|
918
|
-
case 4:
|
|
919
|
-
case "end":
|
|
920
|
-
return _context4.stop();
|
|
726
|
+
case 1:
|
|
727
|
+
storage = _context4.v;
|
|
728
|
+
return _context4.a(2, ((_storage$this$domain2 = storage[this.domain]) == null ? void 0 : _storage$this$domain2[this.sessionId]) || null);
|
|
921
729
|
}
|
|
922
730
|
}, _callee4, this);
|
|
923
731
|
}));
|
|
@@ -927,26 +735,25 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
927
735
|
return getAll;
|
|
928
736
|
}();
|
|
929
737
|
_proto.removeItem = /*#__PURE__*/function () {
|
|
930
|
-
var _removeItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
738
|
+
var _removeItem = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(key) {
|
|
931
739
|
var _storage$this$domain3;
|
|
932
740
|
var storage;
|
|
933
|
-
return
|
|
934
|
-
while (1) switch (_context5.
|
|
741
|
+
return _regenerator().w(function (_context5) {
|
|
742
|
+
while (1) switch (_context5.n) {
|
|
935
743
|
case 0:
|
|
936
|
-
_context5.
|
|
744
|
+
_context5.n = 1;
|
|
937
745
|
return this.getStorage();
|
|
938
|
-
case
|
|
939
|
-
storage = _context5.
|
|
746
|
+
case 1:
|
|
747
|
+
storage = _context5.v;
|
|
940
748
|
if (!((_storage$this$domain3 = storage[this.domain]) != null && _storage$this$domain3[this.sessionId])) {
|
|
941
|
-
_context5.
|
|
749
|
+
_context5.n = 2;
|
|
942
750
|
break;
|
|
943
751
|
}
|
|
944
752
|
delete storage[this.domain][this.sessionId][key];
|
|
945
|
-
_context5.
|
|
753
|
+
_context5.n = 2;
|
|
946
754
|
return this.store.save(storage);
|
|
947
|
-
case
|
|
948
|
-
|
|
949
|
-
return _context5.stop();
|
|
755
|
+
case 2:
|
|
756
|
+
return _context5.a(2);
|
|
950
757
|
}
|
|
951
758
|
}, _callee5, this);
|
|
952
759
|
}));
|
|
@@ -956,26 +763,25 @@ var SessionStorage = /*#__PURE__*/function () {
|
|
|
956
763
|
return removeItem;
|
|
957
764
|
}();
|
|
958
765
|
_proto.clear = /*#__PURE__*/function () {
|
|
959
|
-
var _clear = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
766
|
+
var _clear = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
960
767
|
var _storage$this$domain4;
|
|
961
768
|
var storage;
|
|
962
|
-
return
|
|
963
|
-
while (1) switch (_context6.
|
|
769
|
+
return _regenerator().w(function (_context6) {
|
|
770
|
+
while (1) switch (_context6.n) {
|
|
964
771
|
case 0:
|
|
965
|
-
_context6.
|
|
772
|
+
_context6.n = 1;
|
|
966
773
|
return this.getStorage();
|
|
967
|
-
case
|
|
968
|
-
storage = _context6.
|
|
774
|
+
case 1:
|
|
775
|
+
storage = _context6.v;
|
|
969
776
|
if (!((_storage$this$domain4 = storage[this.domain]) != null && _storage$this$domain4[this.sessionId])) {
|
|
970
|
-
_context6.
|
|
777
|
+
_context6.n = 2;
|
|
971
778
|
break;
|
|
972
779
|
}
|
|
973
780
|
delete storage[this.domain][this.sessionId];
|
|
974
|
-
_context6.
|
|
781
|
+
_context6.n = 2;
|
|
975
782
|
return this.store.save(storage);
|
|
976
|
-
case
|
|
977
|
-
|
|
978
|
-
return _context6.stop();
|
|
783
|
+
case 2:
|
|
784
|
+
return _context6.a(2);
|
|
979
785
|
}
|
|
980
786
|
}, _callee6, this);
|
|
981
787
|
}));
|
|
@@ -1113,5 +919,5 @@ var LogType;
|
|
|
1113
919
|
LogType["ERROR"] = "error";
|
|
1114
920
|
})(LogType || (LogType = {}));
|
|
1115
921
|
|
|
1116
|
-
export { CategoryType, EventEntityType, FileStore, LocalStorage, LogType, MemoryStore, RequestService, SessionStorage, StorageType, StoreType, clone, getCurrentWorkingDirectory, getRootDomain, getUserHomeDirectory, isBrowser, isFunction, isNode, isObject, managedLog, _recursiveMerge as recursiveMerge, requestService, sleep, splitIntoTwo, _stackTrace as stackTrace };
|
|
922
|
+
export { CategoryType, EventEntityType, FileStore, LocalStorage, LogType, MemoryStore, RequestService, SessionStorage, StorageType, StoreFileType, StoreType, clone, getCurrentWorkingDirectory, getRootDomain, getUserHomeDirectory, isBrowser, isFunction, isNode, isObject, managedLog, _recursiveMerge as recursiveMerge, requestService, sleep, splitIntoTwo, _stackTrace as stackTrace };
|
|
1117
923
|
//# sourceMappingURL=jsx-core.esm.js.map
|