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