@kong-ui-public/entities-keys 3.13.41 → 3.14.0

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