@oomol-lab/open-flow 0.1.0-beta.29 → 0.1.0-beta.30
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/browser/{createResourceDialog-C_8I3Fua.js → createResourceDialog-_y2xHaUA.js} +1 -1
- package/dist/browser/flow-authoring.js +60 -60
- package/dist/browser/flow-change-schema.d.ts +1 -0
- package/dist/browser/flow-change.d.ts +3 -2
- package/dist/browser/flow-change.js +943 -943
- package/dist/browser/{flowChanges-BBtkyUGd.js → flowChanges-AdN0Iqma.js} +1 -1
- package/dist/browser/{flowWorkspace-DNmBb3ZW.js → flowWorkspace-BrtzLKWB.js} +4 -4
- package/dist/browser/{inputValues-BbSVOWQP.js → inputValues-DJfFraxG.js} +1 -1
- package/dist/browser/workbench.js +4 -4
- package/dist/browser/{workbenchSelect-CQOvpteT.js → workbenchSelect-BDPIQxYK.js} +104 -104
- package/dist/common/control-api-conformance.js +73 -73
- package/dist/common/control-api.js +148 -148
- package/dist/common/control-requests.js +94 -94
- package/dist/common/flow-encoding.d.ts +2 -0
- package/dist/common/flow-encoding.js +1103 -947
- package/dist/common/flow-semantics.js +817 -757
- package/dist/common/mcp.js +257 -257
- package/dist/common/provider-triggers.js +1283 -1283
- package/dist/common/scheduler.js +566 -558
- package/package.json +1 -1
|
@@ -3711,7 +3711,7 @@ function po(e) {
|
|
|
3711
3711
|
external: e?.external ?? void 0
|
|
3712
3712
|
};
|
|
3713
3713
|
}
|
|
3714
|
-
function
|
|
3714
|
+
function k(e, t, n, r, i) {
|
|
3715
3715
|
let a = typeof t.unrepresentable == "function" ? t.unrepresentable({
|
|
3716
3716
|
zodSchema: e,
|
|
3717
3717
|
path: r.path,
|
|
@@ -3721,7 +3721,7 @@ function mo(e, t, n, r, i) {
|
|
|
3721
3721
|
if (a === void 0 || a === "throw") throw Error(i);
|
|
3722
3722
|
return Object.assign(n, a), !0;
|
|
3723
3723
|
}
|
|
3724
|
-
function
|
|
3724
|
+
function A(e, t, n = {
|
|
3725
3725
|
path: [],
|
|
3726
3726
|
schemaPath: []
|
|
3727
3727
|
}) {
|
|
@@ -3750,15 +3750,15 @@ function k(e, t, n = {
|
|
|
3750
3750
|
a(e, t, n, r);
|
|
3751
3751
|
}
|
|
3752
3752
|
let a = e._zod.parent;
|
|
3753
|
-
a && (o.ref ||= a,
|
|
3753
|
+
a && (o.ref ||= a, A(a, t, r), t.seen.get(a).isParent = !0);
|
|
3754
3754
|
}
|
|
3755
3755
|
let c = t.metadataRegistry.get(e);
|
|
3756
|
-
return c && fo(o.schema, c), t.io === "input" &&
|
|
3756
|
+
return c && fo(o.schema, c), t.io === "input" && j(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
|
|
3757
3757
|
}
|
|
3758
|
-
function
|
|
3758
|
+
function mo(e) {
|
|
3759
3759
|
return e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
3760
3760
|
}
|
|
3761
|
-
function
|
|
3761
|
+
function ho(e, t) {
|
|
3762
3762
|
let n = e.seen.get(t);
|
|
3763
3763
|
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
3764
3764
|
if (e.external && e.sharedDefsExtractedFor === e.external) return;
|
|
@@ -3779,7 +3779,7 @@ function go(e, t) {
|
|
|
3779
3779
|
let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
|
|
3780
3780
|
return t[1].defId = a, {
|
|
3781
3781
|
defId: a,
|
|
3782
|
-
ref: `${i("__shared")}#/${r}/${
|
|
3782
|
+
ref: `${i("__shared")}#/${r}/${mo(a)}`
|
|
3783
3783
|
};
|
|
3784
3784
|
}
|
|
3785
3785
|
let i = `#/${r}/`;
|
|
@@ -3787,7 +3787,7 @@ function go(e, t) {
|
|
|
3787
3787
|
let a = t[1].schema.id ?? `__schema${e.counter++}`;
|
|
3788
3788
|
return {
|
|
3789
3789
|
defId: a,
|
|
3790
|
-
ref: i +
|
|
3790
|
+
ref: i + mo(a)
|
|
3791
3791
|
};
|
|
3792
3792
|
}, a = (e) => {
|
|
3793
3793
|
if (e[1].schema.$ref) return;
|
|
@@ -3831,13 +3831,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3831
3831
|
}
|
|
3832
3832
|
e.external && (e.sharedDefsExtractedFor = e.external);
|
|
3833
3833
|
}
|
|
3834
|
-
function
|
|
3834
|
+
function go(e) {
|
|
3835
3835
|
let t = e.anyOf;
|
|
3836
3836
|
if (!Array.isArray(t) || t.length === 0 || e.type !== void 0) return;
|
|
3837
3837
|
let n = [];
|
|
3838
3838
|
for (let e of t) {
|
|
3839
3839
|
if (!e || typeof e != "object") return;
|
|
3840
|
-
|
|
3840
|
+
go(e);
|
|
3841
3841
|
let t = Object.keys(e);
|
|
3842
3842
|
if (t.length !== 1 || t[0] !== "type") return;
|
|
3843
3843
|
let r = e.type;
|
|
@@ -3848,21 +3848,21 @@ function _o(e) {
|
|
|
3848
3848
|
}
|
|
3849
3849
|
delete e.anyOf, e.type = n.length === 1 ? n[0] : n;
|
|
3850
3850
|
}
|
|
3851
|
-
var
|
|
3851
|
+
var _o = /* @__PURE__ */ new Set([
|
|
3852
3852
|
"type",
|
|
3853
3853
|
"properties",
|
|
3854
3854
|
"required",
|
|
3855
3855
|
"additionalProperties"
|
|
3856
|
-
]),
|
|
3857
|
-
function
|
|
3856
|
+
]), vo = ["oneOf", "anyOf"];
|
|
3857
|
+
function yo(e) {
|
|
3858
3858
|
let t = e.additionalProperties;
|
|
3859
3859
|
return t === void 0 || t === !1 || typeof t != "object" || !t ? null : Object.keys(t).length ? t : null;
|
|
3860
3860
|
}
|
|
3861
|
-
function
|
|
3861
|
+
function bo(e) {
|
|
3862
3862
|
let t = [];
|
|
3863
3863
|
for (let n of e) {
|
|
3864
3864
|
if (typeof n != "object" || n.type !== "object") return null;
|
|
3865
|
-
for (let e in n) if (!
|
|
3865
|
+
for (let e in n) if (!_o.has(e)) return null;
|
|
3866
3866
|
t.push(n);
|
|
3867
3867
|
}
|
|
3868
3868
|
let n = {}, r = /* @__PURE__ */ new Set();
|
|
@@ -3871,10 +3871,10 @@ function xo(e) {
|
|
|
3871
3871
|
if (Object.prototype.hasOwnProperty.call(n, r)) continue;
|
|
3872
3872
|
let e = [];
|
|
3873
3873
|
for (let n of t) {
|
|
3874
|
-
let t = n.properties?.[r] ??
|
|
3874
|
+
let t = n.properties?.[r] ?? yo(n);
|
|
3875
3875
|
t != null && (e.some((e) => JSON.stringify(e) === JSON.stringify(t)) || e.push(t));
|
|
3876
3876
|
}
|
|
3877
|
-
_(n, r, e.length === 1 ? e[0] :
|
|
3877
|
+
_(n, r, e.length === 1 ? e[0] : bo(e) ?? { allOf: e });
|
|
3878
3878
|
}
|
|
3879
3879
|
for (let t of e.required ?? []) r.add(t);
|
|
3880
3880
|
}
|
|
@@ -3886,29 +3886,29 @@ function xo(e) {
|
|
|
3886
3886
|
else {
|
|
3887
3887
|
let e = [];
|
|
3888
3888
|
for (let n of t) {
|
|
3889
|
-
let t =
|
|
3889
|
+
let t = yo(n);
|
|
3890
3890
|
t && !e.some((e) => JSON.stringify(e) === JSON.stringify(t)) && e.push(t);
|
|
3891
3891
|
}
|
|
3892
3892
|
e.length === 1 ? i.additionalProperties = e[0] : e.length > 1 && (i.additionalProperties = { allOf: e });
|
|
3893
3893
|
}
|
|
3894
3894
|
return i;
|
|
3895
3895
|
}
|
|
3896
|
-
function
|
|
3896
|
+
function xo(e) {
|
|
3897
3897
|
let t = e.allOf;
|
|
3898
3898
|
if (!Array.isArray(t) || t.length < 2) return;
|
|
3899
|
-
for (let t of
|
|
3900
|
-
let n = t.filter((e) =>
|
|
3901
|
-
if (!n.length) r =
|
|
3899
|
+
for (let t of _o) if (t in e) return;
|
|
3900
|
+
let n = t.filter((e) => vo.some((t) => Array.isArray(e[t]))), r = null;
|
|
3901
|
+
if (!n.length) r = bo(t);
|
|
3902
3902
|
else {
|
|
3903
|
-
let e = n[0], i =
|
|
3903
|
+
let e = n[0], i = vo.find((t) => Array.isArray(e[t]));
|
|
3904
3904
|
if (Object.keys(e).length !== 1) return;
|
|
3905
|
-
let a = t.filter((t) => t !== e), o = e[i].map((e) =>
|
|
3905
|
+
let a = t.filter((t) => t !== e), o = e[i].map((e) => bo([...a, e]));
|
|
3906
3906
|
if (o.some((e) => !e)) return;
|
|
3907
3907
|
r = { [i]: o };
|
|
3908
3908
|
}
|
|
3909
3909
|
r && (delete e.allOf, fo(e, r));
|
|
3910
3910
|
}
|
|
3911
|
-
function
|
|
3911
|
+
function So(e, t) {
|
|
3912
3912
|
let n = e.seen.get(t);
|
|
3913
3913
|
if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
|
|
3914
3914
|
let r = (t) => {
|
|
@@ -3935,7 +3935,7 @@ function Co(e, t) {
|
|
|
3935
3935
|
};
|
|
3936
3936
|
if (!e.external || e.sharedEmitDoneFor !== e.external) {
|
|
3937
3937
|
for (let t of [...e.seen.entries()].reverse()) r(t[0]);
|
|
3938
|
-
if (e.target !== "openapi-3.0") for (let t of e.seen.entries())
|
|
3938
|
+
if (e.target !== "openapi-3.0") for (let t of e.seen.entries()) go(t[1].def ?? t[1].schema);
|
|
3939
3939
|
for (let t of e.deferred) t();
|
|
3940
3940
|
if (e.intersections.length) {
|
|
3941
3941
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3945,7 +3945,7 @@ function Co(e, t) {
|
|
|
3945
3945
|
let r = t.get(n);
|
|
3946
3946
|
r ? r.push(e) : t.set(n, [e]);
|
|
3947
3947
|
}
|
|
3948
|
-
for (let n of e.intersections) for (let e of t.get(n) ?? [])
|
|
3948
|
+
for (let n of e.intersections) for (let e of t.get(n) ?? []) xo(e);
|
|
3949
3949
|
}
|
|
3950
3950
|
}
|
|
3951
3951
|
let i = {};
|
|
@@ -3969,8 +3969,8 @@ function Co(e, t) {
|
|
|
3969
3969
|
value: {
|
|
3970
3970
|
...t["~standard"],
|
|
3971
3971
|
jsonSchema: {
|
|
3972
|
-
input:
|
|
3973
|
-
output:
|
|
3972
|
+
input: wo(t, "input", e.processors),
|
|
3973
|
+
output: wo(t, "output", e.processors)
|
|
3974
3974
|
}
|
|
3975
3975
|
},
|
|
3976
3976
|
enumerable: !1,
|
|
@@ -3980,83 +3980,83 @@ function Co(e, t) {
|
|
|
3980
3980
|
throw Error("Error converting schema to JSON.");
|
|
3981
3981
|
}
|
|
3982
3982
|
}
|
|
3983
|
-
function
|
|
3983
|
+
function j(e, t) {
|
|
3984
3984
|
let n = t ?? { seen: /* @__PURE__ */ new Set() };
|
|
3985
3985
|
if (n.seen.has(e)) return !1;
|
|
3986
3986
|
n.seen.add(e);
|
|
3987
3987
|
let r = e._zod.def;
|
|
3988
3988
|
if (r.type === "transform") return !0;
|
|
3989
|
-
if (r.type === "array") return
|
|
3990
|
-
if (r.type === "set") return
|
|
3991
|
-
if (r.type === "lazy") return
|
|
3992
|
-
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault" || r.type === "catch") return
|
|
3993
|
-
if (r.type === "intersection") return
|
|
3994
|
-
if (r.type === "record" || r.type === "map") return
|
|
3995
|
-
if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 :
|
|
3989
|
+
if (r.type === "array") return j(r.element, n);
|
|
3990
|
+
if (r.type === "set") return j(r.valueType, n);
|
|
3991
|
+
if (r.type === "lazy") return j(r.getter(), n);
|
|
3992
|
+
if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault" || r.type === "catch") return j(r.innerType, n);
|
|
3993
|
+
if (r.type === "intersection") return j(r.left, n) || j(r.right, n);
|
|
3994
|
+
if (r.type === "record" || r.type === "map") return j(r.keyType, n) || j(r.valueType, n);
|
|
3995
|
+
if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 : j(r.in, n) || j(r.out, n);
|
|
3996
3996
|
if (r.type === "object") {
|
|
3997
|
-
for (let e in r.shape) if (
|
|
3997
|
+
for (let e in r.shape) if (j(r.shape[e], n)) return !0;
|
|
3998
3998
|
return !1;
|
|
3999
3999
|
}
|
|
4000
4000
|
if (r.type === "union") {
|
|
4001
|
-
for (let e of r.options) if (
|
|
4001
|
+
for (let e of r.options) if (j(e, n)) return !0;
|
|
4002
4002
|
return !1;
|
|
4003
4003
|
}
|
|
4004
4004
|
if (r.type === "tuple") {
|
|
4005
|
-
for (let e of r.items) if (
|
|
4006
|
-
return !!(r.rest &&
|
|
4005
|
+
for (let e of r.items) if (j(e, n)) return !0;
|
|
4006
|
+
return !!(r.rest && j(r.rest, n));
|
|
4007
4007
|
}
|
|
4008
4008
|
return !1;
|
|
4009
4009
|
}
|
|
4010
|
-
var
|
|
4010
|
+
var Co = (e, t = {}) => (n) => {
|
|
4011
4011
|
let r = po({
|
|
4012
4012
|
...n,
|
|
4013
4013
|
processors: t
|
|
4014
4014
|
});
|
|
4015
|
-
return
|
|
4016
|
-
},
|
|
4015
|
+
return A(e, r), ho(r, e), So(r, e);
|
|
4016
|
+
}, wo = (e, t, n = {}) => (r) => {
|
|
4017
4017
|
let { libraryOptions: i, target: a } = r ?? {}, o = po({
|
|
4018
4018
|
...i ?? {},
|
|
4019
4019
|
target: a,
|
|
4020
4020
|
io: t,
|
|
4021
4021
|
processors: n
|
|
4022
4022
|
});
|
|
4023
|
-
return
|
|
4024
|
-
},
|
|
4023
|
+
return A(e, o), ho(o, e), So(o, e);
|
|
4024
|
+
}, To = {
|
|
4025
4025
|
guid: "uuid",
|
|
4026
4026
|
url: "uri",
|
|
4027
4027
|
datetime: "date-time",
|
|
4028
4028
|
json_string: "json-string",
|
|
4029
4029
|
regex: ""
|
|
4030
|
-
},
|
|
4030
|
+
}, Eo = (e, t, n, r) => {
|
|
4031
4031
|
let i = n;
|
|
4032
4032
|
i.type = "string";
|
|
4033
4033
|
let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l, laxFormat: u } = e._zod.bag;
|
|
4034
|
-
if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format =
|
|
4034
|
+
if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = To[s] ?? s, i.format === "" && delete i.format, (s === "time" || u) && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
|
|
4035
4035
|
let e = [...c];
|
|
4036
4036
|
e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
|
|
4037
4037
|
...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
|
|
4038
4038
|
pattern: e.source
|
|
4039
4039
|
}))]);
|
|
4040
4040
|
}
|
|
4041
|
-
},
|
|
4041
|
+
}, Do = (e, t, n, r) => {
|
|
4042
4042
|
let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
|
|
4043
4043
|
i.type = typeof s == "string" && s.includes("int") ? "integer" : "number";
|
|
4044
4044
|
let d = typeof u == "number" && u >= (a ?? -Infinity), f = typeof l == "number" && l <= (o ?? Infinity), p = t.target === "draft-04" || t.target === "openapi-3.0";
|
|
4045
|
-
d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (Number.isFinite(c) && c !== 0 ? i.multipleOf = Math.abs(c) :
|
|
4046
|
-
},
|
|
4045
|
+
d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (Number.isFinite(c) && c !== 0 ? i.multipleOf = Math.abs(c) : k(e, t, i, r, `A multipleOf divisor of ${c} cannot be represented in JSON Schema`));
|
|
4046
|
+
}, Oo = (e, t, n, r) => {
|
|
4047
4047
|
n.type = "boolean";
|
|
4048
|
-
},
|
|
4048
|
+
}, ko = (e, t, n, r) => {
|
|
4049
4049
|
t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
|
|
4050
|
-
},
|
|
4050
|
+
}, Ao = (e, t, n, r) => {
|
|
4051
4051
|
n.not = {};
|
|
4052
|
-
},
|
|
4052
|
+
}, jo = (e, t, n, r) => {
|
|
4053
4053
|
let i = e._zod.def, a = Ge(i.entries);
|
|
4054
4054
|
if (a.length === 0) {
|
|
4055
4055
|
n.not = {};
|
|
4056
4056
|
return;
|
|
4057
4057
|
}
|
|
4058
4058
|
a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), n.enum = a;
|
|
4059
|
-
},
|
|
4059
|
+
}, Mo = (e, t, n, r) => {
|
|
4060
4060
|
let i = e._zod.def;
|
|
4061
4061
|
if (i.values.length === 0) {
|
|
4062
4062
|
n.not = {};
|
|
@@ -4064,9 +4064,9 @@ var wo = (e, t = {}) => (n) => {
|
|
|
4064
4064
|
}
|
|
4065
4065
|
let a = [];
|
|
4066
4066
|
for (let o of i.values) if (o === void 0) {
|
|
4067
|
-
if (
|
|
4067
|
+
if (k(e, t, n, r, "Literal `undefined` cannot be represented in JSON Schema")) return;
|
|
4068
4068
|
} else if (typeof o == "bigint") {
|
|
4069
|
-
if (
|
|
4069
|
+
if (k(e, t, n, r, "BigInt literals cannot be represented in JSON Schema")) return;
|
|
4070
4070
|
a.push(Number(o));
|
|
4071
4071
|
} else a.push(o);
|
|
4072
4072
|
if (a.length !== 0) {
|
|
@@ -4075,26 +4075,26 @@ var wo = (e, t = {}) => (n) => {
|
|
|
4075
4075
|
n.type = e === null ? "null" : typeof e, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [e] : n.const = e;
|
|
4076
4076
|
} else a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), a.every((e) => typeof e == "boolean") && (n.type = "boolean"), a.every((e) => e === null) && (n.type = "null"), n.enum = a;
|
|
4077
4077
|
}
|
|
4078
|
+
}, No = (e, t, n, r) => {
|
|
4079
|
+
k(e, t, n, r, "Custom types cannot be represented in JSON Schema");
|
|
4078
4080
|
}, Po = (e, t, n, r) => {
|
|
4079
|
-
|
|
4081
|
+
k(e, t, n, r, "Transforms cannot be represented in JSON Schema");
|
|
4080
4082
|
}, Fo = (e, t, n, r) => {
|
|
4081
|
-
mo(e, t, n, r, "Transforms cannot be represented in JSON Schema");
|
|
4082
|
-
}, Io = (e, t, n, r) => {
|
|
4083
4083
|
let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
|
|
4084
|
-
typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items =
|
|
4084
|
+
typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = A(a.element, t, {
|
|
4085
4085
|
...r,
|
|
4086
4086
|
path: [...r.path, "items"]
|
|
4087
4087
|
});
|
|
4088
4088
|
};
|
|
4089
|
-
function
|
|
4089
|
+
function Io(e) {
|
|
4090
4090
|
let t = e._zod.def;
|
|
4091
|
-
return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ?
|
|
4091
|
+
return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ? Io(t.out) : t.type === "catch" ? Io(t.innerType) : e._zod.optin;
|
|
4092
4092
|
}
|
|
4093
|
-
var
|
|
4093
|
+
var Lo = (e, t, n, r) => {
|
|
4094
4094
|
let i = n, a = e._zod.def, o = a.shape;
|
|
4095
|
-
if (Object.getOwnPropertySymbols(o).length &&
|
|
4095
|
+
if (Object.getOwnPropertySymbols(o).length && k(e, t, i, r, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
4096
4096
|
i.type = "object", i.properties = {};
|
|
4097
|
-
for (let e in o) _(i.properties, e,
|
|
4097
|
+
for (let e in o) _(i.properties, e, A(o[e], t, {
|
|
4098
4098
|
...r,
|
|
4099
4099
|
path: [
|
|
4100
4100
|
...r.path,
|
|
@@ -4104,14 +4104,14 @@ var Ro = (e, t, n, r) => {
|
|
|
4104
4104
|
}));
|
|
4105
4105
|
let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
|
|
4106
4106
|
let n = a.shape[e];
|
|
4107
|
-
return t.io === "input" ?
|
|
4107
|
+
return t.io === "input" ? Io(n) === void 0 : n._zod.optout === void 0;
|
|
4108
4108
|
}));
|
|
4109
|
-
c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties =
|
|
4109
|
+
c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = A(a.catchall, t, {
|
|
4110
4110
|
...r,
|
|
4111
4111
|
path: [...r.path, "additionalProperties"]
|
|
4112
4112
|
})) : t.io === "output" && (i.additionalProperties = !1);
|
|
4113
|
-
},
|
|
4114
|
-
let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) =>
|
|
4113
|
+
}, Ro = (e, t, n, r) => {
|
|
4114
|
+
let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => A(e, t, {
|
|
4115
4115
|
...r,
|
|
4116
4116
|
path: [
|
|
4117
4117
|
...r.path,
|
|
@@ -4120,15 +4120,15 @@ var Ro = (e, t, n, r) => {
|
|
|
4120
4120
|
]
|
|
4121
4121
|
}));
|
|
4122
4122
|
a ? n.oneOf = o : n.anyOf = o;
|
|
4123
|
-
},
|
|
4124
|
-
let i = e._zod.def, a =
|
|
4123
|
+
}, zo = (e, t, n, r) => {
|
|
4124
|
+
let i = e._zod.def, a = A(i.left, t, {
|
|
4125
4125
|
...r,
|
|
4126
4126
|
path: [
|
|
4127
4127
|
...r.path,
|
|
4128
4128
|
"allOf",
|
|
4129
4129
|
0
|
|
4130
4130
|
]
|
|
4131
|
-
}), o =
|
|
4131
|
+
}), o = A(i.right, t, {
|
|
4132
4132
|
...r,
|
|
4133
4133
|
path: [
|
|
4134
4134
|
...r.path,
|
|
@@ -4138,19 +4138,19 @@ var Ro = (e, t, n, r) => {
|
|
|
4138
4138
|
}), s = (e) => "allOf" in e && Object.keys(e).length === 1, c = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
|
|
4139
4139
|
n.allOf = c, t.intersections.push(c);
|
|
4140
4140
|
};
|
|
4141
|
-
function
|
|
4141
|
+
function Bo(e, t, n) {
|
|
4142
4142
|
if (t.$ref) {
|
|
4143
4143
|
if (n.has(t)) return t;
|
|
4144
4144
|
n.add(t);
|
|
4145
4145
|
let r = e.get(t)?.def;
|
|
4146
4146
|
if (!r) return t;
|
|
4147
|
-
let i =
|
|
4147
|
+
let i = Bo(e, r, n);
|
|
4148
4148
|
return i === r ? t : i;
|
|
4149
4149
|
}
|
|
4150
4150
|
for (let r of ["anyOf", "oneOf"]) {
|
|
4151
4151
|
let i = t[r];
|
|
4152
4152
|
if (!Array.isArray(i)) continue;
|
|
4153
|
-
let a = i.map((t) =>
|
|
4153
|
+
let a = i.map((t) => Bo(e, t, n));
|
|
4154
4154
|
a.some((e, t) => e !== i[t]) && (t = {
|
|
4155
4155
|
...t,
|
|
4156
4156
|
[r]: a
|
|
@@ -4161,15 +4161,15 @@ function Vo(e, t, n) {
|
|
|
4161
4161
|
let { minimum: o, maximum: s, exclusiveMinimum: c, exclusiveMaximum: l, multipleOf: u, format: d, id: f, ...p } = t;
|
|
4162
4162
|
return p.enum ? p.enum = p.enum.map((e) => typeof e == "number" ? String(e) : e) : typeof p.const == "number" && (p.const = String(p.const)), i ? (p.type = "string", a || (p.pattern = (r.includes("number") ? Yn : Jn).source), p) : p;
|
|
4163
4163
|
}
|
|
4164
|
-
var
|
|
4165
|
-
function
|
|
4164
|
+
var Vo = /* @__PURE__ */ new WeakMap();
|
|
4165
|
+
function Ho(e) {
|
|
4166
4166
|
let t = /* @__PURE__ */ new Map();
|
|
4167
4167
|
for (let n of e.seen.values()) n.def && !t.has(n.schema) && t.set(n.schema, n);
|
|
4168
4168
|
let n = /* @__PURE__ */ new Map();
|
|
4169
|
-
for (let r of
|
|
4169
|
+
for (let r of Vo.get(e) ?? []) {
|
|
4170
4170
|
let i = e.seen.get(r), a = (i?.def ?? i?.schema)?.propertyNames;
|
|
4171
4171
|
if (!a || a === !0 || n.has(a)) continue;
|
|
4172
|
-
let o =
|
|
4172
|
+
let o = Bo(t, a, /* @__PURE__ */ new Set());
|
|
4173
4173
|
o !== a && n.set(a, o);
|
|
4174
4174
|
}
|
|
4175
4175
|
if (n.size) for (let t of e.seen.values()) for (let e of [t.schema, t.def]) {
|
|
@@ -4177,12 +4177,12 @@ function Uo(e) {
|
|
|
4177
4177
|
t && (e.propertyNames = t);
|
|
4178
4178
|
}
|
|
4179
4179
|
}
|
|
4180
|
-
var
|
|
4180
|
+
var Uo = (e, t, n, r) => {
|
|
4181
4181
|
let i = n, a = e._zod.def;
|
|
4182
4182
|
i.type = "object";
|
|
4183
4183
|
let o = a.keyType, s = o._zod.bag?.patterns;
|
|
4184
4184
|
if (a.mode === "loose" && s && s.size > 0) {
|
|
4185
|
-
let e =
|
|
4185
|
+
let e = A(a.valueType, t, {
|
|
4186
4186
|
...r,
|
|
4187
4187
|
path: [
|
|
4188
4188
|
...r.path,
|
|
@@ -4194,85 +4194,85 @@ var Wo = (e, t, n, r) => {
|
|
|
4194
4194
|
for (let t of s) _(i.patternProperties, t.source, e);
|
|
4195
4195
|
} else {
|
|
4196
4196
|
if (t.target === "draft-07" || t.target === "draft-2020-12") {
|
|
4197
|
-
i.propertyNames =
|
|
4197
|
+
i.propertyNames = A(a.keyType, t, {
|
|
4198
4198
|
...r,
|
|
4199
4199
|
path: [...r.path, "propertyNames"]
|
|
4200
4200
|
});
|
|
4201
|
-
let n =
|
|
4202
|
-
n || (n = [],
|
|
4201
|
+
let n = Vo.get(t);
|
|
4202
|
+
n || (n = [], Vo.set(t, n), t.deferred.push(() => Ho(t))), n.push(e);
|
|
4203
4203
|
}
|
|
4204
|
-
i.additionalProperties =
|
|
4204
|
+
i.additionalProperties = A(a.valueType, t, {
|
|
4205
4205
|
...r,
|
|
4206
4206
|
path: [...r.path, "additionalProperties"]
|
|
4207
4207
|
});
|
|
4208
4208
|
}
|
|
4209
|
-
let c = o._zod.values, l = t.io === "input" &&
|
|
4209
|
+
let c = o._zod.values, l = t.io === "input" && Io(a.valueType) !== void 0;
|
|
4210
4210
|
if (c && !a.partial && !l) {
|
|
4211
4211
|
let e = [...c].filter((e) => typeof e == "string" || typeof e == "number");
|
|
4212
4212
|
e.length > 0 && (i.required = e.map(String));
|
|
4213
4213
|
}
|
|
4214
|
-
},
|
|
4215
|
-
let i = e._zod.def, a =
|
|
4214
|
+
}, Wo = (e, t, n, r) => {
|
|
4215
|
+
let i = e._zod.def, a = A(i.innerType, t, r), o = t.seen.get(e);
|
|
4216
4216
|
t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
|
|
4217
|
-
},
|
|
4217
|
+
}, Go = (e, t, n, r) => {
|
|
4218
4218
|
let i = e._zod.def;
|
|
4219
|
-
|
|
4219
|
+
A(i.innerType, t, r);
|
|
4220
4220
|
let a = t.seen.get(e);
|
|
4221
4221
|
a.ref = i.innerType;
|
|
4222
|
-
},
|
|
4223
|
-
function
|
|
4222
|
+
}, Ko = Symbol();
|
|
4223
|
+
function qo(e, t, n, r, i) {
|
|
4224
4224
|
let a = !1, o = JSON.stringify(e, (e, t) => typeof t == "bigint" ? (a = !0, null) : t);
|
|
4225
|
-
return a ? (
|
|
4225
|
+
return a ? (k(t, n, r, i, "BigInt defaults cannot be represented in JSON Schema"), Ko) : JSON.parse(o);
|
|
4226
4226
|
}
|
|
4227
|
-
var
|
|
4227
|
+
var Jo = (e, t, n, r) => {
|
|
4228
4228
|
let i = e._zod.def;
|
|
4229
|
-
|
|
4229
|
+
A(i.innerType, t, r);
|
|
4230
4230
|
let a = t.seen.get(e);
|
|
4231
4231
|
a.ref = i.innerType;
|
|
4232
|
-
let o =
|
|
4233
|
-
o !==
|
|
4234
|
-
},
|
|
4232
|
+
let o = qo(i.defaultValue, e, t, n, r);
|
|
4233
|
+
o !== Ko && (n.default = o);
|
|
4234
|
+
}, Yo = (e, t, n, r) => {
|
|
4235
4235
|
let i = e._zod.def;
|
|
4236
|
-
|
|
4236
|
+
A(i.innerType, t, r);
|
|
4237
4237
|
let a = t.seen.get(e);
|
|
4238
4238
|
if (a.ref = i.innerType, t.io !== "input") return;
|
|
4239
|
-
let o =
|
|
4240
|
-
o !==
|
|
4241
|
-
},
|
|
4239
|
+
let o = qo(i.defaultValue, e, t, n, r);
|
|
4240
|
+
o !== Ko && (n._prefault = o);
|
|
4241
|
+
}, Xo = (e, t, n, r) => {
|
|
4242
4242
|
let i = e._zod.def;
|
|
4243
|
-
|
|
4243
|
+
A(i.innerType, t, r);
|
|
4244
4244
|
let a = t.seen.get(e);
|
|
4245
4245
|
a.ref = i.innerType;
|
|
4246
4246
|
let o;
|
|
4247
4247
|
try {
|
|
4248
4248
|
o = i.catchValue(void 0);
|
|
4249
4249
|
} catch {
|
|
4250
|
-
|
|
4250
|
+
k(e, t, n, r, "Dynamic catch values are not supported in JSON Schema");
|
|
4251
4251
|
return;
|
|
4252
4252
|
}
|
|
4253
4253
|
n.default = o;
|
|
4254
|
-
},
|
|
4254
|
+
}, Zo = (e, t, n, r) => {
|
|
4255
4255
|
let i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), o = t.io === "input" ? a ? i.out : i.in : i.out;
|
|
4256
|
-
|
|
4256
|
+
A(o, t, r);
|
|
4257
4257
|
let s = t.seen.get(e);
|
|
4258
4258
|
s.ref = o;
|
|
4259
|
-
},
|
|
4259
|
+
}, Qo = (e, t, n, r) => {
|
|
4260
4260
|
let i = e._zod.def;
|
|
4261
|
-
|
|
4261
|
+
A(i.innerType, t, r);
|
|
4262
4262
|
let a = t.seen.get(e);
|
|
4263
4263
|
a.ref = i.innerType, n.readOnly = !0;
|
|
4264
|
-
},
|
|
4264
|
+
}, $o = (e, t, n, r) => {
|
|
4265
4265
|
let i = e._zod.def;
|
|
4266
|
-
|
|
4266
|
+
A(i.innerType, t, r);
|
|
4267
4267
|
let a = t.seen.get(e);
|
|
4268
4268
|
a.ref = i.innerType;
|
|
4269
|
-
},
|
|
4269
|
+
}, es = (e, t, n, r) => {
|
|
4270
4270
|
let i = e._zod.innerType;
|
|
4271
|
-
|
|
4271
|
+
A(i, t, r);
|
|
4272
4272
|
let a = t.seen.get(e);
|
|
4273
4273
|
a.ref = i;
|
|
4274
|
-
},
|
|
4275
|
-
function
|
|
4274
|
+
}, ts = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4275
|
+
function ns(e, t, n) {
|
|
4276
4276
|
Object.defineProperty(e, t, {
|
|
4277
4277
|
configurable: !0,
|
|
4278
4278
|
enumerable: !1,
|
|
@@ -4293,12 +4293,12 @@ function rs(e, t, n) {
|
|
|
4293
4293
|
}
|
|
4294
4294
|
});
|
|
4295
4295
|
}
|
|
4296
|
-
var
|
|
4296
|
+
var M = /*@__PURE__*/ C("ZodError", (e, t) => {
|
|
4297
4297
|
$t.init(e, t), e.name = "ZodError";
|
|
4298
4298
|
let n = Object.getPrototypeOf(e);
|
|
4299
|
-
|
|
4299
|
+
ts.has(n) || (ts.add(n), ns(n, "format", (e) => (t) => rn(e, t)), ns(n, "flatten", (e) => (t) => nn(e, t)), ns(n, "addIssue", (e) => (t) => {
|
|
4300
4300
|
e.issues.push(t), e.message = JSON.stringify(e.issues, qe, 2);
|
|
4301
|
-
}),
|
|
4301
|
+
}), ns(n, "addIssues", (e) => (t) => {
|
|
4302
4302
|
e.issues.push(...t), e.message = JSON.stringify(e.issues, qe, 2);
|
|
4303
4303
|
}), Object.defineProperty(n, "isEmpty", {
|
|
4304
4304
|
configurable: !0,
|
|
@@ -4307,16 +4307,16 @@ var j = /*@__PURE__*/ C("ZodError", (e, t) => {
|
|
|
4307
4307
|
return this.issues.length === 0;
|
|
4308
4308
|
}
|
|
4309
4309
|
}));
|
|
4310
|
-
}, void 0, { Parent: Error }),
|
|
4310
|
+
}, void 0, { Parent: Error }), rs = /* @__PURE__ */ on(M), is = /* @__PURE__ */ sn(M), as = /* @__PURE__ */ cn(M), os = /* @__PURE__ */ un(M), ss = /* @__PURE__ */ fn(M), cs = /* @__PURE__ */ pn(M), ls = /* @__PURE__ */ mn(M), us = /* @__PURE__ */ hn(M), ds = /* @__PURE__ */ gn(M), fs = /* @__PURE__ */ _n(M), ps = /* @__PURE__ */ vn(M), ms = /* @__PURE__ */ yn(M);
|
|
4311
4311
|
//#endregion
|
|
4312
4312
|
//#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
|
|
4313
|
-
function
|
|
4313
|
+
function hs() {
|
|
4314
4314
|
w.localeError || T(ra());
|
|
4315
4315
|
}
|
|
4316
|
-
function
|
|
4316
|
+
function gs() {
|
|
4317
4317
|
w.memoizer || T({ memoizer: ea() });
|
|
4318
4318
|
}
|
|
4319
|
-
var
|
|
4319
|
+
var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.type = t.type, e), {
|
|
4320
4320
|
check(...e) {
|
|
4321
4321
|
let t = this.def;
|
|
4322
4322
|
return this.clone(v(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
|
|
@@ -4338,55 +4338,55 @@ var M = /*@__PURE__*/ C("ZodType", (e, t) => (gs(), D.init(e, t), e.def = t, e.t
|
|
|
4338
4338
|
return e.add(this, t), this;
|
|
4339
4339
|
},
|
|
4340
4340
|
refine(e, t) {
|
|
4341
|
-
return this.check(
|
|
4341
|
+
return this.check(kc(e, t));
|
|
4342
4342
|
},
|
|
4343
4343
|
superRefine(e, t) {
|
|
4344
|
-
return this.check(
|
|
4344
|
+
return this.check(Ac(e, t));
|
|
4345
4345
|
},
|
|
4346
4346
|
overwrite(e) {
|
|
4347
4347
|
return this.check(/* @__PURE__ */ to(e));
|
|
4348
4348
|
},
|
|
4349
4349
|
optional() {
|
|
4350
|
-
return
|
|
4350
|
+
return lc(this);
|
|
4351
4351
|
},
|
|
4352
4352
|
exactOptional() {
|
|
4353
|
-
return
|
|
4353
|
+
return dc(this);
|
|
4354
4354
|
},
|
|
4355
4355
|
nullable() {
|
|
4356
|
-
return
|
|
4356
|
+
return pc(this);
|
|
4357
4357
|
},
|
|
4358
4358
|
nullish() {
|
|
4359
|
-
return
|
|
4359
|
+
return lc(pc(this));
|
|
4360
4360
|
},
|
|
4361
4361
|
nonoptional(e) {
|
|
4362
|
-
return
|
|
4362
|
+
return yc(this, e);
|
|
4363
4363
|
},
|
|
4364
4364
|
array() {
|
|
4365
|
-
return
|
|
4365
|
+
return z(this);
|
|
4366
4366
|
},
|
|
4367
4367
|
or(e) {
|
|
4368
|
-
return
|
|
4368
|
+
return V([this, e]);
|
|
4369
4369
|
},
|
|
4370
4370
|
and(e) {
|
|
4371
|
-
return
|
|
4371
|
+
return nc(this, e);
|
|
4372
4372
|
},
|
|
4373
4373
|
transform(e) {
|
|
4374
|
-
return
|
|
4374
|
+
return Cc(this, sc(e));
|
|
4375
4375
|
},
|
|
4376
4376
|
default(e) {
|
|
4377
|
-
return
|
|
4377
|
+
return hc(this, e);
|
|
4378
4378
|
},
|
|
4379
4379
|
prefault(e) {
|
|
4380
|
-
return
|
|
4380
|
+
return _c(this, e);
|
|
4381
4381
|
},
|
|
4382
4382
|
catch(e) {
|
|
4383
|
-
return
|
|
4383
|
+
return xc(this, e);
|
|
4384
4384
|
},
|
|
4385
4385
|
pipe(e) {
|
|
4386
|
-
return
|
|
4386
|
+
return Cc(this, e);
|
|
4387
4387
|
},
|
|
4388
4388
|
readonly() {
|
|
4389
|
-
return
|
|
4389
|
+
return Tc(this);
|
|
4390
4390
|
},
|
|
4391
4391
|
describe(e) {
|
|
4392
4392
|
let t = this.clone();
|
|
@@ -4410,8 +4410,8 @@ var M = /*@__PURE__*/ C("ZodType", (e, t) => (gs(), D.init(e, t), e.def = t, e.t
|
|
|
4410
4410
|
return jt(this, "~standard", {
|
|
4411
4411
|
...br(this),
|
|
4412
4412
|
jsonSchema: {
|
|
4413
|
-
input:
|
|
4414
|
-
output:
|
|
4413
|
+
input: wo(this, "input"),
|
|
4414
|
+
output: wo(this, "output")
|
|
4415
4415
|
}
|
|
4416
4416
|
});
|
|
4417
4417
|
},
|
|
@@ -4419,16 +4419,16 @@ var M = /*@__PURE__*/ C("ZodType", (e, t) => (gs(), D.init(e, t), e.def = t, e.t
|
|
|
4419
4419
|
At(this, "~standard", e);
|
|
4420
4420
|
},
|
|
4421
4421
|
parse: function e(t, n) {
|
|
4422
|
-
return
|
|
4422
|
+
return rs(this, t, n, { callee: e });
|
|
4423
4423
|
},
|
|
4424
4424
|
parseAsync: async function e(t, n) {
|
|
4425
|
-
return await
|
|
4425
|
+
return await is(this, t, n, { callee: e });
|
|
4426
4426
|
},
|
|
4427
4427
|
safeParse(e, t) {
|
|
4428
|
-
return
|
|
4428
|
+
return as(this, e, t);
|
|
4429
4429
|
},
|
|
4430
4430
|
async safeParseAsync(e, t) {
|
|
4431
|
-
return
|
|
4431
|
+
return os(this, e, t);
|
|
4432
4432
|
},
|
|
4433
4433
|
get spa() {
|
|
4434
4434
|
return this?.safeParseAsync;
|
|
@@ -4437,31 +4437,31 @@ var M = /*@__PURE__*/ C("ZodType", (e, t) => (gs(), D.init(e, t), e.def = t, e.t
|
|
|
4437
4437
|
At(this, "spa", e);
|
|
4438
4438
|
},
|
|
4439
4439
|
encode: function e(t, n) {
|
|
4440
|
-
return
|
|
4440
|
+
return ss(this, t, n, { callee: e });
|
|
4441
4441
|
},
|
|
4442
4442
|
decode: function e(t, n) {
|
|
4443
|
-
return
|
|
4443
|
+
return cs(this, t, n, { callee: e });
|
|
4444
4444
|
},
|
|
4445
4445
|
encodeAsync: async function e(t, n) {
|
|
4446
|
-
return await
|
|
4446
|
+
return await ls(this, t, n, { callee: e });
|
|
4447
4447
|
},
|
|
4448
4448
|
decodeAsync: async function e(t, n) {
|
|
4449
|
-
return await
|
|
4449
|
+
return await us(this, t, n, { callee: e });
|
|
4450
4450
|
},
|
|
4451
4451
|
safeEncode(e, t) {
|
|
4452
|
-
return
|
|
4452
|
+
return ds(this, e, t);
|
|
4453
4453
|
},
|
|
4454
4454
|
safeDecode(e, t) {
|
|
4455
|
-
return
|
|
4455
|
+
return fs(this, e, t);
|
|
4456
4456
|
},
|
|
4457
4457
|
async safeEncodeAsync(e, t) {
|
|
4458
|
-
return
|
|
4458
|
+
return ps(this, e, t);
|
|
4459
4459
|
},
|
|
4460
4460
|
async safeDecodeAsync(e, t) {
|
|
4461
|
-
return
|
|
4461
|
+
return ms(this, e, t);
|
|
4462
4462
|
},
|
|
4463
4463
|
toJSONSchema(e) {
|
|
4464
|
-
return
|
|
4464
|
+
return Co(this, {})(e);
|
|
4465
4465
|
},
|
|
4466
4466
|
get description() {
|
|
4467
4467
|
return sa.get(this)?.description;
|
|
@@ -4469,8 +4469,8 @@ var M = /*@__PURE__*/ C("ZodType", (e, t) => (gs(), D.init(e, t), e.def = t, e.t
|
|
|
4469
4469
|
get _def() {
|
|
4470
4470
|
return this._zod.def;
|
|
4471
4471
|
}
|
|
4472
|
-
}),
|
|
4473
|
-
xr.init(e, t),
|
|
4472
|
+
}), _s = /*@__PURE__*/ C("_ZodString", (e, t) => {
|
|
4473
|
+
xr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Eo(e, t, n, r);
|
|
4474
4474
|
let n = e._zod.bag;
|
|
4475
4475
|
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null;
|
|
4476
4476
|
}, {
|
|
@@ -4519,141 +4519,141 @@ var M = /*@__PURE__*/ C("ZodType", (e, t) => (gs(), D.init(e, t), e.def = t, e.t
|
|
|
4519
4519
|
slugify() {
|
|
4520
4520
|
return this.check(/* @__PURE__ */ oo());
|
|
4521
4521
|
}
|
|
4522
|
-
}),
|
|
4523
|
-
xr.init(e, t),
|
|
4522
|
+
}), vs = /*@__PURE__*/ C("ZodString", (e, t) => {
|
|
4523
|
+
xr.init(e, t), _s.init(e, t);
|
|
4524
4524
|
}, {
|
|
4525
4525
|
email(e) {
|
|
4526
|
-
return this.check(/* @__PURE__ */ la(
|
|
4526
|
+
return this.check(/* @__PURE__ */ la(Cs, e));
|
|
4527
4527
|
},
|
|
4528
4528
|
url(e) {
|
|
4529
|
-
return this.check(/* @__PURE__ */ ha(
|
|
4529
|
+
return this.check(/* @__PURE__ */ ha(Es, e));
|
|
4530
4530
|
},
|
|
4531
4531
|
jwt(e) {
|
|
4532
|
-
return this.check(/* @__PURE__ */ Aa(
|
|
4532
|
+
return this.check(/* @__PURE__ */ Aa(Vs, e));
|
|
4533
4533
|
},
|
|
4534
4534
|
emoji(e) {
|
|
4535
|
-
return this.check(/* @__PURE__ */ ga(
|
|
4535
|
+
return this.check(/* @__PURE__ */ ga(Ds, e));
|
|
4536
4536
|
},
|
|
4537
4537
|
guid(e) {
|
|
4538
|
-
return this.check(/* @__PURE__ */ ua(
|
|
4538
|
+
return this.check(/* @__PURE__ */ ua(ws, e));
|
|
4539
4539
|
},
|
|
4540
4540
|
uuid(e) {
|
|
4541
|
-
return this.check(/* @__PURE__ */ da(
|
|
4541
|
+
return this.check(/* @__PURE__ */ da(Ts, e));
|
|
4542
4542
|
},
|
|
4543
4543
|
uuidv4(e) {
|
|
4544
|
-
return this.check(/* @__PURE__ */ fa(
|
|
4544
|
+
return this.check(/* @__PURE__ */ fa(Ts, e));
|
|
4545
4545
|
},
|
|
4546
4546
|
uuidv6(e) {
|
|
4547
|
-
return this.check(/* @__PURE__ */ pa(
|
|
4547
|
+
return this.check(/* @__PURE__ */ pa(Ts, e));
|
|
4548
4548
|
},
|
|
4549
4549
|
uuidv7(e) {
|
|
4550
|
-
return this.check(/* @__PURE__ */ ma(
|
|
4550
|
+
return this.check(/* @__PURE__ */ ma(Ts, e));
|
|
4551
4551
|
},
|
|
4552
4552
|
nanoid(e) {
|
|
4553
|
-
return this.check(/* @__PURE__ */ _a(
|
|
4553
|
+
return this.check(/* @__PURE__ */ _a(Os, e));
|
|
4554
4554
|
},
|
|
4555
4555
|
cuid(e) {
|
|
4556
|
-
return this.check(/* @__PURE__ */ va(
|
|
4556
|
+
return this.check(/* @__PURE__ */ va(ks, e));
|
|
4557
4557
|
},
|
|
4558
4558
|
cuid2(e) {
|
|
4559
|
-
return this.check(/* @__PURE__ */ ya(
|
|
4559
|
+
return this.check(/* @__PURE__ */ ya(As, e));
|
|
4560
4560
|
},
|
|
4561
4561
|
ulid(e) {
|
|
4562
|
-
return this.check(/* @__PURE__ */ ba(
|
|
4562
|
+
return this.check(/* @__PURE__ */ ba(js, e));
|
|
4563
4563
|
},
|
|
4564
4564
|
base64(e) {
|
|
4565
|
-
return this.check(/* @__PURE__ */ Da(
|
|
4565
|
+
return this.check(/* @__PURE__ */ Da(Rs, e));
|
|
4566
4566
|
},
|
|
4567
4567
|
base64url(e) {
|
|
4568
|
-
return this.check(/* @__PURE__ */ Oa(
|
|
4568
|
+
return this.check(/* @__PURE__ */ Oa(zs, e));
|
|
4569
4569
|
},
|
|
4570
4570
|
xid(e) {
|
|
4571
|
-
return this.check(/* @__PURE__ */ xa(
|
|
4571
|
+
return this.check(/* @__PURE__ */ xa(Ms, e));
|
|
4572
4572
|
},
|
|
4573
4573
|
ksuid(e) {
|
|
4574
|
-
return this.check(/* @__PURE__ */ Sa(
|
|
4574
|
+
return this.check(/* @__PURE__ */ Sa(Ns, e));
|
|
4575
4575
|
},
|
|
4576
4576
|
ipv4(e) {
|
|
4577
|
-
return this.check(/* @__PURE__ */ Ca(
|
|
4577
|
+
return this.check(/* @__PURE__ */ Ca(Ps, e));
|
|
4578
4578
|
},
|
|
4579
4579
|
ipv6(e) {
|
|
4580
|
-
return this.check(/* @__PURE__ */ wa(
|
|
4580
|
+
return this.check(/* @__PURE__ */ wa(Fs, e));
|
|
4581
4581
|
},
|
|
4582
4582
|
cidrv4(e) {
|
|
4583
|
-
return this.check(/* @__PURE__ */ Ta(
|
|
4583
|
+
return this.check(/* @__PURE__ */ Ta(Is, e));
|
|
4584
4584
|
},
|
|
4585
4585
|
cidrv6(e) {
|
|
4586
|
-
return this.check(/* @__PURE__ */ Ea(
|
|
4586
|
+
return this.check(/* @__PURE__ */ Ea(Ls, e));
|
|
4587
4587
|
},
|
|
4588
4588
|
e164(e) {
|
|
4589
|
-
return this.check(/* @__PURE__ */ ka(
|
|
4589
|
+
return this.check(/* @__PURE__ */ ka(Bs, e));
|
|
4590
4590
|
},
|
|
4591
4591
|
datetime(e) {
|
|
4592
|
-
return this.check(/* @__PURE__ */ ja(
|
|
4592
|
+
return this.check(/* @__PURE__ */ ja(ys, e));
|
|
4593
4593
|
},
|
|
4594
4594
|
date(e) {
|
|
4595
|
-
return this.check(/* @__PURE__ */ Ma(
|
|
4595
|
+
return this.check(/* @__PURE__ */ Ma(bs, e));
|
|
4596
4596
|
},
|
|
4597
4597
|
time(e) {
|
|
4598
|
-
return this.check(/* @__PURE__ */ Na(
|
|
4598
|
+
return this.check(/* @__PURE__ */ Na(xs, e));
|
|
4599
4599
|
},
|
|
4600
4600
|
duration(e) {
|
|
4601
|
-
return this.check(/* @__PURE__ */ Pa(
|
|
4601
|
+
return this.check(/* @__PURE__ */ Pa(Ss, e));
|
|
4602
4602
|
}
|
|
4603
4603
|
});
|
|
4604
|
-
function
|
|
4605
|
-
return /* @__PURE__ */ ca(
|
|
4606
|
-
}
|
|
4607
|
-
var
|
|
4608
|
-
O.init(e, t),
|
|
4609
|
-
}),
|
|
4610
|
-
Rr.init(e, t),
|
|
4611
|
-
}),
|
|
4612
|
-
zr.init(e, t),
|
|
4613
|
-
}),
|
|
4614
|
-
Br.init(e, t),
|
|
4615
|
-
}),
|
|
4616
|
-
Vr.init(e, t),
|
|
4617
|
-
}),
|
|
4618
|
-
wr.init(e, t),
|
|
4619
|
-
}),
|
|
4620
|
-
Sr.init(e, t),
|
|
4621
|
-
}),
|
|
4622
|
-
Cr.init(e, t),
|
|
4623
|
-
}),
|
|
4624
|
-
Ar.init(e, t),
|
|
4625
|
-
}),
|
|
4626
|
-
jr.init(e, t),
|
|
4627
|
-
}),
|
|
4628
|
-
Mr.init(e, t),
|
|
4629
|
-
}),
|
|
4630
|
-
Nr.init(e, t),
|
|
4631
|
-
}),
|
|
4632
|
-
Pr.init(e, t),
|
|
4633
|
-
}),
|
|
4634
|
-
Fr.init(e, t),
|
|
4635
|
-
}),
|
|
4636
|
-
Ir.init(e, t),
|
|
4637
|
-
}),
|
|
4638
|
-
Lr.init(e, t),
|
|
4639
|
-
}),
|
|
4640
|
-
Hr.init(e, t),
|
|
4641
|
-
}),
|
|
4642
|
-
Gr.init(e, t),
|
|
4643
|
-
}),
|
|
4644
|
-
Kr.init(e, t),
|
|
4645
|
-
}),
|
|
4646
|
-
Jr.init(e, t),
|
|
4647
|
-
}),
|
|
4648
|
-
Xr.init(e, t),
|
|
4649
|
-
}),
|
|
4650
|
-
Qr.init(e, t),
|
|
4651
|
-
}),
|
|
4652
|
-
$r.init(e, t),
|
|
4653
|
-
}),
|
|
4654
|
-
ti.init(e, t),
|
|
4655
|
-
}),
|
|
4656
|
-
ni.init(e, t),
|
|
4604
|
+
function P(e) {
|
|
4605
|
+
return /* @__PURE__ */ ca(vs, e);
|
|
4606
|
+
}
|
|
4607
|
+
var F = /*@__PURE__*/ C("ZodStringFormat", (e, t) => {
|
|
4608
|
+
O.init(e, t), _s.init(e, t);
|
|
4609
|
+
}), ys = /*@__PURE__*/ C("ZodISODateTime", (e, t) => {
|
|
4610
|
+
Rr.init(e, t), F.init(e, t);
|
|
4611
|
+
}), bs = /*@__PURE__*/ C("ZodISODate", (e, t) => {
|
|
4612
|
+
zr.init(e, t), F.init(e, t);
|
|
4613
|
+
}), xs = /*@__PURE__*/ C("ZodISOTime", (e, t) => {
|
|
4614
|
+
Br.init(e, t), F.init(e, t);
|
|
4615
|
+
}), Ss = /*@__PURE__*/ C("ZodISODuration", (e, t) => {
|
|
4616
|
+
Vr.init(e, t), F.init(e, t);
|
|
4617
|
+
}), Cs = /*@__PURE__*/ C("ZodEmail", (e, t) => {
|
|
4618
|
+
wr.init(e, t), F.init(e, t);
|
|
4619
|
+
}), ws = /*@__PURE__*/ C("ZodGUID", (e, t) => {
|
|
4620
|
+
Sr.init(e, t), F.init(e, t);
|
|
4621
|
+
}), Ts = /*@__PURE__*/ C("ZodUUID", (e, t) => {
|
|
4622
|
+
Cr.init(e, t), F.init(e, t);
|
|
4623
|
+
}), Es = /*@__PURE__*/ C("ZodURL", (e, t) => {
|
|
4624
|
+
Ar.init(e, t), F.init(e, t);
|
|
4625
|
+
}), Ds = /*@__PURE__*/ C("ZodEmoji", (e, t) => {
|
|
4626
|
+
jr.init(e, t), F.init(e, t);
|
|
4627
|
+
}), Os = /*@__PURE__*/ C("ZodNanoID", (e, t) => {
|
|
4628
|
+
Mr.init(e, t), F.init(e, t);
|
|
4629
|
+
}), ks = /*@__PURE__*/ C("ZodCUID", (e, t) => {
|
|
4630
|
+
Nr.init(e, t), F.init(e, t);
|
|
4631
|
+
}), As = /*@__PURE__*/ C("ZodCUID2", (e, t) => {
|
|
4632
|
+
Pr.init(e, t), F.init(e, t);
|
|
4633
|
+
}), js = /*@__PURE__*/ C("ZodULID", (e, t) => {
|
|
4634
|
+
Fr.init(e, t), F.init(e, t);
|
|
4635
|
+
}), Ms = /*@__PURE__*/ C("ZodXID", (e, t) => {
|
|
4636
|
+
Ir.init(e, t), F.init(e, t);
|
|
4637
|
+
}), Ns = /*@__PURE__*/ C("ZodKSUID", (e, t) => {
|
|
4638
|
+
Lr.init(e, t), F.init(e, t);
|
|
4639
|
+
}), Ps = /*@__PURE__*/ C("ZodIPv4", (e, t) => {
|
|
4640
|
+
Hr.init(e, t), F.init(e, t);
|
|
4641
|
+
}), Fs = /*@__PURE__*/ C("ZodIPv6", (e, t) => {
|
|
4642
|
+
Gr.init(e, t), F.init(e, t);
|
|
4643
|
+
}), Is = /*@__PURE__*/ C("ZodCIDRv4", (e, t) => {
|
|
4644
|
+
Kr.init(e, t), F.init(e, t);
|
|
4645
|
+
}), Ls = /*@__PURE__*/ C("ZodCIDRv6", (e, t) => {
|
|
4646
|
+
Jr.init(e, t), F.init(e, t);
|
|
4647
|
+
}), Rs = /*@__PURE__*/ C("ZodBase64", (e, t) => {
|
|
4648
|
+
Xr.init(e, t), F.init(e, t);
|
|
4649
|
+
}), zs = /*@__PURE__*/ C("ZodBase64URL", (e, t) => {
|
|
4650
|
+
Qr.init(e, t), F.init(e, t);
|
|
4651
|
+
}), Bs = /*@__PURE__*/ C("ZodE164", (e, t) => {
|
|
4652
|
+
$r.init(e, t), F.init(e, t);
|
|
4653
|
+
}), Vs = /*@__PURE__*/ C("ZodJWT", (e, t) => {
|
|
4654
|
+
ti.init(e, t), F.init(e, t);
|
|
4655
|
+
}), Hs = /*@__PURE__*/ C("ZodNumber", (e, t) => {
|
|
4656
|
+
ni.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Do(e, t, n, r);
|
|
4657
4657
|
let n = e._zod.bag;
|
|
4658
4658
|
e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null;
|
|
4659
4659
|
}, {
|
|
@@ -4676,10 +4676,10 @@ var P = /*@__PURE__*/ C("ZodStringFormat", (e, t) => {
|
|
|
4676
4676
|
return this.check(/* @__PURE__ */ Ha(e, t));
|
|
4677
4677
|
},
|
|
4678
4678
|
int(e) {
|
|
4679
|
-
return this.check(
|
|
4679
|
+
return this.check(Ws(e));
|
|
4680
4680
|
},
|
|
4681
4681
|
safe(e) {
|
|
4682
|
-
return this.check(
|
|
4682
|
+
return this.check(Ws(e));
|
|
4683
4683
|
},
|
|
4684
4684
|
positive(e) {
|
|
4685
4685
|
return this.check(/* @__PURE__ */ Ua(0, e));
|
|
@@ -4703,41 +4703,41 @@ var P = /*@__PURE__*/ C("ZodStringFormat", (e, t) => {
|
|
|
4703
4703
|
return this;
|
|
4704
4704
|
}
|
|
4705
4705
|
});
|
|
4706
|
-
function
|
|
4707
|
-
return /* @__PURE__ */ Fa(
|
|
4706
|
+
function I(e) {
|
|
4707
|
+
return /* @__PURE__ */ Fa(Hs, e);
|
|
4708
4708
|
}
|
|
4709
|
-
var
|
|
4710
|
-
ri.init(e, t),
|
|
4709
|
+
var Us = /*@__PURE__*/ C("ZodNumberFormat", (e, t) => {
|
|
4710
|
+
ri.init(e, t), Hs.init(e, t);
|
|
4711
4711
|
});
|
|
4712
|
-
function
|
|
4713
|
-
return /* @__PURE__ */ Ia(
|
|
4712
|
+
function Ws(e) {
|
|
4713
|
+
return /* @__PURE__ */ Ia(Us, e);
|
|
4714
4714
|
}
|
|
4715
|
-
var
|
|
4716
|
-
ii.init(e, t),
|
|
4715
|
+
var Gs = /*@__PURE__*/ C("ZodBoolean", (e, t) => {
|
|
4716
|
+
ii.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Oo(e, t, n, r);
|
|
4717
4717
|
});
|
|
4718
|
-
function
|
|
4719
|
-
return /* @__PURE__ */ La(
|
|
4718
|
+
function L(e) {
|
|
4719
|
+
return /* @__PURE__ */ La(Gs, e);
|
|
4720
4720
|
}
|
|
4721
|
-
var
|
|
4722
|
-
ai.init(e, t),
|
|
4721
|
+
var Ks = /*@__PURE__*/ C("ZodNull", (e, t) => {
|
|
4722
|
+
ai.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => ko(e, t, n, r);
|
|
4723
4723
|
});
|
|
4724
|
-
function
|
|
4725
|
-
return /* @__PURE__ */ Ra(
|
|
4724
|
+
function qs(e) {
|
|
4725
|
+
return /* @__PURE__ */ Ra(Ks, e);
|
|
4726
4726
|
}
|
|
4727
|
-
var
|
|
4728
|
-
oi.init(e, t),
|
|
4727
|
+
var Js = /*@__PURE__*/ C("ZodUnknown", (e, t) => {
|
|
4728
|
+
oi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
|
|
4729
4729
|
});
|
|
4730
|
-
function
|
|
4731
|
-
return /* @__PURE__ */ za(
|
|
4730
|
+
function R() {
|
|
4731
|
+
return /* @__PURE__ */ za(Js);
|
|
4732
4732
|
}
|
|
4733
|
-
var
|
|
4734
|
-
si.init(e, t),
|
|
4733
|
+
var Ys = /*@__PURE__*/ C("ZodNever", (e, t) => {
|
|
4734
|
+
si.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ao(e, t, n, r);
|
|
4735
4735
|
});
|
|
4736
|
-
function
|
|
4737
|
-
return /* @__PURE__ */ Ba(
|
|
4736
|
+
function Xs(e) {
|
|
4737
|
+
return /* @__PURE__ */ Ba(Ys, e);
|
|
4738
4738
|
}
|
|
4739
|
-
var
|
|
4740
|
-
|
|
4739
|
+
var Zs = /*@__PURE__*/ C("ZodArray", (e, t) => {
|
|
4740
|
+
gs(), li.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fo(e, t, n, r), e.element = t.element;
|
|
4741
4741
|
}, {
|
|
4742
4742
|
min(e, t) {
|
|
4743
4743
|
return this.check(/* @__PURE__ */ qa(e, t));
|
|
@@ -4755,14 +4755,14 @@ var Qs = /*@__PURE__*/ C("ZodArray", (e, t) => {
|
|
|
4755
4755
|
return this.element;
|
|
4756
4756
|
}
|
|
4757
4757
|
});
|
|
4758
|
-
function
|
|
4759
|
-
return /* @__PURE__ */ so(
|
|
4758
|
+
function z(e, t) {
|
|
4759
|
+
return /* @__PURE__ */ so(Zs, e, t);
|
|
4760
4760
|
}
|
|
4761
|
-
var
|
|
4762
|
-
|
|
4761
|
+
var Qs = /*@__PURE__*/ C("ZodObject", (e, t) => {
|
|
4762
|
+
gs(), gi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Lo(e, t, n, r), Lt(e, "shape", (e) => e._zod.def.shape, !1);
|
|
4763
4763
|
}, {
|
|
4764
4764
|
keyof() {
|
|
4765
|
-
return
|
|
4765
|
+
return U(Object.keys(this._zod.def.shape));
|
|
4766
4766
|
},
|
|
4767
4767
|
catchall(e) {
|
|
4768
4768
|
return this.clone({
|
|
@@ -4773,19 +4773,19 @@ var $s = /*@__PURE__*/ C("ZodObject", (e, t) => {
|
|
|
4773
4773
|
passthrough() {
|
|
4774
4774
|
return this.clone({
|
|
4775
4775
|
...this._zod.def,
|
|
4776
|
-
catchall:
|
|
4776
|
+
catchall: R()
|
|
4777
4777
|
});
|
|
4778
4778
|
},
|
|
4779
4779
|
loose() {
|
|
4780
4780
|
return this.clone({
|
|
4781
4781
|
...this._zod.def,
|
|
4782
|
-
catchall:
|
|
4782
|
+
catchall: R()
|
|
4783
4783
|
});
|
|
4784
4784
|
},
|
|
4785
4785
|
strict() {
|
|
4786
4786
|
return this.clone({
|
|
4787
4787
|
...this._zod.def,
|
|
4788
|
-
catchall:
|
|
4788
|
+
catchall: Xs()
|
|
4789
4789
|
});
|
|
4790
4790
|
},
|
|
4791
4791
|
strip() {
|
|
@@ -4810,74 +4810,74 @@ var $s = /*@__PURE__*/ C("ZodObject", (e, t) => {
|
|
|
4810
4810
|
return pt(this, e);
|
|
4811
4811
|
},
|
|
4812
4812
|
partial(...e) {
|
|
4813
|
-
return _t(
|
|
4813
|
+
return _t(cc, this, e[0]);
|
|
4814
4814
|
},
|
|
4815
4815
|
exactPartial(...e) {
|
|
4816
|
-
return _t(
|
|
4816
|
+
return _t(uc, this, e[0], "exactPartial");
|
|
4817
4817
|
},
|
|
4818
4818
|
required(...e) {
|
|
4819
|
-
return vt(
|
|
4819
|
+
return vt(vc, this, e[0]);
|
|
4820
4820
|
}
|
|
4821
4821
|
});
|
|
4822
|
-
function
|
|
4823
|
-
return new
|
|
4822
|
+
function B(e, t) {
|
|
4823
|
+
return new Qs({
|
|
4824
4824
|
type: "object",
|
|
4825
4825
|
shape: e ?? {},
|
|
4826
4826
|
...b(t)
|
|
4827
4827
|
});
|
|
4828
4828
|
}
|
|
4829
|
-
function
|
|
4830
|
-
return new
|
|
4829
|
+
function $s(e, t) {
|
|
4830
|
+
return new Qs({
|
|
4831
4831
|
type: "object",
|
|
4832
4832
|
shape: e,
|
|
4833
|
-
catchall:
|
|
4833
|
+
catchall: Xs(),
|
|
4834
4834
|
...b(t)
|
|
4835
4835
|
});
|
|
4836
4836
|
}
|
|
4837
|
-
var
|
|
4838
|
-
vi.init(e, t),
|
|
4837
|
+
var ec = /*@__PURE__*/ C("ZodUnion", (e, t) => {
|
|
4838
|
+
vi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ro(e, t, n, r), e.options = t.options;
|
|
4839
4839
|
});
|
|
4840
|
-
function
|
|
4841
|
-
return new
|
|
4840
|
+
function V(e, t) {
|
|
4841
|
+
return new ec({
|
|
4842
4842
|
type: "union",
|
|
4843
4843
|
options: e,
|
|
4844
4844
|
...b(t)
|
|
4845
4845
|
});
|
|
4846
4846
|
}
|
|
4847
|
-
var
|
|
4848
|
-
yi.init(e, t),
|
|
4847
|
+
var tc = /*@__PURE__*/ C("ZodIntersection", (e, t) => {
|
|
4848
|
+
yi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => zo(e, t, n, r);
|
|
4849
4849
|
});
|
|
4850
|
-
function
|
|
4851
|
-
return new
|
|
4850
|
+
function nc(e, t) {
|
|
4851
|
+
return new tc({
|
|
4852
4852
|
type: "intersection",
|
|
4853
4853
|
left: e,
|
|
4854
4854
|
right: t
|
|
4855
4855
|
});
|
|
4856
4856
|
}
|
|
4857
|
-
var
|
|
4858
|
-
|
|
4857
|
+
var rc = /*@__PURE__*/ C("ZodRecord", (e, t) => {
|
|
4858
|
+
gs(), Si.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Uo(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
4859
4859
|
});
|
|
4860
|
-
function
|
|
4861
|
-
return !t || !t._zod ? new
|
|
4860
|
+
function H(e, t, n) {
|
|
4861
|
+
return !t || !t._zod ? new rc({
|
|
4862
4862
|
type: "record",
|
|
4863
|
-
keyType:
|
|
4863
|
+
keyType: P(),
|
|
4864
4864
|
valueType: e,
|
|
4865
4865
|
...b(t)
|
|
4866
|
-
}) : new
|
|
4866
|
+
}) : new rc({
|
|
4867
4867
|
type: "record",
|
|
4868
4868
|
keyType: e,
|
|
4869
4869
|
valueType: t,
|
|
4870
4870
|
...b(n)
|
|
4871
4871
|
});
|
|
4872
4872
|
}
|
|
4873
|
-
var
|
|
4874
|
-
Ci.init(e, t),
|
|
4873
|
+
var ic = /*@__PURE__*/ C("ZodEnum", (e, t) => {
|
|
4874
|
+
Ci.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => jo(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
4875
4875
|
let n = new Set(Object.keys(t.entries));
|
|
4876
4876
|
e.extract = (e, r) => {
|
|
4877
4877
|
let i = {};
|
|
4878
4878
|
for (let r of e) if (n.has(r)) i[r] = t.entries[r];
|
|
4879
4879
|
else throw Error(`Key ${r} not found in enum`);
|
|
4880
|
-
return new
|
|
4880
|
+
return new ic({
|
|
4881
4881
|
...t,
|
|
4882
4882
|
checks: [],
|
|
4883
4883
|
...b(r),
|
|
@@ -4887,7 +4887,7 @@ var ac = /*@__PURE__*/ C("ZodEnum", (e, t) => {
|
|
|
4887
4887
|
let i = { ...t.entries };
|
|
4888
4888
|
for (let t of e) if (n.has(t)) delete i[t];
|
|
4889
4889
|
else throw Error(`Key ${t} not found in enum`);
|
|
4890
|
-
return new
|
|
4890
|
+
return new ic({
|
|
4891
4891
|
...t,
|
|
4892
4892
|
checks: [],
|
|
4893
4893
|
...b(r),
|
|
@@ -4895,28 +4895,28 @@ var ac = /*@__PURE__*/ C("ZodEnum", (e, t) => {
|
|
|
4895
4895
|
});
|
|
4896
4896
|
};
|
|
4897
4897
|
});
|
|
4898
|
-
function
|
|
4899
|
-
return new
|
|
4898
|
+
function U(e, t) {
|
|
4899
|
+
return new ic({
|
|
4900
4900
|
type: "enum",
|
|
4901
4901
|
entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
|
|
4902
4902
|
...b(t)
|
|
4903
4903
|
});
|
|
4904
4904
|
}
|
|
4905
|
-
var
|
|
4906
|
-
wi.init(e, t),
|
|
4905
|
+
var ac = /*@__PURE__*/ C("ZodLiteral", (e, t) => {
|
|
4906
|
+
wi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Mo(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
|
|
4907
4907
|
if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
4908
4908
|
return t.values[0];
|
|
4909
4909
|
} });
|
|
4910
4910
|
});
|
|
4911
|
-
function
|
|
4912
|
-
return new
|
|
4911
|
+
function W(e, t) {
|
|
4912
|
+
return new ac({
|
|
4913
4913
|
type: "literal",
|
|
4914
4914
|
values: Array.isArray(e) ? e : [e],
|
|
4915
4915
|
...b(t)
|
|
4916
4916
|
});
|
|
4917
4917
|
}
|
|
4918
|
-
var
|
|
4919
|
-
|
|
4918
|
+
var oc = /*@__PURE__*/ C("ZodTransform", (e, t) => {
|
|
4919
|
+
gs(), Ti.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Po(e, t, n, r), e._zod.parse = (n, r) => {
|
|
4920
4920
|
if (r.direction === "backward") throw new Gt(e.constructor.name);
|
|
4921
4921
|
n.addIssue = (r) => {
|
|
4922
4922
|
if (typeof r == "string") n.issues.push(Ot(r, n.value, t));
|
|
@@ -4929,44 +4929,44 @@ var sc = /*@__PURE__*/ C("ZodTransform", (e, t) => {
|
|
|
4929
4929
|
return i instanceof Promise ? i.then((e) => (n.value = e, n)) : (n.value = i, n);
|
|
4930
4930
|
};
|
|
4931
4931
|
});
|
|
4932
|
-
function
|
|
4933
|
-
return new
|
|
4932
|
+
function sc(e) {
|
|
4933
|
+
return new oc({
|
|
4934
4934
|
type: "transform",
|
|
4935
4935
|
transform: e
|
|
4936
4936
|
});
|
|
4937
4937
|
}
|
|
4938
|
-
var
|
|
4939
|
-
Di.init(e, t),
|
|
4938
|
+
var cc = /*@__PURE__*/ C("ZodOptional", (e, t) => {
|
|
4939
|
+
Di.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => $o(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
4940
4940
|
});
|
|
4941
|
-
function
|
|
4942
|
-
return new
|
|
4941
|
+
function lc(e) {
|
|
4942
|
+
return new cc({
|
|
4943
4943
|
type: "optional",
|
|
4944
4944
|
innerType: e
|
|
4945
4945
|
});
|
|
4946
4946
|
}
|
|
4947
|
-
var
|
|
4948
|
-
Oi.init(e, t),
|
|
4947
|
+
var uc = /*@__PURE__*/ C("ZodExactOptional", (e, t) => {
|
|
4948
|
+
Oi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => $o(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
4949
4949
|
});
|
|
4950
|
-
function
|
|
4951
|
-
return new
|
|
4950
|
+
function dc(e) {
|
|
4951
|
+
return new uc({
|
|
4952
4952
|
type: "optional",
|
|
4953
4953
|
innerType: e
|
|
4954
4954
|
});
|
|
4955
4955
|
}
|
|
4956
|
-
var
|
|
4957
|
-
ki.init(e, t),
|
|
4956
|
+
var fc = /*@__PURE__*/ C("ZodNullable", (e, t) => {
|
|
4957
|
+
ki.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
4958
4958
|
});
|
|
4959
|
-
function
|
|
4960
|
-
return new
|
|
4959
|
+
function pc(e) {
|
|
4960
|
+
return new fc({
|
|
4961
4961
|
type: "nullable",
|
|
4962
4962
|
innerType: e
|
|
4963
4963
|
});
|
|
4964
4964
|
}
|
|
4965
|
-
var
|
|
4966
|
-
Ai.init(e, t),
|
|
4965
|
+
var mc = /*@__PURE__*/ C("ZodDefault", (e, t) => {
|
|
4966
|
+
Ai.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Jo(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
4967
4967
|
});
|
|
4968
|
-
function
|
|
4969
|
-
return new
|
|
4968
|
+
function hc(e, t) {
|
|
4969
|
+
return new mc({
|
|
4970
4970
|
type: "default",
|
|
4971
4971
|
innerType: e,
|
|
4972
4972
|
get defaultValue() {
|
|
@@ -4974,11 +4974,11 @@ function gc(e, t) {
|
|
|
4974
4974
|
}
|
|
4975
4975
|
});
|
|
4976
4976
|
}
|
|
4977
|
-
var
|
|
4978
|
-
Mi.init(e, t),
|
|
4977
|
+
var gc = /*@__PURE__*/ C("ZodPrefault", (e, t) => {
|
|
4978
|
+
Mi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
4979
4979
|
});
|
|
4980
|
-
function
|
|
4981
|
-
return new
|
|
4980
|
+
function _c(e, t) {
|
|
4981
|
+
return new gc({
|
|
4982
4982
|
type: "prefault",
|
|
4983
4983
|
innerType: e,
|
|
4984
4984
|
get defaultValue() {
|
|
@@ -4986,184 +4986,184 @@ function vc(e, t) {
|
|
|
4986
4986
|
}
|
|
4987
4987
|
});
|
|
4988
4988
|
}
|
|
4989
|
-
var
|
|
4990
|
-
Ni.init(e, t),
|
|
4989
|
+
var vc = /*@__PURE__*/ C("ZodNonOptional", (e, t) => {
|
|
4990
|
+
Ni.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Go(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
4991
4991
|
});
|
|
4992
|
-
function
|
|
4993
|
-
return new
|
|
4992
|
+
function yc(e, t) {
|
|
4993
|
+
return new vc({
|
|
4994
4994
|
type: "nonoptional",
|
|
4995
4995
|
innerType: e,
|
|
4996
4996
|
...b(t)
|
|
4997
4997
|
});
|
|
4998
4998
|
}
|
|
4999
|
-
var
|
|
5000
|
-
Ii.init(e, t),
|
|
4999
|
+
var bc = /*@__PURE__*/ C("ZodCatch", (e, t) => {
|
|
5000
|
+
Ii.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xo(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
5001
5001
|
});
|
|
5002
|
-
function
|
|
5003
|
-
return new
|
|
5002
|
+
function xc(e, t) {
|
|
5003
|
+
return new bc({
|
|
5004
5004
|
type: "catch",
|
|
5005
5005
|
innerType: e,
|
|
5006
5006
|
catchValue: typeof t == "function" ? t : zt(t)
|
|
5007
5007
|
});
|
|
5008
5008
|
}
|
|
5009
|
-
var
|
|
5010
|
-
Li.init(e, t),
|
|
5009
|
+
var Sc = /*@__PURE__*/ C("ZodPipe", (e, t) => {
|
|
5010
|
+
Li.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zo(e, t, n, r), e.in = t.in, e.out = t.out;
|
|
5011
5011
|
});
|
|
5012
|
-
function
|
|
5013
|
-
return new
|
|
5012
|
+
function Cc(e, t) {
|
|
5013
|
+
return new Sc({
|
|
5014
5014
|
type: "pipe",
|
|
5015
5015
|
in: e,
|
|
5016
5016
|
out: t
|
|
5017
5017
|
});
|
|
5018
5018
|
}
|
|
5019
|
-
var
|
|
5020
|
-
zi.init(e, t),
|
|
5019
|
+
var wc = /*@__PURE__*/ C("ZodReadonly", (e, t) => {
|
|
5020
|
+
zi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
|
|
5021
5021
|
});
|
|
5022
|
-
function
|
|
5023
|
-
return new
|
|
5022
|
+
function Tc(e) {
|
|
5023
|
+
return new wc({
|
|
5024
5024
|
type: "readonly",
|
|
5025
5025
|
innerType: e
|
|
5026
5026
|
});
|
|
5027
5027
|
}
|
|
5028
|
-
var
|
|
5029
|
-
Vi.init(e, t),
|
|
5028
|
+
var Ec = /*@__PURE__*/ C("ZodLazy", (e, t) => {
|
|
5029
|
+
Vi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => es(e, t, n, r), e.unwrap = () => e._zod.def.getter();
|
|
5030
5030
|
});
|
|
5031
|
-
function
|
|
5032
|
-
return new
|
|
5031
|
+
function Dc(e) {
|
|
5032
|
+
return new Ec({
|
|
5033
5033
|
type: "lazy",
|
|
5034
5034
|
getter: e
|
|
5035
5035
|
});
|
|
5036
5036
|
}
|
|
5037
|
-
var
|
|
5038
|
-
Hi.init(e, t),
|
|
5037
|
+
var Oc = /*@__PURE__*/ C("ZodCustom", (e, t) => {
|
|
5038
|
+
Hi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => No(e, t, n, r);
|
|
5039
5039
|
});
|
|
5040
|
-
function
|
|
5041
|
-
return /* @__PURE__ */ co(
|
|
5040
|
+
function kc(e, t = {}) {
|
|
5041
|
+
return /* @__PURE__ */ co(Oc, e, t);
|
|
5042
5042
|
}
|
|
5043
|
-
function
|
|
5043
|
+
function Ac(e, t) {
|
|
5044
5044
|
return /* @__PURE__ */ lo(e, t);
|
|
5045
5045
|
}
|
|
5046
|
-
function
|
|
5047
|
-
let t =
|
|
5048
|
-
|
|
5049
|
-
F(),
|
|
5046
|
+
function jc(e) {
|
|
5047
|
+
let t = Dc(() => V([
|
|
5048
|
+
P(e),
|
|
5050
5049
|
I(),
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5050
|
+
L(),
|
|
5051
|
+
qs(),
|
|
5052
|
+
z(t),
|
|
5053
|
+
H(P(), t)
|
|
5054
5054
|
]));
|
|
5055
5055
|
return t;
|
|
5056
5056
|
}
|
|
5057
5057
|
//#endregion
|
|
5058
5058
|
//#region src/flow/common/triggerScheduleSchema.ts
|
|
5059
|
-
var
|
|
5060
|
-
type:
|
|
5061
|
-
expression:
|
|
5062
|
-
timezone:
|
|
5063
|
-
}),
|
|
5064
|
-
type:
|
|
5065
|
-
unit:
|
|
5059
|
+
var Mc = z(V([B({
|
|
5060
|
+
type: W("cron"),
|
|
5061
|
+
expression: P(),
|
|
5062
|
+
timezone: P()
|
|
5063
|
+
}), B({
|
|
5064
|
+
type: W("every"),
|
|
5065
|
+
unit: U([
|
|
5066
5066
|
"day",
|
|
5067
5067
|
"hour",
|
|
5068
5068
|
"minute",
|
|
5069
5069
|
"month",
|
|
5070
5070
|
"week"
|
|
5071
5071
|
]),
|
|
5072
|
-
value:
|
|
5073
|
-
})])),
|
|
5074
|
-
description:
|
|
5075
|
-
jsonSchema:
|
|
5076
|
-
nullable:
|
|
5077
|
-
handle:
|
|
5078
|
-
}),
|
|
5079
|
-
collapsed:
|
|
5080
|
-
group:
|
|
5081
|
-
}),
|
|
5082
|
-
kind:
|
|
5083
|
-
nodeId:
|
|
5084
|
-
output:
|
|
5085
|
-
}),
|
|
5086
|
-
kind:
|
|
5087
|
-
input:
|
|
5088
|
-
}),
|
|
5072
|
+
value: I()
|
|
5073
|
+
})])), G = P(), K = jc(), Nc = z(G), Pc = B({
|
|
5074
|
+
description: G.optional(),
|
|
5075
|
+
jsonSchema: K,
|
|
5076
|
+
nullable: L(),
|
|
5077
|
+
handle: G
|
|
5078
|
+
}), q = Pc.extend({ value: K.optional() }), Fc = B({
|
|
5079
|
+
collapsed: L().optional(),
|
|
5080
|
+
group: G
|
|
5081
|
+
}), Ic = B({
|
|
5082
|
+
kind: W("node"),
|
|
5083
|
+
nodeId: G,
|
|
5084
|
+
output: G
|
|
5085
|
+
}), Lc = B({
|
|
5086
|
+
kind: W("flow"),
|
|
5087
|
+
input: G
|
|
5088
|
+
}), Rc = V([
|
|
5089
|
+
Ic,
|
|
5089
5090
|
Lc,
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
bindingId: W
|
|
5091
|
+
B({
|
|
5092
|
+
kind: W("binding"),
|
|
5093
|
+
bindingId: G
|
|
5094
5094
|
})
|
|
5095
|
-
]),
|
|
5096
|
-
kind:
|
|
5097
|
-
value:
|
|
5098
|
-
}),
|
|
5099
|
-
kind:
|
|
5100
|
-
sources:
|
|
5101
|
-
})]),
|
|
5102
|
-
inputs:
|
|
5103
|
-
outputs:
|
|
5104
|
-
},
|
|
5105
|
-
kind:
|
|
5106
|
-
action:
|
|
5107
|
-
connectionId:
|
|
5108
|
-
connections:
|
|
5109
|
-
connectionId:
|
|
5110
|
-
alias:
|
|
5095
|
+
]), zc = V([B({
|
|
5096
|
+
kind: W("value"),
|
|
5097
|
+
value: K
|
|
5098
|
+
}), B({
|
|
5099
|
+
kind: W("sources"),
|
|
5100
|
+
sources: z(Rc)
|
|
5101
|
+
})]), Bc = H(G, zc), Vc = {
|
|
5102
|
+
inputs: z(V([q, Fc])),
|
|
5103
|
+
outputs: z(V([Pc, Fc]))
|
|
5104
|
+
}, Hc = B({
|
|
5105
|
+
kind: W("connector"),
|
|
5106
|
+
action: G,
|
|
5107
|
+
connectionId: G.optional(),
|
|
5108
|
+
connections: z(B({
|
|
5109
|
+
connectionId: G,
|
|
5110
|
+
alias: G.optional()
|
|
5111
5111
|
}))
|
|
5112
|
-
}),
|
|
5113
|
-
...
|
|
5114
|
-
name:
|
|
5115
|
-
moduleId:
|
|
5116
|
-
capabilities:
|
|
5117
|
-
}),
|
|
5118
|
-
kind:
|
|
5119
|
-
value:
|
|
5120
|
-
}),
|
|
5121
|
-
kind:
|
|
5122
|
-
input:
|
|
5123
|
-
})]),
|
|
5124
|
-
...
|
|
5125
|
-
name:
|
|
5126
|
-
executor:
|
|
5127
|
-
|
|
5128
|
-
kind:
|
|
5129
|
-
action:
|
|
5130
|
-
connectionId:
|
|
5112
|
+
}), Uc = B({
|
|
5113
|
+
...Vc,
|
|
5114
|
+
name: G,
|
|
5115
|
+
moduleId: G,
|
|
5116
|
+
capabilities: z(Hc).optional()
|
|
5117
|
+
}), Wc = V([B({
|
|
5118
|
+
kind: W("value"),
|
|
5119
|
+
value: K
|
|
5120
|
+
}), B({
|
|
5121
|
+
kind: W("input"),
|
|
5122
|
+
input: G
|
|
5123
|
+
})]), Gc = V([Wc, B({ kind: W("model") })]), Kc = B({
|
|
5124
|
+
...Vc,
|
|
5125
|
+
name: G,
|
|
5126
|
+
executor: V([
|
|
5127
|
+
B({
|
|
5128
|
+
kind: W("connector"),
|
|
5129
|
+
action: G,
|
|
5130
|
+
connectionId: G.optional()
|
|
5131
5131
|
}),
|
|
5132
|
-
|
|
5133
|
-
kind:
|
|
5134
|
-
mode:
|
|
5132
|
+
B({
|
|
5133
|
+
kind: W("llm"),
|
|
5134
|
+
mode: U(["chat", "json"])
|
|
5135
5135
|
}),
|
|
5136
|
-
|
|
5137
|
-
kind:
|
|
5138
|
-
code:
|
|
5139
|
-
model:
|
|
5140
|
-
prompt:
|
|
5141
|
-
system:
|
|
5142
|
-
maxRounds:
|
|
5143
|
-
tools:
|
|
5144
|
-
id:
|
|
5145
|
-
name:
|
|
5146
|
-
description:
|
|
5147
|
-
action:
|
|
5148
|
-
connectionId:
|
|
5149
|
-
approval:
|
|
5150
|
-
inputs:
|
|
5136
|
+
B({
|
|
5137
|
+
kind: W("agent"),
|
|
5138
|
+
code: L().optional(),
|
|
5139
|
+
model: G,
|
|
5140
|
+
prompt: Wc,
|
|
5141
|
+
system: G,
|
|
5142
|
+
maxRounds: I(),
|
|
5143
|
+
tools: z(B({
|
|
5144
|
+
id: G,
|
|
5145
|
+
name: G,
|
|
5146
|
+
description: G,
|
|
5147
|
+
action: G,
|
|
5148
|
+
connectionId: G.optional(),
|
|
5149
|
+
approval: L(),
|
|
5150
|
+
inputs: z(q.extend({ source: Gc }))
|
|
5151
5151
|
})),
|
|
5152
|
-
notification:
|
|
5153
|
-
taskId:
|
|
5154
|
-
messageHandle:
|
|
5155
|
-
inputs:
|
|
5152
|
+
notification: B({
|
|
5153
|
+
taskId: G,
|
|
5154
|
+
messageHandle: G,
|
|
5155
|
+
inputs: H(G, Wc)
|
|
5156
5156
|
}).optional()
|
|
5157
5157
|
})
|
|
5158
5158
|
])
|
|
5159
|
-
}),
|
|
5160
|
-
input:
|
|
5161
|
-
cases:
|
|
5162
|
-
output:
|
|
5163
|
-
relation:
|
|
5164
|
-
expressions:
|
|
5165
|
-
input:
|
|
5166
|
-
operator:
|
|
5159
|
+
}), qc = {
|
|
5160
|
+
input: q,
|
|
5161
|
+
cases: z(B({
|
|
5162
|
+
output: G,
|
|
5163
|
+
relation: U(["all", "any"]),
|
|
5164
|
+
expressions: z(B({
|
|
5165
|
+
input: G,
|
|
5166
|
+
operator: U([
|
|
5167
5167
|
"!=",
|
|
5168
5168
|
"<",
|
|
5169
5169
|
"<=",
|
|
@@ -5185,41 +5185,41 @@ var Nc = R(B([z({
|
|
|
5185
5185
|
"notHasValue",
|
|
5186
5186
|
"startsWith"
|
|
5187
5187
|
]),
|
|
5188
|
-
value:
|
|
5188
|
+
value: K.optional()
|
|
5189
5189
|
}))
|
|
5190
5190
|
})),
|
|
5191
|
-
defaultOutput:
|
|
5192
|
-
},
|
|
5193
|
-
bodyFields:
|
|
5194
|
-
options:
|
|
5195
|
-
allowedMethods:
|
|
5196
|
-
allowedOrigins:
|
|
5197
|
-
noResponseBody:
|
|
5198
|
-
responseData:
|
|
5199
|
-
responseHeaders:
|
|
5200
|
-
responseStatusCode:
|
|
5191
|
+
defaultOutput: G.optional()
|
|
5192
|
+
}, Jc = { prompt: G }, Yc = {
|
|
5193
|
+
bodyFields: z(q),
|
|
5194
|
+
options: B({
|
|
5195
|
+
allowedMethods: Nc.optional(),
|
|
5196
|
+
allowedOrigins: Nc.optional(),
|
|
5197
|
+
noResponseBody: L().optional(),
|
|
5198
|
+
responseData: G.optional(),
|
|
5199
|
+
responseHeaders: H(G, G).optional(),
|
|
5200
|
+
responseStatusCode: I().optional()
|
|
5201
5201
|
}).optional()
|
|
5202
|
-
},
|
|
5203
|
-
configSchema:
|
|
5204
|
-
definitionVersion:
|
|
5205
|
-
description:
|
|
5206
|
-
displayName:
|
|
5207
|
-
key:
|
|
5208
|
-
name:
|
|
5209
|
-
outputs:
|
|
5210
|
-
provider:
|
|
5211
|
-
},
|
|
5212
|
-
body:
|
|
5213
|
-
allowArray:
|
|
5214
|
-
allowEmpty:
|
|
5215
|
-
formats:
|
|
5202
|
+
}, Xc = {
|
|
5203
|
+
configSchema: K,
|
|
5204
|
+
definitionVersion: W(2),
|
|
5205
|
+
description: G,
|
|
5206
|
+
displayName: G,
|
|
5207
|
+
key: G,
|
|
5208
|
+
name: G,
|
|
5209
|
+
outputs: z(Pc).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
|
|
5210
|
+
provider: G
|
|
5211
|
+
}, Zc = B({
|
|
5212
|
+
body: B({
|
|
5213
|
+
allowArray: L(),
|
|
5214
|
+
allowEmpty: L(),
|
|
5215
|
+
formats: z(U([
|
|
5216
5216
|
"form",
|
|
5217
5217
|
"json",
|
|
5218
5218
|
"multipart",
|
|
5219
5219
|
"text"
|
|
5220
5220
|
]))
|
|
5221
5221
|
}),
|
|
5222
|
-
methods:
|
|
5222
|
+
methods: z(U([
|
|
5223
5223
|
"DELETE",
|
|
5224
5224
|
"GET",
|
|
5225
5225
|
"HEAD",
|
|
@@ -5227,298 +5227,298 @@ var Nc = R(B([z({
|
|
|
5227
5227
|
"POST",
|
|
5228
5228
|
"PUT"
|
|
5229
5229
|
])),
|
|
5230
|
-
successStatus:
|
|
5231
|
-
}),
|
|
5232
|
-
name:
|
|
5233
|
-
description:
|
|
5234
|
-
icon:
|
|
5235
|
-
},
|
|
5236
|
-
maxExecutions:
|
|
5237
|
-
inputs:
|
|
5238
|
-
name:
|
|
5239
|
-
description:
|
|
5240
|
-
icon:
|
|
5241
|
-
timeoutMs:
|
|
5242
|
-
},
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
kind:
|
|
5246
|
-
...
|
|
5230
|
+
successStatus: I()
|
|
5231
|
+
}), Qc = {
|
|
5232
|
+
name: G,
|
|
5233
|
+
description: G.optional(),
|
|
5234
|
+
icon: G.optional()
|
|
5235
|
+
}, $c = {
|
|
5236
|
+
maxExecutions: I().int().positive().max(2 ** 53 - 1).optional(),
|
|
5237
|
+
inputs: Bc,
|
|
5238
|
+
name: G.optional(),
|
|
5239
|
+
description: G.optional(),
|
|
5240
|
+
icon: G.optional(),
|
|
5241
|
+
timeoutMs: I().optional()
|
|
5242
|
+
}, el = V([
|
|
5243
|
+
B({
|
|
5244
|
+
...$c,
|
|
5245
|
+
kind: W("condition"),
|
|
5246
|
+
...qc
|
|
5247
5247
|
}),
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
inputs:
|
|
5251
|
-
kind:
|
|
5252
|
-
values:
|
|
5248
|
+
B({
|
|
5249
|
+
...$c,
|
|
5250
|
+
inputs: R().transform(() => ({})).default({}),
|
|
5251
|
+
kind: W("value"),
|
|
5252
|
+
values: z(q)
|
|
5253
5253
|
}),
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
kind:
|
|
5257
|
-
subflowId:
|
|
5254
|
+
B({
|
|
5255
|
+
...$c,
|
|
5256
|
+
kind: W("subflow"),
|
|
5257
|
+
subflowId: G
|
|
5258
5258
|
}),
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
kind:
|
|
5262
|
-
task:
|
|
5263
|
-
additionalInputs:
|
|
5259
|
+
B({
|
|
5260
|
+
...$c,
|
|
5261
|
+
kind: W("task"),
|
|
5262
|
+
task: Uc,
|
|
5263
|
+
additionalInputs: z(q).optional()
|
|
5264
5264
|
}),
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
kind:
|
|
5268
|
-
taskId:
|
|
5269
|
-
additionalInputs:
|
|
5265
|
+
B({
|
|
5266
|
+
...$c,
|
|
5267
|
+
kind: W("task"),
|
|
5268
|
+
taskId: G,
|
|
5269
|
+
additionalInputs: z(q).optional()
|
|
5270
5270
|
}),
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
kind:
|
|
5274
|
-
input:
|
|
5275
|
-
...
|
|
5276
|
-
}).omit({ timeoutMs: !0 }),
|
|
5277
|
-
ec({
|
|
5278
|
-
...el,
|
|
5279
|
-
kind: U("wait"),
|
|
5280
|
-
input: K,
|
|
5281
|
-
...Yc
|
|
5271
|
+
$s({
|
|
5272
|
+
...$c,
|
|
5273
|
+
kind: W("approval"),
|
|
5274
|
+
input: q,
|
|
5275
|
+
...Jc
|
|
5282
5276
|
}).omit({ timeoutMs: !0 }),
|
|
5283
|
-
|
|
5277
|
+
$s({
|
|
5284
5278
|
...$c,
|
|
5285
|
-
kind:
|
|
5279
|
+
kind: W("wait"),
|
|
5280
|
+
input: q,
|
|
5281
|
+
...Jc
|
|
5282
|
+
}).omit({ timeoutMs: !0 }),
|
|
5283
|
+
B({
|
|
5284
|
+
...Qc,
|
|
5285
|
+
kind: W("manual")
|
|
5286
5286
|
}),
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
kind:
|
|
5290
|
-
...
|
|
5287
|
+
B({
|
|
5288
|
+
...Qc,
|
|
5289
|
+
kind: W("webhook"),
|
|
5290
|
+
...Yc
|
|
5291
5291
|
}),
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
kind:
|
|
5295
|
-
cronTimes:
|
|
5292
|
+
B({
|
|
5293
|
+
...Qc,
|
|
5294
|
+
kind: W("cron"),
|
|
5295
|
+
cronTimes: Mc
|
|
5296
5296
|
}),
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
kind:
|
|
5300
|
-
bindingId:
|
|
5301
|
-
config:
|
|
5302
|
-
definition:
|
|
5303
|
-
...
|
|
5304
|
-
type:
|
|
5297
|
+
B({
|
|
5298
|
+
...Qc,
|
|
5299
|
+
kind: W("poll"),
|
|
5300
|
+
bindingId: G,
|
|
5301
|
+
config: H(G, K),
|
|
5302
|
+
definition: B({
|
|
5303
|
+
...Xc,
|
|
5304
|
+
type: W("poll")
|
|
5305
5305
|
}),
|
|
5306
|
-
pollTimes:
|
|
5306
|
+
pollTimes: Mc
|
|
5307
5307
|
}),
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
kind:
|
|
5311
|
-
bindingId:
|
|
5312
|
-
config:
|
|
5313
|
-
definition:
|
|
5314
|
-
...
|
|
5315
|
-
type:
|
|
5316
|
-
endpoint:
|
|
5308
|
+
B({
|
|
5309
|
+
...Qc,
|
|
5310
|
+
kind: W("integration"),
|
|
5311
|
+
bindingId: G,
|
|
5312
|
+
config: H(G, K),
|
|
5313
|
+
definition: B({
|
|
5314
|
+
...Xc,
|
|
5315
|
+
type: W("integration"),
|
|
5316
|
+
endpoint: Zc
|
|
5317
5317
|
})
|
|
5318
5318
|
})
|
|
5319
|
-
]),
|
|
5320
|
-
kind:
|
|
5321
|
-
id:
|
|
5322
|
-
})]),
|
|
5323
|
-
source:
|
|
5324
|
-
target:
|
|
5325
|
-
sourceHandle:
|
|
5326
|
-
}),
|
|
5327
|
-
nodeId:
|
|
5328
|
-
target:
|
|
5329
|
-
},
|
|
5330
|
-
name:
|
|
5331
|
-
inputs:
|
|
5332
|
-
outputs:
|
|
5333
|
-
}),
|
|
5334
|
-
nodes:
|
|
5335
|
-
edges:
|
|
5336
|
-
}),
|
|
5337
|
-
kind:
|
|
5338
|
-
target:
|
|
5339
|
-
}),
|
|
5340
|
-
name:
|
|
5341
|
-
imports:
|
|
5342
|
-
source:
|
|
5343
|
-
}),
|
|
5344
|
-
bindings:
|
|
5345
|
-
graph:
|
|
5346
|
-
subflows:
|
|
5347
|
-
tasks:
|
|
5319
|
+
]), tl = V([B({ kind: W("flow") }), B({
|
|
5320
|
+
kind: W("subflow"),
|
|
5321
|
+
id: G
|
|
5322
|
+
})]), nl = B({
|
|
5323
|
+
source: G,
|
|
5324
|
+
target: G,
|
|
5325
|
+
sourceHandle: G.optional()
|
|
5326
|
+
}), J = {
|
|
5327
|
+
nodeId: G,
|
|
5328
|
+
target: tl
|
|
5329
|
+
}, rl = B({
|
|
5330
|
+
name: G,
|
|
5331
|
+
inputs: z(q),
|
|
5332
|
+
outputs: z(Pc.extend({ sources: z(V([Ic, Lc])) }))
|
|
5333
|
+
}), il = B({
|
|
5334
|
+
nodes: H(G, el),
|
|
5335
|
+
edges: z(nl).default([])
|
|
5336
|
+
}), al = B({
|
|
5337
|
+
kind: U(["connection", "variable"]),
|
|
5338
|
+
target: G
|
|
5339
|
+
}), ol = B({
|
|
5340
|
+
name: G,
|
|
5341
|
+
imports: Nc,
|
|
5342
|
+
source: G
|
|
5343
|
+
}), sl = B({
|
|
5344
|
+
bindings: H(G, al),
|
|
5345
|
+
graph: il,
|
|
5346
|
+
subflows: H(G, rl.extend({ graph: il })),
|
|
5347
|
+
tasks: H(G, Kc)
|
|
5348
|
+
}), cl = B({
|
|
5349
|
+
modelVersion: V([W(2), W(3)]),
|
|
5350
|
+
document: sl,
|
|
5351
|
+
modules: H(G, ol)
|
|
5348
5352
|
});
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
modules: V(W, sl)
|
|
5353
|
-
}).extend({
|
|
5354
|
-
kind: U("open-flow-flow-revision"),
|
|
5355
|
-
version: U(1)
|
|
5353
|
+
cl.extend({ modelVersion: W(3) }), cl.extend({
|
|
5354
|
+
kind: W("open-flow-flow-revision"),
|
|
5355
|
+
version: W(1)
|
|
5356
5356
|
});
|
|
5357
5357
|
var ll = {
|
|
5358
5358
|
"binding.create": {
|
|
5359
|
-
bindingId:
|
|
5360
|
-
binding:
|
|
5359
|
+
bindingId: G,
|
|
5360
|
+
binding: al
|
|
5361
5361
|
},
|
|
5362
|
-
"binding.delete": { bindingId:
|
|
5362
|
+
"binding.delete": { bindingId: G },
|
|
5363
5363
|
"binding.target.set": {
|
|
5364
|
-
bindingId:
|
|
5365
|
-
before:
|
|
5366
|
-
value:
|
|
5364
|
+
bindingId: G,
|
|
5365
|
+
before: G,
|
|
5366
|
+
value: G
|
|
5367
5367
|
},
|
|
5368
5368
|
"graph.edge.connect": {
|
|
5369
|
-
target:
|
|
5370
|
-
edge:
|
|
5369
|
+
target: tl,
|
|
5370
|
+
edge: nl
|
|
5371
5371
|
},
|
|
5372
5372
|
"graph.edge.disconnect": {
|
|
5373
|
-
target:
|
|
5374
|
-
edge:
|
|
5373
|
+
target: tl,
|
|
5374
|
+
edge: nl
|
|
5375
5375
|
},
|
|
5376
5376
|
"graph.node.create": {
|
|
5377
|
-
...
|
|
5378
|
-
node:
|
|
5379
|
-
},
|
|
5380
|
-
"graph.node.delete":
|
|
5381
|
-
"graph.node.field.set":
|
|
5382
|
-
|
|
5383
|
-
...
|
|
5384
|
-
kind:
|
|
5385
|
-
field:
|
|
5377
|
+
...J,
|
|
5378
|
+
node: el
|
|
5379
|
+
},
|
|
5380
|
+
"graph.node.delete": J,
|
|
5381
|
+
"graph.node.field.set": V([
|
|
5382
|
+
B({
|
|
5383
|
+
...J,
|
|
5384
|
+
kind: W("graph.node.field.set"),
|
|
5385
|
+
field: U([
|
|
5386
5386
|
"description",
|
|
5387
5387
|
"icon",
|
|
5388
5388
|
"name"
|
|
5389
5389
|
]),
|
|
5390
|
-
before:
|
|
5391
|
-
value:
|
|
5390
|
+
before: G.optional(),
|
|
5391
|
+
value: G.optional()
|
|
5392
5392
|
}),
|
|
5393
|
-
|
|
5394
|
-
...
|
|
5395
|
-
kind:
|
|
5396
|
-
field:
|
|
5397
|
-
before:
|
|
5398
|
-
value:
|
|
5393
|
+
B({
|
|
5394
|
+
...J,
|
|
5395
|
+
kind: W("graph.node.field.set"),
|
|
5396
|
+
field: W("maxExecutions"),
|
|
5397
|
+
before: I().int().positive().max(2 ** 53 - 1).optional(),
|
|
5398
|
+
value: I().int().positive().max(2 ** 53 - 1).optional()
|
|
5399
5399
|
}),
|
|
5400
|
-
|
|
5401
|
-
...
|
|
5402
|
-
kind:
|
|
5403
|
-
field:
|
|
5404
|
-
before:
|
|
5405
|
-
value:
|
|
5400
|
+
B({
|
|
5401
|
+
...J,
|
|
5402
|
+
kind: W("graph.node.field.set"),
|
|
5403
|
+
field: W("timeoutMs"),
|
|
5404
|
+
before: I().optional(),
|
|
5405
|
+
value: I().optional()
|
|
5406
5406
|
})
|
|
5407
5407
|
]),
|
|
5408
5408
|
"graph.node.input.set": {
|
|
5409
|
-
...
|
|
5410
|
-
handle:
|
|
5411
|
-
before:
|
|
5412
|
-
value:
|
|
5409
|
+
...J,
|
|
5410
|
+
handle: G,
|
|
5411
|
+
before: zc.optional(),
|
|
5412
|
+
value: zc.optional()
|
|
5413
5413
|
},
|
|
5414
5414
|
"graph.node.additional-inputs.set": {
|
|
5415
|
-
...
|
|
5416
|
-
before:
|
|
5417
|
-
value:
|
|
5415
|
+
...J,
|
|
5416
|
+
before: z(q).optional(),
|
|
5417
|
+
value: z(q).optional()
|
|
5418
5418
|
},
|
|
5419
5419
|
"graph.node.condition.set": {
|
|
5420
|
-
...
|
|
5421
|
-
before:
|
|
5422
|
-
value:
|
|
5420
|
+
...J,
|
|
5421
|
+
before: B(qc),
|
|
5422
|
+
value: B(qc)
|
|
5423
5423
|
},
|
|
5424
5424
|
"graph.node.values.set": {
|
|
5425
|
-
...
|
|
5426
|
-
before:
|
|
5427
|
-
value:
|
|
5425
|
+
...J,
|
|
5426
|
+
before: z(q),
|
|
5427
|
+
value: z(q)
|
|
5428
5428
|
},
|
|
5429
5429
|
"graph.node.resolution.set": {
|
|
5430
|
-
...
|
|
5431
|
-
target:
|
|
5432
|
-
before:
|
|
5433
|
-
value:
|
|
5430
|
+
...J,
|
|
5431
|
+
target: B({ kind: W("flow") }),
|
|
5432
|
+
before: B(Jc),
|
|
5433
|
+
value: B(Jc)
|
|
5434
5434
|
},
|
|
5435
5435
|
"graph.node.webhook.set": {
|
|
5436
|
-
...
|
|
5437
|
-
target:
|
|
5438
|
-
before:
|
|
5439
|
-
value:
|
|
5436
|
+
...J,
|
|
5437
|
+
target: B({ kind: W("flow") }),
|
|
5438
|
+
before: B(Yc),
|
|
5439
|
+
value: B(Yc)
|
|
5440
5440
|
},
|
|
5441
5441
|
"graph.node.task.ports.set": {
|
|
5442
|
-
...
|
|
5443
|
-
before:
|
|
5444
|
-
value:
|
|
5442
|
+
...J,
|
|
5443
|
+
before: B(Vc),
|
|
5444
|
+
value: B(Vc)
|
|
5445
5445
|
},
|
|
5446
5446
|
"graph.node.task.name.set": {
|
|
5447
|
-
...
|
|
5448
|
-
before:
|
|
5449
|
-
value:
|
|
5447
|
+
...J,
|
|
5448
|
+
before: G,
|
|
5449
|
+
value: G
|
|
5450
5450
|
},
|
|
5451
5451
|
"graph.node.task.capabilities.set": {
|
|
5452
|
-
...
|
|
5453
|
-
before:
|
|
5454
|
-
value:
|
|
5452
|
+
...J,
|
|
5453
|
+
before: z(Hc).optional(),
|
|
5454
|
+
value: z(Hc).optional()
|
|
5455
5455
|
},
|
|
5456
5456
|
"graph.trigger.config.set": {
|
|
5457
|
-
nodeId:
|
|
5458
|
-
name:
|
|
5459
|
-
before:
|
|
5460
|
-
value:
|
|
5457
|
+
nodeId: G,
|
|
5458
|
+
name: G,
|
|
5459
|
+
before: K.optional(),
|
|
5460
|
+
value: K.optional()
|
|
5461
5461
|
},
|
|
5462
5462
|
"graph.trigger.schedule.set": {
|
|
5463
|
-
nodeId:
|
|
5464
|
-
before:
|
|
5465
|
-
value:
|
|
5463
|
+
nodeId: G,
|
|
5464
|
+
before: Mc,
|
|
5465
|
+
value: Mc
|
|
5466
5466
|
},
|
|
5467
5467
|
"module.create": {
|
|
5468
|
-
moduleId:
|
|
5469
|
-
module:
|
|
5468
|
+
moduleId: G,
|
|
5469
|
+
module: ol
|
|
5470
5470
|
},
|
|
5471
|
-
"module.delete": { moduleId:
|
|
5471
|
+
"module.delete": { moduleId: G },
|
|
5472
5472
|
"module.rename": {
|
|
5473
|
-
moduleId:
|
|
5474
|
-
before:
|
|
5475
|
-
name:
|
|
5473
|
+
moduleId: G,
|
|
5474
|
+
before: G,
|
|
5475
|
+
name: G
|
|
5476
5476
|
},
|
|
5477
5477
|
"module.source.replace": {
|
|
5478
|
-
moduleId:
|
|
5479
|
-
beforeImports:
|
|
5480
|
-
beforeSource:
|
|
5481
|
-
imports:
|
|
5482
|
-
source:
|
|
5478
|
+
moduleId: G,
|
|
5479
|
+
beforeImports: Nc,
|
|
5480
|
+
beforeSource: G,
|
|
5481
|
+
imports: Nc,
|
|
5482
|
+
source: G
|
|
5483
5483
|
},
|
|
5484
5484
|
"subflow.create": {
|
|
5485
|
-
subflowId:
|
|
5486
|
-
subflow:
|
|
5485
|
+
subflowId: G,
|
|
5486
|
+
subflow: rl.extend({ graph: il })
|
|
5487
5487
|
},
|
|
5488
5488
|
"subflow.definition.set": {
|
|
5489
|
-
subflowId:
|
|
5490
|
-
before:
|
|
5491
|
-
definition:
|
|
5489
|
+
subflowId: G,
|
|
5490
|
+
before: rl,
|
|
5491
|
+
definition: rl
|
|
5492
5492
|
},
|
|
5493
|
-
"subflow.delete": { subflowId:
|
|
5493
|
+
"subflow.delete": { subflowId: G },
|
|
5494
5494
|
"task.create": {
|
|
5495
|
-
taskId:
|
|
5496
|
-
task:
|
|
5495
|
+
taskId: G,
|
|
5496
|
+
task: Kc
|
|
5497
5497
|
},
|
|
5498
|
-
"task.delete": { taskId:
|
|
5498
|
+
"task.delete": { taskId: G },
|
|
5499
5499
|
"task.connector.connection.set": {
|
|
5500
|
-
taskId:
|
|
5501
|
-
before:
|
|
5502
|
-
value:
|
|
5500
|
+
taskId: G,
|
|
5501
|
+
before: G.optional(),
|
|
5502
|
+
value: G.optional()
|
|
5503
5503
|
},
|
|
5504
5504
|
"task.agent.set": {
|
|
5505
|
-
taskId:
|
|
5506
|
-
before:
|
|
5507
|
-
value:
|
|
5505
|
+
taskId: G,
|
|
5506
|
+
before: Kc,
|
|
5507
|
+
value: Kc
|
|
5508
5508
|
},
|
|
5509
5509
|
"task.llm.mode.set": {
|
|
5510
|
-
taskId:
|
|
5511
|
-
before:
|
|
5512
|
-
value:
|
|
5510
|
+
taskId: G,
|
|
5511
|
+
before: U(["chat", "json"]),
|
|
5512
|
+
value: U(["chat", "json"])
|
|
5513
5513
|
},
|
|
5514
5514
|
"task.name.set": {
|
|
5515
|
-
taskId:
|
|
5516
|
-
before:
|
|
5517
|
-
value:
|
|
5515
|
+
taskId: G,
|
|
5516
|
+
before: G,
|
|
5517
|
+
value: G
|
|
5518
5518
|
}
|
|
5519
5519
|
};
|
|
5520
|
-
|
|
5521
|
-
kind:
|
|
5520
|
+
z(V([...new Map(Object.entries(ll).map(([e, t]) => [e, t instanceof N ? t : B({
|
|
5521
|
+
kind: W(e),
|
|
5522
5522
|
...t
|
|
5523
5523
|
})])).values()])).min(1);
|
|
5524
5524
|
//#endregion
|
|
@@ -5537,61 +5537,61 @@ async function pl(e) {
|
|
|
5537
5537
|
let t = new Uint8Array(e.byteLength);
|
|
5538
5538
|
return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
5539
5539
|
}
|
|
5540
|
-
var ml =
|
|
5541
|
-
jsonSchema:
|
|
5542
|
-
nullable:
|
|
5543
|
-
value:
|
|
5544
|
-
description:
|
|
5545
|
-
}).strict(), gl =
|
|
5546
|
-
kind:
|
|
5547
|
-
value:
|
|
5548
|
-
}).strict(),
|
|
5549
|
-
kind:
|
|
5550
|
-
sources:
|
|
5551
|
-
kind:
|
|
5552
|
-
nodeId:
|
|
5553
|
-
output:
|
|
5540
|
+
var ml = H(P(), R()), hl = B({
|
|
5541
|
+
jsonSchema: R(),
|
|
5542
|
+
nullable: L(),
|
|
5543
|
+
value: R().optional(),
|
|
5544
|
+
description: P().optional()
|
|
5545
|
+
}).strict(), gl = H(P(), hl), _l = V([B({
|
|
5546
|
+
kind: W("value"),
|
|
5547
|
+
value: R()
|
|
5548
|
+
}).strict(), B({
|
|
5549
|
+
kind: W("sources"),
|
|
5550
|
+
sources: z(B({
|
|
5551
|
+
kind: W("node"),
|
|
5552
|
+
nodeId: P(),
|
|
5553
|
+
output: P()
|
|
5554
5554
|
}).strict())
|
|
5555
5555
|
}).strict()]), vl = {
|
|
5556
|
-
name:
|
|
5557
|
-
description:
|
|
5558
|
-
icon:
|
|
5559
|
-
}, yl =
|
|
5560
|
-
|
|
5556
|
+
name: P().optional(),
|
|
5557
|
+
description: P().optional(),
|
|
5558
|
+
icon: P().optional()
|
|
5559
|
+
}, yl = V([
|
|
5560
|
+
B({
|
|
5561
5561
|
...vl,
|
|
5562
|
-
kind:
|
|
5563
|
-
cronTimes: R(
|
|
5562
|
+
kind: W("cron"),
|
|
5563
|
+
cronTimes: z(R())
|
|
5564
5564
|
}).strict(),
|
|
5565
|
-
|
|
5565
|
+
B({
|
|
5566
5566
|
...vl,
|
|
5567
|
-
kind:
|
|
5567
|
+
kind: W("manual")
|
|
5568
5568
|
}).strict(),
|
|
5569
|
-
|
|
5569
|
+
B({
|
|
5570
5570
|
...vl,
|
|
5571
|
-
kind:
|
|
5572
|
-
concurrency:
|
|
5573
|
-
inputs:
|
|
5574
|
-
task:
|
|
5575
|
-
name:
|
|
5576
|
-
moduleId:
|
|
5571
|
+
kind: W("task"),
|
|
5572
|
+
concurrency: W(1).optional(),
|
|
5573
|
+
inputs: H(P(), _l),
|
|
5574
|
+
task: B({
|
|
5575
|
+
name: P(),
|
|
5576
|
+
moduleId: P(),
|
|
5577
5577
|
inputs: gl,
|
|
5578
|
-
outputs:
|
|
5578
|
+
outputs: H(P(), hl.omit({ value: !0 }))
|
|
5579
5579
|
}).strict()
|
|
5580
5580
|
}).strict()
|
|
5581
5581
|
]);
|
|
5582
|
-
|
|
5583
|
-
name:
|
|
5584
|
-
graph:
|
|
5585
|
-
}).strict(),
|
|
5586
|
-
kind:
|
|
5587
|
-
version:
|
|
5588
|
-
modelVersion:
|
|
5589
|
-
modules:
|
|
5590
|
-
name:
|
|
5591
|
-
source:
|
|
5592
|
-
imports:
|
|
5582
|
+
B({
|
|
5583
|
+
name: P(),
|
|
5584
|
+
graph: B({ nodes: H(P(), yl) }).strict()
|
|
5585
|
+
}).strict(), B({
|
|
5586
|
+
kind: W("open-flow-project-revision"),
|
|
5587
|
+
version: W(1),
|
|
5588
|
+
modelVersion: V([W(1), W(2)]),
|
|
5589
|
+
modules: H(P(), B({
|
|
5590
|
+
name: P(),
|
|
5591
|
+
source: P(),
|
|
5592
|
+
imports: z(P())
|
|
5593
5593
|
}).strict()),
|
|
5594
|
-
document:
|
|
5594
|
+
document: B({
|
|
5595
5595
|
bindings: ml,
|
|
5596
5596
|
flows: ml,
|
|
5597
5597
|
subflows: ml,
|
|
@@ -6175,12 +6175,12 @@ function Hl(e) {
|
|
|
6175
6175
|
async function Ul(e) {
|
|
6176
6176
|
let t = await $l(e, "/users/me/profile");
|
|
6177
6177
|
eu(t, "profile fetch");
|
|
6178
|
-
let n =
|
|
6178
|
+
let n = Y(t.data)?.historyId;
|
|
6179
6179
|
if (typeof n != "string" || n.length == 0) throw new a("Gmail profile historyId is missing.");
|
|
6180
6180
|
return n;
|
|
6181
6181
|
}
|
|
6182
6182
|
function Wl(e) {
|
|
6183
|
-
let t =
|
|
6183
|
+
let t = Y(e);
|
|
6184
6184
|
if (typeof t?.historyId != "string" || t.historyId.length == 0) throw new r("Gmail checkpoint historyId is missing; recreate the Trigger.");
|
|
6185
6185
|
return {
|
|
6186
6186
|
historyId: t.historyId,
|
|
@@ -6191,9 +6191,9 @@ async function Gl(e, t) {
|
|
|
6191
6191
|
if (t.length == 0) return [];
|
|
6192
6192
|
let n = await $l(e, "/users/me/labels");
|
|
6193
6193
|
eu(n, "labels list");
|
|
6194
|
-
let i =
|
|
6194
|
+
let i = Y(n.data)?.labels, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
6195
6195
|
if (Array.isArray(i)) for (let e of i) {
|
|
6196
|
-
let t =
|
|
6196
|
+
let t = Y(e);
|
|
6197
6197
|
typeof t?.id == "string" && t.id.length != 0 && (a.add(t.id), typeof t.name == "string" && t.name.length > 0 && o.set(t.name.toLowerCase(), t.id));
|
|
6198
6198
|
}
|
|
6199
6199
|
return [...new Set(t.map((e) => {
|
|
@@ -6213,7 +6213,7 @@ async function Kl(e, t, n, i) {
|
|
|
6213
6213
|
startHistoryId: t.historyId
|
|
6214
6214
|
});
|
|
6215
6215
|
if (c.status == 404) throw new r("Gmail history checkpoint expired; recreate the Trigger.");
|
|
6216
|
-
eu(c, "history list"), s =
|
|
6216
|
+
eu(c, "history list"), s = Y(c.data) ?? {};
|
|
6217
6217
|
for (let e of s.history ?? []) for (let t of e.messagesAdded ?? []) {
|
|
6218
6218
|
let e = t.message?.id;
|
|
6219
6219
|
e != null && e.length > 0 && !a.has(e) && a.set(e, { id: e });
|
|
@@ -6241,7 +6241,7 @@ function ql(e, t) {
|
|
|
6241
6241
|
}
|
|
6242
6242
|
async function Jl(e, t) {
|
|
6243
6243
|
let n = await $l(e, `/users/me/messages/${encodeURIComponent(t)}`, { format: "metadata" });
|
|
6244
|
-
return n.status == 404 ? null : (eu(n, "message metadata fetch"),
|
|
6244
|
+
return n.status == 404 ? null : (eu(n, "message metadata fetch"), Y(n.data) ?? null);
|
|
6245
6245
|
}
|
|
6246
6246
|
async function Yl(e, t, n, r) {
|
|
6247
6247
|
let i = t.labelIds ?? [];
|
|
@@ -6261,8 +6261,8 @@ async function Zl(e, t, n, r) {
|
|
|
6261
6261
|
q: `${n} rfc822msgid:${i}`
|
|
6262
6262
|
});
|
|
6263
6263
|
eu(a, "query match");
|
|
6264
|
-
let o =
|
|
6265
|
-
return Array.isArray(o) && o.some((e) =>
|
|
6264
|
+
let o = Y(a.data)?.messages;
|
|
6265
|
+
return Array.isArray(o) && o.some((e) => Y(e)?.id === t.id);
|
|
6266
6266
|
}
|
|
6267
6267
|
function Ql(e) {
|
|
6268
6268
|
let t = e.payload?.headers ?? [];
|
|
@@ -6306,7 +6306,7 @@ function nu(e, t) {
|
|
|
6306
6306
|
let r = Date.parse(t);
|
|
6307
6307
|
return Number.isNaN(r) ? "" : new Date(r).toISOString();
|
|
6308
6308
|
}
|
|
6309
|
-
function
|
|
6309
|
+
function Y(e) {
|
|
6310
6310
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
6311
6311
|
}
|
|
6312
6312
|
//#endregion
|
|
@@ -6443,7 +6443,7 @@ function ou(e) {
|
|
|
6443
6443
|
};
|
|
6444
6444
|
}
|
|
6445
6445
|
function su(e) {
|
|
6446
|
-
let t =
|
|
6446
|
+
let t = X(e), n = typeof t?.pageToken == "string" ? t.pageToken : void 0, i = typeof t?.calendarId == "string" ? t.calendarId : void 0;
|
|
6447
6447
|
if (typeof t?.syncToken == "string" && t.syncToken.length > 0) return {
|
|
6448
6448
|
calendarId: i,
|
|
6449
6449
|
...n == null ? {} : { pageToken: n },
|
|
@@ -6474,7 +6474,7 @@ async function cu(e, t, n, r) {
|
|
|
6474
6474
|
events: []
|
|
6475
6475
|
};
|
|
6476
6476
|
mu(e, r, "seed full sync");
|
|
6477
|
-
let o =
|
|
6477
|
+
let o = X(r.data) ?? {};
|
|
6478
6478
|
if (o.nextSyncToken) return {
|
|
6479
6479
|
checkpoint: {
|
|
6480
6480
|
calendarId: t.calendarId,
|
|
@@ -6514,7 +6514,7 @@ async function lu(e, t, n) {
|
|
|
6514
6514
|
filtered: i
|
|
6515
6515
|
};
|
|
6516
6516
|
mu(e, s, "incremental sync");
|
|
6517
|
-
let c =
|
|
6517
|
+
let c = X(s.data) ?? {};
|
|
6518
6518
|
for (let e of c.items ?? []) {
|
|
6519
6519
|
if (e.id == null || e.id.length == 0) continue;
|
|
6520
6520
|
let n = uu(e);
|
|
@@ -6605,15 +6605,15 @@ function hu(e) {
|
|
|
6605
6605
|
return e.status == 400 && !_u(e.data);
|
|
6606
6606
|
}
|
|
6607
6607
|
function gu(e) {
|
|
6608
|
-
let t =
|
|
6608
|
+
let t = X(X(e)?.error)?.errors;
|
|
6609
6609
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
6610
|
-
let t =
|
|
6610
|
+
let t = X(e)?.reason;
|
|
6611
6611
|
return typeof t == "string" ? [t] : [];
|
|
6612
6612
|
}) : [];
|
|
6613
6613
|
}
|
|
6614
6614
|
function _u(e) {
|
|
6615
6615
|
if (gu(e).includes("fullSyncRequired")) return !0;
|
|
6616
|
-
let t =
|
|
6616
|
+
let t = X(X(e)?.error)?.message;
|
|
6617
6617
|
return typeof t == "string" && t.includes("fullSyncRequired");
|
|
6618
6618
|
}
|
|
6619
6619
|
function vu(e) {
|
|
@@ -6626,7 +6626,7 @@ function yu(e) {
|
|
|
6626
6626
|
let t = Date.parse(e);
|
|
6627
6627
|
return Number.isNaN(t) ? null : Math.floor(t / 1e3);
|
|
6628
6628
|
}
|
|
6629
|
-
function
|
|
6629
|
+
function X(e) {
|
|
6630
6630
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
6631
6631
|
}
|
|
6632
6632
|
//#endregion
|
|
@@ -6751,7 +6751,7 @@ var bu = 6012e5, xu = 36e5, Su = 6e4, Cu = 6e4, wu = 2, Tu = 100, Eu = new TextE
|
|
|
6751
6751
|
},
|
|
6752
6752
|
snapshot: Ou,
|
|
6753
6753
|
async receive(e) {
|
|
6754
|
-
let t = await
|
|
6754
|
+
let t = await Xu(e);
|
|
6755
6755
|
if (t.outcome != "wake") return t;
|
|
6756
6756
|
let n = Au(e.state), r = e.header("x-goog-resource-state");
|
|
6757
6757
|
if (!e.admit) return e.current ? {
|
|
@@ -6789,19 +6789,19 @@ var bu = 6012e5, xu = 36e5, Su = 6e4, Cu = 6e4, wu = 2, Tu = 100, Eu = new TextE
|
|
|
6789
6789
|
},
|
|
6790
6790
|
async reconcile(e) {
|
|
6791
6791
|
let t = Au(e.state), n = Nu(t), r = e.now.getTime(), i = n.filter((e) => Date.parse(e.expiration) > r);
|
|
6792
|
-
if (i.length != n.length && (n = i, await
|
|
6792
|
+
if (i.length != n.length && (n = i, await Z(t, n, e.now)), !e.active) return await Fu(e, n);
|
|
6793
6793
|
let a = n.filter((e) => e.state == "creating" && e.resourceId != null).toSorted((e, t) => Date.parse(t.createdAt) - Date.parse(e.createdAt))[0];
|
|
6794
6794
|
a != null && (n = n.map((e) => ({
|
|
6795
6795
|
...e,
|
|
6796
6796
|
state: e.id == a.id ? "active" : "retiring"
|
|
6797
|
-
})), await
|
|
6797
|
+
})), await Z(t, n, e.now));
|
|
6798
6798
|
let o = n.find((e) => e.state == "active"), s = n.filter((e) => e.state == "creating").filter((e) => Date.parse(e.createdAt) + Su <= r);
|
|
6799
6799
|
if (s.length > 0) {
|
|
6800
6800
|
let r = new Set(s.map((e) => e.id));
|
|
6801
6801
|
n = n.map((e) => r.has(e.id) ? {
|
|
6802
6802
|
...e,
|
|
6803
6803
|
state: "retiring"
|
|
6804
|
-
} : e), await
|
|
6804
|
+
} : e), await Z(t, n, e.now);
|
|
6805
6805
|
}
|
|
6806
6806
|
if (o = n.find((e) => e.state == "active"), o != null) {
|
|
6807
6807
|
try {
|
|
@@ -6809,9 +6809,9 @@ var bu = 6012e5, xu = 36e5, Su = 6e4, Cu = 6e4, wu = 2, Tu = 100, Eu = new TextE
|
|
|
6809
6809
|
} catch {
|
|
6810
6810
|
return { outcome: "ready" };
|
|
6811
6811
|
}
|
|
6812
|
-
if (o = n.find((e) => e.state == "active"), o != null && Date.parse(o.expiration) - xu > r) return await
|
|
6812
|
+
if (o = n.find((e) => e.state == "active"), o != null && Date.parse(o.expiration) - xu > r) return await Z(t, n, Gu(n, e.now)), { outcome: "ready" };
|
|
6813
6813
|
}
|
|
6814
|
-
return n.some((e) => e.state == "creating") || n.filter((e) => e.resourceId == null).length >= wu ? (await
|
|
6814
|
+
return n.some((e) => e.state == "creating") || n.filter((e) => e.resourceId == null).length >= wu ? (await Z(t, n, Gu(n, e.now)), { outcome: o == null ? "pending" : "ready" }) : await Pu(e, n);
|
|
6815
6815
|
}
|
|
6816
6816
|
};
|
|
6817
6817
|
function Au(e) {
|
|
@@ -6829,7 +6829,7 @@ function ju(e) {
|
|
|
6829
6829
|
};
|
|
6830
6830
|
}
|
|
6831
6831
|
function Mu(e) {
|
|
6832
|
-
let n =
|
|
6832
|
+
let n = Yu(e) ? Q(e.pageToken) : void 0;
|
|
6833
6833
|
if (n == null) throw new t("Google Drive checkpoint pageToken is missing.");
|
|
6834
6834
|
return n;
|
|
6835
6835
|
}
|
|
@@ -6865,7 +6865,7 @@ async function Pu(r, i) {
|
|
|
6865
6865
|
id: crypto.randomUUID(),
|
|
6866
6866
|
state: "creating"
|
|
6867
6867
|
};
|
|
6868
|
-
i = [...i, c], await
|
|
6868
|
+
i = [...i, c], await Z(a, i, new Date(r.now.getTime() + Su));
|
|
6869
6869
|
let l;
|
|
6870
6870
|
try {
|
|
6871
6871
|
l = await Bu(r, {
|
|
@@ -6887,9 +6887,9 @@ async function Pu(r, i) {
|
|
|
6887
6887
|
}
|
|
6888
6888
|
}, "changes.watch");
|
|
6889
6889
|
} catch (n) {
|
|
6890
|
-
throw (n instanceof e || n instanceof t) && await
|
|
6890
|
+
throw (n instanceof e || n instanceof t) && await Z(a, i.filter((e) => e.id != c.id), r.now), n;
|
|
6891
6891
|
}
|
|
6892
|
-
let u =
|
|
6892
|
+
let u = Q(l.resourceId);
|
|
6893
6893
|
if (u == null) throw new n("Google Drive changes.watch response is missing resourceId.");
|
|
6894
6894
|
let d = Ju(l.expiration) ?? c.expiration;
|
|
6895
6895
|
i = i.map((e) => e.id == c.id ? {
|
|
@@ -6900,20 +6900,20 @@ async function Pu(r, i) {
|
|
|
6900
6900
|
} : e.state == "active" ? {
|
|
6901
6901
|
...e,
|
|
6902
6902
|
state: "retiring"
|
|
6903
|
-
} : e), await
|
|
6903
|
+
} : e), await Z(a, i, Gu(i, r.now));
|
|
6904
6904
|
try {
|
|
6905
6905
|
i = await Iu(r, i);
|
|
6906
6906
|
} catch {
|
|
6907
6907
|
return { outcome: "ready" };
|
|
6908
6908
|
}
|
|
6909
|
-
return await
|
|
6909
|
+
return await Z(a, i, Gu(i, r.now)), { outcome: "ready" };
|
|
6910
6910
|
}
|
|
6911
6911
|
async function Fu(e, t) {
|
|
6912
6912
|
let n = Au(e.state);
|
|
6913
6913
|
return t.some((e) => e.state == "active" || e.state == "creating") && (t = t.map((e) => ({
|
|
6914
6914
|
...e,
|
|
6915
6915
|
state: "retiring"
|
|
6916
|
-
})), await
|
|
6916
|
+
})), await Z(n, t, e.now)), t = await Iu(e, t), t.length == 0 ? { outcome: "ready" } : (await Z(n, t, Gu(t, e.now)), { outcome: "pending" });
|
|
6917
6917
|
}
|
|
6918
6918
|
async function Iu(e, t) {
|
|
6919
6919
|
let n = Au(e.state);
|
|
@@ -6923,7 +6923,7 @@ async function Iu(e, t) {
|
|
|
6923
6923
|
...e,
|
|
6924
6924
|
state: "stopping"
|
|
6925
6925
|
} : e);
|
|
6926
|
-
await
|
|
6926
|
+
await Z(n, i, new Date(e.now.getTime() + Cu)), await zu(e, r), t = i.filter((e) => e.id != r.id), await Z(n, t, e.now);
|
|
6927
6927
|
}
|
|
6928
6928
|
return t;
|
|
6929
6929
|
}
|
|
@@ -6935,7 +6935,7 @@ async function Lu(e) {
|
|
|
6935
6935
|
...t.driveId == null ? {} : { driveId: t.driveId },
|
|
6936
6936
|
supportsAllDrives: !0
|
|
6937
6937
|
}
|
|
6938
|
-
}, "changes.getStartPageToken"), i =
|
|
6938
|
+
}, "changes.getStartPageToken"), i = Yu(r) ? Q(r.startPageToken) : void 0;
|
|
6939
6939
|
if (i == null) throw new n("Google Drive startPageToken response is invalid.");
|
|
6940
6940
|
return i;
|
|
6941
6941
|
}
|
|
@@ -6955,10 +6955,10 @@ async function Ru(e, t) {
|
|
|
6955
6955
|
supportsAllDrives: !0
|
|
6956
6956
|
}
|
|
6957
6957
|
}, "changes.list");
|
|
6958
|
-
for (let e of ["nextPageToken", "newStartPageToken"]) if (a[e] !== void 0 &&
|
|
6959
|
-
let o =
|
|
6958
|
+
for (let e of ["nextPageToken", "newStartPageToken"]) if (a[e] !== void 0 && Q(a[e]) == null) throw new n(`Google Drive changes response contains an invalid ${e}.`);
|
|
6959
|
+
let o = Q(a.nextPageToken), s = o ?? Q(a.newStartPageToken);
|
|
6960
6960
|
if (s == null) throw new n("Google Drive changes response is missing its next checkpoint.");
|
|
6961
|
-
if (a.changes != null && (!Array.isArray(a.changes) || !a.changes.every(
|
|
6961
|
+
if (a.changes != null && (!Array.isArray(a.changes) || !a.changes.every(Yu))) throw new n("Google Drive changes response contains invalid changes.");
|
|
6962
6962
|
if (o === i) throw new n("Google Drive changes continuation did not advance.");
|
|
6963
6963
|
return {
|
|
6964
6964
|
changes: a.changes ?? [],
|
|
@@ -6980,7 +6980,7 @@ async function zu(e, t) {
|
|
|
6980
6980
|
}
|
|
6981
6981
|
async function Bu(e, t, n) {
|
|
6982
6982
|
let r = await Vu(e, t);
|
|
6983
|
-
if (r.status >= 200 && r.status < 300 &&
|
|
6983
|
+
if (r.status >= 200 && r.status < 300 && Yu(r.data)) return r.data;
|
|
6984
6984
|
Hu(r, n);
|
|
6985
6985
|
}
|
|
6986
6986
|
async function Vu(t, r) {
|
|
@@ -6995,12 +6995,12 @@ function Hu(r, i) {
|
|
|
6995
6995
|
throw r.status == 401 || r.status == 403 && !a.toLowerCase().includes("ratelimit") ? new e(`Google Drive ${i} requires Connection reauthorization.`) : r.status == 408 || r.status == 429 || r.status >= 500 ? new n(`Google Drive ${i} is temporarily unavailable.`) : new t(`Google Drive ${i} rejected the subscription${a == "" ? "." : ` with ${a}.`}`);
|
|
6996
6996
|
}
|
|
6997
6997
|
function Uu(e) {
|
|
6998
|
-
if (!
|
|
6998
|
+
if (!Yu(e) || !Yu(e.error)) return "";
|
|
6999
6999
|
let t = e.error.errors;
|
|
7000
|
-
return Array.isArray(t) &&
|
|
7000
|
+
return Array.isArray(t) && Yu(t[0]) && typeof t[0].reason == "string" ? t[0].reason : typeof e.error.status == "string" ? e.error.status : "";
|
|
7001
7001
|
}
|
|
7002
7002
|
function Wu(e, t) {
|
|
7003
|
-
let n =
|
|
7003
|
+
let n = Q(e.driveId), r = Q(e.fileId), i = Q(e.time), a = Q(e.changeType), o = e.removed === !0;
|
|
7004
7004
|
return {
|
|
7005
7005
|
changeId: [
|
|
7006
7006
|
n ?? "my-drive",
|
|
@@ -7011,14 +7011,14 @@ function Wu(e, t) {
|
|
|
7011
7011
|
].join(":"),
|
|
7012
7012
|
changeType: a ?? null,
|
|
7013
7013
|
driveId: n ?? null,
|
|
7014
|
-
file:
|
|
7014
|
+
file: Yu(e.file) ? e.file : null,
|
|
7015
7015
|
fileId: r ?? null,
|
|
7016
7016
|
notification: t,
|
|
7017
7017
|
removed: o,
|
|
7018
7018
|
time: i ?? null
|
|
7019
7019
|
};
|
|
7020
7020
|
}
|
|
7021
|
-
async function
|
|
7021
|
+
async function Z(e, t, n) {
|
|
7022
7022
|
await e.saveSubscription({ channels: t }, n);
|
|
7023
7023
|
}
|
|
7024
7024
|
function Gu(e, t) {
|
|
@@ -7042,13 +7042,13 @@ function Ju(e) {
|
|
|
7042
7042
|
let t = typeof e == "string" || typeof e == "number" ? Number(e) : NaN;
|
|
7043
7043
|
return Number.isFinite(t) && t > 0 ? new Date(t).toISOString() : void 0;
|
|
7044
7044
|
}
|
|
7045
|
-
function
|
|
7045
|
+
function Q(e) {
|
|
7046
7046
|
return typeof e == "string" && e.length > 0 ? e : void 0;
|
|
7047
7047
|
}
|
|
7048
|
-
function
|
|
7048
|
+
function Yu(e) {
|
|
7049
7049
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
7050
7050
|
}
|
|
7051
|
-
async function
|
|
7051
|
+
async function Xu(e) {
|
|
7052
7052
|
let t = Au(e.state), n = e.header("x-goog-channel-id"), r = e.header("x-goog-resource-id"), i = e.header("x-goog-resource-state"), a = e.header("x-goog-channel-token");
|
|
7053
7053
|
if (n == null || r == null || i == null || a == null) return {
|
|
7054
7054
|
body: "",
|
|
@@ -7065,15 +7065,15 @@ async function Yu(e) {
|
|
|
7065
7065
|
} : (s.resourceId ?? (o = o.map((e) => e.id == n ? {
|
|
7066
7066
|
...e,
|
|
7067
7067
|
resourceId: r
|
|
7068
|
-
} : e), await
|
|
7068
|
+
} : e), await Z(t, o, e.now)), i != "sync" && i != "change" ? {
|
|
7069
7069
|
outcome: "ignored",
|
|
7070
7070
|
reason: "Google Drive notification state is not actionable."
|
|
7071
7071
|
} : { outcome: "wake" });
|
|
7072
7072
|
}
|
|
7073
|
-
var
|
|
7073
|
+
var Zu = {
|
|
7074
7074
|
initialState: ku.initialState,
|
|
7075
7075
|
reconcile: ku.reconcile,
|
|
7076
|
-
receive:
|
|
7076
|
+
receive: Xu,
|
|
7077
7077
|
listener: {
|
|
7078
7078
|
intervalMs: 3e5,
|
|
7079
7079
|
async read(e) {
|
|
@@ -7110,12 +7110,12 @@ var Xu = {
|
|
|
7110
7110
|
nullable: !1
|
|
7111
7111
|
}]
|
|
7112
7112
|
}
|
|
7113
|
-
},
|
|
7113
|
+
}, Qu = "application/vnd.google-apps.folder", $u = "nextPageToken,incompleteSearch,files(id,name,mimeType,createdTime,modifiedTime,parents,trashed,webViewLink,driveId,size,version,lastModifyingUser(displayName,emailAddress))", ed = /* @__PURE__ */ new Set([
|
|
7114
7114
|
"rateLimitExceeded",
|
|
7115
7115
|
"userRateLimitExceeded",
|
|
7116
7116
|
"dailyLimitExceeded",
|
|
7117
7117
|
"sharingRateLimitExceeded"
|
|
7118
|
-
]),
|
|
7118
|
+
]), td = /* @__PURE__ */ new Set(["insufficientFilePermissions", "appNotAuthorizedToFile"]), nd = {
|
|
7119
7119
|
buildOutputs: o,
|
|
7120
7120
|
snapshot: {
|
|
7121
7121
|
configSchema: {
|
|
@@ -7234,16 +7234,16 @@ var Xu = {
|
|
|
7234
7234
|
type: "poll"
|
|
7235
7235
|
},
|
|
7236
7236
|
async poll(e) {
|
|
7237
|
-
let t =
|
|
7238
|
-
if (e.checkpoint === null) return
|
|
7239
|
-
let n =
|
|
7240
|
-
return n.changeType === t.changeType ?
|
|
7241
|
-
checkpoint:
|
|
7237
|
+
let t = rd(e.config);
|
|
7238
|
+
if (e.checkpoint === null) return ad(e, t);
|
|
7239
|
+
let n = id(e.checkpoint);
|
|
7240
|
+
return n.changeType === t.changeType ? sd(e, t, n) : {
|
|
7241
|
+
checkpoint: od(e.now, t.changeType),
|
|
7242
7242
|
events: []
|
|
7243
7243
|
};
|
|
7244
7244
|
}
|
|
7245
7245
|
};
|
|
7246
|
-
function
|
|
7246
|
+
function rd(e) {
|
|
7247
7247
|
return {
|
|
7248
7248
|
changeType: e.changeType,
|
|
7249
7249
|
driveId: e.driveId ?? "",
|
|
@@ -7254,7 +7254,7 @@ function nd(e) {
|
|
|
7254
7254
|
namePrefix: e.namePrefix ?? ""
|
|
7255
7255
|
};
|
|
7256
7256
|
}
|
|
7257
|
-
function
|
|
7257
|
+
function id(e) {
|
|
7258
7258
|
let t = $(e);
|
|
7259
7259
|
if (typeof t?.since != "string" || Number.isNaN(Date.parse(t.since))) throw new r("Google Drive checkpoint is invalid; recreate the Trigger.");
|
|
7260
7260
|
let n = t.boundaryKeys;
|
|
@@ -7268,23 +7268,23 @@ function rd(e) {
|
|
|
7268
7268
|
...Array.isArray(n) ? { boundaryKeys: n.filter((e) => typeof e == "string") } : {}
|
|
7269
7269
|
};
|
|
7270
7270
|
}
|
|
7271
|
-
async function
|
|
7272
|
-
let n = await
|
|
7271
|
+
async function ad(e, t) {
|
|
7272
|
+
let n = await hd(e, `/drive/v3/files/${encodeURIComponent(t.folderId)}`, {
|
|
7273
7273
|
fields: "id,name,mimeType,driveId,trashed",
|
|
7274
7274
|
supportsAllDrives: "true"
|
|
7275
7275
|
});
|
|
7276
|
-
|
|
7276
|
+
gd(n, "folder probe");
|
|
7277
7277
|
let i = $(n.data);
|
|
7278
7278
|
if (i == null) throw new a("Google Drive folder probe returned no payload.");
|
|
7279
|
-
if (i.mimeType !==
|
|
7279
|
+
if (i.mimeType !== Qu) throw new r("Google Drive folderId does not point to a folder.");
|
|
7280
7280
|
if (i.trashed === !0) throw new r("The Google Drive folder is in the trash.");
|
|
7281
7281
|
if (t.driveId.length > 0 && (i.driveId ?? "") !== t.driveId) throw new r("The configured Google Drive shared drive does not contain this folder.");
|
|
7282
7282
|
return {
|
|
7283
|
-
checkpoint:
|
|
7283
|
+
checkpoint: od(e.now, t.changeType),
|
|
7284
7284
|
events: []
|
|
7285
7285
|
};
|
|
7286
7286
|
}
|
|
7287
|
-
function
|
|
7287
|
+
function od(e, t) {
|
|
7288
7288
|
let n = e.toISOString();
|
|
7289
7289
|
return {
|
|
7290
7290
|
changeType: t,
|
|
@@ -7292,11 +7292,11 @@ function ad(e, t) {
|
|
|
7292
7292
|
since: n
|
|
7293
7293
|
};
|
|
7294
7294
|
}
|
|
7295
|
-
async function
|
|
7296
|
-
let r =
|
|
7295
|
+
async function sd(e, t, n) {
|
|
7296
|
+
let r = ud(t, n.since, n.floor), i = `${t.driveId}|${r}`, a = n.pageQuery == i ? n.pageToken : void 0, o = await hd(e, "/drive/v3/files", {
|
|
7297
7297
|
corpora: t.driveId.length == 0 ? "allDrives" : "drive",
|
|
7298
7298
|
driveId: t.driveId.length == 0 ? void 0 : t.driveId,
|
|
7299
|
-
fields:
|
|
7299
|
+
fields: $u,
|
|
7300
7300
|
includeItemsFromAllDrives: "true",
|
|
7301
7301
|
pageSize: t.maxFilesPerPoll,
|
|
7302
7302
|
pageToken: a,
|
|
@@ -7304,74 +7304,74 @@ async function od(e, t, n) {
|
|
|
7304
7304
|
spaces: "drive",
|
|
7305
7305
|
supportsAllDrives: "true"
|
|
7306
7306
|
});
|
|
7307
|
-
|
|
7307
|
+
gd(o, "files list");
|
|
7308
7308
|
let s = $(o.data) ?? {}, c = new Set(n.boundaryKeys ?? []), l = [], u = [], d = a == null ? void 0 : n.maxSeen;
|
|
7309
7309
|
for (let e of s.files ?? []) {
|
|
7310
7310
|
if (e.id == null || e.id.length == 0) continue;
|
|
7311
|
-
let n =
|
|
7311
|
+
let n = pd(e, t.changeType);
|
|
7312
7312
|
if (n == null) continue;
|
|
7313
|
-
let r =
|
|
7314
|
-
u.push(r.dedupeKey),
|
|
7313
|
+
let r = md(e, e.id, n, t.changeType);
|
|
7314
|
+
u.push(r.dedupeKey), bd(n, d) && (d = n), c.has(r.dedupeKey) || l.push(r);
|
|
7315
7315
|
}
|
|
7316
7316
|
if (s.incompleteSearch === !0) {
|
|
7317
|
-
let e = a == null ? {} :
|
|
7317
|
+
let e = a == null ? {} : cd(a, i, d);
|
|
7318
7318
|
return {
|
|
7319
|
-
checkpoint:
|
|
7319
|
+
checkpoint: ld(n, t.changeType, n.since, u, e),
|
|
7320
7320
|
events: l
|
|
7321
7321
|
};
|
|
7322
7322
|
}
|
|
7323
7323
|
if (s.nextPageToken) return {
|
|
7324
|
-
checkpoint:
|
|
7324
|
+
checkpoint: ld(n, t.changeType, n.since, u, cd(s.nextPageToken, i, d)),
|
|
7325
7325
|
events: l,
|
|
7326
7326
|
hasMore: !0
|
|
7327
7327
|
};
|
|
7328
7328
|
let f = d ?? n.since;
|
|
7329
7329
|
return {
|
|
7330
|
-
checkpoint:
|
|
7330
|
+
checkpoint: ld(n, t.changeType, f, u),
|
|
7331
7331
|
events: l
|
|
7332
7332
|
};
|
|
7333
7333
|
}
|
|
7334
|
-
function
|
|
7334
|
+
function cd(e, t, n) {
|
|
7335
7335
|
return {
|
|
7336
7336
|
pageQuery: t,
|
|
7337
7337
|
pageToken: e,
|
|
7338
7338
|
...n == null ? {} : { maxSeen: n }
|
|
7339
7339
|
};
|
|
7340
7340
|
}
|
|
7341
|
-
function
|
|
7341
|
+
function ld(e, t, n, r, i = {}) {
|
|
7342
7342
|
let a = [.../* @__PURE__ */ new Set([...e.boundaryKeys ?? [], ...r])].map((e) => ({
|
|
7343
7343
|
at: Date.parse(e.slice(e.indexOf(":") + 1)),
|
|
7344
7344
|
key: e
|
|
7345
|
-
})).filter(({ at: t }) => t >=
|
|
7345
|
+
})).filter(({ at: t }) => t >= dd(n, e.floor)).toSorted((e, t) => t.at - e.at).slice(0, 200).map(({ key: e }) => e);
|
|
7346
7346
|
return {
|
|
7347
7347
|
changeType: t,
|
|
7348
7348
|
since: n,
|
|
7349
|
-
...
|
|
7349
|
+
...fd(e.floor, n),
|
|
7350
7350
|
...i,
|
|
7351
7351
|
...a.length == 0 ? {} : { boundaryKeys: a }
|
|
7352
7352
|
};
|
|
7353
7353
|
}
|
|
7354
|
-
function
|
|
7354
|
+
function ud(e, t, n) {
|
|
7355
7355
|
let r = e.changeType == "created" ? "createdTime" : "modifiedTime", i = [
|
|
7356
|
-
`'${
|
|
7356
|
+
`'${yd(e.folderId)}' in parents`,
|
|
7357
7357
|
"trashed = false",
|
|
7358
|
-
`${r} >= '${new Date(
|
|
7358
|
+
`${r} >= '${new Date(dd(t, n)).toISOString()}'`
|
|
7359
7359
|
];
|
|
7360
|
-
return e.itemTypes.has("folder") ? e.itemTypes.has("file") || i.push(`mimeType = '${
|
|
7360
|
+
return e.itemTypes.has("folder") ? e.itemTypes.has("file") || i.push(`mimeType = '${Qu}'`) : i.push(`mimeType != '${Qu}'`), e.mimeTypes.length > 0 && i.push(`(${e.mimeTypes.map((e) => `mimeType = '${yd(e)}'`).join(" or ")})`), e.namePrefix.length > 0 && i.push(`name contains '${yd(e.namePrefix)}'`), i.join(" and ");
|
|
7361
7361
|
}
|
|
7362
|
-
function
|
|
7362
|
+
function dd(e, t) {
|
|
7363
7363
|
let n = Date.parse(e) - 6e4, r = t == null ? NaN : Date.parse(t);
|
|
7364
7364
|
return Number.isNaN(r) ? n : Math.max(n, r);
|
|
7365
7365
|
}
|
|
7366
|
-
function
|
|
7366
|
+
function fd(e, t) {
|
|
7367
7367
|
return e == null || Number.isNaN(Date.parse(e)) || Date.parse(t) - 6e4 >= Date.parse(e) ? {} : { floor: e };
|
|
7368
7368
|
}
|
|
7369
|
-
function
|
|
7369
|
+
function pd(e, t) {
|
|
7370
7370
|
let n = t == "created" ? e.createdTime : e.modifiedTime;
|
|
7371
7371
|
return n == null || n.length == 0 || Number.isNaN(Date.parse(n)) ? void 0 : n;
|
|
7372
7372
|
}
|
|
7373
|
-
function
|
|
7374
|
-
let i = e.mimeType ==
|
|
7373
|
+
function md(e, t, n, r) {
|
|
7374
|
+
let i = e.mimeType == Qu ? "folder" : "file", a = e.lastModifyingUser;
|
|
7375
7375
|
return {
|
|
7376
7376
|
dedupeKey: `${t}:${n}`,
|
|
7377
7377
|
payload: {
|
|
@@ -7393,7 +7393,7 @@ function pd(e, t, n, r) {
|
|
|
7393
7393
|
}
|
|
7394
7394
|
};
|
|
7395
7395
|
}
|
|
7396
|
-
async function
|
|
7396
|
+
async function hd(e, t, n) {
|
|
7397
7397
|
try {
|
|
7398
7398
|
return await e.connector.execute({
|
|
7399
7399
|
endpoint: t,
|
|
@@ -7404,32 +7404,32 @@ async function md(e, t, n) {
|
|
|
7404
7404
|
throw new a(`Google Drive proxy request to ${t} failed.`, { cause: e });
|
|
7405
7405
|
}
|
|
7406
7406
|
}
|
|
7407
|
-
function
|
|
7407
|
+
function gd(e, t) {
|
|
7408
7408
|
if (!(e.status >= 200 && e.status < 300)) {
|
|
7409
7409
|
if (e.status == 400 || e.status == 404) throw new r(`Google Drive ${t} rejected the configuration.`);
|
|
7410
7410
|
if (e.status == 401) throw new i(`Google Drive ${t} rejected the Connection.`);
|
|
7411
7411
|
if (e.status == 403) {
|
|
7412
|
-
let n =
|
|
7413
|
-
if (n.some((e) =>
|
|
7414
|
-
if (n.some((e) =>
|
|
7415
|
-
if (
|
|
7412
|
+
let n = _d(e.data);
|
|
7413
|
+
if (n.some((e) => ed.has(e))) throw new a(`Google Drive ${t} was rate limited.`);
|
|
7414
|
+
if (n.some((e) => td.has(e))) throw new r(`Google Drive ${t} was rejected by an ACL.`);
|
|
7415
|
+
if (vd(e.data)) throw new i(`Google Drive ${t} needs additional scopes.`);
|
|
7416
7416
|
}
|
|
7417
7417
|
throw new a(`Google Drive ${t} failed with status ${e.status}.`);
|
|
7418
7418
|
}
|
|
7419
7419
|
}
|
|
7420
|
-
function
|
|
7420
|
+
function _d(e) {
|
|
7421
7421
|
let t = $($(e)?.error);
|
|
7422
7422
|
return [...[t?.errors, t?.details].flatMap((e) => Array.isArray(e) ? e : []).map((e) => $(e)?.reason), t?.status].filter((e) => typeof e == "string");
|
|
7423
7423
|
}
|
|
7424
|
-
function
|
|
7425
|
-
if (
|
|
7424
|
+
function vd(e) {
|
|
7425
|
+
if (_d(e).includes("ACCESS_TOKEN_SCOPE_INSUFFICIENT")) return !0;
|
|
7426
7426
|
let t = $($(e)?.error)?.message;
|
|
7427
7427
|
return typeof t == "string" && t.toLowerCase().includes("insufficient authentication scopes");
|
|
7428
7428
|
}
|
|
7429
|
-
function
|
|
7429
|
+
function yd(e) {
|
|
7430
7430
|
return e.replaceAll("\\", "\\\\").replaceAll("'", "\\'");
|
|
7431
7431
|
}
|
|
7432
|
-
function
|
|
7432
|
+
function bd(e, t) {
|
|
7433
7433
|
let n = Date.parse(e);
|
|
7434
7434
|
return Number.isNaN(n) ? !1 : t == null || Number.isNaN(Date.parse(t)) || n > Date.parse(t);
|
|
7435
7435
|
}
|
|
@@ -7438,14 +7438,14 @@ function $(e) {
|
|
|
7438
7438
|
}
|
|
7439
7439
|
//#endregion
|
|
7440
7440
|
//#region src/trigger/providers/google-sheets/on-row-added.ts
|
|
7441
|
-
var
|
|
7441
|
+
var xd = [
|
|
7442
7442
|
"permission_denied",
|
|
7443
7443
|
"accessnotconfigured",
|
|
7444
7444
|
"insufficientfilepermissions",
|
|
7445
7445
|
"appnotauthorizedtofile",
|
|
7446
7446
|
"the caller does not have permission",
|
|
7447
7447
|
"has not been used in project"
|
|
7448
|
-
],
|
|
7448
|
+
], Sd = ["ratelimitexceeded", "dailylimitexceeded"], Cd = {
|
|
7449
7449
|
buildOutputs: o,
|
|
7450
7450
|
snapshot: {
|
|
7451
7451
|
configSchema: {
|
|
@@ -7544,19 +7544,19 @@ var bd = [
|
|
|
7544
7544
|
type: "poll"
|
|
7545
7545
|
},
|
|
7546
7546
|
async poll(e) {
|
|
7547
|
-
let t =
|
|
7547
|
+
let t = wd(e.config);
|
|
7548
7548
|
if (e.checkpoint === null) return {
|
|
7549
|
-
checkpoint: await
|
|
7549
|
+
checkpoint: await Dd(e, t, await Ed(e, t)),
|
|
7550
7550
|
events: []
|
|
7551
7551
|
};
|
|
7552
|
-
let n =
|
|
7552
|
+
let n = Td(e.checkpoint), r = await Ed(e, t);
|
|
7553
7553
|
if (n.spreadsheetId !== t.spreadsheetId || n.sheetId !== r.sheetId || n.lastRowNumber > r.rowCount) return {
|
|
7554
|
-
checkpoint: await
|
|
7554
|
+
checkpoint: await Dd(e, t, r),
|
|
7555
7555
|
events: []
|
|
7556
7556
|
};
|
|
7557
|
-
let i = await
|
|
7557
|
+
let i = await kd(e, t, r), a = Math.min(Math.max(t.firstDataRow, n.lastRowNumber), r.rowCount), o = Math.min(a + t.maxRowsPerPoll, r.rowCount), s = await Ad(e, t, r, a, o, "row window fetch");
|
|
7558
7558
|
if (s.length == 0 && n.lastRowNumber >= t.firstDataRow) return {
|
|
7559
|
-
checkpoint: await
|
|
7559
|
+
checkpoint: await Dd(e, t, r),
|
|
7560
7560
|
events: []
|
|
7561
7561
|
};
|
|
7562
7562
|
let c = a + s.length - 1;
|
|
@@ -7568,11 +7568,11 @@ var bd = [
|
|
|
7568
7568
|
for (let [e, o] of s.entries()) {
|
|
7569
7569
|
let s = a + e;
|
|
7570
7570
|
if (!(s <= n.lastRowNumber)) {
|
|
7571
|
-
if (s == t.headerRow ||
|
|
7571
|
+
if (s == t.headerRow || Md(o)) {
|
|
7572
7572
|
u += 1;
|
|
7573
7573
|
continue;
|
|
7574
7574
|
}
|
|
7575
|
-
l.push(await
|
|
7575
|
+
l.push(await Nd(t, r, s, o, i));
|
|
7576
7576
|
}
|
|
7577
7577
|
}
|
|
7578
7578
|
let d = c == o && o < r.rowCount;
|
|
@@ -7588,7 +7588,7 @@ var bd = [
|
|
|
7588
7588
|
};
|
|
7589
7589
|
}
|
|
7590
7590
|
};
|
|
7591
|
-
function
|
|
7591
|
+
function wd(e) {
|
|
7592
7592
|
let t = (e.columnRange ?? "A:ZZZ").trim(), n = t.indexOf(":"), r = n < 0 ? t : t.slice(0, n), i = n < 0 ? t : t.slice(n + 1), a = e.spreadsheetId.trim();
|
|
7593
7593
|
return {
|
|
7594
7594
|
colEnd: i,
|
|
@@ -7602,8 +7602,8 @@ function Cd(e) {
|
|
|
7602
7602
|
valueRender: e.valueRender ?? "UNFORMATTED_VALUE"
|
|
7603
7603
|
};
|
|
7604
7604
|
}
|
|
7605
|
-
function
|
|
7606
|
-
let t =
|
|
7605
|
+
function Td(e) {
|
|
7606
|
+
let t = zd(e);
|
|
7607
7607
|
if (typeof t?.spreadsheetId != "string" || !Number.isInteger(t.sheetId) || !Number.isInteger(t.lastRowNumber)) throw new r("Google Sheets checkpoint is invalid; recreate the Trigger.");
|
|
7608
7608
|
return {
|
|
7609
7609
|
lastRowNumber: t.lastRowNumber,
|
|
@@ -7611,11 +7611,11 @@ function wd(e) {
|
|
|
7611
7611
|
spreadsheetId: t.spreadsheetId
|
|
7612
7612
|
};
|
|
7613
7613
|
}
|
|
7614
|
-
async function
|
|
7615
|
-
let n = await
|
|
7614
|
+
async function Ed(e, t) {
|
|
7615
|
+
let n = await Fd(e, `/spreadsheets/${encodeURIComponent(t.spreadsheetId)}`, { fields: "sheets.properties(sheetId,title,sheetType,gridProperties)" });
|
|
7616
7616
|
if (n.status == 404) throw new r("The Google Sheets spreadsheet was not found.");
|
|
7617
|
-
|
|
7618
|
-
let i =
|
|
7617
|
+
Id(n, "spreadsheet metadata fetch");
|
|
7618
|
+
let i = zd(n.data)?.sheets, o = (Array.isArray(i) ? i.map((e) => zd(zd(e)?.properties)) : []).filter((e) => e != null), s = (/^\d+$/.test(t.sheet) ? o.find(({ sheetId: e }) => e === Number(t.sheet)) : void 0) ?? o.find(({ title: e }) => e === t.sheet);
|
|
7619
7619
|
if (s == null) throw new r(`Google Sheets tab "${t.sheet}" does not exist.`);
|
|
7620
7620
|
if (s.sheetType != null && s.sheetType !== "GRID") throw new r("The Google Sheets tab is not a grid sheet.");
|
|
7621
7621
|
let c = s.gridProperties?.rowCount;
|
|
@@ -7626,45 +7626,45 @@ async function Td(e, t) {
|
|
|
7626
7626
|
title: s.title
|
|
7627
7627
|
};
|
|
7628
7628
|
}
|
|
7629
|
-
async function
|
|
7629
|
+
async function Dd(e, t, n) {
|
|
7630
7630
|
return {
|
|
7631
|
-
lastRowNumber: await
|
|
7631
|
+
lastRowNumber: await Od(e, t, n),
|
|
7632
7632
|
sheetId: n.sheetId,
|
|
7633
7633
|
spreadsheetId: t.spreadsheetId
|
|
7634
7634
|
};
|
|
7635
7635
|
}
|
|
7636
|
-
async function
|
|
7636
|
+
async function Od(e, t, n) {
|
|
7637
7637
|
if (n.rowCount < t.firstDataRow) return t.firstDataRow - 1;
|
|
7638
|
-
let r = await
|
|
7638
|
+
let r = await Ad(e, t, n, t.firstDataRow, n.rowCount, "full-range scan");
|
|
7639
7639
|
return r.length == 0 ? t.firstDataRow - 1 : t.firstDataRow + r.length - 1;
|
|
7640
7640
|
}
|
|
7641
|
-
async function
|
|
7642
|
-
let r = await
|
|
7641
|
+
async function kd(e, t, n) {
|
|
7642
|
+
let r = await Fd(e, Pd(t, n, t.headerRow, t.headerRow), {
|
|
7643
7643
|
majorDimension: "ROWS",
|
|
7644
7644
|
valueRenderOption: "FORMATTED_VALUE"
|
|
7645
7645
|
});
|
|
7646
|
-
return
|
|
7646
|
+
return Id(r, "header row fetch"), jd(r.data)[0] ?? [];
|
|
7647
7647
|
}
|
|
7648
|
-
async function
|
|
7649
|
-
let o = await
|
|
7648
|
+
async function Ad(e, t, n, r, i, a) {
|
|
7649
|
+
let o = await Fd(e, Pd(t, n, r, i), {
|
|
7650
7650
|
dateTimeRenderOption: t.dateTimeRender,
|
|
7651
7651
|
majorDimension: "ROWS",
|
|
7652
7652
|
valueRenderOption: t.valueRender
|
|
7653
7653
|
});
|
|
7654
|
-
return
|
|
7654
|
+
return Id(o, a), jd(o.data);
|
|
7655
7655
|
}
|
|
7656
|
-
function
|
|
7657
|
-
let t =
|
|
7656
|
+
function jd(e) {
|
|
7657
|
+
let t = zd(e)?.values;
|
|
7658
7658
|
return Array.isArray(t) ? t : [];
|
|
7659
7659
|
}
|
|
7660
|
-
function
|
|
7660
|
+
function Md(e) {
|
|
7661
7661
|
return e.every((e) => e === "" || e == null);
|
|
7662
7662
|
}
|
|
7663
|
-
async function
|
|
7664
|
-
let a = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(r))), o = [...new Uint8Array(a)].slice(0, 8).map((e) => e.toString(16).padStart(2, "0")).join(""), s = {}, c =
|
|
7663
|
+
async function Nd(e, t, n, r, i) {
|
|
7664
|
+
let a = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(r))), o = [...new Uint8Array(a)].slice(0, 8).map((e) => e.toString(16).padStart(2, "0")).join(""), s = {}, c = Ld(e.colStart);
|
|
7665
7665
|
for (let [e, t] of r.entries()) {
|
|
7666
7666
|
let n = i[e];
|
|
7667
|
-
s[typeof n == "string" && n.length > 0 ? n :
|
|
7667
|
+
s[typeof n == "string" && n.length > 0 ? n : Rd(c + e)] = t;
|
|
7668
7668
|
}
|
|
7669
7669
|
return {
|
|
7670
7670
|
dedupeKey: `${t.sheetId}:${n}:${o}`,
|
|
@@ -7678,11 +7678,11 @@ async function Md(e, t, n, r, i) {
|
|
|
7678
7678
|
}
|
|
7679
7679
|
};
|
|
7680
7680
|
}
|
|
7681
|
-
function
|
|
7681
|
+
function Pd(e, t, n, r) {
|
|
7682
7682
|
let i = encodeURIComponent(`'${t.title.replaceAll("'", "''")}'`);
|
|
7683
7683
|
return `/spreadsheets/${encodeURIComponent(e.spreadsheetId)}/values/${i}!${e.colStart}${n}:${e.colEnd}${r}`;
|
|
7684
7684
|
}
|
|
7685
|
-
async function
|
|
7685
|
+
async function Fd(e, t, n) {
|
|
7686
7686
|
try {
|
|
7687
7687
|
return await e.connector.execute({
|
|
7688
7688
|
endpoint: t,
|
|
@@ -7693,32 +7693,32 @@ async function Pd(e, t, n) {
|
|
|
7693
7693
|
throw new a(`Google Sheets proxy request to ${t} failed.`, { cause: e });
|
|
7694
7694
|
}
|
|
7695
7695
|
}
|
|
7696
|
-
function
|
|
7696
|
+
function Id(e, t) {
|
|
7697
7697
|
if (e.status >= 200 && e.status < 300) return;
|
|
7698
7698
|
if (e.status == 401) throw new i(`Google Sheets ${t} rejected the Connection.`);
|
|
7699
7699
|
let n = JSON.stringify(e.data ?? null).toLowerCase();
|
|
7700
7700
|
if (e.status == 403) {
|
|
7701
|
-
if (
|
|
7702
|
-
if (
|
|
7701
|
+
if (Sd.some((e) => n.includes(e))) throw new a(`Google Sheets ${t} was rate limited.`);
|
|
7702
|
+
if (xd.some((e) => n.includes(e))) throw new i(`Google Sheets ${t} rejected the Connection.`);
|
|
7703
7703
|
}
|
|
7704
7704
|
throw e.status == 400 && n.includes("unable to parse range") ? new r("Google Sheets rejected the configured range.") : e.status == 413 ? new r("Google Sheets response is too large; narrow columnRange.") : new a(`Google Sheets ${t} failed with status ${e.status}.`);
|
|
7705
7705
|
}
|
|
7706
|
-
function
|
|
7706
|
+
function Ld(e) {
|
|
7707
7707
|
let t = 0;
|
|
7708
7708
|
for (let n of e.toUpperCase()) t = t * 26 + n.charCodeAt(0) - 64;
|
|
7709
7709
|
return t;
|
|
7710
7710
|
}
|
|
7711
|
-
function
|
|
7711
|
+
function Rd(e) {
|
|
7712
7712
|
let t = "";
|
|
7713
7713
|
for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
|
|
7714
7714
|
return t;
|
|
7715
7715
|
}
|
|
7716
|
-
function
|
|
7716
|
+
function zd(e) {
|
|
7717
7717
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
7718
7718
|
}
|
|
7719
7719
|
//#endregion
|
|
7720
7720
|
//#region src/trigger/providers/linear/on-issue-changed.ts
|
|
7721
|
-
var
|
|
7721
|
+
var Bd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", Vd = new RegExp(Bd), Hd = 6e4, Ud = 50, Wd = {
|
|
7722
7722
|
buildOutputs: o,
|
|
7723
7723
|
snapshot: {
|
|
7724
7724
|
configSchema: {
|
|
@@ -7729,7 +7729,7 @@ var zd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
|
|
|
7729
7729
|
title: "Team ID",
|
|
7730
7730
|
description: "Linear Team UUID. Use Copy model UUID in Linear to find it.",
|
|
7731
7731
|
type: "string",
|
|
7732
|
-
pattern:
|
|
7732
|
+
pattern: Bd
|
|
7733
7733
|
},
|
|
7734
7734
|
stateIds: {
|
|
7735
7735
|
title: "Issue statuses",
|
|
@@ -7737,7 +7737,7 @@ var zd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
|
|
|
7737
7737
|
type: "array",
|
|
7738
7738
|
items: {
|
|
7739
7739
|
type: "string",
|
|
7740
|
-
pattern:
|
|
7740
|
+
pattern: Bd
|
|
7741
7741
|
},
|
|
7742
7742
|
uniqueItems: !0,
|
|
7743
7743
|
maxItems: 50,
|
|
@@ -7804,12 +7804,12 @@ var zd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
|
|
|
7804
7804
|
provider: "linear",
|
|
7805
7805
|
type: "poll"
|
|
7806
7806
|
},
|
|
7807
|
-
configOptions:
|
|
7807
|
+
configOptions: Yd,
|
|
7808
7808
|
async poll(e) {
|
|
7809
7809
|
let t = typeof e.config.teamId == "string" ? e.config.teamId.toLowerCase() : e.config.teamId, n = e.config.stateIds ?? [];
|
|
7810
|
-
if (typeof t != "string" || !
|
|
7810
|
+
if (typeof t != "string" || !Vd.test(t) || !Array.isArray(n) || n.length > 50 || n.some((e) => typeof e != "string" || !Vd.test(e))) throw new r("Linear Issue configuration is invalid.");
|
|
7811
7811
|
if (e.checkpoint == null) {
|
|
7812
|
-
|
|
7812
|
+
qd((await Jd(e, "query LinearTeam($teamId: String!) { team(id: $teamId) { id } }", { teamId: t })).team, t);
|
|
7813
7813
|
let n = e.now.toISOString();
|
|
7814
7814
|
return {
|
|
7815
7815
|
checkpoint: {
|
|
@@ -7819,10 +7819,10 @@ var zd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
|
|
|
7819
7819
|
events: []
|
|
7820
7820
|
};
|
|
7821
7821
|
}
|
|
7822
|
-
let i =
|
|
7822
|
+
let i = Gd(e.checkpoint), o = i.until ?? new Date(Math.max(e.now.getTime(), Date.parse(i.since))).toISOString(), s = new Date(Math.max(Date.parse(i.startedAt), Date.parse(i.since) - Hd)).toISOString(), l = qd((await Jd(e, `query LinearIssueChanges($teamId: String!, $filter: IssueFilter!, $after: String) {
|
|
7823
7823
|
team(id: $teamId) {
|
|
7824
7824
|
id
|
|
7825
|
-
issues(first: ${
|
|
7825
|
+
issues(first: ${Ud}, after: $after, orderBy: updatedAt, includeArchived: true, filter: $filter) {
|
|
7826
7826
|
nodes { id identifier title url createdAt updatedAt state { id name type } }
|
|
7827
7827
|
pageInfo { hasNextPage endCursor }
|
|
7828
7828
|
}
|
|
@@ -7838,11 +7838,11 @@ var zd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
|
|
|
7838
7838
|
...n.length == 0 ? {} : { state: { id: { in: n } } }
|
|
7839
7839
|
}
|
|
7840
7840
|
})).team, t).issues;
|
|
7841
|
-
if (!c(l) || !Array.isArray(l.nodes) || l.nodes.length >
|
|
7841
|
+
if (!c(l) || !Array.isArray(l.nodes) || l.nodes.length > Ud || !c(l.pageInfo) || typeof l.pageInfo.hasNextPage != "boolean") throw new a("Linear returned an invalid Issue page.");
|
|
7842
7842
|
let { hasNextPage: u, endCursor: d } = l.pageInfo;
|
|
7843
7843
|
if (u && (typeof d != "string" || d.length == 0 || d.length > 4096 || d == i.after || l.nodes.length == 0)) throw new a("Linear returned an invalid continuation cursor.");
|
|
7844
7844
|
let f = l.nodes.map((e) => {
|
|
7845
|
-
if (!c(e) || typeof e.id != "string" || !
|
|
7845
|
+
if (!c(e) || typeof e.id != "string" || !Vd.test(e.id) || typeof e.identifier != "string" || e.identifier.length == 0 || typeof e.title != "string" || typeof e.url != "string" || !Kd(e.createdAt) || !Kd(e.updatedAt) || Date.parse(e.createdAt) > Date.parse(e.updatedAt) || Date.parse(e.updatedAt) < Date.parse(s) || Date.parse(e.updatedAt) > Date.parse(o) || !c(e.state) || typeof e.state.id != "string" || !Vd.test(e.state.id) || typeof e.state.name != "string" || typeof e.state.type != "string" || n.length > 0 && !n.includes(e.state.id)) throw new a("Linear returned an invalid Issue.");
|
|
7846
7846
|
return {
|
|
7847
7847
|
dedupeKey: `${e.id}:${e.updatedAt}`,
|
|
7848
7848
|
payload: {
|
|
@@ -7875,8 +7875,8 @@ var zd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
|
|
|
7875
7875
|
};
|
|
7876
7876
|
}
|
|
7877
7877
|
};
|
|
7878
|
-
function
|
|
7879
|
-
if (!c(e) || !
|
|
7878
|
+
function Gd(e) {
|
|
7879
|
+
if (!c(e) || !Kd(e.startedAt) || !Kd(e.since) || Date.parse(e.since) < Date.parse(e.startedAt) || e.until != null && (!Kd(e.until) || Date.parse(e.until) < Date.parse(e.since)) || e.after != null && (typeof e.after != "string" || e.after.length == 0 || e.after.length > 4096 || e.until == null)) throw new r("Linear Issue checkpoint is invalid.");
|
|
7880
7880
|
return {
|
|
7881
7881
|
startedAt: e.startedAt,
|
|
7882
7882
|
since: e.since,
|
|
@@ -7884,15 +7884,15 @@ function Wd(e) {
|
|
|
7884
7884
|
...typeof e.after == "string" ? { after: e.after } : {}
|
|
7885
7885
|
};
|
|
7886
7886
|
}
|
|
7887
|
-
function
|
|
7887
|
+
function Kd(e) {
|
|
7888
7888
|
return typeof e == "string" && e.length <= 40 && /^\d{4}-\d{2}-\d{2}T/.test(e) && Number.isFinite(Date.parse(e));
|
|
7889
7889
|
}
|
|
7890
|
-
function
|
|
7890
|
+
function qd(e, t) {
|
|
7891
7891
|
if (e === null) throw new r("The Linear team is unavailable or not accessible to this Connection.");
|
|
7892
7892
|
if (!c(e) || e.id !== t) throw new a("Linear returned an invalid Team.");
|
|
7893
7893
|
return e;
|
|
7894
7894
|
}
|
|
7895
|
-
async function
|
|
7895
|
+
async function Jd(e, t, n) {
|
|
7896
7896
|
e.signal?.throwIfAborted();
|
|
7897
7897
|
let o = await e.connector.execute({
|
|
7898
7898
|
endpoint: "/graphql",
|
|
@@ -7912,19 +7912,19 @@ async function qd(e, t, n) {
|
|
|
7912
7912
|
if (o.status != 200 || !c(s) || !c(s.data) || s.errors != null && !Array.isArray(s.errors)) throw new a(`Linear returned an invalid query response (HTTP ${o.status}).`);
|
|
7913
7913
|
return s.data;
|
|
7914
7914
|
}
|
|
7915
|
-
async function
|
|
7915
|
+
async function Yd(e) {
|
|
7916
7916
|
let { field: t, config: n } = e;
|
|
7917
7917
|
if (t != "teamId" && t != "stateIds") throw new r("Unknown Linear configuration field.");
|
|
7918
|
-
if (t == "stateIds" && (typeof n.teamId != "string" || !
|
|
7918
|
+
if (t == "stateIds" && (typeof n.teamId != "string" || !Vd.test(n.teamId))) throw new r("Select a Linear Team first.");
|
|
7919
7919
|
let i = [], o = /* @__PURE__ */ new Set(), s = null;
|
|
7920
7920
|
for (let r = 0; r < 10; r++) {
|
|
7921
|
-
let r = await
|
|
7921
|
+
let r = await Jd(e, t == "teamId" ? "query LinearTeams($after: String) { teams(first: 100, after: $after) { nodes { id name key } pageInfo { hasNextPage endCursor } } }" : "query LinearStates($teamId: String!, $after: String) { team(id: $teamId) { id states(first: 100, after: $after) { nodes { id name color position } pageInfo { hasNextPage endCursor } } } }", {
|
|
7922
7922
|
after: s,
|
|
7923
7923
|
...t == "teamId" ? {} : { teamId: n.teamId }
|
|
7924
|
-
}), l = t == "teamId" ? r.teams :
|
|
7924
|
+
}), l = t == "teamId" ? r.teams : qd(r.team, String(n.teamId)).states;
|
|
7925
7925
|
if (!c(l) || !Array.isArray(l.nodes) || l.nodes.length > 100 || !c(l.pageInfo) || typeof l.pageInfo.hasNextPage != "boolean") throw new a("Linear returned invalid configuration options.");
|
|
7926
7926
|
for (let e of l.nodes) {
|
|
7927
|
-
if (!c(e) || typeof e.id != "string" || !
|
|
7927
|
+
if (!c(e) || typeof e.id != "string" || !Vd.test(e.id) || typeof e.name != "string" || e.name.length == 0 || (t == "teamId" ? typeof e.key != "string" : typeof e.color != "string" || !/^#[0-9a-fA-F]{6}$/.test(e.color))) throw new a("Linear returned an invalid configuration option.");
|
|
7928
7928
|
i.push({
|
|
7929
7929
|
value: e.id,
|
|
7930
7930
|
label: t == "teamId" ? `${e.name} (${e.key})` : e.name,
|
|
@@ -7938,7 +7938,7 @@ async function Jd(e) {
|
|
|
7938
7938
|
}
|
|
7939
7939
|
throw new r("The Linear options list exceeds the supported limit of 1000 entries.");
|
|
7940
7940
|
}
|
|
7941
|
-
var
|
|
7941
|
+
var Xd = {
|
|
7942
7942
|
buildOutputs: o,
|
|
7943
7943
|
snapshot: {
|
|
7944
7944
|
configSchema: {
|
|
@@ -8032,13 +8032,13 @@ var Yd = {
|
|
|
8032
8032
|
type: "poll"
|
|
8033
8033
|
},
|
|
8034
8034
|
async poll(e) {
|
|
8035
|
-
let t =
|
|
8036
|
-
if (e.checkpoint === null) return
|
|
8037
|
-
let n =
|
|
8038
|
-
return n.target ===
|
|
8035
|
+
let t = Zd(e.config);
|
|
8036
|
+
if (e.checkpoint === null) return Qd(e, t);
|
|
8037
|
+
let n = ef(e.checkpoint);
|
|
8038
|
+
return n.target === pf(t) ? rf(e, t, nf(n, tf(t.events))) : Qd(e, t);
|
|
8039
8039
|
}
|
|
8040
8040
|
};
|
|
8041
|
-
function
|
|
8041
|
+
function Zd(e) {
|
|
8042
8042
|
return {
|
|
8043
8043
|
dataSourceId: e.dataSourceId ?? "",
|
|
8044
8044
|
databaseId: e.databaseId,
|
|
@@ -8047,9 +8047,9 @@ function Xd(e) {
|
|
|
8047
8047
|
maxItemsPerPoll: e.maxItemsPerPoll ?? 25
|
|
8048
8048
|
};
|
|
8049
8049
|
}
|
|
8050
|
-
async function
|
|
8051
|
-
let n = await
|
|
8052
|
-
return
|
|
8050
|
+
async function Qd(e, t) {
|
|
8051
|
+
let n = await $d(e, t), r = tf(t.events);
|
|
8052
|
+
return ff(await df(e, {
|
|
8053
8053
|
body: {
|
|
8054
8054
|
page_size: 1,
|
|
8055
8055
|
sorts: [{
|
|
@@ -8064,31 +8064,31 @@ async function Zd(e, t) {
|
|
|
8064
8064
|
cursorField: r,
|
|
8065
8065
|
dataSourceId: n,
|
|
8066
8066
|
since: (/* @__PURE__ */ new Date(Math.ceil(e.now.getTime() / 6e4) * 6e4)).toISOString(),
|
|
8067
|
-
target:
|
|
8067
|
+
target: pf(t)
|
|
8068
8068
|
},
|
|
8069
8069
|
events: []
|
|
8070
8070
|
};
|
|
8071
8071
|
}
|
|
8072
|
-
async function
|
|
8073
|
-
let n = await
|
|
8072
|
+
async function $d(e, t) {
|
|
8073
|
+
let n = await df(e, {
|
|
8074
8074
|
endpoint: `/databases/${encodeURIComponent(t.databaseId)}`,
|
|
8075
8075
|
method: "GET"
|
|
8076
8076
|
});
|
|
8077
|
-
|
|
8078
|
-
let i =
|
|
8079
|
-
let t =
|
|
8077
|
+
ff(n, "database resolve");
|
|
8078
|
+
let i = yf(n.data)?.data_sources, a = Array.isArray(i) ? i.flatMap((e) => {
|
|
8079
|
+
let t = yf(e)?.id;
|
|
8080
8080
|
return typeof t == "string" && t.length > 0 ? [t] : [];
|
|
8081
8081
|
}) : [];
|
|
8082
8082
|
if (t.dataSourceId.length > 0) {
|
|
8083
|
-
let e =
|
|
8083
|
+
let e = mf(t.dataSourceId), n = a.find((t) => mf(t) == e);
|
|
8084
8084
|
if (n == null) throw new r("The Notion data source does not belong to the configured database.");
|
|
8085
8085
|
return n;
|
|
8086
8086
|
}
|
|
8087
8087
|
if (a.length == 1) return a[0];
|
|
8088
8088
|
throw a.length == 0 ? new r("The Notion database has no data sources.") : new r("The Notion database has multiple data sources; configure dataSourceId.");
|
|
8089
8089
|
}
|
|
8090
|
-
function
|
|
8091
|
-
let t =
|
|
8090
|
+
function ef(e) {
|
|
8091
|
+
let t = yf(e), n = t?.cursorField;
|
|
8092
8092
|
if (typeof t?.dataSourceId != "string" || t.dataSourceId.length == 0 || n !== "created_time" && n !== "last_edited_time" || typeof t.since != "string" || t.since.length == 0) throw new r("Notion checkpoint is invalid; recreate the Trigger.");
|
|
8093
8093
|
return {
|
|
8094
8094
|
cursorField: n,
|
|
@@ -8100,10 +8100,10 @@ function $d(e) {
|
|
|
8100
8100
|
...t.sinceOnly === !0 ? { sinceOnly: !0 } : {}
|
|
8101
8101
|
};
|
|
8102
8102
|
}
|
|
8103
|
-
function
|
|
8103
|
+
function tf(e) {
|
|
8104
8104
|
return e.length == 1 && e[0] == "page_added" ? "created_time" : "last_edited_time";
|
|
8105
8105
|
}
|
|
8106
|
-
function
|
|
8106
|
+
function nf(e, t) {
|
|
8107
8107
|
return e.cursorField == t ? e : {
|
|
8108
8108
|
cursorField: t,
|
|
8109
8109
|
dataSourceId: e.dataSourceId,
|
|
@@ -8111,11 +8111,11 @@ function tf(e, t) {
|
|
|
8111
8111
|
target: e.target
|
|
8112
8112
|
};
|
|
8113
8113
|
}
|
|
8114
|
-
async function
|
|
8114
|
+
async function rf(e, t, n) {
|
|
8115
8115
|
let r = [], i = 0, a = 0, o = null, s = n.startCursor, c = null;
|
|
8116
8116
|
for (let l = 0; l < 5; l += 1) {
|
|
8117
|
-
let l = await
|
|
8118
|
-
body:
|
|
8117
|
+
let l = await df(e, {
|
|
8118
|
+
body: sf(n, t.maxItemsPerPoll - a, s),
|
|
8119
8119
|
endpoint: `/data_sources/${encodeURIComponent(n.dataSourceId)}/query`,
|
|
8120
8120
|
method: "POST"
|
|
8121
8121
|
});
|
|
@@ -8123,14 +8123,14 @@ async function nf(e, t, n) {
|
|
|
8123
8123
|
c = "restarted";
|
|
8124
8124
|
break;
|
|
8125
8125
|
}
|
|
8126
|
-
|
|
8127
|
-
let u =
|
|
8126
|
+
ff(l, "data source query");
|
|
8127
|
+
let u = yf(l.data) ?? {};
|
|
8128
8128
|
for (let e of u.results ?? []) {
|
|
8129
8129
|
a += 1;
|
|
8130
8130
|
let s = n.cursorField == "created_time" ? e.created_time : e.last_edited_time;
|
|
8131
|
-
s != null && s.length > 0 && (o =
|
|
8132
|
-
let c =
|
|
8133
|
-
t.events.includes(c) ? r.push(
|
|
8131
|
+
s != null && s.length > 0 && (o = gf(o, s));
|
|
8132
|
+
let c = cf(e);
|
|
8133
|
+
t.events.includes(c) ? r.push(lf(e, c, t, n)) : i += 1;
|
|
8134
8134
|
}
|
|
8135
8135
|
if (u.request_status?.type == "incomplete") {
|
|
8136
8136
|
c = "truncated";
|
|
@@ -8156,36 +8156,36 @@ async function nf(e, t, n) {
|
|
|
8156
8156
|
...l,
|
|
8157
8157
|
since: n.since,
|
|
8158
8158
|
startCursor: c.nextCursor,
|
|
8159
|
-
...
|
|
8159
|
+
...of(n)
|
|
8160
8160
|
} : {
|
|
8161
8161
|
...l,
|
|
8162
|
-
...
|
|
8162
|
+
...af(n, c, o, e.now)
|
|
8163
8163
|
},
|
|
8164
8164
|
events: r,
|
|
8165
8165
|
filtered: i,
|
|
8166
8166
|
...c == "complete" ? {} : { hasMore: !0 }
|
|
8167
8167
|
};
|
|
8168
8168
|
}
|
|
8169
|
-
function
|
|
8169
|
+
function af(e, t, n, r) {
|
|
8170
8170
|
let i = {
|
|
8171
8171
|
since: e.since,
|
|
8172
|
-
...
|
|
8172
|
+
...of(e)
|
|
8173
8173
|
}, a = Date.parse(e.since) + 6e4 <= r.getTime() ? {
|
|
8174
8174
|
since: e.since,
|
|
8175
8175
|
sinceExclusive: !0
|
|
8176
8176
|
} : i;
|
|
8177
|
-
return n != null &&
|
|
8177
|
+
return n != null && _f(n, e.since) ? { since: n } : t == "restarted" ? i : t == "complete" ? e.sinceOnly === !0 || n != null ? a : i : n == null ? i : e.sinceOnly === !0 ? a : {
|
|
8178
8178
|
since: e.since,
|
|
8179
8179
|
sinceOnly: !0
|
|
8180
8180
|
};
|
|
8181
8181
|
}
|
|
8182
|
-
function
|
|
8182
|
+
function of(e) {
|
|
8183
8183
|
return {
|
|
8184
8184
|
...e.sinceExclusive === !0 ? { sinceExclusive: !0 } : {},
|
|
8185
8185
|
...e.sinceOnly === !0 ? { sinceOnly: !0 } : {}
|
|
8186
8186
|
};
|
|
8187
8187
|
}
|
|
8188
|
-
function
|
|
8188
|
+
function sf(e, t, n) {
|
|
8189
8189
|
let r = e.cursorField;
|
|
8190
8190
|
return {
|
|
8191
8191
|
filter: e.sinceOnly === !0 ? { and: [{
|
|
@@ -8206,70 +8206,70 @@ function of(e, t, n) {
|
|
|
8206
8206
|
...n == null ? {} : { start_cursor: n }
|
|
8207
8207
|
};
|
|
8208
8208
|
}
|
|
8209
|
-
function
|
|
8210
|
-
return
|
|
8209
|
+
function cf(e) {
|
|
8210
|
+
return vf(e.created_time) === vf(e.last_edited_time) ? "page_added" : "page_updated";
|
|
8211
8211
|
}
|
|
8212
|
-
function
|
|
8212
|
+
function lf(e, t, n, r) {
|
|
8213
8213
|
return {
|
|
8214
|
-
dedupeKey: t == "page_added" ? `added:${e.id}` : `updated:${e.id}:${
|
|
8214
|
+
dedupeKey: t == "page_added" ? `added:${e.id}` : `updated:${e.id}:${vf(e.last_edited_time) ?? e.last_edited_time ?? ""}`,
|
|
8215
8215
|
payload: {
|
|
8216
8216
|
createdBy: { id: e.created_by?.id ?? "" },
|
|
8217
8217
|
createdTime: e.created_time ?? "",
|
|
8218
8218
|
dataSourceId: r.dataSourceId,
|
|
8219
|
-
databaseId:
|
|
8219
|
+
databaseId: hf(n.databaseId),
|
|
8220
8220
|
event: t,
|
|
8221
8221
|
lastEditedBy: { id: e.last_edited_by?.id ?? "" },
|
|
8222
8222
|
lastEditedTime: e.last_edited_time ?? "",
|
|
8223
8223
|
pageId: e.id,
|
|
8224
8224
|
...n.includeProperties ? { properties: e.properties ?? {} } : {},
|
|
8225
|
-
title:
|
|
8225
|
+
title: uf(e.properties ?? {}),
|
|
8226
8226
|
url: e.url ?? ""
|
|
8227
8227
|
}
|
|
8228
8228
|
};
|
|
8229
8229
|
}
|
|
8230
|
-
function
|
|
8230
|
+
function uf(e) {
|
|
8231
8231
|
for (let t of Object.values(e)) {
|
|
8232
|
-
let e =
|
|
8233
|
-
if (!(e?.type !== "title" || !Array.isArray(e.title))) return e.title.map((e) => typeof
|
|
8232
|
+
let e = yf(t);
|
|
8233
|
+
if (!(e?.type !== "title" || !Array.isArray(e.title))) return e.title.map((e) => typeof yf(e)?.plain_text == "string" ? yf(e).plain_text : "").join("");
|
|
8234
8234
|
}
|
|
8235
8235
|
return "";
|
|
8236
8236
|
}
|
|
8237
|
-
async function
|
|
8237
|
+
async function df(e, t) {
|
|
8238
8238
|
try {
|
|
8239
8239
|
return await e.connector.execute(t, e.signal);
|
|
8240
8240
|
} catch (e) {
|
|
8241
8241
|
throw new a(`Notion proxy request to ${t.endpoint} failed.`, { cause: e });
|
|
8242
8242
|
}
|
|
8243
8243
|
}
|
|
8244
|
-
function
|
|
8244
|
+
function ff(e, t) {
|
|
8245
8245
|
if (!(e.status >= 200 && e.status < 300)) throw e.status == 401 || e.status == 403 ? new i(`Notion ${t} rejected the Connection.`) : e.status == 404 ? new r("The Notion target was not found or is not shared with the Connection.") : e.status == 400 ? new r(`Notion ${t} rejected the configuration.`) : new a(`Notion ${t} failed with status ${e.status}.`);
|
|
8246
8246
|
}
|
|
8247
|
-
function
|
|
8247
|
+
function pf(e) {
|
|
8248
8248
|
return `${e.databaseId}|${e.dataSourceId}`;
|
|
8249
8249
|
}
|
|
8250
|
-
function
|
|
8250
|
+
function mf(e) {
|
|
8251
8251
|
return e.replaceAll("-", "").toLowerCase();
|
|
8252
8252
|
}
|
|
8253
|
-
function
|
|
8254
|
-
let t =
|
|
8253
|
+
function hf(e) {
|
|
8254
|
+
let t = mf(e);
|
|
8255
8255
|
return `${t.slice(0, 8)}-${t.slice(8, 12)}-${t.slice(12, 16)}-${t.slice(16, 20)}-${t.slice(20)}`;
|
|
8256
8256
|
}
|
|
8257
|
-
function
|
|
8257
|
+
function gf(e, t) {
|
|
8258
8258
|
let n = Date.parse(t);
|
|
8259
8259
|
return Number.isNaN(n) || e != null && n < Date.parse(e) ? e : t;
|
|
8260
8260
|
}
|
|
8261
|
-
function
|
|
8261
|
+
function _f(e, t) {
|
|
8262
8262
|
return !Number.isNaN(Date.parse(e)) && !Number.isNaN(Date.parse(t)) && Date.parse(e) > Date.parse(t);
|
|
8263
8263
|
}
|
|
8264
|
-
function
|
|
8264
|
+
function vf(e) {
|
|
8265
8265
|
if (e == null || e.length == 0) return null;
|
|
8266
8266
|
let t = Date.parse(e);
|
|
8267
8267
|
return Number.isNaN(t) ? null : new Date(t).toISOString();
|
|
8268
8268
|
}
|
|
8269
|
-
function
|
|
8269
|
+
function yf(e) {
|
|
8270
8270
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
8271
8271
|
}
|
|
8272
|
-
var
|
|
8272
|
+
var bf = {
|
|
8273
8273
|
buildOutputs: o,
|
|
8274
8274
|
snapshot: {
|
|
8275
8275
|
configSchema: {
|
|
@@ -8381,14 +8381,14 @@ var yf = {
|
|
|
8381
8381
|
type: "poll"
|
|
8382
8382
|
},
|
|
8383
8383
|
async poll(e) {
|
|
8384
|
-
let t =
|
|
8384
|
+
let t = xf(e.config);
|
|
8385
8385
|
if (e.checkpoint === null) return {
|
|
8386
|
-
checkpoint: await
|
|
8386
|
+
checkpoint: await Sf(e, t),
|
|
8387
8387
|
events: []
|
|
8388
8388
|
};
|
|
8389
|
-
let n =
|
|
8389
|
+
let n = wf(e.checkpoint), { items: r, next: i } = await Tf(e, n, t.maxItemsPerPoll), a = [], o = 0;
|
|
8390
8390
|
for (let [e, i] of r) {
|
|
8391
|
-
let r = await
|
|
8391
|
+
let r = await Ef(e, i, t, n);
|
|
8392
8392
|
r != "structural" && (r == "filtered" ? o += 1 : a.push(r));
|
|
8393
8393
|
}
|
|
8394
8394
|
return {
|
|
@@ -8399,7 +8399,7 @@ var yf = {
|
|
|
8399
8399
|
};
|
|
8400
8400
|
}
|
|
8401
8401
|
};
|
|
8402
|
-
function
|
|
8402
|
+
function xf(e) {
|
|
8403
8403
|
return {
|
|
8404
8404
|
events: e.events ?? ["created", "updated"],
|
|
8405
8405
|
itemId: (e.itemId ?? "").trim(),
|
|
@@ -8408,25 +8408,25 @@ function bf(e) {
|
|
|
8408
8408
|
parentFolderId: (e.parentFolderId ?? "").trim()
|
|
8409
8409
|
};
|
|
8410
8410
|
}
|
|
8411
|
-
async function
|
|
8412
|
-
let n = await
|
|
8411
|
+
async function Sf(e, t) {
|
|
8412
|
+
let n = await kf(e, "/me/drive/root/delta", { token: "latest" });
|
|
8413
8413
|
if (n.status == 404) throw new r("OneDrive is not provisioned for this account.");
|
|
8414
|
-
|
|
8415
|
-
let i =
|
|
8414
|
+
jf(n, "delta seeding");
|
|
8415
|
+
let i = If(n.data)?.["@odata.deltaLink"], o = i == null ? null : Pf(i);
|
|
8416
8416
|
if (o == null) throw new a("OneDrive delta seeding response has no delta token.");
|
|
8417
|
-
return await
|
|
8417
|
+
return await Cf(e, "parentFolderId", t.parentFolderId), await Cf(e, "itemId", t.itemId), {
|
|
8418
8418
|
deltaToken: o,
|
|
8419
8419
|
lastPolledAt: e.now.toISOString()
|
|
8420
8420
|
};
|
|
8421
8421
|
}
|
|
8422
|
-
async function
|
|
8422
|
+
async function Cf(e, t, n) {
|
|
8423
8423
|
if (n.length == 0) return;
|
|
8424
|
-
let i = await
|
|
8424
|
+
let i = await kf(e, `/me/drive/items/${encodeURIComponent(n)}`, {});
|
|
8425
8425
|
if (i.status == 400 || i.status == 404) throw new r(`OneDrive ${t} does not identify an item in this drive.`);
|
|
8426
|
-
|
|
8426
|
+
jf(i, `${t} validation`);
|
|
8427
8427
|
}
|
|
8428
|
-
function
|
|
8429
|
-
let t =
|
|
8428
|
+
function wf(e) {
|
|
8429
|
+
let t = If(e);
|
|
8430
8430
|
if (typeof t?.deltaToken != "string" || t.deltaToken.length == 0 || typeof t.lastPolledAt != "string" || Number.isNaN(Date.parse(t.lastPolledAt))) throw new r("OneDrive checkpoint is invalid; recreate the Trigger.");
|
|
8431
8431
|
return {
|
|
8432
8432
|
deltaToken: t.deltaToken,
|
|
@@ -8434,28 +8434,28 @@ function Cf(e) {
|
|
|
8434
8434
|
...typeof t.pageToken == "string" && t.pageToken.length > 0 ? { pageToken: t.pageToken } : {}
|
|
8435
8435
|
};
|
|
8436
8436
|
}
|
|
8437
|
-
async function
|
|
8437
|
+
async function Tf(e, t, n) {
|
|
8438
8438
|
let r = /* @__PURE__ */ new Map(), i = t.pageToken ?? t.deltaToken;
|
|
8439
8439
|
for (let t = 0; t < 5; t += 1) {
|
|
8440
|
-
let t = await
|
|
8440
|
+
let t = await kf(e, "/me/drive/root/delta", {
|
|
8441
8441
|
$top: n,
|
|
8442
8442
|
token: i
|
|
8443
8443
|
});
|
|
8444
|
-
|
|
8445
|
-
let o =
|
|
8444
|
+
Af(t);
|
|
8445
|
+
let o = If(t.data) ?? {};
|
|
8446
8446
|
for (let e of o.value ?? []) e.id != null && e.id.length > 0 && r.set(e.id, e);
|
|
8447
8447
|
if (o["@odata.deltaLink"]) return {
|
|
8448
8448
|
items: r,
|
|
8449
8449
|
next: {
|
|
8450
8450
|
checkpoint: {
|
|
8451
|
-
deltaToken:
|
|
8451
|
+
deltaToken: Nf(o["@odata.deltaLink"]),
|
|
8452
8452
|
lastPolledAt: e.now.toISOString()
|
|
8453
8453
|
},
|
|
8454
8454
|
hasMore: !1
|
|
8455
8455
|
}
|
|
8456
8456
|
};
|
|
8457
8457
|
if (!o["@odata.nextLink"]) throw new a("OneDrive delta response has no continuation link.");
|
|
8458
|
-
i =
|
|
8458
|
+
i = Nf(o["@odata.nextLink"]);
|
|
8459
8459
|
}
|
|
8460
8460
|
return {
|
|
8461
8461
|
items: r,
|
|
@@ -8469,17 +8469,17 @@ async function wf(e, t, n) {
|
|
|
8469
8469
|
}
|
|
8470
8470
|
};
|
|
8471
8471
|
}
|
|
8472
|
-
async function
|
|
8472
|
+
async function Ef(e, t, n, r) {
|
|
8473
8473
|
if (t.root != null) return "structural";
|
|
8474
|
-
let i =
|
|
8474
|
+
let i = Df(t);
|
|
8475
8475
|
if (i == null) return "structural";
|
|
8476
|
-
let a = t.deleted == null ?
|
|
8477
|
-
return !n.events.includes(a) || !n.itemTypes.includes(i) || n.parentFolderId.length > 0 && t.parentReference?.id !== n.parentFolderId || n.itemId.length > 0 && e !== n.itemId ? "filtered" : await
|
|
8476
|
+
let a = t.deleted == null ? Ff(t.createdDateTime, new Date(r.lastPolledAt)) ? "created" : "updated" : "deleted";
|
|
8477
|
+
return !n.events.includes(a) || !n.itemTypes.includes(i) || n.parentFolderId.length > 0 && t.parentReference?.id !== n.parentFolderId || n.itemId.length > 0 && e !== n.itemId ? "filtered" : await Of(e, t, a, i, r.deltaToken);
|
|
8478
8478
|
}
|
|
8479
|
-
function
|
|
8479
|
+
function Df(e) {
|
|
8480
8480
|
return e.file == null ? e.folder == null ? e.deleted == null ? null : "file" : "folder" : "file";
|
|
8481
8481
|
}
|
|
8482
|
-
async function
|
|
8482
|
+
async function Of(e, t, n, r, i) {
|
|
8483
8483
|
return {
|
|
8484
8484
|
dedupeKey: t.deleted == null ? `${e}:${t.eTag ?? t.lastModifiedDateTime}` : await pl(fl([
|
|
8485
8485
|
"one-drive-deleted",
|
|
@@ -8502,7 +8502,7 @@ async function Df(e, t, n, r, i) {
|
|
|
8502
8502
|
}
|
|
8503
8503
|
};
|
|
8504
8504
|
}
|
|
8505
|
-
async function
|
|
8505
|
+
async function kf(e, t, n) {
|
|
8506
8506
|
try {
|
|
8507
8507
|
return await e.connector.execute({
|
|
8508
8508
|
endpoint: t,
|
|
@@ -8513,31 +8513,31 @@ async function Of(e, t, n) {
|
|
|
8513
8513
|
throw new a(`OneDrive proxy request to ${t} failed.`, { cause: e });
|
|
8514
8514
|
}
|
|
8515
8515
|
}
|
|
8516
|
-
function
|
|
8517
|
-
if (e.status == 410 &&
|
|
8516
|
+
function Af(e) {
|
|
8517
|
+
if (e.status == 410 && Mf(e.data)) throw new r("OneDrive delta token expired; recreate the Trigger.");
|
|
8518
8518
|
if (e.status == 404) throw new r("OneDrive is not provisioned for this account.");
|
|
8519
8519
|
if (e.status == 400) throw new r("OneDrive rejected the delta token; recreate the Trigger.");
|
|
8520
|
-
|
|
8520
|
+
jf(e, "delta list");
|
|
8521
8521
|
}
|
|
8522
|
-
function
|
|
8522
|
+
function jf(e, t) {
|
|
8523
8523
|
if (!(e.status >= 200 && e.status < 300)) throw e.status == 401 || e.status == 403 ? new i(`OneDrive ${t} rejected the Connection.`) : new a(`OneDrive ${t} failed with status ${e.status}.`);
|
|
8524
8524
|
}
|
|
8525
|
-
function
|
|
8526
|
-
let t =
|
|
8525
|
+
function Mf(e) {
|
|
8526
|
+
let t = If(e)?.error;
|
|
8527
8527
|
for (; t != null;) {
|
|
8528
|
-
let e =
|
|
8528
|
+
let e = If(t);
|
|
8529
8529
|
if (e == null) break;
|
|
8530
8530
|
if (e.code == "resyncChangesApplyDifferences" || e.code == "resyncChangesUploadDifferences") return !0;
|
|
8531
8531
|
t = e.innerError ?? e.innererror;
|
|
8532
8532
|
}
|
|
8533
8533
|
return !1;
|
|
8534
8534
|
}
|
|
8535
|
-
function
|
|
8536
|
-
let t =
|
|
8535
|
+
function Nf(e) {
|
|
8536
|
+
let t = Pf(e);
|
|
8537
8537
|
if (t == null) throw new a("OneDrive delta link has no token.");
|
|
8538
8538
|
return t;
|
|
8539
8539
|
}
|
|
8540
|
-
function
|
|
8540
|
+
function Pf(e) {
|
|
8541
8541
|
let t = /[?&]token=([^&#]+)/.exec(e)?.[1] ?? /\(token='([^']+)'\)/.exec(e)?.[1];
|
|
8542
8542
|
if (t == null) return null;
|
|
8543
8543
|
try {
|
|
@@ -8546,17 +8546,17 @@ function Nf(e) {
|
|
|
8546
8546
|
return t;
|
|
8547
8547
|
}
|
|
8548
8548
|
}
|
|
8549
|
-
function
|
|
8549
|
+
function Ff(e, t) {
|
|
8550
8550
|
if (e == null || e.length == 0) return !1;
|
|
8551
8551
|
let n = new Date(e);
|
|
8552
8552
|
return !Number.isNaN(n.getTime()) && n >= t;
|
|
8553
8553
|
}
|
|
8554
|
-
function
|
|
8554
|
+
function If(e) {
|
|
8555
8555
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
8556
8556
|
}
|
|
8557
8557
|
//#endregion
|
|
8558
8558
|
//#region src/trigger/providers/outlook/on-message-received.ts
|
|
8559
|
-
var
|
|
8559
|
+
var Lf = "inbox", Rf = 25, zf = 100, Bf = "1970-01-01T00:00:00Z", Vf = "id,internetMessageId,conversationId,subject,bodyPreview,from,toRecipients,receivedDateTime,hasAttachments,isRead,isDraft,importance,categories,parentFolderId,webLink", Hf = {
|
|
8560
8560
|
buildOutputs: o,
|
|
8561
8561
|
snapshot: {
|
|
8562
8562
|
configSchema: {
|
|
@@ -8564,7 +8564,7 @@ var If = "inbox", Lf = 25, Rf = 100, zf = "1970-01-01T00:00:00Z", Bf = "id,inter
|
|
|
8564
8564
|
description: "Configuration for outlook.on_message_received. Every configured matching field must match.",
|
|
8565
8565
|
properties: {
|
|
8566
8566
|
folder: {
|
|
8567
|
-
default:
|
|
8567
|
+
default: Lf,
|
|
8568
8568
|
description: "A well-known mail folder name, folder ID, or an empty string for the whole mailbox.",
|
|
8569
8569
|
pattern: "^[A-Za-z0-9_=-]*$",
|
|
8570
8570
|
type: "string"
|
|
@@ -8574,7 +8574,7 @@ var If = "inbox", Lf = 25, Rf = 100, zf = "1970-01-01T00:00:00Z", Bf = "id,inter
|
|
|
8574
8574
|
type: "boolean"
|
|
8575
8575
|
},
|
|
8576
8576
|
maxMessagesPerPoll: {
|
|
8577
|
-
default:
|
|
8577
|
+
default: Rf,
|
|
8578
8578
|
maximum: 100,
|
|
8579
8579
|
minimum: 1,
|
|
8580
8580
|
type: "integer"
|
|
@@ -8674,37 +8674,37 @@ var If = "inbox", Lf = 25, Rf = 100, zf = "1970-01-01T00:00:00Z", Bf = "id,inter
|
|
|
8674
8674
|
type: "poll"
|
|
8675
8675
|
},
|
|
8676
8676
|
async poll(e) {
|
|
8677
|
-
let t =
|
|
8677
|
+
let t = Uf(e.config);
|
|
8678
8678
|
if (e.checkpoint === null) return {
|
|
8679
|
-
checkpoint: await
|
|
8679
|
+
checkpoint: await Wf(e, t),
|
|
8680
8680
|
events: []
|
|
8681
8681
|
};
|
|
8682
|
-
let n =
|
|
8683
|
-
$filter:
|
|
8682
|
+
let n = Gf(e.checkpoint), i = await Xf(e, Kf(t.folder), {
|
|
8683
|
+
$filter: qf(t, n.lastReceivedDateTime),
|
|
8684
8684
|
$orderby: "receivedDateTime asc",
|
|
8685
|
-
$select:
|
|
8685
|
+
$select: Vf,
|
|
8686
8686
|
$top: t.maxMessagesPerPoll
|
|
8687
8687
|
});
|
|
8688
|
-
|
|
8689
|
-
let a =
|
|
8688
|
+
Zf(i, "message list");
|
|
8689
|
+
let a = $f(i.data);
|
|
8690
8690
|
if (a.length == 0) return {
|
|
8691
8691
|
checkpoint: n,
|
|
8692
8692
|
events: []
|
|
8693
8693
|
};
|
|
8694
8694
|
let o = Date.parse(n.lastReceivedDateTime), s = o, c = n.lastReceivedDateTime;
|
|
8695
8695
|
for (let e of a) {
|
|
8696
|
-
let t =
|
|
8696
|
+
let t = tp(e.receivedDateTime);
|
|
8697
8697
|
e.receivedDateTime != null && t != null && t > s && (s = t, c = e.receivedDateTime);
|
|
8698
8698
|
}
|
|
8699
8699
|
let l = s > o, u = new Set(n.boundaryMessageIds), d = a.length >= t.maxMessagesPerPoll;
|
|
8700
8700
|
if (d && !l && a.every((e) => typeof e.id == "string" && u.has(e.id))) throw new r("Outlook cursor is stuck on a full timestamp boundary; increase maxMessagesPerPoll and resume the Trigger.");
|
|
8701
8701
|
let f = new Set(l ? [] : n.boundaryMessageIds), p = [], m = 0;
|
|
8702
|
-
for (let e of a) if (e.id != null && e.id.length != 0 && (
|
|
8703
|
-
if (!
|
|
8702
|
+
for (let e of a) if (e.id != null && e.id.length != 0 && (tp(e.receivedDateTime) == s && f.add(e.id), !u.has(e.id))) {
|
|
8703
|
+
if (!Jf(e, t)) {
|
|
8704
8704
|
m += 1;
|
|
8705
8705
|
continue;
|
|
8706
8706
|
}
|
|
8707
|
-
p.push(
|
|
8707
|
+
p.push(Yf(e, e.id));
|
|
8708
8708
|
}
|
|
8709
8709
|
let ee = d && (l || p.length > 0);
|
|
8710
8710
|
return {
|
|
@@ -8718,34 +8718,34 @@ var If = "inbox", Lf = 25, Rf = 100, zf = "1970-01-01T00:00:00Z", Bf = "id,inter
|
|
|
8718
8718
|
};
|
|
8719
8719
|
}
|
|
8720
8720
|
};
|
|
8721
|
-
function
|
|
8721
|
+
function Uf(e) {
|
|
8722
8722
|
return {
|
|
8723
|
-
folder: e.folder ??
|
|
8723
|
+
folder: e.folder ?? Lf,
|
|
8724
8724
|
includeDrafts: e.includeDrafts ?? !1,
|
|
8725
|
-
maxMessagesPerPoll: e.maxMessagesPerPoll ??
|
|
8725
|
+
maxMessagesPerPoll: e.maxMessagesPerPoll ?? Rf,
|
|
8726
8726
|
readStatus: e.readStatus ?? "All",
|
|
8727
8727
|
senderAddress: (e.senderAddress ?? "").trim(),
|
|
8728
8728
|
subjectContains: (e.subjectContains ?? "").trim(),
|
|
8729
8729
|
withAttachmentsOnly: e.withAttachmentsOnly ?? !1
|
|
8730
8730
|
};
|
|
8731
8731
|
}
|
|
8732
|
-
async function
|
|
8733
|
-
let n = await
|
|
8732
|
+
async function Wf(e, t) {
|
|
8733
|
+
let n = await Xf(e, Kf(t.folder), {
|
|
8734
8734
|
$orderby: "receivedDateTime desc",
|
|
8735
8735
|
$select: "id,receivedDateTime",
|
|
8736
|
-
$top:
|
|
8736
|
+
$top: zf
|
|
8737
8737
|
});
|
|
8738
|
-
|
|
8739
|
-
$filter:
|
|
8738
|
+
Zf(n, "seed marker fetch"), Zf(await Xf(e, Kf(t.folder), {
|
|
8739
|
+
$filter: qf(t, Bf),
|
|
8740
8740
|
$orderby: "receivedDateTime desc",
|
|
8741
8741
|
$top: 1
|
|
8742
8742
|
}), "seed filter shape check");
|
|
8743
|
-
let r = $f(
|
|
8743
|
+
let r = ep($f(n.data));
|
|
8744
8744
|
if (r == null) return {
|
|
8745
8745
|
boundaryMessageIds: [],
|
|
8746
8746
|
lastReceivedDateTime: e.now.toISOString()
|
|
8747
8747
|
};
|
|
8748
|
-
let i =
|
|
8748
|
+
let i = $f(n.data).filter((e) => tp(e.receivedDateTime) == r.ms);
|
|
8749
8749
|
return i.length >= t.maxMessagesPerPoll ? {
|
|
8750
8750
|
boundaryMessageIds: [],
|
|
8751
8751
|
lastReceivedDateTime: new Date(r.ms + 1e3).toISOString()
|
|
@@ -8754,26 +8754,26 @@ async function Uf(e, t) {
|
|
|
8754
8754
|
lastReceivedDateTime: r.iso
|
|
8755
8755
|
};
|
|
8756
8756
|
}
|
|
8757
|
-
function
|
|
8758
|
-
let t =
|
|
8759
|
-
if (typeof n != "string" ||
|
|
8757
|
+
function Gf(e) {
|
|
8758
|
+
let t = np(e), n = t?.lastReceivedDateTime;
|
|
8759
|
+
if (typeof n != "string" || tp(n) == null) throw new r("Outlook checkpoint is invalid; recreate the Trigger.");
|
|
8760
8760
|
let i = t?.boundaryMessageIds;
|
|
8761
8761
|
return {
|
|
8762
8762
|
boundaryMessageIds: Array.isArray(i) ? i.filter((e) => typeof e == "string" && e.length > 0) : [],
|
|
8763
8763
|
lastReceivedDateTime: n
|
|
8764
8764
|
};
|
|
8765
8765
|
}
|
|
8766
|
-
function
|
|
8766
|
+
function Kf(e) {
|
|
8767
8767
|
return e.length == 0 ? "/me/messages" : `/me/mailFolders/${encodeURIComponent(e)}/messages`;
|
|
8768
8768
|
}
|
|
8769
|
-
function
|
|
8769
|
+
function qf(e, t) {
|
|
8770
8770
|
let n = [`receivedDateTime ge ${t}`];
|
|
8771
8771
|
return e.readStatus == "Unread" && n.push("isRead eq false"), e.readStatus == "Read" && n.push("isRead eq true"), e.withAttachmentsOnly && n.push("hasAttachments eq true"), e.senderAddress.length > 0 && n.push(`from/emailAddress/address eq '${e.senderAddress.replaceAll("'", "''")}'`), n.join(" and ");
|
|
8772
8772
|
}
|
|
8773
|
-
function
|
|
8773
|
+
function Jf(e, t) {
|
|
8774
8774
|
return e.isDraft === !0 && !t.includeDrafts ? !1 : t.subjectContains.length == 0 || (e.subject ?? "").toLowerCase().includes(t.subjectContains.toLowerCase());
|
|
8775
8775
|
}
|
|
8776
|
-
function
|
|
8776
|
+
function Yf(e, t) {
|
|
8777
8777
|
return {
|
|
8778
8778
|
dedupeKey: t,
|
|
8779
8779
|
payload: {
|
|
@@ -8796,7 +8796,7 @@ function Jf(e, t) {
|
|
|
8796
8796
|
}
|
|
8797
8797
|
};
|
|
8798
8798
|
}
|
|
8799
|
-
async function
|
|
8799
|
+
async function Xf(e, t, n) {
|
|
8800
8800
|
try {
|
|
8801
8801
|
return await e.connector.execute({
|
|
8802
8802
|
endpoint: t,
|
|
@@ -8808,28 +8808,28 @@ async function Yf(e, t, n) {
|
|
|
8808
8808
|
throw new a(`Outlook proxy request to ${t} failed.`, { cause: e });
|
|
8809
8809
|
}
|
|
8810
8810
|
}
|
|
8811
|
-
function
|
|
8811
|
+
function Zf(e, t) {
|
|
8812
8812
|
if (e.status >= 200 && e.status < 300) return;
|
|
8813
|
-
let n =
|
|
8813
|
+
let n = Qf(e.data);
|
|
8814
8814
|
throw e.status == 401 ? new i(`Outlook ${t} rejected the Connection.`) : e.status == 403 && n.has("mailboxnotenabledforrestapi") ? new r("The Outlook mailbox is not reachable through the Graph mail APIs.") : e.status == 403 && (n.has("accessdenied") || n.has("erroraccessdenied")) ? new i(`Outlook ${t} rejected the Connection.`) : e.status == 404 && (n.has("erroritemnotfound") || n.has("itemnotfound")) ? new r("The configured Outlook folder does not exist.") : e.status == 400 && (n.has("errorinvalididmalformed") || n.has("inefficientfilter")) ? new r("Outlook rejected the configured folder or filters.") : new a(`Outlook ${t} failed with status ${e.status}.`);
|
|
8815
8815
|
}
|
|
8816
|
-
function
|
|
8817
|
-
let t = /* @__PURE__ */ new Set(), n =
|
|
8816
|
+
function Qf(e) {
|
|
8817
|
+
let t = /* @__PURE__ */ new Set(), n = np(e)?.error;
|
|
8818
8818
|
for (let e = 0; e < 4; e += 1) {
|
|
8819
|
-
let e =
|
|
8819
|
+
let e = np(n);
|
|
8820
8820
|
if (e == null) break;
|
|
8821
8821
|
typeof e.code == "string" && e.code.length > 0 && t.add(e.code.toLowerCase()), n = e.innerError ?? e.innererror;
|
|
8822
8822
|
}
|
|
8823
8823
|
return t;
|
|
8824
8824
|
}
|
|
8825
|
-
function
|
|
8826
|
-
let t =
|
|
8825
|
+
function $f(e) {
|
|
8826
|
+
let t = np(e)?.value;
|
|
8827
8827
|
return Array.isArray(t) ? t : [];
|
|
8828
8828
|
}
|
|
8829
|
-
function
|
|
8829
|
+
function ep(e) {
|
|
8830
8830
|
let t = null;
|
|
8831
8831
|
for (let n of e) {
|
|
8832
|
-
let e =
|
|
8832
|
+
let e = tp(n.receivedDateTime);
|
|
8833
8833
|
n.receivedDateTime != null && e != null && (t == null || e > t.ms) && (t = {
|
|
8834
8834
|
iso: n.receivedDateTime,
|
|
8835
8835
|
ms: e
|
|
@@ -8837,15 +8837,15 @@ function $f(e) {
|
|
|
8837
8837
|
}
|
|
8838
8838
|
return t;
|
|
8839
8839
|
}
|
|
8840
|
-
function
|
|
8840
|
+
function tp(e) {
|
|
8841
8841
|
if (e == null || e.length == 0) return null;
|
|
8842
8842
|
let t = Date.parse(e);
|
|
8843
8843
|
return Number.isNaN(t) ? null : t;
|
|
8844
8844
|
}
|
|
8845
|
-
function
|
|
8845
|
+
function np(e) {
|
|
8846
8846
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
8847
8847
|
}
|
|
8848
|
-
var
|
|
8848
|
+
var rp = {
|
|
8849
8849
|
initialState: {
|
|
8850
8850
|
checkpoint: null,
|
|
8851
8851
|
subscription: {}
|
|
@@ -8923,7 +8923,7 @@ var np = {
|
|
|
8923
8923
|
outcome: "ignored",
|
|
8924
8924
|
reason: "Shopify topic header is missing."
|
|
8925
8925
|
};
|
|
8926
|
-
if (!
|
|
8926
|
+
if (!ip(e.config).includes(t)) return {
|
|
8927
8927
|
outcome: "ignored",
|
|
8928
8928
|
reason: "Shopify topic is not subscribed."
|
|
8929
8929
|
};
|
|
@@ -8943,39 +8943,39 @@ var np = {
|
|
|
8943
8943
|
};
|
|
8944
8944
|
},
|
|
8945
8945
|
async reconcile(e) {
|
|
8946
|
-
let n =
|
|
8946
|
+
let n = fp(e.state), r = await op(e);
|
|
8947
8947
|
if (r == null) {
|
|
8948
8948
|
if (!e.active) return { outcome: "ready" };
|
|
8949
8949
|
throw new t("The Shopify store or webhook resource is unavailable.");
|
|
8950
8950
|
}
|
|
8951
8951
|
if (!e.active) {
|
|
8952
|
-
for (let t of r.values()) await
|
|
8953
|
-
return await n.saveSubscription({},
|
|
8952
|
+
for (let t of r.values()) await cp(e, t);
|
|
8953
|
+
return await n.saveSubscription({}, pp(e.now)), { outcome: "ready" };
|
|
8954
8954
|
}
|
|
8955
|
-
let i =
|
|
8955
|
+
let i = ip(e.config), a = [], o = [];
|
|
8956
8956
|
try {
|
|
8957
8957
|
for (let t of i) {
|
|
8958
8958
|
let n = r.get(t);
|
|
8959
8959
|
if (n != null) a.push(n);
|
|
8960
8960
|
else {
|
|
8961
|
-
let n = await
|
|
8961
|
+
let n = await ap(e, t);
|
|
8962
8962
|
a.push(n.id), n.created && o.push(n.id);
|
|
8963
8963
|
}
|
|
8964
8964
|
}
|
|
8965
8965
|
} catch (t) {
|
|
8966
|
-
throw await Promise.allSettled(o.map((t) =>
|
|
8966
|
+
throw await Promise.allSettled(o.map((t) => cp(e, t))), t;
|
|
8967
8967
|
}
|
|
8968
|
-
for (let [t, n] of r) i.includes(t) || await
|
|
8969
|
-
return await n.saveSubscription({ webhookIds: a },
|
|
8968
|
+
for (let [t, n] of r) i.includes(t) || await cp(e, n);
|
|
8969
|
+
return await n.saveSubscription({ webhookIds: a }, pp(e.now)), { outcome: "ready" };
|
|
8970
8970
|
}
|
|
8971
8971
|
};
|
|
8972
|
-
function
|
|
8972
|
+
function ip(e) {
|
|
8973
8973
|
return [...new Set(e.topics)];
|
|
8974
8974
|
}
|
|
8975
|
-
async function
|
|
8976
|
-
let r = await
|
|
8975
|
+
async function ap(e, t) {
|
|
8976
|
+
let r = await lp(e, "subscription create", {
|
|
8977
8977
|
body: { webhook: {
|
|
8978
|
-
address:
|
|
8978
|
+
address: sp(e),
|
|
8979
8979
|
format: "json",
|
|
8980
8980
|
topic: t
|
|
8981
8981
|
} },
|
|
@@ -8983,22 +8983,22 @@ async function ip(e, t) {
|
|
|
8983
8983
|
method: "POST"
|
|
8984
8984
|
});
|
|
8985
8985
|
if (r.status == 422) {
|
|
8986
|
-
let n = (await
|
|
8986
|
+
let n = (await op(e))?.get(t);
|
|
8987
8987
|
if (n != null) return {
|
|
8988
8988
|
created: !1,
|
|
8989
8989
|
id: n
|
|
8990
8990
|
};
|
|
8991
8991
|
}
|
|
8992
|
-
|
|
8993
|
-
let i =
|
|
8992
|
+
up(r, "subscription create");
|
|
8993
|
+
let i = dp(mp(mp(r.data)?.webhook)?.id);
|
|
8994
8994
|
if (i == null) throw new n("Shopify subscription response is missing its ID.");
|
|
8995
8995
|
return {
|
|
8996
8996
|
created: !0,
|
|
8997
8997
|
id: i
|
|
8998
8998
|
};
|
|
8999
8999
|
}
|
|
9000
|
-
async function
|
|
9001
|
-
let t =
|
|
9000
|
+
async function op(e) {
|
|
9001
|
+
let t = sp(e), n = await lp(e, "subscription list", {
|
|
9002
9002
|
endpoint: "/webhooks.json",
|
|
9003
9003
|
method: "GET",
|
|
9004
9004
|
query: {
|
|
@@ -9007,34 +9007,34 @@ async function ap(e) {
|
|
|
9007
9007
|
}
|
|
9008
9008
|
});
|
|
9009
9009
|
if (n.status == 404) return null;
|
|
9010
|
-
|
|
9011
|
-
let r =
|
|
9010
|
+
up(n, "subscription list");
|
|
9011
|
+
let r = mp(n.data)?.webhooks, i = /* @__PURE__ */ new Map();
|
|
9012
9012
|
if (!Array.isArray(r)) return i;
|
|
9013
9013
|
for (let e of r) {
|
|
9014
|
-
let n =
|
|
9014
|
+
let n = mp(e), r = dp(n?.id);
|
|
9015
9015
|
n?.address === t && typeof n.topic == "string" && r != null && i.set(n.topic, r);
|
|
9016
9016
|
}
|
|
9017
9017
|
return i;
|
|
9018
9018
|
}
|
|
9019
|
-
function
|
|
9019
|
+
function sp(e) {
|
|
9020
9020
|
let t = new URL(e.endpointUrl);
|
|
9021
9021
|
return t.searchParams.set("open_flow_callback", e.callbackSecret), t.href;
|
|
9022
9022
|
}
|
|
9023
|
-
async function
|
|
9024
|
-
let n = await
|
|
9023
|
+
async function cp(e, t) {
|
|
9024
|
+
let n = await lp(e, "subscription delete", {
|
|
9025
9025
|
endpoint: `/webhooks/${encodeURIComponent(t)}.json`,
|
|
9026
9026
|
method: "DELETE"
|
|
9027
9027
|
});
|
|
9028
|
-
n.status != 404 &&
|
|
9028
|
+
n.status != 404 && up(n, "subscription delete");
|
|
9029
9029
|
}
|
|
9030
|
-
async function
|
|
9030
|
+
async function lp(t, r, i) {
|
|
9031
9031
|
try {
|
|
9032
9032
|
return await t.connector.execute(i, t.signal);
|
|
9033
9033
|
} catch (t) {
|
|
9034
9034
|
throw t instanceof e ? t : new n(`Shopify ${r} request failed.`, { cause: t });
|
|
9035
9035
|
}
|
|
9036
9036
|
}
|
|
9037
|
-
function
|
|
9037
|
+
function up(r, i) {
|
|
9038
9038
|
if (!(r.status >= 200 && r.status < 300)) throw r.status == 401 || r.status == 403 ? new e(`Shopify ${i} rejected the Connection.`) : [
|
|
9039
9039
|
402,
|
|
9040
9040
|
404,
|
|
@@ -9043,34 +9043,34 @@ function lp(r, i) {
|
|
|
9043
9043
|
501
|
|
9044
9044
|
].includes(r.status) ? new t(`Shopify ${i} rejected the subscription.`) : new n(`Shopify ${i} failed with status ${r.status}.`);
|
|
9045
9045
|
}
|
|
9046
|
-
function
|
|
9046
|
+
function dp(e) {
|
|
9047
9047
|
return typeof e == "string" ? e.trim().length == 0 ? null : e : typeof e == "number" && Number.isFinite(e) ? String(e) : null;
|
|
9048
9048
|
}
|
|
9049
|
-
function
|
|
9049
|
+
function fp(e) {
|
|
9050
9050
|
if (e == null) throw new t("Shopify Integration state is missing.");
|
|
9051
9051
|
return e;
|
|
9052
9052
|
}
|
|
9053
|
-
function
|
|
9053
|
+
function pp(e) {
|
|
9054
9054
|
return new Date(e.getTime() + 2592e6);
|
|
9055
9055
|
}
|
|
9056
|
-
function
|
|
9056
|
+
function mp(e) {
|
|
9057
9057
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
9058
9058
|
}
|
|
9059
9059
|
//#endregion
|
|
9060
9060
|
//#region src/trigger/providers/slack/on-message-posted.ts
|
|
9061
|
-
var
|
|
9061
|
+
var hp = 15, gp = 6e4, _p = /* @__PURE__ */ new Set([
|
|
9062
9062
|
"file_share",
|
|
9063
9063
|
"thread_broadcast",
|
|
9064
9064
|
"me_message",
|
|
9065
9065
|
"bot_message"
|
|
9066
|
-
]),
|
|
9066
|
+
]), vp = /* @__PURE__ */ new Set([
|
|
9067
9067
|
"invalid_auth",
|
|
9068
9068
|
"not_authed",
|
|
9069
9069
|
"token_revoked",
|
|
9070
9070
|
"token_expired",
|
|
9071
9071
|
"account_inactive",
|
|
9072
9072
|
"two_factor_setup_required"
|
|
9073
|
-
]),
|
|
9073
|
+
]), yp = /* @__PURE__ */ new Set([
|
|
9074
9074
|
"channel_not_found",
|
|
9075
9075
|
"not_in_channel",
|
|
9076
9076
|
"missing_scope",
|
|
@@ -9086,7 +9086,7 @@ var mp = 15, hp = 6e4, gp = /* @__PURE__ */ new Set([
|
|
|
9086
9086
|
"method_deprecated",
|
|
9087
9087
|
"deprecated_endpoint",
|
|
9088
9088
|
"accesslimited"
|
|
9089
|
-
]),
|
|
9089
|
+
]), bp = {
|
|
9090
9090
|
buildOutputs: o,
|
|
9091
9091
|
snapshot: {
|
|
9092
9092
|
configSchema: {
|
|
@@ -9127,7 +9127,7 @@ var mp = 15, hp = 6e4, gp = /* @__PURE__ */ new Set([
|
|
|
9127
9127
|
type: "boolean"
|
|
9128
9128
|
},
|
|
9129
9129
|
maxMessagesPerPoll: {
|
|
9130
|
-
default:
|
|
9130
|
+
default: hp,
|
|
9131
9131
|
description: "Maximum number of messages processed per poll.",
|
|
9132
9132
|
maximum: 100,
|
|
9133
9133
|
minimum: 1,
|
|
@@ -9205,47 +9205,47 @@ var mp = 15, hp = 6e4, gp = /* @__PURE__ */ new Set([
|
|
|
9205
9205
|
type: "poll"
|
|
9206
9206
|
},
|
|
9207
9207
|
async poll(e) {
|
|
9208
|
-
let t =
|
|
9208
|
+
let t = xp(e.config);
|
|
9209
9209
|
if (e.checkpoint === null) return {
|
|
9210
|
-
checkpoint: { lastTs: await
|
|
9210
|
+
checkpoint: { lastTs: await Sp(e, t.channelId) },
|
|
9211
9211
|
events: []
|
|
9212
9212
|
};
|
|
9213
|
-
let n =
|
|
9213
|
+
let n = Cp(e.checkpoint), r = await wp(e, t, n), i = Dp(r), a = [], o = 0;
|
|
9214
9214
|
for (let e of i.toReversed()) {
|
|
9215
|
-
if (!
|
|
9215
|
+
if (!kp(e.message, t)) {
|
|
9216
9216
|
o += 1;
|
|
9217
9217
|
continue;
|
|
9218
9218
|
}
|
|
9219
|
-
a.push(
|
|
9219
|
+
a.push(Ap(e, t.channelId));
|
|
9220
9220
|
}
|
|
9221
9221
|
return {
|
|
9222
|
-
checkpoint:
|
|
9222
|
+
checkpoint: Op(n, r, i),
|
|
9223
9223
|
events: a,
|
|
9224
9224
|
filtered: o
|
|
9225
9225
|
};
|
|
9226
9226
|
}
|
|
9227
9227
|
};
|
|
9228
|
-
function
|
|
9228
|
+
function xp(e) {
|
|
9229
9229
|
return {
|
|
9230
9230
|
channelId: e.channelId,
|
|
9231
9231
|
fromUserIds: e.fromUserIds ?? [],
|
|
9232
9232
|
ignoreUserIds: e.ignoreUserIds ?? [],
|
|
9233
9233
|
includeBotMessages: e.includeBotMessages ?? !1,
|
|
9234
9234
|
includeSystemMessages: e.includeSystemMessages ?? !1,
|
|
9235
|
-
maxMessagesPerPoll: e.maxMessagesPerPoll ??
|
|
9235
|
+
maxMessagesPerPoll: e.maxMessagesPerPoll ?? hp,
|
|
9236
9236
|
textContains: e.textContains ?? ""
|
|
9237
9237
|
};
|
|
9238
9238
|
}
|
|
9239
|
-
async function
|
|
9240
|
-
let n = await
|
|
9239
|
+
async function Sp(e, t) {
|
|
9240
|
+
let n = await Tp(e, {
|
|
9241
9241
|
channel: t,
|
|
9242
9242
|
limit: 1
|
|
9243
9243
|
});
|
|
9244
|
-
|
|
9244
|
+
Ep(n, "baseline history fetch");
|
|
9245
9245
|
let r = n.data.messages?.[0]?.ts;
|
|
9246
|
-
return r != null &&
|
|
9246
|
+
return r != null && jp(r) ? r : `${Math.floor((e.now.getTime() - gp) / 1e3)}.000000`;
|
|
9247
9247
|
}
|
|
9248
|
-
function
|
|
9248
|
+
function Cp(e) {
|
|
9249
9249
|
let t = e;
|
|
9250
9250
|
if (typeof t.lastTs != "string" || t.lastTs.length == 0) throw new r("Slack checkpoint lastTs is missing.");
|
|
9251
9251
|
let n = t.drainLatest, i = t.pendingHighTs;
|
|
@@ -9257,17 +9257,17 @@ function Sp(e) {
|
|
|
9257
9257
|
pendingHighTs: i
|
|
9258
9258
|
};
|
|
9259
9259
|
}
|
|
9260
|
-
async function
|
|
9261
|
-
let r = await
|
|
9260
|
+
async function wp(e, t, n) {
|
|
9261
|
+
let r = await Tp(e, {
|
|
9262
9262
|
channel: t.channelId,
|
|
9263
9263
|
inclusive: "false",
|
|
9264
9264
|
latest: n.drainLatest,
|
|
9265
9265
|
limit: t.maxMessagesPerPoll,
|
|
9266
9266
|
oldest: n.lastTs
|
|
9267
9267
|
});
|
|
9268
|
-
return
|
|
9268
|
+
return Ep(r, "history list"), r.data;
|
|
9269
9269
|
}
|
|
9270
|
-
async function
|
|
9270
|
+
async function Tp(e, t) {
|
|
9271
9271
|
try {
|
|
9272
9272
|
return await e.connector.execute({
|
|
9273
9273
|
endpoint: "/conversations.history",
|
|
@@ -9278,19 +9278,19 @@ async function wp(e, t) {
|
|
|
9278
9278
|
throw new a("Slack proxy request failed.", { cause: e });
|
|
9279
9279
|
}
|
|
9280
9280
|
}
|
|
9281
|
-
function
|
|
9281
|
+
function Ep(e, t) {
|
|
9282
9282
|
let n = e.data;
|
|
9283
9283
|
if (e.status >= 200 && e.status < 300 && n.ok === !0) return;
|
|
9284
9284
|
let o = typeof n.error == "string" ? n.error : "";
|
|
9285
|
-
throw
|
|
9285
|
+
throw vp.has(o) ? new i(`Slack ${t} rejected with ${o}.`) : yp.has(o) ? new r(`Slack ${t} rejected with ${o}.`) : new a(`Slack ${t} failed with ${o || `status ${e.status}`}.`);
|
|
9286
9286
|
}
|
|
9287
|
-
function
|
|
9288
|
-
return (e.messages ?? []).flatMap((e) => e.ts != null &&
|
|
9287
|
+
function Dp(e) {
|
|
9288
|
+
return (e.messages ?? []).flatMap((e) => e.ts != null && jp(e.ts) ? [{
|
|
9289
9289
|
message: e,
|
|
9290
9290
|
ts: e.ts
|
|
9291
9291
|
}] : []);
|
|
9292
9292
|
}
|
|
9293
|
-
function
|
|
9293
|
+
function Op(e, t, n) {
|
|
9294
9294
|
let r = n[0]?.ts, i = n.at(-1)?.ts;
|
|
9295
9295
|
if (t.has_more === !0) {
|
|
9296
9296
|
if (r == null || i == null) throw new a("Slack history reports has_more without a usable timestamp.");
|
|
@@ -9302,10 +9302,10 @@ function Dp(e, t, n) {
|
|
|
9302
9302
|
}
|
|
9303
9303
|
return e.pendingHighTs == null ? { lastTs: r ?? e.lastTs } : { lastTs: e.pendingHighTs };
|
|
9304
9304
|
}
|
|
9305
|
-
function Op(e, t) {
|
|
9306
|
-
return !t.includeBotMessages && (e.bot_id != null || e.subtype == "bot_message") || !t.includeSystemMessages && e.subtype != null && !gp.has(e.subtype) || t.fromUserIds.length > 0 && (e.user == null || !t.fromUserIds.includes(e.user)) || e.user != null && t.ignoreUserIds.includes(e.user) ? !1 : t.textContains.length == 0 || (e.text ?? "").toLowerCase().includes(t.textContains.toLowerCase());
|
|
9307
|
-
}
|
|
9308
9305
|
function kp(e, t) {
|
|
9306
|
+
return !t.includeBotMessages && (e.bot_id != null || e.subtype == "bot_message") || !t.includeSystemMessages && e.subtype != null && !_p.has(e.subtype) || t.fromUserIds.length > 0 && (e.user == null || !t.fromUserIds.includes(e.user)) || e.user != null && t.ignoreUserIds.includes(e.user) ? !1 : t.textContains.length == 0 || (e.text ?? "").toLowerCase().includes(t.textContains.toLowerCase());
|
|
9307
|
+
}
|
|
9308
|
+
function Ap(e, t) {
|
|
9309
9309
|
return {
|
|
9310
9310
|
dedupeKey: `${t}:${e.ts}`,
|
|
9311
9311
|
payload: {
|
|
@@ -9324,12 +9324,12 @@ function kp(e, t) {
|
|
|
9324
9324
|
}
|
|
9325
9325
|
};
|
|
9326
9326
|
}
|
|
9327
|
-
function
|
|
9327
|
+
function jp(e) {
|
|
9328
9328
|
return /^\d+(?:\.\d+)?$/.test(e) && !Number.isNaN(new Date(Math.round(Number(e) * 1e3)).getTime());
|
|
9329
9329
|
}
|
|
9330
9330
|
//#endregion
|
|
9331
9331
|
//#region src/trigger/providers/stripe/on-event.ts
|
|
9332
|
-
var
|
|
9332
|
+
var Mp = 300, Np = "/v1/webhook_endpoints", Pp = { "Content-Type": "application/x-www-form-urlencoded" }, Fp = {
|
|
9333
9333
|
initialState: {
|
|
9334
9334
|
checkpoint: null,
|
|
9335
9335
|
subscription: {}
|
|
@@ -9401,8 +9401,8 @@ var jp = 300, Mp = "/v1/webhook_endpoints", Np = { "Content-Type": "application/
|
|
|
9401
9401
|
type: "integration"
|
|
9402
9402
|
},
|
|
9403
9403
|
async receive(e) {
|
|
9404
|
-
let t =
|
|
9405
|
-
if (t == null || !await
|
|
9404
|
+
let t = Gp(e.state);
|
|
9405
|
+
if (t == null || !await Kp(e.header("stripe-signature"), t, e.rawBody, e.now)) return {
|
|
9406
9406
|
body: "",
|
|
9407
9407
|
contentType: "text/plain",
|
|
9408
9408
|
outcome: "respond",
|
|
@@ -9417,7 +9417,7 @@ var jp = 300, Mp = "/v1/webhook_endpoints", Np = { "Content-Type": "application/
|
|
|
9417
9417
|
outcome: "ignored",
|
|
9418
9418
|
reason: "Stripe event identity is missing."
|
|
9419
9419
|
};
|
|
9420
|
-
let a =
|
|
9420
|
+
let a = Ip(e.config);
|
|
9421
9421
|
return !a.events.includes("*") && !a.events.includes(r) ? {
|
|
9422
9422
|
outcome: "ignored",
|
|
9423
9423
|
reason: "Stripe event is not subscribed."
|
|
@@ -9433,156 +9433,156 @@ var jp = 300, Mp = "/v1/webhook_endpoints", Np = { "Content-Type": "application/
|
|
|
9433
9433
|
};
|
|
9434
9434
|
},
|
|
9435
9435
|
async reconcile(e) {
|
|
9436
|
-
let t =
|
|
9436
|
+
let t = Up(e.state), n = Ip(e.config), r = Wp(t), i = Gp(t);
|
|
9437
9437
|
if (!e.active) {
|
|
9438
|
-
if (r ??= await
|
|
9439
|
-
let t = await
|
|
9440
|
-
endpoint: `${
|
|
9438
|
+
if (r ??= await zp(e), r != null) {
|
|
9439
|
+
let t = await Bp(e, "endpoint delete", {
|
|
9440
|
+
endpoint: `${Np}/${r}`,
|
|
9441
9441
|
method: "DELETE"
|
|
9442
9442
|
});
|
|
9443
|
-
t.status != 404 &&
|
|
9443
|
+
t.status != 404 && Vp(t, "endpoint delete");
|
|
9444
9444
|
}
|
|
9445
|
-
return await t.saveSubscription({},
|
|
9445
|
+
return await t.saveSubscription({}, qp(e.now)), { outcome: "ready" };
|
|
9446
9446
|
}
|
|
9447
|
-
if (r ??= await
|
|
9448
|
-
let t = await
|
|
9449
|
-
endpoint: `${
|
|
9447
|
+
if (r ??= await zp(e), r != null && i == null) {
|
|
9448
|
+
let t = await Bp(e, "endpoint delete", {
|
|
9449
|
+
endpoint: `${Np}/${r}`,
|
|
9450
9450
|
method: "DELETE"
|
|
9451
9451
|
});
|
|
9452
|
-
t.status != 404 &&
|
|
9452
|
+
t.status != 404 && Vp(t, "endpoint delete"), r = null;
|
|
9453
9453
|
}
|
|
9454
9454
|
if (r == null) {
|
|
9455
|
-
let t = await
|
|
9456
|
-
body:
|
|
9457
|
-
endpoint:
|
|
9455
|
+
let t = await Bp(e, "endpoint create", {
|
|
9456
|
+
body: Lp(e.endpointUrl, n),
|
|
9457
|
+
endpoint: Np,
|
|
9458
9458
|
headers: {
|
|
9459
|
-
...
|
|
9459
|
+
...Pp,
|
|
9460
9460
|
"Idempotency-Key": e.idempotencyKey
|
|
9461
9461
|
},
|
|
9462
9462
|
method: "POST"
|
|
9463
9463
|
});
|
|
9464
|
-
|
|
9465
|
-
let a =
|
|
9464
|
+
Vp(t, "endpoint create");
|
|
9465
|
+
let a = Hp(t.data);
|
|
9466
9466
|
r = a.id, i = a.secret;
|
|
9467
9467
|
}
|
|
9468
|
-
let a = await
|
|
9469
|
-
body:
|
|
9468
|
+
let a = await Bp(e, "endpoint update", {
|
|
9469
|
+
body: Rp([
|
|
9470
9470
|
...n.events.map((e, t) => [`enabled_events[${t}]`, e]),
|
|
9471
9471
|
["disabled", "false"],
|
|
9472
9472
|
["description", "Managed by Open Flow."]
|
|
9473
9473
|
]),
|
|
9474
|
-
endpoint: `${
|
|
9475
|
-
headers:
|
|
9474
|
+
endpoint: `${Np}/${r}`,
|
|
9475
|
+
headers: Pp,
|
|
9476
9476
|
method: "POST"
|
|
9477
9477
|
});
|
|
9478
|
-
return a.status == 404 ? (await t.saveSubscription({}, e.now), { outcome: "pending" }) : (
|
|
9478
|
+
return a.status == 404 ? (await t.saveSubscription({}, e.now), { outcome: "pending" }) : (Vp(a, "endpoint update"), await t.saveSubscription({
|
|
9479
9479
|
endpointId: r,
|
|
9480
9480
|
signingSecret: i
|
|
9481
|
-
},
|
|
9481
|
+
}, qp(e.now)), { outcome: "ready" });
|
|
9482
9482
|
}
|
|
9483
9483
|
};
|
|
9484
|
-
function
|
|
9484
|
+
function Ip(e) {
|
|
9485
9485
|
return {
|
|
9486
9486
|
apiVersion: e.apiVersion ?? "",
|
|
9487
9487
|
events: [...new Set(e.events)],
|
|
9488
9488
|
includeConnectedAccounts: e.includeConnectedAccounts ?? !1
|
|
9489
9489
|
};
|
|
9490
9490
|
}
|
|
9491
|
-
function
|
|
9491
|
+
function Lp(e, t) {
|
|
9492
9492
|
let n = [
|
|
9493
9493
|
["url", e],
|
|
9494
9494
|
...t.events.map((e, t) => [`enabled_events[${t}]`, e]),
|
|
9495
9495
|
["description", "Managed by Open Flow."]
|
|
9496
9496
|
];
|
|
9497
|
-
return t.includeConnectedAccounts && n.push(["connect", "true"]), t.apiVersion.length > 0 && n.push(["api_version", t.apiVersion]),
|
|
9497
|
+
return t.includeConnectedAccounts && n.push(["connect", "true"]), t.apiVersion.length > 0 && n.push(["api_version", t.apiVersion]), Rp(n);
|
|
9498
9498
|
}
|
|
9499
|
-
function
|
|
9499
|
+
function Rp(e) {
|
|
9500
9500
|
let t = new URLSearchParams();
|
|
9501
9501
|
for (let [n, r] of e) t.append(n, r);
|
|
9502
9502
|
return t.toString();
|
|
9503
9503
|
}
|
|
9504
|
-
async function
|
|
9504
|
+
async function zp(e) {
|
|
9505
9505
|
let t;
|
|
9506
9506
|
for (let n = 0; n < 10; n += 1) {
|
|
9507
|
-
let n = await
|
|
9508
|
-
endpoint:
|
|
9507
|
+
let n = await Bp(e, "endpoint list", {
|
|
9508
|
+
endpoint: Np,
|
|
9509
9509
|
method: "GET",
|
|
9510
9510
|
query: {
|
|
9511
9511
|
limit: 100,
|
|
9512
9512
|
...t == null ? {} : { starting_after: t }
|
|
9513
9513
|
}
|
|
9514
9514
|
});
|
|
9515
|
-
|
|
9516
|
-
let r =
|
|
9515
|
+
Vp(n, "endpoint list");
|
|
9516
|
+
let r = Jp(n.data), i = Array.isArray(r?.data) ? r.data : [];
|
|
9517
9517
|
for (let t of i) {
|
|
9518
|
-
let n =
|
|
9518
|
+
let n = Jp(t);
|
|
9519
9519
|
if (n?.url === e.endpointUrl && typeof n.id == "string") return n.id;
|
|
9520
9520
|
}
|
|
9521
|
-
let a =
|
|
9521
|
+
let a = Jp(i.at(-1))?.id;
|
|
9522
9522
|
if (r?.has_more !== !0 || typeof a != "string") return null;
|
|
9523
9523
|
t = a;
|
|
9524
9524
|
}
|
|
9525
9525
|
return null;
|
|
9526
9526
|
}
|
|
9527
|
-
async function
|
|
9527
|
+
async function Bp(t, r, i) {
|
|
9528
9528
|
try {
|
|
9529
9529
|
return await t.connector.execute(i, t.signal);
|
|
9530
9530
|
} catch (t) {
|
|
9531
9531
|
throw t instanceof e ? t : new n(`Stripe ${r} request failed.`, { cause: t });
|
|
9532
9532
|
}
|
|
9533
9533
|
}
|
|
9534
|
-
function
|
|
9534
|
+
function Vp(r, i) {
|
|
9535
9535
|
if (!(r.status >= 200 && r.status < 300)) {
|
|
9536
9536
|
if (r.status == 401 || r.status == 403) throw new e(`Stripe ${i} rejected the Connection.`);
|
|
9537
9537
|
if (r.status == 400 || r.status == 404) {
|
|
9538
|
-
let e =
|
|
9538
|
+
let e = Jp(Jp(r.data)?.error)?.message;
|
|
9539
9539
|
throw new t(`Stripe ${i} rejected the subscription${typeof e == "string" ? `: ${e}` : "."}`);
|
|
9540
9540
|
}
|
|
9541
9541
|
throw new n(`Stripe ${i} failed with status ${r.status}.`);
|
|
9542
9542
|
}
|
|
9543
9543
|
}
|
|
9544
|
-
function
|
|
9545
|
-
let t =
|
|
9544
|
+
function Hp(e) {
|
|
9545
|
+
let t = Jp(e);
|
|
9546
9546
|
if (typeof t?.id != "string" || typeof t.secret != "string" || t.secret.length == 0) throw new n("Stripe endpoint response is missing its ID or signing secret.");
|
|
9547
9547
|
return {
|
|
9548
9548
|
id: t.id,
|
|
9549
9549
|
secret: t.secret
|
|
9550
9550
|
};
|
|
9551
9551
|
}
|
|
9552
|
-
function
|
|
9552
|
+
function Up(e) {
|
|
9553
9553
|
if (e == null) throw new t("Stripe Integration state is missing.");
|
|
9554
9554
|
return e;
|
|
9555
9555
|
}
|
|
9556
|
-
function
|
|
9556
|
+
function Wp(e) {
|
|
9557
9557
|
let t = e.subscription.endpointId;
|
|
9558
9558
|
return typeof t == "string" && t.length > 0 ? t : null;
|
|
9559
9559
|
}
|
|
9560
|
-
function
|
|
9560
|
+
function Gp(e) {
|
|
9561
9561
|
let t = e?.subscription.signingSecret;
|
|
9562
9562
|
return typeof t == "string" && t.length > 0 ? t : null;
|
|
9563
9563
|
}
|
|
9564
|
-
async function
|
|
9564
|
+
async function Kp(e, t, n, r) {
|
|
9565
9565
|
if (e == null) return !1;
|
|
9566
9566
|
let i = e.split(",").map((e) => e.trim().split("=", 2)), a = i.find(([e]) => e == "t")?.[1];
|
|
9567
9567
|
if (a == null || !/^\d+$/.test(a)) return !1;
|
|
9568
9568
|
let o = Number(a);
|
|
9569
|
-
if (!Number.isSafeInteger(o) || Math.abs(Math.floor(r.getTime() / 1e3) - o) >
|
|
9569
|
+
if (!Number.isSafeInteger(o) || Math.abs(Math.floor(r.getTime() / 1e3) - o) > Mp) return !1;
|
|
9570
9570
|
let s = i.filter(([e, t]) => e == "v1" && t != null).map(([, e]) => e), c = [Te(`${a}.`), n];
|
|
9571
9571
|
return (await Promise.all(s.map((e) => Oe(t, c, e)))).some(Boolean);
|
|
9572
9572
|
}
|
|
9573
|
-
function
|
|
9573
|
+
function qp(e) {
|
|
9574
9574
|
return new Date(e.getTime() + 2592e6);
|
|
9575
9575
|
}
|
|
9576
|
-
function
|
|
9576
|
+
function Jp(e) {
|
|
9577
9577
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
9578
9578
|
}
|
|
9579
9579
|
//#endregion
|
|
9580
9580
|
//#region src/trigger/providers/telegram/on-update.ts
|
|
9581
|
-
var
|
|
9581
|
+
var Yp = /* @__PURE__ */ new Set([
|
|
9582
9582
|
"chat_member",
|
|
9583
9583
|
"message_reaction",
|
|
9584
9584
|
"message_reaction_count"
|
|
9585
|
-
]),
|
|
9585
|
+
]), Xp = /* @__PURE__ */ "*.message.edited_message.channel_post.edited_channel_post.business_connection.business_message.edited_business_message.deleted_business_messages.guest_message.message_reaction.message_reaction_count.inline_query.chosen_inline_result.callback_query.shipping_query.pre_checkout_query.purchased_paid_media.poll.poll_answer.my_chat_member.chat_member.chat_join_request.chat_boost.removed_chat_boost.managed_bot.subscription".split("."), Zp = Xp.filter((e) => e != "*" && !Yp.has(e)), Qp = {
|
|
9586
9586
|
snapshot: {
|
|
9587
9587
|
configSchema: {
|
|
9588
9588
|
additionalProperties: !1,
|
|
@@ -9606,7 +9606,7 @@ var Jp = /* @__PURE__ */ new Set([
|
|
|
9606
9606
|
},
|
|
9607
9607
|
updates: {
|
|
9608
9608
|
description: "Telegram update types that trigger a Run. Use * for the Telegram default set.",
|
|
9609
|
-
items: { enum:
|
|
9609
|
+
items: { enum: Xp },
|
|
9610
9610
|
minItems: 1,
|
|
9611
9611
|
type: "array",
|
|
9612
9612
|
uniqueItems: !0
|
|
@@ -9664,13 +9664,13 @@ var Jp = /* @__PURE__ */ new Set([
|
|
|
9664
9664
|
type: "integration"
|
|
9665
9665
|
},
|
|
9666
9666
|
receive(e) {
|
|
9667
|
-
if (!
|
|
9667
|
+
if (!tm(e.header("x-telegram-bot-api-secret-token"), e.callbackSecret)) return {
|
|
9668
9668
|
body: "",
|
|
9669
9669
|
contentType: "text/plain",
|
|
9670
9670
|
outcome: "respond",
|
|
9671
9671
|
status: 404
|
|
9672
9672
|
};
|
|
9673
|
-
if (!
|
|
9673
|
+
if (!nm(e.payload) || !Number.isSafeInteger(e.payload.update_id)) return {
|
|
9674
9674
|
outcome: "ignored",
|
|
9675
9675
|
reason: "Telegram update_id is missing."
|
|
9676
9676
|
};
|
|
@@ -9679,21 +9679,21 @@ var Jp = /* @__PURE__ */ new Set([
|
|
|
9679
9679
|
outcome: "ignored",
|
|
9680
9680
|
reason: "Telegram update body is missing."
|
|
9681
9681
|
};
|
|
9682
|
-
let n =
|
|
9683
|
-
if (!(
|
|
9682
|
+
let n = $p(e.config);
|
|
9683
|
+
if (!(em(n) ?? Zp).includes(t)) return {
|
|
9684
9684
|
outcome: "ignored",
|
|
9685
9685
|
reason: "Telegram update type is not subscribed."
|
|
9686
9686
|
};
|
|
9687
9687
|
let r = e.payload[t];
|
|
9688
9688
|
if (n.chatIds.length > 0) {
|
|
9689
|
-
let e =
|
|
9689
|
+
let e = im(r);
|
|
9690
9690
|
if (e == null || !n.chatIds.includes(e)) return {
|
|
9691
9691
|
outcome: "ignored",
|
|
9692
9692
|
reason: "Telegram chat does not match."
|
|
9693
9693
|
};
|
|
9694
9694
|
}
|
|
9695
9695
|
if (n.userIds.length > 0) {
|
|
9696
|
-
let e =
|
|
9696
|
+
let e = am(r);
|
|
9697
9697
|
if (e == null || !n.userIds.includes(e)) return {
|
|
9698
9698
|
outcome: "ignored",
|
|
9699
9699
|
reason: "Telegram user does not match."
|
|
@@ -9711,19 +9711,19 @@ var Jp = /* @__PURE__ */ new Set([
|
|
|
9711
9711
|
};
|
|
9712
9712
|
},
|
|
9713
9713
|
async reconcile(e) {
|
|
9714
|
-
let n = await
|
|
9715
|
-
if (!e.active) return n == e.endpointUrl && await
|
|
9716
|
-
if (n != "" && n != e.endpointUrl) throw new t(`The Telegram bot already sends updates to ${
|
|
9717
|
-
let r =
|
|
9718
|
-
return await
|
|
9719
|
-
allowed_updates:
|
|
9714
|
+
let n = await om(e);
|
|
9715
|
+
if (!e.active) return n == e.endpointUrl && await sm(e), { outcome: "ready" };
|
|
9716
|
+
if (n != "" && n != e.endpointUrl) throw new t(`The Telegram bot already sends updates to ${lm(n)}.`);
|
|
9717
|
+
let r = $p(e.config);
|
|
9718
|
+
return await cm(e, "setWebhook", {
|
|
9719
|
+
allowed_updates: em(r) ?? [],
|
|
9720
9720
|
drop_pending_updates: n == "" && r.dropPendingUpdates,
|
|
9721
9721
|
secret_token: e.callbackSecret,
|
|
9722
9722
|
url: e.endpointUrl
|
|
9723
9723
|
}), { outcome: "ready" };
|
|
9724
9724
|
}
|
|
9725
9725
|
};
|
|
9726
|
-
function
|
|
9726
|
+
function $p(e) {
|
|
9727
9727
|
return {
|
|
9728
9728
|
chatIds: e.chatIds ?? [],
|
|
9729
9729
|
dropPendingUpdates: e.dropPendingUpdates ?? !0,
|
|
@@ -9731,38 +9731,38 @@ function Qp(e) {
|
|
|
9731
9731
|
userIds: e.userIds ?? []
|
|
9732
9732
|
};
|
|
9733
9733
|
}
|
|
9734
|
-
function
|
|
9734
|
+
function em(e) {
|
|
9735
9735
|
if (!e.updates.includes("*")) return e.updates;
|
|
9736
9736
|
let t = e.updates.filter((e) => e != "*");
|
|
9737
|
-
return t.length == 0 ? null : [.../* @__PURE__ */ new Set([...
|
|
9737
|
+
return t.length == 0 ? null : [.../* @__PURE__ */ new Set([...Zp, ...t])];
|
|
9738
9738
|
}
|
|
9739
|
-
function
|
|
9739
|
+
function tm(e, t) {
|
|
9740
9740
|
if (e == null || e.length != t.length) return !1;
|
|
9741
9741
|
let n = 0;
|
|
9742
9742
|
for (let r = 0; r < t.length; r += 1) n |= e.charCodeAt(r) ^ t.charCodeAt(r);
|
|
9743
9743
|
return n == 0;
|
|
9744
9744
|
}
|
|
9745
|
-
function tm(e) {
|
|
9746
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
9747
|
-
}
|
|
9748
9745
|
function nm(e) {
|
|
9749
|
-
|
|
9746
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
9750
9747
|
}
|
|
9751
9748
|
function rm(e) {
|
|
9752
|
-
if (
|
|
9749
|
+
if (nm(e)) return typeof e.id == "string" || typeof e.id == "number" ? String(e.id) : void 0;
|
|
9753
9750
|
}
|
|
9754
9751
|
function im(e) {
|
|
9755
|
-
if (
|
|
9752
|
+
if (nm(e)) return rm(e.chat) ?? (nm(e.message) ? rm(e.message.chat) : void 0);
|
|
9756
9753
|
}
|
|
9757
|
-
|
|
9758
|
-
|
|
9754
|
+
function am(e) {
|
|
9755
|
+
if (nm(e)) return rm(e.from) ?? rm(e.user);
|
|
9756
|
+
}
|
|
9757
|
+
async function om(e) {
|
|
9758
|
+
let t = await cm(e, "getWebhookInfo"), r = nm(t.result) ? t.result.url : void 0;
|
|
9759
9759
|
if (typeof r != "string") throw new n("Telegram getWebhookInfo response is missing result.url.");
|
|
9760
9760
|
return r;
|
|
9761
9761
|
}
|
|
9762
|
-
async function
|
|
9763
|
-
await
|
|
9762
|
+
async function sm(e) {
|
|
9763
|
+
await cm(e, "deleteWebhook", { drop_pending_updates: !1 });
|
|
9764
9764
|
}
|
|
9765
|
-
async function
|
|
9765
|
+
async function cm(r, i, a) {
|
|
9766
9766
|
let o;
|
|
9767
9767
|
try {
|
|
9768
9768
|
o = await r.connector.execute({
|
|
@@ -9773,19 +9773,19 @@ async function sm(r, i, a) {
|
|
|
9773
9773
|
} catch (t) {
|
|
9774
9774
|
throw t instanceof e ? t : new n(`Telegram ${i} request failed.`, { cause: t });
|
|
9775
9775
|
}
|
|
9776
|
-
let s =
|
|
9776
|
+
let s = nm(o.data) ? o.data : {};
|
|
9777
9777
|
if (o.status >= 200 && o.status < 300 && s.ok === !0) return s;
|
|
9778
9778
|
let c = typeof s.description == "string" ? s.description : `HTTP ${o.status}`;
|
|
9779
9779
|
throw o.status == 401 || o.status == 403 ? new e(`Telegram ${i} rejected the Connection.`) : o.status >= 400 && o.status < 500 && o.status != 429 ? new t(`Telegram ${i} rejected the subscription: ${c}`) : new n(`Telegram ${i} failed: ${c}`);
|
|
9780
9780
|
}
|
|
9781
|
-
function
|
|
9781
|
+
function lm(e) {
|
|
9782
9782
|
try {
|
|
9783
9783
|
return new URL(e).host;
|
|
9784
9784
|
} catch {
|
|
9785
9785
|
return "an invalid URL";
|
|
9786
9786
|
}
|
|
9787
9787
|
}
|
|
9788
|
-
var
|
|
9788
|
+
var um = {
|
|
9789
9789
|
initialState: {
|
|
9790
9790
|
checkpoint: null,
|
|
9791
9791
|
subscription: {}
|
|
@@ -9888,7 +9888,7 @@ var lm = {
|
|
|
9888
9888
|
outcome: "ignored",
|
|
9889
9889
|
reason: "WooCommerce topic header is missing."
|
|
9890
9890
|
};
|
|
9891
|
-
if (!
|
|
9891
|
+
if (!dm(e.config).events.includes(t)) return {
|
|
9892
9892
|
outcome: "ignored",
|
|
9893
9893
|
reason: "WooCommerce topic is not subscribed."
|
|
9894
9894
|
};
|
|
@@ -9908,31 +9908,31 @@ var lm = {
|
|
|
9908
9908
|
};
|
|
9909
9909
|
},
|
|
9910
9910
|
async reconcile(e) {
|
|
9911
|
-
let t =
|
|
9911
|
+
let t = Sm(e.state), n = dm(e.config), r = await mm(e);
|
|
9912
9912
|
if (!e.active) {
|
|
9913
|
-
for (let t of r) await
|
|
9914
|
-
return await t.saveSubscription({},
|
|
9913
|
+
for (let t of r) await hm(e, t.id);
|
|
9914
|
+
return await t.saveSubscription({}, Cm(e.now)), { outcome: "ready" };
|
|
9915
9915
|
}
|
|
9916
9916
|
let i = /* @__PURE__ */ new Map();
|
|
9917
9917
|
for (let e of r) n.events.includes(e.topic) && !i.has(e.topic) && i.set(e.topic, e.id);
|
|
9918
9918
|
let a = new Set(i.values());
|
|
9919
|
-
for (let t of r) a.has(t.id) || await
|
|
9919
|
+
for (let t of r) a.has(t.id) || await hm(e, t.id);
|
|
9920
9920
|
let o = [];
|
|
9921
9921
|
for (let t of n.events) {
|
|
9922
9922
|
let r = i.get(t);
|
|
9923
|
-
o.push(r == null ? await
|
|
9923
|
+
o.push(r == null ? await fm(e, n, t) : await pm(e, r, t));
|
|
9924
9924
|
}
|
|
9925
|
-
return await t.saveSubscription({ webhookIds: o },
|
|
9925
|
+
return await t.saveSubscription({ webhookIds: o }, Cm(e.now)), { outcome: "ready" };
|
|
9926
9926
|
}
|
|
9927
9927
|
};
|
|
9928
|
-
function
|
|
9928
|
+
function dm(e) {
|
|
9929
9929
|
return {
|
|
9930
9930
|
events: [...new Set(e.events)],
|
|
9931
9931
|
webhookName: e.webhookName ?? "OOMOL Trigger"
|
|
9932
9932
|
};
|
|
9933
9933
|
}
|
|
9934
|
-
async function
|
|
9935
|
-
let r = await
|
|
9934
|
+
async function fm(e, t, n) {
|
|
9935
|
+
let r = await gm(e, `webhook create (${n})`, {
|
|
9936
9936
|
body: {
|
|
9937
9937
|
delivery_url: e.endpointUrl,
|
|
9938
9938
|
name: `${t.webhookName} - ${n}`,
|
|
@@ -9942,10 +9942,10 @@ async function dm(e, t, n) {
|
|
|
9942
9942
|
endpoint: "/webhooks",
|
|
9943
9943
|
method: "POST"
|
|
9944
9944
|
});
|
|
9945
|
-
return
|
|
9945
|
+
return _m(r, `webhook create (${n})`), bm(r.data);
|
|
9946
9946
|
}
|
|
9947
|
-
async function
|
|
9948
|
-
let r = await
|
|
9947
|
+
async function pm(e, t, n) {
|
|
9948
|
+
let r = await gm(e, `webhook update (${n})`, {
|
|
9949
9949
|
body: {
|
|
9950
9950
|
delivery_url: e.endpointUrl,
|
|
9951
9951
|
secret: e.callbackSecret,
|
|
@@ -9955,12 +9955,12 @@ async function fm(e, t, n) {
|
|
|
9955
9955
|
endpoint: `/webhooks/${t}`,
|
|
9956
9956
|
method: "PUT"
|
|
9957
9957
|
});
|
|
9958
|
-
return
|
|
9958
|
+
return vm(r) ? fm(e, dm(e.config), n) : (_m(r, `webhook update (${n})`), t);
|
|
9959
9959
|
}
|
|
9960
|
-
async function
|
|
9960
|
+
async function mm(e) {
|
|
9961
9961
|
let t = [];
|
|
9962
9962
|
for (let n = 1; n <= 10; n += 1) {
|
|
9963
|
-
let r = await
|
|
9963
|
+
let r = await gm(e, "webhook list", {
|
|
9964
9964
|
endpoint: "/webhooks",
|
|
9965
9965
|
method: "GET",
|
|
9966
9966
|
query: {
|
|
@@ -9970,12 +9970,12 @@ async function pm(e) {
|
|
|
9970
9970
|
status: "all"
|
|
9971
9971
|
}
|
|
9972
9972
|
});
|
|
9973
|
-
|
|
9973
|
+
_m(r, "webhook list");
|
|
9974
9974
|
let i = Array.isArray(r.data) ? r.data : [];
|
|
9975
9975
|
for (let n of i) {
|
|
9976
|
-
let r =
|
|
9976
|
+
let r = wm(n);
|
|
9977
9977
|
if (r?.delivery_url !== e.endpointUrl || typeof r.topic != "string") continue;
|
|
9978
|
-
let i =
|
|
9978
|
+
let i = xm(r.id);
|
|
9979
9979
|
i != null && t.push({
|
|
9980
9980
|
id: i,
|
|
9981
9981
|
topic: r.topic
|
|
@@ -9985,54 +9985,54 @@ async function pm(e) {
|
|
|
9985
9985
|
}
|
|
9986
9986
|
throw new n("WooCommerce webhook list did not finish within ten pages.");
|
|
9987
9987
|
}
|
|
9988
|
-
async function
|
|
9989
|
-
let n = await
|
|
9988
|
+
async function hm(e, t) {
|
|
9989
|
+
let n = await gm(e, "webhook delete", {
|
|
9990
9990
|
endpoint: `/webhooks/${t}`,
|
|
9991
9991
|
method: "DELETE",
|
|
9992
9992
|
query: { force: "true" }
|
|
9993
9993
|
});
|
|
9994
|
-
n.status != 404 &&
|
|
9994
|
+
n.status != 404 && _m(n, "webhook delete");
|
|
9995
9995
|
}
|
|
9996
|
-
async function
|
|
9996
|
+
async function gm(t, r, i) {
|
|
9997
9997
|
try {
|
|
9998
9998
|
return await t.connector.execute(i, t.signal);
|
|
9999
9999
|
} catch (t) {
|
|
10000
10000
|
throw t instanceof e ? t : new n(`WooCommerce ${r} request failed.`, { cause: t });
|
|
10001
10001
|
}
|
|
10002
10002
|
}
|
|
10003
|
-
function
|
|
10003
|
+
function _m(r, i) {
|
|
10004
10004
|
if (r.status >= 200 && r.status < 300) return;
|
|
10005
|
-
let a =
|
|
10005
|
+
let a = ym(r.data);
|
|
10006
10006
|
throw r.status == 401 || r.status == 403 ? new e(`WooCommerce ${i} rejected the Connection.`) : r.status == 404 || r.status == 400 && (a.endsWith("_invalid_topic") || a.endsWith("_invalid_delivery_url")) || r.status == 501 && a == "woocommerce_rest_trash_not_supported" ? new t(`WooCommerce ${i} rejected the subscription.`) : new n(`WooCommerce ${i} failed with status ${r.status}.`);
|
|
10007
10007
|
}
|
|
10008
|
-
function _m(e) {
|
|
10009
|
-
return e.status == 400 && vm(e.data) == "woocommerce_rest_webhook_invalid_id";
|
|
10010
|
-
}
|
|
10011
10008
|
function vm(e) {
|
|
10012
|
-
|
|
10013
|
-
return typeof t == "string" ? t : "";
|
|
10009
|
+
return e.status == 400 && ym(e.data) == "woocommerce_rest_webhook_invalid_id";
|
|
10014
10010
|
}
|
|
10015
10011
|
function ym(e) {
|
|
10016
|
-
let t =
|
|
10012
|
+
let t = wm(e)?.code;
|
|
10013
|
+
return typeof t == "string" ? t : "";
|
|
10014
|
+
}
|
|
10015
|
+
function bm(e) {
|
|
10016
|
+
let t = xm(wm(e)?.id);
|
|
10017
10017
|
if (t == null) throw new n("WooCommerce webhook response is missing its ID.");
|
|
10018
10018
|
return t;
|
|
10019
10019
|
}
|
|
10020
|
-
function
|
|
10020
|
+
function xm(e) {
|
|
10021
10021
|
return typeof e == "string" && e.length > 0 ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : null;
|
|
10022
10022
|
}
|
|
10023
|
-
function
|
|
10023
|
+
function Sm(e) {
|
|
10024
10024
|
if (e == null) throw new t("WooCommerce Integration state is missing.");
|
|
10025
10025
|
return e;
|
|
10026
10026
|
}
|
|
10027
|
-
function
|
|
10027
|
+
function Cm(e) {
|
|
10028
10028
|
return new Date(e.getTime() + 2592e6);
|
|
10029
10029
|
}
|
|
10030
|
-
function
|
|
10030
|
+
function wm(e) {
|
|
10031
10031
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
10032
10032
|
}
|
|
10033
10033
|
//#endregion
|
|
10034
10034
|
//#region src/trigger/providers/zendesk/on-event.ts
|
|
10035
|
-
var
|
|
10035
|
+
var Tm = 3e5, Em = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_changed,zen:event-type:ticket.attachment_linked_to_comment,zen:event-type:ticket.attachment_redacted_from_comment,zen:event-type:ticket.brand_changed,zen:event-type:ticket.comment_added,zen:event-type:ticket.comment_made_private,zen:event-type:ticket.comment_redacted,zen:event-type:ticket.created,zen:event-type:ticket.csat_received,zen:event-type:ticket.csat_requested,zen:event-type:ticket.custom_field_changed,zen:event-type:ticket.custom_status_changed,zen:event-type:ticket.description_changed,zen:event-type:ticket.email_ccs_changed,zen:event-type:ticket.external_id_changed,zen:event-type:ticket.followers_changed,zen:event-type:ticket.form_changed,zen:event-type:ticket.group_assignment_changed,zen:event-type:ticket.marked_as_spam,zen:event-type:ticket.merged,zen:event-type:ticket.next_sla_breach_changed,zen:event-type:ticket.ola_policy_changed,zen:event-type:ticket.organization_changed,zen:event-type:ticket.permanently_deleted,zen:event-type:ticket.priority_changed,zen:event-type:ticket.problem_link_changed,zen:event-type:ticket.requester_changed,zen:event-type:ticket.schedule_changed,zen:event-type:ticket.sla_policy_changed,zen:event-type:ticket.soft_deleted,zen:event-type:ticket.status_changed,zen:event-type:ticket.subject_changed,zen:event-type:ticket.submitter_changed,zen:event-type:ticket.tags_changed,zen:event-type:ticket.task_due_at_changed,zen:event-type:ticket.type_changed,zen:event-type:ticket.undeleted,zen:event-type:organization.created,zen:event-type:organization.custom_field_changed,zen:event-type:organization.deleted,zen:event-type:organization.external_id_changed,zen:event-type:organization.name_changed,zen:event-type:organization.tags_changed,zen:event-type:user.active_changed,zen:event-type:user.alias_changed,zen:event-type:user.created,zen:event-type:user.custom_field_changed,zen:event-type:user.custom_role_changed,zen:event-type:user.default_group_changed,zen:event-type:user.deleted,zen:event-type:user.details_changed,zen:event-type:user.external_id_changed,zen:event-type:user.group_membership_created,zen:event-type:user.group_membership_deleted,zen:event-type:user.identity_changed,zen:event-type:user.identity_created,zen:event-type:user.identity_deleted,zen:event-type:user.last_login_changed,zen:event-type:user.merged,zen:event-type:user.name_changed,zen:event-type:user.notes_changed,zen:event-type:user.only_private_comments_changed,zen:event-type:user.organization_membership_created,zen:event-type:user.organization_membership_deleted,zen:event-type:user.password_changed,zen:event-type:user.photo_changed,zen:event-type:user.role_changed,zen:event-type:user.suspended_changed,zen:event-type:user.tags_changed,zen:event-type:user.time_zone_changed".split(","), Dm = "/api/v2/webhooks", Om = {
|
|
10036
10036
|
initialState: {
|
|
10037
10037
|
checkpoint: null,
|
|
10038
10038
|
subscription: {}
|
|
@@ -10042,7 +10042,7 @@ var wm = 3e5, Tm = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_chang
|
|
|
10042
10042
|
additionalProperties: !1,
|
|
10043
10043
|
properties: { events: {
|
|
10044
10044
|
items: {
|
|
10045
|
-
enum:
|
|
10045
|
+
enum: Em,
|
|
10046
10046
|
type: "string"
|
|
10047
10047
|
},
|
|
10048
10048
|
minItems: 1,
|
|
@@ -10091,8 +10091,8 @@ var wm = 3e5, Tm = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_chang
|
|
|
10091
10091
|
type: "integration"
|
|
10092
10092
|
},
|
|
10093
10093
|
async receive(e) {
|
|
10094
|
-
let t =
|
|
10095
|
-
if (t == null || n == null || !Number.isFinite(r) || Math.abs(e.now.getTime() - r) >
|
|
10094
|
+
let t = Rm(e.state), n = e.header("x-zendesk-webhook-signature-timestamp"), r = n == null ? NaN : Date.parse(n);
|
|
10095
|
+
if (t == null || n == null || !Number.isFinite(r) || Math.abs(e.now.getTime() - r) > Tm || !await De(t, [Te(n), e.rawBody], e.header("x-zendesk-webhook-signature"))) return {
|
|
10096
10096
|
body: "",
|
|
10097
10097
|
contentType: "text/plain",
|
|
10098
10098
|
outcome: "respond",
|
|
@@ -10124,148 +10124,148 @@ var wm = 3e5, Tm = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_chang
|
|
|
10124
10124
|
};
|
|
10125
10125
|
},
|
|
10126
10126
|
async reconcile(e) {
|
|
10127
|
-
let t =
|
|
10127
|
+
let t = Im(e.state), n = await Am(e), r = Lm(t);
|
|
10128
10128
|
if (!e.active) {
|
|
10129
|
-
for (let t of r == null ? n : [.../* @__PURE__ */ new Set([r, ...n])]) await
|
|
10130
|
-
return await t.saveSubscription({},
|
|
10129
|
+
for (let t of r == null ? n : [.../* @__PURE__ */ new Set([r, ...n])]) await jm(e, t);
|
|
10130
|
+
return await t.saveSubscription({}, Bm(e.now)), { outcome: "ready" };
|
|
10131
10131
|
}
|
|
10132
10132
|
let i = r ?? n[0];
|
|
10133
10133
|
if (i == null) {
|
|
10134
|
-
let t = await
|
|
10135
|
-
body:
|
|
10136
|
-
endpoint:
|
|
10134
|
+
let t = await Mm(e, "webhook create", {
|
|
10135
|
+
body: km(e),
|
|
10136
|
+
endpoint: Dm,
|
|
10137
10137
|
method: "POST"
|
|
10138
10138
|
});
|
|
10139
|
-
|
|
10139
|
+
Nm(t, "webhook create"), i = Fm(Vm(t.data)?.webhook);
|
|
10140
10140
|
} else {
|
|
10141
|
-
let n = await
|
|
10142
|
-
body:
|
|
10143
|
-
endpoint: `${
|
|
10141
|
+
let n = await Mm(e, "webhook update", {
|
|
10142
|
+
body: km(e),
|
|
10143
|
+
endpoint: `${Dm}/${i}`,
|
|
10144
10144
|
method: "PUT"
|
|
10145
10145
|
});
|
|
10146
10146
|
if (n.status == 404) return await t.saveSubscription({}, e.now), { outcome: "pending" };
|
|
10147
|
-
|
|
10147
|
+
Nm(n, "webhook update");
|
|
10148
10148
|
}
|
|
10149
|
-
for (let t of n.filter((e) => e != i)) await
|
|
10149
|
+
for (let t of n.filter((e) => e != i)) await jm(e, t);
|
|
10150
10150
|
return await t.saveSubscription({
|
|
10151
|
-
signingSecret: await
|
|
10151
|
+
signingSecret: await zm(e, i),
|
|
10152
10152
|
webhookId: i
|
|
10153
|
-
},
|
|
10153
|
+
}, Bm(e.now)), { outcome: "ready" };
|
|
10154
10154
|
}
|
|
10155
10155
|
};
|
|
10156
|
-
function
|
|
10156
|
+
function km(e) {
|
|
10157
10157
|
return { webhook: {
|
|
10158
10158
|
description: "Managed by Open Flow. Do not edit.",
|
|
10159
10159
|
endpoint: e.endpointUrl,
|
|
10160
10160
|
http_method: "POST",
|
|
10161
|
-
name:
|
|
10161
|
+
name: Pm(e.endpointUrl),
|
|
10162
10162
|
request_format: "json",
|
|
10163
10163
|
status: "active",
|
|
10164
10164
|
subscriptions: [...new Set(e.config.events)]
|
|
10165
10165
|
} };
|
|
10166
10166
|
}
|
|
10167
|
-
async function
|
|
10167
|
+
async function Am(e) {
|
|
10168
10168
|
let t = [], n;
|
|
10169
10169
|
for (let r = 0; r < 10; r += 1) {
|
|
10170
|
-
let r = await
|
|
10171
|
-
endpoint:
|
|
10170
|
+
let r = await Mm(e, "webhook list", {
|
|
10171
|
+
endpoint: Dm,
|
|
10172
10172
|
method: "GET",
|
|
10173
10173
|
query: {
|
|
10174
|
-
"filter[name_contains]":
|
|
10174
|
+
"filter[name_contains]": Pm(e.endpointUrl),
|
|
10175
10175
|
"page[size]": "100",
|
|
10176
10176
|
...n == null ? {} : { "page[after]": n }
|
|
10177
10177
|
}
|
|
10178
10178
|
});
|
|
10179
|
-
|
|
10180
|
-
let i =
|
|
10179
|
+
Nm(r, "webhook list");
|
|
10180
|
+
let i = Vm(r.data), a = Array.isArray(i?.webhooks) ? i.webhooks : [];
|
|
10181
10181
|
for (let n of a) {
|
|
10182
|
-
let r =
|
|
10182
|
+
let r = Vm(n);
|
|
10183
10183
|
r?.endpoint === e.endpointUrl && typeof r.id == "string" && t.push(r.id);
|
|
10184
10184
|
}
|
|
10185
|
-
let o =
|
|
10185
|
+
let o = Vm(i?.meta);
|
|
10186
10186
|
if (o?.has_more !== !0 || typeof o.after_cursor != "string") return t;
|
|
10187
10187
|
n = o.after_cursor;
|
|
10188
10188
|
}
|
|
10189
10189
|
return t;
|
|
10190
10190
|
}
|
|
10191
|
-
async function
|
|
10192
|
-
let n = await
|
|
10193
|
-
endpoint: `${
|
|
10191
|
+
async function jm(e, t) {
|
|
10192
|
+
let n = await Mm(e, "webhook delete", {
|
|
10193
|
+
endpoint: `${Dm}/${t}`,
|
|
10194
10194
|
method: "DELETE"
|
|
10195
10195
|
});
|
|
10196
|
-
n.status != 404 &&
|
|
10196
|
+
n.status != 404 && Nm(n, "webhook delete");
|
|
10197
10197
|
}
|
|
10198
|
-
async function
|
|
10198
|
+
async function Mm(t, r, i) {
|
|
10199
10199
|
try {
|
|
10200
10200
|
return await t.connector.execute(i, t.signal);
|
|
10201
10201
|
} catch (t) {
|
|
10202
10202
|
throw t instanceof e ? t : new n(`Zendesk ${r} request failed.`, { cause: t });
|
|
10203
10203
|
}
|
|
10204
10204
|
}
|
|
10205
|
-
function
|
|
10205
|
+
function Nm(r, i) {
|
|
10206
10206
|
if (!(r.status >= 200 && r.status < 300)) throw r.status == 401 || r.status == 403 ? new e(`Zendesk ${i} rejected the Connection.`) : [
|
|
10207
10207
|
400,
|
|
10208
10208
|
404,
|
|
10209
10209
|
422
|
|
10210
10210
|
].includes(r.status) ? new t(`Zendesk ${i} rejected the subscription.`) : new n(`Zendesk ${i} failed with status ${r.status}.`);
|
|
10211
10211
|
}
|
|
10212
|
-
function
|
|
10212
|
+
function Pm(e) {
|
|
10213
10213
|
return `open-flow-${e.slice(e.lastIndexOf("/") + 1)}`;
|
|
10214
10214
|
}
|
|
10215
|
-
function
|
|
10216
|
-
let t =
|
|
10215
|
+
function Fm(e) {
|
|
10216
|
+
let t = Vm(e)?.id;
|
|
10217
10217
|
if (typeof t != "string") throw new n("Zendesk webhook response is missing its ID.");
|
|
10218
10218
|
return t;
|
|
10219
10219
|
}
|
|
10220
|
-
function
|
|
10220
|
+
function Im(e) {
|
|
10221
10221
|
if (e == null) throw new t("Zendesk Integration state is missing.");
|
|
10222
10222
|
return e;
|
|
10223
10223
|
}
|
|
10224
|
-
function
|
|
10224
|
+
function Lm(e) {
|
|
10225
10225
|
let t = e.subscription.webhookId;
|
|
10226
10226
|
return typeof t == "string" && t.length > 0 ? t : null;
|
|
10227
10227
|
}
|
|
10228
|
-
function
|
|
10228
|
+
function Rm(e) {
|
|
10229
10229
|
let t = e?.subscription.signingSecret;
|
|
10230
10230
|
return typeof t == "string" && t.length > 0 ? t : null;
|
|
10231
10231
|
}
|
|
10232
|
-
async function
|
|
10233
|
-
let r = await
|
|
10234
|
-
endpoint: `${
|
|
10232
|
+
async function zm(e, t) {
|
|
10233
|
+
let r = await Mm(e, "webhook signing secret", {
|
|
10234
|
+
endpoint: `${Dm}/${t}/signing_secret`,
|
|
10235
10235
|
method: "GET"
|
|
10236
10236
|
});
|
|
10237
|
-
|
|
10238
|
-
let i =
|
|
10237
|
+
Nm(r, "webhook signing secret");
|
|
10238
|
+
let i = Vm(Vm(r.data)?.signing_secret)?.secret;
|
|
10239
10239
|
if (typeof i != "string" || i.length == 0) throw new n("Zendesk webhook signing secret response is invalid.");
|
|
10240
10240
|
return i;
|
|
10241
10241
|
}
|
|
10242
|
-
function
|
|
10242
|
+
function Bm(e) {
|
|
10243
10243
|
return new Date(e.getTime() + 2592e6);
|
|
10244
10244
|
}
|
|
10245
|
-
function
|
|
10245
|
+
function Vm(e) {
|
|
10246
10246
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
10247
10247
|
}
|
|
10248
10248
|
//#endregion
|
|
10249
10249
|
//#region src/trigger/providers/localization.ts
|
|
10250
|
-
var
|
|
10250
|
+
var Hm = {
|
|
10251
10251
|
"zh-CN": () => import("./zh-CN-ByQ6nYam.js"),
|
|
10252
10252
|
"zh-TW": () => import("./zh-TW-QjIarvX9.js"),
|
|
10253
10253
|
ja: () => import("./ja-Bq-ZDOD4.js"),
|
|
10254
10254
|
ko: () => import("./ko-Z-k9R2c6.js"),
|
|
10255
10255
|
ru: () => import("./ru-B4gFecYZ.js"),
|
|
10256
10256
|
fr: () => import("./fr-iv1541dF.js")
|
|
10257
|
-
},
|
|
10258
|
-
function
|
|
10259
|
-
if (e == "en") return
|
|
10260
|
-
let t =
|
|
10257
|
+
}, Um = /* @__PURE__ */ new Map(), Wm = Promise.resolve({});
|
|
10258
|
+
function Gm(e) {
|
|
10259
|
+
if (e == "en") return Wm;
|
|
10260
|
+
let t = Um.get(e);
|
|
10261
10261
|
if (t != null) return t;
|
|
10262
|
-
let n =
|
|
10263
|
-
return
|
|
10264
|
-
|
|
10262
|
+
let n = Hm[e]().then((e) => e.default);
|
|
10263
|
+
return Um.set(e, n), n.catch(() => {
|
|
10264
|
+
Um.get(e) == n && Um.delete(e);
|
|
10265
10265
|
}), n;
|
|
10266
10266
|
}
|
|
10267
|
-
async function
|
|
10268
|
-
let n = (await
|
|
10267
|
+
async function Km(e, t) {
|
|
10268
|
+
let n = (await Gm(t))[e.key];
|
|
10269
10269
|
return {
|
|
10270
10270
|
displayName: n?.displayName ?? e.displayName,
|
|
10271
10271
|
description: n?.description ?? e.description
|
|
@@ -10273,7 +10273,7 @@ async function Gm(e, t) {
|
|
|
10273
10273
|
}
|
|
10274
10274
|
//#endregion
|
|
10275
10275
|
//#region src/trigger/providers/definitions.ts
|
|
10276
|
-
var
|
|
10276
|
+
var qm = [
|
|
10277
10277
|
...f,
|
|
10278
10278
|
h,
|
|
10279
10279
|
Vl,
|
|
@@ -10282,19 +10282,19 @@ var Km = [
|
|
|
10282
10282
|
El,
|
|
10283
10283
|
au,
|
|
10284
10284
|
ku,
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
],
|
|
10285
|
+
Zu,
|
|
10286
|
+
nd,
|
|
10287
|
+
Cd,
|
|
10288
|
+
Wd,
|
|
10289
|
+
Xd,
|
|
10290
|
+
bf,
|
|
10291
|
+
Hf,
|
|
10292
|
+
rp,
|
|
10293
|
+
bp,
|
|
10294
|
+
Fp,
|
|
10295
|
+
Qp,
|
|
10296
|
+
um,
|
|
10297
|
+
Om
|
|
10298
|
+
], Jm = qm.filter((e) => e.snapshot.type == "poll"), Ym = qm.filter((e) => e.snapshot.type == "integration");
|
|
10299
10299
|
//#endregion
|
|
10300
|
-
export { d as feishuResponse, u as feishuSubscriptions,
|
|
10300
|
+
export { d as feishuResponse, u as feishuSubscriptions, Ym as integrationDefinitions, Km as localizeTrigger, ne as matchesFeishuEvent, Jm as pollDefinitions, ee as receiveFeishuEvent, qm as triggerDefinitions };
|