@animaapp/anima-sdk 0.6.16 → 0.6.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +149 -134
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var xr = Object.defineProperty, kr = Object.defineProperties;
|
|
2
2
|
var Tr = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Ft = Object.getOwnPropertySymbols;
|
|
4
|
-
var Sr = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
4
|
+
var Sr = Object.prototype.hasOwnProperty, Er = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Lt = (r) => {
|
|
6
6
|
throw TypeError(r);
|
|
7
7
|
};
|
|
8
|
-
var
|
|
8
|
+
var Dt = (r, e, t) => e in r ? xr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, u = (r, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
|
-
Sr.call(e, t) &&
|
|
10
|
+
Sr.call(e, t) && Dt(r, t, e[t]);
|
|
11
11
|
if (Ft)
|
|
12
12
|
for (var t of Ft(e))
|
|
13
|
-
|
|
13
|
+
Er.call(e, t) && Dt(r, t, e[t]);
|
|
14
14
|
return r;
|
|
15
15
|
}, g = (r, e) => kr(r, Tr(e));
|
|
16
|
-
var ht = (r, e, t) => e.has(r) ||
|
|
17
|
-
var N = (r, e, t) => (ht(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Qe = (r, e, t) => e.has(r) ?
|
|
16
|
+
var ht = (r, e, t) => e.has(r) || Lt("Cannot " + t);
|
|
17
|
+
var N = (r, e, t) => (ht(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Qe = (r, e, t) => e.has(r) ? Lt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), pt = (r, e, t, s) => (ht(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t), Ne = (r, e, t) => (ht(r, e, "access private method"), t);
|
|
18
18
|
var C = (r, e, t) => new Promise((s, n) => {
|
|
19
19
|
var a = (c) => {
|
|
20
20
|
try {
|
|
@@ -42,7 +42,7 @@ class de extends Error {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
const Qt = "Figma Token Issue";
|
|
45
|
-
class
|
|
45
|
+
class Ar extends Error {
|
|
46
46
|
constructor({
|
|
47
47
|
fileKey: e,
|
|
48
48
|
reason: t,
|
|
@@ -85,7 +85,7 @@ const Kn = (r) => r.message === sr, Rr = (r) => r.message === er, Zr = (r) => [Q
|
|
|
85
85
|
if (((s = r == null ? void 0 : r.cause) == null ? void 0 : s.message) === "Fetch Error") {
|
|
86
86
|
const { err: n, status: a } = r.cause.body;
|
|
87
87
|
if (a === 403)
|
|
88
|
-
return new
|
|
88
|
+
return new Ar({
|
|
89
89
|
fileKey: e,
|
|
90
90
|
reason: n,
|
|
91
91
|
cause: r
|
|
@@ -99,14 +99,14 @@ const Kn = (r) => r.message === sr, Rr = (r) => r.message === er, Zr = (r) => [Q
|
|
|
99
99
|
}
|
|
100
100
|
return new jr({ fileKey: e, cause: r });
|
|
101
101
|
}, Xn = (r) => Nr(r) ? "NotFound" : Rr(r) ? "RateLimitExceeded" : Zr(r) ? "FigmaTokenIssue" : Mr(r) ? "RequestTooLarge" : "UnknownFigmaApiException";
|
|
102
|
-
var Pr = Object.defineProperty, $r = Object.defineProperties, Fr = Object.getOwnPropertyDescriptors,
|
|
102
|
+
var Pr = Object.defineProperty, $r = Object.defineProperties, Fr = Object.getOwnPropertyDescriptors, Vt = Object.getOwnPropertySymbols, Dr = Object.prototype.hasOwnProperty, Lr = Object.prototype.propertyIsEnumerable, Ut = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), ar = (r) => {
|
|
103
103
|
throw TypeError(r);
|
|
104
104
|
}, Wt = (r, e, t) => e in r ? Pr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, U = (r, e) => {
|
|
105
105
|
for (var t in e || (e = {}))
|
|
106
|
-
|
|
107
|
-
if (
|
|
108
|
-
for (var t of
|
|
109
|
-
|
|
106
|
+
Dr.call(e, t) && Wt(r, t, e[t]);
|
|
107
|
+
if (Vt)
|
|
108
|
+
for (var t of Vt(e))
|
|
109
|
+
Lr.call(e, t) && Wt(r, t, e[t]);
|
|
110
110
|
return r;
|
|
111
111
|
}, jt = (r, e) => $r(r, Fr(e)), Rt = (r, e, t) => e.has(r) || ar("Cannot " + t), S = (r, e, t) => (Rt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), B = (r, e, t) => e.has(r) ? ar("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), R = (r, e, t, s) => (Rt(r, e, "write to private field"), e.set(r, t), t), Q = (r, e, t) => (Rt(r, e, "access private method"), t), I = (r, e, t) => new Promise((s, n) => {
|
|
112
112
|
var a = (c) => {
|
|
@@ -123,7 +123,7 @@ var Pr = Object.defineProperty, $r = Object.defineProperties, Fr = Object.getOwn
|
|
|
123
123
|
}
|
|
124
124
|
}, o = (c) => c.done ? s(c.value) : Promise.resolve(c.value).then(a, i);
|
|
125
125
|
o((t = t.apply(r, e)).next());
|
|
126
|
-
}),
|
|
126
|
+
}), Vr = (r, e, t) => (e = r[Ut("asyncIterator")]) ? e.call(r) : (r = r[Ut("iterator")](), e = {}, t = (s, n) => (n = r[s]) && (e[s] = (a) => new Promise((i, o, c) => (a = n.call(r, a), c = a.done, Promise.resolve(a.value).then((d) => i({ value: d, done: c }), o)))), t("next"), t("return"), e), Ur = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
127
127
|
function Wr(r) {
|
|
128
128
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
129
129
|
}
|
|
@@ -133,42 +133,42 @@ function Br() {
|
|
|
133
133
|
(function(t, s) {
|
|
134
134
|
r.exports = s();
|
|
135
135
|
})(zr, function() {
|
|
136
|
-
var t = typeof Promise == "function", s = typeof self == "object" ? self : Ur, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", d = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", v = n && typeof Symbol.toStringTag != "undefined", j = i && typeof Set.prototype.entries == "function", M = a && typeof Map.prototype.entries == "function", F = j && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), z = M && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), se = f && typeof Array.prototype[Symbol.iterator] == "function", ge = se && Object.getPrototypeOf([][Symbol.iterator]()), ce = f && typeof String.prototype[Symbol.iterator] == "function",
|
|
137
|
-
function Ie(
|
|
138
|
-
var k = typeof
|
|
136
|
+
var t = typeof Promise == "function", s = typeof self == "object" ? self : Ur, n = typeof Symbol != "undefined", a = typeof Map != "undefined", i = typeof Set != "undefined", o = typeof WeakMap != "undefined", c = typeof WeakSet != "undefined", d = typeof DataView != "undefined", f = n && typeof Symbol.iterator != "undefined", v = n && typeof Symbol.toStringTag != "undefined", j = i && typeof Set.prototype.entries == "function", M = a && typeof Map.prototype.entries == "function", F = j && Object.getPrototypeOf((/* @__PURE__ */ new Set()).entries()), z = M && Object.getPrototypeOf((/* @__PURE__ */ new Map()).entries()), se = f && typeof Array.prototype[Symbol.iterator] == "function", ge = se && Object.getPrototypeOf([][Symbol.iterator]()), ce = f && typeof String.prototype[Symbol.iterator] == "function", L = ce && Object.getPrototypeOf(""[Symbol.iterator]()), K = 8, q = -1;
|
|
137
|
+
function Ie(A) {
|
|
138
|
+
var k = typeof A;
|
|
139
139
|
if (k !== "object")
|
|
140
140
|
return k;
|
|
141
|
-
if (
|
|
141
|
+
if (A === null)
|
|
142
142
|
return "null";
|
|
143
|
-
if (
|
|
143
|
+
if (A === s)
|
|
144
144
|
return "global";
|
|
145
|
-
if (Array.isArray(
|
|
145
|
+
if (Array.isArray(A) && (v === !1 || !(Symbol.toStringTag in A)))
|
|
146
146
|
return "Array";
|
|
147
147
|
if (typeof window == "object" && window !== null) {
|
|
148
|
-
if (typeof window.location == "object" &&
|
|
148
|
+
if (typeof window.location == "object" && A === window.location)
|
|
149
149
|
return "Location";
|
|
150
|
-
if (typeof window.document == "object" &&
|
|
150
|
+
if (typeof window.document == "object" && A === window.document)
|
|
151
151
|
return "Document";
|
|
152
152
|
if (typeof window.navigator == "object") {
|
|
153
|
-
if (typeof window.navigator.mimeTypes == "object" &&
|
|
153
|
+
if (typeof window.navigator.mimeTypes == "object" && A === window.navigator.mimeTypes)
|
|
154
154
|
return "MimeTypeArray";
|
|
155
|
-
if (typeof window.navigator.plugins == "object" &&
|
|
155
|
+
if (typeof window.navigator.plugins == "object" && A === window.navigator.plugins)
|
|
156
156
|
return "PluginArray";
|
|
157
157
|
}
|
|
158
|
-
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") &&
|
|
159
|
-
if (
|
|
158
|
+
if ((typeof window.HTMLElement == "function" || typeof window.HTMLElement == "object") && A instanceof window.HTMLElement) {
|
|
159
|
+
if (A.tagName === "BLOCKQUOTE")
|
|
160
160
|
return "HTMLQuoteElement";
|
|
161
|
-
if (
|
|
161
|
+
if (A.tagName === "TD")
|
|
162
162
|
return "HTMLTableDataCellElement";
|
|
163
|
-
if (
|
|
163
|
+
if (A.tagName === "TH")
|
|
164
164
|
return "HTMLTableHeaderCellElement";
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
var ft = v &&
|
|
167
|
+
var ft = v && A[Symbol.toStringTag];
|
|
168
168
|
if (typeof ft == "string")
|
|
169
169
|
return ft;
|
|
170
|
-
var
|
|
171
|
-
return
|
|
170
|
+
var V = Object.getPrototypeOf(A);
|
|
171
|
+
return V === RegExp.prototype ? "RegExp" : V === Date.prototype ? "Date" : t && V === Promise.prototype ? "Promise" : i && V === Set.prototype ? "Set" : a && V === Map.prototype ? "Map" : c && V === WeakSet.prototype ? "WeakSet" : o && V === WeakMap.prototype ? "WeakMap" : d && V === DataView.prototype ? "DataView" : a && V === z ? "Map Iterator" : i && V === F ? "Set Iterator" : se && V === ge ? "Array Iterator" : ce && V === L ? "String Iterator" : V === null ? "Object" : Object.prototype.toString.call(A).slice(K, q);
|
|
172
172
|
}
|
|
173
173
|
return Ie;
|
|
174
174
|
});
|
|
@@ -231,7 +231,7 @@ const Hr = /* @__PURE__ */ Wr(qr), Zt = typeof Buffer != "undefined", Jr = Zt &&
|
|
|
231
231
|
return r;
|
|
232
232
|
}
|
|
233
233
|
);
|
|
234
|
-
function
|
|
234
|
+
function Ee(r) {
|
|
235
235
|
return Gr(r) ? "Buffer" : Hr(r);
|
|
236
236
|
}
|
|
237
237
|
const Xr = /* @__PURE__ */ new Set([
|
|
@@ -242,7 +242,7 @@ const Xr = /* @__PURE__ */ new Set([
|
|
|
242
242
|
"Set"
|
|
243
243
|
]);
|
|
244
244
|
function Yr(r, e, t = null) {
|
|
245
|
-
switch (t ||
|
|
245
|
+
switch (t || Ee(r)) {
|
|
246
246
|
case "Arguments":
|
|
247
247
|
case "Array":
|
|
248
248
|
case "Object":
|
|
@@ -257,7 +257,7 @@ function bt(r) {
|
|
|
257
257
|
return Xr.has(r);
|
|
258
258
|
}
|
|
259
259
|
function Bt(r, e, t, s = null) {
|
|
260
|
-
switch (s ||
|
|
260
|
+
switch (s || Ee(r)) {
|
|
261
261
|
case "Arguments":
|
|
262
262
|
case "Array":
|
|
263
263
|
case "Object":
|
|
@@ -376,7 +376,7 @@ function ps() {
|
|
|
376
376
|
}
|
|
377
377
|
function wt(r, e = null, t = ps) {
|
|
378
378
|
arguments.length === 2 && typeof e == "function" && (t = e, e = null);
|
|
379
|
-
const s = e ||
|
|
379
|
+
const s = e || Ee(r), n = hs.get(s);
|
|
380
380
|
if (s === "Object") {
|
|
381
381
|
const a = t(r, s);
|
|
382
382
|
if (a !== void 0)
|
|
@@ -393,14 +393,14 @@ function je(r, e = {}) {
|
|
|
393
393
|
customizer: t
|
|
394
394
|
// TODO: max depth
|
|
395
395
|
// depth = Infinity,
|
|
396
|
-
} = e, s =
|
|
396
|
+
} = e, s = Ee(r);
|
|
397
397
|
if (!bt(s))
|
|
398
398
|
return xt(r, null, null, null);
|
|
399
399
|
const n = wt(r, s, t), a = new WeakMap([[r, n]]), i = new WeakSet([r]);
|
|
400
400
|
return xt(r, n, a, i);
|
|
401
401
|
}
|
|
402
402
|
function xt(r, e, t, s, n) {
|
|
403
|
-
const a =
|
|
403
|
+
const a = Ee(r), i = wt(r, a);
|
|
404
404
|
if (!bt(a))
|
|
405
405
|
return i;
|
|
406
406
|
let o;
|
|
@@ -422,7 +422,7 @@ function xt(r, e, t, s, n) {
|
|
|
422
422
|
if (s.has(d))
|
|
423
423
|
Bt(e, c, t.get(d), a);
|
|
424
424
|
else {
|
|
425
|
-
const f =
|
|
425
|
+
const f = Ee(d), v = wt(d, f);
|
|
426
426
|
bt(f) && (t.set(d, v), s.add(d)), Bt(
|
|
427
427
|
e,
|
|
428
428
|
c,
|
|
@@ -467,7 +467,7 @@ function vs(r) {
|
|
|
467
467
|
return I(this, null, function* () {
|
|
468
468
|
const e = new Blob([r]).stream().pipeThrough(new CompressionStream("gzip")), t = [];
|
|
469
469
|
try {
|
|
470
|
-
for (var s =
|
|
470
|
+
for (var s = Vr(e), n, a, i; n = !(a = yield s.next()).done; n = !1) {
|
|
471
471
|
const o = a.value;
|
|
472
472
|
t.push(o);
|
|
473
473
|
}
|
|
@@ -549,10 +549,10 @@ function Tt() {
|
|
|
549
549
|
return Math.floor(Date.now() / 1e3).toString();
|
|
550
550
|
}
|
|
551
551
|
const xs = 5 * 60 * 1e3, ks = 1 * 1e3;
|
|
552
|
-
var ve,
|
|
552
|
+
var ve, D, X, St, Et, Ze;
|
|
553
553
|
class Ts {
|
|
554
554
|
constructor({ fetch: e = globalThis.fetch.bind(globalThis), baseAddress: t }) {
|
|
555
|
-
B(this, X), B(this, ve), B(this,
|
|
555
|
+
B(this, X), B(this, ve), B(this, D), this.baseAddress = t, R(this, ve, e), R(this, D, {}), this.plugins = [];
|
|
556
556
|
}
|
|
557
557
|
get headers() {
|
|
558
558
|
throw new Error("Missing implementation");
|
|
@@ -564,42 +564,42 @@ class Ts {
|
|
|
564
564
|
this.plugins = this.plugins.filter((t) => t.name !== e);
|
|
565
565
|
}
|
|
566
566
|
withOptions(e = {}) {
|
|
567
|
-
return R(this,
|
|
567
|
+
return R(this, D, e), this;
|
|
568
568
|
}
|
|
569
569
|
get(e) {
|
|
570
570
|
return I(this, arguments, function* (t, s = {}) {
|
|
571
571
|
const { overrideBaseAddress: n, overrideDefaultHeaders: a } = s, i = n != null ? n : this.baseAddress;
|
|
572
572
|
let o = a != null ? a : this.headers;
|
|
573
|
-
const c = je(S(this,
|
|
574
|
-
return R(this,
|
|
573
|
+
const c = je(S(this, D));
|
|
574
|
+
return R(this, D, {}), c.extraHeaders && (o = U(U({}, o), c.extraHeaders)), c.requestValidation && (o = jt(U({}, o), { "X-Request-Nonce": or(), "X-Request-Timestamp": Tt() })), c.async ? yield Q(this, X, Et).call(this, `${i}${t}`, c.async, { headers: o }) : yield Q(this, X, St).call(this, `${i}${t}`, c, { headers: o });
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
post(e, t) {
|
|
578
578
|
return I(this, arguments, function* (s, n, a = {}) {
|
|
579
|
-
const i = je(S(this,
|
|
580
|
-
return R(this,
|
|
579
|
+
const i = je(S(this, D));
|
|
580
|
+
return R(this, D, {}), Q(this, X, Ze).call(this, s, "POST", n, a, i);
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
583
|
put(e, t) {
|
|
584
584
|
return I(this, arguments, function* (s, n, a = {}) {
|
|
585
|
-
const i = je(S(this,
|
|
586
|
-
return R(this,
|
|
585
|
+
const i = je(S(this, D));
|
|
586
|
+
return R(this, D, {}), Q(this, X, Ze).call(this, s, "PUT", n, a, i);
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
delete(e, t) {
|
|
590
590
|
return I(this, arguments, function* (s, n, a = {}) {
|
|
591
|
-
const i = je(S(this,
|
|
592
|
-
return R(this,
|
|
591
|
+
const i = je(S(this, D));
|
|
592
|
+
return R(this, D, {}), Q(this, X, Ze).call(this, s, "DELETE", n, a, i);
|
|
593
593
|
});
|
|
594
594
|
}
|
|
595
595
|
patch(e, t) {
|
|
596
596
|
return I(this, arguments, function* (s, n, a = {}) {
|
|
597
|
-
const i = je(S(this,
|
|
598
|
-
return R(this,
|
|
597
|
+
const i = je(S(this, D));
|
|
598
|
+
return R(this, D, {}), Q(this, X, Ze).call(this, s, "PATCH", n, a, i);
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
ve = /* @__PURE__ */ new WeakMap(),
|
|
602
|
+
ve = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakSet(), St = function(r, e, t) {
|
|
603
603
|
return I(this, null, function* () {
|
|
604
604
|
const s = () => I(this, null, function* () {
|
|
605
605
|
var c, d;
|
|
@@ -653,7 +653,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
|
|
|
653
653
|
const o = yield s();
|
|
654
654
|
return yield i(o);
|
|
655
655
|
});
|
|
656
|
-
},
|
|
656
|
+
}, Et = function(r, e, t) {
|
|
657
657
|
return I(this, null, function* () {
|
|
658
658
|
var s, n;
|
|
659
659
|
const {
|
|
@@ -689,26 +689,26 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
|
|
|
689
689
|
if (i != null && i.aborted) {
|
|
690
690
|
clearTimeout(se), S(this, ve).call(this, `${f}/${M}/cancel`, { method: "POST", headers: this.headers }).then(() => {
|
|
691
691
|
z(new Re({ canceled: !0 }));
|
|
692
|
-
}).catch((
|
|
692
|
+
}).catch((L) => {
|
|
693
693
|
z(new Re({ canceled: !1 }));
|
|
694
694
|
});
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
697
|
try {
|
|
698
|
-
const
|
|
699
|
-
if (
|
|
698
|
+
const L = yield (yield S(this, ve).call(this, `${f}/${M}`, { headers: this.headers })).json();
|
|
699
|
+
if (L.status === "success") {
|
|
700
700
|
clearTimeout(se);
|
|
701
|
-
const K =
|
|
701
|
+
const K = L.response_json;
|
|
702
702
|
F(K);
|
|
703
|
-
} else if (
|
|
704
|
-
clearTimeout(se), z(new ws(
|
|
703
|
+
} else if (L.status === "failed")
|
|
704
|
+
clearTimeout(se), z(new ws(L.response_json));
|
|
705
705
|
else {
|
|
706
|
-
a && a(
|
|
706
|
+
a && a(L.response_json);
|
|
707
707
|
const K = o(ce);
|
|
708
708
|
setTimeout(() => ge(ce + 1), K);
|
|
709
709
|
}
|
|
710
|
-
} catch (
|
|
711
|
-
z(
|
|
710
|
+
} catch (L) {
|
|
711
|
+
z(L);
|
|
712
712
|
}
|
|
713
713
|
});
|
|
714
714
|
ge();
|
|
@@ -720,7 +720,7 @@ ve = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), X = /* @_
|
|
|
720
720
|
let c = i != null ? i : this.headers;
|
|
721
721
|
n.extraHeaders && (c = U(U({}, c), n.extraHeaders)), n.requestValidation && (c = jt(U({}, c), { "X-Request-Nonce": or(), "X-Request-Timestamp": Tt() }));
|
|
722
722
|
let d = t;
|
|
723
|
-
return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (d = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ys() && (c["Content-Encoding"] = "gzip", d = yield vs(d))), n.async ? yield Q(this, X,
|
|
723
|
+
return typeof FormData != "undefined" && t instanceof FormData ? delete c["Content-Type"] : (d = s.skipBodyJsonStringify ? t : JSON.stringify(t), n.compress && ys() && (c["Content-Encoding"] = "gzip", d = yield vs(d))), n.async ? yield Q(this, X, Et).call(this, `${o}${r}`, n.async, {
|
|
724
724
|
method: e,
|
|
725
725
|
headers: c,
|
|
726
726
|
body: d
|
|
@@ -770,14 +770,14 @@ class Ss {
|
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
Me = /* @__PURE__ */ new WeakMap();
|
|
773
|
-
const
|
|
773
|
+
const Es = (r, e, t) => {
|
|
774
774
|
const s = e.sort();
|
|
775
775
|
return `${r}-${s.join("-")}-${t}`;
|
|
776
|
-
},
|
|
777
|
-
var Y,
|
|
776
|
+
}, As = (r) => r ? r.ts > Date.now() - 1e3 * 30 : !1;
|
|
777
|
+
var Y, At, cr;
|
|
778
778
|
class Cs {
|
|
779
779
|
constructor(e) {
|
|
780
|
-
B(this,
|
|
780
|
+
B(this, At), B(this, Y), this.resourceName = "Images", R(this, Y, e);
|
|
781
781
|
}
|
|
782
782
|
/**
|
|
783
783
|
* Return the URL for the _layer_ images for the given nodes.
|
|
@@ -785,14 +785,14 @@ class Cs {
|
|
|
785
785
|
*/
|
|
786
786
|
get(e) {
|
|
787
787
|
return I(this, arguments, function* ({ fileKey: t, nodeIds: s, format: n = "jpg", scale: a }) {
|
|
788
|
-
const i =
|
|
789
|
-
if (
|
|
788
|
+
const i = Es(t, s, n), o = S(this, Y).cache.images.entries.get(i);
|
|
789
|
+
if (As(o))
|
|
790
790
|
return o.result;
|
|
791
791
|
o && S(this, Y).cache.images.entries.delete(i);
|
|
792
792
|
const c = S(this, Y).cache.images.pendingRequests.get(i);
|
|
793
793
|
if (c)
|
|
794
794
|
return c;
|
|
795
|
-
const d = Q(this,
|
|
795
|
+
const d = Q(this, At, cr).call(this, i, t, s, n, a);
|
|
796
796
|
S(this, Y).cache.images.pendingRequests.set(i, d);
|
|
797
797
|
try {
|
|
798
798
|
return yield d;
|
|
@@ -802,7 +802,7 @@ class Cs {
|
|
|
802
802
|
});
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
Y = /* @__PURE__ */ new WeakMap(),
|
|
805
|
+
Y = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakSet(), cr = function(r, e, t, s, n) {
|
|
806
806
|
return I(this, null, function* () {
|
|
807
807
|
const a = yield S(this, Y).get(
|
|
808
808
|
`v1/images/${e}?ids=${t}&format=${s}${n ? `&scale=${n}` : ""}`
|
|
@@ -1068,7 +1068,7 @@ class W extends Error {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
1070
|
W.create = (r) => new W(r);
|
|
1071
|
-
const
|
|
1071
|
+
const Ae = (r, e) => {
|
|
1072
1072
|
let t;
|
|
1073
1073
|
switch (r.code) {
|
|
1074
1074
|
case l.invalid_type:
|
|
@@ -1124,7 +1124,7 @@ const Ee = (r, e) => {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
return { message: t };
|
|
1126
1126
|
};
|
|
1127
|
-
let lr =
|
|
1127
|
+
let lr = Ae;
|
|
1128
1128
|
function js(r) {
|
|
1129
1129
|
lr = r;
|
|
1130
1130
|
}
|
|
@@ -1161,7 +1161,7 @@ function h(r, e) {
|
|
|
1161
1161
|
// then schema-bound map if available
|
|
1162
1162
|
t,
|
|
1163
1163
|
// then global override map
|
|
1164
|
-
t ===
|
|
1164
|
+
t === Ae ? void 0 : Ae
|
|
1165
1165
|
// then global default map
|
|
1166
1166
|
].filter((n) => !!n)
|
|
1167
1167
|
});
|
|
@@ -1479,7 +1479,7 @@ class w {
|
|
|
1479
1479
|
return this.safeParse(null).success;
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
|
-
const Zs = /^c[^\s-]{8,}$/i, Ms = /^[0-9a-z]+$/, Ps = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $s = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Fs = /^[a-z0-9_-]{21}$/i,
|
|
1482
|
+
const Zs = /^c[^\s-]{8,}$/i, Ms = /^[0-9a-z]+$/, Ps = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $s = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Fs = /^[a-z0-9_-]{21}$/i, Ds = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ls = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Vs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1483
1483
|
let vt;
|
|
1484
1484
|
const Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, zs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Bs = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, qs = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Hs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Js = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, hr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Gs = new RegExp(`^${hr}$`);
|
|
1485
1485
|
function pr(r) {
|
|
@@ -1498,7 +1498,7 @@ function Xs(r, e) {
|
|
|
1498
1498
|
return !!((e === "v4" || !e) && Ws.test(r) || (e === "v6" || !e) && Bs.test(r));
|
|
1499
1499
|
}
|
|
1500
1500
|
function Ys(r, e) {
|
|
1501
|
-
if (!
|
|
1501
|
+
if (!Ds.test(r))
|
|
1502
1502
|
return !1;
|
|
1503
1503
|
try {
|
|
1504
1504
|
const [t] = r.split("."), s = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), n = JSON.parse(atob(s));
|
|
@@ -1559,7 +1559,7 @@ class H extends w {
|
|
|
1559
1559
|
message: a.message
|
|
1560
1560
|
}), s.dirty());
|
|
1561
1561
|
} else if (a.kind === "email")
|
|
1562
|
-
|
|
1562
|
+
Vs.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1563
1563
|
validation: "email",
|
|
1564
1564
|
code: l.invalid_string,
|
|
1565
1565
|
message: a.message
|
|
@@ -1638,7 +1638,7 @@ class H extends w {
|
|
|
1638
1638
|
code: l.invalid_string,
|
|
1639
1639
|
validation: "time",
|
|
1640
1640
|
message: a.message
|
|
1641
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
1641
|
+
}), s.dirty()) : a.kind === "duration" ? Ls.test(e.data) || (n = this._getOrReturnCtx(e, n), h(n, {
|
|
1642
1642
|
validation: "duration",
|
|
1643
1643
|
code: l.invalid_string,
|
|
1644
1644
|
message: a.message
|
|
@@ -2187,7 +2187,7 @@ he.create = (r) => {
|
|
|
2187
2187
|
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1
|
|
2188
2188
|
}, b(r)));
|
|
2189
2189
|
};
|
|
2190
|
-
class
|
|
2190
|
+
class De extends w {
|
|
2191
2191
|
_parse(e) {
|
|
2192
2192
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
|
|
2193
2193
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2200,7 +2200,7 @@ class Le extends w {
|
|
|
2200
2200
|
return $(e.data);
|
|
2201
2201
|
}
|
|
2202
2202
|
}
|
|
2203
|
-
|
|
2203
|
+
De.create = (r) => new De(u({
|
|
2204
2204
|
typeName: y.ZodBoolean,
|
|
2205
2205
|
coerce: (r == null ? void 0 : r.coerce) || !1
|
|
2206
2206
|
}, b(r)));
|
|
@@ -2296,7 +2296,7 @@ class ot extends w {
|
|
|
2296
2296
|
ot.create = (r) => new ot(u({
|
|
2297
2297
|
typeName: y.ZodSymbol
|
|
2298
2298
|
}, b(r)));
|
|
2299
|
-
class
|
|
2299
|
+
class Le extends w {
|
|
2300
2300
|
_parse(e) {
|
|
2301
2301
|
if (this._getType(e) !== p.undefined) {
|
|
2302
2302
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2309,10 +2309,10 @@ class Ve extends w {
|
|
|
2309
2309
|
return $(e.data);
|
|
2310
2310
|
}
|
|
2311
2311
|
}
|
|
2312
|
-
|
|
2312
|
+
Le.create = (r) => new Le(u({
|
|
2313
2313
|
typeName: y.ZodUndefined
|
|
2314
2314
|
}, b(r)));
|
|
2315
|
-
class
|
|
2315
|
+
class Ve extends w {
|
|
2316
2316
|
_parse(e) {
|
|
2317
2317
|
if (this._getType(e) !== p.null) {
|
|
2318
2318
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2325,7 +2325,7 @@ class De extends w {
|
|
|
2325
2325
|
return $(e.data);
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
|
-
|
|
2328
|
+
Ve.create = (r) => new Ve(u({
|
|
2329
2329
|
typeName: y.ZodNull
|
|
2330
2330
|
}, b(r)));
|
|
2331
2331
|
class Ce extends w {
|
|
@@ -2449,20 +2449,20 @@ J.create = (r, e) => new J(u({
|
|
|
2449
2449
|
typeName: y.ZodArray
|
|
2450
2450
|
}, b(e)));
|
|
2451
2451
|
function ke(r) {
|
|
2452
|
-
if (r instanceof
|
|
2452
|
+
if (r instanceof E) {
|
|
2453
2453
|
const e = {};
|
|
2454
2454
|
for (const t in r.shape) {
|
|
2455
2455
|
const s = r.shape[t];
|
|
2456
2456
|
e[t] = ee.create(ke(s));
|
|
2457
2457
|
}
|
|
2458
|
-
return new
|
|
2458
|
+
return new E(g(u({}, r._def), {
|
|
2459
2459
|
shape: () => e
|
|
2460
2460
|
}));
|
|
2461
2461
|
} else return r instanceof J ? new J(g(u({}, r._def), {
|
|
2462
2462
|
type: ke(r.element)
|
|
2463
2463
|
})) : r instanceof ee ? ee.create(ke(r.unwrap())) : r instanceof me ? me.create(ke(r.unwrap())) : r instanceof re ? re.create(r.items.map((e) => ke(e))) : r;
|
|
2464
2464
|
}
|
|
2465
|
-
class
|
|
2465
|
+
class E extends w {
|
|
2466
2466
|
constructor() {
|
|
2467
2467
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2468
2468
|
}
|
|
@@ -2539,7 +2539,7 @@ class A extends w {
|
|
|
2539
2539
|
return this._def.shape();
|
|
2540
2540
|
}
|
|
2541
2541
|
strict(e) {
|
|
2542
|
-
return m.errToObj, new
|
|
2542
|
+
return m.errToObj, new E(u(g(u({}, this._def), {
|
|
2543
2543
|
unknownKeys: "strict"
|
|
2544
2544
|
}), e !== void 0 ? {
|
|
2545
2545
|
errorMap: (t, s) => {
|
|
@@ -2554,12 +2554,12 @@ class A extends w {
|
|
|
2554
2554
|
} : {}));
|
|
2555
2555
|
}
|
|
2556
2556
|
strip() {
|
|
2557
|
-
return new
|
|
2557
|
+
return new E(g(u({}, this._def), {
|
|
2558
2558
|
unknownKeys: "strip"
|
|
2559
2559
|
}));
|
|
2560
2560
|
}
|
|
2561
2561
|
passthrough() {
|
|
2562
|
-
return new
|
|
2562
|
+
return new E(g(u({}, this._def), {
|
|
2563
2563
|
unknownKeys: "passthrough"
|
|
2564
2564
|
}));
|
|
2565
2565
|
}
|
|
@@ -2581,7 +2581,7 @@ class A extends w {
|
|
|
2581
2581
|
// }) as any;
|
|
2582
2582
|
// };
|
|
2583
2583
|
extend(e) {
|
|
2584
|
-
return new
|
|
2584
|
+
return new E(g(u({}, this._def), {
|
|
2585
2585
|
shape: () => u(u({}, this._def.shape()), e)
|
|
2586
2586
|
}));
|
|
2587
2587
|
}
|
|
@@ -2591,7 +2591,7 @@ class A extends w {
|
|
|
2591
2591
|
* upgrade if you are experiencing issues.
|
|
2592
2592
|
*/
|
|
2593
2593
|
merge(e) {
|
|
2594
|
-
return new
|
|
2594
|
+
return new E({
|
|
2595
2595
|
unknownKeys: e._def.unknownKeys,
|
|
2596
2596
|
catchall: e._def.catchall,
|
|
2597
2597
|
shape: () => u(u({}, this._def.shape()), e._def.shape()),
|
|
@@ -2658,7 +2658,7 @@ class A extends w {
|
|
|
2658
2658
|
// return merged;
|
|
2659
2659
|
// }
|
|
2660
2660
|
catchall(e) {
|
|
2661
|
-
return new
|
|
2661
|
+
return new E(g(u({}, this._def), {
|
|
2662
2662
|
catchall: e
|
|
2663
2663
|
}));
|
|
2664
2664
|
}
|
|
@@ -2666,7 +2666,7 @@ class A extends w {
|
|
|
2666
2666
|
const t = {};
|
|
2667
2667
|
return x.objectKeys(e).forEach((s) => {
|
|
2668
2668
|
e[s] && this.shape[s] && (t[s] = this.shape[s]);
|
|
2669
|
-
}), new
|
|
2669
|
+
}), new E(g(u({}, this._def), {
|
|
2670
2670
|
shape: () => t
|
|
2671
2671
|
}));
|
|
2672
2672
|
}
|
|
@@ -2674,7 +2674,7 @@ class A extends w {
|
|
|
2674
2674
|
const t = {};
|
|
2675
2675
|
return x.objectKeys(this.shape).forEach((s) => {
|
|
2676
2676
|
e[s] || (t[s] = this.shape[s]);
|
|
2677
|
-
}), new
|
|
2677
|
+
}), new E(g(u({}, this._def), {
|
|
2678
2678
|
shape: () => t
|
|
2679
2679
|
}));
|
|
2680
2680
|
}
|
|
@@ -2689,7 +2689,7 @@ class A extends w {
|
|
|
2689
2689
|
return x.objectKeys(this.shape).forEach((s) => {
|
|
2690
2690
|
const n = this.shape[s];
|
|
2691
2691
|
e && !e[s] ? t[s] = n : t[s] = n.optional();
|
|
2692
|
-
}), new
|
|
2692
|
+
}), new E(g(u({}, this._def), {
|
|
2693
2693
|
shape: () => t
|
|
2694
2694
|
}));
|
|
2695
2695
|
}
|
|
@@ -2704,7 +2704,7 @@ class A extends w {
|
|
|
2704
2704
|
a = a._def.innerType;
|
|
2705
2705
|
t[s] = a;
|
|
2706
2706
|
}
|
|
2707
|
-
}), new
|
|
2707
|
+
}), new E(g(u({}, this._def), {
|
|
2708
2708
|
shape: () => t
|
|
2709
2709
|
}));
|
|
2710
2710
|
}
|
|
@@ -2712,19 +2712,19 @@ class A extends w {
|
|
|
2712
2712
|
return gr(x.objectKeys(this.shape));
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
|
|
2715
|
+
E.create = (r, e) => new E(u({
|
|
2716
2716
|
shape: () => r,
|
|
2717
2717
|
unknownKeys: "strip",
|
|
2718
2718
|
catchall: oe.create(),
|
|
2719
2719
|
typeName: y.ZodObject
|
|
2720
2720
|
}, b(e)));
|
|
2721
|
-
|
|
2721
|
+
E.strictCreate = (r, e) => new E(u({
|
|
2722
2722
|
shape: () => r,
|
|
2723
2723
|
unknownKeys: "strict",
|
|
2724
2724
|
catchall: oe.create(),
|
|
2725
2725
|
typeName: y.ZodObject
|
|
2726
2726
|
}, b(e)));
|
|
2727
|
-
|
|
2727
|
+
E.lazycreate = (r, e) => new E(u({
|
|
2728
2728
|
shape: r,
|
|
2729
2729
|
unknownKeys: "strip",
|
|
2730
2730
|
catchall: oe.create(),
|
|
@@ -2798,7 +2798,7 @@ Ue.create = (r, e) => new Ue(u({
|
|
|
2798
2798
|
options: r,
|
|
2799
2799
|
typeName: y.ZodUnion
|
|
2800
2800
|
}, b(e)));
|
|
2801
|
-
const ae = (r) => r instanceof Be ? ae(r.schema) : r instanceof G ? ae(r.innerType()) : r instanceof qe ? [r.value] : r instanceof pe ? r.options : r instanceof He ? x.objectValues(r.enum) : r instanceof Je ? ae(r._def.innerType) : r instanceof
|
|
2801
|
+
const ae = (r) => r instanceof Be ? ae(r.schema) : r instanceof G ? ae(r.innerType()) : r instanceof qe ? [r.value] : r instanceof pe ? r.options : r instanceof He ? x.objectValues(r.enum) : r instanceof Je ? ae(r._def.innerType) : r instanceof Le ? [void 0] : r instanceof Ve ? [null] : r instanceof ee ? [void 0, ...ae(r.unwrap())] : r instanceof me ? [null, ...ae(r.unwrap())] : r instanceof Mt || r instanceof Ke ? ae(r.unwrap()) : r instanceof Ge ? ae(r._def.innerType) : [];
|
|
2802
2802
|
class lt extends w {
|
|
2803
2803
|
_parse(e) {
|
|
2804
2804
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -3138,7 +3138,7 @@ class Se extends w {
|
|
|
3138
3138
|
t.common.contextualErrorMap,
|
|
3139
3139
|
t.schemaErrorMap,
|
|
3140
3140
|
nt(),
|
|
3141
|
-
|
|
3141
|
+
Ae
|
|
3142
3142
|
].filter((d) => !!d),
|
|
3143
3143
|
issueData: {
|
|
3144
3144
|
code: l.invalid_arguments,
|
|
@@ -3154,7 +3154,7 @@ class Se extends w {
|
|
|
3154
3154
|
t.common.contextualErrorMap,
|
|
3155
3155
|
t.schemaErrorMap,
|
|
3156
3156
|
nt(),
|
|
3157
|
-
|
|
3157
|
+
Ae
|
|
3158
3158
|
].filter((d) => !!d),
|
|
3159
3159
|
issueData: {
|
|
3160
3160
|
code: l.invalid_return_type,
|
|
@@ -3640,7 +3640,7 @@ function yr(r, e = {}, t) {
|
|
|
3640
3640
|
}) : Ce.create();
|
|
3641
3641
|
}
|
|
3642
3642
|
const rn = {
|
|
3643
|
-
object:
|
|
3643
|
+
object: E.lazycreate
|
|
3644
3644
|
};
|
|
3645
3645
|
var y;
|
|
3646
3646
|
(function(r) {
|
|
@@ -3648,18 +3648,18 @@ var y;
|
|
|
3648
3648
|
})(y || (y = {}));
|
|
3649
3649
|
const sn = (r, e = {
|
|
3650
3650
|
message: `Input not instance of ${r.name}`
|
|
3651
|
-
}) => yr((t) => t instanceof r, e), vr = H.create, _r = fe.create, nn = ut.create, an = he.create, br =
|
|
3651
|
+
}) => yr((t) => t instanceof r, e), vr = H.create, _r = fe.create, nn = ut.create, an = he.create, br = De.create, on = we.create, cn = ot.create, dn = Le.create, un = Ve.create, ln = Ce.create, fn = _e.create, hn = oe.create, pn = ct.create, mn = J.create, gn = E.create, yn = E.strictCreate, vn = Ue.create, _n = lt.create, bn = We.create, wn = re.create, xn = ze.create, kn = dt.create, Tn = xe.create, Sn = Se.create, En = Be.create, An = qe.create, Cn = pe.create, On = He.create, In = Oe.create, Xt = G.create, Nn = ee.create, jn = me.create, Rn = G.createWithPreprocess, Zn = Ye.create, Mn = () => vr().optional(), Pn = () => _r().optional(), $n = () => br().optional(), Fn = {
|
|
3652
3652
|
string: (r) => H.create(g(u({}, r), { coerce: !0 })),
|
|
3653
3653
|
number: (r) => fe.create(g(u({}, r), { coerce: !0 })),
|
|
3654
|
-
boolean: (r) =>
|
|
3654
|
+
boolean: (r) => De.create(g(u({}, r), {
|
|
3655
3655
|
coerce: !0
|
|
3656
3656
|
})),
|
|
3657
3657
|
bigint: (r) => he.create(g(u({}, r), { coerce: !0 })),
|
|
3658
3658
|
date: (r) => we.create(g(u({}, r), { coerce: !0 }))
|
|
3659
|
-
},
|
|
3659
|
+
}, Dn = _;
|
|
3660
3660
|
var T = /* @__PURE__ */ Object.freeze({
|
|
3661
3661
|
__proto__: null,
|
|
3662
|
-
defaultErrorMap:
|
|
3662
|
+
defaultErrorMap: Ae,
|
|
3663
3663
|
setErrorMap: js,
|
|
3664
3664
|
getErrorMap: nt,
|
|
3665
3665
|
makeIssue: at,
|
|
@@ -3686,17 +3686,17 @@ var T = /* @__PURE__ */ Object.freeze({
|
|
|
3686
3686
|
ZodString: H,
|
|
3687
3687
|
ZodNumber: fe,
|
|
3688
3688
|
ZodBigInt: he,
|
|
3689
|
-
ZodBoolean:
|
|
3689
|
+
ZodBoolean: De,
|
|
3690
3690
|
ZodDate: we,
|
|
3691
3691
|
ZodSymbol: ot,
|
|
3692
|
-
ZodUndefined:
|
|
3693
|
-
ZodNull:
|
|
3692
|
+
ZodUndefined: Le,
|
|
3693
|
+
ZodNull: Ve,
|
|
3694
3694
|
ZodAny: Ce,
|
|
3695
3695
|
ZodUnknown: _e,
|
|
3696
3696
|
ZodNever: oe,
|
|
3697
3697
|
ZodVoid: ct,
|
|
3698
3698
|
ZodArray: J,
|
|
3699
|
-
ZodObject:
|
|
3699
|
+
ZodObject: E,
|
|
3700
3700
|
ZodUnion: Ue,
|
|
3701
3701
|
ZodDiscriminatedUnion: lt,
|
|
3702
3702
|
ZodIntersection: We,
|
|
@@ -3740,8 +3740,8 @@ var T = /* @__PURE__ */ Object.freeze({
|
|
|
3740
3740
|
function: Sn,
|
|
3741
3741
|
instanceof: sn,
|
|
3742
3742
|
intersection: bn,
|
|
3743
|
-
lazy:
|
|
3744
|
-
literal:
|
|
3743
|
+
lazy: En,
|
|
3744
|
+
literal: An,
|
|
3745
3745
|
map: kn,
|
|
3746
3746
|
nan: nn,
|
|
3747
3747
|
nativeEnum: On,
|
|
@@ -3768,12 +3768,12 @@ var T = /* @__PURE__ */ Object.freeze({
|
|
|
3768
3768
|
union: vn,
|
|
3769
3769
|
unknown: fn,
|
|
3770
3770
|
void: pn,
|
|
3771
|
-
NEVER:
|
|
3771
|
+
NEVER: Dn,
|
|
3772
3772
|
ZodIssueCode: l,
|
|
3773
3773
|
quotelessJson: Ns,
|
|
3774
3774
|
ZodError: W
|
|
3775
3775
|
});
|
|
3776
|
-
const
|
|
3776
|
+
const Ln = T.object({
|
|
3777
3777
|
language: T.enum(["typescript", "javascript"]).optional(),
|
|
3778
3778
|
disableMarkedForExport: T.boolean().optional(),
|
|
3779
3779
|
allowAutoSelectFirstNode: T.boolean().optional().default(!0)
|
|
@@ -3803,6 +3803,8 @@ const Vn = T.object({
|
|
|
3803
3803
|
enableDisplayScreenModelId: T.boolean().optional(),
|
|
3804
3804
|
enableGeneratePackageLock: T.boolean().optional(),
|
|
3805
3805
|
enableAnimationsPreset: T.boolean().optional(),
|
|
3806
|
+
enableDisplayDataId: T.boolean().optional(),
|
|
3807
|
+
enableDisplayDataName: T.boolean().optional(),
|
|
3806
3808
|
enableAutoSplit: T.boolean().optional(),
|
|
3807
3809
|
autoSplitThreshold: T.number().optional(),
|
|
3808
3810
|
url: T.string().url().optional(),
|
|
@@ -3814,8 +3816,8 @@ const Vn = T.object({
|
|
|
3814
3816
|
enableTranslation: T.boolean().optional()
|
|
3815
3817
|
})
|
|
3816
3818
|
])
|
|
3817
|
-
),
|
|
3818
|
-
const e =
|
|
3819
|
+
), Vn = (r) => {
|
|
3820
|
+
const e = Ln.safeParse(r);
|
|
3819
3821
|
if (e.success === !1) {
|
|
3820
3822
|
const t = new Error("Invalid codegen settings");
|
|
3821
3823
|
throw t.cause = e.error, t;
|
|
@@ -3885,7 +3887,7 @@ class Qn {
|
|
|
3885
3887
|
generateCode(n) {
|
|
3886
3888
|
return C(this, arguments, function* (e, t = {}, s) {
|
|
3887
3889
|
var c;
|
|
3888
|
-
const a =
|
|
3890
|
+
const a = Vn(e.settings);
|
|
3889
3891
|
e.figmaToken && (yield Ne(this, le, wr).call(this, e.fileKey, e.figmaToken, e.nodesId, { allowAutoSelectFirstNode: (c = a.allowAutoSelectFirstNode) != null ? c : !0 }, s));
|
|
3890
3892
|
let i = e.tracking;
|
|
3891
3893
|
N(this, O) && "userId" in N(this, O) && N(this, O).userId && (i != null && i.externalId || (i = { externalId: N(this, O).userId }));
|
|
@@ -3910,6 +3912,8 @@ class Qn {
|
|
|
3910
3912
|
enableDisplayScreenModelId: a.enableDisplayScreenModelId,
|
|
3911
3913
|
enableGeneratePackageLock: a.enableGeneratePackageLock,
|
|
3912
3914
|
enableAnimationsPreset: a.enableAnimationsPreset,
|
|
3915
|
+
enableDisplayDataId: a.enableDisplayDataId,
|
|
3916
|
+
enableDisplayDataName: a.enableDisplayDataName,
|
|
3913
3917
|
codegenSettings: a.codegenSettings,
|
|
3914
3918
|
webhookUrl: e.webhookUrl
|
|
3915
3919
|
};
|
|
@@ -3920,14 +3924,25 @@ class Qn {
|
|
|
3920
3924
|
return C(this, arguments, function* (e, t = {}, s) {
|
|
3921
3925
|
let a = e.tracking;
|
|
3922
3926
|
N(this, O) && "userId" in N(this, O) && N(this, O).userId && (a != null && a.externalId || (a = { externalId: N(this, O).userId }));
|
|
3923
|
-
|
|
3927
|
+
let i;
|
|
3928
|
+
if (e.mhtml)
|
|
3929
|
+
i = {
|
|
3930
|
+
type: "mhtml",
|
|
3931
|
+
mhtml: e.mhtml,
|
|
3932
|
+
url: e.url
|
|
3933
|
+
};
|
|
3934
|
+
else if (e.url)
|
|
3935
|
+
i = {
|
|
3936
|
+
type: "url",
|
|
3937
|
+
url: e.url
|
|
3938
|
+
};
|
|
3939
|
+
else
|
|
3940
|
+
throw new Error("Either 'url' or 'mhtml' must be provided");
|
|
3941
|
+
const o = {
|
|
3924
3942
|
tracking: a,
|
|
3925
3943
|
assetsStorage: e.assetsStorage,
|
|
3926
3944
|
params: {
|
|
3927
|
-
input:
|
|
3928
|
-
type: "url",
|
|
3929
|
-
url: e.url
|
|
3930
|
-
},
|
|
3945
|
+
input: i,
|
|
3931
3946
|
conventions: {
|
|
3932
3947
|
framework: e.settings.framework,
|
|
3933
3948
|
language: e.settings.language,
|
|
@@ -3938,7 +3953,7 @@ class Qn {
|
|
|
3938
3953
|
}
|
|
3939
3954
|
}
|
|
3940
3955
|
};
|
|
3941
|
-
return Ne(this, le, st).call(this, "/v1/l2c",
|
|
3956
|
+
return Ne(this, le, st).call(this, "/v1/l2c", o, t, "l2c", s);
|
|
3942
3957
|
});
|
|
3943
3958
|
}
|
|
3944
3959
|
/**
|
|
@@ -3987,7 +4002,7 @@ O = new WeakMap(), Xe = new WeakMap(), le = new WeakSet(), wr = function(e, t, s
|
|
|
3987
4002
|
});
|
|
3988
4003
|
}, st = function(e, t, s, n, a) {
|
|
3989
4004
|
return C(this, null, function* () {
|
|
3990
|
-
var v, j, M, F, z, se, ge, ce,
|
|
4005
|
+
var v, j, M, F, z, se, ge, ce, L;
|
|
3991
4006
|
if (this.hasAuth() === !1)
|
|
3992
4007
|
throw new Error('It needs to set "auth" before calling this method.');
|
|
3993
4008
|
const i = {}, o = yield fetch(`${N(this, Xe)}${e}`, {
|
|
@@ -4037,11 +4052,11 @@ O = new WeakMap(), Xe = new WeakMap(), le = new WeakSet(), wr = function(e, t, s
|
|
|
4037
4052
|
const Ie = f.split(`
|
|
4038
4053
|
`);
|
|
4039
4054
|
f = Ie.pop() || "";
|
|
4040
|
-
for (const
|
|
4041
|
-
if (!(!
|
|
4055
|
+
for (const A of Ie)
|
|
4056
|
+
if (!(!A.trim() || A.startsWith(":")) && A.startsWith("data: ")) {
|
|
4042
4057
|
let k;
|
|
4043
4058
|
try {
|
|
4044
|
-
k = JSON.parse(
|
|
4059
|
+
k = JSON.parse(A.slice(6));
|
|
4045
4060
|
} catch (ft) {
|
|
4046
4061
|
continue;
|
|
4047
4062
|
}
|
|
@@ -4085,7 +4100,7 @@ O = new WeakMap(), Xe = new WeakMap(), le = new WeakSet(), wr = function(e, t, s
|
|
|
4085
4100
|
}
|
|
4086
4101
|
case "codegen_completed":
|
|
4087
4102
|
case "generation_completed": {
|
|
4088
|
-
typeof s == "function" ? s(k) : (
|
|
4103
|
+
typeof s == "function" ? s(k) : (L = s.onCodegenCompleted) == null || L.call(s);
|
|
4089
4104
|
break;
|
|
4090
4105
|
}
|
|
4091
4106
|
case "error":
|
|
@@ -4280,7 +4295,7 @@ const na = (r, e) => C(void 0, null, function* () {
|
|
|
4280
4295
|
export {
|
|
4281
4296
|
Qn as Anima,
|
|
4282
4297
|
de as CodegenError,
|
|
4283
|
-
|
|
4298
|
+
Ar as FigmaTokenIssue,
|
|
4284
4299
|
Ir as NotFound,
|
|
4285
4300
|
Cr as RateLimitExceeded,
|
|
4286
4301
|
Or as RequestTooLarge,
|
|
@@ -4305,7 +4320,7 @@ export {
|
|
|
4305
4320
|
Mr as isRequestTooLarge,
|
|
4306
4321
|
Kn as isUnknownFigmaApiException,
|
|
4307
4322
|
ea as isValidFigmaUrl,
|
|
4308
|
-
|
|
4323
|
+
Vn as validateSettings,
|
|
4309
4324
|
nr as wrapFigmaApiError
|
|
4310
4325
|
};
|
|
4311
4326
|
//# sourceMappingURL=index.js.map
|