@wecode-team/cms-supabase-api 0.1.52 → 0.1.53-beta.0
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/index.d.ts +1 -0
- package/dist/index.esm.js +1321 -661
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1321 -661
- package/dist/index.js.map +1 -1
- package/dist/utils/route-helpers.d.ts +9 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ function _interopNamespaceDefault(e) {
|
|
|
25
25
|
var jwt__namespace = /*#__PURE__*/_interopNamespaceDefault(jwt);
|
|
26
26
|
var bcrypt__namespace = /*#__PURE__*/_interopNamespaceDefault(bcrypt);
|
|
27
27
|
|
|
28
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
28
|
+
function asyncGeneratorStep$1(n, t, e, r, o, a, c) {
|
|
29
29
|
try {
|
|
30
30
|
var i = n[a](c),
|
|
31
31
|
u = i.value;
|
|
@@ -34,390 +34,391 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
|
34
34
|
}
|
|
35
35
|
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
36
36
|
}
|
|
37
|
-
function _asyncToGenerator(n) {
|
|
37
|
+
function _asyncToGenerator$1(n) {
|
|
38
38
|
return function () {
|
|
39
39
|
var t = this,
|
|
40
40
|
e = arguments;
|
|
41
41
|
return new Promise(function (r, o) {
|
|
42
42
|
var a = n.apply(t, e);
|
|
43
43
|
function _next(n) {
|
|
44
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
44
|
+
asyncGeneratorStep$1(a, r, o, _next, _throw, "next", n);
|
|
45
45
|
}
|
|
46
46
|
function _throw(n) {
|
|
47
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
47
|
+
asyncGeneratorStep$1(a, r, o, _next, _throw, "throw", n);
|
|
48
48
|
}
|
|
49
49
|
_next(void 0);
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
function _typeof$1(o) {
|
|
55
|
-
"@babel/helpers - typeof";
|
|
56
|
-
|
|
57
|
-
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
58
|
-
return typeof o;
|
|
59
|
-
} : function (o) {
|
|
60
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
61
|
-
}, _typeof$1(o);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
54
|
function getDefaultExportFromCjs (x) {
|
|
65
55
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
var regeneratorRuntime$
|
|
58
|
+
var regeneratorRuntime$2 = {exports: {}};
|
|
69
59
|
|
|
70
|
-
var OverloadYield = {exports: {}};
|
|
60
|
+
var OverloadYield$1 = {exports: {}};
|
|
71
61
|
|
|
72
62
|
(function (module) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
var OverloadYieldExports = OverloadYield.exports;
|
|
63
|
+
function _OverloadYield(e, d) {
|
|
64
|
+
this.v = e, this.k = d;
|
|
65
|
+
}
|
|
66
|
+
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
67
|
+
} (OverloadYield$1));
|
|
79
68
|
|
|
80
|
-
var
|
|
69
|
+
var OverloadYieldExports$1 = OverloadYield$1.exports;
|
|
81
70
|
|
|
82
|
-
var
|
|
71
|
+
var regenerator$3 = {exports: {}};
|
|
72
|
+
|
|
73
|
+
var regeneratorDefine$1 = {exports: {}};
|
|
83
74
|
|
|
84
75
|
(function (module) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
76
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
77
|
+
var i = Object.defineProperty;
|
|
78
|
+
try {
|
|
79
|
+
i({}, "", {});
|
|
80
|
+
} catch (e) {
|
|
81
|
+
i = 0;
|
|
82
|
+
}
|
|
83
|
+
module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
|
|
84
|
+
function o(r, n) {
|
|
85
|
+
_regeneratorDefine(e, r, function (e) {
|
|
86
|
+
return this._invoke(r, n, e);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
r ? i ? i(e, r, {
|
|
90
|
+
value: n,
|
|
91
|
+
enumerable: !t,
|
|
92
|
+
configurable: !t,
|
|
93
|
+
writable: !t
|
|
94
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
95
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
|
|
96
|
+
}
|
|
97
|
+
module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
98
|
+
} (regeneratorDefine$1));
|
|
99
|
+
|
|
100
|
+
var regeneratorDefineExports$1 = regeneratorDefine$1.exports;
|
|
109
101
|
|
|
110
102
|
(function (module) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
var regeneratorExports = regenerator$1.exports;
|
|
103
|
+
var regeneratorDefine = regeneratorDefineExports$1;
|
|
104
|
+
function _regenerator() {
|
|
105
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
106
|
+
var e,
|
|
107
|
+
t,
|
|
108
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
109
|
+
n = r.iterator || "@@iterator",
|
|
110
|
+
o = r.toStringTag || "@@toStringTag";
|
|
111
|
+
function i(r, n, o, i) {
|
|
112
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
113
|
+
u = Object.create(c.prototype);
|
|
114
|
+
return regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
115
|
+
var i,
|
|
116
|
+
c,
|
|
117
|
+
u,
|
|
118
|
+
f = 0,
|
|
119
|
+
p = o || [],
|
|
120
|
+
y = !1,
|
|
121
|
+
G = {
|
|
122
|
+
p: 0,
|
|
123
|
+
n: 0,
|
|
124
|
+
v: e,
|
|
125
|
+
a: d,
|
|
126
|
+
f: d.bind(e, 4),
|
|
127
|
+
d: function d(t, r) {
|
|
128
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
function d(r, n) {
|
|
132
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
133
|
+
var o,
|
|
134
|
+
i = p[t],
|
|
135
|
+
d = G.p,
|
|
136
|
+
l = i[2];
|
|
137
|
+
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));
|
|
138
|
+
}
|
|
139
|
+
if (o || r > 1) return a;
|
|
140
|
+
throw y = !0, n;
|
|
141
|
+
}
|
|
142
|
+
return function (o, p, l) {
|
|
143
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
144
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
145
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
146
|
+
try {
|
|
147
|
+
if (f = 2, i) {
|
|
148
|
+
if (c || (o = "next"), t = i[o]) {
|
|
149
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
150
|
+
if (!t.done) return t;
|
|
151
|
+
u = t.value, c < 2 && (c = 0);
|
|
152
|
+
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
153
|
+
i = e;
|
|
154
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
155
|
+
} catch (t) {
|
|
156
|
+
i = e, c = 1, u = t;
|
|
157
|
+
} finally {
|
|
158
|
+
f = 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
value: t,
|
|
163
|
+
done: y
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
}(r, o, i), !0), u;
|
|
167
|
+
}
|
|
168
|
+
var a = {};
|
|
169
|
+
function Generator() {}
|
|
170
|
+
function GeneratorFunction() {}
|
|
171
|
+
function GeneratorFunctionPrototype() {}
|
|
172
|
+
t = Object.getPrototypeOf;
|
|
173
|
+
var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
|
|
174
|
+
return this;
|
|
175
|
+
}), t),
|
|
176
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
177
|
+
function f(e) {
|
|
178
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
179
|
+
}
|
|
180
|
+
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 () {
|
|
181
|
+
return this;
|
|
182
|
+
}), regeneratorDefine(u, "toString", function () {
|
|
183
|
+
return "[object Generator]";
|
|
184
|
+
}), (module.exports = _regenerator = function _regenerator() {
|
|
185
|
+
return {
|
|
186
|
+
w: i,
|
|
187
|
+
m: f
|
|
188
|
+
};
|
|
189
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
|
|
190
|
+
}
|
|
191
|
+
module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
192
|
+
} (regenerator$3));
|
|
202
193
|
|
|
203
|
-
var
|
|
194
|
+
var regeneratorExports$1 = regenerator$3.exports;
|
|
204
195
|
|
|
205
|
-
var
|
|
196
|
+
var regeneratorAsync$1 = {exports: {}};
|
|
206
197
|
|
|
207
|
-
var
|
|
198
|
+
var regeneratorAsyncGen$1 = {exports: {}};
|
|
199
|
+
|
|
200
|
+
var regeneratorAsyncIterator$1 = {exports: {}};
|
|
208
201
|
|
|
209
202
|
(function (module) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
203
|
+
var OverloadYield = OverloadYieldExports$1;
|
|
204
|
+
var regeneratorDefine = regeneratorDefineExports$1;
|
|
205
|
+
function AsyncIterator(t, e) {
|
|
206
|
+
function n(r, o, i, f) {
|
|
207
|
+
try {
|
|
208
|
+
var c = t[r](o),
|
|
209
|
+
u = c.value;
|
|
210
|
+
return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
211
|
+
n("next", t, i, f);
|
|
212
|
+
}, function (t) {
|
|
213
|
+
n("throw", t, i, f);
|
|
214
|
+
}) : e.resolve(u).then(function (t) {
|
|
215
|
+
c.value = t, i(c);
|
|
216
|
+
}, function (t) {
|
|
217
|
+
return n("throw", t, i, f);
|
|
218
|
+
});
|
|
219
|
+
} catch (t) {
|
|
220
|
+
f(t);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
var r;
|
|
224
|
+
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
225
|
+
return this;
|
|
226
|
+
})), regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
227
|
+
function f() {
|
|
228
|
+
return new e(function (e, r) {
|
|
229
|
+
n(t, i, e, r);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
return r = r ? r.then(f, f) : f();
|
|
233
|
+
}, !0);
|
|
234
|
+
}
|
|
235
|
+
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
236
|
+
} (regeneratorAsyncIterator$1));
|
|
237
|
+
|
|
238
|
+
var regeneratorAsyncIteratorExports$1 = regeneratorAsyncIterator$1.exports;
|
|
245
239
|
|
|
246
240
|
(function (module) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
241
|
+
var regenerator = regeneratorExports$1;
|
|
242
|
+
var regeneratorAsyncIterator = regeneratorAsyncIteratorExports$1;
|
|
243
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
244
|
+
return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
|
|
245
|
+
}
|
|
246
|
+
module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
247
|
+
} (regeneratorAsyncGen$1));
|
|
248
|
+
|
|
249
|
+
var regeneratorAsyncGenExports$1 = regeneratorAsyncGen$1.exports;
|
|
255
250
|
|
|
256
251
|
(function (module) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
var regeneratorAsyncExports = regeneratorAsync.exports;
|
|
252
|
+
var regeneratorAsyncGen = regeneratorAsyncGenExports$1;
|
|
253
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
254
|
+
var a = regeneratorAsyncGen(n, e, r, t, o);
|
|
255
|
+
return a.next().then(function (n) {
|
|
256
|
+
return n.done ? n.value : a.next();
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
260
|
+
} (regeneratorAsync$1));
|
|
267
261
|
|
|
268
|
-
var
|
|
262
|
+
var regeneratorAsyncExports$1 = regeneratorAsync$1.exports;
|
|
263
|
+
|
|
264
|
+
var regeneratorKeys$1 = {exports: {}};
|
|
269
265
|
|
|
270
266
|
(function (module) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
var regeneratorKeysExports = regeneratorKeys.exports;
|
|
267
|
+
function _regeneratorKeys(e) {
|
|
268
|
+
var n = Object(e),
|
|
269
|
+
r = [];
|
|
270
|
+
for (var t in n) r.unshift(t);
|
|
271
|
+
return function e() {
|
|
272
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
|
|
273
|
+
return e.done = !0, e;
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
277
|
+
} (regeneratorKeys$1));
|
|
283
278
|
|
|
284
|
-
var
|
|
279
|
+
var regeneratorKeysExports$1 = regeneratorKeys$1.exports;
|
|
285
280
|
|
|
286
|
-
var
|
|
281
|
+
var regeneratorValues$1 = {exports: {}};
|
|
282
|
+
|
|
283
|
+
var _typeof$3 = {exports: {}};
|
|
287
284
|
|
|
288
285
|
(function (module) {
|
|
289
|
-
|
|
290
|
-
|
|
286
|
+
function _typeof(o) {
|
|
287
|
+
"@babel/helpers - typeof";
|
|
291
288
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
289
|
+
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
290
|
+
return typeof o;
|
|
291
|
+
} : function (o) {
|
|
292
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
293
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
|
294
|
+
}
|
|
295
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
296
|
+
} (_typeof$3));
|
|
297
|
+
|
|
298
|
+
var _typeofExports$1 = _typeof$3.exports;
|
|
301
299
|
|
|
302
300
|
(function (module) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
|
|
301
|
+
var _typeof = _typeofExports$1["default"];
|
|
302
|
+
function _regeneratorValues(e) {
|
|
303
|
+
if (null != e) {
|
|
304
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
305
|
+
r = 0;
|
|
306
|
+
if (t) return t.call(e);
|
|
307
|
+
if ("function" == typeof e.next) return e;
|
|
308
|
+
if (!isNaN(e.length)) return {
|
|
309
|
+
next: function next() {
|
|
310
|
+
return e && r >= e.length && (e = void 0), {
|
|
311
|
+
value: e && e[r++],
|
|
312
|
+
done: !e
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
318
|
+
}
|
|
319
|
+
module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
320
|
+
} (regeneratorValues$1));
|
|
321
|
+
|
|
322
|
+
var regeneratorValuesExports$1 = regeneratorValues$1.exports;
|
|
324
323
|
|
|
325
324
|
(function (module) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
325
|
+
var OverloadYield = OverloadYieldExports$1;
|
|
326
|
+
var regenerator = regeneratorExports$1;
|
|
327
|
+
var regeneratorAsync = regeneratorAsyncExports$1;
|
|
328
|
+
var regeneratorAsyncGen = regeneratorAsyncGenExports$1;
|
|
329
|
+
var regeneratorAsyncIterator = regeneratorAsyncIteratorExports$1;
|
|
330
|
+
var regeneratorKeys = regeneratorKeysExports$1;
|
|
331
|
+
var regeneratorValues = regeneratorValuesExports$1;
|
|
332
|
+
function _regeneratorRuntime() {
|
|
334
333
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
|
|
334
|
+
var r = regenerator(),
|
|
335
|
+
e = r.m(_regeneratorRuntime),
|
|
336
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
337
|
+
function n(r) {
|
|
338
|
+
var e = "function" == typeof r && r.constructor;
|
|
339
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
340
|
+
}
|
|
341
|
+
var o = {
|
|
342
|
+
"throw": 1,
|
|
343
|
+
"return": 2,
|
|
344
|
+
"break": 3,
|
|
345
|
+
"continue": 3
|
|
346
|
+
};
|
|
347
|
+
function a(r) {
|
|
348
|
+
var e, t;
|
|
349
|
+
return function (n) {
|
|
350
|
+
e || (e = {
|
|
351
|
+
stop: function stop() {
|
|
352
|
+
return t(n.a, 2);
|
|
353
|
+
},
|
|
354
|
+
"catch": function _catch() {
|
|
355
|
+
return n.v;
|
|
356
|
+
},
|
|
357
|
+
abrupt: function abrupt(r, e) {
|
|
358
|
+
return t(n.a, o[r], e);
|
|
359
|
+
},
|
|
360
|
+
delegateYield: function delegateYield(r, o, a) {
|
|
361
|
+
return e.resultName = o, t(n.d, regeneratorValues(r), a);
|
|
362
|
+
},
|
|
363
|
+
finish: function finish(r) {
|
|
364
|
+
return t(n.f, r);
|
|
365
|
+
}
|
|
366
|
+
}, t = function t(r, _t, o) {
|
|
367
|
+
n.p = e.prev, n.n = e.next;
|
|
368
|
+
try {
|
|
369
|
+
return r(_t, o);
|
|
370
|
+
} finally {
|
|
371
|
+
e.next = n.n;
|
|
372
|
+
}
|
|
373
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
374
|
+
try {
|
|
375
|
+
return r.call(this, e);
|
|
376
|
+
} finally {
|
|
377
|
+
n.p = e.prev, n.n = e.next;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
382
|
+
return {
|
|
383
|
+
wrap: function wrap(e, t, n, o) {
|
|
384
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
385
|
+
},
|
|
386
|
+
isGeneratorFunction: n,
|
|
387
|
+
mark: r.m,
|
|
388
|
+
awrap: function awrap(r, e) {
|
|
389
|
+
return new OverloadYield(r, e);
|
|
390
|
+
},
|
|
391
|
+
AsyncIterator: regeneratorAsyncIterator,
|
|
392
|
+
async: function async(r, e, t, o, u) {
|
|
393
|
+
return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
|
|
394
|
+
},
|
|
395
|
+
keys: regeneratorKeys,
|
|
396
|
+
values: regeneratorValues
|
|
397
|
+
};
|
|
398
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
|
|
399
|
+
}
|
|
400
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
401
|
+
} (regeneratorRuntime$2));
|
|
402
|
+
|
|
403
|
+
var regeneratorRuntimeExports$1 = regeneratorRuntime$2.exports;
|
|
404
404
|
|
|
405
405
|
// TODO(Babel 8): Remove this file.
|
|
406
406
|
|
|
407
|
-
var runtime = regeneratorRuntimeExports();
|
|
408
|
-
var regenerator = runtime;
|
|
407
|
+
var runtime$1 = regeneratorRuntimeExports$1();
|
|
408
|
+
var regenerator$2 = runtime$1;
|
|
409
409
|
|
|
410
410
|
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
411
411
|
try {
|
|
412
|
-
regeneratorRuntime = runtime;
|
|
412
|
+
regeneratorRuntime = runtime$1;
|
|
413
413
|
} catch (accidentalStrictMode) {
|
|
414
|
-
if (
|
|
415
|
-
globalThis.regeneratorRuntime = runtime;
|
|
414
|
+
if (typeof globalThis === "object") {
|
|
415
|
+
globalThis.regeneratorRuntime = runtime$1;
|
|
416
416
|
} else {
|
|
417
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
417
|
+
Function("r", "regeneratorRuntime = r")(runtime$1);
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
|
|
420
|
+
|
|
421
|
+
var _regeneratorRuntime$1 = /*@__PURE__*/getDefaultExportFromCjs(regenerator$2);
|
|
421
422
|
|
|
422
423
|
var supabaseInstance = null;
|
|
423
424
|
/**
|
|
@@ -457,9 +458,9 @@ function testConnection() {
|
|
|
457
458
|
* 通过直接创建表和函数来避免手动执行 SQL 文件
|
|
458
459
|
*/
|
|
459
460
|
function _testConnection() {
|
|
460
|
-
_testConnection = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
461
|
+
_testConnection = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee() {
|
|
461
462
|
var supabase, _yield$supabase$from$, error, _t;
|
|
462
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
463
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
463
464
|
while (1) switch (_context.prev = _context.next) {
|
|
464
465
|
case 0:
|
|
465
466
|
_context.prev = 0;
|
|
@@ -498,9 +499,9 @@ function executeSupabaseSetup() {
|
|
|
498
499
|
* 初始化CMS系统表
|
|
499
500
|
*/
|
|
500
501
|
function _executeSupabaseSetup() {
|
|
501
|
-
_executeSupabaseSetup = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
502
|
+
_executeSupabaseSetup = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2() {
|
|
502
503
|
var supabase, createTableSQL, _yield$supabase$from$2, tableError, fullSetupSQL, functionsToCheck, missingFunctions, _i, _functionsToCheck, funcName, _t3;
|
|
503
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
504
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
504
505
|
while (1) switch (_context2.prev = _context2.next) {
|
|
505
506
|
case 0:
|
|
506
507
|
_context2.prev = 0;
|
|
@@ -630,9 +631,9 @@ function initializeCmsSystem() {
|
|
|
630
631
|
* 关闭Supabase连接(实际上Supabase客户端不需要显式关闭)
|
|
631
632
|
*/
|
|
632
633
|
function _initializeCmsSystem() {
|
|
633
|
-
_initializeCmsSystem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
634
|
+
_initializeCmsSystem = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3() {
|
|
634
635
|
var setupSuccess, supabase, _yield$supabase$rpc, error, _t4;
|
|
635
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
636
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
636
637
|
while (1) switch (_context3.prev = _context3.next) {
|
|
637
638
|
case 0:
|
|
638
639
|
_context3.prev = 0;
|
|
@@ -679,8 +680,8 @@ function closeSupabase() {
|
|
|
679
680
|
* 用户可以复制此脚本到 Supabase SQL 编辑器中执行
|
|
680
681
|
*/
|
|
681
682
|
function _closeSupabase() {
|
|
682
|
-
_closeSupabase = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
683
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
683
|
+
_closeSupabase = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4() {
|
|
684
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
684
685
|
while (1) switch (_context4.prev = _context4.next) {
|
|
685
686
|
case 0:
|
|
686
687
|
supabaseInstance = null;
|
|
@@ -700,34 +701,44 @@ var feishuAlertConfig = {
|
|
|
700
701
|
crudErrorWebhookUrls: ["https://open.feishu.cn/open-apis/bot/v2/hook/784e9470-c1fd-4e38-97a2-b9a1856c00b1"]
|
|
701
702
|
};
|
|
702
703
|
|
|
703
|
-
function _classCallCheck(a, n) {
|
|
704
|
+
function _classCallCheck$1(a, n) {
|
|
704
705
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
705
706
|
}
|
|
706
707
|
|
|
707
|
-
function
|
|
708
|
-
|
|
708
|
+
function _typeof$2(o) {
|
|
709
|
+
"@babel/helpers - typeof";
|
|
710
|
+
|
|
711
|
+
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
712
|
+
return typeof o;
|
|
713
|
+
} : function (o) {
|
|
714
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
715
|
+
}, _typeof$2(o);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
function toPrimitive$1(t, r) {
|
|
719
|
+
if ("object" != _typeof$2(t) || !t) return t;
|
|
709
720
|
var e = t[Symbol.toPrimitive];
|
|
710
721
|
if (void 0 !== e) {
|
|
711
722
|
var i = e.call(t, r || "default");
|
|
712
|
-
if ("object" != _typeof$
|
|
723
|
+
if ("object" != _typeof$2(i)) return i;
|
|
713
724
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
714
725
|
}
|
|
715
726
|
return ("string" === r ? String : Number)(t);
|
|
716
727
|
}
|
|
717
728
|
|
|
718
|
-
function toPropertyKey(t) {
|
|
719
|
-
var i = toPrimitive(t, "string");
|
|
720
|
-
return "symbol" == _typeof$
|
|
729
|
+
function toPropertyKey$1(t) {
|
|
730
|
+
var i = toPrimitive$1(t, "string");
|
|
731
|
+
return "symbol" == _typeof$2(i) ? i : i + "";
|
|
721
732
|
}
|
|
722
733
|
|
|
723
|
-
function _defineProperties(e, r) {
|
|
734
|
+
function _defineProperties$1(e, r) {
|
|
724
735
|
for (var t = 0; t < r.length; t++) {
|
|
725
736
|
var o = r[t];
|
|
726
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
737
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey$1(o.key), o);
|
|
727
738
|
}
|
|
728
739
|
}
|
|
729
|
-
function _createClass(e, r, t) {
|
|
730
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
740
|
+
function _createClass$1(e, r, t) {
|
|
741
|
+
return r && _defineProperties$1(e.prototype, r), t && _defineProperties$1(e, t), Object.defineProperty(e, "prototype", {
|
|
731
742
|
writable: !1
|
|
732
743
|
}), e;
|
|
733
744
|
}
|
|
@@ -735,19 +746,19 @@ function _createClass(e, r, t) {
|
|
|
735
746
|
// CMS 模型服务类
|
|
736
747
|
var CmsModelService = /*#__PURE__*/function () {
|
|
737
748
|
function CmsModelService() {
|
|
738
|
-
_classCallCheck(this, CmsModelService);
|
|
749
|
+
_classCallCheck$1(this, CmsModelService);
|
|
739
750
|
this.tableName = "_cms_models";
|
|
740
751
|
this.supabase = getSupabase();
|
|
741
752
|
}
|
|
742
753
|
/**
|
|
743
754
|
* 创建新的CMS模型
|
|
744
755
|
*/
|
|
745
|
-
return _createClass(CmsModelService, [{
|
|
756
|
+
return _createClass$1(CmsModelService, [{
|
|
746
757
|
key: "create",
|
|
747
758
|
value: (function () {
|
|
748
|
-
var _create = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
759
|
+
var _create = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(data) {
|
|
749
760
|
var _yield$this$supabase$, result, error;
|
|
750
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
761
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
751
762
|
while (1) switch (_context.prev = _context.next) {
|
|
752
763
|
case 0:
|
|
753
764
|
_context.next = 1;
|
|
@@ -781,9 +792,9 @@ var CmsModelService = /*#__PURE__*/function () {
|
|
|
781
792
|
}, {
|
|
782
793
|
key: "findById",
|
|
783
794
|
value: (function () {
|
|
784
|
-
var _findById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
|
795
|
+
var _findById = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(id) {
|
|
785
796
|
var _yield$this$supabase$2, data, error;
|
|
786
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
797
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
787
798
|
while (1) switch (_context2.prev = _context2.next) {
|
|
788
799
|
case 0:
|
|
789
800
|
_context2.next = 1;
|
|
@@ -823,9 +834,9 @@ var CmsModelService = /*#__PURE__*/function () {
|
|
|
823
834
|
}, {
|
|
824
835
|
key: "findByTableName",
|
|
825
836
|
value: (function () {
|
|
826
|
-
var _findByTableName = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(tableName) {
|
|
837
|
+
var _findByTableName = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(tableName) {
|
|
827
838
|
var _yield$this$supabase$3, data, error;
|
|
828
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
839
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
829
840
|
while (1) switch (_context3.prev = _context3.next) {
|
|
830
841
|
case 0:
|
|
831
842
|
_context3.next = 1;
|
|
@@ -865,9 +876,9 @@ var CmsModelService = /*#__PURE__*/function () {
|
|
|
865
876
|
}, {
|
|
866
877
|
key: "findAll",
|
|
867
878
|
value: (function () {
|
|
868
|
-
var _findAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
879
|
+
var _findAll = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4() {
|
|
869
880
|
var _yield$this$supabase$4, data, error;
|
|
870
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
881
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
871
882
|
while (1) switch (_context4.prev = _context4.next) {
|
|
872
883
|
case 0:
|
|
873
884
|
_context4.next = 1;
|
|
@@ -903,9 +914,9 @@ var CmsModelService = /*#__PURE__*/function () {
|
|
|
903
914
|
}, {
|
|
904
915
|
key: "update",
|
|
905
916
|
value: (function () {
|
|
906
|
-
var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, data) {
|
|
917
|
+
var _update = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee5(id, data) {
|
|
907
918
|
var _yield$this$supabase$5, result, error;
|
|
908
|
-
return _regeneratorRuntime.wrap(function (_context5) {
|
|
919
|
+
return _regeneratorRuntime$1.wrap(function (_context5) {
|
|
909
920
|
while (1) switch (_context5.prev = _context5.next) {
|
|
910
921
|
case 0:
|
|
911
922
|
_context5.next = 1;
|
|
@@ -939,9 +950,9 @@ var CmsModelService = /*#__PURE__*/function () {
|
|
|
939
950
|
}, {
|
|
940
951
|
key: "delete",
|
|
941
952
|
value: (function () {
|
|
942
|
-
var _delete2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
|
953
|
+
var _delete2 = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee6(id) {
|
|
943
954
|
var _yield$this$supabase$6, error;
|
|
944
|
-
return _regeneratorRuntime.wrap(function (_context6) {
|
|
955
|
+
return _regeneratorRuntime$1.wrap(function (_context6) {
|
|
945
956
|
while (1) switch (_context6.prev = _context6.next) {
|
|
946
957
|
case 0:
|
|
947
958
|
_context6.next = 1;
|
|
@@ -987,9 +998,9 @@ function initializeCmsModel() {
|
|
|
987
998
|
}
|
|
988
999
|
// 为了向后兼容,导出服务类作为默认导出
|
|
989
1000
|
function _initializeCmsModel() {
|
|
990
|
-
_initializeCmsModel = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
1001
|
+
_initializeCmsModel = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee7() {
|
|
991
1002
|
var supabase, createTableSQL, _yield$supabase$rpc, error, _t;
|
|
992
|
-
return _regeneratorRuntime.wrap(function (_context7) {
|
|
1003
|
+
return _regeneratorRuntime$1.wrap(function (_context7) {
|
|
993
1004
|
while (1) switch (_context7.prev = _context7.next) {
|
|
994
1005
|
case 0:
|
|
995
1006
|
_context7.prev = 0;
|
|
@@ -1025,8 +1036,8 @@ function _initializeCmsModel() {
|
|
|
1025
1036
|
return _initializeCmsModel.apply(this, arguments);
|
|
1026
1037
|
}
|
|
1027
1038
|
|
|
1028
|
-
function _defineProperty(e, r, t) {
|
|
1029
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1039
|
+
function _defineProperty$1(e, r, t) {
|
|
1040
|
+
return (r = toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
1030
1041
|
value: t,
|
|
1031
1042
|
enumerable: !0,
|
|
1032
1043
|
configurable: !0,
|
|
@@ -1034,11 +1045,11 @@ function _defineProperty(e, r, t) {
|
|
|
1034
1045
|
}) : e[r] = t, e;
|
|
1035
1046
|
}
|
|
1036
1047
|
|
|
1037
|
-
function ownKeys$
|
|
1038
|
-
function _objectSpread$
|
|
1039
|
-
function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$
|
|
1040
|
-
function _unsupportedIterableToArray$
|
|
1041
|
-
function _arrayLikeToArray$
|
|
1048
|
+
function ownKeys$5(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; }
|
|
1049
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1050
|
+
function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1051
|
+
function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
|
|
1052
|
+
function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1042
1053
|
// 字段类型映射到PostgreSQL类型
|
|
1043
1054
|
var fieldTypeMapping = {
|
|
1044
1055
|
string: "text",
|
|
@@ -1056,20 +1067,20 @@ var fieldTypeMapping = {
|
|
|
1056
1067
|
};
|
|
1057
1068
|
var DynamicTableService = /*#__PURE__*/function () {
|
|
1058
1069
|
function DynamicTableService() {
|
|
1059
|
-
_classCallCheck(this, DynamicTableService);
|
|
1070
|
+
_classCallCheck$1(this, DynamicTableService);
|
|
1060
1071
|
this.supabase = getSupabase();
|
|
1061
1072
|
}
|
|
1062
1073
|
/**
|
|
1063
1074
|
* 默认按 created_at 倒序(新数据在前)。
|
|
1064
1075
|
* 兼容:如果表不存在 created_at 字段,则回退按 id 倒序。
|
|
1065
1076
|
*/
|
|
1066
|
-
return _createClass(DynamicTableService, [{
|
|
1077
|
+
return _createClass$1(DynamicTableService, [{
|
|
1067
1078
|
key: "orderByCreatedAtOrFallback",
|
|
1068
1079
|
value: (function () {
|
|
1069
|
-
var _orderByCreatedAtOrFallback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(buildQuery, offset, limit) {
|
|
1080
|
+
var _orderByCreatedAtOrFallback = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(buildQuery, offset, limit) {
|
|
1070
1081
|
var _first$error;
|
|
1071
1082
|
var first, msg, isMissingCreatedAt, second;
|
|
1072
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
1083
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
1073
1084
|
while (1) switch (_context.prev = _context.next) {
|
|
1074
1085
|
case 0:
|
|
1075
1086
|
_context.next = 1;
|
|
@@ -1200,9 +1211,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1200
1211
|
}, {
|
|
1201
1212
|
key: "createTable",
|
|
1202
1213
|
value: (function () {
|
|
1203
|
-
var _createTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(tableName, schema, baseTableName) {
|
|
1214
|
+
var _createTable = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(tableName, schema, baseTableName) {
|
|
1204
1215
|
var tablePrefix, createTableSQL, foreignKeys, _yield$this$supabase$, error, _t;
|
|
1205
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
1216
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
1206
1217
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1207
1218
|
case 0:
|
|
1208
1219
|
_context2.prev = 0;
|
|
@@ -1296,9 +1307,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1296
1307
|
}, {
|
|
1297
1308
|
key: "dropTable",
|
|
1298
1309
|
value: (function () {
|
|
1299
|
-
var _dropTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(tableName) {
|
|
1310
|
+
var _dropTable = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(tableName) {
|
|
1300
1311
|
var _yield$this$supabase$2, error, _t2;
|
|
1301
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
1312
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
1302
1313
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1303
1314
|
case 0:
|
|
1304
1315
|
_context3.prev = 0;
|
|
@@ -1341,9 +1352,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1341
1352
|
}, {
|
|
1342
1353
|
key: "dropAllForeignKeys",
|
|
1343
1354
|
value: (function () {
|
|
1344
|
-
var _dropAllForeignKeys = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(tableName) {
|
|
1355
|
+
var _dropAllForeignKeys = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(tableName) {
|
|
1345
1356
|
var parts, baseTableName, dropFKSQL, _yield$this$supabase$3, error, _t3;
|
|
1346
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
1357
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
1347
1358
|
while (1) switch (_context4.prev = _context4.next) {
|
|
1348
1359
|
case 0:
|
|
1349
1360
|
_context4.prev = 0;
|
|
@@ -1393,9 +1404,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1393
1404
|
}, {
|
|
1394
1405
|
key: "dropForeignKeyByName",
|
|
1395
1406
|
value: (function () {
|
|
1396
|
-
var _dropForeignKeyByName = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(tableName, constraintName) {
|
|
1407
|
+
var _dropForeignKeyByName = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee5(tableName, constraintName) {
|
|
1397
1408
|
var dropSQL, _yield$this$supabase$4, error, _t4;
|
|
1398
|
-
return _regeneratorRuntime.wrap(function (_context5) {
|
|
1409
|
+
return _regeneratorRuntime$1.wrap(function (_context5) {
|
|
1399
1410
|
while (1) switch (_context5.prev = _context5.next) {
|
|
1400
1411
|
case 0:
|
|
1401
1412
|
_context5.prev = 0;
|
|
@@ -1439,9 +1450,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1439
1450
|
}, {
|
|
1440
1451
|
key: "dropForeignKey",
|
|
1441
1452
|
value: (function () {
|
|
1442
|
-
var _dropForeignKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(tableName, constraintName) {
|
|
1453
|
+
var _dropForeignKey = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee6(tableName, constraintName) {
|
|
1443
1454
|
var _yield$this$supabase$5, error, _t5;
|
|
1444
|
-
return _regeneratorRuntime.wrap(function (_context6) {
|
|
1455
|
+
return _regeneratorRuntime$1.wrap(function (_context6) {
|
|
1445
1456
|
while (1) switch (_context6.prev = _context6.next) {
|
|
1446
1457
|
case 0:
|
|
1447
1458
|
_context6.prev = 0;
|
|
@@ -1483,9 +1494,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1483
1494
|
}, {
|
|
1484
1495
|
key: "tableExists",
|
|
1485
1496
|
value: (function () {
|
|
1486
|
-
var _tableExists = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(tableName) {
|
|
1497
|
+
var _tableExists = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee7(tableName) {
|
|
1487
1498
|
var _yield$this$supabase$6, data, error, _t6;
|
|
1488
|
-
return _regeneratorRuntime.wrap(function (_context7) {
|
|
1499
|
+
return _regeneratorRuntime$1.wrap(function (_context7) {
|
|
1489
1500
|
while (1) switch (_context7.prev = _context7.next) {
|
|
1490
1501
|
case 0:
|
|
1491
1502
|
_context7.prev = 0;
|
|
@@ -1527,9 +1538,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1527
1538
|
}, {
|
|
1528
1539
|
key: "getTableStructure",
|
|
1529
1540
|
value: (function () {
|
|
1530
|
-
var _getTableStructure = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(tableName) {
|
|
1541
|
+
var _getTableStructure = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee8(tableName) {
|
|
1531
1542
|
var _yield$this$supabase$7, data, error, _t7;
|
|
1532
|
-
return _regeneratorRuntime.wrap(function (_context8) {
|
|
1543
|
+
return _regeneratorRuntime$1.wrap(function (_context8) {
|
|
1533
1544
|
while (1) switch (_context8.prev = _context8.next) {
|
|
1534
1545
|
case 0:
|
|
1535
1546
|
_context8.prev = 0;
|
|
@@ -1571,9 +1582,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1571
1582
|
}, {
|
|
1572
1583
|
key: "executeQuery",
|
|
1573
1584
|
value: (function () {
|
|
1574
|
-
var _executeQuery = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(sql, values) {
|
|
1585
|
+
var _executeQuery = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee9(sql, values) {
|
|
1575
1586
|
var finalSql, _yield$this$supabase$8, data, error, _t8;
|
|
1576
|
-
return _regeneratorRuntime.wrap(function (_context9) {
|
|
1587
|
+
return _regeneratorRuntime$1.wrap(function (_context9) {
|
|
1577
1588
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1578
1589
|
case 0:
|
|
1579
1590
|
_context9.prev = 0;
|
|
@@ -1624,7 +1635,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1624
1635
|
}, {
|
|
1625
1636
|
key: "getTableData",
|
|
1626
1637
|
value: (function () {
|
|
1627
|
-
var _getTableData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(tableName) {
|
|
1638
|
+
var _getTableData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee0(tableName) {
|
|
1628
1639
|
var _this = this;
|
|
1629
1640
|
var page,
|
|
1630
1641
|
limit,
|
|
@@ -1637,7 +1648,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1637
1648
|
count,
|
|
1638
1649
|
_args0 = arguments,
|
|
1639
1650
|
_t9;
|
|
1640
|
-
return _regeneratorRuntime.wrap(function (_context0) {
|
|
1651
|
+
return _regeneratorRuntime$1.wrap(function (_context0) {
|
|
1641
1652
|
while (1) switch (_context0.prev = _context0.next) {
|
|
1642
1653
|
case 0:
|
|
1643
1654
|
page = _args0.length > 1 && _args0[1] !== undefined ? _args0[1] : 1;
|
|
@@ -1696,7 +1707,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1696
1707
|
}, {
|
|
1697
1708
|
key: "getTableDataWithSearch",
|
|
1698
1709
|
value: (function () {
|
|
1699
|
-
var _getTableDataWithSearch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(tableName) {
|
|
1710
|
+
var _getTableDataWithSearch = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee1(tableName) {
|
|
1700
1711
|
var _this2 = this;
|
|
1701
1712
|
var page,
|
|
1702
1713
|
limit,
|
|
@@ -1710,7 +1721,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1710
1721
|
count,
|
|
1711
1722
|
_args1 = arguments,
|
|
1712
1723
|
_t0;
|
|
1713
|
-
return _regeneratorRuntime.wrap(function (_context1) {
|
|
1724
|
+
return _regeneratorRuntime$1.wrap(function (_context1) {
|
|
1714
1725
|
while (1) switch (_context1.prev = _context1.next) {
|
|
1715
1726
|
case 0:
|
|
1716
1727
|
page = _args1.length > 1 && _args1[1] !== undefined ? _args1[1] : 1;
|
|
@@ -1772,7 +1783,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1772
1783
|
}, {
|
|
1773
1784
|
key: "insertData",
|
|
1774
1785
|
value: (function () {
|
|
1775
|
-
var _insertData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(tableName, data) {
|
|
1786
|
+
var _insertData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee10(tableName, data) {
|
|
1776
1787
|
var autoFixForeignKey,
|
|
1777
1788
|
_yield$this$supabase$9,
|
|
1778
1789
|
result,
|
|
@@ -1784,7 +1795,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1784
1795
|
_dropResult,
|
|
1785
1796
|
_args10 = arguments,
|
|
1786
1797
|
_t1;
|
|
1787
|
-
return _regeneratorRuntime.wrap(function (_context10) {
|
|
1798
|
+
return _regeneratorRuntime$1.wrap(function (_context10) {
|
|
1788
1799
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1789
1800
|
case 0:
|
|
1790
1801
|
autoFixForeignKey = _args10.length > 2 && _args10[2] !== undefined ? _args10[2] : true;
|
|
@@ -1874,7 +1885,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1874
1885
|
}, {
|
|
1875
1886
|
key: "updateData",
|
|
1876
1887
|
value: (function () {
|
|
1877
|
-
var _updateData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(tableName, id, data) {
|
|
1888
|
+
var _updateData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee11(tableName, id, data) {
|
|
1878
1889
|
var autoFixForeignKey,
|
|
1879
1890
|
_yield$this$supabase$0,
|
|
1880
1891
|
result,
|
|
@@ -1886,7 +1897,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1886
1897
|
_dropResult2,
|
|
1887
1898
|
_args11 = arguments,
|
|
1888
1899
|
_t10;
|
|
1889
|
-
return _regeneratorRuntime.wrap(function (_context11) {
|
|
1900
|
+
return _regeneratorRuntime$1.wrap(function (_context11) {
|
|
1890
1901
|
while (1) switch (_context11.prev = _context11.next) {
|
|
1891
1902
|
case 0:
|
|
1892
1903
|
autoFixForeignKey = _args11.length > 3 && _args11[3] !== undefined ? _args11[3] : true;
|
|
@@ -1974,9 +1985,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
1974
1985
|
}, {
|
|
1975
1986
|
key: "deleteData",
|
|
1976
1987
|
value: (function () {
|
|
1977
|
-
var _deleteData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(tableName, id) {
|
|
1988
|
+
var _deleteData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee12(tableName, id) {
|
|
1978
1989
|
var _yield$this$supabase$1, result, error, _t11;
|
|
1979
|
-
return _regeneratorRuntime.wrap(function (_context12) {
|
|
1990
|
+
return _regeneratorRuntime$1.wrap(function (_context12) {
|
|
1980
1991
|
while (1) switch (_context12.prev = _context12.next) {
|
|
1981
1992
|
case 0:
|
|
1982
1993
|
_context12.prev = 0;
|
|
@@ -2017,9 +2028,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
2017
2028
|
}, {
|
|
2018
2029
|
key: "getDataById",
|
|
2019
2030
|
value: (function () {
|
|
2020
|
-
var _getDataById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(tableName, id) {
|
|
2031
|
+
var _getDataById = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee13(tableName, id) {
|
|
2021
2032
|
var _yield$this$supabase$10, data, error, _t12;
|
|
2022
|
-
return _regeneratorRuntime.wrap(function (_context13) {
|
|
2033
|
+
return _regeneratorRuntime$1.wrap(function (_context13) {
|
|
2023
2034
|
while (1) switch (_context13.prev = _context13.next) {
|
|
2024
2035
|
case 0:
|
|
2025
2036
|
_context13.prev = 0;
|
|
@@ -2067,9 +2078,9 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
2067
2078
|
}, {
|
|
2068
2079
|
key: "getRelationOptions",
|
|
2069
2080
|
value: (function () {
|
|
2070
|
-
var _getRelationOptions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(params) {
|
|
2081
|
+
var _getRelationOptions = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee14(params) {
|
|
2071
2082
|
var tableName, _params$displayField, displayField, _params$limit, limit, search, query, _yield$query, data, error, _t13;
|
|
2072
|
-
return _regeneratorRuntime.wrap(function (_context14) {
|
|
2083
|
+
return _regeneratorRuntime$1.wrap(function (_context14) {
|
|
2073
2084
|
while (1) switch (_context14.prev = _context14.next) {
|
|
2074
2085
|
case 0:
|
|
2075
2086
|
_context14.prev = 0;
|
|
@@ -2091,7 +2102,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
2091
2102
|
throw error;
|
|
2092
2103
|
case 2:
|
|
2093
2104
|
return _context14.abrupt("return", (data || []).map(function (item) {
|
|
2094
|
-
return _objectSpread$
|
|
2105
|
+
return _objectSpread$5({
|
|
2095
2106
|
id: item.id,
|
|
2096
2107
|
label: item[displayField] || "ID: ".concat(item.id)
|
|
2097
2108
|
}, item);
|
|
@@ -2124,7 +2135,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
2124
2135
|
}, {
|
|
2125
2136
|
key: "getTableDataWithRelations",
|
|
2126
2137
|
value: (function () {
|
|
2127
|
-
var _getTableDataWithRelations = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(tableName, schema) {
|
|
2138
|
+
var _getTableDataWithRelations = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee15(tableName, schema) {
|
|
2128
2139
|
var _this3 = this;
|
|
2129
2140
|
var page,
|
|
2130
2141
|
limit,
|
|
@@ -2138,7 +2149,7 @@ var DynamicTableService = /*#__PURE__*/function () {
|
|
|
2138
2149
|
count,
|
|
2139
2150
|
_args15 = arguments,
|
|
2140
2151
|
_t14;
|
|
2141
|
-
return _regeneratorRuntime.wrap(function (_context15) {
|
|
2152
|
+
return _regeneratorRuntime$1.wrap(function (_context15) {
|
|
2142
2153
|
while (1) switch (_context15.prev = _context15.next) {
|
|
2143
2154
|
case 0:
|
|
2144
2155
|
page = _args15.length > 2 && _args15[2] !== undefined ? _args15[2] : 1;
|
|
@@ -2204,28 +2215,28 @@ function getDynamicTableService() {
|
|
|
2204
2215
|
return defaultService$1;
|
|
2205
2216
|
}
|
|
2206
2217
|
|
|
2207
|
-
function ownKeys$
|
|
2208
|
-
function _objectSpread$
|
|
2218
|
+
function ownKeys$4(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; }
|
|
2219
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2209
2220
|
var AuthService = /*#__PURE__*/function () {
|
|
2210
2221
|
function AuthService() {
|
|
2211
|
-
_classCallCheck(this, AuthService);
|
|
2222
|
+
_classCallCheck$1(this, AuthService);
|
|
2212
2223
|
this.supabase = getSupabase();
|
|
2213
2224
|
this.defaultTableName = 'cms_users';
|
|
2214
2225
|
}
|
|
2215
2226
|
/**
|
|
2216
2227
|
* 根据用户名查询用户
|
|
2217
2228
|
*/
|
|
2218
|
-
return _createClass(AuthService, [{
|
|
2229
|
+
return _createClass$1(AuthService, [{
|
|
2219
2230
|
key: "findUserByUsername",
|
|
2220
2231
|
value: (function () {
|
|
2221
|
-
var _findUserByUsername = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(username) {
|
|
2232
|
+
var _findUserByUsername = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(username) {
|
|
2222
2233
|
var tableName,
|
|
2223
2234
|
_yield$this$supabase$,
|
|
2224
2235
|
users,
|
|
2225
2236
|
error,
|
|
2226
2237
|
_args = arguments,
|
|
2227
2238
|
_t;
|
|
2228
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
2239
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
2229
2240
|
while (1) switch (_context.prev = _context.next) {
|
|
2230
2241
|
case 0:
|
|
2231
2242
|
tableName = _args.length > 1 && _args[1] !== undefined ? _args[1] : this.defaultTableName;
|
|
@@ -2273,14 +2284,14 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2273
2284
|
}, {
|
|
2274
2285
|
key: "findUserById",
|
|
2275
2286
|
value: (function () {
|
|
2276
|
-
var _findUserById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(userId) {
|
|
2287
|
+
var _findUserById = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(userId) {
|
|
2277
2288
|
var tableName,
|
|
2278
2289
|
_yield$this$supabase$2,
|
|
2279
2290
|
users,
|
|
2280
2291
|
error,
|
|
2281
2292
|
_args2 = arguments,
|
|
2282
2293
|
_t2;
|
|
2283
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
2294
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
2284
2295
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2285
2296
|
case 0:
|
|
2286
2297
|
tableName = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : this.defaultTableName;
|
|
@@ -2328,14 +2339,14 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2328
2339
|
}, {
|
|
2329
2340
|
key: "checkUsernameExists",
|
|
2330
2341
|
value: (function () {
|
|
2331
|
-
var _checkUsernameExists = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(username) {
|
|
2342
|
+
var _checkUsernameExists = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(username) {
|
|
2332
2343
|
var tableName,
|
|
2333
2344
|
_yield$this$supabase$3,
|
|
2334
2345
|
users,
|
|
2335
2346
|
error,
|
|
2336
2347
|
_args3 = arguments,
|
|
2337
2348
|
_t3;
|
|
2338
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
2349
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
2339
2350
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2340
2351
|
case 0:
|
|
2341
2352
|
tableName = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : this.defaultTableName;
|
|
@@ -2377,12 +2388,12 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2377
2388
|
}, {
|
|
2378
2389
|
key: "createUser",
|
|
2379
2390
|
value: (function () {
|
|
2380
|
-
var _createUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(userData) {
|
|
2391
|
+
var _createUser = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(userData) {
|
|
2381
2392
|
var finalUserData, _yield$this$supabase$4, result, error, _t4;
|
|
2382
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
2393
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
2383
2394
|
while (1) switch (_context4.prev = _context4.next) {
|
|
2384
2395
|
case 0:
|
|
2385
|
-
finalUserData = _objectSpread$
|
|
2396
|
+
finalUserData = _objectSpread$4({
|
|
2386
2397
|
tableName: this.defaultTableName
|
|
2387
2398
|
}, userData);
|
|
2388
2399
|
_context4.prev = 1;
|
|
@@ -2427,7 +2438,7 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2427
2438
|
}, {
|
|
2428
2439
|
key: "updateUser",
|
|
2429
2440
|
value: (function () {
|
|
2430
|
-
var _updateUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(userId) {
|
|
2441
|
+
var _updateUser = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee5(userId) {
|
|
2431
2442
|
var updateData,
|
|
2432
2443
|
finalUpdateData,
|
|
2433
2444
|
_yield$this$supabase$5,
|
|
@@ -2435,12 +2446,12 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2435
2446
|
error,
|
|
2436
2447
|
_args5 = arguments,
|
|
2437
2448
|
_t5;
|
|
2438
|
-
return _regeneratorRuntime.wrap(function (_context5) {
|
|
2449
|
+
return _regeneratorRuntime$1.wrap(function (_context5) {
|
|
2439
2450
|
while (1) switch (_context5.prev = _context5.next) {
|
|
2440
2451
|
case 0:
|
|
2441
2452
|
updateData = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
2442
2453
|
// 设置默认值
|
|
2443
|
-
finalUpdateData = _objectSpread$
|
|
2454
|
+
finalUpdateData = _objectSpread$4({
|
|
2444
2455
|
tableName: this.defaultTableName
|
|
2445
2456
|
}, updateData);
|
|
2446
2457
|
_context5.prev = 1;
|
|
@@ -2481,13 +2492,13 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2481
2492
|
}, {
|
|
2482
2493
|
key: "deleteUser",
|
|
2483
2494
|
value: (function () {
|
|
2484
|
-
var _deleteUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(userId) {
|
|
2495
|
+
var _deleteUser = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee6(userId) {
|
|
2485
2496
|
var tableName,
|
|
2486
2497
|
_yield$this$supabase$6,
|
|
2487
2498
|
error,
|
|
2488
2499
|
_args6 = arguments,
|
|
2489
2500
|
_t6;
|
|
2490
|
-
return _regeneratorRuntime.wrap(function (_context6) {
|
|
2501
|
+
return _regeneratorRuntime$1.wrap(function (_context6) {
|
|
2491
2502
|
while (1) switch (_context6.prev = _context6.next) {
|
|
2492
2503
|
case 0:
|
|
2493
2504
|
tableName = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : this.defaultTableName;
|
|
@@ -2528,7 +2539,7 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2528
2539
|
}, {
|
|
2529
2540
|
key: "getUserList",
|
|
2530
2541
|
value: (function () {
|
|
2531
|
-
var _getUserList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
2542
|
+
var _getUserList = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee7() {
|
|
2532
2543
|
var page,
|
|
2533
2544
|
limit,
|
|
2534
2545
|
tableName,
|
|
@@ -2539,7 +2550,7 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2539
2550
|
count,
|
|
2540
2551
|
_args7 = arguments,
|
|
2541
2552
|
_t7;
|
|
2542
|
-
return _regeneratorRuntime.wrap(function (_context7) {
|
|
2553
|
+
return _regeneratorRuntime$1.wrap(function (_context7) {
|
|
2543
2554
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2544
2555
|
case 0:
|
|
2545
2556
|
page = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : 1;
|
|
@@ -2595,7 +2606,7 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2595
2606
|
}, {
|
|
2596
2607
|
key: "searchUsers",
|
|
2597
2608
|
value: (function () {
|
|
2598
|
-
var _searchUsers = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(searchValue) {
|
|
2609
|
+
var _searchUsers = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee8(searchValue) {
|
|
2599
2610
|
var page,
|
|
2600
2611
|
limit,
|
|
2601
2612
|
tableName,
|
|
@@ -2606,7 +2617,7 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2606
2617
|
count,
|
|
2607
2618
|
_args8 = arguments,
|
|
2608
2619
|
_t8;
|
|
2609
|
-
return _regeneratorRuntime.wrap(function (_context8) {
|
|
2620
|
+
return _regeneratorRuntime$1.wrap(function (_context8) {
|
|
2610
2621
|
while (1) switch (_context8.prev = _context8.next) {
|
|
2611
2622
|
case 0:
|
|
2612
2623
|
page = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : 1;
|
|
@@ -2662,13 +2673,13 @@ var AuthService = /*#__PURE__*/function () {
|
|
|
2662
2673
|
}, {
|
|
2663
2674
|
key: "updateLastLogin",
|
|
2664
2675
|
value: (function () {
|
|
2665
|
-
var _updateLastLogin = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(userId) {
|
|
2676
|
+
var _updateLastLogin = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee9(userId) {
|
|
2666
2677
|
var tableName,
|
|
2667
2678
|
_yield$this$supabase$9,
|
|
2668
2679
|
error,
|
|
2669
2680
|
_args9 = arguments,
|
|
2670
2681
|
_t9;
|
|
2671
|
-
return _regeneratorRuntime.wrap(function (_context9) {
|
|
2682
|
+
return _regeneratorRuntime$1.wrap(function (_context9) {
|
|
2672
2683
|
while (1) switch (_context9.prev = _context9.next) {
|
|
2673
2684
|
case 0:
|
|
2674
2685
|
tableName = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : this.defaultTableName;
|
|
@@ -2734,30 +2745,30 @@ function _objectWithoutProperties(e, t) {
|
|
|
2734
2745
|
return i;
|
|
2735
2746
|
}
|
|
2736
2747
|
|
|
2737
|
-
function _assertThisInitialized(e) {
|
|
2748
|
+
function _assertThisInitialized$1(e) {
|
|
2738
2749
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2739
2750
|
return e;
|
|
2740
2751
|
}
|
|
2741
2752
|
|
|
2742
|
-
function _possibleConstructorReturn(t, e) {
|
|
2743
|
-
if (e && ("object" == _typeof$
|
|
2753
|
+
function _possibleConstructorReturn$1(t, e) {
|
|
2754
|
+
if (e && ("object" == _typeof$2(e) || "function" == typeof e)) return e;
|
|
2744
2755
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2745
|
-
return _assertThisInitialized(t);
|
|
2756
|
+
return _assertThisInitialized$1(t);
|
|
2746
2757
|
}
|
|
2747
2758
|
|
|
2748
|
-
function _getPrototypeOf(t) {
|
|
2749
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
2759
|
+
function _getPrototypeOf$1(t) {
|
|
2760
|
+
return _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
2750
2761
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
2751
|
-
}, _getPrototypeOf(t);
|
|
2762
|
+
}, _getPrototypeOf$1(t);
|
|
2752
2763
|
}
|
|
2753
2764
|
|
|
2754
|
-
function _setPrototypeOf(t, e) {
|
|
2755
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
2765
|
+
function _setPrototypeOf$1(t, e) {
|
|
2766
|
+
return _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
2756
2767
|
return t.__proto__ = e, t;
|
|
2757
|
-
}, _setPrototypeOf(t, e);
|
|
2768
|
+
}, _setPrototypeOf$1(t, e);
|
|
2758
2769
|
}
|
|
2759
2770
|
|
|
2760
|
-
function _inherits(t, e) {
|
|
2771
|
+
function _inherits$1(t, e) {
|
|
2761
2772
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
2762
2773
|
t.prototype = Object.create(e && e.prototype, {
|
|
2763
2774
|
constructor: {
|
|
@@ -2767,10 +2778,10 @@ function _inherits(t, e) {
|
|
|
2767
2778
|
}
|
|
2768
2779
|
}), Object.defineProperty(t, "prototype", {
|
|
2769
2780
|
writable: !1
|
|
2770
|
-
}), e && _setPrototypeOf(t, e);
|
|
2781
|
+
}), e && _setPrototypeOf$1(t, e);
|
|
2771
2782
|
}
|
|
2772
2783
|
|
|
2773
|
-
function _isNativeFunction(t) {
|
|
2784
|
+
function _isNativeFunction$1(t) {
|
|
2774
2785
|
try {
|
|
2775
2786
|
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
2776
2787
|
} catch (n) {
|
|
@@ -2778,34 +2789,34 @@ function _isNativeFunction(t) {
|
|
|
2778
2789
|
}
|
|
2779
2790
|
}
|
|
2780
2791
|
|
|
2781
|
-
function _isNativeReflectConstruct$
|
|
2792
|
+
function _isNativeReflectConstruct$3() {
|
|
2782
2793
|
try {
|
|
2783
2794
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
2784
2795
|
} catch (t) {}
|
|
2785
|
-
return (_isNativeReflectConstruct$
|
|
2796
|
+
return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
|
|
2786
2797
|
return !!t;
|
|
2787
2798
|
})();
|
|
2788
2799
|
}
|
|
2789
2800
|
|
|
2790
|
-
function _construct(t, e, r) {
|
|
2791
|
-
if (_isNativeReflectConstruct$
|
|
2801
|
+
function _construct$1(t, e, r) {
|
|
2802
|
+
if (_isNativeReflectConstruct$3()) return Reflect.construct.apply(null, arguments);
|
|
2792
2803
|
var o = [null];
|
|
2793
2804
|
o.push.apply(o, e);
|
|
2794
2805
|
var p = new (t.bind.apply(t, o))();
|
|
2795
|
-
return r && _setPrototypeOf(p, r.prototype), p;
|
|
2806
|
+
return r && _setPrototypeOf$1(p, r.prototype), p;
|
|
2796
2807
|
}
|
|
2797
2808
|
|
|
2798
|
-
function _wrapNativeSuper(t) {
|
|
2809
|
+
function _wrapNativeSuper$1(t) {
|
|
2799
2810
|
var r = "function" == typeof Map ? new Map() : void 0;
|
|
2800
|
-
return _wrapNativeSuper = function _wrapNativeSuper(t) {
|
|
2801
|
-
if (null === t || !_isNativeFunction(t)) return t;
|
|
2811
|
+
return _wrapNativeSuper$1 = function _wrapNativeSuper(t) {
|
|
2812
|
+
if (null === t || !_isNativeFunction$1(t)) return t;
|
|
2802
2813
|
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
2803
2814
|
if (void 0 !== r) {
|
|
2804
2815
|
if (r.has(t)) return r.get(t);
|
|
2805
2816
|
r.set(t, Wrapper);
|
|
2806
2817
|
}
|
|
2807
2818
|
function Wrapper() {
|
|
2808
|
-
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
2819
|
+
return _construct$1(t, arguments, _getPrototypeOf$1(this).constructor);
|
|
2809
2820
|
}
|
|
2810
2821
|
return Wrapper.prototype = Object.create(t.prototype, {
|
|
2811
2822
|
constructor: {
|
|
@@ -2814,42 +2825,557 @@ function _wrapNativeSuper(t) {
|
|
|
2814
2825
|
writable: !0,
|
|
2815
2826
|
configurable: !0
|
|
2816
2827
|
}
|
|
2817
|
-
}), _setPrototypeOf(Wrapper, t);
|
|
2818
|
-
}, _wrapNativeSuper(t);
|
|
2828
|
+
}), _setPrototypeOf$1(Wrapper, t);
|
|
2829
|
+
}, _wrapNativeSuper$1(t);
|
|
2819
2830
|
}
|
|
2820
2831
|
|
|
2821
|
-
function
|
|
2832
|
+
function _typeof$1(o) {
|
|
2833
|
+
"@babel/helpers - typeof";
|
|
2834
|
+
|
|
2835
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
2836
|
+
return typeof o;
|
|
2837
|
+
} : function (o) {
|
|
2838
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
2839
|
+
}, _typeof$1(o);
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
function toPrimitive(t, r) {
|
|
2843
|
+
if ("object" != _typeof$1(t) || !t) return t;
|
|
2844
|
+
var e = t[Symbol.toPrimitive];
|
|
2845
|
+
if (void 0 !== e) {
|
|
2846
|
+
var i = e.call(t, r || "default");
|
|
2847
|
+
if ("object" != _typeof$1(i)) return i;
|
|
2848
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2849
|
+
}
|
|
2850
|
+
return ("string" === r ? String : Number)(t);
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2853
|
+
function toPropertyKey(t) {
|
|
2854
|
+
var i = toPrimitive(t, "string");
|
|
2855
|
+
return "symbol" == _typeof$1(i) ? i : i + "";
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
function _defineProperty(e, r, t) {
|
|
2859
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2860
|
+
value: t,
|
|
2861
|
+
enumerable: !0,
|
|
2862
|
+
configurable: !0,
|
|
2863
|
+
writable: !0
|
|
2864
|
+
}) : e[r] = t, e;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
2868
|
+
try {
|
|
2869
|
+
var i = n[a](c),
|
|
2870
|
+
u = i.value;
|
|
2871
|
+
} catch (n) {
|
|
2872
|
+
return void e(n);
|
|
2873
|
+
}
|
|
2874
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
2875
|
+
}
|
|
2876
|
+
function _asyncToGenerator(n) {
|
|
2877
|
+
return function () {
|
|
2878
|
+
var t = this,
|
|
2879
|
+
e = arguments;
|
|
2880
|
+
return new Promise(function (r, o) {
|
|
2881
|
+
var a = n.apply(t, e);
|
|
2882
|
+
function _next(n) {
|
|
2883
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
2884
|
+
}
|
|
2885
|
+
function _throw(n) {
|
|
2886
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
2887
|
+
}
|
|
2888
|
+
_next(void 0);
|
|
2889
|
+
});
|
|
2890
|
+
};
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
function _arrayLikeToArray$3(r, a) {
|
|
2822
2894
|
(null == a || a > r.length) && (a = r.length);
|
|
2823
2895
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2824
2896
|
return n;
|
|
2825
2897
|
}
|
|
2826
2898
|
|
|
2827
|
-
function _arrayWithoutHoles(r) {
|
|
2828
|
-
if (Array.isArray(r)) return _arrayLikeToArray$
|
|
2829
|
-
}
|
|
2899
|
+
function _arrayWithoutHoles$1(r) {
|
|
2900
|
+
if (Array.isArray(r)) return _arrayLikeToArray$3(r);
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
function _iterableToArray$1(r) {
|
|
2904
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
function _unsupportedIterableToArray$3(r, a) {
|
|
2908
|
+
if (r) {
|
|
2909
|
+
if ("string" == typeof r) return _arrayLikeToArray$3(r, a);
|
|
2910
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
2911
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
function _nonIterableSpread$1() {
|
|
2916
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
function _toConsumableArray$1(r) {
|
|
2920
|
+
return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$3(r) || _nonIterableSpread$1();
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
function _defineProperties(e, r) {
|
|
2924
|
+
for (var t = 0; t < r.length; t++) {
|
|
2925
|
+
var o = r[t];
|
|
2926
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
function _createClass(e, r, t) {
|
|
2930
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
2931
|
+
writable: !1
|
|
2932
|
+
}), e;
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
function _classCallCheck(a, n) {
|
|
2936
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
function _assertThisInitialized(e) {
|
|
2940
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2941
|
+
return e;
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
function _possibleConstructorReturn(t, e) {
|
|
2945
|
+
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e;
|
|
2946
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2947
|
+
return _assertThisInitialized(t);
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
function _getPrototypeOf(t) {
|
|
2951
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
2952
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
2953
|
+
}, _getPrototypeOf(t);
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
function _setPrototypeOf(t, e) {
|
|
2957
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
2958
|
+
return t.__proto__ = e, t;
|
|
2959
|
+
}, _setPrototypeOf(t, e);
|
|
2960
|
+
}
|
|
2961
|
+
|
|
2962
|
+
function _inherits(t, e) {
|
|
2963
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
2964
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
2965
|
+
constructor: {
|
|
2966
|
+
value: t,
|
|
2967
|
+
writable: !0,
|
|
2968
|
+
configurable: !0
|
|
2969
|
+
}
|
|
2970
|
+
}), Object.defineProperty(t, "prototype", {
|
|
2971
|
+
writable: !1
|
|
2972
|
+
}), e && _setPrototypeOf(t, e);
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
function _isNativeFunction(t) {
|
|
2976
|
+
try {
|
|
2977
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
2978
|
+
} catch (n) {
|
|
2979
|
+
return "function" == typeof t;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
function _isNativeReflectConstruct$2() {
|
|
2984
|
+
try {
|
|
2985
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
2986
|
+
} catch (t) {}
|
|
2987
|
+
return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
|
|
2988
|
+
return !!t;
|
|
2989
|
+
})();
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
function _construct(t, e, r) {
|
|
2993
|
+
if (_isNativeReflectConstruct$2()) return Reflect.construct.apply(null, arguments);
|
|
2994
|
+
var o = [null];
|
|
2995
|
+
o.push.apply(o, e);
|
|
2996
|
+
var p = new (t.bind.apply(t, o))();
|
|
2997
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
function _wrapNativeSuper(t) {
|
|
3001
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
3002
|
+
return _wrapNativeSuper = function _wrapNativeSuper(t) {
|
|
3003
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
3004
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
3005
|
+
if (void 0 !== r) {
|
|
3006
|
+
if (r.has(t)) return r.get(t);
|
|
3007
|
+
r.set(t, Wrapper);
|
|
3008
|
+
}
|
|
3009
|
+
function Wrapper() {
|
|
3010
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
3011
|
+
}
|
|
3012
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
3013
|
+
constructor: {
|
|
3014
|
+
value: Wrapper,
|
|
3015
|
+
enumerable: !1,
|
|
3016
|
+
writable: !0,
|
|
3017
|
+
configurable: !0
|
|
3018
|
+
}
|
|
3019
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
3020
|
+
}, _wrapNativeSuper(t);
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
var regeneratorRuntime$1 = {exports: {}};
|
|
3024
|
+
|
|
3025
|
+
var OverloadYield = {exports: {}};
|
|
3026
|
+
|
|
3027
|
+
(function (module) {
|
|
3028
|
+
function _OverloadYield(e, d) {
|
|
3029
|
+
this.v = e, this.k = d;
|
|
3030
|
+
}
|
|
3031
|
+
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3032
|
+
})(OverloadYield);
|
|
3033
|
+
var OverloadYieldExports = OverloadYield.exports;
|
|
3034
|
+
|
|
3035
|
+
var regenerator$1 = {exports: {}};
|
|
3036
|
+
|
|
3037
|
+
var regeneratorDefine = {exports: {}};
|
|
3038
|
+
|
|
3039
|
+
(function (module) {
|
|
3040
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
3041
|
+
var i = Object.defineProperty;
|
|
3042
|
+
try {
|
|
3043
|
+
i({}, "", {});
|
|
3044
|
+
} catch (e) {
|
|
3045
|
+
i = 0;
|
|
3046
|
+
}
|
|
3047
|
+
module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
|
|
3048
|
+
function o(r, n) {
|
|
3049
|
+
_regeneratorDefine(e, r, function (e) {
|
|
3050
|
+
return this._invoke(r, n, e);
|
|
3051
|
+
});
|
|
3052
|
+
}
|
|
3053
|
+
r ? i ? i(e, r, {
|
|
3054
|
+
value: n,
|
|
3055
|
+
enumerable: !t,
|
|
3056
|
+
configurable: !t,
|
|
3057
|
+
writable: !t
|
|
3058
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
3059
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
|
|
3060
|
+
}
|
|
3061
|
+
module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3062
|
+
})(regeneratorDefine);
|
|
3063
|
+
var regeneratorDefineExports = regeneratorDefine.exports;
|
|
3064
|
+
|
|
3065
|
+
(function (module) {
|
|
3066
|
+
var regeneratorDefine = regeneratorDefineExports;
|
|
3067
|
+
function _regenerator() {
|
|
3068
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3069
|
+
var e,
|
|
3070
|
+
t,
|
|
3071
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
3072
|
+
n = r.iterator || "@@iterator",
|
|
3073
|
+
o = r.toStringTag || "@@toStringTag";
|
|
3074
|
+
function i(r, n, o, i) {
|
|
3075
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
3076
|
+
u = Object.create(c.prototype);
|
|
3077
|
+
return regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
3078
|
+
var i,
|
|
3079
|
+
c,
|
|
3080
|
+
u,
|
|
3081
|
+
f = 0,
|
|
3082
|
+
p = o || [],
|
|
3083
|
+
y = !1,
|
|
3084
|
+
G = {
|
|
3085
|
+
p: 0,
|
|
3086
|
+
n: 0,
|
|
3087
|
+
v: e,
|
|
3088
|
+
a: d,
|
|
3089
|
+
f: d.bind(e, 4),
|
|
3090
|
+
d: function d(t, r) {
|
|
3091
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
3092
|
+
}
|
|
3093
|
+
};
|
|
3094
|
+
function d(r, n) {
|
|
3095
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
3096
|
+
var o,
|
|
3097
|
+
i = p[t],
|
|
3098
|
+
d = G.p,
|
|
3099
|
+
l = i[2];
|
|
3100
|
+
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));
|
|
3101
|
+
}
|
|
3102
|
+
if (o || r > 1) return a;
|
|
3103
|
+
throw y = !0, n;
|
|
3104
|
+
}
|
|
3105
|
+
return function (o, p, l) {
|
|
3106
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
3107
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
3108
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
3109
|
+
try {
|
|
3110
|
+
if (f = 2, i) {
|
|
3111
|
+
if (c || (o = "next"), t = i[o]) {
|
|
3112
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
3113
|
+
if (!t.done) return t;
|
|
3114
|
+
u = t.value, c < 2 && (c = 0);
|
|
3115
|
+
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
3116
|
+
i = e;
|
|
3117
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
3118
|
+
} catch (t) {
|
|
3119
|
+
i = e, c = 1, u = t;
|
|
3120
|
+
} finally {
|
|
3121
|
+
f = 1;
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
return {
|
|
3125
|
+
value: t,
|
|
3126
|
+
done: y
|
|
3127
|
+
};
|
|
3128
|
+
};
|
|
3129
|
+
}(r, o, i), !0), u;
|
|
3130
|
+
}
|
|
3131
|
+
var a = {};
|
|
3132
|
+
function Generator() {}
|
|
3133
|
+
function GeneratorFunction() {}
|
|
3134
|
+
function GeneratorFunctionPrototype() {}
|
|
3135
|
+
t = Object.getPrototypeOf;
|
|
3136
|
+
var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
|
|
3137
|
+
return this;
|
|
3138
|
+
}), t),
|
|
3139
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
3140
|
+
function f(e) {
|
|
3141
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
3142
|
+
}
|
|
3143
|
+
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 () {
|
|
3144
|
+
return this;
|
|
3145
|
+
}), regeneratorDefine(u, "toString", function () {
|
|
3146
|
+
return "[object Generator]";
|
|
3147
|
+
}), (module.exports = _regenerator = function _regenerator() {
|
|
3148
|
+
return {
|
|
3149
|
+
w: i,
|
|
3150
|
+
m: f
|
|
3151
|
+
};
|
|
3152
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
|
|
3153
|
+
}
|
|
3154
|
+
module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3155
|
+
})(regenerator$1);
|
|
3156
|
+
var regeneratorExports = regenerator$1.exports;
|
|
3157
|
+
|
|
3158
|
+
var regeneratorAsync = {exports: {}};
|
|
3159
|
+
|
|
3160
|
+
var regeneratorAsyncGen = {exports: {}};
|
|
3161
|
+
|
|
3162
|
+
var regeneratorAsyncIterator = {exports: {}};
|
|
3163
|
+
|
|
3164
|
+
(function (module) {
|
|
3165
|
+
var OverloadYield = OverloadYieldExports;
|
|
3166
|
+
var regeneratorDefine = regeneratorDefineExports;
|
|
3167
|
+
function AsyncIterator(t, e) {
|
|
3168
|
+
function n(r, o, i, f) {
|
|
3169
|
+
try {
|
|
3170
|
+
var c = t[r](o),
|
|
3171
|
+
u = c.value;
|
|
3172
|
+
return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
3173
|
+
n("next", t, i, f);
|
|
3174
|
+
}, function (t) {
|
|
3175
|
+
n("throw", t, i, f);
|
|
3176
|
+
}) : e.resolve(u).then(function (t) {
|
|
3177
|
+
c.value = t, i(c);
|
|
3178
|
+
}, function (t) {
|
|
3179
|
+
return n("throw", t, i, f);
|
|
3180
|
+
});
|
|
3181
|
+
} catch (t) {
|
|
3182
|
+
f(t);
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
var r;
|
|
3186
|
+
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
3187
|
+
return this;
|
|
3188
|
+
})), regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
3189
|
+
function f() {
|
|
3190
|
+
return new e(function (e, r) {
|
|
3191
|
+
n(t, i, e, r);
|
|
3192
|
+
});
|
|
3193
|
+
}
|
|
3194
|
+
return r = r ? r.then(f, f) : f();
|
|
3195
|
+
}, !0);
|
|
3196
|
+
}
|
|
3197
|
+
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3198
|
+
})(regeneratorAsyncIterator);
|
|
3199
|
+
var regeneratorAsyncIteratorExports = regeneratorAsyncIterator.exports;
|
|
3200
|
+
|
|
3201
|
+
(function (module) {
|
|
3202
|
+
var regenerator = regeneratorExports;
|
|
3203
|
+
var regeneratorAsyncIterator = regeneratorAsyncIteratorExports;
|
|
3204
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
3205
|
+
return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
|
|
3206
|
+
}
|
|
3207
|
+
module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3208
|
+
})(regeneratorAsyncGen);
|
|
3209
|
+
var regeneratorAsyncGenExports = regeneratorAsyncGen.exports;
|
|
3210
|
+
|
|
3211
|
+
(function (module) {
|
|
3212
|
+
var regeneratorAsyncGen = regeneratorAsyncGenExports;
|
|
3213
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
3214
|
+
var a = regeneratorAsyncGen(n, e, r, t, o);
|
|
3215
|
+
return a.next().then(function (n) {
|
|
3216
|
+
return n.done ? n.value : a.next();
|
|
3217
|
+
});
|
|
3218
|
+
}
|
|
3219
|
+
module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3220
|
+
})(regeneratorAsync);
|
|
3221
|
+
var regeneratorAsyncExports = regeneratorAsync.exports;
|
|
3222
|
+
|
|
3223
|
+
var regeneratorKeys = {exports: {}};
|
|
3224
|
+
|
|
3225
|
+
(function (module) {
|
|
3226
|
+
function _regeneratorKeys(e) {
|
|
3227
|
+
var n = Object(e),
|
|
3228
|
+
r = [];
|
|
3229
|
+
for (var t in n) r.unshift(t);
|
|
3230
|
+
return function e() {
|
|
3231
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
|
|
3232
|
+
return e.done = !0, e;
|
|
3233
|
+
};
|
|
3234
|
+
}
|
|
3235
|
+
module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3236
|
+
})(regeneratorKeys);
|
|
3237
|
+
var regeneratorKeysExports = regeneratorKeys.exports;
|
|
3238
|
+
|
|
3239
|
+
var regeneratorValues = {exports: {}};
|
|
3240
|
+
|
|
3241
|
+
var _typeof = {exports: {}};
|
|
3242
|
+
|
|
3243
|
+
(function (module) {
|
|
3244
|
+
function _typeof(o) {
|
|
3245
|
+
"@babel/helpers - typeof";
|
|
3246
|
+
|
|
3247
|
+
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
3248
|
+
return typeof o;
|
|
3249
|
+
} : function (o) {
|
|
3250
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
3251
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
|
3252
|
+
}
|
|
3253
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3254
|
+
})(_typeof);
|
|
3255
|
+
var _typeofExports = _typeof.exports;
|
|
3256
|
+
|
|
3257
|
+
(function (module) {
|
|
3258
|
+
var _typeof = _typeofExports["default"];
|
|
3259
|
+
function _regeneratorValues(e) {
|
|
3260
|
+
if (null != e) {
|
|
3261
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
3262
|
+
r = 0;
|
|
3263
|
+
if (t) return t.call(e);
|
|
3264
|
+
if ("function" == typeof e.next) return e;
|
|
3265
|
+
if (!isNaN(e.length)) return {
|
|
3266
|
+
next: function next() {
|
|
3267
|
+
return e && r >= e.length && (e = void 0), {
|
|
3268
|
+
value: e && e[r++],
|
|
3269
|
+
done: !e
|
|
3270
|
+
};
|
|
3271
|
+
}
|
|
3272
|
+
};
|
|
3273
|
+
}
|
|
3274
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
3275
|
+
}
|
|
3276
|
+
module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3277
|
+
})(regeneratorValues);
|
|
3278
|
+
var regeneratorValuesExports = regeneratorValues.exports;
|
|
3279
|
+
|
|
3280
|
+
(function (module) {
|
|
3281
|
+
var OverloadYield = OverloadYieldExports;
|
|
3282
|
+
var regenerator = regeneratorExports;
|
|
3283
|
+
var regeneratorAsync = regeneratorAsyncExports;
|
|
3284
|
+
var regeneratorAsyncGen = regeneratorAsyncGenExports;
|
|
3285
|
+
var regeneratorAsyncIterator = regeneratorAsyncIteratorExports;
|
|
3286
|
+
var regeneratorKeys = regeneratorKeysExports;
|
|
3287
|
+
var regeneratorValues = regeneratorValuesExports;
|
|
3288
|
+
function _regeneratorRuntime() {
|
|
3289
|
+
|
|
3290
|
+
var r = regenerator(),
|
|
3291
|
+
e = r.m(_regeneratorRuntime),
|
|
3292
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
3293
|
+
function n(r) {
|
|
3294
|
+
var e = "function" == typeof r && r.constructor;
|
|
3295
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
3296
|
+
}
|
|
3297
|
+
var o = {
|
|
3298
|
+
"throw": 1,
|
|
3299
|
+
"return": 2,
|
|
3300
|
+
"break": 3,
|
|
3301
|
+
"continue": 3
|
|
3302
|
+
};
|
|
3303
|
+
function a(r) {
|
|
3304
|
+
var e, t;
|
|
3305
|
+
return function (n) {
|
|
3306
|
+
e || (e = {
|
|
3307
|
+
stop: function stop() {
|
|
3308
|
+
return t(n.a, 2);
|
|
3309
|
+
},
|
|
3310
|
+
"catch": function _catch() {
|
|
3311
|
+
return n.v;
|
|
3312
|
+
},
|
|
3313
|
+
abrupt: function abrupt(r, e) {
|
|
3314
|
+
return t(n.a, o[r], e);
|
|
3315
|
+
},
|
|
3316
|
+
delegateYield: function delegateYield(r, o, a) {
|
|
3317
|
+
return e.resultName = o, t(n.d, regeneratorValues(r), a);
|
|
3318
|
+
},
|
|
3319
|
+
finish: function finish(r) {
|
|
3320
|
+
return t(n.f, r);
|
|
3321
|
+
}
|
|
3322
|
+
}, t = function t(r, _t, o) {
|
|
3323
|
+
n.p = e.prev, n.n = e.next;
|
|
3324
|
+
try {
|
|
3325
|
+
return r(_t, o);
|
|
3326
|
+
} finally {
|
|
3327
|
+
e.next = n.n;
|
|
3328
|
+
}
|
|
3329
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
3330
|
+
try {
|
|
3331
|
+
return r.call(this, e);
|
|
3332
|
+
} finally {
|
|
3333
|
+
n.p = e.prev, n.n = e.next;
|
|
3334
|
+
}
|
|
3335
|
+
};
|
|
3336
|
+
}
|
|
3337
|
+
return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
3338
|
+
return {
|
|
3339
|
+
wrap: function wrap(e, t, n, o) {
|
|
3340
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
3341
|
+
},
|
|
3342
|
+
isGeneratorFunction: n,
|
|
3343
|
+
mark: r.m,
|
|
3344
|
+
awrap: function awrap(r, e) {
|
|
3345
|
+
return new OverloadYield(r, e);
|
|
3346
|
+
},
|
|
3347
|
+
AsyncIterator: regeneratorAsyncIterator,
|
|
3348
|
+
async: function async(r, e, t, o, u) {
|
|
3349
|
+
return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
|
|
3350
|
+
},
|
|
3351
|
+
keys: regeneratorKeys,
|
|
3352
|
+
values: regeneratorValues
|
|
3353
|
+
};
|
|
3354
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports)();
|
|
3355
|
+
}
|
|
3356
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3357
|
+
})(regeneratorRuntime$1);
|
|
3358
|
+
var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
|
|
3359
|
+
|
|
3360
|
+
// TODO(Babel 8): Remove this file.
|
|
2830
3361
|
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
}
|
|
3362
|
+
var runtime = regeneratorRuntimeExports();
|
|
3363
|
+
var regenerator = runtime;
|
|
2834
3364
|
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
3365
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
3366
|
+
try {
|
|
3367
|
+
regeneratorRuntime = runtime;
|
|
3368
|
+
} catch (accidentalStrictMode) {
|
|
3369
|
+
if ((typeof globalThis === "undefined" ? "undefined" : _typeof$1(globalThis)) === "object") {
|
|
3370
|
+
globalThis.regeneratorRuntime = runtime;
|
|
3371
|
+
} else {
|
|
3372
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
2840
3373
|
}
|
|
2841
3374
|
}
|
|
3375
|
+
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
2842
3376
|
|
|
2843
|
-
function
|
|
2844
|
-
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2847
|
-
function _toConsumableArray(r) {
|
|
2848
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread();
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
function ownKeys$2(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; }
|
|
2852
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3377
|
+
function ownKeys$3(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; }
|
|
3378
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2853
3379
|
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
2854
3380
|
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
2855
3381
|
// src/error.ts
|
|
@@ -2954,7 +3480,7 @@ function validateExtension(fileName, allowedExtensions) {
|
|
|
2954
3480
|
throw new OssError(ErrorCode.INVALID_PARAMS, "\u6587\u4EF6 \"".concat(fileName, "\" \u7F3A\u5C11\u6269\u5C55\u540D"));
|
|
2955
3481
|
}
|
|
2956
3482
|
if (!whitelist.has(ext)) {
|
|
2957
|
-
throw new OssError(ErrorCode.INVALID_PARAMS, "\u6587\u4EF6\u7C7B\u578B \".".concat(ext, "\" \u4E0D\u5728\u5141\u8BB8\u5217\u8868\u4E2D\uFF0C\u5141\u8BB8\u7684\u7C7B\u578B\uFF1A").concat(_toConsumableArray(whitelist).join(", ")));
|
|
3483
|
+
throw new OssError(ErrorCode.INVALID_PARAMS, "\u6587\u4EF6\u7C7B\u578B \".".concat(ext, "\" \u4E0D\u5728\u5141\u8BB8\u5217\u8868\u4E2D\uFF0C\u5141\u8BB8\u7684\u7C7B\u578B\uFF1A").concat(_toConsumableArray$1(whitelist).join(", ")));
|
|
2958
3484
|
}
|
|
2959
3485
|
}
|
|
2960
3486
|
function validateMagicBytes(_x, _x2) {
|
|
@@ -3377,7 +3903,7 @@ var DEFAULT_LIMITS = {
|
|
|
3377
3903
|
other: 10 * 1024 * 1024
|
|
3378
3904
|
};
|
|
3379
3905
|
function getSizeLimit(fileName, limits) {
|
|
3380
|
-
var merged = _objectSpread$
|
|
3906
|
+
var merged = _objectSpread$3(_objectSpread$3({}, DEFAULT_LIMITS), limits);
|
|
3381
3907
|
if (isImage(fileName)) return merged.image;
|
|
3382
3908
|
if (isVideo(fileName)) return merged.video;
|
|
3383
3909
|
return merged.other;
|
|
@@ -3405,7 +3931,7 @@ function _compressImageBlob() {
|
|
|
3405
3931
|
return _regeneratorRuntime.wrap(function (_context10) {
|
|
3406
3932
|
while (1) switch (_context10.prev = _context10.next) {
|
|
3407
3933
|
case 0:
|
|
3408
|
-
opts = _objectSpread$
|
|
3934
|
+
opts = _objectSpread$3(_objectSpread$3({}, DEFAULT_COMPRESS), options);
|
|
3409
3935
|
if (!(typeof createImageBitmap === "undefined" || typeof OffscreenCanvas === "undefined")) {
|
|
3410
3936
|
_context10.next = 1;
|
|
3411
3937
|
break;
|
|
@@ -3471,7 +3997,7 @@ function _processFile() {
|
|
|
3471
3997
|
return _regeneratorRuntime.wrap(function (_context11) {
|
|
3472
3998
|
while (1) switch (_context11.prev = _context11.next) {
|
|
3473
3999
|
case 0:
|
|
3474
|
-
opts = _objectSpread$
|
|
4000
|
+
opts = _objectSpread$3(_objectSpread$3({}, DEFAULT_COMPRESS), compress);
|
|
3475
4001
|
if (!(opts.enabled && isImage(fileName))) {
|
|
3476
4002
|
_context11.next = 2;
|
|
3477
4003
|
break;
|
|
@@ -3535,7 +4061,7 @@ function createOssClient() {
|
|
|
3535
4061
|
var allowedExtensions = options.allowedExtensions;
|
|
3536
4062
|
function mergeRetry(override) {
|
|
3537
4063
|
if (!defaultRetry && !override) return void 0;
|
|
3538
|
-
return _objectSpread$
|
|
4064
|
+
return _objectSpread$3(_objectSpread$3({}, defaultRetry), override);
|
|
3539
4065
|
}
|
|
3540
4066
|
function resolveCompress(override) {
|
|
3541
4067
|
if (override === false) return {
|
|
@@ -3545,7 +4071,7 @@ function createOssClient() {
|
|
|
3545
4071
|
enabled: false
|
|
3546
4072
|
};
|
|
3547
4073
|
var base = _typeof$1(defaultCompress) === "object" ? defaultCompress : {};
|
|
3548
|
-
return override ? _objectSpread$
|
|
4074
|
+
return override ? _objectSpread$3(_objectSpread$3({}, base), override) : Object.keys(base).length ? base : void 0;
|
|
3549
4075
|
}
|
|
3550
4076
|
function uploadOne(_x25, _x26, _x27, _x28) {
|
|
3551
4077
|
return _uploadOne.apply(this, arguments);
|
|
@@ -3631,7 +4157,7 @@ function createOssClient() {
|
|
|
3631
4157
|
var i = index++;
|
|
3632
4158
|
var item = files[i];
|
|
3633
4159
|
running++;
|
|
3634
|
-
var fileOpts = _objectSpread$
|
|
4160
|
+
var fileOpts = _objectSpread$3({
|
|
3635
4161
|
retry: opts === null || opts === void 0 ? void 0 : opts.retry,
|
|
3636
4162
|
compress: opts === null || opts === void 0 ? void 0 : opts.compress
|
|
3637
4163
|
}, item.options);
|
|
@@ -3762,7 +4288,7 @@ function createOssClient() {
|
|
|
3762
4288
|
}
|
|
3763
4289
|
|
|
3764
4290
|
var _excluded$1 = ["accessKeyId", "accessKeySecret"];
|
|
3765
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
4291
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf$1(o), _possibleConstructorReturn$1(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf$1(t).constructor) : o.apply(t, e)); }
|
|
3766
4292
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
3767
4293
|
var DEFAULT_MAX_SIZE = 2 * 1024 * 1024;
|
|
3768
4294
|
var DEFAULT_SIGNED_URL_EXPIRES_IN = 60 * 60;
|
|
@@ -3770,15 +4296,15 @@ var OssUploadError = /*#__PURE__*/function (_Error) {
|
|
|
3770
4296
|
function OssUploadError(message) {
|
|
3771
4297
|
var _this;
|
|
3772
4298
|
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400;
|
|
3773
|
-
_classCallCheck(this, OssUploadError);
|
|
4299
|
+
_classCallCheck$1(this, OssUploadError);
|
|
3774
4300
|
_this = _callSuper(this, OssUploadError, [message]);
|
|
3775
4301
|
_this.name = "OssUploadError";
|
|
3776
4302
|
_this.status = status;
|
|
3777
4303
|
return _this;
|
|
3778
4304
|
}
|
|
3779
|
-
_inherits(OssUploadError, _Error);
|
|
3780
|
-
return _createClass(OssUploadError);
|
|
3781
|
-
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
4305
|
+
_inherits$1(OssUploadError, _Error);
|
|
4306
|
+
return _createClass$1(OssUploadError);
|
|
4307
|
+
}(/*#__PURE__*/_wrapNativeSuper$1(Error));
|
|
3782
4308
|
function sanitizePathSegment(value) {
|
|
3783
4309
|
return String(value || "").trim().replace(/[^a-zA-Z0-9/_-]+/g, "-").replace(/\/{2,}/g, "/").replace(/^\/+|\/+$/g, "");
|
|
3784
4310
|
}
|
|
@@ -3843,7 +4369,7 @@ function normalizeSdkError(error) {
|
|
|
3843
4369
|
}
|
|
3844
4370
|
var OssUploadService = /*#__PURE__*/function () {
|
|
3845
4371
|
function OssUploadService(config) {
|
|
3846
|
-
_classCallCheck(this, OssUploadService);
|
|
4372
|
+
_classCallCheck$1(this, OssUploadService);
|
|
3847
4373
|
this.config = normalizeConfig(config);
|
|
3848
4374
|
this.client = createOssClient({
|
|
3849
4375
|
baseURL: this.config.baseURL,
|
|
@@ -3851,7 +4377,7 @@ var OssUploadService = /*#__PURE__*/function () {
|
|
|
3851
4377
|
retry: this.config.retry
|
|
3852
4378
|
});
|
|
3853
4379
|
}
|
|
3854
|
-
return _createClass(OssUploadService, [{
|
|
4380
|
+
return _createClass$1(OssUploadService, [{
|
|
3855
4381
|
key: "getConfig",
|
|
3856
4382
|
value: function getConfig() {
|
|
3857
4383
|
var _this$config = this.config;
|
|
@@ -3863,9 +4389,9 @@ var OssUploadService = /*#__PURE__*/function () {
|
|
|
3863
4389
|
}, {
|
|
3864
4390
|
key: "upload",
|
|
3865
4391
|
value: function () {
|
|
3866
|
-
var _upload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(input) {
|
|
4392
|
+
var _upload = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(input) {
|
|
3867
4393
|
var sessionId, maxSize, objectKey, result, url, resolvedUrl, _t;
|
|
3868
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
4394
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
3869
4395
|
while (1) switch (_context.prev = _context.next) {
|
|
3870
4396
|
case 0:
|
|
3871
4397
|
sessionId = String(input.sessionId || "").trim();
|
|
@@ -3977,9 +4503,9 @@ function ensureAdminRegistryTable(_x) {
|
|
|
3977
4503
|
return _ensureAdminRegistryTable.apply(this, arguments);
|
|
3978
4504
|
}
|
|
3979
4505
|
function _ensureAdminRegistryTable() {
|
|
3980
|
-
_ensureAdminRegistryTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(supabase) {
|
|
4506
|
+
_ensureAdminRegistryTable = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(supabase) {
|
|
3981
4507
|
var _yield$supabase$from$, error;
|
|
3982
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
4508
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
3983
4509
|
while (1) switch (_context.prev = _context.next) {
|
|
3984
4510
|
case 0:
|
|
3985
4511
|
if (!ensured) {
|
|
@@ -4020,9 +4546,9 @@ function getSessionAdminRow(_x2, _x3) {
|
|
|
4020
4546
|
return _getSessionAdminRow.apply(this, arguments);
|
|
4021
4547
|
}
|
|
4022
4548
|
function _getSessionAdminRow() {
|
|
4023
|
-
_getSessionAdminRow = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(supabase, sessionId) {
|
|
4549
|
+
_getSessionAdminRow = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(supabase, sessionId) {
|
|
4024
4550
|
var sid, _yield$supabase$from$2, data, error;
|
|
4025
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
4551
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
4026
4552
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4027
4553
|
case 0:
|
|
4028
4554
|
sid = normalizeSessionId(sessionId);
|
|
@@ -4051,9 +4577,9 @@ function getSessionAdminRowByEmail(_x4, _x5, _x6) {
|
|
|
4051
4577
|
return _getSessionAdminRowByEmail.apply(this, arguments);
|
|
4052
4578
|
}
|
|
4053
4579
|
function _getSessionAdminRowByEmail() {
|
|
4054
|
-
_getSessionAdminRowByEmail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(supabase, sessionId, email) {
|
|
4580
|
+
_getSessionAdminRowByEmail = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(supabase, sessionId, email) {
|
|
4055
4581
|
var row, normalizedEmail, rowEmail;
|
|
4056
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
4582
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
4057
4583
|
while (1) switch (_context3.prev = _context3.next) {
|
|
4058
4584
|
case 0:
|
|
4059
4585
|
_context3.next = 1;
|
|
@@ -4087,9 +4613,9 @@ function isUserSessionAdmin(_x7, _x8, _x9) {
|
|
|
4087
4613
|
return _isUserSessionAdmin.apply(this, arguments);
|
|
4088
4614
|
}
|
|
4089
4615
|
function _isUserSessionAdmin() {
|
|
4090
|
-
_isUserSessionAdmin = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(supabase, sessionId, userId) {
|
|
4616
|
+
_isUserSessionAdmin = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(supabase, sessionId, userId) {
|
|
4091
4617
|
var row;
|
|
4092
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
4618
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
4093
4619
|
while (1) switch (_context4.prev = _context4.next) {
|
|
4094
4620
|
case 0:
|
|
4095
4621
|
_context4.next = 1;
|
|
@@ -4112,6 +4638,62 @@ function _isUserSessionAdmin() {
|
|
|
4112
4638
|
return _isUserSessionAdmin.apply(this, arguments);
|
|
4113
4639
|
}
|
|
4114
4640
|
|
|
4641
|
+
function _arrayWithHoles(r) {
|
|
4642
|
+
if (Array.isArray(r)) return r;
|
|
4643
|
+
}
|
|
4644
|
+
|
|
4645
|
+
function _iterableToArrayLimit(r, l) {
|
|
4646
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
4647
|
+
if (null != t) {
|
|
4648
|
+
var e,
|
|
4649
|
+
n,
|
|
4650
|
+
i,
|
|
4651
|
+
u,
|
|
4652
|
+
a = [],
|
|
4653
|
+
f = !0,
|
|
4654
|
+
o = !1;
|
|
4655
|
+
try {
|
|
4656
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
4657
|
+
if (Object(t) !== t) return;
|
|
4658
|
+
f = !1;
|
|
4659
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
4660
|
+
} catch (r) {
|
|
4661
|
+
o = !0, n = r;
|
|
4662
|
+
} finally {
|
|
4663
|
+
try {
|
|
4664
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
4665
|
+
} finally {
|
|
4666
|
+
if (o) throw n;
|
|
4667
|
+
}
|
|
4668
|
+
}
|
|
4669
|
+
return a;
|
|
4670
|
+
}
|
|
4671
|
+
}
|
|
4672
|
+
|
|
4673
|
+
function _arrayLikeToArray$2(r, a) {
|
|
4674
|
+
(null == a || a > r.length) && (a = r.length);
|
|
4675
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4676
|
+
return n;
|
|
4677
|
+
}
|
|
4678
|
+
|
|
4679
|
+
function _unsupportedIterableToArray$2(r, a) {
|
|
4680
|
+
if (r) {
|
|
4681
|
+
if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
|
|
4682
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
4683
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0;
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
|
|
4687
|
+
function _nonIterableRest() {
|
|
4688
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4689
|
+
}
|
|
4690
|
+
|
|
4691
|
+
function _slicedToArray(r, e) {
|
|
4692
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest();
|
|
4693
|
+
}
|
|
4694
|
+
|
|
4695
|
+
function ownKeys$2(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; }
|
|
4696
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4115
4697
|
var ACTION_LABELS = {
|
|
4116
4698
|
create: "创建",
|
|
4117
4699
|
read: "查询",
|
|
@@ -4127,9 +4709,44 @@ function getWebhookUrls() {
|
|
|
4127
4709
|
return item.trim();
|
|
4128
4710
|
}).filter(Boolean);
|
|
4129
4711
|
}
|
|
4712
|
+
function safeJsonStringify(value) {
|
|
4713
|
+
var seen = new WeakSet();
|
|
4714
|
+
try {
|
|
4715
|
+
return JSON.stringify(value, function (_key, currentValue) {
|
|
4716
|
+
if (typeof currentValue === "bigint") {
|
|
4717
|
+
return currentValue.toString();
|
|
4718
|
+
}
|
|
4719
|
+
if (_typeof$2(currentValue) === "object" && currentValue !== null) {
|
|
4720
|
+
if (seen.has(currentValue)) {
|
|
4721
|
+
return "[Circular]";
|
|
4722
|
+
}
|
|
4723
|
+
seen.add(currentValue);
|
|
4724
|
+
}
|
|
4725
|
+
return currentValue;
|
|
4726
|
+
}, 2);
|
|
4727
|
+
} catch (_unused) {
|
|
4728
|
+
return "";
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
function serializeError(error) {
|
|
4732
|
+
var extraFields = Object.fromEntries(Object.entries(error).filter(function (_ref) {
|
|
4733
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
4734
|
+
value = _ref2[1];
|
|
4735
|
+
return value !== undefined;
|
|
4736
|
+
}));
|
|
4737
|
+
return _objectSpread$2({
|
|
4738
|
+
name: error.name,
|
|
4739
|
+
message: error.message
|
|
4740
|
+
}, extraFields);
|
|
4741
|
+
}
|
|
4130
4742
|
function getErrorMessage(error) {
|
|
4131
4743
|
if (error instanceof Error) {
|
|
4132
|
-
|
|
4744
|
+
var serializedError = safeJsonStringify(serializeError(error));
|
|
4745
|
+
return serializedError || error.message;
|
|
4746
|
+
}
|
|
4747
|
+
if (_typeof$2(error) === "object" && error !== null) {
|
|
4748
|
+
var _serializedError = safeJsonStringify(error);
|
|
4749
|
+
return _serializedError || String(error);
|
|
4133
4750
|
}
|
|
4134
4751
|
return String(error);
|
|
4135
4752
|
}
|
|
@@ -4149,8 +4766,8 @@ function getSessionId(c) {
|
|
|
4149
4766
|
function buildAlertText(c, options) {
|
|
4150
4767
|
var _options$modelId, _options$recordId;
|
|
4151
4768
|
var actionLabel = ACTION_LABELS[options.action];
|
|
4152
|
-
|
|
4153
|
-
var lines = ["\u5305\u540D: @wecode-team/cms-supabase-api", "\u5BBF\u4E3B\u9879\u76EE\u6807\u8BC6(sessionId): ".concat(getSessionId(c)), "\u64CD\u4F5C\
|
|
4769
|
+
TARGET_LABELS[options.target];
|
|
4770
|
+
var lines = ["\u5305\u540D: @wecode-team/cms-supabase-api", "\u5BBF\u4E3B\u9879\u76EE\u6807\u8BC6(sessionId): ".concat(getSessionId(c)), "\u64CD\u4F5C\u7C7B\u578B: ".concat(actionLabel), "\u6570\u636E\u8868\u540D: ".concat(options.tableName || "-"), "\u6A21\u578B ID: ".concat((_options$modelId = options.modelId) !== null && _options$modelId !== void 0 ? _options$modelId : "-"), "\u8BB0\u5F55 ID: ".concat((_options$recordId = options.recordId) !== null && _options$recordId !== void 0 ? _options$recordId : "-"), "\u65F6\u95F4: ".concat(new Date().toISOString()), "\u9519\u8BEF\u4FE1\u606F: ".concat(getErrorMessage(options.error)), "\u8BF7\u6C42\u4FE1\u606F:\n".concat(buildRequestSummary(c))];
|
|
4154
4771
|
var stack = getErrorStack(options.error);
|
|
4155
4772
|
if (stack) {
|
|
4156
4773
|
lines.push("\u9519\u8BEF\u5806\u6808:\n".concat(stack));
|
|
@@ -4161,9 +4778,9 @@ function postWebhook(_x, _x2) {
|
|
|
4161
4778
|
return _postWebhook.apply(this, arguments);
|
|
4162
4779
|
}
|
|
4163
4780
|
function _postWebhook() {
|
|
4164
|
-
_postWebhook = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(webhook, body) {
|
|
4781
|
+
_postWebhook = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(webhook, body) {
|
|
4165
4782
|
var response;
|
|
4166
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
4783
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
4167
4784
|
while (1) switch (_context.prev = _context.next) {
|
|
4168
4785
|
case 0:
|
|
4169
4786
|
_context.next = 1;
|
|
@@ -4193,9 +4810,9 @@ function notifyCmsCrudErrorToFeishu(_x3, _x4) {
|
|
|
4193
4810
|
return _notifyCmsCrudErrorToFeishu.apply(this, arguments);
|
|
4194
4811
|
}
|
|
4195
4812
|
function _notifyCmsCrudErrorToFeishu() {
|
|
4196
|
-
_notifyCmsCrudErrorToFeishu = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c, options) {
|
|
4813
|
+
_notifyCmsCrudErrorToFeishu = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c, options) {
|
|
4197
4814
|
var webhookUrls, body, results, failed;
|
|
4198
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
4815
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
4199
4816
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4200
4817
|
case 0:
|
|
4201
4818
|
webhookUrls = getWebhookUrls();
|
|
@@ -4257,9 +4874,9 @@ function initializeSystem() {
|
|
|
4257
4874
|
return _initializeSystem.apply(this, arguments);
|
|
4258
4875
|
}
|
|
4259
4876
|
function _initializeSystem() {
|
|
4260
|
-
_initializeSystem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
4877
|
+
_initializeSystem = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee() {
|
|
4261
4878
|
var _t;
|
|
4262
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
4879
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
4263
4880
|
while (1) switch (_context.prev = _context.next) {
|
|
4264
4881
|
case 0:
|
|
4265
4882
|
_context.prev = 0;
|
|
@@ -4350,9 +4967,9 @@ function getModels(_x) {
|
|
|
4350
4967
|
}
|
|
4351
4968
|
// POST - 创建新模型
|
|
4352
4969
|
function _getModels() {
|
|
4353
|
-
_getModels = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c) {
|
|
4970
|
+
_getModels = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c) {
|
|
4354
4971
|
var cmsModelService, page, limit, name, sessionId, models, tablePrefix, total, offset, paginatedModels, response, _response, _t2;
|
|
4355
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
4972
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
4356
4973
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4357
4974
|
case 0:
|
|
4358
4975
|
_context2.prev = 0;
|
|
@@ -4421,9 +5038,9 @@ function createModel(_x2) {
|
|
|
4421
5038
|
}
|
|
4422
5039
|
// PUT - 更新模型
|
|
4423
5040
|
function _createModel() {
|
|
4424
|
-
_createModel = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(c) {
|
|
5041
|
+
_createModel = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(c) {
|
|
4425
5042
|
var cmsModelService, dynamicTableService, body, name, table_name, json_schema, _response2, sessionId, tableNameError, _response3, schemaValidationError, _response4, existingModel, _response5, allModels, nameExists, _response6, tableExists, _response7, tableCreated, _response8, newModel, response, _response9, _t3;
|
|
4426
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
5043
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
4427
5044
|
while (1) switch (_context3.prev = _context3.next) {
|
|
4428
5045
|
case 0:
|
|
4429
5046
|
_context3.prev = 0;
|
|
@@ -4572,9 +5189,9 @@ function updateModel(_x3) {
|
|
|
4572
5189
|
}
|
|
4573
5190
|
// DELETE - 删除模型
|
|
4574
5191
|
function _updateModel() {
|
|
4575
|
-
_updateModel = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(c) {
|
|
5192
|
+
_updateModel = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(c) {
|
|
4576
5193
|
var cmsModelService, body, id, name, json_schema, _response0, model, _response1, schemaValidationError, _response10, updateData, updatedModel, response, _response11, _t4;
|
|
4577
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
5194
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
4578
5195
|
while (1) switch (_context4.prev = _context4.next) {
|
|
4579
5196
|
case 0:
|
|
4580
5197
|
_context4.prev = 0;
|
|
@@ -4667,9 +5284,9 @@ function deleteModel(_x4) {
|
|
|
4667
5284
|
return _deleteModel.apply(this, arguments);
|
|
4668
5285
|
}
|
|
4669
5286
|
function _deleteModel() {
|
|
4670
|
-
_deleteModel = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(c) {
|
|
5287
|
+
_deleteModel = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee5(c) {
|
|
4671
5288
|
var cmsModelService, dynamicTableService, idStr, _response12, id, model, _response13, tableDropped, _response14, response, _response15, _t5;
|
|
4672
|
-
return _regeneratorRuntime.wrap(function (_context5) {
|
|
5289
|
+
return _regeneratorRuntime$1.wrap(function (_context5) {
|
|
4673
5290
|
while (1) switch (_context5.prev = _context5.next) {
|
|
4674
5291
|
case 0:
|
|
4675
5292
|
_context5.prev = 0;
|
|
@@ -4750,46 +5367,6 @@ function _deleteModel() {
|
|
|
4750
5367
|
return _deleteModel.apply(this, arguments);
|
|
4751
5368
|
}
|
|
4752
5369
|
|
|
4753
|
-
function _arrayWithHoles(r) {
|
|
4754
|
-
if (Array.isArray(r)) return r;
|
|
4755
|
-
}
|
|
4756
|
-
|
|
4757
|
-
function _iterableToArrayLimit(r, l) {
|
|
4758
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
4759
|
-
if (null != t) {
|
|
4760
|
-
var e,
|
|
4761
|
-
n,
|
|
4762
|
-
i,
|
|
4763
|
-
u,
|
|
4764
|
-
a = [],
|
|
4765
|
-
f = !0,
|
|
4766
|
-
o = !1;
|
|
4767
|
-
try {
|
|
4768
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
4769
|
-
if (Object(t) !== t) return;
|
|
4770
|
-
f = !1;
|
|
4771
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
4772
|
-
} catch (r) {
|
|
4773
|
-
o = !0, n = r;
|
|
4774
|
-
} finally {
|
|
4775
|
-
try {
|
|
4776
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
4777
|
-
} finally {
|
|
4778
|
-
if (o) throw n;
|
|
4779
|
-
}
|
|
4780
|
-
}
|
|
4781
|
-
return a;
|
|
4782
|
-
}
|
|
4783
|
-
}
|
|
4784
|
-
|
|
4785
|
-
function _nonIterableRest() {
|
|
4786
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4787
|
-
}
|
|
4788
|
-
|
|
4789
|
-
function _slicedToArray(r, e) {
|
|
4790
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest();
|
|
4791
|
-
}
|
|
4792
|
-
|
|
4793
5370
|
var _excluded = ["id", "created_at", "updated_at"],
|
|
4794
5371
|
_excluded2 = ["id"],
|
|
4795
5372
|
_excluded3 = ["created_at", "updated_at"];
|
|
@@ -4797,7 +5374,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
4797
5374
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4798
5375
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4799
5376
|
function ownKeys$1(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; }
|
|
4800
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5377
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4801
5378
|
function normalizeJsonLikeFields(schemaFields, payload) {
|
|
4802
5379
|
if (!schemaFields || schemaFields.length === 0) return payload;
|
|
4803
5380
|
var jsonLikeFieldNames = new Set(schemaFields.filter(function (f) {
|
|
@@ -5023,9 +5600,9 @@ function getTableData(_x, _x2) {
|
|
|
5023
5600
|
}
|
|
5024
5601
|
// POST - 创建新数据
|
|
5025
5602
|
function _getTableData() {
|
|
5026
|
-
_getTableData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(c, tableName) {
|
|
5603
|
+
_getTableData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(c, tableName) {
|
|
5027
5604
|
var _model$json_schema, validationResponse, dynamicTableService, cmsModelService, page, limit, search, filtersStr, model, schemaFields, filters, _response, parsed, normalized, _response2, result, searchableFields, response, _response3, _t, _t2;
|
|
5028
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
5605
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
5029
5606
|
while (1) switch (_context.prev = _context.next) {
|
|
5030
5607
|
case 0:
|
|
5031
5608
|
_context.prev = 0;
|
|
@@ -5171,9 +5748,9 @@ function createTableData(_x3, _x4) {
|
|
|
5171
5748
|
}
|
|
5172
5749
|
// PUT - 更新数据
|
|
5173
5750
|
function _createTableData() {
|
|
5174
|
-
_createTableData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c, tableName) {
|
|
5751
|
+
_createTableData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c, tableName) {
|
|
5175
5752
|
var _model$json_schema2, validationResponse, dynamicTableService, cmsModelService, body, rawData, data, _i2, _Object$entries2, _Object$entries2$_i, key, value, model, normalizedData, _response4, result, response, _response5, _t3, _t4;
|
|
5176
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
5753
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
5177
5754
|
while (1) switch (_context2.prev = _context2.next) {
|
|
5178
5755
|
case 0:
|
|
5179
5756
|
_context2.prev = 0;
|
|
@@ -5263,9 +5840,9 @@ function updateTableData(_x5, _x6) {
|
|
|
5263
5840
|
}
|
|
5264
5841
|
// DELETE - 删除数据
|
|
5265
5842
|
function _updateTableData() {
|
|
5266
|
-
_updateTableData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(c, tableName) {
|
|
5843
|
+
_updateTableData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(c, tableName) {
|
|
5267
5844
|
var _model$json_schema3, validationResponse, dynamicTableService, cmsModelService, body, id, data, recordId, _response6, _response7, existingData, _response8, rawUpdateData, updateData, _i3, _Object$entries3, _Object$entries3$_i, key, value, model, _response9, result, _response0, response, _response1, _t5, _t6;
|
|
5268
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
5845
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
5269
5846
|
while (1) switch (_context3.prev = _context3.next) {
|
|
5270
5847
|
case 0:
|
|
5271
5848
|
_context3.prev = 0;
|
|
@@ -5400,9 +5977,9 @@ function deleteTableData(_x7, _x8) {
|
|
|
5400
5977
|
}
|
|
5401
5978
|
// GET - 获取关联表选项列表 (用于下拉选择)
|
|
5402
5979
|
function _deleteTableData() {
|
|
5403
|
-
_deleteTableData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(c, tableName) {
|
|
5980
|
+
_deleteTableData = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(c, tableName) {
|
|
5404
5981
|
var validationResponse, dynamicTableService, id, _response10, recordId, _response11, existingData, _response12, result, response, _response13, _t7;
|
|
5405
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
5982
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
5406
5983
|
while (1) switch (_context4.prev = _context4.next) {
|
|
5407
5984
|
case 0:
|
|
5408
5985
|
_context4.prev = 0;
|
|
@@ -5489,9 +6066,9 @@ function getRelationOptions(_x9, _x0) {
|
|
|
5489
6066
|
}
|
|
5490
6067
|
// GET - 获取表数据(带关联数据)
|
|
5491
6068
|
function _getRelationOptions() {
|
|
5492
|
-
_getRelationOptions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(c, tableName) {
|
|
6069
|
+
_getRelationOptions = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee5(c, tableName) {
|
|
5493
6070
|
var validationResponse, dynamicTableService, displayField, limit, search, params, options, response, _response14, _t8;
|
|
5494
|
-
return _regeneratorRuntime.wrap(function (_context5) {
|
|
6071
|
+
return _regeneratorRuntime$1.wrap(function (_context5) {
|
|
5495
6072
|
while (1) switch (_context5.prev = _context5.next) {
|
|
5496
6073
|
case 0:
|
|
5497
6074
|
_context5.prev = 0;
|
|
@@ -5545,9 +6122,9 @@ function getTableDataWithRelations(_x1, _x10) {
|
|
|
5545
6122
|
// DELETE - 删除表的所有外键约束
|
|
5546
6123
|
// 用于解决外键约束引用错误表的问题
|
|
5547
6124
|
function _getTableDataWithRelations() {
|
|
5548
|
-
_getTableDataWithRelations = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(c, tableName) {
|
|
6125
|
+
_getTableDataWithRelations = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee6(c, tableName) {
|
|
5549
6126
|
var validationResponse, dynamicTableService, cmsModelService, page, limit, model, result, response, hasRelations, _result, _response15, _result2, _response16, _response17, _t9;
|
|
5550
|
-
return _regeneratorRuntime.wrap(function (_context6) {
|
|
6127
|
+
return _regeneratorRuntime$1.wrap(function (_context6) {
|
|
5551
6128
|
while (1) switch (_context6.prev = _context6.next) {
|
|
5552
6129
|
case 0:
|
|
5553
6130
|
_context6.prev = 0;
|
|
@@ -5632,9 +6209,9 @@ function dropForeignKeys(_x11, _x12) {
|
|
|
5632
6209
|
return _dropForeignKeys.apply(this, arguments);
|
|
5633
6210
|
}
|
|
5634
6211
|
function _dropForeignKeys() {
|
|
5635
|
-
_dropForeignKeys = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(c, tableName) {
|
|
6212
|
+
_dropForeignKeys = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee7(c, tableName) {
|
|
5636
6213
|
var validationResponse, dynamicTableService, result, response, _response18, _response19, _t0;
|
|
5637
|
-
return _regeneratorRuntime.wrap(function (_context7) {
|
|
6214
|
+
return _regeneratorRuntime$1.wrap(function (_context7) {
|
|
5638
6215
|
while (1) switch (_context7.prev = _context7.next) {
|
|
5639
6216
|
case 0:
|
|
5640
6217
|
_context7.prev = 0;
|
|
@@ -5695,9 +6272,9 @@ var JWT_EXPIRES_IN = '24h';
|
|
|
5695
6272
|
*/
|
|
5696
6273
|
var AuthUtils = /*#__PURE__*/function () {
|
|
5697
6274
|
function AuthUtils() {
|
|
5698
|
-
_classCallCheck(this, AuthUtils);
|
|
6275
|
+
_classCallCheck$1(this, AuthUtils);
|
|
5699
6276
|
}
|
|
5700
|
-
return _createClass(AuthUtils, null, [{
|
|
6277
|
+
return _createClass$1(AuthUtils, null, [{
|
|
5701
6278
|
key: "generateToken",
|
|
5702
6279
|
value:
|
|
5703
6280
|
/**
|
|
@@ -5733,8 +6310,8 @@ var AuthUtils = /*#__PURE__*/function () {
|
|
|
5733
6310
|
}, {
|
|
5734
6311
|
key: "validatePassword",
|
|
5735
6312
|
value: (function () {
|
|
5736
|
-
var _validatePassword = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(plainPassword, hashedPassword) {
|
|
5737
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
6313
|
+
var _validatePassword = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(plainPassword, hashedPassword) {
|
|
6314
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
5738
6315
|
while (1) switch (_context.prev = _context.next) {
|
|
5739
6316
|
case 0:
|
|
5740
6317
|
return _context.abrupt("return", bcrypt__namespace.compare(plainPassword, hashedPassword));
|
|
@@ -5756,8 +6333,8 @@ var AuthUtils = /*#__PURE__*/function () {
|
|
|
5756
6333
|
}, {
|
|
5757
6334
|
key: "hashPassword",
|
|
5758
6335
|
value: (function () {
|
|
5759
|
-
var _hashPassword = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(password) {
|
|
5760
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
6336
|
+
var _hashPassword = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(password) {
|
|
6337
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
5761
6338
|
while (1) switch (_context2.prev = _context2.next) {
|
|
5762
6339
|
case 0:
|
|
5763
6340
|
return _context2.abrupt("return", bcrypt__namespace.hash(password, 10));
|
|
@@ -5798,9 +6375,9 @@ var AuthUtils = /*#__PURE__*/function () {
|
|
|
5798
6375
|
}, {
|
|
5799
6376
|
key: "authenticateUser",
|
|
5800
6377
|
value: (function () {
|
|
5801
|
-
var _authenticateUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(username, password, tableName) {
|
|
6378
|
+
var _authenticateUser = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(username, password, tableName) {
|
|
5802
6379
|
var authService, user, isPasswordValid, _t;
|
|
5803
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
6380
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
5804
6381
|
while (1) switch (_context3.prev = _context3.next) {
|
|
5805
6382
|
case 0:
|
|
5806
6383
|
authService = this.getAuthService(); // 查询用户
|
|
@@ -5869,9 +6446,9 @@ var AuthUtils = /*#__PURE__*/function () {
|
|
|
5869
6446
|
}, {
|
|
5870
6447
|
key: "verifyTokenAndGetUser",
|
|
5871
6448
|
value: (function () {
|
|
5872
|
-
var _verifyTokenAndGetUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(token, tableName) {
|
|
6449
|
+
var _verifyTokenAndGetUser = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(token, tableName) {
|
|
5873
6450
|
var decoded, authService, userInfo, message, _t2;
|
|
5874
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
6451
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
5875
6452
|
while (1) switch (_context4.prev = _context4.next) {
|
|
5876
6453
|
case 0:
|
|
5877
6454
|
_context4.prev = 0;
|
|
@@ -5996,9 +6573,9 @@ function forgotPassword(_x, _x2) {
|
|
|
5996
6573
|
}
|
|
5997
6574
|
// POST - 通过邮箱验证码重置密码
|
|
5998
6575
|
function _forgotPassword() {
|
|
5999
|
-
_forgotPassword = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c, tableName) {
|
|
6576
|
+
_forgotPassword = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c, tableName) {
|
|
6000
6577
|
var _body$username, i18n, body, account, supabase, sessionId, adminRow, _i18n, _t3;
|
|
6001
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
6578
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
6002
6579
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6003
6580
|
case 0:
|
|
6004
6581
|
_context2.prev = 0;
|
|
@@ -6070,9 +6647,9 @@ function resetPassword(_x3, _x4) {
|
|
|
6070
6647
|
return _resetPassword.apply(this, arguments);
|
|
6071
6648
|
}
|
|
6072
6649
|
function _resetPassword() {
|
|
6073
|
-
_resetPassword = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(c, tableName) {
|
|
6650
|
+
_resetPassword = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(c, tableName) {
|
|
6074
6651
|
var _body$username2, _body$code, i18n, body, account, code, password, supabase, sessionId, adminRow, verifyResult, _yield$supabase$auth$2, updateError, _i18n2, _t4;
|
|
6075
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
6652
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
6076
6653
|
while (1) switch (_context3.prev = _context3.next) {
|
|
6077
6654
|
case 0:
|
|
6078
6655
|
_context3.prev = 0;
|
|
@@ -6190,8 +6767,8 @@ function insertAdminRegistryRow(_x5, _x6, _x7, _x8) {
|
|
|
6190
6767
|
return _insertAdminRegistryRow.apply(this, arguments);
|
|
6191
6768
|
}
|
|
6192
6769
|
function _insertAdminRegistryRow() {
|
|
6193
|
-
_insertAdminRegistryRow = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(supabase, sessionId, userId, account) {
|
|
6194
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
6770
|
+
_insertAdminRegistryRow = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(supabase, sessionId, userId, account) {
|
|
6771
|
+
return _regeneratorRuntime$1.wrap(function (_context4) {
|
|
6195
6772
|
while (1) switch (_context4.prev = _context4.next) {
|
|
6196
6773
|
case 0:
|
|
6197
6774
|
_context4.next = 1;
|
|
@@ -6218,9 +6795,9 @@ function getEffectiveRoleForSession(_x9, _x0) {
|
|
|
6218
6795
|
return _getEffectiveRoleForSession.apply(this, arguments);
|
|
6219
6796
|
} // POST - 用户登录
|
|
6220
6797
|
function _getEffectiveRoleForSession() {
|
|
6221
|
-
_getEffectiveRoleForSession = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(user, sessionId) {
|
|
6798
|
+
_getEffectiveRoleForSession = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee5(user, sessionId) {
|
|
6222
6799
|
var supabase, sid, role, ok;
|
|
6223
|
-
return _regeneratorRuntime.wrap(function (_context5) {
|
|
6800
|
+
return _regeneratorRuntime$1.wrap(function (_context5) {
|
|
6224
6801
|
while (1) switch (_context5.prev = _context5.next) {
|
|
6225
6802
|
case 0:
|
|
6226
6803
|
supabase = getSupabase();
|
|
@@ -6256,9 +6833,9 @@ function login(_x1, _x10) {
|
|
|
6256
6833
|
}
|
|
6257
6834
|
// GET - 是否允许注册(首次进入需要创建管理员账号)
|
|
6258
6835
|
function _login() {
|
|
6259
|
-
_login = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(c, tableName) {
|
|
6836
|
+
_login = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee6(c, tableName) {
|
|
6260
6837
|
var _data$session, body, username, password, supabase, sessionId, email, _yield$supabase$auth$3, data, error, token, user, role, _t5;
|
|
6261
|
-
return _regeneratorRuntime.wrap(function (_context6) {
|
|
6838
|
+
return _regeneratorRuntime$1.wrap(function (_context6) {
|
|
6262
6839
|
while (1) switch (_context6.prev = _context6.next) {
|
|
6263
6840
|
case 0:
|
|
6264
6841
|
_context6.prev = 0;
|
|
@@ -6351,9 +6928,9 @@ function signupStatus(_x11, _x12) {
|
|
|
6351
6928
|
}
|
|
6352
6929
|
// POST - 首次注册管理员(每个 session_id 只允许一个)
|
|
6353
6930
|
function _signupStatus() {
|
|
6354
|
-
_signupStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(c, tableName) {
|
|
6931
|
+
_signupStatus = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee7(c, tableName) {
|
|
6355
6932
|
var supabase, sessionId, ok, row, data, _t6;
|
|
6356
|
-
return _regeneratorRuntime.wrap(function (_context7) {
|
|
6933
|
+
return _regeneratorRuntime$1.wrap(function (_context7) {
|
|
6357
6934
|
while (1) switch (_context7.prev = _context7.next) {
|
|
6358
6935
|
case 0:
|
|
6359
6936
|
_context7.prev = 0;
|
|
@@ -6410,9 +6987,9 @@ function signup(_x13, _x14) {
|
|
|
6410
6987
|
}
|
|
6411
6988
|
// POST - 验证token
|
|
6412
6989
|
function _signup() {
|
|
6413
|
-
_signup = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(c, tableName) {
|
|
6990
|
+
_signup = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee8(c, tableName) {
|
|
6414
6991
|
var _body$username3, _data$session2, body, account, password, supabase, sessionId, email, ok, existing, _yield$supabase$auth$4, data, error, insertRes, token, user, role, _t7;
|
|
6415
|
-
return _regeneratorRuntime.wrap(function (_context8) {
|
|
6992
|
+
return _regeneratorRuntime$1.wrap(function (_context8) {
|
|
6416
6993
|
while (1) switch (_context8.prev = _context8.next) {
|
|
6417
6994
|
case 0:
|
|
6418
6995
|
_context8.prev = 0;
|
|
@@ -6577,9 +7154,9 @@ function verifyAuth(_x15, _x16) {
|
|
|
6577
7154
|
}
|
|
6578
7155
|
// GET - 获取当前用户信息
|
|
6579
7156
|
function _verifyAuth() {
|
|
6580
|
-
_verifyAuth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(c, tableName) {
|
|
7157
|
+
_verifyAuth = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee9(c, tableName) {
|
|
6581
7158
|
var authHeader, token, supabase, _yield$supabase$auth$5, data, error, sessionId, role, decoded, message, responseMessage, _t8, _t9;
|
|
6582
|
-
return _regeneratorRuntime.wrap(function (_context9) {
|
|
7159
|
+
return _regeneratorRuntime$1.wrap(function (_context9) {
|
|
6583
7160
|
while (1) switch (_context9.prev = _context9.next) {
|
|
6584
7161
|
case 0:
|
|
6585
7162
|
_context9.prev = 0;
|
|
@@ -6657,9 +7234,9 @@ function getCurrentUser(_x17, _x18) {
|
|
|
6657
7234
|
}
|
|
6658
7235
|
// 中间件:验证 Supabase JWT token
|
|
6659
7236
|
function _getCurrentUser() {
|
|
6660
|
-
_getCurrentUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(c, tableName) {
|
|
7237
|
+
_getCurrentUser = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee0(c, tableName) {
|
|
6661
7238
|
var authHeader, token, supabase, _yield$supabase$auth$6, data, error, user, sessionId, role, _t0;
|
|
6662
|
-
return _regeneratorRuntime.wrap(function (_context0) {
|
|
7239
|
+
return _regeneratorRuntime$1.wrap(function (_context0) {
|
|
6663
7240
|
while (1) switch (_context0.prev = _context0.next) {
|
|
6664
7241
|
case 0:
|
|
6665
7242
|
_context0.prev = 0;
|
|
@@ -6730,7 +7307,7 @@ function _getCurrentUser() {
|
|
|
6730
7307
|
}
|
|
6731
7308
|
function requireAuth(handler) {
|
|
6732
7309
|
return /*#__PURE__*/function () {
|
|
6733
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(c) {
|
|
7310
|
+
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(c) {
|
|
6734
7311
|
var authHeader,
|
|
6735
7312
|
token,
|
|
6736
7313
|
supabase,
|
|
@@ -6742,7 +7319,7 @@ function requireAuth(handler) {
|
|
|
6742
7319
|
_key,
|
|
6743
7320
|
_args = arguments,
|
|
6744
7321
|
_t2;
|
|
6745
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
7322
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
6746
7323
|
while (1) switch (_context.prev = _context.next) {
|
|
6747
7324
|
case 0:
|
|
6748
7325
|
_context.prev = 0;
|
|
@@ -6824,10 +7401,10 @@ function resolveUploadMaxSize(_x, _x2) {
|
|
|
6824
7401
|
return _resolveUploadMaxSize.apply(this, arguments);
|
|
6825
7402
|
}
|
|
6826
7403
|
function _resolveUploadMaxSize() {
|
|
6827
|
-
_resolveUploadMaxSize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(tableName, fieldName) {
|
|
7404
|
+
_resolveUploadMaxSize = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(tableName, fieldName) {
|
|
6828
7405
|
var _model$json_schema;
|
|
6829
7406
|
var cmsModelService, model;
|
|
6830
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
7407
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
6831
7408
|
while (1) switch (_context.prev = _context.next) {
|
|
6832
7409
|
case 0:
|
|
6833
7410
|
if (!(!tableName || !fieldName)) {
|
|
@@ -6857,9 +7434,9 @@ function uploadToOss(_x3) {
|
|
|
6857
7434
|
return _uploadToOss.apply(this, arguments);
|
|
6858
7435
|
}
|
|
6859
7436
|
function _uploadToOss() {
|
|
6860
|
-
_uploadToOss = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c) {
|
|
7437
|
+
_uploadToOss = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c) {
|
|
6861
7438
|
var formData, file, fieldName, tableName, uploadService, result, status, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8;
|
|
6862
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
7439
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
6863
7440
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6864
7441
|
case 0:
|
|
6865
7442
|
_context2.prev = 0;
|
|
@@ -6931,7 +7508,7 @@ function _uploadToOss() {
|
|
|
6931
7508
|
}
|
|
6932
7509
|
|
|
6933
7510
|
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; }
|
|
6934
|
-
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; }
|
|
7511
|
+
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$1(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; }
|
|
6935
7512
|
var CONFIG_NAMESPACE_RE = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;
|
|
6936
7513
|
var CONFIG_SESSION_RE = /^[a-zA-Z0-9_]{1,128}$/;
|
|
6937
7514
|
function getConfigSessionId(c) {
|
|
@@ -6948,7 +7525,7 @@ function getConfigsTableName(sessionId) {
|
|
|
6948
7525
|
return "".concat(sessionId.replace(/-/g, '_'), "__config__");
|
|
6949
7526
|
}
|
|
6950
7527
|
function normalizeValues(values) {
|
|
6951
|
-
if (!values || _typeof$
|
|
7528
|
+
if (!values || _typeof$2(values) !== "object" || Array.isArray(values)) {
|
|
6952
7529
|
return {};
|
|
6953
7530
|
}
|
|
6954
7531
|
return values;
|
|
@@ -6985,9 +7562,9 @@ function getConfig(_x) {
|
|
|
6985
7562
|
return _getConfig.apply(this, arguments);
|
|
6986
7563
|
}
|
|
6987
7564
|
function _getConfig() {
|
|
6988
|
-
_getConfig = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(c) {
|
|
7565
|
+
_getConfig = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(c) {
|
|
6989
7566
|
var namespace, namespaceError, _response, sessionId, sessionError, _response2, tableName, supabase, _yield$supabase$from$, data, error, response, _response3, _t;
|
|
6990
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
7567
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
6991
7568
|
while (1) switch (_context.prev = _context.next) {
|
|
6992
7569
|
case 0:
|
|
6993
7570
|
_context.prev = 0;
|
|
@@ -7056,9 +7633,9 @@ function updateConfig(_x2) {
|
|
|
7056
7633
|
return _updateConfig.apply(this, arguments);
|
|
7057
7634
|
}
|
|
7058
7635
|
function _updateConfig() {
|
|
7059
|
-
_updateConfig = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c) {
|
|
7636
|
+
_updateConfig = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c) {
|
|
7060
7637
|
var namespace, namespaceError, _response4, body, values, sessionId, sessionError, _response5, tableName, supabase, _yield$supabase$from$2, existing, existingError, nextValues, _yield$supabase$from$3, data, error, response, _response6, _t2;
|
|
7061
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
7638
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
7062
7639
|
while (1) switch (_context2.prev = _context2.next) {
|
|
7063
7640
|
case 0:
|
|
7064
7641
|
_context2.prev = 0;
|
|
@@ -7149,6 +7726,22 @@ function _updateConfig() {
|
|
|
7149
7726
|
return _updateConfig.apply(this, arguments);
|
|
7150
7727
|
}
|
|
7151
7728
|
|
|
7729
|
+
function _arrayWithoutHoles(r) {
|
|
7730
|
+
if (Array.isArray(r)) return _arrayLikeToArray$2(r);
|
|
7731
|
+
}
|
|
7732
|
+
|
|
7733
|
+
function _iterableToArray(r) {
|
|
7734
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
7735
|
+
}
|
|
7736
|
+
|
|
7737
|
+
function _nonIterableSpread() {
|
|
7738
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7739
|
+
}
|
|
7740
|
+
|
|
7741
|
+
function _toConsumableArray(r) {
|
|
7742
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$2(r) || _nonIterableSpread();
|
|
7743
|
+
}
|
|
7744
|
+
|
|
7152
7745
|
var AUTH_REQUIRED = "CMS_AUTH_REQUIRED";
|
|
7153
7746
|
var AUTH_INVALID = "CMS_AUTH_INVALID";
|
|
7154
7747
|
var CMS_FORBIDDEN = "CMS_FORBIDDEN";
|
|
@@ -7160,9 +7753,9 @@ function getRoleFromSupabaseUser$1(user) {
|
|
|
7160
7753
|
return appRole !== null && appRole !== void 0 ? appRole : userRole;
|
|
7161
7754
|
}
|
|
7162
7755
|
var requireJwtAuth = /*#__PURE__*/function () {
|
|
7163
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(c, next) {
|
|
7756
|
+
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(c, next) {
|
|
7164
7757
|
var authHeader, token, supabase, _yield$supabase$auth$, data, error, auth;
|
|
7165
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
7758
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
7166
7759
|
while (1) switch (_context.prev = _context.next) {
|
|
7167
7760
|
case 0:
|
|
7168
7761
|
authHeader = c.req.header("Authorization") || null;
|
|
@@ -7224,10 +7817,10 @@ var requireJwtAuth = /*#__PURE__*/function () {
|
|
|
7224
7817
|
};
|
|
7225
7818
|
}();
|
|
7226
7819
|
var requireAdminRole = /*#__PURE__*/function () {
|
|
7227
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c, next) {
|
|
7820
|
+
var _ref2 = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c, next) {
|
|
7228
7821
|
var _user$user_metadata2;
|
|
7229
7822
|
var auth, role, sessionId, user, userSessionId, supabase, ok, isAdmin;
|
|
7230
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
7823
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
7231
7824
|
while (1) switch (_context2.prev = _context2.next) {
|
|
7232
7825
|
case 0:
|
|
7233
7826
|
auth = c.auth;
|
|
@@ -7323,9 +7916,9 @@ function supabaseLogin(_x) {
|
|
|
7323
7916
|
}
|
|
7324
7917
|
// POST - 校验 Supabase JWT(需要 Authorization: Bearer <token>)
|
|
7325
7918
|
function _supabaseLogin() {
|
|
7326
|
-
_supabaseLogin = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(c) {
|
|
7919
|
+
_supabaseLogin = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(c) {
|
|
7327
7920
|
var _body$email, _data$session, body, email, password, supabase, _yield$supabase$auth$, data, error, token, user, role, _t;
|
|
7328
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
7921
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
7329
7922
|
while (1) switch (_context.prev = _context.next) {
|
|
7330
7923
|
case 0:
|
|
7331
7924
|
_context.prev = 0;
|
|
@@ -7400,9 +7993,9 @@ function supabaseVerify(_x2) {
|
|
|
7400
7993
|
}
|
|
7401
7994
|
// GET - 当前用户(需要 Authorization: Bearer <token>)
|
|
7402
7995
|
function _supabaseVerify() {
|
|
7403
|
-
_supabaseVerify = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(c) {
|
|
7996
|
+
_supabaseVerify = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c) {
|
|
7404
7997
|
var token, supabase, _yield$supabase$auth$2, data, error, _t2;
|
|
7405
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
7998
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
7406
7999
|
while (1) switch (_context2.prev = _context2.next) {
|
|
7407
8000
|
case 0:
|
|
7408
8001
|
_context2.prev = 0;
|
|
@@ -7457,9 +8050,9 @@ function supabaseCurrentUser(_x3) {
|
|
|
7457
8050
|
return _supabaseCurrentUser.apply(this, arguments);
|
|
7458
8051
|
}
|
|
7459
8052
|
function _supabaseCurrentUser() {
|
|
7460
|
-
_supabaseCurrentUser = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(c) {
|
|
8053
|
+
_supabaseCurrentUser = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(c) {
|
|
7461
8054
|
var token, supabase, _yield$supabase$auth$3, data, error, user, role, _t3;
|
|
7462
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
8055
|
+
return _regeneratorRuntime$1.wrap(function (_context3) {
|
|
7463
8056
|
while (1) switch (_context3.prev = _context3.next) {
|
|
7464
8057
|
case 0:
|
|
7465
8058
|
_context3.prev = 0;
|
|
@@ -7517,64 +8110,128 @@ function _supabaseCurrentUser() {
|
|
|
7517
8110
|
return _supabaseCurrentUser.apply(this, arguments);
|
|
7518
8111
|
}
|
|
7519
8112
|
|
|
8113
|
+
function isSkipAuthRequest(c) {
|
|
8114
|
+
return c.req.header("X-CMS-Skip-Auth") === "true";
|
|
8115
|
+
}
|
|
8116
|
+
function withAdmin() {
|
|
8117
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8118
|
+
if (!options.skipAuth) {
|
|
8119
|
+
return [requireJwtAuth, requireAdminRole];
|
|
8120
|
+
}
|
|
8121
|
+
// 路由免鉴权
|
|
8122
|
+
return [(/*#__PURE__*/function () {
|
|
8123
|
+
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(c, next) {
|
|
8124
|
+
return _regeneratorRuntime$1.wrap(function (_context) {
|
|
8125
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8126
|
+
case 0:
|
|
8127
|
+
if (!isSkipAuthRequest(c)) {
|
|
8128
|
+
_context.next = 2;
|
|
8129
|
+
break;
|
|
8130
|
+
}
|
|
8131
|
+
_context.next = 1;
|
|
8132
|
+
return next();
|
|
8133
|
+
case 1:
|
|
8134
|
+
return _context.abrupt("return");
|
|
8135
|
+
case 2:
|
|
8136
|
+
_context.next = 3;
|
|
8137
|
+
return requireJwtAuth(c, next);
|
|
8138
|
+
case 3:
|
|
8139
|
+
case "end":
|
|
8140
|
+
return _context.stop();
|
|
8141
|
+
}
|
|
8142
|
+
}, _callee);
|
|
8143
|
+
}));
|
|
8144
|
+
return function (_x, _x2) {
|
|
8145
|
+
return _ref.apply(this, arguments);
|
|
8146
|
+
};
|
|
8147
|
+
}()), (/*#__PURE__*/function () {
|
|
8148
|
+
var _ref2 = _asyncToGenerator$1(/*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2(c, next) {
|
|
8149
|
+
return _regeneratorRuntime$1.wrap(function (_context2) {
|
|
8150
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
8151
|
+
case 0:
|
|
8152
|
+
if (!isSkipAuthRequest(c)) {
|
|
8153
|
+
_context2.next = 2;
|
|
8154
|
+
break;
|
|
8155
|
+
}
|
|
8156
|
+
_context2.next = 1;
|
|
8157
|
+
return next();
|
|
8158
|
+
case 1:
|
|
8159
|
+
return _context2.abrupt("return");
|
|
8160
|
+
case 2:
|
|
8161
|
+
_context2.next = 3;
|
|
8162
|
+
return requireAdminRole(c, next);
|
|
8163
|
+
case 3:
|
|
8164
|
+
case "end":
|
|
8165
|
+
return _context2.stop();
|
|
8166
|
+
}
|
|
8167
|
+
}, _callee2);
|
|
8168
|
+
}));
|
|
8169
|
+
return function (_x3, _x4) {
|
|
8170
|
+
return _ref2.apply(this, arguments);
|
|
8171
|
+
};
|
|
8172
|
+
}())];
|
|
8173
|
+
}
|
|
7520
8174
|
// 创建模型路由处理器
|
|
7521
8175
|
function createModelRoute(app) {
|
|
8176
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7522
8177
|
// CMS 管理接口:要求登录 + admin 权限(兼容 Supabase Auth JWT / 旧 CMS JWT)
|
|
7523
|
-
app.get("/models",
|
|
7524
|
-
app.post("/models",
|
|
7525
|
-
app.put("/models",
|
|
7526
|
-
app["delete"]("/models",
|
|
8178
|
+
app.get.apply(app, ["/models"].concat(_toConsumableArray(withAdmin(options)), [getModels]));
|
|
8179
|
+
app.post.apply(app, ["/models"].concat(_toConsumableArray(withAdmin(options)), [createModel]));
|
|
8180
|
+
app.put.apply(app, ["/models"].concat(_toConsumableArray(withAdmin(options)), [updateModel]));
|
|
8181
|
+
app["delete"].apply(app, ["/models"].concat(_toConsumableArray(withAdmin(options)), [deleteModel]));
|
|
7527
8182
|
return app;
|
|
7528
8183
|
}
|
|
7529
8184
|
// 创建数据表路由处理器(固定表名)
|
|
7530
8185
|
function createDataRoute(app, tableName) {
|
|
7531
|
-
|
|
8186
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8187
|
+
app.get.apply(app, ["/data/".concat(tableName)].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
7532
8188
|
return getTableData(c, tableName);
|
|
7533
|
-
});
|
|
7534
|
-
app.post("/data/".concat(tableName),
|
|
8189
|
+
}]));
|
|
8190
|
+
app.post.apply(app, ["/data/".concat(tableName)].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
7535
8191
|
return createTableData(c, tableName);
|
|
7536
|
-
});
|
|
7537
|
-
app.put("/data/".concat(tableName),
|
|
8192
|
+
}]));
|
|
8193
|
+
app.put.apply(app, ["/data/".concat(tableName)].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
7538
8194
|
return updateTableData(c, tableName);
|
|
7539
|
-
});
|
|
7540
|
-
app["delete"]("/data/".concat(tableName),
|
|
8195
|
+
}]));
|
|
8196
|
+
app["delete"].apply(app, ["/data/".concat(tableName)].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
7541
8197
|
return deleteTableData(c, tableName);
|
|
7542
|
-
});
|
|
8198
|
+
}]));
|
|
7543
8199
|
return app;
|
|
7544
8200
|
}
|
|
7545
8201
|
// 动态创建数据表路由处理器(从URL参数获取表名)
|
|
7546
8202
|
function createDynamicDataRoute(app) {
|
|
8203
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7547
8204
|
// 获取关联表选项(放在 :tableName 路由之前,避免被匹配)
|
|
7548
|
-
app.get("/relation/:tableName/options",
|
|
7549
|
-
var tableName = c.req.param("tableName");
|
|
8205
|
+
app.get.apply(app, ["/relation/:tableName/options"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
8206
|
+
var tableName = c.req.param("tableName") || "";
|
|
7550
8207
|
return getRelationOptions(c, tableName);
|
|
7551
|
-
});
|
|
8208
|
+
}]));
|
|
7552
8209
|
// 获取带关联数据的表数据
|
|
7553
|
-
app.get("/data/:tableName/with-relations",
|
|
7554
|
-
var tableName = c.req.param("tableName");
|
|
8210
|
+
app.get.apply(app, ["/data/:tableName/with-relations"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
8211
|
+
var tableName = c.req.param("tableName") || "";
|
|
7555
8212
|
return getTableDataWithRelations(c, tableName);
|
|
7556
|
-
});
|
|
7557
|
-
app.get("/data/:tableName",
|
|
7558
|
-
var tableName = c.req.param("tableName");
|
|
8213
|
+
}]));
|
|
8214
|
+
app.get.apply(app, ["/data/:tableName"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
8215
|
+
var tableName = c.req.param("tableName") || "";
|
|
7559
8216
|
return getTableData(c, tableName);
|
|
7560
|
-
});
|
|
7561
|
-
app.post("/data/:tableName",
|
|
7562
|
-
var tableName = c.req.param("tableName");
|
|
8217
|
+
}]));
|
|
8218
|
+
app.post.apply(app, ["/data/:tableName"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
8219
|
+
var tableName = c.req.param("tableName") || "";
|
|
7563
8220
|
return createTableData(c, tableName);
|
|
7564
|
-
});
|
|
7565
|
-
app.put("/data/:tableName",
|
|
7566
|
-
var tableName = c.req.param("tableName");
|
|
8221
|
+
}]));
|
|
8222
|
+
app.put.apply(app, ["/data/:tableName"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
8223
|
+
var tableName = c.req.param("tableName") || "";
|
|
7567
8224
|
return updateTableData(c, tableName);
|
|
7568
|
-
});
|
|
7569
|
-
app["delete"]("/data/:tableName",
|
|
7570
|
-
var tableName = c.req.param("tableName");
|
|
8225
|
+
}]));
|
|
8226
|
+
app["delete"].apply(app, ["/data/:tableName"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
8227
|
+
var tableName = c.req.param("tableName") || "";
|
|
7571
8228
|
return deleteTableData(c, tableName);
|
|
7572
|
-
});
|
|
8229
|
+
}]));
|
|
7573
8230
|
// 删除表的所有外键约束(用于解决外键引用错误表的问题)
|
|
7574
|
-
app["delete"]("/data/:tableName/foreign-keys",
|
|
7575
|
-
var tableName = c.req.param("tableName");
|
|
8231
|
+
app["delete"].apply(app, ["/data/:tableName/foreign-keys"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
8232
|
+
var tableName = c.req.param("tableName") || "";
|
|
7576
8233
|
return dropForeignKeys(c, tableName);
|
|
7577
|
-
});
|
|
8234
|
+
}]));
|
|
7578
8235
|
return app;
|
|
7579
8236
|
}
|
|
7580
8237
|
// 动态创建认证路由处理器(从URL参数获取表名)
|
|
@@ -7657,21 +8314,24 @@ function createAuthRoute(app, tableName) {
|
|
|
7657
8314
|
return app;
|
|
7658
8315
|
}
|
|
7659
8316
|
function createOssUploadRoute(app) {
|
|
7660
|
-
|
|
8317
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8318
|
+
app.post.apply(app, ["/upload"].concat(_toConsumableArray(withAdmin(options)), [uploadToOss]));
|
|
7661
8319
|
return app;
|
|
7662
8320
|
}
|
|
7663
8321
|
function createConfigRoute(app) {
|
|
7664
|
-
|
|
7665
|
-
app.
|
|
8322
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8323
|
+
app.get.apply(app, ["/configs"].concat(_toConsumableArray(withAdmin(options)), [getConfig]));
|
|
8324
|
+
app.put.apply(app, ["/configs/:namespace"].concat(_toConsumableArray(withAdmin(options)), [function (c) {
|
|
7666
8325
|
return updateConfig(c);
|
|
7667
|
-
});
|
|
8326
|
+
}]));
|
|
7668
8327
|
return app;
|
|
7669
8328
|
}
|
|
7670
8329
|
// 一键创建所有CMS路由
|
|
7671
8330
|
function createCmsRoutes(app) {
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
8331
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8332
|
+
createModelRoute(app, options);
|
|
8333
|
+
createConfigRoute(app, options);
|
|
8334
|
+
createDynamicDataRoute(app, options);
|
|
7675
8335
|
createDynamicAuthRoute(app);
|
|
7676
8336
|
return app;
|
|
7677
8337
|
}
|