@dynamicforms/fastapi-viewsets 0.5.7 → 0.6.1
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/fastapi-viewsets.js +142 -120
- package/dist/fastapi-viewsets.js.map +1 -1
- package/dist/fastapi-viewsets.umd.cjs +2 -2
- package/dist/fastapi-viewsets.umd.cjs.map +1 -1
- package/dist/index.d.ts +695 -11
- package/package.json +6 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/mixins.d.ts +0 -199
- package/dist/mixins.d.ts.map +0 -1
- package/dist/muxws-proxy.d.ts +0 -69
- package/dist/muxws-proxy.d.ts.map +0 -1
- package/dist/proxy-base.d.ts +0 -159
- package/dist/proxy-base.d.ts.map +0 -1
- package/dist/rest-proxy.d.ts +0 -84
- package/dist/rest-proxy.d.ts.map +0 -1
- package/dist/viewset.d.ts +0 -69
- package/dist/viewset.d.ts.map +0 -1
package/dist/fastapi-viewsets.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
import e from "axios";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { createTranslatable as t, interpolate as n } from "@dynamicforms/translatable";
|
|
3
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/typeof.js
|
|
4
|
+
function r(e) {
|
|
4
5
|
"@babel/helpers - typeof";
|
|
5
|
-
return
|
|
6
|
+
return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
6
7
|
return typeof e;
|
|
7
8
|
} : function(e) {
|
|
8
9
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
9
|
-
},
|
|
10
|
+
}, r(e);
|
|
10
11
|
}
|
|
11
12
|
//#endregion
|
|
12
|
-
//#region \0@oxc-project+runtime@0.
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
var
|
|
16
|
-
if (
|
|
17
|
-
var i =
|
|
18
|
-
if (
|
|
13
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/toPrimitive.js
|
|
14
|
+
function i(e, t) {
|
|
15
|
+
if (r(e) != "object" || !e) return e;
|
|
16
|
+
var n = e[Symbol.toPrimitive];
|
|
17
|
+
if (n !== void 0) {
|
|
18
|
+
var i = n.call(e, t || "default");
|
|
19
|
+
if (r(i) != "object") return i;
|
|
19
20
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
20
21
|
}
|
|
21
|
-
return (
|
|
22
|
+
return (t === "string" ? String : Number)(e);
|
|
22
23
|
}
|
|
23
24
|
//#endregion
|
|
24
|
-
//#region \0@oxc-project+runtime@0.
|
|
25
|
-
function
|
|
26
|
-
var
|
|
27
|
-
return t
|
|
25
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/toPropertyKey.js
|
|
26
|
+
function a(e) {
|
|
27
|
+
var t = i(e, "string");
|
|
28
|
+
return r(t) == "symbol" ? t : t + "";
|
|
28
29
|
}
|
|
29
30
|
//#endregion
|
|
30
|
-
//#region \0@oxc-project+runtime@0.
|
|
31
|
-
function
|
|
32
|
-
return (t =
|
|
31
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/defineProperty.js
|
|
32
|
+
function o(e, t, n) {
|
|
33
|
+
return (t = a(t)) in e ? Object.defineProperty(e, t, {
|
|
33
34
|
value: n,
|
|
34
35
|
enumerable: !0,
|
|
35
36
|
configurable: !0,
|
|
@@ -38,53 +39,53 @@ function i(e, t, n) {
|
|
|
38
39
|
}
|
|
39
40
|
//#endregion
|
|
40
41
|
//#region vue/mixins.ts
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
var o = class {};
|
|
44
|
-
i(o, "actions", ["bulkCreate"]);
|
|
45
|
-
var s = class extends a {};
|
|
46
|
-
i(s, "actions", [...a.actions, ...o.actions]);
|
|
42
|
+
var s = class {};
|
|
43
|
+
o(s, "actions", ["create"]);
|
|
47
44
|
var c = class {};
|
|
48
|
-
|
|
49
|
-
var l = class {};
|
|
50
|
-
|
|
45
|
+
o(c, "actions", ["bulkCreate"]);
|
|
46
|
+
var l = class extends s {};
|
|
47
|
+
o(l, "actions", [...s.actions, ...c.actions]);
|
|
51
48
|
var u = class {};
|
|
52
|
-
|
|
49
|
+
o(u, "actions", ["list"]);
|
|
53
50
|
var d = class {};
|
|
54
|
-
|
|
51
|
+
o(d, "actions", ["listCursor"]);
|
|
55
52
|
var f = class {};
|
|
56
|
-
|
|
53
|
+
o(f, "actions", ["listPage"]);
|
|
57
54
|
var p = class {};
|
|
58
|
-
|
|
59
|
-
var m = class
|
|
60
|
-
|
|
55
|
+
o(p, "actions", ["retrieve"]);
|
|
56
|
+
var m = class {};
|
|
57
|
+
o(m, "actions", ["update", "partialUpdate"]);
|
|
61
58
|
var h = class {};
|
|
62
|
-
|
|
63
|
-
var g = class {};
|
|
64
|
-
|
|
65
|
-
var _ = class
|
|
66
|
-
|
|
59
|
+
o(h, "actions", ["bulkUpdate", "bulkPartialUpdate"]);
|
|
60
|
+
var g = class extends m {};
|
|
61
|
+
o(g, "actions", [...m.actions, ...h.actions]);
|
|
62
|
+
var _ = class {};
|
|
63
|
+
o(_, "actions", ["destroy"]);
|
|
67
64
|
var v = class {};
|
|
68
|
-
|
|
69
|
-
var y = class extends
|
|
70
|
-
|
|
71
|
-
var b = class
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
o(v, "actions", ["bulkDestroy"]);
|
|
66
|
+
var y = class extends _ {};
|
|
67
|
+
o(y, "actions", [..._.actions, ...v.actions]);
|
|
68
|
+
var b = class {};
|
|
69
|
+
o(b, "actions", ["lookup"]);
|
|
70
|
+
var x = class extends u {};
|
|
71
|
+
o(x, "actions", [...u.actions, ...p.actions]);
|
|
72
|
+
var S = class extends x {};
|
|
73
|
+
o(S, "actions", [
|
|
74
|
+
...x.actions,
|
|
75
|
+
...s.actions,
|
|
76
|
+
...m.actions,
|
|
77
|
+
..._.actions
|
|
77
78
|
]);
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
...
|
|
81
|
-
...
|
|
82
|
-
...
|
|
83
|
-
...
|
|
79
|
+
var C = class extends S {};
|
|
80
|
+
o(C, "actions", [
|
|
81
|
+
...S.actions,
|
|
82
|
+
...c.actions,
|
|
83
|
+
...h.actions,
|
|
84
|
+
...v.actions
|
|
84
85
|
]);
|
|
85
86
|
//#endregion
|
|
86
|
-
//#region \0@oxc-project+runtime@0.
|
|
87
|
-
function
|
|
87
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/asyncToGenerator.js
|
|
88
|
+
function w(e, t, n, r, i, a, o) {
|
|
88
89
|
try {
|
|
89
90
|
var s = e[a](o), c = s.value;
|
|
90
91
|
} catch (e) {
|
|
@@ -93,16 +94,16 @@ function S(e, t, n, r, i, a, o) {
|
|
|
93
94
|
}
|
|
94
95
|
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function T(e) {
|
|
97
98
|
return function() {
|
|
98
99
|
var t = this, n = arguments;
|
|
99
100
|
return new Promise(function(r, i) {
|
|
100
101
|
var a = e.apply(t, n);
|
|
101
102
|
function o(e) {
|
|
102
|
-
|
|
103
|
+
w(a, r, i, o, s, "next", e);
|
|
103
104
|
}
|
|
104
105
|
function s(e) {
|
|
105
|
-
|
|
106
|
+
w(a, r, i, o, s, "throw", e);
|
|
106
107
|
}
|
|
107
108
|
o(void 0);
|
|
108
109
|
});
|
|
@@ -110,15 +111,15 @@ function C(e) {
|
|
|
110
111
|
}
|
|
111
112
|
//#endregion
|
|
112
113
|
//#region vue/proxy-base.ts
|
|
113
|
-
var
|
|
114
|
+
var E = class extends Error {
|
|
114
115
|
constructor(e, t, n = {}) {
|
|
115
|
-
super(`Request failed with status code ${e}`),
|
|
116
|
+
super(`Request failed with status code ${e}`), o(this, "response", void 0), this.name = "ViewSetRequestError", this.response = {
|
|
116
117
|
status: e,
|
|
117
118
|
data: t,
|
|
118
119
|
headers: n
|
|
119
120
|
};
|
|
120
121
|
}
|
|
121
|
-
},
|
|
122
|
+
}, D = /* @__PURE__ */ new Set([
|
|
122
123
|
"get",
|
|
123
124
|
"post",
|
|
124
125
|
"put",
|
|
@@ -127,7 +128,7 @@ var w = class extends Error {
|
|
|
127
128
|
"head",
|
|
128
129
|
"options",
|
|
129
130
|
"trace"
|
|
130
|
-
]),
|
|
131
|
+
]), O = {
|
|
131
132
|
base: {
|
|
132
133
|
GET: [
|
|
133
134
|
"list",
|
|
@@ -149,7 +150,7 @@ var w = class extends Error {
|
|
|
149
150
|
DELETE: ["bulkDestroy"]
|
|
150
151
|
},
|
|
151
152
|
lookup: { GET: ["lookup"] }
|
|
152
|
-
},
|
|
153
|
+
}, k = Object.keys({
|
|
153
154
|
list: !0,
|
|
154
155
|
listPage: !0,
|
|
155
156
|
listCursor: !0,
|
|
@@ -164,7 +165,7 @@ var w = class extends Error {
|
|
|
164
165
|
bulkDestroy: !0,
|
|
165
166
|
lookup: !0
|
|
166
167
|
});
|
|
167
|
-
function
|
|
168
|
+
function A(e, t) {
|
|
168
169
|
var n;
|
|
169
170
|
let r = t == null ? e.constructor.declares : t;
|
|
170
171
|
if (!Array.isArray(r)) return null;
|
|
@@ -172,30 +173,30 @@ function O(e, t) {
|
|
|
172
173
|
for (let e of r) for (let t of (n = e == null ? void 0 : e.actions) == null ? [] : n) i.add(t);
|
|
173
174
|
return i;
|
|
174
175
|
}
|
|
175
|
-
var
|
|
176
|
+
var j = class {
|
|
176
177
|
constructor(e) {
|
|
177
|
-
|
|
178
|
+
o(this, "basePath", void 0), this.basePath = e.replace(/\/$/, "");
|
|
178
179
|
}
|
|
179
180
|
request(e, t, n) {
|
|
180
181
|
throw Error("ViewSetInternals.request: no transport");
|
|
181
182
|
}
|
|
182
|
-
},
|
|
183
|
+
}, M = class extends j {
|
|
183
184
|
constructor(e) {
|
|
184
|
-
super(e.basePath),
|
|
185
|
+
super(e.basePath), o(this, "pkFieldName", void 0), o(this, "schemaValidationEnabled", void 0), o(this, "declaredMixins", void 0), this.pkFieldName = e.pkFieldName, this.schemaValidationEnabled = e.validateSchema !== !1, this.declaredMixins = e.declares;
|
|
185
186
|
}
|
|
186
187
|
initSchemaValidation() {
|
|
187
188
|
this.schemaValidationEnabled && this.validateAgainstSchema();
|
|
188
189
|
}
|
|
189
190
|
validateAgainstSchema() {
|
|
190
191
|
var e = this;
|
|
191
|
-
return
|
|
192
|
-
let t =
|
|
192
|
+
return T(function* () {
|
|
193
|
+
let t = A(e, e.declaredMixins);
|
|
193
194
|
if (t !== null) try {
|
|
194
195
|
var n;
|
|
195
196
|
let i = yield e.request("GET", "/schema"), a = (n = i == null ? void 0 : i.paths) == null ? {} : n, o = /* @__PURE__ */ new Set(), s = [], c = [];
|
|
196
197
|
for (let [t, n] of Object.entries(a)) {
|
|
197
198
|
var r;
|
|
198
|
-
let i = t.slice(e.basePath.length).replace(/^\//, ""), a = Object.keys(n).filter((e) =>
|
|
199
|
+
let i = t.slice(e.basePath.length).replace(/^\//, ""), a = Object.keys(n).filter((e) => D.has(e.toLowerCase())), l;
|
|
199
200
|
if (i === "") l = "base";
|
|
200
201
|
else if (i === "bulk") l = "bulk";
|
|
201
202
|
else if (i === "lookup") l = "lookup";
|
|
@@ -208,7 +209,7 @@ var k = class {
|
|
|
208
209
|
});
|
|
209
210
|
continue;
|
|
210
211
|
}
|
|
211
|
-
let u = (r =
|
|
212
|
+
let u = (r = O[l]) == null ? {} : r;
|
|
212
213
|
for (let e of a) {
|
|
213
214
|
let n = u[e.toUpperCase()];
|
|
214
215
|
if (n) {
|
|
@@ -221,7 +222,7 @@ var k = class {
|
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
let l = [];
|
|
224
|
-
for (let e of
|
|
225
|
+
for (let e of k) t.has(e) && !o.has(e) && l.push(`declares '${e}' but the BE viewset serves no such endpoint`);
|
|
225
226
|
for (let { endpoint: e, actions: n } of s) n.some((e) => t.has(e)) || l.push(`BE serves '${e}' but the ViewSet declares no ${n.join(" / ")}`);
|
|
226
227
|
for (let { endpoint: t, method: n } of c) typeof e[n] != "function" && l.push(`BE serves '${t}' but the ViewSet has no '${n}()' method`);
|
|
227
228
|
l.length > 0 && console.warn(`[ViewSet ${e.basePath}] FE/BE definition mismatch:\n` + l.map((e) => ` • ${e}`).join("\n"));
|
|
@@ -230,25 +231,25 @@ var k = class {
|
|
|
230
231
|
}
|
|
231
232
|
create(e) {
|
|
232
233
|
var t = this;
|
|
233
|
-
return
|
|
234
|
+
return T(function* () {
|
|
234
235
|
return t.request("POST", "", { body: e });
|
|
235
236
|
})();
|
|
236
237
|
}
|
|
237
238
|
bulkCreate(e) {
|
|
238
239
|
var t = this;
|
|
239
|
-
return
|
|
240
|
+
return T(function* () {
|
|
240
241
|
return t.request("POST", "/bulk", { body: e });
|
|
241
242
|
})();
|
|
242
243
|
}
|
|
243
244
|
list(e) {
|
|
244
245
|
var t = this;
|
|
245
|
-
return
|
|
246
|
+
return T(function* () {
|
|
246
247
|
return t.request("GET", "", { query: e });
|
|
247
248
|
})();
|
|
248
249
|
}
|
|
249
250
|
listCursor(e) {
|
|
250
251
|
var t = this;
|
|
251
|
-
return
|
|
252
|
+
return T(function* () {
|
|
252
253
|
let n = yield t.request("GET", "", { query: e });
|
|
253
254
|
return {
|
|
254
255
|
results: n.results,
|
|
@@ -264,7 +265,7 @@ var k = class {
|
|
|
264
265
|
}
|
|
265
266
|
listPage(e) {
|
|
266
267
|
var t = this;
|
|
267
|
-
return
|
|
268
|
+
return T(function* () {
|
|
268
269
|
let n = yield t.request("GET", "", { query: e });
|
|
269
270
|
return {
|
|
270
271
|
results: n.results,
|
|
@@ -278,57 +279,57 @@ var k = class {
|
|
|
278
279
|
}
|
|
279
280
|
retrieve(e) {
|
|
280
281
|
var t = this;
|
|
281
|
-
return
|
|
282
|
+
return T(function* () {
|
|
282
283
|
return t.request("GET", `/${e}`);
|
|
283
284
|
})();
|
|
284
285
|
}
|
|
285
286
|
update(e, t) {
|
|
286
287
|
var n = this;
|
|
287
|
-
return
|
|
288
|
+
return T(function* () {
|
|
288
289
|
return n.request("PUT", `/${e}`, { body: t });
|
|
289
290
|
})();
|
|
290
291
|
}
|
|
291
292
|
partialUpdate(e, t) {
|
|
292
293
|
var n = this;
|
|
293
|
-
return
|
|
294
|
+
return T(function* () {
|
|
294
295
|
return n.request("PATCH", `/${e}`, { body: t });
|
|
295
296
|
})();
|
|
296
297
|
}
|
|
297
298
|
bulkUpdate(e) {
|
|
298
299
|
var t = this;
|
|
299
|
-
return
|
|
300
|
+
return T(function* () {
|
|
300
301
|
return t.request("PUT", "/bulk", { body: e });
|
|
301
302
|
})();
|
|
302
303
|
}
|
|
303
304
|
bulkPartialUpdate(e) {
|
|
304
305
|
var t = this;
|
|
305
|
-
return
|
|
306
|
+
return T(function* () {
|
|
306
307
|
return t.request("PATCH", "/bulk", { body: e });
|
|
307
308
|
})();
|
|
308
309
|
}
|
|
309
310
|
destroy(e) {
|
|
310
311
|
var t = this;
|
|
311
|
-
return
|
|
312
|
+
return T(function* () {
|
|
312
313
|
return t.request("DELETE", `/${e}`);
|
|
313
314
|
})();
|
|
314
315
|
}
|
|
315
316
|
bulkDestroy(e) {
|
|
316
317
|
var t = this;
|
|
317
|
-
return
|
|
318
|
+
return T(function* () {
|
|
318
319
|
return t.request("DELETE", "/bulk", { body: e });
|
|
319
320
|
})();
|
|
320
321
|
}
|
|
321
322
|
lookup() {
|
|
322
323
|
var e = this;
|
|
323
|
-
return
|
|
324
|
+
return T(function* () {
|
|
324
325
|
return e.request("GET", "/lookup");
|
|
325
326
|
})();
|
|
326
327
|
}
|
|
327
328
|
};
|
|
328
|
-
|
|
329
|
+
o(M, "declares", void 0);
|
|
329
330
|
//#endregion
|
|
330
|
-
//#region \0@oxc-project+runtime@0.
|
|
331
|
-
function
|
|
331
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/objectSpread2.js
|
|
332
|
+
function N(e, t) {
|
|
332
333
|
var n = Object.keys(e);
|
|
333
334
|
if (Object.getOwnPropertySymbols) {
|
|
334
335
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -338,12 +339,12 @@ function j(e, t) {
|
|
|
338
339
|
}
|
|
339
340
|
return n;
|
|
340
341
|
}
|
|
341
|
-
function
|
|
342
|
+
function P(e) {
|
|
342
343
|
for (var t = 1; t < arguments.length; t++) {
|
|
343
344
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
344
|
-
t % 2 ?
|
|
345
|
-
|
|
346
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
345
|
+
t % 2 ? N(Object(n), !0).forEach(function(t) {
|
|
346
|
+
o(e, t, n[t]);
|
|
347
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : N(Object(n)).forEach(function(t) {
|
|
347
348
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
348
349
|
});
|
|
349
350
|
}
|
|
@@ -351,10 +352,10 @@ function M(e) {
|
|
|
351
352
|
}
|
|
352
353
|
//#endregion
|
|
353
354
|
//#region vue/muxws-proxy.ts
|
|
354
|
-
var
|
|
355
|
+
var F = class extends M {
|
|
355
356
|
constructor(e) {
|
|
356
357
|
var t;
|
|
357
|
-
super(e),
|
|
358
|
+
super(e), o(this, "peerSource", void 0), o(this, "timeoutMs", void 0), o(this, "headers", void 0), o(this, "peerPromise", void 0), this.peerSource = e.peer, this.timeoutMs = e.timeoutMs, this.headers = (t = e.headers) == null ? {} : t, this.initSchemaValidation();
|
|
358
359
|
}
|
|
359
360
|
peer() {
|
|
360
361
|
if (!this.peerPromise) {
|
|
@@ -365,29 +366,29 @@ var N = class extends A {
|
|
|
365
366
|
}
|
|
366
367
|
request(e, t) {
|
|
367
368
|
var n = this;
|
|
368
|
-
return
|
|
369
|
-
let i = yield n.peer(), a =
|
|
369
|
+
return T(function* (e, t, r = {}) {
|
|
370
|
+
let i = yield n.peer(), a = P(P({}, n.headers), {}, {
|
|
370
371
|
":method": e,
|
|
371
372
|
":path": `${n.basePath}${t}`
|
|
372
373
|
});
|
|
373
|
-
r.query && Object.keys(r.query).length > 0 && (a[":query"] =
|
|
374
|
+
r.query && Object.keys(r.query).length > 0 && (a[":query"] = I(r.query));
|
|
374
375
|
let o = i.open(r.body, {
|
|
375
376
|
headers: a,
|
|
376
377
|
end: !0
|
|
377
378
|
});
|
|
378
379
|
yield o.replyHeadersArrived;
|
|
379
|
-
let s =
|
|
380
|
-
if (s >= 400) throw new
|
|
380
|
+
let s = L(o.replyHeaders), c = yield o.result(n.timeoutMs === void 0 ? void 0 : { timeoutMs: n.timeoutMs });
|
|
381
|
+
if (s >= 400) throw new E(s, c, R(o.replyHeaders));
|
|
381
382
|
return c;
|
|
382
383
|
}).apply(this, arguments);
|
|
383
384
|
}
|
|
384
385
|
};
|
|
385
|
-
function
|
|
386
|
+
function I(e) {
|
|
386
387
|
let t = {};
|
|
387
388
|
for (let [n, r] of Object.entries(e)) r != null && (t[n] = r);
|
|
388
389
|
return t;
|
|
389
390
|
}
|
|
390
|
-
function
|
|
391
|
+
function L(e) {
|
|
391
392
|
let t = e == null ? void 0 : e[":status"];
|
|
392
393
|
if (typeof t == "number") return t;
|
|
393
394
|
if (typeof t == "string") {
|
|
@@ -396,24 +397,24 @@ function F(e) {
|
|
|
396
397
|
}
|
|
397
398
|
return 200;
|
|
398
399
|
}
|
|
399
|
-
function
|
|
400
|
+
function R(e) {
|
|
400
401
|
let t = {};
|
|
401
402
|
for (let [n, r] of Object.entries(e == null ? {} : e)) n.startsWith(":") || (t[n] = String(r));
|
|
402
403
|
return t;
|
|
403
404
|
}
|
|
404
|
-
function
|
|
405
|
-
return new
|
|
405
|
+
function z(e, t) {
|
|
406
|
+
return new F(P({ declares: e.declares }, t));
|
|
406
407
|
}
|
|
407
408
|
//#endregion
|
|
408
409
|
//#region vue/rest-proxy.ts
|
|
409
|
-
var
|
|
410
|
+
var B = class extends M {
|
|
410
411
|
constructor(t) {
|
|
411
412
|
var n;
|
|
412
|
-
super(t),
|
|
413
|
+
super(t), o(this, "http", void 0), this.http = (n = t.axiosInstance) == null ? e : n, this.initSchemaValidation();
|
|
413
414
|
}
|
|
414
415
|
request(e, t) {
|
|
415
416
|
var n = this;
|
|
416
|
-
return
|
|
417
|
+
return T(function* (e, t, r = {}) {
|
|
417
418
|
let i = `${n.basePath}${t}`, a = r.query !== void 0 && Object.keys(r.query).length > 0 ? { params: r.query } : void 0;
|
|
418
419
|
switch (e) {
|
|
419
420
|
case "GET": return (a ? yield n.http.get(i, a) : yield n.http.get(i)).data;
|
|
@@ -421,41 +422,62 @@ var R = class extends A {
|
|
|
421
422
|
case "PUT": return (a ? yield n.http.put(i, r.body, a) : yield n.http.put(i, r.body)).data;
|
|
422
423
|
case "PATCH": return (a ? yield n.http.patch(i, r.body, a) : yield n.http.patch(i, r.body)).data;
|
|
423
424
|
case "DELETE": {
|
|
424
|
-
let e = r.body === void 0 ? a :
|
|
425
|
+
let e = r.body === void 0 ? a : P(P({}, a == null ? {} : a), {}, { data: r.body });
|
|
425
426
|
return (e ? yield n.http.delete(i, e) : yield n.http.delete(i)).data;
|
|
426
427
|
}
|
|
427
428
|
}
|
|
428
429
|
}).apply(this, arguments);
|
|
429
430
|
}
|
|
430
431
|
};
|
|
431
|
-
function
|
|
432
|
+
function V(e, t, n, r) {
|
|
432
433
|
let i = typeof t == "string" ? {
|
|
433
434
|
basePath: t,
|
|
434
435
|
pkFieldName: n,
|
|
435
436
|
axiosInstance: r
|
|
436
437
|
} : t;
|
|
437
|
-
return new
|
|
438
|
+
return new B(P({ declares: e.declares }, i));
|
|
438
439
|
}
|
|
439
440
|
//#endregion
|
|
440
441
|
//#region vue/viewset.ts
|
|
441
|
-
function
|
|
442
|
+
function H(e, t, n) {
|
|
442
443
|
var r;
|
|
443
444
|
return r = class extends e {
|
|
444
445
|
constructor(e) {
|
|
445
|
-
super(
|
|
446
|
+
super(P(P({}, e), {}, {
|
|
446
447
|
pkFieldName: t,
|
|
447
448
|
declares: void 0
|
|
448
449
|
}));
|
|
449
450
|
}
|
|
450
|
-
},
|
|
451
|
+
}, o(r, "declares", n), r;
|
|
452
|
+
}
|
|
453
|
+
function U() {
|
|
454
|
+
return (e, t) => H(B, e, t);
|
|
451
455
|
}
|
|
452
|
-
function
|
|
453
|
-
return (e, t) =>
|
|
456
|
+
function W() {
|
|
457
|
+
return (e, t) => H(F, e, t);
|
|
454
458
|
}
|
|
455
|
-
|
|
456
|
-
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region vue/errors.ts
|
|
461
|
+
var { strings: G, translateStrings: K } = t({
|
|
462
|
+
not_found: "Item with pk {pk} not found",
|
|
463
|
+
session_expired: "Session expired or invalid",
|
|
464
|
+
not_authorized: "Not authorized to perform this action",
|
|
465
|
+
rate_limited: "Rate limit exceeded",
|
|
466
|
+
unsupported_list_shape: "unsupported list shape \"{shape}\"; this endpoint offers {allowed}",
|
|
467
|
+
cursor_unreadable: "cursor is not readable: {error}",
|
|
468
|
+
cursor_missing_position: "cursor is not readable: no position in it",
|
|
469
|
+
cursor_stale: "this cursor was issued for a different ordering or filter - start from the first page",
|
|
470
|
+
cursor_missing_keys: "cursor has no value for ordering key(s): {missing}",
|
|
471
|
+
cursor_value_mismatch: "cursor value for \"{name}\" does not fit the field: {error}"
|
|
472
|
+
});
|
|
473
|
+
function q(e) {
|
|
474
|
+
if (!e.detail_code) return e.detail;
|
|
475
|
+
let t = G[e.detail_code];
|
|
476
|
+
if (t == null) return e.detail;
|
|
477
|
+
let r = P({}, e.detail_params);
|
|
478
|
+
return Array.isArray(r.allowed) && (r.allowed = r.allowed.join(", ")), Array.isArray(r.missing) && (r.missing = r.missing.join(", ")), n(t, r);
|
|
457
479
|
}
|
|
458
480
|
//#endregion
|
|
459
|
-
export {
|
|
481
|
+
export { l as BulkCreateMixin, y as BulkDestroyMixin, c as BulkOnlyCreateMixin, v as BulkOnlyDestroyMixin, h as BulkOnlyUpdateMixin, g as BulkUpdateMixin, C as BulkViewSetMixin, s as CreateMixin, d as CursorListMixin, _ as DestroyMixin, u as ListMixin, b as LookupMixin, F as MuxwsProxyImpl, f as PaginatedListMixin, x as ReadOnlyViewSetMixin, B as RestProxyImpl, p as RetrieveMixin, m as UpdateMixin, j as ViewSetInternals, S as ViewSetMixin, M as ViewSetProxyBase, E as ViewSetRequestError, W as muxwsViewSet, U as restViewSet, z as route_muxws, V as route_rest, G as translatableStrings, q as translateApiError, K as translateStrings };
|
|
460
482
|
|
|
461
483
|
//# sourceMappingURL=fastapi-viewsets.js.map
|