@stonecrop/graphql-client 0.10.8 → 0.10.10
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/client.js +19 -5
- package/dist/graphql-client.d.ts +7 -6
- package/dist/graphql-client.js +57 -43
- package/dist/graphql-client.js.map +1 -1
- package/dist/src/client.d.ts +8 -8
- package/dist/src/client.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/client.ts +24 -10
package/dist/client.js
CHANGED
|
@@ -73,7 +73,14 @@ export class StonecropClient {
|
|
|
73
73
|
}
|
|
74
74
|
workflow {
|
|
75
75
|
states
|
|
76
|
-
actions
|
|
76
|
+
actions {
|
|
77
|
+
label
|
|
78
|
+
handler
|
|
79
|
+
requiredFields
|
|
80
|
+
allowedStates
|
|
81
|
+
confirm
|
|
82
|
+
args
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
85
|
inherits
|
|
79
86
|
listDoctype
|
|
@@ -117,7 +124,14 @@ export class StonecropClient {
|
|
|
117
124
|
}
|
|
118
125
|
workflow {
|
|
119
126
|
states
|
|
120
|
-
actions
|
|
127
|
+
actions {
|
|
128
|
+
label
|
|
129
|
+
handler
|
|
130
|
+
requiredFields
|
|
131
|
+
allowedStates
|
|
132
|
+
confirm
|
|
133
|
+
args
|
|
134
|
+
}
|
|
121
135
|
}
|
|
122
136
|
inherits
|
|
123
137
|
listDoctype
|
|
@@ -132,7 +146,7 @@ export class StonecropClient {
|
|
|
132
146
|
}
|
|
133
147
|
/**
|
|
134
148
|
* Get a single record by ID
|
|
135
|
-
* @param doctype - Doctype
|
|
149
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
136
150
|
* @param recordId - Record ID to fetch
|
|
137
151
|
*/
|
|
138
152
|
async getRecord(doctype, recordId) {
|
|
@@ -147,7 +161,7 @@ export class StonecropClient {
|
|
|
147
161
|
}
|
|
148
162
|
/**
|
|
149
163
|
* Get multiple records with optional filtering and pagination
|
|
150
|
-
* @param doctype - Doctype
|
|
164
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
151
165
|
* @param options - Query options (filters, orderBy, limit, offset)
|
|
152
166
|
*/
|
|
153
167
|
async getRecords(doctype, options) {
|
|
@@ -178,7 +192,7 @@ export class StonecropClient {
|
|
|
178
192
|
}
|
|
179
193
|
/**
|
|
180
194
|
* Execute a doctype action
|
|
181
|
-
* @param doctype - Doctype
|
|
195
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
182
196
|
* @param action - Action name to execute
|
|
183
197
|
* @param args - Action arguments
|
|
184
198
|
*/
|
package/dist/graphql-client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataClient } from '@stonecrop/schema';
|
|
2
2
|
import type { DoctypeContext } from '@stonecrop/schema';
|
|
3
3
|
import { DoctypeMeta } from '@stonecrop/schema';
|
|
4
|
+
import type { DoctypeRef } from '@stonecrop/schema';
|
|
4
5
|
|
|
5
6
|
export { DoctypeContext }
|
|
6
7
|
|
|
@@ -104,16 +105,16 @@ export declare class StonecropClient implements DataClient {
|
|
|
104
105
|
getAllMeta(): Promise<DoctypeMeta[]>;
|
|
105
106
|
/**
|
|
106
107
|
* Get a single record by ID
|
|
107
|
-
* @param doctype - Doctype
|
|
108
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
108
109
|
* @param recordId - Record ID to fetch
|
|
109
110
|
*/
|
|
110
|
-
getRecord(doctype:
|
|
111
|
+
getRecord(doctype: DoctypeRef, recordId: string): Promise<Record<string, unknown> | null>;
|
|
111
112
|
/**
|
|
112
113
|
* Get multiple records with optional filtering and pagination
|
|
113
|
-
* @param doctype - Doctype
|
|
114
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
114
115
|
* @param options - Query options (filters, orderBy, limit, offset)
|
|
115
116
|
*/
|
|
116
|
-
getRecords(doctype:
|
|
117
|
+
getRecords(doctype: DoctypeRef, options?: {
|
|
117
118
|
filters?: Record<string, unknown>;
|
|
118
119
|
orderBy?: string;
|
|
119
120
|
limit?: number;
|
|
@@ -121,11 +122,11 @@ export declare class StonecropClient implements DataClient {
|
|
|
121
122
|
}): Promise<Record<string, unknown>[]>;
|
|
122
123
|
/**
|
|
123
124
|
* Execute a doctype action
|
|
124
|
-
* @param doctype - Doctype
|
|
125
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
125
126
|
* @param action - Action name to execute
|
|
126
127
|
* @param args - Action arguments
|
|
127
128
|
*/
|
|
128
|
-
runAction(doctype:
|
|
129
|
+
runAction(doctype: DoctypeRef, action: string, args?: unknown[]): Promise<{
|
|
129
130
|
success: boolean;
|
|
130
131
|
data: unknown;
|
|
131
132
|
error: string | null;
|
package/dist/graphql-client.js
CHANGED
|
@@ -56,7 +56,7 @@ var ee = 9e15, z = 1e9, be = "0123456789abcdef", Ne = "2.30258509299404568401799
|
|
|
56
56
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
57
57
|
crypto: !1
|
|
58
58
|
// true/false
|
|
59
|
-
}, ct, G, y = !0, ve = "[DecimalError] ", Q = ve + "Invalid argument: ", ut = ve + "Precision limit exceeded", lt = ve + "crypto unavailable", ft = "[object Decimal]",
|
|
59
|
+
}, ct, G, y = !0, ve = "[DecimalError] ", Q = ve + "Invalid argument: ", ut = ve + "Precision limit exceeded", lt = ve + "crypto unavailable", ft = "[object Decimal]", F = Math.floor, k = Math.pow, bt = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Lt = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Ft = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, ht = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, V = 1e7, v = 7, Mt = 9007199254740991, Pt = Ne.length - 1, Fe = Te.length - 1, p = { toStringTag: ft };
|
|
60
60
|
p.absoluteValue = p.abs = function() {
|
|
61
61
|
var e = new this.constructor(this);
|
|
62
62
|
return e.s < 0 && (e.s = 1), T(e);
|
|
@@ -88,7 +88,7 @@ p.cosine = p.cos = function() {
|
|
|
88
88
|
p.cubeRoot = p.cbrt = function() {
|
|
89
89
|
var e, t, n, i, r, s, o, a, u, c, l = this, f = l.constructor;
|
|
90
90
|
if (!l.isFinite() || l.isZero()) return new f(l);
|
|
91
|
-
for (y = !1, s = l.s * k(l.s * l, 1 / 3), !s || Math.abs(s) == 1 / 0 ? (n = b(l.d), e = l.e, (s = (e - n.length + 1) % 3) && (n += s == 1 || s == -2 ? "0" : "00"), s = k(n, 1 / 3), e =
|
|
91
|
+
for (y = !1, s = l.s * k(l.s * l, 1 / 3), !s || Math.abs(s) == 1 / 0 ? (n = b(l.d), e = l.e, (s = (e - n.length + 1) % 3) && (n += s == 1 || s == -2 ? "0" : "00"), s = k(n, 1 / 3), e = F((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), i = new f(n), i.s = l.s) : i = new f(s.toString()), o = (e = f.precision) + 3; ; )
|
|
92
92
|
if (a = i, u = a.times(a).times(a), c = u.plus(l), i = S(c.plus(l).times(a), c.plus(u), o + 2, 1), b(a.d).slice(0, o) === (n = b(i.d)).slice(0, o))
|
|
93
93
|
if (n = n.slice(o - 3, o + 1), n == "9999" || !r && n == "4999") {
|
|
94
94
|
if (!r && (T(a, e + 1, 0), a.times(a).times(a).eq(l))) {
|
|
@@ -105,7 +105,7 @@ p.cubeRoot = p.cbrt = function() {
|
|
|
105
105
|
p.decimalPlaces = p.dp = function() {
|
|
106
106
|
var e, t = this.d, n = NaN;
|
|
107
107
|
if (t) {
|
|
108
|
-
if (e = t.length - 1, n = (e -
|
|
108
|
+
if (e = t.length - 1, n = (e - F(this.e / v)) * v, e = t[e], e) for (; e % 10 == 0; e /= 10) n--;
|
|
109
109
|
n < 0 && (n = 0);
|
|
110
110
|
}
|
|
111
111
|
return n;
|
|
@@ -180,11 +180,11 @@ p.inverseTangent = p.atan = function() {
|
|
|
180
180
|
if (c.isFinite()) {
|
|
181
181
|
if (c.isZero())
|
|
182
182
|
return new l(c);
|
|
183
|
-
if (c.abs().eq(1) && f + 4 <=
|
|
183
|
+
if (c.abs().eq(1) && f + 4 <= Fe)
|
|
184
184
|
return o = j(l, f + 4, h).times(0.25), o.s = c.s, o;
|
|
185
185
|
} else {
|
|
186
186
|
if (!c.s) return new l(NaN);
|
|
187
|
-
if (f + 4 <=
|
|
187
|
+
if (f + 4 <= Fe)
|
|
188
188
|
return o = j(l, f + 4, h).times(0.5), o.s = c.s, o;
|
|
189
189
|
}
|
|
190
190
|
for (l.precision = a = f + 10, l.rounding = 1, n = Math.min(28, a / v + 2 | 0), e = n; e; --e) c = c.div(c.times(c).plus(1).sqrt().plus(1));
|
|
@@ -196,7 +196,7 @@ p.isFinite = function() {
|
|
|
196
196
|
return !!this.d;
|
|
197
197
|
};
|
|
198
198
|
p.isInteger = p.isInt = function() {
|
|
199
|
-
return !!this.d &&
|
|
199
|
+
return !!this.d && F(this.e / v) > this.d.length - 2;
|
|
200
200
|
};
|
|
201
201
|
p.isNaN = function() {
|
|
202
202
|
return !this.s;
|
|
@@ -254,7 +254,7 @@ p.minus = p.sub = function(e) {
|
|
|
254
254
|
else return new N(u === 3 ? -0 : 0);
|
|
255
255
|
return y ? T(e, a, u) : e;
|
|
256
256
|
}
|
|
257
|
-
if (n =
|
|
257
|
+
if (n = F(e.e / v), l = F(m.e / v), c = c.slice(), s = l - n, s) {
|
|
258
258
|
for (f = s < 0, f ? (t = c, s = -s, o = h.length) : (t = h, n = l, o = c.length), i = Math.max(Math.ceil(a / v), o) + 2, s > i && (s = i, t.length = 1), t.reverse(), i = s; i--; ) t.push(0);
|
|
259
259
|
t.reverse();
|
|
260
260
|
} else {
|
|
@@ -282,7 +282,7 @@ p.modulo = p.mod = function(e) {
|
|
|
282
282
|
return e = new i(e), !n.d || !e.s || e.d && !e.d[0] ? new i(NaN) : !e.d || n.d && !n.d[0] ? T(new i(n), i.precision, i.rounding) : (y = !1, i.modulo == 9 ? (t = S(n, e.abs(), 0, 3, 1), t.s *= e.s) : t = S(n, e, 0, i.modulo, 1), t = t.times(e), y = !0, n.minus(t));
|
|
283
283
|
};
|
|
284
284
|
p.naturalExponential = p.exp = function() {
|
|
285
|
-
return
|
|
285
|
+
return Me(this);
|
|
286
286
|
};
|
|
287
287
|
p.naturalLogarithm = p.ln = function() {
|
|
288
288
|
return J(this);
|
|
@@ -299,7 +299,7 @@ p.plus = p.add = function(e) {
|
|
|
299
299
|
return e.s = -e.s, f.minus(e);
|
|
300
300
|
if (c = f.d, l = e.d, a = h.precision, u = h.rounding, !c[0] || !l[0])
|
|
301
301
|
return l[0] || (e = new h(f)), y ? T(e, a, u) : e;
|
|
302
|
-
if (s =
|
|
302
|
+
if (s = F(f.e / v), i = F(e.e / v), c = c.slice(), r = s - i, r) {
|
|
303
303
|
for (r < 0 ? (n = c, r = -r, o = l.length) : (n = l, i = s, o = c.length), s = Math.ceil(a / v), o = s > o ? s + 1 : o + 1, r > o && (r = o, n.length = 1), n.reverse(); r--; ) n.push(0);
|
|
304
304
|
n.reverse();
|
|
305
305
|
}
|
|
@@ -325,7 +325,7 @@ p.squareRoot = p.sqrt = function() {
|
|
|
325
325
|
var e, t, n, i, r, s, o = this, a = o.d, u = o.e, c = o.s, l = o.constructor;
|
|
326
326
|
if (c !== 1 || !a || !a[0])
|
|
327
327
|
return new l(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
|
|
328
|
-
for (y = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (t = b(a), (t.length + u) % 2 == 0 && (t += "0"), c = Math.sqrt(t), u =
|
|
328
|
+
for (y = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (t = b(a), (t.length + u) % 2 == 0 && (t += "0"), c = Math.sqrt(t), u = F((u + 1) / 2) - (u < 0 || u % 2), c == 1 / 0 ? t = "5e" + u : (t = c.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + u), i = new l(t)) : i = new l(c.toString()), n = (u = l.precision) + 3; ; )
|
|
329
329
|
if (s = i, i = s.plus(S(o, s, n + 2, 1)).times(0.5), b(s.d).slice(0, n) === (t = b(i.d)).slice(0, n))
|
|
330
330
|
if (t = t.slice(n - 3, n + 1), t == "9999" || !r && t == "4999") {
|
|
331
331
|
if (!r && (T(s, u + 1, 0), s.times(s).eq(o))) {
|
|
@@ -347,7 +347,7 @@ p.times = p.mul = function(e) {
|
|
|
347
347
|
var t, n, i, r, s, o, a, u, c, l = this, f = l.constructor, h = l.d, m = (e = new f(e)).d;
|
|
348
348
|
if (e.s *= l.s, !h || !h[0] || !m || !m[0])
|
|
349
349
|
return new f(!e.s || h && !h[0] && !m || m && !m[0] && !h ? NaN : !h || !m ? e.s / 0 : e.s * 0);
|
|
350
|
-
for (n =
|
|
350
|
+
for (n = F(l.e / v) + F(e.e / v), u = h.length, c = m.length, u < c && (s = h, h = m, m = s, o = u, u = c, c = o), s = [], o = u + c, i = o; i--; ) s.push(0);
|
|
351
351
|
for (i = c; --i >= 0; ) {
|
|
352
352
|
for (t = 0, r = u + i; r > i; )
|
|
353
353
|
a = s[r] + m[i] * h[r - i - 1] + t, s[r--] = a % V | 0, t = a / V | 0;
|
|
@@ -410,14 +410,14 @@ p.toPower = p.pow = function(e) {
|
|
|
410
410
|
if (!a.d || !e.d || !a.d[0] || !e.d[0]) return new u(k(+a, c));
|
|
411
411
|
if (a = new u(a), a.eq(1)) return a;
|
|
412
412
|
if (i = u.precision, s = u.rounding, e.eq(1)) return T(a, i, s);
|
|
413
|
-
if (t =
|
|
413
|
+
if (t = F(e.e / v), t >= e.d.length - 1 && (n = c < 0 ? -c : c) <= Mt)
|
|
414
414
|
return r = pt(u, a, n, i), e.s < 0 ? new u(1).div(r) : T(r, i, s);
|
|
415
415
|
if (o = a.s, o < 0) {
|
|
416
416
|
if (t < e.d.length - 1) return new u(NaN);
|
|
417
417
|
if ((e.d[t] & 1) == 0 && (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
418
418
|
return a.s = o, a;
|
|
419
419
|
}
|
|
420
|
-
return n = k(+a, c), t = n == 0 || !isFinite(n) ?
|
|
420
|
+
return n = k(+a, c), t = n == 0 || !isFinite(n) ? F(c * (Math.log("0." + b(a.d)) / Math.LN10 + a.e + 1)) : new u(n + "").e, t > u.maxE + 1 || t < u.minE - 1 ? new u(t > 0 ? o / 0 : 0) : (y = !1, u.rounding = a.s = 1, n = Math.min(12, (t + "").length), r = Me(e.times(J(a, i + n)), i), r.d && (r = T(r, i + 5, 1), ae(r.d, i, s) && (t = i + 10, r = T(Me(e.times(J(a, t + n)), t), t + 5, 1), +b(r.d).slice(i + 1, i + 15) + 1 == 1e14 && (r = T(r, i + 1, 0)))), r.s = o, y = !0, u.rounding = s, T(r, i, s));
|
|
421
421
|
};
|
|
422
422
|
p.toPrecision = function(e, t) {
|
|
423
423
|
var n, i = this, r = i.constructor;
|
|
@@ -501,7 +501,7 @@ var S = /* @__PURE__ */ (function() {
|
|
|
501
501
|
for (; !i[0] && i.length > 1; ) i.shift();
|
|
502
502
|
}
|
|
503
503
|
return function(i, r, s, o, a, u) {
|
|
504
|
-
var c, l, f, h, m, N, E, C, A,
|
|
504
|
+
var c, l, f, h, m, N, E, C, A, M, O, _, Y, q, W, ue, se, Se, B, le, fe = i.constructor, De = i.s == r.s ? 1 : -1, L = i.d, D = r.d;
|
|
505
505
|
if (!L || !L[0] || !D || !D[0])
|
|
506
506
|
return new fe(
|
|
507
507
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
@@ -510,28 +510,28 @@ var S = /* @__PURE__ */ (function() {
|
|
|
510
510
|
L && L[0] == 0 || !D ? De * 0 : De / 0
|
|
511
511
|
)
|
|
512
512
|
);
|
|
513
|
-
for (u ? (m = 1, l = i.e - r.e) : (u = V, m = v, l =
|
|
513
|
+
for (u ? (m = 1, l = i.e - r.e) : (u = V, m = v, l = F(i.e / m) - F(r.e / m)), B = D.length, se = L.length, A = new fe(De), M = A.d = [], f = 0; D[f] == (L[f] || 0); f++) ;
|
|
514
514
|
if (D[f] > (L[f] || 0) && l--, s == null ? (q = s = fe.precision, o = fe.rounding) : a ? q = s + (i.e - r.e) + 1 : q = s, q < 0)
|
|
515
|
-
|
|
515
|
+
M.push(1), N = !0;
|
|
516
516
|
else {
|
|
517
517
|
if (q = q / m + 2 | 0, f = 0, B == 1) {
|
|
518
518
|
for (h = 0, D = D[0], q++; (f < se || h) && q--; f++)
|
|
519
|
-
W = h * u + (L[f] || 0),
|
|
519
|
+
W = h * u + (L[f] || 0), M[f] = W / D | 0, h = W % D | 0;
|
|
520
520
|
N = h || f < se;
|
|
521
521
|
} else {
|
|
522
522
|
for (h = u / (D[0] + 1) | 0, h > 1 && (D = e(D, h, u), L = e(L, h, u), B = D.length, se = L.length), ue = B, O = L.slice(0, B), _ = O.length; _ < B; ) O[_++] = 0;
|
|
523
523
|
le = D.slice(), le.unshift(0), Se = D[0], D[1] >= u / 2 && ++Se;
|
|
524
524
|
do
|
|
525
|
-
h = 0, c = t(D, O, B, _), c < 0 ? (Y = O[0], B != _ && (Y = Y * u + (O[1] || 0)), h = Y / Se | 0, h > 1 ? (h >= u && (h = u - 1), E = e(D, h, u), C = E.length, _ = O.length, c = t(E, O, C, _), c == 1 && (h--, n(E, B < C ? le : D, C, u))) : (h == 0 && (c = h = 1), E = D.slice()), C = E.length, C < _ && E.unshift(0), n(O, E, _, u), c == -1 && (_ = O.length, c = t(D, O, B, _), c < 1 && (h++, n(O, B < _ ? le : D, _, u))), _ = O.length) : c === 0 && (h++, O = [0]),
|
|
525
|
+
h = 0, c = t(D, O, B, _), c < 0 ? (Y = O[0], B != _ && (Y = Y * u + (O[1] || 0)), h = Y / Se | 0, h > 1 ? (h >= u && (h = u - 1), E = e(D, h, u), C = E.length, _ = O.length, c = t(E, O, C, _), c == 1 && (h--, n(E, B < C ? le : D, C, u))) : (h == 0 && (c = h = 1), E = D.slice()), C = E.length, C < _ && E.unshift(0), n(O, E, _, u), c == -1 && (_ = O.length, c = t(D, O, B, _), c < 1 && (h++, n(O, B < _ ? le : D, _, u))), _ = O.length) : c === 0 && (h++, O = [0]), M[f++] = h, c && O[0] ? O[_++] = L[ue] || 0 : (O = [L[ue]], _ = 1);
|
|
526
526
|
while ((ue++ < se || O[0] !== void 0) && q--);
|
|
527
527
|
N = O[0] !== void 0;
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
M[0] || M.shift();
|
|
530
530
|
}
|
|
531
531
|
if (m == 1)
|
|
532
532
|
A.e = l, ct = N;
|
|
533
533
|
else {
|
|
534
|
-
for (f = 1, h =
|
|
534
|
+
for (f = 1, h = M[0]; h >= 10; h /= 10) f++;
|
|
535
535
|
A.e = f + l * m - 1, T(A, a ? s + A.e + 1 : s, o, N);
|
|
536
536
|
}
|
|
537
537
|
return A;
|
|
@@ -588,7 +588,7 @@ function we(e, t, n) {
|
|
|
588
588
|
return T(new e(Ne), t, 1, !0);
|
|
589
589
|
}
|
|
590
590
|
function j(e, t, n) {
|
|
591
|
-
if (t >
|
|
591
|
+
if (t > Fe) throw Error(ut);
|
|
592
592
|
return T(new e(Te), t, n, !0);
|
|
593
593
|
}
|
|
594
594
|
function dt(e) {
|
|
@@ -606,7 +606,7 @@ function H(e) {
|
|
|
606
606
|
function pt(e, t, n, i) {
|
|
607
607
|
var r, s = new e(1), o = Math.ceil(i / v + 4);
|
|
608
608
|
for (y = !1; ; ) {
|
|
609
|
-
if (n % 2 && (s = s.times(t), Qe(s.d, o) && (r = !0)), n =
|
|
609
|
+
if (n % 2 && (s = s.times(t), Qe(s.d, o) && (r = !0)), n = F(n / 2), n === 0) {
|
|
610
610
|
n = s.d.length - 1, r && s.d[n] === 0 && ++s.d[n];
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
@@ -627,7 +627,7 @@ function mt(e, t, n) {
|
|
|
627
627
|
}
|
|
628
628
|
return s;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function Me(e, t) {
|
|
631
631
|
var n, i, r, s, o, a, u, c = 0, l = 0, f = 0, h = e.constructor, m = h.rounding, N = h.precision;
|
|
632
632
|
if (!e.d || !e.d[0] || e.e > 17)
|
|
633
633
|
return new h(e.d ? e.d[0] ? e.s < 0 ? 0 : 1 / 0 : 1 : e.s ? e.s < 0 ? 0 : e : NaN);
|
|
@@ -648,7 +648,7 @@ function Fe(e, t) {
|
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
650
|
function J(e, t) {
|
|
651
|
-
var n, i, r, s, o, a, u, c, l, f, h, m = 1, N = 10, E = e, C = E.d, A = E.constructor,
|
|
651
|
+
var n, i, r, s, o, a, u, c, l, f, h, m = 1, N = 10, E = e, C = E.d, A = E.constructor, M = A.rounding, O = A.precision;
|
|
652
652
|
if (E.s < 0 || !C || !C[0] || !E.e && C[0] == 1 && C.length == 1)
|
|
653
653
|
return new A(C && !C[0] ? -1 / 0 : E.s != 1 ? NaN : C ? 0 : E);
|
|
654
654
|
if (t == null ? (y = !1, l = O) : l = t, A.precision = l += N, n = b(C), i = n.charAt(0), Math.abs(s = E.e) < 15e14) {
|
|
@@ -656,14 +656,14 @@ function J(e, t) {
|
|
|
656
656
|
E = E.times(e), n = b(E.d), i = n.charAt(0), m++;
|
|
657
657
|
s = E.e, i > 1 ? (E = new A("0." + n), s++) : E = new A(i + "." + n.slice(1));
|
|
658
658
|
} else
|
|
659
|
-
return c = we(A, l + 2, O).times(s + ""), E = J(new A(i + "." + n.slice(1)), l - N).plus(c), A.precision = O, t == null ? T(E, O,
|
|
659
|
+
return c = we(A, l + 2, O).times(s + ""), E = J(new A(i + "." + n.slice(1)), l - N).plus(c), A.precision = O, t == null ? T(E, O, M, y = !0) : E;
|
|
660
660
|
for (f = E, u = o = E = S(E.minus(1), E.plus(1), l, 1), h = T(E.times(E), l, 1), r = 3; ; ) {
|
|
661
661
|
if (o = T(o.times(h), l, 1), c = u.plus(S(o, new A(r), l, 1)), b(c.d).slice(0, l) === b(u.d).slice(0, l))
|
|
662
662
|
if (u = u.times(2), s !== 0 && (u = u.plus(we(A, l + 2, O).times(s + ""))), u = S(u, new A(m), l, 1), t == null)
|
|
663
|
-
if (ae(u.d, l - N,
|
|
663
|
+
if (ae(u.d, l - N, M, a))
|
|
664
664
|
A.precision = l += N, c = o = E = S(f.minus(1), f.plus(1), l, 1), h = T(E.times(E), l, 1), r = a = 1;
|
|
665
665
|
else
|
|
666
|
-
return T(u, A.precision = O,
|
|
666
|
+
return T(u, A.precision = O, M, y = !0);
|
|
667
667
|
else
|
|
668
668
|
return A.precision = O, u;
|
|
669
669
|
u = c, r += 2;
|
|
@@ -698,7 +698,7 @@ function Bt(e, t) {
|
|
|
698
698
|
n = 16, t = t.toLowerCase();
|
|
699
699
|
else if (bt.test(t))
|
|
700
700
|
n = 2;
|
|
701
|
-
else if (
|
|
701
|
+
else if (Ft.test(t))
|
|
702
702
|
n = 8;
|
|
703
703
|
else
|
|
704
704
|
throw Error(Q + t);
|
|
@@ -844,7 +844,7 @@ function Kt(e) {
|
|
|
844
844
|
];
|
|
845
845
|
for (t = 0; t < s.length; t += 3)
|
|
846
846
|
if (n = s[t], r && (this[n] = Le[n]), (i = e[n]) !== void 0)
|
|
847
|
-
if (
|
|
847
|
+
if (F(i) === i && i >= s[t + 1] && i <= s[t + 2]) this[n] = i;
|
|
848
848
|
else throw Error(Q + n + ": " + i);
|
|
849
849
|
if (n = "crypto", r && (this[n] = Le[n]), (i = e[n]) !== void 0)
|
|
850
850
|
if (i === !0 || i === !1 || i === 0 || i === 1)
|
|
@@ -1080,7 +1080,7 @@ function Pe(e, t) {
|
|
|
1080
1080
|
column: t + 1 - n
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Fn(e) {
|
|
1084
1084
|
return wt(
|
|
1085
1085
|
e.source,
|
|
1086
1086
|
Pe(e.source, e.start)
|
|
@@ -1113,7 +1113,7 @@ function We(e) {
|
|
|
1113
1113
|
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
1114
1114
|
`);
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function Mn(e) {
|
|
1117
1117
|
const t = e[0];
|
|
1118
1118
|
return t == null || "kind" in t || "length" in t ? {
|
|
1119
1119
|
nodes: t,
|
|
@@ -1165,7 +1165,7 @@ class Ge extends Error {
|
|
|
1165
1165
|
*/
|
|
1166
1166
|
constructor(t, ...n) {
|
|
1167
1167
|
var i, r, s;
|
|
1168
|
-
const { nodes: o, source: a, positions: u, path: c, originalError: l, extensions: f } =
|
|
1168
|
+
const { nodes: o, source: a, positions: u, path: c, originalError: l, extensions: f } = Mn(n);
|
|
1169
1169
|
super(t), this.name = "GraphQLError", this.path = c ?? void 0, this.originalError = l ?? void 0, this.nodes = Ke(
|
|
1170
1170
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
1171
1171
|
);
|
|
@@ -1215,7 +1215,7 @@ class Ge extends Error {
|
|
|
1215
1215
|
for (const n of this.nodes)
|
|
1216
1216
|
n.loc && (t += `
|
|
1217
1217
|
|
|
1218
|
-
` +
|
|
1218
|
+
` + Fn(n.loc));
|
|
1219
1219
|
else if (this.source && this.locations)
|
|
1220
1220
|
for (const n of this.locations)
|
|
1221
1221
|
t += `
|
|
@@ -3365,9 +3365,9 @@ function gi(e, t, n = yt) {
|
|
|
3365
3365
|
const h = [], m = [];
|
|
3366
3366
|
do {
|
|
3367
3367
|
a++;
|
|
3368
|
-
const A = a === o.length,
|
|
3368
|
+
const A = a === o.length, M = A && u.length !== 0;
|
|
3369
3369
|
if (A) {
|
|
3370
|
-
if (l = m.length === 0 ? void 0 : h[h.length - 1], c = f, f = m.pop(),
|
|
3370
|
+
if (l = m.length === 0 ? void 0 : h[h.length - 1], c = f, f = m.pop(), M)
|
|
3371
3371
|
if (s) {
|
|
3372
3372
|
c = c.slice();
|
|
3373
3373
|
let _ = 0;
|
|
@@ -3406,7 +3406,7 @@ function gi(e, t, n = yt) {
|
|
|
3406
3406
|
continue;
|
|
3407
3407
|
}
|
|
3408
3408
|
}
|
|
3409
|
-
if (O === void 0 &&
|
|
3409
|
+
if (O === void 0 && M && u.push([l, c]), A)
|
|
3410
3410
|
h.pop();
|
|
3411
3411
|
else {
|
|
3412
3412
|
var C;
|
|
@@ -4137,7 +4137,14 @@ class Li {
|
|
|
4137
4137
|
}
|
|
4138
4138
|
workflow {
|
|
4139
4139
|
states
|
|
4140
|
-
actions
|
|
4140
|
+
actions {
|
|
4141
|
+
label
|
|
4142
|
+
handler
|
|
4143
|
+
requiredFields
|
|
4144
|
+
allowedStates
|
|
4145
|
+
confirm
|
|
4146
|
+
args
|
|
4147
|
+
}
|
|
4141
4148
|
}
|
|
4142
4149
|
inherits
|
|
4143
4150
|
listDoctype
|
|
@@ -4181,7 +4188,14 @@ class Li {
|
|
|
4181
4188
|
}
|
|
4182
4189
|
workflow {
|
|
4183
4190
|
states
|
|
4184
|
-
actions
|
|
4191
|
+
actions {
|
|
4192
|
+
label
|
|
4193
|
+
handler
|
|
4194
|
+
requiredFields
|
|
4195
|
+
allowedStates
|
|
4196
|
+
confirm
|
|
4197
|
+
args
|
|
4198
|
+
}
|
|
4185
4199
|
}
|
|
4186
4200
|
inherits
|
|
4187
4201
|
listDoctype
|
|
@@ -4196,7 +4210,7 @@ class Li {
|
|
|
4196
4210
|
}
|
|
4197
4211
|
/**
|
|
4198
4212
|
* Get a single record by ID
|
|
4199
|
-
* @param doctype - Doctype
|
|
4213
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
4200
4214
|
* @param recordId - Record ID to fetch
|
|
4201
4215
|
*/
|
|
4202
4216
|
async getRecord(t, n) {
|
|
@@ -4213,7 +4227,7 @@ class Li {
|
|
|
4213
4227
|
}
|
|
4214
4228
|
/**
|
|
4215
4229
|
* Get multiple records with optional filtering and pagination
|
|
4216
|
-
* @param doctype - Doctype
|
|
4230
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
4217
4231
|
* @param options - Query options (filters, orderBy, limit, offset)
|
|
4218
4232
|
*/
|
|
4219
4233
|
async getRecords(t, n) {
|
|
@@ -4246,7 +4260,7 @@ class Li {
|
|
|
4246
4260
|
}
|
|
4247
4261
|
/**
|
|
4248
4262
|
* Execute a doctype action
|
|
4249
|
-
* @param doctype - Doctype
|
|
4263
|
+
* @param doctype - Doctype reference (name and optional slug)
|
|
4250
4264
|
* @param action - Action name to execute
|
|
4251
4265
|
* @param args - Action arguments
|
|
4252
4266
|
*/
|
|
@@ -4285,7 +4299,7 @@ const Ri = (e) => JSON.parse(e, (t, n) => {
|
|
|
4285
4299
|
else if (!isNaN(Number(n)))
|
|
4286
4300
|
return new ie(n);
|
|
4287
4301
|
return n;
|
|
4288
|
-
}),
|
|
4302
|
+
}), Fi = {
|
|
4289
4303
|
getMeta: async (e, t) => {
|
|
4290
4304
|
const n = new xi(t || "/graphql", {
|
|
4291
4305
|
fetch: window.fetch,
|
|
@@ -4304,7 +4318,7 @@ const Ri = (e) => JSON.parse(e, (t, n) => {
|
|
|
4304
4318
|
};
|
|
4305
4319
|
export {
|
|
4306
4320
|
Li as StonecropClient,
|
|
4307
|
-
|
|
4321
|
+
Fi as methods,
|
|
4308
4322
|
ki as queries,
|
|
4309
4323
|
bi as typeDefs
|
|
4310
4324
|
};
|