@kong-ui-public/entities-gateway-services 3.14.20-pr.2823.44b88daa4.0 → 3.14.20-pr.2836.18eab0ddc.0

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 (36) hide show
  1. package/dist/entities-gateway-services.es.js +1750 -0
  2. package/dist/entities-gateway-services.umd.js +1 -0
  3. package/dist/style.css +1 -0
  4. package/dist/types/components/GatewayServiceConfigCard.vue.d.ts +63 -0
  5. package/dist/types/components/GatewayServiceConfigCard.vue.d.ts.map +1 -0
  6. package/dist/types/components/GatewayServiceForm.vue.d.ts +98 -0
  7. package/dist/types/components/GatewayServiceForm.vue.d.ts.map +1 -0
  8. package/dist/types/components/GatewayServiceList.vue.d.ts +133 -0
  9. package/dist/types/components/GatewayServiceList.vue.d.ts.map +1 -0
  10. package/dist/types/composables/getPortFromProtocol.d.ts +4 -0
  11. package/dist/types/composables/getPortFromProtocol.d.ts.map +1 -0
  12. package/dist/types/composables/index.d.ts +10 -0
  13. package/dist/types/composables/index.d.ts.map +1 -0
  14. package/dist/types/composables/useI18n.d.ts +9 -0
  15. package/dist/types/composables/useI18n.d.ts.map +1 -0
  16. package/dist/types/composables/useUrlValidators.d.ts +8 -0
  17. package/dist/types/composables/useUrlValidators.d.ts.map +1 -0
  18. package/dist/types/constants.d.ts +15 -0
  19. package/dist/types/constants.d.ts.map +1 -0
  20. package/dist/types/gateway-services-endpoints.d.ts +22 -0
  21. package/dist/types/gateway-services-endpoints.d.ts.map +1 -0
  22. package/dist/types/index.d.ts +7 -0
  23. package/dist/types/index.d.ts.map +1 -0
  24. package/dist/types/types/gateway-service-config-card.d.ts +28 -0
  25. package/dist/types/types/gateway-service-config-card.d.ts.map +1 -0
  26. package/dist/types/types/gateway-service-form.d.ts +68 -0
  27. package/dist/types/types/gateway-service-form.d.ts.map +1 -0
  28. package/dist/types/types/gateway-service-list.d.ts +38 -0
  29. package/dist/types/types/gateway-service-list.d.ts.map +1 -0
  30. package/dist/types/types/index.d.ts +4 -0
  31. package/dist/types/types/index.d.ts.map +1 -0
  32. package/dist/types/utils/index.d.ts +2 -0
  33. package/dist/types/utils/index.d.ts.map +1 -0
  34. package/dist/types/utils/urlValidator.d.ts +4 -0
  35. package/dist/types/utils/urlValidator.d.ts.map +1 -0
  36. package/package.json +4 -4
