@kong-ui-public/entities-keys 3.5.43 → 3.5.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import { defineComponent as me, ref as h, computed as I, watch as le, onBeforeMount as we, resolveComponent as M, openBlock as b, createElementBlock as V, createVNode as u, unref as o, withCtx as f, createBlock as D, Teleport as Ee, withDirectives as xe, createTextVNode as te, toDisplayString as K, vShow as Me, createElementVNode as U, Fragment as ke, renderList as pe, withModifiers as De, reactive as he, createCommentVNode as oe, createSlots as Re } from "vue";
2
- import { useRouter as Ce } from "vue-router";
3
- import { AddIcon as Fe } from "@kong/icons";
4
- import { createI18n as Ve, i18nTComponent as Te } from "@kong-ui-public/i18n";
5
- import { useAxios as ge, useFetcher as Ae, useDeleteUrlBuilder as Be, FetcherStatus as _e, EntityBaseTable as Ue, EntityFilter as qe, PermissionsWrapper as se, EntityDeleteModal as Pe, EntityTypes as Ne, useErrors as Oe, EntityBaseFormType as ae, useDebouncedFilter as Je, EntityBaseForm as We, SupportedEntityType as Ke, EntityFormSection as Se, useStringHelpers as Le, ConfigurationSchemaSection as fe, ConfigurationSchemaType as ue, EntityBaseConfigCard as Qe, InternalLinkItem as ze, ConfigCardItem as Ie } from "@kong-ui-public/entities-shared";
6
- const Ge = {
1
+ import { defineComponent as ue, ref as b, computed as _, watch as Z, onBeforeMount as Se, resolveComponent as T, openBlock as S, createElementBlock as q, createVNode as f, unref as o, withCtx as u, createBlock as A, Teleport as je, withDirectives as $e, createTextVNode as le, toDisplayString as j, vShow as Ee, createElementVNode as F, reactive as me, createCommentVNode as ie, createSlots as xe, Fragment as ge, renderList as ve } from "vue";
2
+ import { useRouter as Ie } from "vue-router";
3
+ import { AddIcon as Me } from "@kong/icons";
4
+ import { createI18n as Ve, i18nTComponent as De } from "@kong-ui-public/i18n";
5
+ import { useAxios as ke, useFetcher as Re, useDeleteUrlBuilder as Fe, FetcherStatus as be, EntityBaseTable as Te, EntityFilter as Ae, PermissionsWrapper as oe, TableTags as Be, EntityDeleteModal as Ue, EntityTypes as qe, useErrors as Pe, EntityBaseFormType as se, useDebouncedFilter as Ne, EntityBaseForm as Oe, SupportedEntityType as we, EntityFormSection as he, useStringHelpers as Je, ConfigurationSchemaSection as ye, ConfigurationSchemaType as fe, EntityBaseConfigCard as We, InternalLinkItem as Le, ConfigCardItem as _e } from "@kong-ui-public/entities-shared";
6
+ const Qe = {
7
7
  title: "Keys",
8
8
  list: {
9
9
  toolbar_actions: {
@@ -115,57 +115,57 @@ const Ge = {
115
115
  }
116
116
  }
117
117
  }
118
- }, He = {
119
- keys: Ge
118
+ }, ze = {
119
+ keys: Qe
120
120
  };
121
- function Xe() {
122
- const s = Ve("en-us", He);
121
+ function Ge() {
122
+ const s = Ve("en-us", ze);
123
123
  return {
124
124
  i18n: s,
125
- i18nT: Te(s)
125
+ i18nT: De(s)
126
126
  // Translation component <i18n-t>
127
127
  };
128
128
  }
129
- const ve = {
130
- useI18n: Xe
131
- }, A = "/v2/control-planes/{controlPlaneId}/core-entities", B = "/{workspace}", q = {
129
+ const pe = {
130
+ useI18n: Ge
131
+ }, D = "/v2/control-planes/{controlPlaneId}/core-entities", R = "/{workspace}", B = {
132
132
  list: {
133
133
  konnect: {
134
- all: `${A}/keys`,
135
- forKeySet: `${A}/key-sets/{keySetId}/keys`
134
+ all: `${D}/keys`,
135
+ forKeySet: `${D}/key-sets/{keySetId}/keys`
136
136
  },
137
137
  kongManager: {
138
- all: `${B}/keys`,
139
- forKeySet: `${B}/key-sets/{keySetId}/keys`
138
+ all: `${R}/keys`,
139
+ forKeySet: `${R}/key-sets/{keySetId}/keys`
140
140
  }
141
141
  },
142
142
  form: {
143
143
  konnect: {
144
144
  create: {
145
- all: `${A}/keys`,
146
- forKeySet: `${A}/key-sets/{keySetId}/keys`
145
+ all: `${D}/keys`,
146
+ forKeySet: `${D}/key-sets/{keySetId}/keys`
147
147
  },
148
148
  edit: {
149
- all: `${A}/keys/{id}`,
150
- forKeySet: `${A}/key-sets/{keySetId}/keys/{id}`
149
+ all: `${D}/keys/{id}`,
150
+ forKeySet: `${D}/key-sets/{keySetId}/keys/{id}`
151
151
  },
152
- keySets: `${A}/key-sets`,
153
- getKeySet: `${A}/key-sets/{keySetId}`
152
+ keySets: `${D}/key-sets`,
153
+ getKeySet: `${D}/key-sets/{keySetId}`
154
154
  },
155
155
  kongManager: {
156
156
  create: {
157
- all: `${B}/keys`,
158
- forKeySet: `${B}/key-sets/{keySetId}/keys`
157
+ all: `${R}/keys`,
158
+ forKeySet: `${R}/key-sets/{keySetId}/keys`
159
159
  },
160
160
  edit: {
161
- all: `${B}/keys/{id}`,
162
- forKeySet: `${B}/key-sets/{keySetId}/keys/{id}`
161
+ all: `${R}/keys/{id}`,
162
+ forKeySet: `${R}/key-sets/{keySetId}/keys/{id}`
163
163
  },
164
- keySets: `${B}/key-sets`,
165
- getKeySet: `${B}/key-sets/{keySetId}`
164
+ keySets: `${R}/key-sets`,
165
+ getKeySet: `${R}/key-sets/{keySetId}`
166
166
  }
167
167
  }
168
- }, Ye = { class: "kong-ui-entities-keys-list" }, Ze = { key: 1 }, et = /* @__PURE__ */ me({
168
+ }, He = { class: "kong-ui-entities-keys-list" }, Xe = /* @__PURE__ */ ue({
169
169
  __name: "KeyList",
170
170
  props: {
171
171
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -210,259 +210,245 @@ const ve = {
210
210
  }
211
211
  },
212
212
  emits: ["error", "copy:success", "copy:error", "delete:success"],
213
- setup(s, { emit: P }) {
214
- var ee;
215
- const _ = P, l = s, { i18n: { t: y } } = ve.useI18n(), r = Ce(), { axiosInstance: j } = ge((ee = l.config) == null ? void 0 : ee.axiosRequestConfig), R = h(1), L = I(() => l.config.app !== "kongManager" || !!l.config.disableSorting), $ = {
213
+ setup(s, { emit: U }) {
214
+ var Y;
215
+ const h = U, l = s, { i18n: { t: y } } = pe.useI18n(), d = Ie(), { axiosInstance: C } = ke((Y = l.config) == null ? void 0 : Y.axiosRequestConfig), x = b(1), J = _(() => l.config.app !== "kongManager" || !!l.config.disableSorting), K = {
216
216
  // the Name column is non-hidable
217
217
  name: { label: y("keys.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
218
218
  kid: { label: y("keys.list.table_headers.key_id"), sortable: !0 },
219
219
  tags: { label: y("keys.list.table_headers.tags") },
220
220
  id: { label: y("keys.list.table_headers.id"), sortable: !0 }
221
- }, t = $, w = I(() => {
222
- var i, d, k, S;
223
- let e = `${l.config.apiBaseUrl}${q.list[l.config.app][l.config.keySetId ? "forKeySet" : "all"]}`;
224
- return l.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((i = l.config) == null ? void 0 : i.controlPlaneId) || "").replace(/{keySetId}/gi, ((d = l.config) == null ? void 0 : d.keySetId) || "") : l.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (k = l.config) != null && k.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, ((S = l.config) == null ? void 0 : S.keySetId) || "")), e;
225
- }), x = h(""), T = I(() => {
221
+ }, t = K, I = _(() => {
222
+ var i, c, k, g;
223
+ let e = `${l.config.apiBaseUrl}${B.list[l.config.app][l.config.keySetId ? "forKeySet" : "all"]}`;
224
+ return l.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((i = l.config) == null ? void 0 : i.controlPlaneId) || "").replace(/{keySetId}/gi, ((c = l.config) == null ? void 0 : c.keySetId) || "") : l.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (k = l.config) != null && k.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, ((g = l.config) == null ? void 0 : g.keySetId) || "")), e;
225
+ }), E = b(""), V = _(() => {
226
226
  const e = l.config.app === "konnect" || l.config.isExactMatch;
227
227
  if (e)
228
228
  return {
229
229
  isExactMatch: e,
230
230
  placeholder: y("keys.search.placeholder")
231
231
  };
232
- const i = { name: $.name };
232
+ const i = { name: K.name };
233
233
  return {
234
234
  isExactMatch: e,
235
235
  fields: i,
236
236
  schema: l.config.filterSchema
237
237
  };
238
- }), { fetcher: Q, fetcherState: z } = Ae(l.config, w.value), G = () => {
239
- x.value = "";
240
- }, O = () => {
241
- R.value++;
242
- }, a = h(null), g = h(!1), E = (e, i) => {
243
- const d = e.id;
244
- if (!i(d)) {
238
+ }), { fetcher: W, fetcherState: L } = Re(l.config, I.value), Q = () => {
239
+ E.value = "";
240
+ }, P = () => {
241
+ x.value++;
242
+ }, n = b(null), m = b(!1), $ = (e, i) => {
243
+ const c = e.id;
244
+ if (!i(c)) {
245
245
  p(e, "id");
246
246
  return;
247
247
  }
248
- C(e, "id");
248
+ w(e, "id");
249
249
  }, v = (e, i) => {
250
- const d = JSON.stringify(e);
251
- if (!i(d)) {
252
- _("copy:error", {
250
+ const c = JSON.stringify(e);
251
+ if (!i(c)) {
252
+ h("copy:error", {
253
253
  entity: e,
254
254
  message: y("keys.errors.copy")
255
255
  });
256
256
  return;
257
257
  }
258
- _("copy:success", {
258
+ h("copy:success", {
259
259
  entity: e,
260
260
  message: y("keys.copy.success_brief")
261
261
  });
262
- }, C = (e, i) => {
263
- _("copy:success", {
262
+ }, w = (e, i) => {
263
+ h("copy:success", {
264
264
  entity: e,
265
265
  field: i,
266
266
  message: y("keys.copy.success", { val: e[i] })
267
267
  });
268
268
  }, p = (e, i) => {
269
- _("copy:error", {
269
+ h("copy:error", {
270
270
  entity: e,
271
271
  field: i,
272
272
  message: y("keys.errors.copy")
273
273
  });
274
- }, ie = async (e) => {
275
- var d;
276
- await ((d = l.canRetrieve) == null ? void 0 : d.call(l, e)) && r.push(l.config.getViewRoute(e.id));
277
- }, ne = (e) => ({
274
+ }, ee = async (e) => {
275
+ var c;
276
+ await ((c = l.canRetrieve) == null ? void 0 : c.call(l, e)) && d.push(l.config.getViewRoute(e.id));
277
+ }, ae = (e) => ({
278
278
  label: y("keys.actions.view"),
279
279
  to: l.config.getViewRoute(e)
280
280
  }), re = (e) => ({
281
281
  label: y("keys.actions.edit"),
282
282
  to: l.config.getEditRoute(e)
283
- }), F = h(void 0), J = h(!1), W = h(!1), H = h(""), de = Be(l.config, w.value), ce = (e) => {
284
- F.value = e, J.value = !0;
285
- }, ye = () => {
286
- J.value = !1;
287
- }, X = async () => {
288
- var e, i, d;
289
- if ((e = F.value) != null && e.id) {
290
- W.value = !0;
283
+ }), M = b(void 0), N = b(!1), O = b(!1), z = b(""), ne = Fe(l.config, I.value), de = (e) => {
284
+ M.value = e, N.value = !0;
285
+ }, ce = () => {
286
+ N.value = !1;
287
+ }, G = async () => {
288
+ var e, i, c;
289
+ if ((e = M.value) != null && e.id) {
290
+ O.value = !0;
291
291
  try {
292
- await j.delete(de(F.value.id)), W.value = !1, J.value = !1, R.value++, _("delete:success", F.value);
292
+ await C.delete(ne(M.value.id)), O.value = !1, N.value = !1, x.value++, h("delete:success", M.value);
293
293
  } catch (k) {
294
- H.value = ((d = (i = k.response) == null ? void 0 : i.data) == null ? void 0 : d.message) || k.message || y("keys.errors.delete"), _("error", k);
294
+ z.value = ((c = (i = k.response) == null ? void 0 : i.data) == null ? void 0 : c.message) || k.message || y("keys.errors.delete"), h("error", k);
295
295
  } finally {
296
- W.value = !1;
296
+ O.value = !1;
297
297
  }
298
298
  }
299
- }, Y = h(!1);
300
- le(z, (e) => {
301
- var i, d, k, S;
302
- if (Array.isArray((i = e == null ? void 0 : e.response) == null ? void 0 : i.data) && (Y.value = e.response.data.length > 0), e.status === _e.NoRecords ? g.value = !0 : g.value = !1, e.status === _e.Error) {
303
- a.value = {
299
+ }, H = b(!1);
300
+ Z(L, (e) => {
301
+ var i, c, k, g;
302
+ if (Array.isArray((i = e == null ? void 0 : e.response) == null ? void 0 : i.data) && (H.value = e.response.data.length > 0), e.status === be.NoRecords ? m.value = !0 : m.value = !1, e.status === be.Error) {
303
+ n.value = {
304
304
  title: y("keys.errors.general")
305
- }, (S = (k = (d = e.error) == null ? void 0 : d.response) == null ? void 0 : k.data) != null && S.message && (a.value.message = e.error.response.data.message), _("error", e.error);
305
+ }, (g = (k = (c = e.error) == null ? void 0 : c.response) == null ? void 0 : k.data) != null && g.message && (n.value.message = e.error.response.data.message), h("error", e.error);
306
306
  return;
307
307
  }
308
- a.value = null;
308
+ n.value = null;
309
309
  });
310
- const Z = h({
310
+ const X = b({
311
311
  ctaPath: l.config.createRoute,
312
312
  ctaText: void 0,
313
313
  message: `${y("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState ? ` ${l.config.additionMessageForEmptyState}` : ""}`,
314
314
  title: y("keys.title")
315
315
  });
316
- return we(async () => {
317
- await l.canCreate() && (Z.value.title = y("keys.list.empty_state.title"), Z.value.ctaText = y("keys.actions.create"));
316
+ return Se(async () => {
317
+ await l.canCreate() && (X.value.title = y("keys.list.empty_state.title"), X.value.ctaText = y("keys.actions.create"));
318
318
  }), (e, i) => {
319
- const d = M("KButton"), k = M("KCopy"), S = M("KBadge"), n = M("KTruncate"), c = M("KDropdownItem"), be = M("KClipboardProvider");
320
- return b(), V("div", Ye, [
321
- u(o(Ue), {
319
+ const c = T("KButton"), k = T("KCopy"), g = T("KDropdownItem"), r = T("KClipboardProvider");
320
+ return S(), q("div", He, [
321
+ f(o(Te), {
322
322
  "cache-identifier": s.cacheIdentifier,
323
- "disable-sorting": L.value,
324
- "empty-state-options": Z.value,
323
+ "disable-sorting": J.value,
324
+ "empty-state-options": X.value,
325
325
  "enable-entity-actions": "",
326
- "error-message": a.value,
327
- fetcher: o(Q),
328
- "fetcher-cache-key": R.value,
329
- "hide-toolbar": g.value,
326
+ "error-message": n.value,
327
+ fetcher: o(W),
328
+ "fetcher-cache-key": x.value,
329
+ "hide-toolbar": m.value,
330
330
  "pagination-type": "offset",
331
331
  "preferences-storage-key": "kong-ui-entities-keys-list",
332
- query: x.value,
332
+ query: E.value,
333
333
  "table-headers": o(t),
334
- onClearSearchInput: G,
335
- "onClick:row": i[2] || (i[2] = (m) => ie(m)),
336
- onSort: O
334
+ onClearSearchInput: Q,
335
+ "onClick:row": i[1] || (i[1] = (a) => ee(a)),
336
+ onSort: P
337
337
  }, {
338
- "toolbar-filter": f(() => [
339
- u(o(qe), {
340
- modelValue: x.value,
341
- "onUpdate:modelValue": i[0] || (i[0] = (m) => x.value = m),
342
- config: T.value
338
+ "toolbar-filter": u(() => [
339
+ f(o(Ae), {
340
+ modelValue: E.value,
341
+ "onUpdate:modelValue": i[0] || (i[0] = (a) => E.value = a),
342
+ config: V.value
343
343
  }, null, 8, ["modelValue", "config"])
344
344
  ]),
345
- "toolbar-button": f(() => [
346
- (b(), D(Ee, {
345
+ "toolbar-button": u(() => [
346
+ (S(), A(je, {
347
347
  disabled: !s.useActionOutside,
348
348
  to: "#kong-ui-app-page-header-action-button"
349
349
  }, [
350
- u(o(se), {
350
+ f(o(oe), {
351
351
  "auth-function": () => s.canCreate()
352
352
  }, {
353
- default: f(() => [
354
- xe(u(d, {
353
+ default: u(() => [
354
+ $e(f(c, {
355
355
  appearance: "primary",
356
356
  "data-testid": "toolbar-add-key",
357
357
  size: s.useActionOutside ? "medium" : "large",
358
358
  to: s.config.createRoute
359
359
  }, {
360
- default: f(() => [
361
- u(o(Fe)),
362
- te(" " + K(o(y)("keys.list.toolbar_actions.new_key")), 1)
360
+ default: u(() => [
361
+ f(o(Me)),
362
+ le(" " + j(o(y)("keys.list.toolbar_actions.new_key")), 1)
363
363
  ]),
364
364
  _: 1
365
365
  }, 8, ["size", "to"]), [
366
- [Me, Y.value]
366
+ [Ee, H.value]
367
367
  ])
368
368
  ]),
369
369
  _: 1
370
370
  }, 8, ["auth-function"])
371
371
  ], 8, ["disabled"]))
372
372
  ]),
373
- name: f(({ rowValue: m }) => [
374
- U("b", null, K(m ?? "-"), 1)
373
+ name: u(({ rowValue: a }) => [
374
+ F("b", null, j(a ?? "-"), 1)
375
375
  ]),
376
- kid: f(({ rowValue: m }) => [
377
- u(k, { text: m }, null, 8, ["text"])
376
+ kid: u(({ rowValue: a }) => [
377
+ f(k, { text: a }, null, 8, ["text"])
378
378
  ]),
379
- tags: f(({ rowValue: m }) => [
380
- (m == null ? void 0 : m.length) > 0 ? (b(), D(n, { key: 0 }, {
381
- default: f(() => [
382
- (b(!0), V(ke, null, pe(m, (N) => (b(), D(S, {
383
- key: N,
384
- onClick: i[1] || (i[1] = De(() => {
385
- }, ["stop"]))
386
- }, {
387
- default: f(() => [
388
- te(K(N), 1)
389
- ]),
390
- _: 2
391
- }, 1024))), 128))
392
- ]),
393
- _: 2
394
- }, 1024)) : (b(), V("span", Ze, "-"))
379
+ tags: u(({ rowValue: a }) => [
380
+ f(o(Be), { tags: a }, null, 8, ["tags"])
395
381
  ]),
396
- id: f(({ rowValue: m }) => [
397
- u(k, {
398
- text: m,
382
+ id: u(({ rowValue: a }) => [
383
+ f(k, {
384
+ text: a,
399
385
  truncate: ""
400
386
  }, null, 8, ["text"])
401
387
  ]),
402
- actions: f(({ row: m }) => [
403
- u(be, null, {
404
- default: f(({ copyToClipboard: N }) => [
405
- u(c, {
388
+ actions: u(({ row: a }) => [
389
+ f(r, null, {
390
+ default: u(({ copyToClipboard: te }) => [
391
+ f(g, {
406
392
  "data-testid": "action-entity-copy-id",
407
- onClick: ($e) => E(m, N)
393
+ onClick: (Ke) => $(a, te)
408
394
  }, {
409
- default: f(() => [
410
- te(K(o(y)("keys.actions.copy_id")), 1)
395
+ default: u(() => [
396
+ le(j(o(y)("keys.actions.copy_id")), 1)
411
397
  ]),
412
398
  _: 2
413
399
  }, 1032, ["onClick"])
414
400
  ]),
415
401
  _: 2
416
402
  }, 1024),
417
- u(be, null, {
418
- default: f(({ copyToClipboard: N }) => [
419
- u(c, {
403
+ f(r, null, {
404
+ default: u(({ copyToClipboard: te }) => [
405
+ f(g, {
420
406
  "data-testid": "action-entity-copy-json",
421
- onClick: ($e) => v(m, N)
407
+ onClick: (Ke) => v(a, te)
422
408
  }, {
423
- default: f(() => [
424
- te(K(o(y)("keys.actions.copy_json")), 1)
409
+ default: u(() => [
410
+ le(j(o(y)("keys.actions.copy_json")), 1)
425
411
  ]),
426
412
  _: 2
427
413
  }, 1032, ["onClick"])
428
414
  ]),
429
415
  _: 2
430
416
  }, 1024),
431
- u(o(se), {
432
- "auth-function": () => s.canRetrieve(m)
417
+ f(o(oe), {
418
+ "auth-function": () => s.canRetrieve(a)
433
419
  }, {
434
- default: f(() => [
435
- u(c, {
420
+ default: u(() => [
421
+ f(g, {
436
422
  "data-testid": "action-entity-view",
437
423
  "has-divider": "",
438
- item: ne(m.id)
424
+ item: ae(a.id)
439
425
  }, null, 8, ["item"])
440
426
  ]),
441
427
  _: 2
442
428
  }, 1032, ["auth-function"]),
443
- u(o(se), {
444
- "auth-function": () => s.canEdit(m)
429
+ f(o(oe), {
430
+ "auth-function": () => s.canEdit(a)
445
431
  }, {
446
- default: f(() => [
447
- u(c, {
432
+ default: u(() => [
433
+ f(g, {
448
434
  "data-testid": "action-entity-edit",
449
- item: re(m.id)
435
+ item: re(a.id)
450
436
  }, null, 8, ["item"])
451
437
  ]),
452
438
  _: 2
453
439
  }, 1032, ["auth-function"]),
454
- u(o(se), {
455
- "auth-function": () => s.canDelete(m)
440
+ f(o(oe), {
441
+ "auth-function": () => s.canDelete(a)
456
442
  }, {
457
- default: f(() => [
458
- u(c, {
443
+ default: u(() => [
444
+ f(g, {
459
445
  danger: "",
460
446
  "data-testid": "action-entity-delete",
461
447
  "has-divider": "",
462
- onClick: (N) => ce(m)
448
+ onClick: (te) => de(a)
463
449
  }, {
464
- default: f(() => [
465
- te(K(o(y)("keys.actions.delete")), 1)
450
+ default: u(() => [
451
+ le(j(o(y)("keys.actions.delete")), 1)
466
452
  ]),
467
453
  _: 2
468
454
  }, 1032, ["onClick"])
@@ -472,31 +458,31 @@ const ve = {
472
458
  ]),
473
459
  _: 1
474
460
  }, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "hide-toolbar", "query", "table-headers"]),
475
- u(o(Pe), {
476
- "action-pending": W.value,
461
+ f(o(Ue), {
462
+ "action-pending": O.value,
477
463
  description: o(y)("keys.delete.description"),
478
- "entity-name": F.value && (F.value.name || F.value.id),
479
- "entity-type": o(Ne).Key,
480
- error: H.value,
464
+ "entity-name": M.value && (M.value.name || M.value.id),
465
+ "entity-type": o(qe).Key,
466
+ error: z.value,
481
467
  "need-confirm": !1,
482
468
  title: o(y)("keys.delete.title"),
483
- visible: J.value,
484
- onCancel: ye,
485
- onProceed: X
469
+ visible: N.value,
470
+ onCancel: ce,
471
+ onProceed: G
486
472
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
487
473
  ]);
488
474
  };
489
475
  }
490
- }), je = (s, P) => {
491
- const _ = s.__vccOpts || s;
492
- for (const [l, y] of P)
493
- _[l] = y;
494
- return _;
495
- }, mt = /* @__PURE__ */ je(et, [["__scopeId", "data-v-a99a46e1"]]), tt = { class: "kong-ui-entities-keys-form" }, lt = { "data-testid": "no-search-results" }, it = { class: "select-item-container" }, ot = { class: "select-item-label" }, st = { class: "select-item-description" }, at = {
476
+ }), Ce = (s, U) => {
477
+ const h = s.__vccOpts || s;
478
+ for (const [l, y] of U)
479
+ h[l] = y;
480
+ return h;
481
+ }, ut = /* @__PURE__ */ Ce(Xe, [["__scopeId", "data-v-22a4f9c4"]]), Ye = { class: "kong-ui-entities-keys-form" }, Ze = { "data-testid": "no-search-results" }, et = { class: "select-item-container" }, tt = { class: "select-item-label" }, lt = { class: "select-item-description" }, it = {
496
482
  key: 0,
497
483
  class: "invalid-key-set-message",
498
484
  "data-testid": "invalid-key-set-message"
499
- }, nt = { "data-testid": "key-format-container" }, rt = /* @__PURE__ */ me({
485
+ }, ot = { "data-testid": "key-format-container" }, st = /* @__PURE__ */ ue({
500
486
  __name: "KeyForm",
501
487
  props: {
502
488
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -525,9 +511,9 @@ const ve = {
525
511
  }
526
512
  },
527
513
  emits: ["update", "error", "loading"],
528
- setup(s, { emit: P }) {
529
- var ee;
530
- const _ = P, l = s, y = Ce(), { i18n: { t: r } } = ve.useI18n(), { getMessageFromError: j } = Oe(), { axiosInstance: R } = ge((ee = l.config) == null ? void 0 : ee.axiosRequestConfig), L = I(() => l.keySetId ? q.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi, l.keySetId) : q.form[l.config.app].edit.all), $ = I(() => l.keyId ? ae.Edit : ae.Create), t = he({
514
+ setup(s, { emit: U }) {
515
+ var Y;
516
+ const h = U, l = s, y = Ie(), { i18n: { t: d } } = pe.useI18n(), { getMessageFromError: C } = Pe(), { axiosInstance: x } = ke((Y = l.config) == null ? void 0 : Y.axiosRequestConfig), J = _(() => l.keySetId ? B.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi, l.keySetId) : B.form[l.config.app].edit.all), K = _(() => l.keyId ? se.Edit : se.Create), t = me({
531
517
  fields: {
532
518
  name: "",
533
519
  tags: "",
@@ -540,7 +526,7 @@ const ve = {
540
526
  },
541
527
  isReadonly: !1,
542
528
  errorMessage: ""
543
- }), w = he({
529
+ }), I = me({
544
530
  name: "",
545
531
  tags: "",
546
532
  key_id: "",
@@ -549,250 +535,250 @@ const ve = {
549
535
  jwk: "",
550
536
  private_key: "",
551
537
  public_key: ""
552
- }), x = [
538
+ }), E = [
553
539
  {
554
- label: r("keys.form.fields.key_format.options.jwk"),
540
+ label: d("keys.form.fields.key_format.options.jwk"),
555
541
  value: "jwk"
556
542
  },
557
543
  {
558
- label: r("keys.form.fields.key_format.options.pem"),
544
+ label: d("keys.form.fields.key_format.options.pem"),
559
545
  value: "pem"
560
546
  }
561
- ], T = I(() => t.isReadonly || $.value === ae.Create && !!l.fixedKeySetId), Q = I(() => !T.value);
562
- le(() => l.fixedKeySetId, (e) => {
563
- $.value === ae.Create && (t.fields.key_set = e);
547
+ ], V = _(() => t.isReadonly || K.value === se.Create && !!l.fixedKeySetId), W = _(() => !V.value);
548
+ Z(() => l.fixedKeySetId, (e) => {
549
+ K.value === se.Create && (t.fields.key_set = e);
564
550
  }, { immediate: !0 });
565
- const z = I(() => JSON.stringify(t.fields) !== JSON.stringify(w) && !!t.fields.key_id && !!t.fields.key_format && (t.fields.key_format === "jwk" && !!t.fields.jwk || t.fields.key_format === "pem" && !!t.fields.private_key && !!t.fields.public_key)), G = (e) => {
566
- var i, d, k, S;
567
- t.fields.key_id = (e == null ? void 0 : e.kid) || "", t.fields.name = (e == null ? void 0 : e.name) || "", t.fields.tags = ((i = e == null ? void 0 : e.tags) == null ? void 0 : i.join(", ")) || "", t.fields.key_set = ((d = e == null ? void 0 : e.set) == null ? void 0 : d.id) || "", t.fields.key_format = e != null && e.pem ? "pem" : "jwk", t.fields.jwk = (e == null ? void 0 : e.jwk) || "", t.fields.private_key = ((k = e == null ? void 0 : e.pem) == null ? void 0 : k.private_key) || "", t.fields.public_key = ((S = e == null ? void 0 : e.pem) == null ? void 0 : S.public_key) || "", Object.assign(w, t.fields);
568
- }, O = () => {
551
+ const L = _(() => JSON.stringify(t.fields) !== JSON.stringify(I) && !!t.fields.key_id && !!t.fields.key_format && (t.fields.key_format === "jwk" && !!t.fields.jwk || t.fields.key_format === "pem" && !!t.fields.private_key && !!t.fields.public_key)), Q = (e) => {
552
+ var i, c, k, g;
553
+ t.fields.key_id = (e == null ? void 0 : e.kid) || "", t.fields.name = (e == null ? void 0 : e.name) || "", t.fields.tags = ((i = e == null ? void 0 : e.tags) == null ? void 0 : i.join(", ")) || "", t.fields.key_set = ((c = e == null ? void 0 : e.set) == null ? void 0 : c.id) || "", t.fields.key_format = e != null && e.pem ? "pem" : "jwk", t.fields.jwk = (e == null ? void 0 : e.jwk) || "", t.fields.private_key = ((k = e == null ? void 0 : e.pem) == null ? void 0 : k.private_key) || "", t.fields.public_key = ((g = e == null ? void 0 : e.pem) == null ? void 0 : g.public_key) || "", Object.assign(I, t.fields);
554
+ }, P = () => {
569
555
  y.push(l.config.cancelRoute);
570
- }, a = I(() => {
571
- var i, d;
572
- let e = `${l.config.apiBaseUrl}${q.form[l.config.app][$.value][l.keySetId ? "forKeySet" : "all"]}`;
573
- return l.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((i = l.config) == null ? void 0 : i.controlPlaneId) || "") : l.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (d = l.config) != null && d.workspace ? `/${l.config.workspace}` : "")), e = e.replace(/{id}/gi, l.keyId).replace(/{keySetId}/gi, l.keySetId || ""), e;
574
- }), g = I(() => {
575
- var e, i, d;
556
+ }, n = _(() => {
557
+ var i, c;
558
+ let e = `${l.config.apiBaseUrl}${B.form[l.config.app][K.value][l.keySetId ? "forKeySet" : "all"]}`;
559
+ return l.config.app === "konnect" ? e = e.replace(/{controlPlaneId}/gi, ((i = l.config) == null ? void 0 : i.controlPlaneId) || "") : l.config.app === "kongManager" && (e = e.replace(/\/{workspace}/gi, (c = l.config) != null && c.workspace ? `/${l.config.workspace}` : "")), e = e.replace(/{id}/gi, l.keyId).replace(/{keySetId}/gi, l.keySetId || ""), e;
560
+ }), m = _(() => {
561
+ var e, i, c;
576
562
  return {
577
563
  kid: t.fields.key_id,
578
564
  name: t.fields.name || null,
579
- tags: ((d = (i = (e = t.fields.tags) == null ? void 0 : e.split(",")) == null ? void 0 : i.map((k) => String(k || "").trim())) == null ? void 0 : d.filter((k) => k !== "")) || [],
565
+ tags: ((c = (i = (e = t.fields.tags) == null ? void 0 : e.split(",")) == null ? void 0 : i.map((k) => String(k || "").trim())) == null ? void 0 : c.filter((k) => k !== "")) || [],
580
566
  set: t.fields.key_set ? { id: t.fields.key_set } : null,
581
567
  jwk: t.fields.key_format === "jwk" ? t.fields.jwk : null,
582
568
  pem: t.fields.key_format === "pem" ? { private_key: t.fields.private_key, public_key: t.fields.public_key } : null
583
569
  };
584
- }), E = async () => {
585
- var e, i, d, k, S;
570
+ }), $ = async () => {
571
+ var e, i, c, k, g;
586
572
  try {
587
573
  t.isReadonly = !0;
588
- let n;
589
- if ($.value === "create" ? n = await R.post(a.value, g.value) : $.value === "edit" && (n = ((e = l.config) == null ? void 0 : e.app) === "konnect" ? await R.put(a.value, g.value) : await R.patch(a.value, g.value)), n) {
590
- const { data: c } = n;
591
- t.fields.key_id = (c == null ? void 0 : c.kid) || "", t.fields.name = (c == null ? void 0 : c.name) || "", t.fields.tags = ((i = c == null ? void 0 : c.tags) == null ? void 0 : i.join(", ")) || "", t.fields.key_set = ((d = c == null ? void 0 : c.set) == null ? void 0 : d.id) || "", t.fields.key_format = c != null && c.pem ? "pem" : "jwk", t.fields.jwk = (c == null ? void 0 : c.jwk) || "", t.fields.private_key = ((k = c == null ? void 0 : c.pem) == null ? void 0 : k.private_key) || "", t.fields.public_key = ((S = c == null ? void 0 : c.pem) == null ? void 0 : S.public_key) || "", Object.assign(w, t.fields), _("update", n == null ? void 0 : n.data);
574
+ let r;
575
+ if (K.value === "create" ? r = await x.post(n.value, m.value) : K.value === "edit" && (r = ((e = l.config) == null ? void 0 : e.app) === "konnect" ? await x.put(n.value, m.value) : await x.patch(n.value, m.value)), r) {
576
+ const { data: a } = r;
577
+ t.fields.key_id = (a == null ? void 0 : a.kid) || "", t.fields.name = (a == null ? void 0 : a.name) || "", t.fields.tags = ((i = a == null ? void 0 : a.tags) == null ? void 0 : i.join(", ")) || "", t.fields.key_set = ((c = a == null ? void 0 : a.set) == null ? void 0 : c.id) || "", t.fields.key_format = a != null && a.pem ? "pem" : "jwk", t.fields.jwk = (a == null ? void 0 : a.jwk) || "", t.fields.private_key = ((k = a == null ? void 0 : a.pem) == null ? void 0 : k.private_key) || "", t.fields.public_key = ((g = a == null ? void 0 : a.pem) == null ? void 0 : g.public_key) || "", Object.assign(I, t.fields), h("update", r == null ? void 0 : r.data);
592
578
  }
593
- } catch (n) {
594
- t.errorMessage = j(n), _("error", n);
579
+ } catch (r) {
580
+ t.errorMessage = C(r), h("error", r);
595
581
  } finally {
596
582
  t.isReadonly = !1;
597
583
  }
598
584
  }, {
599
585
  debouncedQueryChange: v,
600
- loading: C,
586
+ loading: w,
601
587
  allRecords: p,
602
- error: ie,
603
- validationError: ne,
588
+ error: ee,
589
+ validationError: ae,
604
590
  loadItems: re,
605
- results: F
606
- } = Je(l.config, q.form[l.config.app].keySets, void 0, {
591
+ results: M
592
+ } = Ne(l.config, B.form[l.config.app].keySets, void 0, {
607
593
  fetchedItemsKey: "data",
608
594
  searchKeys: ["id", "name"]
609
- }), J = (e) => {
610
- (!e || e !== t.fields.key_set && e !== w.key_set) && v(e);
611
- }, W = I(() => ie.value ? r("keys.errors.key_sets.fetch") : ""), H = I(() => ne.value ? r("keys.errors.key_sets.invalid") : ""), de = h(0), ce = I(() => p.value === void 0), ye = I(() => {
612
- if (ce.value)
613
- return l.config.app === "konnect" ? r("keys.form.fields.key_set.footer") : void 0;
614
- }), X = h(/* @__PURE__ */ new Set()), Y = I(() => Array.from(X.value).map((i) => ({
595
+ }), N = (e) => {
596
+ (!e || e !== t.fields.key_set && e !== I.key_set) && v(e);
597
+ }, O = _(() => ee.value ? d("keys.errors.key_sets.fetch") : ""), z = _(() => ae.value ? d("keys.errors.key_sets.invalid") : ""), ne = b(0), de = _(() => p.value === void 0), ce = _(() => {
598
+ if (de.value)
599
+ return l.config.app === "konnect" ? d("keys.form.fields.key_set.footer") : void 0;
600
+ }), G = b(/* @__PURE__ */ new Set()), H = _(() => Array.from(G.value).map((i) => ({
615
601
  name: i.name || "",
616
602
  // can't use name for label or it tries to search => 404
617
603
  label: "",
618
604
  // leave it blank so no flicker when used with selected-item-template
619
605
  value: i.id,
620
606
  selected: t.fields.key_set === i.id
621
- }))), Z = (e) => {
622
- X.value.clear();
607
+ }))), X = (e) => {
608
+ G.value.clear();
623
609
  let i;
624
610
  for (i of e)
625
- X.value.add(i);
611
+ G.value.add(i);
626
612
  };
627
- return le(F, (e) => {
628
- Z(e);
629
- }, { immediate: !0, deep: !0 }), le(Y, () => {
630
- de.value++;
631
- }, { immediate: !0, deep: !0 }), we(async () => {
613
+ return Z(M, (e) => {
614
+ X(e);
615
+ }, { immediate: !0, deep: !0 }), Z(H, () => {
616
+ ne.value++;
617
+ }, { immediate: !0, deep: !0 }), Se(async () => {
632
618
  await re();
633
619
  }), (e, i) => {
634
- const d = M("KInput"), k = M("KSelect"), S = M("KTextArea");
635
- return b(), V("div", tt, [
636
- u(o(We), {
637
- "can-submit": z.value,
620
+ const c = T("KInput"), k = T("KSelect"), g = T("KTextArea");
621
+ return S(), q("div", Ye, [
622
+ f(o(Oe), {
623
+ "can-submit": L.value,
638
624
  config: s.config,
639
625
  "edit-id": s.keyId,
640
- "entity-type": o(Ke).Key,
641
- "error-message": t.errorMessage || W.value,
642
- "fetch-url": L.value,
643
- "form-fields": g.value,
626
+ "entity-type": o(we).Key,
627
+ "error-message": t.errorMessage || O.value,
628
+ "fetch-url": J.value,
629
+ "form-fields": m.value,
644
630
  "is-readonly": t.isReadonly,
645
- onCancel: O,
646
- "onFetch:error": i[8] || (i[8] = (n) => e.$emit("error", n)),
647
- "onFetch:success": G,
648
- onLoading: i[9] || (i[9] = (n) => e.$emit("loading", n)),
649
- onSubmit: E
631
+ onCancel: P,
632
+ "onFetch:error": i[8] || (i[8] = (r) => e.$emit("error", r)),
633
+ "onFetch:success": Q,
634
+ onLoading: i[9] || (i[9] = (r) => e.$emit("loading", r)),
635
+ onSubmit: $
650
636
  }, {
651
- default: f(() => [
652
- u(o(Se), {
653
- description: o(r)("keys.form.sections.general.description"),
654
- title: o(r)("keys.form.sections.general.title")
637
+ default: u(() => [
638
+ f(o(he), {
639
+ description: o(d)("keys.form.sections.general.description"),
640
+ title: o(d)("keys.form.sections.general.title")
655
641
  }, {
656
- default: f(() => [
657
- u(d, {
642
+ default: u(() => [
643
+ f(c, {
658
644
  modelValue: t.fields.key_id,
659
- "onUpdate:modelValue": i[0] || (i[0] = (n) => t.fields.key_id = n),
645
+ "onUpdate:modelValue": i[0] || (i[0] = (r) => t.fields.key_id = r),
660
646
  modelModifiers: { trim: !0 },
661
647
  autocomplete: "off",
662
648
  "data-testid": "key-form-id",
663
- help: o(r)("keys.form.fields.id.help"),
664
- label: o(r)("keys.form.fields.id.label"),
649
+ help: o(d)("keys.form.fields.id.help"),
650
+ label: o(d)("keys.form.fields.id.label"),
665
651
  "label-attributes": {
666
- info: o(r)("keys.form.fields.id.tooltip"),
652
+ info: o(d)("keys.form.fields.id.tooltip"),
667
653
  tooltipAttributes: { maxWidth: "400" }
668
654
  },
669
- placeholder: o(r)("keys.form.fields.id.placeholder"),
655
+ placeholder: o(d)("keys.form.fields.id.placeholder"),
670
656
  readonly: t.isReadonly,
671
657
  required: "",
672
658
  type: "text"
673
659
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"]),
674
- u(d, {
660
+ f(c, {
675
661
  modelValue: t.fields.name,
676
- "onUpdate:modelValue": i[1] || (i[1] = (n) => t.fields.name = n),
662
+ "onUpdate:modelValue": i[1] || (i[1] = (r) => t.fields.name = r),
677
663
  modelModifiers: { trim: !0 },
678
664
  autocomplete: "off",
679
665
  "data-testid": "key-form-name",
680
- label: o(r)("keys.form.fields.name.label"),
681
- placeholder: o(r)("keys.form.fields.name.placeholder"),
666
+ label: o(d)("keys.form.fields.name.label"),
667
+ placeholder: o(d)("keys.form.fields.name.placeholder"),
682
668
  readonly: t.isReadonly,
683
669
  type: "text"
684
670
  }, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
685
- u(k, {
671
+ f(k, {
686
672
  modelValue: t.fields.key_set,
687
- "onUpdate:modelValue": i[2] || (i[2] = (n) => t.fields.key_set = n),
688
- clearable: Q.value,
673
+ "onUpdate:modelValue": i[2] || (i[2] = (r) => t.fields.key_set = r),
674
+ clearable: W.value,
689
675
  "data-testid": "key-form-key-set",
690
- "dropdown-footer-text": ye.value,
676
+ "dropdown-footer-text": ce.value,
691
677
  "enable-filtering": "",
692
678
  "filter-function": () => !0,
693
- items: Y.value,
694
- label: o(r)("keys.form.fields.key_set.label"),
695
- loading: o(C),
696
- placeholder: o(r)("keys.form.fields.key_set.placeholder"),
697
- readonly: T.value,
679
+ items: H.value,
680
+ label: o(d)("keys.form.fields.key_set.label"),
681
+ loading: o(w),
682
+ placeholder: o(d)("keys.form.fields.key_set.placeholder"),
683
+ readonly: V.value,
698
684
  width: "100%",
699
- onQueryChange: J
685
+ onQueryChange: N
700
686
  }, {
701
- loading: f(() => [
702
- U("div", null, K(o(r)("keys.actions.loading")), 1)
687
+ loading: u(() => [
688
+ F("div", null, j(o(d)("keys.actions.loading")), 1)
703
689
  ]),
704
- empty: f(() => [
705
- U("div", lt, K(o(r)("keys.search.no_results")), 1)
690
+ empty: u(() => [
691
+ F("div", Ze, j(o(d)("keys.search.no_results")), 1)
706
692
  ]),
707
- "selected-item-template": f(({ item: n }) => [
708
- U("div", null, K(n.name), 1)
693
+ "selected-item-template": u(({ item: r }) => [
694
+ F("div", null, j(r.name), 1)
709
695
  ]),
710
- "item-template": f(({ item: n }) => [
711
- U("div", it, [
712
- U("div", ot, K(n.name), 1),
713
- U("div", st, K(n.value), 1)
696
+ "item-template": u(({ item: r }) => [
697
+ F("div", et, [
698
+ F("div", tt, j(r.name), 1),
699
+ F("div", lt, j(r.value), 1)
714
700
  ])
715
701
  ]),
716
702
  _: 1
717
703
  }, 8, ["modelValue", "clearable", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"]),
718
- H.value ? (b(), V("p", at, K(H.value), 1)) : oe("", !0),
719
- u(d, {
704
+ z.value ? (S(), q("p", it, j(z.value), 1)) : ie("", !0),
705
+ f(c, {
720
706
  modelValue: t.fields.tags,
721
- "onUpdate:modelValue": i[3] || (i[3] = (n) => t.fields.tags = n),
707
+ "onUpdate:modelValue": i[3] || (i[3] = (r) => t.fields.tags = r),
722
708
  modelModifiers: { trim: !0 },
723
709
  autocomplete: "off",
724
710
  "data-testid": "key-form-tags",
725
- help: o(r)("keys.form.fields.tags.help"),
726
- label: o(r)("keys.form.fields.tags.label"),
711
+ help: o(d)("keys.form.fields.tags.help"),
712
+ label: o(d)("keys.form.fields.tags.label"),
727
713
  "label-attributes": {
728
- info: o(r)("keys.form.fields.tags.tooltip"),
714
+ info: o(d)("keys.form.fields.tags.tooltip"),
729
715
  tooltipAttributes: { maxWidth: "400" }
730
716
  },
731
- placeholder: o(r)("keys.form.fields.tags.placeholder"),
717
+ placeholder: o(d)("keys.form.fields.tags.placeholder"),
732
718
  readonly: t.isReadonly,
733
719
  type: "text"
734
720
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
735
721
  ]),
736
722
  _: 1
737
723
  }, 8, ["description", "title"]),
738
- u(o(Se), {
739
- description: o(r)("keys.form.sections.keys.description"),
724
+ f(o(he), {
725
+ description: o(d)("keys.form.sections.keys.description"),
740
726
  "has-divider": "",
741
- title: o(r)("keys.form.sections.keys.title")
727
+ title: o(d)("keys.form.sections.keys.title")
742
728
  }, {
743
- default: f(() => [
744
- U("div", nt, [
745
- u(k, {
729
+ default: u(() => [
730
+ F("div", ot, [
731
+ f(k, {
746
732
  modelValue: t.fields.key_format,
747
- "onUpdate:modelValue": i[4] || (i[4] = (n) => t.fields.key_format = n),
733
+ "onUpdate:modelValue": i[4] || (i[4] = (r) => t.fields.key_format = r),
748
734
  "data-testid": "key-form-key-format",
749
- items: x,
750
- label: o(r)("keys.form.fields.key_format.label"),
735
+ items: E,
736
+ label: o(d)("keys.form.fields.key_format.label"),
751
737
  readonly: t.isReadonly,
752
738
  required: "",
753
739
  width: "100%"
754
740
  }, null, 8, ["modelValue", "label", "readonly"])
755
741
  ]),
756
- t.fields.key_format === "jwk" ? (b(), D(S, {
742
+ t.fields.key_format === "jwk" ? (S(), A(g, {
757
743
  key: 0,
758
744
  modelValue: t.fields.jwk,
759
- "onUpdate:modelValue": i[5] || (i[5] = (n) => t.fields.jwk = n),
745
+ "onUpdate:modelValue": i[5] || (i[5] = (r) => t.fields.jwk = r),
760
746
  modelModifiers: { trim: !0 },
761
747
  class: "key-form-textarea",
762
748
  "data-testid": "key-form-jwk",
763
- label: o(r)("keys.form.fields.jwk.label"),
749
+ label: o(d)("keys.form.fields.jwk.label"),
764
750
  "label-attributes": {
765
- info: o(r)("keys.form.fields.jwk.tooltip"),
751
+ info: o(d)("keys.form.fields.jwk.tooltip"),
766
752
  tooltipAttributes: { maxWidth: "400" }
767
753
  },
768
- placeholder: o(r)("keys.form.fields.jwk.placeholder"),
754
+ placeholder: o(d)("keys.form.fields.jwk.placeholder"),
769
755
  readonly: t.isReadonly,
770
756
  required: ""
771
- }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : oe("", !0),
772
- t.fields.key_format === "pem" ? (b(), D(S, {
757
+ }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : ie("", !0),
758
+ t.fields.key_format === "pem" ? (S(), A(g, {
773
759
  key: 1,
774
760
  modelValue: t.fields.private_key,
775
- "onUpdate:modelValue": i[6] || (i[6] = (n) => t.fields.private_key = n),
761
+ "onUpdate:modelValue": i[6] || (i[6] = (r) => t.fields.private_key = r),
776
762
  modelModifiers: { trim: !0 },
777
763
  class: "key-form-textarea",
778
764
  "data-testid": "key-form-private-key",
779
- label: o(r)("keys.form.fields.private_key.label"),
780
- placeholder: o(r)("keys.form.fields.private_key.placeholder"),
765
+ label: o(d)("keys.form.fields.private_key.label"),
766
+ placeholder: o(d)("keys.form.fields.private_key.placeholder"),
781
767
  readonly: t.isReadonly,
782
768
  required: ""
783
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : oe("", !0),
784
- t.fields.key_format === "pem" ? (b(), D(S, {
769
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : ie("", !0),
770
+ t.fields.key_format === "pem" ? (S(), A(g, {
785
771
  key: 2,
786
772
  modelValue: t.fields.public_key,
787
- "onUpdate:modelValue": i[7] || (i[7] = (n) => t.fields.public_key = n),
773
+ "onUpdate:modelValue": i[7] || (i[7] = (r) => t.fields.public_key = r),
788
774
  modelModifiers: { trim: !0 },
789
775
  class: "key-form-textarea",
790
776
  "data-testid": "key-form-public-key",
791
- label: o(r)("keys.form.fields.public_key.label"),
792
- placeholder: o(r)("keys.form.fields.public_key.placeholder"),
777
+ label: o(d)("keys.form.fields.public_key.label"),
778
+ placeholder: o(d)("keys.form.fields.public_key.placeholder"),
793
779
  readonly: t.isReadonly,
794
780
  required: ""
795
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : oe("", !0)
781
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : ie("", !0)
796
782
  ]),
797
783
  _: 1
798
784
  }, 8, ["description", "title"])
@@ -802,7 +788,7 @@ const ve = {
802
788
  ]);
803
789
  };
804
790
  }
805
- }), gt = /* @__PURE__ */ je(rt, [["__scopeId", "data-v-9d0b1ebc"]]), dt = { class: "kong-ui-entities-keys-entity-config-card" }, ct = { key: 2 }, vt = /* @__PURE__ */ me({
791
+ }), kt = /* @__PURE__ */ Ce(st, [["__scopeId", "data-v-9d0b1ebc"]]), at = { class: "kong-ui-entities-keys-entity-config-card" }, rt = { key: 2 }, pt = /* @__PURE__ */ ue({
806
792
  __name: "KeyConfigCard",
807
793
  props: {
808
794
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -835,142 +821,142 @@ const ve = {
835
821
  }
836
822
  },
837
823
  emits: ["loading", "fetch:error", "fetch:success", "navigation-click"],
838
- setup(s, { emit: P }) {
839
- var O;
840
- const _ = P, l = s, { axiosInstance: y } = ge((O = l.config) == null ? void 0 : O.axiosRequestConfig), { convertKeyToTitle: r } = Le(), { i18n: { t: j } } = ve.useI18n(), R = I(() => l.keySetId ? `${q.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, l.keySetId) : q.form[l.config.app].edit.all), L = I(() => {
841
- var a;
842
- return (a = q.form[l.config.app]) == null ? void 0 : a.getKeySet;
843
- }), $ = h(), t = h({}), w = h(l.keySetId || ""), x = h(""), T = h(!1), Q = async (a) => {
844
- var g;
845
- $.value = a, w.value = (g = a == null ? void 0 : a.set) == null ? void 0 : g.id, _("fetch:success", a), z(a);
824
+ setup(s, { emit: U }) {
825
+ var P;
826
+ const h = U, l = s, { axiosInstance: y } = ke((P = l.config) == null ? void 0 : P.axiosRequestConfig), { convertKeyToTitle: d } = Je(), { i18n: { t: C } } = pe.useI18n(), x = _(() => l.keySetId ? `${B.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, l.keySetId) : B.form[l.config.app].edit.all), J = _(() => {
827
+ var n;
828
+ return (n = B.form[l.config.app]) == null ? void 0 : n.getKeySet;
829
+ }), K = b(), t = b({}), I = b(l.keySetId || ""), E = b(""), V = b(!1), W = async (n) => {
830
+ var m;
831
+ K.value = n, I.value = (m = n == null ? void 0 : n.set) == null ? void 0 : m.id, h("fetch:success", n), L(n);
846
832
  };
847
- le(w, async () => {
848
- var g, E;
849
- if (!w.value)
833
+ Z(I, async () => {
834
+ var m, $;
835
+ if (!I.value)
850
836
  return;
851
- let a = `${l.config.apiBaseUrl}${L.value}`;
852
- l.config.app === "konnect" ? a = a.replace(/{controlPlaneId}/gi, ((g = l.config) == null ? void 0 : g.controlPlaneId) || "").replace(/{keySetId}/gi, w.value || "") : l.config.app === "kongManager" && (a = a.replace(/\/{workspace}/gi, (E = l.config) != null && E.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, w.value || ""));
837
+ let n = `${l.config.apiBaseUrl}${J.value}`;
838
+ l.config.app === "konnect" ? n = n.replace(/{controlPlaneId}/gi, ((m = l.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{keySetId}/gi, I.value || "") : l.config.app === "kongManager" && (n = n.replace(/\/{workspace}/gi, ($ = l.config) != null && $.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, I.value || ""));
853
839
  try {
854
- T.value = !0;
855
- const { data: v } = await y.get(a, {
856
- validateStatus: (C) => C === 404 || C >= 200 && C < 300
840
+ V.value = !0;
841
+ const { data: v } = await y.get(n, {
842
+ validateStatus: (w) => w === 404 || w >= 200 && w < 300
857
843
  // in case KeySet is deleted
858
844
  });
859
- x.value = (v == null ? void 0 : v.name) || (v == null ? void 0 : v.id);
845
+ E.value = (v == null ? void 0 : v.name) || (v == null ? void 0 : v.id);
860
846
  } catch (v) {
861
- _("fetch:error", v);
847
+ h("fetch:error", v);
862
848
  } finally {
863
- T.value = !1;
849
+ V.value = !1;
864
850
  }
865
851
  }, { immediate: !0 });
866
- const z = (a) => {
867
- var g, E;
852
+ const L = (n) => {
853
+ var m, $;
868
854
  try {
869
- if (a.jwk) {
870
- const v = JSON.parse(a.jwk);
871
- Object.keys(v).forEach((C) => {
855
+ if (n.jwk) {
856
+ const v = JSON.parse(n.jwk);
857
+ Object.keys(v).forEach((w) => {
872
858
  t.value = {
873
859
  ...t.value,
874
- [`jwk.${C}`]: v[C]
860
+ [`jwk.${w}`]: v[w]
875
861
  };
876
862
  });
877
863
  } else
878
864
  t.value = {
879
- "pem.public_key": (g = a == null ? void 0 : a.pem) == null ? void 0 : g.public_key,
880
- "pem.private_key": (E = a == null ? void 0 : a.pem) == null ? void 0 : E.private_key
865
+ "pem.public_key": (m = n == null ? void 0 : n.pem) == null ? void 0 : m.public_key,
866
+ "pem.private_key": ($ = n == null ? void 0 : n.pem) == null ? void 0 : $.private_key
881
867
  };
882
868
  } catch (v) {
883
- _("fetch:error", v);
869
+ h("fetch:error", v);
884
870
  }
885
871
  return t;
886
- }, G = h({
872
+ }, Q = b({
887
873
  id: {},
888
874
  name: {
889
- tooltip: j("keys.form.fields.name.tooltip")
875
+ tooltip: C("keys.form.fields.name.tooltip")
890
876
  },
891
877
  last_updated: {},
892
878
  created: {},
893
879
  set: {
894
- label: j("keys.form.fields.set.label"),
895
- section: fe.Basic,
896
- tooltip: j("keys.form.fields.set.tooltip"),
880
+ label: C("keys.form.fields.set.label"),
881
+ section: ye.Basic,
882
+ tooltip: C("keys.form.fields.set.tooltip"),
897
883
  order: 5
898
884
  },
899
885
  kid: {
900
- label: j("keys.form.fields.kid.label"),
901
- section: fe.Basic,
902
- tooltip: j("keys.form.fields.kid.tooltip")
886
+ label: C("keys.form.fields.kid.label"),
887
+ section: ye.Basic,
888
+ tooltip: C("keys.form.fields.kid.tooltip")
903
889
  },
904
890
  tags: {
905
- tooltip: j("keys.form.fields.tags.tooltip")
891
+ tooltip: C("keys.form.fields.tags.tooltip")
906
892
  },
907
893
  // advanced fields
908
894
  jwk: {
909
- label: j("keys.form.fields.jwk.label"),
910
- type: ue.Json
895
+ label: C("keys.form.fields.jwk.label"),
896
+ type: fe.Json
911
897
  },
912
898
  pem: {
913
- section: fe.Advanced,
914
- label: j("keys.form.fields.key_format.options.pem"),
915
- type: ue.Json
899
+ section: ye.Advanced,
900
+ label: C("keys.form.fields.key_format.options.pem"),
901
+ type: fe.Json
916
902
  }
917
903
  });
918
- return (a, g) => {
919
- var v, C;
920
- const E = M("KSkeleton");
921
- return b(), V("div", dt, [
922
- u(o(Qe), {
904
+ return (n, m) => {
905
+ var v, w;
906
+ const $ = T("KSkeleton");
907
+ return S(), q("div", at, [
908
+ f(o(We), {
923
909
  config: s.config,
924
910
  "config-card-doc": s.configCardDoc,
925
- "config-schema": G.value,
926
- "entity-type": o(Ke).Key,
927
- "fetch-url": R.value,
911
+ "config-schema": Q.value,
912
+ "entity-type": o(we).Key,
913
+ "fetch-url": x.value,
928
914
  "hide-title": s.hideTitle,
929
- "onFetch:error": g[0] || (g[0] = (p) => a.$emit("fetch:error", p)),
930
- "onFetch:success": Q,
931
- onLoading: g[1] || (g[1] = (p) => a.$emit("loading", p))
932
- }, Re({
933
- set: f(({ row: p }) => [
934
- T.value ? (b(), D(E, {
915
+ "onFetch:error": m[0] || (m[0] = (p) => n.$emit("fetch:error", p)),
916
+ "onFetch:success": W,
917
+ onLoading: m[1] || (m[1] = (p) => n.$emit("loading", p))
918
+ }, xe({
919
+ set: u(({ row: p }) => [
920
+ V.value ? (S(), A($, {
935
921
  key: 0,
936
922
  "data-testid": "key-set-name-loader",
937
923
  type: "spinner"
938
- })) : p.value && p.value.id === w.value && x.value ? (b(), D(o(ze), {
924
+ })) : p.value && p.value.id === I.value && E.value ? (S(), A(o(Le), {
939
925
  key: 1,
940
926
  item: {
941
927
  key: p.value.id,
942
- value: x.value,
943
- type: o(ue).LinkInternal
928
+ value: E.value,
929
+ type: o(fe).LinkInternal
944
930
  },
945
- onClick: (ie) => a.$emit("navigation-click", p.value.id, "key-sets")
946
- }, null, 8, ["item", "onClick"])) : (b(), V("div", ct, K("–")))
931
+ onClick: (ee) => n.$emit("navigation-click", p.value.id, "key-sets")
932
+ }, null, 8, ["item", "onClick"])) : (S(), q("div", rt, j("–")))
947
933
  ]),
948
934
  _: 2
949
935
  }, [
950
- (v = $.value) != null && v.jwk ? {
936
+ (v = K.value) != null && v.jwk ? {
951
937
  name: "jwk",
952
- fn: f(() => [
953
- (b(!0), V(ke, null, pe(Object.keys(t.value), (p) => (b(), D(o(Ie), {
938
+ fn: u(() => [
939
+ (S(!0), q(ge, null, ve(Object.keys(t.value), (p) => (S(), A(o(_e), {
954
940
  key: p,
955
941
  "data-testid": `${p}`,
956
942
  item: {
957
943
  key: p,
958
- label: o(r)(p),
944
+ label: o(d)(p),
959
945
  value: t.value[p]
960
946
  }
961
947
  }, null, 8, ["data-testid", "item"]))), 128))
962
948
  ]),
963
949
  key: "0"
964
950
  } : void 0,
965
- (C = $.value) != null && C.pem ? {
951
+ (w = K.value) != null && w.pem ? {
966
952
  name: "pem",
967
- fn: f(() => [
968
- (b(!0), V(ke, null, pe(Object.keys(t.value), (p) => (b(), D(o(Ie), {
953
+ fn: u(() => [
954
+ (S(!0), q(ge, null, ve(Object.keys(t.value), (p) => (S(), A(o(_e), {
969
955
  key: p,
970
956
  "data-testid": `${p}`,
971
957
  item: {
972
958
  key: p,
973
- label: o(r)(p),
959
+ label: o(d)(p),
974
960
  value: t.value[p]
975
961
  }
976
962
  }, null, 8, ["data-testid", "item"]))), 128))
@@ -983,7 +969,7 @@ const ve = {
983
969
  }
984
970
  });
985
971
  export {
986
- vt as KeyConfigCard,
987
- gt as KeyForm,
988
- mt as KeyList
972
+ pt as KeyConfigCard,
973
+ kt as KeyForm,
974
+ ut as KeyList
989
975
  };