@epam/ai-dial-toolset-editor 1.1.15 → 1.1.17
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/index.js +25 -27
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { memo as C, useCallback as w, useEffect as T, useMemo as E, useRef as D,
|
|
|
5
5
|
import { IconBrandOauth as k, IconKey as A, IconLockOff as j, IconLogin as te, IconLogout as M } from "@tabler/icons-react";
|
|
6
6
|
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
7
7
|
import { CopyButton as I, TAG_INPUT_TAG_CLASS_NAME as L, mergeClasses as R, useCodeCopy as z } from "@epam/ai-dial-chat-shared";
|
|
8
|
-
|
|
8
|
+
// src/constants/toolsets.ts
|
|
9
9
|
var B = /* @__PURE__ */ function(e) {
|
|
10
10
|
return e.Http = "HTTP", e.Sse = "SSE", e;
|
|
11
11
|
}({}), V = "New toolset", H = "0.0.1", U = {
|
|
@@ -53,7 +53,7 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
53
53
|
if (q(t)) return t;
|
|
54
54
|
}
|
|
55
55
|
return t;
|
|
56
|
-
}, ne = (e) => !e?.trim() || J(e), Z = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === o.ApiKey ? e.keyHeader?.trim() ? e.withLogin === c.WithoutLogin
|
|
56
|
+
}, ne = (e) => !e?.trim() || J(e), Z = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === o.ApiKey ? e.keyHeader?.trim() ? e.withLogin === c.WithoutLogin || !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === o.OAuth && e.withLogin === c.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && ne(e.authorizationEndpoint) && ne(e.tokenEndpoint) : !0, re = (e, t = !1) => Object.keys(a(e, { validateVersionPattern: !0 })).length === 0 && J(e.endpoint) && Z(e.auth, t), ie = {
|
|
57
57
|
name: {
|
|
58
58
|
label: "Name",
|
|
59
59
|
placeholder: "Enter name"
|
|
@@ -119,16 +119,16 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
119
119
|
uploadProgressTitle: "Uploading files",
|
|
120
120
|
cancelLabel: "Cancel"
|
|
121
121
|
}, ae = ({ form: t, errors: r, bucket: i, FileManagerModal: a, resolveIconUrl: o, allowedMimeTypes: s, maxFileSizeBytes: c, availableLocaleOptions: u, onChange: d, onNameBlur: f, onVersionBlur: p, labels: m }) => {
|
|
122
|
-
let [h, g] = O(!1), _ = m?.form ?? ie, v = m?.avatarPicker ?? Q, y = E(() => o(t.iconUrl), [t.iconUrl, o])
|
|
122
|
+
let [h, g] = O(!1), _ = m?.form ?? ie, v = m?.avatarPicker ?? Q, y = E(() => o(t.iconUrl), [t.iconUrl, o]), b = {
|
|
123
|
+
name: t.name,
|
|
124
|
+
description: t.description,
|
|
125
|
+
iconUrl: t.iconUrl,
|
|
126
|
+
version: t.version,
|
|
127
|
+
topics: t.topics,
|
|
128
|
+
otherLocales: t.otherLocales
|
|
129
|
+
};
|
|
123
130
|
return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(n, {
|
|
124
|
-
values:
|
|
125
|
-
name: t.name,
|
|
126
|
-
description: t.description,
|
|
127
|
-
iconUrl: t.iconUrl,
|
|
128
|
-
version: t.version,
|
|
129
|
-
topics: t.topics,
|
|
130
|
-
otherLocales: t.otherLocales
|
|
131
|
-
},
|
|
131
|
+
values: b,
|
|
132
132
|
errors: r,
|
|
133
133
|
onChange: d,
|
|
134
134
|
onNameBlur: f,
|
|
@@ -645,23 +645,22 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
645
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"), !I && !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;
|
|
646
646
|
}, [M, I]), $ = w(async () => {
|
|
647
647
|
let e = Q(B);
|
|
648
|
-
if (Object.keys(e).length > 0)
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
G({}), U(!0);
|
|
653
|
-
try {
|
|
654
|
-
let e = await s(B, z);
|
|
655
|
-
if (!e) return;
|
|
656
|
-
await d(), f(B);
|
|
648
|
+
if (Object.keys(e).length > 0) G(e);
|
|
649
|
+
else {
|
|
650
|
+
G({}), U(!0);
|
|
657
651
|
try {
|
|
658
|
-
await
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
652
|
+
let e = await s(B, z);
|
|
653
|
+
if (!e) return;
|
|
654
|
+
await d(), f(B);
|
|
655
|
+
try {
|
|
656
|
+
await l(e, B.auth), p();
|
|
657
|
+
} catch (e) {
|
|
658
|
+
let { traceId: t } = await u(e);
|
|
659
|
+
x(M?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
660
|
+
}
|
|
661
|
+
} catch {} finally {
|
|
662
|
+
U(!1);
|
|
662
663
|
}
|
|
663
|
-
} catch {} finally {
|
|
664
|
-
U(!1);
|
|
665
664
|
}
|
|
666
665
|
}, [
|
|
667
666
|
B,
|
|
@@ -741,5 +740,4 @@ var B = /* @__PURE__ */ function(e) {
|
|
|
741
740
|
})
|
|
742
741
|
});
|
|
743
742
|
};
|
|
744
|
-
//#endregion
|
|
745
743
|
export { U as AUTH_TYPE_ICONS, V as DEFAULT_TOOLSET_NAME, H as DEFAULT_TOOLSET_VERSION, ae as GeneralForm, he as ToolsetEditor, $ as ToolsetOAuthLoginStatus, B as ToolsetTransportType, K as getDefaultToolsetForm, W as getStorageSafeUniqueToolsetName, Z 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.1.
|
|
4
|
+
"version": "1.1.17",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-builder-form": "1.1.
|
|
21
|
+
"@epam/ai-dial-builder-form": "1.1.17"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@epam/ai-dial-chat-hooks": "1.1.
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.1.
|
|
24
|
+
"@epam/ai-dial-chat-hooks": "1.1.17",
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.1.17",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.14.2",
|
|
27
27
|
"react": "^19.2.8"
|
|
28
28
|
},
|