aibox-custom-component-packages 0.0.12 → 0.0.13

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.
Files changed (70) hide show
  1. package/es/AddOrEditSupplierDialog.mjs +2 -2
  2. package/es/ApplicationTypeTag.mjs +1 -1
  3. package/es/AuthSection.mjs +1 -1
  4. package/es/AvailableRangePreview.mjs +1 -1
  5. package/es/AvailableRangeSetting.mjs +3 -3
  6. package/es/CodeView.mjs +1 -1
  7. package/es/CommonTagsList.mjs +2 -2
  8. package/es/CreateMcpForm.mjs +5 -5
  9. package/es/DocSyncSelect.mjs +1 -1
  10. package/es/FileUploader.mjs +1 -1
  11. package/es/McpFormDialog.mjs +6 -6
  12. package/es/McpParamsSet.mjs +5 -5
  13. package/es/MdEditor.mjs +1 -1
  14. package/es/ParameterTable.mjs +3 -3
  15. package/es/PublishRecord.mjs +1 -1
  16. package/es/SourcePublish.mjs +5 -5
  17. package/es/Table.mjs +1 -1
  18. package/es/assets/CreateMcpForm.css +1 -1
  19. package/es/assets/McpFormDialog.css +1 -1
  20. package/es/assets/MdEditor.css +1 -1
  21. package/es/assets/SourcePublish.css +1 -1
  22. package/es/chunks/AddOrEditSupplierDialog.BCiXcUBu.js +721 -0
  23. package/es/chunks/AiboxTable.B_Yli5E8.js +635 -0
  24. package/es/chunks/ApplicationTypeTag.BbJwXyVa.js +47 -0
  25. package/es/chunks/AuthSection.CLi8HcIx.js +201 -0
  26. package/es/chunks/AvailableRangePreview.BgeL_bMq.js +194 -0
  27. package/es/chunks/AvailableRangeSetting.CGJxgfPT.js +229 -0
  28. package/es/chunks/CodeView.CWbewuHs.js +148 -0
  29. package/es/chunks/CommonTagsList.CJdBie2N.js +156 -0
  30. package/es/chunks/CommonTagsList.NbXVfvLW.js +156 -0
  31. package/es/chunks/CreateMcpForm.C0HqvD-g.js +308 -0
  32. package/es/chunks/CreateMcpForm.DSE5jyiW.js +308 -0
  33. package/es/chunks/DocSyncSelect.DlJXL1lq.js +2290 -0
  34. package/es/chunks/FileUploader.BSIhrd9M.js +216 -0
  35. package/es/chunks/McpFormDialog.CDH31D2Q.js +297 -0
  36. package/es/chunks/McpFormDialog.CgnC1I7i.js +297 -0
  37. package/es/chunks/McpParamsSet.Bx3aRL9j.js +501 -0
  38. package/es/chunks/MdEditor.B9-B9aiy.js +163 -0
  39. package/es/chunks/MdEditor.Bb9S_hso.js +163 -0
  40. package/es/chunks/ParameterTable.CoRz_932.js +2010 -0
  41. package/es/chunks/PublishRecord.C0841sJ-.js +133 -0
  42. package/es/chunks/PublishRecord.C8h1tu3w.js +133 -0
  43. package/es/chunks/SourcePublish.BhLjt18i.js +972 -0
  44. package/es/chunks/SourcePublish.FiswtYfr.js +972 -0
  45. package/es/chunks/SourcePublish.nfXmrVHm.js +972 -0
  46. package/es/chunks/config.CIQoQGOb.js +35 -0
  47. package/es/chunks/config.TaUlPTYL.js +270 -0
  48. package/es/chunks/config.lm2B-n0s.js +270 -0
  49. package/es/chunks/i18n.CIhVBbR3.js +418 -0
  50. package/es/index.mjs +20 -20
  51. package/lib/CommonTagsList.js +1 -1
  52. package/lib/CreateMcpForm.js +1 -1
  53. package/lib/McpFormDialog.js +1 -1
  54. package/lib/MdEditor.js +1 -1
  55. package/lib/PublishRecord.js +1 -1
  56. package/lib/SourcePublish.js +1 -1
  57. package/lib/assets/CreateMcpForm.css +1 -1
  58. package/lib/assets/McpFormDialog.css +1 -1
  59. package/lib/assets/MdEditor.css +1 -1
  60. package/lib/assets/SourcePublish.css +1 -1
  61. package/lib/chunks/CommonTagsList.QEP4G-Em.js +1 -0
  62. package/lib/chunks/CreateMcpForm.B2o0Ghjg.js +1 -0
  63. package/lib/chunks/McpFormDialog.FwXnBBd2.js +6 -0
  64. package/lib/chunks/MdEditor.Cp24y4DJ.js +1 -0
  65. package/lib/chunks/PublishRecord.BVndvj7F.js +5 -0
  66. package/lib/chunks/SourcePublish.BBsNlnp4.js +1 -0
  67. package/lib/chunks/SourcePublish.CpeV-UOG.js +1 -0
  68. package/lib/chunks/config.B9Di8LtU.js +1 -0
  69. package/lib/index.js +1 -1
  70. package/package.json +6 -5
