@bpinternal/integration-hub 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/index.js +16990 -1081
- package/dist/details/IntegrationReadmeContent.d.ts +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +16 -14
- package/dist/runtime/BotpressIntegrationHubScreen.d.ts +2 -2
- package/dist/runtime/botpressTypes.d.ts +9 -0
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.js +493 -470
- package/dist/theme.css +28 -0
- package/package.json +5 -1
package/dist/runtime/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Loader2 as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { I as
|
|
5
|
-
import { StaticZuiForm as
|
|
6
|
-
import { useQueryClient as
|
|
1
|
+
import { jsx as b, jsxs as K } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2 as Pt } from "lucide-react";
|
|
3
|
+
import { useState as x, useRef as gt, useEffect as Y, useMemo as E, useCallback as m } from "react";
|
|
4
|
+
import { I as sn, c as ft, u as rn, a as cn, b as ln, d as dn, e as un, f as fn, g as pn, h as gn, i as hn, j as bn, k as vn, l as Cn } from "../chunks/index.js";
|
|
5
|
+
import { StaticZuiForm as wn } from "@bpinternal/static-zui-form";
|
|
6
|
+
import { useQueryClient as Bt, useQuery as Ut, useMutation as _ } from "@tanstack/react-query";
|
|
7
7
|
import "framer-motion";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "tailwind-merge";
|
|
10
10
|
import "@base-ui/react/menu";
|
|
11
|
-
const
|
|
11
|
+
const yn = "width=650,height=800,popup=true", An = 500, In = 5 * 60 * 1e3, Sn = (n) => {
|
|
12
12
|
if (!n)
|
|
13
13
|
return null;
|
|
14
14
|
try {
|
|
@@ -16,7 +16,7 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
16
16
|
} catch {
|
|
17
17
|
return n.split("/").filter(Boolean).at(-1) ?? null;
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, Tn = async ({
|
|
20
20
|
client: n,
|
|
21
21
|
linkTemplateScript: t,
|
|
22
22
|
data: e
|
|
@@ -28,27 +28,27 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
28
28
|
if (typeof i != "string")
|
|
29
29
|
throw new Error("Authorization URL is not a string");
|
|
30
30
|
return i;
|
|
31
|
-
},
|
|
31
|
+
}, On = async ({
|
|
32
32
|
authorizationUrl: n,
|
|
33
33
|
onClose: t,
|
|
34
|
-
popupFeatures: e =
|
|
35
|
-
pollIntervalMs: i =
|
|
36
|
-
timeoutMs: o =
|
|
34
|
+
popupFeatures: e = yn,
|
|
35
|
+
pollIntervalMs: i = An,
|
|
36
|
+
timeoutMs: o = In
|
|
37
37
|
}) => {
|
|
38
38
|
const a = window.open(n, "OAuth", e);
|
|
39
39
|
if (!a)
|
|
40
40
|
return "blocked";
|
|
41
41
|
if (!await new Promise((c) => {
|
|
42
|
-
const
|
|
42
|
+
const r = window.setInterval(() => {
|
|
43
43
|
try {
|
|
44
44
|
if (!a.closed)
|
|
45
45
|
return;
|
|
46
|
-
window.clearInterval(
|
|
46
|
+
window.clearInterval(r), window.clearTimeout(d), c(!0);
|
|
47
47
|
} catch {
|
|
48
|
-
window.clearInterval(
|
|
48
|
+
window.clearInterval(r), window.clearTimeout(d), c(!1);
|
|
49
49
|
}
|
|
50
50
|
}, i), d = window.setTimeout(() => {
|
|
51
|
-
window.clearInterval(
|
|
51
|
+
window.clearInterval(r), a.closed || a.close(), c(!1);
|
|
52
52
|
}, o);
|
|
53
53
|
}))
|
|
54
54
|
return "timeout";
|
|
@@ -57,7 +57,7 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
57
57
|
} catch {
|
|
58
58
|
return "failed";
|
|
59
59
|
}
|
|
60
|
-
},
|
|
60
|
+
}, xn = (n) => n instanceof Error ? n : new Error("OAuth authorization failed"), Mn = ({
|
|
61
61
|
client: n,
|
|
62
62
|
integrationName: t,
|
|
63
63
|
linkTemplateScript: e,
|
|
@@ -66,87 +66,87 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
66
66
|
oauthTemplateData: a,
|
|
67
67
|
isAuthorized: l = !1,
|
|
68
68
|
disabled: c = !1,
|
|
69
|
-
onAuthorized:
|
|
69
|
+
onAuthorized: r,
|
|
70
70
|
onError: d
|
|
71
71
|
}) => {
|
|
72
|
-
const [u, C] =
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
const [u, C] = x(null), [v, y] = x(!1), [M, B] = x(!1), P = i ?? Sn(o), h = !!(i || o), f = gt(d);
|
|
73
|
+
Y(() => {
|
|
74
|
+
f.current = d;
|
|
75
75
|
}, [d]);
|
|
76
|
-
const S =
|
|
76
|
+
const S = E(() => {
|
|
77
77
|
try {
|
|
78
78
|
return JSON.stringify(a ?? {});
|
|
79
79
|
} catch {
|
|
80
80
|
return "{}";
|
|
81
81
|
}
|
|
82
82
|
}, [a]);
|
|
83
|
-
|
|
83
|
+
Y(() => {
|
|
84
84
|
if (!h) {
|
|
85
|
-
C(null),
|
|
85
|
+
C(null), y(!1);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
let
|
|
88
|
+
let p = !1;
|
|
89
89
|
return (async () => {
|
|
90
|
-
var
|
|
90
|
+
var T;
|
|
91
91
|
let k = {};
|
|
92
92
|
try {
|
|
93
93
|
k = JSON.parse(S);
|
|
94
94
|
} catch {
|
|
95
95
|
k = {};
|
|
96
96
|
}
|
|
97
|
-
const
|
|
97
|
+
const N = {
|
|
98
98
|
webhookUrl: o ?? null,
|
|
99
|
-
webhookId:
|
|
99
|
+
webhookId: P,
|
|
100
100
|
...k
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
y(!0);
|
|
103
103
|
try {
|
|
104
|
-
const
|
|
104
|
+
const L = await Tn({
|
|
105
105
|
client: n,
|
|
106
106
|
linkTemplateScript: e,
|
|
107
|
-
data:
|
|
107
|
+
data: N
|
|
108
108
|
});
|
|
109
|
-
|
|
110
|
-
} catch (
|
|
111
|
-
|
|
109
|
+
p || C(L);
|
|
110
|
+
} catch (L) {
|
|
111
|
+
p || (C(null), (T = f.current) == null || T.call(f, xn(L)));
|
|
112
112
|
} finally {
|
|
113
|
-
|
|
113
|
+
p || y(!1);
|
|
114
114
|
}
|
|
115
115
|
})(), () => {
|
|
116
|
-
|
|
116
|
+
p = !0;
|
|
117
117
|
};
|
|
118
|
-
}, [n, h, e, S, o,
|
|
119
|
-
const
|
|
120
|
-
var
|
|
121
|
-
if (!(!u ||
|
|
122
|
-
|
|
118
|
+
}, [n, h, e, S, o, P]);
|
|
119
|
+
const F = h && !!u && !v && !c, H = async () => {
|
|
120
|
+
var p, A, k;
|
|
121
|
+
if (!(!u || M)) {
|
|
122
|
+
B(!0);
|
|
123
123
|
try {
|
|
124
|
-
const
|
|
124
|
+
const N = await On({
|
|
125
125
|
authorizationUrl: u,
|
|
126
|
-
onClose:
|
|
126
|
+
onClose: r
|
|
127
127
|
});
|
|
128
|
-
if (
|
|
128
|
+
if (N === "completed")
|
|
129
129
|
return;
|
|
130
|
-
if (
|
|
131
|
-
(
|
|
130
|
+
if (N === "blocked") {
|
|
131
|
+
(p = f.current) == null || p.call(f, new Error("Please allow browser popups to authorize this integration."));
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
|
-
if (
|
|
135
|
-
(A =
|
|
134
|
+
if (N === "timeout") {
|
|
135
|
+
(A = f.current) == null || A.call(f, new Error("OAuth popup did not close in time. Please close it and try again."));
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
(k =
|
|
138
|
+
(k = f.current) == null || k.call(f, new Error("OAuth authorization finished but refresh failed."));
|
|
139
139
|
} finally {
|
|
140
|
-
|
|
140
|
+
B(!1);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
|
-
return /* @__PURE__ */
|
|
145
|
-
|
|
144
|
+
return /* @__PURE__ */ b(
|
|
145
|
+
sn,
|
|
146
146
|
{
|
|
147
147
|
integrationName: t,
|
|
148
|
-
canAuthorize:
|
|
149
|
-
isAuthorizing:
|
|
148
|
+
canAuthorize: F,
|
|
149
|
+
isAuthorizing: M,
|
|
150
150
|
isAuthorized: l,
|
|
151
151
|
disabled: c,
|
|
152
152
|
showInstallHint: !h,
|
|
@@ -155,38 +155,38 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
);
|
|
158
|
-
},
|
|
158
|
+
}, kt = ({
|
|
159
159
|
definition: n,
|
|
160
160
|
selectedConnectionMethod: t
|
|
161
161
|
}) => {
|
|
162
162
|
var i, o, a;
|
|
163
163
|
const e = t != null ? (o = (i = n.configurations) == null ? void 0 : i[t]) == null ? void 0 : o.schema : (a = n.configuration) == null ? void 0 : a.schema;
|
|
164
164
|
return !e || typeof e != "object" ? null : e;
|
|
165
|
-
},
|
|
165
|
+
}, Lt = (n) => {
|
|
166
166
|
if (!n || typeof n != "object")
|
|
167
167
|
return [];
|
|
168
168
|
const t = n.properties;
|
|
169
169
|
return !t || typeof t != "object" ? [] : Object.keys(t);
|
|
170
|
-
},
|
|
170
|
+
}, lt = (n) => !n || typeof n != "object" || Array.isArray(n) ? {} : n, Mt = (n, t) => {
|
|
171
171
|
if (t.length === 0)
|
|
172
172
|
return {};
|
|
173
173
|
const e = t.filter((i) => Object.prototype.hasOwnProperty.call(n, i)).map((i) => [i, n[i]]);
|
|
174
174
|
return Object.fromEntries(e);
|
|
175
|
-
},
|
|
175
|
+
}, X = (n) => !!n && typeof n == "object" && !Array.isArray(n), pt = (n, t) => {
|
|
176
176
|
if (Object.is(n, t))
|
|
177
177
|
return !0;
|
|
178
178
|
if (Array.isArray(n) || Array.isArray(t))
|
|
179
|
-
return !Array.isArray(n) || !Array.isArray(t) || n.length !== t.length ? !1 : n.every((e, i) =>
|
|
180
|
-
if (
|
|
181
|
-
if (!
|
|
179
|
+
return !Array.isArray(n) || !Array.isArray(t) || n.length !== t.length ? !1 : n.every((e, i) => pt(e, t[i]));
|
|
180
|
+
if (X(n) || X(t)) {
|
|
181
|
+
if (!X(n) || !X(t))
|
|
182
182
|
return !1;
|
|
183
183
|
const e = Object.keys(n), i = Object.keys(t);
|
|
184
184
|
return e.length !== i.length ? !1 : e.every(
|
|
185
|
-
(o) => Object.prototype.hasOwnProperty.call(t, o) &&
|
|
185
|
+
(o) => Object.prototype.hasOwnProperty.call(t, o) && pt(n[o], t[o])
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
188
|
return !1;
|
|
189
|
-
},
|
|
189
|
+
}, Pn = ({
|
|
190
190
|
definition: n,
|
|
191
191
|
installedState: t,
|
|
192
192
|
selectedConnectionMethod: e,
|
|
@@ -194,71 +194,71 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
194
194
|
isSaving: o,
|
|
195
195
|
disabled: a = !1
|
|
196
196
|
}) => {
|
|
197
|
-
const l =
|
|
198
|
-
() =>
|
|
197
|
+
const l = E(
|
|
198
|
+
() => kt({ definition: n, selectedConnectionMethod: e }),
|
|
199
199
|
[n, e]
|
|
200
|
-
), c =
|
|
201
|
-
() =>
|
|
200
|
+
), c = E(() => Lt(l), [l]), r = E(
|
|
201
|
+
() => Mt(lt(t == null ? void 0 : t.configuration), c),
|
|
202
202
|
[t == null ? void 0 : t.configuration, c]
|
|
203
|
-
), d =
|
|
204
|
-
return
|
|
203
|
+
), d = E(() => c.join("\0"), [c]), [u, C] = x({}), [v, y] = x(null), [M, B] = x(0), P = gt(null);
|
|
204
|
+
return Y(() => {
|
|
205
205
|
const h = {
|
|
206
206
|
integrationAlias: (t == null ? void 0 : t.integrationAlias) ?? null,
|
|
207
207
|
configurationType: (t == null ? void 0 : t.configurationType) ?? null,
|
|
208
208
|
schemaKeySignature: d,
|
|
209
|
-
configuration:
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
}, [
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
|
|
209
|
+
configuration: r
|
|
210
|
+
}, f = P.current;
|
|
211
|
+
f && f.integrationAlias === h.integrationAlias && f.configurationType === h.configurationType && f.schemaKeySignature === h.schemaKeySignature && pt(f.configuration, h.configuration) || (P.current = h, C(r), y(null), B((S) => S + 1));
|
|
212
|
+
}, [r, t == null ? void 0 : t.integrationAlias, t == null ? void 0 : t.configurationType, d]), !l || c.length === 0 ? null : /* @__PURE__ */ K("div", { className: "flex flex-col gap-3", children: [
|
|
213
|
+
/* @__PURE__ */ b(
|
|
214
|
+
wn,
|
|
215
215
|
{
|
|
216
216
|
schema: l,
|
|
217
217
|
value: u,
|
|
218
218
|
onChange: (h) => {
|
|
219
|
-
const
|
|
220
|
-
C(
|
|
219
|
+
const f = Mt(lt(h), c);
|
|
220
|
+
C(f);
|
|
221
221
|
},
|
|
222
222
|
onValidation: ({ formValid: h }) => {
|
|
223
|
-
|
|
223
|
+
y(h);
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
|
-
|
|
226
|
+
M
|
|
227
227
|
),
|
|
228
228
|
/* @__PURE__ */ K(
|
|
229
229
|
"button",
|
|
230
230
|
{
|
|
231
231
|
type: "button",
|
|
232
|
-
disabled: a || o ||
|
|
232
|
+
disabled: a || o || v !== !0,
|
|
233
233
|
onClick: () => {
|
|
234
|
-
const h =
|
|
234
|
+
const h = lt(t == null ? void 0 : t.configuration);
|
|
235
235
|
i({
|
|
236
236
|
...h,
|
|
237
237
|
...u
|
|
238
238
|
});
|
|
239
239
|
},
|
|
240
|
-
className:
|
|
240
|
+
className: ft(
|
|
241
241
|
"relative self-end rounded-lg bg-[var(--gray-12)] px-6 py-2 text-sm text-[var(--gray-1)] hover:opacity-90 cursor-pointer",
|
|
242
242
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
243
243
|
),
|
|
244
244
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
o && /* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ b("span", { className: o ? "invisible" : "", children: "Save Configuration" }),
|
|
246
|
+
o && /* @__PURE__ */ b(Pt, { className: "absolute inset-0 m-auto h-4 w-4 animate-spin" })
|
|
247
247
|
]
|
|
248
248
|
}
|
|
249
249
|
)
|
|
250
250
|
] });
|
|
251
|
-
},
|
|
251
|
+
}, Et = "Other", Bn = "team-cloud-services", dt = "sandbox", ut = (n) => n.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_.:/-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (t) => t.toUpperCase()), Un = (n) => n == null ? void 0 : n.replace(/\.$/, ""), Nt = (n) => {
|
|
252
252
|
var t;
|
|
253
253
|
return n && "meta" in n ? ((t = n.meta) == null ? void 0 : t.installs) ?? null : null;
|
|
254
|
-
},
|
|
254
|
+
}, ht = (n) => n instanceof Error ? n : new Error("An unknown error occurred while loading integrations"), Ft = (n) => n === Bn, Dt = (n, t) => {
|
|
255
255
|
var o;
|
|
256
256
|
const e = t == null ? void 0 : t(n);
|
|
257
257
|
if (e)
|
|
258
258
|
return e;
|
|
259
259
|
const i = (o = n.attributes) == null ? void 0 : o.category;
|
|
260
|
-
return typeof i == "string" && i.length > 0 ? i :
|
|
261
|
-
},
|
|
260
|
+
return typeof i == "string" && i.length > 0 ? i : Et;
|
|
261
|
+
}, tt = (n) => n ? Object.entries(n).map(([t, e]) => {
|
|
262
262
|
const i = e;
|
|
263
263
|
return {
|
|
264
264
|
...i,
|
|
@@ -266,17 +266,17 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
266
266
|
name: typeof i.name == "string" && i.name.length > 0 ? i.name : t,
|
|
267
267
|
integrationAlias: t
|
|
268
268
|
};
|
|
269
|
-
}) : [],
|
|
269
|
+
}) : [], bt = ({
|
|
270
270
|
installedIntegrations: n,
|
|
271
271
|
integrationId: t,
|
|
272
272
|
integrationName: e
|
|
273
|
-
}) => n.find((i) => i.id === t) ?? n.find((i) => i.integrationAlias === t) ?? (e ? n.find((i) => i.name === e) : void 0),
|
|
273
|
+
}) => n.find((i) => i.id === t) ?? n.find((i) => i.integrationAlias === t) ?? (e ? n.find((i) => i.name === e) : void 0), kn = ({
|
|
274
274
|
summary: n,
|
|
275
275
|
installedByName: t,
|
|
276
276
|
categoryResolver: e
|
|
277
277
|
}) => {
|
|
278
|
-
var
|
|
279
|
-
const i = t.get(n.name), o =
|
|
278
|
+
var r, d, u;
|
|
279
|
+
const i = t.get(n.name), o = Ft((r = n.ownerWorkspace) == null ? void 0 : r.handle), a = (i == null ? void 0 : i.version) ?? null, l = n.version ?? null, c = a && l ? a !== l : !1;
|
|
280
280
|
return {
|
|
281
281
|
id: n.id,
|
|
282
282
|
installedId: i == null ? void 0 : i.id,
|
|
@@ -284,9 +284,9 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
284
284
|
title: n.title,
|
|
285
285
|
description: n.description,
|
|
286
286
|
iconUrl: n.iconUrl,
|
|
287
|
-
attributes: { category:
|
|
287
|
+
attributes: { category: Dt(n, e) },
|
|
288
288
|
meta: {
|
|
289
|
-
installs:
|
|
289
|
+
installs: Nt(n)
|
|
290
290
|
},
|
|
291
291
|
installed: !!i,
|
|
292
292
|
enabled: i == null ? void 0 : i.enabled,
|
|
@@ -302,13 +302,13 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
302
302
|
version: n.version,
|
|
303
303
|
updatedAt: n.updatedAt
|
|
304
304
|
};
|
|
305
|
-
},
|
|
305
|
+
}, Ln = ({
|
|
306
306
|
installedIntegration: n,
|
|
307
307
|
summary: t,
|
|
308
308
|
categoryResolver: e
|
|
309
309
|
}) => {
|
|
310
310
|
var a, l, c;
|
|
311
|
-
const i =
|
|
311
|
+
const i = Ft((a = t == null ? void 0 : t.ownerWorkspace) == null ? void 0 : a.handle), o = n.version && (t != null && t.version) ? n.version !== (t == null ? void 0 : t.version) : !1;
|
|
312
312
|
return {
|
|
313
313
|
id: (t == null ? void 0 : t.id) ?? n.id,
|
|
314
314
|
installedId: n.id,
|
|
@@ -317,10 +317,10 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
317
317
|
description: (t == null ? void 0 : t.description) ?? null,
|
|
318
318
|
iconUrl: t == null ? void 0 : t.iconUrl,
|
|
319
319
|
attributes: {
|
|
320
|
-
category: t ?
|
|
320
|
+
category: t ? Dt(t, e) : Et
|
|
321
321
|
},
|
|
322
322
|
meta: {
|
|
323
|
-
installs:
|
|
323
|
+
installs: Nt(t)
|
|
324
324
|
},
|
|
325
325
|
installed: !0,
|
|
326
326
|
enabled: n.enabled,
|
|
@@ -336,7 +336,7 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
336
336
|
version: (t == null ? void 0 : t.version) ?? n.version,
|
|
337
337
|
updatedAt: t == null ? void 0 : t.updatedAt
|
|
338
338
|
};
|
|
339
|
-
},
|
|
339
|
+
}, En = (n) => {
|
|
340
340
|
if (!n)
|
|
341
341
|
return {
|
|
342
342
|
actionCards: [],
|
|
@@ -350,20 +350,20 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
350
350
|
var l;
|
|
351
351
|
return {
|
|
352
352
|
key: o,
|
|
353
|
-
name:
|
|
353
|
+
name: ut(o),
|
|
354
354
|
description: a.description ?? "",
|
|
355
355
|
type: "action",
|
|
356
356
|
billable: ((l = a.attributes) == null ? void 0 : l.billable) === "true"
|
|
357
357
|
};
|
|
358
358
|
}), e = Object.entries(n.events ?? {}).map(([o, a]) => ({
|
|
359
359
|
key: o,
|
|
360
|
-
name:
|
|
360
|
+
name: ut(o),
|
|
361
361
|
description: a.description ?? "",
|
|
362
362
|
type: "event",
|
|
363
363
|
enabled: !0
|
|
364
364
|
})), i = Object.keys(n.channels ?? {}).map((o) => ({
|
|
365
365
|
key: o,
|
|
366
|
-
name:
|
|
366
|
+
name: ut(o),
|
|
367
367
|
description: "Channel communication support",
|
|
368
368
|
type: "channel",
|
|
369
369
|
enabled: !0
|
|
@@ -373,8 +373,8 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
373
373
|
eventCards: e,
|
|
374
374
|
channelCards: i
|
|
375
375
|
};
|
|
376
|
-
},
|
|
377
|
-
var a, l, c,
|
|
376
|
+
}, Nn = (n) => {
|
|
377
|
+
var a, l, c, r;
|
|
378
378
|
if (!n)
|
|
379
379
|
return [];
|
|
380
380
|
const e = [
|
|
@@ -384,19 +384,19 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
384
384
|
}
|
|
385
385
|
];
|
|
386
386
|
for (const [d, u] of Object.entries(n.configurations ?? {}))
|
|
387
|
-
d !==
|
|
387
|
+
d !== dt && e.push({
|
|
388
388
|
value: d,
|
|
389
|
-
label:
|
|
389
|
+
label: Un(u.description) || u.title || d
|
|
390
390
|
});
|
|
391
|
-
return !!((c = n.sandbox) == null ? void 0 : c.identifierExtractScript) && !!((
|
|
392
|
-
},
|
|
391
|
+
return !!((c = n.sandbox) == null ? void 0 : c.identifierExtractScript) && !!((r = n.configurations) != null && r[dt]) && e.push({ value: dt, label: "Connect to a Playground" }), e;
|
|
392
|
+
}, Fn = ({
|
|
393
393
|
installedState: n,
|
|
394
394
|
connectionMethods: t
|
|
395
395
|
}) => {
|
|
396
396
|
var i;
|
|
397
397
|
const e = (n == null ? void 0 : n.configurationType) ?? null;
|
|
398
398
|
return t.some((o) => o.value === e) ? e : ((i = t[0]) == null ? void 0 : i.value) ?? null;
|
|
399
|
-
},
|
|
399
|
+
}, Dn = ({
|
|
400
400
|
integrations: n,
|
|
401
401
|
searchTerm: t,
|
|
402
402
|
visibility: e,
|
|
@@ -406,68 +406,68 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
406
406
|
const a = t.trim().toLowerCase(), l = i ?? [];
|
|
407
407
|
let c = n;
|
|
408
408
|
if (a && (c = c.filter((u) => (u.title || u.name).toLowerCase().includes(a))), e && e !== "all" && (c = c.filter((u) => e === "private" ? u.isPrivate : !u.isPrivate)), l.length > 0 && (c = c.filter((u) => {
|
|
409
|
-
const C = l.includes("official") && u.isOfficial,
|
|
410
|
-
return C ||
|
|
409
|
+
const C = l.includes("official") && u.isOfficial, v = l.includes("verified") && u.isVerified;
|
|
410
|
+
return C || v;
|
|
411
411
|
})), !o)
|
|
412
412
|
return c;
|
|
413
|
-
const
|
|
414
|
-
return [...c].sort((u, C) => o === "asc" ?
|
|
415
|
-
},
|
|
413
|
+
const r = (u) => (u.title || u.name).toLowerCase(), d = (u) => u.updatedAt ? new Date(u.updatedAt).getTime() : 0;
|
|
414
|
+
return [...c].sort((u, C) => o === "asc" ? r(u).localeCompare(r(C), void 0, { sensitivity: "base" }) : o === "desc" ? r(C).localeCompare(r(u), void 0, { sensitivity: "base" }) : o === "newest" ? d(C) - d(u) : d(u) - d(C));
|
|
415
|
+
}, ue = (n) => {
|
|
416
416
|
const t = /* @__PURE__ */ new Map();
|
|
417
417
|
for (const e of n)
|
|
418
418
|
t.set(e.id, e);
|
|
419
419
|
return [...t.values()];
|
|
420
|
-
},
|
|
420
|
+
}, jt = ({
|
|
421
421
|
client: n,
|
|
422
422
|
botId: t,
|
|
423
423
|
transformIntegrationPatch: e
|
|
424
424
|
}) => async (i, o) => {
|
|
425
425
|
const a = e == null ? void 0 : e[i], l = a ? await a(o) : o;
|
|
426
426
|
await n.updateBot({ id: t, integrations: l });
|
|
427
|
-
},
|
|
427
|
+
}, jn = (n, t) => ["integration-hub", n, t], Vn = (n) => {
|
|
428
428
|
var e;
|
|
429
429
|
if (!n || typeof n != "object")
|
|
430
430
|
return !1;
|
|
431
431
|
const t = n;
|
|
432
432
|
return t.status === 404 || t.statusCode === 404 || ((e = t.response) == null ? void 0 : e.status) === 404;
|
|
433
|
-
},
|
|
433
|
+
}, _n = async ({
|
|
434
434
|
client: n,
|
|
435
435
|
integrationId: t
|
|
436
436
|
}) => {
|
|
437
437
|
try {
|
|
438
438
|
return (await n.getPublicIntegrationById({ id: t })).integration;
|
|
439
439
|
} catch (e) {
|
|
440
|
-
if (!
|
|
440
|
+
if (!Vn(e))
|
|
441
441
|
throw e;
|
|
442
442
|
return (await n.getIntegration({ id: t })).integration;
|
|
443
443
|
}
|
|
444
|
-
},
|
|
444
|
+
}, Hn = ({
|
|
445
445
|
installedIntegrations: n,
|
|
446
446
|
integrationId: t,
|
|
447
447
|
integrationName: e
|
|
448
|
-
}) =>
|
|
448
|
+
}) => bt({
|
|
449
449
|
installedIntegrations: n,
|
|
450
450
|
integrationId: t,
|
|
451
451
|
integrationName: e
|
|
452
|
-
}) ?? null,
|
|
452
|
+
}) ?? null, zn = async ({ client: n, botId: t, integrationId: e }) => {
|
|
453
453
|
if (!e)
|
|
454
454
|
return null;
|
|
455
455
|
const [i, o] = await Promise.all([
|
|
456
|
-
|
|
456
|
+
_n({ client: n, integrationId: e }),
|
|
457
457
|
n.getBot({ id: t })
|
|
458
|
-
]), a =
|
|
458
|
+
]), a = tt(o.bot.integrations), l = Hn({
|
|
459
459
|
installedIntegrations: a,
|
|
460
460
|
integrationId: e,
|
|
461
461
|
integrationName: i.name
|
|
462
|
-
}), c =
|
|
462
|
+
}), c = Nn(i);
|
|
463
463
|
return {
|
|
464
464
|
definition: i,
|
|
465
465
|
installedState: l,
|
|
466
|
-
capabilities:
|
|
466
|
+
capabilities: En(i),
|
|
467
467
|
connectionMethods: c,
|
|
468
|
-
selectedConnectionMethod:
|
|
468
|
+
selectedConnectionMethod: Fn({ installedState: l, connectionMethods: c })
|
|
469
469
|
};
|
|
470
|
-
},
|
|
470
|
+
}, Vt = ({
|
|
471
471
|
client: n,
|
|
472
472
|
workspaceId: t,
|
|
473
473
|
botId: e,
|
|
@@ -475,71 +475,71 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
475
475
|
enabled: o = !0,
|
|
476
476
|
transformIntegrationPatch: a
|
|
477
477
|
}) => {
|
|
478
|
-
const l =
|
|
478
|
+
const l = Bt(), c = E(() => jn(t, e), [t, e]), { data: r, isLoading: d, error: u, refetch: C } = Ut({
|
|
479
479
|
queryKey: [...c, "details", i],
|
|
480
480
|
enabled: o && !!i,
|
|
481
|
-
queryFn: () =>
|
|
482
|
-
}),
|
|
481
|
+
queryFn: () => zn({ client: n, workspaceId: t, botId: e, integrationId: i, enabled: o })
|
|
482
|
+
}), v = m(async () => {
|
|
483
483
|
await l.invalidateQueries({ queryKey: c });
|
|
484
|
-
}, [l, c]),
|
|
485
|
-
if (!(
|
|
484
|
+
}, [l, c]), y = () => {
|
|
485
|
+
if (!(r != null && r.installedState))
|
|
486
486
|
throw new Error("Integration is not installed on this bot");
|
|
487
|
-
return
|
|
488
|
-
},
|
|
489
|
-
mutationFn: async (
|
|
490
|
-
const S =
|
|
491
|
-
await
|
|
487
|
+
return r.installedState;
|
|
488
|
+
}, M = jt({ client: n, botId: e, transformIntegrationPatch: a }), B = _({
|
|
489
|
+
mutationFn: async (f) => {
|
|
490
|
+
const S = y();
|
|
491
|
+
await M("configure", {
|
|
492
492
|
[S.integrationAlias]: {
|
|
493
|
-
configuration:
|
|
493
|
+
configuration: f,
|
|
494
494
|
configurationType: S.configurationType ?? null
|
|
495
495
|
}
|
|
496
496
|
});
|
|
497
497
|
},
|
|
498
|
-
onSuccess:
|
|
499
|
-
}),
|
|
498
|
+
onSuccess: v
|
|
499
|
+
}), P = _({
|
|
500
500
|
mutationFn: async () => {
|
|
501
|
-
const
|
|
502
|
-
await
|
|
503
|
-
[
|
|
504
|
-
enabled: !
|
|
501
|
+
const f = y(), S = f.enabled ? "disable" : "enable";
|
|
502
|
+
await M(S, {
|
|
503
|
+
[f.integrationAlias]: {
|
|
504
|
+
enabled: !f.enabled
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
},
|
|
508
|
-
onSuccess:
|
|
509
|
-
}), h =
|
|
510
|
-
mutationFn: async (
|
|
511
|
-
const S =
|
|
512
|
-
await
|
|
508
|
+
onSuccess: v
|
|
509
|
+
}), h = _({
|
|
510
|
+
mutationFn: async (f) => {
|
|
511
|
+
const S = y();
|
|
512
|
+
await M("configure", {
|
|
513
513
|
[S.integrationAlias]: {
|
|
514
|
-
configurationType:
|
|
514
|
+
configurationType: f
|
|
515
515
|
}
|
|
516
516
|
});
|
|
517
517
|
},
|
|
518
|
-
onSuccess:
|
|
518
|
+
onSuccess: v
|
|
519
519
|
});
|
|
520
520
|
return {
|
|
521
|
-
definition: (
|
|
522
|
-
installedState: (
|
|
523
|
-
selectedConnectionMethod: (
|
|
524
|
-
capabilities: (
|
|
521
|
+
definition: (r == null ? void 0 : r.definition) ?? null,
|
|
522
|
+
installedState: (r == null ? void 0 : r.installedState) ?? null,
|
|
523
|
+
selectedConnectionMethod: (r == null ? void 0 : r.selectedConnectionMethod) ?? null,
|
|
524
|
+
capabilities: (r == null ? void 0 : r.capabilities) ?? {
|
|
525
525
|
actionCards: [],
|
|
526
526
|
eventCards: [],
|
|
527
527
|
channelCards: []
|
|
528
528
|
},
|
|
529
|
-
connectionMethods: (
|
|
529
|
+
connectionMethods: (r == null ? void 0 : r.connectionMethods) ?? [],
|
|
530
530
|
isLoading: d,
|
|
531
|
-
error: u ?
|
|
532
|
-
saveConfig:
|
|
533
|
-
toggleEnabled:
|
|
531
|
+
error: u ? ht(u) : null,
|
|
532
|
+
saveConfig: B.mutateAsync,
|
|
533
|
+
toggleEnabled: P.mutateAsync,
|
|
534
534
|
setConnectionMethod: h.mutateAsync,
|
|
535
535
|
refresh: () => {
|
|
536
536
|
C();
|
|
537
537
|
},
|
|
538
|
-
isSavingConfig:
|
|
539
|
-
isTogglingEnabled:
|
|
538
|
+
isSavingConfig: B.isPending,
|
|
539
|
+
isTogglingEnabled: P.isPending,
|
|
540
540
|
isSettingConnectionMethod: h.isPending
|
|
541
541
|
};
|
|
542
|
-
},
|
|
542
|
+
}, fe = Vt, _t = 100, Ht = 200, Kn = (n, t) => ["integration-hub", n, t], qn = ({
|
|
543
543
|
publicIntegrations: n,
|
|
544
544
|
privateIntegrations: t
|
|
545
545
|
}) => {
|
|
@@ -549,38 +549,38 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
549
549
|
for (const i of t)
|
|
550
550
|
e.set(i.id, i);
|
|
551
551
|
return [...e.values()];
|
|
552
|
-
},
|
|
552
|
+
}, Rn = async ({ client: n }) => {
|
|
553
553
|
const t = [];
|
|
554
554
|
let e, i = 0;
|
|
555
555
|
do {
|
|
556
556
|
const o = e, a = await n.listPublicIntegrations({
|
|
557
|
-
limit:
|
|
557
|
+
limit: _t,
|
|
558
558
|
version: "latest",
|
|
559
559
|
nextToken: e
|
|
560
560
|
});
|
|
561
|
-
if (t.push(...a.integrations), e = a.meta.nextToken, i += 1, i >=
|
|
561
|
+
if (t.push(...a.integrations), e = a.meta.nextToken, i += 1, i >= Ht)
|
|
562
562
|
throw new Error("Public integration pagination exceeded safety limit");
|
|
563
563
|
if (e && e === o)
|
|
564
564
|
break;
|
|
565
565
|
} while (e);
|
|
566
566
|
return t;
|
|
567
|
-
},
|
|
567
|
+
}, Qn = async ({ client: n }) => {
|
|
568
568
|
const t = [];
|
|
569
569
|
let e, i = 0;
|
|
570
570
|
do {
|
|
571
571
|
const o = e, a = await n.listIntegrations({
|
|
572
|
-
limit:
|
|
572
|
+
limit: _t,
|
|
573
573
|
version: "latest",
|
|
574
574
|
visibility: "private",
|
|
575
575
|
nextToken: e
|
|
576
576
|
});
|
|
577
|
-
if (t.push(...a.integrations), e = a.meta.nextToken, i += 1, i >=
|
|
577
|
+
if (t.push(...a.integrations), e = a.meta.nextToken, i += 1, i >= Ht)
|
|
578
578
|
throw new Error("Private integration pagination exceeded safety limit");
|
|
579
579
|
if (e && e === o)
|
|
580
580
|
break;
|
|
581
581
|
} while (e);
|
|
582
582
|
return t;
|
|
583
|
-
},
|
|
583
|
+
}, Wn = async ({
|
|
584
584
|
client: n,
|
|
585
585
|
integrationId: t
|
|
586
586
|
}) => {
|
|
@@ -593,27 +593,27 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
},
|
|
596
|
+
}, $n = ({
|
|
597
597
|
integrationId: n,
|
|
598
598
|
installedIntegrations: t
|
|
599
599
|
}) => {
|
|
600
|
-
const e =
|
|
600
|
+
const e = bt({ installedIntegrations: t, integrationId: n });
|
|
601
601
|
return (e == null ? void 0 : e.integrationAlias) ?? n;
|
|
602
|
-
},
|
|
602
|
+
}, Gn = async ({ client: n, botId: t, categoryResolver: e }) => {
|
|
603
603
|
const [i, o, a] = await Promise.all([
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
Rn({ client: n }),
|
|
605
|
+
Qn({ client: n }),
|
|
606
606
|
n.getBot({ id: t })
|
|
607
|
-
]), l =
|
|
608
|
-
(
|
|
609
|
-
summary:
|
|
610
|
-
installedByName:
|
|
607
|
+
]), l = tt(a.bot.integrations), c = qn({ publicIntegrations: i, privateIntegrations: o }), r = new Map(l.map((v) => [v.name, v])), d = new Map(c.map((v) => [v.name, v])), u = c.map(
|
|
608
|
+
(v) => kn({
|
|
609
|
+
summary: v,
|
|
610
|
+
installedByName: r,
|
|
611
611
|
categoryResolver: e
|
|
612
612
|
})
|
|
613
613
|
), C = l.map(
|
|
614
|
-
(
|
|
615
|
-
installedIntegration:
|
|
616
|
-
summary: d.get(
|
|
614
|
+
(v) => Ln({
|
|
615
|
+
installedIntegration: v,
|
|
616
|
+
summary: d.get(v.name),
|
|
617
617
|
categoryResolver: e
|
|
618
618
|
})
|
|
619
619
|
);
|
|
@@ -621,7 +621,7 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
621
621
|
integrations: u,
|
|
622
622
|
installedIntegrations: C
|
|
623
623
|
};
|
|
624
|
-
},
|
|
624
|
+
}, zt = ({
|
|
625
625
|
client: n,
|
|
626
626
|
workspaceId: t,
|
|
627
627
|
botId: e,
|
|
@@ -629,102 +629,102 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
629
629
|
enabled: o = !0,
|
|
630
630
|
transformIntegrationPatch: a
|
|
631
631
|
}) => {
|
|
632
|
-
const l =
|
|
632
|
+
const l = Bt(), c = E(() => Kn(t, e), [t, e]), r = gt(Promise.resolve()), { data: d, isLoading: u, error: C, refetch: v } = Ut({
|
|
633
633
|
queryKey: [...c, "catalog"],
|
|
634
634
|
enabled: o,
|
|
635
|
-
queryFn: () =>
|
|
636
|
-
}),
|
|
635
|
+
queryFn: () => Gn({ client: n, workspaceId: t, botId: e, categoryResolver: i })
|
|
636
|
+
}), y = m(async () => {
|
|
637
637
|
await l.invalidateQueries({ queryKey: c });
|
|
638
|
-
}, [l, c]),
|
|
639
|
-
const A =
|
|
640
|
-
return
|
|
638
|
+
}, [l, c]), M = m(async (p) => {
|
|
639
|
+
const A = r.current.then(p, p);
|
|
640
|
+
return r.current = A.then(
|
|
641
641
|
() => {
|
|
642
642
|
},
|
|
643
643
|
() => {
|
|
644
644
|
}
|
|
645
645
|
), A;
|
|
646
|
-
}, []),
|
|
647
|
-
const { bot: A } = await n.getBot({ id: e }), k =
|
|
648
|
-
return
|
|
649
|
-
}, h =
|
|
650
|
-
mutationFn: async (
|
|
651
|
-
await
|
|
652
|
-
await
|
|
646
|
+
}, []), B = jt({ client: n, botId: e, transformIntegrationPatch: a }), P = async (p) => {
|
|
647
|
+
const { bot: A } = await n.getBot({ id: e }), k = tt(A.integrations);
|
|
648
|
+
return $n({ integrationId: p, installedIntegrations: k });
|
|
649
|
+
}, h = _({
|
|
650
|
+
mutationFn: async (p) => {
|
|
651
|
+
await M(async () => {
|
|
652
|
+
await B("install", { [p]: { enabled: !0 } });
|
|
653
653
|
});
|
|
654
654
|
},
|
|
655
|
-
onSuccess:
|
|
656
|
-
}),
|
|
657
|
-
mutationFn: async (
|
|
658
|
-
await
|
|
659
|
-
const A = await
|
|
660
|
-
await
|
|
655
|
+
onSuccess: y
|
|
656
|
+
}), f = _({
|
|
657
|
+
mutationFn: async (p) => {
|
|
658
|
+
await M(async () => {
|
|
659
|
+
const A = await P(p);
|
|
660
|
+
await B("uninstall", { [A]: null });
|
|
661
661
|
});
|
|
662
662
|
},
|
|
663
|
-
onSuccess:
|
|
664
|
-
}), S =
|
|
665
|
-
mutationFn: async (
|
|
666
|
-
await
|
|
667
|
-
const A = await
|
|
668
|
-
await
|
|
663
|
+
onSuccess: y
|
|
664
|
+
}), S = _({
|
|
665
|
+
mutationFn: async (p) => {
|
|
666
|
+
await M(async () => {
|
|
667
|
+
const A = await P(p);
|
|
668
|
+
await B("enable", { [A]: { enabled: !0 } });
|
|
669
669
|
});
|
|
670
670
|
},
|
|
671
|
-
onSuccess:
|
|
672
|
-
}),
|
|
673
|
-
mutationFn: async (
|
|
674
|
-
await
|
|
675
|
-
const A = await
|
|
676
|
-
await
|
|
671
|
+
onSuccess: y
|
|
672
|
+
}), F = _({
|
|
673
|
+
mutationFn: async (p) => {
|
|
674
|
+
await M(async () => {
|
|
675
|
+
const A = await P(p);
|
|
676
|
+
await B("disable", { [A]: { enabled: !1 } });
|
|
677
677
|
});
|
|
678
678
|
},
|
|
679
|
-
onSuccess:
|
|
680
|
-
}), H =
|
|
681
|
-
mutationFn: async (
|
|
682
|
-
await
|
|
683
|
-
const { bot: A } = await n.getBot({ id: e }), k =
|
|
679
|
+
onSuccess: y
|
|
680
|
+
}), H = _({
|
|
681
|
+
mutationFn: async (p) => {
|
|
682
|
+
await M(async () => {
|
|
683
|
+
const { bot: A } = await n.getBot({ id: e }), k = tt(A.integrations), N = await Wn({ client: n, integrationId: p }), T = bt({
|
|
684
684
|
installedIntegrations: k,
|
|
685
|
-
integrationId:
|
|
686
|
-
integrationName:
|
|
687
|
-
}),
|
|
688
|
-
enabled: (
|
|
689
|
-
configuration: (
|
|
690
|
-
configurationType: (
|
|
691
|
-
},
|
|
692
|
-
[
|
|
685
|
+
integrationId: p,
|
|
686
|
+
integrationName: N
|
|
687
|
+
}), L = {
|
|
688
|
+
enabled: (T == null ? void 0 : T.enabled) ?? !0,
|
|
689
|
+
configuration: (T == null ? void 0 : T.configuration) ?? {},
|
|
690
|
+
configurationType: (T == null ? void 0 : T.configurationType) ?? null
|
|
691
|
+
}, q = {
|
|
692
|
+
[p]: L
|
|
693
693
|
};
|
|
694
|
-
|
|
694
|
+
T && T.integrationAlias !== p && (q[T.integrationAlias] = null), await B("upgrade", q);
|
|
695
695
|
});
|
|
696
696
|
},
|
|
697
|
-
onSuccess:
|
|
697
|
+
onSuccess: y
|
|
698
698
|
});
|
|
699
699
|
return {
|
|
700
700
|
integrations: (d == null ? void 0 : d.integrations) ?? [],
|
|
701
701
|
installedIntegrations: (d == null ? void 0 : d.installedIntegrations) ?? [],
|
|
702
702
|
isLoading: u,
|
|
703
|
-
error: C ?
|
|
703
|
+
error: C ? ht(C) : null,
|
|
704
704
|
install: h.mutateAsync,
|
|
705
|
-
uninstall:
|
|
705
|
+
uninstall: f.mutateAsync,
|
|
706
706
|
enable: S.mutateAsync,
|
|
707
|
-
disable:
|
|
707
|
+
disable: F.mutateAsync,
|
|
708
708
|
upgrade: H.mutateAsync,
|
|
709
709
|
refresh: () => {
|
|
710
|
-
|
|
710
|
+
v();
|
|
711
711
|
},
|
|
712
712
|
isInstalling: h.isPending,
|
|
713
|
-
isUninstalling:
|
|
713
|
+
isUninstalling: f.isPending,
|
|
714
714
|
isEnabling: S.isPending,
|
|
715
|
-
isDisabling:
|
|
715
|
+
isDisabling: F.isPending,
|
|
716
716
|
isUpgrading: H.isPending
|
|
717
717
|
};
|
|
718
|
-
},
|
|
718
|
+
}, pe = zt, Zn = ["official", "verified"], Jn = () => /* @__PURE__ */ b("div", { className: "flex items-center justify-center py-16", children: /* @__PURE__ */ b(Pt, { className: "h-6 w-6 animate-spin text-[var(--gray-9)]" }) }), Xn = () => /* @__PURE__ */ b("div", { className: "flex items-center justify-center py-16 text-sm text-[var(--gray-11)]", children: "Integration details are unavailable for this selection." }), Yn = (n) => n ? {
|
|
719
719
|
key: n.key,
|
|
720
720
|
type: n.type
|
|
721
|
-
} : null,
|
|
721
|
+
} : null, mn = ({
|
|
722
722
|
definition: n,
|
|
723
723
|
selectedConnectionMethod: t
|
|
724
724
|
}) => {
|
|
725
725
|
var e, i, o, a, l;
|
|
726
726
|
return t ? ((o = (i = (e = n.configurations) == null ? void 0 : e[t]) == null ? void 0 : i.identifier) == null ? void 0 : o.linkTemplateScript) ?? null : ((l = (a = n.configuration) == null ? void 0 : a.identifier) == null ? void 0 : l.linkTemplateScript) ?? null;
|
|
727
|
-
},
|
|
727
|
+
}, te = ({
|
|
728
728
|
client: n,
|
|
729
729
|
workspaceId: t,
|
|
730
730
|
botId: e,
|
|
@@ -733,334 +733,355 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
733
733
|
bannerSlides: a,
|
|
734
734
|
bannerIconUrl: l,
|
|
735
735
|
noResultsDocumentationLink: c,
|
|
736
|
-
disableInstallation:
|
|
736
|
+
disableInstallation: r = !1,
|
|
737
737
|
hasWriteAccess: d = !0,
|
|
738
738
|
transformIntegrationPatch: u,
|
|
739
739
|
categoryResolver: C,
|
|
740
|
-
filterMenuLabels:
|
|
741
|
-
defaultVisibility:
|
|
742
|
-
defaultVerification:
|
|
743
|
-
defaultSortMethod:
|
|
744
|
-
renderConfigurationForm:
|
|
740
|
+
filterMenuLabels: v,
|
|
741
|
+
defaultVisibility: y,
|
|
742
|
+
defaultVerification: M,
|
|
743
|
+
defaultSortMethod: B,
|
|
744
|
+
renderConfigurationForm: P,
|
|
745
745
|
renderConnectionsContent: h,
|
|
746
|
-
oauthTemplateData:
|
|
746
|
+
oauthTemplateData: f,
|
|
747
747
|
renderDetailPanel: S,
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
748
|
+
renderNotifications: F,
|
|
749
|
+
onShare: H,
|
|
750
|
+
onInstall: p,
|
|
751
|
+
onUninstall: A,
|
|
752
|
+
onEnable: k,
|
|
753
|
+
onDisable: N,
|
|
754
|
+
onUpgrade: T,
|
|
755
|
+
onError: L
|
|
754
756
|
}) => {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
757
|
+
var Ct;
|
|
758
|
+
const [q, vt] = x(i), [Q, Kt] = x(""), [R, W] = x(null), [nt, $] = x(null), [et, D] = x(null), [qt, z] = x(!1), [it, Rt] = x(y), [ot, Qt] = x(
|
|
759
|
+
M ?? [...Zn]
|
|
760
|
+
), [at, Wt] = x(B), [$t, st] = x("connections"), [Gt, rt] = x("connections"), w = zt({
|
|
758
761
|
client: n,
|
|
759
762
|
workspaceId: t,
|
|
760
763
|
botId: e,
|
|
761
764
|
categoryResolver: C,
|
|
762
765
|
enabled: !0,
|
|
763
766
|
transformIntegrationPatch: u
|
|
764
|
-
}),
|
|
765
|
-
() =>
|
|
767
|
+
}), Zt = E(
|
|
768
|
+
() => Dn({
|
|
766
769
|
integrations: w.integrations,
|
|
767
|
-
searchTerm:
|
|
768
|
-
visibility:
|
|
769
|
-
verification:
|
|
770
|
-
sortMethod:
|
|
770
|
+
searchTerm: Q,
|
|
771
|
+
visibility: it,
|
|
772
|
+
verification: ot,
|
|
773
|
+
sortMethod: at
|
|
771
774
|
}),
|
|
772
|
-
[w.integrations,
|
|
773
|
-
), U =
|
|
775
|
+
[w.integrations, Q, it, ot, at]
|
|
776
|
+
), U = E(
|
|
774
777
|
() => [...w.integrations, ...w.installedIntegrations].find(
|
|
775
|
-
(g) => g.id ===
|
|
778
|
+
(g) => g.id === R
|
|
776
779
|
) ?? null,
|
|
777
|
-
[w.integrations, w.installedIntegrations,
|
|
778
|
-
),
|
|
780
|
+
[w.integrations, w.installedIntegrations, R]
|
|
781
|
+
), s = Vt({
|
|
779
782
|
client: n,
|
|
780
783
|
workspaceId: t,
|
|
781
784
|
botId: e,
|
|
782
|
-
integrationId:
|
|
783
|
-
enabled: !!
|
|
785
|
+
integrationId: nt,
|
|
786
|
+
enabled: !!nt,
|
|
784
787
|
transformIntegrationPatch: u
|
|
785
|
-
}),
|
|
788
|
+
}), Jt = E(
|
|
786
789
|
() => (o == null ? void 0 : o.filter((g) => g.name !== "Popular").map((g) => g.name)) ?? [],
|
|
787
790
|
[o]
|
|
788
|
-
),
|
|
791
|
+
), { readme: Xt, isLoading: Yt } = rn((Ct = s.definition) == null ? void 0 : Ct.readmeUrl);
|
|
792
|
+
Y(() => {
|
|
793
|
+
z(!1), D(null);
|
|
794
|
+
}, [nt]);
|
|
795
|
+
const G = m(
|
|
789
796
|
(g) => {
|
|
790
|
-
const
|
|
791
|
-
|
|
797
|
+
const I = ht(g);
|
|
798
|
+
L == null || L(I);
|
|
792
799
|
},
|
|
793
|
-
[
|
|
794
|
-
),
|
|
800
|
+
[L]
|
|
801
|
+
), Z = async ({
|
|
795
802
|
operation: g,
|
|
796
|
-
onSuccess:
|
|
797
|
-
integration:
|
|
803
|
+
onSuccess: I,
|
|
804
|
+
integration: j
|
|
798
805
|
}) => {
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
806
|
+
const V = j ?? U;
|
|
807
|
+
if (V)
|
|
801
808
|
try {
|
|
802
|
-
await g(),
|
|
803
|
-
} catch (
|
|
804
|
-
|
|
809
|
+
await g(), I == null || I(V);
|
|
810
|
+
} catch (ct) {
|
|
811
|
+
G(ct);
|
|
805
812
|
}
|
|
806
|
-
},
|
|
807
|
-
var
|
|
808
|
-
if (!
|
|
813
|
+
}, mt = (g) => {
|
|
814
|
+
var St, Tt, Ot, xt;
|
|
815
|
+
if (!R || g !== R)
|
|
809
816
|
return null;
|
|
810
|
-
if (
|
|
811
|
-
return
|
|
812
|
-
if (!
|
|
813
|
-
return
|
|
814
|
-
const
|
|
815
|
-
definition:
|
|
816
|
-
selectedConnectionMethod:
|
|
817
|
-
}),
|
|
818
|
-
definition:
|
|
819
|
-
selectedConnectionMethod:
|
|
820
|
-
}),
|
|
817
|
+
if (s.isLoading)
|
|
818
|
+
return Jn();
|
|
819
|
+
if (!s.definition || !U)
|
|
820
|
+
return Xn();
|
|
821
|
+
const I = !!s.installedState, j = mn({
|
|
822
|
+
definition: s.definition,
|
|
823
|
+
selectedConnectionMethod: s.selectedConnectionMethod
|
|
824
|
+
}), V = s.connectionMethods.length > 1 || !!j, ct = kt({
|
|
825
|
+
definition: s.definition,
|
|
826
|
+
selectedConnectionMethod: s.selectedConnectionMethod
|
|
827
|
+
}), tn = Lt(ct).length > 0, nn = !!P || tn, wt = !I || qt, yt = {
|
|
828
|
+
integration: U,
|
|
829
|
+
definition: s.definition,
|
|
830
|
+
installedState: s.installedState,
|
|
831
|
+
workspaceId: t,
|
|
832
|
+
botId: e
|
|
833
|
+
}, At = async (O) => {
|
|
821
834
|
try {
|
|
822
|
-
await
|
|
823
|
-
} catch (
|
|
824
|
-
|
|
835
|
+
await s.saveConfig(O);
|
|
836
|
+
} catch (J) {
|
|
837
|
+
G(J);
|
|
825
838
|
}
|
|
826
|
-
},
|
|
827
|
-
definition:
|
|
828
|
-
installedState:
|
|
829
|
-
connectionMethods:
|
|
830
|
-
selectedConnectionMethod:
|
|
831
|
-
onConnectionMethodChange:
|
|
832
|
-
isSettingConnectionMethod:
|
|
839
|
+
}, en = h ? h({
|
|
840
|
+
definition: s.definition,
|
|
841
|
+
installedState: s.installedState,
|
|
842
|
+
connectionMethods: s.connectionMethods,
|
|
843
|
+
selectedConnectionMethod: s.selectedConnectionMethod,
|
|
844
|
+
onConnectionMethodChange: s.setConnectionMethod,
|
|
845
|
+
isSettingConnectionMethod: s.isSettingConnectionMethod
|
|
833
846
|
}) : /* @__PURE__ */ K("div", { className: "flex flex-col gap-4", children: [
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
|
|
847
|
+
/* @__PURE__ */ b("div", { className: "self-end", children: /* @__PURE__ */ b(
|
|
848
|
+
fn,
|
|
836
849
|
{
|
|
837
|
-
options:
|
|
838
|
-
value:
|
|
850
|
+
options: s.connectionMethods,
|
|
851
|
+
value: s.selectedConnectionMethod,
|
|
839
852
|
disabled: !d,
|
|
840
|
-
onChange: (
|
|
841
|
-
d &&
|
|
853
|
+
onChange: (O) => {
|
|
854
|
+
d && s.setConnectionMethod(O).catch(G);
|
|
842
855
|
}
|
|
843
856
|
}
|
|
844
857
|
) }),
|
|
845
|
-
|
|
846
|
-
|
|
858
|
+
j ? /* @__PURE__ */ b(
|
|
859
|
+
Mn,
|
|
847
860
|
{
|
|
848
861
|
client: n,
|
|
849
|
-
integrationName:
|
|
850
|
-
linkTemplateScript:
|
|
851
|
-
webhookUrl: (
|
|
852
|
-
oauthTemplateData:
|
|
853
|
-
isAuthorized: !!((
|
|
862
|
+
integrationName: s.definition.title ?? s.definition.name,
|
|
863
|
+
linkTemplateScript: j,
|
|
864
|
+
webhookUrl: (St = s.installedState) == null ? void 0 : St.webhookUrl,
|
|
865
|
+
oauthTemplateData: f,
|
|
866
|
+
isAuthorized: !!((Tt = s.installedState) != null && Tt.identifier),
|
|
854
867
|
disabled: !d,
|
|
855
868
|
onAuthorized: async () => {
|
|
856
|
-
|
|
869
|
+
s.refresh(), w.refresh();
|
|
857
870
|
},
|
|
858
|
-
onError:
|
|
871
|
+
onError: G
|
|
859
872
|
}
|
|
860
873
|
) : /* @__PURE__ */ K("p", { className: "text-sm text-[var(--gray-11)]", children: [
|
|
861
874
|
"No custom connection UI was provided. Use ",
|
|
862
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ b("code", { children: "renderConnectionsContent" }),
|
|
863
876
|
" to plug your OAuth/manual connection flow."
|
|
864
877
|
] })
|
|
865
|
-
] }),
|
|
866
|
-
|
|
878
|
+
] }), on = /* @__PURE__ */ b(
|
|
879
|
+
pn,
|
|
867
880
|
{
|
|
868
|
-
webhookUrl: (
|
|
869
|
-
isBlocked: !
|
|
870
|
-
children:
|
|
871
|
-
definition:
|
|
872
|
-
installedState:
|
|
873
|
-
selectedConnectionMethod:
|
|
874
|
-
onSave:
|
|
875
|
-
isSaving:
|
|
876
|
-
}) : /* @__PURE__ */
|
|
877
|
-
|
|
881
|
+
webhookUrl: (Ot = s.installedState) == null ? void 0 : Ot.webhookUrl,
|
|
882
|
+
isBlocked: !s.installedState,
|
|
883
|
+
children: P ? P({
|
|
884
|
+
definition: s.definition,
|
|
885
|
+
installedState: s.installedState,
|
|
886
|
+
selectedConnectionMethod: s.selectedConnectionMethod,
|
|
887
|
+
onSave: At,
|
|
888
|
+
isSaving: s.isSavingConfig
|
|
889
|
+
}) : /* @__PURE__ */ b(
|
|
890
|
+
Pn,
|
|
878
891
|
{
|
|
879
|
-
definition:
|
|
880
|
-
installedState:
|
|
881
|
-
selectedConnectionMethod:
|
|
882
|
-
onSave:
|
|
883
|
-
isSaving:
|
|
884
|
-
disabled: !d || !
|
|
892
|
+
definition: s.definition,
|
|
893
|
+
installedState: s.installedState,
|
|
894
|
+
selectedConnectionMethod: s.selectedConnectionMethod,
|
|
895
|
+
onSave: At,
|
|
896
|
+
isSaving: s.isSavingConfig,
|
|
897
|
+
disabled: !d || !s.installedState
|
|
885
898
|
}
|
|
886
899
|
)
|
|
887
900
|
}
|
|
901
|
+
), It = /* @__PURE__ */ b(
|
|
902
|
+
gn,
|
|
903
|
+
{
|
|
904
|
+
actionCards: s.capabilities.actionCards,
|
|
905
|
+
eventCards: s.capabilities.eventCards,
|
|
906
|
+
channelCards: s.capabilities.channelCards,
|
|
907
|
+
selectedCard: et,
|
|
908
|
+
onCardSelect: (O) => {
|
|
909
|
+
D(
|
|
910
|
+
Yn(
|
|
911
|
+
O ? {
|
|
912
|
+
key: O.key,
|
|
913
|
+
type: O.type
|
|
914
|
+
} : null
|
|
915
|
+
)
|
|
916
|
+
);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
), an = /* @__PURE__ */ b(
|
|
920
|
+
hn,
|
|
921
|
+
{
|
|
922
|
+
version: s.definition.version,
|
|
923
|
+
githubUrl: s.definition.url,
|
|
924
|
+
aboutLabel: "About Integration",
|
|
925
|
+
onAboutClick: I ? () => z(!0) : void 0
|
|
926
|
+
}
|
|
888
927
|
);
|
|
889
|
-
return /* @__PURE__ */
|
|
890
|
-
|
|
928
|
+
return /* @__PURE__ */ b(
|
|
929
|
+
bn,
|
|
891
930
|
{
|
|
892
|
-
title:
|
|
893
|
-
iconUrl:
|
|
931
|
+
title: s.definition.title ?? s.definition.name,
|
|
932
|
+
iconUrl: s.definition.iconUrl,
|
|
894
933
|
contributorName: U.author,
|
|
895
934
|
isOfficial: U.isOfficial,
|
|
896
935
|
isVerified: U.isVerified,
|
|
897
936
|
isPrivate: U.isPrivate,
|
|
898
937
|
onBack: () => {
|
|
899
|
-
|
|
938
|
+
W(null), $(null), D(null), z(!1);
|
|
900
939
|
},
|
|
901
|
-
onInstall:
|
|
902
|
-
|
|
940
|
+
onInstall: I || r || !d ? void 0 : () => {
|
|
941
|
+
Z({
|
|
903
942
|
operation: () => w.install(U.id),
|
|
904
|
-
onSuccess:
|
|
943
|
+
onSuccess: p,
|
|
905
944
|
integration: U
|
|
906
945
|
});
|
|
907
946
|
},
|
|
908
|
-
onToggleEnabled: !
|
|
909
|
-
const
|
|
910
|
-
|
|
947
|
+
onToggleEnabled: !I || !d ? void 0 : () => {
|
|
948
|
+
const O = s.installedState, J = !!(O != null && O.enabled);
|
|
949
|
+
Z({
|
|
911
950
|
operation: async () => {
|
|
912
|
-
if (!
|
|
951
|
+
if (!O)
|
|
913
952
|
throw new Error("Integration is not installed");
|
|
914
|
-
if (
|
|
915
|
-
await w.disable(
|
|
953
|
+
if (J) {
|
|
954
|
+
await w.disable(O.id);
|
|
916
955
|
return;
|
|
917
956
|
}
|
|
918
|
-
await w.enable(
|
|
957
|
+
await w.enable(O.id);
|
|
919
958
|
},
|
|
920
|
-
onSuccess:
|
|
959
|
+
onSuccess: J ? N : k,
|
|
921
960
|
integration: U
|
|
922
961
|
});
|
|
923
962
|
},
|
|
924
|
-
onUninstall: !
|
|
925
|
-
const
|
|
926
|
-
|
|
963
|
+
onUninstall: !I || !d ? void 0 : () => {
|
|
964
|
+
const O = s.installedState;
|
|
965
|
+
Z({
|
|
927
966
|
operation: async () => {
|
|
928
|
-
if (!
|
|
967
|
+
if (!O)
|
|
929
968
|
throw new Error("Integration is not installed");
|
|
930
|
-
await w.uninstall(
|
|
969
|
+
await w.uninstall(O.id);
|
|
931
970
|
},
|
|
932
|
-
onSuccess:
|
|
971
|
+
onSuccess: A,
|
|
933
972
|
integration: U
|
|
934
973
|
});
|
|
935
974
|
},
|
|
936
975
|
onUpgrade: !U.hasUpdate || !d ? void 0 : () => {
|
|
937
|
-
|
|
976
|
+
Z({
|
|
938
977
|
operation: () => w.upgrade(U.id),
|
|
939
|
-
onSuccess:
|
|
978
|
+
onSuccess: T,
|
|
940
979
|
integration: U
|
|
941
980
|
});
|
|
942
981
|
},
|
|
943
|
-
isInstalled:
|
|
944
|
-
disableInstallation:
|
|
982
|
+
isInstalled: I,
|
|
983
|
+
disableInstallation: r,
|
|
945
984
|
hasWriteAccess: d,
|
|
946
985
|
isInstalling: w.isInstalling,
|
|
947
986
|
isUninstalling: w.isUninstalling,
|
|
948
987
|
isTogglingEnabled: w.isEnabling || w.isDisabling,
|
|
949
988
|
hasUpdate: U.hasUpdate,
|
|
950
989
|
isUpgrading: w.isUpgrading,
|
|
951
|
-
toggleButtonLabel: (
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
990
|
+
toggleButtonLabel: (xt = s.installedState) != null && xt.enabled ? "Disable" : "Enable",
|
|
991
|
+
onShare: H ? () => H(yt) : void 0,
|
|
992
|
+
showBackToSetup: I && wt,
|
|
993
|
+
onBackToSetup: () => z(!1),
|
|
994
|
+
notifications: F == null ? void 0 : F(yt),
|
|
995
|
+
selectedDetailPanel: et && S ? S({
|
|
996
|
+
definition: s.definition,
|
|
997
|
+
selectedCard: et,
|
|
998
|
+
onClose: () => D(null)
|
|
956
999
|
}) : void 0,
|
|
957
|
-
onDismissSelectedDetailPanel: () =>
|
|
958
|
-
children: /* @__PURE__ */
|
|
959
|
-
|
|
1000
|
+
onDismissSelectedDetailPanel: () => D(null),
|
|
1001
|
+
children: wt ? /* @__PURE__ */ K("div", { className: "flex flex-col gap-6 mt-6", children: [
|
|
1002
|
+
/* @__PURE__ */ b(vn, { readme: Xt, isLoading: Yt }),
|
|
1003
|
+
It
|
|
1004
|
+
] }) : /* @__PURE__ */ b(
|
|
1005
|
+
Cn,
|
|
960
1006
|
{
|
|
961
|
-
integrationTitle:
|
|
962
|
-
isFullyConfigured:
|
|
963
|
-
hasConnectionStep:
|
|
964
|
-
hasConfigurationStep:
|
|
965
|
-
configuredTab:
|
|
966
|
-
onConfiguredTabChange:
|
|
967
|
-
setupTab:
|
|
968
|
-
onSetupTabChange:
|
|
1007
|
+
integrationTitle: s.definition.title ?? s.definition.name,
|
|
1008
|
+
isFullyConfigured: I,
|
|
1009
|
+
hasConnectionStep: V,
|
|
1010
|
+
hasConfigurationStep: nn,
|
|
1011
|
+
configuredTab: $t,
|
|
1012
|
+
onConfiguredTabChange: st,
|
|
1013
|
+
setupTab: Gt,
|
|
1014
|
+
onSetupTabChange: rt,
|
|
969
1015
|
onCancelSetup: () => {
|
|
970
|
-
|
|
1016
|
+
W(null), $(null), D(null), z(!1);
|
|
971
1017
|
},
|
|
972
|
-
metadata:
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
githubUrl: r.definition.url,
|
|
977
|
-
aboutLabel: "About Integration"
|
|
978
|
-
}
|
|
979
|
-
),
|
|
980
|
-
connectionsContent: Rt,
|
|
981
|
-
configurationContent: $t,
|
|
982
|
-
capabilitiesContent: /* @__PURE__ */ v(
|
|
983
|
-
an,
|
|
984
|
-
{
|
|
985
|
-
actionCards: r.capabilities.actionCards,
|
|
986
|
-
eventCards: r.capabilities.eventCards,
|
|
987
|
-
channelCards: r.capabilities.channelCards,
|
|
988
|
-
selectedCard: Y,
|
|
989
|
-
onCardSelect: (T) => {
|
|
990
|
-
q(
|
|
991
|
-
_n(
|
|
992
|
-
T ? {
|
|
993
|
-
key: T.key,
|
|
994
|
-
type: T.type
|
|
995
|
-
} : null
|
|
996
|
-
)
|
|
997
|
-
);
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
)
|
|
1018
|
+
metadata: an,
|
|
1019
|
+
connectionsContent: en,
|
|
1020
|
+
configurationContent: on,
|
|
1021
|
+
capabilitiesContent: It
|
|
1001
1022
|
}
|
|
1002
1023
|
)
|
|
1003
1024
|
}
|
|
1004
1025
|
);
|
|
1005
1026
|
};
|
|
1006
1027
|
return /* @__PURE__ */ K("div", { className: "flex h-full min-h-0 flex-col", children: [
|
|
1007
|
-
!
|
|
1008
|
-
/* @__PURE__ */
|
|
1028
|
+
!R && /* @__PURE__ */ b("div", { className: "flex justify-end px-6 pt-4", children: /* @__PURE__ */ K("div", { className: "flex rounded-lg bg-[var(--gray-a3)] p-1", children: [
|
|
1029
|
+
/* @__PURE__ */ b(
|
|
1009
1030
|
"button",
|
|
1010
1031
|
{
|
|
1011
1032
|
type: "button",
|
|
1012
|
-
onClick: () =>
|
|
1013
|
-
className:
|
|
1033
|
+
onClick: () => vt("hub"),
|
|
1034
|
+
className: ft(
|
|
1014
1035
|
"cursor-pointer rounded-md px-3 py-1.5 text-sm text-[var(--gray-11)] transition-colors",
|
|
1015
|
-
|
|
1036
|
+
q === "hub" && "bg-[var(--gray-1)] text-[var(--gray-12)] shadow-sm"
|
|
1016
1037
|
),
|
|
1017
1038
|
children: "Integration Hub"
|
|
1018
1039
|
}
|
|
1019
1040
|
),
|
|
1020
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ b(
|
|
1021
1042
|
"button",
|
|
1022
1043
|
{
|
|
1023
1044
|
type: "button",
|
|
1024
|
-
onClick: () =>
|
|
1025
|
-
className:
|
|
1045
|
+
onClick: () => vt("installed"),
|
|
1046
|
+
className: ft(
|
|
1026
1047
|
"cursor-pointer rounded-md px-3 py-1.5 text-sm text-[var(--gray-11)] transition-colors",
|
|
1027
|
-
|
|
1048
|
+
q === "installed" && "bg-[var(--gray-1)] text-[var(--gray-12)] shadow-sm"
|
|
1028
1049
|
),
|
|
1029
1050
|
children: "Installed Integrations"
|
|
1030
1051
|
}
|
|
1031
1052
|
)
|
|
1032
1053
|
] }) }),
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
|
|
1054
|
+
/* @__PURE__ */ b(
|
|
1055
|
+
cn,
|
|
1035
1056
|
{
|
|
1036
|
-
view:
|
|
1037
|
-
searchInput:
|
|
1038
|
-
searchTerm:
|
|
1039
|
-
onSearchInputChange:
|
|
1040
|
-
selectedIntegrationId:
|
|
1041
|
-
hubIntegrations:
|
|
1057
|
+
view: q,
|
|
1058
|
+
searchInput: Q,
|
|
1059
|
+
searchTerm: Q,
|
|
1060
|
+
onSearchInputChange: Kt,
|
|
1061
|
+
selectedIntegrationId: R,
|
|
1062
|
+
hubIntegrations: Zt,
|
|
1042
1063
|
sidebarIntegrations: w.integrations,
|
|
1043
1064
|
installedIntegrations: w.installedIntegrations,
|
|
1044
1065
|
isHubLoading: w.isLoading,
|
|
1045
1066
|
isInstalledLoading: w.isLoading,
|
|
1046
|
-
filterMenu: /* @__PURE__ */
|
|
1047
|
-
|
|
1067
|
+
filterMenu: /* @__PURE__ */ b(
|
|
1068
|
+
ln,
|
|
1048
1069
|
{
|
|
1049
|
-
visibility:
|
|
1050
|
-
verification:
|
|
1051
|
-
sortMethod:
|
|
1052
|
-
labels:
|
|
1053
|
-
onVisibilityChange:
|
|
1054
|
-
onVerificationChange:
|
|
1055
|
-
onSortMethodChange:
|
|
1070
|
+
visibility: it,
|
|
1071
|
+
verification: ot,
|
|
1072
|
+
sortMethod: at,
|
|
1073
|
+
labels: v,
|
|
1074
|
+
onVisibilityChange: Rt,
|
|
1075
|
+
onVerificationChange: Qt,
|
|
1076
|
+
onSortMethodChange: Wt
|
|
1056
1077
|
}
|
|
1057
1078
|
),
|
|
1058
1079
|
categories: o,
|
|
1059
1080
|
bannerSlides: a,
|
|
1060
1081
|
bannerIconUrl: l,
|
|
1061
1082
|
noResultsDocumentationLink: c,
|
|
1062
|
-
renderIntegrationCard: (g, { onEscape:
|
|
1063
|
-
|
|
1083
|
+
renderIntegrationCard: (g, { onEscape: I }) => /* @__PURE__ */ b(
|
|
1084
|
+
dn,
|
|
1064
1085
|
{
|
|
1065
1086
|
name: g.title ?? g.name,
|
|
1066
1087
|
description: g.description,
|
|
@@ -1072,49 +1093,51 @@ const rn = "width=650,height=800,popup=true", cn = 500, ln = 5 * 60 * 1e3, dn =
|
|
|
1072
1093
|
private: g.isPrivate,
|
|
1073
1094
|
iconUrl: g.iconUrl,
|
|
1074
1095
|
onClick: () => {
|
|
1075
|
-
|
|
1096
|
+
W(g.id), $(g.installedId ?? g.id), st("connections"), rt("connections"), z(!1), D(null);
|
|
1076
1097
|
},
|
|
1077
|
-
onEscape:
|
|
1098
|
+
onEscape: I
|
|
1078
1099
|
}
|
|
1079
1100
|
),
|
|
1080
|
-
renderInstalledIntegrations: ({ integrations: g, searchTerm:
|
|
1081
|
-
|
|
1101
|
+
renderInstalledIntegrations: ({ integrations: g, searchTerm: I, categoryOrder: j }) => /* @__PURE__ */ b(
|
|
1102
|
+
un,
|
|
1082
1103
|
{
|
|
1083
1104
|
integrations: g,
|
|
1084
|
-
searchTerm:
|
|
1085
|
-
categoryOrder:
|
|
1086
|
-
onSelectIntegration: (
|
|
1087
|
-
|
|
1105
|
+
searchTerm: I,
|
|
1106
|
+
categoryOrder: j.length > 0 ? j : Jt,
|
|
1107
|
+
onSelectIntegration: (V) => {
|
|
1108
|
+
W(V.id), $(V.installedId ?? V.id), st("connections"), rt("connections"), z(!1), D(null);
|
|
1088
1109
|
}
|
|
1089
1110
|
}
|
|
1090
1111
|
),
|
|
1091
|
-
renderIntegrationDetails:
|
|
1112
|
+
renderIntegrationDetails: mt
|
|
1092
1113
|
}
|
|
1093
1114
|
)
|
|
1094
1115
|
] });
|
|
1095
|
-
},
|
|
1116
|
+
}, ge = te;
|
|
1096
1117
|
export {
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1118
|
+
ge as BotpressIntegrationHub,
|
|
1119
|
+
te as BotpressIntegrationHubScreen,
|
|
1120
|
+
Mn as IntegrationOAuthButton,
|
|
1121
|
+
vn as IntegrationReadmeContent,
|
|
1122
|
+
Pn as IntegrationStaticZuiConfigurationForm,
|
|
1123
|
+
ue as dedupeById,
|
|
1124
|
+
Tn as fetchOAuthAuthorizationUrl,
|
|
1125
|
+
Dn as filterAndSortIntegrations,
|
|
1126
|
+
bt as findInstalledIntegration,
|
|
1127
|
+
tt as getInstalledIntegrations,
|
|
1128
|
+
Fn as getSelectedConnectionMethod,
|
|
1129
|
+
Sn as getWebhookIdFromUrl,
|
|
1130
|
+
Ft as isOfficialWorkspace,
|
|
1131
|
+
On as openOAuthPopup,
|
|
1132
|
+
Dt as resolveCategory,
|
|
1133
|
+
En as toCapabilityCards,
|
|
1134
|
+
Nn as toConnectionMethods,
|
|
1135
|
+
ht as toError,
|
|
1136
|
+
kn as toHubItem,
|
|
1137
|
+
Ln as toInstalledItem,
|
|
1138
|
+
Vt as useBotpressIntegrationDetails,
|
|
1139
|
+
zt as useBotpressIntegrationHub,
|
|
1140
|
+
fe as useIntegrationDetails,
|
|
1141
|
+
pe as useIntegrationHub,
|
|
1142
|
+
rn as useIntegrationReadme
|
|
1120
1143
|
};
|