@kong-ui-public/entities-keys 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { defineComponent as me, ref as I, computed as S, watch as ee, onBeforeMount as Se, resolveComponent as x, 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 Me, reactive as be, createCommentVNode as ae, createSlots as xe } 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 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";
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 Ue, EntityFilter as Ae, PermissionsWrapper as se, 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 Le, ConfigurationSchemaSection as fe, ConfigurationSchemaType as ue, EntityBaseConfigCard as We, InternalLinkItem as Qe, ConfigCardItem as _e } from "@kong-ui-public/entities-shared";
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
6
  const Ge = {
7
7
  title: "Keys",
8
8
  list: {
@@ -119,40 +119,28 @@ const Ge = {
119
119
  keys: Ge
120
120
  };
121
121
  function ze() {
122
- const o = Fe("en-us", He);
122
+ const i = Fe("en-us", He);
123
123
  return {
124
- i18n: o,
125
- i18nT: Re(o)
124
+ i18n: i,
125
+ i18nT: Re(i)
126
126
  // Translation component <i18n-t>
127
127
  };
128
128
  }
129
129
  const ve = {
130
130
  useI18n: ze
131
- }, U = "/v2/control-planes/{controlPlaneId}/core-entities", A = "/{workspace}", P = {
131
+ }, A = "/v2/control-planes/{controlPlaneId}/core-entities", U = "/{workspace}", P = {
132
132
  list: {
133
133
  konnect: {
134
- all: `${U}/keys`,
135
- forKeySet: `${U}/key-sets/{keySetId}/keys`
136
- },
137
- kongManager: {
138
134
  all: `${A}/keys`,
139
135
  forKeySet: `${A}/key-sets/{keySetId}/keys`
136
+ },
137
+ kongManager: {
138
+ all: `${U}/keys`,
139
+ forKeySet: `${U}/key-sets/{keySetId}/keys`
140
140
  }
141
141
  },
142
142
  form: {
143
143
  konnect: {
144
- create: {
145
- all: `${U}/keys`,
146
- forKeySet: `${U}/key-sets/{keySetId}/keys`
147
- },
148
- edit: {
149
- all: `${U}/keys/{id}`,
150
- forKeySet: `${U}/key-sets/{keySetId}/keys/{id}`
151
- },
152
- keySets: `${U}/key-sets`,
153
- getKeySet: `${U}/key-sets/{keySetId}`
154
- },
155
- kongManager: {
156
144
  create: {
157
145
  all: `${A}/keys`,
158
146
  forKeySet: `${A}/key-sets/{keySetId}/keys`
@@ -163,6 +151,18 @@ const ve = {
163
151
  },
164
152
  keySets: `${A}/key-sets`,
165
153
  getKeySet: `${A}/key-sets/{keySetId}`
154
+ },
155
+ kongManager: {
156
+ create: {
157
+ all: `${U}/keys`,
158
+ forKeySet: `${U}/key-sets/{keySetId}/keys`
159
+ },
160
+ edit: {
161
+ all: `${U}/keys/{id}`,
162
+ forKeySet: `${U}/key-sets/{keySetId}/keys/{id}`
163
+ },
164
+ keySets: `${U}/key-sets`,
165
+ getKeySet: `${U}/key-sets/{keySetId}`
166
166
  }
167
167
  }
168
168
  }, Xe = { class: "kong-ui-entities-keys-list" }, Ye = { key: 1 }, Ze = /* @__PURE__ */ me({
@@ -172,7 +172,7 @@ const ve = {
172
172
  config: {
173
173
  type: Object,
174
174
  required: !0,
175
- validator: (o) => !(!o || !["konnect", "kongManager"].includes(o == null ? void 0 : o.app) || !o.createRoute || !o.getViewRoute || !o.getEditRoute || o.app === "kongManager" && !o.isExactMatch && !o.filterSchema)
175
+ 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)
176
176
  },
177
177
  // used to override the default identifier for the cache entry
178
178
  cacheIdentifier: {
@@ -210,99 +210,99 @@ const ve = {
210
210
  }
211
211
  },
212
212
  emits: ["error", "copy:success", "copy:error", "delete:success"],
213
- setup(o, { emit: O }) {
214
- var ie;
215
- const _ = O, l = o, { i18n: { t: c } } = ve.useI18n(), d = Ie(), { axiosInstance: K } = ge((ie = l.config) == null ? void 0 : ie.axiosRequestConfig), F = I(1), H = S(() => l.config.app !== "kongManager" || !!l.config.disableSorting), j = {
213
+ setup(i, { emit: O }) {
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 = {
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 },
219
219
  tags: { label: c("keys.list.table_headers.tags") },
220
220
  id: { label: c("keys.list.table_headers.id"), sortable: !0 }
221
221
  }, e = j, w = S(() => {
222
- var t, i, f, b;
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, ((i = l.config) == null ? void 0 : i.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
- }), M = I(""), B = S(() => {
226
- const s = l.config.app === "konnect" || l.config.isExactMatch;
227
- if (s)
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;
225
+ }), x = I(""), B = S(() => {
226
+ const a = l.config.app === "konnect" || l.config.isExactMatch;
227
+ if (a)
228
228
  return {
229
- isExactMatch: s,
229
+ isExactMatch: a,
230
230
  placeholder: c("keys.search.placeholder")
231
231
  };
232
232
  const t = { name: j.name };
233
233
  return {
234
- isExactMatch: s,
234
+ isExactMatch: a,
235
235
  fields: t,
236
236
  schema: l.config.filterSchema
237
237
  };
238
238
  }), { fetcher: z, fetcherState: X } = Te(l.config, w.value), Y = () => {
239
- M.value = "";
239
+ x.value = "";
240
240
  }, J = () => {
241
241
  F.value++;
242
- }, r = I(null), g = (s, t) => {
243
- const i = s.id;
244
- if (!t(i)) {
245
- R(s, "id");
242
+ }, r = I(null), g = (a, t) => {
243
+ const o = a.id;
244
+ if (!t(o)) {
245
+ R(a, "id");
246
246
  return;
247
247
  }
248
- v(s, "id");
249
- }, $ = (s, t) => {
250
- const i = JSON.stringify(s);
251
- if (!t(i)) {
248
+ v(a, "id");
249
+ }, $ = (a, t) => {
250
+ const o = JSON.stringify(a);
251
+ if (!t(o)) {
252
252
  _("copy:error", {
253
- entity: s,
253
+ entity: a,
254
254
  message: c("keys.errors.copy")
255
255
  });
256
256
  return;
257
257
  }
258
258
  _("copy:success", {
259
- entity: s,
259
+ entity: a,
260
260
  message: c("keys.copy.success_brief")
261
261
  });
262
- }, v = (s, t) => {
262
+ }, v = (a, t) => {
263
263
  _("copy:success", {
264
- entity: s,
264
+ entity: a,
265
265
  field: t,
266
- message: c("keys.copy.success", { val: s[t] })
266
+ message: c("keys.copy.success", { val: a[t] })
267
267
  });
268
- }, R = (s, t) => {
268
+ }, R = (a, t) => {
269
269
  _("copy:error", {
270
- entity: s,
270
+ entity: a,
271
271
  field: t,
272
272
  message: c("keys.errors.copy")
273
273
  });
274
- }, p = async (s) => {
275
- var i;
276
- await ((i = l.canRetrieve) == null ? void 0 : i.call(l, s)) && d.push(l.config.getViewRoute(s.id));
277
- }, te = (s) => ({
274
+ }, p = async (a) => {
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) => ({
278
278
  label: c("keys.actions.view"),
279
- to: l.config.getViewRoute(s)
280
- }), re = (s) => ({
279
+ to: l.config.getViewRoute(a)
280
+ }), re = (a) => ({
281
281
  label: c("keys.actions.edit"),
282
- to: l.config.getEditRoute(s)
283
- }), T = I(void 0), L = I(!1), W = I(!1), le = I(""), oe = Ve(l.config, w.value), de = (s) => {
284
- T.value = s, L.value = !0;
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;
285
285
  }, ce = () => {
286
- L.value = !1;
286
+ W.value = !1;
287
287
  }, ye = async () => {
288
- var s, t, i;
289
- if ((s = T.value) != null && s.id) {
290
- W.value = !0;
288
+ var a, t, o;
289
+ if ((a = T.value) != null && a.id) {
290
+ L.value = !0;
291
291
  try {
292
- await K.delete(oe(T.value.id)), W.value = !1, L.value = !1, F.value++, _("delete:success", T.value);
292
+ await K.delete(ie(T.value.id)), L.value = !1, W.value = !1, F.value++, _("delete:success", T.value);
293
293
  } catch (f) {
294
- le.value = ((i = (t = f.response) == null ? void 0 : t.data) == null ? void 0 : i.message) || f.message || c("keys.errors.delete"), _("error", f);
294
+ le.value = ((o = (t = f.response) == null ? void 0 : t.data) == null ? void 0 : o.message) || f.message || c("keys.errors.delete"), _("error", f);
295
295
  } finally {
296
- W.value = !1;
296
+ L.value = !1;
297
297
  }
298
298
  }
299
299
  }, Q = I(!1);
300
- ee(X, (s) => {
301
- var t, i, f, b;
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) {
300
+ ee(X, (a) => {
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
303
  r.value = {
304
304
  title: c("keys.errors.general")
305
- }, (b = (f = (i = s.error) == null ? void 0 : i.response) == null ? void 0 : f.data) != null && b.message && (r.value.message = s.error.response.data.message), _("error", s.error);
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);
306
306
  return;
307
307
  }
308
308
  r.value = null;
@@ -315,52 +315,52 @@ const ve = {
315
315
  });
316
316
  return Se(async () => {
317
317
  await l.canCreate() && (G.value.title = c("keys.list.empty_state.title"), G.value.ctaText = c("keys.actions.create"));
318
- }), (s, t) => {
319
- const i = x("KButton"), f = x("KCopy"), b = x("KBadge"), E = x("KTruncate"), n = x("KDropdownItem"), u = x("KClipboardProvider");
318
+ }), (a, t) => {
319
+ const o = M("KButton"), f = M("KCopy"), b = M("KBadge"), E = M("KTruncate"), n = M("KDropdownItem"), u = M("KClipboardProvider");
320
320
  return h(), V("div", Xe, [
321
- k(a(Ue), {
322
- "cache-identifier": o.cacheIdentifier,
321
+ k(s(Ae), {
322
+ "cache-identifier": i.cacheIdentifier,
323
323
  "disable-pagination-page-jump": "",
324
324
  "disable-sorting": H.value,
325
325
  "empty-state-options": G.value,
326
326
  "enable-entity-actions": "",
327
327
  "error-message": r.value,
328
- fetcher: a(z),
328
+ fetcher: s(z),
329
329
  "fetcher-cache-key": F.value,
330
330
  "pagination-type": "offset",
331
331
  "preferences-storage-key": "kong-ui-entities-keys-list",
332
- query: M.value,
333
- "table-headers": a(e),
334
- "use-action-outside": o.useActionOutside,
332
+ query: x.value,
333
+ "table-headers": s(e),
334
+ "use-action-outside": i.useActionOutside,
335
335
  onClearSearchInput: Y,
336
336
  "onClick:row": t[2] || (t[2] = (m) => p(m)),
337
337
  onSort: J
338
338
  }, {
339
339
  "toolbar-filter": y(() => [
340
- k(a(Ae), {
341
- modelValue: M.value,
342
- "onUpdate:modelValue": t[0] || (t[0] = (m) => M.value = m),
340
+ k(s(Ue), {
341
+ modelValue: x.value,
342
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => x.value = m),
343
343
  config: B.value
344
344
  }, null, 8, ["modelValue", "config"])
345
345
  ]),
346
346
  "toolbar-button": y(() => [
347
347
  (h(), D(je, {
348
- disabled: !o.useActionOutside,
348
+ disabled: !i.useActionOutside,
349
349
  to: "#kong-ui-app-page-header-action-button"
350
350
  }, [
351
- k(a(se), {
352
- "auth-function": () => o.canCreate()
351
+ k(s(ae), {
352
+ "auth-function": () => i.canCreate()
353
353
  }, {
354
354
  default: y(() => [
355
- $e(k(i, {
355
+ $e(k(o, {
356
356
  appearance: "primary",
357
357
  "data-testid": "toolbar-add-key",
358
358
  size: "large",
359
- to: o.config.createRoute
359
+ to: i.config.createRoute
360
360
  }, {
361
361
  default: y(() => [
362
- k(a(De)),
363
- Z(" " + C(a(c)("keys.list.toolbar_actions.new_key")), 1)
362
+ k(s(De)),
363
+ Z(" " + C(s(c)("keys.list.toolbar_actions.new_key")), 1)
364
364
  ]),
365
365
  _: 1
366
366
  }, 8, ["to"]), [
@@ -382,7 +382,7 @@ const ve = {
382
382
  default: y(() => [
383
383
  (h(!0), V(ke, null, pe(m, (N) => (h(), D(b, {
384
384
  key: N,
385
- onClick: t[1] || (t[1] = Me(() => {
385
+ onClick: t[1] || (t[1] = xe(() => {
386
386
  }, ["stop"]))
387
387
  }, {
388
388
  default: y(() => [
@@ -408,7 +408,7 @@ const ve = {
408
408
  onClick: (Ke) => g(m, N)
409
409
  }, {
410
410
  default: y(() => [
411
- Z(C(a(c)("keys.actions.copy_id")), 1)
411
+ Z(C(s(c)("keys.actions.copy_id")), 1)
412
412
  ]),
413
413
  _: 2
414
414
  }, 1032, ["onClick"])
@@ -422,15 +422,15 @@ const ve = {
422
422
  onClick: (Ke) => $(m, N)
423
423
  }, {
424
424
  default: y(() => [
425
- Z(C(a(c)("keys.actions.copy_json")), 1)
425
+ Z(C(s(c)("keys.actions.copy_json")), 1)
426
426
  ]),
427
427
  _: 2
428
428
  }, 1032, ["onClick"])
429
429
  ]),
430
430
  _: 2
431
431
  }, 1024),
432
- k(a(se), {
433
- "auth-function": () => o.canRetrieve(m)
432
+ k(s(ae), {
433
+ "auth-function": () => i.canRetrieve(m)
434
434
  }, {
435
435
  default: y(() => [
436
436
  k(n, {
@@ -441,8 +441,8 @@ const ve = {
441
441
  ]),
442
442
  _: 2
443
443
  }, 1032, ["auth-function"]),
444
- k(a(se), {
445
- "auth-function": () => o.canEdit(m)
444
+ k(s(ae), {
445
+ "auth-function": () => i.canEdit(m)
446
446
  }, {
447
447
  default: y(() => [
448
448
  k(n, {
@@ -452,8 +452,8 @@ const ve = {
452
452
  ]),
453
453
  _: 2
454
454
  }, 1032, ["auth-function"]),
455
- k(a(se), {
456
- "auth-function": () => o.canDelete(m)
455
+ k(s(ae), {
456
+ "auth-function": () => i.canDelete(m)
457
457
  }, {
458
458
  default: y(() => [
459
459
  k(n, {
@@ -463,7 +463,7 @@ const ve = {
463
463
  onClick: (N) => de(m)
464
464
  }, {
465
465
  default: y(() => [
466
- Z(C(a(c)("keys.actions.delete")), 1)
466
+ Z(C(s(c)("keys.actions.delete")), 1)
467
467
  ]),
468
468
  _: 2
469
469
  }, 1032, ["onClick"])
@@ -473,38 +473,38 @@ const ve = {
473
473
  ]),
474
474
  _: 1
475
475
  }, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "use-action-outside"]),
476
- k(a(qe), {
477
- "action-pending": W.value,
478
- description: a(c)("keys.delete.description"),
476
+ k(s(qe), {
477
+ "action-pending": L.value,
478
+ description: s(c)("keys.delete.description"),
479
479
  "entity-name": T.value && (T.value.name || T.value.id),
480
- "entity-type": a(Pe).Key,
480
+ "entity-type": s(Pe).Key,
481
481
  error: le.value,
482
482
  "need-confirm": !1,
483
- title: a(c)("keys.delete.title"),
484
- visible: L.value,
483
+ title: s(c)("keys.delete.title"),
484
+ visible: W.value,
485
485
  onCancel: ce,
486
486
  onProceed: ye
487
487
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
488
488
  ]);
489
489
  };
490
490
  }
491
- }), Ce = (o, O) => {
492
- const _ = o.__vccOpts || o;
491
+ }), Ce = (i, O) => {
492
+ const _ = i.__vccOpts || i;
493
493
  for (const [l, c] of O)
494
494
  _[l] = c;
495
495
  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" }, ot = { class: "select-item-label" }, it = { class: "select-item-description" }, at = {
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 = {
497
497
  key: 0,
498
498
  class: "invalid-key-set-message",
499
499
  "data-testid": "invalid-key-set-message"
500
- }, st = { "data-testid": "key-format-container" }, nt = /* @__PURE__ */ me({
500
+ }, at = { "data-testid": "key-format-container" }, nt = /* @__PURE__ */ me({
501
501
  __name: "KeyForm",
502
502
  props: {
503
503
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
504
504
  config: {
505
505
  type: Object,
506
506
  required: !0,
507
- validator: (o) => !(!o || !["konnect", "kongManager"].includes(o == null ? void 0 : o.app) || o.app === "konnect" && !o.controlPlaneId || o.app === "kongManager" && typeof o.workspace != "string" || !o.cancelRoute)
507
+ 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)
508
508
  },
509
509
  /** If a valid Key ID is provided, it will put the form in Edit mode instead of Create */
510
510
  keyId: {
@@ -534,9 +534,9 @@ const ve = {
534
534
  }
535
535
  },
536
536
  emits: ["update", "error", "loading"],
537
- setup(o, { emit: O }) {
538
- var s;
539
- const _ = O, l = o, c = Ie(), { i18n: { t: d } } = ve.useI18n(), { getMessageFromError: K } = Oe(), { axiosInstance: F } = ge((s = l.config) == null ? void 0 : s.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
+ 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({
540
540
  fields: {
541
541
  name: "",
542
542
  tags: "",
@@ -558,7 +558,7 @@ const ve = {
558
558
  jwk: "",
559
559
  private_key: "",
560
560
  public_key: ""
561
- }), M = [
561
+ }), x = [
562
562
  {
563
563
  label: d("keys.form.fields.key_format.options.jwk"),
564
564
  value: "jwk"
@@ -572,32 +572,32 @@ const ve = {
572
572
  j.value === ne.Create && (e.fields.key_set = t);
573
573
  }, { immediate: !0 });
574
574
  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
- var i, f, b, E;
576
- e.fields.key_id = (t == null ? void 0 : t.kid) || "", e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((i = t == null ? void 0 : t.tags) == null ? void 0 : i.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);
575
+ var o, f, b, E;
576
+ 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
577
  }, J = () => {
578
578
  c.push(l.config.cancelRoute);
579
579
  }, r = S(() => {
580
- var i, f;
580
+ var o, f;
581
581
  let t = `${l.config.apiBaseUrl}${P.form[l.config.app][j.value][l.keySetId ? "forKeySet" : "all"]}`;
582
- return l.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((i = l.config) == null ? void 0 : i.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;
582
+ 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;
583
583
  }), g = S(() => {
584
- var t, i, f;
584
+ var t, o, f;
585
585
  return {
586
586
  kid: e.fields.key_id,
587
587
  name: e.fields.name || null,
588
- tags: ((f = (i = (t = e.fields.tags) == null ? void 0 : t.split(",")) == null ? void 0 : i.map((b) => String(b || "").trim())) == null ? void 0 : f.filter((b) => b !== "")) || [],
588
+ tags: ((f = (o = (t = e.fields.tags) == null ? void 0 : t.split(",")) == null ? void 0 : o.map((b) => String(b || "").trim())) == null ? void 0 : f.filter((b) => b !== "")) || [],
589
589
  set: e.fields.key_set ? { id: e.fields.key_set } : null,
590
590
  jwk: e.fields.key_format === "jwk" ? e.fields.jwk : null,
591
591
  pem: e.fields.key_format === "pem" ? { private_key: e.fields.private_key, public_key: e.fields.public_key } : null
592
592
  };
593
593
  }), $ = async () => {
594
- var t, i, f, b, E;
594
+ var t, o, f, b, E;
595
595
  try {
596
596
  e.isReadonly = !0;
597
597
  let n;
598
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
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 = ((i = u == null ? void 0 : u.tags) == null ? void 0 : i.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);
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);
601
601
  }
602
602
  } catch (n) {
603
603
  e.errorMessage = K(n), _("error", n);
@@ -611,147 +611,153 @@ const ve = {
611
611
  error: te,
612
612
  validationError: re,
613
613
  loadItems: T,
614
- results: L
614
+ results: W
615
615
  } = Ne(l.config, P.form[l.config.app].keySets, void 0, {
616
616
  fetchedItemsKey: "data",
617
617
  searchKeys: ["id", "name"]
618
- }), W = (t) => {
618
+ }), L = (t) => {
619
619
  (!t || t !== e.fields.key_set && t !== w.key_set) && v(t);
620
- }, le = S(() => te.value ? d("keys.errors.key_sets.fetch") : ""), oe = S(() => re.value ? d("keys.errors.key_sets.invalid") : ""), de = I(0), ce = S(() => p.value === void 0), ye = S(() => {
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(() => {
621
621
  if (ce.value)
622
622
  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((i) => ({
624
- name: i.name || "",
623
+ }), Q = I(/* @__PURE__ */ new Set()), G = S(() => Array.from(Q.value).map((o) => ({
624
+ name: o.name || "",
625
625
  // can't use name for label or it tries to search => 404
626
626
  label: "",
627
627
  // leave it blank so no flicker when used with selected-item-template
628
- value: i.id,
629
- selected: e.fields.key_set === i.id
630
- }))), ie = (t) => {
628
+ value: o.id,
629
+ selected: e.fields.key_set === o.id
630
+ }))), oe = (t) => {
631
631
  Q.value.clear();
632
- let i;
633
- for (i of t)
634
- Q.value.add(i);
632
+ let o;
633
+ for (o of t)
634
+ Q.value.add(o);
635
635
  };
636
- return ee(L, (t) => {
637
- ie(t);
636
+ return ee(W, (t) => {
637
+ oe(t);
638
638
  }, { immediate: !0, deep: !0 }), ee(G, () => {
639
639
  de.value++;
640
640
  }, { immediate: !0, deep: !0 }), Se(async () => {
641
641
  await T();
642
- }), (t, i) => {
643
- const f = x("KInput"), b = x("KSelect"), E = x("KTextArea");
642
+ }), (t, o) => {
643
+ const f = M("KInput"), b = M("KSelect"), E = M("KTextArea");
644
644
  return h(), V("div", et, [
645
- k(a(Je), {
645
+ k(s(Je), {
646
646
  "can-submit": X.value,
647
- config: o.config,
648
- "edit-id": o.keyId,
649
- "enable-terraform": o.enableTerraform,
650
- "entity-type": a(we).Key,
647
+ config: i.config,
648
+ "edit-id": i.keyId,
649
+ "enable-terraform": i.enableTerraform,
650
+ "entity-type": s(we).Key,
651
651
  "error-message": e.errorMessage || le.value,
652
652
  "fetch-url": H.value,
653
653
  "form-fields": g.value,
654
654
  "is-readonly": e.isReadonly,
655
655
  onCancel: J,
656
- "onFetch:error": i[8] || (i[8] = (n) => t.$emit("error", n)),
656
+ "onFetch:error": o[8] || (o[8] = (n) => t.$emit("error", n)),
657
657
  "onFetch:success": Y,
658
- onLoading: i[9] || (i[9] = (n) => t.$emit("loading", n)),
658
+ onLoading: o[9] || (o[9] = (n) => t.$emit("loading", n)),
659
659
  onSubmit: $
660
660
  }, {
661
661
  default: y(() => [
662
- k(a(he), {
663
- description: a(d)("keys.form.sections.general.description"),
664
- title: a(d)("keys.form.sections.general.title")
662
+ k(s(he), {
663
+ description: s(d)("keys.form.sections.general.description"),
664
+ title: s(d)("keys.form.sections.general.title")
665
665
  }, {
666
666
  default: y(() => [
667
667
  k(f, {
668
668
  modelValue: e.fields.key_id,
669
- "onUpdate:modelValue": i[0] || (i[0] = (n) => e.fields.key_id = n),
669
+ "onUpdate:modelValue": o[0] || (o[0] = (n) => e.fields.key_id = n),
670
670
  modelModifiers: { trim: !0 },
671
671
  autocomplete: "off",
672
672
  "data-testid": "key-form-id",
673
- help: a(d)("keys.form.fields.id.help"),
674
- label: a(d)("keys.form.fields.id.label"),
675
- "label-attributes": { info: a(d)("keys.form.fields.id.tooltip") },
676
- placeholder: a(d)("keys.form.fields.id.placeholder"),
673
+ help: s(d)("keys.form.fields.id.help"),
674
+ label: s(d)("keys.form.fields.id.label"),
675
+ "label-attributes": {
676
+ info: s(d)("keys.form.fields.id.tooltip"),
677
+ tooltipAttributes: { maxWidth: "400" }
678
+ },
679
+ placeholder: s(d)("keys.form.fields.id.placeholder"),
677
680
  readonly: e.isReadonly,
678
681
  required: "",
679
682
  type: "text"
680
683
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"]),
681
684
  k(f, {
682
685
  modelValue: e.fields.name,
683
- "onUpdate:modelValue": i[1] || (i[1] = (n) => e.fields.name = n),
686
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => e.fields.name = n),
684
687
  modelModifiers: { trim: !0 },
685
688
  autocomplete: "off",
686
689
  "data-testid": "key-form-name",
687
- label: a(d)("keys.form.fields.name.label"),
688
- placeholder: a(d)("keys.form.fields.name.placeholder"),
690
+ label: s(d)("keys.form.fields.name.label"),
691
+ placeholder: s(d)("keys.form.fields.name.placeholder"),
689
692
  readonly: e.isReadonly,
690
693
  type: "text"
691
694
  }, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
692
695
  k(b, {
693
696
  modelValue: e.fields.key_set,
694
- "onUpdate:modelValue": i[2] || (i[2] = (n) => e.fields.key_set = n),
697
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => e.fields.key_set = n),
695
698
  clearable: z.value,
696
699
  "data-testid": "key-form-key-set",
697
700
  "dropdown-footer-text": ye.value,
698
701
  "enable-filtering": "",
699
702
  "filter-function": () => !0,
700
703
  items: G.value,
701
- label: a(d)("keys.form.fields.key_set.label"),
702
- loading: a(R),
703
- placeholder: a(d)("keys.form.fields.key_set.placeholder"),
704
+ label: s(d)("keys.form.fields.key_set.label"),
705
+ loading: s(R),
706
+ placeholder: s(d)("keys.form.fields.key_set.placeholder"),
704
707
  readonly: B.value,
705
708
  width: "100%",
706
- onQueryChange: W
709
+ onQueryChange: L
707
710
  }, {
708
711
  loading: y(() => [
709
- q("div", null, C(a(d)("keys.actions.loading")), 1)
712
+ q("div", null, C(s(d)("keys.actions.loading")), 1)
710
713
  ]),
711
714
  empty: y(() => [
712
- q("div", tt, C(a(d)("keys.search.no_results")), 1)
715
+ q("div", tt, C(s(d)("keys.search.no_results")), 1)
713
716
  ]),
714
717
  "selected-item-template": y(({ item: n }) => [
715
718
  q("div", null, C(n.name), 1)
716
719
  ]),
717
720
  "item-template": y(({ item: n }) => [
718
721
  q("div", lt, [
719
- q("div", ot, C(n.name), 1),
720
- q("div", it, C(n.value), 1)
722
+ q("div", it, C(n.name), 1),
723
+ q("div", ot, C(n.value), 1)
721
724
  ])
722
725
  ]),
723
726
  _: 1
724
727
  }, 8, ["modelValue", "clearable", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"]),
725
- oe.value ? (h(), V("p", at, C(oe.value), 1)) : ae("", !0),
728
+ ie.value ? (h(), V("p", st, C(ie.value), 1)) : se("", !0),
726
729
  k(f, {
727
730
  modelValue: e.fields.tags,
728
- "onUpdate:modelValue": i[3] || (i[3] = (n) => e.fields.tags = n),
731
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => e.fields.tags = n),
729
732
  modelModifiers: { trim: !0 },
730
733
  autocomplete: "off",
731
734
  "data-testid": "key-form-tags",
732
- help: a(d)("keys.form.fields.tags.help"),
733
- label: a(d)("keys.form.fields.tags.label"),
734
- "label-attributes": { info: a(d)("keys.form.fields.tags.tooltip") },
735
- placeholder: a(d)("keys.form.fields.tags.placeholder"),
735
+ help: s(d)("keys.form.fields.tags.help"),
736
+ label: s(d)("keys.form.fields.tags.label"),
737
+ "label-attributes": {
738
+ info: s(d)("keys.form.fields.tags.tooltip"),
739
+ tooltipAttributes: { maxWidth: "400" }
740
+ },
741
+ placeholder: s(d)("keys.form.fields.tags.placeholder"),
736
742
  readonly: e.isReadonly,
737
743
  type: "text"
738
744
  }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
739
745
  ]),
740
746
  _: 1
741
747
  }, 8, ["description", "title"]),
742
- k(a(he), {
743
- description: a(d)("keys.form.sections.keys.description"),
748
+ k(s(he), {
749
+ description: s(d)("keys.form.sections.keys.description"),
744
750
  "has-divider": "",
745
- title: a(d)("keys.form.sections.keys.title")
751
+ title: s(d)("keys.form.sections.keys.title")
746
752
  }, {
747
753
  default: y(() => [
748
- q("div", st, [
754
+ q("div", at, [
749
755
  k(b, {
750
756
  modelValue: e.fields.key_format,
751
- "onUpdate:modelValue": i[4] || (i[4] = (n) => e.fields.key_format = n),
757
+ "onUpdate:modelValue": o[4] || (o[4] = (n) => e.fields.key_format = n),
752
758
  "data-testid": "key-form-key-format",
753
- items: M,
754
- label: a(d)("keys.form.fields.key_format.label"),
759
+ items: x,
760
+ label: s(d)("keys.form.fields.key_format.label"),
755
761
  readonly: e.isReadonly,
756
762
  required: "",
757
763
  width: "100%"
@@ -760,40 +766,43 @@ const ve = {
760
766
  e.fields.key_format === "jwk" ? (h(), D(E, {
761
767
  key: 0,
762
768
  modelValue: e.fields.jwk,
763
- "onUpdate:modelValue": i[5] || (i[5] = (n) => e.fields.jwk = n),
769
+ "onUpdate:modelValue": o[5] || (o[5] = (n) => e.fields.jwk = n),
764
770
  modelModifiers: { trim: !0 },
765
771
  class: "key-form-textarea",
766
772
  "data-testid": "key-form-jwk",
767
- label: a(d)("keys.form.fields.jwk.label"),
768
- "label-attributes": { info: a(d)("keys.form.fields.jwk.tooltip") },
769
- placeholder: a(d)("keys.form.fields.jwk.placeholder"),
773
+ label: s(d)("keys.form.fields.jwk.label"),
774
+ "label-attributes": {
775
+ info: s(d)("keys.form.fields.jwk.tooltip"),
776
+ tooltipAttributes: { maxWidth: "400" }
777
+ },
778
+ placeholder: s(d)("keys.form.fields.jwk.placeholder"),
770
779
  readonly: e.isReadonly,
771
780
  required: ""
772
- }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : ae("", !0),
781
+ }, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : se("", !0),
773
782
  e.fields.key_format === "pem" ? (h(), D(E, {
774
783
  key: 1,
775
784
  modelValue: e.fields.private_key,
776
- "onUpdate:modelValue": i[6] || (i[6] = (n) => e.fields.private_key = n),
785
+ "onUpdate:modelValue": o[6] || (o[6] = (n) => e.fields.private_key = n),
777
786
  modelModifiers: { trim: !0 },
778
787
  class: "key-form-textarea",
779
788
  "data-testid": "key-form-private-key",
780
- label: a(d)("keys.form.fields.private_key.label"),
781
- placeholder: a(d)("keys.form.fields.private_key.placeholder"),
789
+ label: s(d)("keys.form.fields.private_key.label"),
790
+ placeholder: s(d)("keys.form.fields.private_key.placeholder"),
782
791
  readonly: e.isReadonly,
783
792
  required: ""
784
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : ae("", !0),
793
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : se("", !0),
785
794
  e.fields.key_format === "pem" ? (h(), D(E, {
786
795
  key: 2,
787
796
  modelValue: e.fields.public_key,
788
- "onUpdate:modelValue": i[7] || (i[7] = (n) => e.fields.public_key = n),
797
+ "onUpdate:modelValue": o[7] || (o[7] = (n) => e.fields.public_key = n),
789
798
  modelModifiers: { trim: !0 },
790
799
  class: "key-form-textarea",
791
800
  "data-testid": "key-form-public-key",
792
- label: a(d)("keys.form.fields.public_key.label"),
793
- placeholder: a(d)("keys.form.fields.public_key.placeholder"),
801
+ label: s(d)("keys.form.fields.public_key.label"),
802
+ placeholder: s(d)("keys.form.fields.public_key.placeholder"),
794
803
  readonly: e.isReadonly,
795
804
  required: ""
796
- }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : ae("", !0)
805
+ }, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : se("", !0)
797
806
  ]),
798
807
  _: 1
799
808
  }, 8, ["description", "title"])
@@ -803,14 +812,14 @@ const ve = {
803
812
  ]);
804
813
  };
805
814
  }
806
- }), mt = /* @__PURE__ */ Ce(nt, [["__scopeId", "data-v-aa23b398"]]), rt = { class: "kong-ui-entities-keys-entity-config-card" }, dt = { key: 2 }, gt = /* @__PURE__ */ me({
815
+ }), mt = /* @__PURE__ */ Ce(nt, [["__scopeId", "data-v-c9e601fc"]]), rt = { class: "kong-ui-entities-keys-entity-config-card" }, dt = { key: 2 }, gt = /* @__PURE__ */ me({
807
816
  __name: "KeyConfigCard",
808
817
  props: {
809
818
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
810
819
  config: {
811
820
  type: Object,
812
821
  required: !0,
813
- validator: (o) => !(!o || !["konnect", "kongManager"].includes(o == null ? void 0 : o.app) || o.app === "konnect" && !o.controlPlaneId || o.app === "kongManager" && typeof o.workspace != "string" || !o.entityId)
822
+ 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)
814
823
  },
815
824
  /**
816
825
  * External link for documentation that determines visibility of Documentation button
@@ -844,12 +853,12 @@ const ve = {
844
853
  }
845
854
  },
846
855
  emits: ["loading", "fetch:error", "fetch:success", "navigation-click"],
847
- setup(o, { emit: O }) {
856
+ setup(i, { emit: O }) {
848
857
  var J;
849
- const _ = O, l = o, { axiosInstance: c } = ge((J = l.config) == null ? void 0 : J.axiosRequestConfig), { convertKeyToTitle: d } = Le(), { 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(() => {
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(() => {
850
859
  var r;
851
860
  return (r = P.form[l.config.app]) == null ? void 0 : r.getKeySet;
852
- }), j = I(), e = I({}), w = I(l.keySetId || ""), M = I(""), B = I(!1), z = async (r) => {
861
+ }), j = I(), e = I({}), w = I(l.keySetId || ""), x = I(""), B = I(!1), z = async (r) => {
853
862
  var g;
854
863
  j.value = r, w.value = (g = r == null ? void 0 : r.set) == null ? void 0 : g.id, _("fetch:success", r), X(r);
855
864
  };
@@ -862,7 +871,7 @@ const ve = {
862
871
  try {
863
872
  B.value = !0;
864
873
  const { data: v } = await c.get(r);
865
- M.value = (v == null ? void 0 : v.name) || (v == null ? void 0 : v.id);
874
+ x.value = (v == null ? void 0 : v.name) || (v == null ? void 0 : v.id);
866
875
  } catch (v) {
867
876
  _("fetch:error", v);
868
877
  } finally {
@@ -923,31 +932,31 @@ const ve = {
923
932
  });
924
933
  return (r, g) => {
925
934
  var v, R;
926
- const $ = x("KSkeleton");
935
+ const $ = M("KSkeleton");
927
936
  return h(), V("div", rt, [
928
- k(a(We), {
929
- config: o.config,
930
- "config-card-doc": o.configCardDoc,
937
+ k(s(Le), {
938
+ config: i.config,
939
+ "config-card-doc": i.configCardDoc,
931
940
  "config-schema": Y.value,
932
- "enable-terraform": o.enableTerraform,
933
- "entity-type": a(we).Key,
941
+ "enable-terraform": i.enableTerraform,
942
+ "entity-type": s(we).Key,
934
943
  "fetch-url": F.value,
935
- "hide-title": o.hideTitle,
944
+ "hide-title": i.hideTitle,
936
945
  "onFetch:error": g[0] || (g[0] = (p) => r.$emit("fetch:error", p)),
937
946
  "onFetch:success": z,
938
947
  onLoading: g[1] || (g[1] = (p) => r.$emit("loading", p))
939
- }, xe({
948
+ }, Me({
940
949
  set: y(({ row: p }) => [
941
950
  B.value ? (h(), D($, {
942
951
  key: 0,
943
952
  "data-testid": "key-set-name-loader",
944
953
  type: "spinner"
945
- })) : p.value && p.value.id === w.value && M.value ? (h(), D(a(Qe), {
954
+ })) : p.value && p.value.id === w.value && x.value ? (h(), D(s(Qe), {
946
955
  key: 1,
947
956
  item: {
948
957
  key: p.value.id,
949
- value: M.value,
950
- type: a(ue).LinkInternal
958
+ value: x.value,
959
+ type: s(ue).LinkInternal
951
960
  },
952
961
  onClick: (te) => r.$emit("navigation-click", p.value.id, "key-sets")
953
962
  }, null, 8, ["item", "onClick"])) : (h(), V("div", dt, C("–")))
@@ -957,12 +966,12 @@ const ve = {
957
966
  (v = j.value) != null && v.jwk ? {
958
967
  name: "jwk",
959
968
  fn: y(() => [
960
- (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(a(_e), {
969
+ (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(s(_e), {
961
970
  key: p,
962
971
  "data-testid": `${p}`,
963
972
  item: {
964
973
  key: p,
965
- label: a(d)(p),
974
+ label: s(d)(p),
966
975
  value: e.value[p]
967
976
  }
968
977
  }, null, 8, ["data-testid", "item"]))), 128))
@@ -972,12 +981,12 @@ const ve = {
972
981
  (R = j.value) != null && R.pem ? {
973
982
  name: "pem",
974
983
  fn: y(() => [
975
- (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(a(_e), {
984
+ (h(!0), V(ke, null, pe(Object.keys(e.value), (p) => (h(), D(s(_e), {
976
985
  key: p,
977
986
  "data-testid": `${p}`,
978
987
  item: {
979
988
  key: p,
980
- label: a(d)(p),
989
+ label: s(d)(p),
981
990
  value: e.value[p]
982
991
  }
983
992
  }, 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),L=()=>{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))},W=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),q=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){q.value=!0;try{await w.delete(G(E.value.id)),q.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{q.value=!1}}},P=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)&&(P.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 A=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()&&(A.value.title=f("keys.list.empty_state.title"),A.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":A.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:L,"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,P.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:W(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":q.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)),L=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:W,validationError:X,loadItems:E,results:R}=c.useDebouncedFilter(l.config,$.form[l.config.app].keySets,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),q=o=>{(!o||o!==t.fields.key_set&&o!==_.key_set)&&g(o)},Q=e.computed(()=>W.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}),P=e.ref(new Set),A=e.computed(()=>Array.from(P.value).map(a=>({name:a.name||"",label:"",value:a.id,selected:t.fields.key_set===a.id}))),H=o=>{P.value.clear();let a;for(a of o)P.value.add(a)};return e.watch(R,o=>{H(o)},{immediate:!0,deep:!0}),e.watch(A,()=>{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":L,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")},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:A.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:q},{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")},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")},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-aa23b398"]]),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},L=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":L.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:W=>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 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"})});
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-aa23b398],.kong-ui-entities-keys-form .key-form-textarea[data-v-aa23b398]{width:100%}.kong-ui-entities-keys-form .invalid-key-set-message[data-v-aa23b398]{color:#d60027;font-size:11px;font-weight:500;margin-top:3px!important}.kong-ui-entities-keys-form[data-v-aa23b398] .k-select .custom-selected-item{left:0}.kong-ui-entities-keys-form .select-item-container .select-item-label[data-v-aa23b398]{font-weight:600}.kong-ui-entities-keys-form .select-item-container .select-item-description[data-v-aa23b398]{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-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 +1 @@
1
- {"version":3,"file":"KeyForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/KeyForm.vue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAGnC,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EAIzB,MAAM,UAAU,CAAA;AAYjB,OAAO,gDAAgD,CAAA;;IAsrBrD,oHAAoH;;;;4BAI9F,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;IAQ/E,yFAAyF;;;;;;IAMzF,8FAA8F;;;;;;IAM9F,+EAA+E;;;;;;IAM/E;;;OAGG;;;;;;;;;;IAjCH,oHAAoH;;;;4BAI9F,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;IAQ/E,yFAAyF;;;;;;IAMzF,8FAA8F;;;;;;IAM9F,+EAA+E;;;;;;IAM/E;;;OAGG;;;;;;;;;;;;;;;AAvCL,wBA8CG"}
1
+ {"version":3,"file":"KeyForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/KeyForm.vue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAGnC,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EAIzB,MAAM,UAAU,CAAA;AAYjB,OAAO,gDAAgD,CAAA;;IAitBrD,oHAAoH;;;;4BAI9F,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;IAQ/E,yFAAyF;;;;;;IAMzF,8FAA8F;;;;;;IAM9F,+EAA+E;;;;;;IAM/E;;;OAGG;;;;;;;;;;IAjCH,oHAAoH;;;;4BAI9F,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;IAQ/E,yFAAyF;;;;;;IAMzF,8FAA8F;;;;;;IAM9F,+EAA+E;;;;;;IAM/E;;;OAGG;;;;;;;;;;;;;;;AAvCL,wBA8CG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-keys",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-keys.umd.js",
6
6
  "module": "./dist/entities-keys.es.js",