@@ -0,0 +1,308 @@
1
+ import { t as e } from "./withinstall.dLh4K-0g.js";
2
+ import { m as t } from "./i18n.CIhVBbR3.js";
3
+ import { t as n } from "./usePreview.CMMjOD_o.js";
4
+ import { t as r } from "./FilePreview.De4zHsfc.js";
5
+ import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
6
+ import { t as a } from "./FileUploader.BSIhrd9M.js";
7
+ import { t as o } from "./RadioGroup.Czc1JtkN.js";
8
+ import { t as s } from "./AuthSection.CLi8HcIx.js";
9
+ import { t as c } from "./MdEditor.Bb9S_hso.js";
10
+ import { createBlock as l, createCommentVNode as u, createElementVNode as d, createTextVNode as f, createVNode as p, openBlock as m, reactive as h, ref as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
11
+ import { ElForm as x, ElFormItem as S, ElIcon as C, ElInput as w, ElMessage as T, ElTooltip as E } from "element-plus";
12
+ import { IconTip as D } from "color-message-aibox-vue";
13
+ import '../assets/CreateMcpForm.css';//#region components/CreateMcpForm/config.js
14
+ var O = () => {
15
+ let { t: e } = t();
16
+ return {
17
+ rulesObj: {
18
+ name: [{
19
+ required: !0,
20
+ message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_PLACEHOLDER"),
21
+ trigger: "blur"
22
+ }, {
23
+ max: 20,
24
+ message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_MAX"),
25
+ trigger: "blur"
26
+ }],
27
+ description: [{
28
+ required: !0,
29
+ message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
30
+ trigger: "blur"
31
+ }, {
32
+ max: 200,
33
+ message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_MAX"),
34
+ trigger: "blur"
35
+ }],
36
+ overview: [{
37
+ required: !0,
38
+ message: e("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
39
+ trigger: "blur"
40
+ }],
41
+ address: [{
42
+ type: "url",
43
+ required: !0,
44
+ message: e("LIBRARY_CREATEMCPFORM.SERVICE_URL_INVALID"),
45
+ trigger: ["blur", "change"]
46
+ }],
47
+ communicationType: [{
48
+ required: !0,
49
+ message: e("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD_REQUIRED"),
50
+ trigger: "change"
51
+ }],
52
+ applyLink: [{
53
+ type: "url",
54
+ message: e("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_INVALID"),
55
+ trigger: ["blur", "change"]
56
+ }]
57
+ },
58
+ communicationTypeOpts: [{
59
+ label: "SSE",
60
+ value: "SSE"
61
+ }, {
62
+ label: "Streamable HTTP",
63
+ value: "HTTP"
64
+ }]
65
+ };
66
+ }, k = { class: "label-with-icon" }, A = { class: "label-with-icon" }, j = { class: "auth-section-wrapper" }, M = e(/* @__PURE__ */ i({
67
+ __name: "CreateMcpForm",
68
+ props: { showOverview: {
69
+ type: Boolean,
70
+ default: !1
71
+ } },
72
+ setup(e, { expose: i }) {
73
+ let M = e, { t: N } = t(), { previewImage: P } = n(), F = g(null), I = g(null), { rulesObj: L, communicationTypeOpts: R } = O(), z = h({
74
+ icon: "",
75
+ iconUrl: "",
76
+ name: "",
77
+ description: "",
78
+ overview: "",
79
+ communicationType: "HTTP",
80
+ address: "",
81
+ applyLink: ""
82
+ }), B = g(R), V = g({ auth: {
83
+ authType: "none",
84
+ keyType: "custom",
85
+ paramLocation: "header",
86
+ paramName: "",
87
+ paramValue: "",
88
+ token: ""
89
+ } }), H = g({ ...L }), U = () => {
90
+ M.showOverview ? H.value.overview = L.overview : delete H.value.overview;
91
+ };
92
+ y(() => M.showOverview, () => {
93
+ U();
94
+ }, { immediate: !0 });
95
+ let W = g([]), G = (e) => {
96
+ z.iconUrl = e.url, z.icon = e.bnid, W.value = [e];
97
+ }, K = () => {
98
+ z.iconUrl = "", z.icon = "", W.value = [];
99
+ }, q = (e) => {
100
+ P(e.url);
101
+ };
102
+ return i({
103
+ validate: async (e) => {
104
+ if (!F.value) return !1;
105
+ if (U(), I.value?.validateField) {
106
+ let t = I.value.validateField();
107
+ if (Object.keys(t).length > 0) return t.paramName ? T.error(N("LIBRARY_CREATEMCPFORM.PARAMETER_NAME_REQUIRED")) : t.paramValue || t.token ? T.error(N("LIBRARY_CREATEMCPFORM.INPUT_API_KEY_REQUIRED")) : T.error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED")), e?.(Error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED"))), !1;
108
+ }
109
+ return F.value.validate(e);
110
+ },
111
+ getFormData: () => ({
112
+ name: z.name,
113
+ icon: z.icon,
114
+ description: z.description,
115
+ overview: M.showOverview ? z.overview : "",
116
+ address: z.address,
117
+ communicationType: z.communicationType,
118
+ authType: V.value.auth.authType === "none" ? 0 : 1,
119
+ authLocation: V.value.auth.paramLocation === "header" ? 0 : 1,
120
+ apiKeyName: V.value.auth.keyType === "bearer" ? "Authorization" : V.value.auth.paramName || "",
121
+ apiKeyValue: V.value.auth.keyType === "bearer" ? V.value.auth.token ? `Bearer ${V.value.auth.token}` : "" : V.value.auth.paramValue || "",
122
+ applyLink: z.applyLink || "",
123
+ headerPrefixType: 1
124
+ }),
125
+ setFormData: (e) => {
126
+ if (!e) return;
127
+ Object.assign(z, {
128
+ name: e.name || "",
129
+ description: e.description || "",
130
+ overview: e.overview || "",
131
+ icon: e.icon || "",
132
+ iconUrl: e.iconUrl || "",
133
+ communicationType: e.communicationType || "SSE",
134
+ address: e.address || "",
135
+ applyLink: e.applyLink || ""
136
+ });
137
+ let t = e.authType === 1 || e.authType === "1";
138
+ if (V.value.auth.authType = t ? "apiKey" : "none", V.value.auth.paramLocation = e.authLocation === 0 || e.authLocation === "0" ? "header" : "query", t) {
139
+ let t = !e.apiKeyName || e.apiKeyName === "Authorization";
140
+ if (V.value.auth.keyType = t ? "bearer" : "custom", t) {
141
+ V.value.auth.paramName = "", V.value.auth.paramValue = "";
142
+ let t = e.apiKeyValue || "";
143
+ V.value.auth.token = t.startsWith("Bearer ") ? t.substring(7) : t;
144
+ } else V.value.auth.paramName = e.apiKeyName || "", V.value.auth.paramValue = e.apiKeyValue || "", V.value.auth.token = "";
145
+ } else V.value.auth.keyType = "custom", V.value.auth.paramName = "", V.value.auth.paramValue = "", V.value.auth.token = "";
146
+ e.icon && e.icon !== "0" && e.iconUrl && (W.value = [{
147
+ bnid: e.icon,
148
+ url: e.iconUrl
149
+ }]);
150
+ }
151
+ }), (t, n) => (m(), l(v(x), {
152
+ ref_key: "ruleFormRef",
153
+ ref: F,
154
+ model: z,
155
+ rules: H.value,
156
+ "label-width": "auto",
157
+ "label-position": "top",
158
+ class: "scrollable-form"
159
+ }, {
160
+ default: b(() => [
161
+ p(v(S), {
162
+ class: "scrollable-form__item",
163
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON"),
164
+ prop: "icon"
165
+ }, {
166
+ label: b(() => [d("div", k, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON")), 1), p(v(E), { placement: "top" }, {
167
+ content: b(() => [
168
+ f(_(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_TIP")), 1),
169
+ n[7] ||= d("br", null, null, -1),
170
+ f(" " + _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_SIZE_TIP")), 1)
171
+ ]),
172
+ default: b(() => [p(v(C), {
173
+ size: "14px",
174
+ color: "#999"
175
+ }, {
176
+ default: b(() => [p(v(D))]),
177
+ _: 1
178
+ })]),
179
+ _: 1
180
+ })])]),
181
+ default: b(() => [p(v(r), {
182
+ fileList: W.value,
183
+ previewType: "Card",
184
+ isCustom: !0,
185
+ onOnRemove: K,
186
+ onOnPreview: q
187
+ }, {
188
+ CardUploader: b(() => [W.value.length === 0 ? (m(), l(v(a), {
189
+ key: 0,
190
+ "upload-type": "Card",
191
+ onOnSuccess: G,
192
+ limitSize: 5,
193
+ acceptType: ".jpg,.png",
194
+ businessType: "mcp",
195
+ defaultUploadIcon: "mcp"
196
+ })) : u("", !0)]),
197
+ _: 1
198
+ }, 8, ["fileList"])]),
199
+ _: 1
200
+ }, 8, ["label"]),
201
+ p(v(S), {
202
+ class: "scrollable-form__item",
203
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME"),
204
+ prop: "name"
205
+ }, {
206
+ default: b(() => [p(v(w), {
207
+ modelValue: z.name,
208
+ "onUpdate:modelValue": n[0] ||= (e) => z.name = e,
209
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME_REQUIRED"),
210
+ maxlength: "20",
211
+ "show-word-limit": ""
212
+ }, null, 8, ["modelValue", "placeholder"])]),
213
+ _: 1
214
+ }, 8, ["label"]),
215
+ p(v(S), {
216
+ class: "scrollable-form__item",
217
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION"),
218
+ prop: "description"
219
+ }, {
220
+ default: b(() => [p(v(w), {
221
+ modelValue: z.description,
222
+ "onUpdate:modelValue": n[1] ||= (e) => z.description = e,
223
+ type: "textarea",
224
+ rows: 3,
225
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
226
+ maxlength: "200",
227
+ "show-word-limit": ""
228
+ }, null, 8, ["modelValue", "placeholder"])]),
229
+ _: 1
230
+ }, 8, ["label"]),
231
+ e.showOverview ? (m(), l(v(S), {
232
+ key: 0,
233
+ class: "scrollable-form__item",
234
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW"),
235
+ prop: "overview"
236
+ }, {
237
+ default: b(() => [p(v(c), {
238
+ modelValue: z.overview,
239
+ "onUpdate:modelValue": n[2] ||= (e) => z.overview = e,
240
+ height: "300px",
241
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
242
+ businessType: "mcp"
243
+ }, null, 8, ["modelValue", "placeholder"])]),
244
+ _: 1
245
+ }, 8, ["label"])) : u("", !0),
246
+ p(v(S), {
247
+ class: "scrollable-form__item",
248
+ label: v(N)("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD"),
249
+ prop: "communicationType"
250
+ }, {
251
+ default: b(() => [p(v(o), {
252
+ modelValue: z.communicationType,
253
+ "onUpdate:modelValue": n[3] ||= (e) => z.communicationType = e,
254
+ options: B.value,
255
+ layout: "vertical",
256
+ "class-name": "scrollable-form__item-radio"
257
+ }, null, 8, ["modelValue", "options"])]),
258
+ _: 1
259
+ }, 8, ["label"]),
260
+ p(v(S), {
261
+ class: "scrollable-form__item",
262
+ label: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL"),
263
+ prop: "address"
264
+ }, {
265
+ default: b(() => [p(v(w), {
266
+ modelValue: z.address,
267
+ "onUpdate:modelValue": n[4] ||= (e) => z.address = e,
268
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL_REQUIRED")
269
+ }, null, 8, ["modelValue", "placeholder"])]),
270
+ _: 1
271
+ }, 8, ["label"]),
272
+ V.value.auth.authType === "apiKey" ? (m(), l(v(S), {
273
+ key: 1,
274
+ class: "scrollable-form__item",
275
+ prop: "applyLink"
276
+ }, {
277
+ label: b(() => [d("div", A, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL")), 1), p(v(E), { placement: "top" }, {
278
+ content: b(() => [f(_(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_TIP")), 1)]),
279
+ default: b(() => [p(v(C), {
280
+ size: "14px",
281
+ color: "#999"
282
+ }, {
283
+ default: b(() => [p(v(D))]),
284
+ _: 1
285
+ })]),
286
+ _: 1
287
+ })])]),
288
+ default: b(() => [p(v(w), {
289
+ modelValue: z.applyLink,
290
+ "onUpdate:modelValue": n[5] ||= (e) => z.applyLink = e,
291
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_REQUIRED")
292
+ }, null, 8, ["modelValue", "placeholder"])]),
293
+ _: 1
294
+ })) : u("", !0),
295
+ d("div", j, [p(v(s), {
296
+ ref_key: "authSectionRef",
297
+ ref: I,
298
+ featData: V.value,
299
+ "onUpdate:featData": n[6] ||= (e) => V.value = e,
300
+ layout: "vertical"
301
+ }, null, 8, ["featData"])])
302
+ ]),
303
+ _: 1
304
+ }, 8, ["model", "rules"]));
305
+ }
306
+ }, [["__scopeId", "data-v-47c4a3f2"]]));
307
+ //#endregion
308
+ export { M as t };
@@ -0,0 +1,308 @@
1
+ import { t as e } from "./withinstall.dLh4K-0g.js";
2
+ import { m as t } from "./i18n.CIhVBbR3.js";
3
+ import { t as n } from "./usePreview.CMMjOD_o.js";
4
+ import { t as r } from "./FilePreview.De4zHsfc.js";
5
+ import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
6
+ import { t as a } from "./FileUploader.BSIhrd9M.js";
7
+ import { t as o } from "./RadioGroup.Czc1JtkN.js";
8
+ import { t as s } from "./AuthSection.CLi8HcIx.js";
9
+ import { t as c } from "./MdEditor.B9-B9aiy.js";
10
+ import { createBlock as l, createCommentVNode as u, createElementVNode as d, createTextVNode as f, createVNode as p, openBlock as m, reactive as h, ref as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
11
+ import { ElForm as x, ElFormItem as S, ElIcon as C, ElInput as w, ElMessage as T, ElTooltip as E } from "element-plus";
12
+ import { IconTip as D } from "color-message-aibox-vue";
13
+ import '../assets/CreateMcpForm.css';//#region components/CreateMcpForm/config.js
14
+ var O = () => {
15
+ let { t: e } = t();
16
+ return {
17
+ rulesObj: {
18
+ name: [{
19
+ required: !0,
20
+ message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_PLACEHOLDER"),
21
+ trigger: "blur"
22
+ }, {
23
+ max: 20,
24
+ message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_MAX"),
25
+ trigger: "blur"
26
+ }],
27
+ description: [{
28
+ required: !0,
29
+ message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
30
+ trigger: "blur"
31
+ }, {
32
+ max: 200,
33
+ message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_MAX"),
34
+ trigger: "blur"
35
+ }],
36
+ overview: [{
37
+ required: !0,
38
+ message: e("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
39
+ trigger: "blur"
40
+ }],
41
+ address: [{
42
+ type: "url",
43
+ required: !0,
44
+ message: e("LIBRARY_CREATEMCPFORM.SERVICE_URL_INVALID"),
45
+ trigger: ["blur", "change"]
46
+ }],
47
+ communicationType: [{
48
+ required: !0,
49
+ message: e("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD_REQUIRED"),
50
+ trigger: "change"
51
+ }],
52
+ applyLink: [{
53
+ type: "url",
54
+ message: e("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_INVALID"),
55
+ trigger: ["blur", "change"]
56
+ }]
57
+ },
58
+ communicationTypeOpts: [{
59
+ label: "SSE",
60
+ value: "SSE"
61
+ }, {
62
+ label: "Streamable HTTP",
63
+ value: "HTTP"
64
+ }]
65
+ };
66
+ }, k = { class: "label-with-icon" }, A = { class: "label-with-icon" }, j = { class: "auth-section-wrapper" }, M = e(/* @__PURE__ */ i({
67
+ __name: "CreateMcpForm",
68
+ props: { showOverview: {
69
+ type: Boolean,
70
+ default: !1
71
+ } },
72
+ setup(e, { expose: i }) {
73
+ let M = e, { t: N } = t(), { previewImage: P } = n(), F = g(null), I = g(null), { rulesObj: L, communicationTypeOpts: R } = O(), z = h({
74
+ icon: "",
75
+ iconUrl: "",
76
+ name: "",
77
+ description: "",
78
+ overview: "",
79
+ communicationType: "HTTP",
80
+ address: "",
81
+ applyLink: ""
82
+ }), B = g(R), V = g({ auth: {
83
+ authType: "none",
84
+ keyType: "custom",
85
+ paramLocation: "header",
86
+ paramName: "",
87
+ paramValue: "",
88
+ token: ""
89
+ } }), H = g({ ...L }), U = () => {
90
+ M.showOverview ? H.value.overview = L.overview : delete H.value.overview;
91
+ };
92
+ y(() => M.showOverview, () => {
93
+ U();
94
+ }, { immediate: !0 });
95
+ let W = g([]), G = (e) => {
96
+ z.iconUrl = e.url, z.icon = e.bnid, W.value = [e];
97
+ }, K = () => {
98
+ z.iconUrl = "", z.icon = "", W.value = [];
99
+ }, q = (e) => {
100
+ P(e.url);
101
+ };
102
+ return i({
103
+ validate: async (e) => {
104
+ if (!F.value) return !1;
105
+ if (U(), I.value?.validateField) {
106
+ let t = I.value.validateField();
107
+ if (Object.keys(t).length > 0) return t.paramName ? T.error(N("LIBRARY_CREATEMCPFORM.PARAMETER_NAME_REQUIRED") || "请输入密钥参数名") : t.paramValue || t.token ? T.error(N("LIBRARY_CREATEMCPFORM.INPUT_API_KEY_REQUIRED") || "请输入密钥值") : T.error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息"), e?.(Error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息")), !1;
108
+ }
109
+ return F.value.validate(e);
110
+ },
111
+ getFormData: () => ({
112
+ name: z.name,
113
+ icon: z.icon,
114
+ description: z.description,
115
+ overview: M.showOverview ? z.overview : "",
116
+ address: z.address,
117
+ communicationType: z.communicationType,
118
+ authType: V.value.auth.authType === "none" ? 0 : 1,
119
+ authLocation: V.value.auth.paramLocation === "header" ? 0 : 1,
120
+ apiKeyName: V.value.auth.keyType === "bearer" ? "Authorization" : V.value.auth.paramName || "",
121
+ apiKeyValue: V.value.auth.keyType === "bearer" ? V.value.auth.token ? `Bearer ${V.value.auth.token}` : "" : V.value.auth.paramValue || "",
122
+ applyLink: z.applyLink || "",
123
+ headerPrefixType: 1
124
+ }),
125
+ setFormData: (e) => {
126
+ if (!e) return;
127
+ Object.assign(z, {
128
+ name: e.name || "",
129
+ description: e.description || "",
130
+ overview: e.overview || "",
131
+ icon: e.icon || "",
132
+ iconUrl: e.iconUrl || "",
133
+ communicationType: e.communicationType || "SSE",
134
+ address: e.address || "",
135
+ applyLink: e.applyLink || ""
136
+ });
137
+ let t = e.authType === 1 || e.authType === "1";
138
+ if (V.value.auth.authType = t ? "apiKey" : "none", V.value.auth.paramLocation = e.authLocation === 0 || e.authLocation === "0" ? "header" : "query", t) {
139
+ let t = !e.apiKeyName || e.apiKeyName === "Authorization";
140
+ if (V.value.auth.keyType = t ? "bearer" : "custom", t) {
141
+ V.value.auth.paramName = "", V.value.auth.paramValue = "";
142
+ let t = e.apiKeyValue || "";
143
+ V.value.auth.token = t.startsWith("Bearer ") ? t.substring(7) : t;
144
+ } else V.value.auth.paramName = e.apiKeyName || "", V.value.auth.paramValue = e.apiKeyValue || "", V.value.auth.token = "";
145
+ } else V.value.auth.keyType = "custom", V.value.auth.paramName = "", V.value.auth.paramValue = "", V.value.auth.token = "";
146
+ e.icon && e.icon !== "0" && e.iconUrl && (W.value = [{
147
+ bnid: e.icon,
148
+ url: e.iconUrl
149
+ }]);
150
+ }
151
+ }), (t, n) => (m(), l(v(x), {
152
+ ref_key: "ruleFormRef",
153
+ ref: F,
154
+ model: z,
155
+ rules: H.value,
156
+ "label-width": "auto",
157
+ "label-position": "top",
158
+ class: "scrollable-form"
159
+ }, {
160
+ default: b(() => [
161
+ p(v(S), {
162
+ class: "scrollable-form__item",
163
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON"),
164
+ prop: "icon"
165
+ }, {
166
+ label: b(() => [d("div", k, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON")), 1), p(v(E), { placement: "top" }, {
167
+ content: b(() => [
168
+ f(_(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_TIP")), 1),
169
+ n[7] ||= d("br", null, null, -1),
170
+ f(" " + _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_SIZE_TIP")), 1)
171
+ ]),
172
+ default: b(() => [p(v(C), {
173
+ size: "14px",
174
+ color: "#999"
175
+ }, {
176
+ default: b(() => [p(v(D))]),
177
+ _: 1
178
+ })]),
179
+ _: 1
180
+ })])]),
181
+ default: b(() => [p(v(r), {
182
+ fileList: W.value,
183
+ previewType: "Card",
184
+ isCustom: !0,
185
+ onOnRemove: K,
186
+ onOnPreview: q
187
+ }, {
188
+ CardUploader: b(() => [W.value.length === 0 ? (m(), l(v(a), {
189
+ key: 0,
190
+ "upload-type": "Card",
191
+ onOnSuccess: G,
192
+ limitSize: 5,
193
+ acceptType: ".jpg,.png",
194
+ businessType: "mcp",
195
+ defaultUploadIcon: "mcp"
196
+ })) : u("", !0)]),
197
+ _: 1
198
+ }, 8, ["fileList"])]),
199
+ _: 1
200
+ }, 8, ["label"]),
201
+ p(v(S), {
202
+ class: "scrollable-form__item",
203
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME"),
204
+ prop: "name"
205
+ }, {
206
+ default: b(() => [p(v(w), {
207
+ modelValue: z.name,
208
+ "onUpdate:modelValue": n[0] ||= (e) => z.name = e,
209
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME_REQUIRED"),
210
+ maxlength: "20",
211
+ "show-word-limit": ""
212
+ }, null, 8, ["modelValue", "placeholder"])]),
213
+ _: 1
214
+ }, 8, ["label"]),
215
+ p(v(S), {
216
+ class: "scrollable-form__item",
217
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION"),
218
+ prop: "description"
219
+ }, {
220
+ default: b(() => [p(v(w), {
221
+ modelValue: z.description,
222
+ "onUpdate:modelValue": n[1] ||= (e) => z.description = e,
223
+ type: "textarea",
224
+ rows: 3,
225
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
226
+ maxlength: "200",
227
+ "show-word-limit": ""
228
+ }, null, 8, ["modelValue", "placeholder"])]),
229
+ _: 1
230
+ }, 8, ["label"]),
231
+ e.showOverview ? (m(), l(v(S), {
232
+ key: 0,
233
+ class: "scrollable-form__item",
234
+ label: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW"),
235
+ prop: "overview"
236
+ }, {
237
+ default: b(() => [p(v(c), {
238
+ modelValue: z.overview,
239
+ "onUpdate:modelValue": n[2] ||= (e) => z.overview = e,
240
+ height: "300px",
241
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
242
+ businessType: "mcp"
243
+ }, null, 8, ["modelValue", "placeholder"])]),
244
+ _: 1
245
+ }, 8, ["label"])) : u("", !0),
246
+ p(v(S), {
247
+ class: "scrollable-form__item",
248
+ label: v(N)("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD"),
249
+ prop: "communicationType"
250
+ }, {
251
+ default: b(() => [p(v(o), {
252
+ modelValue: z.communicationType,
253
+ "onUpdate:modelValue": n[3] ||= (e) => z.communicationType = e,
254
+ options: B.value,
255
+ layout: "vertical",
256
+ "class-name": "scrollable-form__item-radio"
257
+ }, null, 8, ["modelValue", "options"])]),
258
+ _: 1
259
+ }, 8, ["label"]),
260
+ p(v(S), {
261
+ class: "scrollable-form__item",
262
+ label: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL"),
263
+ prop: "address"
264
+ }, {
265
+ default: b(() => [p(v(w), {
266
+ modelValue: z.address,
267
+ "onUpdate:modelValue": n[4] ||= (e) => z.address = e,
268
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL_REQUIRED")
269
+ }, null, 8, ["modelValue", "placeholder"])]),
270
+ _: 1
271
+ }, 8, ["label"]),
272
+ V.value.auth.authType === "apiKey" ? (m(), l(v(S), {
273
+ key: 1,
274
+ class: "scrollable-form__item",
275
+ prop: "applyLink"
276
+ }, {
277
+ label: b(() => [d("div", A, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL")), 1), p(v(E), { placement: "top" }, {
278
+ content: b(() => [f(_(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_TIP")), 1)]),
279
+ default: b(() => [p(v(C), {
280
+ size: "14px",
281
+ color: "#999"
282
+ }, {
283
+ default: b(() => [p(v(D))]),
284
+ _: 1
285
+ })]),
286
+ _: 1
287
+ })])]),
288
+ default: b(() => [p(v(w), {
289
+ modelValue: z.applyLink,
290
+ "onUpdate:modelValue": n[5] ||= (e) => z.applyLink = e,
291
+ placeholder: v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_REQUIRED")
292
+ }, null, 8, ["modelValue", "placeholder"])]),
293
+ _: 1
294
+ })) : u("", !0),
295
+ d("div", j, [p(v(s), {
296
+ ref_key: "authSectionRef",
297
+ ref: I,
298
+ featData: V.value,
299
+ "onUpdate:featData": n[6] ||= (e) => V.value = e,
300
+ layout: "vertical"
301
+ }, null, 8, ["featData"])])
302
+ ]),
303
+ _: 1
304
+ }, 8, ["model", "rules"]));
305
+ }
306
+ }, [["__scopeId", "data-v-b8579cd8"]]));
307
+ //#endregion
308
+ export { M as t };