@kong-ui-public/entities-keys 3.5.3 → 3.5.4

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 I, computed as S, watch as ee, onBeforeMount as Se, resolveComponent as M, openBlock as h, createElementBlock as V, createVNode as k, unref as s, withCtx as y, createBlock as D, Teleport as je, withDirectives as $e, createTextVNode as Z, toDisplayString as C, vShow as Ee, createElementVNode as q, Fragment as ke, renderList as pe, withModifiers as xe, reactive as be, createCommentVNode as se, createSlots as Me } from "vue";
1
+ import { defineComponent as me, ref as I, computed as S, watch as ee, onBeforeMount as Se, resolveComponent as M, openBlock as h, createElementBlock as V, createVNode as k, unref as a, withCtx as y, createBlock as D, Teleport as je, withDirectives as $e, createTextVNode as Z, toDisplayString as C, vShow as Ee, createElementVNode as q, Fragment as ke, renderList as pe, withModifiers as xe, reactive as be, createCommentVNode as ae, createSlots as Me } from "vue";
2
2
  import { useRouter as Ie } from "vue-router";
3
3
  import { AddIcon as De } from "@kong/icons";
4
4
  import { createI18n as Fe, i18nTComponent as Re } from "@kong-ui-public/i18n";
5
- import { useAxios as ge, useFetcher as Te, useDeleteUrlBuilder as Ve, FetcherStatus as Be, EntityBaseTable as Ae, EntityFilter as Ue, PermissionsWrapper as ae, EntityDeleteModal as qe, EntityTypes as Pe, useErrors as Oe, EntityBaseFormType as ne, useDebouncedFilter as Ne, EntityBaseForm as Je, SupportedEntityType as we, EntityFormSection as he, useStringHelpers as We, ConfigurationSchemaSection as fe, ConfigurationSchemaType as ue, EntityBaseConfigCard as Le, InternalLinkItem as Qe, ConfigCardItem as _e } from "@kong-ui-public/entities-shared";
6
- const Ge = {
5
+ import { useAxios as ge, useFetcher as Te, useDeleteUrlBuilder as Ve, FetcherStatus as Be, EntityBaseTable as Ae, EntityFilter as Ue, PermissionsWrapper as se, EntityDeleteModal as qe, EntityTypes as Pe, useErrors as Oe, EntityBaseFormType as re, useDebouncedFilter as Ne, EntityBaseForm as Je, SupportedEntityType as we, EntityFormSection as he, useStringHelpers as We, ConfigurationSchemaSection as fe, ConfigurationSchemaType as ue, EntityBaseConfigCard as Le, InternalLinkItem as Qe, ConfigCardItem as _e } from "@kong-ui-public/entities-shared";
6
+ const ze = {
7
7
  title: "Keys",
8
8
  list: {
9
9
  toolbar_actions: {
@@ -115,11 +115,11 @@ const Ge = {
115
115
  }
116
116
  }
117
117
  }
118
- }, He = {
119
- keys: Ge
118
+ }, Ge = {
119
+ keys: ze
120
120
  };
121
- function ze() {
122
- const i = Fe("en-us", He);
121
+ function He() {
122
+ const i = Fe("en-us", Ge);
123
123
  return {
124
124
  i18n: i,
125
125
  i18nT: Re(i)
@@ -127,7 +127,7 @@ function ze() {
127
127
  };
128
128
  }
129
129
  const ve = {
130
- useI18n: ze
130
+ useI18n: He
131
131
  }, A = "/v2/control-planes/{controlPlaneId}/core-entities", U = "/{workspace}", P = {
132
132
  list: {
133
133
  konnect: {
@@ -212,7 +212,7 @@ const ve = {
212
212
  emits: ["error", "copy:success", "copy:error", "delete:success"],
213
213
  setup(i, { emit: O }) {
214
214
  var oe;
215
- const _ = O, l = i, { i18n: { t: c } } = ve.useI18n(), d = Ie(), { axiosInstance: K } = ge((oe = l.config) == null ? void 0 : oe.axiosRequestConfig), F = I(1), H = S(() => l.config.app !== "kongManager" || !!l.config.disableSorting), j = {
215
+ const _ = O, l = i, { i18n: { t: c } } = ve.useI18n(), d = Ie(), { axiosInstance: K } = ge((oe = l.config) == null ? void 0 : oe.axiosRequestConfig), F = I(1), G = S(() => l.config.app !== "kongManager" || !!l.config.disableSorting), j = {
216
216
  // the Name column is non-hidable
217
217
  name: { label: c("keys.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
218
218
  kid: { label: c("keys.list.table_headers.key_id"), sortable: !0 },
@@ -220,73 +220,73 @@ const ve = {
220
220
  id: { label: c("keys.list.table_headers.id"), sortable: !0 }
221
221
  }, e = j, w = S(() => {
222
222
  var t, o, f, b;
223
- let a = `${l.config.apiBaseUrl}${P.list[l.config.app][l.config.keySetId ? "forKeySet" : "all"]}`;
224
- return l.config.app === "konnect" ? a = a.replace(/{controlPlaneId}/gi, ((t = l.config) == null ? void 0 : t.controlPlaneId) || "").replace(/{keySetId}/gi, ((o = l.config) == null ? void 0 : o.keySetId) || "") : l.config.app === "kongManager" && (a = a.replace(/\/{workspace}/gi, (f = l.config) != null && f.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, ((b = l.config) == null ? void 0 : b.keySetId) || "")), a;
223
+ let s = `${l.config.apiBaseUrl}${P.list[l.config.app][l.config.keySetId ? "forKeySet" : "all"]}`;
224
+ return l.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((t = l.config) == null ? void 0 : t.controlPlaneId) || "").replace(/{keySetId}/gi, ((o = l.config) == null ? void 0 : o.keySetId) || "") : l.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (f = l.config) != null && f.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, ((b = l.config) == null ? void 0 : b.keySetId) || "")), s;
225
225
  }), x = I(""), B = S(() => {
226
- const a = l.config.app === "konnect" || l.config.isExactMatch;
227
- if (a)
226
+ const s = l.config.app === "konnect" || l.config.isExactMatch;
227
+ if (s)
228
228
  return {
229
- isExactMatch: a,
229
+ isExactMatch: s,
230
230
  placeholder: c("keys.search.placeholder")
231
231
  };
232
232
  const t = { name: j.name };
233
233
  return {
234
- isExactMatch: a,
234
+ isExactMatch: s,
235
235
  fields: t,
236
236
  schema: l.config.filterSchema
237
237
  };
238
- }), { fetcher: z, fetcherState: X } = Te(l.config, w.value), Y = () => {
238
+ }), { fetcher: H, fetcherState: X } = Te(l.config, w.value), Y = () => {
239
239
  x.value = "";
240
240
  }, J = () => {
241
241
  F.value++;
242
- }, r = I(null), g = (a, t) => {
243
- const o = a.id;
242
+ }, n = I(null), g = (s, t) => {
243
+ const o = s.id;
244
244
  if (!t(o)) {
245
- R(a, "id");
245
+ R(s, "id");
246
246
  return;
247
247
  }
248
- v(a, "id");
249
- }, $ = (a, t) => {
250
- const o = JSON.stringify(a);
248
+ v(s, "id");
249
+ }, $ = (s, t) => {
250
+ const o = JSON.stringify(s);
251
251
  if (!t(o)) {
252
252
  _("copy:error", {
253
- entity: a,
253
+ entity: s,
254
254
  message: c("keys.errors.copy")
255
255
  });
256
256
  return;
257
257
  }
258
258
  _("copy:success", {
259
- entity: a,
259
+ entity: s,
260
260
  message: c("keys.copy.success_brief")
261
261
  });
262
- }, v = (a, t) => {
262
+ }, v = (s, t) => {
263
263
  _("copy:success", {
264
- entity: a,
264
+ entity: s,
265
265
  field: t,
266
- message: c("keys.copy.success", { val: a[t] })
266
+ message: c("keys.copy.success", { val: s[t] })
267
267
  });
268
- }, R = (a, t) => {
268
+ }, R = (s, t) => {
269
269
  _("copy:error", {
270
- entity: a,
270
+ entity: s,
271
271
  field: t,
272
272
  message: c("keys.errors.copy")
273
273
  });
274
- }, p = async (a) => {
274
+ }, p = async (s) => {
275
275
  var o;
276
- await ((o = l.canRetrieve) == null ? void 0 : o.call(l, a)) && d.push(l.config.getViewRoute(a.id));
277
- }, te = (a) => ({
276
+ await ((o = l.canRetrieve) == null ? void 0 : o.call(l, s)) && d.push(l.config.getViewRoute(s.id));
277
+ }, te = (s) => ({
278
278
  label: c("keys.actions.view"),
279
- to: l.config.getViewRoute(a)
280
- }), re = (a) => ({
279
+ to: l.config.getViewRoute(s)
280
+ }), ne = (s) => ({
281
281
  label: c("keys.actions.edit"),
282
- to: l.config.getEditRoute(a)
283
- }), T = I(void 0), W = I(!1), L = I(!1), le = I(""), ie = Ve(l.config, w.value), de = (a) => {
284
- T.value = a, W.value = !0;
282
+ to: l.config.getEditRoute(s)
283
+ }), T = I(void 0), W = I(!1), L = I(!1), le = I(""), ie = Ve(l.config, w.value), de = (s) => {
284
+ T.value = s, W.value = !0;
285
285
  }, ce = () => {
286
286
  W.value = !1;
287
287
  }, ye = async () => {
288
- var a, t, o;
289
- if ((a = T.value) != null && a.id) {
288
+ var s, t, o;
289
+ if ((s = T.value) != null && s.id) {
290
290
  L.value = !0;
291
291
  try {
292
292
  await K.delete(ie(T.value.id)), L.value = !1, W.value = !1, F.value++, _("delete:success", T.value);
@@ -297,47 +297,46 @@ const ve = {
297
297
  }
298
298
  }
299
299
  }, Q = I(!1);
300
- ee(X, (a) => {
300
+ ee(X, (s) => {
301
301
  var t, o, f, b;
302
- if (Array.isArray((t = a == null ? void 0 : a.response) == null ? void 0 : t.data) && (Q.value = a.response.data.length > 0), a.status === Be.Error) {
303
- r.value = {
302
+ if (Array.isArray((t = s == null ? void 0 : s.response) == null ? void 0 : t.data) && (Q.value = s.response.data.length > 0), s.status === Be.Error) {
303
+ n.value = {
304
304
  title: c("keys.errors.general")
305
- }, (b = (f = (o = a.error) == null ? void 0 : o.response) == null ? void 0 : f.data) != null && b.message && (r.value.message = a.error.response.data.message), _("error", a.error);
305
+ }, (b = (f = (o = s.error) == null ? void 0 : o.response) == null ? void 0 : f.data) != null && b.message && (n.value.message = s.error.response.data.message), _("error", s.error);
306
306
  return;
307
307
  }
308
- r.value = null;
308
+ n.value = null;
309
309
  });
310
- const G = I({
310
+ const z = I({
311
311
  ctaPath: l.config.createRoute,
312
312
  ctaText: void 0,
313
313
  message: `${c("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState ? ` ${l.config.additionMessageForEmptyState}` : ""}`,
314
314
  title: c("keys.title")
315
315
  });
316
316
  return Se(async () => {
317
- await l.canCreate() && (G.value.title = c("keys.list.empty_state.title"), G.value.ctaText = c("keys.actions.create"));
318
- }), (a, t) => {
319
- const o = M("KButton"), f = M("KCopy"), b = M("KBadge"), E = M("KTruncate"), n = M("KDropdownItem"), u = M("KClipboardProvider");
317
+ await l.canCreate() && (z.value.title = c("keys.list.empty_state.title"), z.value.ctaText = c("keys.actions.create"));
318
+ }), (s, t) => {
319
+ const o = M("KButton"), f = M("KCopy"), b = M("KBadge"), E = M("KTruncate"), r = M("KDropdownItem"), u = M("KClipboardProvider");
320
320
  return h(), V("div", Xe, [
321
- k(s(Ae), {
321
+ k(a(Ae), {
322
322
  "cache-identifier": i.cacheIdentifier,
323
323
  "disable-pagination-page-jump": "",
324
- "disable-sorting": H.value,
325
- "empty-state-options": G.value,
324
+ "disable-sorting": G.value,
325
+ "empty-state-options": z.value,
326
326
  "enable-entity-actions": "",
327
- "error-message": r.value,
328
- fetcher: s(z),
327
+ "error-message": n.value,
328
+ fetcher: a(H),
329
329
  "fetcher-cache-key": F.value,
330
330
  "pagination-type": "offset",
331
331
  "preferences-storage-key": "kong-ui-entities-keys-list",
332
332
  query: x.value,
333
- "table-headers": s(e),
334
- "use-action-outside": i.useActionOutside,
333
+ "table-headers": a(e),
335
334
  onClearSearchInput: Y,
336
335
  "onClick:row": t[2] || (t[2] = (m) => p(m)),
337
336
  onSort: J
338
337
  }, {
339
338
  "toolbar-filter": y(() => [
340
- k(s(Ue), {
339
+ k(a(Ue), {
341
340
  modelValue: x.value,
342
341
  "onUpdate:modelValue": t[0] || (t[0] = (m) => x.value = m),
343
342
  config: B.value
@@ -348,22 +347,22 @@ const ve = {
348
347
  disabled: !i.useActionOutside,
349
348
  to: "#kong-ui-app-page-header-action-button"
350
349
  }, [
351
- k(s(ae), {
350
+ k(a(se), {
352
351
  "auth-function": () => i.canCreate()
353
352
  }, {
354
353
  default: y(() => [
355
354
  $e(k(o, {
356
355
  appearance: "primary",
357
356
  "data-testid": "toolbar-add-key",
358
- size: "large",
357
+ size: i.useActionOutside ? "medium" : "large",
359
358
  to: i.config.createRoute
360
359
  }, {
361
360
  default: y(() => [
362
- k(s(De)),
363
- Z(" " + C(s(c)("keys.list.toolbar_actions.new_key")), 1)
361
+ k(a(De)),
362
+ Z(" " + C(a(c)("keys.list.toolbar_actions.new_key")), 1)
364
363
  ]),
365
364
  _: 1
366
- }, 8, ["to"]), [
365
+ }, 8, ["size", "to"]), [
367
366
  [Ee, Q.value]
368
367
  ])
369
368
  ]),
@@ -403,12 +402,12 @@ const ve = {
403
402
  actions: y(({ row: m }) => [
404
403
  k(u, null, {
405
404
  default: y(({ copyToClipboard: N }) => [
406
- k(n, {
405
+ k(r, {
407
406
  "data-testid": "action-entity-copy-id",
408
407
  onClick: (Ke) => g(m, N)
409
408
  }, {
410
409
  default: y(() => [
411
- Z(C(s(c)("keys.actions.copy_id")), 1)
410
+ Z(C(a(c)("keys.actions.copy_id")), 1)
412
411
  ]),
413
412
  _: 2
414
413
  }, 1032, ["onClick"])
@@ -417,23 +416,23 @@ const ve = {
417
416
  }, 1024),
418
417
  k(u, null, {
419
418
  default: y(({ copyToClipboard: N }) => [
420
- k(n, {
419
+ k(r, {
421
420
  "data-testid": "action-entity-copy-json",
422
421
  onClick: (Ke) => $(m, N)
423
422
  }, {
424
423
  default: y(() => [
425
- Z(C(s(c)("keys.actions.copy_json")), 1)
424
+ Z(C(a(c)("keys.actions.copy_json")), 1)
426
425
  ]),
427
426
  _: 2
428
427
  }, 1032, ["onClick"])
429
428
  ]),
430
429
  _: 2
431
430
  }, 1024),
432
- k(s(ae), {
431
+ k(a(se), {
433
432
  "auth-function": () => i.canRetrieve(m)
434
433
  }, {
435
434
  default: y(() => [
436
- k(n, {
435
+ k(r, {
437
436
  "data-testid": "action-entity-view",
438
437
  "has-divider": "",
439
438
  item: te(m.id)
@@ -441,29 +440,29 @@ const ve = {
441
440
  ]),
442
441
  _: 2
443
442
  }, 1032, ["auth-function"]),
444
- k(s(ae), {
443
+ k(a(se), {
445
444
  "auth-function": () => i.canEdit(m)
446
445
  }, {
447
446
  default: y(() => [
448
- k(n, {
447
+ k(r, {
449
448
  "data-testid": "action-entity-edit",
450
- item: re(m.id)
449
+ item: ne(m.id)
451
450
  }, null, 8, ["item"])
452
451
  ]),
453
452
  _: 2
454
453
  }, 1032, ["auth-function"]),
455
- k(s(ae), {
454
+ k(a(se), {
456
455
  "auth-function": () => i.canDelete(m)
457
456
  }, {
458
457
  default: y(() => [
459
- k(n, {
458
+ k(r, {
460
459
  danger: "",
461
460
  "data-testid": "action-entity-delete",
462
461
  "has-divider": "",
463
462
  onClick: (N) => de(m)
464
463
  }, {
465
464
  default: y(() => [
466
- Z(C(s(c)("keys.actions.delete")), 1)
465
+ Z(C(a(c)("keys.actions.delete")), 1)
467
466
  ]),
468
467
  _: 2
469
468
  }, 1032, ["onClick"])
@@ -472,15 +471,15 @@ const ve = {
472
471
  }, 1032, ["auth-function"])
473
472
  ]),
474
473
  _: 1
475
- }, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "use-action-outside"]),
476
- k(s(qe), {
474
+ }, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers"]),
475
+ k(a(qe), {
477
476
  "action-pending": L.value,
478
- description: s(c)("keys.delete.description"),
477
+ description: a(c)("keys.delete.description"),
479
478
  "entity-name": T.value && (T.value.name || T.value.id),
480
- "entity-type": s(Pe).Key,
479
+ "entity-type": a(Pe).Key,
481
480
  error: le.value,
482
481
  "need-confirm": !1,
483
- title: s(c)("keys.delete.title"),
482
+ title: a(c)("keys.delete.title"),
484
483
  visible: W.value,
485
484
  onCancel: ce,
486
485
  onProceed: ye
@@ -493,11 +492,11 @@ const ve = {
493
492
  for (const [l, c] of O)
494
493
  _[l] = c;
495
494
  return _;
496
- }, pt = /* @__PURE__ */ Ce(Ze, [["__scopeId", "data-v-58d43c7d"]]), et = { class: "kong-ui-entities-keys-form" }, tt = { "data-testid": "no-search-results" }, lt = { class: "select-item-container" }, it = { class: "select-item-label" }, ot = { class: "select-item-description" }, st = {
495
+ }, pt = /* @__PURE__ */ Ce(Ze, [["__scopeId", "data-v-7ca9a3a4"]]), et = { class: "kong-ui-entities-keys-form" }, tt = { "data-testid": "no-search-results" }, lt = { class: "select-item-container" }, it = { class: "select-item-label" }, ot = { class: "select-item-description" }, at = {
497
496
  key: 0,
498
497
  class: "invalid-key-set-message",
499
498
  "data-testid": "invalid-key-set-message"
500
- }, at = { "data-testid": "key-format-container" }, nt = /* @__PURE__ */ me({
499
+ }, st = { "data-testid": "key-format-container" }, rt = /* @__PURE__ */ me({
501
500
  __name: "KeyForm",
502
501
  props: {
503
502
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -535,8 +534,8 @@ const ve = {
535
534
  },
536
535
  emits: ["update", "error", "loading"],
537
536
  setup(i, { emit: O }) {
538
- var a;
539
- const _ = O, l = i, c = Ie(), { i18n: { t: d } } = ve.useI18n(), { getMessageFromError: K } = Oe(), { axiosInstance: F } = ge((a = l.config) == null ? void 0 : a.axiosRequestConfig), H = S(() => l.keySetId ? P.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi, l.keySetId) : P.form[l.config.app].edit.all), j = S(() => l.keyId ? ne.Edit : ne.Create), e = be({
537
+ var s;
538
+ const _ = O, l = i, c = Ie(), { i18n: { t: d } } = ve.useI18n(), { getMessageFromError: K } = Oe(), { axiosInstance: F } = ge((s = l.config) == null ? void 0 : s.axiosRequestConfig), G = S(() => l.keySetId ? P.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi, l.keySetId) : P.form[l.config.app].edit.all), j = S(() => l.keyId ? re.Edit : re.Create), e = be({
540
539
  fields: {
541
540
  name: "",
542
541
  tags: "",
@@ -567,16 +566,16 @@ const ve = {
567
566
  label: d("keys.form.fields.key_format.options.pem"),
568
567
  value: "pem"
569
568
  }
570
- ], B = S(() => e.isReadonly || j.value === ne.Create && !!l.fixedKeySetId), z = S(() => !B.value);
569
+ ], B = S(() => e.isReadonly || j.value === re.Create && !!l.fixedKeySetId), H = S(() => !B.value);
571
570
  ee(() => l.fixedKeySetId, (t) => {
572
- j.value === ne.Create && (e.fields.key_set = t);
571
+ j.value === re.Create && (e.fields.key_set = t);
573
572
  }, { immediate: !0 });
574
573
  const X = S(() => JSON.stringify(e.fields) !== JSON.stringify(w) && !!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)), Y = (t) => {
575
574
  var o, f, b, E;
576
575
  e.fields.key_id = (t == null ? void 0 : t.kid) || "", e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((o = t == null ? void 0 : t.tags) == null ? void 0 : o.join(", ")) || "", e.fields.key_set = ((f = t == null ? void 0 : t.set) == null ? void 0 : f.id) || "", e.fields.key_format = t != null && t.pem ? "pem" : "jwk", e.fields.jwk = (t == null ? void 0 : t.jwk) || "", e.fields.private_key = ((b = t == null ? void 0 : t.pem) == null ? void 0 : b.private_key) || "", e.fields.public_key = ((E = t == null ? void 0 : t.pem) == null ? void 0 : E.public_key) || "", Object.assign(w, e.fields);
577
576
  }, J = () => {
578
577
  c.push(l.config.cancelRoute);
579
- }, r = S(() => {
578
+ }, n = S(() => {
580
579
  var o, f;
581
580
  let t = `${l.config.apiBaseUrl}${P.form[l.config.app][j.value][l.keySetId ? "forKeySet" : "all"]}`;
582
581
  return l.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((o = l.config) == null ? void 0 : o.controlPlaneId) || "") : l.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (f = l.config) != null && f.workspace ? `/${l.config.workspace}` : "")), t = t.replace(/{id}/gi, l.keyId).replace(/{keySetId}/gi, l.keySetId || ""), t;
@@ -594,13 +593,13 @@ const ve = {
594
593
  var t, o, f, b, E;
595
594
  try {
596
595
  e.isReadonly = !0;
597
- let n;
598
- if (j.value === "create" ? n = await F.post(r.value, g.value) : j.value === "edit" && (n = ((t = l.config) == null ? void 0 : t.app) === "konnect" ? await F.put(r.value, g.value) : await F.patch(r.value, g.value)), n) {
599
- const { data: u } = n;
600
- e.fields.key_id = (u == null ? void 0 : u.kid) || "", e.fields.name = (u == null ? void 0 : u.name) || "", e.fields.tags = ((o = u == null ? void 0 : u.tags) == null ? void 0 : o.join(", ")) || "", e.fields.key_set = ((f = u == null ? void 0 : u.set) == null ? void 0 : f.id) || "", e.fields.key_format = u != null && u.pem ? "pem" : "jwk", e.fields.jwk = (u == null ? void 0 : u.jwk) || "", e.fields.private_key = ((b = u == null ? void 0 : u.pem) == null ? void 0 : b.private_key) || "", e.fields.public_key = ((E = u == null ? void 0 : u.pem) == null ? void 0 : E.public_key) || "", Object.assign(w, e.fields), _("update", n == null ? void 0 : n.data);
596
+ let r;
597
+ if (j.value === "create" ? r = await F.post(n.value, g.value) : j.value === "edit" && (r = ((t = l.config) == null ? void 0 : t.app) === "konnect" ? await F.put(n.value, g.value) : await F.patch(n.value, g.value)), r) {
598
+ const { data: u } = r;
599
+ e.fields.key_id = (u == null ? void 0 : u.kid) || "", e.fields.name = (u == null ? void 0 : u.name) || "", e.fields.tags = ((o = u == null ? void 0 : u.tags) == null ? void 0 : o.join(", ")) || "", e.fields.key_set = ((f = u == null ? void 0 : u.set) == null ? void 0 : f.id) || "", e.fields.key_format = u != null && u.pem ? "pem" : "jwk", e.fields.jwk = (u == null ? void 0 : u.jwk) || "", e.fields.private_key = ((b = u == null ? void 0 : u.pem) == null ? void 0 : b.private_key) || "", e.fields.public_key = ((E = u == null ? void 0 : u.pem) == null ? void 0 : E.public_key) || "", Object.assign(w, e.fields), _("update", r == null ? void 0 : r.data);
601
600
  }
602
- } catch (n) {
603
- e.errorMessage = K(n), _("error", n);
601
+ } catch (r) {
602
+ e.errorMessage = K(r), _("error", r);
604
603
  } finally {
605
604
  e.isReadonly = !1;
606
605
  }
@@ -609,7 +608,7 @@ const ve = {
609
608
  loading: R,
610
609
  allRecords: p,
611
610
  error: te,
612
- validationError: re,
611
+ validationError: ne,
613
612
  loadItems: T,
614
613
  results: W
615
614
  } = Ne(l.config, P.form[l.config.app].keySets, void 0, {
@@ -617,10 +616,10 @@ const ve = {
617
616
  searchKeys: ["id", "name"]
618
617
  }), L = (t) => {
619
618
  (!t || t !== e.fields.key_set && t !== w.key_set) && v(t);
620
- }, le = S(() => te.value ? d("keys.errors.key_sets.fetch") : ""), ie = S(() => re.value ? d("keys.errors.key_sets.invalid") : ""), de = I(0), ce = S(() => p.value === void 0), ye = S(() => {
619
+ }, le = S(() => te.value ? d("keys.errors.key_sets.fetch") : ""), ie = S(() => ne.value ? d("keys.errors.key_sets.invalid") : ""), de = I(0), ce = S(() => p.value === void 0), ye = S(() => {
621
620
  if (ce.value)
622
621
  return l.config.app === "konnect" ? d("keys.form.fields.key_set.footer") : void 0;
623
- }), Q = I(/* @__PURE__ */ new Set()), G = S(() => Array.from(Q.value).map((o) => ({
622
+ }), Q = I(/* @__PURE__ */ new Set()), z = S(() => Array.from(Q.value).map((o) => ({
624
623
  name: o.name || "",
625
624
  // can't use name for label or it tries to search => 404
626
625
  label: "",
@@ -635,129 +634,129 @@ const ve = {
635
634
  };
636
635
  return ee(W, (t) => {
637
636
  oe(t);
638
- }, { immediate: !0, deep: !0 }), ee(G, () => {
637
+ }, { immediate: !0, deep: !0 }), ee(z, () => {
639
638
  de.value++;
640
639
  }, { immediate: !0, deep: !0 }), Se(async () => {
641
640
  await T();
642
641
  }), (t, o) => {
643
642
  const f = M("KInput"), b = M("KSelect"), E = M("KTextArea");
644
643
  return h(), V("div", et, [
645
- k(s(Je), {
644
+ k(a(Je), {
646
645
  "can-submit": X.value,
647
646
  config: i.config,
648
647
  "edit-id": i.keyId,
649
648
  "enable-terraform": i.enableTerraform,
650
- "entity-type": s(we).Key,
649
+ "entity-type": a(we).Key,
651
650
  "error-message": e.errorMessage || le.value,
652
- "fetch-url": H.value,
651
+ "fetch-url": G.value,
653
652
  "form-fields": g.value,
654
653
  "is-readonly": e.isReadonly,
655
654
  onCancel: J,
656
- "onFetch:error": o[8] || (o[8] = (n) => t.$emit("error", n)),
655
+ "onFetch:error": o[8] || (o[8] = (r) => t.$emit("error", r)),
657
656
  "onFetch:success": Y,
658
- onLoading: o[9] || (o[9] = (n) => t.$emit("loading", n)),
657
+ onLoading: o[9] || (o[9] = (r) => t.$emit("loading", r)),
659
658
  onSubmit: $
660
659
  }, {
661
660
  default: y(() => [
662
- k(s(he), {
663
- description: s(d)("keys.form.sections.general.description"),
664
- title: s(d)("keys.form.sections.general.title")
661
+ k(a(he), {
662
+ description: a(d)("keys.form.sections.general.description"),
663
+ title: a(d)("keys.form.sections.general.title")
665
664
  }, {
666
665
  default: y(() => [
667
666
  k(f, {
668
667
  modelValue: e.fields.key_id,
669
- "onUpdate:modelValue": o[0] || (o[0] = (n) => e.fields.key_id = n),
668
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => e.fields.key_id = r),
670
669
  modelModifiers: { trim: !0 },
671
670
  autocomplete: "off",
672
671
  "data-testid": "key-form-id",
673
- help: s(d)("keys.form.fields.id.help"),
674
- label: s(d)("keys.form.fields.id.label"),
672
+ help: a(d)("keys.form.fields.id.help"),
673
+ label: a(d)("keys.form.fields.id.label"),
675
674
  "label-attributes": {
676
- info: s(d)("keys.form.fields.id.tooltip"),
675
+ info: a(d)("keys.form.fields.id.tooltip"),
677
676
  tooltipAttributes: { maxWidth: "400" }
678
677
  },
679
- placeholder: s(d)("keys.form.fields.id.placeholder"),
678
+ placeholder: a(d)("keys.form.fields.id.placeholder"),
680
679
  readonly: e.isReadonly,
681
680
  required: "",
682
681
  type: "text"
683
682
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"]),
684
683
  k(f, {
685
684
  modelValue: e.fields.name,
686
- "onUpdate:modelValue": o[1] || (o[1] = (n) => e.fields.name = n),
685
+ "onUpdate:modelValue": o[1] || (o[1] = (r) => e.fields.name = r),
687
686
  modelModifiers: { trim: !0 },
688
687
  autocomplete: "off",
689
688
  "data-testid": "key-form-name",
690
- label: s(d)("keys.form.fields.name.label"),
691
- placeholder: s(d)("keys.form.fields.name.placeholder"),
689
+ label: a(d)("keys.form.fields.name.label"),
690
+ placeholder: a(d)("keys.form.fields.name.placeholder"),
692
691
  readonly: e.isReadonly,
693
692
  type: "text"
694
693
  }, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
695
694
  k(b, {
696
695
  modelValue: e.fields.key_set,
697
- "onUpdate:modelValue": o[2] || (o[2] = (n) => e.fields.key_set = n),
698
- clearable: z.value,
696
+ "onUpdate:modelValue": o[2] || (o[2] = (r) => e.fields.key_set = r),
697
+ clearable: H.value,
699
698
  "data-testid": "key-form-key-set",
700
699
  "dropdown-footer-text": ye.value,
701
700
  "enable-filtering": "",
702
701
  "filter-function": () => !0,
703
- items: G.value,
704
- label: s(d)("keys.form.fields.key_set.label"),
705
- loading: s(R),
706
- placeholder: s(d)("keys.form.fields.key_set.placeholder"),
702
+ items: z.value,
703
+ label: a(d)("keys.form.fields.key_set.label"),
704
+ loading: a(R),
705
+ placeholder: a(d)("keys.form.fields.key_set.placeholder"),
707
706
  readonly: B.value,
708
707
  width: "100%",
709
708
  onQueryChange: L
710
709
  }, {
711
710
  loading: y(() => [
712
- q("div", null, C(s(d)("keys.actions.loading")), 1)
711
+ q("div", null, C(a(d)("keys.actions.loading")), 1)
713
712
  ]),
714
713
  empty: y(() => [
715
- q("div", tt, C(s(d)("keys.search.no_results")), 1)
714
+ q("div", tt, C(a(d)("keys.search.no_results")), 1)
716
715
  ]),
717
- "selected-item-template": y(({ item: n }) => [
718
- q("div", null, C(n.name), 1)
716
+ "selected-item-template": y(({ item: r }) => [
717
+ q("div", null, C(r.name), 1)
719
718
  ]),
720
- "item-template": y(({ item: n }) => [
719
+ "item-template": y(({ item: r }) => [
721
720
  q("div", lt, [
722
- q("div", it, C(n.name), 1),
723
- q("div", ot, C(n.value), 1)
721
+ q("div", it, C(r.name), 1),
722
+ q("div", ot, C(r.value), 1)
724
723
  ])
725
724
  ]),
726
725
  _: 1
727
726
  }, 8, ["modelValue", "clearable", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"]),
728
- ie.value ? (h(), V("p", st, C(ie.value), 1)) : se("", !0),
727
+ ie.value ? (h(), V("p", at, C(ie.value), 1)) : ae("", !0),
729
728
  k(f, {
730
729
  modelValue: e.fields.tags,
731
- "onUpdate:modelValue": o[3] || (o[3] = (n) => e.fields.tags = n),
730
+ "onUpdate:modelValue": o[3] || (o[3] = (r) => e.fields.tags = r),
732
731
  modelModifiers: { trim: !0 },
733
732
  autocomplete: "off",
734
733
  "data-testid": "key-form-tags",
735
- help: s(d)("keys.form.fields.tags.help"),
736
- label: s(d)("keys.form.fields.tags.label"),
734
+ help: a(d)("keys.form.fields.tags.help"),
735
+ label: a(d)("keys.form.fields.tags.label"),
737
736
  "label-attributes": {
738
- info: s(d)("keys.form.fields.tags.tooltip"),
737
+ info: a(d)("keys.form.fields.tags.tooltip"),
739
738
  tooltipAttributes: { maxWidth: "400" }
740
739
  },
741
- placeholder: s(d)("keys.form.fields.tags.placeholder"),
740
+ placeholder: a(d)("keys.form.fields.tags.placeholder"),
742
741
  readonly: e.isReadonly,
743
742
  type: "text"
744
743
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
745
744
  ]),
746
745
  _: 1
747
746
  }, 8, ["description", "title"]),
748
- k(s(he), {
749
- description: s(d)("keys.form.sections.keys.description"),
747
+ k(a(he), {
748
+ description: a(d)("keys.form.sections.keys.description"),
750
749
  "has-divider": "",
751
- title: s(d)("keys.form.sections.keys.title")
750
+ title: a(d)("keys.form.sections.keys.title")
752
751
  }, {
753
752
  default: y(() => [
754
- q("div", at, [
753
+ q("div", st, [
755
754
  k(b, {
756
755
  modelValue: e.fields.key_format,
757
- "onUpdate:modelValue": o[4] || (o[4] = (n) => e.fields.key_format = n),
756
+ "onUpdate:modelValue": o[4] || (o[4] = (r) => e.fields.key_format = r),
758
757
  "data-testid": "key-form-key-format",
759
758
  items: x,
760
- label: s(d)("keys.form.fields.key_format.label"),
759
+ label: a(d)("keys.form.fields.key_format.label"),
761
760
  readonly: e.isReadonly,
762
761
  required: "",
763
762
  width: "100%"
@@ -766,43 +765,43 @@ const ve = {
766
765
  e.fields.key_format === "jwk" ? (h(), D(E, {
767
766
  key: 0,
768
767
  modelValue: e.fields.jwk,
769
- "onUpdate:modelValue": o[5] || (o[5] = (n) => e.fields.jwk = n),
768
+ "onUpdate:modelValue": o[5] || (o[5] = (r) => e.fields.jwk = r),
770
769
  modelModifiers: { trim: !0 },
771
770
  class: "key-form-textarea",
772
771
  "data-testid": "key-form-jwk",
773
- label: s(d)("keys.form.fields.jwk.label"),
772
+ label: a(d)("keys.form.fields.jwk.label"),
774
773
  "label-attributes": {
775
- info: s(d)("keys.form.fields.jwk.tooltip"),
774
+ info: a(d)("keys.form.fields.jwk.tooltip"),
776
775
  tooltipAttributes: { maxWidth: "400" }
777
776
  },
778
- placeholder: s(d)("keys.form.fields.jwk.placeholder"),
777
+ placeholder: a(d)("keys.form.fields.jwk.placeholder"),
779
778
  readonly: e.isReadonly,
780
779
  required: ""
781
- }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : se("", !0),
780
+ }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : ae("", !0),
782
781
  e.fields.key_format === "pem" ? (h(), D(E, {
783
782
  key: 1,
784
783
  modelValue: e.fields.private_key,
785
- "onUpdate:modelValue": o[6] || (o[6] = (n) => e.fields.private_key = n),
784
+ "onUpdate:modelValue": o[6] || (o[6] = (r) => e.fields.private_key = r),
786
785
  modelModifiers: { trim: !0 },
787
786
  class: "key-form-textarea",
788
787
  "data-testid": "key-form-private-key",
789
- label: s(d)("keys.form.fields.private_key.label"),
790
- placeholder: s(d)("keys.form.fields.private_key.placeholder"),
788
+ label: a(d)("keys.form.fields.private_key.label"),
789
+ placeholder: a(d)("keys.form.fields.private_key.placeholder"),
791
790
  readonly: e.isReadonly,
792
791
  required: ""
793
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : se("", !0),
792
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : ae("", !0),
794
793
  e.fields.key_format === "pem" ? (h(), D(E, {
795
794
  key: 2,
796
795
  modelValue: e.fields.public_key,
797
- "onUpdate:modelValue": o[7] || (o[7] = (n) => e.fields.public_key = n),
796
+ "onUpdate:modelValue": o[7] || (o[7] = (r) => e.fields.public_key = r),
798
797
  modelModifiers: { trim: !0 },
799
798
  class: "key-form-textarea",
800
799
  "data-testid": "key-form-public-key",
801
- label: s(d)("keys.form.fields.public_key.label"),
802
- placeholder: s(d)("keys.form.fields.public_key.placeholder"),
800
+ label: a(d)("keys.form.fields.public_key.label"),
801
+ placeholder: a(d)("keys.form.fields.public_key.placeholder"),
803
802
  readonly: e.isReadonly,
804
803
  required: ""
805
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : se("", !0)
804
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : ae("", !0)
806
805
  ]),
807
806
  _: 1
808
807
  }, 8, ["description", "title"])
@@ -812,7 +811,7 @@ const ve = {
812
811
  ]);
813
812
  };
814
813
  }
815
- }), mt = /* @__PURE__ */ Ce(nt, [["__scopeId", "data-v-c9e601fc"]]), rt = { class: "kong-ui-entities-keys-entity-config-card" }, dt = { key: 2 }, gt = /* @__PURE__ */ me({
814
+ }), mt = /* @__PURE__ */ Ce(rt, [["__scopeId", "data-v-c9e601fc"]]), nt = { class: "kong-ui-entities-keys-entity-config-card" }, dt = { key: 2 }, gt = /* @__PURE__ */ me({
816
815
  __name: "KeyConfigCard",
817
816
  props: {
818
817
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -855,22 +854,22 @@ const ve = {
855
854
  emits: ["loading", "fetch:error", "fetch:success", "navigation-click"],
856
855
  setup(i, { emit: O }) {
857
856
  var J;
858
- const _ = O, l = i, { axiosInstance: c } = ge((J = l.config) == null ? void 0 : J.axiosRequestConfig), { convertKeyToTitle: d } = We(), { i18n: { t: K } } = ve.useI18n(), F = S(() => l.keySetId ? `${P.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, l.keySetId) : P.form[l.config.app].edit.all), H = S(() => {
859
- var r;
860
- return (r = P.form[l.config.app]) == null ? void 0 : r.getKeySet;
861
- }), j = I(), e = I({}), w = I(l.keySetId || ""), x = I(""), B = I(!1), z = async (r) => {
857
+ const _ = O, l = i, { axiosInstance: c } = ge((J = l.config) == null ? void 0 : J.axiosRequestConfig), { convertKeyToTitle: d } = We(), { i18n: { t: K } } = ve.useI18n(), F = S(() => l.keySetId ? `${P.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, l.keySetId) : P.form[l.config.app].edit.all), G = S(() => {
858
+ var n;
859
+ return (n = P.form[l.config.app]) == null ? void 0 : n.getKeySet;
860
+ }), j = I(), e = I({}), w = I(l.keySetId || ""), x = I(""), B = I(!1), H = async (n) => {
862
861
  var g;
863
- j.value = r, w.value = (g = r == null ? void 0 : r.set) == null ? void 0 : g.id, _("fetch:success", r), X(r);
862
+ j.value = n, w.value = (g = n == null ? void 0 : n.set) == null ? void 0 : g.id, _("fetch:success", n), X(n);
864
863
  };
865
864
  ee(w, async () => {
866
865
  var g, $;
867
866
  if (!w.value)
868
867
  return;
869
- let r = `${l.config.apiBaseUrl}${H.value}`;
870
- l.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((g = l.config) == null ? void 0 : g.controlPlaneId) || "").replace(/{keySetId}/gi, w.value || "") : l.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, ($ = l.config) != null && $.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, w.value || ""));
868
+ let n = `${l.config.apiBaseUrl}${G.value}`;
869
+ l.config.app === "konnect" ? n = n.replace(/{controlPlaneId}/gi, ((g = l.config) == null ? void 0 : g.controlPlaneId) || "").replace(/{keySetId}/gi, w.value || "") : l.config.app === "kongManager" && (n = n.replace(/\/{workspace}/gi, ($ = l.config) != null && $.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, w.value || ""));
871
870
  try {
872
871
  B.value = !0;
873
- const { data: v } = await c.get(r);
872
+ const { data: v } = await c.get(n);
874
873
  x.value = (v == null ? void 0 : v.name) || (v == null ? void 0 : v.id);
875
874
  } catch (v) {
876
875
  _("fetch:error", v);
@@ -878,11 +877,11 @@ const ve = {
878
877
  B.value = !1;
879
878
  }
880
879
  }, { immediate: !0 });
881
- const X = (r) => {
880
+ const X = (n) => {
882
881
  var g, $;
883
882
  try {
884
- if (r.jwk) {
885
- const v = JSON.parse(r.jwk);
883
+ if (n.jwk) {
884
+ const v = JSON.parse(n.jwk);
886
885
  Object.keys(v).forEach((R) => {
887
886
  e.value = {
888
887
  ...e.value,
@@ -891,8 +890,8 @@ const ve = {
891
890
  });
892
891
  } else
893
892
  e.value = {
894
- "pem.public_key": (g = r == null ? void 0 : r.pem) == null ? void 0 : g.public_key,
895
- "pem.private_key": ($ = r == null ? void 0 : r.pem) == null ? void 0 : $.private_key
893
+ "pem.public_key": (g = n == null ? void 0 : n.pem) == null ? void 0 : g.public_key,
894
+ "pem.private_key": ($ = n == null ? void 0 : n.pem) == null ? void 0 : $.private_key
896
895
  };
897
896
  } catch (v) {
898
897
  _("fetch:error", v);
@@ -930,35 +929,35 @@ const ve = {
930
929
  type: ue.Json
931
930
  }
932
931
  });
933
- return (r, g) => {
932
+ return (n, g) => {
934
933
  var v, R;
935
934
  const $ = M("KSkeleton");
936
- return h(), V("div", rt, [
937
- k(s(Le), {
935
+ return h(), V("div", nt, [
936
+ k(a(Le), {
938
937
  config: i.config,
939
938
  "config-card-doc": i.configCardDoc,
940
939
  "config-schema": Y.value,
941
940
  "enable-terraform": i.enableTerraform,
942
- "entity-type": s(we).Key,
941
+ "entity-type": a(we).Key,
943
942
  "fetch-url": F.value,
944
943
  "hide-title": i.hideTitle,
945
- "onFetch:error": g[0] || (g[0] = (p) => r.$emit("fetch:error", p)),
946
- "onFetch:success": z,
947
- onLoading: g[1] || (g[1] = (p) => r.$emit("loading", p))
944
+ "onFetch:error": g[0] || (g[0] = (p) => n.$emit("fetch:error", p)),
945
+ "onFetch:success": H,
946
+ onLoading: g[1] || (g[1] = (p) => n.$emit("loading", p))
948
947
  }, Me({
949
948
  set: y(({ row: p }) => [
950
949
  B.value ? (h(), D($, {
951
950
  key: 0,
952
951
  "data-testid": "key-set-name-loader",
953
952
  type: "spinner"
954
- })) : p.value && p.value.id === w.value && x.value ? (h(), D(s(Qe), {
953
+ })) : p.value && p.value.id === w.value && x.value ? (h(), D(a(Qe), {
955
954
  key: 1,
956
955
  item: {
957
956
  key: p.value.id,
958
957
  value: x.value,
959
- type: s(ue).LinkInternal
958
+ type: a(ue).LinkInternal
960
959
  },
961
- onClick: (te) => r.$emit("navigation-click", p.value.id, "key-sets")
960
+ onClick: (te) => n.$emit("navigation-click", p.value.id, "key-sets")
962
961
  }, null, 8, ["item", "onClick"])) : (h(), V("div", dt, C("–")))
963
962
  ]),
964
963
  _: 2
@@ -966,12 +965,12 @@ const ve = {
966
965
  (v = j.value) != null && v.jwk ? {
967
966
  name: "jwk",
968
967
  fn: y(() => [
969
- (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(s(_e), {
968
+ (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(a(_e), {
970
969
  key: p,
971
970
  "data-testid": `${p}`,
972
971
  item: {
973
972
  key: p,
974
- label: s(d)(p),
973
+ label: a(d)(p),
975
974
  value: e.value[p]
976
975
  }
977
976
  }, null, 8, ["data-testid", "item"]))), 128))
@@ -981,12 +980,12 @@ const ve = {
981
980
  (R = j.value) != null && R.pem ? {
982
981
  name: "pem",
983
982
  fn: y(() => [
984
- (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(s(_e), {
983
+ (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(a(_e), {
985
984
  key: p,
986
985
  "data-testid": `${p}`,
987
986
  item: {
988
987
  key: p,
989
- label: s(d)(p),
988
+ label: a(d)(p),
990
989
  value: e.value[p]
991
990
  }
992
991
  }, null, 8, ["data-testid", "item"]))), 128))
@@ -1 +1 @@
1
- (function(C,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(C=typeof globalThis<"u"?globalThis:C||self,e(C["kong-ui-public-entities-keys"]={},C.Vue,C.VueRouter,C.KongIcons,C["kong-ui-public-i18n"],C["kong-ui-public-entities-shared"]))})(this,function(C,e,ee,le,te,c){"use strict";const ie={keys:{title:"Keys",list:{toolbar_actions:{new_key:"New Key"},table_headers:{name:"Name",key_id:"Key ID",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key",description:"A Key object holds a representation of asymmetric keys in various formats."}},actions:{create:"New Key",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},delete:{title:"Delete a Key",description:"This action cannot be reversed so make sure to check the key usage before deleting."},errors:{general:"Keys could not be retrieved",delete:"The key could not be deleted at this time.",copy:"Failed to copy to clipboard",key_sets:{fetch:"Could not fetch available key sets",invalid:"Please select a valid key set ID"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key."},keys:{title:"Asymmetric Keys",description:"Choose the preferred format for this asymmetric key. Currently only support PEM and JWK format."}},fields:{id:{label:"Key ID",placeholder:"Enter a key ID",tooltip:"An identifier for a key",help:"If using JWK, need to match with the jwk.kid field"},name:{label:"Name",placeholder:"Enter a unique name for this key",tooltip:"The name to associate with the given key"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},key_set:{label:"Key Set",placeholder:"Select a key set to add into",footer:"Search by exact ID to find key sets not included in the list"},key_format:{label:"Key Format",options:{jwk:"JWK",pem:"PEM"}},jwk:{label:"JWK",placeholder:"Enter a JWK",tooltip:"A JSON Web key represented as a string"},kid:{label:"Key ID",tooltip:"A unique identifier for a key."},set:{label:"Key Set",tooltip:"The id (an UUID) of the key-set with which to associate the key."},private_key:{label:"Private Key",placeholder:"Enter a private key"},public_key:{label:"Public Key",placeholder:"Enter a public key"}}}}};function ae(){const i=te.createI18n("en-us",ie);return{i18n:i,i18nT:te.i18nTComponent(i)}}const z={useI18n:ae},N="/v2/control-planes/{controlPlaneId}/core-entities",j="/{workspace}",$={list:{konnect:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},kongManager:{all:`${j}/keys`,forKeySet:`${j}/key-sets/{keySetId}/keys`}},form:{konnect:{create:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},edit:{all:`${N}/keys/{id}`,forKeySet:`${N}/key-sets/{keySetId}/keys/{id}`},keySets:`${N}/key-sets`,getKeySet:`${N}/key-sets/{keySetId}`},kongManager:{create:{all:`${j}/keys`,forKeySet:`${j}/key-sets/{keySetId}/keys`},edit:{all:`${j}/keys/{id}`,forKeySet:`${j}/key-sets/{keySetId}/keys/{id}`},keySets:`${j}/key-sets`,getKeySet:`${j}/key-sets/{keySetId}`}}},ne={class:"kong-ui-entities-keys-list"},re={key:1},se=e.defineComponent({__name:"KeyList",props:{config:{type:Object,required:!0,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)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(i,{emit:T}){var H;const h=T,l=i,{i18n:{t:f}}=z.useI18n(),d=ee.useRouter(),{axiosInstance:w}=c.useAxios((H=l.config)==null?void 0:H.axiosRequestConfig),K=e.ref(1),U=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),S={name:{label:f("keys.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},kid:{label:f("keys.list.table_headers.key_id"),sortable:!0},tags:{label:f("keys.list.table_headers.tags")},id:{label:f("keys.list.table_headers.id"),sortable:!0}},t=S,_=e.computed(()=>{var o,a,y,b;let n=`${l.config.apiBaseUrl}${$.list[l.config.app][l.config.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((o=l.config)==null?void 0:o.controlPlaneId)||"").replace(/{keySetId}/gi,((a=l.config)==null?void 0:a.keySetId)||""):l.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(y=l.config)!=null&&y.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,((b=l.config)==null?void 0:b.keySetId)||"")),n}),x=e.ref(""),D=e.computed(()=>{const n=l.config.app==="konnect"||l.config.isExactMatch;if(n)return{isExactMatch:n,placeholder:f("keys.search.placeholder")};const o={name:S.name};return{isExactMatch:n,fields:o,schema:l.config.filterSchema}}),{fetcher:O,fetcherState:J}=c.useFetcher(l.config,_.value),W=()=>{x.value=""},F=()=>{K.value++},s=e.ref(null),u=(n,o)=>{const a=n.id;if(!o(a)){B(n,"id");return}g(n,"id")},I=(n,o)=>{const a=JSON.stringify(n);if(!o(a)){h("copy:error",{entity:n,message:f("keys.errors.copy")});return}h("copy:success",{entity:n,message:f("keys.copy.success_brief")})},g=(n,o)=>{h("copy:success",{entity:n,field:o,message:f("keys.copy.success",{val:n[o]})})},B=(n,o)=>{h("copy:error",{entity:n,field:o,message:f("keys.errors.copy")})},k=async n=>{var a;await((a=l.canRetrieve)==null?void 0:a.call(l,n))&&d.push(l.config.getViewRoute(n.id))},L=n=>({label:f("keys.actions.view"),to:l.config.getViewRoute(n)}),X=n=>({label:f("keys.actions.edit"),to:l.config.getEditRoute(n)}),E=e.ref(void 0),R=e.ref(!1),A=e.ref(!1),Q=e.ref(""),G=c.useDeleteUrlBuilder(l.config,_.value),Y=n=>{E.value=n,R.value=!0},Z=()=>{R.value=!1},v=async()=>{var n,o,a;if((n=E.value)!=null&&n.id){A.value=!0;try{await w.delete(G(E.value.id)),A.value=!1,R.value=!1,K.value++,h("delete:success",E.value)}catch(y){Q.value=((a=(o=y.response)==null?void 0:o.data)==null?void 0:a.message)||y.message||f("keys.errors.delete"),h("error",y)}finally{A.value=!1}}},q=e.ref(!1);e.watch(J,n=>{var o,a,y,b;if(Array.isArray((o=n==null?void 0:n.response)==null?void 0:o.data)&&(q.value=n.response.data.length>0),n.status===c.FetcherStatus.Error){s.value={title:f("keys.errors.general")},(b=(y=(a=n.error)==null?void 0:a.response)==null?void 0:y.data)!=null&&b.message&&(s.value.message=n.error.response.data.message),h("error",n.error);return}s.value=null});const P=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${f("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:f("keys.title")});return e.onBeforeMount(async()=>{await l.canCreate()&&(P.value.title=f("keys.list.empty_state.title"),P.value.ctaText=f("keys.actions.create"))}),(n,o)=>{const a=e.resolveComponent("KButton"),y=e.resolveComponent("KCopy"),b=e.resolveComponent("KBadge"),V=e.resolveComponent("KTruncate"),r=e.resolveComponent("KDropdownItem"),p=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",ne,[e.createVNode(e.unref(c.EntityBaseTable),{"cache-identifier":i.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":U.value,"empty-state-options":P.value,"enable-entity-actions":"","error-message":s.value,fetcher:e.unref(O),"fetcher-cache-key":K.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-keys-list",query:x.value,"table-headers":e.unref(t),"use-action-outside":i.useActionOutside,onClearSearchInput:W,"onClick:row":o[2]||(o[2]=m=>k(m)),onSort:F},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(c.EntityFilter),{modelValue:x.value,"onUpdate:modelValue":o[0]||(o[0]=m=>x.value=m),config:D.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!i.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(a,{appearance:"primary","data-testid":"toolbar-add-key",size:"large",to:i.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(le.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(f)("keys.list.toolbar_actions.new_key")),1)]),_:1},8,["to"]),[[e.vShow,q.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:m})=>[e.createElementVNode("b",null,e.toDisplayString(m??"-"),1)]),kid:e.withCtx(({rowValue:m})=>[e.createVNode(y,{text:m},null,8,["text"])]),tags:e.withCtx(({rowValue:m})=>[(m==null?void 0:m.length)>0?(e.openBlock(),e.createBlock(V,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,M=>(e.openBlock(),e.createBlock(b,{key:M,onClick:o[1]||(o[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",re,"-"))]),id:e.withCtx(({rowValue:m})=>[e.createVNode(y,{text:m,truncate:""},null,8,["text"])]),actions:e.withCtx(({row:m})=>[e.createVNode(p,null,{default:e.withCtx(({copyToClipboard:M})=>[e.createVNode(r,{"data-testid":"action-entity-copy-id",onClick:Ce=>u(m,M)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)("keys.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(p,null,{default:e.withCtx(({copyToClipboard:M})=>[e.createVNode(r,{"data-testid":"action-entity-copy-json",onClick:Ce=>I(m,M)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)("keys.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canRetrieve(m)},{default:e.withCtx(()=>[e.createVNode(r,{"data-testid":"action-entity-view","has-divider":"",item:L(m.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canEdit(m)},{default:e.withCtx(()=>[e.createVNode(r,{"data-testid":"action-entity-edit",item:X(m.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canDelete(m)},{default:e.withCtx(()=>[e.createVNode(r,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:M=>Y(m)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)("keys.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),e.createVNode(e.unref(c.EntityDeleteModal),{"action-pending":A.value,description:e.unref(f)("keys.delete.description"),"entity-name":E.value&&(E.value.name||E.value.id),"entity-type":e.unref(c.EntityTypes).Key,error:Q.value,"need-confirm":!1,title:e.unref(f)("keys.delete.title"),visible:R.value,onCancel:Z,onProceed:v},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),oe=(i,T)=>{const h=i.__vccOpts||i;for(const[l,f]of T)h[l]=f;return h},ce=oe(se,[["__scopeId","data-v-58d43c7d"]]),de={class:"kong-ui-entities-keys-form"},fe={"data-testid":"no-search-results"},ye={class:"select-item-container"},pe={class:"select-item-label"},ke={class:"select-item-description"},me={key:0,class:"invalid-key-set-message","data-testid":"invalid-key-set-message"},ue={"data-testid":"key-format-container"},ge=oe(e.defineComponent({__name:"KeyForm",props:{config:{type:Object,required:!0,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)},keyId:{type:String,required:!1,default:""},keySetId:{type:String,required:!1,default:null},fixedKeySetId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(i,{emit:T}){var n;const h=T,l=i,f=ee.useRouter(),{i18n:{t:d}}=z.useI18n(),{getMessageFromError:w}=c.useErrors(),{axiosInstance:K}=c.useAxios((n=l.config)==null?void 0:n.axiosRequestConfig),U=e.computed(()=>l.keySetId?$.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi,l.keySetId):$.form[l.config.app].edit.all),S=e.computed(()=>l.keyId?c.EntityBaseFormType.Edit:c.EntityBaseFormType.Create),t=e.reactive({fields:{name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""},isReadonly:!1,errorMessage:""}),_=e.reactive({name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""}),x=[{label:d("keys.form.fields.key_format.options.jwk"),value:"jwk"},{label:d("keys.form.fields.key_format.options.pem"),value:"pem"}],D=e.computed(()=>t.isReadonly||S.value===c.EntityBaseFormType.Create&&!!l.fixedKeySetId),O=e.computed(()=>!D.value);e.watch(()=>l.fixedKeySetId,o=>{S.value===c.EntityBaseFormType.Create&&(t.fields.key_set=o)},{immediate:!0});const J=e.computed(()=>JSON.stringify(t.fields)!==JSON.stringify(_)&&!!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)),W=o=>{var a,y,b,V;t.fields.key_id=(o==null?void 0:o.kid)||"",t.fields.name=(o==null?void 0:o.name)||"",t.fields.tags=((a=o==null?void 0:o.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((y=o==null?void 0:o.set)==null?void 0:y.id)||"",t.fields.key_format=o!=null&&o.pem?"pem":"jwk",t.fields.jwk=(o==null?void 0:o.jwk)||"",t.fields.private_key=((b=o==null?void 0:o.pem)==null?void 0:b.private_key)||"",t.fields.public_key=((V=o==null?void 0:o.pem)==null?void 0:V.public_key)||"",Object.assign(_,t.fields)},F=()=>{f.push(l.config.cancelRoute)},s=e.computed(()=>{var a,y;let o=`${l.config.apiBaseUrl}${$.form[l.config.app][S.value][l.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=l.config)==null?void 0:a.controlPlaneId)||""):l.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(y=l.config)!=null&&y.workspace?`/${l.config.workspace}`:"")),o=o.replace(/{id}/gi,l.keyId).replace(/{keySetId}/gi,l.keySetId||""),o}),u=e.computed(()=>{var o,a,y;return{kid:t.fields.key_id,name:t.fields.name||null,tags:((y=(a=(o=t.fields.tags)==null?void 0:o.split(","))==null?void 0:a.map(b=>String(b||"").trim()))==null?void 0:y.filter(b=>b!==""))||[],set:t.fields.key_set?{id:t.fields.key_set}:null,jwk:t.fields.key_format==="jwk"?t.fields.jwk:null,pem:t.fields.key_format==="pem"?{private_key:t.fields.private_key,public_key:t.fields.public_key}:null}}),I=async()=>{var o,a,y,b,V;try{t.isReadonly=!0;let r;if(S.value==="create"?r=await K.post(s.value,u.value):S.value==="edit"&&(r=((o=l.config)==null?void 0:o.app)==="konnect"?await K.put(s.value,u.value):await K.patch(s.value,u.value)),r){const{data:p}=r;t.fields.key_id=(p==null?void 0:p.kid)||"",t.fields.name=(p==null?void 0:p.name)||"",t.fields.tags=((a=p==null?void 0:p.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((y=p==null?void 0:p.set)==null?void 0:y.id)||"",t.fields.key_format=p!=null&&p.pem?"pem":"jwk",t.fields.jwk=(p==null?void 0:p.jwk)||"",t.fields.private_key=((b=p==null?void 0:p.pem)==null?void 0:b.private_key)||"",t.fields.public_key=((V=p==null?void 0:p.pem)==null?void 0:V.public_key)||"",Object.assign(_,t.fields),h("update",r==null?void 0:r.data)}}catch(r){t.errorMessage=w(r),h("error",r)}finally{t.isReadonly=!1}},{debouncedQueryChange:g,loading:B,allRecords:k,error:L,validationError:X,loadItems:E,results:R}=c.useDebouncedFilter(l.config,$.form[l.config.app].keySets,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),A=o=>{(!o||o!==t.fields.key_set&&o!==_.key_set)&&g(o)},Q=e.computed(()=>L.value?d("keys.errors.key_sets.fetch"):""),G=e.computed(()=>X.value?d("keys.errors.key_sets.invalid"):""),Y=e.ref(0),Z=e.computed(()=>k.value===void 0),v=e.computed(()=>{if(Z.value)return l.config.app==="konnect"?d("keys.form.fields.key_set.footer"):void 0}),q=e.ref(new Set),P=e.computed(()=>Array.from(q.value).map(a=>({name:a.name||"",label:"",value:a.id,selected:t.fields.key_set===a.id}))),H=o=>{q.value.clear();let a;for(a of o)q.value.add(a)};return e.watch(R,o=>{H(o)},{immediate:!0,deep:!0}),e.watch(P,()=>{Y.value++},{immediate:!0,deep:!0}),e.onBeforeMount(async()=>{await E()}),(o,a)=>{const y=e.resolveComponent("KInput"),b=e.resolveComponent("KSelect"),V=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",de,[e.createVNode(e.unref(c.EntityBaseForm),{"can-submit":J.value,config:i.config,"edit-id":i.keyId,"enable-terraform":i.enableTerraform,"entity-type":e.unref(c.SupportedEntityType).Key,"error-message":t.errorMessage||Q.value,"fetch-url":U.value,"form-fields":u.value,"is-readonly":t.isReadonly,onCancel:F,"onFetch:error":a[8]||(a[8]=r=>o.$emit("error",r)),"onFetch:success":W,onLoading:a[9]||(a[9]=r=>o.$emit("loading",r)),onSubmit:I},{default:e.withCtx(()=>[e.createVNode(e.unref(c.EntityFormSection),{description:e.unref(d)("keys.form.sections.general.description"),title:e.unref(d)("keys.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(y,{modelValue:t.fields.key_id,"onUpdate:modelValue":a[0]||(a[0]=r=>t.fields.key_id=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-id",help:e.unref(d)("keys.form.fields.id.help"),label:e.unref(d)("keys.form.fields.id.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.id.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.id.placeholder"),readonly:t.isReadonly,required:"",type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"]),e.createVNode(y,{modelValue:t.fields.name,"onUpdate:modelValue":a[1]||(a[1]=r=>t.fields.name=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-name",label:e.unref(d)("keys.form.fields.name.label"),placeholder:e.unref(d)("keys.form.fields.name.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:t.fields.key_set,"onUpdate:modelValue":a[2]||(a[2]=r=>t.fields.key_set=r),clearable:O.value,"data-testid":"key-form-key-set","dropdown-footer-text":v.value,"enable-filtering":"","filter-function":()=>!0,items:P.value,label:e.unref(d)("keys.form.fields.key_set.label"),loading:e.unref(B),placeholder:e.unref(d)("keys.form.fields.key_set.placeholder"),readonly:D.value,width:"100%",onQueryChange:A},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(d)("keys.actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",fe,e.toDisplayString(e.unref(d)("keys.search.no_results")),1)]),"selected-item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",null,e.toDisplayString(r.name),1)]),"item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",ye,[e.createElementVNode("div",pe,e.toDisplayString(r.name),1),e.createElementVNode("div",ke,e.toDisplayString(r.value),1)])]),_:1},8,["modelValue","clearable","dropdown-footer-text","items","label","loading","placeholder","readonly"]),G.value?(e.openBlock(),e.createElementBlock("p",me,e.toDisplayString(G.value),1)):e.createCommentVNode("",!0),e.createVNode(y,{modelValue:t.fields.tags,"onUpdate:modelValue":a[3]||(a[3]=r=>t.fields.tags=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-tags",help:e.unref(d)("keys.form.fields.tags.help"),label:e.unref(d)("keys.form.fields.tags.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"]),e.createVNode(e.unref(c.EntityFormSection),{description:e.unref(d)("keys.form.sections.keys.description"),"has-divider":"",title:e.unref(d)("keys.form.sections.keys.title")},{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createVNode(b,{modelValue:t.fields.key_format,"onUpdate:modelValue":a[4]||(a[4]=r=>t.fields.key_format=r),"data-testid":"key-form-key-format",items:x,label:e.unref(d)("keys.form.fields.key_format.label"),readonly:t.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"])]),t.fields.key_format==="jwk"?(e.openBlock(),e.createBlock(V,{key:0,modelValue:t.fields.jwk,"onUpdate:modelValue":a[5]||(a[5]=r=>t.fields.jwk=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-jwk",label:e.unref(d)("keys.form.fields.jwk.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.jwk.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.jwk.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","label-attributes","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(V,{key:1,modelValue:t.fields.private_key,"onUpdate:modelValue":a[6]||(a[6]=r=>t.fields.private_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-private-key",label:e.unref(d)("keys.form.fields.private_key.label"),placeholder:e.unref(d)("keys.form.fields.private_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(V,{key:2,modelValue:t.fields.public_key,"onUpdate:modelValue":a[7]||(a[7]=r=>t.fields.public_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-public-key",label:e.unref(d)("keys.form.fields.public_key.label"),placeholder:e.unref(d)("keys.form.fields.public_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-c9e601fc"]]),be={class:"kong-ui-entities-keys-entity-config-card"},he={key:2},_e=e.defineComponent({__name:"KeyConfigCard",props:{config:{type:Object,required:!0,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)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},keySetId:{type:String,default:null},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(i,{emit:T}){var F;const h=T,l=i,{axiosInstance:f}=c.useAxios((F=l.config)==null?void 0:F.axiosRequestConfig),{convertKeyToTitle:d}=c.useStringHelpers(),{i18n:{t:w}}=z.useI18n(),K=e.computed(()=>l.keySetId?`${$.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi,l.keySetId):$.form[l.config.app].edit.all),U=e.computed(()=>{var s;return(s=$.form[l.config.app])==null?void 0:s.getKeySet}),S=e.ref(),t=e.ref({}),_=e.ref(l.keySetId||""),x=e.ref(""),D=e.ref(!1),O=async s=>{var u;S.value=s,_.value=(u=s==null?void 0:s.set)==null?void 0:u.id,h("fetch:success",s),J(s)};e.watch(_,async()=>{var u,I;if(!_.value)return;let s=`${l.config.apiBaseUrl}${U.value}`;l.config.app==="konnect"?s=s.replace(/{controlPlaneId}/gi,((u=l.config)==null?void 0:u.controlPlaneId)||"").replace(/{keySetId}/gi,_.value||""):l.config.app==="kongManager"&&(s=s.replace(/\/{workspace}/gi,(I=l.config)!=null&&I.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,_.value||""));try{D.value=!0;const{data:g}=await f.get(s);x.value=(g==null?void 0:g.name)||(g==null?void 0:g.id)}catch(g){h("fetch:error",g)}finally{D.value=!1}},{immediate:!0});const J=s=>{var u,I;try{if(s.jwk){const g=JSON.parse(s.jwk);Object.keys(g).forEach(B=>{t.value={...t.value,[`jwk.${B}`]:g[B]}})}else t.value={"pem.public_key":(u=s==null?void 0:s.pem)==null?void 0:u.public_key,"pem.private_key":(I=s==null?void 0:s.pem)==null?void 0:I.private_key}}catch(g){h("fetch:error",g)}return t},W=e.ref({id:{},name:{tooltip:w("keys.form.fields.name.tooltip")},last_updated:{},created:{},set:{label:w("keys.form.fields.set.label"),section:c.ConfigurationSchemaSection.Basic,tooltip:w("keys.form.fields.set.tooltip"),order:5},kid:{label:w("keys.form.fields.kid.label"),section:c.ConfigurationSchemaSection.Basic,tooltip:w("keys.form.fields.kid.tooltip")},tags:{tooltip:w("keys.form.fields.tags.tooltip")},jwk:{label:w("keys.form.fields.jwk.label"),type:c.ConfigurationSchemaType.Json},pem:{section:c.ConfigurationSchemaSection.Advanced,label:w("keys.form.fields.key_format.options.pem"),type:c.ConfigurationSchemaType.Json}});return(s,u)=>{var g,B;const I=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",be,[e.createVNode(e.unref(c.EntityBaseConfigCard),{config:i.config,"config-card-doc":i.configCardDoc,"config-schema":W.value,"enable-terraform":i.enableTerraform,"entity-type":e.unref(c.SupportedEntityType).Key,"fetch-url":K.value,"hide-title":i.hideTitle,"onFetch:error":u[0]||(u[0]=k=>s.$emit("fetch:error",k)),"onFetch:success":O,onLoading:u[1]||(u[1]=k=>s.$emit("loading",k))},e.createSlots({set:e.withCtx(({row:k})=>[D.value?(e.openBlock(),e.createBlock(I,{key:0,"data-testid":"key-set-name-loader",type:"spinner"})):k.value&&k.value.id===_.value&&x.value?(e.openBlock(),e.createBlock(e.unref(c.InternalLinkItem),{key:1,item:{key:k.value.id,value:x.value,type:e.unref(c.ConfigurationSchemaType).LinkInternal},onClick:L=>s.$emit("navigation-click",k.value.id,"key-sets")},null,8,["item","onClick"])):(e.openBlock(),e.createElementBlock("div",he,e.toDisplayString("–")))]),_:2},[(g=S.value)!=null&&g.jwk?{name:"jwk",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),k=>(e.openBlock(),e.createBlock(e.unref(c.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(d)(k),value:t.value[k]}},null,8,["data-testid","item"]))),128))]),key:"0"}:void 0,(B=S.value)!=null&&B.pem?{name:"pem",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),k=>(e.openBlock(),e.createBlock(e.unref(c.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(d)(k),value:t.value[k]}},null,8,["data-testid","item"]))),128))]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}});C.KeyConfigCard=_e,C.KeyForm=ge,C.KeyList=ce,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
1
+ (function(C,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(C=typeof globalThis<"u"?globalThis:C||self,e(C["kong-ui-public-entities-keys"]={},C.Vue,C.VueRouter,C.KongIcons,C["kong-ui-public-i18n"],C["kong-ui-public-entities-shared"]))})(this,function(C,e,ee,le,te,c){"use strict";const ie={keys:{title:"Keys",list:{toolbar_actions:{new_key:"New Key"},table_headers:{name:"Name",key_id:"Key ID",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key",description:"A Key object holds a representation of asymmetric keys in various formats."}},actions:{create:"New Key",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},delete:{title:"Delete a Key",description:"This action cannot be reversed so make sure to check the key usage before deleting."},errors:{general:"Keys could not be retrieved",delete:"The key could not be deleted at this time.",copy:"Failed to copy to clipboard",key_sets:{fetch:"Could not fetch available key sets",invalid:"Please select a valid key set ID"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key."},keys:{title:"Asymmetric Keys",description:"Choose the preferred format for this asymmetric key. Currently only support PEM and JWK format."}},fields:{id:{label:"Key ID",placeholder:"Enter a key ID",tooltip:"An identifier for a key",help:"If using JWK, need to match with the jwk.kid field"},name:{label:"Name",placeholder:"Enter a unique name for this key",tooltip:"The name to associate with the given key"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},key_set:{label:"Key Set",placeholder:"Select a key set to add into",footer:"Search by exact ID to find key sets not included in the list"},key_format:{label:"Key Format",options:{jwk:"JWK",pem:"PEM"}},jwk:{label:"JWK",placeholder:"Enter a JWK",tooltip:"A JSON Web key represented as a string"},kid:{label:"Key ID",tooltip:"A unique identifier for a key."},set:{label:"Key Set",tooltip:"The id (an UUID) of the key-set with which to associate the key."},private_key:{label:"Private Key",placeholder:"Enter a private key"},public_key:{label:"Public Key",placeholder:"Enter a public key"}}}}};function ae(){const i=te.createI18n("en-us",ie);return{i18n:i,i18nT:te.i18nTComponent(i)}}const H={useI18n:ae},N="/v2/control-planes/{controlPlaneId}/core-entities",j="/{workspace}",$={list:{konnect:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},kongManager:{all:`${j}/keys`,forKeySet:`${j}/key-sets/{keySetId}/keys`}},form:{konnect:{create:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},edit:{all:`${N}/keys/{id}`,forKeySet:`${N}/key-sets/{keySetId}/keys/{id}`},keySets:`${N}/key-sets`,getKeySet:`${N}/key-sets/{keySetId}`},kongManager:{create:{all:`${j}/keys`,forKeySet:`${j}/key-sets/{keySetId}/keys`},edit:{all:`${j}/keys/{id}`,forKeySet:`${j}/key-sets/{keySetId}/keys/{id}`},keySets:`${j}/key-sets`,getKeySet:`${j}/key-sets/{keySetId}`}}},ne={class:"kong-ui-entities-keys-list"},re={key:1},se=e.defineComponent({__name:"KeyList",props:{config:{type:Object,required:!0,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)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(i,{emit:T}){var G;const h=T,l=i,{i18n:{t:f}}=H.useI18n(),d=ee.useRouter(),{axiosInstance:w}=c.useAxios((G=l.config)==null?void 0:G.axiosRequestConfig),K=e.ref(1),U=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),S={name:{label:f("keys.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},kid:{label:f("keys.list.table_headers.key_id"),sortable:!0},tags:{label:f("keys.list.table_headers.tags")},id:{label:f("keys.list.table_headers.id"),sortable:!0}},t=S,_=e.computed(()=>{var o,a,y,b;let n=`${l.config.apiBaseUrl}${$.list[l.config.app][l.config.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((o=l.config)==null?void 0:o.controlPlaneId)||"").replace(/{keySetId}/gi,((a=l.config)==null?void 0:a.keySetId)||""):l.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(y=l.config)!=null&&y.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,((b=l.config)==null?void 0:b.keySetId)||"")),n}),x=e.ref(""),D=e.computed(()=>{const n=l.config.app==="konnect"||l.config.isExactMatch;if(n)return{isExactMatch:n,placeholder:f("keys.search.placeholder")};const o={name:S.name};return{isExactMatch:n,fields:o,schema:l.config.filterSchema}}),{fetcher:O,fetcherState:J}=c.useFetcher(l.config,_.value),W=()=>{x.value=""},F=()=>{K.value++},s=e.ref(null),u=(n,o)=>{const a=n.id;if(!o(a)){B(n,"id");return}g(n,"id")},I=(n,o)=>{const a=JSON.stringify(n);if(!o(a)){h("copy:error",{entity:n,message:f("keys.errors.copy")});return}h("copy:success",{entity:n,message:f("keys.copy.success_brief")})},g=(n,o)=>{h("copy:success",{entity:n,field:o,message:f("keys.copy.success",{val:n[o]})})},B=(n,o)=>{h("copy:error",{entity:n,field:o,message:f("keys.errors.copy")})},k=async n=>{var a;await((a=l.canRetrieve)==null?void 0:a.call(l,n))&&d.push(l.config.getViewRoute(n.id))},L=n=>({label:f("keys.actions.view"),to:l.config.getViewRoute(n)}),X=n=>({label:f("keys.actions.edit"),to:l.config.getEditRoute(n)}),E=e.ref(void 0),R=e.ref(!1),A=e.ref(!1),Q=e.ref(""),z=c.useDeleteUrlBuilder(l.config,_.value),Y=n=>{E.value=n,R.value=!0},Z=()=>{R.value=!1},v=async()=>{var n,o,a;if((n=E.value)!=null&&n.id){A.value=!0;try{await w.delete(z(E.value.id)),A.value=!1,R.value=!1,K.value++,h("delete:success",E.value)}catch(y){Q.value=((a=(o=y.response)==null?void 0:o.data)==null?void 0:a.message)||y.message||f("keys.errors.delete"),h("error",y)}finally{A.value=!1}}},q=e.ref(!1);e.watch(J,n=>{var o,a,y,b;if(Array.isArray((o=n==null?void 0:n.response)==null?void 0:o.data)&&(q.value=n.response.data.length>0),n.status===c.FetcherStatus.Error){s.value={title:f("keys.errors.general")},(b=(y=(a=n.error)==null?void 0:a.response)==null?void 0:y.data)!=null&&b.message&&(s.value.message=n.error.response.data.message),h("error",n.error);return}s.value=null});const P=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${f("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:f("keys.title")});return e.onBeforeMount(async()=>{await l.canCreate()&&(P.value.title=f("keys.list.empty_state.title"),P.value.ctaText=f("keys.actions.create"))}),(n,o)=>{const a=e.resolveComponent("KButton"),y=e.resolveComponent("KCopy"),b=e.resolveComponent("KBadge"),V=e.resolveComponent("KTruncate"),r=e.resolveComponent("KDropdownItem"),p=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",ne,[e.createVNode(e.unref(c.EntityBaseTable),{"cache-identifier":i.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":U.value,"empty-state-options":P.value,"enable-entity-actions":"","error-message":s.value,fetcher:e.unref(O),"fetcher-cache-key":K.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-keys-list",query:x.value,"table-headers":e.unref(t),onClearSearchInput:W,"onClick:row":o[2]||(o[2]=m=>k(m)),onSort:F},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(c.EntityFilter),{modelValue:x.value,"onUpdate:modelValue":o[0]||(o[0]=m=>x.value=m),config:D.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!i.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(a,{appearance:"primary","data-testid":"toolbar-add-key",size:i.useActionOutside?"medium":"large",to:i.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(le.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(f)("keys.list.toolbar_actions.new_key")),1)]),_:1},8,["size","to"]),[[e.vShow,q.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:m})=>[e.createElementVNode("b",null,e.toDisplayString(m??"-"),1)]),kid:e.withCtx(({rowValue:m})=>[e.createVNode(y,{text:m},null,8,["text"])]),tags:e.withCtx(({rowValue:m})=>[(m==null?void 0:m.length)>0?(e.openBlock(),e.createBlock(V,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,M=>(e.openBlock(),e.createBlock(b,{key:M,onClick:o[1]||(o[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",re,"-"))]),id:e.withCtx(({rowValue:m})=>[e.createVNode(y,{text:m,truncate:""},null,8,["text"])]),actions:e.withCtx(({row:m})=>[e.createVNode(p,null,{default:e.withCtx(({copyToClipboard:M})=>[e.createVNode(r,{"data-testid":"action-entity-copy-id",onClick:Ce=>u(m,M)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)("keys.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(p,null,{default:e.withCtx(({copyToClipboard:M})=>[e.createVNode(r,{"data-testid":"action-entity-copy-json",onClick:Ce=>I(m,M)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)("keys.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canRetrieve(m)},{default:e.withCtx(()=>[e.createVNode(r,{"data-testid":"action-entity-view","has-divider":"",item:L(m.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canEdit(m)},{default:e.withCtx(()=>[e.createVNode(r,{"data-testid":"action-entity-edit",item:X(m.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(c.PermissionsWrapper),{"auth-function":()=>i.canDelete(m)},{default:e.withCtx(()=>[e.createVNode(r,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:M=>Y(m)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)("keys.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),e.createVNode(e.unref(c.EntityDeleteModal),{"action-pending":A.value,description:e.unref(f)("keys.delete.description"),"entity-name":E.value&&(E.value.name||E.value.id),"entity-type":e.unref(c.EntityTypes).Key,error:Q.value,"need-confirm":!1,title:e.unref(f)("keys.delete.title"),visible:R.value,onCancel:Z,onProceed:v},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),oe=(i,T)=>{const h=i.__vccOpts||i;for(const[l,f]of T)h[l]=f;return h},ce=oe(se,[["__scopeId","data-v-7ca9a3a4"]]),de={class:"kong-ui-entities-keys-form"},fe={"data-testid":"no-search-results"},ye={class:"select-item-container"},pe={class:"select-item-label"},ke={class:"select-item-description"},me={key:0,class:"invalid-key-set-message","data-testid":"invalid-key-set-message"},ue={"data-testid":"key-format-container"},ge=oe(e.defineComponent({__name:"KeyForm",props:{config:{type:Object,required:!0,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)},keyId:{type:String,required:!1,default:""},keySetId:{type:String,required:!1,default:null},fixedKeySetId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(i,{emit:T}){var n;const h=T,l=i,f=ee.useRouter(),{i18n:{t:d}}=H.useI18n(),{getMessageFromError:w}=c.useErrors(),{axiosInstance:K}=c.useAxios((n=l.config)==null?void 0:n.axiosRequestConfig),U=e.computed(()=>l.keySetId?$.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi,l.keySetId):$.form[l.config.app].edit.all),S=e.computed(()=>l.keyId?c.EntityBaseFormType.Edit:c.EntityBaseFormType.Create),t=e.reactive({fields:{name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""},isReadonly:!1,errorMessage:""}),_=e.reactive({name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""}),x=[{label:d("keys.form.fields.key_format.options.jwk"),value:"jwk"},{label:d("keys.form.fields.key_format.options.pem"),value:"pem"}],D=e.computed(()=>t.isReadonly||S.value===c.EntityBaseFormType.Create&&!!l.fixedKeySetId),O=e.computed(()=>!D.value);e.watch(()=>l.fixedKeySetId,o=>{S.value===c.EntityBaseFormType.Create&&(t.fields.key_set=o)},{immediate:!0});const J=e.computed(()=>JSON.stringify(t.fields)!==JSON.stringify(_)&&!!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)),W=o=>{var a,y,b,V;t.fields.key_id=(o==null?void 0:o.kid)||"",t.fields.name=(o==null?void 0:o.name)||"",t.fields.tags=((a=o==null?void 0:o.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((y=o==null?void 0:o.set)==null?void 0:y.id)||"",t.fields.key_format=o!=null&&o.pem?"pem":"jwk",t.fields.jwk=(o==null?void 0:o.jwk)||"",t.fields.private_key=((b=o==null?void 0:o.pem)==null?void 0:b.private_key)||"",t.fields.public_key=((V=o==null?void 0:o.pem)==null?void 0:V.public_key)||"",Object.assign(_,t.fields)},F=()=>{f.push(l.config.cancelRoute)},s=e.computed(()=>{var a,y;let o=`${l.config.apiBaseUrl}${$.form[l.config.app][S.value][l.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=l.config)==null?void 0:a.controlPlaneId)||""):l.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(y=l.config)!=null&&y.workspace?`/${l.config.workspace}`:"")),o=o.replace(/{id}/gi,l.keyId).replace(/{keySetId}/gi,l.keySetId||""),o}),u=e.computed(()=>{var o,a,y;return{kid:t.fields.key_id,name:t.fields.name||null,tags:((y=(a=(o=t.fields.tags)==null?void 0:o.split(","))==null?void 0:a.map(b=>String(b||"").trim()))==null?void 0:y.filter(b=>b!==""))||[],set:t.fields.key_set?{id:t.fields.key_set}:null,jwk:t.fields.key_format==="jwk"?t.fields.jwk:null,pem:t.fields.key_format==="pem"?{private_key:t.fields.private_key,public_key:t.fields.public_key}:null}}),I=async()=>{var o,a,y,b,V;try{t.isReadonly=!0;let r;if(S.value==="create"?r=await K.post(s.value,u.value):S.value==="edit"&&(r=((o=l.config)==null?void 0:o.app)==="konnect"?await K.put(s.value,u.value):await K.patch(s.value,u.value)),r){const{data:p}=r;t.fields.key_id=(p==null?void 0:p.kid)||"",t.fields.name=(p==null?void 0:p.name)||"",t.fields.tags=((a=p==null?void 0:p.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((y=p==null?void 0:p.set)==null?void 0:y.id)||"",t.fields.key_format=p!=null&&p.pem?"pem":"jwk",t.fields.jwk=(p==null?void 0:p.jwk)||"",t.fields.private_key=((b=p==null?void 0:p.pem)==null?void 0:b.private_key)||"",t.fields.public_key=((V=p==null?void 0:p.pem)==null?void 0:V.public_key)||"",Object.assign(_,t.fields),h("update",r==null?void 0:r.data)}}catch(r){t.errorMessage=w(r),h("error",r)}finally{t.isReadonly=!1}},{debouncedQueryChange:g,loading:B,allRecords:k,error:L,validationError:X,loadItems:E,results:R}=c.useDebouncedFilter(l.config,$.form[l.config.app].keySets,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),A=o=>{(!o||o!==t.fields.key_set&&o!==_.key_set)&&g(o)},Q=e.computed(()=>L.value?d("keys.errors.key_sets.fetch"):""),z=e.computed(()=>X.value?d("keys.errors.key_sets.invalid"):""),Y=e.ref(0),Z=e.computed(()=>k.value===void 0),v=e.computed(()=>{if(Z.value)return l.config.app==="konnect"?d("keys.form.fields.key_set.footer"):void 0}),q=e.ref(new Set),P=e.computed(()=>Array.from(q.value).map(a=>({name:a.name||"",label:"",value:a.id,selected:t.fields.key_set===a.id}))),G=o=>{q.value.clear();let a;for(a of o)q.value.add(a)};return e.watch(R,o=>{G(o)},{immediate:!0,deep:!0}),e.watch(P,()=>{Y.value++},{immediate:!0,deep:!0}),e.onBeforeMount(async()=>{await E()}),(o,a)=>{const y=e.resolveComponent("KInput"),b=e.resolveComponent("KSelect"),V=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",de,[e.createVNode(e.unref(c.EntityBaseForm),{"can-submit":J.value,config:i.config,"edit-id":i.keyId,"enable-terraform":i.enableTerraform,"entity-type":e.unref(c.SupportedEntityType).Key,"error-message":t.errorMessage||Q.value,"fetch-url":U.value,"form-fields":u.value,"is-readonly":t.isReadonly,onCancel:F,"onFetch:error":a[8]||(a[8]=r=>o.$emit("error",r)),"onFetch:success":W,onLoading:a[9]||(a[9]=r=>o.$emit("loading",r)),onSubmit:I},{default:e.withCtx(()=>[e.createVNode(e.unref(c.EntityFormSection),{description:e.unref(d)("keys.form.sections.general.description"),title:e.unref(d)("keys.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(y,{modelValue:t.fields.key_id,"onUpdate:modelValue":a[0]||(a[0]=r=>t.fields.key_id=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-id",help:e.unref(d)("keys.form.fields.id.help"),label:e.unref(d)("keys.form.fields.id.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.id.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.id.placeholder"),readonly:t.isReadonly,required:"",type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"]),e.createVNode(y,{modelValue:t.fields.name,"onUpdate:modelValue":a[1]||(a[1]=r=>t.fields.name=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-name",label:e.unref(d)("keys.form.fields.name.label"),placeholder:e.unref(d)("keys.form.fields.name.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:t.fields.key_set,"onUpdate:modelValue":a[2]||(a[2]=r=>t.fields.key_set=r),clearable:O.value,"data-testid":"key-form-key-set","dropdown-footer-text":v.value,"enable-filtering":"","filter-function":()=>!0,items:P.value,label:e.unref(d)("keys.form.fields.key_set.label"),loading:e.unref(B),placeholder:e.unref(d)("keys.form.fields.key_set.placeholder"),readonly:D.value,width:"100%",onQueryChange:A},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(d)("keys.actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",fe,e.toDisplayString(e.unref(d)("keys.search.no_results")),1)]),"selected-item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",null,e.toDisplayString(r.name),1)]),"item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",ye,[e.createElementVNode("div",pe,e.toDisplayString(r.name),1),e.createElementVNode("div",ke,e.toDisplayString(r.value),1)])]),_:1},8,["modelValue","clearable","dropdown-footer-text","items","label","loading","placeholder","readonly"]),z.value?(e.openBlock(),e.createElementBlock("p",me,e.toDisplayString(z.value),1)):e.createCommentVNode("",!0),e.createVNode(y,{modelValue:t.fields.tags,"onUpdate:modelValue":a[3]||(a[3]=r=>t.fields.tags=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-tags",help:e.unref(d)("keys.form.fields.tags.help"),label:e.unref(d)("keys.form.fields.tags.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"]),e.createVNode(e.unref(c.EntityFormSection),{description:e.unref(d)("keys.form.sections.keys.description"),"has-divider":"",title:e.unref(d)("keys.form.sections.keys.title")},{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createVNode(b,{modelValue:t.fields.key_format,"onUpdate:modelValue":a[4]||(a[4]=r=>t.fields.key_format=r),"data-testid":"key-form-key-format",items:x,label:e.unref(d)("keys.form.fields.key_format.label"),readonly:t.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"])]),t.fields.key_format==="jwk"?(e.openBlock(),e.createBlock(V,{key:0,modelValue:t.fields.jwk,"onUpdate:modelValue":a[5]||(a[5]=r=>t.fields.jwk=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-jwk",label:e.unref(d)("keys.form.fields.jwk.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.jwk.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.jwk.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","label-attributes","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(V,{key:1,modelValue:t.fields.private_key,"onUpdate:modelValue":a[6]||(a[6]=r=>t.fields.private_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-private-key",label:e.unref(d)("keys.form.fields.private_key.label"),placeholder:e.unref(d)("keys.form.fields.private_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(V,{key:2,modelValue:t.fields.public_key,"onUpdate:modelValue":a[7]||(a[7]=r=>t.fields.public_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-public-key",label:e.unref(d)("keys.form.fields.public_key.label"),placeholder:e.unref(d)("keys.form.fields.public_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-c9e601fc"]]),be={class:"kong-ui-entities-keys-entity-config-card"},he={key:2},_e=e.defineComponent({__name:"KeyConfigCard",props:{config:{type:Object,required:!0,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)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},keySetId:{type:String,default:null},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(i,{emit:T}){var F;const h=T,l=i,{axiosInstance:f}=c.useAxios((F=l.config)==null?void 0:F.axiosRequestConfig),{convertKeyToTitle:d}=c.useStringHelpers(),{i18n:{t:w}}=H.useI18n(),K=e.computed(()=>l.keySetId?`${$.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi,l.keySetId):$.form[l.config.app].edit.all),U=e.computed(()=>{var s;return(s=$.form[l.config.app])==null?void 0:s.getKeySet}),S=e.ref(),t=e.ref({}),_=e.ref(l.keySetId||""),x=e.ref(""),D=e.ref(!1),O=async s=>{var u;S.value=s,_.value=(u=s==null?void 0:s.set)==null?void 0:u.id,h("fetch:success",s),J(s)};e.watch(_,async()=>{var u,I;if(!_.value)return;let s=`${l.config.apiBaseUrl}${U.value}`;l.config.app==="konnect"?s=s.replace(/{controlPlaneId}/gi,((u=l.config)==null?void 0:u.controlPlaneId)||"").replace(/{keySetId}/gi,_.value||""):l.config.app==="kongManager"&&(s=s.replace(/\/{workspace}/gi,(I=l.config)!=null&&I.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,_.value||""));try{D.value=!0;const{data:g}=await f.get(s);x.value=(g==null?void 0:g.name)||(g==null?void 0:g.id)}catch(g){h("fetch:error",g)}finally{D.value=!1}},{immediate:!0});const J=s=>{var u,I;try{if(s.jwk){const g=JSON.parse(s.jwk);Object.keys(g).forEach(B=>{t.value={...t.value,[`jwk.${B}`]:g[B]}})}else t.value={"pem.public_key":(u=s==null?void 0:s.pem)==null?void 0:u.public_key,"pem.private_key":(I=s==null?void 0:s.pem)==null?void 0:I.private_key}}catch(g){h("fetch:error",g)}return t},W=e.ref({id:{},name:{tooltip:w("keys.form.fields.name.tooltip")},last_updated:{},created:{},set:{label:w("keys.form.fields.set.label"),section:c.ConfigurationSchemaSection.Basic,tooltip:w("keys.form.fields.set.tooltip"),order:5},kid:{label:w("keys.form.fields.kid.label"),section:c.ConfigurationSchemaSection.Basic,tooltip:w("keys.form.fields.kid.tooltip")},tags:{tooltip:w("keys.form.fields.tags.tooltip")},jwk:{label:w("keys.form.fields.jwk.label"),type:c.ConfigurationSchemaType.Json},pem:{section:c.ConfigurationSchemaSection.Advanced,label:w("keys.form.fields.key_format.options.pem"),type:c.ConfigurationSchemaType.Json}});return(s,u)=>{var g,B;const I=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",be,[e.createVNode(e.unref(c.EntityBaseConfigCard),{config:i.config,"config-card-doc":i.configCardDoc,"config-schema":W.value,"enable-terraform":i.enableTerraform,"entity-type":e.unref(c.SupportedEntityType).Key,"fetch-url":K.value,"hide-title":i.hideTitle,"onFetch:error":u[0]||(u[0]=k=>s.$emit("fetch:error",k)),"onFetch:success":O,onLoading:u[1]||(u[1]=k=>s.$emit("loading",k))},e.createSlots({set:e.withCtx(({row:k})=>[D.value?(e.openBlock(),e.createBlock(I,{key:0,"data-testid":"key-set-name-loader",type:"spinner"})):k.value&&k.value.id===_.value&&x.value?(e.openBlock(),e.createBlock(e.unref(c.InternalLinkItem),{key:1,item:{key:k.value.id,value:x.value,type:e.unref(c.ConfigurationSchemaType).LinkInternal},onClick:L=>s.$emit("navigation-click",k.value.id,"key-sets")},null,8,["item","onClick"])):(e.openBlock(),e.createElementBlock("div",he,e.toDisplayString("–")))]),_:2},[(g=S.value)!=null&&g.jwk?{name:"jwk",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),k=>(e.openBlock(),e.createBlock(e.unref(c.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(d)(k),value:t.value[k]}},null,8,["data-testid","item"]))),128))]),key:"0"}:void 0,(B=S.value)!=null&&B.pem?{name:"pem",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),k=>(e.openBlock(),e.createBlock(e.unref(c.ConfigCardItem),{key:k,"data-testid":`${k}`,item:{key:k,label:e.unref(d)(k),value:t.value[k]}},null,8,["data-testid","item"]))),128))]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}});C.KeyConfigCard=_e,C.KeyForm=ge,C.KeyList=ce,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-85381f68]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-85381f68]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-85381f68]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-85381f68] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-85381f68]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-94d27e50]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-94d27e50]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-94d27e50] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-71b4425a]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-71b4425a]{margin-left:auto}.kong-ui-entity-base-table .actions-container[data-v-71b4425a]{float:right}.kong-ui-entity-base-table .actions-container[data-v-71b4425a] .k-dropdown-item-trigger{margin-bottom:0;margin-top:0}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-94990087]{width:100%}.kong-ui-entity-filter-clear[data-v-94990087]{cursor:pointer}.kong-ui-entity-filter[data-v-94990087]{display:flex;position:relative}.kong-ui-entity-filter[data-v-94990087] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-94990087] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-94990087]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-94990087]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-94990087]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-94990087]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-94990087]{color:#232633}.menu-item-expand-icon[data-v-94990087]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-94990087]{transform:rotate(180deg)}.menu-item-indicator[data-v-94990087]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-94990087]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-94990087] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-94990087] .k-input{width:100%}.menu-item-body[data-v-94990087] .k-select-input .input{font-size:12px}.menu-item-body[data-v-94990087] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-94990087]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-94990087]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-94990087]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-keys-list[data-v-58d43c7d]{width:100%}.kong-ui-entities-keys-list .kong-ui-entity-filter-input[data-v-58d43c7d]{margin-right:12px}.kong-ui-entities-keys-form[data-v-c9e601fc],.kong-ui-entities-keys-form .key-form-textarea[data-v-c9e601fc]{width:100%}.kong-ui-entities-keys-form .invalid-key-set-message[data-v-c9e601fc]{color:#d60027;font-size:11px;font-weight:500;margin-top:3px!important}.kong-ui-entities-keys-form[data-v-c9e601fc] .k-select .custom-selected-item{left:0}.kong-ui-entities-keys-form .select-item-container .select-item-label[data-v-c9e601fc]{font-weight:600}.kong-ui-entities-keys-form .select-item-container .select-item-description[data-v-c9e601fc]{color:#6c7489;font-size:12px}
1
+ .config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-711ebcf2]{align-items:center;border-bottom:var(--2f5b0492);display:var(--5d59c22c);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-711ebcf2]{width:var(--aa41a894)}.config-card-details-row .config-card-details-label label[data-v-711ebcf2]{color:#3a3f51}.config-card-details-row .config-card-details-value[data-v-711ebcf2]{width:var(--aa3d1cde)}.config-card-details-row .config-card-details-value .truncated[data-v-711ebcf2]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-711ebcf2]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-711ebcf2] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-711ebcf2]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-711ebcf2]{margin-right:4px}.config-card-details-row[data-v-711ebcf2] .k-label{margin-bottom:0}.config-card-details-row[data-v-711ebcf2] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-711ebcf2] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-85381f68]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-85381f68]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-85381f68]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-85381f68] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-85381f68]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-94d27e50]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-94d27e50]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-94d27e50] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-94d27e50] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-94d27e50] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-71b4425a]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-71b4425a]{margin-left:auto}.kong-ui-entity-base-table .actions-container[data-v-71b4425a]{float:right}.kong-ui-entity-base-table .actions-container[data-v-71b4425a] .k-dropdown-item-trigger{margin-bottom:0;margin-top:0}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-94990087]{width:100%}.kong-ui-entity-filter-clear[data-v-94990087]{cursor:pointer}.kong-ui-entity-filter[data-v-94990087]{display:flex;position:relative}.kong-ui-entity-filter[data-v-94990087] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-94990087] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-94990087]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-94990087]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-94990087]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-94990087]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-94990087]{color:#232633}.menu-item-expand-icon[data-v-94990087]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-94990087]{transform:rotate(180deg)}.menu-item-indicator[data-v-94990087]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-94990087]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-94990087] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-94990087] .k-input{width:100%}.menu-item-body[data-v-94990087] .k-select-input .input{font-size:12px}.menu-item-body[data-v-94990087] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-94990087]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-94990087]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-94990087]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-keys-list[data-v-7ca9a3a4]{width:100%}.kong-ui-entities-keys-list .kong-ui-entity-filter-input[data-v-7ca9a3a4]{margin-right:12px}.kong-ui-entities-keys-form[data-v-c9e601fc],.kong-ui-entities-keys-form .key-form-textarea[data-v-c9e601fc]{width:100%}.kong-ui-entities-keys-form .invalid-key-set-message[data-v-c9e601fc]{color:#d60027;font-size:11px;font-weight:500;margin-top:3px!important}.kong-ui-entities-keys-form[data-v-c9e601fc] .k-select .custom-selected-item{left:0}.kong-ui-entities-keys-form .select-item-container .select-item-label[data-v-c9e601fc]{font-weight:600}.kong-ui-entities-keys-form .select-item-container .select-item-description[data-v-c9e601fc]{color:#6c7489;font-size:12px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-keys",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-keys.umd.js",
6
6
  "module": "./dist/entities-keys.es.js",