@epam/ai-dial-toolset-editor 1.2.0-dev.46 → 1.2.0-dev.50
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAwC5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA+WhD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const TOOLSET_EDITOR_CLASS: {
|
|
2
|
+
/** The metadata column of the editor, inside the shared editor layout. */
|
|
3
|
+
readonly metadataSection: "dial-toolset-editor-metadata-section";
|
|
4
|
+
/** The setup column beside it, holding the connection and auth forms. */
|
|
5
|
+
readonly setupSection: "dial-toolset-editor-setup-section";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,oBAAoB;IAC/B,0EAA0E;;IAE1E,yEAAyE;;CAEjE,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export type { ToolsetOAuthLoginHandler, ToolsetOAuthLoginRequest, ToolsetOAuthLo
|
|
|
9
9
|
export type { DeploymentGeneralFormData, ToolsetAuthActions, ToolsetAuthFormData, ToolsetFormData, ToolsetFormErrors, ToolsetLoginRequest, ToolsetLogoutRequest, } from './models/toolset-form';
|
|
10
10
|
export { AUTH_TYPE_ICONS, DEFAULT_TOOLSET_NAME, DEFAULT_TOOLSET_VERSION, ToolsetTransportType, } from './constants/toolsets';
|
|
11
11
|
export { getDefaultToolsetForm, getStorageSafeUniqueToolsetName, isToolsetAuthValid, isToolsetFormValid, isValidEndpointUrl, normalizeReturnedEndpointUrl, } from './utils/toolsets';
|
|
12
|
+
export { TOOLSET_EDITOR_CLASS } from './constants/public-class-names';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { AvatarPickerModal as e, DeploymentCreationFieldErrorCode as t, DeploymentCreationForm as n, EditorLayout as r, EditorSection as i, validateDeploymentCreationFields as a } from "@epam/ai-dial-builder-form";
|
|
2
2
|
import { ToolsetAuthTypes as o, ToolsetCredentialsLevel as s, WithLogin as c, dialFileToAttachment as l, getApiErrorDetails as u } from "@epam/ai-dial-chat-hooks";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
//#region src/constants/
|
|
9
|
-
var
|
|
3
|
+
import { CopyButton as d, TAG_INPUT_TAG_CLASS_NAME as f, mergeClasses as p, useCodeCopy as m } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { ConfirmationPopup as h, ConfirmationPopupVariant as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Input as y, NeutralButton as b, PasswordInput as x, PrimaryButton as S, Radio as C, RadioGroup as w, SegmentedControl as ee, Select as T, TagInput as E } from "@epam/ai-dial-ui-kit";
|
|
5
|
+
import { memo as D, useCallback as O, useEffect as k, useMemo as A, useRef as j, useState as M } from "react";
|
|
6
|
+
import { IconBrandOauth as N, IconKey as P, IconLockOff as F, IconLogin as te, IconLogout as I } from "@tabler/icons-react";
|
|
7
|
+
import { Fragment as ne, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
8
|
+
//#region src/constants/public-class-names.ts
|
|
9
|
+
var z = {
|
|
10
|
+
metadataSection: "dial-toolset-editor-metadata-section",
|
|
11
|
+
setupSection: "dial-toolset-editor-setup-section"
|
|
12
|
+
}, B = /* @__PURE__ */ function(e) {
|
|
10
13
|
return e.Http = "HTTP", e.Sse = "SSE", e;
|
|
11
14
|
}({}), V = "New toolset", H = "0.0.1", U = {
|
|
12
|
-
[o.OAuth]:
|
|
13
|
-
[o.ApiKey]:
|
|
14
|
-
[o.None]:
|
|
15
|
+
[o.OAuth]: N,
|
|
16
|
+
[o.ApiKey]: P,
|
|
17
|
+
[o.None]: F
|
|
15
18
|
}, W = ({ defaultName: e = V, existingNames: t }) => {
|
|
16
19
|
let n = new Set(t);
|
|
17
20
|
if (!n.has(e)) return e;
|
|
@@ -53,7 +56,7 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
53
56
|
if (q(t)) return t;
|
|
54
57
|
}
|
|
55
58
|
return t;
|
|
56
|
-
},
|
|
59
|
+
}, Z = (e) => !e?.trim() || J(e), Q = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === o.ApiKey ? e.keyHeader?.trim() ? e.withLogin === c.WithoutLogin ? !0 : !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === o.OAuth && e.withLogin === c.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && Z(e.authorizationEndpoint) && Z(e.tokenEndpoint) : !0, re = (e, t = !1) => Object.keys(a(e, { validateVersionPattern: !0 })).length === 0 && J(e.endpoint) && Q(e.auth, t), ie = {
|
|
57
60
|
name: {
|
|
58
61
|
label: "Name",
|
|
59
62
|
placeholder: "Enter name"
|
|
@@ -92,7 +95,7 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
92
95
|
saveLabel: "Save"
|
|
93
96
|
},
|
|
94
97
|
ariaLabel: "General"
|
|
95
|
-
},
|
|
98
|
+
}, ae = {
|
|
96
99
|
title: "Add avatar",
|
|
97
100
|
attachLabel: "Attach",
|
|
98
101
|
emptyTitle: "This folder is empty",
|
|
@@ -118,9 +121,9 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
118
121
|
deleteCancelLabel: "Cancel",
|
|
119
122
|
uploadProgressTitle: "Uploading files",
|
|
120
123
|
cancelLabel: "Cancel"
|
|
121
|
-
},
|
|
122
|
-
let [h, g] =
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
+
}, oe = ({ form: t, errors: r, bucket: i, FileManagerModal: a, resolveIconUrl: o, allowedMimeTypes: s, maxFileSizeBytes: c, availableLocaleOptions: u, onChange: d, onNameBlur: f, onVersionBlur: p, labels: m }) => {
|
|
125
|
+
let [h, g] = M(!1), _ = m?.form ?? ie, v = m?.avatarPicker ?? ae, y = A(() => o(t.iconUrl), [t.iconUrl, o]);
|
|
126
|
+
return /* @__PURE__ */ R(ne, { children: [/* @__PURE__ */ L(n, {
|
|
124
127
|
values: {
|
|
125
128
|
name: t.name,
|
|
126
129
|
description: t.description,
|
|
@@ -137,7 +140,7 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
137
140
|
onAddAvatarClick: () => g(!0),
|
|
138
141
|
labels: _,
|
|
139
142
|
availableLocaleOptions: u
|
|
140
|
-
}), /* @__PURE__ */
|
|
143
|
+
}), /* @__PURE__ */ L(e, {
|
|
141
144
|
isOpen: h,
|
|
142
145
|
onClose: () => g(!1),
|
|
143
146
|
onAttach: (e) => {
|
|
@@ -152,47 +155,47 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
152
155
|
})] });
|
|
153
156
|
}, $ = /* @__PURE__ */ function(e) {
|
|
154
157
|
return e.Success = "success", e.Cancelled = "cancelled", e.PopupBlocked = "popup-blocked", e.InvalidConfig = "invalid-config", e.Failed = "failed", e;
|
|
155
|
-
}({}),
|
|
156
|
-
let [
|
|
157
|
-
j || t === e.authenticationType ||
|
|
158
|
+
}({}), se = (e, t) => e === o.None ? c.WithoutLogin : e === o.OAuth && !t ? c.WithConfig : c.WithLogin, ce = (e, t) => e === o.None ? t?.typeNone ?? "Open access" : e === o.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", le = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: l, onOAuthLogin: d, onNotifySuccess: p, onNotifyError: m, onAuthChange: S, onEnsureSaved: w, labels: T }) => {
|
|
159
|
+
let [D, O] = M(!1), [k, A] = M(!1), j = e.isLoggedIn || n || D, N = J(a) && Q(e, i) && !j, P = (t) => {
|
|
160
|
+
j || t === e.authenticationType || S({
|
|
158
161
|
authenticationType: t,
|
|
159
|
-
withLogin:
|
|
162
|
+
withLogin: se(t, !!e.clientId?.trim())
|
|
160
163
|
});
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
switch (e.auth != null &&
|
|
164
|
+
}, F = (e) => {
|
|
165
|
+
S({ withLogin: e });
|
|
166
|
+
}, ne = (e) => {
|
|
167
|
+
switch (e.auth != null && S(e.auth), e.status) {
|
|
165
168
|
case $.Success:
|
|
166
|
-
|
|
169
|
+
S({ isLoggedIn: !0 }), p(T?.loginSuccessMessage ?? "Successfully logged in.");
|
|
167
170
|
return;
|
|
168
171
|
case $.PopupBlocked:
|
|
169
|
-
|
|
172
|
+
m(T?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
|
|
170
173
|
return;
|
|
171
174
|
case $.InvalidConfig:
|
|
172
|
-
|
|
175
|
+
m(T?.errorOAuthConfigMissing ?? "The OAuth provider did not return a valid client configuration. Please check the endpoint or contact your administrator.");
|
|
173
176
|
return;
|
|
174
177
|
case $.Failed:
|
|
175
|
-
|
|
178
|
+
m(T?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", e.traceId);
|
|
176
179
|
return;
|
|
177
180
|
case $.Cancelled: return;
|
|
178
181
|
}
|
|
179
|
-
},
|
|
182
|
+
}, z = async () => {
|
|
180
183
|
if (!N) return;
|
|
181
184
|
if (e.authenticationType === o.OAuth) {
|
|
182
|
-
|
|
185
|
+
O(!0);
|
|
183
186
|
try {
|
|
184
|
-
|
|
187
|
+
ne(await d({
|
|
185
188
|
auth: e,
|
|
186
189
|
ensureSaved: w
|
|
187
190
|
}));
|
|
188
191
|
} finally {
|
|
189
|
-
|
|
192
|
+
O(!1);
|
|
190
193
|
}
|
|
191
194
|
return;
|
|
192
195
|
}
|
|
193
196
|
let t = await w();
|
|
194
197
|
if (t) {
|
|
195
|
-
|
|
198
|
+
O(!0);
|
|
196
199
|
try {
|
|
197
200
|
let n = {
|
|
198
201
|
url: t,
|
|
@@ -200,63 +203,63 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
200
203
|
authenticationType: e.authenticationType,
|
|
201
204
|
apiKey: e.apiKey?.trim()
|
|
202
205
|
};
|
|
203
|
-
await l.login(t, n),
|
|
206
|
+
await l.login(t, n), S({ isLoggedIn: !0 }), p(T?.loginSuccessMessage ?? "Successfully logged in.");
|
|
204
207
|
} catch (e) {
|
|
205
208
|
let { traceId: t } = await u(e);
|
|
206
|
-
|
|
209
|
+
m(T?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
207
210
|
} finally {
|
|
208
|
-
|
|
211
|
+
O(!1);
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
|
-
},
|
|
212
|
-
|
|
214
|
+
}, B = async () => {
|
|
215
|
+
O(!0);
|
|
213
216
|
try {
|
|
214
217
|
let t = {
|
|
215
218
|
url: r,
|
|
216
219
|
credentialsLevel: s.User,
|
|
217
220
|
authenticationType: e.authenticationType
|
|
218
221
|
};
|
|
219
|
-
await l.logout(r, t),
|
|
222
|
+
await l.logout(r, t), S({ isLoggedIn: !1 }), A(!1), p(T?.logoutSuccessMessage ?? "Successfully logged out.");
|
|
220
223
|
} catch (e) {
|
|
221
224
|
let { traceId: t } = await u(e);
|
|
222
|
-
|
|
225
|
+
m(T?.errorLogoutFailed ?? "Failed to log out. Please try again.", t);
|
|
223
226
|
} finally {
|
|
224
|
-
|
|
227
|
+
O(!1);
|
|
225
228
|
}
|
|
226
|
-
},
|
|
229
|
+
}, V = () => e.isLoggedIn ? /* @__PURE__ */ L("div", {
|
|
227
230
|
className: "flex",
|
|
228
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ L(b, {
|
|
229
232
|
label: T?.logOutLabel ?? "Log out",
|
|
230
|
-
iconBefore: /* @__PURE__ */
|
|
231
|
-
size:
|
|
232
|
-
stroke:
|
|
233
|
+
iconBefore: /* @__PURE__ */ L(I, {
|
|
234
|
+
size: _.MD,
|
|
235
|
+
stroke: v
|
|
233
236
|
}),
|
|
234
237
|
onClick: () => A(!0),
|
|
235
|
-
disabled: n ||
|
|
238
|
+
disabled: n || D
|
|
236
239
|
})
|
|
237
|
-
}) : /* @__PURE__ */
|
|
240
|
+
}) : /* @__PURE__ */ L("div", {
|
|
238
241
|
className: "flex",
|
|
239
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ L(b, {
|
|
240
243
|
label: T?.logInLabel ?? "Log in",
|
|
241
|
-
iconBefore: /* @__PURE__ */
|
|
242
|
-
size:
|
|
243
|
-
stroke:
|
|
244
|
+
iconBefore: /* @__PURE__ */ L(te, {
|
|
245
|
+
size: _.MD,
|
|
246
|
+
stroke: v
|
|
244
247
|
}),
|
|
245
|
-
onClick:
|
|
248
|
+
onClick: z,
|
|
246
249
|
disabled: !N
|
|
247
250
|
})
|
|
248
251
|
});
|
|
249
|
-
return /* @__PURE__ */
|
|
252
|
+
return /* @__PURE__ */ R("section", {
|
|
250
253
|
className: "flex flex-col gap-2",
|
|
251
254
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ L("h3", {
|
|
253
256
|
className: "dial-h3-text",
|
|
254
257
|
children: T?.sectionTitle ?? "Authentication"
|
|
255
258
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ L(ee, {
|
|
257
260
|
"aria-label": T?.sectionTitle ?? "Authentication",
|
|
258
261
|
value: e.authenticationType,
|
|
259
|
-
onChange: (e) =>
|
|
262
|
+
onChange: (e) => P(e),
|
|
260
263
|
segmentClassName: "px-2",
|
|
261
264
|
items: [
|
|
262
265
|
o.None,
|
|
@@ -266,56 +269,56 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
266
269
|
let n = U[t];
|
|
267
270
|
return {
|
|
268
271
|
value: t,
|
|
269
|
-
label: /* @__PURE__ */
|
|
272
|
+
label: /* @__PURE__ */ R("div", {
|
|
270
273
|
className: "flex items-center gap-2",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ L(n, {
|
|
272
275
|
className: "shrink-0",
|
|
273
|
-
size:
|
|
274
|
-
stroke:
|
|
276
|
+
size: _.SM,
|
|
277
|
+
stroke: v,
|
|
275
278
|
"aria-hidden": !0
|
|
276
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ L("span", {
|
|
277
280
|
className: "sr-only desktop:not-sr-only",
|
|
278
|
-
children:
|
|
281
|
+
children: ce(t, T)
|
|
279
282
|
})]
|
|
280
283
|
}),
|
|
281
284
|
disabled: j && e.authenticationType !== t
|
|
282
285
|
};
|
|
283
286
|
})
|
|
284
287
|
}),
|
|
285
|
-
e.authenticationType === o.None && /* @__PURE__ */
|
|
288
|
+
e.authenticationType === o.None && /* @__PURE__ */ L("p", {
|
|
286
289
|
className: "dial-small-text pt-2 text-secondary",
|
|
287
290
|
children: T?.openAccessDescription ?? "Open endpoint, no credentials"
|
|
288
291
|
}),
|
|
289
|
-
e.authenticationType === o.OAuth && /* @__PURE__ */
|
|
292
|
+
e.authenticationType === o.OAuth && /* @__PURE__ */ R("div", {
|
|
290
293
|
className: "flex flex-col gap-3 pt-2",
|
|
291
294
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ R("div", {
|
|
293
296
|
className: "flex flex-col gap-2",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ L(C, {
|
|
295
298
|
name: "oauth-login-mode",
|
|
296
299
|
id: "oauth-with-login",
|
|
297
300
|
value: c.WithLogin,
|
|
298
301
|
labelProps: { label: T?.withLoginOAuthLabel ?? "Standard login" },
|
|
299
302
|
isSelected: e.withLogin === c.WithLogin,
|
|
300
303
|
disabled: j,
|
|
301
|
-
onChange:
|
|
302
|
-
}), /* @__PURE__ */
|
|
304
|
+
onChange: F
|
|
305
|
+
}), /* @__PURE__ */ L(C, {
|
|
303
306
|
name: "oauth-login-mode",
|
|
304
307
|
id: "oauth-with-config",
|
|
305
308
|
value: c.WithConfig,
|
|
306
309
|
labelProps: { label: T?.withConfigOAuthLabel ?? "Custom login" },
|
|
307
310
|
isSelected: e.withLogin === c.WithConfig,
|
|
308
311
|
disabled: j,
|
|
309
|
-
onChange:
|
|
312
|
+
onChange: F
|
|
310
313
|
})]
|
|
311
314
|
}),
|
|
312
|
-
e.withLogin === c.WithConfig && /* @__PURE__ */
|
|
315
|
+
e.withLogin === c.WithConfig && /* @__PURE__ */ R("div", {
|
|
313
316
|
className: "flex flex-col gap-3",
|
|
314
317
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ L(y, {
|
|
316
319
|
id: "toolset-client-id",
|
|
317
320
|
value: e.clientId ?? "",
|
|
318
|
-
onChange: (e) =>
|
|
321
|
+
onChange: (e) => S({ clientId: e ?? "" }),
|
|
319
322
|
labelProps: {
|
|
320
323
|
label: T?.clientIdLabel ?? "Client ID",
|
|
321
324
|
required: !0
|
|
@@ -325,10 +328,10 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
325
328
|
invalid: !!t.clientId,
|
|
326
329
|
disabled: j
|
|
327
330
|
}),
|
|
328
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ L(x, {
|
|
329
332
|
id: "toolset-client-secret",
|
|
330
333
|
value: e.clientSecret ?? "",
|
|
331
|
-
onChange: (e) =>
|
|
334
|
+
onChange: (e) => S({ clientSecret: e ?? "" }),
|
|
332
335
|
labelProps: {
|
|
333
336
|
label: T?.clientSecretLabel ?? "Client secret",
|
|
334
337
|
required: !i
|
|
@@ -340,69 +343,69 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
340
343
|
invalid: !!t.clientSecret,
|
|
341
344
|
disabled: j
|
|
342
345
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ L(y, {
|
|
344
347
|
id: "toolset-authorization-endpoint",
|
|
345
348
|
value: e.authorizationEndpoint ?? "",
|
|
346
|
-
onChange: (e) =>
|
|
349
|
+
onChange: (e) => S({ authorizationEndpoint: e ?? "" }),
|
|
347
350
|
labelProps: { label: T?.authorizationEndpointLabel ?? "Authorization endpoint" },
|
|
348
351
|
placeholder: T?.authorizationEndpointPlaceholder ?? "Enter authorization endpoint",
|
|
349
352
|
error: t.authorizationEndpoint || void 0,
|
|
350
353
|
invalid: !!t.authorizationEndpoint,
|
|
351
354
|
disabled: j
|
|
352
355
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ L(y, {
|
|
354
357
|
id: "toolset-token-endpoint",
|
|
355
358
|
value: e.tokenEndpoint ?? "",
|
|
356
|
-
onChange: (e) =>
|
|
359
|
+
onChange: (e) => S({ tokenEndpoint: e ?? "" }),
|
|
357
360
|
labelProps: { label: T?.tokenEndpointLabel ?? "Token endpoint" },
|
|
358
361
|
placeholder: T?.tokenEndpointPlaceholder ?? "Enter token endpoint",
|
|
359
362
|
error: t.tokenEndpoint || void 0,
|
|
360
363
|
invalid: !!t.tokenEndpoint,
|
|
361
364
|
disabled: j
|
|
362
365
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ L(E, {
|
|
364
367
|
id: "toolset-scopes",
|
|
365
368
|
labelProps: { label: T?.scopesLabel ?? "Scopes" },
|
|
366
369
|
placeholder: T?.scopesPlaceholder ?? "Enter scopes",
|
|
367
370
|
value: e.scopes ?? [],
|
|
368
|
-
onChange: (e) =>
|
|
371
|
+
onChange: (e) => S({ scopes: e }),
|
|
369
372
|
disabled: j,
|
|
370
|
-
tagClassName:
|
|
373
|
+
tagClassName: f
|
|
371
374
|
})
|
|
372
375
|
]
|
|
373
376
|
}),
|
|
374
|
-
|
|
377
|
+
V()
|
|
375
378
|
]
|
|
376
379
|
}),
|
|
377
|
-
e.authenticationType === o.ApiKey && /* @__PURE__ */
|
|
380
|
+
e.authenticationType === o.ApiKey && /* @__PURE__ */ R("div", {
|
|
378
381
|
className: "flex flex-col gap-3 pt-2",
|
|
379
382
|
children: [
|
|
380
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ R("div", {
|
|
381
384
|
className: "flex flex-col gap-2",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ L(C, {
|
|
383
386
|
name: "apikey-login-mode",
|
|
384
387
|
id: "apikey-with-login",
|
|
385
388
|
value: c.WithLogin,
|
|
386
389
|
labelProps: { label: T?.withLoginLabel ?? "With login" },
|
|
387
390
|
isSelected: e.withLogin === c.WithLogin,
|
|
388
391
|
disabled: j,
|
|
389
|
-
onChange:
|
|
390
|
-
}), /* @__PURE__ */
|
|
392
|
+
onChange: F
|
|
393
|
+
}), /* @__PURE__ */ L(C, {
|
|
391
394
|
name: "apikey-login-mode",
|
|
392
395
|
id: "apikey-without-login",
|
|
393
396
|
value: c.WithoutLogin,
|
|
394
397
|
labelProps: { label: T?.withoutLoginLabel ?? "Without login" },
|
|
395
398
|
isSelected: e.withLogin === c.WithoutLogin,
|
|
396
399
|
disabled: j,
|
|
397
|
-
onChange:
|
|
400
|
+
onChange: F
|
|
398
401
|
})]
|
|
399
402
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ R("div", {
|
|
401
404
|
className: "flex flex-col gap-3",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
405
|
+
children: [/* @__PURE__ */ L(y, {
|
|
403
406
|
id: "toolset-key-header",
|
|
404
407
|
value: e.keyHeader ?? "",
|
|
405
|
-
onChange: (e) =>
|
|
408
|
+
onChange: (e) => S({ keyHeader: e ?? "" }),
|
|
406
409
|
labelProps: {
|
|
407
410
|
label: T?.keyHeaderLabel ?? "API Key parameter name",
|
|
408
411
|
required: !0
|
|
@@ -411,10 +414,10 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
411
414
|
error: t.keyHeader || void 0,
|
|
412
415
|
invalid: !!t.keyHeader,
|
|
413
416
|
disabled: j
|
|
414
|
-
}), e.withLogin === c.WithLogin && /* @__PURE__ */
|
|
417
|
+
}), e.withLogin === c.WithLogin && /* @__PURE__ */ L(x, {
|
|
415
418
|
id: "toolset-api-key",
|
|
416
419
|
value: e.apiKey ?? "",
|
|
417
|
-
onChange: (e) =>
|
|
420
|
+
onChange: (e) => S({ apiKey: e ?? "" }),
|
|
418
421
|
labelProps: {
|
|
419
422
|
label: T?.apiKeyLabel ?? "API key",
|
|
420
423
|
required: !0
|
|
@@ -427,46 +430,46 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
427
430
|
disabled: j
|
|
428
431
|
})]
|
|
429
432
|
}),
|
|
430
|
-
e.withLogin !== c.WithoutLogin &&
|
|
433
|
+
e.withLogin !== c.WithoutLogin && V()
|
|
431
434
|
]
|
|
432
435
|
}),
|
|
433
|
-
k && /* @__PURE__ */
|
|
436
|
+
k && /* @__PURE__ */ L(h, {
|
|
434
437
|
open: k,
|
|
435
438
|
header: T?.logoutConfirmTitle ?? "Log out?",
|
|
436
439
|
description: T?.logoutConfirmDescription ?? "Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.",
|
|
437
440
|
confirmLabel: T?.logOutLabel ?? "Log out",
|
|
438
441
|
cancelLabel: T?.cancelLabel ?? "Cancel",
|
|
439
|
-
variant:
|
|
440
|
-
isLoading:
|
|
441
|
-
disableConfirmButton:
|
|
442
|
-
onConfirm:
|
|
442
|
+
variant: g.Danger,
|
|
443
|
+
isLoading: D,
|
|
444
|
+
disableConfirmButton: D,
|
|
445
|
+
onConfirm: B,
|
|
443
446
|
onCancel: () => A(!1),
|
|
444
447
|
onClose: () => A(!1)
|
|
445
448
|
})
|
|
446
449
|
]
|
|
447
450
|
});
|
|
448
|
-
},
|
|
449
|
-
let { isCopied: r, copy: i } =
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
className:
|
|
451
|
+
}, ue = D(({ url: e, className: t, labels: n }) => {
|
|
452
|
+
let { isCopied: r, copy: i } = m(e), a = n?.copiedLabel ?? "Copied!";
|
|
453
|
+
return /* @__PURE__ */ R("div", {
|
|
454
|
+
className: p("flex flex-col gap-3", t),
|
|
452
455
|
children: [
|
|
453
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ R("div", {
|
|
454
457
|
className: "flex flex-col gap-1",
|
|
455
|
-
children: [/* @__PURE__ */
|
|
458
|
+
children: [/* @__PURE__ */ L("p", {
|
|
456
459
|
className: "dial-body-semi-text text-start text-primary",
|
|
457
460
|
children: n?.title ?? "Connect toolset"
|
|
458
|
-
}), /* @__PURE__ */
|
|
461
|
+
}), /* @__PURE__ */ L("p", {
|
|
459
462
|
className: "dial-small-text text-start text-secondary",
|
|
460
463
|
children: n?.description ?? "Copy endpoint URL to easily integrate toolset into your workflows"
|
|
461
464
|
})]
|
|
462
465
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ L("div", { children: /* @__PURE__ */ L(d, {
|
|
464
467
|
copiedLabel: a,
|
|
465
468
|
copyLabel: n?.copyLabel ?? "Copy URL",
|
|
466
469
|
isCopied: r,
|
|
467
470
|
onClick: i
|
|
468
471
|
}) }),
|
|
469
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ L("span", {
|
|
470
473
|
role: "status",
|
|
471
474
|
"aria-live": "polite",
|
|
472
475
|
className: "sr-only",
|
|
@@ -474,16 +477,16 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
474
477
|
})
|
|
475
478
|
]
|
|
476
479
|
});
|
|
477
|
-
}),
|
|
478
|
-
let [g, _] =
|
|
480
|
+
}), de = ({ form: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, connectUrl: a, listToolNames: o, authActions: s, onOAuthLogin: c, onNotifySuccess: l, onNotifyError: u, onChange: d, onAuthChange: p, onEnsureSaved: m, labels: h }) => {
|
|
481
|
+
let [g, _] = M(null), v = !!a && !!r, b = A(() => [{
|
|
479
482
|
value: B.Http,
|
|
480
483
|
label: "HTTP"
|
|
481
484
|
}, {
|
|
482
485
|
value: B.Sse,
|
|
483
486
|
label: "SSE"
|
|
484
487
|
}], []);
|
|
485
|
-
return
|
|
486
|
-
if (!r || !o || !
|
|
488
|
+
return k(() => {
|
|
489
|
+
if (!r || !o || !Q(e.auth, i)) {
|
|
487
490
|
_(null);
|
|
488
491
|
return;
|
|
489
492
|
}
|
|
@@ -504,56 +507,56 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
504
507
|
e.auth,
|
|
505
508
|
e.endpoint,
|
|
506
509
|
o
|
|
507
|
-
]), /* @__PURE__ */
|
|
510
|
+
]), /* @__PURE__ */ R("div", {
|
|
508
511
|
className: "flex max-w-[1060px] flex-col gap-4",
|
|
509
512
|
children: [
|
|
510
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ L(y, {
|
|
511
514
|
id: "toolset-endpoint",
|
|
512
515
|
value: e.endpoint,
|
|
513
516
|
onChange: (e) => d({ endpoint: e ?? "" }),
|
|
514
517
|
labelProps: {
|
|
515
|
-
label:
|
|
518
|
+
label: h?.endpointLabel ?? "Endpoint",
|
|
516
519
|
required: !0
|
|
517
520
|
},
|
|
518
|
-
placeholder:
|
|
519
|
-
caption:
|
|
521
|
+
placeholder: h?.endpointPlaceholder ?? "https://...",
|
|
522
|
+
caption: h?.endpointCaption ?? "The HTTPS address where the server accepts MCP requests. Choose the transport under Protocol below.",
|
|
520
523
|
error: t.endpoint || void 0,
|
|
521
524
|
invalid: !!t.endpoint
|
|
522
525
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ L(w, {
|
|
524
527
|
labelProps: {
|
|
525
|
-
label:
|
|
528
|
+
label: h?.protocolLabel ?? "Protocol",
|
|
526
529
|
required: !0
|
|
527
530
|
},
|
|
528
531
|
id: "toolset-protocol",
|
|
529
|
-
items:
|
|
532
|
+
items: b,
|
|
530
533
|
value: e.protocol,
|
|
531
534
|
onChange: (e) => {
|
|
532
535
|
d({ protocol: e });
|
|
533
536
|
}
|
|
534
537
|
}),
|
|
535
|
-
g ? /* @__PURE__ */
|
|
538
|
+
g ? /* @__PURE__ */ L(T, {
|
|
536
539
|
id: "toolset-allowed-tools",
|
|
537
540
|
multiple: !0,
|
|
538
541
|
searchable: !0,
|
|
539
542
|
selectAll: !0,
|
|
540
|
-
labelProps: { label:
|
|
541
|
-
placeholder:
|
|
543
|
+
labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
|
|
544
|
+
placeholder: h?.allowedToolsSelectPlaceholder ?? "Select allowed tools",
|
|
542
545
|
options: g.map((e) => ({
|
|
543
546
|
value: e,
|
|
544
547
|
label: e
|
|
545
548
|
})),
|
|
546
549
|
value: e.allowedTools,
|
|
547
550
|
onChange: (e) => d({ allowedTools: e })
|
|
548
|
-
}) : /* @__PURE__ */
|
|
551
|
+
}) : /* @__PURE__ */ L(E, {
|
|
549
552
|
id: "toolset-allowed-tools",
|
|
550
|
-
labelProps: { label:
|
|
551
|
-
placeholder:
|
|
553
|
+
labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
|
|
554
|
+
placeholder: h?.allowedToolsPlaceholder ?? "Add tools, comma separated",
|
|
552
555
|
value: e.allowedTools,
|
|
553
556
|
onChange: (e) => d({ allowedTools: e }),
|
|
554
|
-
tagClassName:
|
|
557
|
+
tagClassName: f
|
|
555
558
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ L(le, {
|
|
557
560
|
auth: e.auth,
|
|
558
561
|
errors: t,
|
|
559
562
|
isSaving: n,
|
|
@@ -564,182 +567,182 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
564
567
|
onOAuthLogin: c,
|
|
565
568
|
onNotifySuccess: l,
|
|
566
569
|
onNotifyError: u,
|
|
567
|
-
onAuthChange:
|
|
568
|
-
onEnsureSaved:
|
|
569
|
-
labels:
|
|
570
|
+
onAuthChange: p,
|
|
571
|
+
onEnsureSaved: m,
|
|
572
|
+
labels: h?.auth
|
|
570
573
|
}),
|
|
571
|
-
v && /* @__PURE__ */
|
|
574
|
+
v && /* @__PURE__ */ L(ue, {
|
|
572
575
|
url: a ?? "",
|
|
573
|
-
labels:
|
|
576
|
+
labels: h?.connect,
|
|
574
577
|
className: "border-t border-tertiary pt-4"
|
|
575
578
|
})
|
|
576
579
|
]
|
|
577
580
|
});
|
|
578
|
-
},
|
|
581
|
+
}, fe = [
|
|
579
582
|
"keyHeader",
|
|
580
583
|
"apiKey",
|
|
581
584
|
"clientId",
|
|
582
585
|
"clientSecret",
|
|
583
586
|
"authorizationEndpoint",
|
|
584
587
|
"tokenEndpoint"
|
|
585
|
-
],
|
|
588
|
+
], pe = [
|
|
586
589
|
"name",
|
|
587
590
|
"version",
|
|
588
591
|
"endpoint",
|
|
589
|
-
...
|
|
590
|
-
],
|
|
592
|
+
...fe
|
|
593
|
+
], me = new Set(pe), he = (e) => {
|
|
591
594
|
let t = {};
|
|
592
|
-
for (let n of Object.keys(e))
|
|
595
|
+
for (let n of Object.keys(e)) me.has(n) && (t[n] = !0);
|
|
593
596
|
return t;
|
|
594
|
-
},
|
|
595
|
-
let
|
|
596
|
-
|
|
597
|
-
|
|
597
|
+
}, ge = ({ initialForm: e, toolsetId: n, onPersist: s, onPostSaveLogin: l, onToolsetsChanged: d, onSaveSuccess: f, onSaveComplete: m, onBack: h, buildMcpUrl: g, listToolNames: _, authActions: v, onOAuthLogin: y, onNotifySuccess: x, onNotifyError: C, bucket: w, FileManagerModal: ee, resolveIconUrl: T, allowedMimeTypes: E, maxFileSizeBytes: D, availableLocaleOptions: N, labels: P }) => {
|
|
598
|
+
let F = !!n, [te, I] = M(""), B = n || te, [V, H] = M(e), [U, W] = M(!1), [G, K] = M({}), [q, Y] = M({}), X = j(null);
|
|
599
|
+
k(() => {
|
|
600
|
+
H(e), X.current = e, K({}), Y({}), I("");
|
|
598
601
|
}, [e]);
|
|
599
|
-
let
|
|
600
|
-
|
|
602
|
+
let Z = O((e) => {
|
|
603
|
+
H((t) => ({
|
|
601
604
|
...t,
|
|
602
605
|
...e
|
|
603
|
-
})),
|
|
606
|
+
})), Y((t) => ({
|
|
604
607
|
...t,
|
|
605
|
-
...
|
|
606
|
-
})),
|
|
608
|
+
...he(e)
|
|
609
|
+
})), K((t) => {
|
|
607
610
|
let n = { ...t };
|
|
608
611
|
for (let t of Object.keys(e)) delete n[t];
|
|
609
612
|
return n;
|
|
610
613
|
});
|
|
611
|
-
}, []),
|
|
612
|
-
|
|
614
|
+
}, []), Q = O((e) => {
|
|
615
|
+
H((t) => ({
|
|
613
616
|
...t,
|
|
614
617
|
auth: {
|
|
615
618
|
...t.auth,
|
|
616
619
|
...e
|
|
617
620
|
}
|
|
618
|
-
})),
|
|
621
|
+
})), Y((t) => ({
|
|
619
622
|
...t,
|
|
620
|
-
...
|
|
621
|
-
})),
|
|
623
|
+
...he(e)
|
|
624
|
+
})), K((t) => {
|
|
622
625
|
let n = { ...t };
|
|
623
|
-
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of
|
|
626
|
+
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of fe) delete n[e];
|
|
624
627
|
else for (let t of Object.keys(e)) delete n[t];
|
|
625
628
|
return n;
|
|
626
629
|
}), "isLoggedIn" in e && d();
|
|
627
|
-
}, [d]),
|
|
628
|
-
if (
|
|
629
|
-
|
|
630
|
+
}, [d]), ie = O(async () => {
|
|
631
|
+
if (B && X.current != null && JSON.stringify(X.current) === JSON.stringify(V)) return B;
|
|
632
|
+
W(!0);
|
|
630
633
|
try {
|
|
631
|
-
let e = await s(
|
|
632
|
-
return e ? (
|
|
634
|
+
let e = await s(V, B);
|
|
635
|
+
return e ? (B || I(e), X.current = V, await d(), e) : null;
|
|
633
636
|
} catch {
|
|
634
637
|
return null;
|
|
635
638
|
} finally {
|
|
636
|
-
|
|
639
|
+
W(!1);
|
|
637
640
|
}
|
|
638
641
|
}, [
|
|
642
|
+
V,
|
|
639
643
|
B,
|
|
640
|
-
z,
|
|
641
644
|
s,
|
|
642
645
|
d
|
|
643
|
-
]),
|
|
644
|
-
let n =
|
|
645
|
-
return i.name === t.Required && (r.name = n?.nameRequired ?? "Name is required"), i.version === t.InvalidFormat && (r.version = n?.versionInvalid ?? "Version may only contain letters, digits, dots, underscores, and dashes"), e.endpoint.trim() ? J(e.endpoint) || (r.endpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL") : r.endpoint = n?.endpointRequired ?? "Endpoint is required", e.auth.isLoggedIn || (e.auth.authenticationType === o.ApiKey && (e.auth.keyHeader?.trim() || (r.keyHeader = n?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === c.WithLogin && !e.auth.apiKey?.trim() && (r.apiKey = n?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === o.OAuth && e.auth.withLogin === c.WithConfig && (e.auth.clientId?.trim() || (r.clientId = n?.clientIdRequired ?? "Client ID is required"), !
|
|
646
|
-
}, [
|
|
647
|
-
let e =
|
|
646
|
+
]), ae = O(async () => await ie() ?? !1, [ie]), $ = O((e) => {
|
|
647
|
+
let n = P?.validation, r = {}, i = a(e, { validateVersionPattern: !0 });
|
|
648
|
+
return i.name === t.Required && (r.name = n?.nameRequired ?? "Name is required"), i.version === t.InvalidFormat && (r.version = n?.versionInvalid ?? "Version may only contain letters, digits, dots, underscores, and dashes"), e.endpoint.trim() ? J(e.endpoint) || (r.endpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL") : r.endpoint = n?.endpointRequired ?? "Endpoint is required", e.auth.isLoggedIn || (e.auth.authenticationType === o.ApiKey && (e.auth.keyHeader?.trim() || (r.keyHeader = n?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === c.WithLogin && !e.auth.apiKey?.trim() && (r.apiKey = n?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === o.OAuth && e.auth.withLogin === c.WithConfig && (e.auth.clientId?.trim() || (r.clientId = n?.clientIdRequired ?? "Client ID is required"), !F && !e.auth.clientSecret?.trim() && (r.clientSecret = n?.clientSecretRequired ?? "Client secret is required"), e.auth.authorizationEndpoint?.trim() && !J(e.auth.authorizationEndpoint) && (r.authorizationEndpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL"), e.auth.tokenEndpoint?.trim() && !J(e.auth.tokenEndpoint) && (r.tokenEndpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL"))), r;
|
|
649
|
+
}, [P, F]), se = O(async () => {
|
|
650
|
+
let e = $(V);
|
|
648
651
|
if (Object.keys(e).length > 0) {
|
|
649
|
-
|
|
652
|
+
K(e);
|
|
650
653
|
return;
|
|
651
654
|
}
|
|
652
|
-
|
|
655
|
+
K({}), W(!0);
|
|
653
656
|
try {
|
|
654
|
-
let e = await s(
|
|
657
|
+
let e = await s(V, B);
|
|
655
658
|
if (!e) return;
|
|
656
|
-
await d(), f(
|
|
659
|
+
await d(), f(V);
|
|
657
660
|
try {
|
|
658
|
-
await l(e,
|
|
661
|
+
await l(e, V.auth), m();
|
|
659
662
|
} catch (e) {
|
|
660
663
|
let { traceId: t } = await u(e);
|
|
661
|
-
|
|
664
|
+
C(P?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
662
665
|
}
|
|
663
666
|
} catch {} finally {
|
|
664
|
-
|
|
667
|
+
W(!1);
|
|
665
668
|
}
|
|
666
669
|
}, [
|
|
670
|
+
V,
|
|
671
|
+
$,
|
|
667
672
|
B,
|
|
668
|
-
Q,
|
|
669
|
-
z,
|
|
670
673
|
s,
|
|
671
674
|
d,
|
|
672
675
|
f,
|
|
673
|
-
|
|
676
|
+
m,
|
|
674
677
|
l,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
]),
|
|
678
|
-
let e =
|
|
679
|
-
for (let n of
|
|
680
|
-
if (!
|
|
678
|
+
C,
|
|
679
|
+
P
|
|
680
|
+
]), ce = A(() => !re(V, F), [V, F]), le = A(() => {
|
|
681
|
+
let e = $(V), t = { ...G };
|
|
682
|
+
for (let n of pe) {
|
|
683
|
+
if (!q[n]) continue;
|
|
681
684
|
let r = e[n];
|
|
682
685
|
r ? t[n] = r : delete t[n];
|
|
683
686
|
}
|
|
684
687
|
return t;
|
|
685
688
|
}, [
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
]),
|
|
691
|
-
return /* @__PURE__ */
|
|
692
|
-
title:
|
|
693
|
-
onBack:
|
|
694
|
-
backAriaLabel:
|
|
695
|
-
isSaving:
|
|
696
|
-
labels: { savingStatusLabel:
|
|
697
|
-
actions: /* @__PURE__ */
|
|
698
|
-
label:
|
|
699
|
-
onClick:
|
|
700
|
-
}), /* @__PURE__ */
|
|
701
|
-
label:
|
|
702
|
-
disabled:
|
|
703
|
-
onClick:
|
|
689
|
+
q,
|
|
690
|
+
G,
|
|
691
|
+
V,
|
|
692
|
+
$
|
|
693
|
+
]), ue = g && B ? g(B) : void 0;
|
|
694
|
+
return /* @__PURE__ */ L(r, {
|
|
695
|
+
title: F ? P?.layout?.editTitle ?? "Edit toolset" : P?.layout?.createTitle ?? "Create toolset",
|
|
696
|
+
onBack: h,
|
|
697
|
+
backAriaLabel: P?.layout?.backAriaLabel ?? "Back to catalog",
|
|
698
|
+
isSaving: U,
|
|
699
|
+
labels: { savingStatusLabel: P?.layout?.savingStatusLabel ?? "Saving" },
|
|
700
|
+
actions: /* @__PURE__ */ R(ne, { children: [/* @__PURE__ */ L(b, {
|
|
701
|
+
label: P?.layout?.cancelLabel ?? "Cancel",
|
|
702
|
+
onClick: h
|
|
703
|
+
}), /* @__PURE__ */ L(S, {
|
|
704
|
+
label: F ? P?.layout?.saveLabel ?? "Save" : P?.layout?.createLabel ?? "Create",
|
|
705
|
+
disabled: ce,
|
|
706
|
+
onClick: se
|
|
704
707
|
})] }),
|
|
705
|
-
leftContent: /* @__PURE__ */
|
|
706
|
-
title:
|
|
707
|
-
className: "border-0 p-4 desktop:p-6",
|
|
708
|
-
children: /* @__PURE__ */
|
|
709
|
-
form:
|
|
710
|
-
errors:
|
|
711
|
-
bucket:
|
|
712
|
-
FileManagerModal:
|
|
713
|
-
resolveIconUrl:
|
|
714
|
-
allowedMimeTypes:
|
|
715
|
-
maxFileSizeBytes:
|
|
716
|
-
availableLocaleOptions:
|
|
717
|
-
onChange:
|
|
718
|
-
labels:
|
|
708
|
+
leftContent: /* @__PURE__ */ L(i, {
|
|
709
|
+
title: P?.layout?.metadataSectionTitle ?? "Metadata",
|
|
710
|
+
className: p("border-0 p-4 desktop:p-6", z.metadataSection),
|
|
711
|
+
children: /* @__PURE__ */ L(oe, {
|
|
712
|
+
form: V,
|
|
713
|
+
errors: le,
|
|
714
|
+
bucket: w,
|
|
715
|
+
FileManagerModal: ee,
|
|
716
|
+
resolveIconUrl: T,
|
|
717
|
+
allowedMimeTypes: E,
|
|
718
|
+
maxFileSizeBytes: D,
|
|
719
|
+
availableLocaleOptions: N,
|
|
720
|
+
onChange: Z,
|
|
721
|
+
labels: P?.general
|
|
719
722
|
})
|
|
720
723
|
}),
|
|
721
|
-
rightContent: /* @__PURE__ */
|
|
722
|
-
title:
|
|
723
|
-
className: "border-0 p-4 desktop:p-6",
|
|
724
|
-
children: /* @__PURE__ */
|
|
725
|
-
form:
|
|
726
|
-
errors:
|
|
727
|
-
isSaving:
|
|
728
|
-
toolsetId:
|
|
729
|
-
isEditMode:
|
|
730
|
-
connectUrl:
|
|
724
|
+
rightContent: /* @__PURE__ */ L(i, {
|
|
725
|
+
title: P?.layout?.setupSectionTitle ?? "Setup",
|
|
726
|
+
className: p("border-0 p-4 desktop:p-6", z.setupSection),
|
|
727
|
+
children: /* @__PURE__ */ L(de, {
|
|
728
|
+
form: V,
|
|
729
|
+
errors: le,
|
|
730
|
+
isSaving: U,
|
|
731
|
+
toolsetId: B,
|
|
732
|
+
isEditMode: F,
|
|
733
|
+
connectUrl: ue,
|
|
731
734
|
listToolNames: _,
|
|
732
|
-
authActions:
|
|
733
|
-
onOAuthLogin:
|
|
734
|
-
onNotifySuccess:
|
|
735
|
-
onNotifyError:
|
|
736
|
-
onChange:
|
|
737
|
-
onAuthChange:
|
|
738
|
-
onEnsureSaved:
|
|
739
|
-
labels:
|
|
735
|
+
authActions: v,
|
|
736
|
+
onOAuthLogin: y,
|
|
737
|
+
onNotifySuccess: x,
|
|
738
|
+
onNotifyError: C,
|
|
739
|
+
onChange: Z,
|
|
740
|
+
onAuthChange: Q,
|
|
741
|
+
onEnsureSaved: ae,
|
|
742
|
+
labels: P?.settings
|
|
740
743
|
})
|
|
741
744
|
})
|
|
742
745
|
});
|
|
743
746
|
};
|
|
744
747
|
//#endregion
|
|
745
|
-
export { U as AUTH_TYPE_ICONS, V as DEFAULT_TOOLSET_NAME, H as DEFAULT_TOOLSET_VERSION,
|
|
748
|
+
export { U as AUTH_TYPE_ICONS, V as DEFAULT_TOOLSET_NAME, H as DEFAULT_TOOLSET_VERSION, oe as GeneralForm, z as TOOLSET_EDITOR_CLASS, ge as ToolsetEditor, $ as ToolsetOAuthLoginStatus, B as ToolsetTransportType, K as getDefaultToolsetForm, W as getStorageSafeUniqueToolsetName, Q as isToolsetAuthValid, re as isToolsetFormValid, J as isValidEndpointUrl, X as normalizeReturnedEndpointUrl };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-toolset-editor",
|
|
3
3
|
"description": "Host-agnostic form for authoring and editing a DIAL MCP toolset",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.50",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-builder-form": "1.2.0-dev.
|
|
21
|
+
"@epam/ai-dial-builder-form": "1.2.0-dev.50"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@epam/ai-dial-chat-hooks": "1.2.0-dev.
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
26
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
24
|
+
"@epam/ai-dial-chat-hooks": "1.2.0-dev.50",
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.50",
|
|
26
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.7",
|
|
27
27
|
"react": "^19.2.8"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|