@kong-ui-public/entities-shared 3.70.2 → 3.70.3-pr.3930.1dcd46774.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,7 +1,7 @@
1
1
  import N from "axios";
2
2
  import { inject as D, ref as y, computed as b, unref as H, toValue as g, watch as re, toRef as oe, provide as S } from "vue";
3
3
  import { createI18n as W, i18nTComponent as ie } from "@kong-ui-public/i18n";
4
- const nt = /* @__PURE__ */ Symbol("PLUGIN_FORM_LAYOUT_STATE"), rt = /* @__PURE__ */ Symbol("CONFIG_CARD_SHOW_SENSITIVE_FIELDS"), Y = /* @__PURE__ */ Symbol("DECK_COMMAND_EDITOR"), J = "[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).", ot = "50vh", it = 2e5, ce = {
4
+ const rt = /* @__PURE__ */ Symbol("PLUGIN_FORM_LAYOUT_STATE"), ot = /* @__PURE__ */ Symbol("CONFIG_CARD_SHOW_SENSITIVE_FIELDS"), Y = /* @__PURE__ */ Symbol("DECK_COMMAND_EDITOR"), J = "[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).", it = "50vh", ct = 2e5, ce = {
5
5
  /** Surfaces the `managed_by` ownership field in entity lists and detail cards. */
6
6
  MANAGED_BY: "KM-3018-entity-managed-by"
7
7
  };
@@ -38,13 +38,13 @@ function ue() {
38
38
  }
39
39
  };
40
40
  }
