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