miolo 2.0.0-beta.26 → 2.0.0-beta.28
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/cli/miolo.cli.umd.js +235 -462
- package/dist/cli/miolo.cli.umd.js.map +1 -1
- package/dist/cli-react/miolo.cli-react.umd.js +279 -502
- package/dist/cli-react/miolo.cli-react.umd.js.map +1 -1
- package/dist/server/miolo.server.node.mjs +955 -1263
- package/package.json +13 -13
- package/src/cli-react/context/MioloContextProvider.jsx +27 -19
- package/src/server/middleware/http/custom_blacklist.mjs +2 -1
- package/src/server/middleware/routes/router/crud/attachCrudRoutes.mjs +1 -1
- package/src/server/middleware/routes/router/queries/attachQueriesRoutes.mjs +1 -1
- package/src/cli/fetcher/v1.tar.gz +0 -0
- package/src/cli-react/_jsx.tar.gz +0 -0
- package/src/cli-react/ssr/hooks.tar.gz +0 -0
- package/src/server/middleware/ssr/_old.tar.gz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* miolo v2.0.0-beta.
|
|
2
|
+
* miolo v2.0.0-beta.28
|
|
3
3
|
*
|
|
4
4
|
* https://www.afialapis.com/os/miolo
|
|
5
5
|
*
|
|
@@ -118,306 +118,115 @@
|
|
|
118
118
|
return n;
|
|
119
119
|
}, _extends.apply(null, arguments);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
return o(a, "_invoke", {
|
|
156
|
-
value: makeInvokeMethod(t, r, c)
|
|
157
|
-
}), a;
|
|
158
|
-
}
|
|
159
|
-
function tryCatch(t, e, r) {
|
|
160
|
-
try {
|
|
161
|
-
return {
|
|
162
|
-
type: "normal",
|
|
163
|
-
arg: t.call(e, r)
|
|
164
|
-
};
|
|
165
|
-
} catch (t) {
|
|
166
|
-
return {
|
|
167
|
-
type: "throw",
|
|
168
|
-
arg: t
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
e.wrap = wrap;
|
|
173
|
-
var h = "suspendedStart",
|
|
174
|
-
l = "suspendedYield",
|
|
175
|
-
f = "executing",
|
|
176
|
-
s = "completed",
|
|
177
|
-
y = {};
|
|
178
|
-
function Generator() {}
|
|
179
|
-
function GeneratorFunction() {}
|
|
180
|
-
function GeneratorFunctionPrototype() {}
|
|
181
|
-
var p = {};
|
|
182
|
-
define(p, a, function () {
|
|
183
|
-
return this;
|
|
184
|
-
});
|
|
185
|
-
var d = Object.getPrototypeOf,
|
|
186
|
-
v = d && d(d(values([])));
|
|
187
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
188
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
189
|
-
function defineIteratorMethods(t) {
|
|
190
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
191
|
-
define(t, e, function (t) {
|
|
192
|
-
return this._invoke(e, t);
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
function AsyncIterator(t, e) {
|
|
197
|
-
function invoke(r, o, i, a) {
|
|
198
|
-
var c = tryCatch(t[r], t, o);
|
|
199
|
-
if ("throw" !== c.type) {
|
|
200
|
-
var u = c.arg,
|
|
201
|
-
h = u.value;
|
|
202
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
203
|
-
invoke("next", t, i, a);
|
|
204
|
-
}, function (t) {
|
|
205
|
-
invoke("throw", t, i, a);
|
|
206
|
-
}) : e.resolve(h).then(function (t) {
|
|
207
|
-
u.value = t, i(u);
|
|
208
|
-
}, function (t) {
|
|
209
|
-
return invoke("throw", t, i, a);
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
a(c.arg);
|
|
213
|
-
}
|
|
214
|
-
var r;
|
|
215
|
-
o(this, "_invoke", {
|
|
216
|
-
value: function (t, n) {
|
|
217
|
-
function callInvokeWithMethodAndArg() {
|
|
218
|
-
return new e(function (e, r) {
|
|
219
|
-
invoke(t, n, e, r);
|
|
220
|
-
});
|
|
121
|
+
function _regenerator() {
|
|
122
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
123
|
+
var e,
|
|
124
|
+
t,
|
|
125
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
126
|
+
n = r.iterator || "@@iterator",
|
|
127
|
+
o = r.toStringTag || "@@toStringTag";
|
|
128
|
+
function i(r, n, o, i) {
|
|
129
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
130
|
+
u = Object.create(c.prototype);
|
|
131
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
132
|
+
var i,
|
|
133
|
+
c,
|
|
134
|
+
u,
|
|
135
|
+
f = 0,
|
|
136
|
+
p = o || [],
|
|
137
|
+
y = false,
|
|
138
|
+
G = {
|
|
139
|
+
p: 0,
|
|
140
|
+
n: 0,
|
|
141
|
+
v: e,
|
|
142
|
+
a: d,
|
|
143
|
+
f: d.bind(e, 4),
|
|
144
|
+
d: function (t, r) {
|
|
145
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
function d(r, n) {
|
|
149
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
150
|
+
var o,
|
|
151
|
+
i = p[t],
|
|
152
|
+
d = G.p,
|
|
153
|
+
l = i[2];
|
|
154
|
+
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));
|
|
221
155
|
}
|
|
222
|
-
|
|
156
|
+
if (o || r > 1) return a;
|
|
157
|
+
throw y = true, n;
|
|
223
158
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
159
|
+
return function (o, p, l) {
|
|
160
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
161
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
162
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
163
|
+
try {
|
|
164
|
+
if (f = 2, i) {
|
|
165
|
+
if (c || (o = "next"), t = i[o]) {
|
|
166
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
167
|
+
if (!t.done) return t;
|
|
168
|
+
u = t.value, c < 2 && (c = 0);
|
|
169
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
170
|
+
i = e;
|
|
171
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
172
|
+
} catch (t) {
|
|
173
|
+
i = e, c = 1, u = t;
|
|
174
|
+
} finally {
|
|
175
|
+
f = 1;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
232
178
|
return {
|
|
233
179
|
value: t,
|
|
234
|
-
done:
|
|
180
|
+
done: y
|
|
235
181
|
};
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
var c = n.delegate;
|
|
239
|
-
if (c) {
|
|
240
|
-
var u = maybeInvokeDelegate(c, n);
|
|
241
|
-
if (u) {
|
|
242
|
-
if (u === y) continue;
|
|
243
|
-
return u;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
247
|
-
if (o === h) throw o = s, n.arg;
|
|
248
|
-
n.dispatchException(n.arg);
|
|
249
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
250
|
-
o = f;
|
|
251
|
-
var p = tryCatch(e, r, n);
|
|
252
|
-
if ("normal" === p.type) {
|
|
253
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
254
|
-
return {
|
|
255
|
-
value: p.arg,
|
|
256
|
-
done: n.done
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
function maybeInvokeDelegate(e, r) {
|
|
264
|
-
var n = r.method,
|
|
265
|
-
o = e.iterator[n];
|
|
266
|
-
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;
|
|
267
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
268
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
269
|
-
var a = i.arg;
|
|
270
|
-
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);
|
|
271
|
-
}
|
|
272
|
-
function pushTryEntry(t) {
|
|
273
|
-
var e = {
|
|
274
|
-
tryLoc: t[0]
|
|
275
|
-
};
|
|
276
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
277
|
-
}
|
|
278
|
-
function resetTryEntry(t) {
|
|
279
|
-
var e = t.completion || {};
|
|
280
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
281
|
-
}
|
|
282
|
-
function Context(t) {
|
|
283
|
-
this.tryEntries = [{
|
|
284
|
-
tryLoc: "root"
|
|
285
|
-
}], t.forEach(pushTryEntry, this), this.reset(true);
|
|
182
|
+
};
|
|
183
|
+
}(r, o, i), true), u;
|
|
286
184
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return i.next = i;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
185
|
+
var a = {};
|
|
186
|
+
function Generator() {}
|
|
187
|
+
function GeneratorFunction() {}
|
|
188
|
+
function GeneratorFunctionPrototype() {}
|
|
189
|
+
t = Object.getPrototypeOf;
|
|
190
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
191
|
+
return this;
|
|
192
|
+
}), t),
|
|
193
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
194
|
+
function f(e) {
|
|
195
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
302
196
|
}
|
|
303
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
304
|
-
value: GeneratorFunctionPrototype,
|
|
305
|
-
configurable: true
|
|
306
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
307
|
-
value: GeneratorFunction,
|
|
308
|
-
configurable: true
|
|
309
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
310
|
-
var e = "function" == typeof t && t.constructor;
|
|
311
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
312
|
-
}, e.mark = function (t) {
|
|
313
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
314
|
-
}, e.awrap = function (t) {
|
|
315
|
-
return {
|
|
316
|
-
__await: t
|
|
317
|
-
};
|
|
318
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
197
|
+
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 () {
|
|
319
198
|
return this;
|
|
320
|
-
}),
|
|
321
|
-
void 0 === i && (i = Promise);
|
|
322
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
323
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
324
|
-
return t.done ? t.value : a.next();
|
|
325
|
-
});
|
|
326
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
327
|
-
return this;
|
|
328
|
-
}), define(g, "toString", function () {
|
|
199
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
329
200
|
return "[object Generator]";
|
|
330
|
-
}),
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return r.reverse(), function next() {
|
|
335
|
-
for (; r.length;) {
|
|
336
|
-
var t = r.pop();
|
|
337
|
-
if (t in e) return next.value = t, next.done = false, next;
|
|
338
|
-
}
|
|
339
|
-
return next.done = true, next;
|
|
201
|
+
}), (_regenerator = function () {
|
|
202
|
+
return {
|
|
203
|
+
w: i,
|
|
204
|
+
m: f
|
|
340
205
|
};
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
362
|
-
if (i.tryLoc <= this.prev) {
|
|
363
|
-
var c = n.call(i, "catchLoc"),
|
|
364
|
-
u = n.call(i, "finallyLoc");
|
|
365
|
-
if (c && u) {
|
|
366
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
367
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
368
|
-
} else if (c) {
|
|
369
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
370
|
-
} else {
|
|
371
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
372
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
abrupt: function (t, e) {
|
|
378
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
379
|
-
var o = this.tryEntries[r];
|
|
380
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
381
|
-
var i = o;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
386
|
-
var a = i ? i.completion : {};
|
|
387
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
388
|
-
},
|
|
389
|
-
complete: function (t, e) {
|
|
390
|
-
if ("throw" === t.type) throw t.arg;
|
|
391
|
-
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;
|
|
392
|
-
},
|
|
393
|
-
finish: function (t) {
|
|
394
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
395
|
-
var r = this.tryEntries[e];
|
|
396
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
catch: function (t) {
|
|
400
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
401
|
-
var r = this.tryEntries[e];
|
|
402
|
-
if (r.tryLoc === t) {
|
|
403
|
-
var n = r.completion;
|
|
404
|
-
if ("throw" === n.type) {
|
|
405
|
-
var o = n.arg;
|
|
406
|
-
resetTryEntry(r);
|
|
407
|
-
}
|
|
408
|
-
return o;
|
|
409
|
-
}
|
|
206
|
+
})();
|
|
207
|
+
}
|
|
208
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
209
|
+
var i = Object.defineProperty;
|
|
210
|
+
try {
|
|
211
|
+
i({}, "", {});
|
|
212
|
+
} catch (e) {
|
|
213
|
+
i = 0;
|
|
214
|
+
}
|
|
215
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
216
|
+
if (r) i ? i(e, r, {
|
|
217
|
+
value: n,
|
|
218
|
+
enumerable: !t,
|
|
219
|
+
configurable: !t,
|
|
220
|
+
writable: !t
|
|
221
|
+
}) : e[r] = n;else {
|
|
222
|
+
function o(r, n) {
|
|
223
|
+
_regeneratorDefine(e, r, function (e) {
|
|
224
|
+
return this._invoke(r, n, e);
|
|
225
|
+
});
|
|
410
226
|
}
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
delegateYield: function (e, r, n) {
|
|
414
|
-
return this.delegate = {
|
|
415
|
-
iterator: values(e),
|
|
416
|
-
resultName: r,
|
|
417
|
-
nextLoc: n
|
|
418
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
227
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
419
228
|
}
|
|
420
|
-
}, e;
|
|
229
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
421
230
|
}
|
|
422
231
|
|
|
423
232
|
/**
|
|
@@ -525,10 +334,10 @@
|
|
|
525
334
|
return endpoint;
|
|
526
335
|
};
|
|
527
336
|
_proto._fetch = /*#__PURE__*/function () {
|
|
528
|
-
var _fetch2 = _asyncToGenerator(/*#__PURE__*/
|
|
337
|
+
var _fetch2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(method, url, params, auth) {
|
|
529
338
|
var request, wurl, response, isBrowser, isTest, _data, data;
|
|
530
|
-
return
|
|
531
|
-
while (1) switch (_context.
|
|
339
|
+
return _regenerator().w(function (_context) {
|
|
340
|
+
while (1) switch (_context.n) {
|
|
532
341
|
case 0:
|
|
533
342
|
if (auth === void 0) {
|
|
534
343
|
auth = undefined;
|
|
@@ -552,56 +361,53 @@
|
|
|
552
361
|
wurl += json_to_query_string(params);
|
|
553
362
|
}
|
|
554
363
|
}
|
|
555
|
-
_context.
|
|
364
|
+
_context.n = 1;
|
|
556
365
|
return fetch(wurl, request);
|
|
557
|
-
case
|
|
558
|
-
response = _context.
|
|
366
|
+
case 1:
|
|
367
|
+
response = _context.v;
|
|
559
368
|
if (!response.redirected) {
|
|
560
|
-
_context.
|
|
369
|
+
_context.n = 3;
|
|
561
370
|
break;
|
|
562
371
|
}
|
|
563
372
|
isBrowser = typeof window == 'object';
|
|
564
373
|
if (!isBrowser) {
|
|
565
|
-
_context.
|
|
374
|
+
_context.n = 3;
|
|
566
375
|
break;
|
|
567
376
|
}
|
|
568
377
|
// JSDOM does not support navigation, so lets skip it for tests
|
|
569
378
|
isTest = typeof navigator !== "undefined" && navigator.userAgent.includes("Node.js");
|
|
570
379
|
if (isTest) {
|
|
571
|
-
_context.
|
|
380
|
+
_context.n = 2;
|
|
572
381
|
break;
|
|
573
382
|
}
|
|
574
383
|
window.location.replace(response.url);
|
|
575
|
-
return _context.
|
|
576
|
-
case
|
|
384
|
+
return _context.a(2, Promise.resolve(response));
|
|
385
|
+
case 2:
|
|
577
386
|
console.error("Response for " + wurl + " is a redirect to " + response.url + ". But you are in a test environment, where redirects cannot be done. Unexpected results are coming...");
|
|
578
|
-
case
|
|
387
|
+
case 3:
|
|
579
388
|
if (!(response.headers.get('content-type').indexOf('json') >= 0)) {
|
|
580
|
-
_context.
|
|
389
|
+
_context.n = 5;
|
|
581
390
|
break;
|
|
582
391
|
}
|
|
583
|
-
_context.
|
|
392
|
+
_context.n = 4;
|
|
584
393
|
return response.json();
|
|
585
|
-
case
|
|
586
|
-
_data = _context.
|
|
587
|
-
return _context.
|
|
394
|
+
case 4:
|
|
395
|
+
_data = _context.v;
|
|
396
|
+
return _context.a(2, {
|
|
588
397
|
data: _data,
|
|
589
398
|
status: response.status,
|
|
590
399
|
response: response
|
|
591
400
|
});
|
|
592
|
-
case
|
|
593
|
-
_context.
|
|
401
|
+
case 5:
|
|
402
|
+
_context.n = 6;
|
|
594
403
|
return response.text();
|
|
595
|
-
case
|
|
596
|
-
data = _context.
|
|
597
|
-
return _context.
|
|
404
|
+
case 6:
|
|
405
|
+
data = _context.v;
|
|
406
|
+
return _context.a(2, {
|
|
598
407
|
data: data,
|
|
599
408
|
status: response.status,
|
|
600
409
|
response: response
|
|
601
410
|
});
|
|
602
|
-
case 27:
|
|
603
|
-
case "end":
|
|
604
|
-
return _context.stop();
|
|
605
411
|
}
|
|
606
412
|
}, _callee, this);
|
|
607
413
|
}));
|
|
@@ -611,36 +417,33 @@
|
|
|
611
417
|
return _fetch;
|
|
612
418
|
}();
|
|
613
419
|
_proto.get = /*#__PURE__*/function () {
|
|
614
|
-
var _get = _asyncToGenerator(/*#__PURE__*/
|
|
615
|
-
var resp, _this$config;
|
|
616
|
-
return
|
|
617
|
-
while (1) switch (_context2.
|
|
420
|
+
var _get = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url, params, auth) {
|
|
421
|
+
var resp, _this$config, _t;
|
|
422
|
+
return _regenerator().w(function (_context2) {
|
|
423
|
+
while (1) switch (_context2.n) {
|
|
618
424
|
case 0:
|
|
619
425
|
if (auth === void 0) {
|
|
620
426
|
auth = undefined;
|
|
621
427
|
}
|
|
622
|
-
_context2.
|
|
623
|
-
_context2.
|
|
428
|
+
_context2.p = 1;
|
|
429
|
+
_context2.n = 2;
|
|
624
430
|
return this._fetch('GET', url, omit_nil(params), auth);
|
|
625
|
-
case
|
|
626
|
-
resp = _context2.
|
|
627
|
-
return _context2.
|
|
628
|
-
case
|
|
629
|
-
_context2.
|
|
630
|
-
|
|
431
|
+
case 2:
|
|
432
|
+
resp = _context2.v;
|
|
433
|
+
return _context2.a(2, resp);
|
|
434
|
+
case 3:
|
|
435
|
+
_context2.p = 3;
|
|
436
|
+
_t = _context2.v;
|
|
631
437
|
if (((_this$config = this.config) == null ? void 0 : _this$config.silent_fail) !== true) {
|
|
632
438
|
console.error("Error on GET " + url);
|
|
633
|
-
console.error(
|
|
439
|
+
console.error(_t);
|
|
634
440
|
}
|
|
635
|
-
return _context2.
|
|
636
|
-
data:
|
|
441
|
+
return _context2.a(2, {
|
|
442
|
+
data: _t,
|
|
637
443
|
status: -1
|
|
638
444
|
});
|
|
639
|
-
case 12:
|
|
640
|
-
case "end":
|
|
641
|
-
return _context2.stop();
|
|
642
445
|
}
|
|
643
|
-
}, _callee2, this, [[1,
|
|
446
|
+
}, _callee2, this, [[1, 3]]);
|
|
644
447
|
}));
|
|
645
448
|
function get(_x5, _x6, _x7) {
|
|
646
449
|
return _get.apply(this, arguments);
|
|
@@ -648,199 +451,178 @@
|
|
|
648
451
|
return get;
|
|
649
452
|
}();
|
|
650
453
|
_proto.post = /*#__PURE__*/function () {
|
|
651
|
-
var _post = _asyncToGenerator(/*#__PURE__*/
|
|
652
|
-
var resp, _this$config2;
|
|
653
|
-
return
|
|
654
|
-
while (1) switch (_context3.
|
|
454
|
+
var _post = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(url, data, auth) {
|
|
455
|
+
var resp, _this$config2, _t2;
|
|
456
|
+
return _regenerator().w(function (_context3) {
|
|
457
|
+
while (1) switch (_context3.n) {
|
|
655
458
|
case 0:
|
|
656
459
|
if (auth === void 0) {
|
|
657
460
|
auth = undefined;
|
|
658
461
|
}
|
|
659
|
-
_context3.
|
|
660
|
-
_context3.
|
|
462
|
+
_context3.p = 1;
|
|
463
|
+
_context3.n = 2;
|
|
661
464
|
return this._fetch('POST', url, data, auth);
|
|
662
|
-
case
|
|
663
|
-
resp = _context3.
|
|
664
|
-
return _context3.
|
|
665
|
-
case
|
|
666
|
-
_context3.
|
|
667
|
-
|
|
465
|
+
case 2:
|
|
466
|
+
resp = _context3.v;
|
|
467
|
+
return _context3.a(2, resp);
|
|
468
|
+
case 3:
|
|
469
|
+
_context3.p = 3;
|
|
470
|
+
_t2 = _context3.v;
|
|
668
471
|
if (((_this$config2 = this.config) == null ? void 0 : _this$config2.silent_fail) !== true) {
|
|
669
472
|
console.error("Error on POST " + url);
|
|
670
|
-
console.error(
|
|
473
|
+
console.error(_t2);
|
|
671
474
|
}
|
|
672
|
-
return _context3.
|
|
673
|
-
data:
|
|
475
|
+
return _context3.a(2, {
|
|
476
|
+
data: _t2,
|
|
674
477
|
status: -1
|
|
675
478
|
});
|
|
676
|
-
case 12:
|
|
677
|
-
case "end":
|
|
678
|
-
return _context3.stop();
|
|
679
479
|
}
|
|
680
|
-
}, _callee3, this, [[1,
|
|
480
|
+
}, _callee3, this, [[1, 3]]);
|
|
681
481
|
}));
|
|
682
|
-
function post(_x8, _x9,
|
|
482
|
+
function post(_x8, _x9, _x0) {
|
|
683
483
|
return _post.apply(this, arguments);
|
|
684
484
|
}
|
|
685
485
|
return post;
|
|
686
486
|
}();
|
|
687
487
|
_proto.login = /*#__PURE__*/function () {
|
|
688
|
-
var _login = _asyncToGenerator(/*#__PURE__*/
|
|
488
|
+
var _login = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(url, _ref2) {
|
|
689
489
|
var username, password, res;
|
|
690
|
-
return
|
|
691
|
-
while (1) switch (_context4.
|
|
490
|
+
return _regenerator().w(function (_context4) {
|
|
491
|
+
while (1) switch (_context4.n) {
|
|
692
492
|
case 0:
|
|
693
493
|
username = _ref2.username, password = _ref2.password;
|
|
694
|
-
_context4.
|
|
494
|
+
_context4.n = 1;
|
|
695
495
|
return this._fetch('POST', url || '/login', {
|
|
696
496
|
username: username,
|
|
697
497
|
password: password
|
|
698
498
|
});
|
|
699
|
-
case
|
|
700
|
-
res = _context4.
|
|
499
|
+
case 1:
|
|
500
|
+
res = _context4.v;
|
|
701
501
|
this.cookie = parse_login_cookie(res.response);
|
|
702
|
-
return _context4.
|
|
703
|
-
case 6:
|
|
704
|
-
case "end":
|
|
705
|
-
return _context4.stop();
|
|
502
|
+
return _context4.a(2, res);
|
|
706
503
|
}
|
|
707
504
|
}, _callee4, this);
|
|
708
505
|
}));
|
|
709
|
-
function login(
|
|
506
|
+
function login(_x1, _x10) {
|
|
710
507
|
return _login.apply(this, arguments);
|
|
711
508
|
}
|
|
712
509
|
return login;
|
|
713
510
|
}();
|
|
714
511
|
_proto.logout = /*#__PURE__*/function () {
|
|
715
|
-
var _logout = _asyncToGenerator(/*#__PURE__*/
|
|
512
|
+
var _logout = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(url) {
|
|
716
513
|
var res;
|
|
717
|
-
return
|
|
718
|
-
while (1) switch (_context5.
|
|
514
|
+
return _regenerator().w(function (_context5) {
|
|
515
|
+
while (1) switch (_context5.n) {
|
|
719
516
|
case 0:
|
|
720
517
|
this.cookie = undefined;
|
|
721
|
-
_context5.
|
|
518
|
+
_context5.n = 1;
|
|
722
519
|
return this._fetch('POST', url || '/logout', {});
|
|
723
|
-
case
|
|
724
|
-
res = _context5.
|
|
725
|
-
return _context5.
|
|
726
|
-
case 5:
|
|
727
|
-
case "end":
|
|
728
|
-
return _context5.stop();
|
|
520
|
+
case 1:
|
|
521
|
+
res = _context5.v;
|
|
522
|
+
return _context5.a(2, res);
|
|
729
523
|
}
|
|
730
524
|
}, _callee5, this);
|
|
731
525
|
}));
|
|
732
|
-
function logout(
|
|
526
|
+
function logout(_x11) {
|
|
733
527
|
return _logout.apply(this, arguments);
|
|
734
528
|
}
|
|
735
529
|
return logout;
|
|
736
530
|
}();
|
|
737
531
|
_proto.read = /*#__PURE__*/function () {
|
|
738
|
-
var _read = _asyncToGenerator(/*#__PURE__*/
|
|
532
|
+
var _read = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(url, params, auth) {
|
|
739
533
|
var result;
|
|
740
|
-
return
|
|
741
|
-
while (1) switch (_context6.
|
|
534
|
+
return _regenerator().w(function (_context6) {
|
|
535
|
+
while (1) switch (_context6.n) {
|
|
742
536
|
case 0:
|
|
743
537
|
if (auth === void 0) {
|
|
744
538
|
auth = undefined;
|
|
745
539
|
}
|
|
746
|
-
_context6.
|
|
540
|
+
_context6.n = 1;
|
|
747
541
|
return this.get(url + "/read", params, auth);
|
|
748
|
-
case
|
|
749
|
-
result = _context6.
|
|
750
|
-
return _context6.
|
|
751
|
-
case 5:
|
|
752
|
-
case "end":
|
|
753
|
-
return _context6.stop();
|
|
542
|
+
case 1:
|
|
543
|
+
result = _context6.v;
|
|
544
|
+
return _context6.a(2, result.data);
|
|
754
545
|
}
|
|
755
546
|
}, _callee6, this);
|
|
756
547
|
}));
|
|
757
|
-
function read(
|
|
548
|
+
function read(_x12, _x13, _x14) {
|
|
758
549
|
return _read.apply(this, arguments);
|
|
759
550
|
}
|
|
760
551
|
return read;
|
|
761
552
|
}();
|
|
762
553
|
_proto.key_list = /*#__PURE__*/function () {
|
|
763
|
-
var _key_list = _asyncToGenerator(/*#__PURE__*/
|
|
554
|
+
var _key_list = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(url, params, auth) {
|
|
764
555
|
var result;
|
|
765
|
-
return
|
|
766
|
-
while (1) switch (_context7.
|
|
556
|
+
return _regenerator().w(function (_context7) {
|
|
557
|
+
while (1) switch (_context7.n) {
|
|
767
558
|
case 0:
|
|
768
559
|
if (auth === void 0) {
|
|
769
560
|
auth = undefined;
|
|
770
561
|
}
|
|
771
|
-
_context7.
|
|
562
|
+
_context7.n = 1;
|
|
772
563
|
return this.get(url + "/key_list", params, auth);
|
|
773
|
-
case
|
|
774
|
-
result = _context7.
|
|
775
|
-
return _context7.
|
|
776
|
-
case 5:
|
|
777
|
-
case "end":
|
|
778
|
-
return _context7.stop();
|
|
564
|
+
case 1:
|
|
565
|
+
result = _context7.v;
|
|
566
|
+
return _context7.a(2, result.data);
|
|
779
567
|
}
|
|
780
568
|
}, _callee7, this);
|
|
781
569
|
}));
|
|
782
|
-
function key_list(
|
|
570
|
+
function key_list(_x15, _x16, _x17) {
|
|
783
571
|
return _key_list.apply(this, arguments);
|
|
784
572
|
}
|
|
785
573
|
return key_list;
|
|
786
574
|
}();
|
|
787
575
|
_proto.name_list = /*#__PURE__*/function () {
|
|
788
|
-
var _name_list = _asyncToGenerator(/*#__PURE__*/
|
|
576
|
+
var _name_list = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(url, params, auth) {
|
|
789
577
|
var result;
|
|
790
|
-
return
|
|
791
|
-
while (1) switch (_context8.
|
|
578
|
+
return _regenerator().w(function (_context8) {
|
|
579
|
+
while (1) switch (_context8.n) {
|
|
792
580
|
case 0:
|
|
793
581
|
if (auth === void 0) {
|
|
794
582
|
auth = undefined;
|
|
795
583
|
}
|
|
796
|
-
_context8.
|
|
584
|
+
_context8.n = 1;
|
|
797
585
|
return this.key_list(url, params, auth);
|
|
798
|
-
case
|
|
799
|
-
result = _context8.
|
|
800
|
-
return _context8.
|
|
801
|
-
case 5:
|
|
802
|
-
case "end":
|
|
803
|
-
return _context8.stop();
|
|
586
|
+
case 1:
|
|
587
|
+
result = _context8.v;
|
|
588
|
+
return _context8.a(2, Object.values(result));
|
|
804
589
|
}
|
|
805
590
|
}, _callee8, this);
|
|
806
591
|
}));
|
|
807
|
-
function name_list(
|
|
592
|
+
function name_list(_x18, _x19, _x20) {
|
|
808
593
|
return _name_list.apply(this, arguments);
|
|
809
594
|
}
|
|
810
595
|
return name_list;
|
|
811
596
|
}();
|
|
812
597
|
_proto.find = /*#__PURE__*/function () {
|
|
813
|
-
var _find = _asyncToGenerator(/*#__PURE__*/
|
|
598
|
+
var _find = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(url, id, auth) {
|
|
814
599
|
var result;
|
|
815
|
-
return
|
|
816
|
-
while (1) switch (_context9.
|
|
600
|
+
return _regenerator().w(function (_context9) {
|
|
601
|
+
while (1) switch (_context9.n) {
|
|
817
602
|
case 0:
|
|
818
603
|
if (auth === void 0) {
|
|
819
604
|
auth = undefined;
|
|
820
605
|
}
|
|
821
|
-
_context9.
|
|
606
|
+
_context9.n = 1;
|
|
822
607
|
return this.get(url + "/find", {
|
|
823
608
|
id: id
|
|
824
609
|
}, auth);
|
|
825
|
-
case
|
|
826
|
-
result = _context9.
|
|
827
|
-
return _context9.
|
|
828
|
-
case 5:
|
|
829
|
-
case "end":
|
|
830
|
-
return _context9.stop();
|
|
610
|
+
case 1:
|
|
611
|
+
result = _context9.v;
|
|
612
|
+
return _context9.a(2, result.data);
|
|
831
613
|
}
|
|
832
614
|
}, _callee9, this);
|
|
833
615
|
}));
|
|
834
|
-
function find(
|
|
616
|
+
function find(_x21, _x22, _x23) {
|
|
835
617
|
return _find.apply(this, arguments);
|
|
836
618
|
}
|
|
837
619
|
return find;
|
|
838
620
|
}();
|
|
839
621
|
_proto.distinct = /*#__PURE__*/function () {
|
|
840
|
-
var _distinct = _asyncToGenerator(/*#__PURE__*/
|
|
622
|
+
var _distinct = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(url, field, params, auth) {
|
|
841
623
|
var nparams, result;
|
|
842
|
-
return
|
|
843
|
-
while (1) switch (
|
|
624
|
+
return _regenerator().w(function (_context0) {
|
|
625
|
+
while (1) switch (_context0.n) {
|
|
844
626
|
case 0:
|
|
845
627
|
if (auth === void 0) {
|
|
846
628
|
auth = undefined;
|
|
@@ -848,65 +630,59 @@
|
|
|
848
630
|
nparams = _extends({}, params, {
|
|
849
631
|
distinct_field: field
|
|
850
632
|
});
|
|
851
|
-
|
|
633
|
+
_context0.n = 1;
|
|
852
634
|
return this.get(url + "/distinct", nparams, auth);
|
|
853
|
-
case
|
|
854
|
-
result =
|
|
855
|
-
return
|
|
856
|
-
case 6:
|
|
857
|
-
case "end":
|
|
858
|
-
return _context10.stop();
|
|
635
|
+
case 1:
|
|
636
|
+
result = _context0.v;
|
|
637
|
+
return _context0.a(2, result.data);
|
|
859
638
|
}
|
|
860
|
-
},
|
|
639
|
+
}, _callee0, this);
|
|
861
640
|
}));
|
|
862
|
-
function distinct(
|
|
641
|
+
function distinct(_x24, _x25, _x26, _x27) {
|
|
863
642
|
return _distinct.apply(this, arguments);
|
|
864
643
|
}
|
|
865
644
|
return distinct;
|
|
866
645
|
}();
|
|
867
646
|
_proto.upsave = /*#__PURE__*/function () {
|
|
868
|
-
var _upsave = _asyncToGenerator(/*#__PURE__*/
|
|
647
|
+
var _upsave = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(url, data, auth) {
|
|
869
648
|
var result;
|
|
870
|
-
return
|
|
871
|
-
while (1) switch (
|
|
649
|
+
return _regenerator().w(function (_context1) {
|
|
650
|
+
while (1) switch (_context1.n) {
|
|
872
651
|
case 0:
|
|
873
652
|
if (auth === void 0) {
|
|
874
653
|
auth = undefined;
|
|
875
654
|
}
|
|
876
655
|
if (!(data.id == undefined)) {
|
|
877
|
-
|
|
656
|
+
_context1.n = 2;
|
|
878
657
|
break;
|
|
879
658
|
}
|
|
880
659
|
delete data.id;
|
|
881
|
-
|
|
660
|
+
_context1.n = 1;
|
|
882
661
|
return this.post(url + "/save", data, auth);
|
|
883
|
-
case
|
|
884
|
-
result =
|
|
885
|
-
|
|
662
|
+
case 1:
|
|
663
|
+
result = _context1.v;
|
|
664
|
+
_context1.n = 4;
|
|
886
665
|
break;
|
|
887
|
-
case
|
|
888
|
-
|
|
666
|
+
case 2:
|
|
667
|
+
_context1.n = 3;
|
|
889
668
|
return this.post(url + "/update", data, auth);
|
|
890
|
-
case
|
|
891
|
-
result =
|
|
892
|
-
case
|
|
893
|
-
return
|
|
894
|
-
case 12:
|
|
895
|
-
case "end":
|
|
896
|
-
return _context11.stop();
|
|
669
|
+
case 3:
|
|
670
|
+
result = _context1.v;
|
|
671
|
+
case 4:
|
|
672
|
+
return _context1.a(2, result.data);
|
|
897
673
|
}
|
|
898
|
-
},
|
|
674
|
+
}, _callee1, this);
|
|
899
675
|
}));
|
|
900
|
-
function upsave(
|
|
676
|
+
function upsave(_x28, _x29, _x30) {
|
|
901
677
|
return _upsave.apply(this, arguments);
|
|
902
678
|
}
|
|
903
679
|
return upsave;
|
|
904
680
|
}();
|
|
905
681
|
_proto.remove = /*#__PURE__*/function () {
|
|
906
|
-
var _remove = _asyncToGenerator(/*#__PURE__*/
|
|
682
|
+
var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(url, id, auth) {
|
|
907
683
|
var data, result;
|
|
908
|
-
return
|
|
909
|
-
while (1) switch (
|
|
684
|
+
return _regenerator().w(function (_context10) {
|
|
685
|
+
while (1) switch (_context10.n) {
|
|
910
686
|
case 0:
|
|
911
687
|
if (auth === void 0) {
|
|
912
688
|
auth = undefined;
|
|
@@ -914,18 +690,15 @@
|
|
|
914
690
|
data = {
|
|
915
691
|
id: id
|
|
916
692
|
};
|
|
917
|
-
|
|
693
|
+
_context10.n = 1;
|
|
918
694
|
return this.post(url + "/delete", data, auth);
|
|
919
|
-
case
|
|
920
|
-
result =
|
|
921
|
-
return
|
|
922
|
-
case 6:
|
|
923
|
-
case "end":
|
|
924
|
-
return _context12.stop();
|
|
695
|
+
case 1:
|
|
696
|
+
result = _context10.v;
|
|
697
|
+
return _context10.a(2, result.data);
|
|
925
698
|
}
|
|
926
|
-
},
|
|
699
|
+
}, _callee10, this);
|
|
927
700
|
}));
|
|
928
|
-
function remove(
|
|
701
|
+
function remove(_x31, _x32, _x33) {
|
|
929
702
|
return _remove.apply(this, arguments);
|
|
930
703
|
}
|
|
931
704
|
return remove;
|