41
- const R = "khcp-user-table-preferences", de = {
41
+ const M = "khcp-user-table-preferences", de = {
42
42
  pageSize: 30,
43
43
  sortColumnKey: void 0,
44
44
  sortColumnOrder: void 0,
45
45
  columnVisibility: {}
46
46
  };
47
- function ct() {
47
+ function lt() {
48
48
  const e = (o) => {
49
49
  if (typeof o == "string")
50
50
  try {
@@ -54,21 +54,21 @@ function ct() {
54
54
  return;
55
55
  }
56
56
  }, n = () => {
57
- const o = e(localStorage.getItem(R));
57
+ const o = e(localStorage.getItem(M));
58
58
  return !o || !Object.keys(o).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(o));
59
59
  };
60
60
  return {
61
61
  setTablePreferences: (o, t) => {
62
62
  try {
63
63
  const s = n();
64
- s.set(o, t), localStorage.setItem(R, JSON.stringify(Object.fromEntries(s.entries())));
64
+ s.set(o, t), localStorage.setItem(M, JSON.stringify(Object.fromEntries(s.entries())));
65
65
  } catch (s) {
66
66
  console.error("useTablePreferences(setTablePreferences)", s);
67
67
  }
68
68
  },
69
69
  getTablePreferences: (o, t) => n()?.get(o) || void 0 || t || de,
70
70
  deleteAllTablePreferences: () => {
71
- localStorage.removeItem(R);
71
+ localStorage.removeItem(M);
72
72
  }
73
73
  };
74
74
  }
@@ -78,7 +78,7 @@ function T(e = {}) {
78
78
  axiosInstance: n(e)
79
79
  };
80
80
  }
81
- const fe = { actions: { copyId: "Copy ID", copied_id: 'Copied "{id}" to the clipboard', copyToClipboard: "Copied successfully!", copyToClipboardFailed: "Failed to copy to the clipboard" } }, pe = { message: "Are you sure you want to delete this {entityType}?", messageWithName: "Are you sure you want to delete this {entityType} {entityName}?" }, ge = { actions: { viewConfiguration: "View configuration", hideConfiguration: "Hide configuration", save: "Save", cancel: "Cancel", back: "Back" }, configuration: { title: "Configuration", message: "Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.", yaml: "YAML", json: "JSON", terraform: "Terraform", deck: "decK" }, errors: { edit: "The entity could not be edited at this time." } }, me = { emptyState: { noSearchResultsTitle: "No results found", noSearchResultsMessage: "Please adjust the criteria and try again.", noSearchResultsCtaText: "Clear" } }, ye = { title: "Configuration", actions: { copy: "Copy JSON", deck_customize: "Customize before copying to CLI", deck_customize_cancel: "Cancel", sensitive_fields: "Show sensitive fields", sensitive_fields_tooltip: "View masked sensitive data in your configurations if any field values have been redacted." }, sections: { advanced: "Advanced", plugin: "Plugin specific configuration", policy: "Policy specific configuration" }, commonFields: { id_label: "ID", name_label: "Name", enabled_label: "Enabled", enabled_tooltip: "Enabled is FTW", updated_at_label: "Last updated", created_at_label: "Created", managed_by_label: "Managed By", tags_label: "Tags", link: "Link", partial_label: "Redis configuration" }, statusBadge: { enabledLabel: "Enabled", disabledLabel: "Disabled" }, copy: { tooltip: "Copy {label}", success: "Copied!" }, errors: { load: "The entity configuration data could not be loaded at this time.", copy: "Failed to copy to clipboard" }, general: { entryTitle: "Entry {index}", structuredFormat: "Structured" } }, he = { learnMore: "Learn more", pricingTitle: "Pricing: " }, be = { filterButtonText: "Filter", fieldLabel: "Filter by:", inputPlaceholder: "Enter a value", selectPlaceholder: "Select an item", applyButtonText: "Apply", clearButtonText: "Clear", clearAllButtonText: "Clear all filters" }, ve = { errors: { fetch: "Could not fetch available items", invalid: "Please select a valid value" } }, _e = { unexpected: "An unexpected error has occurred", dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.' }, Ae = { utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces." }, Ce = { enable: { title: "Enable {entityType}", message: "Are you sure you want to enable the {entityType} {entityName}?", confirmText: "Yes, enable" }, disable: { title: "Disable {entityType}", message: "Are you sure you want to disable the {entityType} {entityName}?", confirmText: "Yes, disable" } }, we = { hint: { konnect: "The {token} environment variable must be added first. See {link} for details.", kongManager: "If your Admin API is secured, set up authentication following {link}." }, documentation: "the documentation", steps: { step_1: "Step 1: Export token", step_2: "Step 2: Apply configuration" }, customization: { title: "Customize before copying to CLI", copy_pat: "Make sure to copy your personal access token now. You won't be able to see it again.", reuse_pat: "Use an existing PAT if you've already generated one.", generate_pat: "Generate PAT", footer_reminder: "Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.", secret_advise: "Command may contain sensitive values. Treat it as a secret." }, copy_tooltip: "Copy" }, ke = { body: "Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.", cta: "Switch to decK format" }, Ie = { title: "Generate a Personal Access Token", description: "Personal access tokens are used to authenticate decK commands and Konnect API requests.", fields: { name: { label: "Name", placeholder: "Enter token name" }, expiresAt: { label: "Expiration date", placeholder: "Select an expiration date", n_days: "{n} days" } }, actions: { cancel: "Cancel", generate: "Generate", generating: "Generating…" } }, xe = { dismissLabel: "Dismiss" }, Ee = { rotateKey: "Rotate key", generateKey: "Generate key", placeholder: "Enter or generate a key", oneTimeHint: "The key is shown only once. Copy it now and store it securely.", copy: "Copy", showKey: "Show key", hideKey: "Hide key" }, Q = {
81
+ const fe = { actions: { copyId: "Copy ID", copied_id: 'Copied "{id}" to the clipboard', copyToClipboard: "Copied successfully!", copyToClipboardFailed: "Failed to copy to the clipboard" } }, pe = { message: "Are you sure you want to delete this {entityType}?", messageWithName: "Are you sure you want to delete this {entityType} {entityName}?" }, ge = { actions: { viewConfiguration: "View configuration", hideConfiguration: "Hide configuration", save: "Save", cancel: "Cancel", back: "Back" }, configuration: { title: "Configuration", message: "Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.", yaml: "YAML", json: "JSON", terraform: "Terraform", deck: "decK" }, errors: { edit: "The entity could not be edited at this time." } }, me = { emptyState: { noSearchResultsTitle: "No results found", noSearchResultsMessage: "Please adjust the criteria and try again.", noSearchResultsCtaText: "Clear" } }, ye = { title: "Configuration", actions: { copy: "Copy JSON", deck_customize: "Customize before copying to CLI", deck_customize_cancel: "Cancel", sensitive_fields: "Show sensitive fields", sensitive_fields_tooltip: "View masked sensitive data in your configurations if any field values have been redacted." }, sections: { advanced: "Advanced", plugin: "Plugin specific configuration", policy: "Policy specific configuration" }, commonFields: { id_label: "ID", name_label: "Name", enabled_label: "Enabled", enabled_tooltip: "Enabled is FTW", updated_at_label: "Last updated", created_at_label: "Created", managed_by_label: "Managed By", tags_label: "Tags", link: "Link", partial_label: "Redis configuration" }, statusBadge: { enabledLabel: "Enabled", disabledLabel: "Disabled" }, copy: { tooltip: "Copy {label}", success: "Copied!" }, errors: { load: "The entity configuration data could not be loaded at this time.", copy: "Failed to copy to clipboard" }, general: { entryTitle: "Entry {index}", structuredFormat: "Structured" } }, he = { learnMore: "Learn more", pricingTitle: "Pricing: " }, be = { filterButtonText: "Filter", fieldLabel: "Filter by:", inputPlaceholder: "Enter a value", selectPlaceholder: "Select an item", applyButtonText: "Apply", clearButtonText: "Clear", clearAllButtonText: "Clear all filters" }, ve = { errors: { fetch: "Could not fetch available items", invalid: "Please select a valid value" } }, _e = { unexpected: "An unexpected error has occurred", dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.' }, Ae = { utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces." }, Ce = { enable: { title: "Enable {entityType}", message: "Are you sure you want to enable the {entityType} {entityName}?", confirmText: "Yes, enable" }, disable: { title: "Disable {entityType}", message: "Are you sure you want to disable the {entityType} {entityName}?", confirmText: "Yes, disable" } }, ke = { copy_url: "Copy URL" }, we = { hint: { konnect: "The {token} environment variable must be added first. See {link} for details.", kongManager: "If your Admin API is secured, set up authentication following {link}." }, documentation: "the documentation", steps: { step_1: "Step 1: Export token", step_2: "Step 2: Apply configuration" }, customization: { title: "Customize before copying to CLI", copy_pat: "Make sure to copy your personal access token now. You won't be able to see it again.", reuse_pat: "Use an existing PAT if you've already generated one.", generate_pat: "Generate PAT", footer_reminder: "Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.", secret_advise: "Command may contain sensitive values. Treat it as a secret." }, copy_tooltip: "Copy" }, Ie = { body: "Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.", cta: "Switch to decK format" }, xe = { title: "Generate a Personal Access Token", description: "Personal access tokens are used to authenticate decK commands and Konnect API requests.", fields: { name: { label: "Name", placeholder: "Enter token name" }, expiresAt: { label: "Expiration date", placeholder: "Select an expiration date", n_days: "{n} days" } }, actions: { cancel: "Cancel", generate: "Generate", generating: "Generating…" } }, Ee = { dismissLabel: "Dismiss" }, De = { rotateKey: "Rotate key", generateKey: "Generate key", placeholder: "Enter or generate a key", oneTimeHint: "The key is shown only once. Copy it now and store it securely.", copy: "Copy", showKey: "Show key", hideKey: "Hide key" }, Q = {
82
82
  global: fe,
83
83
  deleteModal: pe,
84
84
  baseForm: ge,
@@ -90,13 +90,14 @@ const fe = { actions: { copyId: "Copy ID", copied_id: 'Copied "{id}" to the clip
90
90
  errors: _e,
91
91
  validationErrors: Ae,
92
92
  toggleModal: Ce,
93
+ jsonCodeBlock: ke,
93
94
  deckCodeBlock: we,
94
- deckCallout: ke,
95
- generatePatModal: Ie,
96
- onboardingCard: xe,
97
- sensitiveInput: Ee
95
+ deckCallout: Ie,
96
+ generatePatModal: xe,
97
+ onboardingCard: Ee,
98
+ sensitiveInput: De
98
99
  };
99
- function M() {
100
+ function R() {
100
101
  const e = W("en-us", Q);
101
102
  return {
102
103
  i18n: e,
@@ -105,7 +106,7 @@ function M() {
105
106
  };
106
107
  }
107
108
  var I = /* @__PURE__ */ ((e) => (e[e.InitialLoad = 0] = "InitialLoad", e[e.Loading = 1] = "Loading", e[e.Idle = 2] = "Idle", e[e.NoResults = 3] = "NoResults", e[e.NoRecords = 4] = "NoRecords", e[e.Error = 5] = "Error", e))(I || {}), X = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Partial = "partial", e.CloudGatewayAddon = "cloud_gateway_addon", e.BackendCluster = "backend_cluster", e.VirtualCluster = "virtual_cluster", e.Listener = "listener", e.ProducePolicy = "produce_policy", e.ConsumePolicy = "consume_policy", e.ClusterPolicy = "cluster_policy", e.ListenerPolicy = "listener_policy", e.SchemaRegistry = "schema_registry", e.StaticKey = "static_key", e.TlsTrustBundle = "tls_trust_bundle", e.AuthServer = "auth_server", e.AuthServerScopes = "auth_server_scopes", e.AuthServerClaims = "auth_server_claims", e.AuthServerClients = "auth_server_clients", e.Other = "other", e.PluginSchema = "plugin_schema", e.CustomPlugin = "custom_plugin", e.ClonedPlugin = "cloned_plugin", e))(X || {});
108
- const lt = Object.values(X), De = [
109
+ const ut = Object.values(X), Oe = [
109
110
  "ca_certificate",
110
111
  "certificate",
111
112
  "consumer",
@@ -125,11 +126,11 @@ const lt = Object.values(X), De = [
125
126
  /* Partial */
126
127
  ];
127
128
  function Z(e) {
128
- return De.includes(e);
129
+ return Oe.includes(e);
129
130
  }
130
- const ut = ["backend_cluster", "virtual_cluster", "listener", "produce_policy", "consume_policy", "cluster_policy", "listener_policy", "schema_registry", "static_key", "tls_trust_bundle"], dt = ["auth_server", "auth_server_scopes", "auth_server_claims", "auth_server_clients"];
131
- var P = /* @__PURE__ */ ((e) => (e.ID = "id", e.IdArray = "id-array", e.Text = "plain-text", e.Date = "date", e.Redacted = "redacted", e.RedactedArray = "redacted-array", e.Json = "json", e.JsonArray = "json-array", e.BadgeTag = "badge-tag", e.CopyBadge = "copy-badge", e.BadgeStatus = "badge-status", e.BadgeMethod = "badge-method", e.LinkInternal = "link-internal", e.LinkExternal = "link-external", e.ManagedBy = "managed-by", e))(P || {}), Oe = /* @__PURE__ */ ((e) => (e.Basic = "basic", e.Advanced = "advanced", e.Plugin = "plugin", e.Policy = "policy", e))(Oe || {});
132
- const ft = ["structured", "yaml", "json", "terraform", "deck"];
131
+ const dt = ["backend_cluster", "virtual_cluster", "listener", "produce_policy", "consume_policy", "cluster_policy", "listener_policy", "schema_registry", "static_key", "tls_trust_bundle"], ft = ["auth_server", "auth_server_scopes", "auth_server_claims", "auth_server_clients"];
132
+ var P = /* @__PURE__ */ ((e) => (e.ID = "id", e.IdArray = "id-array", e.Text = "plain-text", e.Date = "date", e.Redacted = "redacted", e.RedactedArray = "redacted-array", e.Json = "json", e.JsonArray = "json-array", e.BadgeTag = "badge-tag", e.CopyBadge = "copy-badge", e.BadgeStatus = "badge-status", e.BadgeMethod = "badge-method", e.LinkInternal = "link-internal", e.LinkExternal = "link-external", e.ManagedBy = "managed-by", e))(P || {}), Le = /* @__PURE__ */ ((e) => (e.Basic = "basic", e.Advanced = "advanced", e.Plugin = "plugin", e.Policy = "policy", e))(Le || {});
133
+ const pt = ["structured", "yaml", "json", "terraform", "deck"];
133
134
  function q() {
134
135
  const e = (i, r) => r?.[i] ?? void 0, n = (i, r) => {
135
136
  if (i.length !== r.length) return !1;
@@ -227,12 +228,12 @@ function q() {
227
228
  redactByConfigSchema: v
228
229
  };
229
230
  }
230
- function Le(e, n, o, t = {
231
+ function Re(e, n, o, t = {
231
232
  fetchedItemsKey: "data",
232
233
  searchKeys: ["id"]
233
234
  }) {
234
235
  o || (o = "1000");
235
- const { axiosInstance: s } = T(e.axiosRequestConfig), { i18n: { t: l } } = M(), { debounce: a } = ue(), u = a(async (p) => {
236
+ const { axiosInstance: s } = T(e.axiosRequestConfig), { i18n: { t: l } } = R(), { debounce: a } = ue(), u = a(async (p) => {
236
237
  await x(p);
237
238
  }, 200), m = y(!1), v = y(""), i = y(""), r = y([]), d = y([]), c = y(void 0), f = b(() => {
238
239
  let p = `${e.apiBaseUrl}${H(n)}`;
@@ -247,9 +248,9 @@ function Le(e, n, o, t = {
247
248
  } finally {
248
249
  m.value = !1;
249
250
  }
250
- }, k = y(""), x = async (p) => {
251
- if (k.value !== p) {
252
- if (k.value = p ?? "", !p) {
251
+ }, w = y(""), x = async (p) => {
252
+ if (w.value !== p) {
253
+ if (w.value = p ?? "", !p) {
253
254
  r.value = d.value;
254
255
  return;
255
256
  }
@@ -261,17 +262,17 @@ function Le(e, n, o, t = {
261
262
  } else {
262
263
  const _ = [];
263
264
  h(p) && t.searchKeys.includes("id") ? _.push((async () => {
264
- const { data: w } = await s.get(`${f.value}/${p}`);
265
- return [w[t.fetchedItemsKey] ?? w];
265
+ const { data: k } = await s.get(`${f.value}/${p}`);
266
+ return [k[t.fetchedItemsKey] ?? k];
266
267
  })()) : _.push(
267
- ...t.searchKeys.filter((w) => w !== "id").map(async (w) => {
268
- const { data: O } = await s.get(`${f.value}?${w}=${p}`);
268
+ ...t.searchKeys.filter((k) => k !== "id").map(async (k) => {
269
+ const { data: O } = await s.get(`${f.value}?${k}=${p}`);
269
270
  return O[t.fetchedItemsKey];
270
271
  })
271
272
  );
272
273
  const C = await Promise.all(_), E = /* @__PURE__ */ new Set();
273
- r.value = [], C?.forEach?.((w) => {
274
- w?.forEach?.((O) => {
274
+ r.value = [], C?.forEach?.((k) => {
275
+ k?.forEach?.((O) => {
275
276
  E.has(O.id) || (E.add(O.id), r.value.push(O));
276
277
  });
277
278
  });
@@ -321,7 +322,7 @@ function Me(e, n) {
321
322
  deckCalloutPreferenceKey: l
322
323
  };
323
324
  }
324
- function Re(e, n) {
325
+ function Ke(e, n) {
325
326
  const o = D(Y, null), t = b(() => {
326
327
  const a = g(e);
327
328
  return (a.app === "kongManager" || !!(a.app === "konnect" && a.enableDeckTab)) && Z(g(n));
@@ -342,14 +343,14 @@ function Re(e, n) {
342
343
  deckCalloutPreferenceKey: l
343
344
  };
344
345
  }
345
- function Ke(e, n) {
346
+ function Pe(e, n) {
346
347
  const o = H(n), t = b(
347
348
  () => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${o}`) : new URL(o)
348
349
  );
349
350
  return t.value.search = "", (s) => `${t.value.href}/${s}`;
350
351
  }
351
- function Pe() {
352
- const { i18n: { t: e } } = M();
352
+ function Te() {
353
+ const { i18n: { t: e } } = R();
353
354
  return {
354
355
  getErrorFieldsFromError: (t) => {
355
356
  if (!t)
@@ -418,7 +419,7 @@ function Pe() {
418
419
  }
419
420
  };
420
421
  }
421
- function Te(e) {
422
+ function Ne(e) {
422
423
  const n = window.location.origin, o = n.endsWith("/") ? n : `${n}/`;
423
424
  try {
424
425
  const t = e.join("/"), s = `${o}${t}`, l = e.some((u) => u.trim() === "");
@@ -455,7 +456,7 @@ function ee(e, n) {
455
456
  };
456
457
  }
457
458
  const $ = /* @__PURE__ */ new Map();
458
- function Ne(e, n, o) {
459
+ function $e(e, n, o) {
459
460
  const t = y(!0), s = g(e), { axiosInstance: l } = T(s.axiosRequestConfig), a = ee(e, n), u = y({
460
461
  status: I.Idle
461
462
  }), m = async (r) => {
@@ -468,11 +469,11 @@ function Ne(e, n, o) {
468
469
  if (f.status >= 400)
469
470
  throw f;
470
471
  const h = f.data, A = d && d.replace(/[^\w-_]/gi, "");
471
- let k;
472
- h[A] ? k = Array.isArray(h[A]) ? h[A] : [h[A]] : Array.isArray(h) ? k = h : k = Object.keys(h).length ? [h] : [];
472
+ let w;
473
+ h[A] ? w = Array.isArray(h[A]) ? h[A] : [h[A]] : Array.isArray(h) ? w = h : w = Object.keys(h).length ? [h] : [];
473
474
  const x = {
474
- data: k,
475
- total: k.length,
475
+ data: w,
476
+ total: w.length,
476
477
  ...h.offset ? {
477
478
  pagination: {
478
479
  offset: h.offset
@@ -511,7 +512,7 @@ function te(e) {
511
512
  }
512
513
  return y(1);
513
514
  }
514
- function $e() {
515
+ function Ue() {
515
516
  const e = (t, s = "_") => t ? t.split(s).map((l) => l.toLowerCase() === "id" ? l.toUpperCase() : l.charAt(0).toUpperCase() + l.substring(1)).join(" ") : "", n = /(?:^|[\s-:'"])\w/g;
516
517
  return {
517
518
  capitalize: (t) => t ? t.replace(n, (s) => s.toUpperCase()) : "",
@@ -525,26 +526,26 @@ const se = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-(
525
526
  if (!n)
526
527
  throw new Error(`Invalid argument not valid semver ('${e}' received)`);
527
528
  return n.shift(), n;
528
- }, B = (e) => e === "*" || e === "x" || e === "X", F = (e) => {
529
+ }, B = (e) => e === "*" || e === "x" || e === "X", j = (e) => {
529
530
  const n = parseInt(e, 10);
530
531
  return isNaN(n) ? e : n;
531
- }, Ue = (e, n) => typeof e != typeof n ? [String(e), String(n)] : [e, n], Be = (e, n) => {
532
+ }, Be = (e, n) => typeof e != typeof n ? [String(e), String(n)] : [e, n], je = (e, n) => {
532
533
  if (B(e) || B(n))
533
534
  return 0;
534
- const [o, t] = Ue(F(e), F(n));
535
+ const [o, t] = Be(j(e), j(n));
535
536
  return o > t ? 1 : o < t ? -1 : 0;
536
- }, j = (e, n) => {
537
+ }, F = (e, n) => {
537
538
  for (let o = 0; o < Math.max(e.length, n.length); o++) {
538
- const t = Be(e[o] || "0", n[o] || "0");
539
+ const t = je(e[o] || "0", n[o] || "0");
539
540
  if (t !== 0)
540
541
  return t;
541
542
  }
542
543
  return 0;
543
544
  }, Fe = (e, n) => {
544
- const o = U(e), t = U(n), s = o.pop(), l = t.pop(), a = j(o, t);
545
- return a !== 0 ? a : s && l ? j(s.split("."), l.split(".")) : s || l ? s ? -1 : 1 : 0;
545
+ const o = U(e), t = U(n), s = o.pop(), l = t.pop(), a = F(o, t);
546
+ return a !== 0 ? a : s && l ? F(s.split("."), l.split(".")) : s || l ? s ? -1 : 1 : 0;
546
547
  }, G = (e, n, o) => {
547
- je(o);
548
+ Ge(o);
548
549
  const t = Fe(e, n);
549
550
  return ae[o].includes(t);
550
551
  }, ae = {
@@ -554,18 +555,18 @@ const se = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-(
554
555
  "<=": [-1, 0],
555
556
  "<": [-1],
556
557
  "!=": [-1, 1]
557
- }, z = Object.keys(ae), je = (e) => {
558
+ }, z = Object.keys(ae), Ge = (e) => {
558
559
  if (typeof e != "string")
559
560
  throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
560
561
  if (z.indexOf(e) === -1)
561
562
  throw new Error(`Invalid operator, expected one of ${z.join("|")}`);
562
- }, Ge = (e) => typeof e == "string" && /^[v\d]/.test(e) && se.test(e);
563
- function ze(e) {
563
+ }, ze = (e) => typeof e == "string" && /^[v\d]/.test(e) && se.test(e);
564
+ function Ve(e) {
564
565
  const { gatewayInfo: n, supportedRange: o } = e;
565
566
  if (!n)
566
567
  return !0;
567
568
  const { edition: t, version: s } = n;
568
- if (!Ge(s))
569
+ if (!ze(s))
569
570
  return console.error("Invalid version"), !1;
570
571
  const l = o[t];
571
572
  if (!l)
@@ -573,7 +574,7 @@ function ze(e) {
573
574
  const [a, u] = l;
574
575
  return !(a && G(s, a, "<") || u && G(s, u, ">"));
575
576
  }
576
- function Ve(e) {
577
+ function He(e) {
577
578
  const n = y(0), o = y(0), t = y(!1);
578
579
  return re(e, (l) => {
579
580
  l && !t.value && (n.value = l.offsetWidth, o.value = l.scrollWidth, t.value = !0);
@@ -581,18 +582,18 @@ function Ve(e) {
581
582
  isTruncated: b(() => n.value < o.value)
582
583
  };
583
584
  }
584
- function He() {
585
- const { i18n: { t: e } } = M();
585
+ function Se() {
586
+ const { i18n: { t: e } } = R();
586
587
  return {
587
588
  utf8Name: (o) => /^[\p{N}\p{L}.\-_~]*$/u.test(o) ? "" : e("validationErrors.utf8Name")
588
589
  };
589
590
  }
590
- const L = /* @__PURE__ */ Symbol("schema"), Se = (e) => {
591
+ const L = /* @__PURE__ */ Symbol("schema"), We = (e) => {
591
592
  S(L, e);
592
- }, We = () => D(L, void 0), Ye = (e) => /^\d+$/.test(e), Je = (e) => {
593
+ }, Ye = () => D(L, void 0), Je = (e) => /^\d+$/.test(e), Qe = (e) => {
593
594
  const o = D(L, void 0)?.value;
594
595
  let t;
595
- if ((o?.type === "array" || o?.type === "set") && Ye(e)) {
596
+ if ((o?.type === "array" || o?.type === "set") && Je(e)) {
596
597
  const l = o.elements;
597
598
  t = l && {
598
599
  ...l,
@@ -604,7 +605,7 @@ const L = /* @__PURE__ */ Symbol("schema"), Se = (e) => {
604
605
  const s = oe(t);
605
606
  return S(L, s), s;
606
607
  };
607
- function Qe(e) {
608
+ function Xe(e) {
608
609
  let n = "";
609
610
  const o = y(!1), t = y(null), s = b(() => {
610
611
  let a;
@@ -623,20 +624,20 @@ function ne() {
623
624
  const e = D(ce.MANAGED_BY, !1);
624
625
  return b(() => !!g(e));
625
626
  }
626
- const Xe = (e) => e?.service || e?.tool || null, Ze = "Custom", V = {
627
+ const Ze = (e) => e?.service || e?.tool || null, qe = "Custom", V = {
627
628
  "terraform-provider-konnect": "Terraform",
628
629
  deck: "decK",
629
630
  "kong-gateway-operator": "Kong Gateway Operator",
630
631
  "gw-manager": "Konnect UI",
631
632
  "ai-manager": "AI Manager",
632
633
  "dev-portal": "Dev Portal"
633
- }, pt = (e) => {
634
- const n = Xe(e);
635
- return n ? Object.hasOwn(V, n) ? V[n] : Ze : null;
634
+ }, gt = (e) => {
635
+ const n = Ze(e);
636
+ return n ? Object.hasOwn(V, n) ? V[n] : qe : null;
636
637
  };
637
638
  let K;
638
- const qe = () => (K === void 0 && (K = W("en-us", Q).t("baseConfigCard.commonFields.managed_by_label")), K);
639
- function et(e, n = {}) {
639
+ const et = () => (K === void 0 && (K = W("en-us", Q).t("baseConfigCard.commonFields.managed_by_label")), K);
640
+ function tt(e, n = {}) {
640
641
  const o = ne();
641
642
  return {
642
643
  defaultTablePreferences: {
@@ -647,34 +648,34 @@ function et(e, n = {}) {
647
648
  },
648
649
  tableHeaders: b(() => ({
649
650
  ...g(e),
650
- ...o.value ? { managed_by: { label: qe(), sortable: !1 } } : {}
651
+ ...o.value ? { managed_by: { label: et(), sortable: !1 } } : {}
651
652
  }))
652
653
  };
653
654
  }
654
- const gt = {
655
+ const mt = {
655
656
  useAxios: T,
656
- useDebouncedFilter: Le,
657
- useDeleteUrlBuilder: Ke,
657
+ useDebouncedFilter: Re,
658
+ useDeleteUrlBuilder: Pe,
658
659
  useBaseEntityDeckOptions: Me,
659
- useBaseFormDeckOptions: Re,
660
- useErrors: Pe,
661
- useExternalLinkCreator: Te,
662
- useFetcher: Ne,
660
+ useBaseFormDeckOptions: Ke,
661
+ useErrors: Te,
662
+ useExternalLinkCreator: Ne,
663
+ useFetcher: $e,
663
664
  useFetcherCacheKey: te,
664
665
  useFetchUrlBuilder: ee,
665
666
  useHelpers: q,
666
- useStringHelpers: $e,
667
- useI18n: M,
668
- useGatewayFeatureSupported: ze,
669
- useTruncationDetector: Ve,
670
- useValidators: He,
671
- useSchema: We,
672
- useSchemaProvider: Se,
673
- useSubSchema: Je,
674
- useTableState: Qe,
667
+ useStringHelpers: Ue,
668
+ useI18n: R,
669
+ useGatewayFeatureSupported: Ve,
670
+ useTruncationDetector: He,
671
+ useValidators: Se,
672
+ useSchema: Ye,
673
+ useSchemaProvider: We,
674
+ useSubSchema: Qe,
675
+ useTableState: Xe,
675
676
  useManagedByEnabled: ne,
676
- useManagedByColumn: et
677
- }, mt = (e, n) => {
677
+ useManagedByColumn: tt
678
+ }, yt = (e, n) => {
678
679
  const o = e.__vccOpts || e;
679
680
  for (const [t, s] of n)
680
681
  o[t] = s;
@@ -683,25 +684,25 @@ const gt = {
683
684
  export {
684
685
  P as C,
685
686
  Y as D,
686
- ut as E,
687
+ dt as E,
687
688
  I as F,
688
- dt as I,
689
- nt as P,
690
- it as S,
691
- mt as _,
692
- rt as a,
693
- ot as b,
694
- gt as c,
689
+ ft as I,
690
+ rt as P,
691
+ ct as S,
692
+ yt as _,
693
+ ot as a,
694
+ it as b,
695
+ mt as c,
695
696
  X as d,
696
- lt as e,
697
+ ut as e,
697
698
  J as f,
698
- pt as g,
699
- ft as h,
700
- Oe as i,
701
- ct as j,
699
+ gt as g,
700
+ pt as h,
701
+ Le as i,
702
+ lt as j,
702
703
  ce as k,
703
- De as l,
704
- qe as m,
704
+ Oe as l,
705
+ et as m,
705
706
  de as n,
706
707
  Z as o
707
708
  };
@@ -0,0 +1 @@
1
+ "use strict";const U=require("axios"),c=require("vue"),R=require("@kong-ui-public/i18n"),re=Symbol("PLUGIN_FORM_LAYOUT_STATE"),oe=Symbol("CONFIG_CARD_SHOW_SENSITIVE_FIELDS"),x=Symbol("DECK_COMMAND_EDITOR"),N="[entities-shared] DeckCommandEditor was not provided. Provide it via the `DECK_COMMAND_EDITOR_KEY` injection key or the `provideDeckCommandEditor` helper (see @kong-ui-public/entities-shared/deck-editor).",ie="50vh",ce=2e5,W={MANAGED_BY:"KM-3018-entity-managed-by"};function le(){return{getAxiosInstance:(e={})=>{try{const n=c.inject("get-axios-instance",void 0);return typeof n=="function"?n(e):U.create({withCredentials:!0,timeout:3e4,...e})}catch(n){return console.warn("getAxiosInstance:",n.message||n),U.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>e?.response?.headers["x-datadog-trace-id"]||""}}function ue(){return{debounce:(e,n)=>{let o;return(...t)=>{clearTimeout(o),o=window?.setTimeout(()=>{e(...t)},n)}}}}const L="khcp-user-table-preferences",Y={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnVisibility:{}};function de(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(t){console.error("useTablePreferences(tryParseJson)",t);return}},n=()=>{const o=e(localStorage.getItem(L));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,t)=>{try{const a=n();a.set(o,t),localStorage.setItem(L,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:(o,t)=>n()?.get(o)||void 0||t||Y,deleteAllTablePreferences:()=>{localStorage.removeItem(L)}}}function K(e={}){const{getAxiosInstance:n}=le();return{axiosInstance:n(e)}}const fe={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},pe={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ge={actions:{viewConfiguration:"View configuration",hideConfiguration:"Hide configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform",deck:"decK"},errors:{edit:"The entity could not be edited at this time."}},ye={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},me={title:"Configuration",actions:{copy:"Copy JSON",deck_customize:"Customize before copying to CLI",deck_customize_cancel:"Cancel",sensitive_fields:"Show sensitive fields",sensitive_fields_tooltip:"View masked sensitive data in your configurations if any field values have been redacted."},sections:{advanced:"Advanced",plugin:"Plugin specific configuration",policy:"Policy specific configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last updated",created_at_label:"Created",managed_by_label:"Managed By",tags_label:"Tags",link:"Link",partial_label:"Redis configuration"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},he={learnMore:"Learn more",pricingTitle:"Pricing: "},be={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ve={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},_e={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ae={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Ce={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ie={copy_url:"Copy URL"},ke={hint:{konnect:"The {token} environment variable must be added first. See {link} for details.",kongManager:"If your Admin API is secured, set up authentication following {link}."},documentation:"the documentation",steps:{step_1:"Step 1: Export token",step_2:"Step 2: Apply configuration"},customization:{title:"Customize before copying to CLI",copy_pat:"Make sure to copy your personal access token now. You won't be able to see it again.",reuse_pat:"Use an existing PAT if you've already generated one.",generate_pat:"Generate PAT",footer_reminder:"Changes you make here won't affect your configuration. After you apply changes with decK in the CLI, refresh the page to view them.",secret_advise:"Command may contain sensitive values. Treat it as a secret."},copy_tooltip:"Copy"},we={body:"Want a ready-to-use CLI command? {cta} to view this configuration as a decK sync snippet you can copy directly.",cta:"Switch to decK format"},Ee={title:"Generate a Personal Access Token",description:"Personal access tokens are used to authenticate decK commands and Konnect API requests.",fields:{name:{label:"Name",placeholder:"Enter token name"},expiresAt:{label:"Expiration date",placeholder:"Select an expiration date",n_days:"{n} days"}},actions:{cancel:"Cancel",generate:"Generate",generating:"Generating…"}},Oe={dismissLabel:"Dismiss"},De={rotateKey:"Rotate key",generateKey:"Generate key",placeholder:"Enter or generate a key",oneTimeHint:"The key is shown only once. Copy it now and store it securely.",copy:"Copy",showKey:"Show key",hideKey:"Hide key"},J={global:fe,deleteModal:pe,baseForm:ge,baseTable:ye,baseConfigCard:me,emptyState:he,filter:be,debouncedFilter:ve,errors:_e,validationErrors:Ae,toggleModal:Ce,jsonCodeBlock:Ie,deckCodeBlock:ke,deckCallout:we,generatePatModal:Ee,onboardingCard:Oe,sensitiveInput:De};function T(){const e=R.createI18n("en-us",J);return{i18n:e,i18nT:R.i18nTComponent(e)}}var C=(e=>(e[e.InitialLoad=0]="InitialLoad",e[e.Loading=1]="Loading",e[e.Idle=2]="Idle",e[e.NoResults=3]="NoResults",e[e.NoRecords=4]="NoRecords",e[e.Error=5]="Error",e))(C||{}),P=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e.Partial="partial",e.CloudGatewayAddon="cloud_gateway_addon",e.BackendCluster="backend_cluster",e.VirtualCluster="virtual_cluster",e.Listener="listener",e.ProducePolicy="produce_policy",e.ConsumePolicy="consume_policy",e.ClusterPolicy="cluster_policy",e.ListenerPolicy="listener_policy",e.SchemaRegistry="schema_registry",e.StaticKey="static_key",e.TlsTrustBundle="tls_trust_bundle",e.AuthServer="auth_server",e.AuthServerScopes="auth_server_scopes",e.AuthServerClaims="auth_server_claims",e.AuthServerClients="auth_server_clients",e.Other="other",e.PluginSchema="plugin_schema",e.CustomPlugin="custom_plugin",e.ClonedPlugin="cloned_plugin",e))(P||{});const Te=Object.values(P),X=["ca_certificate","certificate","consumer","consumer_group","service","key","set","plugin","plugin_schema","custom_plugin","cloned_plugin","route","upstream","target","vault","partial"];function F(e){return X.includes(e)}const Le=["backend_cluster","virtual_cluster","listener","produce_policy","consume_policy","cluster_policy","listener_policy","schema_registry","static_key","tls_trust_bundle"],Me=["auth_server","auth_server_scopes","auth_server_claims","auth_server_clients"];var O=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e.ManagedBy="managed-by",e))(O||{}),q=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e.Policy="policy",e))(q||{});const Re=["structured","yaml","json","terraform","deck"];function Q(){const e=(i,r)=>r?.[i]??void 0,n=(i,r)=>{if(i.length!==r.length)return!1;const f=new Set([...i,...r]);for(const l of f){const p=i.filter(v=>v===l).length,m=r.filter(v=>v===l).length;if(p!==m)return!1}return!0},o=(i,r,f)=>{if(f){if(Object.keys(i).length===Object.keys(r).length)for(const l in i)if(Array.isArray(i[l])&&Array.isArray(r[l])){if(n(i[l],r[l]))continue;return!1}else{if(i[l]===r[l])continue;return!1}else return!1;return!0}try{return JSON.stringify(i)===JSON.stringify(r)}catch{return!1}},t=i=>(r,f)=>{let l=r[i]===void 0||r[i]===null?"":r[i],p=f[i]===void 0||f[i]===null?"":f[i];return Array.isArray(r[i])&&(l=r[i][0]),Array.isArray(f[i])&&(p=f[i][0]),l.localeCompare(p)},a=i=>i?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(i):!1,u="********",s=i=>!!i&&typeof i=="object"&&!Array.isArray(i),d=(i,r)=>i?.find(l=>Object.keys(l)?.[0]===r)?.[r],y=(i,r)=>{if(!r||i===null||i===void 0)return i;if(r.type==="string")return r.encrypted?u:i;if(r.type==="record"||r.type==="map"){if(!s(i))return i;if(r.type==="map"&&!r.values)return{...i};const f={};for(const l in i)if(r.type==="record"){const p=d(r.fields,l);f[l]=p?y(i[l],p):i[l]}else if(r.type==="map"){const p=r.values;f[l]=y(i[l],{...p,encrypted:!!(r.encrypted||p.encrypted)})}return f}if((r.type==="array"||r.type==="set")&&Array.isArray(i)){const f=r.elements;return f?i.map(l=>y(l,{...f,encrypted:!!(r.encrypted||f.encrypted)})):i.slice()}return i},h=(i,r)=>{if(Array.isArray(i))return i.map(l=>h(l,r));if(!s(i))return i;const f={};for(const l in i){if(r[l]?.type===O.Redacted){f[l]=u;continue}if(r[l]?.type===O.RedactedArray&&Array.isArray(i[l])){f[l]=i[l].map(()=>u);continue}f[l]=h(i[l],r)}return f};return{getPropValue:e,objectsAreEqual:o,sortAlpha:t,isValidUuid:a,isObjectRecord:s,getApiSchemaField:d,redactByApiSchema:y,redactByConfigSchema:h}}function xe(e,n,o,t={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="1000");const{axiosInstance:a}=K(e.axiosRequestConfig),{i18n:{t:u}}=T(),{debounce:s}=ue(),d=s(async g=>{await k(g)},200),y=c.ref(!1),h=c.ref(""),i=c.ref(""),r=c.ref([]),f=c.ref([]),l=c.ref(void 0),p=c.computed(()=>{let g=`${e.apiBaseUrl}${c.unref(n)}`;return e.app==="konnect"&&(g=g.replace(/{controlPlaneId}/gi,e?.controlPlaneId||"")),g.replace(/\/{workspace}/gi,e?.workspace?`/${e.workspace}`:"")}),{isValidUuid:m}=Q(),v=async()=>{try{y.value=!0;const{data:g}=await a.get(`${p.value}?size=${o}`);g?.next||(l.value=t.fetchedItemsKey in g?g[t.fetchedItemsKey]:[]),f.value=t.fetchedItemsKey in g?g[t.fetchedItemsKey]:[],r.value=f.value}catch{r.value=[],h.value=u("debouncedFilter.errors.fetch")}finally{y.value=!1}},I=c.ref(""),k=async g=>{if(I.value!==g){if(I.value=g??"",!g){r.value=f.value;return}if(l.value===void 0)try{if(y.value=!0,h.value="",i.value="",e.app==="konnect"){const b=`${p.value}/${g}`,{data:_}=await a.get(`${b}?size=${o}`);t.fetchedItemsKey in _?r.value=_[t.fetchedItemsKey]:_?.[t.exactMatchKey??"id"]?r.value=[_]:r.value=[]}else{const b=[];m(g)&&t.searchKeys.includes("id")?b.push((async()=>{const{data:A}=await a.get(`${p.value}/${g}`);return[A[t.fetchedItemsKey]??A]})()):b.push(...t.searchKeys.filter(A=>A!=="id").map(async A=>{const{data:E}=await a.get(`${p.value}?${A}=${g}`);return E[t.fetchedItemsKey]}));const _=await Promise.all(b),w=new Set;r.value=[],_?.forEach?.(A=>{A?.forEach?.(E=>{w.has(E.id)||(w.add(E.id),r.value.push(E))})})}}catch(b){b?.response?.status===404?i.value=u("debouncedFilter.errors.invalid"):(r.value=[],h.value=u("debouncedFilter.errors.fetch"))}finally{y.value=!1}else y.value=!0,i.value="",r.value=l.value?.filter(b=>{let _=!1;for(const w of t.searchKeys)(typeof b[w]=="string"?b[w]?.toLowerCase():b[w])?.includes(g.toLowerCase())&&(_=!0);return _}),(!r.value||!r.value.length)&&(i.value=u("debouncedFilter.errors.invalid")),y.value=!1}};return{loading:y,error:h,validationError:i,results:r,allRecords:l,loadItems:v,debouncedQueryChange:d}}function Ne(e,n){const o=c.inject(x,null),t=c.computed(()=>{const s=c.toValue(e);return(s.app==="kongManager"||!!(s.app==="konnect"&&s.enableDeckConfig))&&F(c.toValue(n))}),a=c.computed(()=>{const s=c.toValue(e),d=s.app==="konnect"&&s.enableDeckConfig&&typeof s.enableDeckConfig!="boolean"?s.enableDeckConfig.customization:void 0;if(d&&!o){console.warn(N);return}return d}),u=c.computed(()=>{const s=c.toValue(e);return s.app==="konnect"&&s.enableDeckConfig&&typeof s.enableDeckConfig!="boolean"?s.enableDeckConfig.calloutPreferenceKey:s.app==="kongManager"?s.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:a,deckCalloutPreferenceKey:u}}function Ke(e,n){const o=c.inject(x,null),t=c.computed(()=>{const s=c.toValue(e);return(s.app==="kongManager"||!!(s.app==="konnect"&&s.enableDeckTab))&&F(c.toValue(n))}),a=c.computed(()=>{const s=c.toValue(e),d=s.app==="konnect"&&s.enableDeckTab&&typeof s.enableDeckTab!="boolean"?s.enableDeckTab.customization:void 0;if(d&&!o){console.warn(N);return}return d}),u=c.computed(()=>{const s=c.toValue(e);return s.app==="konnect"&&s.enableDeckTab&&typeof s.enableDeckTab!="boolean"?s.enableDeckTab.calloutPreferenceKey:s.app==="kongManager"?s.deckCalloutPreferenceKey:void 0});return{isDeckEnabled:t,deckCustomizationOptions:a,deckCalloutPreferenceKey:u}}function Pe(e,n){const o=c.unref(n),t=c.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return t.value.search="",a=>`${t.value.href}/${a}`}function Fe(){const{i18n:{t:e}}=T();return{getErrorFieldsFromError:t=>{if(!t)return{messages:[e("errors.unexpected")],fields:[]};if(t?.response?.status===401)return{messages:[],fields:[]};let a=[e("errors.unexpected")];const u=[];if(t?.response?.data){if(t.response.data.details?.length)return a=[],t.response.data.details.forEach(s=>{let d=e("errors.unexpected");s.messages&&Array.isArray(s.messages)&&s.messages.length&&(d=s.messages.join(", ")),s.field&&u.push({field:s.field,message:d}),a.push(`${s.field??""} ${d}`)}),{messages:a,fields:u};if(t.response.data.message&&Array.isArray(t.response.data.message))return a=[],t.response.data.message.forEach(s=>{if(s?.constraints){const d=Object.values(s.constraints).join(", ");a.push(d),s.property&&u.push({field:s.property,message:d})}else s?.property&&s?.message?(u.push({field:s.property,message:s.message}),a.push(s.message)):a.push(s)}),{messages:a,fields:u};if(typeof t.response.data.message=="string"||typeof t.response.data=="string")return{messages:[t.response.data.message],fields:[]};if(typeof t.response.data=="object")return a=[],Object.keys(t.response.data).forEach(s=>{u.push({field:s,message:t.response.data[s]}),a.push(t.response.data[s])}),{messages:a,fields:u}}return{messages:[t.message||e("errors.unexpected")],fields:[]}},getMessageFromError:t=>{if(!t)return e("errors.unexpected");if(t?.response?.status===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if(t?.response?.data){if(t.response.data.detail)return t.response.data.detail;if(t.response.data.details?.length)return t.response.data.details.map(a=>{let u=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(u=a.messages.join(", ")),a.field?`${a.field} - ${u}`:u}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?a[0]?.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Ue(e){const n=window.location.origin,o=n.endsWith("/")?n:`${n}/`;try{const t=e.join("/"),a=`${o}${t}`,u=e.some(d=>d.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!u&&new URL(a))return`${o}${t}`;throw new Error("Invalid url")}catch(t){return console.warn("Failed to build valid URL:",t),""}}function Z(e,n){const o=c.computed(()=>{const a=c.toValue(e);return typeof a.isExactMatch=="boolean"?a.isExactMatch:a.app==="konnect"}),t=c.computed(()=>{const a=c.toValue(n);return a.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a)});return a=>{const{page:u,pageSize:s,offset:d,sortColumnKey:y,sortColumnOrder:h,query:i}=a;try{let r=new URL(t.value.href);if(o.value&&i){const f=new URLSearchParams(t.value.search);r.search="",r=c.toValue(e).isExactMatch?new URL(`${r.href}/${i}`):new URL(`${r.href}?filter[name][contains]=${i}`),f.forEach((l,p)=>r.searchParams.append(p,l))}else o.value||new URLSearchParams(i).forEach((f,l)=>{r.searchParams.append(l,f)}),y&&r.searchParams.append("sort_by",y),h==="desc"&&r.searchParams.append("sort_desc","1"),r.searchParams.append("size",String(s));return d&&u!==1&&r.searchParams.append("offset",String(d)),r.href}catch(r){return console.error("RouteList(fetcher)",r),c.toValue(n)}}}const $=new Map;function $e(e,n,o){const t=c.ref(!0),a=c.toValue(e),{axiosInstance:u}=K(a.axiosRequestConfig),s=Z(e,n),d=c.ref({status:C.Idle}),y=async r=>{const f=c.toValue(o)||"data";try{d.value=t.value?{status:C.InitialLoad}:{status:C.Loading},t.value=!1;let l=s(r);l.includes("filter[name]")&&(l=`${l}&page[size]=${r.pageSize}&page[number]=${r.page}`);const p=await u.get(l);if(p.status>=400)throw p;const m=p.data,v=f&&f.replace(/[^\w-_]/gi,"");let I;m[v]?I=Array.isArray(m[v])?m[v]:[m[v]]:Array.isArray(m)?I=m:I=Object.keys(m).length?[m]:[];const k={data:I,total:I.length,...m.offset?{pagination:{offset:m.offset}}:null};return k.data.length===0&&!r.query?d.value={status:C.NoRecords,response:k}:d.value={status:C.Idle,response:k},k}catch(l){const p={data:[],total:0};return r.query&&(l.response?.status===404||l.status===404)?(d.value={status:C.NoResults,response:p,error:l.response?l:{response:l}},p):(d.value={status:C.Error,response:p,error:l.response?l:{response:l}},p)}},h=a.cacheIdentifier,i=ee(h);return{fetcher:y,fetcherState:d,fetcherCacheKey:i}}function ee(e){if(e){let n=$.get(e);return n||(n=c.ref(1),$.set(e,n)),n}return c.ref(1)}function Be(){const e=(t,a="_")=>t?t.split(a).map(u=>u.toLowerCase()==="id"?u.toUpperCase():u.charAt(0).toUpperCase()+u.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:t=>t?t.replace(n,a=>a.toUpperCase()):"",convertKeyToTitle:e}}const te=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,B=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(te);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},j=e=>e==="*"||e==="x"||e==="X",G=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},je=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],Ge=(e,n)=>{if(j(e)||j(n))return 0;const[o,t]=je(G(e),G(n));return o>t?1:o<t?-1:0},V=(e,n)=>{for(let o=0;o<Math.max(e.length,n.length);o++){const t=Ge(e[o]||"0",n[o]||"0");if(t!==0)return t}return 0},Ve=(e,n)=>{const o=B(e),t=B(n),a=o.pop(),u=t.pop(),s=V(o,t);return s!==0?s:a&&u?V(a.split("."),u.split(".")):a||u?a?-1:1:0},S=(e,n,o)=>{Se(o);const t=Ve(e,n);return ae[o].includes(t)},ae={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},H=Object.keys(ae),Se=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(H.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${H.join("|")}`)},He=e=>typeof e=="string"&&/^[v\d]/.test(e)&&te.test(e);function ze(e){const{gatewayInfo:n,supportedRange:o}=e;if(!n)return!0;const{edition:t,version:a}=n;if(!He(a))return console.error("Invalid version"),!1;const u=o[t];if(!u)return!1;const[s,d]=u;return!(s&&S(a,s,"<")||d&&S(a,d,">"))}function We(e){const n=c.ref(0),o=c.ref(0),t=c.ref(!1);return c.watch(e,u=>{u&&!t.value&&(n.value=u.offsetWidth,o.value=u.scrollWidth,t.value=!0)}),{isTruncated:c.computed(()=>n.value<o.value)}}function Ye(){const{i18n:{t:e}}=T();return{utf8Name:o=>/^[\p{N}\p{L}.\-_~]*$/u.test(o)?"":e("validationErrors.utf8Name")}}const D=Symbol("schema"),Je=e=>{c.provide(D,e)},Xe=()=>c.inject(D,void 0),qe=e=>/^\d+$/.test(e),Qe=e=>{const o=c.inject(D,void 0)?.value;let t;if((o?.type==="array"||o?.type==="set")&&qe(e)){const u=o.elements;t=u&&{...u,encrypted:!!(o.encrypted||u.encrypted)}}else t=o?.fields?.find(s=>Object.keys(s)[0]===e)?.[e];const a=c.toRef(t);return c.provide(D,a),a};function Ze(e){let n="";const o=c.ref(!1),t=c.ref(null),a=c.computed(()=>{let s;return o.value?s=!0:t.value?s=t.value.hasData||e&&c.toValue(e):s=!1,!s});return{tableState:t,hasRecords:o,hideTableToolbar:a,handleStateChange:s=>{s.hasData?o.value=!0:s.state==="success"&&!s.hasData&&(!e||!n)&&(o.value=!1),e&&(n=c.toValue(e)),t.value={...s}}}}function se(){const e=c.inject(W.MANAGED_BY,!1);return c.computed(()=>!!c.toValue(e))}const et=e=>e?.service||e?.tool||null,tt="Custom",z={"terraform-provider-konnect":"Terraform",deck:"decK","kong-gateway-operator":"Kong Gateway Operator","gw-manager":"Konnect UI","ai-manager":"AI Manager","dev-portal":"Dev Portal"},at=e=>{const n=et(e);return n?Object.hasOwn(z,n)?z[n]:tt:null};let M;const ne=()=>(M===void 0&&(M=R.createI18n("en-us",J).t("baseConfigCard.commonFields.managed_by_label")),M);function st(e,n={}){const o=se();return{defaultTablePreferences:{columnVisibility:{managed_by:!1,...n}},tableHeaders:c.computed(()=>({...c.toValue(e),...o.value?{managed_by:{label:ne(),sortable:!1}}:{}}))}}const nt={useAxios:K,useDebouncedFilter:xe,useDeleteUrlBuilder:Pe,useBaseEntityDeckOptions:Ne,useBaseFormDeckOptions:Ke,useErrors:Fe,useExternalLinkCreator:Ue,useFetcher:$e,useFetcherCacheKey:ee,useFetchUrlBuilder:Z,useHelpers:Q,useStringHelpers:Be,useI18n:T,useGatewayFeatureSupported:ze,useTruncationDetector:We,useValidators:Ye,useSchema:Xe,useSchemaProvider:Je,useSubSchema:Qe,useTableState:Ze,useManagedByEnabled:se,useManagedByColumn:st},rt=(e,n)=>{const o=e.__vccOpts||e;for(const[t,a]of n)o[t]=a;return o};exports.CONFIG_CARD_CODE_BLOCK_MAX_HEIGHT=ie;exports.CONFIG_CARD_FORMATS=Re;exports.CONFIG_CARD_SHOW_SENSITIVE_FIELDS=oe;exports.ConfigurationSchemaSection=q;exports.ConfigurationSchemaType=O;exports.DECK_COMMAND_EDITOR_KEY=x;exports.DECK_COMMAND_EDITOR_MISSING_WARNING=N;exports.ENTITIES_FEATURE_FLAGS=W;exports.EventGatewayTypesArray=Le;exports.FetcherStatus=C;exports.IdentityTypesArray=Me;exports.PLUGIN_FORM_LAYOUT_STATE=re;exports.SHIKI_MAX_HIGHLIGHT_LENGTH=ce;exports.SupportedEntityDeckArray=X;exports.SupportedEntityType=P;exports.SupportedEntityTypesArray=Te;exports._export_sfc=rt;exports.composables=nt;exports.de=de;exports.getManagedByFieldLabel=ne;exports.getManagedByLabel=at;exports.isSupportedDeckEntityType=F;exports.ne=Y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-eAeFFurO.cjs"),p=require("@kong-ui-public/monaco-editor"),k=require("@kong/icons"),y=require("@kong/kongponents");require("@kong-ui-public/monaco-editor/dist/runtime/style.css");const _={class:"deck-command-editor-wrapper"},f={class:"deck-command-copy-button"},C=e.defineComponent({__name:"DeckCommandEditor",props:e.mergeModels({language:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const d=e.inject("app:konnectColorMode",e.computed(()=>"light")),n=e.useModel(r,"modelValue"),{i18n:{t:c}}=a.composables.useI18n(),s={scrollbar:{alwaysConsumeMouseWheel:!1},autoIndent:"keep",editContext:!1};async function u(){await m(n.value)}async function m(l){if(navigator.clipboard)try{return await navigator.clipboard.writeText(l),!0}catch{}const o=document?.createElement("textarea");o&&(o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="32px",o.style.height="32px",o.style.padding="0",o.style.border="none",o.style.outline="none",o.style.boxShadow="none",o.style.background="transparent",o.value=l,document?.body?.appendChild(o),o.focus(),o.select());let t;try{t=document?.execCommand("copy")}catch{t=!1}finally{document?.body?.removeChild(o)}return t}return(l,o)=>(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(),e.createBlock(e.unref(p.MonacoEditor),{key:e.unref(d),modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=t=>n.value=t),appearance:"standalone",class:"deck-command-editor",language:r.language,options:s,theme:e.unref(d)},null,8,["modelValue","language","theme"])),e.createElementVNode("div",f,[e.createVNode(e.unref(y.KCodeBlockIconButton),{"aria-label":e.unref(c)("deckCodeBlock.copy_tooltip"),"copy-tooltip":e.unref(c)("deckCodeBlock.copy_tooltip"),theme:"light",onClick:o[1]||(o[1]=t=>u())},{default:e.withCtx(()=>[e.createVNode(e.unref(k.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip"])])]))}}),i=a._export_sfc(C,[["__scopeId","data-v-2da602e1"]]),g={},v={class:"editor-skeleton"};function b(r,d){const n=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,c=>e.createVNode(n,{key:c})),64))])}const E=a._export_sfc(g,[["render",b],["__scopeId","data-v-ec59bbd1"]]);function h(){e.provide(a.DECK_COMMAND_EDITOR_KEY,i)}exports.DeckCommandEditor=i;exports.DeckCommandEditorLoading=E;exports.provideDeckCommandEditor=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./_plugin-vue_export-helper-oE3FNAYy.cjs"),p=require("@kong-ui-public/monaco-editor"),k=require("@kong/icons"),y=require("@kong/kongponents");require("@kong-ui-public/monaco-editor/dist/runtime/style.css");const _={class:"deck-command-editor-wrapper"},f={class:"deck-command-copy-button"},C=e.defineComponent({__name:"DeckCommandEditor",props:e.mergeModels({language:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const d=e.inject("app:konnectColorMode",e.computed(()=>"light")),n=e.useModel(r,"modelValue"),{i18n:{t:c}}=a.composables.useI18n(),s={scrollbar:{alwaysConsumeMouseWheel:!1},autoIndent:"keep",editContext:!1};async function u(){await m(n.value)}async function m(l){if(navigator.clipboard)try{return await navigator.clipboard.writeText(l),!0}catch{}const o=document?.createElement("textarea");o&&(o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="32px",o.style.height="32px",o.style.padding="0",o.style.border="none",o.style.outline="none",o.style.boxShadow="none",o.style.background="transparent",o.value=l,document?.body?.appendChild(o),o.focus(),o.select());let t;try{t=document?.execCommand("copy")}catch{t=!1}finally{document?.body?.removeChild(o)}return t}return(l,o)=>(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(),e.createBlock(e.unref(p.MonacoEditor),{key:e.unref(d),modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=t=>n.value=t),appearance:"standalone",class:"deck-command-editor",language:r.language,options:s,theme:e.unref(d)},null,8,["modelValue","language","theme"])),e.createElementVNode("div",f,[e.createVNode(e.unref(y.KCodeBlockIconButton),{"aria-label":e.unref(c)("deckCodeBlock.copy_tooltip"),"copy-tooltip":e.unref(c)("deckCodeBlock.copy_tooltip"),theme:"light",onClick:o[1]||(o[1]=t=>u())},{default:e.withCtx(()=>[e.createVNode(e.unref(k.CopyIcon),{decorative:""})]),_:1},8,["aria-label","copy-tooltip"])])]))}}),i=a._export_sfc(C,[["__scopeId","data-v-2da602e1"]]),g={},v={class:"editor-skeleton"};function b(r,d){const n=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,c=>e.createVNode(n,{key:c})),64))])}const E=a._export_sfc(g,[["render",b],["__scopeId","data-v-ec59bbd1"]]);function h(){e.provide(a.DECK_COMMAND_EDITOR_KEY,i)}exports.DeckCommandEditor=i;exports.DeckCommandEditorLoading=E;exports.provideDeckCommandEditor=h;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as _, inject as f, computed as k, useModel as C, openBlock as c, createElementBlock as i, createBlock as g, unref as o, createElementVNode as v, createVNode as s, withCtx as h, mergeModels as b, resolveComponent as x, Fragment as E, renderList as D, provide as M } from "vue";
2
- import { c as w, _ as m, D as V } from "./_plugin-vue_export-helper-ekMaqAP6.js";
2
+ import { c as w, _ as m, D as V } from "./_plugin-vue_export-helper-BPlOTiWL.js";
3
3
  import { MonacoEditor as B } from "@kong-ui-public/monaco-editor";
4
4
  import { CopyIcon as I } from "@kong/icons";
5
5
  import { KCodeBlockIconButton as K } from "@kong/kongponents";