@kong-ui-public/entities-keys 3.9.8 → 3.9.10

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,8 +1,8 @@
1
- import { defineComponent as me, ref as w, computed as h, watch as ee, onBeforeMount as Ce, resolveComponent as B, createElementBlock as N, openBlock as S, createVNode as u, unref as l, createSlots as pe, withCtx as k, createTextVNode as Y, toDisplayString as x, createElementVNode as M, createBlock as R, Teleport as Ee, createCommentVNode as Q, reactive as be, Fragment as _e, renderList as Se } from "vue";
2
- import { useRouter as xe } from "vue-router";
3
- import { BookIcon as Ve, AddIcon as Me, KeyIcon as Re } from "@kong/icons";
4
- import { createI18n as De, i18nTComponent as Te } from "@kong-ui-public/i18n";
5
- import { useAxios as ge, useTableState as Fe, useFetcher as Ae, useDeleteUrlBuilder as Ue, FetcherStatus as Be, EntityBaseTable as Oe, PermissionsWrapper as ae, TableTags as Pe, EntityFilter as qe, EntityEmptyState as Ne, EntityDeleteModal as Je, EntityTypes as We, useErrors as Le, EntityBaseFormType as se, useDebouncedFilter as He, EntityBaseForm as Qe, SupportedEntityType as Ke, EntityFormSection as Ie, useStringHelpers as ze, ConfigurationSchemaType as ue, ConfigurationSchemaSection as ke, EntityBaseConfigCard as Ge, InternalLinkItem as Xe, ConfigCardItem as we } from "@kong-ui-public/entities-shared";
1
+ import { defineComponent as ve, ref as w, computed as h, watch as le, onBeforeMount as je, resolveComponent as F, createElementBlock as W, openBlock as b, createVNode as f, unref as l, createSlots as ge, withCtx as u, createTextVNode as O, toDisplayString as C, createElementVNode as D, createBlock as V, Teleport as De, createCommentVNode as J, reactive as Se, Fragment as we, renderList as Ie } from "vue";
2
+ import { useRouter as Ee } from "vue-router";
3
+ import { BookIcon as Ce, AddIcon as Ke, KeyIcon as Fe } from "@kong/icons";
4
+ import { createI18n as Te, i18nTComponent as Be } from "@kong-ui-public/i18n";
5
+ import { useAxios as he, useTableState as Ae, useFetcher as Ue, useDeleteUrlBuilder as Pe, FetcherStatus as qe, EntityBaseTable as Ne, PermissionsWrapper as ne, TableTags as Oe, EntityFilter as Je, EntityDeleteModal as We, EntityTypes as Le, useErrors as He, EntityBaseFormType as re, useDebouncedFilter as Qe, EntityBaseForm as Ge, SupportedEntityType as Ve, EntityFormSection as xe, useStringHelpers as ze, ConfigurationSchemaType as pe, ConfigurationSchemaSection as me, EntityBaseConfigCard as Xe, InternalLinkItem as Ye, ConfigCardItem as $e } from "@kong-ui-public/entities-shared";
6
6
  const Ze = {
7
7
  title: "Keys",
8
8
  list: {
@@ -23,7 +23,8 @@ const Ze = {
23
23
  title: "Configure your first key",
24
24
  group: "Keys created in gateways within this group will automatically appear here.",
25
25
  description: "Keys hold a representation of asymmetric keys that gateways and plugins can use for secure operations.",
26
- create_cta: "New key"
26
+ create_cta: "New key",
27
+ learn_more: "Learn more"
27
28
  }
28
29
  },
29
30
  actions: {
@@ -127,20 +128,20 @@ const Ze = {
127
128
  }
128
129
  }
129
130
  }
130
- }, Ye = {
131
+ }, et = {
131
132
  keys: Ze
132
133
  };
