@ram_28/kf-ai-sdk 2.0.20-beta.0 → 2.0.20-beta.2
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/{FileField-BWrSHNRq.js → FileField-CZjS2uLh.js} +3 -3
- package/dist/{FileField-eDeuzln8.cjs → FileField-DU4UWo_t.cjs} +1 -1
- package/dist/bdo/core/Item.d.ts +0 -4
- package/dist/bdo/core/Item.d.ts.map +1 -1
- package/dist/bdo/fields/ReferenceField.d.ts +1 -1
- package/dist/bdo/fields/ReferenceField.d.ts.map +1 -1
- package/dist/bdo/fields/SelectField.d.ts +1 -1
- package/dist/bdo/fields/SelectField.d.ts.map +1 -1
- package/dist/bdo/fields/UserField.d.ts +1 -1
- package/dist/bdo/fields/UserField.d.ts.map +1 -1
- package/dist/bdo.cjs +1 -1
- package/dist/bdo.mjs +298 -286
- package/dist/components/hooks/useBDOForm/createItemProxy.d.ts +2 -3
- package/dist/components/hooks/useBDOForm/createItemProxy.d.ts.map +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +226 -243
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.mjs +1 -1
- package/package.json +1 -1
- package/sdk/bdo/core/Item.ts +1 -11
- package/sdk/bdo/expressions/evaluator.ts +51 -9
- package/sdk/bdo/fields/ReferenceField.ts +1 -1
- package/sdk/bdo/fields/SelectField.ts +1 -1
- package/sdk/bdo/fields/UserField.ts +1 -1
- package/sdk/components/hooks/useBDOForm/createItemProxy.ts +18 -63
package/dist/bdo.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { a as
|
|
5
|
-
import { v, e as
|
|
6
|
-
import { S as F, D as
|
|
7
|
-
import { a as
|
|
8
|
-
import { d as
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var D = (t, e, r) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var m = (t, e, r) => D(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { a as o } from "./client-_ayziI1d.js";
|
|
5
|
+
import { v as E, e as v } from "./attachment-constants-C2UHWxmp.js";
|
|
6
|
+
import { S as F, D as A, U, B as T } from "./FileField-CZjS2uLh.js";
|
|
7
|
+
import { a as Q, b as Z, F as ee, N as te, R as re, c as ae, T as se, T as ne } from "./FileField-CZjS2uLh.js";
|
|
8
|
+
import { d as oe } from "./constants-ConHc1oS.js";
|
|
9
9
|
class w {
|
|
10
|
-
constructor(e,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return this._bdo = e, this._data = { ...
|
|
10
|
+
constructor(e, r) {
|
|
11
|
+
m(this, "_data");
|
|
12
|
+
m(this, "_bdo");
|
|
13
|
+
m(this, "_accessorCache", /* @__PURE__ */ new Map());
|
|
14
|
+
return this._bdo = e, this._data = { ...r }, new Proxy(this, {
|
|
15
15
|
get(a, s, n) {
|
|
16
16
|
return s === "validate" || s === "toJSON" || s === "_bdo" || s === "_data" || s === "_accessorCache" || s === "_getAccessor" || s === "_requireInstanceId" || typeof s == "symbol" ? Reflect.get(a, s, n) : s === "_id" ? a._data._id : a._getAccessor(s);
|
|
17
17
|
},
|
|
@@ -41,17 +41,8 @@ class w {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Require instanceId or throw.
|
|
46
|
-
* TODO: Support create flow via draftInteraction to get temp _id
|
|
47
|
-
*/
|
|
48
44
|
_requireInstanceId() {
|
|
49
|
-
|
|
50
|
-
if (!e)
|
|
51
|
-
throw new Error(
|
|
52
|
-
"Cannot perform attachment operation: item has no _id. Save the item first."
|
|
53
|
-
);
|
|
54
|
-
return e;
|
|
45
|
+
return this._data._id || "draft";
|
|
55
46
|
}
|
|
56
47
|
/**
|
|
57
48
|
* Get or create a field accessor for the given field.
|
|
@@ -64,7 +55,7 @@ class w {
|
|
|
64
55
|
_id: e,
|
|
65
56
|
Name: e,
|
|
66
57
|
Type: "String"
|
|
67
|
-
}, n = (a == null ? void 0 : a.readOnly) ?? !1,
|
|
58
|
+
}, n = (a == null ? void 0 : a.readOnly) ?? !1, i = () => {
|
|
68
59
|
if (a) {
|
|
69
60
|
const h = a.validate(this._data[e]);
|
|
70
61
|
if (!h.valid)
|
|
@@ -75,153 +66,153 @@ class w {
|
|
|
75
66
|
this._data[e],
|
|
76
67
|
this.toJSON()
|
|
77
68
|
) : { valid: !0, errors: [] };
|
|
78
|
-
},
|
|
79
|
-
const
|
|
80
|
-
return
|
|
69
|
+
}, l = (h) => {
|
|
70
|
+
const y = this._data[e];
|
|
71
|
+
return y ?? h;
|
|
81
72
|
};
|
|
82
|
-
let
|
|
83
|
-
if (n ?
|
|
73
|
+
let f;
|
|
74
|
+
if (n ? f = {
|
|
84
75
|
label: (a == null ? void 0 : a.label) ?? e,
|
|
85
76
|
required: (a == null ? void 0 : a.required) ?? !1,
|
|
86
77
|
readOnly: !0,
|
|
87
78
|
defaultValue: a == null ? void 0 : a.defaultValue,
|
|
88
79
|
meta: s,
|
|
89
80
|
get: () => this._data[e],
|
|
90
|
-
getOrDefault:
|
|
91
|
-
validate:
|
|
92
|
-
} :
|
|
81
|
+
getOrDefault: l,
|
|
82
|
+
validate: i
|
|
83
|
+
} : f = {
|
|
93
84
|
label: (a == null ? void 0 : a.label) ?? e,
|
|
94
85
|
required: (a == null ? void 0 : a.required) ?? !1,
|
|
95
86
|
readOnly: !1,
|
|
96
87
|
defaultValue: a == null ? void 0 : a.defaultValue,
|
|
97
88
|
meta: s,
|
|
98
89
|
get: () => this._data[e],
|
|
99
|
-
getOrDefault:
|
|
90
|
+
getOrDefault: l,
|
|
100
91
|
set: (h) => {
|
|
101
92
|
this._data[e] = h;
|
|
102
93
|
},
|
|
103
|
-
validate:
|
|
94
|
+
validate: i
|
|
104
95
|
}, s.Type === "Image" || s.Type === "File") {
|
|
105
|
-
const h = this._bdo.getBoId(),
|
|
106
|
-
s.Type === "Image" ? (
|
|
107
|
-
const
|
|
96
|
+
const h = this._bdo.getBoId(), y = f;
|
|
97
|
+
s.Type === "Image" ? (y.getDownloadUrl = async (u) => {
|
|
98
|
+
const d = this._requireInstanceId(), _ = this._data[e];
|
|
108
99
|
if (!(_ != null && _._id))
|
|
109
100
|
throw new Error(`${e} has no image to download`);
|
|
110
|
-
return
|
|
111
|
-
|
|
101
|
+
return o(h).getDownloadUrl(
|
|
102
|
+
d,
|
|
112
103
|
e,
|
|
113
104
|
_._id,
|
|
114
|
-
|
|
105
|
+
u
|
|
115
106
|
);
|
|
116
|
-
}, n || (
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
FileName:
|
|
120
|
-
Size:
|
|
121
|
-
FileExtension:
|
|
122
|
-
}, [
|
|
123
|
-
|
|
107
|
+
}, n || (y.upload = async (u) => {
|
|
108
|
+
E(u.name, "Image");
|
|
109
|
+
const d = this._requireInstanceId(), _ = {
|
|
110
|
+
FileName: u.name,
|
|
111
|
+
Size: u.size,
|
|
112
|
+
FileExtension: v(u.name)
|
|
113
|
+
}, [c] = await o(h).getUploadUrl(
|
|
114
|
+
d,
|
|
124
115
|
e,
|
|
125
116
|
[_]
|
|
126
117
|
);
|
|
127
|
-
await fetch(
|
|
118
|
+
await fetch(c.UploadUrl.URL, {
|
|
128
119
|
method: "PUT",
|
|
129
|
-
headers: { "Content-Type":
|
|
130
|
-
body:
|
|
120
|
+
headers: { "Content-Type": c.ContentType },
|
|
121
|
+
body: u
|
|
131
122
|
});
|
|
132
|
-
const
|
|
133
|
-
_id:
|
|
134
|
-
_name:
|
|
135
|
-
FileName:
|
|
136
|
-
FileExtension:
|
|
137
|
-
Size:
|
|
138
|
-
ContentType:
|
|
123
|
+
const b = {
|
|
124
|
+
_id: c._id,
|
|
125
|
+
_name: c._name,
|
|
126
|
+
FileName: c.FileName,
|
|
127
|
+
FileExtension: c.FileExtension,
|
|
128
|
+
Size: c.Size,
|
|
129
|
+
ContentType: c.ContentType
|
|
139
130
|
};
|
|
140
|
-
return this._data[e] =
|
|
141
|
-
},
|
|
142
|
-
const
|
|
143
|
-
if (!(
|
|
131
|
+
return this._data[e] = b, b;
|
|
132
|
+
}, y.deleteAttachment = async () => {
|
|
133
|
+
const u = this._requireInstanceId(), d = this._data[e];
|
|
134
|
+
if (!(d != null && d._id))
|
|
144
135
|
throw new Error(`${e} has no image to delete`);
|
|
145
|
-
await
|
|
146
|
-
})) : (
|
|
136
|
+
await o(h).deleteAttachment(u, e, d._id), this._data[e] = null;
|
|
137
|
+
})) : (y.getDownloadUrl = async (u, d) => {
|
|
147
138
|
const _ = this._requireInstanceId();
|
|
148
|
-
return
|
|
139
|
+
return o(h).getDownloadUrl(
|
|
149
140
|
_,
|
|
150
141
|
e,
|
|
151
|
-
|
|
152
|
-
|
|
142
|
+
u,
|
|
143
|
+
d
|
|
153
144
|
);
|
|
154
|
-
},
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
}, n || (
|
|
158
|
-
for (const
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
FileName:
|
|
162
|
-
Size:
|
|
163
|
-
FileExtension:
|
|
164
|
-
})),
|
|
165
|
-
|
|
145
|
+
}, y.getDownloadUrls = async (u) => {
|
|
146
|
+
const d = this._requireInstanceId();
|
|
147
|
+
return o(h).getDownloadUrls(d, e, u);
|
|
148
|
+
}, n || (y.upload = async (u) => {
|
|
149
|
+
for (const p of u)
|
|
150
|
+
E(p.name, "File");
|
|
151
|
+
const d = this._requireInstanceId(), _ = u.map((p) => ({
|
|
152
|
+
FileName: p.name,
|
|
153
|
+
Size: p.size,
|
|
154
|
+
FileExtension: v(p.name)
|
|
155
|
+
})), c = await o(h).getUploadUrl(
|
|
156
|
+
d,
|
|
166
157
|
e,
|
|
167
158
|
_
|
|
168
|
-
),
|
|
169
|
-
|
|
159
|
+
), b = await Promise.all(
|
|
160
|
+
u.map(async (p, N) => (await fetch(c[N].UploadUrl.URL, {
|
|
170
161
|
method: "PUT",
|
|
171
|
-
headers: { "Content-Type":
|
|
172
|
-
body:
|
|
162
|
+
headers: { "Content-Type": c[N].ContentType },
|
|
163
|
+
body: p
|
|
173
164
|
}), {
|
|
174
|
-
_id:
|
|
175
|
-
_name:
|
|
176
|
-
FileName:
|
|
177
|
-
FileExtension:
|
|
178
|
-
Size:
|
|
179
|
-
ContentType:
|
|
165
|
+
_id: c[N]._id,
|
|
166
|
+
_name: c[N]._name,
|
|
167
|
+
FileName: c[N].FileName,
|
|
168
|
+
FileExtension: c[N].FileExtension,
|
|
169
|
+
Size: c[N].Size,
|
|
170
|
+
ContentType: c[N].ContentType
|
|
180
171
|
}))
|
|
181
|
-
),
|
|
172
|
+
), S = this._data[e] ?? [];
|
|
182
173
|
return this._data[e] = [
|
|
183
|
-
...
|
|
184
|
-
...
|
|
185
|
-
],
|
|
186
|
-
},
|
|
187
|
-
const
|
|
188
|
-
await
|
|
189
|
-
|
|
174
|
+
...S,
|
|
175
|
+
...b
|
|
176
|
+
], b;
|
|
177
|
+
}, y.deleteAttachment = async (u) => {
|
|
178
|
+
const d = this._requireInstanceId();
|
|
179
|
+
await o(h).deleteAttachment(
|
|
180
|
+
d,
|
|
190
181
|
e,
|
|
191
|
-
|
|
182
|
+
u
|
|
192
183
|
);
|
|
193
184
|
const _ = this._data[e] ?? [];
|
|
194
185
|
this._data[e] = _.filter(
|
|
195
|
-
(
|
|
186
|
+
(c) => c._id !== u
|
|
196
187
|
);
|
|
197
188
|
}));
|
|
198
189
|
}
|
|
199
|
-
return this._accessorCache.set(e,
|
|
190
|
+
return this._accessorCache.set(e, f), f;
|
|
200
191
|
}
|
|
201
192
|
/**
|
|
202
193
|
* Validate all fields and return combined results
|
|
203
194
|
*/
|
|
204
195
|
validate() {
|
|
205
|
-
const e = this._bdo.getFields(),
|
|
196
|
+
const e = this._bdo.getFields(), r = [], a = this.toJSON();
|
|
206
197
|
for (const [s, n] of Object.entries(e)) {
|
|
207
198
|
if (n.readOnly) continue;
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
210
|
-
|
|
199
|
+
const i = this._data[s], l = n.validate(i);
|
|
200
|
+
if (!l.valid) {
|
|
201
|
+
r.push(...l.errors);
|
|
211
202
|
continue;
|
|
212
203
|
}
|
|
213
204
|
if (this._bdo.hasMetadata()) {
|
|
214
|
-
const
|
|
205
|
+
const f = this._bdo.validateFieldExpression(
|
|
215
206
|
s,
|
|
216
|
-
|
|
207
|
+
i,
|
|
217
208
|
a
|
|
218
209
|
);
|
|
219
|
-
|
|
210
|
+
f.valid || r.push(...f.errors);
|
|
220
211
|
}
|
|
221
212
|
}
|
|
222
213
|
return {
|
|
223
|
-
valid:
|
|
224
|
-
errors:
|
|
214
|
+
valid: r.length === 0,
|
|
215
|
+
errors: r
|
|
225
216
|
};
|
|
226
217
|
}
|
|
227
218
|
/**
|
|
@@ -231,7 +222,7 @@ class w {
|
|
|
231
222
|
return { ...this._data };
|
|
232
223
|
}
|
|
233
224
|
}
|
|
234
|
-
const
|
|
225
|
+
const C = {
|
|
235
226
|
// ============================================================
|
|
236
227
|
// STRING FUNCTIONS (7)
|
|
237
228
|
// ============================================================
|
|
@@ -239,27 +230,27 @@ const R = {
|
|
|
239
230
|
* Concatenate multiple values into a single string
|
|
240
231
|
* @example CONCAT("Hello", " ", "World") => "Hello World"
|
|
241
232
|
*/
|
|
242
|
-
CONCAT: (...
|
|
233
|
+
CONCAT: (...t) => t.map((e) => String(e ?? "")).join(""),
|
|
243
234
|
/**
|
|
244
235
|
* Convert string to uppercase
|
|
245
236
|
* @example UPPER("hello") => "HELLO"
|
|
246
237
|
*/
|
|
247
|
-
UPPER: (
|
|
238
|
+
UPPER: (t) => String(t ?? "").toUpperCase(),
|
|
248
239
|
/**
|
|
249
240
|
* Convert string to lowercase
|
|
250
241
|
* @example LOWER("HELLO") => "hello"
|
|
251
242
|
*/
|
|
252
|
-
LOWER: (
|
|
243
|
+
LOWER: (t) => String(t ?? "").toLowerCase(),
|
|
253
244
|
/**
|
|
254
245
|
* Remove leading and trailing whitespace
|
|
255
246
|
* @example TRIM(" hello ") => "hello"
|
|
256
247
|
*/
|
|
257
|
-
TRIM: (
|
|
248
|
+
TRIM: (t) => String(t ?? "").trim(),
|
|
258
249
|
/**
|
|
259
250
|
* Get the length of a string
|
|
260
251
|
* @example LENGTH("hello") => 5
|
|
261
252
|
*/
|
|
262
|
-
LENGTH: (
|
|
253
|
+
LENGTH: (t) => String(t ?? "").length,
|
|
263
254
|
/**
|
|
264
255
|
* Extract a substring
|
|
265
256
|
* @param str - Source string
|
|
@@ -267,15 +258,15 @@ const R = {
|
|
|
267
258
|
* @param len - Optional length of substring
|
|
268
259
|
* @example SUBSTRING("hello", 1, 3) => "ell"
|
|
269
260
|
*/
|
|
270
|
-
SUBSTRING: (
|
|
261
|
+
SUBSTRING: (t, e, r) => String(t ?? "").substring(
|
|
271
262
|
e,
|
|
272
|
-
|
|
263
|
+
r !== void 0 ? e + r : void 0
|
|
273
264
|
),
|
|
274
265
|
/**
|
|
275
266
|
* Replace occurrences of a substring
|
|
276
267
|
* @example REPLACE("hello", "l", "L") => "heLlo" (first occurrence only)
|
|
277
268
|
*/
|
|
278
|
-
REPLACE: (
|
|
269
|
+
REPLACE: (t, e, r) => String(t ?? "").replace(e, r),
|
|
279
270
|
// ============================================================
|
|
280
271
|
// MATH FUNCTIONS (8)
|
|
281
272
|
// ============================================================
|
|
@@ -283,51 +274,51 @@ const R = {
|
|
|
283
274
|
* Sum all numeric arguments
|
|
284
275
|
* @example SUM(1, 2, 3) => 6
|
|
285
276
|
*/
|
|
286
|
-
SUM: (...
|
|
277
|
+
SUM: (...t) => t.reduce((e, r) => e + (Number(r) || 0), 0),
|
|
287
278
|
/**
|
|
288
279
|
* Calculate average of numeric arguments
|
|
289
280
|
* @example AVG(1, 2, 3) => 2
|
|
290
281
|
*/
|
|
291
|
-
AVG: (...
|
|
292
|
-
const e =
|
|
293
|
-
return e.length === 0 ? 0 : e.reduce((
|
|
282
|
+
AVG: (...t) => {
|
|
283
|
+
const e = t.filter((r) => r != null && !isNaN(Number(r)));
|
|
284
|
+
return e.length === 0 ? 0 : e.reduce((r, a) => r + Number(a), 0) / e.length;
|
|
294
285
|
},
|
|
295
286
|
/**
|
|
296
287
|
* Get minimum value
|
|
297
288
|
* @example MIN(1, 2, 3) => 1
|
|
298
289
|
*/
|
|
299
|
-
MIN: (...
|
|
300
|
-
const e =
|
|
290
|
+
MIN: (...t) => {
|
|
291
|
+
const e = t.filter((r) => r != null && !isNaN(Number(r))).map((r) => Number(r));
|
|
301
292
|
return e.length === 0 ? 0 : Math.min(...e);
|
|
302
293
|
},
|
|
303
294
|
/**
|
|
304
295
|
* Get maximum value
|
|
305
296
|
* @example MAX(1, 2, 3) => 3
|
|
306
297
|
*/
|
|
307
|
-
MAX: (...
|
|
308
|
-
const e =
|
|
298
|
+
MAX: (...t) => {
|
|
299
|
+
const e = t.filter((r) => r != null && !isNaN(Number(r))).map((r) => Number(r));
|
|
309
300
|
return e.length === 0 ? 0 : Math.max(...e);
|
|
310
301
|
},
|
|
311
302
|
/**
|
|
312
303
|
* Get absolute value
|
|
313
304
|
* @example ABS(-5) => 5
|
|
314
305
|
*/
|
|
315
|
-
ABS: (
|
|
306
|
+
ABS: (t) => Math.abs(Number(t) || 0),
|
|
316
307
|
/**
|
|
317
308
|
* Round to nearest integer
|
|
318
309
|
* @example ROUND(1.5) => 2
|
|
319
310
|
*/
|
|
320
|
-
ROUND: (
|
|
311
|
+
ROUND: (t) => Math.round(Number(t) || 0),
|
|
321
312
|
/**
|
|
322
313
|
* Round down to nearest integer
|
|
323
314
|
* @example FLOOR(1.9) => 1
|
|
324
315
|
*/
|
|
325
|
-
FLOOR: (
|
|
316
|
+
FLOOR: (t) => Math.floor(Number(t) || 0),
|
|
326
317
|
/**
|
|
327
318
|
* Round up to nearest integer
|
|
328
319
|
* @example CEIL(1.1) => 2
|
|
329
320
|
*/
|
|
330
|
-
CEIL: (
|
|
321
|
+
CEIL: (t) => Math.ceil(Number(t) || 0),
|
|
331
322
|
// ============================================================
|
|
332
323
|
// DATE FUNCTIONS (6)
|
|
333
324
|
// ============================================================
|
|
@@ -335,51 +326,51 @@ const R = {
|
|
|
335
326
|
* Extract year from date
|
|
336
327
|
* @example YEAR("2024-01-15") => 2024
|
|
337
328
|
*/
|
|
338
|
-
YEAR: (
|
|
339
|
-
const e = new Date(
|
|
329
|
+
YEAR: (t) => {
|
|
330
|
+
const e = new Date(t);
|
|
340
331
|
return isNaN(e.getTime()) ? 0 : e.getFullYear();
|
|
341
332
|
},
|
|
342
333
|
/**
|
|
343
334
|
* Extract month from date (1-12)
|
|
344
335
|
* @example MONTH("2024-01-15") => 1
|
|
345
336
|
*/
|
|
346
|
-
MONTH: (
|
|
347
|
-
const e = new Date(
|
|
337
|
+
MONTH: (t) => {
|
|
338
|
+
const e = new Date(t);
|
|
348
339
|
return isNaN(e.getTime()) ? 0 : e.getMonth() + 1;
|
|
349
340
|
},
|
|
350
341
|
/**
|
|
351
342
|
* Extract day of month from date (1-31)
|
|
352
343
|
* @example DAY("2024-01-15") => 15
|
|
353
344
|
*/
|
|
354
|
-
DAY: (
|
|
355
|
-
const e = new Date(
|
|
345
|
+
DAY: (t) => {
|
|
346
|
+
const e = new Date(t);
|
|
356
347
|
return isNaN(e.getTime()) ? 0 : e.getDate();
|
|
357
348
|
},
|
|
358
349
|
/**
|
|
359
350
|
* Calculate difference in days between two dates
|
|
360
351
|
* @example DATE_DIFF("2024-01-15", "2024-01-10") => 5
|
|
361
352
|
*/
|
|
362
|
-
DATE_DIFF: (
|
|
363
|
-
const
|
|
364
|
-
if (isNaN(
|
|
365
|
-
const s = Math.abs(
|
|
353
|
+
DATE_DIFF: (t, e) => {
|
|
354
|
+
const r = new Date(t), a = new Date(e);
|
|
355
|
+
if (isNaN(r.getTime()) || isNaN(a.getTime())) return 0;
|
|
356
|
+
const s = Math.abs(r.getTime() - a.getTime());
|
|
366
357
|
return Math.ceil(s / (1e3 * 60 * 60 * 24));
|
|
367
358
|
},
|
|
368
359
|
/**
|
|
369
360
|
* Add days to a date
|
|
370
361
|
* @example ADD_DAYS("2024-01-15", 5) => Date("2024-01-20")
|
|
371
362
|
*/
|
|
372
|
-
ADD_DAYS: (
|
|
373
|
-
const
|
|
374
|
-
return isNaN(
|
|
363
|
+
ADD_DAYS: (t, e) => {
|
|
364
|
+
const r = new Date(t);
|
|
365
|
+
return isNaN(r.getTime()) ? /* @__PURE__ */ new Date(NaN) : (r.setDate(r.getDate() + e), r);
|
|
375
366
|
},
|
|
376
367
|
/**
|
|
377
368
|
* Add months to a date
|
|
378
369
|
* @example ADD_MONTHS("2024-01-15", 2) => Date("2024-03-15")
|
|
379
370
|
*/
|
|
380
|
-
ADD_MONTHS: (
|
|
381
|
-
const
|
|
382
|
-
return isNaN(
|
|
371
|
+
ADD_MONTHS: (t, e) => {
|
|
372
|
+
const r = new Date(t);
|
|
373
|
+
return isNaN(r.getTime()) ? /* @__PURE__ */ new Date(NaN) : (r.setMonth(r.getMonth() + e), r);
|
|
383
374
|
},
|
|
384
375
|
// ============================================================
|
|
385
376
|
// CONDITIONAL FUNCTIONS (1)
|
|
@@ -388,7 +379,7 @@ const R = {
|
|
|
388
379
|
* Return value based on condition
|
|
389
380
|
* @example IF(true, "yes", "no") => "yes"
|
|
390
381
|
*/
|
|
391
|
-
IF: (
|
|
382
|
+
IF: (t, e, r) => t ? e : r,
|
|
392
383
|
// ============================================================
|
|
393
384
|
// SYSTEM FUNCTIONS (1)
|
|
394
385
|
// ============================================================
|
|
@@ -396,16 +387,16 @@ const R = {
|
|
|
396
387
|
* Generate a UUID v4
|
|
397
388
|
* @example UUID() => "550e8400-e29b-41d4-a716-446655440000"
|
|
398
389
|
*/
|
|
399
|
-
UUID: () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (
|
|
390
|
+
UUID: () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
400
391
|
const e = Math.random() * 16 | 0;
|
|
401
|
-
return (
|
|
392
|
+
return (t === "x" ? e : e & 3 | 8).toString(16);
|
|
402
393
|
})
|
|
403
394
|
};
|
|
404
|
-
function
|
|
405
|
-
const
|
|
395
|
+
function M() {
|
|
396
|
+
const t = /* @__PURE__ */ new Date();
|
|
406
397
|
return {
|
|
407
|
-
NOW:
|
|
408
|
-
TODAY: new Date(
|
|
398
|
+
NOW: t,
|
|
399
|
+
TODAY: new Date(t.getFullYear(), t.getMonth(), t.getDate()),
|
|
409
400
|
CURRENT_USER: {
|
|
410
401
|
// These would come from auth context in real usage
|
|
411
402
|
// For now, provide empty defaults
|
|
@@ -416,50 +407,71 @@ function C() {
|
|
|
416
407
|
}
|
|
417
408
|
};
|
|
418
409
|
}
|
|
419
|
-
function g(
|
|
420
|
-
var
|
|
421
|
-
switch (
|
|
410
|
+
function g(t, e) {
|
|
411
|
+
var r;
|
|
412
|
+
switch (t.Type) {
|
|
422
413
|
case "Literal":
|
|
423
|
-
return
|
|
414
|
+
return t.Value;
|
|
424
415
|
case "Identifier":
|
|
425
|
-
return e.formValues[
|
|
416
|
+
return e.formValues[t.Name];
|
|
426
417
|
case "SystemIdentifier":
|
|
427
|
-
return
|
|
418
|
+
return I(t, e);
|
|
428
419
|
case "BinaryExpression":
|
|
429
|
-
return
|
|
420
|
+
return V(t, e);
|
|
430
421
|
case "LogicalExpression":
|
|
431
|
-
return
|
|
422
|
+
return q(t, e);
|
|
432
423
|
case "CallExpression":
|
|
433
|
-
return
|
|
424
|
+
return j(t, e);
|
|
434
425
|
case "MemberExpression":
|
|
435
|
-
return
|
|
426
|
+
return P(t, e);
|
|
436
427
|
case "AssignmentExpression":
|
|
437
|
-
return ((
|
|
428
|
+
return ((r = t.Arguments) == null ? void 0 : r.length) === 1 ? g(t.Arguments[0], e) : void 0;
|
|
438
429
|
default:
|
|
439
|
-
throw new Error(`Unsupported expression type: ${
|
|
430
|
+
throw new Error(`Unsupported expression type: ${t.Type}`);
|
|
440
431
|
}
|
|
441
432
|
}
|
|
442
|
-
function
|
|
443
|
-
const
|
|
444
|
-
return
|
|
433
|
+
function I(t, e) {
|
|
434
|
+
const r = t.Name, a = e.systemValues[r];
|
|
435
|
+
return t.Property ? a && typeof a == "object" ? a[t.Property.Name] : void 0 : a;
|
|
436
|
+
}
|
|
437
|
+
const B = /^\d{4}-\d{2}-\d{2}([ T]\d{2}:\d{2}(:\d{2})?)?$/;
|
|
438
|
+
function O(t) {
|
|
439
|
+
if (t instanceof Date) return t.getTime();
|
|
440
|
+
if (typeof t == "string" && B.test(t)) {
|
|
441
|
+
const e = t.includes("T") || t.includes(" ") ? t.replace(" ", "T") : t + "T00:00:00";
|
|
442
|
+
return new Date(e).getTime();
|
|
443
|
+
}
|
|
444
|
+
return NaN;
|
|
445
|
+
}
|
|
446
|
+
function x(t, e) {
|
|
447
|
+
const r = O(t), a = O(e);
|
|
448
|
+
return !isNaN(r) && !isNaN(a) ? { l: r, r: a } : { l: Number(t), r: Number(e) };
|
|
445
449
|
}
|
|
446
|
-
function
|
|
447
|
-
if (!
|
|
450
|
+
function V(t, e) {
|
|
451
|
+
if (!t.Arguments || t.Arguments.length < 2)
|
|
448
452
|
throw new Error("BinaryExpression requires 2 arguments");
|
|
449
|
-
const [
|
|
450
|
-
switch (
|
|
453
|
+
const [r, a] = t.Arguments, s = g(r, e), n = g(a, e);
|
|
454
|
+
switch (t.Operator) {
|
|
451
455
|
case "==":
|
|
452
456
|
return s == n;
|
|
453
457
|
case "!=":
|
|
454
458
|
return s != n;
|
|
455
|
-
case "<":
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
case "
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
459
|
+
case "<": {
|
|
460
|
+
const { l: i, r: l } = x(s, n);
|
|
461
|
+
return i < l;
|
|
462
|
+
}
|
|
463
|
+
case "<=": {
|
|
464
|
+
const { l: i, r: l } = x(s, n);
|
|
465
|
+
return i <= l;
|
|
466
|
+
}
|
|
467
|
+
case ">": {
|
|
468
|
+
const { l: i, r: l } = x(s, n);
|
|
469
|
+
return i > l;
|
|
470
|
+
}
|
|
471
|
+
case ">=": {
|
|
472
|
+
const { l: i, r: l } = x(s, n);
|
|
473
|
+
return i >= l;
|
|
474
|
+
}
|
|
463
475
|
case "+":
|
|
464
476
|
return Number(s) + Number(n);
|
|
465
477
|
case "-":
|
|
@@ -471,50 +483,50 @@ function D(r, e) {
|
|
|
471
483
|
case "%":
|
|
472
484
|
return Number(s) % Number(n);
|
|
473
485
|
default:
|
|
474
|
-
throw new Error(`Unsupported binary operator: ${
|
|
486
|
+
throw new Error(`Unsupported binary operator: ${t.Operator}`);
|
|
475
487
|
}
|
|
476
488
|
}
|
|
477
|
-
function
|
|
478
|
-
if (!
|
|
489
|
+
function q(t, e) {
|
|
490
|
+
if (!t.Arguments || t.Arguments.length === 0)
|
|
479
491
|
throw new Error("LogicalExpression requires at least 1 argument");
|
|
480
|
-
const
|
|
481
|
-
switch (
|
|
492
|
+
const r = t.Arguments;
|
|
493
|
+
switch (t.Operator) {
|
|
482
494
|
case "AND":
|
|
483
|
-
return
|
|
495
|
+
return r.every((a) => !!g(a, e));
|
|
484
496
|
case "OR":
|
|
485
|
-
return
|
|
497
|
+
return r.some((a) => !!g(a, e));
|
|
486
498
|
case "!":
|
|
487
|
-
return !g(
|
|
499
|
+
return !g(r[0], e);
|
|
488
500
|
default:
|
|
489
|
-
throw new Error(`Unsupported logical operator: ${
|
|
501
|
+
throw new Error(`Unsupported logical operator: ${t.Operator}`);
|
|
490
502
|
}
|
|
491
503
|
}
|
|
492
|
-
function
|
|
493
|
-
if (!
|
|
504
|
+
function j(t, e) {
|
|
505
|
+
if (!t.Callee)
|
|
494
506
|
throw new Error("CallExpression requires a Callee");
|
|
495
|
-
const
|
|
496
|
-
if (!
|
|
497
|
-
throw new Error(`Unknown function: ${
|
|
498
|
-
const a = (
|
|
499
|
-
return
|
|
507
|
+
const r = C[t.Callee];
|
|
508
|
+
if (!r)
|
|
509
|
+
throw new Error(`Unknown function: ${t.Callee}`);
|
|
510
|
+
const a = (t.Arguments ?? []).map((s) => g(s, e));
|
|
511
|
+
return r(...a);
|
|
500
512
|
}
|
|
501
|
-
function
|
|
513
|
+
function P(t, e) {
|
|
502
514
|
var s, n;
|
|
503
|
-
if (!((s =
|
|
515
|
+
if (!((s = t.Arguments) != null && s.length))
|
|
504
516
|
return;
|
|
505
|
-
const
|
|
506
|
-
return a &&
|
|
517
|
+
const r = g(t.Arguments[0], e), a = (n = t.Arguments[0].Property) == null ? void 0 : n.Name;
|
|
518
|
+
return a && r && typeof r == "object" ? r[a] : r;
|
|
507
519
|
}
|
|
508
|
-
class
|
|
520
|
+
class L {
|
|
509
521
|
constructor() {
|
|
510
522
|
/**
|
|
511
523
|
* Map of field ID to its validation rules
|
|
512
524
|
*/
|
|
513
|
-
|
|
525
|
+
m(this, "fieldRules", /* @__PURE__ */ new Map());
|
|
514
526
|
/**
|
|
515
527
|
* The loaded BDO metadata
|
|
516
528
|
*/
|
|
517
|
-
|
|
529
|
+
m(this, "metadata", null);
|
|
518
530
|
}
|
|
519
531
|
/**
|
|
520
532
|
* Load metadata and extract field validation rules
|
|
@@ -527,20 +539,20 @@ class q {
|
|
|
527
539
|
* @param metadata - The BDO metadata from the backend
|
|
528
540
|
*/
|
|
529
541
|
loadMetadata(e) {
|
|
530
|
-
var
|
|
542
|
+
var r, a;
|
|
531
543
|
this.metadata = e, this.fieldRules.clear();
|
|
532
544
|
for (const [s, n] of Object.entries(e.Fields)) {
|
|
533
|
-
const
|
|
545
|
+
const i = [];
|
|
534
546
|
if (n.Validation && Array.isArray(n.Validation)) {
|
|
535
|
-
for (const
|
|
536
|
-
if (typeof
|
|
537
|
-
|
|
538
|
-
else if (typeof
|
|
539
|
-
const
|
|
540
|
-
|
|
547
|
+
for (const l of n.Validation)
|
|
548
|
+
if (typeof l == "object" && l.ExpressionTree)
|
|
549
|
+
i.push(l);
|
|
550
|
+
else if (typeof l == "string") {
|
|
551
|
+
const f = (a = (r = e.Rules) == null ? void 0 : r.Validation) == null ? void 0 : a[l];
|
|
552
|
+
f && i.push(f);
|
|
541
553
|
}
|
|
542
554
|
}
|
|
543
|
-
|
|
555
|
+
i.length > 0 && this.fieldRules.set(s, i);
|
|
544
556
|
}
|
|
545
557
|
}
|
|
546
558
|
/**
|
|
@@ -572,25 +584,25 @@ class q {
|
|
|
572
584
|
* @param allValues - All form field values (for cross-field validation)
|
|
573
585
|
* @returns ValidationResult with valid=true if all rules pass
|
|
574
586
|
*/
|
|
575
|
-
validateField(e,
|
|
587
|
+
validateField(e, r, a) {
|
|
576
588
|
const s = this.fieldRules.get(e);
|
|
577
589
|
if (!s || s.length === 0)
|
|
578
590
|
return { valid: !0, errors: [] };
|
|
579
591
|
const n = {
|
|
580
|
-
formValues: { ...a, [e]:
|
|
581
|
-
systemValues:
|
|
592
|
+
formValues: { ...a, [e]: r },
|
|
593
|
+
systemValues: M()
|
|
582
594
|
};
|
|
583
|
-
for (const
|
|
595
|
+
for (const i of s)
|
|
584
596
|
try {
|
|
585
|
-
if (!g(
|
|
597
|
+
if (!g(i.ExpressionTree, n))
|
|
586
598
|
return {
|
|
587
599
|
valid: !1,
|
|
588
|
-
errors: [
|
|
600
|
+
errors: [i.Message || `Validation failed: ${i.Name || i.Id}`]
|
|
589
601
|
};
|
|
590
|
-
} catch (
|
|
602
|
+
} catch (l) {
|
|
591
603
|
console.warn(
|
|
592
|
-
`Expression evaluation failed for rule ${
|
|
593
|
-
|
|
604
|
+
`Expression evaluation failed for rule ${i.Id}:`,
|
|
605
|
+
l
|
|
594
606
|
);
|
|
595
607
|
}
|
|
596
608
|
return { valid: !0, errors: [] };
|
|
@@ -605,44 +617,44 @@ class q {
|
|
|
605
617
|
* @returns ValidationResult with all collected errors
|
|
606
618
|
*/
|
|
607
619
|
validateAll(e) {
|
|
608
|
-
const
|
|
620
|
+
const r = [];
|
|
609
621
|
for (const a of this.fieldRules.keys()) {
|
|
610
622
|
const s = this.validateField(a, e[a], e);
|
|
611
|
-
s.valid ||
|
|
623
|
+
s.valid || r.push(...s.errors);
|
|
612
624
|
}
|
|
613
625
|
return {
|
|
614
|
-
valid:
|
|
615
|
-
errors:
|
|
626
|
+
valid: r.length === 0,
|
|
627
|
+
errors: r
|
|
616
628
|
};
|
|
617
629
|
}
|
|
618
630
|
}
|
|
619
|
-
class
|
|
631
|
+
class k {
|
|
620
632
|
constructor() {
|
|
621
633
|
// ============================================================
|
|
622
634
|
// SYSTEM FIELDS (inherited by all BDOs)
|
|
623
635
|
// ============================================================
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
636
|
+
m(this, "_id", new F({ _id: "_id", Name: "ID", Type: "String", ReadOnly: !0 }));
|
|
637
|
+
m(this, "_created_at", new A({ _id: "_created_at", Name: "Created At", Type: "DateTime", ReadOnly: !0 }));
|
|
638
|
+
m(this, "_modified_at", new A({ _id: "_modified_at", Name: "Modified At", Type: "DateTime", ReadOnly: !0 }));
|
|
639
|
+
m(this, "_created_by", new U({ _id: "_created_by", Name: "Created By", Type: "User", ReadOnly: !0 }));
|
|
640
|
+
m(this, "_modified_by", new U({ _id: "_modified_by", Name: "Modified By", Type: "User", ReadOnly: !0 }));
|
|
641
|
+
m(this, "_version", new F({ _id: "_version", Name: "Version", Type: "String", ReadOnly: !0 }));
|
|
642
|
+
m(this, "_m_version", new F({ _id: "_m_version", Name: "Metadata Version", Type: "String", ReadOnly: !0 }));
|
|
631
643
|
/**
|
|
632
644
|
* Whether fields have been bound to this BDO
|
|
633
645
|
*/
|
|
634
|
-
|
|
646
|
+
m(this, "_fieldsBound", !1);
|
|
635
647
|
/**
|
|
636
648
|
* Cached field map
|
|
637
649
|
*/
|
|
638
|
-
|
|
650
|
+
m(this, "_fieldsCache", null);
|
|
639
651
|
// ============================================================
|
|
640
652
|
// EXPRESSION ENGINE (for backend validation rules)
|
|
641
653
|
// ============================================================
|
|
642
654
|
/**
|
|
643
655
|
* Expression engine instance for evaluating backend validation rules
|
|
644
656
|
*/
|
|
645
|
-
|
|
657
|
+
m(this, "_expressionEngine", new L());
|
|
646
658
|
}
|
|
647
659
|
// ============================================================
|
|
648
660
|
// FIELD DEFINITIONS (auto-discovered)
|
|
@@ -662,13 +674,13 @@ class z {
|
|
|
662
674
|
if (this._fieldsCache)
|
|
663
675
|
return this._fieldsCache;
|
|
664
676
|
const e = {};
|
|
665
|
-
for (const
|
|
666
|
-
const a = this[
|
|
667
|
-
a instanceof
|
|
677
|
+
for (const r of Object.keys(this)) {
|
|
678
|
+
const a = this[r];
|
|
679
|
+
a instanceof T && (e[r] = a);
|
|
668
680
|
}
|
|
669
681
|
if (!this._fieldsBound) {
|
|
670
|
-
for (const
|
|
671
|
-
|
|
682
|
+
for (const r of Object.values(e))
|
|
683
|
+
r._parentBoId = this.meta._id;
|
|
672
684
|
this._fieldsBound = !0;
|
|
673
685
|
}
|
|
674
686
|
return this._fieldsCache = e, e;
|
|
@@ -705,8 +717,8 @@ class z {
|
|
|
705
717
|
* @param allValues - All form field values (for cross-field validation)
|
|
706
718
|
* @returns ValidationResultType from expression evaluation
|
|
707
719
|
*/
|
|
708
|
-
validateFieldExpression(e,
|
|
709
|
-
return this._expressionEngine.hasMetadata() ? this._expressionEngine.validateField(e,
|
|
720
|
+
validateFieldExpression(e, r, a) {
|
|
721
|
+
return this._expressionEngine.hasMetadata() ? this._expressionEngine.validateField(e, r, a) : { valid: !0, errors: [] };
|
|
710
722
|
}
|
|
711
723
|
// ============================================================
|
|
712
724
|
// READ OPERATIONS
|
|
@@ -715,14 +727,14 @@ class z {
|
|
|
715
727
|
* Get a single record by ID
|
|
716
728
|
*/
|
|
717
729
|
async get(e) {
|
|
718
|
-
const
|
|
719
|
-
return new w(this,
|
|
730
|
+
const r = await o(this.meta._id).get(e);
|
|
731
|
+
return new w(this, r);
|
|
720
732
|
}
|
|
721
733
|
/**
|
|
722
734
|
* List records with optional filtering, sorting, and pagination
|
|
723
735
|
*/
|
|
724
736
|
async list(e) {
|
|
725
|
-
return (await
|
|
737
|
+
return (await o(this.meta._id).list(e)).Data.map(
|
|
726
738
|
(a) => new w(this, a)
|
|
727
739
|
);
|
|
728
740
|
}
|
|
@@ -730,7 +742,7 @@ class z {
|
|
|
730
742
|
* Get count of records matching the filter criteria
|
|
731
743
|
*/
|
|
732
744
|
async count(e) {
|
|
733
|
-
return (await
|
|
745
|
+
return (await o(this.meta._id).count(e)).Count;
|
|
734
746
|
}
|
|
735
747
|
// ============================================================
|
|
736
748
|
// CREATE OPERATIONS
|
|
@@ -740,10 +752,10 @@ class z {
|
|
|
740
752
|
* Returns an Item with _id from API response + the input data as field accessors
|
|
741
753
|
*/
|
|
742
754
|
async create(e) {
|
|
743
|
-
const
|
|
755
|
+
const r = await o(this.meta._id).create(e);
|
|
744
756
|
return new w(
|
|
745
757
|
this,
|
|
746
|
-
{ ...e, _id:
|
|
758
|
+
{ ...e, _id: r._id }
|
|
747
759
|
);
|
|
748
760
|
}
|
|
749
761
|
// ============================================================
|
|
@@ -752,8 +764,8 @@ class z {
|
|
|
752
764
|
/**
|
|
753
765
|
* Update an existing record
|
|
754
766
|
*/
|
|
755
|
-
async update(e,
|
|
756
|
-
return
|
|
767
|
+
async update(e, r) {
|
|
768
|
+
return o(this.meta._id).update(e, r);
|
|
757
769
|
}
|
|
758
770
|
// ============================================================
|
|
759
771
|
// DELETE OPERATIONS
|
|
@@ -762,7 +774,7 @@ class z {
|
|
|
762
774
|
* Delete a record by ID
|
|
763
775
|
*/
|
|
764
776
|
async delete(e) {
|
|
765
|
-
return
|
|
777
|
+
return o(this.meta._id).delete(e);
|
|
766
778
|
}
|
|
767
779
|
// ============================================================
|
|
768
780
|
// DRAFT OPERATIONS (for useBDOForm integration)
|
|
@@ -771,14 +783,14 @@ class z {
|
|
|
771
783
|
* Create a draft - compute fields without persisting
|
|
772
784
|
*/
|
|
773
785
|
async draft(e) {
|
|
774
|
-
return
|
|
786
|
+
return o(this.meta._id).draft(e);
|
|
775
787
|
}
|
|
776
788
|
/**
|
|
777
789
|
* Interactive draft - create/update draft without instance ID
|
|
778
790
|
* Returns computed fields along with a temporary _id
|
|
779
791
|
*/
|
|
780
792
|
async draftInteraction(e) {
|
|
781
|
-
return
|
|
793
|
+
return o(this.meta._id).draftInteraction(e);
|
|
782
794
|
}
|
|
783
795
|
/**
|
|
784
796
|
* Create an Item wrapper for manipulating data with field accessors
|
|
@@ -790,14 +802,14 @@ class z {
|
|
|
790
802
|
/**
|
|
791
803
|
* Commit an update draft - finalize changes on an existing record
|
|
792
804
|
*/
|
|
793
|
-
async draftUpdate(e,
|
|
794
|
-
return
|
|
805
|
+
async draftUpdate(e, r) {
|
|
806
|
+
return o(this.meta._id).draftUpdate(e, r);
|
|
795
807
|
}
|
|
796
808
|
/**
|
|
797
809
|
* Patch an existing draft - compute fields during editing
|
|
798
810
|
*/
|
|
799
|
-
async draftPatch(e,
|
|
800
|
-
return
|
|
811
|
+
async draftPatch(e, r) {
|
|
812
|
+
return o(this.meta._id).draftPatch(e, r);
|
|
801
813
|
}
|
|
802
814
|
// ============================================================
|
|
803
815
|
// ANALYTICS OPERATIONS
|
|
@@ -806,13 +818,13 @@ class z {
|
|
|
806
818
|
* Get aggregated metrics grouped by dimensions
|
|
807
819
|
*/
|
|
808
820
|
async metric(e) {
|
|
809
|
-
return
|
|
821
|
+
return o(this.meta._id).metric(e);
|
|
810
822
|
}
|
|
811
823
|
/**
|
|
812
824
|
* Get pivot table data
|
|
813
825
|
*/
|
|
814
826
|
async pivot(e) {
|
|
815
|
-
return
|
|
827
|
+
return o(this.meta._id).pivot(e);
|
|
816
828
|
}
|
|
817
829
|
// ============================================================
|
|
818
830
|
// ATTACHMENT OPERATIONS
|
|
@@ -820,29 +832,29 @@ class z {
|
|
|
820
832
|
/**
|
|
821
833
|
* Get signed upload URLs for file/image attachments
|
|
822
834
|
*/
|
|
823
|
-
async getUploadUrl(e,
|
|
824
|
-
return
|
|
835
|
+
async getUploadUrl(e, r, a) {
|
|
836
|
+
return o(this.meta._id).getUploadUrl(e, r, a);
|
|
825
837
|
}
|
|
826
838
|
/**
|
|
827
839
|
* Get signed download URL for a single attachment
|
|
828
840
|
*/
|
|
829
|
-
async getDownloadUrl(e,
|
|
830
|
-
return
|
|
841
|
+
async getDownloadUrl(e, r, a, s) {
|
|
842
|
+
return o(this.meta._id).getDownloadUrl(e, r, a, s);
|
|
831
843
|
}
|
|
832
844
|
/**
|
|
833
845
|
* Get signed download URLs for all attachments on a field
|
|
834
846
|
*/
|
|
835
|
-
async getDownloadUrls(e,
|
|
836
|
-
return
|
|
847
|
+
async getDownloadUrls(e, r, a) {
|
|
848
|
+
return o(this.meta._id).getDownloadUrls(e, r, a);
|
|
837
849
|
}
|
|
838
850
|
/**
|
|
839
851
|
* Delete an attachment
|
|
840
852
|
*/
|
|
841
|
-
async deleteAttachment(e,
|
|
842
|
-
return
|
|
853
|
+
async deleteAttachment(e, r, a) {
|
|
854
|
+
return o(this.meta._id).deleteAttachment(e, r, a);
|
|
843
855
|
}
|
|
844
856
|
}
|
|
845
|
-
class
|
|
857
|
+
class G extends T {
|
|
846
858
|
constructor(e) {
|
|
847
859
|
super(e);
|
|
848
860
|
}
|
|
@@ -857,7 +869,7 @@ class J extends x {
|
|
|
857
869
|
} : { valid: !0, errors: [] };
|
|
858
870
|
}
|
|
859
871
|
}
|
|
860
|
-
class
|
|
872
|
+
class H extends T {
|
|
861
873
|
constructor(e) {
|
|
862
874
|
super(e);
|
|
863
875
|
}
|
|
@@ -872,7 +884,7 @@ class Y extends x {
|
|
|
872
884
|
} : { valid: !0, errors: [] };
|
|
873
885
|
}
|
|
874
886
|
}
|
|
875
|
-
class
|
|
887
|
+
class K extends T {
|
|
876
888
|
constructor(e) {
|
|
877
889
|
super(e);
|
|
878
890
|
}
|
|
@@ -887,21 +899,21 @@ class k extends x {
|
|
|
887
899
|
}
|
|
888
900
|
}
|
|
889
901
|
export {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
+
G as ArrayField,
|
|
903
|
+
k as BaseBdo,
|
|
904
|
+
T as BaseField,
|
|
905
|
+
Q as BooleanField,
|
|
906
|
+
Z as DateField,
|
|
907
|
+
A as DateTimeField,
|
|
908
|
+
ee as FileField,
|
|
909
|
+
K as ImageField,
|
|
910
|
+
te as NumberField,
|
|
911
|
+
H as ObjectField,
|
|
912
|
+
re as ReferenceField,
|
|
913
|
+
ae as SelectField,
|
|
902
914
|
F as StringField,
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
915
|
+
oe as SystemField,
|
|
916
|
+
se as TextAreaField,
|
|
917
|
+
ne as TextField,
|
|
906
918
|
U as UserField
|
|
907
919
|
};
|