@@ -0,0 +1,1750 @@
1
+ import { defineComponent as Me, ref as U, computed as S, watch as xe, onBeforeMount as ze, resolveComponent as M, createElementBlock as A, openBlock as V, createVNode as c, unref as o, createSlots as ke, withCtx as u, createTextVNode as T, toDisplayString as b, createBlock as le, createCommentVNode as R, createElementVNode as P, withModifiers as Re, Teleport as He, reactive as De, onMounted as Ze, Transition as Te, Fragment as Je, renderList as Qe, renderSlot as Xe } from "vue";
2
+ import { useRouter as Ge } from "vue-router";
3
+ import { BookIcon as Be, AddIcon as Ke, ServicesIcon as Ye } from "@kong/icons";
4
+ import { createI18n as et, i18nTComponent as tt } from "@kong-ui-public/i18n";
5
+ import { useAxios as Ne, useTableState as ot, useFetcher as rt, useDeleteUrlBuilder as it, FetcherStatus as lt, EntityBaseTable as st, PermissionsWrapper as ie, TableTags as at, EntityFilter as nt, EntityToggleModal as ct, EntityDeleteModal as dt, EntityTypes as ut, useHelpers as We, ConfigurationSchemaType as ft, ConfigurationSchemaSection as we, EntityBaseConfigCard as pt, SupportedEntityType as Oe, useErrors as mt, useValidators as vt, EntityBaseFormType as Le, useGatewayFeatureSupported as gt, EntityBaseForm as yt, EntityFormSection as qe } from "@kong-ui-public/entities-shared";
6
+ const _t = {
7
+ create: "New gateway service",
8
+ debugger: "Start debugging",
9
+ serverless_create: "Add a Service",
10
+ copy_id: "Copy ID",
11
+ copy_json: "Copy JSON",
12
+ edit: "Edit",
13
+ clear: "Clear",
14
+ view: "View Details",
15
+ delete: {
16
+ title: "Delete a Gateway Service",
17
+ description: "Deleting this Gateway Service will also remove any associated plugins. This action cannot be reversed.",
18
+ menu_label: "Delete"
19
+ }
20
+ }, ht = {
21
+ placeholder: {
22
+ konnect: "Filter by name",
23
+ kongManager: "Filter by exact name or ID"
24
+ }
25
+ }, bt = {
26
+ title: "Gateway Services",
27
+ list: {
28
+ toolbar_actions: {
29
+ new_gateway_service: "New gateway service"
30
+ },
31
+ table_headers: {
32
+ name: "Name",
33
+ control_plane: "Control Plane",
34
+ protocol: "Protocol",
35
+ host: "Host",
36
+ port: "Port",
37
+ path: "Path",
38
+ enabled: "Enabled",
39
+ tags: "Tags",
40
+ id: "ID",
41
+ created_at: "Created At",
42
+ updated_at: "Last Modified"
43
+ },
44
+ empty_state: {
45
+ title: "Configure a New Gateway Service",
46
+ description: "Gateway services are used to proxy traffic.",
47
+ serverless_title: "Configure your first Gateway Service"
48
+ }
49
+ },
50
+ empty_state_v2: {
51
+ create: "New gateway service",
52
+ title: "Configure your first gateway service",
53
+ group: "Services created in gateways within this group will automatically appear here.",
54
+ description: "Gateway services represent backend APIs or microservices that receive traffic routed through the gateway.",
55
+ learn_more: "Learn more"
56
+ },
57
+ form: {
58
+ buttons: {
59
+ try_sample: "Try sample API"
60
+ },
61
+ errors: {
62
+ host: {
63
+ empty: "Host cannot be empty",
64
+ invalid: "Invalid host"
65
+ },
66
+ port: {
67
+ type: "Port must be a number",
68
+ invalid: "Port must be between 0 and 65535"
69
+ },
70
+ path: {
71
+ prefix: "Path must begin with /",
72
+ invalid: "Path should not include characters outside of the reserved list of RFC 3986"
73
+ },
74
+ protocol: {
75
+ empty: "Protocol cannot be empty",
76
+ invalid: "Protocol - value must be one of http, https, grpc, grpcs, tcp, udp, tls, tls_passthrough, ws, wss"
77
+ },
78
+ url: {
79
+ invalid: "The URL must follow a valid format. Example: https://api.kong-air.com/flights"
80
+ }
81
+ },
82
+ sections: {
83
+ general: {
84
+ title: "General Information",
85
+ description: "Provide a name and tags to help identify and manage this service."
86
+ },
87
+ keys: {
88
+ title: "Service endpoint",
89
+ description: "Define where this service should send requests.",
90
+ checkedGroupLabel: "Choose how and where to send traffic",
91
+ urlLabel: "Full URL",
92
+ checkedGroupAltLabel: "Protocol, host, port and path",
93
+ url: {
94
+ label: "Full URL",
95
+ description: "Define the service using a single, complete API URL for simple setup."
96
+ },
97
+ protocol: {
98
+ label: "Protocol, host, port, and path",
99
+ description: "Manually specify each component of the API’s URL for advanced configurations."
100
+ },
101
+ viewAdvancedFields: "View advanced fields"
102
+ }
103
+ },
104
+ fields: {
105
+ upstream_url: {
106
+ label: "Full URL",
107
+ placeholder: "e.g. https://api.kong-air.com/flights",
108
+ tooltip_for_konnect: "This is the URL of the API you will manage in Konnect.",
109
+ tooltip_for_km: "This is the URL of the API you will manage in Kong Gateway."
110
+ },
111
+ name: {
112
+ label: "Name",
113
+ placeholder: "Enter a unique name",
114
+ tooltip: "The Service name."
115
+ },
116
+ protocol: {
117
+ label: "Protocol",
118
+ tooltip: "The protocol used to communicate with the upstream.",
119
+ options: {
120
+ http: "http",
121
+ https: "https",
122
+ tcp: "tcp",
123
+ tls: "tls",
124
+ tls_passthrough: "tls_passthrough",
125
+ grpc: "grpc",
126
+ grpcs: "grpcs",
127
+ ws: "ws",
128
+ wss: "wss",
129
+ udp: "udp"
130
+ }
131
+ },
132
+ host: {
133
+ label: "Host",
134
+ placeholder: "e.g. api.kong-air.com",
135
+ tooltip: "The host of the upstream server. Note that the host value is case sensitive."
136
+ },
137
+ path: {
138
+ label: "Path",
139
+ placeholder: "e.g. /sample",
140
+ tooltip: "The path to be used in request to the upstream server."
141
+ },
142
+ port: {
143
+ label: "Port",
144
+ tooltip: "The upstream server port."
145
+ },
146
+ retries: {
147
+ label: "Retries",
148
+ tooltip: "The number of retries to execute upon failure to proxy."
149
+ },
150
+ connect_timeout: {
151
+ label: "Connection timeout",
152
+ tooltip: "The timeout in milliseconds for establishing a connection to the upstream server."
153
+ },
154
+ write_timeout: {
155
+ label: "Write timeout",
156
+ tooltip: "The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server."
157
+ },
158
+ read_timeout: {
159
+ label: "Read timeout",
160
+ tooltip: "The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server."
161
+ },
162
+ client_certificate: {
163
+ label: "Client certificate",
164
+ placeholder: "Enter a Certificate ID",
165
+ tooltip: "Certificate to be used as client certificate while TLS handshaking to the upstream server."
166
+ },
167
+ ca_certificates: {
168
+ label: "CA certificates",
169
+ placeholder: "Enter a comma separated list of CA Certificate IDs",
170
+ tooltip: "Array of {code1} object UUIDs that are used to build the trust store while verifying upstream server's TLS certificate. If set to {code2} when Nginx default is respected. If default CA list in Nginx are not specified and TLS verification is enabled, then handshake with upstream server will always fail (because no CA are trusted).",
171
+ code1: "CA Certificate",
172
+ code2: "null"
173
+ },
174
+ tls_verify_enabled: {
175
+ label: "TLS verify",
176
+ help: "If unchecked, use default system setting",
177
+ tooltip: "Whether to enable verification of upstream server TLS certificate. If set to {code1}, then the Nginx default is respected.",
178
+ code1: "null"
179
+ },
180
+ tls_verify_option: {
181
+ unset: {
182
+ display: "Use default system setting"
183
+ },
184
+ true: {
185
+ label: "True",
186
+ display: "On"
187
+ },
188
+ false: {
189
+ label: "False",
190
+ display: "Off"
191
+ }
192
+ },
193
+ tags: {
194
+ label: "Tags",
195
+ tooltip: "An optional set of strings associated with the Service for grouping and filtering.",
196
+ placeholder: "Enter a list of tags separated by comma",
197
+ help: "e.g. tag1, tag2, tag3",
198
+ collapse: "Add tags"
199
+ },
200
+ enabled: {
201
+ label: "Enabled",
202
+ tooltip: "Whether the Service is active. If set to {false}, the proxy behavior will be as if any routes attached to it do not exist (404). Default: {true}.",
203
+ false: "false",
204
+ true: "true"
205
+ }
206
+ }
207
+ }
208
+ }, wt = {
209
+ general: "Gateway Services could not be retrieved",
210
+ delete: "The gateway service could not be deleted at this time.",
211
+ copy: "Failed to copy to clipboard",
212
+ urlErrorMessage: "Error: invalid URL"
213
+ }, kt = {
214
+ success: "Copied {val} to clipboard",
215
+ success_brief: "Successfully copied to clipboard"
216
+ }, Vt = {
217
+ gateway_services: "gateway services"
218
+ }, St = {
219
+ actions: _t,
220
+ search: ht,
221
+ gateway_services: bt,
222
+ errors: wt,
223
+ copy: kt,
224
+ glossary: Vt
225
+ };
226
+ function Ct() {
227
+ const s = et("en-us", St);
228
+ return {
229
+ i18n: s,
230
+ i18nT: tt(s)
231
+ // Translation component <i18n-t>
232
+ };
233
+ }
234
+ function Et() {
235
+ return {
236
+ getPortFromProtocol: (q, m) => {
237
+ const d = [80, 443], a = Number(m);
238
+ if ((a || a === 0) && !d.includes(a))
239
+ return a;
240
+ switch (q) {
241
+ case "grpcs":
242
+ case "tls":
243
+ case "https":
244
+ case "wss":
245
+ return 443;
246
+ case "grpc":
247
+ case "tcp":
248
+ case "http":
249
+ case "ws":
250
+ default:
251
+ return 80;
252
+ }
253
+ }
254
+ };
255
+ }
256
+ function Pt() {
257
+ const { i18n: { t: s } } = Q.useI18n();
258
+ return {
259
+ validateHost: (v) => {
260
+ if (!v || v.trim() === "") return s("gateway_services.form.errors.host.empty");
261
+ const F = /^(?!:\/\/)([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)(\.[a-zA-Z]{1,63})?$/;
262
+ return /^((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])$/.test(v) || F.test(v) ? "" : s("gateway_services.form.errors.host.invalid");
263
+ },
264
+ validateProtocol: (v, F) => !v || v.trim() === "" ? s("gateway_services.form.errors.protocol.empty") : (v = v.slice(0, -1), F.find((l) => {
265
+ if (l.value === v) return l;
266
+ }) === void 0 ? s("gateway_services.form.errors.protocol.invalid") : ""),
267
+ validatePath: (v) => !v || v === "" ? "" : v.startsWith("/") ? /[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/.test(v) ? s("gateway_services.form.errors.path.invalid") : "" : s("gateway_services.form.errors.path.prefix"),
268
+ validatePort: (v) => {
269
+ if (v == null || v === "")
270
+ return "";
271
+ const F = typeof v == "string" ? parseInt(v, 10) : v;
272
+ return isNaN(F) ? s("gateway_services.form.errors.port.type") : F < 0 || F > 65535 ? s("gateway_services.form.errors.port.invalid") : "";
273
+ }
274
+ };
275
+ }
276
+ const Q = {
277
+ useI18n: Ct,
278
+ usePortFromProtocol: Et,
279
+ useUrlValidators: Pt
280
+ }, Ue = "/v2/control-planes/{controlPlaneId}/core-entities", $e = "/{workspace}", Ve = {
281
+ list: {
282
+ konnect: {
283
+ all: `${Ue}/services`
284
+ },
285
+ kongManager: {
286
+ all: `${$e}/services`
287
+ }
288
+ },
289
+ form: {
290
+ konnect: {
291
+ create: `${Ue}/services`,
292
+ edit: `${Ue}/services/{id}`
293
+ },
294
+ kongManager: {
295
+ create: `${$e}/services`,
296
+ edit: `${$e}/services/{id}`
297
+ }
298
+ }
299
+ }, It = { class: "kong-ui-entities-gateway-services-list" }, Ft = { class: "button-row" }, At = { key: 1 }, Rt = /* @__PURE__ */ Me({
300
+ __name: "GatewayServiceList",
301
+ props: {
302
+ /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
303
+ config: {
304
+ type: Object,
305
+ required: !0,
306
+ validator: (s) => !(!s || !["konnect", "kongManager"].includes(s == null ? void 0 : s.app) || !s.createRoute || !s.getViewRoute || !s.getEditRoute || s.app === "kongManager" && !s.isExactMatch && !s.filterSchema)
307
+ },
308
+ // used to override the default identifier for the cache entry
309
+ cacheIdentifier: {
310
+ type: String,
311
+ default: ""
312
+ },
313
+ /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can create a new entity */
314
+ canCreate: {
315
+ type: Function,
316
+ required: !1,
317
+ default: async () => !0
318
+ },
319
+ /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can delete a given entity */
320
+ canDelete: {
321
+ type: Function,
322
+ required: !1,
323
+ default: async () => !0
324
+ },
325
+ /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can edit a given entity */
326
+ canEdit: {
327
+ type: Function,
328
+ required: !1,
329
+ default: async () => !0
330
+ },
331
+ /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can retrieve (view details) a given entity */
332
+ canRetrieve: {
333
+ type: Function,
334
+ required: !1,
335
+ default: async () => !0
336
+ },
337
+ /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can start debugger session on a given entity */
338
+ canDebug: {
339
+ type: Function,
340
+ required: !1,
341
+ default: async () => !1
342
+ },
343
+ /** default to false, setting to true will teleport the toolbar button to the destination in the consuming app */
344
+ useActionOutside: {
345
+ type: Boolean,
346
+ default: !1
347
+ },
348
+ /** user is onboarding, use onboarding text */
349
+ isServerless: {
350
+ type: Boolean,
351
+ default: !1
352
+ }
353
+ },
354
+ emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "toggle:success"],
355
+ setup(s, { emit: q }) {
356
+ var oe;
357
+ const m = q, d = s, { i18n: { t: a, formatUnixTimeStamp: v } } = Q.useI18n(), F = Ge(), { axiosInstance: B } = Ne((oe = d.config) == null ? void 0 : oe.axiosRequestConfig), { hasRecords: l, handleStateChange: D } = ot(() => W.value), I = S(() => l.value && d.config.app === "konnect"), Se = S(() => d.config.app !== "kongManager" || !!d.config.disableSorting), se = {
358
+ // the Name column is non-hidable
359
+ name: { label: a("gateway_services.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
360
+ ...d.config.showControlPlaneColumn ? { control_plane: { label: a("gateway_services.list.table_headers.control_plane") } } : {},
361
+ protocol: { label: a("gateway_services.list.table_headers.protocol"), searchable: !0, sortable: !0 },
362
+ host: { label: a("gateway_services.list.table_headers.host"), searchable: !0, sortable: !0 },
363
+ port: { label: a("gateway_services.list.table_headers.port"), searchable: !0, sortable: !0 },
364
+ path: { label: a("gateway_services.list.table_headers.path"), searchable: !0, sortable: !0 },
365
+ enabled: { label: a("gateway_services.list.table_headers.enabled"), searchable: !0, sortable: !0 },
366
+ tags: { label: a("gateway_services.list.table_headers.tags"), sortable: !1 },
367
+ updated_at: { label: a("gateway_services.list.table_headers.updated_at"), sortable: !0 },
368
+ created_at: { label: a("gateway_services.list.table_headers.created_at"), sortable: !0 }
369
+ }, de = {
370
+ columnVisibility: {
371
+ created_at: !1
372
+ }
373
+ }, ue = se, X = S(() => {
374
+ var g, y;
375
+ let f = `${d.config.apiBaseUrl}${Ve.list[d.config.app].all}`;
376
+ return d.config.app === "konnect" ? f = f.replace(/{controlPlaneId}/gi, ((g = d.config) == null ? void 0 : g.controlPlaneId) || "") : d.config.app === "kongManager" && (f = f.replace(/\/{workspace}/gi, (y = d.config) != null && y.workspace ? `/${d.config.workspace}` : "")), f;
377
+ }), Ce = S(() => d.config.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${X.value}`) : new URL(X.value)), W = U(""), O = S(() => {
378
+ const f = d.config.app === "konnect" || d.config.isExactMatch;
379
+ if (f)
380
+ return {
381
+ isExactMatch: f,
382
+ placeholder: a(`search.placeholder.${d.config.app}`)
383
+ };
384
+ const { name: g, enabled: y, protocol: E, host: N, port: K, path: t } = se;
385
+ return {
386
+ isExactMatch: f,
387
+ fields: { name: g, enabled: y, protocol: E, host: N, port: K, path: t },
388
+ schema: d.config.filterSchema
389
+ };
390
+ }), {
391
+ fetcher: Ee,
392
+ fetcherState: j,
393
+ fetcherCacheKey: C
394
+ } = rt(S(() => ({ ...d.config, cacheIdentifier: d.cacheIdentifier })), X), ae = () => {
395
+ W.value = "";
396
+ }, ne = () => {
397
+ C.value++;
398
+ }, Y = U(null), e = S(() => ({
399
+ ctaPath: d.config.createRoute,
400
+ ctaText: te.value ? d.isServerless ? a("actions.serverless_create") : a("actions.create") : void 0,
401
+ message: `${a("gateway_services.list.empty_state.description")}${d.config.additionMessageForEmptyState ? ` ${d.config.additionMessageForEmptyState}` : ""}`,
402
+ title: te.value ? d.isServerless ? a("gateway_services.list.empty_state.serverless_title") : a("gateway_services.list.empty_state.title") : a("gateway_services.title")
403
+ })), w = U(!1), $ = U(null), ee = S(() => {
404
+ const f = {
405
+ action: "disable",
406
+ id: "",
407
+ name: ""
408
+ };
409
+ if ($.value) {
410
+ const { enabled: g, id: y, name: E } = $.value;
411
+ f.action = g ? "disable" : "enable", f.id = y, f.name = E || y;
412
+ }
413
+ return f;
414
+ }), fe = (f) => {
415
+ w.value = !0, $.value = f;
416
+ }, pe = () => {
417
+ w.value = !1, $.value = null;
418
+ }, z = async () => {
419
+ var E, N;
420
+ if (!await ((E = d.canEdit) == null ? void 0 : E.call(d, $.value)) || !$.value)
421
+ return;
422
+ const g = `${Ce.value.href}/${$.value.id}`, y = !$.value.enabled;
423
+ try {
424
+ const K = (N = d.config) == null ? void 0 : N.app;
425
+ let t;
426
+ W.value && K === "konnect" && (t = await B.get(g));
427
+ const { data: r } = K === "konnect" ? await B.put(g, { ...(t == null ? void 0 : t.data) || $.value, enabled: y }) : await B.patch(g, { ...$.value, enabled: y });
428
+ m("toggle:success", r), $.value.enabled = y;
429
+ } catch (K) {
430
+ m("error", K);
431
+ }
432
+ }, me = (f) => {
433
+ d.config.getControlPlaneRoute && F.push(d.config.getControlPlaneRoute(f));
434
+ }, ve = async (f, g) => {
435
+ const y = f.id;
436
+ if (!await g(y)) {
437
+ m("copy:error", {
438
+ entity: f,
439
+ field: "id",
440
+ message: a("errors.copy")
441
+ });
442
+ return;
443
+ }
444
+ m("copy:success", {
445
+ entity: f,
446
+ field: "id",
447
+ message: a("copy.success", { val: y })
448
+ });
449
+ }, ge = async (f, g) => {
450
+ const y = JSON.stringify(f);
451
+ if (!await g(y)) {
452
+ m("copy:error", {
453
+ entity: f,
454
+ message: a("errors.copy")
455
+ });
456
+ return;
457
+ }
458
+ m("copy:success", {
459
+ entity: f,
460
+ message: a("copy.success_brief")
461
+ });
462
+ }, ye = async (f) => {
463
+ var y;
464
+ await ((y = d.canRetrieve) == null ? void 0 : y.call(d, f)) && F.push(d.config.getViewRoute(f.id));
465
+ }, _e = (f) => ({
466
+ label: a("actions.view"),
467
+ to: d.config.getViewRoute(f)
468
+ }), Pe = (f) => ({
469
+ label: a("actions.edit"),
470
+ to: d.config.getEditRoute(f)
471
+ }), H = (f) => {
472
+ if (d.config.getDebugRoute)
473
+ return {
474
+ label: a("actions.debugger"),
475
+ to: d.config.getDebugRoute(f)
476
+ };
477
+ }, x = U(void 0), G = U(!1), Z = U(!1), ce = U(""), Ie = it(d.config, X.value), he = (f) => {
478
+ x.value = f, G.value = !0, ce.value = "";
479
+ }, be = () => {
480
+ G.value = !1, x.value = void 0;
481
+ }, Fe = async () => {
482
+ var f, g, y;
483
+ if ((f = x.value) != null && f.id) {
484
+ Z.value = !0;
485
+ try {
486
+ await B.delete(Ie(x.value.id)), m("delete:success", x.value), be(), C.value++;
487
+ } catch (E) {
488
+ ce.value = ((y = (g = E.response) == null ? void 0 : g.data) == null ? void 0 : y.message) || E.message || a("errors.delete"), m("error", E);
489
+ } finally {
490
+ Z.value = !1;
491
+ }
492
+ }
493
+ }, Ae = () => {
494
+ F.push(d.config.createRoute);
495
+ };
496
+ xe(j, (f) => {
497
+ var g, y, E;
498
+ if (f.status === lt.Error) {
499
+ Y.value = {
500
+ title: a("errors.general")
501
+ }, (E = (y = (g = f.error) == null ? void 0 : g.response) == null ? void 0 : y.data) != null && E.message && (Y.value.message = f.error.response.data.message), m("error", f.error);
502
+ return;
503
+ }
504
+ Y.value = null;
505
+ });
506
+ const te = U(!1);
507
+ return ze(async () => {
508
+ te.value = await d.canCreate();
509
+ }), (f, g) => {
510
+ const y = M("KButton"), E = M("KEmptyState"), N = M("KBadge"), K = M("KInputSwitch"), t = M("KDropdownItem"), r = M("KClipboardProvider");
511
+ return V(), A("div", It, [
512
+ c(o(st), {
513
+ "cache-identifier": s.cacheIdentifier,
514
+ "default-table-preferences": de,
515
+ "disable-sorting": Se.value,
516
+ "empty-state-options": e.value,
517
+ "enable-entity-actions": "",
518
+ "error-message": Y.value,
519
+ fetcher: o(Ee),
520
+ "fetcher-cache-key": o(C),
521
+ "pagination-type": "offset",
522
+ "preferences-storage-key": "kong-ui-entities-gateway-services-list",
523
+ query: W.value,
524
+ "table-headers": o(ue),
525
+ onClearSearchInput: ae,
526
+ "onClick:row": g[4] || (g[4] = (n) => ye(n)),
527
+ onSort: ne,
528
+ onState: o(D)
529
+ }, ke({
530
+ "toolbar-filter": u(() => [
531
+ c(o(nt), {
532
+ modelValue: W.value,
533
+ "onUpdate:modelValue": g[0] || (g[0] = (n) => W.value = n),
534
+ config: O.value
535
+ }, null, 8, ["modelValue", "config"])
536
+ ]),
537
+ "toolbar-button": u(() => [
538
+ (V(), le(He, {
539
+ disabled: !s.useActionOutside,
540
+ to: "#kong-ui-app-page-header-action-button"
541
+ }, [
542
+ P("div", Ft, [
543
+ I.value ? (V(), le(y, {
544
+ key: 0,
545
+ appearance: "secondary",
546
+ class: "open-learning-hub",
547
+ "data-testid": "gateway-services-learn-more-button",
548
+ icon: "",
549
+ onClick: g[1] || (g[1] = (n) => f.$emit("click:learn-more"))
550
+ }, {
551
+ default: u(() => [
552
+ c(o(Be), { decorative: "" })
553
+ ]),
554
+ _: 1
555
+ })) : R("", !0),
556
+ c(o(ie), {
557
+ "auth-function": () => s.canCreate()
558
+ }, {
559
+ default: u(() => [
560
+ c(y, {
561
+ appearance: "primary",
562
+ "data-testid": "toolbar-add-gateway-service",
563
+ size: s.useActionOutside ? "medium" : "large",
564
+ to: s.config.createRoute
565
+ }, {
566
+ default: u(() => [
567
+ c(o(Ke)),
568
+ T(" " + b(o(a)("gateway_services.list.toolbar_actions.new_gateway_service")), 1)
569
+ ]),
570
+ _: 1
571
+ }, 8, ["size", "to"])
572
+ ]),
573
+ _: 1
574
+ }, 8, ["auth-function"])
575
+ ])
576
+ ], 8, ["disabled"]))
577
+ ]),
578
+ name: u(({ rowValue: n }) => [
579
+ P("b", null, b(n ?? "-"), 1)
580
+ ]),
581
+ control_plane: u(({ row: n }) => {
582
+ var h;
583
+ return [
584
+ (h = n.x_meta) != null && h.cluster_id ? (V(), le(N, {
585
+ key: 0,
586
+ tooltip: n.x_meta.cluster_id,
587
+ "truncation-tooltip": "",
588
+ onClick: Re((_) => me(n.x_meta.cluster_id), ["stop"])
589
+ }, {
590
+ default: u(() => [
591
+ T(b(n.x_meta.cluster_id), 1)
592
+ ]),
593
+ _: 2
594
+ }, 1032, ["tooltip", "onClick"])) : (V(), A("b", At, "-"))
595
+ ];
596
+ }),
597
+ enabled: u(({ row: n }) => [
598
+ c(o(ie), {
599
+ "auth-function": () => s.canEdit(n),
600
+ "force-show": ""
601
+ }, {
602
+ default: u(({ isAllowed: h }) => [
603
+ P("div", {
604
+ onClick: g[3] || (g[3] = Re(() => {
605
+ }, ["stop"]))
606
+ }, [
607
+ c(K, {
608
+ modelValue: n.enabled,
609
+ "onUpdate:modelValue": (_) => n.enabled = _,
610
+ "data-testid": `row-${n.id}-toggle-input`,
611
+ disabled: !h,
612
+ onClick: Re((_) => fe(n), ["prevent"])
613
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "data-testid", "disabled", "onClick"])
614
+ ])
615
+ ]),
616
+ _: 2
617
+ }, 1032, ["auth-function"])
618
+ ]),
619
+ tags: u(({ rowValue: n }) => [
620
+ c(o(at), { tags: n }, null, 8, ["tags"])
621
+ ]),
622
+ created_at: u(({ rowValue: n }) => [
623
+ T(b(o(v)(n)), 1)
624
+ ]),
625
+ updated_at: u(({ row: n, rowValue: h }) => [
626
+ T(b(o(v)(h ?? n.created_at)), 1)
627
+ ]),
628
+ actions: u(({ row: n }) => [
629
+ c(r, null, {
630
+ default: u(({ copyToClipboard: h }) => [
631
+ c(t, {
632
+ "data-testid": "action-entity-copy-id",
633
+ onClick: (_) => ve(n, h)
634
+ }, {
635
+ default: u(() => [
636
+ T(b(o(a)("actions.copy_id")), 1)
637
+ ]),
638
+ _: 1
639
+ }, 8, ["onClick"])
640
+ ]),
641
+ _: 2
642
+ }, 1024),
643
+ c(r, null, {
644
+ default: u(({ copyToClipboard: h }) => [
645
+ c(t, {
646
+ "data-testid": "action-entity-copy-json",
647
+ onClick: (_) => ge(n, h)
648
+ }, {
649
+ default: u(() => [
650
+ T(b(o(a)("actions.copy_json")), 1)
651
+ ]),
652
+ _: 1
653
+ }, 8, ["onClick"])
654
+ ]),
655
+ _: 2
656
+ }, 1024),
657
+ c(o(ie), {
658
+ "auth-function": () => s.canRetrieve(n)
659
+ }, {
660
+ default: u(() => [
661
+ c(t, {
662
+ "data-testid": "action-entity-view",
663
+ "has-divider": "",
664
+ item: _e(n.id)
665
+ }, null, 8, ["item"])
666
+ ]),
667
+ _: 2
668
+ }, 1032, ["auth-function"]),
669
+ c(o(ie), {
670
+ "auth-function": () => s.canDebug(n)
671
+ }, {
672
+ default: u(() => [
673
+ s.config.getDebugRoute ? (V(), le(t, {
674
+ key: 0,
675
+ "data-testid": "action-entity-debug",
676
+ item: H(n.id)
677
+ }, null, 8, ["item"])) : R("", !0)
678
+ ]),
679
+ _: 2
680
+ }, 1032, ["auth-function"]),
681
+ c(o(ie), {
682
+ "auth-function": () => s.canEdit(n)
683
+ }, {
684
+ default: u(() => [
685
+ c(t, {
686
+ "data-testid": "action-entity-edit",
687
+ item: Pe(n.id)
688
+ }, null, 8, ["item"])
689
+ ]),
690
+ _: 2
691
+ }, 1032, ["auth-function"]),
692
+ c(o(ie), {
693
+ "auth-function": () => s.canDelete(n)
694
+ }, {
695
+ default: u(() => [
696
+ c(t, {
697
+ danger: "",
698
+ "data-testid": "action-entity-delete",
699
+ "has-divider": "",
700
+ onClick: (h) => he(n)
701
+ }, {
702
+ default: u(() => [
703
+ T(b(o(a)("actions.delete.menu_label")), 1)
704
+ ]),
705
+ _: 1
706
+ }, 8, ["onClick"])
707
+ ]),
708
+ _: 2
709
+ }, 1032, ["auth-function"])
710
+ ]),
711
+ _: 2
712
+ }, [
713
+ !W.value && s.config.app === "konnect" ? {
714
+ name: "empty-state",
715
+ fn: u(() => {
716
+ var n;
717
+ return [
718
+ c(E, {
719
+ "data-testid": "gateway-services-entity-empty-state",
720
+ "icon-background": "",
721
+ message: o(a)("gateway_services.empty_state_v2.description"),
722
+ title: o(a)("gateway_services.empty_state_v2.title")
723
+ }, ke({
724
+ icon: u(() => [
725
+ c(o(Ye), { decorative: "" })
726
+ ]),
727
+ action: u(() => [
728
+ te.value ? (V(), le(y, {
729
+ key: 0,
730
+ "data-testid": "entity-create-button",
731
+ onClick: Ae
732
+ }, {
733
+ default: u(() => [
734
+ c(o(Ke), { decorative: "" }),
735
+ T(" " + b(o(a)("gateway_services.empty_state_v2.create")), 1)
736
+ ]),
737
+ _: 1
738
+ })) : R("", !0),
739
+ c(y, {
740
+ appearance: "secondary",
741
+ "data-testid": "entity-learn-more-button",
742
+ onClick: g[2] || (g[2] = (h) => f.$emit("click:learn-more"))
743
+ }, {
744
+ default: u(() => [
745
+ c(o(Be), { decorative: "" }),
746
+ T(" " + b(o(a)("gateway_services.empty_state_v2.learn_more")), 1)
747
+ ]),
748
+ _: 1
749
+ })
750
+ ]),
751
+ _: 2
752
+ }, [
753
+ (n = s.config) != null && n.isControlPlaneGroup ? {
754
+ name: "default",
755
+ fn: u(() => [
756
+ T(b(o(a)("gateway_services.empty_state_v2.group")), 1)
757
+ ]),
758
+ key: "0"
759
+ } : void 0
760
+ ]), 1032, ["message", "title"])
761
+ ];
762
+ }),
763
+ key: "0"
764
+ } : void 0
765
+ ]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
766
+ c(o(ct), {
767
+ action: ee.value.action,
768
+ "entity-id": ee.value.id,
769
+ "entity-name": ee.value.name,
770
+ "entity-type": o(a)("glossary.gateway_services"),
771
+ "on-confirm": z,
772
+ visible: w.value,
773
+ onCancel: pe,
774
+ onProceed: pe
775
+ }, null, 8, ["action", "entity-id", "entity-name", "entity-type", "visible"]),
776
+ c(o(dt), {
777
+ "action-pending": Z.value,
778
+ description: o(a)("actions.delete.description"),
779
+ "entity-name": x.value && (x.value.name || x.value.id),
780
+ "entity-type": o(ut).GatewayService,
781
+ error: ce.value,
782
+ title: o(a)("actions.delete.title"),
783
+ visible: G.value,
784
+ onCancel: be,
785
+ onProceed: Fe
786
+ }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
787
+ ]);
788
+ };
789
+ }
790
+ }), je = (s, q) => {
791
+ const m = s.__vccOpts || s;
792
+ for (const [d, a] of q)
793
+ m[d] = a;
794
+ return m;
795
+ }, ao = /* @__PURE__ */ je(Rt, [["__scopeId", "data-v-be14eac9"]]), Tt = { class: "kong-ui-gateway-service-entity-config-card" }, no = /* @__PURE__ */ Me({
796
+ __name: "GatewayServiceConfigCard",
797
+ props: {
798
+ /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
799
+ config: {
800
+ type: Object,
801
+ required: !0,
802
+ validator: (s) => !(!s || !["konnect", "kongManager"].includes(s == null ? void 0 : s.app) || s.app === "konnect" && !s.controlPlaneId || s.app === "kongManager" && typeof s.workspace != "string" || !s.entityId)
803
+ },
804
+ /**
805
+ * External link for documentation that determines visibility of Documentation button
806
+ */
807
+ configCardDoc: {
808
+ type: String,
809
+ default: "",
810
+ required: !1
811
+ },
812
+ /**
813
+ * Control visibility of card title content
814
+ */
815
+ hideTitle: {
816
+ type: Boolean,
817
+ default: !1
818
+ }
819
+ },
820
+ emits: ["loading", "fetch:error", "fetch:success"],
821
+ setup(s) {
822
+ const q = s, { i18n: { t: m }, i18nT: d } = Q.useI18n(), a = S(() => Ve.form[q.config.app].edit), { getPropValue: v } = We(), F = (l, D) => v(l, D) === !0 ? m("gateway_services.form.fields.tls_verify_option.true.display") : m("gateway_services.form.fields.tls_verify_option.false.display"), B = U({
823
+ id: {},
824
+ name: {
825
+ tooltip: m("gateway_services.form.fields.name.tooltip")
826
+ },
827
+ enabled: {},
828
+ updated_at: {},
829
+ created_at: {},
830
+ protocol: {
831
+ section: we.Basic,
832
+ tooltip: m("gateway_services.form.fields.protocol.tooltip")
833
+ },
834
+ host: {
835
+ section: we.Basic,
836
+ tooltip: m("gateway_services.form.fields.host.tooltip")
837
+ },
838
+ path: {
839
+ section: we.Basic,
840
+ tooltip: m("gateway_services.form.fields.path.tooltip")
841
+ },
842
+ port: {
843
+ section: we.Basic,
844
+ tooltip: m("gateway_services.form.fields.port.tooltip")
845
+ },
846
+ tags: {
847
+ tooltip: m("gateway_services.form.fields.tags.tooltip")
848
+ },
849
+ // advanced fields
850
+ retries: {
851
+ order: 1,
852
+ tooltip: m("gateway_services.form.fields.retries.tooltip")
853
+ },
854
+ connect_timeout: {
855
+ order: 2,
856
+ tooltip: m("gateway_services.form.fields.connect_timeout.tooltip")
857
+ },
858
+ write_timeout: {
859
+ order: 3,
860
+ tooltip: m("gateway_services.form.fields.write_timeout.tooltip")
861
+ },
862
+ read_timeout: {
863
+ order: 4,
864
+ tooltip: m("gateway_services.form.fields.read_timeout.tooltip")
865
+ },
866
+ client_certificate: {
867
+ order: 5,
868
+ tooltip: m("gateway_services.form.fields.client_certificate.tooltip")
869
+ },
870
+ ca_certificates: {
871
+ type: ft.BadgeTag,
872
+ label: m("gateway_services.form.fields.ca_certificates.label"),
873
+ order: 6
874
+ },
875
+ tls_verify: {
876
+ label: m("gateway_services.form.fields.tls_verify_enabled.label")
877
+ },
878
+ tls_verify_depth: {
879
+ hidden: !0
880
+ }
881
+ });
882
+ return (l, D) => (V(), A("div", Tt, [
883
+ c(o(pt), {
884
+ config: s.config,
885
+ "config-card-doc": s.configCardDoc,
886
+ "config-schema": B.value,
887
+ "entity-type": o(Oe).GatewayService,
888
+ "fetch-url": a.value,
889
+ "hide-title": s.hideTitle,
890
+ "onFetch:error": D[0] || (D[0] = (I) => l.$emit("fetch:error", I)),
891
+ "onFetch:success": D[1] || (D[1] = (I) => l.$emit("fetch:success", I)),
892
+ onLoading: D[2] || (D[2] = (I) => l.$emit("loading", I))
893
+ }, {
894
+ "enabled-label-tooltip": u(() => [
895
+ c(o(d), {
896
+ keypath: "gateway_services.form.fields.enabled.tooltip",
897
+ scope: "global"
898
+ }, {
899
+ false: u(() => [
900
+ P("code", null, b(o(m)("gateway_services.form.fields.enabled.false")), 1)
901
+ ]),
902
+ true: u(() => [
903
+ P("code", null, b(o(m)("gateway_services.form.fields.enabled.true")), 1)
904
+ ]),
905
+ _: 1
906
+ })
907
+ ]),
908
+ "ca_certificates-label-tooltip": u(() => [
909
+ c(o(d), {
910
+ keypath: "gateway_services.form.fields.ca_certificates.tooltip",
911
+ scope: "global"
912
+ }, {
913
+ code1: u(() => [
914
+ P("code", null, b(o(m)("gateway_services.form.fields.ca_certificates.code1")), 1)
915
+ ]),
916
+ code2: u(() => [
917
+ P("code", null, b(o(m)("gateway_services.form.fields.ca_certificates.code2")), 1)
918
+ ]),
919
+ _: 1
920
+ })
921
+ ]),
922
+ "tls_verify-label-tooltip": u(() => [
923
+ c(o(d), {
924
+ keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
925
+ scope: "global"
926
+ }, {
927
+ code1: u(() => [
928
+ P("code", null, b(o(m)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
929
+ ]),
930
+ _: 1
931
+ })
932
+ ]),
933
+ tls_verify: u((I) => [
934
+ T(b(typeof o(v)("rowValue", I) == "boolean" ? F("rowValue", I) : o(m)("gateway_services.form.fields.tls_verify_option.unset.display")), 1)
935
+ ]),
936
+ client_certificate: u((I) => [
937
+ T(b(o(v)("rowValue", I) ? o(v)("rowValue", I).id : "–"), 1)
938
+ ]),
939
+ _: 1
940
+ }, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
941
+ ]));
942
+ }
943
+ }), L = {
944
+ name: "Kong-Air-Flights-API",
945
+ protocol: "https",
946
+ path: "/flights",
947
+ host: "api.kong-air.com",
948
+ port: 443
949
+ }, Ut = { class: "kong-ui-entities-gateway-service-form" }, $t = {
950
+ key: 0,
951
+ class: "gateway-service-form-general-info"
952
+ }, xt = { class: "gateway-service-form-group-selection-wrapper" }, Mt = {
953
+ key: 0,
954
+ class: "gateway-service-form-group-fields"
955
+ }, Dt = {
956
+ key: 0,
957
+ class: "gateway-service-form-group-fields"
958
+ }, Bt = { key: 0 }, Kt = {
959
+ key: 0,
960
+ class: "gateway-service-form-advanced-fields"
961
+ }, Lt = { class: "gateway-service-form-margin-bottom" }, qt = { class: "gateway-service-form-margin-bottom" }, Gt = { class: "gateway-service-form-margin-bottom" }, Nt = { class: "gateway-service-form-margin-bottom" }, Wt = {
962
+ key: 0,
963
+ class: "gateway-service-form-margin-bottom"
964
+ }, Ot = {
965
+ key: 1,
966
+ class: "gateway-service-form-margin-bottom"
967
+ }, jt = {
968
+ key: 2,
969
+ class: "gateway-service-form-margin-bottom"
970
+ }, zt = {
971
+ key: 0,
972
+ class: "checkbox-aligned-radio"
973
+ }, Ht = {
974
+ key: 1,
975
+ class: "checkbox-aligned-radio"
976
+ }, Zt = { class: "gateway-service-form-tags" }, Jt = { class: "form-error-list" }, Qt = /* @__PURE__ */ Me({
977
+ __name: "GatewayServiceForm",
978
+ props: {
979
+ /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
980
+ config: {
981
+ type: Object,
982
+ required: !0,
983
+ validator: (s) => !(!s || !["konnect", "kongManager"].includes(s == null ? void 0 : s.app) || s.app === "konnect" && !s.controlPlaneId || s.app === "kongManager" && typeof s.workspace != "string" || !s.cancelRoute)
984
+ },
985
+ /** If a valid Gateway Service ID is provided, it will put the form in Edit mode instead of Create */
986
+ gatewayServiceId: {
987
+ type: String,
988
+ required: !1,
989
+ default: ""
990
+ },
991
+ /** Whether show or hide EntityFormSection info column */
992
+ hideSectionsInfo: {
993
+ type: Boolean,
994
+ required: !1,
995
+ default: !1
996
+ },
997
+ /** Whether show or hide Try sample API button */
998
+ hideTrySampleApiButton: {
999
+ type: Boolean,
1000
+ required: !1,
1001
+ default: !1
1002
+ }
1003
+ },
1004
+ emits: ["update", "error", "url-valid:success", "url-valid:error", "loading", "model-updated", "try-sample-api"],
1005
+ setup(s, { expose: q, emit: m }) {
1006
+ var K;
1007
+ const d = m, a = s, v = U(!0), F = Ge(), { i18nT: B, i18n: { t: l } } = Q.useI18n(), { getErrorFieldsFromError: D } = mt(), { axiosInstance: I } = Ne((K = a.config) == null ? void 0 : K.axiosRequestConfig), Se = vt(), { validateHost: se, validatePath: de, validatePort: ue, validateProtocol: X } = Q.useUrlValidators(), { objectsAreEqual: Ce } = We(), W = S(() => Ve.form[a.config.app].edit), O = S(() => a.gatewayServiceId ? Le.Edit : Le.Create), Ee = U(!1), j = S(() => !!a.gatewayServiceId), C = U(j.value ? "protocol" : "url"), ae = Q.usePortFromProtocol(), ne = U(""), Y = S(() => !!ne.value || !!H("name")), e = De({
1008
+ fields: {
1009
+ name: "",
1010
+ protocol: "http",
1011
+ host: "",
1012
+ path: "",
1013
+ port: 80,
1014
+ url: "",
1015
+ retries: 5,
1016
+ connect_timeout: 6e4,
1017
+ write_timeout: 6e4,
1018
+ read_timeout: 6e4,
1019
+ client_certificate: "",
1020
+ ca_certificates: "",
1021
+ tls_verify_enabled: !1,
1022
+ tls_verify_value: !1,
1023
+ tags: "",
1024
+ enabled: !0
1025
+ },
1026
+ isReadonly: !1,
1027
+ errorMessages: [],
1028
+ formFieldErrors: {
1029
+ host: "",
1030
+ port: "",
1031
+ path: "",
1032
+ name: "",
1033
+ url: "",
1034
+ tags: "",
1035
+ retries: "",
1036
+ connect_timeout: "",
1037
+ write_timeout: "",
1038
+ read_timeout: "",
1039
+ client_certificate: "",
1040
+ ca_certificates: "",
1041
+ tls_verify_enabled: "",
1042
+ tls_verify_value: ""
1043
+ }
1044
+ }), w = De({
1045
+ name: "",
1046
+ protocol: "http",
1047
+ host: "",
1048
+ path: "",
1049
+ port: 80,
1050
+ url: "",
1051
+ retries: 5,
1052
+ connect_timeout: 6e4,
1053
+ write_timeout: 6e4,
1054
+ read_timeout: 6e4,
1055
+ client_certificate: "",
1056
+ ca_certificates: "",
1057
+ tls_verify_enabled: !1,
1058
+ tls_verify_value: !1,
1059
+ tags: "",
1060
+ enabled: !0
1061
+ }), $ = a.config.app === "konnect" || gt({
1062
+ gatewayInfo: a.config.gatewayInfo,
1063
+ // 'ws' and 'wss' are not valid values for the protocol field in Gateway Community Edition or before Gateway Enterprise Edition 3.0
1064
+ supportedRange: {
1065
+ enterprise: ["3.0"]
1066
+ }
1067
+ }), ee = [
1068
+ {
1069
+ label: l("gateway_services.form.fields.protocol.options.http"),
1070
+ value: "http",
1071
+ group: "http"
1072
+ },
1073
+ {
1074
+ label: l("gateway_services.form.fields.protocol.options.https"),
1075
+ value: "https",
1076
+ group: "http"
1077
+ },
1078
+ {
1079
+ label: l("gateway_services.form.fields.protocol.options.tcp"),
1080
+ value: "tcp",
1081
+ group: "tcp"
1082
+ },
1083
+ {
1084
+ label: l("gateway_services.form.fields.protocol.options.tls"),
1085
+ value: "tls",
1086
+ group: "tcp"
1087
+ },
1088
+ {
1089
+ label: l("gateway_services.form.fields.protocol.options.tls_passthrough"),
1090
+ value: "tls_passthrough",
1091
+ group: "tcp"
1092
+ },
1093
+ {
1094
+ label: l("gateway_services.form.fields.protocol.options.grpc"),
1095
+ value: "grpc",
1096
+ group: "grpc"
1097
+ },
1098
+ {
1099
+ label: l("gateway_services.form.fields.protocol.options.grpcs"),
1100
+ value: "grpcs",
1101
+ group: "grpc"
1102
+ },
1103
+ ...$ ? [
1104
+ {
1105
+ label: l("gateway_services.form.fields.protocol.options.ws"),
1106
+ value: "ws",
1107
+ group: "websocket"
1108
+ },
1109
+ {
1110
+ label: l("gateway_services.form.fields.protocol.options.wss"),
1111
+ value: "wss",
1112
+ group: "websocket"
1113
+ }
1114
+ ] : [],
1115
+ {
1116
+ label: l("gateway_services.form.fields.protocol.options.udp"),
1117
+ value: "udp",
1118
+ group: "udp"
1119
+ }
1120
+ ], fe = { url: "url", protocol: "protocol" }, pe = (t) => {
1121
+ e.fields.protocol = t.value, e.fields.port = ae.getPortFromProtocol(e.fields.protocol, String(e.fields.port));
1122
+ }, z = (t) => t ? parseFloat(t) : 0, me = () => {
1123
+ e.fields.host = w.host, e.fields.path = w.path, e.fields.port = w.port, e.fields.protocol = w.protocol, e.fields.url = w.url, e.fields.retries = w.retries, e.fields.connect_timeout = w.connect_timeout, e.fields.write_timeout = w.write_timeout, e.fields.read_timeout = w.read_timeout, e.fields.client_certificate = w.client_certificate, e.fields.ca_certificates = w.ca_certificates, e.fields.tls_verify_enabled = w.tls_verify_enabled, e.fields.tls_verify_value = w.tls_verify_value, e.fields.enabled = w.enabled;
1124
+ }, ve = () => {
1125
+ v.value = !0, G(), e.errorMessages = [], me();
1126
+ }, ge = () => {
1127
+ switch (me(), e.fields.name = `${L.name}-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, C.value) {
1128
+ case "url":
1129
+ e.fields.url = `${L.protocol}://${L.host}${L.path}`;
1130
+ break;
1131
+ case "protocol":
1132
+ e.fields.host = L.host, e.fields.path = L.path, e.fields.protocol = L.protocol, e.fields.port = L.port;
1133
+ break;
1134
+ default:
1135
+ e.fields.url = `${L.protocol}://${L.host}${L.path}`;
1136
+ }
1137
+ }, ye = () => {
1138
+ if (G(), e.fields.url.length)
1139
+ try {
1140
+ const t = new URL(e.fields.url), r = X(t.protocol, ee);
1141
+ if (r) throw new Error(r);
1142
+ e.fields.protocol = t.protocol.slice(0, -1);
1143
+ const n = se(t.hostname);
1144
+ if (n) throw new Error(n);
1145
+ e.fields.host = t.hostname;
1146
+ const h = de(t.pathname);
1147
+ if (h) throw new Error(h);
1148
+ e.fields.path = t.pathname;
1149
+ const _ = ue(t.port);
1150
+ if (_) throw new Error(_);
1151
+ const k = Number(t.port);
1152
+ Ee.value = !!k, e.fields.port = k || ae.getPortFromProtocol(e.fields.protocol), d("url-valid:success");
1153
+ } catch {
1154
+ d("url-valid:error", l("gateway_services.form.errors.url.invalid")), e.formFieldErrors.url = l("gateway_services.form.errors.url.invalid");
1155
+ }
1156
+ }, _e = (t) => {
1157
+ G(t);
1158
+ }, Pe = S(() => !!e.formFieldErrors.url || !!e.formFieldErrors.host || !!e.formFieldErrors.port), H = (t) => {
1159
+ if (e.errorMessages.length) return "";
1160
+ const r = e.formFieldErrors;
1161
+ return r[t] ? r[t] : "";
1162
+ }, x = (t) => {
1163
+ G(t ?? void 0);
1164
+ const r = se(e.fields.host);
1165
+ r && (e.formFieldErrors.host = r);
1166
+ const n = de(e.fields.path);
1167
+ n && (e.formFieldErrors.path = n);
1168
+ const h = ue(e.fields.port);
1169
+ h && (e.formFieldErrors.port = h), Z.value ? d("url-valid:success") : d("url-valid:error", e.errorMessages.join(",") || l("gateway_services.form.errors.url.invalid"));
1170
+ }, G = (t) => {
1171
+ if (t)
1172
+ e.formFieldErrors[t] = "";
1173
+ else
1174
+ for (let r in e.formFieldErrors)
1175
+ e.formFieldErrors[r] = "";
1176
+ e.errorMessages = [];
1177
+ }, Z = S(() => {
1178
+ for (let t in e.formFieldErrors)
1179
+ if (e.formFieldErrors[t].length)
1180
+ return !1;
1181
+ return !0;
1182
+ }), ce = () => {
1183
+ e.fields.url && C.value === "url" ? ye() : x();
1184
+ }, Ie = () => `new-service-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}`, he = S(() => !["tcp", "tls", "tls_passthrough", "grpc", "grpcs", "udp"].includes(e.fields.protocol)), be = S(() => {
1185
+ if (C.value === "url")
1186
+ return !0;
1187
+ const t = ["https", "wss", "tls"].includes(e.fields.protocol);
1188
+ return C.value === "protocol" && t;
1189
+ }), Fe = S(() => {
1190
+ if (C.value === "url")
1191
+ return !0;
1192
+ const t = ["https", "tls"].includes(e.fields.protocol);
1193
+ return C.value === "protocol" && t;
1194
+ }), Ae = S(() => {
1195
+ if (C.value === "url")
1196
+ return !0;
1197
+ const t = ["https", "wss", "tls"].includes(e.fields.protocol);
1198
+ return C.value === "protocol" && t;
1199
+ }), te = (t) => {
1200
+ G("name"), ne.value = Se.utf8Name(t);
1201
+ }, oe = S(() => {
1202
+ const t = !j.value || !Ce(e.fields, w), r = C.value === "url" && !!e.fields.url && Z.value, n = C.value === "protocol" && !!e.fields.host && Z.value;
1203
+ return t && (r || n);
1204
+ }), f = (t) => {
1205
+ var r, n, h;
1206
+ e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((r = t == null ? void 0 : t.tags) == null ? void 0 : r.join(", ")) || "", e.fields.protocol = (t == null ? void 0 : t.protocol) || "http", e.fields.path = (t == null ? void 0 : t.path) || "", e.fields.read_timeout = t != null && t.read_timeout || (t == null ? void 0 : t.read_timeout) === 0 ? t == null ? void 0 : t.read_timeout : 6e4, e.fields.retries = t != null && t.retries || (t == null ? void 0 : t.retries) === 0 ? t == null ? void 0 : t.retries : 5, e.fields.host = (t == null ? void 0 : t.host) || "", e.fields.connect_timeout = t != null && t.connect_timeout || (t == null ? void 0 : t.connect_timeout) === 0 ? t == null ? void 0 : t.connect_timeout : 6e4, e.fields.tls_verify_enabled = (t == null ? void 0 : t.tls_verify) !== "" && (t == null ? void 0 : t.tls_verify) !== null && (t == null ? void 0 : t.tls_verify) !== void 0, e.fields.tls_verify_value = t != null && t.tls_verify ? t == null ? void 0 : t.tls_verify : !1, e.fields.ca_certificates = ((n = t == null ? void 0 : t.ca_certificates) == null ? void 0 : n.join(",")) || "", e.fields.client_certificate = ((h = t == null ? void 0 : t.client_certificate) == null ? void 0 : h.id) || "", e.fields.write_timeout = t != null && t.write_timeout || (t == null ? void 0 : t.write_timeout) === 0 ? t == null ? void 0 : t.write_timeout : 6e4, e.fields.port = t != null && t.port || (t == null ? void 0 : t.port) === 0 ? t == null ? void 0 : t.port : 80, e.fields.enabled = (t == null ? void 0 : t.enabled) ?? !0, Object.assign(w, e.fields);
1207
+ }, g = () => {
1208
+ F.push(a.config.cancelRoute);
1209
+ }, y = S(() => {
1210
+ var r, n;
1211
+ let t = `${a.config.apiBaseUrl}${Ve.form[a.config.app][O.value]}`;
1212
+ return a.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((r = a.config) == null ? void 0 : r.controlPlaneId) || "") : a.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (n = a.config) != null && n.workspace ? `/${a.config.workspace}` : "")), t = t.replace(/{id}/gi, a.gatewayServiceId), t;
1213
+ }), E = S(() => {
1214
+ var r, n, h, _;
1215
+ const t = {
1216
+ name: e.fields.name || null,
1217
+ tags: e.fields.tags ? (h = (n = (r = e.fields.tags) == null ? void 0 : r.split(",")) == null ? void 0 : n.map((k) => String(k || "").trim())) == null ? void 0 : h.filter((k) => k !== "") : null,
1218
+ protocol: e.fields.protocol,
1219
+ path: e.fields.path || null,
1220
+ read_timeout: e.fields.read_timeout,
1221
+ retries: e.fields.retries,
1222
+ host: e.fields.host,
1223
+ connect_timeout: e.fields.connect_timeout,
1224
+ ca_certificates: e.fields.ca_certificates ? (_ = e.fields.ca_certificates) == null ? void 0 : _.split(",").filter((k) => k !== "") : null,
1225
+ client_certificate: e.fields.client_certificate ? { id: e.fields.client_certificate } : null,
1226
+ write_timeout: e.fields.write_timeout,
1227
+ port: e.fields.port,
1228
+ url: e.fields.url,
1229
+ enabled: e.fields.enabled
1230
+ };
1231
+ return e.fields.client_certificate && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.client_certificate = { id: e.fields.client_certificate }), e.fields.tls_verify_enabled && ["https", "wss", "tls"].includes(e.fields.protocol) && (t.tls_verify = e.fields.tls_verify_value), he.value || (t.path = null), O.value === "create" ? C.value === "url" ? (delete t.protocol, delete t.host, delete t.path, a.config.app === "konnect" && delete t.port) : delete t.url : O.value === "edit" && delete t.url, t;
1232
+ }), N = async () => {
1233
+ var t, r, n, h;
1234
+ try {
1235
+ e.isReadonly = !0;
1236
+ const _ = E.value;
1237
+ let k;
1238
+ if (O.value === "create" ? k = await I.post(y.value, _) : O.value === "edit" && (k = ((t = a.config) == null ? void 0 : t.app) === "konnect" ? await I.put(y.value, _) : await I.patch(y.value, _)), k) {
1239
+ const { data: i } = k;
1240
+ e.fields.name = (i == null ? void 0 : i.name) || "", e.fields.port = i.port || ae.getPortFromProtocol(i.protocol), e.fields.protocol = (i == null ? void 0 : i.protocol) || "http", e.fields.host = (i == null ? void 0 : i.host) || "", e.fields.path = (i == null ? void 0 : i.path) || "", e.fields.url = (i == null ? void 0 : i.url) || "", e.fields.retries = i != null && i.retries || (i == null ? void 0 : i.retries) === 0 ? i == null ? void 0 : i.retries : 5, e.fields.connect_timeout = i != null && i.connect_timeout || (i == null ? void 0 : i.connect_timeout) === 0 ? i == null ? void 0 : i.connect_timeout : 6e4, e.fields.write_timeout = i != null && i.write_timeout || (i == null ? void 0 : i.write_timeout) === 0 ? i == null ? void 0 : i.write_timeout : 6e4, e.fields.read_timeout = i != null && i.read_timeout || (i == null ? void 0 : i.read_timeout) === 0 ? i == null ? void 0 : i.read_timeout : 6e4, e.fields.client_certificate = ((r = i == null ? void 0 : i.client_certificate) == null ? void 0 : r.id) || "", e.fields.ca_certificates = (n = i == null ? void 0 : i.ca_certificates) != null && n.length ? i == null ? void 0 : i.ca_certificates.join(",") : "", e.fields.tls_verify_enabled = (i == null ? void 0 : i.tls_verify) !== "" && (i == null ? void 0 : i.tls_verify) !== null && (i == null ? void 0 : i.tls_verify) !== void 0, e.fields.tls_verify_value = e.fields.tls_verify_enabled && (i == null ? void 0 : i.tls_verify), e.fields.tags = (h = i == null ? void 0 : i.tags) != null && h.length ? i.tags.join(", ") : "", e.fields.enabled = (i == null ? void 0 : i.enabled) ?? !0, Object.assign(w, e.fields), d("update", k == null ? void 0 : k.data);
1241
+ }
1242
+ return k;
1243
+ } catch (_) {
1244
+ const { fields: k, messages: i } = D(_);
1245
+ e.errorMessages = i, k.length && k.forEach((J) => {
1246
+ const re = J.field;
1247
+ re === "client_certificate.id" ? e.formFieldErrors.client_certificate = J.message : re.startsWith("ca_certificates") ? e.formFieldErrors.ca_certificates = J.message : Object.keys(e.formFieldErrors).includes(re) && (e.formFieldErrors = {
1248
+ ...e.formFieldErrors,
1249
+ [re]: J.message
1250
+ });
1251
+ }), d("error", _);
1252
+ } finally {
1253
+ e.isReadonly = !1;
1254
+ }
1255
+ };
1256
+ return xe(() => a.gatewayServiceId, () => {
1257
+ Object.assign(e.fields, w);
1258
+ }), xe(e.fields, () => {
1259
+ d("model-updated", E.value);
1260
+ }), Ze(() => {
1261
+ d("model-updated", E.value), j.value || (e.fields.name = Ie());
1262
+ }), q({
1263
+ validateUrl: ce,
1264
+ getPayload: E,
1265
+ saveFormData: N,
1266
+ canSubmit: oe,
1267
+ initForm: f
1268
+ }), (t, r) => {
1269
+ const n = M("KRadio"), h = M("KButton"), _ = M("KInput"), k = M("KSelect"), i = M("KCheckbox"), J = M("KCollapse"), re = M("KAlert");
1270
+ return V(), A("div", Ut, [
1271
+ c(o(yt), {
1272
+ "can-submit": oe.value,
1273
+ config: s.config,
1274
+ "edit-id": s.gatewayServiceId,
1275
+ "entity-type": o(Oe).GatewayService,
1276
+ "fetch-url": W.value,
1277
+ "form-fields": E.value,
1278
+ "is-readonly": e.isReadonly,
1279
+ onCancel: g,
1280
+ "onFetch:error": r[30] || (r[30] = (p) => t.$emit("error", p)),
1281
+ "onFetch:success": f,
1282
+ onLoading: r[31] || (r[31] = (p) => t.$emit("loading", p)),
1283
+ onSubmit: N
1284
+ }, {
1285
+ "form-actions": u(() => [
1286
+ Xe(t.$slots, "form-actions", {
1287
+ canSubmit: oe.value,
1288
+ cancel: g,
1289
+ submit: N
1290
+ }, void 0, !0)
1291
+ ]),
1292
+ default: u(() => [
1293
+ c(o(qe), {
1294
+ description: o(l)("gateway_services.form.sections.keys.description"),
1295
+ "hide-info-header": s.hideSectionsInfo,
1296
+ title: o(l)("gateway_services.form.sections.keys.title")
1297
+ }, {
1298
+ default: u(() => [
1299
+ j.value ? R("", !0) : (V(), A("div", $t, [
1300
+ P("div", xt, [
1301
+ c(n, {
1302
+ modelValue: C.value,
1303
+ "onUpdate:modelValue": r[0] || (r[0] = (p) => C.value = p),
1304
+ card: "",
1305
+ "card-orientation": "horizontal",
1306
+ "data-testid": "gateway-service-url-radio",
1307
+ description: o(l)("gateway_services.form.sections.keys.url.description"),
1308
+ label: o(l)("gateway_services.form.sections.keys.url.label"),
1309
+ "selected-value": fe.url,
1310
+ onChange: ve
1311
+ }, null, 8, ["modelValue", "description", "label", "selected-value"]),
1312
+ c(n, {
1313
+ modelValue: C.value,
1314
+ "onUpdate:modelValue": r[1] || (r[1] = (p) => C.value = p),
1315
+ card: "",
1316
+ "card-orientation": "horizontal",
1317
+ "checked-group": "protocol",
1318
+ "data-testid": "gateway-service-protocol-radio",
1319
+ description: o(l)("gateway_services.form.sections.keys.protocol.description"),
1320
+ label: o(l)("gateway_services.form.sections.keys.protocol.label"),
1321
+ "selected-value": fe.protocol,
1322
+ onChange: ve
1323
+ }, null, 8, ["modelValue", "description", "label", "selected-value"])
1324
+ ]),
1325
+ c(Te, { name: "slide-fade" }, {
1326
+ default: u(() => [
1327
+ C.value === "url" ? (V(), A("div", Mt, [
1328
+ c(_, {
1329
+ modelValue: e.fields.url,
1330
+ "onUpdate:modelValue": r[2] || (r[2] = (p) => e.fields.url = p),
1331
+ modelModifiers: { trim: !0 },
1332
+ class: "gateway-service-url-input gateway-service-form-margin-bottom",
1333
+ "data-testid": "gateway-service-url-input",
1334
+ error: Pe.value,
1335
+ "error-message": H("url"),
1336
+ label: o(l)("gateway_services.form.fields.upstream_url.label"),
1337
+ "label-attributes": {
1338
+ info: s.config.app === "konnect" ? o(l)("gateway_services.form.fields.upstream_url.tooltip_for_konnect") : o(l)("gateway_services.form.fields.upstream_url.tooltip_for_km"),
1339
+ tooltipAttributes: { maxWidth: "400" }
1340
+ },
1341
+ name: "url",
1342
+ placeholder: o(l)("gateway_services.form.fields.upstream_url.placeholder"),
1343
+ required: "",
1344
+ onInput: ye
1345
+ }, ke({ _: 2 }, [
1346
+ s.hideTrySampleApiButton ? void 0 : {
1347
+ name: "after",
1348
+ fn: u(() => [
1349
+ c(h, {
1350
+ appearance: "tertiary",
1351
+ "data-testid": "try-sample-api",
1352
+ size: "small",
1353
+ onClick: ge
1354
+ }, {
1355
+ default: u(() => [
1356
+ T(b(o(l)("gateway_services.form.buttons.try_sample")), 1)
1357
+ ]),
1358
+ _: 1
1359
+ })
1360
+ ]),
1361
+ key: "0"
1362
+ }
1363
+ ]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
1364
+ ])) : R("", !0)
1365
+ ]),
1366
+ _: 1
1367
+ })
1368
+ ])),
1369
+ c(Te, { name: "slide-fade" }, {
1370
+ default: u(() => [
1371
+ C.value === "protocol" || j.value ? (V(), A("div", Dt, [
1372
+ c(k, {
1373
+ modelValue: e.fields.protocol,
1374
+ "onUpdate:modelValue": r[3] || (r[3] = (p) => e.fields.protocol = p),
1375
+ "data-testid": "gateway-service-protocol-select",
1376
+ items: ee,
1377
+ label: o(l)("gateway_services.form.fields.protocol.label"),
1378
+ "label-attributes": {
1379
+ info: o(l)("gateway_services.form.fields.protocol.tooltip"),
1380
+ tooltipAttributes: { maxWidth: "400" }
1381
+ },
1382
+ readonly: e.isReadonly,
1383
+ required: "",
1384
+ width: "100%",
1385
+ onSelected: pe
1386
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
1387
+ c(_, {
1388
+ modelValue: e.fields.host,
1389
+ "onUpdate:modelValue": r[4] || (r[4] = (p) => e.fields.host = p),
1390
+ modelModifiers: { trim: !0 },
1391
+ class: "gateway-service-form-margin-top",
1392
+ "data-testid": "gateway-service-host-input",
1393
+ error: !!e.formFieldErrors.host,
1394
+ "error-message": H("host"),
1395
+ label: o(l)("gateway_services.form.fields.host.label"),
1396
+ "label-attributes": {
1397
+ info: o(l)("gateway_services.form.fields.host.tooltip"),
1398
+ tooltipAttributes: { maxWidth: "400" }
1399
+ },
1400
+ name: "host",
1401
+ placeholder: o(l)("gateway_services.form.fields.host.placeholder"),
1402
+ required: "",
1403
+ onInput: r[5] || (r[5] = (p) => x("host"))
1404
+ }, ke({ _: 2 }, [
1405
+ s.hideTrySampleApiButton ? void 0 : {
1406
+ name: "after",
1407
+ fn: u(() => [
1408
+ c(h, {
1409
+ appearance: "tertiary",
1410
+ size: "small",
1411
+ onClick: ge
1412
+ }, {
1413
+ default: u(() => [
1414
+ T(b(o(l)("gateway_services.form.buttons.try_sample")), 1)
1415
+ ]),
1416
+ _: 1
1417
+ })
1418
+ ]),
1419
+ key: "0"
1420
+ }
1421
+ ]), 1032, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"]),
1422
+ he.value ? (V(), A("div", Bt, [
1423
+ c(_, {
1424
+ modelValue: e.fields.path,
1425
+ "onUpdate:modelValue": r[6] || (r[6] = (p) => e.fields.path = p),
1426
+ modelModifiers: { trim: !0 },
1427
+ class: "gateway-service-form-margin-top",
1428
+ "data-testid": "gateway-service-path-input",
1429
+ error: !!e.formFieldErrors.path,
1430
+ "error-message": H("path"),
1431
+ label: o(l)("gateway_services.form.fields.path.label"),
1432
+ "label-attributes": {
1433
+ info: o(l)("gateway_services.form.fields.path.tooltip"),
1434
+ tooltipAttributes: { maxWidth: "400" }
1435
+ },
1436
+ name: "path",
1437
+ placeholder: o(l)("gateway_services.form.fields.path.placeholder"),
1438
+ onInput: r[7] || (r[7] = (p) => x("path"))
1439
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder"])
1440
+ ])) : R("", !0),
1441
+ c(_, {
1442
+ modelValue: e.fields.port,
1443
+ "onUpdate:modelValue": [
1444
+ r[8] || (r[8] = (p) => e.fields.port = p),
1445
+ r[10] || (r[10] = () => {
1446
+ e.fields.port = z(e.fields.port + "");
1447
+ })
1448
+ ],
1449
+ class: "gateway-service-form-margin-top",
1450
+ "data-testid": "gateway-service-port-input",
1451
+ error: !!e.formFieldErrors.port,
1452
+ "error-message": H("port"),
1453
+ label: o(l)("gateway_services.form.fields.port.label"),
1454
+ "label-attributes": {
1455
+ info: o(l)("gateway_services.form.fields.port.tooltip"),
1456
+ tooltipAttributes: { maxWidth: "400" }
1457
+ },
1458
+ name: "port",
1459
+ type: "number",
1460
+ onInput: r[9] || (r[9] = (p) => x("port"))
1461
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes"])
1462
+ ])) : R("", !0)
1463
+ ]),
1464
+ _: 1
1465
+ }),
1466
+ c(J, {
1467
+ modelValue: v.value,
1468
+ "onUpdate:modelValue": r[26] || (r[26] = (p) => v.value = p),
1469
+ "data-testid": "advanced-fields-collapse",
1470
+ "trigger-alignment": "leading",
1471
+ "trigger-label": o(l)("gateway_services.form.sections.keys.viewAdvancedFields")
1472
+ }, {
1473
+ default: u(() => [
1474
+ c(Te, { name: "slide-fade" }, {
1475
+ default: u(() => [
1476
+ v.value ? R("", !0) : (V(), A("div", Kt, [
1477
+ P("div", Lt, [
1478
+ c(_, {
1479
+ modelValue: e.fields.retries,
1480
+ "onUpdate:modelValue": [
1481
+ r[11] || (r[11] = (p) => e.fields.retries = p),
1482
+ r[12] || (r[12] = () => {
1483
+ e.fields.retries = z(e.fields.retries + "");
1484
+ })
1485
+ ],
1486
+ autocomplete: "off",
1487
+ "data-testid": "gateway-service-retries-input",
1488
+ label: o(l)("gateway_services.form.fields.retries.label"),
1489
+ "label-attributes": {
1490
+ info: o(l)("gateway_services.form.fields.retries.tooltip"),
1491
+ tooltipAttributes: { maxWidth: "400" }
1492
+ },
1493
+ name: "retries",
1494
+ readonly: e.isReadonly,
1495
+ type: "number"
1496
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1497
+ ]),
1498
+ P("div", qt, [
1499
+ c(_, {
1500
+ modelValue: e.fields.connect_timeout,
1501
+ "onUpdate:modelValue": [
1502
+ r[13] || (r[13] = (p) => e.fields.connect_timeout = p),
1503
+ r[14] || (r[14] = () => {
1504
+ e.fields.connect_timeout = z(e.fields.connect_timeout + "");
1505
+ })
1506
+ ],
1507
+ autocomplete: "off",
1508
+ "data-testid": "gateway-service-connTimeout-input",
1509
+ label: o(l)("gateway_services.form.fields.connect_timeout.label"),
1510
+ "label-attributes": {
1511
+ info: o(l)("gateway_services.form.fields.connect_timeout.tooltip"),
1512
+ tooltipAttributes: { maxWidth: "400" }
1513
+ },
1514
+ name: "connTimeout",
1515
+ readonly: e.isReadonly,
1516
+ type: "number"
1517
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1518
+ ]),
1519
+ P("div", Gt, [
1520
+ c(_, {
1521
+ modelValue: e.fields.write_timeout,
1522
+ "onUpdate:modelValue": [
1523
+ r[15] || (r[15] = (p) => e.fields.write_timeout = p),
1524
+ r[16] || (r[16] = () => {
1525
+ e.fields.write_timeout = z(e.fields.write_timeout + "");
1526
+ })
1527
+ ],
1528
+ autocomplete: "off",
1529
+ "data-testid": "gateway-service-writeTimeout-input",
1530
+ label: o(l)("gateway_services.form.fields.write_timeout.label"),
1531
+ "label-attributes": {
1532
+ info: o(l)("gateway_services.form.fields.write_timeout.tooltip"),
1533
+ tooltipAttributes: { maxWidth: "400" }
1534
+ },
1535
+ name: "writeTimeout",
1536
+ readonly: e.isReadonly,
1537
+ type: "number"
1538
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1539
+ ]),
1540
+ P("div", Nt, [
1541
+ c(_, {
1542
+ modelValue: e.fields.read_timeout,
1543
+ "onUpdate:modelValue": [
1544
+ r[17] || (r[17] = (p) => e.fields.read_timeout = p),
1545
+ r[18] || (r[18] = () => {
1546
+ e.fields.read_timeout = z(e.fields.read_timeout + "");
1547
+ })
1548
+ ],
1549
+ autocomplete: "off",
1550
+ "data-testid": "gateway-service-readTimeout-input",
1551
+ label: o(l)("gateway_services.form.fields.read_timeout.label"),
1552
+ "label-attributes": {
1553
+ info: o(l)("gateway_services.form.fields.read_timeout.tooltip"),
1554
+ tooltipAttributes: { maxWidth: "400" }
1555
+ },
1556
+ name: "readTimeout",
1557
+ readonly: e.isReadonly,
1558
+ type: "number"
1559
+ }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
1560
+ ]),
1561
+ be.value ? (V(), A("div", Wt, [
1562
+ c(_, {
1563
+ modelValue: e.fields.client_certificate,
1564
+ "onUpdate:modelValue": r[19] || (r[19] = (p) => e.fields.client_certificate = p),
1565
+ modelModifiers: { trim: !0 },
1566
+ autocomplete: "off",
1567
+ "data-testid": "gateway-service-clientCert-input",
1568
+ error: !!e.formFieldErrors.client_certificate,
1569
+ label: o(l)("gateway_services.form.fields.client_certificate.label"),
1570
+ "label-attributes": {
1571
+ info: o(l)("gateway_services.form.fields.client_certificate.tooltip"),
1572
+ tooltipAttributes: { maxWidth: "400" }
1573
+ },
1574
+ name: "clientCert",
1575
+ placeholder: o(l)("gateway_services.form.fields.client_certificate.placeholder"),
1576
+ readonly: e.isReadonly,
1577
+ type: "text",
1578
+ onInput: r[20] || (r[20] = (p) => _e("client_certificate"))
1579
+ }, null, 8, ["modelValue", "error", "label", "label-attributes", "placeholder", "readonly"])
1580
+ ])) : R("", !0),
1581
+ Fe.value ? (V(), A("div", Ot, [
1582
+ c(_, {
1583
+ modelValue: e.fields.ca_certificates,
1584
+ "onUpdate:modelValue": r[21] || (r[21] = (p) => e.fields.ca_certificates = p),
1585
+ modelModifiers: { trim: !0 },
1586
+ autocomplete: "off",
1587
+ "data-testid": "gateway-service-ca-certs-input",
1588
+ error: !!e.formFieldErrors.ca_certificates,
1589
+ label: o(l)("gateway_services.form.fields.ca_certificates.label"),
1590
+ "label-attributes": { tooltipAttributes: { maxWidth: "400" } },
1591
+ placeholder: o(l)("gateway_services.form.fields.ca_certificates.placeholder"),
1592
+ readonly: e.isReadonly,
1593
+ type: "text",
1594
+ onInput: r[22] || (r[22] = (p) => _e("ca_certificates"))
1595
+ }, {
1596
+ "label-tooltip": u(() => [
1597
+ c(o(B), {
1598
+ keypath: "gateway_services.form.fields.ca_certificates.tooltip",
1599
+ scope: "global"
1600
+ }, {
1601
+ code1: u(() => [
1602
+ P("code", null, b(o(l)("gateway_services.form.fields.ca_certificates.code1")), 1)
1603
+ ]),
1604
+ code2: u(() => [
1605
+ P("code", null, b(o(l)("gateway_services.form.fields.ca_certificates.code2")), 1)
1606
+ ]),
1607
+ _: 1
1608
+ })
1609
+ ]),
1610
+ _: 1
1611
+ }, 8, ["modelValue", "error", "label", "placeholder", "readonly"])
1612
+ ])) : R("", !0),
1613
+ Ae.value ? (V(), A("div", jt, [
1614
+ c(i, {
1615
+ modelValue: e.fields.tls_verify_enabled,
1616
+ "onUpdate:modelValue": r[23] || (r[23] = (p) => e.fields.tls_verify_enabled = p),
1617
+ "data-testid": "gateway-service-tls-verify-checkbox",
1618
+ description: o(l)("gateway_services.form.fields.tls_verify_enabled.help"),
1619
+ label: o(l)("gateway_services.form.fields.tls_verify_enabled.label"),
1620
+ "label-attributes": { tooltipAttributes: { maxWidth: "400" } }
1621
+ }, {
1622
+ tooltip: u(() => [
1623
+ c(o(B), {
1624
+ keypath: "gateway_services.form.fields.tls_verify_enabled.tooltip",
1625
+ scope: "global"
1626
+ }, {
1627
+ code1: u(() => [
1628
+ P("code", null, b(o(l)("gateway_services.form.fields.tls_verify_enabled.code1")), 1)
1629
+ ]),
1630
+ _: 1
1631
+ })
1632
+ ]),
1633
+ _: 1
1634
+ }, 8, ["modelValue", "description", "label"]),
1635
+ e.fields.tls_verify_enabled ? (V(), A("div", zt, [
1636
+ c(n, {
1637
+ modelValue: e.fields.tls_verify_value,
1638
+ "onUpdate:modelValue": r[24] || (r[24] = (p) => e.fields.tls_verify_value = p),
1639
+ "data-testid": "gateway-service-tls-verify-true-option",
1640
+ label: o(l)("gateway_services.form.fields.tls_verify_option.true.label"),
1641
+ "selected-value": !0
1642
+ }, null, 8, ["modelValue", "label"])
1643
+ ])) : R("", !0),
1644
+ e.fields.tls_verify_enabled ? (V(), A("div", Ht, [
1645
+ c(n, {
1646
+ modelValue: e.fields.tls_verify_value,
1647
+ "onUpdate:modelValue": r[25] || (r[25] = (p) => e.fields.tls_verify_value = p),
1648
+ "data-testid": "gateway-service-tls-verify-false-option",
1649
+ label: o(l)("gateway_services.form.fields.tls_verify_option.false.label"),
1650
+ "selected-value": !1
1651
+ }, null, 8, ["modelValue", "label"])
1652
+ ])) : R("", !0)
1653
+ ])) : R("", !0)
1654
+ ]))
1655
+ ]),
1656
+ _: 1
1657
+ })
1658
+ ]),
1659
+ _: 1
1660
+ }, 8, ["modelValue", "trigger-label"])
1661
+ ]),
1662
+ _: 1
1663
+ }, 8, ["description", "hide-info-header", "title"]),
1664
+ c(o(qe), {
1665
+ description: o(l)("gateway_services.form.sections.general.description"),
1666
+ "hide-info-header": s.hideSectionsInfo,
1667
+ title: o(l)("gateway_services.form.sections.general.title")
1668
+ }, {
1669
+ default: u(() => [
1670
+ c(_, {
1671
+ modelValue: e.fields.name,
1672
+ "onUpdate:modelValue": r[27] || (r[27] = (p) => e.fields.name = p),
1673
+ modelModifiers: { trim: !0 },
1674
+ autocomplete: "off",
1675
+ "data-testid": "gateway-service-name-input",
1676
+ error: Y.value,
1677
+ "error-message": ne.value,
1678
+ label: o(l)("gateway_services.form.fields.name.label"),
1679
+ "label-attributes": {
1680
+ info: o(l)("gateway_services.form.fields.name.tooltip"),
1681
+ tooltipAttributes: { maxWidth: "400" }
1682
+ },
1683
+ name: "name",
1684
+ placeholder: o(l)("gateway_services.form.fields.name.placeholder"),
1685
+ readonly: e.isReadonly,
1686
+ type: "text",
1687
+ onInput: te
1688
+ }, null, 8, ["modelValue", "error", "error-message", "label", "label-attributes", "placeholder", "readonly"]),
1689
+ c(J, {
1690
+ "data-testid": "tags-collapse",
1691
+ "trigger-alignment": "leading",
1692
+ "trigger-label": o(l)("gateway_services.form.fields.tags.collapse")
1693
+ }, {
1694
+ default: u(() => [
1695
+ P("div", Zt, [
1696
+ c(_, {
1697
+ modelValue: e.fields.tags,
1698
+ "onUpdate:modelValue": r[28] || (r[28] = (p) => e.fields.tags = p),
1699
+ modelModifiers: { trim: !0 },
1700
+ autocomplete: "off",
1701
+ "data-testid": "gateway-service-tags-input",
1702
+ help: o(l)("gateway_services.form.fields.tags.help"),
1703
+ label: o(l)("gateway_services.form.fields.tags.label"),
1704
+ "label-attributes": {
1705
+ info: o(l)("gateway_services.form.fields.tags.tooltip"),
1706
+ tooltipAttributes: { maxWidth: "400" }
1707
+ },
1708
+ name: "tags",
1709
+ placeholder: o(l)("gateway_services.form.fields.tags.placeholder"),
1710
+ readonly: e.isReadonly,
1711
+ type: "text",
1712
+ onInput: r[29] || (r[29] = (p) => G("tags"))
1713
+ }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
1714
+ ])
1715
+ ]),
1716
+ _: 1
1717
+ }, 8, ["trigger-label"])
1718
+ ]),
1719
+ _: 1
1720
+ }, 8, ["description", "hide-info-header", "title"]),
1721
+ e.errorMessages.length ? (V(), le(re, {
1722
+ key: 0,
1723
+ appearance: "danger",
1724
+ "data-testid": "form-error"
1725
+ }, {
1726
+ default: u(() => [
1727
+ P("ul", Jt, [
1728
+ (V(!0), A(Je, null, Qe(e.errorMessages, (p) => (V(), A("li", { key: p }, b(p), 1))), 128))
1729
+ ])
1730
+ ]),
1731
+ _: 1
1732
+ })) : R("", !0)
1733
+ ]),
1734
+ _: 3
1735
+ }, 8, ["can-submit", "config", "edit-id", "entity-type", "fetch-url", "form-fields", "is-readonly"])
1736
+ ]);
1737
+ };
1738
+ }
1739
+ }), co = /* @__PURE__ */ je(Qt, [["__scopeId", "data-v-8f8e7eca"]]), { validateHost: Xt, validatePort: Yt, validateProtocol: eo, validatePath: to } = Q.useUrlValidators(), uo = () => ({
1740
+ validateHost: Xt,
1741
+ validatePort: Yt,
1742
+ validateProtocol: eo,
1743
+ validatePath: to
1744
+ });
1745
+ export {
1746
+ no as GatewayServiceConfigCard,
1747
+ co as GatewayServiceForm,
1748
+ ao as GatewayServiceList,
1749
+ uo as useUrlValidator
1750
+ };