133
- function et() {
134
- const i = De("en-us", Ye);
134
+ function tt() {
135
+ const a = Te("en-us", et);
135
136
  return {
136
- i18n: i,
137
- i18nT: Te(i)
137
+ i18n: a,
138
+ i18nT: Be(a)
138
139
  // Translation component <i18n-t>
139
140
  };
140
141
  }
141
- const ve = {
142
- useI18n: et
143
- }, A = "/v2/control-planes/{controlPlaneId}/core-entities", U = "/{workspace}", O = {
142
+ const be = {
143
+ useI18n: tt
144
+ }, A = "/v2/control-planes/{controlPlaneId}/core-entities", U = "/{workspace}", P = {
144
145
  list: {
145
146
  konnect: {
146
147
  all: `${A}/keys`,
@@ -177,14 +178,14 @@ const ve = {
177
178
  getKeySet: `${U}/key-sets/{keySetId}`
178
179
  }
179
180
  }
180
- }, tt = "#00abd2", lt = "24px", it = { class: "kong-ui-entities-keys-list" }, ot = { class: "button-row" }, at = { class: "empty-state-icon-gateway" }, st = /* @__PURE__ */ me({
181
+ }, lt = { class: "kong-ui-entities-keys-list" }, it = { class: "button-row" }, at = /* @__PURE__ */ ve({
181
182
  __name: "KeyList",
182
183
  props: {
183
184
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
184
185
  config: {
185
186
  type: Object,
186
187
  required: !0,
187
- validator: (i) => !(!i || !["konnect", "kongManager"].includes(i == null ? void 0 : i.app) || !i.createRoute || !i.getViewRoute || !i.getEditRoute || i.app === "kongManager" && !i.isExactMatch && !i.filterSchema)
188
+ validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || !a.createRoute || !a.getViewRoute || !a.getEditRoute || a.app === "kongManager" && !a.isExactMatch && !a.filterSchema)
188
189
  },
189
190
  // used to override the default identifier for the cache entry
190
191
  cacheIdentifier: {
@@ -222,176 +223,176 @@ const ve = {
222
223
  }
223
224
  },
224
225
  emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success"],
225
- setup(i, { emit: P }) {
226
- var b;
227
- const _ = P, t = i, { i18n: { t: f } } = ve.useI18n(), r = xe(), { axiosInstance: K } = ge((b = t.config) == null ? void 0 : b.axiosRequestConfig), { hasRecords: q, handleStateChange: z } = Fe(() => E.value), $ = h(() => q.value && t.config.app === "konnect"), e = h(() => !!t.config.keySetId), C = h(() => t.config.app !== "kongManager" || !!t.config.disableSorting), D = {
226
+ setup(a, { emit: q }) {
227
+ var I;
228
+ const _ = q, t = a, { i18n: { t: c } } = be.useI18n(), d = Ee(), { axiosInstance: x } = he((I = t.config) == null ? void 0 : I.axiosRequestConfig), { hasRecords: N, handleStateChange: z } = Ae(() => M.value), $ = h(() => N.value && t.config.app === "konnect"), e = h(() => !!t.config.keySetId), K = h(() => t.config.app !== "kongManager" || !!t.config.disableSorting), T = {
228
229
  // the Name column is non-hidable
229
- name: { label: f("keys.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
230
- kid: { label: f("keys.list.table_headers.key_id"), sortable: !0 },
231
- tags: { label: f("keys.list.table_headers.tags") },
232
- id: { label: f("keys.list.table_headers.id"), sortable: !0 }
233
- }, T = D, J = h(() => {
234
- var c, s, d, F;
235
- let a = `${t.config.apiBaseUrl}${O.list[t.config.app][t.config.keySetId ? "forKeySet" : "all"]}`;
236
- return t.config.app === "konnect" ? a = a.replace(/{controlPlaneId}/gi, ((c = t.config) == null ? void 0 : c.controlPlaneId) || "").replace(/{keySetId}/gi, ((s = t.config) == null ? void 0 : s.keySetId) || "") : t.config.app === "kongManager" && (a = a.replace(/\/{workspace}/gi, (d = t.config) != null && d.workspace ? `/${t.config.workspace}` : "").replace(/{keySetId}/gi, ((F = t.config) == null ? void 0 : F.keySetId) || "")), a;
237
- }), E = w(""), G = h(() => {
238
- const a = t.config.app === "konnect" || t.config.isExactMatch;
239
- if (a)
230
+ name: { label: c("keys.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
231
+ kid: { label: c("keys.list.table_headers.key_id"), sortable: !0 },
232
+ tags: { label: c("keys.list.table_headers.tags") },
233
+ id: { label: c("keys.list.table_headers.id"), sortable: !0 }
234
+ }, B = T, L = h(() => {
235
+ var i, n, E, Z;
236
+ let s = `${t.config.apiBaseUrl}${P.list[t.config.app][t.config.keySetId ? "forKeySet" : "all"]}`;
237
+ return t.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((i = t.config) == null ? void 0 : i.controlPlaneId) || "").replace(/{keySetId}/gi, ((n = t.config) == null ? void 0 : n.keySetId) || "") : t.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (E = t.config) != null && E.workspace ? `/${t.config.workspace}` : "").replace(/{keySetId}/gi, ((Z = t.config) == null ? void 0 : Z.keySetId) || "")), s;
238
+ }), M = w(""), X = h(() => {
239
+ const s = t.config.app === "konnect" || t.config.isExactMatch;
240
+ if (s)
240
241
  return {
241
- isExactMatch: a,
242
- placeholder: f("keys.search.placeholder")
242
+ isExactMatch: s,
243
+ placeholder: c("keys.search.placeholder")
243
244
  };
244
- const c = { name: D.name };
245
+ const i = { name: T.name };
245
246
  return {
246
- isExactMatch: a,
247
- fields: c,
247
+ isExactMatch: s,
248
+ fields: i,
248
249
  schema: t.config.filterSchema
249
250
  };
250
251
  }), {
251
- fetcher: W,
252
+ fetcher: H,
252
253
  fetcherState: y,
253
- fetcherCacheKey: g
254
- } = Ae(h(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), J), j = () => {
255
- E.value = "";
256
- }, v = () => {
257
- g.value++;
258
- }, I = w(null), p = async (a, c) => {
259
- const s = a.id;
260
- if (!await c(s)) {
261
- re(a, "id");
254
+ fetcherCacheKey: m
255
+ } = Ue(h(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), L), j = () => {
256
+ M.value = "";
257
+ }, g = () => {
258
+ m.value++;
259
+ }, S = w(null), k = async (s, i) => {
260
+ const n = s.id;
261
+ if (!await i(n)) {
262
+ ce(s, "id");
262
263
  return;
263
264
  }
264
- ne(a, "id");
265
- }, te = async (a, c) => {
266
- const s = JSON.stringify(a);
267
- if (!await c(s)) {
265
+ de(s, "id");
266
+ }, ie = async (s, i) => {
267
+ const n = JSON.stringify(s);
268
+ if (!await i(n)) {
268
269
  _("copy:error", {
269
- entity: a,
270
- message: f("keys.errors.copy")
270
+ entity: s,
271
+ message: c("keys.errors.copy")
271
272
  });
272
273
  return;
273
274
  }
274
275
  _("copy:success", {
275
- entity: a,
276
- message: f("keys.copy.success_brief")
276
+ entity: s,
277
+ message: c("keys.copy.success_brief")
277
278
  });
278
- }, ne = (a, c) => {
279
+ }, de = (s, i) => {
279
280
  _("copy:success", {
280
- entity: a,
281
- field: c,
282
- message: f("keys.copy.success", { val: a[c] })
281
+ entity: s,
282
+ field: i,
283
+ message: c("keys.copy.success", { val: s[i] })
283
284
  });
284
- }, re = (a, c) => {
285
+ }, ce = (s, i) => {
285
286
  _("copy:error", {
286
- entity: a,
287
- field: c,
288
- message: f("keys.errors.copy")
287
+ entity: s,
288
+ field: i,
289
+ message: c("keys.errors.copy")
289
290
  });
290
- }, de = async (a) => {
291
- var s;
292
- await ((s = t.canRetrieve) == null ? void 0 : s.call(t, a)) && r.push(t.config.getViewRoute(a.id));
293
- }, ce = (a) => ({
294
- label: f("keys.actions.view"),
295
- to: t.config.getViewRoute(a)
296
- }), ye = (a) => ({
297
- label: f("keys.actions.edit"),
298
- to: t.config.getEditRoute(a)
299
- }), V = w(void 0), L = w(!1), H = w(!1), le = w(""), X = Ue(t.config, J.value), ie = (a) => {
300
- V.value = a, L.value = !0;
301
- }, fe = () => {
302
- L.value = !1;
303
- }, oe = async () => {
304
- var a, c, s;
305
- if ((a = V.value) != null && a.id) {
306
- H.value = !0;
291
+ }, ye = async (s) => {
292
+ var n;
293
+ await ((n = t.canRetrieve) == null ? void 0 : n.call(t, s)) && d.push(t.config.getViewRoute(s.id));
294
+ }, fe = (s) => ({
295
+ label: c("keys.actions.view"),
296
+ to: t.config.getViewRoute(s)
297
+ }), ue = (s) => ({
298
+ label: c("keys.actions.edit"),
299
+ to: t.config.getEditRoute(s)
300
+ }), R = w(void 0), Q = w(!1), G = w(!1), ae = w(""), Y = Pe(t.config, L.value), oe = (s) => {
301
+ R.value = s, Q.value = !0;
302
+ }, ke = () => {
303
+ Q.value = !1;
304
+ }, se = async () => {
305
+ var s, i, n;
306
+ if ((s = R.value) != null && s.id) {
307
+ G.value = !0;
307
308
  try {
308
- await K.delete(X(V.value.id)), H.value = !1, L.value = !1, g.value++, _("delete:success", V.value);
309
- } catch (d) {
310
- le.value = ((s = (c = d.response) == null ? void 0 : c.data) == null ? void 0 : s.message) || d.message || f("keys.errors.delete"), _("error", d);
309
+ await x.delete(Y(R.value.id)), G.value = !1, Q.value = !1, m.value++, _("delete:success", R.value);
310
+ } catch (E) {
311
+ ae.value = ((n = (i = E.response) == null ? void 0 : i.data) == null ? void 0 : n.message) || E.message || c("keys.errors.delete"), _("error", E);
311
312
  } finally {
312
- H.value = !1;
313
+ G.value = !1;
313
314
  }
314
315
  }
315
316
  }, o = () => {
316
- r.push(t.config.createRoute);
317
+ d.push(t.config.createRoute);
317
318
  };
318
- ee(y, (a) => {
319
- var c, s, d;
320
- if (a.status === Be.Error) {
321
- I.value = {
322
- title: f("keys.errors.general")
323
- }, (d = (s = (c = a.error) == null ? void 0 : c.response) == null ? void 0 : s.data) != null && d.message && (I.value.message = a.error.response.data.message), _("error", a.error);
319
+ le(y, (s) => {
320
+ var i, n, E;
321
+ if (s.status === qe.Error) {
322
+ S.value = {
323
+ title: c("keys.errors.general")
324
+ }, (E = (n = (i = s.error) == null ? void 0 : i.response) == null ? void 0 : n.data) != null && E.message && (S.value.message = s.error.response.data.message), _("error", s.error);
324
325
  return;
325
326
  }
326
- I.value = null;
327
+ S.value = null;
327
328
  });
328
- const n = w({
329
+ const r = w({
329
330
  ctaPath: t.config.createRoute,
330
331
  ctaText: void 0,
331
- message: `${f("keys.list.empty_state.description")}${t.config.additionMessageForEmptyState ? ` ${t.config.additionMessageForEmptyState}` : ""}`,
332
- title: f("keys.title")
333
- });
334
- return Ce(async () => {
335
- await t.canCreate() && (n.value.title = f("keys.list.empty_state.title"), n.value.ctaText = f("keys.actions.create"));
336
- }), (a, c) => {
337
- const s = B("KButton"), d = B("KCopy"), F = B("KDropdownItem"), he = B("KClipboardProvider");
338
- return S(), N("div", it, [
339
- u(l(Oe), {
340
- "cache-identifier": i.cacheIdentifier,
341
- "disable-sorting": C.value,
342
- "empty-state-options": n.value,
332
+ message: `${c("keys.list.empty_state.description")}${t.config.additionMessageForEmptyState ? ` ${t.config.additionMessageForEmptyState}` : ""}`,
333
+ title: c("keys.title")
334
+ }), v = w(!1);
335
+ return je(async () => {
336
+ v.value = await t.canCreate(), v.value && (r.value.title = c("keys.list.empty_state.title"), r.value.ctaText = c("keys.actions.create"));
337
+ }), (s, i) => {
338
+ const n = F("KButton"), E = F("KEmptyState"), Z = F("KCopy"), ee = F("KDropdownItem"), _e = F("KClipboardProvider");
339
+ return b(), W("div", lt, [
340
+ f(l(Ne), {
341
+ "cache-identifier": a.cacheIdentifier,
342
+ "disable-sorting": K.value,
343
+ "empty-state-options": r.value,
343
344
  "enable-entity-actions": "",
344
- "error-message": I.value,
345
- fetcher: l(W),
346
- "fetcher-cache-key": l(g),
345
+ "error-message": S.value,
346
+ fetcher: l(H),
347
+ "fetcher-cache-key": l(m),
347
348
  "pagination-type": "offset",
348
349
  "preferences-storage-key": "kong-ui-entities-keys-list",
349
- query: E.value,
350
- "table-headers": l(T),
350
+ query: M.value,
351
+ "table-headers": l(B),
351
352
  onClearSearchInput: j,
352
- "onClick:row": c[3] || (c[3] = (m) => de(m)),
353
- onSort: v,
353
+ "onClick:row": i[3] || (i[3] = (p) => ye(p)),
354
+ onSort: g,
354
355
  onState: l(z)
355
- }, pe({
356
- "toolbar-filter": k(() => [
357
- u(l(qe), {
358
- modelValue: E.value,
359
- "onUpdate:modelValue": c[0] || (c[0] = (m) => E.value = m),
360
- config: G.value
356
+ }, ge({
357
+ "toolbar-filter": u(() => [
358
+ f(l(Je), {
359
+ modelValue: M.value,
360
+ "onUpdate:modelValue": i[0] || (i[0] = (p) => M.value = p),
361
+ config: X.value
361
362
  }, null, 8, ["modelValue", "config"])
362
363
  ]),
363
- "toolbar-button": k(() => [
364
- (S(), R(Ee, {
365
- disabled: !i.useActionOutside,
364
+ "toolbar-button": u(() => [
365
+ (b(), V(De, {
366
+ disabled: !a.useActionOutside,
366
367
  to: "#kong-ui-app-page-header-action-button"
367
368
  }, [
368
- M("div", ot, [
369
- !e.value && $.value ? (S(), R(s, {
369
+ D("div", it, [
370
+ !e.value && $.value ? (b(), V(n, {
370
371
  key: 0,
371
372
  appearance: "secondary",
372
373
  class: "open-learning-hub",
373
374
  "data-testid": "keys-learn-more-button",
374
375
  icon: "",
375
- onClick: c[1] || (c[1] = (m) => a.$emit("click:learn-more"))
376
+ onClick: i[1] || (i[1] = (p) => s.$emit("click:learn-more"))
376
377
  }, {
377
- default: k(() => [
378
- u(l(Ve), { decorative: "" })
378
+ default: u(() => [
379
+ f(l(Ce), { decorative: "" })
379
380
  ]),
380
381
  _: 1
381
- })) : Q("", !0),
382
- u(l(ae), {
383
- "auth-function": () => i.canCreate()
382
+ })) : J("", !0),
383
+ f(l(ne), {
384
+ "auth-function": () => a.canCreate()
384
385
  }, {
385
- default: k(() => [
386
- u(s, {
386
+ default: u(() => [
387
+ f(n, {
387
388
  appearance: "primary",
388
389
  "data-testid": "toolbar-add-key",
389
- size: i.useActionOutside ? "medium" : "large",
390
- to: i.config.createRoute
390
+ size: a.useActionOutside ? "medium" : "large",
391
+ to: a.config.createRoute
391
392
  }, {
392
- default: k(() => [
393
- u(l(Me)),
394
- Y(" " + x(l(f)("keys.list.toolbar_actions.new_key")), 1)
393
+ default: u(() => [
394
+ f(l(Ke)),
395
+ O(" " + C(l(c)("keys.list.toolbar_actions.new_key")), 1)
395
396
  ]),
396
397
  _: 1
397
398
  }, 8, ["size", "to"])
@@ -401,85 +402,85 @@ const ve = {
401
402
  ])
402
403
  ], 8, ["disabled"]))
403
404
  ]),
404
- name: k(({ rowValue: m }) => [
405
- M("b", null, x(m ?? "-"), 1)
405
+ name: u(({ rowValue: p }) => [
406
+ D("b", null, C(p ?? "-"), 1)
406
407
  ]),
407
- kid: k(({ rowValue: m }) => [
408
- u(d, { text: m }, null, 8, ["text"])
408
+ kid: u(({ rowValue: p }) => [
409
+ f(Z, { text: p }, null, 8, ["text"])
409
410
  ]),
410
- tags: k(({ rowValue: m }) => [
411
- u(l(Pe), { tags: m }, null, 8, ["tags"])
411
+ tags: u(({ rowValue: p }) => [
412
+ f(l(Oe), { tags: p }, null, 8, ["tags"])
412
413
  ]),
413
- id: k(({ rowValue: m }) => [
414
- u(d, {
415
- text: m,
414
+ id: u(({ rowValue: p }) => [
415
+ f(Z, {
416
+ text: p,
416
417
  truncate: ""
417
418
  }, null, 8, ["text"])
418
419
  ]),
419
- actions: k(({ row: m }) => [
420
- u(he, null, {
421
- default: k(({ copyToClipboard: Z }) => [
422
- u(F, {
420
+ actions: u(({ row: p }) => [
421
+ f(_e, null, {
422
+ default: u(({ copyToClipboard: te }) => [
423
+ f(ee, {
423
424
  "data-testid": "action-entity-copy-id",
424
- onClick: (je) => p(m, Z)
425
+ onClick: (Re) => k(p, te)
425
426
  }, {
426
- default: k(() => [
427
- Y(x(l(f)("keys.actions.copy_id")), 1)
427
+ default: u(() => [
428
+ O(C(l(c)("keys.actions.copy_id")), 1)
428
429
  ]),
429
430
  _: 2
430
431
  }, 1032, ["onClick"])
431
432
  ]),
432
433
  _: 2
433
434
  }, 1024),
434
- u(he, null, {
435
- default: k(({ copyToClipboard: Z }) => [
436
- u(F, {
435
+ f(_e, null, {
436
+ default: u(({ copyToClipboard: te }) => [
437
+ f(ee, {
437
438
  "data-testid": "action-entity-copy-json",
438
- onClick: (je) => te(m, Z)
439
+ onClick: (Re) => ie(p, te)
439
440
  }, {
440
- default: k(() => [
441
- Y(x(l(f)("keys.actions.copy_json")), 1)
441
+ default: u(() => [
442
+ O(C(l(c)("keys.actions.copy_json")), 1)
442
443
  ]),
443
444
  _: 2
444
445
  }, 1032, ["onClick"])
445
446
  ]),
446
447
  _: 2
447
448
  }, 1024),
448
- u(l(ae), {
449
- "auth-function": () => i.canRetrieve(m)
449
+ f(l(ne), {
450
+ "auth-function": () => a.canRetrieve(p)
450
451
  }, {
451
- default: k(() => [
452
- u(F, {
452
+ default: u(() => [
453
+ f(ee, {
453
454
  "data-testid": "action-entity-view",
454
455
  "has-divider": "",
455
- item: ce(m.id)
456
+ item: fe(p.id)
456
457
  }, null, 8, ["item"])
457
458
  ]),
458
459
  _: 2
459
460
  }, 1032, ["auth-function"]),
460
- u(l(ae), {
461
- "auth-function": () => i.canEdit(m)
461
+ f(l(ne), {
462
+ "auth-function": () => a.canEdit(p)
462
463
  }, {
463
- default: k(() => [
464
- u(F, {
464
+ default: u(() => [
465
+ f(ee, {
465
466
  "data-testid": "action-entity-edit",
466
- item: ye(m.id)
467
+ item: ue(p.id)
467
468
  }, null, 8, ["item"])
468
469
  ]),
469
470
  _: 2
470
471
  }, 1032, ["auth-function"]),
471
- u(l(ae), {
472
- "auth-function": () => i.canDelete(m)
472
+ f(l(ne), {
473
+ "auth-function": () => a.canDelete(p)
473
474
  }, {
474
- default: k(() => [
475
- u(F, {
475
+ default: u(() => [
476
+ f(ee, {
476
477
  danger: "",
477
478
  "data-testid": "action-entity-delete",
478
479
  "has-divider": "",
479
- onClick: (Z) => ie(m)
480
+ onClick: (te) => oe(p)
480
481
  }, {
481
- default: k(() => [
482
- Y(x(l(f)("keys.actions.delete")), 1)
482
+ default: u(() => [
483
+ O(C(l(c)("keys.actions.delete")), 1)
483
484
  ]),
484
485
  _: 2
485
486
  }, 1032, ["onClick"])
@@ -489,77 +490,91 @@ const ve = {
489
490
  ]),
490
491
  _: 2
491
492
  }, [
492
- !E.value && i.config.app === "konnect" ? {
493
+ !M.value && a.config.app === "konnect" ? {
493
494
  name: "empty-state",
494
- fn: k(() => {
495
- var m;
495
+ fn: u(() => {
496
+ var p;
496
497
  return [
497
- u(l(Ne), {
498
- "action-button-text": l(f)("keys.list.empty_state_v2.create_cta"),
499
- appearance: "secondary",
500
- "can-create": () => i.canCreate(),
501
- "data-testid": i.config.keySetId ? "nested-keys-entity-empty-state" : "keys-entity-empty-state",
502
- description: l(f)("keys.list.empty_state_v2.description"),
503
- "learn-more": i.config.app === "konnect",
504
- title: l(f)("keys.list.empty_state_v2.title"),
505
- "onClick:create": o,
506
- "onClick:learnMore": c[2] || (c[2] = (Z) => a.$emit("click:learn-more"))
507
- }, pe({
508
- image: k(() => [
509
- M("div", at, [
510
- u(l(Re), {
511
- color: l(tt),
512
- size: l(lt)
513
- }, null, 8, ["color", "size"])
514
- ])
498
+ f(E, {
499
+ "data-testid": a.config.keySetId ? "nested-keys-entity-empty-state" : "keys-entity-empty-state",
500
+ "icon-background": "",
501
+ message: l(c)("keys.list.empty_state_v2.description"),
502
+ title: l(c)("keys.list.empty_state_v2.title")
503
+ }, ge({
504
+ icon: u(() => [
505
+ f(l(Fe), { decorative: "" })
506
+ ]),
507
+ action: u(() => [
508
+ v.value ? (b(), V(n, {
509
+ key: 0,
510
+ "data-testid": "entity-create-button",
511
+ onClick: o
512
+ }, {
513
+ default: u(() => [
514
+ f(l(Ke), { decorative: "" }),
515
+ O(" " + C(l(c)("keys.list.empty_state_v2.create_cta")), 1)
516
+ ]),
517
+ _: 1
518
+ })) : J("", !0),
519
+ f(n, {
520
+ appearance: "secondary",
521
+ "data-testid": "entity-learn-more-button",
522
+ onClick: i[2] || (i[2] = (te) => s.$emit("click:learn-more"))
523
+ }, {
524
+ default: u(() => [
525
+ f(l(Ce), { decorative: "" }),
526
+ O(" " + C(l(c)("keys.list.empty_state_v2.learn_more")), 1)
527
+ ]),
528
+ _: 1
529
+ })
515
530
  ]),
516
531
  _: 2
517
532
  }, [
518
- (m = i.config) != null && m.isControlPlaneGroup ? {
519
- name: "message",
520
- fn: k(() => [
521
- Y(x(l(f)("keys.list.empty_state_v2.group")), 1)
533
+ (p = a.config) != null && p.isControlPlaneGroup ? {
534
+ name: "default",
535
+ fn: u(() => [
536
+ O(C(l(c)("keys.list.empty_state_v2.group")), 1)
522
537
  ]),
523
538
  key: "0"
524
539
  } : void 0
525
- ]), 1032, ["action-button-text", "can-create", "data-testid", "description", "learn-more", "title"])
540
+ ]), 1032, ["data-testid", "message", "title"])
526
541
  ];
527
542
  }),
528
543
  key: "0"
529
544
  } : void 0
530
545
  ]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
531
- u(l(Je), {
532
- "action-pending": H.value,
533
- description: l(f)("keys.delete.description"),
534
- "entity-name": V.value && (V.value.name || V.value.id),
535
- "entity-type": l(We).Key,
536
- error: le.value,
546
+ f(l(We), {
547
+ "action-pending": G.value,
548
+ description: l(c)("keys.delete.description"),
549
+ "entity-name": R.value && (R.value.name || R.value.id),
550
+ "entity-type": l(Le).Key,
551
+ error: ae.value,
537
552
  "need-confirm": !1,
538
- title: l(f)("keys.delete.title"),
539
- visible: L.value,
540
- onCancel: fe,
541
- onProceed: oe
553
+ title: l(c)("keys.delete.title"),
554
+ visible: Q.value,
555
+ onCancel: ke,
556
+ onProceed: se
542
557
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
543
558
  ]);
544
559
  };
545
560
  }
546
- }), $e = (i, P) => {
547
- const _ = i.__vccOpts || i;
548
- for (const [t, f] of P)
549
- _[t] = f;
561
+ }), Me = (a, q) => {
562
+ const _ = a.__vccOpts || a;
563
+ for (const [t, c] of q)
564
+ _[t] = c;
550
565
  return _;
551
- }, St = /* @__PURE__ */ $e(st, [["__scopeId", "data-v-6f7f8fb6"]]), nt = { class: "kong-ui-entities-keys-form" }, rt = { "data-testid": "no-search-results" }, dt = { class: "select-item-container" }, ct = { class: "select-item-label" }, yt = { class: "select-item-description" }, ft = {
566
+ }, bt = /* @__PURE__ */ Me(at, [["__scopeId", "data-v-be539385"]]), ot = { class: "kong-ui-entities-keys-form" }, st = { "data-testid": "no-search-results" }, nt = { class: "select-item-container" }, rt = { class: "select-item-label" }, dt = { class: "select-item-description" }, ct = {
552
567
  key: 1,
553
568
  class: "invalid-key-set-message",
554
569
  "data-testid": "invalid-key-set-message"
555
- }, ut = { "data-testid": "key-format-container" }, kt = /* @__PURE__ */ me({
570
+ }, yt = { "data-testid": "key-format-container" }, ft = /* @__PURE__ */ ve({
556
571
  __name: "KeyForm",
557
572
  props: {
558
573
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
559
574
  config: {
560
575
  type: Object,
561
576
  required: !0,
562
- validator: (i) => !(!i || !["konnect", "kongManager"].includes(i == null ? void 0 : i.app) || i.app === "konnect" && !i.controlPlaneId || i.app === "kongManager" && typeof i.workspace != "string" || !i.cancelRoute)
577
+ validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || a.app === "konnect" && !a.controlPlaneId || a.app === "kongManager" && typeof a.workspace != "string" || !a.cancelRoute)
563
578
  },
564
579
  /** If a valid Key ID is provided, it will put the form in Edit mode instead of Create */
565
580
  keyId: {
@@ -587,9 +602,9 @@ const ve = {
587
602
  }
588
603
  },
589
604
  emits: ["update", "error", "loading"],
590
- setup(i, { emit: P }) {
591
- var oe;
592
- const _ = P, t = i, f = xe(), { i18n: { t: r } } = ve.useI18n(), { getMessageFromError: K } = Le(), { axiosInstance: q } = ge((oe = t.config) == null ? void 0 : oe.axiosRequestConfig), z = h(() => t.keySetId ? O.form[t.config.app].edit.forKeySet.replace(/{keySetId}/gi, t.keySetId) : O.form[t.config.app].edit.all), $ = h(() => t.keyId ? se.Edit : se.Create), e = be({
605
+ setup(a, { emit: q }) {
606
+ var se;
607
+ const _ = q, t = a, c = Ee(), { i18n: { t: d } } = be.useI18n(), { getMessageFromError: x } = He(), { axiosInstance: N } = he((se = t.config) == null ? void 0 : se.axiosRequestConfig), z = h(() => t.keySetId ? P.form[t.config.app].edit.forKeySet.replace(/{keySetId}/gi, t.keySetId) : P.form[t.config.app].edit.all), $ = h(() => t.keyId ? re.Edit : re.Create), e = Se({
593
608
  fields: {
594
609
  name: "",
595
610
  tags: "",
@@ -603,7 +618,7 @@ const ve = {
603
618
  },
604
619
  isReadonly: !1,
605
620
  errorMessage: ""
606
- }), C = be({
621
+ }), K = Se({
607
622
  name: "",
608
623
  tags: "",
609
624
  key_id: "",
@@ -612,271 +627,271 @@ const ve = {
612
627
  jwk: "",
613
628
  private_key: "",
614
629
  public_key: ""
615
- }), D = [
630
+ }), T = [
616
631
  {
617
- label: r("keys.form.fields.key_format.options.jwk"),
632
+ label: d("keys.form.fields.key_format.options.jwk"),
618
633
  value: "jwk"
619
634
  },
620
635
  {
621
- label: r("keys.form.fields.key_format.options.pem"),
636
+ label: d("keys.form.fields.key_format.options.pem"),
622
637
  value: "pem"
623
638
  }
624
- ], T = h(() => e.isReadonly || $.value === se.Create && !!t.fixedKeySetId), J = h(() => !T.value);
625
- ee(() => t.fixedKeySetId, (o) => {
626
- $.value === se.Create && (e.fields.key_set = o);
639
+ ], B = h(() => e.isReadonly || $.value === re.Create && !!t.fixedKeySetId), L = h(() => !B.value);
640
+ le(() => t.fixedKeySetId, (o) => {
641
+ $.value === re.Create && (e.fields.key_set = o);
627
642
  }, { immediate: !0 });
628
- const E = h(() => JSON.stringify(e.fields) !== JSON.stringify(C) && !!e.fields.key_id && !!e.fields.key_format && (e.fields.key_format === "jwk" && !!e.fields.jwk || e.fields.key_format === "pem" && !!e.fields.private_key && !!e.fields.public_key)), G = (o) => {
629
- var n, b, a, c;
630
- e.fields.key_id = (o == null ? void 0 : o.kid) || "", e.fields.name = (o == null ? void 0 : o.name) || "", e.fields.tags = ((n = o == null ? void 0 : o.tags) == null ? void 0 : n.join(", ")) || "", e.fields.key_set = ((b = o == null ? void 0 : o.set) == null ? void 0 : b.id) || "", e.fields.key_format = o != null && o.pem ? "pem" : "jwk", e.fields.jwk = (o == null ? void 0 : o.jwk) || "", e.fields.private_key = ((a = o == null ? void 0 : o.pem) == null ? void 0 : a.private_key) || "", e.fields.public_key = ((c = o == null ? void 0 : o.pem) == null ? void 0 : c.public_key) || "", t.showx5t && (e.fields.x5t = (o == null ? void 0 : o.x5t) || ""), Object.assign(C, e.fields);
631
- }, W = () => {
632
- f.push(t.config.cancelRoute);
643
+ const M = h(() => JSON.stringify(e.fields) !== JSON.stringify(K) && !!e.fields.key_id && !!e.fields.key_format && (e.fields.key_format === "jwk" && !!e.fields.jwk || e.fields.key_format === "pem" && !!e.fields.private_key && !!e.fields.public_key)), X = (o) => {
644
+ var r, v, I, s;
645
+ e.fields.key_id = (o == null ? void 0 : o.kid) || "", e.fields.name = (o == null ? void 0 : o.name) || "", e.fields.tags = ((r = o == null ? void 0 : o.tags) == null ? void 0 : r.join(", ")) || "", e.fields.key_set = ((v = o == null ? void 0 : o.set) == null ? void 0 : v.id) || "", e.fields.key_format = o != null && o.pem ? "pem" : "jwk", e.fields.jwk = (o == null ? void 0 : o.jwk) || "", e.fields.private_key = ((I = o == null ? void 0 : o.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((s = o == null ? void 0 : o.pem) == null ? void 0 : s.public_key) || "", t.showx5t && (e.fields.x5t = (o == null ? void 0 : o.x5t) || ""), Object.assign(K, e.fields);
646
+ }, H = () => {
647
+ c.push(t.config.cancelRoute);
633
648
  }, y = h(() => {
634
- var n, b;
635
- let o = `${t.config.apiBaseUrl}${O.form[t.config.app][$.value][t.keySetId ? "forKeySet" : "all"]}`;
636
- return t.config.app === "konnect" ? o = o.replace(/{controlPlaneId}/gi, ((n = t.config) == null ? void 0 : n.controlPlaneId) || "") : t.config.app === "kongManager" && (o = o.replace(/\/{workspace}/gi, (b = t.config) != null && b.workspace ? `/${t.config.workspace}` : "")), o = o.replace(/{id}/gi, t.keyId).replace(/{keySetId}/gi, t.keySetId || ""), o;
637
- }), g = h(() => {
638
- var o, n, b;
649
+ var r, v;
650
+ let o = `${t.config.apiBaseUrl}${P.form[t.config.app][$.value][t.keySetId ? "forKeySet" : "all"]}`;
651
+ return t.config.app === "konnect" ? o = o.replace(/{controlPlaneId}/gi, ((r = t.config) == null ? void 0 : r.controlPlaneId) || "") : t.config.app === "kongManager" && (o = o.replace(/\/{workspace}/gi, (v = t.config) != null && v.workspace ? `/${t.config.workspace}` : "")), o = o.replace(/{id}/gi, t.keyId).replace(/{keySetId}/gi, t.keySetId || ""), o;
652
+ }), m = h(() => {
653
+ var o, r, v;
639
654
  return {
640
655
  kid: e.fields.key_id,
641
656
  ...t.showx5t ? { x5t: e.fields.x5t || null } : {},
642
657
  name: e.fields.name || null,
643
- tags: ((b = (n = (o = e.fields.tags) == null ? void 0 : o.split(",")) == null ? void 0 : n.map((a) => String(a || "").trim())) == null ? void 0 : b.filter((a) => a !== "")) || [],
658
+ tags: ((v = (r = (o = e.fields.tags) == null ? void 0 : o.split(",")) == null ? void 0 : r.map((I) => String(I || "").trim())) == null ? void 0 : v.filter((I) => I !== "")) || [],
644
659
  set: e.fields.key_set ? { id: e.fields.key_set } : null,
645
660
  jwk: e.fields.key_format === "jwk" ? e.fields.jwk : null,
646
661
  pem: e.fields.key_format === "pem" ? { private_key: e.fields.private_key, public_key: e.fields.public_key } : null
647
662
  };
648
663
  }), j = async () => {
649
- var o, n, b, a, c;
664
+ var o, r, v, I, s;
650
665
  try {
651
666
  e.isReadonly = !0;
652
- let s;
653
- if ($.value === "create" ? s = await q.post(y.value, g.value) : $.value === "edit" && (s = ((o = t.config) == null ? void 0 : o.app) === "konnect" ? await q.put(y.value, g.value) : await q.patch(y.value, g.value)), s) {
654
- const { data: d } = s;
655
- e.fields.key_id = (d == null ? void 0 : d.kid) || "", e.fields.name = (d == null ? void 0 : d.name) || "", e.fields.tags = ((n = d == null ? void 0 : d.tags) == null ? void 0 : n.join(", ")) || "", e.fields.key_set = ((b = d == null ? void 0 : d.set) == null ? void 0 : b.id) || "", e.fields.key_format = d != null && d.pem ? "pem" : "jwk", e.fields.jwk = (d == null ? void 0 : d.jwk) || "", e.fields.private_key = ((a = d == null ? void 0 : d.pem) == null ? void 0 : a.private_key) || "", e.fields.public_key = ((c = d == null ? void 0 : d.pem) == null ? void 0 : c.public_key) || "", t.showx5t && (e.fields.x5t = (d == null ? void 0 : d.x5t) || ""), Object.assign(C, e.fields), _("update", s == null ? void 0 : s.data);
667
+ let i;
668
+ if ($.value === "create" ? i = await N.post(y.value, m.value) : $.value === "edit" && (i = ((o = t.config) == null ? void 0 : o.app) === "konnect" ? await N.put(y.value, m.value) : await N.patch(y.value, m.value)), i) {
669
+ const { data: n } = i;
670
+ e.fields.key_id = (n == null ? void 0 : n.kid) || "", e.fields.name = (n == null ? void 0 : n.name) || "", e.fields.tags = ((r = n == null ? void 0 : n.tags) == null ? void 0 : r.join(", ")) || "", e.fields.key_set = ((v = n == null ? void 0 : n.set) == null ? void 0 : v.id) || "", e.fields.key_format = n != null && n.pem ? "pem" : "jwk", e.fields.jwk = (n == null ? void 0 : n.jwk) || "", e.fields.private_key = ((I = n == null ? void 0 : n.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((s = n == null ? void 0 : n.pem) == null ? void 0 : s.public_key) || "", t.showx5t && (e.fields.x5t = (n == null ? void 0 : n.x5t) || ""), Object.assign(K, e.fields), _("update", i == null ? void 0 : i.data);
656
671
  }
657
- } catch (s) {
658
- e.errorMessage = K(s), _("error", s);
672
+ } catch (i) {
673
+ e.errorMessage = x(i), _("error", i);
659
674
  } finally {
660
675
  e.isReadonly = !1;
661
676
  }
662
677
  }, {
663
- debouncedQueryChange: v,
664
- loading: I,
665
- allRecords: p,
666
- error: te,
667
- validationError: ne,
668
- loadItems: re,
669
- results: de
670
- } = He(t.config, O.form[t.config.app].keySets, void 0, {
678
+ debouncedQueryChange: g,
679
+ loading: S,
680
+ allRecords: k,
681
+ error: ie,
682
+ validationError: de,
683
+ loadItems: ce,
684
+ results: ye
685
+ } = Qe(t.config, P.form[t.config.app].keySets, void 0, {
671
686
  fetchedItemsKey: "data",
672
687
  searchKeys: ["id", "name"]
673
- }), ce = (o) => {
674
- (!o || o !== e.fields.key_set && o !== C.key_set) && v(o);
675
- }, ye = h(() => te.value ? r("keys.errors.key_sets.fetch") : ""), V = h(() => ne.value ? r("keys.errors.key_sets.invalid") : ""), L = w(0), H = h(() => p.value === void 0), le = h(() => {
676
- if (H.value)
677
- return t.config.app === "konnect" ? r("keys.form.fields.key_set.footer") : void 0;
678
- }), X = w(/* @__PURE__ */ new Set()), ie = h(() => Array.from(X.value).map((n) => ({
679
- name: n.name || "",
688
+ }), fe = (o) => {
689
+ (!o || o !== e.fields.key_set && o !== K.key_set) && g(o);
690
+ }, ue = h(() => ie.value ? d("keys.errors.key_sets.fetch") : ""), R = h(() => de.value ? d("keys.errors.key_sets.invalid") : ""), Q = w(0), G = h(() => k.value === void 0), ae = h(() => {
691
+ if (G.value)
692
+ return t.config.app === "konnect" ? d("keys.form.fields.key_set.footer") : void 0;
693
+ }), Y = w(/* @__PURE__ */ new Set()), oe = h(() => Array.from(Y.value).map((r) => ({
694
+ name: r.name || "",
680
695
  // can't use name for label or it tries to search => 404
681
696
  label: "",
682
697
  // leave it blank so no flicker when used with selected-item-template
683
- value: n.id,
684
- selected: e.fields.key_set === n.id
685
- }))), fe = (o) => {
686
- X.value.clear();
687
- let n;
688
- for (n of o)
689
- X.value.add(n);
698
+ value: r.id,
699
+ selected: e.fields.key_set === r.id
700
+ }))), ke = (o) => {
701
+ Y.value.clear();
702
+ let r;
703
+ for (r of o)
704
+ Y.value.add(r);
690
705
  };
691
- return ee(de, (o) => {
692
- fe(o);
693
- }, { immediate: !0, deep: !0 }), ee(ie, () => {
694
- L.value++;
695
- }, { immediate: !0, deep: !0 }), Ce(async () => {
696
- await re();
697
- }), (o, n) => {
698
- const b = B("KInput"), a = B("KSelect"), c = B("KTextArea");
699
- return S(), N("div", nt, [
700
- u(l(Qe), {
701
- "can-submit": E.value,
702
- config: i.config,
703
- "edit-id": i.keyId,
704
- "entity-type": l(Ke).Key,
705
- "error-message": e.errorMessage || ye.value,
706
+ return le(ye, (o) => {
707
+ ke(o);
708
+ }, { immediate: !0, deep: !0 }), le(oe, () => {
709
+ Q.value++;
710
+ }, { immediate: !0, deep: !0 }), je(async () => {
711
+ await ce();
712
+ }), (o, r) => {
713
+ const v = F("KInput"), I = F("KSelect"), s = F("KTextArea");
714
+ return b(), W("div", ot, [
715
+ f(l(Ge), {
716
+ "can-submit": M.value,
717
+ config: a.config,
718
+ "edit-id": a.keyId,
719
+ "entity-type": l(Ve).Key,
720
+ "error-message": e.errorMessage || ue.value,
706
721
  "fetch-url": z.value,
707
- "form-fields": g.value,
722
+ "form-fields": m.value,
708
723
  "is-readonly": e.isReadonly,
709
- onCancel: W,
710
- "onFetch:error": n[9] || (n[9] = (s) => o.$emit("error", s)),
711
- "onFetch:success": G,
712
- onLoading: n[10] || (n[10] = (s) => o.$emit("loading", s)),
724
+ onCancel: H,
725
+ "onFetch:error": r[9] || (r[9] = (i) => o.$emit("error", i)),
726
+ "onFetch:success": X,
727
+ onLoading: r[10] || (r[10] = (i) => o.$emit("loading", i)),
713
728
  onSubmit: j
714
729
  }, {
715
- default: k(() => [
716
- u(l(Ie), {
717
- description: l(r)("keys.form.sections.general.description"),
718
- title: l(r)("keys.form.sections.general.title")
730
+ default: u(() => [
731
+ f(l(xe), {
732
+ description: l(d)("keys.form.sections.general.description"),
733
+ title: l(d)("keys.form.sections.general.title")
719
734
  }, {
720
- default: k(() => [
721
- u(b, {
735
+ default: u(() => [
736
+ f(v, {
722
737
  modelValue: e.fields.key_id,
723
- "onUpdate:modelValue": n[0] || (n[0] = (s) => e.fields.key_id = s),
738
+ "onUpdate:modelValue": r[0] || (r[0] = (i) => e.fields.key_id = i),
724
739
  modelModifiers: { trim: !0 },
725
740
  autocomplete: "off",
726
741
  "data-testid": "key-form-id",
727
- help: l(r)("keys.form.fields.id.help"),
728
- label: l(r)("keys.form.fields.id.label"),
742
+ help: l(d)("keys.form.fields.id.help"),
743
+ label: l(d)("keys.form.fields.id.label"),
729
744
  "label-attributes": {
730
- info: l(r)("keys.form.fields.id.tooltip"),
745
+ info: l(d)("keys.form.fields.id.tooltip"),
731
746
  tooltipAttributes: { maxWidth: "400" }
732
747
  },
733
- placeholder: l(r)("keys.form.fields.id.placeholder"),
748
+ placeholder: l(d)("keys.form.fields.id.placeholder"),
734
749
  readonly: e.isReadonly,
735
750
  required: "",
736
751
  type: "text"
737
752
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"]),
738
- i.showx5t ? (S(), R(b, {
753
+ a.showx5t ? (b(), V(v, {
739
754
  key: 0,
740
755
  modelValue: e.fields.x5t,
741
- "onUpdate:modelValue": n[1] || (n[1] = (s) => e.fields.x5t = s),
756
+ "onUpdate:modelValue": r[1] || (r[1] = (i) => e.fields.x5t = i),
742
757
  modelModifiers: { trim: !0 },
743
758
  autocomplete: "off",
744
759
  "data-testid": "key-form-x5t",
745
- help: l(r)("keys.form.fields.x5t.help"),
746
- label: l(r)("keys.form.fields.x5t.label"),
760
+ help: l(d)("keys.form.fields.x5t.help"),
761
+ label: l(d)("keys.form.fields.x5t.label"),
747
762
  "label-attributes": {
748
- info: l(r)("keys.form.fields.x5t.tooltip"),
763
+ info: l(d)("keys.form.fields.x5t.tooltip"),
749
764
  tooltipAttributes: { maxWidth: "400" }
750
765
  },
751
- placeholder: l(r)("keys.form.fields.x5t.placeholder"),
766
+ placeholder: l(d)("keys.form.fields.x5t.placeholder"),
752
767
  readonly: e.isReadonly,
753
768
  type: "text"
754
- }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])) : Q("", !0),
755
- u(b, {
769
+ }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])) : J("", !0),
770
+ f(v, {
756
771
  modelValue: e.fields.name,
757
- "onUpdate:modelValue": n[2] || (n[2] = (s) => e.fields.name = s),
772
+ "onUpdate:modelValue": r[2] || (r[2] = (i) => e.fields.name = i),
758
773
  modelModifiers: { trim: !0 },
759
774
  autocomplete: "off",
760
775
  "data-testid": "key-form-name",
761
- label: l(r)("keys.form.fields.name.label"),
762
- placeholder: l(r)("keys.form.fields.name.placeholder"),
776
+ label: l(d)("keys.form.fields.name.label"),
777
+ placeholder: l(d)("keys.form.fields.name.placeholder"),
763
778
  readonly: e.isReadonly,
764
779
  type: "text"
765
780
  }, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
766
- u(a, {
781
+ f(I, {
767
782
  modelValue: e.fields.key_set,
768
- "onUpdate:modelValue": n[3] || (n[3] = (s) => e.fields.key_set = s),
769
- clearable: J.value,
783
+ "onUpdate:modelValue": r[3] || (r[3] = (i) => e.fields.key_set = i),
784
+ clearable: L.value,
770
785
  "data-testid": "key-form-key-set",
771
- "dropdown-footer-text": le.value,
786
+ "dropdown-footer-text": ae.value,
772
787
  "enable-filtering": "",
773
788
  "filter-function": () => !0,
774
- items: ie.value,
775
- label: l(r)("keys.form.fields.key_set.label"),
776
- loading: l(I),
777
- placeholder: l(r)("keys.form.fields.key_set.placeholder"),
778
- readonly: T.value,
789
+ items: oe.value,
790
+ label: l(d)("keys.form.fields.key_set.label"),
791
+ loading: l(S),
792
+ placeholder: l(d)("keys.form.fields.key_set.placeholder"),
793
+ readonly: B.value,
779
794
  width: "100%",
780
- onQueryChange: ce
795
+ onQueryChange: fe
781
796
  }, {
782
- loading: k(() => [
783
- M("div", null, x(l(r)("keys.actions.loading")), 1)
797
+ loading: u(() => [
798
+ D("div", null, C(l(d)("keys.actions.loading")), 1)
784
799
  ]),
785
- empty: k(() => [
786
- M("div", rt, x(l(r)("keys.search.no_results")), 1)
800
+ empty: u(() => [
801
+ D("div", st, C(l(d)("keys.search.no_results")), 1)
787
802
  ]),
788
- "selected-item-template": k(({ item: s }) => [
789
- M("div", null, x(s.name), 1)
803
+ "selected-item-template": u(({ item: i }) => [
804
+ D("div", null, C(i.name), 1)
790
805
  ]),
791
- "item-template": k(({ item: s }) => [
792
- M("div", dt, [
793
- M("div", ct, x(s.name), 1),
794
- M("div", yt, x(s.value), 1)
806
+ "item-template": u(({ item: i }) => [
807
+ D("div", nt, [
808
+ D("div", rt, C(i.name), 1),
809
+ D("div", dt, C(i.value), 1)
795
810
  ])
796
811
  ]),
797
812
  _: 1
798
813
  }, 8, ["modelValue", "clearable", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"]),
799
- V.value ? (S(), N("p", ft, x(V.value), 1)) : Q("", !0),
800
- u(b, {
814
+ R.value ? (b(), W("p", ct, C(R.value), 1)) : J("", !0),
815
+ f(v, {
801
816
  modelValue: e.fields.tags,
802
- "onUpdate:modelValue": n[4] || (n[4] = (s) => e.fields.tags = s),
817
+ "onUpdate:modelValue": r[4] || (r[4] = (i) => e.fields.tags = i),
803
818
  modelModifiers: { trim: !0 },
804
819
  autocomplete: "off",
805
820
  "data-testid": "key-form-tags",
806
- help: l(r)("keys.form.fields.tags.help"),
807
- label: l(r)("keys.form.fields.tags.label"),
821
+ help: l(d)("keys.form.fields.tags.help"),
822
+ label: l(d)("keys.form.fields.tags.label"),
808
823
  "label-attributes": {
809
- info: l(r)("keys.form.fields.tags.tooltip"),
824
+ info: l(d)("keys.form.fields.tags.tooltip"),
810
825
  tooltipAttributes: { maxWidth: "400" }
811
826
  },
812
- placeholder: l(r)("keys.form.fields.tags.placeholder"),
827
+ placeholder: l(d)("keys.form.fields.tags.placeholder"),
813
828
  readonly: e.isReadonly,
814
829
  type: "text"
815
830
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
816
831
  ]),
817
832
  _: 1
818
833
  }, 8, ["description", "title"]),
819
- u(l(Ie), {
820
- description: l(r)("keys.form.sections.keys.description"),
834
+ f(l(xe), {
835
+ description: l(d)("keys.form.sections.keys.description"),
821
836
  "has-divider": "",
822
- title: l(r)("keys.form.sections.keys.title")
837
+ title: l(d)("keys.form.sections.keys.title")
823
838
  }, {
824
- default: k(() => [
825
- M("div", ut, [
826
- u(a, {
839
+ default: u(() => [
840
+ D("div", yt, [
841
+ f(I, {
827
842
  modelValue: e.fields.key_format,
828
- "onUpdate:modelValue": n[5] || (n[5] = (s) => e.fields.key_format = s),
843
+ "onUpdate:modelValue": r[5] || (r[5] = (i) => e.fields.key_format = i),
829
844
  "data-testid": "key-form-key-format",
830
- items: D,
831
- label: l(r)("keys.form.fields.key_format.label"),
845
+ items: T,
846
+ label: l(d)("keys.form.fields.key_format.label"),
832
847
  readonly: e.isReadonly,
833
848
  required: "",
834
849
  width: "100%"
835
850
  }, null, 8, ["modelValue", "label", "readonly"])
836
851
  ]),
837
- e.fields.key_format === "jwk" ? (S(), R(c, {
852
+ e.fields.key_format === "jwk" ? (b(), V(s, {
838
853
  key: 0,
839
854
  modelValue: e.fields.jwk,
840
- "onUpdate:modelValue": n[6] || (n[6] = (s) => e.fields.jwk = s),
855
+ "onUpdate:modelValue": r[6] || (r[6] = (i) => e.fields.jwk = i),
841
856
  modelModifiers: { trim: !0 },
842
857
  "character-limit": !1,
843
858
  class: "key-form-textarea",
844
859
  "data-testid": "key-form-jwk",
845
- label: l(r)("keys.form.fields.jwk.label"),
860
+ label: l(d)("keys.form.fields.jwk.label"),
846
861
  "label-attributes": {
847
- info: l(r)("keys.form.fields.jwk.tooltip"),
862
+ info: l(d)("keys.form.fields.jwk.tooltip"),
848
863
  tooltipAttributes: { maxWidth: "400" }
849
864
  },
850
- placeholder: l(r)("keys.form.fields.jwk.placeholder"),
865
+ placeholder: l(d)("keys.form.fields.jwk.placeholder"),
851
866
  readonly: e.isReadonly,
852
867
  required: ""
853
- }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : Q("", !0),
854
- e.fields.key_format === "pem" ? (S(), R(c, {
868
+ }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : J("", !0),
869
+ e.fields.key_format === "pem" ? (b(), V(s, {
855
870
  key: 1,
856
871
  modelValue: e.fields.private_key,
857
- "onUpdate:modelValue": n[7] || (n[7] = (s) => e.fields.private_key = s),
872
+ "onUpdate:modelValue": r[7] || (r[7] = (i) => e.fields.private_key = i),
858
873
  modelModifiers: { trim: !0 },
859
874
  "character-limit": !1,
860
875
  class: "key-form-textarea",
861
876
  "data-testid": "key-form-private-key",
862
- label: l(r)("keys.form.fields.private_key.label"),
863
- placeholder: l(r)("keys.form.fields.private_key.placeholder"),
877
+ label: l(d)("keys.form.fields.private_key.label"),
878
+ placeholder: l(d)("keys.form.fields.private_key.placeholder"),
864
879
  readonly: e.isReadonly,
865
880
  required: ""
866
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : Q("", !0),
867
- e.fields.key_format === "pem" ? (S(), R(c, {
881
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : J("", !0),
882
+ e.fields.key_format === "pem" ? (b(), V(s, {
868
883
  key: 2,
869
884
  modelValue: e.fields.public_key,
870
- "onUpdate:modelValue": n[8] || (n[8] = (s) => e.fields.public_key = s),
885
+ "onUpdate:modelValue": r[8] || (r[8] = (i) => e.fields.public_key = i),
871
886
  modelModifiers: { trim: !0 },
872
887
  "character-limit": !1,
873
888
  class: "key-form-textarea",
874
889
  "data-testid": "key-form-public-key",
875
- label: l(r)("keys.form.fields.public_key.label"),
876
- placeholder: l(r)("keys.form.fields.public_key.placeholder"),
890
+ label: l(d)("keys.form.fields.public_key.label"),
891
+ placeholder: l(d)("keys.form.fields.public_key.placeholder"),
877
892
  readonly: e.isReadonly,
878
893
  required: ""
879
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : Q("", !0)
894
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : J("", !0)
880
895
  ]),
881
896
  _: 1
882
897
  }, 8, ["description", "title"])
@@ -886,14 +901,14 @@ const ve = {
886
901
  ]);
887
902
  };
888
903
  }
889
- }), It = /* @__PURE__ */ $e(kt, [["__scopeId", "data-v-d5baf85a"]]), pt = { class: "kong-ui-entities-keys-entity-config-card" }, mt = { key: 2 }, wt = /* @__PURE__ */ me({
904
+ }), _t = /* @__PURE__ */ Me(ft, [["__scopeId", "data-v-d5baf85a"]]), ut = { class: "kong-ui-entities-keys-entity-config-card" }, kt = { key: 2 }, St = /* @__PURE__ */ ve({
890
905
  __name: "KeyConfigCard",
891
906
  props: {
892
907
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
893
908
  config: {
894
909
  type: Object,
895
910
  required: !0,
896
- validator: (i) => !(!i || !["konnect", "kongManager"].includes(i == null ? void 0 : i.app) || i.app === "konnect" && !i.controlPlaneId || i.app === "kongManager" && typeof i.workspace != "string" || !i.entityId)
911
+ validator: (a) => !(!a || !["konnect", "kongManager"].includes(a == null ? void 0 : a.app) || a.app === "konnect" && !a.controlPlaneId || a.app === "kongManager" && typeof a.workspace != "string" || !a.entityId)
897
912
  },
898
913
  /**
899
914
  * External link for documentation that determines visibility of Documentation button
@@ -919,143 +934,143 @@ const ve = {
919
934
  }
920
935
  },
921
936
  emits: ["loading", "fetch:error", "fetch:success", "navigation-click"],
922
- setup(i, { emit: P }) {
923
- var W;
924
- const _ = P, t = i, { axiosInstance: f } = ge((W = t.config) == null ? void 0 : W.axiosRequestConfig), { convertKeyToTitle: r } = ze(), { i18n: { t: K } } = ve.useI18n(), q = h(() => t.keySetId ? `${O.form[t.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, t.keySetId) : O.form[t.config.app].edit.all), z = h(() => {
937
+ setup(a, { emit: q }) {
938
+ var H;
939
+ const _ = q, t = a, { axiosInstance: c } = he((H = t.config) == null ? void 0 : H.axiosRequestConfig), { convertKeyToTitle: d } = ze(), { i18n: { t: x } } = be.useI18n(), N = h(() => t.keySetId ? `${P.form[t.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, t.keySetId) : P.form[t.config.app].edit.all), z = h(() => {
925
940
  var y;
926
- return (y = O.form[t.config.app]) == null ? void 0 : y.getKeySet;
927
- }), $ = w(), e = w({}), C = w(t.keySetId || ""), D = w(""), T = w(!1), J = async (y) => {
928
- var g;
929
- $.value = y, C.value = (g = y == null ? void 0 : y.set) == null ? void 0 : g.id, _("fetch:success", y), E(y);
941
+ return (y = P.form[t.config.app]) == null ? void 0 : y.getKeySet;
942
+ }), $ = w(), e = w({}), K = w(t.keySetId || ""), T = w(""), B = w(!1), L = async (y) => {
943
+ var m;
944
+ $.value = y, K.value = (m = y == null ? void 0 : y.set) == null ? void 0 : m.id, _("fetch:success", y), M(y);
930
945
  };
931
- ee(C, async () => {
932
- var g, j;
933
- if (!C.value)
946
+ le(K, async () => {
947
+ var m, j;
948
+ if (!K.value)
934
949
  return;
935
950
  let y = `${t.config.apiBaseUrl}${z.value}`;
936
- t.config.app === "konnect" ? y = y.replace(/{controlPlaneId}/gi, ((g = t.config) == null ? void 0 : g.controlPlaneId) || "").replace(/{keySetId}/gi, C.value || "") : t.config.app === "kongManager" && (y = y.replace(/\/{workspace}/gi, (j = t.config) != null && j.workspace ? `/${t.config.workspace}` : "").replace(/{keySetId}/gi, C.value || ""));
951
+ t.config.app === "konnect" ? y = y.replace(/{controlPlaneId}/gi, ((m = t.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{keySetId}/gi, K.value || "") : t.config.app === "kongManager" && (y = y.replace(/\/{workspace}/gi, (j = t.config) != null && j.workspace ? `/${t.config.workspace}` : "").replace(/{keySetId}/gi, K.value || ""));
937
952
  try {
938
- T.value = !0;
939
- const { data: v } = await f.get(y, {
940
- validateStatus: (I) => I === 404 || I >= 200 && I < 300
953
+ B.value = !0;
954
+ const { data: g } = await c.get(y, {
955
+ validateStatus: (S) => S === 404 || S >= 200 && S < 300
941
956
  // in case KeySet is deleted
942
957
  });
943
- D.value = (v == null ? void 0 : v.name) || (v == null ? void 0 : v.id);
944
- } catch (v) {
945
- _("fetch:error", v);
958
+ T.value = (g == null ? void 0 : g.name) || (g == null ? void 0 : g.id);
959
+ } catch (g) {
960
+ _("fetch:error", g);
946
961
  } finally {
947
- T.value = !1;
962
+ B.value = !1;
948
963
  }
949
964
  }, { immediate: !0 });
950
- const E = (y) => {
951
- var g, j;
965
+ const M = (y) => {
966
+ var m, j;
952
967
  try {
953
968
  if (y.jwk) {
954
- const v = JSON.parse(y.jwk);
955
- Object.keys(v).forEach((I) => {
969
+ const g = JSON.parse(y.jwk);
970
+ Object.keys(g).forEach((S) => {
956
971
  e.value = {
957
972
  ...e.value,
958
- [`jwk.${I}`]: v[I]
973
+ [`jwk.${S}`]: g[S]
959
974
  };
960
975
  });
961
976
  } else
962
977
  e.value = {
963
- "pem.public_key": (g = y == null ? void 0 : y.pem) == null ? void 0 : g.public_key,
978
+ "pem.public_key": (m = y == null ? void 0 : y.pem) == null ? void 0 : m.public_key,
964
979
  "pem.private_key": (j = y == null ? void 0 : y.pem) == null ? void 0 : j.private_key
965
980
  };
966
- } catch (v) {
967
- _("fetch:error", v);
981
+ } catch (g) {
982
+ _("fetch:error", g);
968
983
  }
969
984
  return e;
970
- }, G = w({
985
+ }, X = w({
971
986
  id: {},
972
987
  name: {
973
- tooltip: K("keys.form.fields.name.tooltip")
988
+ tooltip: x("keys.form.fields.name.tooltip")
974
989
  },
975
990
  last_updated: {},
976
991
  created: {},
977
992
  set: {
978
- label: K("keys.form.fields.set.label"),
979
- section: ke.Basic,
980
- tooltip: K("keys.form.fields.set.tooltip"),
993
+ label: x("keys.form.fields.set.label"),
994
+ section: me.Basic,
995
+ tooltip: x("keys.form.fields.set.tooltip"),
981
996
  order: 5
982
997
  },
983
998
  kid: {
984
- label: K("keys.form.fields.kid.label"),
985
- section: ke.Basic,
986
- tooltip: K("keys.form.fields.kid.tooltip")
999
+ label: x("keys.form.fields.kid.label"),
1000
+ section: me.Basic,
1001
+ tooltip: x("keys.form.fields.kid.tooltip")
987
1002
  },
988
1003
  tags: {
989
- tooltip: K("keys.form.fields.tags.tooltip")
1004
+ tooltip: x("keys.form.fields.tags.tooltip")
990
1005
  },
991
1006
  // advanced fields
992
1007
  jwk: {
993
- label: K("keys.form.fields.jwk.label"),
994
- type: ue.Json
1008
+ label: x("keys.form.fields.jwk.label"),
1009
+ type: pe.Json
995
1010
  },
996
1011
  pem: {
997
- section: ke.Advanced,
998
- label: K("keys.form.fields.key_format.options.pem"),
999
- type: ue.Json
1012
+ section: me.Advanced,
1013
+ label: x("keys.form.fields.key_format.options.pem"),
1014
+ type: pe.Json
1000
1015
  }
1001
1016
  });
1002
- return (y, g) => {
1003
- var v, I;
1004
- const j = B("KSkeleton");
1005
- return S(), N("div", pt, [
1006
- u(l(Ge), {
1007
- config: i.config,
1008
- "config-card-doc": i.configCardDoc,
1009
- "config-schema": G.value,
1010
- "entity-type": l(Ke).Key,
1011
- "fetch-url": q.value,
1012
- "hide-title": i.hideTitle,
1013
- "onFetch:error": g[0] || (g[0] = (p) => y.$emit("fetch:error", p)),
1014
- "onFetch:success": J,
1015
- onLoading: g[1] || (g[1] = (p) => y.$emit("loading", p))
1016
- }, pe({
1017
- set: k(({ row: p }) => [
1018
- T.value ? (S(), R(j, {
1017
+ return (y, m) => {
1018
+ var g, S;
1019
+ const j = F("KSkeleton");
1020
+ return b(), W("div", ut, [
1021
+ f(l(Xe), {
1022
+ config: a.config,
1023
+ "config-card-doc": a.configCardDoc,
1024
+ "config-schema": X.value,
1025
+ "entity-type": l(Ve).Key,
1026
+ "fetch-url": N.value,
1027
+ "hide-title": a.hideTitle,
1028
+ "onFetch:error": m[0] || (m[0] = (k) => y.$emit("fetch:error", k)),
1029
+ "onFetch:success": L,
1030
+ onLoading: m[1] || (m[1] = (k) => y.$emit("loading", k))
1031
+ }, ge({
1032
+ set: u(({ row: k }) => [
1033
+ B.value ? (b(), V(j, {
1019
1034
  key: 0,
1020
1035
  "data-testid": "key-set-name-loader",
1021
1036
  type: "spinner"
1022
- })) : p.value && p.value.id === C.value && D.value ? (S(), R(l(Xe), {
1037
+ })) : k.value && k.value.id === K.value && T.value ? (b(), V(l(Ye), {
1023
1038
  key: 1,
1024
1039
  item: {
1025
- key: p.value.id,
1026
- value: D.value,
1027
- type: l(ue).LinkInternal
1040
+ key: k.value.id,
1041
+ value: T.value,
1042
+ type: l(pe).LinkInternal
1028
1043
  },
1029
- onClick: (te) => y.$emit("navigation-click", p.value.id, "key-sets")
1030
- }, null, 8, ["item", "onClick"])) : (S(), N("div", mt, x("–")))
1044
+ onClick: (ie) => y.$emit("navigation-click", k.value.id, "key-sets")
1045
+ }, null, 8, ["item", "onClick"])) : (b(), W("div", kt, C("–")))
1031
1046
  ]),
1032
1047
  _: 2
1033
1048
  }, [
1034
- (v = $.value) != null && v.jwk ? {
1049
+ (g = $.value) != null && g.jwk ? {
1035
1050
  name: "jwk",
1036
- fn: k(() => [
1037
- (S(!0), N(_e, null, Se(Object.keys(e.value), (p) => (S(), R(l(we), {
1038
- key: p,
1039
- "data-testid": `${p}`,
1051
+ fn: u(() => [
1052
+ (b(!0), W(we, null, Ie(Object.keys(e.value), (k) => (b(), V(l($e), {
1053
+ key: k,
1054
+ "data-testid": `${k}`,
1040
1055
  item: {
1041
- key: p,
1042
- label: l(r)(p),
1043
- value: e.value[p]
1056
+ key: k,
1057
+ label: l(d)(k),
1058
+ value: e.value[k]
1044
1059
  }
1045
1060
  }, null, 8, ["data-testid", "item"]))), 128))
1046
1061
  ]),
1047
1062
  key: "0"
1048
1063
  } : void 0,
1049
- (I = $.value) != null && I.pem ? {
1064
+ (S = $.value) != null && S.pem ? {
1050
1065
  name: "pem",
1051
- fn: k(() => [
1052
- (S(!0), N(_e, null, Se(Object.keys(e.value), (p) => (S(), R(l(we), {
1053
- key: p,
1054
- "data-testid": `${p}`,
1066
+ fn: u(() => [
1067
+ (b(!0), W(we, null, Ie(Object.keys(e.value), (k) => (b(), V(l($e), {
1068
+ key: k,
1069
+ "data-testid": `${k}`,
1055
1070
  item: {
1056
- key: p,
1057
- label: l(r)(p),
1058
- value: e.value[p]
1071
+ key: k,
1072
+ label: l(d)(k),
1073
+ value: e.value[k]
1059
1074
  }
1060
1075
  }, null, 8, ["data-testid", "item"]))), 128))
1061
1076
  ]),
@@ -1067,7 +1082,7 @@ const ve = {
1067
1082
  }
1068
1083
  });
1069
1084
  export {
1070
- wt as KeyConfigCard,
1071
- It as KeyForm,
1072
- St as KeyList
1085
+ St as KeyConfigCard,
1086
+ _t as KeyForm,
1087
+ bt as KeyList
1073
1088
  };