@kong-ui-public/entities-keys 3.5.55 → 3.5.56

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