@judo/actions 0.30.0 → 0.31.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/api/constants.d.ts +1 -1
- package/dist/api/constants.d.ts.map +1 -1
- package/dist/handlers/relation/relation-handlers.d.ts.map +1 -1
- package/dist/index.js +1059 -1029
- package/dist/index.js.map +1 -1
- package/dist/{types-BsQmyhQI.js → types-BRqo2AHD.js} +11 -2
- package/dist/types-BRqo2AHD.js.map +1 -0
- package/package.json +4 -4
- package/dist/types-BsQmyhQI.js.map +0 -1
- package/dist/types-CbA9-fcJ.js +0 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { createContext, useCallback, useContext, useMemo } from "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
1
|
+
import { t as e } from "./types-BRqo2AHD.js";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useMemo as i } from "react";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
//#region ../model-api/dist/index.js
|
|
5
|
+
var o = {
|
|
5
6
|
LIST: "LIST",
|
|
6
7
|
CREATE: "CREATE",
|
|
7
8
|
SET: "SET",
|
|
@@ -16,1412 +17,1441 @@ var RelationBehaviourType = {
|
|
|
16
17
|
DELETE: "DELETE",
|
|
17
18
|
REFRESH: "REFRESH",
|
|
18
19
|
EXPORT: "EXPORT"
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
o.closeDialog();
|
|
20
|
+
}, s = Symbol.for("@judo/ACTION_HANDLER_FACTORY"), c = ((e) => async (e) => {
|
|
21
|
+
if (e.closeDialog) {
|
|
22
|
+
e.closeDialog();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
e.navigation.goBack();
|
|
26
26
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
let
|
|
30
|
-
if (!
|
|
31
|
-
if (!
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
transfer:
|
|
35
|
-
...
|
|
27
|
+
c.actionType = "BackActionDefinition";
|
|
28
|
+
var l = ((e) => async (t) => {
|
|
29
|
+
let n = e.targetPageDefinition;
|
|
30
|
+
if (!n) throw Error("No target page defined for OpenPageAction");
|
|
31
|
+
if (!t.navigation) throw Error("Navigation context is undefined");
|
|
32
|
+
let r = t;
|
|
33
|
+
t.navigation.navigateTo(n, {
|
|
34
|
+
transfer: t.transfer,
|
|
35
|
+
...t.isEager && {
|
|
36
36
|
isEager: !0,
|
|
37
|
-
parentTransferId:
|
|
38
|
-
relationName:
|
|
37
|
+
parentTransferId: r.parentTransferId,
|
|
38
|
+
relationName: r.relationName
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
if (!
|
|
46
|
-
if (!
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
transfer:
|
|
50
|
-
...
|
|
42
|
+
l.actionType = "OpenPageActionDefinition";
|
|
43
|
+
var u = ((e) => async (t) => {
|
|
44
|
+
let n = e.targetPageDefinition;
|
|
45
|
+
if (!n) throw Error("No target page defined for RowOpenPageAction");
|
|
46
|
+
if (!t.navigation) throw Error("Navigation context is undefined");
|
|
47
|
+
let r = t;
|
|
48
|
+
t.navigation.navigateTo(n, {
|
|
49
|
+
transfer: t.transfer,
|
|
50
|
+
...t.isEager && {
|
|
51
51
|
isEager: !0,
|
|
52
|
-
parentTransferId:
|
|
53
|
-
relationName:
|
|
52
|
+
parentTransferId: r.parentTransferId,
|
|
53
|
+
relationName: r.relationName
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
57
|
+
u.actionType = "RowOpenPageActionDefinition";
|
|
58
|
+
var d = ((e) => async (e) => {
|
|
59
|
+
if (e.closeDialog) {
|
|
60
|
+
e.closeDialog();
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
if (
|
|
64
|
-
|
|
63
|
+
if (e.pageType === "VIEW" && e.isEditMode && e.data && e.transfer?.__identifier) {
|
|
64
|
+
e.data.resetTransfer(e.transfer.__identifier);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
e.navigation.goBack();
|
|
68
68
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
d.actionType = "CancelActionDefinition";
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/handlers/form/form-handlers.ts
|
|
72
|
+
var f = ((e) => async (t) => {
|
|
73
|
+
let n = e.targetPageDefinition;
|
|
74
|
+
if (!n) throw Error("No target page defined for OpenFormAction");
|
|
75
|
+
t.navigation.openDialog(n, { transfer: t.transfer });
|
|
74
76
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
let
|
|
78
|
-
if (!
|
|
79
|
-
let
|
|
80
|
-
|
|
77
|
+
f.actionType = "OpenFormActionDefinition";
|
|
78
|
+
var p = ((e) => async (t) => {
|
|
79
|
+
let n = e.targetPageDefinition;
|
|
80
|
+
if (!n) throw Error("No target page defined for OpenCreateFormAction");
|
|
81
|
+
let r = e.ownerDataElement, i = t.isEager === !0, a = t.transfer, o = t;
|
|
82
|
+
t.navigation.openDialog(n, {
|
|
81
83
|
isCreate: !0,
|
|
82
|
-
isEager:
|
|
83
|
-
relation:
|
|
84
|
-
ownerTransfer:
|
|
85
|
-
...
|
|
86
|
-
parentTransferId:
|
|
87
|
-
relationName:
|
|
88
|
-
onSubmitCreate: async (
|
|
84
|
+
isEager: i,
|
|
85
|
+
relation: r,
|
|
86
|
+
ownerTransfer: a,
|
|
87
|
+
...i && {
|
|
88
|
+
parentTransferId: o.parentTransferId,
|
|
89
|
+
relationName: o.relationName,
|
|
90
|
+
onSubmitCreate: async (e) => e
|
|
89
91
|
}
|
|
90
|
-
},
|
|
92
|
+
}, o.onDialogClose);
|
|
91
93
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
let
|
|
95
|
-
if (!
|
|
96
|
-
|
|
97
|
-
transfer:
|
|
98
|
-
operation:
|
|
94
|
+
p.actionType = "OpenCreateFormActionDefinition";
|
|
95
|
+
var m = ((e) => async (t) => {
|
|
96
|
+
let n = e.targetPageDefinition;
|
|
97
|
+
if (!n) throw Error("No target page defined for OpenOperationInputFormAction");
|
|
98
|
+
t.navigation.openDialog(n, {
|
|
99
|
+
transfer: t.transfer,
|
|
100
|
+
operation: e.actionDefinition.formFor?.operation,
|
|
99
101
|
isOperationInput: !0
|
|
100
102
|
});
|
|
101
103
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
m.actionType = "OpenOperationInputFormActionDefinition";
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/handlers/selector/selector-handlers.ts
|
|
107
|
+
function h(e, t) {
|
|
108
|
+
if (e.relation) return e.relation;
|
|
109
|
+
let n = t.ownerDataElement;
|
|
110
|
+
return n && n["@type"] === "RelationType" ? n : null;
|
|
107
111
|
}
|
|
108
|
-
|
|
109
|
-
let
|
|
110
|
-
if (!
|
|
111
|
-
|
|
112
|
-
ownerTransfer:
|
|
112
|
+
var g = ((e) => async (t) => {
|
|
113
|
+
let n = e.targetPageDefinition;
|
|
114
|
+
if (!n) throw Error("No target page defined for OpenSelectorAction");
|
|
115
|
+
t.navigation?.openDialog(n, {
|
|
116
|
+
ownerTransfer: t.transfer,
|
|
113
117
|
isSelector: !0,
|
|
114
118
|
selectionMode: "single"
|
|
115
|
-
},
|
|
119
|
+
}, t.onDialogClose);
|
|
116
120
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
let
|
|
120
|
-
if (!
|
|
121
|
-
|
|
122
|
-
ownerTransfer:
|
|
121
|
+
g.actionType = "OpenSelectorActionDefinition";
|
|
122
|
+
var _ = ((e) => async (t) => {
|
|
123
|
+
let n = e.targetPageDefinition;
|
|
124
|
+
if (!n) throw Error("No target page defined for OpenAddSelectorAction");
|
|
125
|
+
t.navigation?.openDialog(n, {
|
|
126
|
+
ownerTransfer: t.transfer,
|
|
123
127
|
isSelector: !0,
|
|
124
128
|
selectionMode: "multiple",
|
|
125
129
|
operation: "add"
|
|
126
|
-
},
|
|
130
|
+
}, t.onDialogClose);
|
|
127
131
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
let
|
|
131
|
-
if (!
|
|
132
|
-
|
|
133
|
-
ownerTransfer:
|
|
132
|
+
_.actionType = "OpenAddSelectorActionDefinition";
|
|
133
|
+
var v = ((e) => async (t) => {
|
|
134
|
+
let n = e.targetPageDefinition;
|
|
135
|
+
if (!n) throw Error("No target page defined for OpenSetSelectorAction");
|
|
136
|
+
t.navigation?.openDialog(n, {
|
|
137
|
+
ownerTransfer: t.transfer,
|
|
134
138
|
isSelector: !0,
|
|
135
139
|
selectionMode: "single",
|
|
136
140
|
operation: "set"
|
|
137
|
-
},
|
|
141
|
+
}, t.onDialogClose);
|
|
138
142
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
let
|
|
142
|
-
if (!
|
|
143
|
-
let { refreshPage:
|
|
144
|
-
|
|
145
|
-
ownerTransfer:
|
|
143
|
+
v.actionType = "OpenSetSelectorActionDefinition";
|
|
144
|
+
var y = ((e) => async (t) => {
|
|
145
|
+
let n = e.targetPageDefinition;
|
|
146
|
+
if (!n) throw Error("No target page defined for OpenOperationInputSelectorAction");
|
|
147
|
+
let { refreshPage: r, isEditMode: i } = t;
|
|
148
|
+
t.navigation?.openDialog(n, {
|
|
149
|
+
ownerTransfer: t.transfer,
|
|
146
150
|
isSelector: !0,
|
|
147
151
|
isOperationInput: !0
|
|
148
|
-
}, (
|
|
149
|
-
|
|
152
|
+
}, (e) => {
|
|
153
|
+
e?.type === "submitted" && !i && r?.();
|
|
150
154
|
});
|
|
151
155
|
});
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
let
|
|
155
|
-
if (!
|
|
156
|
-
let
|
|
157
|
-
if (
|
|
158
|
-
|
|
156
|
+
y.actionType = "OpenOperationInputSelectorActionDefinition";
|
|
157
|
+
var ee = ((e) => async (t) => {
|
|
158
|
+
let n = e.actionDefinition.targetType;
|
|
159
|
+
if (!n) throw Error("No target type defined for SelectorRangeAction");
|
|
160
|
+
let r = t, { onRangeRequest: i, api: a, onRangeResult: o } = r;
|
|
161
|
+
if (i) {
|
|
162
|
+
i(n);
|
|
159
163
|
return;
|
|
160
164
|
}
|
|
161
|
-
if (
|
|
162
|
-
let
|
|
163
|
-
if (!
|
|
164
|
-
let
|
|
165
|
-
|
|
165
|
+
if (a) {
|
|
166
|
+
let t = h(r, e);
|
|
167
|
+
if (!t) throw Error("Cannot determine relation for selector range");
|
|
168
|
+
let n = await a.getRelationRange(t, r.ownerTransfer, r.queryCustomizer);
|
|
169
|
+
o?.(n.data);
|
|
166
170
|
}
|
|
167
171
|
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
ee.actionType = "SelectorRangeActionDefinition";
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/handlers/crud/crud-handlers.ts
|
|
175
|
+
function b(e) {
|
|
176
|
+
return typeof e == "object" && !!e && e.name === "ValidationError";
|
|
171
177
|
}
|
|
172
|
-
function
|
|
173
|
-
let
|
|
174
|
-
if (
|
|
175
|
-
let
|
|
176
|
-
if (!
|
|
177
|
-
let
|
|
178
|
-
if (
|
|
179
|
-
if (
|
|
178
|
+
function x(e) {
|
|
179
|
+
let t = e.actionDefinition?.targetType;
|
|
180
|
+
if (t) return t;
|
|
181
|
+
let n = e.eContainer;
|
|
182
|
+
if (!n?.dataElement) return;
|
|
183
|
+
let r = n.dataElement;
|
|
184
|
+
if (r["@type"] === "ClassType" || r["@type"] === "data:ClassType") return r;
|
|
185
|
+
if (r["@type"] === "RelationType" || r["@type"] === "data:RelationType" || r.target) return r.target;
|
|
180
186
|
}
|
|
181
|
-
function
|
|
182
|
-
let
|
|
183
|
-
|
|
184
|
-
let L = I;
|
|
185
|
-
return String(L.isAccess) === "true" && !F?.__identifier && !F?.__signedIdentifier;
|
|
187
|
+
function te(e, t) {
|
|
188
|
+
let n = e.ownerDataElement;
|
|
189
|
+
return !n || n["@type"] !== "RelationType" ? !1 : String(n.isAccess) === "true" && !t?.__identifier && !t?.__signedIdentifier;
|
|
186
190
|
}
|
|
187
|
-
function
|
|
188
|
-
let
|
|
189
|
-
|
|
190
|
-
let L = I;
|
|
191
|
-
return String(L.isAccess) !== "true" && !!F?.__signedIdentifier;
|
|
191
|
+
function ne(e, t) {
|
|
192
|
+
let n = e.ownerDataElement;
|
|
193
|
+
return !n || n["@type"] !== "RelationType" ? !1 : String(n.isAccess) !== "true" && !!t?.__signedIdentifier;
|
|
192
194
|
}
|
|
193
|
-
|
|
194
|
-
let
|
|
195
|
-
if (
|
|
196
|
-
let
|
|
197
|
-
|
|
195
|
+
var S = ((e) => async (t) => {
|
|
196
|
+
let n = t.transfer, r = t, { api: i, pageTransferId: a, rowsPerPage: o } = r, s = e.queryCustomizer, c = e.countRecords;
|
|
197
|
+
if (te(e, n)) {
|
|
198
|
+
let n = e.ownerDataElement, l = a ?? `table::${e["xmi:id"]}`;
|
|
199
|
+
t.data?.setTransferLoading(l, !0);
|
|
198
200
|
try {
|
|
199
|
-
let { onListRelation:
|
|
200
|
-
if (
|
|
201
|
-
else if (
|
|
202
|
-
let
|
|
203
|
-
_seek: { limit:
|
|
204
|
-
...
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
let
|
|
208
|
-
|
|
201
|
+
let { onListRelation: e } = r, a;
|
|
202
|
+
if (e) a = await e(n);
|
|
203
|
+
else if (i) {
|
|
204
|
+
let e = await i.listRelation(n, void 0, {
|
|
205
|
+
_seek: { limit: o ?? 10 },
|
|
206
|
+
...s
|
|
207
|
+
}, c);
|
|
208
|
+
a = e.data;
|
|
209
|
+
let r = e.headers.get("x-judo-count"), u = r ? Number.parseInt(r, 10) : void 0, d = { __items: a };
|
|
210
|
+
u !== void 0 && !Number.isNaN(u) && (d.__totalCount = u), t.data?.setTransferData(l, d);
|
|
209
211
|
} else throw Error("API not available in context");
|
|
210
|
-
} catch (
|
|
211
|
-
throw
|
|
212
|
+
} catch (e) {
|
|
213
|
+
throw t.data?.setTransferError(l, e), e;
|
|
212
214
|
} finally {
|
|
213
|
-
|
|
215
|
+
t.data?.setTransferLoading(l, !1);
|
|
214
216
|
}
|
|
215
217
|
return;
|
|
216
218
|
}
|
|
217
|
-
if (
|
|
218
|
-
let
|
|
219
|
-
|
|
219
|
+
if (ne(e, n)) {
|
|
220
|
+
let r = e.ownerDataElement, l = a ?? `table::${e["xmi:id"]}`;
|
|
221
|
+
t.data?.setTransferLoading(l, !0);
|
|
220
222
|
try {
|
|
221
|
-
if (
|
|
222
|
-
let
|
|
223
|
-
_seek: { limit:
|
|
224
|
-
...
|
|
225
|
-
},
|
|
226
|
-
|
|
223
|
+
if (i) {
|
|
224
|
+
let e = await i.listRelation(r, n, {
|
|
225
|
+
_seek: { limit: o ?? 10 },
|
|
226
|
+
...s
|
|
227
|
+
}, c), a = e.data, u = e.headers.get("x-judo-count"), d = u ? Number.parseInt(u, 10) : void 0, f = { __items: a };
|
|
228
|
+
d !== void 0 && !Number.isNaN(d) && (f.__totalCount = d), t.data?.setTransferData(l, f);
|
|
227
229
|
} else throw Error("API not available in context");
|
|
228
|
-
} catch (
|
|
229
|
-
throw
|
|
230
|
+
} catch (e) {
|
|
231
|
+
throw t.data?.setTransferError(l, e), e;
|
|
230
232
|
} finally {
|
|
231
|
-
|
|
233
|
+
t.data?.setTransferLoading(l, !1);
|
|
232
234
|
}
|
|
233
235
|
return;
|
|
234
236
|
}
|
|
235
|
-
if (
|
|
236
|
-
let
|
|
237
|
-
if (
|
|
238
|
-
let
|
|
239
|
-
|
|
237
|
+
if (r.isSelector) {
|
|
238
|
+
let n = e.ownerDataElement;
|
|
239
|
+
if (n && n["@type"] === "RelationType") {
|
|
240
|
+
let l = n, u = a ?? `table::${e["xmi:id"]}`;
|
|
241
|
+
t.data?.setTransferLoading(u, !0);
|
|
240
242
|
try {
|
|
241
|
-
if (
|
|
242
|
-
let
|
|
243
|
-
_seek: { limit:
|
|
244
|
-
...
|
|
245
|
-
},
|
|
246
|
-
|
|
243
|
+
if (i) {
|
|
244
|
+
let e = await i.getRelationRange(l, r.ownerTransfer?.__signedIdentifier ? { __signedIdentifier: r.ownerTransfer.__signedIdentifier } : void 0, {
|
|
245
|
+
_seek: { limit: o ?? 10 },
|
|
246
|
+
...s
|
|
247
|
+
}, c), n = e.data, a = e.headers.get("x-judo-count"), d = a ? Number.parseInt(a, 10) : void 0, f = { __items: n };
|
|
248
|
+
d !== void 0 && !Number.isNaN(d) && (f.__totalCount = d), t.data?.setTransferData(u, f);
|
|
247
249
|
} else throw Error("API not available in context");
|
|
248
|
-
} catch (
|
|
249
|
-
throw
|
|
250
|
+
} catch (e) {
|
|
251
|
+
throw t.data?.setTransferError(u, e), e;
|
|
250
252
|
} finally {
|
|
251
|
-
|
|
253
|
+
t.data?.setTransferLoading(u, !1);
|
|
252
254
|
}
|
|
253
255
|
return;
|
|
254
256
|
}
|
|
255
|
-
if (
|
|
256
|
-
let
|
|
257
|
-
if (!
|
|
258
|
-
let
|
|
259
|
-
|
|
257
|
+
if (n && n["@type"] === "OperationType") {
|
|
258
|
+
let l = n, u = n.eContainer;
|
|
259
|
+
if (!u) throw Error("Cannot determine owning ClassType for operation input selector (OperationType.eContainer is missing)");
|
|
260
|
+
let d = a ?? `table::${e["xmi:id"]}`;
|
|
261
|
+
t.data?.setTransferLoading(d, !0);
|
|
260
262
|
try {
|
|
261
|
-
if (
|
|
262
|
-
let
|
|
263
|
-
_seek: { limit:
|
|
264
|
-
...
|
|
265
|
-
},
|
|
266
|
-
|
|
263
|
+
if (i) {
|
|
264
|
+
let e = await i.getOperationInputRange(u, l, r.ownerTransfer?.__signedIdentifier ? { __signedIdentifier: r.ownerTransfer.__signedIdentifier } : void 0, {
|
|
265
|
+
_seek: { limit: o ?? 10 },
|
|
266
|
+
...s
|
|
267
|
+
}, c), n = e.data, a = e.headers.get("x-judo-count"), f = a ? Number.parseInt(a, 10) : void 0, p = { __items: n };
|
|
268
|
+
f !== void 0 && !Number.isNaN(f) && (p.__totalCount = f), t.data?.setTransferData(d, p);
|
|
267
269
|
} else throw Error("API not available in context");
|
|
268
|
-
} catch (
|
|
269
|
-
throw
|
|
270
|
+
} catch (e) {
|
|
271
|
+
throw t.data?.setTransferError(d, e), e;
|
|
270
272
|
} finally {
|
|
271
|
-
|
|
273
|
+
t.data?.setTransferLoading(d, !1);
|
|
272
274
|
}
|
|
273
275
|
return;
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
|
-
let
|
|
277
|
-
if (
|
|
278
|
-
if (
|
|
279
|
-
let
|
|
280
|
-
if (
|
|
281
|
-
let
|
|
282
|
-
if (
|
|
283
|
-
let
|
|
284
|
-
if (Array.isArray(
|
|
285
|
-
let
|
|
286
|
-
if (
|
|
287
|
-
let
|
|
288
|
-
return !!(
|
|
278
|
+
let l = n?.__identifier ?? n?.__signedIdentifier;
|
|
279
|
+
if (l) {
|
|
280
|
+
if (t.isEager) {
|
|
281
|
+
let e = t;
|
|
282
|
+
if (e.parentTransferId && e.relationName && t.data) {
|
|
283
|
+
let r = t.data.getSnapshot((t) => t.transfers.get(e.parentTransferId)?.data);
|
|
284
|
+
if (r) {
|
|
285
|
+
let i = r[e.relationName];
|
|
286
|
+
if (Array.isArray(i)) {
|
|
287
|
+
let e = i.find((e) => {
|
|
288
|
+
if (n.__signedIdentifier && e.__signedIdentifier === n.__signedIdentifier || n.__identifier && e.__identifier === n.__identifier) return !0;
|
|
289
|
+
let t = e.__tempId, r = n?.__tempId;
|
|
290
|
+
return !!(t && r && t === r);
|
|
289
291
|
});
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
+
if (e) {
|
|
293
|
+
t.data.setTransferData(l, e);
|
|
292
294
|
return;
|
|
293
295
|
}
|
|
294
|
-
} else if (
|
|
295
|
-
|
|
296
|
+
} else if (i && typeof i == "object") {
|
|
297
|
+
t.data.setTransferData(l, i);
|
|
296
298
|
return;
|
|
297
299
|
}
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
|
-
|
|
302
|
+
t.data?.setTransferData(l, n);
|
|
301
303
|
return;
|
|
302
304
|
}
|
|
303
|
-
|
|
305
|
+
t.data?.setTransferLoading(l, !0);
|
|
304
306
|
try {
|
|
305
|
-
let
|
|
306
|
-
if (!
|
|
307
|
-
let { onRefresh:
|
|
308
|
-
if (
|
|
309
|
-
else if (
|
|
307
|
+
let a = x(e);
|
|
308
|
+
if (!a) throw Error("No target type for refresh");
|
|
309
|
+
let { onRefresh: o } = r, c;
|
|
310
|
+
if (o) c = await o(l, a);
|
|
311
|
+
else if (i) c = (await i.refresh(a, n, s)).data;
|
|
310
312
|
else throw Error("API not available in context");
|
|
311
|
-
|
|
312
|
-
} catch (
|
|
313
|
-
throw
|
|
313
|
+
t.data?.setTransferData(l, c);
|
|
314
|
+
} catch (e) {
|
|
315
|
+
throw t.data?.setTransferError(l, e), e;
|
|
314
316
|
} finally {
|
|
315
|
-
|
|
317
|
+
t.data?.setTransferLoading(l, !1);
|
|
316
318
|
}
|
|
317
319
|
}
|
|
318
320
|
});
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
let
|
|
322
|
-
if (!
|
|
323
|
-
let
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
if (!
|
|
327
|
-
let { isEager:
|
|
328
|
-
if (!
|
|
329
|
-
if (
|
|
330
|
-
if (
|
|
331
|
-
}
|
|
332
|
-
let
|
|
333
|
-
|
|
321
|
+
S.actionType = "RefreshActionDefinition";
|
|
322
|
+
var re = ((e) => async (t) => {
|
|
323
|
+
let n = t.transfer;
|
|
324
|
+
if (!n && t.data) {
|
|
325
|
+
let e = t.pageTransferId;
|
|
326
|
+
e && (n = t.data.getSnapshot((t) => t.transfers.get(e)?.data));
|
|
327
|
+
}
|
|
328
|
+
if (!n) throw Error("No transfer data to create");
|
|
329
|
+
let { isEager: r, pageType: i, isEditMode: a, isPageAction: s, validation: c, createDialog: l } = t;
|
|
330
|
+
if (!r && !s) {
|
|
331
|
+
if (i === "FORM") throw Error("Create operation is not allowed on FORM pages. Save the form first.");
|
|
332
|
+
if (i === "VIEW" && a) throw Error("Create operation is not allowed while the view has unsaved changes. Save or cancel changes first.");
|
|
333
|
+
}
|
|
334
|
+
let u = t.pageTransferId ?? n.__identifier ?? "new";
|
|
335
|
+
t.data?.setTransferLoading(u, !0), c?.clearErrors();
|
|
334
336
|
try {
|
|
335
|
-
let { onCreate:
|
|
336
|
-
|
|
337
|
-
let
|
|
338
|
-
if (!
|
|
339
|
-
let
|
|
340
|
-
if (
|
|
341
|
-
await
|
|
342
|
-
} catch (
|
|
343
|
-
if (
|
|
344
|
-
let
|
|
345
|
-
throw
|
|
337
|
+
let { onCreate: i, onValidateCreate: a, api: s, relationMetadata: u, ownerTransfer: d, parentTransferId: f } = t, p;
|
|
338
|
+
e.ownerDataElement?.["@type"] === "RelationType" && (p = e.ownerDataElement), p ||= l?.relation, !p && u && ("relation" in u && u.relation ? p = u.relation : "name" in u && u.name && (p = u));
|
|
339
|
+
let m = p?.target ?? e.actionDefinition.targetType;
|
|
340
|
+
if (!m) throw Error("No target type for create");
|
|
341
|
+
let h = l?.ownerTransfer ?? d, g, _ = p?.behaviours?.includes(o.VALIDATE_CREATE);
|
|
342
|
+
if (r && _ && s) try {
|
|
343
|
+
await s.validateCreateRelation(p, h, n);
|
|
344
|
+
} catch (e) {
|
|
345
|
+
if (b(e)) {
|
|
346
|
+
let t = e.toFieldErrors();
|
|
347
|
+
throw c && Object.keys(t).length > 0 && c.setErrors(t), e;
|
|
346
348
|
}
|
|
347
|
-
throw
|
|
349
|
+
throw e;
|
|
348
350
|
}
|
|
349
|
-
else if (
|
|
350
|
-
let
|
|
351
|
-
if (
|
|
351
|
+
else if (r && _ && a && p) {
|
|
352
|
+
let e = await a(n, p, h);
|
|
353
|
+
if (e && Object.keys(e).length > 0) throw c?.setErrors(e), Error("Validation failed");
|
|
352
354
|
}
|
|
353
|
-
if (
|
|
354
|
-
let
|
|
355
|
-
|
|
356
|
-
...
|
|
357
|
-
__tempId:
|
|
355
|
+
if (r) {
|
|
356
|
+
let e = `temp::${Date.now()}::${Math.random().toString(36).substring(2, 9)}`;
|
|
357
|
+
g = {
|
|
358
|
+
...n,
|
|
359
|
+
__tempId: e,
|
|
358
360
|
__isNew: !0
|
|
359
361
|
};
|
|
360
|
-
let
|
|
361
|
-
if (
|
|
362
|
-
let
|
|
363
|
-
if (
|
|
364
|
-
let
|
|
365
|
-
Array.isArray(
|
|
362
|
+
let r = l?.parentTransferId ?? f, i = l?.relationName;
|
|
363
|
+
if (r && t.data) {
|
|
364
|
+
let e = t.data.getSnapshot((e) => e.transfers.get(r)?.data);
|
|
365
|
+
if (i) {
|
|
366
|
+
let n = e?.[i];
|
|
367
|
+
Array.isArray(n) ? t.data.updateTransferFields(r, { [i]: [...n, g] }) : t.data.updateTransferFields(r, { [i]: g });
|
|
366
368
|
} else {
|
|
367
|
-
let
|
|
368
|
-
|
|
369
|
+
let n = [...e?.__items ?? [], g];
|
|
370
|
+
t.data.updateTransferFields(r, { __items: n });
|
|
369
371
|
}
|
|
370
372
|
}
|
|
371
|
-
|
|
372
|
-
} else if (
|
|
373
|
-
else if (
|
|
374
|
-
|
|
375
|
-
} catch (
|
|
376
|
-
if (
|
|
377
|
-
let
|
|
378
|
-
throw
|
|
373
|
+
l?.onSubmitCreate && await l.onSubmitCreate(g);
|
|
374
|
+
} else if (i) g = await i(n, m);
|
|
375
|
+
else if (s && p) try {
|
|
376
|
+
g = (await s.createRelation(p, h, n)).data;
|
|
377
|
+
} catch (e) {
|
|
378
|
+
if (b(e)) {
|
|
379
|
+
let t = e.toFieldErrors();
|
|
380
|
+
throw c && Object.keys(t).length > 0 && c.setErrors(t), e;
|
|
379
381
|
}
|
|
380
|
-
throw
|
|
382
|
+
throw e;
|
|
381
383
|
}
|
|
382
|
-
else if (!
|
|
384
|
+
else if (!i && !s) return;
|
|
383
385
|
else throw Error("Create requires relation context. Provide relation in createDialog or relationMetadata in additionalContext.");
|
|
384
|
-
|
|
386
|
+
t.closeDialog && t.closeDialog({
|
|
385
387
|
type: "created",
|
|
386
|
-
isEager:
|
|
388
|
+
isEager: r ?? !1
|
|
387
389
|
});
|
|
388
|
-
let
|
|
389
|
-
|
|
390
|
-
} catch (
|
|
391
|
-
throw
|
|
390
|
+
let v = e.actionDefinition.autoOpenAfterCreate !== !1, y = e.targetPageDefinition;
|
|
391
|
+
v && y && t.navigation && !r && t.navigation.replacePage(y, { transfer: g });
|
|
392
|
+
} catch (e) {
|
|
393
|
+
throw b(e) || t.data?.setTransferError(u, e), e;
|
|
392
394
|
} finally {
|
|
393
|
-
|
|
395
|
+
t.data?.setTransferLoading(u, !1);
|
|
394
396
|
}
|
|
395
397
|
});
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
if (!
|
|
400
|
-
let
|
|
401
|
-
|
|
398
|
+
re.actionType = "CreateActionDefinition";
|
|
399
|
+
var ie = ((e) => async (t) => {
|
|
400
|
+
let n = t.transfer, r = n?.__identifier ?? n?.__signedIdentifier;
|
|
401
|
+
if (!r) throw Error("No transfer to update (missing identifier)");
|
|
402
|
+
let i = t.pageTransferId ?? r, a;
|
|
403
|
+
t.data && (a = t.data.getSnapshot((e) => e.transfers.get(i)?.data)), a ||= n, t.data?.setTransferLoading(i, !0);
|
|
402
404
|
try {
|
|
403
|
-
let { isEager:
|
|
404
|
-
if (
|
|
405
|
-
let { parentTransferId:
|
|
406
|
-
if (
|
|
407
|
-
let
|
|
408
|
-
if (
|
|
409
|
-
let
|
|
410
|
-
if (Array.isArray(
|
|
411
|
-
let
|
|
412
|
-
let
|
|
413
|
-
return
|
|
405
|
+
let { isEager: n } = t, r = t;
|
|
406
|
+
if (n) {
|
|
407
|
+
let { parentTransferId: e, relationName: n } = r;
|
|
408
|
+
if (e && n && t.data) {
|
|
409
|
+
let r = t.data.getSnapshot((t) => t.transfers.get(e)?.data);
|
|
410
|
+
if (r) {
|
|
411
|
+
let i = r[n];
|
|
412
|
+
if (Array.isArray(i)) {
|
|
413
|
+
let r = i.map((e) => {
|
|
414
|
+
let t = e.__tempId, n = a.__tempId;
|
|
415
|
+
return t && n && t === n || e.__identifier && e.__identifier === a.__identifier || e.__signedIdentifier && e.__signedIdentifier === a.__signedIdentifier ? { ...a } : e;
|
|
414
416
|
});
|
|
415
|
-
|
|
416
|
-
} else
|
|
417
|
+
t.data.updateTransferFields(e, { [n]: r });
|
|
418
|
+
} else t.data.updateTransferFields(e, { [n]: { ...a } });
|
|
417
419
|
}
|
|
418
420
|
}
|
|
419
|
-
|
|
421
|
+
t.data?.setTransferData(i, a), t.navigation?.goBack();
|
|
420
422
|
return;
|
|
421
423
|
}
|
|
422
|
-
let
|
|
423
|
-
if (!
|
|
424
|
-
let { onUpdate:
|
|
425
|
-
if (
|
|
426
|
-
else if (
|
|
424
|
+
let o = x(e);
|
|
425
|
+
if (!o) throw Error("No target type for update");
|
|
426
|
+
let { onUpdate: s, api: c } = t, l;
|
|
427
|
+
if (s) l = await s(a, o);
|
|
428
|
+
else if (c) l = (await c.update(o, a)).data, l = (await c.refresh(o, l)).data;
|
|
427
429
|
else return;
|
|
428
|
-
|
|
429
|
-
} catch (
|
|
430
|
-
throw
|
|
430
|
+
t.data?.setTransferData(i, l);
|
|
431
|
+
} catch (e) {
|
|
432
|
+
throw t.data?.setTransferError(i, e), e;
|
|
431
433
|
} finally {
|
|
432
|
-
|
|
434
|
+
t.data?.setTransferLoading(i, !1);
|
|
433
435
|
}
|
|
434
436
|
});
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
let
|
|
438
|
-
if (!
|
|
439
|
-
|
|
437
|
+
ie.actionType = "UpdateActionDefinition";
|
|
438
|
+
var ae = ((e) => async (t) => {
|
|
439
|
+
let n = t.transfer, r = n?.__identifier ?? n?.__signedIdentifier;
|
|
440
|
+
if (!r) throw Error("No transfer to delete (missing identifier)");
|
|
441
|
+
t.data?.setTransferLoading(r, !0);
|
|
440
442
|
try {
|
|
441
|
-
let
|
|
442
|
-
if (!
|
|
443
|
-
let { onDelete:
|
|
444
|
-
if (
|
|
445
|
-
else if (
|
|
443
|
+
let i = x(e);
|
|
444
|
+
if (!i) throw Error("No target type for delete");
|
|
445
|
+
let { onDelete: a, api: o } = t;
|
|
446
|
+
if (a) await a(r, i);
|
|
447
|
+
else if (o) await o.delete(i, n);
|
|
446
448
|
else return;
|
|
447
|
-
|
|
448
|
-
} catch (
|
|
449
|
-
throw
|
|
449
|
+
t.data?.clearTransfer(r), t.navigation?.goBack();
|
|
450
|
+
} catch (e) {
|
|
451
|
+
throw t.data?.setTransferError(r, e), e;
|
|
450
452
|
}
|
|
451
453
|
});
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
let
|
|
455
|
-
if (!
|
|
456
|
-
let
|
|
457
|
-
if (!
|
|
458
|
-
let { onBulkDelete:
|
|
459
|
-
if (
|
|
460
|
-
else if (
|
|
461
|
-
let
|
|
462
|
-
await Promise.all(
|
|
454
|
+
ae.actionType = "DeleteActionDefinition";
|
|
455
|
+
var oe = ((e) => async (t) => {
|
|
456
|
+
let n = t.selectedRows;
|
|
457
|
+
if (!n || n.length === 0) return;
|
|
458
|
+
let r = e.actionDefinition.targetType;
|
|
459
|
+
if (!r) throw Error("No target type for bulk delete");
|
|
460
|
+
let { onBulkDelete: i, api: a } = t, o = n.map((e) => e.__identifier ?? e.__signedIdentifier).filter(Boolean);
|
|
461
|
+
if (i) await i(o, r);
|
|
462
|
+
else if (a) {
|
|
463
|
+
let e = n.filter((e) => e.__signedIdentifier).map((e) => a.delete(r, e));
|
|
464
|
+
await Promise.all(e);
|
|
463
465
|
} else return;
|
|
464
|
-
for (let
|
|
466
|
+
for (let e of o) t.data?.clearTransfer(e);
|
|
465
467
|
});
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
470
|
-
let
|
|
471
|
-
if (
|
|
472
|
-
let
|
|
473
|
-
if (Array.isArray(
|
|
474
|
-
let
|
|
475
|
-
|
|
476
|
-
} else
|
|
468
|
+
oe.actionType = "BulkDeleteActionDefinition";
|
|
469
|
+
var se = ((e) => async (t) => {
|
|
470
|
+
let n = t.transfer, r = n?.__identifier ?? n?.__signedIdentifier, { isEager: i, parentTransferId: a, relationName: o } = t;
|
|
471
|
+
if (i && a && t.data) {
|
|
472
|
+
let e = t.data.getSnapshot((e) => e.transfers.get(a)?.data);
|
|
473
|
+
if (o) {
|
|
474
|
+
let i = e?.[o];
|
|
475
|
+
if (Array.isArray(i)) {
|
|
476
|
+
let e = i.filter((e) => (e.__identifier ?? e.__signedIdentifier ?? e.__tempId) !== (r ?? n?.__tempId));
|
|
477
|
+
t.data.updateTransferFields(a, { [o]: e });
|
|
478
|
+
} else t.data.updateTransferFields(a, { [o]: null });
|
|
477
479
|
} else {
|
|
478
|
-
let
|
|
479
|
-
|
|
480
|
+
let i = (e?.__items ?? []).filter((e) => (e.__identifier ?? e.__signedIdentifier ?? e.__tempId) !== (r ?? n?.__tempId));
|
|
481
|
+
t.data.updateTransferFields(a, { __items: i });
|
|
480
482
|
}
|
|
481
483
|
return;
|
|
482
484
|
}
|
|
483
|
-
if (!
|
|
484
|
-
let
|
|
485
|
-
if (!
|
|
486
|
-
let { onRowDelete:
|
|
487
|
-
if (
|
|
488
|
-
else if (
|
|
485
|
+
if (!r) return;
|
|
486
|
+
let s = e.actionDefinition.targetType;
|
|
487
|
+
if (!s) throw Error("No target type for row delete");
|
|
488
|
+
let { onRowDelete: c, api: l } = t;
|
|
489
|
+
if (c) await c(r, s);
|
|
490
|
+
else if (l) await l.delete(s, n);
|
|
489
491
|
else return;
|
|
490
|
-
|
|
492
|
+
t.data?.clearTransfer(r);
|
|
491
493
|
});
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
let
|
|
495
|
-
if (!
|
|
496
|
-
let { onGetTemplate:
|
|
497
|
-
if (
|
|
498
|
-
else if (
|
|
494
|
+
se.actionType = "RowDeleteActionDefinition";
|
|
495
|
+
var ce = ((e) => async (t) => {
|
|
496
|
+
let n = e.actionDefinition.targetType;
|
|
497
|
+
if (!n) throw Error("No target type for get template");
|
|
498
|
+
let { onGetTemplate: r, api: i } = t, a;
|
|
499
|
+
if (r) a = await r(n);
|
|
500
|
+
else if (i) a = (await i.getTemplate(n)).data;
|
|
499
501
|
else throw Error("API not available in context");
|
|
500
|
-
|
|
502
|
+
t.data?.setTransferData(t.pageTransferId ?? "new", a);
|
|
501
503
|
});
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
504
|
+
ce.actionType = "GetTemplateActionDefinition";
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/handlers/relation/relation-handlers.ts
|
|
507
|
+
function C(e, t) {
|
|
508
|
+
if (e.relation) return e.relation;
|
|
509
|
+
let n = t.ownerDataElement;
|
|
510
|
+
return n && n["@type"] === "RelationType" ? n : null;
|
|
507
511
|
}
|
|
508
|
-
|
|
509
|
-
let
|
|
510
|
-
if (!
|
|
511
|
-
let
|
|
512
|
-
if (!
|
|
513
|
-
let
|
|
514
|
-
if (
|
|
515
|
-
else if (
|
|
516
|
-
let
|
|
517
|
-
if (!
|
|
518
|
-
await
|
|
519
|
-
}
|
|
520
|
-
|
|
512
|
+
var le = ((e) => async (t) => {
|
|
513
|
+
let n = t, { ownerTransfer: r, selectedEntity: i, api: a, onSet: o } = n;
|
|
514
|
+
if (!r || !i) throw Error("Missing owner or selected transfer for set");
|
|
515
|
+
let s = r.__identifier ?? r.__signedIdentifier, c = i.__identifier ?? i.__signedIdentifier;
|
|
516
|
+
if (!s || !c) throw Error("Missing transfer identifiers for set");
|
|
517
|
+
let l = e.actionDefinition.name ?? "";
|
|
518
|
+
if (o) await o(s, l, c);
|
|
519
|
+
else if (a) {
|
|
520
|
+
let t = C(n, e);
|
|
521
|
+
if (!t) throw Error("Cannot determine relation for set action");
|
|
522
|
+
await a.setRelation(t, r, i);
|
|
523
|
+
}
|
|
524
|
+
t.closeDialog?.({
|
|
521
525
|
type: "selected",
|
|
522
|
-
data:
|
|
526
|
+
data: i
|
|
523
527
|
});
|
|
524
528
|
});
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
let
|
|
528
|
-
if (!
|
|
529
|
-
let
|
|
530
|
-
if (
|
|
531
|
-
else if (
|
|
532
|
-
let
|
|
533
|
-
if (!
|
|
534
|
-
await
|
|
529
|
+
le.actionType = "SetActionDefinition";
|
|
530
|
+
var ue = ((e) => async (t) => {
|
|
531
|
+
let n = t.transfer, r = n?.__identifier ?? n?.__signedIdentifier;
|
|
532
|
+
if (!r) return;
|
|
533
|
+
let i = e.actionDefinition.name ?? "", a = t, { onUnset: o, api: s } = a;
|
|
534
|
+
if (o) await o(r, i);
|
|
535
|
+
else if (s) {
|
|
536
|
+
let t = C(a, e);
|
|
537
|
+
if (!t) throw Error("Cannot determine relation for unset action");
|
|
538
|
+
await s.unsetRelation(t, n);
|
|
535
539
|
}
|
|
536
540
|
});
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
let
|
|
540
|
-
if (!
|
|
541
|
-
let
|
|
542
|
-
if (!
|
|
543
|
-
let
|
|
544
|
-
if (
|
|
545
|
-
else if (
|
|
546
|
-
let
|
|
547
|
-
if (!
|
|
548
|
-
await
|
|
549
|
-
}
|
|
550
|
-
|
|
541
|
+
ue.actionType = "UnsetActionDefinition";
|
|
542
|
+
var de = ((e) => async (t) => {
|
|
543
|
+
let n = t, { ownerTransfer: r, selectedEntities: i, api: a, onAdd: o } = n;
|
|
544
|
+
if (!r || !i?.length) throw Error("Missing transfers for add");
|
|
545
|
+
let s = r.__identifier ?? r.__signedIdentifier;
|
|
546
|
+
if (!s) throw Error("Missing owner transfer identifier for add");
|
|
547
|
+
let c = i.map((e) => e.__identifier ?? e.__signedIdentifier).filter(Boolean), l = e.actionDefinition.name ?? "";
|
|
548
|
+
if (o) await o(s, l, c);
|
|
549
|
+
else if (a) {
|
|
550
|
+
let t = C(n, e);
|
|
551
|
+
if (!t) throw Error("Cannot determine relation for add action");
|
|
552
|
+
await a.addToRelation(t, r, i);
|
|
553
|
+
}
|
|
554
|
+
t.closeDialog?.({
|
|
551
555
|
type: "selected",
|
|
552
|
-
data:
|
|
556
|
+
data: i
|
|
553
557
|
});
|
|
554
558
|
});
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
let
|
|
558
|
-
if (
|
|
559
|
-
let
|
|
560
|
-
if (
|
|
561
|
-
let
|
|
562
|
-
|
|
559
|
+
de.actionType = "AddActionDefinition";
|
|
560
|
+
var fe = ((e) => async (t) => {
|
|
561
|
+
let n = t, r = t, i = t.transfer, a = i?.__identifier ?? i?.__signedIdentifier;
|
|
562
|
+
if (r.isEager && r.parentTransferId && t.data) {
|
|
563
|
+
let e = r.parentTransferId, n = r.relationName, o = t.data.getSnapshot((t) => t.transfers.get(e)?.data);
|
|
564
|
+
if (n) {
|
|
565
|
+
let r = (o?.[n] ?? []).filter((e) => (e.__identifier ?? e.__signedIdentifier ?? e.__tempId) !== (a ?? i?.__tempId));
|
|
566
|
+
t.data.updateTransferFields(e, { [n]: r });
|
|
563
567
|
} else {
|
|
564
|
-
let
|
|
565
|
-
|
|
568
|
+
let n = (o?.__items ?? []).filter((e) => (e.__identifier ?? e.__signedIdentifier ?? e.__tempId) !== (a ?? i?.__tempId));
|
|
569
|
+
t.data.updateTransferFields(e, { __items: n });
|
|
566
570
|
}
|
|
567
571
|
return;
|
|
568
572
|
}
|
|
569
|
-
let { ownerTransfer:
|
|
570
|
-
if (!
|
|
571
|
-
let
|
|
572
|
-
if (
|
|
573
|
-
else if (
|
|
574
|
-
let
|
|
575
|
-
if (!
|
|
576
|
-
await
|
|
573
|
+
let { ownerTransfer: o, api: s, onRemove: c } = n, l = o?.__identifier ?? o?.__signedIdentifier;
|
|
574
|
+
if (!l || !a) return;
|
|
575
|
+
let u = e.actionDefinition.name ?? "";
|
|
576
|
+
if (c) await c(l, u, [a]);
|
|
577
|
+
else if (s) {
|
|
578
|
+
let t = C(n, e);
|
|
579
|
+
if (!t) throw Error("Cannot determine relation for remove action");
|
|
580
|
+
await s.removeFromRelation(t, o, [i]);
|
|
577
581
|
}
|
|
578
582
|
});
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
let
|
|
582
|
-
if (!
|
|
583
|
-
if (
|
|
584
|
-
let
|
|
585
|
-
if (
|
|
586
|
-
let
|
|
587
|
-
|
|
583
|
+
fe.actionType = "RemoveActionDefinition";
|
|
584
|
+
var pe = ((e) => async (t) => {
|
|
585
|
+
let n = t, r = t, i = t.selectedRows;
|
|
586
|
+
if (!i?.length) return;
|
|
587
|
+
if (r.isEager && r.parentTransferId && t.data) {
|
|
588
|
+
let e = r.parentTransferId, n = r.relationName, a = new Set(i.map((e) => e.__identifier ?? e.__signedIdentifier ?? e.__tempId).filter(Boolean)), o = t.data.getSnapshot((t) => t.transfers.get(e)?.data);
|
|
589
|
+
if (n) {
|
|
590
|
+
let r = (o?.[n] ?? []).filter((e) => !a.has(e.__identifier ?? e.__signedIdentifier ?? e.__tempId));
|
|
591
|
+
t.data.updateTransferFields(e, { [n]: r });
|
|
588
592
|
} else {
|
|
589
|
-
let
|
|
590
|
-
|
|
593
|
+
let n = (o?.__items ?? []).filter((e) => !a.has(e.__identifier ?? e.__signedIdentifier ?? e.__tempId));
|
|
594
|
+
t.data.updateTransferFields(e, { __items: n });
|
|
591
595
|
}
|
|
592
596
|
return;
|
|
593
597
|
}
|
|
594
|
-
let { ownerTransfer:
|
|
595
|
-
if (!
|
|
596
|
-
let
|
|
597
|
-
if (
|
|
598
|
-
else if (
|
|
599
|
-
let
|
|
600
|
-
if (!
|
|
601
|
-
let
|
|
602
|
-
await
|
|
598
|
+
let { ownerTransfer: a, api: o, onBulkRemove: s } = n, c = a?.__identifier ?? a?.__signedIdentifier;
|
|
599
|
+
if (!c) return;
|
|
600
|
+
let l = i.map((e) => e.__identifier ?? e.__signedIdentifier).filter(Boolean), u = e.actionDefinition.name ?? "";
|
|
601
|
+
if (s) await s(c, u, l);
|
|
602
|
+
else if (o) {
|
|
603
|
+
let t = C(n, e);
|
|
604
|
+
if (!t) throw Error("Cannot determine relation for bulk remove action");
|
|
605
|
+
let r = i.filter((e) => e.__signedIdentifier);
|
|
606
|
+
await o.removeFromRelation(t, a, r);
|
|
603
607
|
}
|
|
604
608
|
});
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
let
|
|
608
|
-
if (!
|
|
609
|
-
let
|
|
610
|
-
if (
|
|
611
|
-
else if (
|
|
612
|
-
let
|
|
613
|
-
if (!
|
|
614
|
-
await
|
|
609
|
+
pe.actionType = "BulkRemoveActionDefinition";
|
|
610
|
+
var w = ((e) => async (t) => {
|
|
611
|
+
let n = t.transfer, r = n?.__identifier ?? n?.__signedIdentifier;
|
|
612
|
+
if (!r) return;
|
|
613
|
+
let i = t, { api: a, onClear: o } = i, s = e.actionDefinition.name ?? "";
|
|
614
|
+
if (o) await o(r, s);
|
|
615
|
+
else if (a) {
|
|
616
|
+
let t = C(i, e);
|
|
617
|
+
if (!t) throw Error("Cannot determine relation for clear action");
|
|
618
|
+
t.isCollection === !1 ? await a.unsetRelation(t, n) : await a.setRelation(t, n, []);
|
|
615
619
|
}
|
|
616
620
|
});
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
let
|
|
620
|
-
if (!
|
|
621
|
-
let
|
|
622
|
-
if (
|
|
623
|
-
else if (
|
|
624
|
-
let
|
|
625
|
-
if (!
|
|
626
|
-
|
|
621
|
+
w.actionType = "ClearActionDefinition";
|
|
622
|
+
var T = ((e) => async (t) => {
|
|
623
|
+
let n = t.transfer, r = n?.__identifier ?? n?.__signedIdentifier;
|
|
624
|
+
if (!r) return;
|
|
625
|
+
let i = t, { api: a, onRefreshRelation: o } = i, s = e.actionDefinition.name ?? "";
|
|
626
|
+
if (o) await o(r, s);
|
|
627
|
+
else if (a) {
|
|
628
|
+
let t = C(i, e);
|
|
629
|
+
if (!t) throw Error("Cannot determine relation for refresh action");
|
|
630
|
+
t.isCollection === !1 ? await a.getRelation(t, n) : await a.listRelation(t, n);
|
|
627
631
|
}
|
|
628
632
|
});
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
let
|
|
632
|
-
|
|
633
|
+
T.actionType = "RefreshRelationActionDefinition";
|
|
634
|
+
var E = ((e) => async (t) => {
|
|
635
|
+
let n = t;
|
|
636
|
+
n.onFilterRelation && n.onFilterRelation(e.actionDefinition.name ?? "");
|
|
633
637
|
});
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
638
|
+
E.actionType = "FilterRelationActionDefinition";
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region src/handlers/table/table-handlers.ts
|
|
641
|
+
function me(e) {
|
|
642
|
+
return e.relation ?? null;
|
|
637
643
|
}
|
|
638
|
-
|
|
639
|
-
|
|
644
|
+
var D = ((e) => async (e) => {
|
|
645
|
+
e.onFilterRequest?.();
|
|
640
646
|
});
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
let
|
|
644
|
-
if (!
|
|
645
|
-
let
|
|
646
|
-
if (
|
|
647
|
-
await
|
|
647
|
+
D.actionType = "FilterActionDefinition";
|
|
648
|
+
var O = ((e) => async (t) => {
|
|
649
|
+
let n = e.actionDefinition.targetType;
|
|
650
|
+
if (!n) throw Error("No target type for export");
|
|
651
|
+
let r = t, { onExport: i, api: a } = r;
|
|
652
|
+
if (i) {
|
|
653
|
+
await i(n);
|
|
648
654
|
return;
|
|
649
655
|
}
|
|
650
|
-
if (
|
|
651
|
-
let
|
|
652
|
-
if (!
|
|
653
|
-
let
|
|
654
|
-
|
|
656
|
+
if (a) {
|
|
657
|
+
let e = me(r);
|
|
658
|
+
if (!e) throw Error("Cannot determine relation for export action");
|
|
659
|
+
let i = (await a.exportRelation(e, t.transfer)).data, o = URL.createObjectURL(i), s = document.createElement("a");
|
|
660
|
+
s.href = o, s.download = `export_${n.simpleName ?? n.name}_${Date.now()}.csv`, s.click(), URL.revokeObjectURL(o);
|
|
655
661
|
}
|
|
656
662
|
});
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
663
|
+
O.actionType = "ExportActionDefinition";
|
|
664
|
+
var k = ((e) => async (e) => {
|
|
665
|
+
e.onInlineCreateRow?.();
|
|
660
666
|
});
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
667
|
+
k.actionType = "InlineCreateRowActionDefinition";
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region src/handlers/operation/operation-handlers.ts
|
|
670
|
+
function he(e) {
|
|
671
|
+
return typeof e == "object" && !!e && e.name === "ValidationError";
|
|
664
672
|
}
|
|
665
|
-
function
|
|
666
|
-
if (typeof
|
|
667
|
-
let
|
|
668
|
-
return
|
|
673
|
+
function ge(e, ...t) {
|
|
674
|
+
if (typeof e == "object" && e) {
|
|
675
|
+
let n = e.status;
|
|
676
|
+
return n !== void 0 && t.includes(n);
|
|
669
677
|
}
|
|
670
678
|
return !1;
|
|
671
679
|
}
|
|
672
|
-
function
|
|
673
|
-
if (
|
|
674
|
-
let
|
|
675
|
-
|
|
676
|
-
} else if (
|
|
677
|
-
else if (
|
|
680
|
+
function A(e, t, n, r) {
|
|
681
|
+
if (he(e)) {
|
|
682
|
+
let i = e.toFieldErrors();
|
|
683
|
+
r && Object.keys(i).length > 0 && r.setErrors(i), n?.error(`Validation failed for ${t}`);
|
|
684
|
+
} else if (ge(e, 401, 403)) n?.error(`Access denied: You don't have permission to execute ${t}`);
|
|
685
|
+
else if (ge(e, 404)) n?.error(`Resource not found for ${t}`);
|
|
678
686
|
else {
|
|
679
|
-
let
|
|
680
|
-
|
|
687
|
+
let r = e instanceof Error ? e.message : "Unknown error";
|
|
688
|
+
n?.error(`Operation ${t} failed: ${r}`);
|
|
681
689
|
}
|
|
682
690
|
}
|
|
683
|
-
function
|
|
684
|
-
let
|
|
685
|
-
if (!
|
|
686
|
-
let
|
|
687
|
-
transfer:
|
|
691
|
+
function j(e, t, n, r) {
|
|
692
|
+
let i = e.targetPageDefinition;
|
|
693
|
+
if (!t || !i) return;
|
|
694
|
+
let a = {
|
|
695
|
+
transfer: t,
|
|
688
696
|
isOperationOutput: !0,
|
|
689
|
-
isMappedOutput: (
|
|
697
|
+
isMappedOutput: (n.output?.behaviours ?? []).some((e) => [
|
|
690
698
|
"UPDATE",
|
|
691
699
|
"DELETE",
|
|
692
700
|
"REFRESH"
|
|
693
|
-
].includes(
|
|
701
|
+
].includes(e))
|
|
694
702
|
};
|
|
695
|
-
String(
|
|
703
|
+
String(i.openInDialog) === "true" ? r.navigation?.openDialog(i, a) : r.navigation?.navigateTo(i, a);
|
|
696
704
|
}
|
|
697
|
-
function
|
|
698
|
-
let { refreshPage:
|
|
699
|
-
|
|
705
|
+
function M(e) {
|
|
706
|
+
let { refreshPage: t } = e;
|
|
707
|
+
t?.();
|
|
700
708
|
}
|
|
701
|
-
function
|
|
709
|
+
function N(e) {
|
|
702
710
|
return {
|
|
703
|
-
name:
|
|
704
|
-
isStatic:
|
|
705
|
-
isMapped:
|
|
706
|
-
hasInput: !!
|
|
707
|
-
inputType:
|
|
711
|
+
name: e.name,
|
|
712
|
+
isStatic: e.operationType === "STATIC",
|
|
713
|
+
isMapped: e.operationType === "MAPPED",
|
|
714
|
+
hasInput: !!e.input,
|
|
715
|
+
inputType: e.input?.target
|
|
708
716
|
};
|
|
709
717
|
}
|
|
710
|
-
|
|
711
|
-
let
|
|
712
|
-
if (!
|
|
713
|
-
let { onCallOperation:
|
|
718
|
+
var P = ((e) => async (t) => {
|
|
719
|
+
let n = e.actionDefinition, r = n.operation;
|
|
720
|
+
if (!r) throw Error("No operation defined for CallOperationAction");
|
|
721
|
+
let { onCallOperation: i, api: a } = t, { notifications: o, validation: s } = t, c = t.transfer;
|
|
714
722
|
try {
|
|
715
|
-
if (
|
|
716
|
-
let
|
|
717
|
-
|
|
723
|
+
if (i) {
|
|
724
|
+
let n = await i(r, c, c);
|
|
725
|
+
o?.success(`${r.name} completed successfully`), j(e, n, r, t), M(t);
|
|
718
726
|
return;
|
|
719
727
|
}
|
|
720
|
-
if (
|
|
721
|
-
let
|
|
722
|
-
if (!
|
|
723
|
-
let
|
|
724
|
-
|
|
728
|
+
if (a) {
|
|
729
|
+
let i = n.targetType ?? r.eContainer;
|
|
730
|
+
if (!i) throw Error("No owner type for operation call");
|
|
731
|
+
let s = N(r), l = await a.invokeOperation(i, s, c, c);
|
|
732
|
+
o?.success(`${r.name} completed successfully`), j(e, l.data, r, t), M(t);
|
|
725
733
|
}
|
|
726
|
-
} catch (
|
|
727
|
-
throw
|
|
734
|
+
} catch (e) {
|
|
735
|
+
throw A(e, r.name, o, s), e;
|
|
728
736
|
}
|
|
729
737
|
});
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
let
|
|
733
|
-
if (!
|
|
734
|
-
let
|
|
735
|
-
if (!
|
|
736
|
-
let { onBulkCallOperation:
|
|
738
|
+
P.actionType = "CallOperationActionDefinition";
|
|
739
|
+
var F = ((e) => async (t) => {
|
|
740
|
+
let n = e.actionDefinition, r = n.operation;
|
|
741
|
+
if (!r) throw Error("No operation defined for BulkCallOperationAction");
|
|
742
|
+
let i = t.selectedRows;
|
|
743
|
+
if (!i || i.length === 0) return;
|
|
744
|
+
let { onBulkCallOperation: a, api: o } = t, { notifications: s, validation: c } = t;
|
|
737
745
|
try {
|
|
738
|
-
if (
|
|
739
|
-
await
|
|
746
|
+
if (a) {
|
|
747
|
+
await a(r, i), s?.success(`${r.name} completed on ${i.length} item(s)`), M(t);
|
|
740
748
|
return;
|
|
741
749
|
}
|
|
742
|
-
if (
|
|
743
|
-
let
|
|
744
|
-
if (!
|
|
745
|
-
let
|
|
746
|
-
await Promise.all(
|
|
750
|
+
if (o) {
|
|
751
|
+
let e = n.targetType ?? r.eContainer;
|
|
752
|
+
if (!e) throw Error("No owner type for bulk operation call");
|
|
753
|
+
let a = N(r), c = i.map((t) => o.invokeOperation(e, a, t, t));
|
|
754
|
+
await Promise.all(c), s?.success(`${r.name} completed on ${i.length} item(s)`), M(t);
|
|
747
755
|
}
|
|
748
|
-
} catch (
|
|
749
|
-
throw
|
|
756
|
+
} catch (e) {
|
|
757
|
+
throw A(e, r.name, s, c), e;
|
|
750
758
|
}
|
|
751
759
|
});
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
let
|
|
755
|
-
if (!
|
|
756
|
-
let
|
|
757
|
-
if (!
|
|
758
|
-
if (
|
|
759
|
-
let
|
|
760
|
-
|
|
760
|
+
F.actionType = "BulkCallOperationActionDefinition";
|
|
761
|
+
var I = ((e) => async (t) => {
|
|
762
|
+
let n = e.actionDefinition, r = n.operation;
|
|
763
|
+
if (!r) throw Error("No operation defined for InputFormCallOperationAction");
|
|
764
|
+
let i = t, { onInputFormCallOperation: a, api: o, pageTransferId: s } = i, { notifications: c, validation: l } = t, u = t.transfer, d = i.inputData;
|
|
765
|
+
if (!d && t.data && s && (d = t.data.getSnapshot((e) => e.transfers.get(s)?.data)), d) try {
|
|
766
|
+
if (a) {
|
|
767
|
+
let n = await a(r, u, d);
|
|
768
|
+
t.closeDialog?.({ type: "submitted" }), c?.success(`${r.name} completed successfully`), j(e, n, r, t), M(t);
|
|
761
769
|
return;
|
|
762
770
|
}
|
|
763
|
-
if (
|
|
764
|
-
let
|
|
765
|
-
if (!
|
|
766
|
-
let
|
|
767
|
-
|
|
771
|
+
if (o) {
|
|
772
|
+
let i = n.targetType ?? r.eContainer;
|
|
773
|
+
if (!i) throw Error("No owner type for input form operation call");
|
|
774
|
+
let a = N(r), s = await o.invokeOperation(i, a, u, d);
|
|
775
|
+
t.closeDialog?.({ type: "submitted" }), c?.success(`${r.name} completed successfully`), j(e, s.data, r, t), M(t);
|
|
768
776
|
}
|
|
769
|
-
} catch (
|
|
770
|
-
throw
|
|
777
|
+
} catch (e) {
|
|
778
|
+
throw A(e, r.name, c, l), e;
|
|
771
779
|
}
|
|
772
780
|
});
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
let
|
|
776
|
-
if (!
|
|
777
|
-
let { onInputSelectorCallOperation:
|
|
778
|
-
if (
|
|
779
|
-
if (
|
|
780
|
-
let
|
|
781
|
-
|
|
781
|
+
I.actionType = "InputFormCallOperationActionDefinition";
|
|
782
|
+
var L = ((e) => async (t) => {
|
|
783
|
+
let n = e.actionDefinition, r = n.operation;
|
|
784
|
+
if (!r) throw Error("No operation defined for InputSelectorCallOperationAction");
|
|
785
|
+
let { onInputSelectorCallOperation: i, api: a, selectedEntity: o, ownerTransfer: s } = t, { notifications: c, validation: l } = t, u = t.transfer ?? s;
|
|
786
|
+
if (o) try {
|
|
787
|
+
if (i) {
|
|
788
|
+
let n = await i(r, u, o);
|
|
789
|
+
t.closeDialog?.({ type: "submitted" }), c?.success(`${r.name} completed successfully`), j(e, n, r, t), M(t);
|
|
782
790
|
return;
|
|
783
791
|
}
|
|
784
|
-
if (
|
|
785
|
-
let
|
|
786
|
-
if (!
|
|
787
|
-
let
|
|
788
|
-
|
|
792
|
+
if (a) {
|
|
793
|
+
let i = n.targetType ?? r.eContainer;
|
|
794
|
+
if (!i) throw Error("No owner type for input selector operation call");
|
|
795
|
+
let s = N(r), l = await a.invokeOperation(i, s, u, o);
|
|
796
|
+
t.closeDialog?.({ type: "submitted" }), c?.success(`${r.name} completed successfully`), j(e, l.data, r, t), M(t);
|
|
789
797
|
}
|
|
790
|
-
} catch (
|
|
791
|
-
throw
|
|
798
|
+
} catch (e) {
|
|
799
|
+
throw A(e, r.name, c, l), e;
|
|
792
800
|
}
|
|
793
801
|
});
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
let
|
|
797
|
-
if (!
|
|
798
|
-
let { onParameterlessCallOperation:
|
|
802
|
+
L.actionType = "InputSelectorCallOperationActionDefinition";
|
|
803
|
+
var R = ((e) => async (t) => {
|
|
804
|
+
let n = e.actionDefinition, r = n.operation;
|
|
805
|
+
if (!r) throw Error("No operation defined for ParameterlessCallOperationAction");
|
|
806
|
+
let { onParameterlessCallOperation: i, api: a } = t, { notifications: o, validation: s } = t, c = t.transfer;
|
|
799
807
|
try {
|
|
800
|
-
if (
|
|
801
|
-
let
|
|
802
|
-
|
|
808
|
+
if (i) {
|
|
809
|
+
let n = await i(r, c);
|
|
810
|
+
o?.success(`${r.name} completed successfully`), j(e, n, r, t), M(t);
|
|
803
811
|
return;
|
|
804
812
|
}
|
|
805
|
-
if (
|
|
806
|
-
let
|
|
807
|
-
if (!
|
|
808
|
-
let
|
|
809
|
-
|
|
813
|
+
if (a) {
|
|
814
|
+
let i = n.targetType ?? r.eContainer;
|
|
815
|
+
if (!i) throw Error("No owner type for parameterless operation call");
|
|
816
|
+
let s = N(r), l = await a.invokeOperation(i, s, c, void 0);
|
|
817
|
+
o?.success(`${r.name} completed successfully`), j(e, l.data, r, t), M(t);
|
|
810
818
|
}
|
|
811
|
-
} catch (
|
|
812
|
-
throw
|
|
819
|
+
} catch (e) {
|
|
820
|
+
throw A(e, r.name, o, s), e;
|
|
813
821
|
}
|
|
814
822
|
});
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
823
|
+
R.actionType = "ParameterlessCallOperationActionDefinition";
|
|
824
|
+
//#endregion
|
|
825
|
+
//#region src/handlers/autocomplete/autocomplete-handlers.ts
|
|
826
|
+
function z(e, t) {
|
|
827
|
+
if (e.relation) return e.relation;
|
|
828
|
+
let n = t.ownerDataElement;
|
|
829
|
+
return n && n["@type"] === "RelationType" ? n : null;
|
|
820
830
|
}
|
|
821
|
-
|
|
822
|
-
let
|
|
823
|
-
if (!
|
|
824
|
-
let
|
|
825
|
-
if (
|
|
826
|
-
let
|
|
827
|
-
|
|
831
|
+
var B = ((e) => async (t) => {
|
|
832
|
+
let n = e.actionDefinition.targetType;
|
|
833
|
+
if (!n) throw Error("No target type for autocomplete range");
|
|
834
|
+
let r = t, { onAutocompleteRange: i, api: a, onRangeResult: o } = r, s = r.searchText ?? "";
|
|
835
|
+
if (i) {
|
|
836
|
+
let e = await i(n, s);
|
|
837
|
+
o?.(e);
|
|
828
838
|
return;
|
|
829
839
|
}
|
|
830
|
-
if (
|
|
831
|
-
let
|
|
832
|
-
if (!
|
|
833
|
-
let
|
|
834
|
-
|
|
840
|
+
if (a) {
|
|
841
|
+
let t = z(r, e);
|
|
842
|
+
if (!t) throw Error("Cannot determine relation for autocomplete range");
|
|
843
|
+
let n = await a.getRelationRange(t, r.ownerTransfer, s ? { _filter: { contains: s } } : void 0);
|
|
844
|
+
o?.(n.data);
|
|
835
845
|
}
|
|
836
846
|
});
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
let
|
|
840
|
-
if (!
|
|
841
|
-
let
|
|
842
|
-
if (
|
|
843
|
-
await
|
|
847
|
+
B.actionType = "AutocompleteRangeActionDefinition";
|
|
848
|
+
var V = ((e) => async (t) => {
|
|
849
|
+
let n = t, { ownerTransfer: r, selectedEntity: i, api: a, onAutocompleteSet: o } = n, s = r?.__identifier ?? r?.__signedIdentifier, c = i?.__identifier ?? i?.__signedIdentifier;
|
|
850
|
+
if (!s || !c) return;
|
|
851
|
+
let l = e.actionDefinition.name ?? "";
|
|
852
|
+
if (o) {
|
|
853
|
+
await o(s, l, c);
|
|
844
854
|
return;
|
|
845
855
|
}
|
|
846
|
-
if (
|
|
847
|
-
let
|
|
848
|
-
if (!
|
|
849
|
-
await
|
|
856
|
+
if (a) {
|
|
857
|
+
let t = z(n, e);
|
|
858
|
+
if (!t) throw Error("Cannot determine relation for autocomplete set");
|
|
859
|
+
await a.setRelation(t, r, i);
|
|
850
860
|
}
|
|
851
861
|
});
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
let
|
|
855
|
-
if (!
|
|
856
|
-
let
|
|
857
|
-
if (
|
|
858
|
-
await
|
|
862
|
+
V.actionType = "AutocompleteSetActionDefinition";
|
|
863
|
+
var _e = ((e) => async (t) => {
|
|
864
|
+
let n = t, { ownerTransfer: r, selectedEntities: i, api: a, onAutocompleteAdd: o } = n, s = r?.__identifier ?? r?.__signedIdentifier;
|
|
865
|
+
if (!s || !i?.length) return;
|
|
866
|
+
let c = i.map((e) => e.__identifier ?? e.__signedIdentifier).filter(Boolean), l = e.actionDefinition.name ?? "";
|
|
867
|
+
if (o) {
|
|
868
|
+
await o(s, l, c);
|
|
859
869
|
return;
|
|
860
870
|
}
|
|
861
|
-
if (
|
|
862
|
-
let
|
|
863
|
-
if (!
|
|
864
|
-
let
|
|
865
|
-
await
|
|
871
|
+
if (a) {
|
|
872
|
+
let t = z(n, e);
|
|
873
|
+
if (!t) throw Error("Cannot determine relation for autocomplete add");
|
|
874
|
+
let o = i.filter((e) => e.__signedIdentifier);
|
|
875
|
+
await a.addToRelation(t, r, o);
|
|
866
876
|
}
|
|
867
877
|
});
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
let
|
|
873
|
-
if (
|
|
874
|
-
|
|
875
|
-
|
|
878
|
+
_e.actionType = "AutocompleteAddActionDefinition";
|
|
879
|
+
//#endregion
|
|
880
|
+
//#region src/handlers/other/other-handlers.ts
|
|
881
|
+
var H = ((e) => async (t) => {
|
|
882
|
+
let n = e.actionDefinition.targetType;
|
|
883
|
+
if (!n) throw Error("No target type for pre-fetch");
|
|
884
|
+
let r = t;
|
|
885
|
+
if (r.onPreFetch) {
|
|
886
|
+
let e = await r.onPreFetch(n, t.transfer?.__identifier);
|
|
887
|
+
e.__identifier && t.data.setTransferData(e.__identifier, e);
|
|
876
888
|
}
|
|
877
889
|
});
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
let
|
|
881
|
-
|
|
890
|
+
H.actionType = "PreFetchActionDefinition";
|
|
891
|
+
var ve = ((e) => async (t) => {
|
|
892
|
+
let n = t;
|
|
893
|
+
n.onCustomAction && await n.onCustomAction(e, t);
|
|
882
894
|
});
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
895
|
+
ve.actionType = "CustomActionDefinition";
|
|
896
|
+
//#endregion
|
|
897
|
+
//#region src/provider/api-context.tsx
|
|
898
|
+
var ye = t(null);
|
|
899
|
+
function be() {
|
|
900
|
+
let e = r(ye);
|
|
901
|
+
if (!e) throw Error("useApi must be used within ApiProvider");
|
|
902
|
+
return e.api;
|
|
889
903
|
}
|
|
890
|
-
function
|
|
891
|
-
return /* @__PURE__ */
|
|
892
|
-
value: { api:
|
|
893
|
-
children:
|
|
904
|
+
function xe({ children: e, api: t }) {
|
|
905
|
+
return /* @__PURE__ */ a(ye.Provider, {
|
|
906
|
+
value: { api: t },
|
|
907
|
+
children: e
|
|
894
908
|
});
|
|
895
909
|
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
910
|
+
//#endregion
|
|
911
|
+
//#region src/lifecycle/execute-with-lifecycle.ts
|
|
912
|
+
async function Se(e, t, n, r) {
|
|
913
|
+
let i = () => e(n), a = {
|
|
914
|
+
...n,
|
|
915
|
+
action: r,
|
|
916
|
+
actionDefinition: r.actionDefinition,
|
|
917
|
+
page: n.page,
|
|
918
|
+
callDefault: i
|
|
903
919
|
};
|
|
904
|
-
if (!(
|
|
905
|
-
let
|
|
906
|
-
return
|
|
907
|
-
} catch (
|
|
908
|
-
if (
|
|
909
|
-
throw
|
|
920
|
+
if (!(t.before && await t.before(a) === !1)) try {
|
|
921
|
+
let r;
|
|
922
|
+
return r = t.execute ? await t.execute(a) : await e(n), t.after && await t.after(a, r), r;
|
|
923
|
+
} catch (e) {
|
|
924
|
+
if (t.onError && await t.onError(a, e) === !0) return;
|
|
925
|
+
throw e;
|
|
910
926
|
}
|
|
911
927
|
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
["
|
|
916
|
-
["
|
|
917
|
-
["
|
|
918
|
-
["
|
|
919
|
-
["
|
|
920
|
-
["
|
|
921
|
-
["
|
|
922
|
-
["
|
|
923
|
-
["
|
|
924
|
-
["
|
|
925
|
-
["
|
|
926
|
-
["
|
|
927
|
-
["
|
|
928
|
-
["
|
|
929
|
-
["
|
|
930
|
-
["
|
|
931
|
-
["
|
|
932
|
-
["
|
|
933
|
-
["
|
|
934
|
-
["
|
|
935
|
-
["
|
|
936
|
-
["
|
|
937
|
-
["
|
|
938
|
-
["
|
|
939
|
-
["
|
|
940
|
-
["
|
|
941
|
-
["
|
|
942
|
-
["
|
|
943
|
-
["
|
|
944
|
-
["
|
|
945
|
-
["
|
|
946
|
-
["
|
|
947
|
-
["
|
|
948
|
-
["
|
|
949
|
-
["
|
|
950
|
-
["
|
|
951
|
-
["
|
|
952
|
-
["
|
|
928
|
+
//#endregion
|
|
929
|
+
//#region src/registry/action-handler-registry.ts
|
|
930
|
+
var Ce = new Map([
|
|
931
|
+
["BackActionDefinition", c],
|
|
932
|
+
["OpenPageActionDefinition", l],
|
|
933
|
+
["RowOpenPageActionDefinition", u],
|
|
934
|
+
["CancelActionDefinition", d],
|
|
935
|
+
["OpenFormActionDefinition", f],
|
|
936
|
+
["OpenCreateFormActionDefinition", p],
|
|
937
|
+
["OpenOperationInputFormActionDefinition", m],
|
|
938
|
+
["OpenSelectorActionDefinition", g],
|
|
939
|
+
["OpenAddSelectorActionDefinition", _],
|
|
940
|
+
["OpenSetSelectorActionDefinition", v],
|
|
941
|
+
["OpenOperationInputSelectorActionDefinition", y],
|
|
942
|
+
["SelectorRangeActionDefinition", ee],
|
|
943
|
+
["RefreshActionDefinition", S],
|
|
944
|
+
["CreateActionDefinition", re],
|
|
945
|
+
["UpdateActionDefinition", ie],
|
|
946
|
+
["DeleteActionDefinition", ae],
|
|
947
|
+
["BulkDeleteActionDefinition", oe],
|
|
948
|
+
["RowDeleteActionDefinition", se],
|
|
949
|
+
["GetTemplateActionDefinition", ce],
|
|
950
|
+
["SetActionDefinition", le],
|
|
951
|
+
["UnsetActionDefinition", ue],
|
|
952
|
+
["AddActionDefinition", de],
|
|
953
|
+
["RemoveActionDefinition", fe],
|
|
954
|
+
["BulkRemoveActionDefinition", pe],
|
|
955
|
+
["ClearActionDefinition", w],
|
|
956
|
+
["RefreshRelationActionDefinition", T],
|
|
957
|
+
["FilterRelationActionDefinition", E],
|
|
958
|
+
["FilterActionDefinition", D],
|
|
959
|
+
["ExportActionDefinition", O],
|
|
960
|
+
["InlineCreateRowActionDefinition", k],
|
|
961
|
+
["BulkCallOperationActionDefinition", F],
|
|
962
|
+
["CallOperationActionDefinition", P],
|
|
963
|
+
["InputFormCallOperationActionDefinition", I],
|
|
964
|
+
["InputSelectorCallOperationActionDefinition", L],
|
|
965
|
+
["ParameterlessCallOperationActionDefinition", R],
|
|
966
|
+
["AutocompleteAddActionDefinition", _e],
|
|
967
|
+
["AutocompleteRangeActionDefinition", B],
|
|
968
|
+
["AutocompleteSetActionDefinition", V],
|
|
969
|
+
["PreFetchActionDefinition", H],
|
|
970
|
+
["CustomActionDefinition", ve]
|
|
953
971
|
]);
|
|
954
|
-
function
|
|
955
|
-
return
|
|
972
|
+
function U(e) {
|
|
973
|
+
return Ce.get(e.actionDefinition["@type"]);
|
|
956
974
|
}
|
|
957
|
-
function
|
|
958
|
-
return
|
|
975
|
+
function we(e) {
|
|
976
|
+
return U(e) !== void 0;
|
|
959
977
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
978
|
+
//#endregion
|
|
979
|
+
//#region src/hooks/use-action-dispatcher.ts
|
|
980
|
+
function Te(e) {
|
|
981
|
+
let { navigation: t, data: r, registry: a, api: o, transfer: s, selectedRows: c, closeDialog: l, notifications: u, additionalContext: d, actionOverrides: f } = e, p = i(() => ({
|
|
982
|
+
navigation: t,
|
|
983
|
+
data: r,
|
|
984
|
+
registry: a,
|
|
985
|
+
api: o,
|
|
986
|
+
transfer: s,
|
|
987
|
+
selectedRows: c,
|
|
988
|
+
closeDialog: l,
|
|
989
|
+
notifications: u,
|
|
990
|
+
...d
|
|
971
991
|
}), [
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
]),
|
|
992
|
+
t,
|
|
993
|
+
r,
|
|
994
|
+
a,
|
|
995
|
+
o,
|
|
996
|
+
s,
|
|
997
|
+
c,
|
|
998
|
+
l,
|
|
999
|
+
u,
|
|
1000
|
+
d
|
|
1001
|
+
]), m = n((e) => we(e), []);
|
|
982
1002
|
return {
|
|
983
|
-
dispatch:
|
|
984
|
-
let
|
|
985
|
-
if (!
|
|
986
|
-
let
|
|
987
|
-
throw Error(`No handler for action type: ${
|
|
1003
|
+
dispatch: n(async (e, t) => {
|
|
1004
|
+
let n = U(e);
|
|
1005
|
+
if (!n) {
|
|
1006
|
+
let t = e.actionDefinition["@type"];
|
|
1007
|
+
throw Error(`No handler for action type: ${t}`);
|
|
988
1008
|
}
|
|
989
|
-
let
|
|
990
|
-
...
|
|
991
|
-
...
|
|
992
|
-
} :
|
|
993
|
-
|
|
994
|
-
}, [
|
|
995
|
-
canHandle:
|
|
1009
|
+
let r = n(e), i = t ? {
|
|
1010
|
+
...p,
|
|
1011
|
+
...t
|
|
1012
|
+
} : p, a = e["xmi:id"], o = a ? f?.[a] : void 0;
|
|
1013
|
+
o && Object.keys(o).length > 0 ? await Se(r, o, i, e) : await r(i);
|
|
1014
|
+
}, [p, f]),
|
|
1015
|
+
canHandle: m
|
|
996
1016
|
};
|
|
997
1017
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1018
|
+
//#endregion
|
|
1019
|
+
//#region src/hooks/use-action-handler.ts
|
|
1020
|
+
function Ee(e) {
|
|
1021
|
+
return i(() => {
|
|
1022
|
+
let t = U(e);
|
|
1023
|
+
if (!t) {
|
|
1024
|
+
let t = e.actionDefinition["@type"];
|
|
1025
|
+
throw Error(`No handler for action type: ${t}`);
|
|
1004
1026
|
}
|
|
1005
|
-
return
|
|
1006
|
-
}, [
|
|
1027
|
+
return t(e);
|
|
1028
|
+
}, [e]);
|
|
1007
1029
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return
|
|
1030
|
+
function De(e) {
|
|
1031
|
+
return we(e);
|
|
1010
1032
|
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region src/api/constants.ts
|
|
1035
|
+
var W = "X-Judo-SignedIdentifier", Oe = "X-Judo-Mask", ke = "X-Judo-MarkSelectedRangeItems", Ae = "X-Judo-CountRecords", je = "X-Token", Me = "{}", G = "/~template", K = "/~get", Ne = "/~update", q = "/~validate", Pe = "/~delete", Fe = "/~list", Ie = "/~range", Le = "/~create", Re = "/~set", ze = "/~unset", Be = "/~add", Ve = "/~remove", He = "/~export", Ue = "/~upload-token", We = "/~principal", Ge = "/~meta", Ke = "::", qe = "_default_transferobjecttypes";
|
|
1036
|
+
function J(e, t, n, r) {
|
|
1037
|
+
let i = `${t}${n ? n.split(Ke).join("/") : ""}${r ?? ""}`;
|
|
1038
|
+
return `/${e.packageNameTokens?.length ? `${e.packageNameTokens.join("/")}/` : ""}${(e.simpleName ?? "").split(Ke).filter((e) => !e.includes(qe)).join("/")}${i}`;
|
|
1016
1039
|
}
|
|
1017
|
-
function
|
|
1018
|
-
if (!
|
|
1019
|
-
let
|
|
1020
|
-
return `/${
|
|
1040
|
+
function Je(e, t) {
|
|
1041
|
+
if (!e) throw Error("Application context is required for path building. Ensure the API is properly initialized with an Application.");
|
|
1042
|
+
let n = t || "";
|
|
1043
|
+
return `/${e.modelName}${n.length && !n.startsWith("/") ? `/${n}` : n}`;
|
|
1021
1044
|
}
|
|
1022
|
-
function
|
|
1023
|
-
if (!
|
|
1024
|
-
return `${
|
|
1045
|
+
function Ye(e) {
|
|
1046
|
+
if (!e?.actor) throw Error("Application.actor is required for path building. Ensure the Application has a valid actor ClassType.");
|
|
1047
|
+
return `${e.actor.packageNameTokens?.length ? `${e.actor.packageNameTokens.join("/")}/` : ""}${e.actor.simpleName ?? e.actor.name ?? "Actor"}`;
|
|
1025
1048
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return
|
|
1049
|
+
function Y(e, t = "") {
|
|
1050
|
+
return Je(e, Ye(e) + (t.length && !t.startsWith("/") ? `/${t}` : t));
|
|
1028
1051
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return
|
|
1052
|
+
function X(e, t, n = "/~list") {
|
|
1053
|
+
return Y(t, J(e?.eContainer, "/", e.name, n));
|
|
1031
1054
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return
|
|
1055
|
+
function Z(e, t, n = "") {
|
|
1056
|
+
return Y(t, J(e, "", "", n));
|
|
1034
1057
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let
|
|
1037
|
-
return
|
|
1058
|
+
function Q(e, t, n, r = !1) {
|
|
1059
|
+
let i = e?.eContainer;
|
|
1060
|
+
return r ? Y(t, J(i, "/", e.name, n)) : Y(t, J(i, "/~update/", e.name, n));
|
|
1038
1061
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return
|
|
1062
|
+
function $(e, t, n, r = "") {
|
|
1063
|
+
return Y(n, J(e, "/", t, r));
|
|
1041
1064
|
}
|
|
1042
|
-
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region src/api/judo-rest-api.ts
|
|
1067
|
+
var Xe = class {
|
|
1043
1068
|
config;
|
|
1044
1069
|
fetchImpl;
|
|
1045
1070
|
_defaultHeaders;
|
|
1046
|
-
constructor(
|
|
1047
|
-
if (!
|
|
1048
|
-
if (!
|
|
1049
|
-
this.config =
|
|
1071
|
+
constructor(e) {
|
|
1072
|
+
if (!e.application) throw Error("JudoRestApi requires 'application' in config. Ensure the API is created with a valid Application context.");
|
|
1073
|
+
if (!e.application.actor) throw Error("JudoRestApi requires 'application.actor' in config. Ensure the Application has a valid actor ClassType.");
|
|
1074
|
+
this.config = e, this.fetchImpl = e.fetch ?? globalThis.fetch.bind(globalThis), this._defaultHeaders = { ...e.defaultHeaders };
|
|
1050
1075
|
}
|
|
1051
|
-
setDefaultHeaders(
|
|
1052
|
-
this._defaultHeaders =
|
|
1076
|
+
setDefaultHeaders(e) {
|
|
1077
|
+
this._defaultHeaders = e;
|
|
1053
1078
|
}
|
|
1054
|
-
getUrl(
|
|
1055
|
-
return `${this.config.baseUrl}${
|
|
1079
|
+
getUrl(e) {
|
|
1080
|
+
return `${this.config.baseUrl}${e}`;
|
|
1056
1081
|
}
|
|
1057
|
-
serializeTransfer(
|
|
1058
|
-
return this.config.transferSerializer ? this.config.transferSerializer.serialize(
|
|
1082
|
+
serializeTransfer(e) {
|
|
1083
|
+
return this.config.transferSerializer ? this.config.transferSerializer.serialize(e) : e;
|
|
1059
1084
|
}
|
|
1060
|
-
deserializeTransfer(
|
|
1061
|
-
return this.config.transferDeserializer ? this.config.transferDeserializer.deserialize(
|
|
1085
|
+
deserializeTransfer(e) {
|
|
1086
|
+
return this.config.transferDeserializer ? this.config.transferDeserializer.deserialize(e) : e;
|
|
1062
1087
|
}
|
|
1063
|
-
deserializeArray(
|
|
1064
|
-
return Array.isArray(
|
|
1088
|
+
deserializeArray(e) {
|
|
1089
|
+
return Array.isArray(e) ? this.config.transferDeserializer ? e.map((e) => this.config.transferDeserializer.deserialize(e)) : e : [];
|
|
1065
1090
|
}
|
|
1066
|
-
async request(
|
|
1067
|
-
let
|
|
1068
|
-
method:
|
|
1091
|
+
async request(e, t, n = {}) {
|
|
1092
|
+
let r = this.getUrl(t), i = {
|
|
1093
|
+
method: e,
|
|
1069
1094
|
headers: {
|
|
1070
1095
|
"Content-Type": "application/json",
|
|
1071
1096
|
...this._defaultHeaders,
|
|
1072
|
-
...
|
|
1097
|
+
...n.headers
|
|
1073
1098
|
},
|
|
1074
|
-
body:
|
|
1099
|
+
body: n.body === void 0 ? void 0 : JSON.stringify(n.body)
|
|
1075
1100
|
};
|
|
1076
|
-
this.config.onRequest && (
|
|
1101
|
+
this.config.onRequest && (i = await this.config.onRequest(i));
|
|
1077
1102
|
try {
|
|
1078
|
-
let
|
|
1079
|
-
if (this.config.onResponse && (
|
|
1080
|
-
let
|
|
1081
|
-
if (
|
|
1082
|
-
let
|
|
1083
|
-
if (Array.isArray(
|
|
1084
|
-
let { ValidationError:
|
|
1085
|
-
throw new
|
|
1103
|
+
let e = await this.fetchImpl(r, i);
|
|
1104
|
+
if (this.config.onResponse && (e = await this.config.onResponse(e)), !e.ok) {
|
|
1105
|
+
let t = await e.text();
|
|
1106
|
+
if (e.status === 400 && t.length > 0) try {
|
|
1107
|
+
let e = JSON.parse(t);
|
|
1108
|
+
if (Array.isArray(e)) {
|
|
1109
|
+
let { ValidationError: t } = await import("./types-BRqo2AHD.js").then((e) => e.n);
|
|
1110
|
+
throw new t(e);
|
|
1086
1111
|
}
|
|
1087
|
-
} catch (
|
|
1088
|
-
if (
|
|
1112
|
+
} catch (e) {
|
|
1113
|
+
if (e instanceof Error && e.name === "ValidationError") throw e;
|
|
1089
1114
|
}
|
|
1090
|
-
throw Error(`HTTP ${
|
|
1115
|
+
throw Error(`HTTP ${e.status}: ${t}`);
|
|
1091
1116
|
}
|
|
1092
|
-
let
|
|
1093
|
-
if (
|
|
1117
|
+
let t;
|
|
1118
|
+
if (n.responseType === "blob") t = await e.blob();
|
|
1094
1119
|
else {
|
|
1095
|
-
let
|
|
1096
|
-
|
|
1120
|
+
let n = await e.text();
|
|
1121
|
+
t = n.length > 0 ? JSON.parse(n) : void 0;
|
|
1097
1122
|
}
|
|
1098
1123
|
return {
|
|
1099
|
-
data:
|
|
1100
|
-
status:
|
|
1101
|
-
headers:
|
|
1124
|
+
data: t,
|
|
1125
|
+
status: e.status,
|
|
1126
|
+
headers: e.headers
|
|
1102
1127
|
};
|
|
1103
|
-
} catch (
|
|
1104
|
-
throw this.config.onError && this.config.onError(
|
|
1128
|
+
} catch (e) {
|
|
1129
|
+
throw this.config.onError && this.config.onError(e), e;
|
|
1105
1130
|
}
|
|
1106
1131
|
}
|
|
1107
|
-
async getTemplate(
|
|
1108
|
-
let
|
|
1132
|
+
async getTemplate(e) {
|
|
1133
|
+
let t = Z(e, this.config.application, G), n = await this.request("GET", t);
|
|
1109
1134
|
return {
|
|
1110
|
-
...
|
|
1111
|
-
data: this.deserializeTransfer(
|
|
1135
|
+
...n,
|
|
1136
|
+
data: this.deserializeTransfer(n.data)
|
|
1112
1137
|
};
|
|
1113
1138
|
}
|
|
1114
|
-
async refresh(
|
|
1115
|
-
let
|
|
1116
|
-
body:
|
|
1117
|
-
headers: { [
|
|
1139
|
+
async refresh(e, t, n) {
|
|
1140
|
+
let r = Z(e, this.config.application, K), i = await this.request("POST", r, {
|
|
1141
|
+
body: n ?? {},
|
|
1142
|
+
headers: { [W]: t.__signedIdentifier }
|
|
1118
1143
|
});
|
|
1119
1144
|
return {
|
|
1120
|
-
...
|
|
1121
|
-
data: this.deserializeTransfer(
|
|
1145
|
+
...i,
|
|
1146
|
+
data: this.deserializeTransfer(i.data)
|
|
1122
1147
|
};
|
|
1123
1148
|
}
|
|
1124
|
-
async update(
|
|
1125
|
-
let
|
|
1126
|
-
body: this.serializeTransfer(
|
|
1149
|
+
async update(e, t, n) {
|
|
1150
|
+
let r = Z(e, this.config.application, Ne), i = await this.request("POST", r, {
|
|
1151
|
+
body: this.serializeTransfer(t),
|
|
1127
1152
|
headers: {
|
|
1128
|
-
[
|
|
1129
|
-
[
|
|
1153
|
+
[W]: t.__signedIdentifier,
|
|
1154
|
+
[Oe]: n ?? "{}"
|
|
1130
1155
|
}
|
|
1131
1156
|
});
|
|
1132
1157
|
return {
|
|
1133
|
-
...
|
|
1134
|
-
data: this.deserializeTransfer(
|
|
1158
|
+
...i,
|
|
1159
|
+
data: this.deserializeTransfer(i.data)
|
|
1135
1160
|
};
|
|
1136
1161
|
}
|
|
1137
|
-
async validateUpdate(
|
|
1138
|
-
let
|
|
1139
|
-
body: this.serializeTransfer(
|
|
1140
|
-
headers: { [
|
|
1162
|
+
async validateUpdate(e, t) {
|
|
1163
|
+
let n = Z(e, this.config.application, q), r = await this.request("POST", n, {
|
|
1164
|
+
body: this.serializeTransfer(t),
|
|
1165
|
+
headers: { [W]: t.__signedIdentifier }
|
|
1141
1166
|
});
|
|
1142
1167
|
return {
|
|
1143
|
-
...
|
|
1144
|
-
data: this.deserializeTransfer(
|
|
1168
|
+
...r,
|
|
1169
|
+
data: this.deserializeTransfer(r.data)
|
|
1145
1170
|
};
|
|
1146
1171
|
}
|
|
1147
|
-
async delete(
|
|
1148
|
-
let
|
|
1149
|
-
return this.request("POST",
|
|
1172
|
+
async delete(e, t) {
|
|
1173
|
+
let n = Z(e, this.config.application, Pe);
|
|
1174
|
+
return this.request("POST", n, { headers: { [W]: t.__signedIdentifier } });
|
|
1150
1175
|
}
|
|
1151
|
-
async listRelation(
|
|
1152
|
-
let
|
|
1153
|
-
|
|
1154
|
-
let
|
|
1155
|
-
body:
|
|
1156
|
-
headers:
|
|
1176
|
+
async listRelation(e, t, n, r) {
|
|
1177
|
+
let i = X(e, this.config.application, Fe), a = {};
|
|
1178
|
+
t?.__signedIdentifier && (a[W] = t.__signedIdentifier), r && (a[Ae] = "true");
|
|
1179
|
+
let o = await this.request("POST", i, {
|
|
1180
|
+
body: n ?? {},
|
|
1181
|
+
headers: a
|
|
1157
1182
|
});
|
|
1158
1183
|
return {
|
|
1159
|
-
...
|
|
1160
|
-
data: this.deserializeArray(
|
|
1184
|
+
...o,
|
|
1185
|
+
data: this.deserializeArray(o.data)
|
|
1161
1186
|
};
|
|
1162
1187
|
}
|
|
1163
|
-
async getRelation(
|
|
1164
|
-
let
|
|
1165
|
-
body:
|
|
1166
|
-
headers: { [
|
|
1167
|
-
}),
|
|
1188
|
+
async getRelation(e, t, n) {
|
|
1189
|
+
let r = X(e, this.config.application, K), i = await this.request("POST", r, {
|
|
1190
|
+
body: n ?? {},
|
|
1191
|
+
headers: { [W]: t.__signedIdentifier }
|
|
1192
|
+
}), a = i.data === void 0 || i.data === null ? null : this.deserializeTransfer(i.data);
|
|
1168
1193
|
return {
|
|
1169
|
-
...
|
|
1170
|
-
data:
|
|
1194
|
+
...i,
|
|
1195
|
+
data: a
|
|
1171
1196
|
};
|
|
1172
1197
|
}
|
|
1173
|
-
async refreshAccessRelation(
|
|
1174
|
-
let
|
|
1198
|
+
async refreshAccessRelation(e, t) {
|
|
1199
|
+
let n = X(e, this.config.application, K), r = await this.request("POST", n, { body: t ?? {} });
|
|
1175
1200
|
return {
|
|
1176
|
-
...
|
|
1177
|
-
data: this.deserializeTransfer(
|
|
1201
|
+
...r,
|
|
1202
|
+
data: this.deserializeTransfer(r.data)
|
|
1178
1203
|
};
|
|
1179
1204
|
}
|
|
1180
|
-
async getRelationRange(
|
|
1181
|
-
let
|
|
1182
|
-
owner:
|
|
1183
|
-
queryCustomizer:
|
|
1184
|
-
},
|
|
1185
|
-
|
|
1186
|
-
let
|
|
1187
|
-
body:
|
|
1188
|
-
headers:
|
|
1205
|
+
async getRelationRange(e, t, n, r) {
|
|
1206
|
+
let i = X(e, this.config.application, Ie), a = {
|
|
1207
|
+
owner: t ?? {},
|
|
1208
|
+
queryCustomizer: n ?? {}
|
|
1209
|
+
}, o = { [ke]: "true" };
|
|
1210
|
+
r && (o[Ae] = "true");
|
|
1211
|
+
let s = await this.request("POST", i, {
|
|
1212
|
+
body: a,
|
|
1213
|
+
headers: o
|
|
1189
1214
|
});
|
|
1190
1215
|
return {
|
|
1191
|
-
...
|
|
1192
|
-
data: this.deserializeArray(
|
|
1216
|
+
...s,
|
|
1217
|
+
data: this.deserializeArray(s.data)
|
|
1193
1218
|
};
|
|
1194
1219
|
}
|
|
1195
|
-
async getRelationTemplate(
|
|
1196
|
-
let
|
|
1220
|
+
async getRelationTemplate(e) {
|
|
1221
|
+
let t = Z(e.target, this.config.application, G), n = await this.request("GET", t);
|
|
1197
1222
|
return {
|
|
1198
|
-
...
|
|
1199
|
-
data: this.deserializeTransfer(
|
|
1223
|
+
...n,
|
|
1224
|
+
data: this.deserializeTransfer(n.data)
|
|
1200
1225
|
};
|
|
1201
1226
|
}
|
|
1202
|
-
async createRelation(
|
|
1203
|
-
let
|
|
1204
|
-
!
|
|
1205
|
-
let
|
|
1206
|
-
body: this.serializeTransfer(
|
|
1207
|
-
headers:
|
|
1227
|
+
async createRelation(e, t, n, r) {
|
|
1228
|
+
let i = e.isAccess, a = i ? X(e, this.config.application, Le) : Q(e, this.config.application, Le), o = { [Oe]: r ?? "{}" };
|
|
1229
|
+
!i && t?.__signedIdentifier && (o[W] = t.__signedIdentifier);
|
|
1230
|
+
let s = await this.request("POST", a, {
|
|
1231
|
+
body: this.serializeTransfer(n),
|
|
1232
|
+
headers: o
|
|
1208
1233
|
});
|
|
1209
1234
|
return {
|
|
1210
|
-
...
|
|
1211
|
-
data: this.deserializeTransfer(
|
|
1235
|
+
...s,
|
|
1236
|
+
data: this.deserializeTransfer(s.data)
|
|
1212
1237
|
};
|
|
1213
1238
|
}
|
|
1214
|
-
async validateCreateRelation(
|
|
1215
|
-
let
|
|
1216
|
-
!
|
|
1217
|
-
let
|
|
1218
|
-
body: this.serializeTransfer(
|
|
1219
|
-
headers:
|
|
1239
|
+
async validateCreateRelation(e, t, n) {
|
|
1240
|
+
let r = e.isAccess, i = r ? X(e, this.config.application, q) : Q(e, this.config.application, q), a = {};
|
|
1241
|
+
!r && t?.__signedIdentifier && (a[W] = t.__signedIdentifier);
|
|
1242
|
+
let o = await this.request("POST", i, {
|
|
1243
|
+
body: this.serializeTransfer(n),
|
|
1244
|
+
headers: a
|
|
1220
1245
|
});
|
|
1221
1246
|
return {
|
|
1222
|
-
...
|
|
1223
|
-
data: this.deserializeTransfer(
|
|
1247
|
+
...o,
|
|
1248
|
+
data: this.deserializeTransfer(o.data)
|
|
1224
1249
|
};
|
|
1225
1250
|
}
|
|
1226
|
-
async setRelation(
|
|
1227
|
-
let
|
|
1228
|
-
|
|
1229
|
-
let
|
|
1230
|
-
return this.request("POST",
|
|
1231
|
-
body:
|
|
1232
|
-
headers:
|
|
1251
|
+
async setRelation(e, t, n) {
|
|
1252
|
+
let r = e.isAccess, i = Q(e, this.config.application, Re, r), a = {};
|
|
1253
|
+
r || (a[W] = t.__signedIdentifier);
|
|
1254
|
+
let o = Array.isArray(n) ? n.map((e) => this.serializeTransfer(e)) : this.serializeTransfer(n);
|
|
1255
|
+
return this.request("POST", i, {
|
|
1256
|
+
body: o,
|
|
1257
|
+
headers: a
|
|
1233
1258
|
});
|
|
1234
1259
|
}
|
|
1235
|
-
async unsetRelation(
|
|
1236
|
-
let
|
|
1237
|
-
return
|
|
1260
|
+
async unsetRelation(e, t) {
|
|
1261
|
+
let n = e.isAccess, r = Q(e, this.config.application, ze, n), i = {};
|
|
1262
|
+
return n || (i[W] = t.__signedIdentifier), this.request("POST", r, { headers: i });
|
|
1238
1263
|
}
|
|
1239
|
-
async addToRelation(
|
|
1240
|
-
let
|
|
1241
|
-
return
|
|
1242
|
-
body:
|
|
1243
|
-
headers:
|
|
1264
|
+
async addToRelation(e, t, n) {
|
|
1265
|
+
let r = e.isAccess, i = Q(e, this.config.application, Be, r), a = {};
|
|
1266
|
+
return r || (a[W] = t.__signedIdentifier), this.request("POST", i, {
|
|
1267
|
+
body: n.map((e) => this.serializeTransfer(e)),
|
|
1268
|
+
headers: a
|
|
1244
1269
|
});
|
|
1245
1270
|
}
|
|
1246
|
-
async removeFromRelation(
|
|
1247
|
-
let
|
|
1248
|
-
return
|
|
1249
|
-
body:
|
|
1250
|
-
headers:
|
|
1271
|
+
async removeFromRelation(e, t, n) {
|
|
1272
|
+
let r = e.isAccess, i = Q(e, this.config.application, Ve, r), a = {};
|
|
1273
|
+
return r || (a[W] = t.__signedIdentifier), this.request("POST", i, {
|
|
1274
|
+
body: n.map((e) => this.serializeTransfer(e)),
|
|
1275
|
+
headers: a
|
|
1251
1276
|
});
|
|
1252
1277
|
}
|
|
1253
|
-
async exportRelation(
|
|
1254
|
-
let
|
|
1255
|
-
return
|
|
1256
|
-
body:
|
|
1257
|
-
headers:
|
|
1278
|
+
async exportRelation(e, t, n) {
|
|
1279
|
+
let r = X(e, this.config.application, He), i = {};
|
|
1280
|
+
return t?.__signedIdentifier && (i[W] = t.__signedIdentifier), this.request("POST", r, {
|
|
1281
|
+
body: n ?? {},
|
|
1282
|
+
headers: i,
|
|
1258
1283
|
responseType: "blob"
|
|
1259
1284
|
});
|
|
1260
1285
|
}
|
|
1261
|
-
async invokeOperation(
|
|
1262
|
-
let
|
|
1263
|
-
|
|
1264
|
-
let
|
|
1265
|
-
body:
|
|
1266
|
-
headers:
|
|
1286
|
+
async invokeOperation(e, t, n, r) {
|
|
1287
|
+
let i = $(e, t.name, this.config.application), a = {};
|
|
1288
|
+
t.isMapped && !t.isStatic && n?.__signedIdentifier && (a[W] = n.__signedIdentifier);
|
|
1289
|
+
let o = await this.request("POST", i, {
|
|
1290
|
+
body: t.hasInput ? this.serializeTransfer(r) : void 0,
|
|
1291
|
+
headers: a
|
|
1267
1292
|
});
|
|
1268
|
-
return
|
|
1269
|
-
...
|
|
1270
|
-
data: this.deserializeTransfer(
|
|
1271
|
-
} :
|
|
1272
|
-
}
|
|
1273
|
-
async validateOperationInput(
|
|
1274
|
-
let
|
|
1275
|
-
|
|
1276
|
-
let
|
|
1277
|
-
body: this.serializeTransfer(
|
|
1278
|
-
headers:
|
|
1293
|
+
return o.data !== void 0 && o.data !== null ? {
|
|
1294
|
+
...o,
|
|
1295
|
+
data: this.deserializeTransfer(o.data)
|
|
1296
|
+
} : o;
|
|
1297
|
+
}
|
|
1298
|
+
async validateOperationInput(e, t, n, r) {
|
|
1299
|
+
let i = $(e, t.name, this.config.application, q), a = {};
|
|
1300
|
+
t.isMapped && !t.isStatic && n?.__signedIdentifier && (a[W] = n.__signedIdentifier);
|
|
1301
|
+
let o = await this.request("POST", i, {
|
|
1302
|
+
body: this.serializeTransfer(r),
|
|
1303
|
+
headers: a
|
|
1279
1304
|
});
|
|
1280
1305
|
return {
|
|
1281
|
-
...
|
|
1282
|
-
data: this.deserializeTransfer(
|
|
1306
|
+
...o,
|
|
1307
|
+
data: this.deserializeTransfer(o.data)
|
|
1283
1308
|
};
|
|
1284
1309
|
}
|
|
1285
|
-
async getOperationInputTemplate(
|
|
1286
|
-
if (!
|
|
1287
|
-
let
|
|
1310
|
+
async getOperationInputTemplate(e) {
|
|
1311
|
+
if (!e.inputType) throw Error(`Operation ${e.name} has no input type`);
|
|
1312
|
+
let t = Z(e.inputType, this.config.application, G), n = await this.request("GET", t);
|
|
1288
1313
|
return {
|
|
1289
|
-
...
|
|
1290
|
-
data: this.deserializeTransfer(
|
|
1314
|
+
...n,
|
|
1315
|
+
data: this.deserializeTransfer(n.data)
|
|
1291
1316
|
};
|
|
1292
1317
|
}
|
|
1293
|
-
async getOperationInputRange(
|
|
1294
|
-
let
|
|
1295
|
-
owner:
|
|
1296
|
-
queryCustomizer:
|
|
1297
|
-
},
|
|
1298
|
-
|
|
1299
|
-
let
|
|
1300
|
-
body:
|
|
1301
|
-
headers:
|
|
1318
|
+
async getOperationInputRange(e, t, n, r, i) {
|
|
1319
|
+
let a = $(e, t.name, this.config.application, Ie), o = {
|
|
1320
|
+
owner: n ?? {},
|
|
1321
|
+
queryCustomizer: r ?? {}
|
|
1322
|
+
}, s = { [ke]: "true" };
|
|
1323
|
+
i && (s[Ae] = "true");
|
|
1324
|
+
let c = await this.request("POST", a, {
|
|
1325
|
+
body: o,
|
|
1326
|
+
headers: s
|
|
1302
1327
|
});
|
|
1303
1328
|
return {
|
|
1304
|
-
...
|
|
1305
|
-
data: this.deserializeArray(
|
|
1329
|
+
...c,
|
|
1330
|
+
data: this.deserializeArray(c.data)
|
|
1306
1331
|
};
|
|
1307
1332
|
}
|
|
1308
1333
|
async getPrincipal() {
|
|
1309
|
-
let
|
|
1334
|
+
let e = Y(this.config.application, We), t = await this.request("GET", e);
|
|
1310
1335
|
return {
|
|
1311
|
-
...
|
|
1312
|
-
data: this.deserializeTransfer(
|
|
1336
|
+
...t,
|
|
1337
|
+
data: this.deserializeTransfer(t.data)
|
|
1313
1338
|
};
|
|
1314
1339
|
}
|
|
1315
1340
|
async getMetadata() {
|
|
1316
|
-
let
|
|
1317
|
-
return this.request("GET",
|
|
1341
|
+
let e = Y(this.config.application, Ge);
|
|
1342
|
+
return this.request("GET", e);
|
|
1318
1343
|
}
|
|
1319
|
-
async uploadFile(
|
|
1320
|
-
let
|
|
1321
|
-
|
|
1322
|
-
let
|
|
1344
|
+
async uploadFile(e, t) {
|
|
1345
|
+
let n = (await this.request("POST", `${e}${Ue}`)).data.token, r = new FormData();
|
|
1346
|
+
r.append("file", t);
|
|
1347
|
+
let i = `${this.config.baseUrl}/upload`, a = await this.fetchImpl(i, {
|
|
1323
1348
|
method: "POST",
|
|
1324
1349
|
headers: {
|
|
1325
1350
|
...this._defaultHeaders,
|
|
1326
|
-
[
|
|
1351
|
+
[je]: n
|
|
1327
1352
|
},
|
|
1328
|
-
body:
|
|
1353
|
+
body: r
|
|
1329
1354
|
});
|
|
1330
|
-
if (!
|
|
1355
|
+
if (!a.ok) throw Error(`Upload failed: HTTP ${a.status}`);
|
|
1331
1356
|
return {
|
|
1332
|
-
data: await
|
|
1333
|
-
status:
|
|
1334
|
-
headers:
|
|
1357
|
+
data: await a.json(),
|
|
1358
|
+
status: a.status,
|
|
1359
|
+
headers: a.headers
|
|
1335
1360
|
};
|
|
1336
1361
|
}
|
|
1337
|
-
async downloadFile(
|
|
1338
|
-
let
|
|
1362
|
+
async downloadFile(e, t = "attachment") {
|
|
1363
|
+
let n = `${this.config.baseUrl}/download?disposition=${t}`, r = await this.fetchImpl(n, {
|
|
1339
1364
|
method: "GET",
|
|
1340
1365
|
headers: {
|
|
1341
1366
|
...this._defaultHeaders,
|
|
1342
|
-
[
|
|
1367
|
+
[je]: e
|
|
1343
1368
|
}
|
|
1344
1369
|
});
|
|
1345
|
-
if (!
|
|
1370
|
+
if (!r.ok) throw Error(`Download failed: HTTP ${r.status}`);
|
|
1346
1371
|
return {
|
|
1347
|
-
data: await
|
|
1348
|
-
status:
|
|
1349
|
-
headers:
|
|
1372
|
+
data: await r.blob(),
|
|
1373
|
+
status: r.status,
|
|
1374
|
+
headers: r.headers
|
|
1350
1375
|
};
|
|
1351
1376
|
}
|
|
1352
|
-
async findInstance(
|
|
1353
|
-
let
|
|
1354
|
-
_identifier:
|
|
1377
|
+
async findInstance(e, t, n) {
|
|
1378
|
+
let r = X(e, this.config.application, Fe), i = {
|
|
1379
|
+
_identifier: t,
|
|
1355
1380
|
_seek: { limit: 1 }
|
|
1356
1381
|
};
|
|
1357
|
-
|
|
1358
|
-
let
|
|
1382
|
+
n && (i._mask = n);
|
|
1383
|
+
let a = await this.request("POST", r, { body: i }), o = this.deserializeArray(a.data), s = o.length > 0 ? o[0] : null;
|
|
1359
1384
|
return {
|
|
1360
|
-
...
|
|
1361
|
-
data:
|
|
1385
|
+
...a,
|
|
1386
|
+
data: s
|
|
1362
1387
|
};
|
|
1363
1388
|
}
|
|
1364
1389
|
};
|
|
1365
|
-
function
|
|
1366
|
-
return new
|
|
1390
|
+
function Ze(e) {
|
|
1391
|
+
return new Xe(e);
|
|
1367
1392
|
}
|
|
1368
|
-
|
|
1393
|
+
//#endregion
|
|
1394
|
+
//#region src/api/transfer-serializer.ts
|
|
1395
|
+
var Qe = new Set([
|
|
1369
1396
|
"__identifier",
|
|
1370
1397
|
"__entityType",
|
|
1371
1398
|
"__deleteable",
|
|
1372
1399
|
"__updateable",
|
|
1373
1400
|
"__version"
|
|
1374
|
-
]),
|
|
1401
|
+
]), $e = new Set([
|
|
1375
1402
|
"__isNew",
|
|
1376
1403
|
"__items",
|
|
1377
1404
|
"__tempId"
|
|
1378
|
-
]),
|
|
1379
|
-
function
|
|
1380
|
-
return
|
|
1405
|
+
]), et = new Set([...Qe, ...$e]);
|
|
1406
|
+
function tt(e) {
|
|
1407
|
+
return e === "__signedIdentifier" ? !1 : et.has(e) ? !0 : e.startsWith("__");
|
|
1381
1408
|
}
|
|
1382
|
-
function
|
|
1383
|
-
switch (
|
|
1384
|
-
case "date": return `${
|
|
1385
|
-
case "timestamp": return
|
|
1386
|
-
case "time": return `${String(
|
|
1409
|
+
function nt(e, t) {
|
|
1410
|
+
switch (t) {
|
|
1411
|
+
case "date": return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
1412
|
+
case "timestamp": return e.toISOString();
|
|
1413
|
+
case "time": return `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}:${String(e.getSeconds()).padStart(2, "0")}`;
|
|
1387
1414
|
}
|
|
1388
1415
|
}
|
|
1389
|
-
function
|
|
1390
|
-
return { serialize(
|
|
1391
|
-
if (typeof
|
|
1392
|
-
if (Array.isArray(
|
|
1393
|
-
let
|
|
1394
|
-
for (let [
|
|
1395
|
-
let
|
|
1396
|
-
|
|
1397
|
-
} else typeof
|
|
1398
|
-
return
|
|
1416
|
+
function rt(e) {
|
|
1417
|
+
return { serialize(t) {
|
|
1418
|
+
if (typeof t != "object" || !t) return t;
|
|
1419
|
+
if (Array.isArray(t)) return t.map((e) => this.serialize(e));
|
|
1420
|
+
let n = t, r = n.__entityType, i = r ? e[r] : void 0, a = {};
|
|
1421
|
+
for (let [e, t] of Object.entries(n)) if (!tt(e)) if (t instanceof Date) {
|
|
1422
|
+
let n = i?.[e];
|
|
1423
|
+
a[e] = n ? nt(t, n) : t.toISOString();
|
|
1424
|
+
} else typeof t == "object" && t ? a[e] = this.serialize(t) : a[e] = t;
|
|
1425
|
+
return a;
|
|
1399
1426
|
} };
|
|
1400
1427
|
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
let
|
|
1405
|
-
return new Date(
|
|
1428
|
+
//#endregion
|
|
1429
|
+
//#region src/api/transfer-deserializer.ts
|
|
1430
|
+
function it(e) {
|
|
1431
|
+
let t = e.split("-");
|
|
1432
|
+
if (t.length !== 3) return /* @__PURE__ */ new Date(NaN);
|
|
1433
|
+
let [n, r, i] = t.map(Number);
|
|
1434
|
+
return new Date(n, r - 1, i);
|
|
1406
1435
|
}
|
|
1407
|
-
function
|
|
1408
|
-
switch (
|
|
1409
|
-
case "date": return
|
|
1410
|
-
case "timestamp": return new Date(
|
|
1411
|
-
case "time": return
|
|
1436
|
+
function at(e, t) {
|
|
1437
|
+
switch (t) {
|
|
1438
|
+
case "date": return it(e);
|
|
1439
|
+
case "timestamp": return new Date(e);
|
|
1440
|
+
case "time": return e;
|
|
1412
1441
|
}
|
|
1413
1442
|
}
|
|
1414
|
-
function
|
|
1415
|
-
return { deserialize(
|
|
1416
|
-
if (typeof
|
|
1417
|
-
if (Array.isArray(
|
|
1418
|
-
let
|
|
1419
|
-
for (let [
|
|
1420
|
-
if (
|
|
1421
|
-
let
|
|
1422
|
-
typeof
|
|
1443
|
+
function ot(e) {
|
|
1444
|
+
return { deserialize(t) {
|
|
1445
|
+
if (typeof t != "object" || !t) return t;
|
|
1446
|
+
if (Array.isArray(t)) return t.map((e) => this.deserialize(e));
|
|
1447
|
+
let n = t, r = n.__entityType, i = r ? e[r] : void 0, a = { ...n };
|
|
1448
|
+
for (let [e, t] of Object.entries(a)) typeof t == "object" && t && (a[e] = this.deserialize(t));
|
|
1449
|
+
if (i) for (let [e, t] of Object.entries(i)) {
|
|
1450
|
+
let n = a[e];
|
|
1451
|
+
typeof n == "string" && (a[e] = at(n, t));
|
|
1423
1452
|
}
|
|
1424
|
-
return
|
|
1453
|
+
return a;
|
|
1425
1454
|
} };
|
|
1426
1455
|
}
|
|
1427
|
-
|
|
1456
|
+
//#endregion
|
|
1457
|
+
export { s as ACTION_HANDLER_FACTORY, xe as ApiProvider, Me as DEFAULT_COMMAND_MASK, ke as HEADER_MARK_SELECTED_RANGE_ITEMS, Oe as HEADER_MASK, W as HEADER_SIGNED_IDENTIFIER, je as HEADER_TOKEN, Xe as JudoRestApi, Be as SUFFIX_ADD, Le as SUFFIX_CREATE, Pe as SUFFIX_DELETE, He as SUFFIX_EXPORT, K as SUFFIX_GET, Fe as SUFFIX_LIST, Ie as SUFFIX_RANGE, Ve as SUFFIX_REMOVE, Re as SUFFIX_SET, G as SUFFIX_TEMPLATE, ze as SUFFIX_UNSET, Ne as SUFFIX_UPDATE, q as SUFFIX_VALIDATE, e as ValidationError, Ze as createJudoRestApi, ot as createModelAwareDeserializer, rt as createModelAwareSerializer, at as deserializeTemporalValue, Se as executeWithLifecycle, U as getActionHandler, Z as getClassPath, Q as getMutationRelationPath, $ as getOperationPath, Y as getPathForActor, X as getRelationPath, De as hasActionHandler, we as hasActionHandlerRegistry, it as parseLocalDate, nt as serializeTemporalValue, Te as useActionDispatcher, Ee as useActionHandler, de as useAddActionHandler, be as useApi, _e as useAutocompleteAddActionHandler, B as useAutocompleteRangeActionHandler, V as useAutocompleteSetActionHandler, c as useBackActionHandler, F as useBulkCallOperationActionHandler, oe as useBulkDeleteActionHandler, pe as useBulkRemoveActionHandler, P as useCallOperationActionHandler, d as useCancelActionHandler, w as useClearActionHandler, re as useCreateActionHandler, ve as useCustomActionHandler, ae as useDeleteActionHandler, O as useExportActionHandler, D as useFilterActionHandler, E as useFilterRelationActionHandler, ce as useGetTemplateActionHandler, k as useInlineCreateRowActionHandler, I as useInputFormCallOperationActionHandler, L as useInputSelectorCallOperationActionHandler, _ as useOpenAddSelectorActionHandler, p as useOpenCreateFormActionHandler, f as useOpenFormActionHandler, m as useOpenOperationInputFormActionHandler, y as useOpenOperationInputSelectorActionHandler, l as useOpenPageActionHandler, g as useOpenSelectorActionHandler, v as useOpenSetSelectorActionHandler, R as useParameterlessCallOperationActionHandler, H as usePreFetchActionHandler, S as useRefreshActionHandler, T as useRefreshRelationActionHandler, fe as useRemoveActionHandler, se as useRowDeleteActionHandler, u as useRowOpenPageActionHandler, ee as useSelectorRangeActionHandler, le as useSetActionHandler, ue as useUnsetActionHandler, ie as useUpdateActionHandler };
|