@epam/ai-dial-toolset-editor 1.3.0-dev.235 → 1.3.0-dev.241
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/components/ToolsetEditor/ToolsetEditor.d.ts.map +1 -1
- package/constants/toolsets.d.ts +3 -0
- package/constants/toolsets.d.ts.map +1 -1
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +293 -327
- package/models/general-form-labels.d.ts +14 -0
- package/models/general-form-labels.d.ts.map +1 -0
- package/models/toolset-editor-props.d.ts +4 -13
- package/models/toolset-editor-props.d.ts.map +1 -1
- package/package.json +4 -4
- package/components/GeneralForm/GeneralForm.d.ts +0 -8
- package/components/GeneralForm/GeneralForm.d.ts.map +0 -1
- package/models/general-form-props.d.ts +0 -48
- package/models/general-form-props.d.ts.map +0 -1
|
@@ -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":"AAmBA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA+C5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAodhD,CAAC"}
|
package/constants/toolsets.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeploymentCreationFormLabels } from '../../../builder-form/src/index.ts';
|
|
1
2
|
import { ToolsetAuthTypes } from '../../../chat-hooks/src/index.ts';
|
|
2
3
|
import { TablerIcon } from '@tabler/icons-react';
|
|
3
4
|
export declare enum ToolsetTransportType {
|
|
@@ -8,6 +9,8 @@ export declare enum ToolsetTransportType {
|
|
|
8
9
|
}
|
|
9
10
|
/** Default display version seeded into a new toolset form; the shared deployment default. */
|
|
10
11
|
export declare const DEFAULT_TOOLSET_VERSION = "1.0.0";
|
|
12
|
+
/** Toolset-flavoured English metadata field labels used when the host omits `labels.general.form`. */
|
|
13
|
+
export declare const DEFAULT_TOOLSET_METADATA_LABELS: DeploymentCreationFormLabels;
|
|
11
14
|
/** Icon shown for each toolset authentication-type segment; labels arrive via the auth labels. */
|
|
12
15
|
export declare const AUTH_TYPE_ICONS: Record<ToolsetAuthTypes, TablerIcon>;
|
|
13
16
|
//# sourceMappingURL=toolsets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolsets.d.ts","sourceRoot":"","sources":["../../src/constants/toolsets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toolsets.d.ts","sourceRoot":"","sources":["../../src/constants/toolsets.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,oBAAY,oBAAoB;IAC9B,qCAAqC;IACrC,IAAI,SAAS;IACb,wCAAwC;IACxC,GAAG,QAAQ;CACZ;AAED,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,UAA6B,CAAC;AAElE,sGAAsG;AACtG,eAAO,MAAM,+BAA+B,EAAE,4BA8B7C,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAIhE,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { ToolsetEditor } from './components/ToolsetEditor/ToolsetEditor';
|
|
2
|
-
export { GeneralForm } from './components/GeneralForm/GeneralForm';
|
|
3
2
|
export type { ToolsetEditorLabels, ToolsetEditorLayoutLabels, ToolsetEditorProps, ToolsetEditorValidationLabels, } from './models/toolset-editor-props';
|
|
4
|
-
export type { GeneralFormLabels
|
|
3
|
+
export type { GeneralFormLabels } from './models/general-form-labels';
|
|
5
4
|
export type { ConnectMcpUrlContentLabels, SettingsFormLabels, } from './models/settings-form-props';
|
|
6
5
|
export type { AuthSectionLabels } from './models/auth-section-props';
|
|
7
6
|
export { ToolsetOAuthLoginStatus } from './models/toolset-oauth-login';
|
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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,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,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,162 +1,129 @@
|
|
|
1
1
|
import { DEFAULT_DEPLOYMENT_VERSION as e, DeploymentCreationFieldErrorCode as t, EntityEditor as n, MetadataField as r, MetadataForm as i, useMetadataForm as a, validateDeploymentCreationFields as o } from "@epam/ai-dial-builder-form";
|
|
2
|
-
import { ToolsetAuthTypes as s, ToolsetCredentialsLevel as c, WithLogin as l,
|
|
3
|
-
import { CopyButton as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { IconBrandOauth as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { ToolsetAuthTypes as s, ToolsetCredentialsLevel as c, WithLogin as l, getApiErrorDetails as u } from "@epam/ai-dial-chat-hooks";
|
|
3
|
+
import { CopyButton as d, ENTITY_DESCRIPTION_MAX_LENGTH as f, ENTITY_NAME_MAX_LENGTH as p, TAG_INPUT_TAG_CLASS_NAME as m, TextRefinementField as h, mergeClasses as g, useCodeCopy as _, useTextRefinement as v } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { memo as y, useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
5
|
+
import { IconBrandOauth as T, IconKey as E, IconLockOff as D, IconLogin as ee, IconLogout as te } from "@tabler/icons-react";
|
|
6
|
+
import { ConfirmationPopup as ne, ConfirmationPopupVariant as O, DIAL_ICON_SIZE as k, DIAL_KIT_ICON_STROKE as A, Input as j, NeutralButton as M, PasswordInput as N, Radio as P, RadioGroup as F, SegmentedControl as I, Select as L, TagInput as re } from "@epam/ai-dial-ui-kit";
|
|
7
|
+
import { jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
8
8
|
//#region src/constants/public-class-names.ts
|
|
9
|
-
var
|
|
9
|
+
var ie = {
|
|
10
10
|
metadataSection: "dial-toolset-editor-metadata-section",
|
|
11
11
|
setupSection: "dial-toolset-editor-setup-section"
|
|
12
|
-
},
|
|
12
|
+
}, B = /* @__PURE__ */ function(e) {
|
|
13
13
|
return e.Http = "HTTP", e.Sse = "SSE", e;
|
|
14
|
-
}({}),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
14
|
+
}({}), ae = e, oe = {
|
|
15
|
+
name: {
|
|
16
|
+
label: "Name",
|
|
17
|
+
placeholder: "Enter name"
|
|
18
|
+
},
|
|
19
|
+
description: {
|
|
20
|
+
label: "Description",
|
|
21
|
+
placeholder: "Describe what this toolset does"
|
|
22
|
+
},
|
|
23
|
+
iconUrl: {
|
|
24
|
+
label: "Avatar",
|
|
25
|
+
addAvatarLabel: "Add avatar",
|
|
26
|
+
captionText: "PNG, JPG or SVG (max 1 MB)"
|
|
27
|
+
},
|
|
28
|
+
version: {
|
|
29
|
+
label: "Version",
|
|
30
|
+
placeholder: "e.g. 1.0.0"
|
|
31
|
+
},
|
|
32
|
+
topics: {
|
|
33
|
+
label: "Tags",
|
|
34
|
+
placeholder: "Add tags, comma separated"
|
|
35
|
+
},
|
|
36
|
+
otherLocales: {
|
|
37
|
+
summaryLabel: "Locales",
|
|
38
|
+
addLabel: "Add locales",
|
|
39
|
+
editLabel: "Edit locales",
|
|
40
|
+
popupTitle: "Add locale",
|
|
41
|
+
addLocaleLabel: "Add locale",
|
|
42
|
+
localeRowLabel: "Locale",
|
|
43
|
+
languageLabel: "Language",
|
|
44
|
+
nameLabel: "Name",
|
|
45
|
+
namePlaceholder: "Enter name",
|
|
46
|
+
descriptionLabel: "About",
|
|
47
|
+
descriptionPlaceholder: "Enter brief description",
|
|
48
|
+
deleteAriaLabel: "Delete locale",
|
|
49
|
+
cancelLabel: "Cancel",
|
|
50
|
+
saveLabel: "Save"
|
|
51
|
+
},
|
|
52
|
+
ariaLabel: "General"
|
|
53
|
+
}, V = {
|
|
54
|
+
[s.OAuth]: T,
|
|
55
|
+
[s.ApiKey]: E,
|
|
56
|
+
[s.None]: D
|
|
57
|
+
}, se = () => ({
|
|
19
58
|
authenticationType: s.None,
|
|
20
59
|
withLogin: l.WithoutLogin,
|
|
21
60
|
isLoggedIn: !1
|
|
22
|
-
}),
|
|
61
|
+
}), H = () => ({
|
|
23
62
|
name: "",
|
|
24
|
-
version:
|
|
63
|
+
version: ae,
|
|
25
64
|
iconUrl: "",
|
|
26
65
|
description: "",
|
|
27
66
|
topics: [],
|
|
28
67
|
otherLocales: [],
|
|
29
68
|
endpoint: "",
|
|
30
|
-
protocol:
|
|
69
|
+
protocol: B.Http,
|
|
31
70
|
allowedTools: [],
|
|
32
|
-
auth:
|
|
33
|
-
}),
|
|
71
|
+
auth: se()
|
|
72
|
+
}), U = (e) => {
|
|
34
73
|
if (!/^https?:\/\//.test(e) || e.endsWith(".") || e.endsWith("//")) return !1;
|
|
35
74
|
try {
|
|
36
75
|
return !!new URL(e);
|
|
37
76
|
} catch {
|
|
38
77
|
return !1;
|
|
39
78
|
}
|
|
40
|
-
},
|
|
79
|
+
}, W = (e) => U(e.trim()), ce = (e) => e.replace(/^(https?):\/([^/])/, "$1://$2"), le = (e) => {
|
|
41
80
|
let t = e?.trim() ?? "";
|
|
42
|
-
if (!t ||
|
|
81
|
+
if (!t || U(t)) return t;
|
|
43
82
|
let n = [t];
|
|
44
83
|
try {
|
|
45
84
|
let e = decodeURIComponent(t);
|
|
46
85
|
e !== t && n.push(e);
|
|
47
86
|
} catch {}
|
|
48
87
|
for (let e of n) {
|
|
49
|
-
let t =
|
|
50
|
-
if (
|
|
88
|
+
let t = ce(e);
|
|
89
|
+
if (U(t)) return t;
|
|
51
90
|
}
|
|
52
91
|
return t;
|
|
53
|
-
}, G = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === s.ApiKey ? e.keyHeader?.trim() ? e.withLogin === l.WithoutLogin || !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === s.OAuth && e.withLogin === l.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) &&
|
|
92
|
+
}, G = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === s.ApiKey ? e.keyHeader?.trim() ? e.withLogin === l.WithoutLogin || !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === s.OAuth && e.withLogin === l.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && W(e.authorizationEndpoint ?? "") && W(e.tokenEndpoint ?? "") : !0, ue = (e, t = !1) => Object.keys(o(e, { validateVersionPattern: !0 })).length === 0 && W(e.endpoint) && G(e.auth, t), K = /* @__PURE__ */ new Set([
|
|
54
93
|
"name",
|
|
55
94
|
"description",
|
|
56
95
|
"iconUrl",
|
|
57
96
|
"version",
|
|
58
97
|
"topics",
|
|
59
98
|
"otherLocales"
|
|
60
|
-
]),
|
|
99
|
+
]), de = (e) => ({
|
|
61
100
|
name: e.name,
|
|
62
101
|
description: e.description,
|
|
63
102
|
iconUrl: e.iconUrl,
|
|
64
103
|
version: e.version,
|
|
65
104
|
topics: e.topics,
|
|
66
105
|
otherLocales: e.otherLocales
|
|
67
|
-
}),
|
|
106
|
+
}), fe = (e) => {
|
|
68
107
|
let t = {}, n = {};
|
|
69
|
-
for (let [r, i] of Object.entries(e)) (
|
|
108
|
+
for (let [r, i] of Object.entries(e)) (K.has(r) ? t : n)[r] = i;
|
|
70
109
|
return {
|
|
71
110
|
metadata: t,
|
|
72
111
|
setup: n
|
|
73
112
|
};
|
|
74
|
-
}, K = {
|
|
75
|
-
name: {
|
|
76
|
-
label: "Name",
|
|
77
|
-
placeholder: "Enter name"
|
|
78
|
-
},
|
|
79
|
-
description: {
|
|
80
|
-
label: "Description",
|
|
81
|
-
placeholder: "Describe what this toolset does"
|
|
82
|
-
},
|
|
83
|
-
iconUrl: {
|
|
84
|
-
label: "Avatar",
|
|
85
|
-
addAvatarLabel: "Add avatar",
|
|
86
|
-
captionText: "PNG, JPG or SVG (max 1 MB)"
|
|
87
|
-
},
|
|
88
|
-
version: {
|
|
89
|
-
label: "Version",
|
|
90
|
-
placeholder: "e.g. 1.0.0"
|
|
91
|
-
},
|
|
92
|
-
topics: {
|
|
93
|
-
label: "Tags",
|
|
94
|
-
placeholder: "Add tags, comma separated"
|
|
95
|
-
},
|
|
96
|
-
otherLocales: {
|
|
97
|
-
summaryLabel: "Locales",
|
|
98
|
-
addLabel: "Add locales",
|
|
99
|
-
editLabel: "Edit locales",
|
|
100
|
-
popupTitle: "Add locale",
|
|
101
|
-
addLocaleLabel: "Add locale",
|
|
102
|
-
localeRowLabel: "Locale",
|
|
103
|
-
languageLabel: "Language",
|
|
104
|
-
nameLabel: "Name",
|
|
105
|
-
namePlaceholder: "Enter name",
|
|
106
|
-
descriptionLabel: "About",
|
|
107
|
-
descriptionPlaceholder: "Enter brief description",
|
|
108
|
-
deleteAriaLabel: "Delete locale",
|
|
109
|
-
cancelLabel: "Cancel",
|
|
110
|
-
saveLabel: "Save"
|
|
111
|
-
},
|
|
112
|
-
ariaLabel: "General"
|
|
113
|
-
}, me = ({ form: e, errors: t, bucket: n, FileManagerModal: r, resolveIconUrl: a, allowedMimeTypes: o, maxFileSizeBytes: s, availableLocaleOptions: c, onChange: l, onNameBlur: d, onVersionBlur: f, renderDescription: p, labels: m }) => {
|
|
114
|
-
let h = x((e) => {
|
|
115
|
-
let [t] = e.files;
|
|
116
|
-
return (t ? u(t, n, { resolvePreviewUrl: a }) : null)?.url;
|
|
117
|
-
}, [n, a]), g = C(() => ({
|
|
118
|
-
bucket: n,
|
|
119
|
-
FileManagerModal: r,
|
|
120
|
-
resolveIconUrl: a,
|
|
121
|
-
resolveAttachedIconUrl: h,
|
|
122
|
-
allowedMimeTypes: o,
|
|
123
|
-
maxFileSizeBytes: s
|
|
124
|
-
}), [
|
|
125
|
-
n,
|
|
126
|
-
r,
|
|
127
|
-
a,
|
|
128
|
-
h,
|
|
129
|
-
o,
|
|
130
|
-
s
|
|
131
|
-
]), _ = C(() => ({
|
|
132
|
-
form: m?.form ?? K,
|
|
133
|
-
avatarPicker: m?.avatarPicker
|
|
134
|
-
}), [m?.form, m?.avatarPicker]);
|
|
135
|
-
return /* @__PURE__ */ E(i, {
|
|
136
|
-
values: e,
|
|
137
|
-
errors: t,
|
|
138
|
-
onChange: l,
|
|
139
|
-
onNameBlur: d,
|
|
140
|
-
onVersionBlur: f,
|
|
141
|
-
avatarPicker: g,
|
|
142
|
-
availableLocaleOptions: c,
|
|
143
|
-
renderDescription: p,
|
|
144
|
-
labels: _
|
|
145
|
-
});
|
|
146
113
|
}, q = /* @__PURE__ */ function(e) {
|
|
147
114
|
return e.Success = "success", e.Cancelled = "cancelled", e.PopupBlocked = "popup-blocked", e.InvalidConfig = "invalid-config", e.Failed = "failed", e;
|
|
148
|
-
}({}), J = "toolset-client-secret-keep-caption", Y = (e) => `******${e}`,
|
|
149
|
-
let [v, y] = w(!1), [b, x] = w(!1), S = e.isLoggedIn || n || v, C = i && e.clientSecretHint && !e.clientSecret ? e.clientSecretHint : void 0,
|
|
150
|
-
S || t === e.authenticationType ||
|
|
115
|
+
}({}), J = "toolset-client-secret-keep-caption", Y = (e) => `******${e}`, pe = (e) => e === s.None ? l.WithoutLogin : l.WithLogin, X = (e, t) => e === s.None ? t?.typeNone ?? "Open access" : e === s.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", me = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: o, onOAuthLogin: d, onNotifySuccess: f, onNotifyError: p, onAuthChange: h, onEnsureSaved: g, labels: _ }) => {
|
|
116
|
+
let [v, y] = w(!1), [b, x] = w(!1), S = e.isLoggedIn || n || v, C = i && e.clientSecretHint && !e.clientSecret ? e.clientSecretHint : void 0, T = W(a) && G(e, i) && !S, E = (t) => {
|
|
117
|
+
S || t === e.authenticationType || h({
|
|
151
118
|
authenticationType: t,
|
|
152
|
-
withLogin:
|
|
119
|
+
withLogin: pe(t)
|
|
153
120
|
});
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
switch (e.auth != null &&
|
|
121
|
+
}, D = (e) => {
|
|
122
|
+
h({ withLogin: e });
|
|
123
|
+
}, F = (e) => {
|
|
124
|
+
switch (e.auth != null && h(e.auth), e.status) {
|
|
158
125
|
case q.Success:
|
|
159
|
-
|
|
126
|
+
h({ isLoggedIn: !0 }), f(_?.loginSuccessMessage ?? "Successfully logged in.");
|
|
160
127
|
return;
|
|
161
128
|
case q.PopupBlocked:
|
|
162
129
|
p(_?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
|
|
@@ -169,12 +136,12 @@ var I = {
|
|
|
169
136
|
return;
|
|
170
137
|
case q.Cancelled: return;
|
|
171
138
|
}
|
|
172
|
-
},
|
|
173
|
-
if (!
|
|
139
|
+
}, L = async () => {
|
|
140
|
+
if (!T) return;
|
|
174
141
|
if (e.authenticationType === s.OAuth) {
|
|
175
142
|
y(!0);
|
|
176
143
|
try {
|
|
177
|
-
|
|
144
|
+
F(await d({
|
|
178
145
|
auth: e,
|
|
179
146
|
ensureSaved: g
|
|
180
147
|
}));
|
|
@@ -193,15 +160,15 @@ var I = {
|
|
|
193
160
|
authenticationType: e.authenticationType,
|
|
194
161
|
apiKey: e.apiKey?.trim()
|
|
195
162
|
};
|
|
196
|
-
await o.login(t, n),
|
|
163
|
+
await o.login(t, n), h({ isLoggedIn: !0 }), f(_?.loginSuccessMessage ?? "Successfully logged in.");
|
|
197
164
|
} catch (e) {
|
|
198
|
-
let { traceId: t } = await
|
|
165
|
+
let { traceId: t } = await u(e);
|
|
199
166
|
p(_?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
200
167
|
} finally {
|
|
201
168
|
y(!1);
|
|
202
169
|
}
|
|
203
170
|
}
|
|
204
|
-
},
|
|
171
|
+
}, ie = async () => {
|
|
205
172
|
y(!0);
|
|
206
173
|
try {
|
|
207
174
|
let t = {
|
|
@@ -209,106 +176,106 @@ var I = {
|
|
|
209
176
|
credentialsLevel: c.User,
|
|
210
177
|
authenticationType: e.authenticationType
|
|
211
178
|
};
|
|
212
|
-
await o.logout(r, t),
|
|
179
|
+
await o.logout(r, t), h({ isLoggedIn: !1 }), x(!1), f(_?.logoutSuccessMessage ?? "Successfully logged out.");
|
|
213
180
|
} catch (e) {
|
|
214
|
-
let { traceId: t } = await
|
|
181
|
+
let { traceId: t } = await u(e);
|
|
215
182
|
p(_?.errorLogoutFailed ?? "Failed to log out. Please try again.", t);
|
|
216
183
|
} finally {
|
|
217
184
|
y(!1);
|
|
218
185
|
}
|
|
219
|
-
},
|
|
186
|
+
}, B = () => e.isLoggedIn ? /* @__PURE__ */ R("div", {
|
|
220
187
|
className: "flex",
|
|
221
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ R(M, {
|
|
222
189
|
label: _?.logOutLabel ?? "Log out",
|
|
223
|
-
iconBefore: /* @__PURE__ */
|
|
224
|
-
size:
|
|
225
|
-
stroke:
|
|
190
|
+
iconBefore: /* @__PURE__ */ R(te, {
|
|
191
|
+
size: k.MD,
|
|
192
|
+
stroke: A
|
|
226
193
|
}),
|
|
227
194
|
onClick: () => x(!0),
|
|
228
195
|
disabled: n || v
|
|
229
196
|
})
|
|
230
|
-
}) : /* @__PURE__ */
|
|
197
|
+
}) : /* @__PURE__ */ R("div", {
|
|
231
198
|
className: "flex",
|
|
232
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ R(M, {
|
|
233
200
|
label: _?.logInLabel ?? "Log in",
|
|
234
|
-
iconBefore: /* @__PURE__ */
|
|
235
|
-
size:
|
|
236
|
-
stroke:
|
|
201
|
+
iconBefore: /* @__PURE__ */ R(ee, {
|
|
202
|
+
size: k.MD,
|
|
203
|
+
stroke: A
|
|
237
204
|
}),
|
|
238
|
-
onClick:
|
|
239
|
-
disabled: !
|
|
205
|
+
onClick: L,
|
|
206
|
+
disabled: !T
|
|
240
207
|
})
|
|
241
208
|
});
|
|
242
|
-
return /* @__PURE__ */
|
|
209
|
+
return /* @__PURE__ */ z("section", {
|
|
243
210
|
className: "flex flex-col gap-2",
|
|
244
211
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ R("h3", {
|
|
246
213
|
className: "dial-h3-text",
|
|
247
214
|
children: _?.sectionTitle ?? "Authentication"
|
|
248
215
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ R(I, {
|
|
250
217
|
"aria-label": _?.sectionTitle ?? "Authentication",
|
|
251
218
|
value: e.authenticationType,
|
|
252
|
-
onChange: (e) =>
|
|
219
|
+
onChange: (e) => E(e),
|
|
253
220
|
segmentClassName: "px-2",
|
|
254
221
|
items: [
|
|
255
222
|
s.None,
|
|
256
223
|
s.OAuth,
|
|
257
224
|
s.ApiKey
|
|
258
225
|
].map((t) => {
|
|
259
|
-
let n =
|
|
226
|
+
let n = V[t];
|
|
260
227
|
return {
|
|
261
228
|
value: t,
|
|
262
|
-
label: /* @__PURE__ */
|
|
229
|
+
label: /* @__PURE__ */ z("div", {
|
|
263
230
|
className: "flex items-center gap-2",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ R(n, {
|
|
265
232
|
className: "shrink-0",
|
|
266
|
-
size:
|
|
267
|
-
stroke:
|
|
233
|
+
size: k.SM,
|
|
234
|
+
stroke: A,
|
|
268
235
|
"aria-hidden": !0
|
|
269
|
-
}), /* @__PURE__ */
|
|
236
|
+
}), /* @__PURE__ */ R("span", {
|
|
270
237
|
className: "sr-only desktop:not-sr-only",
|
|
271
|
-
children:
|
|
238
|
+
children: X(t, _)
|
|
272
239
|
})]
|
|
273
240
|
}),
|
|
274
241
|
disabled: S && e.authenticationType !== t
|
|
275
242
|
};
|
|
276
243
|
})
|
|
277
244
|
}),
|
|
278
|
-
e.authenticationType === s.None && /* @__PURE__ */
|
|
245
|
+
e.authenticationType === s.None && /* @__PURE__ */ R("p", {
|
|
279
246
|
className: "dial-small-text pt-2 text-secondary",
|
|
280
247
|
children: _?.openAccessDescription ?? "Open endpoint, no credentials"
|
|
281
248
|
}),
|
|
282
|
-
e.authenticationType === s.OAuth && /* @__PURE__ */
|
|
249
|
+
e.authenticationType === s.OAuth && /* @__PURE__ */ z("div", {
|
|
283
250
|
className: "flex flex-col gap-3 pt-2",
|
|
284
251
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ z("div", {
|
|
286
253
|
className: "flex flex-col gap-2",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ R(P, {
|
|
288
255
|
name: "oauth-login-mode",
|
|
289
256
|
id: "oauth-with-login",
|
|
290
257
|
value: l.WithLogin,
|
|
291
258
|
labelProps: { label: _?.withLoginOAuthLabel ?? "Standard login" },
|
|
292
259
|
isSelected: e.withLogin === l.WithLogin,
|
|
293
260
|
disabled: S,
|
|
294
|
-
onChange:
|
|
295
|
-
}), /* @__PURE__ */
|
|
261
|
+
onChange: D
|
|
262
|
+
}), /* @__PURE__ */ R(P, {
|
|
296
263
|
name: "oauth-login-mode",
|
|
297
264
|
id: "oauth-with-config",
|
|
298
265
|
value: l.WithConfig,
|
|
299
266
|
labelProps: { label: _?.withConfigOAuthLabel ?? "Custom login" },
|
|
300
267
|
isSelected: e.withLogin === l.WithConfig,
|
|
301
268
|
disabled: S,
|
|
302
|
-
onChange:
|
|
269
|
+
onChange: D
|
|
303
270
|
})]
|
|
304
271
|
}),
|
|
305
|
-
e.withLogin === l.WithConfig && /* @__PURE__ */
|
|
272
|
+
e.withLogin === l.WithConfig && /* @__PURE__ */ z("div", {
|
|
306
273
|
className: "flex flex-col gap-3",
|
|
307
274
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ R(j, {
|
|
309
276
|
id: "toolset-client-id",
|
|
310
277
|
value: e.clientId ?? "",
|
|
311
|
-
onChange: (e) =>
|
|
278
|
+
onChange: (e) => h({ clientId: e ?? "" }),
|
|
312
279
|
labelProps: {
|
|
313
280
|
label: _?.clientIdLabel ?? "Client ID",
|
|
314
281
|
required: !0
|
|
@@ -318,12 +285,12 @@ var I = {
|
|
|
318
285
|
invalid: !!t.clientId,
|
|
319
286
|
disabled: S
|
|
320
287
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ z("div", {
|
|
322
289
|
className: "flex flex-col gap-1",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ R(N, {
|
|
324
291
|
id: "toolset-client-secret",
|
|
325
292
|
value: e.clientSecret ?? "",
|
|
326
|
-
onChange: (e) =>
|
|
293
|
+
onChange: (e) => h({ clientSecret: e ?? "" }),
|
|
327
294
|
labelProps: {
|
|
328
295
|
label: _?.clientSecretLabel ?? "Client secret",
|
|
329
296
|
required: !i
|
|
@@ -335,16 +302,16 @@ var I = {
|
|
|
335
302
|
error: t.clientSecret || void 0,
|
|
336
303
|
invalid: !!t.clientSecret,
|
|
337
304
|
disabled: S
|
|
338
|
-
}), C != null && /* @__PURE__ */
|
|
305
|
+
}), C != null && /* @__PURE__ */ R("p", {
|
|
339
306
|
id: J,
|
|
340
307
|
className: "dial-tiny-text text-secondary",
|
|
341
308
|
children: _?.clientSecretKeepCaption ?? "Leave empty to keep the saved secret."
|
|
342
309
|
})]
|
|
343
310
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ R(j, {
|
|
345
312
|
id: "toolset-authorization-endpoint",
|
|
346
313
|
value: e.authorizationEndpoint ?? "",
|
|
347
|
-
onChange: (e) =>
|
|
314
|
+
onChange: (e) => h({ authorizationEndpoint: e ?? "" }),
|
|
348
315
|
labelProps: {
|
|
349
316
|
label: _?.authorizationEndpointLabel ?? "Authorization endpoint",
|
|
350
317
|
required: !0
|
|
@@ -354,10 +321,10 @@ var I = {
|
|
|
354
321
|
invalid: !!t.authorizationEndpoint,
|
|
355
322
|
disabled: S
|
|
356
323
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ R(j, {
|
|
358
325
|
id: "toolset-token-endpoint",
|
|
359
326
|
value: e.tokenEndpoint ?? "",
|
|
360
|
-
onChange: (e) =>
|
|
327
|
+
onChange: (e) => h({ tokenEndpoint: e ?? "" }),
|
|
361
328
|
labelProps: {
|
|
362
329
|
label: _?.tokenEndpointLabel ?? "Token endpoint",
|
|
363
330
|
required: !0
|
|
@@ -367,49 +334,49 @@ var I = {
|
|
|
367
334
|
invalid: !!t.tokenEndpoint,
|
|
368
335
|
disabled: S
|
|
369
336
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ R(re, {
|
|
371
338
|
id: "toolset-scopes",
|
|
372
339
|
labelProps: { label: _?.scopesLabel ?? "Scopes" },
|
|
373
340
|
placeholder: _?.scopesPlaceholder ?? "Enter scopes",
|
|
374
341
|
value: e.scopes ?? [],
|
|
375
|
-
onChange: (e) =>
|
|
342
|
+
onChange: (e) => h({ scopes: e }),
|
|
376
343
|
disabled: S,
|
|
377
|
-
tagClassName:
|
|
344
|
+
tagClassName: m
|
|
378
345
|
})
|
|
379
346
|
]
|
|
380
347
|
}),
|
|
381
|
-
|
|
348
|
+
B()
|
|
382
349
|
]
|
|
383
350
|
}),
|
|
384
|
-
e.authenticationType === s.ApiKey && /* @__PURE__ */
|
|
351
|
+
e.authenticationType === s.ApiKey && /* @__PURE__ */ z("div", {
|
|
385
352
|
className: "flex flex-col gap-3 pt-2",
|
|
386
353
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ z("div", {
|
|
388
355
|
className: "flex flex-col gap-2",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ R(P, {
|
|
390
357
|
name: "apikey-login-mode",
|
|
391
358
|
id: "apikey-with-login",
|
|
392
359
|
value: l.WithLogin,
|
|
393
360
|
labelProps: { label: _?.withLoginLabel ?? "With login" },
|
|
394
361
|
isSelected: e.withLogin === l.WithLogin,
|
|
395
362
|
disabled: S,
|
|
396
|
-
onChange:
|
|
397
|
-
}), /* @__PURE__ */
|
|
363
|
+
onChange: D
|
|
364
|
+
}), /* @__PURE__ */ R(P, {
|
|
398
365
|
name: "apikey-login-mode",
|
|
399
366
|
id: "apikey-without-login",
|
|
400
367
|
value: l.WithoutLogin,
|
|
401
368
|
labelProps: { label: _?.withoutLoginLabel ?? "Without login" },
|
|
402
369
|
isSelected: e.withLogin === l.WithoutLogin,
|
|
403
370
|
disabled: S,
|
|
404
|
-
onChange:
|
|
371
|
+
onChange: D
|
|
405
372
|
})]
|
|
406
373
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ z("div", {
|
|
408
375
|
className: "flex flex-col gap-3",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ R(j, {
|
|
410
377
|
id: "toolset-key-header",
|
|
411
378
|
value: e.keyHeader ?? "",
|
|
412
|
-
onChange: (e) =>
|
|
379
|
+
onChange: (e) => h({ keyHeader: e ?? "" }),
|
|
413
380
|
labelProps: {
|
|
414
381
|
label: _?.keyHeaderLabel ?? "API Key parameter name",
|
|
415
382
|
required: !0
|
|
@@ -418,10 +385,10 @@ var I = {
|
|
|
418
385
|
error: t.keyHeader || void 0,
|
|
419
386
|
invalid: !!t.keyHeader,
|
|
420
387
|
disabled: S
|
|
421
|
-
}), e.withLogin === l.WithLogin && /* @__PURE__ */
|
|
388
|
+
}), e.withLogin === l.WithLogin && /* @__PURE__ */ R(N, {
|
|
422
389
|
id: "toolset-api-key",
|
|
423
390
|
value: e.apiKey ?? "",
|
|
424
|
-
onChange: (e) =>
|
|
391
|
+
onChange: (e) => h({ apiKey: e ?? "" }),
|
|
425
392
|
labelProps: {
|
|
426
393
|
label: _?.apiKeyLabel ?? "API key",
|
|
427
394
|
required: !0
|
|
@@ -434,46 +401,46 @@ var I = {
|
|
|
434
401
|
disabled: S
|
|
435
402
|
})]
|
|
436
403
|
}),
|
|
437
|
-
e.withLogin !== l.WithoutLogin &&
|
|
404
|
+
e.withLogin !== l.WithoutLogin && B()
|
|
438
405
|
]
|
|
439
406
|
}),
|
|
440
|
-
b && /* @__PURE__ */
|
|
407
|
+
b && /* @__PURE__ */ R(ne, {
|
|
441
408
|
open: b,
|
|
442
409
|
header: _?.logoutConfirmTitle ?? "Log out?",
|
|
443
410
|
description: _?.logoutConfirmDescription ?? "Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.",
|
|
444
411
|
confirmLabel: _?.logOutLabel ?? "Log out",
|
|
445
412
|
cancelLabel: _?.cancelLabel ?? "Cancel",
|
|
446
|
-
variant:
|
|
413
|
+
variant: O.Danger,
|
|
447
414
|
isLoading: v,
|
|
448
415
|
disableConfirmButton: v,
|
|
449
|
-
onConfirm:
|
|
416
|
+
onConfirm: ie,
|
|
450
417
|
onCancel: () => x(!1),
|
|
451
418
|
onClose: () => x(!1)
|
|
452
419
|
})
|
|
453
420
|
]
|
|
454
421
|
});
|
|
455
|
-
},
|
|
456
|
-
let { isCopied: r, copy: i } =
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
className:
|
|
422
|
+
}, Z = y(({ url: e, className: t, labels: n }) => {
|
|
423
|
+
let { isCopied: r, copy: i } = _(e), a = n?.copiedLabel ?? "Copied!";
|
|
424
|
+
return /* @__PURE__ */ z("div", {
|
|
425
|
+
className: g("flex flex-col gap-3", t),
|
|
459
426
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ z("div", {
|
|
461
428
|
className: "flex flex-col gap-1",
|
|
462
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ R("p", {
|
|
463
430
|
className: "dial-body-semi-text text-start text-primary",
|
|
464
431
|
children: n?.title ?? "Connect toolset"
|
|
465
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ R("p", {
|
|
466
433
|
className: "dial-small-text text-start text-secondary",
|
|
467
434
|
children: n?.description ?? "Copy endpoint URL to easily integrate toolset into your workflows"
|
|
468
435
|
})]
|
|
469
436
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ R("div", { children: /* @__PURE__ */ R(d, {
|
|
471
438
|
copiedLabel: a,
|
|
472
439
|
copyLabel: n?.copyLabel ?? "Copy URL",
|
|
473
440
|
isCopied: r,
|
|
474
441
|
onClick: i
|
|
475
442
|
}) }),
|
|
476
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ R("span", {
|
|
477
444
|
role: "status",
|
|
478
445
|
"aria-live": "polite",
|
|
479
446
|
className: "sr-only",
|
|
@@ -481,15 +448,15 @@ var I = {
|
|
|
481
448
|
})
|
|
482
449
|
]
|
|
483
450
|
});
|
|
484
|
-
}),
|
|
485
|
-
let [g, _] = w(null), v = !!a && !!r, y =
|
|
486
|
-
value:
|
|
451
|
+
}), he = ({ 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: f, onEnsureSaved: p, labels: h }) => {
|
|
452
|
+
let [g, _] = w(null), v = !!a && !!r, y = S(() => [{
|
|
453
|
+
value: B.Http,
|
|
487
454
|
label: "HTTP"
|
|
488
455
|
}, {
|
|
489
|
-
value:
|
|
456
|
+
value: B.Sse,
|
|
490
457
|
label: "SSE"
|
|
491
458
|
}], []);
|
|
492
|
-
return
|
|
459
|
+
return x(() => {
|
|
493
460
|
if (!r || !o || !G(e.auth, i)) {
|
|
494
461
|
_(null);
|
|
495
462
|
return;
|
|
@@ -511,25 +478,25 @@ var I = {
|
|
|
511
478
|
e.auth,
|
|
512
479
|
e.endpoint,
|
|
513
480
|
o
|
|
514
|
-
]), /* @__PURE__ */
|
|
481
|
+
]), /* @__PURE__ */ z("div", {
|
|
515
482
|
className: "flex max-w-[1060px] flex-col gap-4",
|
|
516
483
|
children: [
|
|
517
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ R(j, {
|
|
518
485
|
id: "toolset-endpoint",
|
|
519
486
|
value: e.endpoint,
|
|
520
487
|
onChange: (e) => d({ endpoint: e ?? "" }),
|
|
521
488
|
labelProps: {
|
|
522
|
-
label:
|
|
489
|
+
label: h?.endpointLabel ?? "Endpoint",
|
|
523
490
|
required: !0
|
|
524
491
|
},
|
|
525
|
-
placeholder:
|
|
526
|
-
caption:
|
|
492
|
+
placeholder: h?.endpointPlaceholder ?? "https://...",
|
|
493
|
+
caption: h?.endpointCaption ?? "The HTTPS address where the server accepts MCP requests. Choose the transport under Protocol below.",
|
|
527
494
|
error: t.endpoint || void 0,
|
|
528
495
|
invalid: !!t.endpoint
|
|
529
496
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ R(F, {
|
|
531
498
|
labelProps: {
|
|
532
|
-
label:
|
|
499
|
+
label: h?.protocolLabel ?? "Protocol",
|
|
533
500
|
required: !0
|
|
534
501
|
},
|
|
535
502
|
id: "toolset-protocol",
|
|
@@ -539,28 +506,28 @@ var I = {
|
|
|
539
506
|
d({ protocol: e });
|
|
540
507
|
}
|
|
541
508
|
}),
|
|
542
|
-
g ? /* @__PURE__ */
|
|
509
|
+
g ? /* @__PURE__ */ R(L, {
|
|
543
510
|
id: "toolset-allowed-tools",
|
|
544
511
|
multiple: !0,
|
|
545
512
|
searchable: !0,
|
|
546
513
|
selectAll: !0,
|
|
547
|
-
labelProps: { label:
|
|
548
|
-
placeholder:
|
|
514
|
+
labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
|
|
515
|
+
placeholder: h?.allowedToolsSelectPlaceholder ?? "Select allowed tools",
|
|
549
516
|
options: g.map((e) => ({
|
|
550
517
|
value: e,
|
|
551
518
|
label: e
|
|
552
519
|
})),
|
|
553
520
|
value: e.allowedTools,
|
|
554
521
|
onChange: (e) => d({ allowedTools: e })
|
|
555
|
-
}) : /* @__PURE__ */
|
|
522
|
+
}) : /* @__PURE__ */ R(re, {
|
|
556
523
|
id: "toolset-allowed-tools",
|
|
557
|
-
labelProps: { label:
|
|
558
|
-
placeholder:
|
|
524
|
+
labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
|
|
525
|
+
placeholder: h?.allowedToolsPlaceholder ?? "Add tools, comma separated",
|
|
559
526
|
value: e.allowedTools,
|
|
560
527
|
onChange: (e) => d({ allowedTools: e }),
|
|
561
|
-
tagClassName:
|
|
528
|
+
tagClassName: m
|
|
562
529
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ R(me, {
|
|
564
531
|
auth: e.auth,
|
|
565
532
|
errors: t,
|
|
566
533
|
isSaving: n,
|
|
@@ -573,170 +540,173 @@ var I = {
|
|
|
573
540
|
onNotifyError: u,
|
|
574
541
|
onAuthChange: f,
|
|
575
542
|
onEnsureSaved: p,
|
|
576
|
-
labels:
|
|
543
|
+
labels: h?.auth
|
|
577
544
|
}),
|
|
578
|
-
v && /* @__PURE__ */
|
|
545
|
+
v && /* @__PURE__ */ R(Z, {
|
|
579
546
|
url: a ?? "",
|
|
580
|
-
labels:
|
|
547
|
+
labels: h?.connect,
|
|
581
548
|
className: "border-t border-tertiary pt-4"
|
|
582
549
|
})
|
|
583
550
|
]
|
|
584
551
|
});
|
|
585
|
-
},
|
|
552
|
+
}, ge = [
|
|
586
553
|
"keyHeader",
|
|
587
554
|
"apiKey",
|
|
588
555
|
"clientId",
|
|
589
556
|
"clientSecret",
|
|
590
557
|
"authorizationEndpoint",
|
|
591
558
|
"tokenEndpoint"
|
|
592
|
-
],
|
|
559
|
+
], _e = ["endpoint", ...ge], Q = new Set(_e), ve = { validateVersionPattern: !0 }, ye = (e) => {
|
|
593
560
|
let t = {};
|
|
594
561
|
for (let n of Object.keys(e)) Q.has(n) && (t[n] = !0);
|
|
595
562
|
return t;
|
|
596
|
-
},
|
|
597
|
-
let N = !!
|
|
563
|
+
}, be = ({ initialForm: e, toolsetId: o, onPersist: c, onPostSaveLogin: d, onToolsetsChanged: m, onSaveSuccess: g, onSaveComplete: _, onBack: y, onDirtyChange: T, buildMcpUrl: E, listToolNames: D, authActions: ee, onOAuthLogin: te, onNotifySuccess: ne, onNotifyError: O, avatarPicker: k, availableLocaleOptions: A, onRefineDescription: j, labels: M }) => {
|
|
564
|
+
let N = !!o, [P, F] = w(""), I = o || P, [L, re] = w({
|
|
598
565
|
initialForm: e,
|
|
599
566
|
key: 0
|
|
600
|
-
}), [
|
|
601
|
-
|
|
567
|
+
}), [z, B] = w(e);
|
|
568
|
+
L.initialForm !== e && (re({
|
|
602
569
|
initialForm: e,
|
|
603
|
-
key:
|
|
604
|
-
}),
|
|
605
|
-
let
|
|
606
|
-
initialValues:
|
|
607
|
-
validationOptions:
|
|
608
|
-
reseedKey:
|
|
609
|
-
}), [
|
|
610
|
-
...
|
|
611
|
-
...
|
|
612
|
-
}), [
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}, [
|
|
616
|
-
let [
|
|
617
|
-
|
|
618
|
-
|
|
570
|
+
key: L.key + 1
|
|
571
|
+
}), B(e));
|
|
572
|
+
let ae = S(() => de(e), [e]), { values: V, setValues: se, markTouched: H, visibleErrorCodes: U, attemptSubmit: ce } = a({
|
|
573
|
+
initialValues: ae,
|
|
574
|
+
validationOptions: ve,
|
|
575
|
+
reseedKey: L.key
|
|
576
|
+
}), [le, G] = w(e), K = S(() => ({
|
|
577
|
+
...le,
|
|
578
|
+
...V
|
|
579
|
+
}), [le, V]), q = S(() => JSON.stringify(K) !== JSON.stringify(z), [K, z]);
|
|
580
|
+
x(() => {
|
|
581
|
+
T?.(q);
|
|
582
|
+
}, [q, T]);
|
|
583
|
+
let [J, Y] = w(!1), [pe, X] = w({}), [me, Z] = w({}), Q = C(null);
|
|
584
|
+
x(() => {
|
|
585
|
+
G(e), Q.current = e, X({}), Z({}), F("");
|
|
619
586
|
}, [e]);
|
|
620
|
-
let
|
|
621
|
-
let { metadata: t, setup: n } =
|
|
622
|
-
Object.keys(t).length > 0 && (
|
|
587
|
+
let be = b((e) => {
|
|
588
|
+
let { metadata: t, setup: n } = fe(e);
|
|
589
|
+
Object.keys(t).length > 0 && (se(t), "name" in t && H(r.Name), "version" in t && H(r.Version)), Object.keys(n).length !== 0 && (G((e) => ({
|
|
623
590
|
...e,
|
|
624
591
|
...n
|
|
625
|
-
})),
|
|
592
|
+
})), Z((e) => ({
|
|
626
593
|
...e,
|
|
627
|
-
...
|
|
628
|
-
})),
|
|
594
|
+
...ye(n)
|
|
595
|
+
})), X((e) => {
|
|
629
596
|
let t = { ...e };
|
|
630
597
|
for (let e of Object.keys(n)) delete t[e];
|
|
631
598
|
return t;
|
|
632
599
|
}));
|
|
633
|
-
}, [
|
|
634
|
-
|
|
600
|
+
}, [se, H]), xe = b((e) => {
|
|
601
|
+
G((t) => ({
|
|
635
602
|
...t,
|
|
636
603
|
auth: {
|
|
637
604
|
...t.auth,
|
|
638
605
|
...e
|
|
639
606
|
}
|
|
640
|
-
})),
|
|
607
|
+
})), Z((t) => ({
|
|
641
608
|
...t,
|
|
642
|
-
...
|
|
643
|
-
})),
|
|
609
|
+
...ye(e)
|
|
610
|
+
})), X((t) => {
|
|
644
611
|
let n = { ...t };
|
|
645
|
-
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of
|
|
612
|
+
if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of ge) delete n[e];
|
|
646
613
|
else for (let t of Object.keys(e)) delete n[t];
|
|
647
614
|
return n;
|
|
648
|
-
}), "isLoggedIn" in e &&
|
|
649
|
-
}, [
|
|
650
|
-
if (
|
|
651
|
-
|
|
615
|
+
}), "isLoggedIn" in e && m();
|
|
616
|
+
}, [m]), Se = b(async () => {
|
|
617
|
+
if (I && Q.current != null && JSON.stringify(Q.current) === JSON.stringify(K)) return I;
|
|
618
|
+
Y(!0);
|
|
652
619
|
try {
|
|
653
|
-
let e = await
|
|
654
|
-
return e ? (
|
|
620
|
+
let e = await c(K, I);
|
|
621
|
+
return e ? (I || F(e), Q.current = K, B(K), T?.(!1), await m(), e) : null;
|
|
655
622
|
} catch {
|
|
656
623
|
return null;
|
|
657
624
|
} finally {
|
|
658
|
-
|
|
625
|
+
Y(!1);
|
|
659
626
|
}
|
|
660
627
|
}, [
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
]),
|
|
628
|
+
K,
|
|
629
|
+
I,
|
|
630
|
+
c,
|
|
631
|
+
m,
|
|
632
|
+
T
|
|
633
|
+
]), Ce = b(async () => await Se() ?? !1, [Se]), $ = b((e) => {
|
|
667
634
|
let t = M?.validation, n = {};
|
|
668
|
-
return e.endpoint.trim() ?
|
|
669
|
-
}, [M, N]),
|
|
670
|
-
let e =
|
|
671
|
-
if (!e || Object.keys(t).length > 0)
|
|
635
|
+
return e.endpoint.trim() ? W(e.endpoint) || (n.endpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.endpoint = t?.endpointRequired ?? "Endpoint is required", e.auth.isLoggedIn || (e.auth.authenticationType === s.ApiKey && (e.auth.keyHeader?.trim() || (n.keyHeader = t?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === l.WithLogin && !e.auth.apiKey?.trim() && (n.apiKey = t?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === s.OAuth && e.auth.withLogin === l.WithConfig && (e.auth.clientId?.trim() || (n.clientId = t?.clientIdRequired ?? "Client ID is required"), !N && !e.auth.clientSecret?.trim() && (n.clientSecret = t?.clientSecretRequired ?? "Client secret is required"), e.auth.authorizationEndpoint?.trim() ? W(e.auth.authorizationEndpoint) || (n.authorizationEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.authorizationEndpoint = t?.authorizationEndpointRequired ?? "Authorization endpoint is required", e.auth.tokenEndpoint?.trim() ? W(e.auth.tokenEndpoint) || (n.tokenEndpoint = t?.endpointInvalid ?? "Enter a valid http(s) URL") : n.tokenEndpoint = t?.tokenEndpointRequired ?? "Token endpoint is required")), n;
|
|
636
|
+
}, [M, N]), we = b(async () => {
|
|
637
|
+
let e = ce(), t = $(K);
|
|
638
|
+
if (!e || Object.keys(t).length > 0) X(t);
|
|
672
639
|
else {
|
|
673
|
-
|
|
640
|
+
X({}), Y(!0);
|
|
674
641
|
try {
|
|
675
|
-
let e = await
|
|
642
|
+
let e = await c(K, I);
|
|
676
643
|
if (!e) return;
|
|
677
|
-
|
|
644
|
+
B(K), await m(), g(K);
|
|
678
645
|
try {
|
|
679
|
-
await
|
|
646
|
+
await d(e, K.auth), _();
|
|
680
647
|
} catch (e) {
|
|
681
|
-
let { traceId: t } = await
|
|
682
|
-
|
|
648
|
+
let { traceId: t } = await u(e);
|
|
649
|
+
O(M?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
|
|
683
650
|
}
|
|
684
651
|
} catch {} finally {
|
|
685
|
-
|
|
652
|
+
Y(!1);
|
|
686
653
|
}
|
|
687
654
|
}
|
|
688
655
|
}, [
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
o,
|
|
694
|
-
u,
|
|
695
|
-
f,
|
|
696
|
-
h,
|
|
656
|
+
ce,
|
|
657
|
+
K,
|
|
658
|
+
$,
|
|
659
|
+
I,
|
|
697
660
|
c,
|
|
698
|
-
|
|
661
|
+
m,
|
|
662
|
+
g,
|
|
663
|
+
_,
|
|
664
|
+
d,
|
|
665
|
+
O,
|
|
699
666
|
M
|
|
700
|
-
]),
|
|
701
|
-
value:
|
|
702
|
-
onChange: (e) =>
|
|
667
|
+
]), Te = v({
|
|
668
|
+
value: V.description,
|
|
669
|
+
onChange: (e) => be({ description: e }),
|
|
703
670
|
onRefine: j,
|
|
704
|
-
disabled:
|
|
705
|
-
resetKey:
|
|
706
|
-
}),
|
|
671
|
+
disabled: J,
|
|
672
|
+
resetKey: L.key
|
|
673
|
+
}), Ee = j ? (e, t) => /* @__PURE__ */ R(h, {
|
|
707
674
|
isEnabled: !0,
|
|
708
675
|
fieldId: t,
|
|
709
676
|
label: M?.general?.form?.description.label ?? "Description",
|
|
710
677
|
labels: M?.refinement,
|
|
711
|
-
refinement:
|
|
712
|
-
disabled:
|
|
678
|
+
refinement: Te,
|
|
679
|
+
disabled: Te.isPending || J,
|
|
713
680
|
children: e
|
|
714
|
-
}) : void 0,
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
681
|
+
}) : void 0, De = S(() => ({
|
|
682
|
+
form: M?.general?.form ?? oe,
|
|
683
|
+
avatarPicker: M?.general?.avatarPicker
|
|
684
|
+
}), [M?.general?.form, M?.general?.avatarPicker]), Oe = S(() => !ue(K, N), [K, N]), ke = S(() => {
|
|
685
|
+
let e = M?.validation, n = $(K), r = { ...pe };
|
|
686
|
+
for (let e of _e) {
|
|
687
|
+
if (!me[e]) continue;
|
|
718
688
|
let t = n[e];
|
|
719
689
|
t ? r[e] = t : delete r[e];
|
|
720
690
|
}
|
|
721
|
-
return
|
|
691
|
+
return U.name === t.Required ? r.name = e?.nameRequired ?? "Name is required" : U.name === t.TooLong ? r.name = e?.nameTooLong ?? `Use ${p} characters or fewer.` : U.name === t.ControlCharacters && (r.name = e?.nameControlCharacters ?? "Remove line breaks, tabs and other control characters."), U.description === t.TooLong && (r.description = e?.descriptionTooLong ?? `Use ${f} characters or fewer.`), U.version === t.InvalidFormat && (r.version = e?.versionInvalid ?? "Version may only contain letters, digits, dots, underscores, and dashes"), r;
|
|
722
692
|
}, [
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
693
|
+
me,
|
|
694
|
+
pe,
|
|
695
|
+
K,
|
|
726
696
|
M,
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
]),
|
|
730
|
-
return /* @__PURE__ */
|
|
697
|
+
U,
|
|
698
|
+
$
|
|
699
|
+
]), Ae = E && I ? E(I) : void 0;
|
|
700
|
+
return /* @__PURE__ */ R(n, {
|
|
731
701
|
title: N ? M?.layout?.editTitle ?? "Edit toolset" : M?.layout?.createTitle ?? "Create toolset",
|
|
732
|
-
onBack:
|
|
733
|
-
onCancel:
|
|
734
|
-
onSubmit:
|
|
702
|
+
onBack: y,
|
|
703
|
+
onCancel: y,
|
|
704
|
+
onSubmit: we,
|
|
735
705
|
submitLabel: N ? M?.layout?.saveLabel ?? "Save" : M?.layout?.createLabel ?? "Create",
|
|
736
|
-
isSubmitting:
|
|
737
|
-
isSubmitDisabled:
|
|
738
|
-
metadataSectionClassName:
|
|
739
|
-
setupSectionClassName:
|
|
706
|
+
isSubmitting: J,
|
|
707
|
+
isSubmitDisabled: Oe || Te.isPending,
|
|
708
|
+
metadataSectionClassName: ie.metadataSection,
|
|
709
|
+
setupSectionClassName: ie.setupSection,
|
|
740
710
|
labels: {
|
|
741
711
|
backAriaLabel: M?.layout?.backAriaLabel ?? "Back to catalog",
|
|
742
712
|
savingStatusLabel: M?.layout?.savingStatusLabel ?? "Saving",
|
|
@@ -744,37 +714,33 @@ var I = {
|
|
|
744
714
|
setupTitle: M?.layout?.setupSectionTitle ?? "Setup",
|
|
745
715
|
cancelLabel: M?.layout?.cancelLabel ?? "Cancel"
|
|
746
716
|
},
|
|
747
|
-
metadata: /* @__PURE__ */
|
|
748
|
-
|
|
749
|
-
errors:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
resolveIconUrl: oe,
|
|
753
|
-
allowedMimeTypes: O,
|
|
754
|
-
maxFileSizeBytes: k,
|
|
717
|
+
metadata: /* @__PURE__ */ R(i, {
|
|
718
|
+
values: K,
|
|
719
|
+
errors: ke,
|
|
720
|
+
onChange: be,
|
|
721
|
+
avatarPicker: k,
|
|
755
722
|
availableLocaleOptions: A,
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
labels: M?.general
|
|
723
|
+
renderDescription: Ee,
|
|
724
|
+
labels: De
|
|
759
725
|
}),
|
|
760
|
-
setup: /* @__PURE__ */
|
|
761
|
-
form:
|
|
762
|
-
errors:
|
|
763
|
-
isSaving:
|
|
764
|
-
toolsetId:
|
|
726
|
+
setup: /* @__PURE__ */ R(he, {
|
|
727
|
+
form: K,
|
|
728
|
+
errors: ke,
|
|
729
|
+
isSaving: J,
|
|
730
|
+
toolsetId: I,
|
|
765
731
|
isEditMode: N,
|
|
766
|
-
connectUrl:
|
|
767
|
-
listToolNames:
|
|
768
|
-
authActions:
|
|
769
|
-
onOAuthLogin:
|
|
770
|
-
onNotifySuccess:
|
|
771
|
-
onNotifyError:
|
|
772
|
-
onChange:
|
|
773
|
-
onAuthChange:
|
|
774
|
-
onEnsureSaved:
|
|
732
|
+
connectUrl: Ae,
|
|
733
|
+
listToolNames: D,
|
|
734
|
+
authActions: ee,
|
|
735
|
+
onOAuthLogin: te,
|
|
736
|
+
onNotifySuccess: ne,
|
|
737
|
+
onNotifyError: O,
|
|
738
|
+
onChange: be,
|
|
739
|
+
onAuthChange: xe,
|
|
740
|
+
onEnsureSaved: Ce,
|
|
775
741
|
labels: M?.settings
|
|
776
742
|
})
|
|
777
743
|
});
|
|
778
744
|
};
|
|
779
745
|
//#endregion
|
|
780
|
-
export {
|
|
746
|
+
export { V as AUTH_TYPE_ICONS, ae as DEFAULT_TOOLSET_VERSION, ie as TOOLSET_EDITOR_CLASS, be as ToolsetEditor, q as ToolsetOAuthLoginStatus, B as ToolsetTransportType, H as getDefaultToolsetForm, G as isToolsetAuthValid, ue as isToolsetFormValid, W as isValidEndpointUrl, le as normalizeReturnedEndpointUrl };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AvatarPickerModalLabels, DeploymentCreationFormLabels } from '../../../builder-form/src/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Pre-translated labels for the general (metadata) form. Each group is
|
|
4
|
+
* optional and replaced as a whole; omitting one falls back to the library's
|
|
5
|
+
* English defaults.
|
|
6
|
+
* @deprecated Use `MetadataFormLabels` from `@epam/ai-dial-builder-form`.
|
|
7
|
+
*/
|
|
8
|
+
export interface GeneralFormLabels {
|
|
9
|
+
/** Labels for the embedded `DeploymentCreationForm` fields. */
|
|
10
|
+
form?: DeploymentCreationFormLabels;
|
|
11
|
+
/** Labels for the avatar picker modal. */
|
|
12
|
+
avatarPicker?: AvatarPickerModalLabels;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=general-form-labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general-form-labels.d.ts","sourceRoot":"","sources":["../../src/models/general-form-labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeploymentCreationFormLocaleOption, MetadataFormAvatarPicker } from '../../../builder-form/src/index.ts';
|
|
2
2
|
import { TextRefinementCallback, TextRefinementLabels } from '../../../chat-shared/src/index.ts';
|
|
3
|
-
import {
|
|
4
|
-
import { GeneralFormLabels } from './general-form-props';
|
|
3
|
+
import { GeneralFormLabels } from './general-form-labels';
|
|
5
4
|
import { SettingsFormLabels } from './settings-form-props';
|
|
6
5
|
import { ToolsetAuthActions, ToolsetAuthFormData, ToolsetFormData } from './toolset-form';
|
|
7
6
|
import { ToolsetOAuthLoginHandler } from './toolset-oauth-login';
|
|
@@ -131,16 +130,8 @@ export interface ToolsetEditorProps {
|
|
|
131
130
|
onNotifySuccess: (message: string) => void;
|
|
132
131
|
/** Shows an error notification with the given message and optional trace id. */
|
|
133
132
|
onNotifyError: (message: string, requestId?: string) => void;
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
/** Host file-manager modal rendered inside the avatar picker. */
|
|
137
|
-
FileManagerModal: ComponentType<AvatarPickerFileManagerModalProps>;
|
|
138
|
-
/** Resolves an icon URL into the previewable URL the form renders. */
|
|
139
|
-
resolveIconUrl: (url: string) => string;
|
|
140
|
-
/** MIME types the avatar picker accepts. */
|
|
141
|
-
allowedMimeTypes: string[];
|
|
142
|
-
/** Maximum avatar file size in bytes. */
|
|
143
|
-
maxFileSizeBytes: number;
|
|
133
|
+
/** Host wiring for the avatar picker: bucket, file manager, icon URL resolution, picked-file resolution and file limits. */
|
|
134
|
+
avatarPicker: MetadataFormAvatarPicker;
|
|
144
135
|
/** Locale options offered by the "Add locale" popup. */
|
|
145
136
|
availableLocaleOptions: DeploymentCreationFormLocaleOption[];
|
|
146
137
|
/** Optional Description rewrite callback; omission hides the Refine with AI action. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolset-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/toolset-editor-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"toolset-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/toolset-editor-props.ts"],"names":[],"mappings":"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"}
|
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.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.241",
|
|
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.3.0-dev.
|
|
21
|
+
"@epam/ai-dial-builder-form": "1.3.0-dev.241"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@epam/ai-dial-chat-hooks": "1.3.0-dev.
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
24
|
+
"@epam/ai-dial-chat-hooks": "1.3.0-dev.241",
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.241",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.45",
|
|
27
27
|
"react": "^19.2.8"
|
|
28
28
|
},
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { GeneralFormProps } from '../../models/general-form-props';
|
|
3
|
-
/**
|
|
4
|
-
* General (metadata) form shared by the Toolset and Custom App editors.
|
|
5
|
-
* @deprecated Render `MetadataForm` from `@epam/ai-dial-builder-form` and supply `avatarPicker.resolveAttachedIconUrl` instead.
|
|
6
|
-
*/
|
|
7
|
-
export declare const GeneralForm: FC<GeneralFormProps>;
|
|
8
|
-
//# sourceMappingURL=GeneralForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GeneralForm.d.ts","sourceRoot":"","sources":["../../../src/components/GeneralForm/GeneralForm.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAmCxE;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAqE5C,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { AvatarPickerFileManagerModalProps, AvatarPickerModalLabels, DeploymentCreationFormLabels, DeploymentCreationFormLocaleOption } from '../../../builder-form/src/index.ts';
|
|
2
|
-
import { ComponentType, ReactNode } from 'react';
|
|
3
|
-
import { DeploymentGeneralFormData, ToolsetFormErrors } from './toolset-form';
|
|
4
|
-
/**
|
|
5
|
-
* Pre-translated labels for the general (metadata) form. Each group is
|
|
6
|
-
* optional and replaced as a whole; omitting one falls back to the library's
|
|
7
|
-
* English defaults.
|
|
8
|
-
* @deprecated Use `MetadataFormLabels` from `@epam/ai-dial-builder-form`.
|
|
9
|
-
*/
|
|
10
|
-
export interface GeneralFormLabels {
|
|
11
|
-
/** Labels for the embedded `DeploymentCreationForm` fields. */
|
|
12
|
-
form?: DeploymentCreationFormLabels;
|
|
13
|
-
/** Labels for the avatar picker modal. */
|
|
14
|
-
avatarPicker?: AvatarPickerModalLabels;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Props of the general (metadata) form shared by the Toolset and Custom App editors.
|
|
18
|
-
* @deprecated Use `MetadataFormProps` from `@epam/ai-dial-builder-form`.
|
|
19
|
-
*/
|
|
20
|
-
export interface GeneralFormProps {
|
|
21
|
-
/** Current general form values. */
|
|
22
|
-
form: DeploymentGeneralFormData;
|
|
23
|
-
/** Field error messages keyed by field name; only `name` and `version` are read. */
|
|
24
|
-
errors: ToolsetFormErrors;
|
|
25
|
-
/** Storage bucket whose files the avatar picker browses. */
|
|
26
|
-
bucket: string;
|
|
27
|
-
/** Host file-manager modal rendered inside the avatar picker. */
|
|
28
|
-
FileManagerModal: ComponentType<AvatarPickerFileManagerModalProps>;
|
|
29
|
-
/** Resolves an icon URL into the previewable URL the form renders. */
|
|
30
|
-
resolveIconUrl: (url: string) => string;
|
|
31
|
-
/** MIME types the avatar picker accepts. */
|
|
32
|
-
allowedMimeTypes: string[];
|
|
33
|
-
/** Maximum avatar file size in bytes. */
|
|
34
|
-
maxFileSizeBytes: number;
|
|
35
|
-
/** Locale options offered by the "Add locale" popup. */
|
|
36
|
-
availableLocaleOptions: DeploymentCreationFormLocaleOption[];
|
|
37
|
-
/** Called with the changed subset of general form values. */
|
|
38
|
-
onChange: (patch: Partial<DeploymentGeneralFormData>) => void;
|
|
39
|
-
/** Called when the Name field loses focus. */
|
|
40
|
-
onNameBlur?: () => void;
|
|
41
|
-
/** Called when the Version field loses focus. */
|
|
42
|
-
onVersionBlur?: () => void;
|
|
43
|
-
/** Wraps the Description textarea; see `MetadataFormProps.renderDescription`. */
|
|
44
|
-
renderDescription?: (textarea: ReactNode, fieldId: string) => ReactNode;
|
|
45
|
-
/** Pre-translated labels; each group falls back to English defaults. */
|
|
46
|
-
labels?: GeneralFormLabels;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=general-form-props.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"general-form-props.d.ts","sourceRoot":"","sources":["../../src/models/general-form-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,uBAAuB,EACvB,4BAA4B,EAC5B,kCAAkC,EACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,IAAI,EAAE,yBAAyB,CAAC;IAChC,oFAAoF;IACpF,MAAM,EAAE,iBAAiB,CAAC;IAC1B,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,gBAAgB,EAAE,aAAa,CAAC,iCAAiC,CAAC,CAAC;IACnE,sEAAsE;IACtE,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,4CAA4C;IAC5C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,sBAAsB,EAAE,kCAAkC,EAAE,CAAC;IAC7D,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,yBAAyB,CAAC,KAAK,IAAI,CAAC;IAC9D,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC;IACxE,wEAAwE;IACxE,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
|