@kong-ui-public/entities-redis-configurations 1.5.8 → 1.5.9-pr.2609.f4d92e2e4.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.
Files changed (60) hide show
  1. package/package.json +8 -8
  2. package/dist/entities-redis-configurations.es.js +0 -3836
  3. package/dist/entities-redis-configurations.umd.js +0 -1
  4. package/dist/style.css +0 -1
  5. package/dist/types/components/ClusterNodes.vue.d.ts +0 -14
  6. package/dist/types/components/ClusterNodes.vue.d.ts.map +0 -1
  7. package/dist/types/components/DeleteWarningModal.vue.d.ts +0 -17
  8. package/dist/types/components/DeleteWarningModal.vue.d.ts.map +0 -1
  9. package/dist/types/components/FieldArrayCardContainer.vue.d.ts +0 -56
  10. package/dist/types/components/FieldArrayCardContainer.vue.d.ts.map +0 -1
  11. package/dist/types/components/LinkedPluginList.vue.d.ts +0 -69
  12. package/dist/types/components/LinkedPluginList.vue.d.ts.map +0 -1
  13. package/dist/types/components/LinkedPluginListModal.vue.d.ts +0 -49
  14. package/dist/types/components/LinkedPluginListModal.vue.d.ts.map +0 -1
  15. package/dist/types/components/LinkedPluginsInline.vue.d.ts +0 -25
  16. package/dist/types/components/LinkedPluginsInline.vue.d.ts.map +0 -1
  17. package/dist/types/components/PluginItem.vue.d.ts +0 -6
  18. package/dist/types/components/PluginItem.vue.d.ts.map +0 -1
  19. package/dist/types/components/RedisConfigurationConfigCard.vue.d.ts +0 -62
  20. package/dist/types/components/RedisConfigurationConfigCard.vue.d.ts.map +0 -1
  21. package/dist/types/components/RedisConfigurationForm.vue.d.ts +0 -90
  22. package/dist/types/components/RedisConfigurationForm.vue.d.ts.map +0 -1
  23. package/dist/types/components/RedisConfigurationFormModal.vue.d.ts +0 -24
  24. package/dist/types/components/RedisConfigurationFormModal.vue.d.ts.map +0 -1
  25. package/dist/types/components/RedisConfigurationList.vue.d.ts +0 -113
  26. package/dist/types/components/RedisConfigurationList.vue.d.ts.map +0 -1
  27. package/dist/types/components/RedisConfigurationSelector.vue.d.ts +0 -30
  28. package/dist/types/components/RedisConfigurationSelector.vue.d.ts.map +0 -1
  29. package/dist/types/components/SentinelNodes.vue.d.ts +0 -14
  30. package/dist/types/components/SentinelNodes.vue.d.ts.map +0 -1
  31. package/dist/types/composables/index.d.ts +0 -6
  32. package/dist/types/composables/index.d.ts.map +0 -1
  33. package/dist/types/composables/useI18n.d.ts +0 -9
  34. package/dist/types/composables/useI18n.d.ts.map +0 -1
  35. package/dist/types/composables/useLinkedPlugins.d.ts +0 -27
  36. package/dist/types/composables/useLinkedPlugins.d.ts.map +0 -1
  37. package/dist/types/composables/useRedisConfigurationForm.d.ts +0 -173
  38. package/dist/types/composables/useRedisConfigurationForm.d.ts.map +0 -1
  39. package/dist/types/composables/useRedisConfigurationSelector.d.ts +0 -11
  40. package/dist/types/composables/useRedisConfigurationSelector.d.ts.map +0 -1
  41. package/dist/types/constants.d.ts +0 -7
  42. package/dist/types/constants.d.ts.map +0 -1
  43. package/dist/types/helpers.d.ts +0 -22
  44. package/dist/types/helpers.d.ts.map +0 -1
  45. package/dist/types/index.d.ts +0 -44
  46. package/dist/types/index.d.ts.map +0 -1
  47. package/dist/types/partials-endpoints.d.ts +0 -26
  48. package/dist/types/partials-endpoints.d.ts.map +0 -1
  49. package/dist/types/types/index.d.ts +0 -6
  50. package/dist/types/types/index.d.ts.map +0 -1
  51. package/dist/types/types/redis-configuration-config.d.ts +0 -8
  52. package/dist/types/types/redis-configuration-config.d.ts.map +0 -1
  53. package/dist/types/types/redis-configuration-form.d.ts +0 -41
  54. package/dist/types/types/redis-configuration-form.d.ts.map +0 -1
  55. package/dist/types/types/redis-configuration-linked-plugins.d.ts +0 -11
  56. package/dist/types/types/redis-configuration-linked-plugins.d.ts.map +0 -1
  57. package/dist/types/types/redis-configuration-list.d.ts +0 -31
  58. package/dist/types/types/redis-configuration-list.d.ts.map +0 -1
  59. package/dist/types/types/redis-configuration.d.ts +0 -57
  60. package/dist/types/types/redis-configuration.d.ts.map +0 -1
@@ -1,3836 +0,0 @@
1
- import { computed as H, reactive as un, ref as $, watch as Te, defineComponent as Q, resolveComponent as j, createElementBlock as J, openBlock as R, createVNode as g, withCtx as S, renderSlot as fi, unref as r, mergeModels as cn, useModel as fn, createElementVNode as F, createTextVNode as ne, toDisplayString as N, Fragment as je, renderList as wt, createBlock as q, getCurrentInstance as pi, onMounted as mi, onUnmounted as gi, isReadonly as bi, toRefs as yi, onBeforeMount as pn, createCommentVNode as oe, isRef as _i, createSlots as mn, withModifiers as vi, Teleport as hi, inject as gn, useId as Ti, nextTick as kt } from "vue";
2
- import "@kong-ui-public/entities-shared/dist/style.css";
3
- import "@kong-ui-public/entities-vaults/dist/style.css";
4
- import { useAxios as St, useErrors as bn, EntityBaseFormType as lt, EntityBaseForm as wi, SupportedEntityType as yn, EntityFormSection as ge, EntityFilter as _n, useDeleteUrlBuilder as Si, useFetcher as Ei, FetcherStatus as Ci, EntityBaseTable as Oi, PermissionsWrapper as Fe, TableTags as Ii, EntityDeleteModal as xi, EntityTypes as Ri, ConfigurationSchemaSection as M, ConfigurationSchemaType as L, EntityBaseConfigCard as $i, useDebouncedFilter as Pi } from "@kong-ui-public/entities-shared";
5
- import { VaultSecretPickerProvider as Ke, VaultSecretPicker as ki } from "@kong-ui-public/entities-vaults";
6
- import { useRouter as vn } from "vue-router";
7
- import { TrashIcon as Ai, AddCircleIcon as hn, AddIcon as bt, RefreshIcon as Vi, ClipboardIcon as Mi, DeployIcon as Li } from "@kong/icons";
8
- import { createI18n as Di, i18nTComponent as ji } from "@kong-ui-public/i18n";
9
- import { PluginIcon as Tn } from "@kong-ui-public/entities-plugins-icon";
10
- import { FORMS_CONFIG as wn } from "@kong-ui-public/forms";
11
- var w = /* @__PURE__ */ ((e) => (e[e.HOST_PORT_CE = 0] = "HOST_PORT_CE", e[e.HOST_PORT_EE = 1] = "HOST_PORT_EE", e[e.SENTINEL = 2] = "SENTINEL", e[e.CLUSTER = 3] = "CLUSTER", e))(w || {}), G = /* @__PURE__ */ ((e) => (e.REDIS_CE = "redis-ce", e.REDIS_EE = "redis-ee", e))(G || {}), Sn = typeof global == "object" && global && global.Object === Object && global, Ui = typeof self == "object" && self && self.Object === Object && self, ae = Sn || Ui || Function("return this")(), Y = ae.Symbol, En = Object.prototype, Ni = En.hasOwnProperty, Bi = En.toString, Ae = Y ? Y.toStringTag : void 0;
12
- function Fi(e) {
13
- var t = Ni.call(e, Ae), n = e[Ae];
14
- try {
15
- e[Ae] = void 0;
16
- var o = !0;
17
- } catch {
18
- }
19
- var i = Bi.call(e);
20
- return o && (t ? e[Ae] = n : delete e[Ae]), i;
21
- }
22
- var Ki = Object.prototype, Hi = Ki.toString;
23
- function zi(e) {
24
- return Hi.call(e);
25
- }
26
- var qi = "[object Null]", Wi = "[object Undefined]", At = Y ? Y.toStringTag : void 0;
27
- function Se(e) {
28
- return e == null ? e === void 0 ? Wi : qi : At && At in Object(e) ? Fi(e) : zi(e);
29
- }
30
- function ue(e) {
31
- return e != null && typeof e == "object";
32
- }
33
- var Gi = "[object Symbol]";
34
- function Et(e) {
35
- return typeof e == "symbol" || ue(e) && Se(e) == Gi;
36
- }
37
- function Cn(e, t) {
38
- for (var n = -1, o = e == null ? 0 : e.length, i = Array(o); ++n < o; )
39
- i[n] = t(e[n], n, e);
40
- return i;
41
- }
42
- var ce = Array.isArray, Vt = Y ? Y.prototype : void 0, Mt = Vt ? Vt.toString : void 0;
43
- function On(e) {
44
- if (typeof e == "string")
45
- return e;
46
- if (ce(e))
47
- return Cn(e, On) + "";
48
- if (Et(e))
49
- return Mt ? Mt.call(e) : "";
50
- var t = e + "";
51
- return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
52
- }
53
- function et(e) {
54
- var t = typeof e;
55
- return e != null && (t == "object" || t == "function");
56
- }
57
- function Ji(e) {
58
- return e;
59
- }
60
- var Qi = "[object AsyncFunction]", Yi = "[object Function]", Xi = "[object GeneratorFunction]", Zi = "[object Proxy]";
61
- function In(e) {
62
- if (!et(e))
63
- return !1;
64
- var t = Se(e);
65
- return t == Yi || t == Xi || t == Qi || t == Zi;
66
- }
67
- var st = ae["__core-js_shared__"], Lt = function() {
68
- var e = /[^.]+$/.exec(st && st.keys && st.keys.IE_PROTO || "");
69
- return e ? "Symbol(src)_1." + e : "";
70
- }();
71
- function er(e) {
72
- return !!Lt && Lt in e;
73
- }
74
- var tr = Function.prototype, nr = tr.toString;
75
- function Ee(e) {
76
- if (e != null) {
77
- try {
78
- return nr.call(e);
79
- } catch {
80
- }
81
- try {
82
- return e + "";
83
- } catch {
84
- }
85
- }
86
- return "";
87
- }
88
- var ir = /[\\^$.*+?()[\]{}|]/g, rr = /^\[object .+?Constructor\]$/, or = Function.prototype, ar = Object.prototype, lr = or.toString, sr = ar.hasOwnProperty, dr = RegExp(
89
- "^" + lr.call(sr).replace(ir, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
90
- );
91
- function ur(e) {
92
- if (!et(e) || er(e))
93
- return !1;
94
- var t = In(e) ? dr : rr;
95
- return t.test(Ee(e));
96
- }
97
- function cr(e, t) {
98
- return e == null ? void 0 : e[t];
99
- }
100
- function Ce(e, t) {
101
- var n = cr(e, t);
102
- return ur(n) ? n : void 0;
103
- }
104
- var yt = Ce(ae, "WeakMap");
105
- function fr(e, t, n) {
106
- switch (n.length) {
107
- case 0:
108
- return e.call(t);
109
- case 1:
110
- return e.call(t, n[0]);
111
- case 2:
112
- return e.call(t, n[0], n[1]);
113
- case 3:
114
- return e.call(t, n[0], n[1], n[2]);
115
- }
116
- return e.apply(t, n);
117
- }
118
- var pr = 800, mr = 16, gr = Date.now;
119
- function br(e) {
120
- var t = 0, n = 0;
121
- return function() {
122
- var o = gr(), i = mr - (o - n);
123
- if (n = o, i > 0) {
124
- if (++t >= pr)
125
- return arguments[0];
126
- } else
127
- t = 0;
128
- return e.apply(void 0, arguments);
129
- };
130
- }
131
- function yr(e) {
132
- return function() {
133
- return e;
134
- };
135
- }
136
- var Ge = function() {
137
- try {
138
- var e = Ce(Object, "defineProperty");
139
- return e({}, "", {}), e;
140
- } catch {
141
- }
142
- }(), _r = Ge ? function(e, t) {
143
- return Ge(e, "toString", {
144
- configurable: !0,
145
- enumerable: !1,
146
- value: yr(t),
147
- writable: !0
148
- });
149
- } : Ji, vr = br(_r);
150
- function hr(e, t) {
151
- for (var n = -1, o = e == null ? 0 : e.length; ++n < o && t(e[n], n, e) !== !1; )
152
- ;
153
- return e;
154
- }
155
- var Tr = 9007199254740991, wr = /^(?:0|[1-9]\d*)$/;
156
- function Sr(e, t) {
157
- var n = typeof e;
158
- return t = t ?? Tr, !!t && (n == "number" || n != "symbol" && wr.test(e)) && e > -1 && e % 1 == 0 && e < t;
159
- }
160
- function xn(e, t, n) {
161
- t == "__proto__" && Ge ? Ge(e, t, {
162
- configurable: !0,
163
- enumerable: !0,
164
- value: n,
165
- writable: !0
166
- }) : e[t] = n;
167
- }
168
- function Ct(e, t) {
169
- return e === t || e !== e && t !== t;
170
- }
171
- var Er = Object.prototype, Cr = Er.hasOwnProperty;
172
- function Rn(e, t, n) {
173
- var o = e[t];
174
- (!(Cr.call(e, t) && Ct(o, n)) || n === void 0 && !(t in e)) && xn(e, t, n);
175
- }
176
- function Or(e, t, n, o) {
177
- var i = !n;
178
- n || (n = {});
179
- for (var a = -1, u = t.length; ++a < u; ) {
180
- var c = t[a], l = void 0;
181
- l === void 0 && (l = e[c]), i ? xn(n, c, l) : Rn(n, c, l);
182
- }
183
- return n;
184
- }
185
- var Dt = Math.max;
186
- function Ir(e, t, n) {
187
- return t = Dt(t === void 0 ? e.length - 1 : t, 0), function() {
188
- for (var o = arguments, i = -1, a = Dt(o.length - t, 0), u = Array(a); ++i < a; )
189
- u[i] = o[t + i];
190
- i = -1;
191
- for (var c = Array(t + 1); ++i < t; )
192
- c[i] = o[i];
193
- return c[t] = n(u), fr(e, this, c);
194
- };
195
- }
196
- var xr = 9007199254740991;
197
- function $n(e) {
198
- return typeof e == "number" && e > -1 && e % 1 == 0 && e <= xr;
199
- }
200
- function Pn(e) {
201
- return e != null && $n(e.length) && !In(e);
202
- }
203
- var Rr = Object.prototype;
204
- function kn(e) {
205
- var t = e && e.constructor, n = typeof t == "function" && t.prototype || Rr;
206
- return e === n;
207
- }
208
- function $r(e, t) {
209
- for (var n = -1, o = Array(e); ++n < e; )
210
- o[n] = t(n);
211
- return o;
212
- }
213
- var Pr = "[object Arguments]";
214
- function jt(e) {
215
- return ue(e) && Se(e) == Pr;
216
- }
217
- var An = Object.prototype, kr = An.hasOwnProperty, Ar = An.propertyIsEnumerable, Vn = jt(/* @__PURE__ */ function() {
218
- return arguments;
219
- }()) ? jt : function(e) {
220
- return ue(e) && kr.call(e, "callee") && !Ar.call(e, "callee");
221
- };
222
- function Vr() {
223
- return !1;
224
- }
225
- var Mn = typeof exports == "object" && exports && !exports.nodeType && exports, Ut = Mn && typeof module == "object" && module && !module.nodeType && module, Mr = Ut && Ut.exports === Mn, Nt = Mr ? ae.Buffer : void 0, Lr = Nt ? Nt.isBuffer : void 0, Je = Lr || Vr, Dr = "[object Arguments]", jr = "[object Array]", Ur = "[object Boolean]", Nr = "[object Date]", Br = "[object Error]", Fr = "[object Function]", Kr = "[object Map]", Hr = "[object Number]", zr = "[object Object]", qr = "[object RegExp]", Wr = "[object Set]", Gr = "[object String]", Jr = "[object WeakMap]", Qr = "[object ArrayBuffer]", Yr = "[object DataView]", Xr = "[object Float32Array]", Zr = "[object Float64Array]", eo = "[object Int8Array]", to = "[object Int16Array]", no = "[object Int32Array]", io = "[object Uint8Array]", ro = "[object Uint8ClampedArray]", oo = "[object Uint16Array]", ao = "[object Uint32Array]", D = {};
226
- D[Xr] = D[Zr] = D[eo] = D[to] = D[no] = D[io] = D[ro] = D[oo] = D[ao] = !0;
227
- D[Dr] = D[jr] = D[Qr] = D[Ur] = D[Yr] = D[Nr] = D[Br] = D[Fr] = D[Kr] = D[Hr] = D[zr] = D[qr] = D[Wr] = D[Gr] = D[Jr] = !1;
228
- function lo(e) {
229
- return ue(e) && $n(e.length) && !!D[Se(e)];
230
- }
231
- function Ot(e) {
232
- return function(t) {
233
- return e(t);
234
- };
235
- }
236
- var Ln = typeof exports == "object" && exports && !exports.nodeType && exports, Ve = Ln && typeof module == "object" && module && !module.nodeType && module, so = Ve && Ve.exports === Ln, dt = so && Sn.process, Pe = function() {
237
- try {
238
- var e = Ve && Ve.require && Ve.require("util").types;
239
- return e || dt && dt.binding && dt.binding("util");
240
- } catch {
241
- }
242
- }(), Bt = Pe && Pe.isTypedArray, Dn = Bt ? Ot(Bt) : lo, uo = Object.prototype, co = uo.hasOwnProperty;
243
- function jn(e, t) {
244
- var n = ce(e), o = !n && Vn(e), i = !n && !o && Je(e), a = !n && !o && !i && Dn(e), u = n || o || i || a, c = u ? $r(e.length, String) : [], l = c.length;
245
- for (var d in e)
246
- (t || co.call(e, d)) && !(u && // Safari 9 has enumerable `arguments.length` in strict mode.
247
- (d == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
248
- i && (d == "offset" || d == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
249
- a && (d == "buffer" || d == "byteLength" || d == "byteOffset") || // Skip index properties.
250
- Sr(d, l))) && c.push(d);
251
- return c;
252
- }
253
- function Un(e, t) {
254
- return function(n) {
255
- return e(t(n));
256
- };
257
- }
258
- var fo = Un(Object.keys, Object), po = Object.prototype, mo = po.hasOwnProperty;
259
- function go(e) {
260
- if (!kn(e))
261
- return fo(e);
262
- var t = [];
263
- for (var n in Object(e))
264
- mo.call(e, n) && n != "constructor" && t.push(n);
265
- return t;
266
- }
267
- function bo(e) {
268
- return Pn(e) ? jn(e) : go(e);
269
- }
270
- function yo(e) {
271
- var t = [];
272
- if (e != null)
273
- for (var n in Object(e))
274
- t.push(n);
275
- return t;
276
- }
277
- var _o = Object.prototype, vo = _o.hasOwnProperty;
278
- function ho(e) {
279
- if (!et(e))
280
- return yo(e);
281
- var t = kn(e), n = [];
282
- for (var o in e)
283
- o == "constructor" && (t || !vo.call(e, o)) || n.push(o);
284
- return n;
285
- }
286
- function To(e) {
287
- return Pn(e) ? jn(e, !0) : ho(e);
288
- }
289
- var wo = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, So = /^\w*$/;
290
- function Eo(e, t) {
291
- if (ce(e))
292
- return !1;
293
- var n = typeof e;
294
- return n == "number" || n == "symbol" || n == "boolean" || e == null || Et(e) ? !0 : So.test(e) || !wo.test(e) || t != null && e in Object(t);
295
- }
296
- var Me = Ce(Object, "create");
297
- function Co() {
298
- this.__data__ = Me ? Me(null) : {}, this.size = 0;
299
- }
300
- function Oo(e) {
301
- var t = this.has(e) && delete this.__data__[e];
302
- return this.size -= t ? 1 : 0, t;
303
- }
304
- var Io = "__lodash_hash_undefined__", xo = Object.prototype, Ro = xo.hasOwnProperty;
305
- function $o(e) {
306
- var t = this.__data__;
307
- if (Me) {
308
- var n = t[e];
309
- return n === Io ? void 0 : n;
310
- }
311
- return Ro.call(t, e) ? t[e] : void 0;
312
- }
313
- var Po = Object.prototype, ko = Po.hasOwnProperty;
314
- function Ao(e) {
315
- var t = this.__data__;
316
- return Me ? t[e] !== void 0 : ko.call(t, e);
317
- }
318
- var Vo = "__lodash_hash_undefined__";
319
- function Mo(e, t) {
320
- var n = this.__data__;
321
- return this.size += this.has(e) ? 0 : 1, n[e] = Me && t === void 0 ? Vo : t, this;
322
- }
323
- function we(e) {
324
- var t = -1, n = e == null ? 0 : e.length;
325
- for (this.clear(); ++t < n; ) {
326
- var o = e[t];
327
- this.set(o[0], o[1]);
328
- }
329
- }
330
- we.prototype.clear = Co;
331
- we.prototype.delete = Oo;
332
- we.prototype.get = $o;
333
- we.prototype.has = Ao;
334
- we.prototype.set = Mo;
335
- function Lo() {
336
- this.__data__ = [], this.size = 0;
337
- }
338
- function tt(e, t) {
339
- for (var n = e.length; n--; )
340
- if (Ct(e[n][0], t))
341
- return n;
342
- return -1;
343
- }
344
- var Do = Array.prototype, jo = Do.splice;
345
- function Uo(e) {
346
- var t = this.__data__, n = tt(t, e);
347
- if (n < 0)
348
- return !1;
349
- var o = t.length - 1;
350
- return n == o ? t.pop() : jo.call(t, n, 1), --this.size, !0;
351
- }
352
- function No(e) {
353
- var t = this.__data__, n = tt(t, e);
354
- return n < 0 ? void 0 : t[n][1];
355
- }
356
- function Bo(e) {
357
- return tt(this.__data__, e) > -1;
358
- }
359
- function Fo(e, t) {
360
- var n = this.__data__, o = tt(n, e);
361
- return o < 0 ? (++this.size, n.push([e, t])) : n[o][1] = t, this;
362
- }
363
- function fe(e) {
364
- var t = -1, n = e == null ? 0 : e.length;
365
- for (this.clear(); ++t < n; ) {
366
- var o = e[t];
367
- this.set(o[0], o[1]);
368
- }
369
- }
370
- fe.prototype.clear = Lo;
371
- fe.prototype.delete = Uo;
372
- fe.prototype.get = No;
373
- fe.prototype.has = Bo;
374
- fe.prototype.set = Fo;
375
- var Le = Ce(ae, "Map");
376
- function Ko() {
377
- this.size = 0, this.__data__ = {
378
- hash: new we(),
379
- map: new (Le || fe)(),
380
- string: new we()
381
- };
382
- }
383
- function Ho(e) {
384
- var t = typeof e;
385
- return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
386
- }
387
- function nt(e, t) {
388
- var n = e.__data__;
389
- return Ho(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
390
- }
391
- function zo(e) {
392
- var t = nt(this, e).delete(e);
393
- return this.size -= t ? 1 : 0, t;
394
- }
395
- function qo(e) {
396
- return nt(this, e).get(e);
397
- }
398
- function Wo(e) {
399
- return nt(this, e).has(e);
400
- }
401
- function Go(e, t) {
402
- var n = nt(this, e), o = n.size;
403
- return n.set(e, t), this.size += n.size == o ? 0 : 1, this;
404
- }
405
- function pe(e) {
406
- var t = -1, n = e == null ? 0 : e.length;
407
- for (this.clear(); ++t < n; ) {
408
- var o = e[t];
409
- this.set(o[0], o[1]);
410
- }
411
- }
412
- pe.prototype.clear = Ko;
413
- pe.prototype.delete = zo;
414
- pe.prototype.get = qo;
415
- pe.prototype.has = Wo;
416
- pe.prototype.set = Go;
417
- var Jo = "Expected a function";
418
- function It(e, t) {
419
- if (typeof e != "function" || t != null && typeof t != "function")
420
- throw new TypeError(Jo);
421
- var n = function() {
422
- var o = arguments, i = t ? t.apply(this, o) : o[0], a = n.cache;
423
- if (a.has(i))
424
- return a.get(i);
425
- var u = e.apply(this, o);
426
- return n.cache = a.set(i, u) || a, u;
427
- };
428
- return n.cache = new (It.Cache || pe)(), n;
429
- }
430
- It.Cache = pe;
431
- var Qo = 500;
432
- function Yo(e) {
433
- var t = It(e, function(o) {
434
- return n.size === Qo && n.clear(), o;
435
- }), n = t.cache;
436
- return t;
437
- }
438
- var Xo = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Zo = /\\(\\)?/g, ea = Yo(function(e) {
439
- var t = [];
440
- return e.charCodeAt(0) === 46 && t.push(""), e.replace(Xo, function(n, o, i, a) {
441
- t.push(i ? a.replace(Zo, "$1") : o || n);
442
- }), t;
443
- });
444
- function ta(e) {
445
- return e == null ? "" : On(e);
446
- }
447
- function xt(e, t) {
448
- return ce(e) ? e : Eo(e, t) ? [e] : ea(ta(e));
449
- }
450
- function Nn(e) {
451
- if (typeof e == "string" || Et(e))
452
- return e;
453
- var t = e + "";
454
- return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
455
- }
456
- function na(e, t) {
457
- t = xt(t, e);
458
- for (var n = 0, o = t.length; e != null && n < o; )
459
- e = e[Nn(t[n++])];
460
- return n && n == o ? e : void 0;
461
- }
462
- function Rt(e, t) {
463
- for (var n = -1, o = t.length, i = e.length; ++n < o; )
464
- e[i + n] = t[n];
465
- return e;
466
- }
467
- var Ft = Y ? Y.isConcatSpreadable : void 0;
468
- function ia(e) {
469
- return ce(e) || Vn(e) || !!(Ft && e && e[Ft]);
470
- }
471
- function ra(e, t, n, o, i) {
472
- var a = -1, u = e.length;
473
- for (n || (n = ia), i || (i = []); ++a < u; ) {
474
- var c = e[a];
475
- n(c) ? Rt(i, c) : i[i.length] = c;
476
- }
477
- return i;
478
- }
479
- function oa(e) {
480
- var t = e == null ? 0 : e.length;
481
- return t ? ra(e) : [];
482
- }
483
- function aa(e) {
484
- return vr(Ir(e, void 0, oa), e + "");
485
- }
486
- var Bn = Un(Object.getPrototypeOf, Object), la = "[object Object]", sa = Function.prototype, da = Object.prototype, Fn = sa.toString, ua = da.hasOwnProperty, ca = Fn.call(Object);
487
- function fa(e) {
488
- if (!ue(e) || Se(e) != la)
489
- return !1;
490
- var t = Bn(e);
491
- if (t === null)
492
- return !0;
493
- var n = ua.call(t, "constructor") && t.constructor;
494
- return typeof n == "function" && n instanceof n && Fn.call(n) == ca;
495
- }
496
- function pa(e, t, n) {
497
- var o = -1, i = e.length;
498
- t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
499
- for (var a = Array(i); ++o < i; )
500
- a[o] = e[o + t];
501
- return a;
502
- }
503
- function ma() {
504
- this.__data__ = new fe(), this.size = 0;
505
- }
506
- function ga(e) {
507
- var t = this.__data__, n = t.delete(e);
508
- return this.size = t.size, n;
509
- }
510
- function ba(e) {
511
- return this.__data__.get(e);
512
- }
513
- function ya(e) {
514
- return this.__data__.has(e);
515
- }
516
- var _a = 200;
517
- function va(e, t) {
518
- var n = this.__data__;
519
- if (n instanceof fe) {
520
- var o = n.__data__;
521
- if (!Le || o.length < _a - 1)
522
- return o.push([e, t]), this.size = ++n.size, this;
523
- n = this.__data__ = new pe(o);
524
- }
525
- return n.set(e, t), this.size = n.size, this;
526
- }
527
- function de(e) {
528
- var t = this.__data__ = new fe(e);
529
- this.size = t.size;
530
- }
531
- de.prototype.clear = ma;
532
- de.prototype.delete = ga;
533
- de.prototype.get = ba;
534
- de.prototype.has = ya;
535
- de.prototype.set = va;
536
- var Kn = typeof exports == "object" && exports && !exports.nodeType && exports, Kt = Kn && typeof module == "object" && module && !module.nodeType && module, ha = Kt && Kt.exports === Kn, Ht = ha ? ae.Buffer : void 0;
537
- Ht && Ht.allocUnsafe;
538
- function Ta(e, t) {
539
- return e.slice();
540
- }
541
- function wa(e, t) {
542
- for (var n = -1, o = e == null ? 0 : e.length, i = 0, a = []; ++n < o; ) {
543
- var u = e[n];
544
- t(u, n, e) && (a[i++] = u);
545
- }
546
- return a;
547
- }
548
- function Hn() {
549
- return [];
550
- }
551
- var Sa = Object.prototype, Ea = Sa.propertyIsEnumerable, zt = Object.getOwnPropertySymbols, zn = zt ? function(e) {
552
- return e == null ? [] : (e = Object(e), wa(zt(e), function(t) {
553
- return Ea.call(e, t);
554
- }));
555
- } : Hn, Ca = Object.getOwnPropertySymbols, Oa = Ca ? function(e) {
556
- for (var t = []; e; )
557
- Rt(t, zn(e)), e = Bn(e);
558
- return t;
559
- } : Hn;
560
- function qn(e, t, n) {
561
- var o = t(e);
562
- return ce(e) ? o : Rt(o, n(e));
563
- }
564
- function qt(e) {
565
- return qn(e, bo, zn);
566
- }
567
- function Wn(e) {
568
- return qn(e, To, Oa);
569
- }
570
- var _t = Ce(ae, "DataView"), vt = Ce(ae, "Promise"), ht = Ce(ae, "Set"), Wt = "[object Map]", Ia = "[object Object]", Gt = "[object Promise]", Jt = "[object Set]", Qt = "[object WeakMap]", Yt = "[object DataView]", xa = Ee(_t), Ra = Ee(Le), $a = Ee(vt), Pa = Ee(ht), ka = Ee(yt), te = Se;
571
- (_t && te(new _t(new ArrayBuffer(1))) != Yt || Le && te(new Le()) != Wt || vt && te(vt.resolve()) != Gt || ht && te(new ht()) != Jt || yt && te(new yt()) != Qt) && (te = function(e) {
572
- var t = Se(e), n = t == Ia ? e.constructor : void 0, o = n ? Ee(n) : "";
573
- if (o)
574
- switch (o) {
575
- case xa:
576
- return Yt;
577
- case Ra:
578
- return Wt;
579
- case $a:
580
- return Gt;
581
- case Pa:
582
- return Jt;
583
- case ka:
584
- return Qt;
585
- }
586
- return t;
587
- });
588
- var Aa = Object.prototype, Va = Aa.hasOwnProperty;
589
- function Ma(e) {
590
- var t = e.length, n = new e.constructor(t);
591
- return t && typeof e[0] == "string" && Va.call(e, "index") && (n.index = e.index, n.input = e.input), n;
592
- }
593
- var Qe = ae.Uint8Array;
594
- function $t(e) {
595
- var t = new e.constructor(e.byteLength);
596
- return new Qe(t).set(new Qe(e)), t;
597
- }
598
- function La(e, t) {
599
- var n = $t(e.buffer);
600
- return new e.constructor(n, e.byteOffset, e.byteLength);
601
- }
602
- var Da = /\w*$/;
603
- function ja(e) {
604
- var t = new e.constructor(e.source, Da.exec(e));
605
- return t.lastIndex = e.lastIndex, t;
606
- }
607
- var Xt = Y ? Y.prototype : void 0, Zt = Xt ? Xt.valueOf : void 0;
608
- function Ua(e) {
609
- return Zt ? Object(Zt.call(e)) : {};
610
- }
611
- function Na(e, t) {
612
- var n = $t(e.buffer);
613
- return new e.constructor(n, e.byteOffset, e.length);
614
- }
615
- var Ba = "[object Boolean]", Fa = "[object Date]", Ka = "[object Map]", Ha = "[object Number]", za = "[object RegExp]", qa = "[object Set]", Wa = "[object String]", Ga = "[object Symbol]", Ja = "[object ArrayBuffer]", Qa = "[object DataView]", Ya = "[object Float32Array]", Xa = "[object Float64Array]", Za = "[object Int8Array]", el = "[object Int16Array]", tl = "[object Int32Array]", nl = "[object Uint8Array]", il = "[object Uint8ClampedArray]", rl = "[object Uint16Array]", ol = "[object Uint32Array]";
616
- function al(e, t, n) {
617
- var o = e.constructor;
618
- switch (t) {
619
- case Ja:
620
- return $t(e);
621
- case Ba:
622
- case Fa:
623
- return new o(+e);
624
- case Qa:
625
- return La(e);
626
- case Ya:
627
- case Xa:
628
- case Za:
629
- case el:
630
- case tl:
631
- case nl:
632
- case il:
633
- case rl:
634
- case ol:
635
- return Na(e);
636
- case Ka:
637
- return new o();
638
- case Ha:
639
- case Wa:
640
- return new o(e);
641
- case za:
642
- return ja(e);
643
- case qa:
644
- return new o();
645
- case Ga:
646
- return Ua(e);
647
- }
648
- }
649
- var ll = "[object Map]";
650
- function sl(e) {
651
- return ue(e) && te(e) == ll;
652
- }
653
- var en = Pe && Pe.isMap, dl = en ? Ot(en) : sl, ul = "[object Set]";
654
- function cl(e) {
655
- return ue(e) && te(e) == ul;
656
- }
657
- var tn = Pe && Pe.isSet, fl = tn ? Ot(tn) : cl, Gn = "[object Arguments]", pl = "[object Array]", ml = "[object Boolean]", gl = "[object Date]", bl = "[object Error]", Jn = "[object Function]", yl = "[object GeneratorFunction]", _l = "[object Map]", vl = "[object Number]", Qn = "[object Object]", hl = "[object RegExp]", Tl = "[object Set]", wl = "[object String]", Sl = "[object Symbol]", El = "[object WeakMap]", Cl = "[object ArrayBuffer]", Ol = "[object DataView]", Il = "[object Float32Array]", xl = "[object Float64Array]", Rl = "[object Int8Array]", $l = "[object Int16Array]", Pl = "[object Int32Array]", kl = "[object Uint8Array]", Al = "[object Uint8ClampedArray]", Vl = "[object Uint16Array]", Ml = "[object Uint32Array]", A = {};
658
- A[Gn] = A[pl] = A[Cl] = A[Ol] = A[ml] = A[gl] = A[Il] = A[xl] = A[Rl] = A[$l] = A[Pl] = A[_l] = A[vl] = A[Qn] = A[hl] = A[Tl] = A[wl] = A[Sl] = A[kl] = A[Al] = A[Vl] = A[Ml] = !0;
659
- A[bl] = A[Jn] = A[El] = !1;
660
- function We(e, t, n, o, i, a) {
661
- var u;
662
- if (n && (u = i ? n(e, o, i, a) : n(e)), u !== void 0)
663
- return u;
664
- if (!et(e))
665
- return e;
666
- var c = ce(e);
667
- if (c)
668
- u = Ma(e);
669
- else {
670
- var l = te(e), d = l == Jn || l == yl;
671
- if (Je(e))
672
- return Ta(e);
673
- if (l == Qn || l == Gn || d && !i)
674
- u = {};
675
- else {
676
- if (!A[l])
677
- return i ? e : {};
678
- u = al(e, l);
679
- }
680
- }
681
- a || (a = new de());
682
- var b = a.get(e);
683
- if (b)
684
- return b;
685
- a.set(e, u), fl(e) ? e.forEach(function(h) {
686
- u.add(We(h, t, n, h, e, a));
687
- }) : dl(e) && e.forEach(function(h, p) {
688
- u.set(p, We(h, t, n, p, e, a));
689
- });
690
- var T = Wn, y = c ? void 0 : T(e);
691
- return hr(y || e, function(h, p) {
692
- y && (p = h, h = e[p]), Rn(u, p, We(h, t, n, p, e, a));
693
- }), u;
694
- }
695
- var Ll = "__lodash_hash_undefined__";
696
- function Dl(e) {
697
- return this.__data__.set(e, Ll), this;
698
- }
699
- function jl(e) {
700
- return this.__data__.has(e);
701
- }
702
- function Ye(e) {
703
- var t = -1, n = e == null ? 0 : e.length;
704
- for (this.__data__ = new pe(); ++t < n; )
705
- this.add(e[t]);
706
- }
707
- Ye.prototype.add = Ye.prototype.push = Dl;
708
- Ye.prototype.has = jl;
709
- function Ul(e, t) {
710
- for (var n = -1, o = e == null ? 0 : e.length; ++n < o; )
711
- if (t(e[n], n, e))
712
- return !0;
713
- return !1;
714
- }
715
- function Nl(e, t) {
716
- return e.has(t);
717
- }
718
- var Bl = 1, Fl = 2;
719
- function Yn(e, t, n, o, i, a) {
720
- var u = n & Bl, c = e.length, l = t.length;
721
- if (c != l && !(u && l > c))
722
- return !1;
723
- var d = a.get(e), b = a.get(t);
724
- if (d && b)
725
- return d == t && b == e;
726
- var T = -1, y = !0, h = n & Fl ? new Ye() : void 0;
727
- for (a.set(e, t), a.set(t, e); ++T < c; ) {
728
- var p = e[T], C = t[T];
729
- if (o)
730
- var s = u ? o(C, p, T, t, e, a) : o(p, C, T, e, t, a);
731
- if (s !== void 0) {
732
- if (s)
733
- continue;
734
- y = !1;
735
- break;
736
- }
737
- if (h) {
738
- if (!Ul(t, function(k, m) {
739
- if (!Nl(h, m) && (p === k || i(p, k, n, o, a)))
740
- return h.push(m);
741
- })) {
742
- y = !1;
743
- break;
744
- }
745
- } else if (!(p === C || i(p, C, n, o, a))) {
746
- y = !1;
747
- break;
748
- }
749
- }
750
- return a.delete(e), a.delete(t), y;
751
- }
752
- function Kl(e) {
753
- var t = -1, n = Array(e.size);
754
- return e.forEach(function(o, i) {
755
- n[++t] = [i, o];
756
- }), n;
757
- }
758
- function Hl(e) {
759
- var t = -1, n = Array(e.size);
760
- return e.forEach(function(o) {
761
- n[++t] = o;
762
- }), n;
763
- }
764
- var zl = 1, ql = 2, Wl = "[object Boolean]", Gl = "[object Date]", Jl = "[object Error]", Ql = "[object Map]", Yl = "[object Number]", Xl = "[object RegExp]", Zl = "[object Set]", es = "[object String]", ts = "[object Symbol]", ns = "[object ArrayBuffer]", is = "[object DataView]", nn = Y ? Y.prototype : void 0, ut = nn ? nn.valueOf : void 0;
765
- function rs(e, t, n, o, i, a, u) {
766
- switch (n) {
767
- case is:
768
- if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
769
- return !1;
770
- e = e.buffer, t = t.buffer;
771
- case ns:
772
- return !(e.byteLength != t.byteLength || !a(new Qe(e), new Qe(t)));
773
- case Wl:
774
- case Gl:
775
- case Yl:
776
- return Ct(+e, +t);
777
- case Jl:
778
- return e.name == t.name && e.message == t.message;
779
- case Xl:
780
- case es:
781
- return e == t + "";
782
- case Ql:
783
- var c = Kl;
784
- case Zl:
785
- var l = o & zl;
786
- if (c || (c = Hl), e.size != t.size && !l)
787
- return !1;
788
- var d = u.get(e);
789
- if (d)
790
- return d == t;
791
- o |= ql, u.set(e, t);
792
- var b = Yn(c(e), c(t), o, i, a, u);
793
- return u.delete(e), b;
794
- case ts:
795
- if (ut)
796
- return ut.call(e) == ut.call(t);
797
- }
798
- return !1;
799
- }
800
- var os = 1, as = Object.prototype, ls = as.hasOwnProperty;
801
- function ss(e, t, n, o, i, a) {
802
- var u = n & os, c = qt(e), l = c.length, d = qt(t), b = d.length;
803
- if (l != b && !u)
804
- return !1;
805
- for (var T = l; T--; ) {
806
- var y = c[T];
807
- if (!(u ? y in t : ls.call(t, y)))
808
- return !1;
809
- }
810
- var h = a.get(e), p = a.get(t);
811
- if (h && p)
812
- return h == t && p == e;
813
- var C = !0;
814
- a.set(e, t), a.set(t, e);
815
- for (var s = u; ++T < l; ) {
816
- y = c[T];
817
- var k = e[y], m = t[y];
818
- if (o)
819
- var _ = u ? o(m, k, y, t, e, a) : o(k, m, y, e, t, a);
820
- if (!(_ === void 0 ? k === m || i(k, m, n, o, a) : _)) {
821
- C = !1;
822
- break;
823
- }
824
- s || (s = y == "constructor");
825
- }
826
- if (C && !s) {
827
- var I = e.constructor, P = t.constructor;
828
- I != P && "constructor" in e && "constructor" in t && !(typeof I == "function" && I instanceof I && typeof P == "function" && P instanceof P) && (C = !1);
829
- }
830
- return a.delete(e), a.delete(t), C;
831
- }
832
- var ds = 1, rn = "[object Arguments]", on = "[object Array]", He = "[object Object]", us = Object.prototype, an = us.hasOwnProperty;
833
- function cs(e, t, n, o, i, a) {
834
- var u = ce(e), c = ce(t), l = u ? on : te(e), d = c ? on : te(t);
835
- l = l == rn ? He : l, d = d == rn ? He : d;
836
- var b = l == He, T = d == He, y = l == d;
837
- if (y && Je(e)) {
838
- if (!Je(t))
839
- return !1;
840
- u = !0, b = !1;
841
- }
842
- if (y && !b)
843
- return a || (a = new de()), u || Dn(e) ? Yn(e, t, n, o, i, a) : rs(e, t, l, n, o, i, a);
844
- if (!(n & ds)) {
845
- var h = b && an.call(e, "__wrapped__"), p = T && an.call(t, "__wrapped__");
846
- if (h || p) {
847
- var C = h ? e.value() : e, s = p ? t.value() : t;
848
- return a || (a = new de()), i(C, s, n, o, a);
849
- }
850
- }
851
- return y ? (a || (a = new de()), ss(e, t, n, o, i, a)) : !1;
852
- }
853
- function Xn(e, t, n, o, i) {
854
- return e === t ? !0 : e == null || t == null || !ue(e) && !ue(t) ? e !== e && t !== t : cs(e, t, n, o, Xn, i);
855
- }
856
- function fs(e) {
857
- var t = e == null ? 0 : e.length;
858
- return t ? e[t - 1] : void 0;
859
- }
860
- function ps(e, t) {
861
- return t.length < 2 ? e : na(e, pa(t, 0, -1));
862
- }
863
- function ms(e, t) {
864
- return Xn(e, t);
865
- }
866
- function gs(e, t) {
867
- return t = xt(t, e), e = ps(e, t), e == null || delete e[Nn(fs(t))];
868
- }
869
- function bs(e) {
870
- return fa(e) ? void 0 : e;
871
- }
872
- var ys = 1, _s = 2, vs = 4, hs = aa(function(e, t) {
873
- var n = {};
874
- if (e == null)
875
- return n;
876
- var o = !1;
877
- t = Cn(t, function(a) {
878
- return a = xt(a, e), o || (o = a.length > 1), a;
879
- }), Or(e, Wn(e), n), o && (n = We(n, ys | _s | vs, bs));
880
- for (var i = t.length; i--; )
881
- gs(n, t[i]);
882
- return n;
883
- });
884
- const z = [];
885
- for (let e = 0; e < 256; ++e)
886
- z.push((e + 256).toString(16).slice(1));
887
- function Ts(e, t = 0) {
888
- return (z[e[t + 0]] + z[e[t + 1]] + z[e[t + 2]] + z[e[t + 3]] + "-" + z[e[t + 4]] + z[e[t + 5]] + "-" + z[e[t + 6]] + z[e[t + 7]] + "-" + z[e[t + 8]] + z[e[t + 9]] + "-" + z[e[t + 10]] + z[e[t + 11]] + z[e[t + 12]] + z[e[t + 13]] + z[e[t + 14]] + z[e[t + 15]]).toLowerCase();
889
- }
890
- let ct;
891
- const ws = new Uint8Array(16);
892
- function Ss() {
893
- if (!ct) {
894
- if (typeof crypto > "u" || !crypto.getRandomValues)
895
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
896
- ct = crypto.getRandomValues.bind(crypto);
897
- }
898
- return ct(ws);
899
- }
900
- const Es = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ln = { randomUUID: Es };
901
- function Cs(e, t, n) {
902
- var i;
903
- if (ln.randomUUID && !e)
904
- return ln.randomUUID();
905
- e = e || {};
906
- const o = e.random ?? ((i = e.rng) == null ? void 0 : i.call(e)) ?? Ss();
907
- if (o.length < 16)
908
- throw new Error("Random bytes length must be >= 16");
909
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Ts(o);
910
- }
911
- const Zn = {
912
- ip: "127.0.0.1",
913
- port: 6379
914
- }, ei = {
915
- host: "127.0.0.1",
916
- port: 6379
917
- }, $e = w.HOST_PORT_EE, ti = {
918
- port: 6379,
919
- host: "127.0.0.1",
920
- database: 0,
921
- username: "",
922
- password: "",
923
- ssl: !1,
924
- ssl_verify: !1,
925
- server_name: "",
926
- connect_timeout: 2e3,
927
- send_timeout: 2e3,
928
- read_timeout: 2e3,
929
- sentinel_username: "",
930
- sentinel_password: "",
931
- keepalive_pool_size: 256,
932
- keepalive_backlog: 0,
933
- sentinel_master: "",
934
- sentinel_nodes: [],
935
- cluster_nodes: [],
936
- cluster_max_redirections: 0,
937
- connection_is_proxied: !1,
938
- timeout: 2e3
939
- }, Fd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
940
- __proto__: null,
941
- DEFAULT_CLUSTER_NODE: Zn,
942
- DEFAULT_FIELDS: ti,
943
- DEFAULT_REDIS_TYPE: $e,
944
- DEFAULT_SENTINEL_NODE: ei
945
- }, Symbol.toStringTag, { value: "Module" })), De = (e) => ({ ...e, id: Cs() }), Tt = (e) => {
946
- const { id: t, ...n } = e;
947
- return n;
948
- }, ni = () => De(ei), ii = () => De(Zn), Ue = (e) => {
949
- var t, n;
950
- return e.type === G.REDIS_CE ? w.HOST_PORT_CE : (t = e.config.sentinel_nodes) != null && t.length ? w.SENTINEL : (n = e.config.cluster_nodes) != null && n.length ? w.CLUSTER : w.HOST_PORT_EE;
951
- }, Xe = (e) => e === w.HOST_PORT_CE ? G.REDIS_CE : G.REDIS_EE, E = {
952
- int(e, t) {
953
- return e == null ? t : parseInt(e.toString(), 10);
954
- },
955
- str(e, t) {
956
- return e == null || e === "" ? t : e.toString();
957
- },
958
- removeIdClusterNodes(e) {
959
- return e.map((t) => ({
960
- ...Tt(t),
961
- port: E.int(t.port)
962
- }));
963
- },
964
- removeIdFromSentinelNodes(e) {
965
- return e.map((t) => ({
966
- ...Tt(t),
967
- port: E.int(t.port)
968
- }));
969
- },
970
- addIdToClusterNodes(e) {
971
- return e.map(De);
972
- },
973
- addIdToSentinelNodes(e) {
974
- return e.map(De);
975
- },
976
- removeNullValues(e) {
977
- const t = { ...e };
978
- for (const n in t)
979
- t[n] === null && delete t[n];
980
- return t;
981
- },
982
- stringToArray(e, t = ",") {
983
- return e ? e.split(t).map((n) => String(n || "").trim()).filter((n) => n !== "") : [];
984
- },
985
- arrayToString(e, t = ", ") {
986
- return e ? e.join(t) : "";
987
- }
988
- }, Kd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
989
- __proto__: null,
990
- genDefaultClusterNode: ii,
991
- genDefaultSentinelNode: ni,
992
- getRedisType: Ue,
993
- mapRedisTypeToPartialType: Xe,
994
- shallowCopyWithId: De,
995
- shallowCopyWithoutId: Tt,
996
- standardize: E
997
- }, Symbol.toStringTag, { value: "Module" })), ze = "/v2/control-planes/{controlPlaneId}/core-entities", qe = "/{workspace}", ke = {
998
- list: {
999
- konnect: `${ze}/partials`,
1000
- kongManager: `${qe}/partials`
1001
- },
1002
- form: {
1003
- konnect: {
1004
- create: `${ze}/partials`,
1005
- edit: `${ze}/partials/{id}`
1006
- },
1007
- kongManager: {
1008
- create: `${qe}/partials`,
1009
- edit: `${qe}/partials/{id}`
1010
- }
1011
- },
1012
- links: {
1013
- konnect: `${ze}/partials/{id}/links`,
1014
- kongManager: `${qe}/partials/{id}/links`
1015
- }
1016
- }, Os = (e) => {
1017
- const { partialId: t, config: n, defaultRedisType: o = $e } = e, i = !!t, { axiosInstance: a } = St(n.axiosRequestConfig), { getMessageFromError: u } = bn(), c = H(() => t ? lt.Edit : lt.Create), l = un({
1018
- fields: {
1019
- name: "",
1020
- tags: "",
1021
- type: Xe(o),
1022
- config: JSON.parse(JSON.stringify(ti))
1023
- },
1024
- readonly: !1,
1025
- errorMessage: ""
1026
- }), d = $(), b = $(o), T = H(() => b.value === w.HOST_PORT_EE || b.value === w.CLUSTER || b.value === w.SENTINEL);
1027
- Te(b, (m) => {
1028
- l.fields.type = Xe(m);
1029
- });
1030
- const y = H(() => {
1031
- var _, I;
1032
- if (i && ms(d.value, h.value) || !((_ = l.fields.name) != null && _.length))
1033
- return !1;
1034
- const { config: m } = l.fields;
1035
- switch (b.value) {
1036
- case w.HOST_PORT_CE:
1037
- case w.HOST_PORT_EE:
1038
- return !!m.host && m.host.length > 0 && !!m.port && m.port > 0;
1039
- case w.CLUSTER:
1040
- return !!m.cluster_nodes.length && m.cluster_nodes.every((P) => P.ip.length > 0);
1041
- case w.SENTINEL:
1042
- return !!m.sentinel_nodes.length && m.sentinel_nodes.every((P) => P.host.length > 0) && !!((I = m.sentinel_master) != null && I.length) && m.sentinel_role && !!m.sentinel_role.length;
1043
- default:
1044
- throw new Error("Invalid redis type");
1045
- }
1046
- }), h = H(() => {
1047
- switch (b.value) {
1048
- case w.HOST_PORT_CE:
1049
- return {
1050
- name: l.fields.name,
1051
- type: l.fields.type,
1052
- tags: E.stringToArray(l.fields.tags),
1053
- config: {
1054
- host: l.fields.config.host,
1055
- port: E.int(l.fields.config.port),
1056
- timeout: E.int(l.fields.config.timeout),
1057
- username: E.str(l.fields.config.username, null),
1058
- database: E.int(l.fields.config.database),
1059
- password: E.str(l.fields.config.password, null),
1060
- ssl: l.fields.config.ssl,
1061
- ssl_verify: l.fields.config.ssl_verify,
1062
- server_name: E.str(l.fields.config.server_name, null)
1063
- }
1064
- };
1065
- case w.HOST_PORT_EE:
1066
- return {
1067
- name: l.fields.name,
1068
- type: l.fields.type,
1069
- tags: E.stringToArray(l.fields.tags),
1070
- config: {
1071
- connect_timeout: E.int(l.fields.config.connect_timeout),
1072
- connection_is_proxied: l.fields.config.connection_is_proxied,
1073
- database: E.int(l.fields.config.database),
1074
- host: l.fields.config.host,
1075
- keepalive_backlog: E.int(l.fields.config.keepalive_backlog),
1076
- keepalive_pool_size: E.int(l.fields.config.keepalive_pool_size),
1077
- password: E.str(l.fields.config.password, null),
1078
- port: E.int(l.fields.config.port),
1079
- read_timeout: E.int(l.fields.config.read_timeout),
1080
- send_timeout: E.int(l.fields.config.send_timeout),
1081
- server_name: E.str(l.fields.config.server_name, null),
1082
- ssl_verify: l.fields.config.ssl_verify,
1083
- ssl: l.fields.config.ssl,
1084
- username: E.str(l.fields.config.username, null),
1085
- // reset other EE fields
1086
- cluster_nodes: null,
1087
- cluster_max_redirections: null,
1088
- sentinel_master: null,
1089
- sentinel_role: null,
1090
- sentinel_nodes: null,
1091
- sentinel_username: null,
1092
- sentinel_password: null
1093
- }
1094
- };
1095
- case w.CLUSTER:
1096
- return {
1097
- name: l.fields.name,
1098
- type: l.fields.type,
1099
- tags: E.stringToArray(l.fields.tags),
1100
- config: {
1101
- cluster_nodes: E.removeIdClusterNodes(l.fields.config.cluster_nodes),
1102
- cluster_max_redirections: E.int(l.fields.config.cluster_max_redirections),
1103
- username: E.str(l.fields.config.username, null),
1104
- password: E.str(l.fields.config.password, null),
1105
- ssl: l.fields.config.ssl,
1106
- ssl_verify: l.fields.config.ssl_verify,
1107
- server_name: E.str(l.fields.config.server_name, null),
1108
- connect_timeout: E.int(l.fields.config.connect_timeout),
1109
- database: E.int(l.fields.config.database),
1110
- send_timeout: E.int(l.fields.config.send_timeout),
1111
- read_timeout: E.int(l.fields.config.read_timeout),
1112
- keepalive_pool_size: E.int(l.fields.config.keepalive_pool_size),
1113
- keepalive_backlog: E.int(l.fields.config.keepalive_backlog),
1114
- // reset other EE fields
1115
- connection_is_proxied: null,
1116
- sentinel_master: null,
1117
- sentinel_role: null,
1118
- sentinel_nodes: null,
1119
- sentinel_username: null,
1120
- sentinel_password: null,
1121
- host: null,
1122
- port: null
1123
- }
1124
- };
1125
- case w.SENTINEL:
1126
- return {
1127
- name: l.fields.name,
1128
- type: l.fields.type,
1129
- tags: E.stringToArray(l.fields.tags),
1130
- config: {
1131
- sentinel_master: E.str(l.fields.config.sentinel_master, null),
1132
- sentinel_nodes: E.removeIdFromSentinelNodes(l.fields.config.sentinel_nodes),
1133
- sentinel_role: E.str(l.fields.config.sentinel_role, null),
1134
- sentinel_username: E.str(l.fields.config.sentinel_username, null),
1135
- sentinel_password: E.str(l.fields.config.sentinel_password, null),
1136
- username: E.str(l.fields.config.username, null),
1137
- password: E.str(l.fields.config.password, null),
1138
- ssl: l.fields.config.ssl,
1139
- ssl_verify: l.fields.config.ssl_verify,
1140
- server_name: E.str(l.fields.config.server_name, null),
1141
- database: E.int(l.fields.config.database),
1142
- connect_timeout: E.int(l.fields.config.connect_timeout),
1143
- send_timeout: E.int(l.fields.config.send_timeout),
1144
- read_timeout: E.int(l.fields.config.read_timeout),
1145
- keepalive_pool_size: E.int(l.fields.config.keepalive_pool_size),
1146
- keepalive_backlog: E.int(l.fields.config.keepalive_backlog),
1147
- // reset other EE fields
1148
- connection_is_proxied: null,
1149
- cluster_nodes: null,
1150
- cluster_max_redirections: null,
1151
- host: null,
1152
- port: null
1153
- }
1154
- };
1155
- default:
1156
- throw new Error("Invalid redis type");
1157
- }
1158
- }), p = H(() => {
1159
- let m = `${n.apiBaseUrl}${ke.form[n.app][c.value]}`;
1160
- return n.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, (n == null ? void 0 : n.controlPlaneId) || "") : n.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, n != null && n.workspace ? `/${n.workspace}` : "")), m = m.replace(/{id}/gi, t || ""), m;
1161
- }), C = H(() => {
1162
- var m;
1163
- return (m = ke.form[n == null ? void 0 : n.app]) == null ? void 0 : m.edit;
1164
- });
1165
- return {
1166
- form: l,
1167
- canSubmit: y,
1168
- payload: h,
1169
- isEdit: i,
1170
- redisType: b,
1171
- redisTypeIsEnterprise: T,
1172
- formType: c,
1173
- fetchUrl: C,
1174
- submit: async () => {
1175
- try {
1176
- l.readonly = !0, l.errorMessage = "";
1177
- let m = h.value;
1178
- return n.app === "konnect" && (m = {
1179
- ...m,
1180
- config: E.removeNullValues(m.config)
1181
- }), c.value === lt.Create ? await a.post(p.value, m) : n.app === "konnect" ? await a.put(p.value, m) : await a.patch(p.value, m);
1182
- } catch (m) {
1183
- throw l.errorMessage = u(m), l.readonly = !1, m;
1184
- }
1185
- },
1186
- setInitialFormValues: (m) => {
1187
- l.fields.config = Object.assign(
1188
- {},
1189
- l.fields.config,
1190
- E.removeNullValues(m.config)
1191
- // remove null values if data, so they can be replaced with default values
1192
- ), l.fields.config.sentinel_nodes = E.addIdToSentinelNodes(m.config.sentinel_nodes ?? []), l.fields.config.cluster_nodes = E.addIdToClusterNodes(m.config.cluster_nodes ?? []), l.fields.name = m.name, l.fields.type = m.type, l.fields.tags = E.arrayToString(m.tags), b.value = Ue(m), d.value = JSON.parse(JSON.stringify(h.value));
1193
- }
1194
- };
1195
- }, Is = { class: "array-card-container" }, xs = /* @__PURE__ */ Q({
1196
- __name: "FieldArrayCardContainer",
1197
- props: {
1198
- model: {
1199
- type: Object,
1200
- default: () => null
1201
- },
1202
- schema: {
1203
- type: Object,
1204
- default: () => null
1205
- },
1206
- index: {
1207
- type: Number,
1208
- default: void 0
1209
- },
1210
- disabled: {
1211
- type: Boolean,
1212
- default: !1
1213
- }
1214
- },
1215
- emits: ["remove-item"],
1216
- setup(e) {
1217
- return (t, n) => {
1218
- const o = j("KCard"), i = j("KButton");
1219
- return R(), J("div", Is, [
1220
- g(o, { class: "card" }, {
1221
- default: S(() => [
1222
- fi(t.$slots, "default", {}, void 0, !0)
1223
- ]),
1224
- _: 3
1225
- }),
1226
- g(i, {
1227
- appearance: "tertiary",
1228
- class: "array-card-remove-button",
1229
- disabled: e.disabled,
1230
- onClick: n[0] || (n[0] = (a) => t.$emit("remove-item"))
1231
- }, {
1232
- default: S(() => [
1233
- g(r(Ai))
1234
- ]),
1235
- _: 1
1236
- }, 8, ["disabled"])
1237
- ]);
1238
- };
1239
- }
1240
- }), ie = (e, t) => {
1241
- const n = e.__vccOpts || e;
1242
- for (const [o, i] of t)
1243
- n[o] = i;
1244
- return n;
1245
- }, ri = /* @__PURE__ */ ie(xs, [["__scopeId", "data-v-a0b2e4fb"]]), Rs = {
1246
- create: "New Redis Configuration",
1247
- copy_id: "Copy ID",
1248
- copy_json: "Copy JSON",
1249
- edit: "Edit",
1250
- delete: "Delete",
1251
- done: "Done",
1252
- view: "View Details",
1253
- loading: "Loading...",
1254
- view_plugin: "View Plugin",
1255
- close: "Close"
1256
- }, $s = {
1257
- placeholder: "Filter by name",
1258
- placeholder_for_exact_match: "Filter by exact ID",
1259
- no_results: "No results found"
1260
- }, Ps = {
1261
- placeholder: "Select a Redis configuration",
1262
- empty_state: "No Redis configurations available",
1263
- create_new: "Create new Redis configuration"
1264
- }, ks = {
1265
- copy: "Failed to copy to clipboard",
1266
- general: "Redis configuration could not be retrieved",
1267
- delete: "The redis configuration could not be deleted at this time."
1268
- }, As = {
1269
- success: "Copied {val} to clipboard"
1270
- }, Vs = {
1271
- redis_partial_modal_title: "Create Redis Configuration",
1272
- partial_created_success_message: "Redis configuration created successfully",
1273
- sections: {
1274
- type: {
1275
- title: "Redis type",
1276
- description: "Both Enterprise and Open Source plugins support Redis. Enterprise plugins can connect to a standalone Redis instance (host/port), Cluster, or Sentinel, while Open Source plugins support only a simplified host/port configuration."
1277
- },
1278
- general: {
1279
- title: "General information",
1280
- description: "Name your Redis configuration."
1281
- },
1282
- connection: {
1283
- title: "Connection settings",
1284
- description: "Define the Redis server’s host, port, authentication, and timeout options for establishing a connection."
1285
- },
1286
- cluster: {
1287
- title: "Cluster configuration",
1288
- description: "Enables data sharding and distribution across multiple Redis nodes, allowing for scalability and load balancing."
1289
- },
1290
- tls: {
1291
- title: "TLS settings",
1292
- description: "Configure secure connections to Redis, including SSL and verification options."
1293
- },
1294
- keepalive: {
1295
- title: "Keepalive configuration",
1296
- description: "Keepalive reuses active connections to Redis, improving performance and efficiency."
1297
- },
1298
- read_write_configuration: {
1299
- title: "Read/Write configuration",
1300
- description: "Set timeouts for reading from and writing to the Redis server to control data transmission reliability."
1301
- },
1302
- sentinel_configuration: {
1303
- title: "Sentinel configuration",
1304
- description: "Manages Redis failover and high availability by connecting to Sentinel nodes that monitor and switch masters."
1305
- }
1306
- },
1307
- fields: {
1308
- type: {
1309
- label: "Redis type"
1310
- },
1311
- name: {
1312
- label: "Name",
1313
- placeholder: "Enter unique name"
1314
- },
1315
- tags: {
1316
- label: "Tags",
1317
- placeholder: "Enter a list of tags separated by comma",
1318
- help: "e.g. tag1, tag2, tag3",
1319
- tooltip: "An optional set of strings associated with the Route for grouping and filtering."
1320
- },
1321
- host: {
1322
- label: "Host",
1323
- tooltip: "A string representing a host name, such as example.com."
1324
- },
1325
- port: {
1326
- label: "Port",
1327
- tooltip: "An integer representing a port number between 0 and 65535, inclusive."
1328
- },
1329
- database: {
1330
- label: "Database",
1331
- tooltip: "Database to use for the Redis connection."
1332
- },
1333
- password: {
1334
- label: "Password",
1335
- tooltip: "Password to use for Redis connections. If undefined, no AUTH commands are sent to Redis."
1336
- },
1337
- username: {
1338
- label: "Username",
1339
- tooltip: "Username to use for Redis connections. If undefined, ACL authentication won't be performed. This requires Redis v6.0.0+. To be compatible with Redis v5.x.y, you can set it to `default`."
1340
- },
1341
- ssl: {
1342
- label: "SSL",
1343
- description: "If set to true, uses SSL to connect to Redis.",
1344
- tooltip: "If set to true, uses SSL to connect to Redis."
1345
- },
1346
- ssl_verify: {
1347
- label: "SSL Verify",
1348
- description: "If set to true, verifies the validity of the server SSL certificate. If setting this parameter, also configure lua_ssl_trusted_certificate in kong. conf to specify the CA (or server) certificate used by your Redis server. You may also need to configure lua_ss1_verify_depth accordingly.",
1349
- tooltip: "If set to true, verifies the validity of the server SSL certificate. If setting this parameter, also configure lua_ssl_trusted_certificate in kong.conf to specify the CA (or server) certificate used by your Redis server. You may also need to configure lua_ssl_verify_depth accordingly."
1350
- },
1351
- server_name: {
1352
- label: "Server name",
1353
- tooltip: "A string representing an SNI (server name indication) value for TLS."
1354
- },
1355
- keepalive_backlog: {
1356
- label: "Keepalive backlog",
1357
- tooltip: "Limits the total number of opened connections for a pool. If the connection pool is full, connection queues above the limit go into the backlog queue. If the backlog queue is full, subsequent connect operations fail and return `nil`. Queued operations (subject to set timeouts) resume once the number of connections in the pool is less than `keepalive_pool_size`. If latency is high or throughput is low, try increasing this value. Empirically, this value is larger than `keepalive_pool_size`."
1358
- },
1359
- keepalive_pool_size: {
1360
- label: "Keepalive pool size",
1361
- tooltip: "The size limit for every cosocket connection pool associated with every remote server, per worker process. If neither `keepalive_pool_size` nor `keepalive_backlog` is specified, no pool is created. If `keepalive_pool_size` isn't specified but `keepalive_backlog` is specified, then the pool uses the default value. Try to increase (e.g. 512) this value if latency is high or throughput is low."
1362
- },
1363
- read_timeout: {
1364
- label: "Read timeout",
1365
- tooltip: "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2."
1366
- },
1367
- send_timeout: {
1368
- label: "Send timeout",
1369
- tooltip: "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2."
1370
- },
1371
- connect_timeout: {
1372
- label: "Connect timeout",
1373
- tooltip: "An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2."
1374
- },
1375
- sentinel_master: {
1376
- label: "Sentinel master",
1377
- tooltip: "Sentinel master to use for Redis connections. Defining this value implies using Redis Sentinel."
1378
- },
1379
- sentinel_role: {
1380
- label: "Sentinel role",
1381
- tooltip: "Sentinel role to use for Redis connections when the `redis` strategy is defined. Defining this value implies using Redis Sentinel."
1382
- },
1383
- sentinel_username: {
1384
- label: "Sentinel username",
1385
- tooltip: "Sentinel username to authenticate with a Redis Sentinel instance. If undefined, ACL authentication won't be performed. This requires Redis v6.2.0+."
1386
- },
1387
- sentinel_password: {
1388
- label: "Sentinel password",
1389
- tooltip: "Sentinel password to authenticate with a Redis Sentinel instance. If undefined, no AUTH commands are sent to Redis Sentinels."
1390
- },
1391
- cluster_node_ip: {
1392
- label: "IP",
1393
- tooltip: "A string representing a host name, such as example.com."
1394
- },
1395
- cluster_node_port: {
1396
- label: "Port",
1397
- tooltip: "An integer representing a port number between 0 and 65535, inclusive."
1398
- },
1399
- cluster_max_redirections: {
1400
- label: "Cluster max redirections",
1401
- tooltip: "Maximum retry attempts for redirection."
1402
- },
1403
- timeout: {
1404
- label: "Timeout",
1405
- tooltip: "redis schema field `timeout` is deprecated, use `connect_timeout`, `send_timeout` and `read_timeout`"
1406
- },
1407
- connection_is_proxied: {
1408
- label: "Connection is proxied",
1409
- tooltip: "If the connection to Redis is proxied (e.g. Envoy), set it `true`. Set the `host` and `port` to point to the proxy address."
1410
- },
1411
- cluster_nodes: {
1412
- title: "Cluster nodes",
1413
- tooltip: "Cluster addresses to use for Redis connections when the `redis` strategy is defined. Defining this field implies using a Redis Cluster. The minimum length of the array is 1 element.",
1414
- add_button: "New item"
1415
- },
1416
- sentinel_nodes: {
1417
- title: "Sentinel nodes",
1418
- tooltip: "Sentinel node addresses to use for Redis connections when the `redis` strategy is defined. Defining this field implies using a Redis Sentinel. The minimum length of the array is 1 element.",
1419
- add_button: "New item"
1420
- },
1421
- sentinel_node_host: {
1422
- label: "Host",
1423
- tooltip: "A string representing a host name, such as example.com."
1424
- },
1425
- sentinel_node_port: {
1426
- label: "Port",
1427
- tooltip: "An integer representing a port number between 0 and 65535, inclusive."
1428
- }
1429
- },
1430
- options: {
1431
- type: {
1432
- host_port: "Host/Port",
1433
- cluster: "Cluster",
1434
- sentinel: "Sentinel",
1435
- open_source: "Open Source",
1436
- enterprise: "Enterprise",
1437
- suffix_open_source: " (Open Source)",
1438
- suffix_enterprise: " (Enterprise)"
1439
- },
1440
- sentinel_role: {
1441
- master: "master",
1442
- slave: "slave",
1443
- any: "any"
1444
- }
1445
- },
1446
- edit_warning_modal: {
1447
- title: "Edit Redis configuration",
1448
- description: "This Redis configuration is connected to {pluginCount}. Any updates will take effect across all associated instances.",
1449
- plugin_count: "{count} plugin(s)",
1450
- confirm: "Confirm"
1451
- }
1452
- }, Ms = {
1453
- title: "Associated plugins ({count})",
1454
- headers: {
1455
- plugin: "Plugin",
1456
- instance_name: "Name"
1457
- }
1458
- }, Ls = {
1459
- title: "Redis Configurations",
1460
- empty_state: {
1461
- title: "Configure a Redis Configuration",
1462
- description: "Set up shared Redis configurations for your gateway plugins to store and retrieve data — like counters or other data — needed during request processing."
1463
- }
1464
- }, Ds = {
1465
- action: "New configuration",
1466
- table_headers: {
1467
- name: "Name",
1468
- type: "Type",
1469
- plugins: "Plugins",
1470
- tags: "Tags"
1471
- },
1472
- empty_state: {
1473
- description: "Set up shared Redis configurations for your gateway plugins to store and retrieve data — like counters or other data — needed during request processing.",
1474
- feature_1: {
1475
- title: "Store your Redis configurations",
1476
- description: "Define a Redis configuration once and use it across multiple plugins."
1477
- },
1478
- feature_2: {
1479
- title: "Sync across plugins",
1480
- description: "Edits to your configuration will be cascaded automatically to all associated plugins."
1481
- }
1482
- }
1483
- }, js = {
1484
- actions: Rs,
1485
- search: $s,
1486
- selector: Ps,
1487
- delete: {
1488
- title: "Delete Redis configuration",
1489
- description: "You’re about to delete this item. Are you sure you want to proceed?",
1490
- warning: "To delete this configuration, first remove it from all associated plugins."
1491
- },
1492
- errors: ks,
1493
- copy: As,
1494
- form: Vs,
1495
- linked_plugins_modal: Ms,
1496
- redis: Ls,
1497
- list: Ds
1498
- };
1499
- function it() {
1500
- const e = Di("en-us", js);
1501
- return {
1502
- i18n: e,
1503
- i18nT: ji(e)
1504
- // Translation component <i18n-t>
1505
- };
1506
- }
1507
- const be = {
1508
- useI18n: it
1509
- }, Us = { class: "cluster-node-items" }, Ns = /* @__PURE__ */ Q({
1510
- __name: "ClusterNodes",
1511
- props: /* @__PURE__ */ cn({
1512
- readonly: { type: Boolean }
1513
- }, {
1514
- modelValue: { required: !0 },
1515
- modelModifiers: {}
1516
- }),
1517
- emits: ["update:modelValue"],
1518
- setup(e) {
1519
- const t = fn(e, "modelValue"), { i18n: { t: n } } = be.useI18n(), o = () => {
1520
- t.value.push(ii());
1521
- }, i = (a) => {
1522
- t.value.splice(a, 1);
1523
- };
1524
- return (a, u) => {
1525
- const c = j("KLabel"), l = j("KInput"), d = j("KButton");
1526
- return R(), J("div", null, [
1527
- g(c, {
1528
- class: "required",
1529
- info: r(n)("form.fields.cluster_nodes.tooltip"),
1530
- "tooltip-attributes": { maxWidth: "400" }
1531
- }, {
1532
- default: S(() => [
1533
- ne(N(r(n)("form.fields.cluster_nodes.title")), 1)
1534
- ]),
1535
- _: 1
1536
- }, 8, ["info"]),
1537
- F("div", null, [
1538
- (R(!0), J(je, null, wt(t.value, (b, T) => (R(), q(ri, {
1539
- key: `${T}`,
1540
- "data-testid": "redis-cluster-nodes",
1541
- disabled: e.readonly,
1542
- onRemoveItem: (y) => i(T)
1543
- }, {
1544
- default: S(() => [
1545
- F("div", Us, [
1546
- g(l, {
1547
- modelValue: b.ip,
1548
- "onUpdate:modelValue": (y) => b.ip = y,
1549
- modelModifiers: { trim: !0 },
1550
- label: r(n)("form.fields.cluster_node_ip.label"),
1551
- "label-attributes": {
1552
- info: r(n)("form.fields.cluster_node_ip.tooltip"),
1553
- tooltipAttributes: { maxWidth: "400" }
1554
- },
1555
- name: "ip",
1556
- readonly: e.readonly,
1557
- required: ""
1558
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "label-attributes", "readonly"]),
1559
- g(l, {
1560
- modelValue: b.port,
1561
- "onUpdate:modelValue": (y) => b.port = y,
1562
- label: r(n)("form.fields.cluster_node_port.label"),
1563
- "label-attributes": {
1564
- info: r(n)("form.fields.cluster_node_port.tooltip"),
1565
- tooltipAttributes: { maxWidth: "400" }
1566
- },
1567
- name: "port",
1568
- readonly: e.readonly,
1569
- type: "number"
1570
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "label-attributes", "readonly"])
1571
- ])
1572
- ]),
1573
- _: 2
1574
- }, 1032, ["disabled", "onRemoveItem"]))), 128)),
1575
- g(d, {
1576
- appearance: "tertiary",
1577
- "data-testid": "redis-add-cluster-node-button",
1578
- disabled: e.readonly,
1579
- onClick: o
1580
- }, {
1581
- default: S(() => [
1582
- g(r(hn)),
1583
- F("span", null, N(r(n)("form.fields.cluster_nodes.add_button")), 1)
1584
- ]),
1585
- _: 1
1586
- }, 8, ["disabled"])
1587
- ])
1588
- ]);
1589
- };
1590
- }
1591
- }), Bs = /* @__PURE__ */ ie(Ns, [["__scopeId", "data-v-776a626d"]]), Fs = { class: "sentinel-node-items" }, Ks = /* @__PURE__ */ Q({
1592
- __name: "SentinelNodes",
1593
- props: /* @__PURE__ */ cn({
1594
- readonly: { type: Boolean }
1595
- }, {
1596
- modelValue: { required: !0 },
1597
- modelModifiers: {}
1598
- }),
1599
- emits: ["update:modelValue"],
1600
- setup(e) {
1601
- const t = fn(e, "modelValue"), { i18n: { t: n } } = be.useI18n(), o = () => {
1602
- t.value.push(ni());
1603
- }, i = (a) => {
1604
- t.value.splice(a, 1);
1605
- };
1606
- return (a, u) => {
1607
- const c = j("KLabel"), l = j("KInput"), d = j("KButton");
1608
- return R(), J("div", null, [
1609
- g(c, {
1610
- class: "required",
1611
- info: r(n)("form.fields.sentinel_nodes.tooltip"),
1612
- "tooltip-attributes": { maxWidth: "400" }
1613
- }, {
1614
- default: S(() => [
1615
- ne(N(r(n)("form.fields.sentinel_nodes.title")), 1)
1616
- ]),
1617
- _: 1
1618
- }, 8, ["info"]),
1619
- F("div", null, [
1620
- (R(!0), J(je, null, wt(t.value, (b, T) => (R(), q(ri, {
1621
- key: b.id,
1622
- "data-testid": "redis-sentinel-nodes",
1623
- disabled: e.readonly,
1624
- onRemoveItem: (y) => i(T)
1625
- }, {
1626
- default: S(() => [
1627
- F("div", Fs, [
1628
- g(l, {
1629
- modelValue: b.host,
1630
- "onUpdate:modelValue": (y) => b.host = y,
1631
- modelModifiers: { trim: !0 },
1632
- label: r(n)("form.fields.sentinel_node_host.label"),
1633
- "label-attributes": {
1634
- info: r(n)("form.fields.sentinel_node_host.tooltip"),
1635
- tooltipAttributes: { maxWidth: "400" }
1636
- },
1637
- name: "host",
1638
- readonly: e.readonly,
1639
- required: ""
1640
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "label-attributes", "readonly"]),
1641
- g(l, {
1642
- modelValue: b.port,
1643
- "onUpdate:modelValue": (y) => b.port = y,
1644
- label: r(n)("form.fields.sentinel_node_port.label"),
1645
- "label-attributes": {
1646
- info: r(n)("form.fields.sentinel_node_port.tooltip"),
1647
- tooltipAttributes: { maxWidth: "400" }
1648
- },
1649
- name: "port",
1650
- readonly: e.readonly,
1651
- type: "number"
1652
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "label-attributes", "readonly"])
1653
- ])
1654
- ]),
1655
- _: 2
1656
- }, 1032, ["disabled", "onRemoveItem"]))), 128)),
1657
- g(d, {
1658
- appearance: "tertiary",
1659
- "data-testid": "redis-add-sentinel-node-button",
1660
- disabled: e.readonly,
1661
- onClick: o
1662
- }, {
1663
- default: S(() => [
1664
- g(r(hn)),
1665
- F("span", null, N(r(n)("form.fields.sentinel_nodes.add_button")), 1)
1666
- ]),
1667
- _: 1
1668
- }, 8, ["disabled"])
1669
- ])
1670
- ]);
1671
- };
1672
- }
1673
- }), Hs = /* @__PURE__ */ ie(Ks, [["__scopeId", "data-v-cd1c07e2"]]);
1674
- var ft = /* @__PURE__ */ new WeakMap(), sn = 0;
1675
- function zs(e) {
1676
- if (!e.length)
1677
- return "";
1678
- for (var t = "arg", n = 0; n < e.length; ++n) {
1679
- var o = void 0;
1680
- e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? typeof e[n] == "string" ? o = '"' + e[n] + '"' : o = String(e[n]) : ft.has(e[n]) ? o = ft.get(e[n]) : (o = sn, ft.set(e[n], sn++)), t += "@" + o;
1681
- }
1682
- return t;
1683
- }
1684
- function qs(e) {
1685
- if (typeof e == "function")
1686
- try {
1687
- e = e();
1688
- } catch {
1689
- e = "";
1690
- }
1691
- return Array.isArray(e) ? e = zs(e) : e = String(e || ""), e;
1692
- }
1693
- var Pt = (
1694
- /** @class */
1695
- function() {
1696
- function e(t) {
1697
- t === void 0 && (t = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = t;
1698
- }
1699
- return e.prototype.serializeKey = function(t) {
1700
- return qs(t);
1701
- }, e.prototype.get = function(t) {
1702
- var n = this.serializeKey(t);
1703
- return this.items.get(n);
1704
- }, e.prototype.set = function(t, n, o) {
1705
- var i = this.serializeKey(t), a = o || this.ttl, u = Date.now(), c = {
1706
- data: n,
1707
- createdAt: u,
1708
- expiresAt: a ? u + a : 1 / 0
1709
- };
1710
- this.dispatchExpire(a, c, i), this.items.set(i, c);
1711
- }, e.prototype.dispatchExpire = function(t, n, o) {
1712
- var i = this;
1713
- t && setTimeout(function() {
1714
- var a = Date.now(), u = a >= n.expiresAt;
1715
- u && i.delete(o);
1716
- }, t);
1717
- }, e.prototype.delete = function(t) {
1718
- this.items.delete(t);
1719
- }, e;
1720
- }()
1721
- );
1722
- function Ws() {
1723
- return typeof navigator.onLine < "u" ? navigator.onLine : !0;
1724
- }
1725
- function Gs() {
1726
- return typeof document < "u" && typeof document.visibilityState < "u" ? document.visibilityState !== "hidden" : !0;
1727
- }
1728
- var Js = function(e) {
1729
- return fetch(e).then(function(t) {
1730
- return t.json();
1731
- });
1732
- };
1733
- const pt = {
1734
- isOnline: Ws,
1735
- isDocumentVisible: Gs,
1736
- fetcher: Js
1737
- };
1738
- var se = function() {
1739
- return se = Object.assign || function(e) {
1740
- for (var t, n = 1, o = arguments.length; n < o; n++) {
1741
- t = arguments[n];
1742
- for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
1743
- }
1744
- return e;
1745
- }, se.apply(this, arguments);
1746
- }, xe = function(e, t, n, o) {
1747
- function i(a) {
1748
- return a instanceof n ? a : new n(function(u) {
1749
- u(a);
1750
- });
1751
- }
1752
- return new (n || (n = Promise))(function(a, u) {
1753
- function c(b) {
1754
- try {
1755
- d(o.next(b));
1756
- } catch (T) {
1757
- u(T);
1758
- }
1759
- }
1760
- function l(b) {
1761
- try {
1762
- d(o.throw(b));
1763
- } catch (T) {
1764
- u(T);
1765
- }
1766
- }
1767
- function d(b) {
1768
- b.done ? a(b.value) : i(b.value).then(c, l);
1769
- }
1770
- d((o = o.apply(e, t || [])).next());
1771
- });
1772
- }, Re = function(e, t) {
1773
- var n = { label: 0, sent: function() {
1774
- if (a[0] & 1) throw a[1];
1775
- return a[1];
1776
- }, trys: [], ops: [] }, o, i, a, u;
1777
- return u = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
1778
- return this;
1779
- }), u;
1780
- function c(d) {
1781
- return function(b) {
1782
- return l([d, b]);
1783
- };
1784
- }
1785
- function l(d) {
1786
- if (o) throw new TypeError("Generator is already executing.");
1787
- for (; n; ) try {
1788
- if (o = 1, i && (a = d[0] & 2 ? i.return : d[0] ? i.throw || ((a = i.return) && a.call(i), 0) : i.next) && !(a = a.call(i, d[1])).done) return a;
1789
- switch (i = 0, a && (d = [d[0] & 2, a.value]), d[0]) {
1790
- case 0:
1791
- case 1:
1792
- a = d;
1793
- break;
1794
- case 4:
1795
- return n.label++, { value: d[1], done: !1 };
1796
- case 5:
1797
- n.label++, i = d[1], d = [0];
1798
- continue;
1799
- case 7:
1800
- d = n.ops.pop(), n.trys.pop();
1801
- continue;
1802
- default:
1803
- if (a = n.trys, !(a = a.length > 0 && a[a.length - 1]) && (d[0] === 6 || d[0] === 2)) {
1804
- n = 0;
1805
- continue;
1806
- }
1807
- if (d[0] === 3 && (!a || d[1] > a[0] && d[1] < a[3])) {
1808
- n.label = d[1];
1809
- break;
1810
- }
1811
- if (d[0] === 6 && n.label < a[1]) {
1812
- n.label = a[1], a = d;
1813
- break;
1814
- }
1815
- if (a && n.label < a[2]) {
1816
- n.label = a[2], n.ops.push(d);
1817
- break;
1818
- }
1819
- a[2] && n.ops.pop(), n.trys.pop();
1820
- continue;
1821
- }
1822
- d = t.call(e, n);
1823
- } catch (b) {
1824
- d = [6, b], i = 0;
1825
- } finally {
1826
- o = a = 0;
1827
- }
1828
- if (d[0] & 5) throw d[1];
1829
- return { value: d[0] ? d[1] : void 0, done: !0 };
1830
- }
1831
- }, Qs = function(e, t) {
1832
- var n = typeof Symbol == "function" && e[Symbol.iterator];
1833
- if (!n) return e;
1834
- var o = n.call(e), i, a = [], u;
1835
- try {
1836
- for (; (t === void 0 || t-- > 0) && !(i = o.next()).done; ) a.push(i.value);
1837
- } catch (c) {
1838
- u = { error: c };
1839
- } finally {
1840
- try {
1841
- i && !i.done && (n = o.return) && n.call(o);
1842
- } finally {
1843
- if (u) throw u.error;
1844
- }
1845
- }
1846
- return a;
1847
- }, Ys = function(e, t, n) {
1848
- if (n || arguments.length === 2) for (var o = 0, i = t.length, a; o < i; o++)
1849
- (a || !(o in t)) && (a || (a = Array.prototype.slice.call(t, 0, o)), a[o] = t[o]);
1850
- return e.concat(a || Array.prototype.slice.call(t));
1851
- }, oi = new Pt(), Ze = new Pt(), mt = new Pt(), ai = {
1852
- cache: oi,
1853
- refreshInterval: 0,
1854
- ttl: 0,
1855
- serverTTL: 1e3,
1856
- dedupingInterval: 2e3,
1857
- revalidateOnFocus: !0,
1858
- revalidateDebounce: 0,
1859
- shouldRetryOnError: !0,
1860
- errorRetryInterval: 5e3,
1861
- errorRetryCount: 5,
1862
- fetcher: pt.fetcher,
1863
- isOnline: pt.isOnline,
1864
- isDocumentVisible: pt.isDocumentVisible
1865
- };
1866
- function Xs(e, t, n) {
1867
- var o = Ze.get(e);
1868
- if (o)
1869
- o.data.push(t);
1870
- else {
1871
- var i = 5e3;
1872
- Ze.set(e, [t], n > 0 ? n + i : n);
1873
- }
1874
- }
1875
- function Zs(e, t, n) {
1876
- if (n.isDocumentVisible() && !(n.errorRetryCount !== void 0 && t > n.errorRetryCount)) {
1877
- var o = Math.min(t || 0, n.errorRetryCount), i = o * n.errorRetryInterval;
1878
- setTimeout(function() {
1879
- e(null, { errorRetryCount: o + 1, shouldRetryOnError: !0 });
1880
- }, i);
1881
- }
1882
- }
1883
- var dn = function(e, t, n, o) {
1884
- return n === void 0 && (n = oi), o === void 0 && (o = ai.ttl), xe(void 0, void 0, void 0, function() {
1885
- var i, a, u, c, l, d, b;
1886
- return Re(this, function(T) {
1887
- switch (T.label) {
1888
- case 0:
1889
- if (!td(t)) return [3, 5];
1890
- T.label = 1;
1891
- case 1:
1892
- return T.trys.push([1, 3, , 4]), [4, t];
1893
- case 2:
1894
- return i = T.sent(), [3, 4];
1895
- case 3:
1896
- return c = T.sent(), a = c, [3, 4];
1897
- case 4:
1898
- return [3, 6];
1899
- case 5:
1900
- i = t, T.label = 6;
1901
- case 6:
1902
- if (u = !1, l = { data: i, error: a, isValidating: u }, typeof i < "u")
1903
- try {
1904
- n.set(e, l, o);
1905
- } catch (y) {
1906
- console.error("swrv(mutate): failed to set cache", y);
1907
- }
1908
- return d = Ze.get(e), d && d.data.length && (b = d.data.filter(function(y) {
1909
- return y.key === e;
1910
- }), b.forEach(function(y, h) {
1911
- typeof l.data < "u" && (y.data = l.data), y.error = l.error, y.isValidating = l.isValidating, y.isLoading = l.isValidating;
1912
- var p = h === b.length - 1;
1913
- p || delete b[h];
1914
- }), b = b.filter(Boolean)), [2, l];
1915
- }
1916
- });
1917
- });
1918
- };
1919
- function ed() {
1920
- for (var e = this, t = [], n = 0; n < arguments.length; n++)
1921
- t[n] = arguments[n];
1922
- var o, i, a = se({}, ai), u = !1, c = !1, l = pi(), d = (l == null ? void 0 : l.proxy) || l;
1923
- if (!d)
1924
- return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."), null;
1925
- var b = (d == null ? void 0 : d.$isServer) || !1;
1926
- t.length >= 1 && (o = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = se(se({}, a), t[2]));
1927
- var T = b ? a.serverTTL : a.ttl, y = typeof o == "function" ? o : $(o);
1928
- typeof i > "u" && (i = a.fetcher);
1929
- var h = null;
1930
- h || (h = un({
1931
- data: void 0,
1932
- error: void 0,
1933
- isValidating: !0,
1934
- isLoading: !0,
1935
- key: null
1936
- }));
1937
- var p = function(m, _) {
1938
- return xe(e, void 0, void 0, function() {
1939
- var I, P, W, re, ye, le, X, _e = this;
1940
- return Re(this, function(Z) {
1941
- switch (Z.label) {
1942
- case 0:
1943
- return I = h.data === void 0, P = y.value, P ? (W = a.cache.get(P), re = W && W.data, h.isValidating = !0, h.isLoading = !re, re && (h.data = re.data, h.error = re.error), ye = m || i, !ye || !a.isDocumentVisible() && !I || (_ == null ? void 0 : _.forceRevalidate) !== void 0 && !(_ != null && _.forceRevalidate) ? (h.isValidating = !1, h.isLoading = !1, [
1944
- 2
1945
- /*return*/
1946
- ]) : W && (le = !!(Date.now() - W.createdAt >= a.dedupingInterval || _ != null && _.forceRevalidate), !le) ? (h.isValidating = !1, h.isLoading = !1, [
1947
- 2
1948
- /*return*/
1949
- ]) : (X = function() {
1950
- return xe(_e, void 0, void 0, function() {
1951
- var ee, ve, he, Oe;
1952
- return Re(this, function(me) {
1953
- switch (me.label) {
1954
- case 0:
1955
- return ee = mt.get(P), ee ? [3, 2] : (ve = Array.isArray(P) ? P : [P], he = ye.apply(void 0, Ys([], Qs(ve), !1)), mt.set(P, he, a.dedupingInterval), [4, dn(P, he, a.cache, T)]);
1956
- case 1:
1957
- return me.sent(), [3, 4];
1958
- case 2:
1959
- return [4, dn(P, ee.data, a.cache, T)];
1960
- case 3:
1961
- me.sent(), me.label = 4;
1962
- case 4:
1963
- return h.isValidating = !1, h.isLoading = !1, mt.delete(P), h.error !== void 0 && (Oe = !u && a.shouldRetryOnError && (_ ? _.shouldRetryOnError : !0), Oe && Zs(p, _ ? _.errorRetryCount : 1, a)), [
1964
- 2
1965
- /*return*/
1966
- ];
1967
- }
1968
- });
1969
- });
1970
- }, re && a.revalidateDebounce ? (setTimeout(function() {
1971
- return xe(_e, void 0, void 0, function() {
1972
- return Re(this, function(ee) {
1973
- switch (ee.label) {
1974
- case 0:
1975
- return u ? [3, 2] : [4, X()];
1976
- case 1:
1977
- ee.sent(), ee.label = 2;
1978
- case 2:
1979
- return [
1980
- 2
1981
- /*return*/
1982
- ];
1983
- }
1984
- });
1985
- });
1986
- }, a.revalidateDebounce), [3, 3]) : [3, 1])) : [
1987
- 2
1988
- /*return*/
1989
- ];
1990
- case 1:
1991
- return [4, X()];
1992
- case 2:
1993
- Z.sent(), Z.label = 3;
1994
- case 3:
1995
- return [
1996
- 2
1997
- /*return*/
1998
- ];
1999
- }
2000
- });
2001
- });
2002
- }, C = function() {
2003
- return xe(e, void 0, void 0, function() {
2004
- return Re(this, function(m) {
2005
- return [2, p(null, { shouldRetryOnError: !1 })];
2006
- });
2007
- });
2008
- }, s = null;
2009
- mi(function() {
2010
- var m = function() {
2011
- return xe(e, void 0, void 0, function() {
2012
- return Re(this, function(_) {
2013
- switch (_.label) {
2014
- case 0:
2015
- return !h.error && a.isOnline() ? [4, p()] : [3, 2];
2016
- case 1:
2017
- return _.sent(), [3, 3];
2018
- case 2:
2019
- s && clearTimeout(s), _.label = 3;
2020
- case 3:
2021
- return a.refreshInterval && !u && (s = setTimeout(m, a.refreshInterval)), [
2022
- 2
2023
- /*return*/
2024
- ];
2025
- }
2026
- });
2027
- });
2028
- };
2029
- a.refreshInterval && (s = setTimeout(m, a.refreshInterval)), a.revalidateOnFocus && (document.addEventListener("visibilitychange", C, !1), window.addEventListener("focus", C, !1));
2030
- }), gi(function() {
2031
- u = !0, s && clearTimeout(s), a.revalidateOnFocus && (document.removeEventListener("visibilitychange", C, !1), window.removeEventListener("focus", C, !1));
2032
- var m = Ze.get(y.value);
2033
- m && (m.data = m.data.filter(function(_) {
2034
- return _ !== h;
2035
- }));
2036
- });
2037
- try {
2038
- Te(y, function(m) {
2039
- bi(y) || (y.value = m), h.key = m, h.isValidating = !!m, Xs(y.value, h, T), !b && !c && y.value && p(), c = !1;
2040
- }, {
2041
- immediate: !0
2042
- });
2043
- } catch {
2044
- }
2045
- var k = se(se({}, yi(h)), { mutate: function(m, _) {
2046
- return p(m, se(se({}, _), { forceRevalidate: !0 }));
2047
- } });
2048
- return k;
2049
- }
2050
- function td(e) {
2051
- return e !== null && typeof e == "object" && typeof e.then == "function";
2052
- }
2053
- function li(e) {
2054
- return `redis-partial-links-${e}`;
2055
- }
2056
- const Ne = (e) => {
2057
- const { axiosInstance: t } = St(e.axiosRequestConfig);
2058
- return {
2059
- fetcher: async (n) => {
2060
- const { partialId: o, size: i, offset: a, query: u } = n;
2061
- let c = `${e.apiBaseUrl}${ke.links[e.app]}`;
2062
- e.app === "konnect" ? c = c.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" && (c = c.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "")), c = c.replace(/{id}/gi, o || ""), u && (c = `${c}?${u}`);
2063
- const { data: l } = await t.get(
2064
- c,
2065
- { params: { size: i, offset: a } }
2066
- );
2067
- return l;
2068
- }
2069
- };
2070
- }, si = (e) => {
2071
- const { partialId: t, config: n } = e, { fetcher: o } = Ne(n), i = $([]), { data: a } = ed(
2072
- li(t),
2073
- () => o({ partialId: t }),
2074
- {
2075
- revalidateOnFocus: !1
2076
- }
2077
- );
2078
- return Te(a, () => {
2079
- var u;
2080
- i.value = ((u = a.value) == null ? void 0 : u.data) ?? [];
2081
- }), i;
2082
- }, nd = { class: "kong-ui-entities-redis-configurations-form" }, id = /* @__PURE__ */ Q({
2083
- __name: "RedisConfigurationForm",
2084
- props: {
2085
- config: {
2086
- type: Object,
2087
- required: !0,
2088
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || (e == null ? void 0 : e.app) === "konnect" && !(e != null && e.controlPlaneId) || (e == null ? void 0 : e.app) === "kongManager" && typeof (e == null ? void 0 : e.workspace) != "string")
2089
- },
2090
- /** If a valid partialId is provided, it will put the form in Edit mode instead of Create */
2091
- partialId: {
2092
- type: String,
2093
- required: !1,
2094
- default: ""
2095
- },
2096
- /**
2097
- * Teleport target for the actions
2098
- */
2099
- actionTeleportTarget: {
2100
- type: String,
2101
- default: null
2102
- },
2103
- /**
2104
- * Top offset for the slideout
2105
- */
2106
- slidoutTopOffset: {
2107
- type: Number,
2108
- default: 60
2109
- },
2110
- /**
2111
- * Set disabled partial type, only for create mode
2112
- */
2113
- disabledPartialType: {
2114
- type: String,
2115
- default: ""
2116
- }
2117
- },
2118
- emits: ["update", "error", "loading", "cancel"],
2119
- setup(e, { emit: t }) {
2120
- const n = e, o = t, { i18n: { t: i }, i18nT: a } = be.useI18n(), u = vn(), c = $(), l = $(), d = $("json"), b = (U, v) => {
2121
- c.value = U ?? "", l.value = v;
2122
- }, T = (U) => {
2123
- var v;
2124
- (v = l.value) == null || v.call(l, U), c.value = !1;
2125
- }, y = H(() => [
2126
- {
2127
- label: i("form.options.type.host_port"),
2128
- group: i("form.options.type.enterprise"),
2129
- value: w.HOST_PORT_EE,
2130
- selected: I.value === w.HOST_PORT_EE,
2131
- disabled: !_ && n.disabledPartialType === G.REDIS_EE
2132
- },
2133
- {
2134
- label: i("form.options.type.cluster"),
2135
- group: i("form.options.type.enterprise"),
2136
- value: w.CLUSTER,
2137
- selected: I.value === w.CLUSTER,
2138
- disabled: !_ && n.disabledPartialType === G.REDIS_EE
2139
- },
2140
- {
2141
- label: i("form.options.type.sentinel"),
2142
- group: i("form.options.type.enterprise"),
2143
- value: w.SENTINEL,
2144
- selected: I.value === w.SENTINEL,
2145
- disabled: !_ && n.disabledPartialType === G.REDIS_EE
2146
- },
2147
- {
2148
- label: i("form.options.type.host_port"),
2149
- group: i("form.options.type.open_source"),
2150
- value: w.HOST_PORT_CE,
2151
- selected: I.value === w.HOST_PORT_CE,
2152
- disabled: _ && P.value || !_ && n.disabledPartialType === G.REDIS_CE
2153
- }
2154
- ]), h = [
2155
- { label: i("form.options.sentinel_role.master"), value: "master" },
2156
- { label: i("form.options.sentinel_role.slave"), value: "slave" },
2157
- { label: i("form.options.sentinel_role.any"), value: "any" }
2158
- ], p = (U) => {
2159
- const v = U.value === w.HOST_PORT_CE ? i("form.options.type.suffix_open_source") : i("form.options.type.suffix_enterprise");
2160
- return `${U.label}${v}`;
2161
- }, C = () => n.disabledPartialType && Xe($e) === n.disabledPartialType ? n.disabledPartialType === G.REDIS_CE ? w.HOST_PORT_EE : w.HOST_PORT_CE : $e, {
2162
- form: s,
2163
- canSubmit: k,
2164
- payload: m,
2165
- isEdit: _,
2166
- redisType: I,
2167
- redisTypeIsEnterprise: P,
2168
- fetchUrl: W,
2169
- submit: re,
2170
- setInitialFormValues: ye
2171
- } = Os({
2172
- partialId: n.partialId,
2173
- defaultRedisType: C(),
2174
- config: n.config
2175
- }), { fetcher: le } = Ne(n.config), X = $(!1), _e = $(!1), Z = $(0), ee = H(() => d.value === "terraform" ? {
2176
- [m.value.type.replaceAll("-", "_")]: hs(m.value, ["type"])
2177
- } : m.value), ve = async () => {
2178
- try {
2179
- if (_ && !_e.value) {
2180
- const { count: v } = await le({ partialId: n.partialId });
2181
- if (Z.value = v, v > 0) {
2182
- X.value = !0;
2183
- return;
2184
- }
2185
- }
2186
- const { data: U } = await re();
2187
- o("update", U);
2188
- } catch (U) {
2189
- o("error", U);
2190
- }
2191
- }, he = () => {
2192
- X.value = !1, _e.value = !0, ve();
2193
- }, Oe = () => {
2194
- n.config.cancelRoute && u.push(n.config.cancelRoute), o("cancel");
2195
- }, me = (U) => {
2196
- o("loading", U);
2197
- }, rt = (U) => {
2198
- o("error", U);
2199
- }, Be = (U) => {
2200
- ye(U);
2201
- };
2202
- return pn(async () => {
2203
- if (_) {
2204
- const { count: U } = await le({ partialId: n.partialId });
2205
- Z.value = U;
2206
- }
2207
- }), (U, v) => {
2208
- const ot = j("KAlert"), Ie = j("KSelect"), B = j("KInput"), O = j("KCheckbox"), x = j("KModal");
2209
- return R(), J(je, null, [
2210
- F("div", nd, [
2211
- g(r(wi), {
2212
- "action-teleport-target": e.actionTeleportTarget,
2213
- "can-submit": r(k),
2214
- config: e.config,
2215
- "edit-id": e.partialId,
2216
- "entity-type": r(yn).Partial,
2217
- "error-message": r(s).errorMessage,
2218
- "fetch-url": r(W),
2219
- "form-fields": ee.value,
2220
- "is-readonly": r(s).readonly,
2221
- "slidout-top-offset": e.slidoutTopOffset,
2222
- onCancel: Oe,
2223
- onCodeBlockTabChange: v[29] || (v[29] = (f) => d.value = f),
2224
- "onFetch:error": rt,
2225
- "onFetch:success": Be,
2226
- onLoading: me,
2227
- onSubmit: ve
2228
- }, {
2229
- default: S(() => [
2230
- Z.value > 0 && r(_) ? (R(), q(ot, {
2231
- key: 0,
2232
- appearance: "warning",
2233
- class: "warning-alert",
2234
- "data-testid": "redis-update-warning-alert"
2235
- }, {
2236
- default: S(() => [
2237
- g(r(a), {
2238
- keypath: "form.edit_warning_modal.description",
2239
- tag: "div"
2240
- }, {
2241
- pluginCount: S(() => [
2242
- F("b", null, N(r(i)("form.edit_warning_modal.plugin_count", { count: Z.value })), 1)
2243
- ]),
2244
- _: 1
2245
- })
2246
- ]),
2247
- _: 1
2248
- })) : oe("", !0),
2249
- g(r(ge), {
2250
- "data-testid": "redis-type-section",
2251
- description: r(i)("form.sections.type.description"),
2252
- title: r(i)("form.sections.type.title")
2253
- }, {
2254
- default: S(() => [
2255
- g(Ie, {
2256
- modelValue: r(I),
2257
- "onUpdate:modelValue": v[0] || (v[0] = (f) => _i(I) ? I.value = f : null),
2258
- "data-testid": "redis-type-select",
2259
- disabled: r(_) && r(I) === r(w).HOST_PORT_CE,
2260
- items: y.value,
2261
- "kpop-attributes": { "data-testid": "redis-type-select-popover" },
2262
- label: r(i)("form.fields.type.label"),
2263
- readonly: r(s).readonly,
2264
- required: ""
2265
- }, {
2266
- "selected-item-template": S(({ item: f }) => [
2267
- ne(N(p(f)), 1)
2268
- ]),
2269
- _: 1
2270
- }, 8, ["modelValue", "disabled", "items", "label", "readonly"])
2271
- ]),
2272
- _: 1
2273
- }, 8, ["description", "title"]),
2274
- g(r(ge), {
2275
- "data-testid": "redis-general-section",
2276
- description: r(i)("form.sections.general.description"),
2277
- title: r(i)("form.sections.general.title")
2278
- }, {
2279
- default: S(() => [
2280
- g(B, {
2281
- modelValue: r(s).fields.name,
2282
- "onUpdate:modelValue": v[1] || (v[1] = (f) => r(s).fields.name = f),
2283
- modelModifiers: { trim: !0 },
2284
- "data-testid": "redis-name-input",
2285
- disabled: r(_),
2286
- label: r(i)("form.fields.name.label"),
2287
- placeholder: r(i)("form.fields.name.placeholder"),
2288
- readonly: r(s).readonly,
2289
- required: ""
2290
- }, null, 8, ["modelValue", "disabled", "label", "placeholder", "readonly"]),
2291
- g(B, {
2292
- modelValue: r(s).fields.tags,
2293
- "onUpdate:modelValue": v[2] || (v[2] = (f) => r(s).fields.tags = f),
2294
- modelModifiers: { trim: !0 },
2295
- "data-testid": "redis-tags-input",
2296
- help: r(i)("form.fields.tags.help"),
2297
- label: r(i)("form.fields.tags.label"),
2298
- "label-attributes": {
2299
- info: r(i)("form.fields.tags.tooltip"),
2300
- tooltipAttributes: { maxWidth: "400" }
2301
- },
2302
- placeholder: r(i)("form.fields.tags.placeholder"),
2303
- readonly: r(s).readonly
2304
- }, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
2305
- ]),
2306
- _: 1
2307
- }, 8, ["description", "title"]),
2308
- r(I) === r(w).SENTINEL ? (R(), q(r(ge), {
2309
- key: 1,
2310
- "data-testid": "redis-sentinel-configuration-section",
2311
- description: r(i)("form.sections.sentinel_configuration.description"),
2312
- title: r(i)("form.sections.sentinel_configuration.title")
2313
- }, {
2314
- default: S(() => [
2315
- g(B, {
2316
- modelValue: r(s).fields.config.sentinel_master,
2317
- "onUpdate:modelValue": v[3] || (v[3] = (f) => r(s).fields.config.sentinel_master = f),
2318
- "data-testid": "redis-sentinel-master-input",
2319
- label: r(i)("form.fields.sentinel_master.label"),
2320
- "label-attributes": {
2321
- info: r(i)("form.fields.sentinel_master.tooltip"),
2322
- tooltipAttributes: { maxWidth: "400" }
2323
- },
2324
- readonly: r(s).readonly,
2325
- required: ""
2326
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2327
- g(Ie, {
2328
- modelValue: r(s).fields.config.sentinel_role,
2329
- "onUpdate:modelValue": v[4] || (v[4] = (f) => r(s).fields.config.sentinel_role = f),
2330
- "data-testid": "redis-sentinel-role-select",
2331
- items: h,
2332
- "kpop-attributes": { "data-testid": "redis-sentinel-role-select-popover" },
2333
- label: r(i)("form.fields.sentinel_role.label"),
2334
- "label-attributes": {
2335
- info: r(i)("form.fields.sentinel_role.tooltip"),
2336
- tooltipAttributes: { maxWidth: "400" }
2337
- },
2338
- readonly: r(s).readonly,
2339
- required: ""
2340
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2341
- g(Hs, {
2342
- modelValue: r(s).fields.config.sentinel_nodes,
2343
- "onUpdate:modelValue": v[5] || (v[5] = (f) => r(s).fields.config.sentinel_nodes = f),
2344
- readonly: r(s).readonly
2345
- }, null, 8, ["modelValue", "readonly"]),
2346
- g(B, {
2347
- modelValue: r(s).fields.config.sentinel_username,
2348
- "onUpdate:modelValue": v[6] || (v[6] = (f) => r(s).fields.config.sentinel_username = f),
2349
- modelModifiers: { trim: !0 },
2350
- label: r(i)("form.fields.sentinel_username.label"),
2351
- "label-attributes": {
2352
- info: r(i)("form.fields.sentinel_username.tooltip"),
2353
- tooltipAttributes: { maxWidth: "400" }
2354
- },
2355
- readonly: r(s).readonly
2356
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2357
- g(r(Ke), {
2358
- class: "secret-picker-provider",
2359
- disabled: r(s).readonly,
2360
- update: (f) => r(s).fields.config.sentinel_username = f,
2361
- value: r(s).fields.config.sentinel_username,
2362
- onOpen: v[7] || (v[7] = (f, K) => b(f, K))
2363
- }, null, 8, ["disabled", "update", "value"]),
2364
- g(B, {
2365
- modelValue: r(s).fields.config.sentinel_password,
2366
- "onUpdate:modelValue": v[8] || (v[8] = (f) => r(s).fields.config.sentinel_password = f),
2367
- modelModifiers: { trim: !0 },
2368
- label: r(i)("form.fields.sentinel_password.label"),
2369
- "label-attributes": {
2370
- info: r(i)("form.fields.sentinel_password.tooltip"),
2371
- tooltipAttributes: { maxWidth: "400" }
2372
- },
2373
- readonly: r(s).readonly,
2374
- "show-password-mask-toggle": "",
2375
- type: "password"
2376
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2377
- g(r(Ke), {
2378
- class: "secret-picker-provider",
2379
- disabled: r(s).readonly,
2380
- update: (f) => r(s).fields.config.sentinel_password = f,
2381
- value: r(s).fields.config.sentinel_password,
2382
- onOpen: v[9] || (v[9] = (f, K) => b(f, K))
2383
- }, null, 8, ["disabled", "update", "value"])
2384
- ]),
2385
- _: 1
2386
- }, 8, ["description", "title"])) : oe("", !0),
2387
- r(I) === r(w).CLUSTER ? (R(), q(r(ge), {
2388
- key: 2,
2389
- "data-testid": "redis-cluster-configuration-section",
2390
- description: r(i)("form.sections.cluster.description"),
2391
- title: r(i)("form.sections.cluster.title")
2392
- }, {
2393
- default: S(() => [
2394
- g(Bs, {
2395
- modelValue: r(s).fields.config.cluster_nodes,
2396
- "onUpdate:modelValue": v[10] || (v[10] = (f) => r(s).fields.config.cluster_nodes = f),
2397
- readonly: r(s).readonly
2398
- }, null, 8, ["modelValue", "readonly"]),
2399
- g(B, {
2400
- modelValue: r(s).fields.config.cluster_max_redirections,
2401
- "onUpdate:modelValue": v[11] || (v[11] = (f) => r(s).fields.config.cluster_max_redirections = f),
2402
- "data-testid": "redis-cluster-max-redirections-input",
2403
- label: r(i)("form.fields.cluster_max_redirections.label"),
2404
- "label-attributes": {
2405
- info: r(i)("form.fields.cluster_max_redirections.tooltip"),
2406
- tooltipAttributes: { maxWidth: "400" }
2407
- },
2408
- readonly: r(s).readonly,
2409
- type: "number"
2410
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2411
- ]),
2412
- _: 1
2413
- }, 8, ["description", "title"])) : oe("", !0),
2414
- g(r(ge), {
2415
- "data-testid": "redis-connection-configuration-section",
2416
- description: r(i)("form.sections.connection.description"),
2417
- title: r(i)("form.sections.connection.title")
2418
- }, {
2419
- default: S(() => [
2420
- r(I) === r(w).HOST_PORT_CE || r(I) === r(w).HOST_PORT_EE ? (R(), q(B, {
2421
- key: 0,
2422
- modelValue: r(s).fields.config.host,
2423
- "onUpdate:modelValue": v[12] || (v[12] = (f) => r(s).fields.config.host = f),
2424
- modelModifiers: { trim: !0 },
2425
- "data-testid": "redis-host-input",
2426
- label: r(i)("form.fields.host.label"),
2427
- "label-attributes": {
2428
- info: r(i)("form.fields.host.tooltip"),
2429
- tooltipAttributes: { maxWidth: "400" }
2430
- },
2431
- readonly: r(s).readonly
2432
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])) : oe("", !0),
2433
- r(I) === r(w).HOST_PORT_CE || r(I) === r(w).HOST_PORT_EE ? (R(), q(B, {
2434
- key: 1,
2435
- modelValue: r(s).fields.config.port,
2436
- "onUpdate:modelValue": v[13] || (v[13] = (f) => r(s).fields.config.port = f),
2437
- modelModifiers: { trim: !0 },
2438
- "data-testid": "redis-port-input",
2439
- label: r(i)("form.fields.port.label"),
2440
- "label-attributes": {
2441
- info: r(i)("form.fields.port.tooltip"),
2442
- tooltipAttributes: { maxWidth: "400" }
2443
- },
2444
- readonly: r(s).readonly,
2445
- type: "number"
2446
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])) : oe("", !0),
2447
- r(I) === r(w).HOST_PORT_EE ? (R(), q(O, {
2448
- key: 2,
2449
- modelValue: r(s).fields.config.connection_is_proxied,
2450
- "onUpdate:modelValue": v[14] || (v[14] = (f) => r(s).fields.config.connection_is_proxied = f),
2451
- "data-testid": "redis-connection-is-proxied-checkbox",
2452
- disabled: r(s).readonly,
2453
- label: r(i)("form.fields.connection_is_proxied.label"),
2454
- "label-attributes": {
2455
- info: r(i)("form.fields.connection_is_proxied.tooltip"),
2456
- tooltipAttributes: { maxWidth: "400" }
2457
- }
2458
- }, null, 8, ["modelValue", "disabled", "label", "label-attributes"])) : oe("", !0),
2459
- r(I) === r(w).HOST_PORT_CE ? (R(), q(B, {
2460
- key: 3,
2461
- modelValue: r(s).fields.config.timeout,
2462
- "onUpdate:modelValue": v[15] || (v[15] = (f) => r(s).fields.config.timeout = f),
2463
- modelModifiers: { trim: !0 },
2464
- "data-testid": "redis-timeout-input",
2465
- label: r(i)("form.fields.timeout.label"),
2466
- "label-attributes": {
2467
- info: r(i)("form.fields.timeout.tooltip"),
2468
- tooltipAttributes: { maxWidth: "400" }
2469
- },
2470
- readonly: r(s).readonly,
2471
- type: "number"
2472
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])) : oe("", !0),
2473
- g(B, {
2474
- modelValue: r(s).fields.config.database,
2475
- "onUpdate:modelValue": v[16] || (v[16] = (f) => r(s).fields.config.database = f),
2476
- modelModifiers: { trim: !0 },
2477
- "data-testid": "redis-database-input",
2478
- label: r(i)("form.fields.database.label"),
2479
- "label-attributes": {
2480
- info: r(i)("form.fields.database.tooltip"),
2481
- tooltipAttributes: { maxWidth: "400" }
2482
- },
2483
- readonly: r(s).readonly,
2484
- type: "number"
2485
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2486
- g(B, {
2487
- modelValue: r(s).fields.config.username,
2488
- "onUpdate:modelValue": v[17] || (v[17] = (f) => r(s).fields.config.username = f),
2489
- modelModifiers: { trim: !0 },
2490
- "data-testid": "redis-username-input",
2491
- label: r(i)("form.fields.username.label"),
2492
- "label-attributes": {
2493
- info: r(i)("form.fields.username.tooltip"),
2494
- tooltipAttributes: { maxWidth: "400" }
2495
- },
2496
- readonly: r(s).readonly
2497
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2498
- g(r(Ke), {
2499
- class: "secret-picker-provider",
2500
- disabled: r(s).readonly,
2501
- update: (f) => r(s).fields.config.username = f,
2502
- value: r(s).fields.config.username,
2503
- onOpen: v[18] || (v[18] = (f, K) => b(f, K))
2504
- }, null, 8, ["disabled", "update", "value"]),
2505
- g(B, {
2506
- modelValue: r(s).fields.config.password,
2507
- "onUpdate:modelValue": v[19] || (v[19] = (f) => r(s).fields.config.password = f),
2508
- modelModifiers: { trim: !0 },
2509
- "data-testid": "redis-password-input",
2510
- label: r(i)("form.fields.password.label"),
2511
- "label-attributes": {
2512
- info: r(i)("form.fields.password.tooltip"),
2513
- tooltipAttributes: { maxWidth: "400" }
2514
- },
2515
- readonly: r(s).readonly,
2516
- "show-password-mask-toggle": "",
2517
- type: "password"
2518
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2519
- g(r(Ke), {
2520
- class: "secret-picker-provider",
2521
- disabled: r(s).readonly,
2522
- update: (f) => r(s).fields.config.password = f,
2523
- value: r(s).fields.config.password,
2524
- onOpen: v[20] || (v[20] = (f, K) => b(f, K))
2525
- }, null, 8, ["disabled", "update", "value"])
2526
- ]),
2527
- _: 1
2528
- }, 8, ["description", "title"]),
2529
- g(r(ge), {
2530
- "data-testid": "redis-tls-configuration-section",
2531
- description: r(i)("form.sections.tls.description"),
2532
- title: r(i)("form.sections.tls.title")
2533
- }, {
2534
- default: S(() => [
2535
- g(O, {
2536
- modelValue: r(s).fields.config.ssl,
2537
- "onUpdate:modelValue": v[21] || (v[21] = (f) => r(s).fields.config.ssl = f),
2538
- "data-testid": "redis-ssl-checkbox",
2539
- description: r(i)("form.fields.ssl.description"),
2540
- disabled: r(s).readonly,
2541
- label: r(i)("form.fields.ssl.label"),
2542
- "label-attributes": {
2543
- info: r(i)("form.fields.ssl.tooltip"),
2544
- tooltipAttributes: { maxWidth: "400" }
2545
- }
2546
- }, null, 8, ["modelValue", "description", "disabled", "label", "label-attributes"]),
2547
- g(O, {
2548
- modelValue: r(s).fields.config.ssl_verify,
2549
- "onUpdate:modelValue": v[22] || (v[22] = (f) => r(s).fields.config.ssl_verify = f),
2550
- "data-testid": "redis-ssl-verify-checkbox",
2551
- description: r(i)("form.fields.ssl_verify.description"),
2552
- disabled: r(s).readonly,
2553
- label: r(i)("form.fields.ssl_verify.label"),
2554
- "label-attributes": {
2555
- info: r(i)("form.fields.ssl_verify.tooltip"),
2556
- tooltipAttributes: { maxWidth: "400" }
2557
- }
2558
- }, null, 8, ["modelValue", "description", "disabled", "label", "label-attributes"]),
2559
- g(B, {
2560
- modelValue: r(s).fields.config.server_name,
2561
- "onUpdate:modelValue": v[23] || (v[23] = (f) => r(s).fields.config.server_name = f),
2562
- modelModifiers: { trim: !0 },
2563
- label: r(i)("form.fields.server_name.label"),
2564
- "label-attributes": {
2565
- info: r(i)("form.fields.server_name.tooltip"),
2566
- tooltipAttributes: { maxWidth: "400" }
2567
- },
2568
- readonly: r(s).readonly
2569
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2570
- ]),
2571
- _: 1
2572
- }, 8, ["description", "title"]),
2573
- r(I) !== r(w).HOST_PORT_CE ? (R(), q(r(ge), {
2574
- key: 3,
2575
- "data-testid": "redis-keepalive-section",
2576
- description: r(i)("form.sections.keepalive.description"),
2577
- title: r(i)("form.sections.keepalive.title")
2578
- }, {
2579
- default: S(() => [
2580
- g(B, {
2581
- modelValue: r(s).fields.config.keepalive_backlog,
2582
- "onUpdate:modelValue": v[24] || (v[24] = (f) => r(s).fields.config.keepalive_backlog = f),
2583
- "data-testid": "redis-keepalive-backlog-input",
2584
- label: r(i)("form.fields.keepalive_backlog.label"),
2585
- "label-attributes": {
2586
- info: r(i)("form.fields.keepalive_backlog.tooltip"),
2587
- tooltipAttributes: { maxWidth: "400" }
2588
- },
2589
- readonly: r(s).readonly,
2590
- type: "number"
2591
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2592
- g(B, {
2593
- modelValue: r(s).fields.config.keepalive_pool_size,
2594
- "onUpdate:modelValue": v[25] || (v[25] = (f) => r(s).fields.config.keepalive_pool_size = f),
2595
- "data-testid": "redis-keepalive-pool-size-input",
2596
- label: r(i)("form.fields.keepalive_pool_size.label"),
2597
- "label-attributes": {
2598
- info: r(i)("form.fields.keepalive_pool_size.tooltip"),
2599
- tooltipAttributes: { maxWidth: "400" }
2600
- },
2601
- readonly: r(s).readonly,
2602
- type: "number"
2603
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2604
- ]),
2605
- _: 1
2606
- }, 8, ["description", "title"])) : oe("", !0),
2607
- r(I) !== r(w).HOST_PORT_CE ? (R(), q(r(ge), {
2608
- key: 4,
2609
- "data-testid": "redis-read-write-configuration-section",
2610
- description: r(i)("form.sections.read_write_configuration.description"),
2611
- title: r(i)("form.sections.read_write_configuration.title")
2612
- }, {
2613
- default: S(() => [
2614
- g(B, {
2615
- modelValue: r(s).fields.config.read_timeout,
2616
- "onUpdate:modelValue": v[26] || (v[26] = (f) => r(s).fields.config.read_timeout = f),
2617
- "data-testid": "redis-read-timeout-input",
2618
- label: r(i)("form.fields.read_timeout.label"),
2619
- "label-attributes": {
2620
- info: r(i)("form.fields.read_timeout.tooltip"),
2621
- tooltipAttributes: { maxWidth: "400" }
2622
- },
2623
- readonly: r(s).readonly,
2624
- type: "number"
2625
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2626
- g(B, {
2627
- modelValue: r(s).fields.config.send_timeout,
2628
- "onUpdate:modelValue": v[27] || (v[27] = (f) => r(s).fields.config.send_timeout = f),
2629
- "data-testid": "redis-send-timeout-input",
2630
- label: r(i)("form.fields.send_timeout.label"),
2631
- "label-attributes": {
2632
- info: r(i)("form.fields.send_timeout.tooltip"),
2633
- tooltipAttributes: { maxWidth: "400" }
2634
- },
2635
- readonly: r(s).readonly,
2636
- type: "number"
2637
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"]),
2638
- g(B, {
2639
- modelValue: r(s).fields.config.connect_timeout,
2640
- "onUpdate:modelValue": v[28] || (v[28] = (f) => r(s).fields.config.connect_timeout = f),
2641
- "data-testid": "redis-connect-timeout-input",
2642
- label: r(i)("form.fields.connect_timeout.label"),
2643
- "label-attributes": {
2644
- info: r(i)("form.fields.connect_timeout.tooltip"),
2645
- tooltipAttributes: { maxWidth: "400" }
2646
- },
2647
- readonly: r(s).readonly,
2648
- type: "number"
2649
- }, null, 8, ["modelValue", "label", "label-attributes", "readonly"])
2650
- ]),
2651
- _: 1
2652
- }, 8, ["description", "title"])) : oe("", !0)
2653
- ]),
2654
- _: 1
2655
- }, 8, ["action-teleport-target", "can-submit", "config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly", "slidout-top-offset"])
2656
- ]),
2657
- g(r(ki), {
2658
- config: n.config,
2659
- setup: c.value,
2660
- onCancel: v[30] || (v[30] = () => c.value = !1),
2661
- onProceed: T
2662
- }, null, 8, ["config", "setup"]),
2663
- g(x, {
2664
- "action-button-text": r(i)("form.edit_warning_modal.confirm"),
2665
- "data-testid": "redis-update-warning-modal",
2666
- "hide-cancel-button": "",
2667
- "max-width": "640",
2668
- title: r(i)("form.edit_warning_modal.title"),
2669
- visible: X.value,
2670
- onCancel: v[31] || (v[31] = (f) => X.value = !1),
2671
- onProceed: he
2672
- }, {
2673
- default: S(() => [
2674
- g(r(a), {
2675
- keypath: "form.edit_warning_modal.description",
2676
- tag: "div"
2677
- }, {
2678
- pluginCount: S(() => [
2679
- F("b", null, N(r(i)("form.edit_warning_modal.plugin_count", { count: Z.value })), 1)
2680
- ]),
2681
- _: 1
2682
- })
2683
- ]),
2684
- _: 1
2685
- }, 8, ["action-button-text", "title", "visible"])
2686
- ], 64);
2687
- };
2688
- }
2689
- }), rd = /* @__PURE__ */ ie(id, [["__scopeId", "data-v-dd883631"]]), od = {
2690
- class: "linked-plugins",
2691
- "data-testid": "linked-plugins-inline"
2692
- }, gt = 7, ad = /* @__PURE__ */ Q({
2693
- __name: "LinkedPluginsInline",
2694
- props: {
2695
- config: {
2696
- type: Object,
2697
- required: !0,
2698
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string")
2699
- },
2700
- partialId: {
2701
- type: String,
2702
- required: !0
2703
- }
2704
- },
2705
- setup(e) {
2706
- const t = e, n = si({
2707
- config: t.config,
2708
- partialId: t.partialId
2709
- });
2710
- return (o, i) => {
2711
- const a = j("KBadge");
2712
- return R(), J("div", od, [
2713
- (R(!0), J(je, null, wt(r(n).slice(0, gt), (u) => (R(), q(r(Tn), {
2714
- key: u.id,
2715
- name: u.name,
2716
- size: 24
2717
- }, null, 8, ["name"]))), 128)),
2718
- r(n).length - gt > 0 ? (R(), q(a, {
2719
- key: 0,
2720
- appearance: "info"
2721
- }, {
2722
- default: S(() => [
2723
- ne(" +" + N(r(n).length - gt), 1)
2724
- ]),
2725
- _: 1
2726
- })) : oe("", !0)
2727
- ]);
2728
- };
2729
- }
2730
- }), ld = /* @__PURE__ */ ie(ad, [["__scopeId", "data-v-c39556bc"]]), sd = { class: "plugin-item" }, dd = /* @__PURE__ */ Q({
2731
- __name: "PluginItem",
2732
- props: {
2733
- pluginName: {}
2734
- },
2735
- setup(e) {
2736
- return (t, n) => (R(), J("div", sd, [
2737
- g(r(Tn), {
2738
- name: e.pluginName,
2739
- size: 24
2740
- }, null, 8, ["name"]),
2741
- F("span", null, N(e.pluginName), 1)
2742
- ]));
2743
- }
2744
- }), ud = /* @__PURE__ */ ie(dd, [["__scopeId", "data-v-de964dc4"]]), cd = { class: "toolbar-container" }, fd = /* @__PURE__ */ Q({
2745
- __name: "LinkedPluginList",
2746
- props: {
2747
- config: {
2748
- type: Object,
2749
- required: !0,
2750
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string")
2751
- },
2752
- /**
2753
- * Only works when filterBarEnabled is true
2754
- */
2755
- isExactMatch: {
2756
- type: Boolean,
2757
- default: !1
2758
- },
2759
- filterBarEnabled: {
2760
- type: Boolean,
2761
- default: !1
2762
- },
2763
- partialId: {
2764
- type: String,
2765
- required: !0
2766
- }
2767
- },
2768
- emits: ["view-plugin", "load"],
2769
- setup(e, { emit: t }) {
2770
- const n = e, o = t, { i18n: { t: i } } = be.useI18n(), a = [
2771
- { key: "name", label: i("linked_plugins_modal.headers.plugin") },
2772
- { key: "instance_name", label: i("linked_plugins_modal.headers.instance_name") },
2773
- { key: "actions", hideLabel: !0 }
2774
- ], { fetcher: u } = Ne(n.config), c = $(0), l = async (y) => {
2775
- const { data: h, count: p } = await u({
2776
- partialId: n.partialId,
2777
- size: y.pageSize,
2778
- offset: y.offset,
2779
- query: y.query
2780
- });
2781
- c.value = p;
2782
- const C = {
2783
- total: p,
2784
- data: h
2785
- };
2786
- return o("load", C), C;
2787
- }, d = $(""), b = H(() => n.config.app === "konnect" || n.isExactMatch ? {
2788
- isExactMatch: !0
2789
- } : {
2790
- isExactMatch: !1,
2791
- fields: { name: { searchable: !0 } },
2792
- schema: { name: { type: "text" } }
2793
- }), T = (y) => {
2794
- o("view-plugin", { id: y.id, plugin: y.name });
2795
- };
2796
- return (y, h) => {
2797
- const p = j("KDropdownItem"), C = j("KTableData");
2798
- return R(), q(C, {
2799
- "cache-identifier": r(li)(e.partialId),
2800
- fetcher: l,
2801
- headers: a,
2802
- "hide-pagination-when-optional": "",
2803
- "pagination-attributes": { totalCount: c.value, disablePageJump: !0 },
2804
- "search-input": d.value
2805
- }, mn({
2806
- name: S(({ rowValue: s }) => [
2807
- g(ud, { "plugin-name": s }, null, 8, ["plugin-name"])
2808
- ]),
2809
- "action-items": S(({ row: s }) => [
2810
- g(p, {
2811
- onClick: (k) => T(s)
2812
- }, {
2813
- default: S(() => [
2814
- ne(N(r(i)("actions.view_plugin")), 1)
2815
- ]),
2816
- _: 1
2817
- }, 8, ["onClick"])
2818
- ]),
2819
- _: 2
2820
- }, [
2821
- e.filterBarEnabled ? {
2822
- name: "toolbar",
2823
- fn: S(() => [
2824
- F("div", cd, [
2825
- g(r(_n), {
2826
- modelValue: d.value,
2827
- "onUpdate:modelValue": h[0] || (h[0] = (s) => d.value = s),
2828
- config: b.value
2829
- }, null, 8, ["modelValue", "config"])
2830
- ])
2831
- ]),
2832
- key: "0"
2833
- } : void 0
2834
- ]), 1032, ["cache-identifier", "pagination-attributes", "search-input"]);
2835
- };
2836
- }
2837
- }), pd = /* @__PURE__ */ ie(fd, [["__scopeId", "data-v-50856d03"]]), md = {
2838
- class: "linked-plugins-modal",
2839
- "data-testid": "linked-plugins-modal"
2840
- }, gd = /* @__PURE__ */ Q({
2841
- __name: "LinkedPluginListModal",
2842
- props: {
2843
- config: {
2844
- type: Object,
2845
- required: !0,
2846
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string")
2847
- },
2848
- redisConfigurationId: {
2849
- type: String,
2850
- required: !0
2851
- },
2852
- visible: {
2853
- type: Boolean,
2854
- required: !0,
2855
- default: !1
2856
- }
2857
- },
2858
- emits: ["cancel", "proceed", "view-plugin"],
2859
- setup(e, { emit: t }) {
2860
- const n = t, { i18n: { t: o } } = be.useI18n(), i = $(0), a = H(() => o("linked_plugins_modal.title", { count: i.value })), u = () => {
2861
- n("cancel");
2862
- }, c = () => {
2863
- n("proceed");
2864
- };
2865
- return (l, d) => {
2866
- const b = j("KModal");
2867
- return R(), J("div", md, [
2868
- g(b, {
2869
- "action-button-text": r(o)("actions.done"),
2870
- "hide-cancel-button": "",
2871
- title: a.value,
2872
- visible: e.visible,
2873
- onCancel: u,
2874
- onProceed: c
2875
- }, {
2876
- default: S(() => [
2877
- g(pd, {
2878
- config: e.config,
2879
- "partial-id": e.redisConfigurationId,
2880
- onLoad: d[0] || (d[0] = ({ total: T }) => i.value = T),
2881
- onViewPlugin: d[1] || (d[1] = (T) => n("view-plugin", T))
2882
- }, null, 8, ["config", "partial-id"])
2883
- ]),
2884
- _: 1
2885
- }, 8, ["action-button-text", "title", "visible"])
2886
- ]);
2887
- };
2888
- }
2889
- }), bd = /* @__PURE__ */ ie(gd, [["__scopeId", "data-v-6148b8bd"]]), yd = /* @__PURE__ */ Q({
2890
- __name: "DeleteWarningModal",
2891
- props: {
2892
- visible: {
2893
- type: Boolean,
2894
- required: !0
2895
- }
2896
- },
2897
- emits: ["close"],
2898
- setup(e, { emit: t }) {
2899
- const { i18n: { t: n } } = be.useI18n(), o = t, i = () => {
2900
- o("close");
2901
- };
2902
- return (a, u) => {
2903
- const c = j("KModal");
2904
- return R(), q(c, {
2905
- "action-button-text": r(n)("actions.close"),
2906
- "data-testid": "remove-links-modal",
2907
- "hide-cancel-button": "",
2908
- "max-width": "640",
2909
- title: r(n)("delete.title"),
2910
- visible: e.visible,
2911
- onCancel: i,
2912
- onProceed: i
2913
- }, {
2914
- default: S(() => [
2915
- ne(N(r(n)("delete.warning")), 1)
2916
- ]),
2917
- _: 1
2918
- }, 8, ["action-button-text", "title", "visible"]);
2919
- };
2920
- }
2921
- }), _d = { class: "kong-ui-entities-partials-list" }, vd = 1e3, hd = /* @__PURE__ */ Q({
2922
- __name: "RedisConfigurationList",
2923
- props: {
2924
- /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
2925
- config: {
2926
- type: Object,
2927
- required: !0,
2928
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || !e.createRoute || !e.getViewRoute || !e.getEditRoute)
2929
- },
2930
- // used to override the default identifier for the cache entry
2931
- cacheIdentifier: {
2932
- type: String,
2933
- default: ""
2934
- },
2935
- /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can create a new entity */
2936
- canCreate: {
2937
- type: Function,
2938
- required: !1,
2939
- default: async () => !0
2940
- },
2941
- /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can delete a given entity */
2942
- canDelete: {
2943
- type: Function,
2944
- required: !1,
2945
- default: async () => !0
2946
- },
2947
- /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can edit a given entity */
2948
- canEdit: {
2949
- type: Function,
2950
- required: !1,
2951
- default: async () => !0
2952
- },
2953
- /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can retrieve (view details) a given entity */
2954
- canRetrieve: {
2955
- type: Function,
2956
- required: !1,
2957
- default: async () => !0
2958
- },
2959
- /** default to false, setting to true will teleport the toolbar button to the destination in the consuming app */
2960
- useActionOutside: {
2961
- type: Boolean,
2962
- default: !1
2963
- }
2964
- },
2965
- emits: ["click:learn-more", "click:plugin", "copy:error", "copy:success", "delete:success", "error"],
2966
- setup(e, { emit: t }) {
2967
- var B;
2968
- const n = t, o = e, i = H(() => {
2969
- var x, f;
2970
- let O = `${o.config.apiBaseUrl}${ke.list[o.config.app]}`;
2971
- return o.config.app === "konnect" ? O = O.replace(/{controlPlaneId}/gi, ((x = o.config) == null ? void 0 : x.controlPlaneId) || "") : o.config.app === "kongManager" && (O = O.replace(/\/{workspace}/gi, (f = o.config) != null && f.workspace ? `/${o.config.workspace}` : "")), O;
2972
- }), a = $(!1), u = $(""), c = $(null), l = $(void 0), d = $(!1), b = $(!1), T = $(""), y = $(!1), h = Si(o.config, i.value), p = $(1), C = H(() => o.config.app !== "kongManager" || !!o.config.disableSorting), { fetcher: s, fetcherState: k } = Ei(o.config, i);
2973
- async function m(O) {
2974
- const x = await s({ ...O, pageSize: vd });
2975
- return x.data = x.data.filter((f) => f.type === G.REDIS_CE || f.type === G.REDIS_EE), x;
2976
- }
2977
- const { i18n: { t: _ } } = be.useI18n(), { axiosInstance: I } = St((B = o.config) == null ? void 0 : B.axiosRequestConfig), P = vn(), W = $(""), re = H(() => {
2978
- const O = o.config.app === "konnect" || o.config.isExactMatch;
2979
- if (O)
2980
- return {
2981
- isExactMatch: !0,
2982
- placeholder: _("search.placeholder_for_exact_match")
2983
- };
2984
- const { name: x } = X;
2985
- return {
2986
- isExactMatch: O,
2987
- fields: {
2988
- name: x
2989
- },
2990
- schema: o.config.filterSchema
2991
- };
2992
- }), { fetcher: ye } = Ne(o.config), le = $({
2993
- ctaPath: o.config.createRoute,
2994
- ctaText: void 0,
2995
- message: `${_("redis.empty_state.description")}${o.config.additionMessageForEmptyState ? ` ${o.config.additionMessageForEmptyState}` : ""}`,
2996
- title: _("redis.title")
2997
- }), X = {
2998
- name: { label: _("list.table_headers.name"), searchable: !0, hidable: !1, sortable: !0 },
2999
- type: { label: _("list.table_headers.type") },
3000
- tags: { label: _("list.table_headers.tags") },
3001
- plugins: { label: _("list.table_headers.plugins") }
3002
- }, _e = (O) => ({
3003
- label: _("actions.view"),
3004
- to: o.config.getViewRoute(O)
3005
- }), Z = (O) => ({
3006
- label: _("actions.edit"),
3007
- to: o.config.getEditRoute(O)
3008
- }), ee = async (O) => {
3009
- const { count: x } = await ye({ partialId: O.id });
3010
- x > 0 ? y.value = !0 : (l.value = O, d.value = !0);
3011
- }, ve = () => {
3012
- W.value = "";
3013
- }, he = async (O) => {
3014
- var f;
3015
- await ((f = o.canRetrieve) == null ? void 0 : f.call(o, O)) && P.push(o.config.getViewRoute(O.id));
3016
- }, Oe = () => {
3017
- d.value = !1;
3018
- }, me = (O) => {
3019
- u.value = O, a.value = !0;
3020
- }, rt = async () => {
3021
- var O, x, f;
3022
- if ((O = l.value) != null && O.id) {
3023
- b.value = !0;
3024
- try {
3025
- await I.delete(h(l.value.id)), b.value = !1, d.value = !1, Be(), n("delete:success", l.value);
3026
- } catch (K) {
3027
- T.value = ((f = (x = K.response) == null ? void 0 : x.data) == null ? void 0 : f.message) || K.message || _("errors.delete"), n("error", K);
3028
- } finally {
3029
- b.value = !1;
3030
- }
3031
- }
3032
- }, Be = () => {
3033
- p.value++;
3034
- }, U = (O) => {
3035
- switch (Ue(O)) {
3036
- case w.HOST_PORT_CE:
3037
- return `${_("form.options.type.host_port")}${_("form.options.type.suffix_open_source")}`;
3038
- case w.HOST_PORT_EE:
3039
- return `${_("form.options.type.host_port")}${_("form.options.type.suffix_enterprise")}`;
3040
- case w.SENTINEL:
3041
- return `${_("form.options.type.sentinel")}${_("form.options.type.suffix_enterprise")}`;
3042
- case w.CLUSTER:
3043
- return `${_("form.options.type.cluster")}${_("form.options.type.suffix_enterprise")}`;
3044
- }
3045
- }, v = () => {
3046
- P.push(o.config.createRoute);
3047
- }, ot = async (O, x) => {
3048
- const f = O.id;
3049
- if (!await x(f)) {
3050
- n("copy:error", {
3051
- entity: O,
3052
- field: "id",
3053
- message: _("errors.copy")
3054
- });
3055
- return;
3056
- }
3057
- n("copy:success", {
3058
- entity: O,
3059
- field: "id",
3060
- message: _("copy.success", { val: f })
3061
- });
3062
- };
3063
- Te(k, (O) => {
3064
- var x, f, K;
3065
- if (O.status === Ci.Error) {
3066
- c.value = {
3067
- title: _("errors.general")
3068
- }, (K = (f = (x = O.error) == null ? void 0 : x.response) == null ? void 0 : f.data) != null && K.message && (c.value.message = O.error.response.data.message), n("error", O.error);
3069
- return;
3070
- }
3071
- c.value = null;
3072
- });
3073
- const Ie = $(!1);
3074
- return Te(o.canCreate, async (O) => {
3075
- Ie.value = await O, Ie.value ? le.value.ctaText = _("actions.create") : le.value.ctaText = void 0;
3076
- }, {
3077
- immediate: !0
3078
- }), (O, x) => {
3079
- const f = j("KButton"), K = j("KDropdownItem"), ui = j("KClipboardProvider"), ci = j("KEmptyState");
3080
- return R(), J("div", _d, [
3081
- g(r(Oi), {
3082
- "cache-identifier": e.cacheIdentifier,
3083
- "disable-sorting": C.value,
3084
- "empty-state-options": le.value,
3085
- "enable-entity-actions": "",
3086
- "error-message": c.value,
3087
- fetcher: m,
3088
- "fetcher-cache-key": p.value,
3089
- "pagination-type": "offset",
3090
- "preferences-storage-key": "kong-ui-entities-redis-configuration-list",
3091
- query: W.value,
3092
- "table-headers": X,
3093
- onClearSearchInput: ve,
3094
- "onClick:row": x[1] || (x[1] = (V) => he(V)),
3095
- onSort: Be
3096
- }, {
3097
- "toolbar-filter": S(() => [
3098
- g(r(_n), {
3099
- modelValue: W.value,
3100
- "onUpdate:modelValue": x[0] || (x[0] = (V) => W.value = V),
3101
- config: re.value
3102
- }, null, 8, ["modelValue", "config"])
3103
- ]),
3104
- "toolbar-button": S(() => [
3105
- (R(), q(hi, {
3106
- disabled: !e.useActionOutside,
3107
- to: "#kong-ui-app-page-header-action-button"
3108
- }, [
3109
- g(r(Fe), { "auth-function": e.canCreate }, {
3110
- default: S(() => [
3111
- g(f, {
3112
- appearance: "primary",
3113
- "data-testid": "toolbar-add-redis-configuration",
3114
- size: "large",
3115
- to: e.config.createRoute
3116
- }, {
3117
- default: S(() => [
3118
- g(r(bt)),
3119
- ne(" " + N(r(_)("actions.create")), 1)
3120
- ]),
3121
- _: 1
3122
- }, 8, ["to"])
3123
- ]),
3124
- _: 1
3125
- }, 8, ["auth-function"])
3126
- ], 8, ["disabled"]))
3127
- ]),
3128
- name: S(({ rowValue: V }) => [
3129
- F("b", null, N(V ?? "-"), 1)
3130
- ]),
3131
- type: S(({ row: V }) => [
3132
- ne(N(U(V)), 1)
3133
- ]),
3134
- tags: S(({ rowValue: V }) => [
3135
- g(r(Ii), { tags: V }, null, 8, ["tags"])
3136
- ]),
3137
- plugins: S(({ row: V }) => [
3138
- g(ld, {
3139
- config: e.config,
3140
- "partial-id": V.id,
3141
- onClick: vi((at) => me(V.id), ["stop"])
3142
- }, null, 8, ["config", "partial-id", "onClick"])
3143
- ]),
3144
- actions: S(({ row: V }) => [
3145
- g(ui, null, {
3146
- default: S(({ copyToClipboard: at }) => [
3147
- g(K, {
3148
- "data-testid": "action-entity-copy-id",
3149
- onClick: (Pd) => ot(V, at)
3150
- }, {
3151
- default: S(() => [
3152
- ne(N(r(_)("actions.copy_id")), 1)
3153
- ]),
3154
- _: 1
3155
- }, 8, ["onClick"])
3156
- ]),
3157
- _: 2
3158
- }, 1024),
3159
- g(r(Fe), {
3160
- "auth-function": () => e.canRetrieve(V)
3161
- }, {
3162
- default: S(() => [
3163
- g(K, {
3164
- "data-testid": "action-entity-view",
3165
- "has-divider": "",
3166
- item: _e(V.id)
3167
- }, null, 8, ["item"])
3168
- ]),
3169
- _: 2
3170
- }, 1032, ["auth-function"]),
3171
- g(r(Fe), {
3172
- "auth-function": () => e.canEdit(V)
3173
- }, {
3174
- default: S(() => [
3175
- g(K, {
3176
- "data-testid": "action-entity-edit",
3177
- item: Z(V.id)
3178
- }, null, 8, ["item"])
3179
- ]),
3180
- _: 2
3181
- }, 1032, ["auth-function"]),
3182
- g(r(Fe), {
3183
- "auth-function": () => e.canDelete(V)
3184
- }, {
3185
- default: S(() => [
3186
- g(K, {
3187
- danger: "",
3188
- "data-testid": "action-entity-delete",
3189
- "has-divider": "",
3190
- onClick: (at) => ee(V)
3191
- }, {
3192
- default: S(() => [
3193
- ne(N(r(_)("actions.delete")), 1)
3194
- ]),
3195
- _: 1
3196
- }, 8, ["onClick"])
3197
- ]),
3198
- _: 2
3199
- }, 1032, ["auth-function"])
3200
- ]),
3201
- "empty-state": S(() => [
3202
- g(ci, {
3203
- "action-button-text": r(_)("list.action"),
3204
- "action-button-visible": Ie.value,
3205
- "data-testid": "redis-entity-empty-state",
3206
- features: [
3207
- {
3208
- key: "feature-1",
3209
- title: r(_)("list.empty_state.feature_1.title"),
3210
- description: r(_)("list.empty_state.feature_1.description")
3211
- },
3212
- {
3213
- key: "feature-2",
3214
- title: r(_)("list.empty_state.feature_2.title"),
3215
- description: r(_)("list.empty_state.feature_2.description")
3216
- }
3217
- ],
3218
- "icon-background": "",
3219
- message: r(_)("list.empty_state.description"),
3220
- title: r(_)("redis.title"),
3221
- onClickAction: v
3222
- }, {
3223
- icon: S(() => [
3224
- g(r(Li), { decorative: "" })
3225
- ]),
3226
- "feature-icon-feature-1": S(() => [
3227
- g(r(Mi))
3228
- ]),
3229
- "feature-icon-feature-2": S(() => [
3230
- g(r(Vi))
3231
- ]),
3232
- "action-button-icon": S(() => [
3233
- g(r(bt), { decorative: "" })
3234
- ]),
3235
- _: 1
3236
- }, 8, ["action-button-text", "action-button-visible", "features", "message", "title"])
3237
- ]),
3238
- _: 1
3239
- }, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher-cache-key", "query"]),
3240
- g(yd, {
3241
- visible: y.value,
3242
- onClose: x[2] || (x[2] = (V) => y.value = !1)
3243
- }, null, 8, ["visible"]),
3244
- g(r(xi), {
3245
- "action-pending": b.value,
3246
- description: r(_)("delete.description"),
3247
- "entity-name": l.value && (l.value.name || l.value.id),
3248
- "entity-type": r(Ri).RedisConfiguration,
3249
- error: T.value,
3250
- "need-confirmation": !0,
3251
- title: r(_)("delete.title"),
3252
- visible: d.value,
3253
- onCancel: Oe,
3254
- onProceed: rt
3255
- }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"]),
3256
- g(bd, {
3257
- config: e.config,
3258
- "redis-configuration-id": u.value,
3259
- visible: a.value,
3260
- onCancel: x[3] || (x[3] = (V) => a.value = !1),
3261
- onProceed: x[4] || (x[4] = (V) => a.value = !1),
3262
- onViewPlugin: x[5] || (x[5] = (V) => n("click:plugin", V))
3263
- }, null, 8, ["config", "redis-configuration-id", "visible"])
3264
- ]);
3265
- };
3266
- }
3267
- }), Hd = /* @__PURE__ */ ie(hd, [["__scopeId", "data-v-4e5be541"]]), Td = { class: "kong-ui-consumer-group-entity-config-card" }, zd = /* @__PURE__ */ Q({
3268
- __name: "RedisConfigurationConfigCard",
3269
- props: {
3270
- /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
3271
- config: {
3272
- type: Object,
3273
- required: !0,
3274
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string" || !e.entityId)
3275
- },
3276
- /**
3277
- * External link for documentation that determines visibility of Documentation button
3278
- */
3279
- configCardDoc: {
3280
- type: String,
3281
- default: "",
3282
- required: !1
3283
- },
3284
- /**
3285
- * Control visibility of card title content
3286
- */
3287
- hideTitle: {
3288
- type: Boolean,
3289
- default: !0
3290
- }
3291
- },
3292
- emits: ["loading", "fetch:error", "fetch:success"],
3293
- setup(e, { emit: t }) {
3294
- const n = e, o = t, { i18n: { t: i } } = be.useI18n(), a = H(() => ke.form[n.config.app].edit), u = $($e), c = (p) => {
3295
- u.value = Ue(p), o("fetch:success", p);
3296
- }, l = H(() => {
3297
- const p = u.value === w.HOST_PORT_CE ? i("form.options.type.suffix_open_source") : i("form.options.type.suffix_enterprise");
3298
- let C = "";
3299
- switch (u.value) {
3300
- case w.HOST_PORT_CE:
3301
- C = i("form.options.type.host_port");
3302
- break;
3303
- case w.HOST_PORT_EE:
3304
- C = i("form.options.type.host_port");
3305
- break;
3306
- case w.CLUSTER:
3307
- C = i("form.options.type.cluster");
3308
- break;
3309
- case w.SENTINEL:
3310
- C = i("form.options.type.sentinel");
3311
- break;
3312
- }
3313
- return `${C}${p}`;
3314
- }), d = (p) => ({
3315
- id: p.id,
3316
- name: p.name,
3317
- tags: p.tags,
3318
- created_at: p.created_at,
3319
- updated_at: p.updated_at,
3320
- type: p.type,
3321
- ...p.config
3322
- }), b = (p, C) => {
3323
- if (!p || Object.keys(p).length === 0)
3324
- return {};
3325
- const { id: s, name: k, created_at: m, updated_at: _, type: I, tags: P, ...W } = p;
3326
- return C === "terraform" ? {
3327
- [I.replaceAll("-", "_")]: {
3328
- id: s,
3329
- name: k,
3330
- tags: P,
3331
- created_at: m,
3332
- updated_at: _,
3333
- config: W
3334
- }
3335
- } : {
3336
- id: s,
3337
- name: k,
3338
- tags: P,
3339
- created_at: m,
3340
- updated_at: _,
3341
- type: I,
3342
- config: W
3343
- };
3344
- }, T = {
3345
- id: {},
3346
- name: {
3347
- type: L.Text,
3348
- section: M.Basic,
3349
- label: i("form.fields.name.label")
3350
- },
3351
- tags: {
3352
- type: L.BadgeTag,
3353
- section: M.Basic,
3354
- label: i("form.fields.tags.label"),
3355
- tooltip: i("form.fields.tags.tooltip")
3356
- },
3357
- updated_at: {},
3358
- created_at: {},
3359
- type: {
3360
- type: L.Text,
3361
- section: M.Basic,
3362
- label: i("form.fields.type.label")
3363
- },
3364
- cluster_max_redirections: {
3365
- type: L.Text,
3366
- section: M.Basic,
3367
- tooltip: i("form.fields.cluster_max_redirections.tooltip"),
3368
- label: i("form.fields.cluster_max_redirections.label")
3369
- },
3370
- cluster_nodes: {
3371
- type: L.JsonArray,
3372
- section: M.Basic,
3373
- label: i("form.fields.cluster_nodes.title"),
3374
- tooltip: i("form.fields.cluster_nodes.tooltip")
3375
- },
3376
- connect_timeout: {
3377
- type: L.Text,
3378
- section: M.Basic,
3379
- label: i("form.fields.connect_timeout.label"),
3380
- tooltip: i("form.fields.connect_timeout.tooltip")
3381
- },
3382
- connection_is_proxied: {
3383
- type: L.Text,
3384
- section: M.Basic,
3385
- label: i("form.fields.connection_is_proxied.label"),
3386
- tooltip: i("form.fields.connection_is_proxied.tooltip")
3387
- },
3388
- database: {
3389
- type: L.Text,
3390
- section: M.Basic,
3391
- label: i("form.fields.database.label"),
3392
- tooltip: i("form.fields.database.tooltip")
3393
- },
3394
- host: {
3395
- type: L.Text,
3396
- section: M.Basic,
3397
- label: i("form.fields.host.label"),
3398
- tooltip: i("form.fields.host.tooltip")
3399
- },
3400
- keepalive_backlog: {
3401
- type: L.Text,
3402
- section: M.Basic,
3403
- label: i("form.fields.keepalive_backlog.label"),
3404
- tooltip: i("form.fields.keepalive_backlog.tooltip")
3405
- },
3406
- keepalive_pool_size: {
3407
- type: L.Text,
3408
- section: M.Basic,
3409
- label: i("form.fields.keepalive_pool_size.label"),
3410
- tooltip: i("form.fields.keepalive_pool_size.tooltip")
3411
- },
3412
- password: {
3413
- type: L.Redacted,
3414
- section: M.Basic,
3415
- label: i("form.fields.password.label"),
3416
- tooltip: i("form.fields.password.tooltip")
3417
- },
3418
- port: {
3419
- type: L.Text,
3420
- section: M.Basic,
3421
- label: i("form.fields.port.label"),
3422
- tooltip: i("form.fields.port.tooltip")
3423
- },
3424
- read_timeout: {
3425
- type: L.Text,
3426
- section: M.Basic,
3427
- label: i("form.fields.read_timeout.label"),
3428
- tooltip: i("form.fields.read_timeout.tooltip")
3429
- },
3430
- send_timeout: {
3431
- type: L.Text,
3432
- section: M.Basic,
3433
- label: i("form.fields.send_timeout.label"),
3434
- tooltip: i("form.fields.send_timeout.tooltip")
3435
- },
3436
- sentinel_master: {
3437
- type: L.Text,
3438
- section: M.Basic,
3439
- label: i("form.fields.sentinel_master.label"),
3440
- tooltip: i("form.fields.sentinel_master.tooltip")
3441
- },
3442
- sentinel_nodes: {
3443
- type: L.JsonArray,
3444
- section: M.Basic,
3445
- tooltip: i("form.fields.sentinel_nodes.tooltip")
3446
- },
3447
- sentinel_password: {
3448
- type: L.Redacted,
3449
- section: M.Basic,
3450
- label: i("form.fields.sentinel_password.label"),
3451
- tooltip: i("form.fields.sentinel_password.tooltip")
3452
- },
3453
- sentinel_role: {
3454
- type: L.Text,
3455
- section: M.Basic,
3456
- label: i("form.fields.sentinel_role.label"),
3457
- tooltip: i("form.fields.sentinel_role.tooltip")
3458
- },
3459
- sentinel_username: {
3460
- type: L.Text,
3461
- section: M.Basic,
3462
- label: i("form.fields.sentinel_username.label"),
3463
- tooltip: i("form.fields.sentinel_username.tooltip")
3464
- },
3465
- server_name: {
3466
- type: L.Text,
3467
- section: M.Basic,
3468
- label: i("form.fields.server_name.label"),
3469
- tooltip: i("form.fields.server_name.tooltip")
3470
- },
3471
- ssl_verify: {
3472
- type: L.Text,
3473
- section: M.Basic,
3474
- label: i("form.fields.ssl_verify.label"),
3475
- tooltip: i("form.fields.ssl_verify.tooltip")
3476
- },
3477
- ssl: {
3478
- type: L.Text,
3479
- section: M.Basic,
3480
- label: i("form.fields.ssl.label"),
3481
- tooltip: i("form.fields.ssl.tooltip")
3482
- },
3483
- timeout: {
3484
- type: L.Text,
3485
- section: M.Basic,
3486
- label: i("form.fields.timeout.label"),
3487
- tooltip: i("form.fields.timeout.tooltip")
3488
- },
3489
- username: {
3490
- type: L.Text,
3491
- section: M.Basic,
3492
- label: i("form.fields.username.label"),
3493
- tooltip: i("form.fields.username.tooltip")
3494
- }
3495
- }, y = (p) => {
3496
- const C = {}, s = Object.keys(T);
3497
- for (const k of s)
3498
- p.includes(k) ? C[k] = {
3499
- ...T[k],
3500
- order: p.indexOf(k) + 1
3501
- } : C[k] = {
3502
- ...T[k],
3503
- hidden: !0
3504
- };
3505
- return C;
3506
- }, h = H(() => {
3507
- const p = ["id", "name", "tags", "type", "updated_at", "created_at"];
3508
- switch (u.value) {
3509
- case w.HOST_PORT_CE:
3510
- return y([
3511
- ...p,
3512
- "host",
3513
- "port",
3514
- "timeout",
3515
- "database",
3516
- "username",
3517
- "password",
3518
- "ssl",
3519
- "ssl_verify",
3520
- "server_name"
3521
- ]);
3522
- case w.HOST_PORT_EE:
3523
- return y([
3524
- ...p,
3525
- "host",
3526
- "port",
3527
- "connection_is_proxied",
3528
- "database",
3529
- "username",
3530
- "password",
3531
- "ssl",
3532
- "ssl_verify",
3533
- "server_name",
3534
- "keepalive_backlog",
3535
- "keepalive_pool_size",
3536
- "read_timeout",
3537
- "send_timeout",
3538
- "connect_timeout"
3539
- ]);
3540
- case w.CLUSTER:
3541
- return y([
3542
- ...p,
3543
- "cluster_nodes",
3544
- "cluster_max_redirections",
3545
- "database",
3546
- "username",
3547
- "password",
3548
- "ssl",
3549
- "ssl_verify",
3550
- "server_name",
3551
- "keepalive_backlog",
3552
- "keepalive_pool_size",
3553
- "read_timeout",
3554
- "send_timeout",
3555
- "connect_timeout"
3556
- ]);
3557
- case w.SENTINEL:
3558
- return y([
3559
- ...p,
3560
- "sentinel_master",
3561
- "sentinel_role",
3562
- "sentinel_nodes",
3563
- "sentinel_username",
3564
- "sentinel_password",
3565
- "database",
3566
- "username",
3567
- "password",
3568
- "ssl",
3569
- "ssl_verify",
3570
- "server_name",
3571
- "keepalive_backlog",
3572
- "keepalive_pool_size",
3573
- "read_timeout",
3574
- "send_timeout",
3575
- "connect_timeout"
3576
- ]);
3577
- default:
3578
- throw new Error("Invalid Redis type");
3579
- }
3580
- });
3581
- return (p, C) => (R(), J("div", Td, [
3582
- g(r($i), {
3583
- "code-block-record-formatter": b,
3584
- config: e.config,
3585
- "config-card-doc": e.configCardDoc,
3586
- "config-schema": h.value,
3587
- "entity-type": r(yn).Partial,
3588
- "fetch-url": a.value,
3589
- "hide-title": e.hideTitle,
3590
- "record-resolver": d,
3591
- "onFetch:error": C[0] || (C[0] = (s) => p.$emit("fetch:error", s)),
3592
- "onFetch:success": c,
3593
- onLoading: C[1] || (C[1] = (s) => p.$emit("loading", s))
3594
- }, {
3595
- type: S(() => [
3596
- F("div", null, N(l.value), 1)
3597
- ]),
3598
- _: 1
3599
- }, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
3600
- ]));
3601
- }
3602
- }), wd = "12px";
3603
- function di(e) {
3604
- const {
3605
- redisType: t = "redis-ce"
3606
- } = e, n = "1000", o = gn(wn), { i18n: { t: i } } = it();
3607
- if (!o)
3608
- throw new Error("FORMS_CONFIG must be provided");
3609
- const {
3610
- debouncedQueryChange: a,
3611
- loading: u,
3612
- error: c,
3613
- loadItems: l,
3614
- results: d
3615
- } = Pi(o, ke.list[o.app], n, {
3616
- fetchedItemsKey: "data",
3617
- searchKeys: ["id", "name"]
3618
- }), b = (y) => {
3619
- switch (y) {
3620
- case w.CLUSTER:
3621
- return i("form.options.type.cluster");
3622
- case w.HOST_PORT_CE:
3623
- return i("form.options.type.host_port");
3624
- case w.SENTINEL:
3625
- return i("form.options.type.sentinel");
3626
- case w.HOST_PORT_EE:
3627
- return `${i("form.options.type.host_port")} (${i("form.options.type.enterprise")})`;
3628
- }
3629
- }, T = H(() => (d.value || []).filter((h) => h.type === "redis-ce" || h.type === "redis-ee").map((h) => ({ label: h.id, name: h.name, value: h.id, type: h.type, tag: b(Ue(h)) })).filter((h) => h.type === t));
3630
- return pn(() => {
3631
- l();
3632
- }), {
3633
- items: T,
3634
- loading: u,
3635
- onQueryChange: a,
3636
- error: c,
3637
- loadItems: l
3638
- };
3639
- }
3640
- const Sd = ["id"], Ed = /* @__PURE__ */ Q({
3641
- __name: "RedisConfigurationFormModal",
3642
- props: {
3643
- visible: { type: Boolean },
3644
- partialType: { default: "redis-ee" }
3645
- },
3646
- emits: ["toast", "modal-close", "created"],
3647
- setup(e, { emit: t }) {
3648
- const n = t, { i18n: { t: o } } = it(), i = gn(wn), a = H(() => ({
3649
- ...i,
3650
- cancelRoute: void 0
3651
- })), { getMessageFromError: u } = bn(), c = Ti(), l = H(() => {
3652
- switch (e.partialType) {
3653
- case G.REDIS_CE:
3654
- return G.REDIS_EE;
3655
- case G.REDIS_EE:
3656
- return G.REDIS_CE;
3657
- default:
3658
- return;
3659
- }
3660
- }), d = $(!1), b = $(), T = (p) => {
3661
- n("toast", {
3662
- message: u(p),
3663
- appearance: "danger"
3664
- });
3665
- }, y = (p) => {
3666
- n("toast", {
3667
- message: o("form.partial_created_success_message"),
3668
- appearance: "success"
3669
- }), h(), n("created", p);
3670
- }, h = () => {
3671
- b.value = void 0, n("modal-close"), kt(() => {
3672
- d.value = !1;
3673
- });
3674
- };
3675
- return Te(
3676
- () => e.visible,
3677
- (p) => {
3678
- p && (d.value = !0, kt(() => {
3679
- b.value = `#redis-modal-footer-${c}`;
3680
- }));
3681
- }
3682
- ), (p, C) => {
3683
- const s = j("KModal");
3684
- return R(), q(s, {
3685
- class: "redis-configuration-partial-form",
3686
- "data-testid": "redis-partial-form-modal",
3687
- "full-screen": "",
3688
- title: r(o)("form.redis_partial_modal_title"),
3689
- visible: d.value,
3690
- onCancel: h
3691
- }, {
3692
- footer: S(() => [
3693
- F("div", {
3694
- id: `redis-modal-footer-${r(c)}`,
3695
- class: "redis-modal-footer"
3696
- }, null, 8, Sd)
3697
- ]),
3698
- default: S(() => [
3699
- g(rd, {
3700
- "action-teleport-target": b.value,
3701
- config: a.value,
3702
- "disabled-partial-type": l.value,
3703
- "slidout-top-offset": 0,
3704
- onCancel: h,
3705
- onError: T,
3706
- onUpdate: y
3707
- }, null, 8, ["action-teleport-target", "config", "disabled-partial-type"])
3708
- ]),
3709
- _: 1
3710
- }, 8, ["title", "visible"]);
3711
- };
3712
- }
3713
- }), Cd = /* @__PURE__ */ ie(Ed, [["__scopeId", "data-v-78142ed8"]]), Od = { class: "selected-redis-config" }, Id = ["data-testid"], xd = {
3714
- class: "select-item-name",
3715
- "data-testid": "selected-redis-config"
3716
- }, Rd = {
3717
- class: "empty-redis-config",
3718
- "data-testid": "empty-redis-config"
3719
- }, $d = /* @__PURE__ */ Q({
3720
- __name: "RedisConfigurationSelector",
3721
- props: {
3722
- modelValue: {},
3723
- redisType: { default: "redis-ee" },
3724
- placeholder: {},
3725
- emptyStateText: {},
3726
- showCreateButton: { type: Boolean, default: !0 },
3727
- createButtonText: {}
3728
- },
3729
- emits: ["update:modelValue", "change", "create-new", "error", "modal-close"],
3730
- setup(e, { emit: t }) {
3731
- const n = t, { i18n: { t: o } } = it(), {
3732
- items: i,
3733
- loading: a,
3734
- onQueryChange: u,
3735
- error: c,
3736
- loadItems: l
3737
- } = di({
3738
- redisType: e.redisType
3739
- }), d = $(!1), b = (p) => {
3740
- const C = p == null ? void 0 : p.value;
3741
- n("update:modelValue", C), n("change", p);
3742
- }, T = () => {
3743
- d.value = !0;
3744
- }, y = () => {
3745
- d.value = !1, n("modal-close");
3746
- }, h = (p) => {
3747
- d.value = !1, l(), b({
3748
- name: p.name,
3749
- value: p.id,
3750
- label: p.name
3751
- });
3752
- };
3753
- return Te(c, (p) => {
3754
- p && n("error", new Error(String(p)));
3755
- }), (p, C) => {
3756
- const s = j("KBadge"), k = j("KSelect");
3757
- return R(), J(je, null, [
3758
- g(k, {
3759
- class: "redis-config-select-trigger",
3760
- "enable-filtering": "",
3761
- "filter-function": () => !0,
3762
- items: r(i),
3763
- loading: r(a),
3764
- "model-value": e.modelValue,
3765
- placeholder: e.placeholder || r(o)("selector.placeholder"),
3766
- onChange: b,
3767
- onQueryChange: r(u)
3768
- }, mn({
3769
- "selected-item-template": S(({ item: m }) => [
3770
- F("div", Od, N(m.name), 1)
3771
- ]),
3772
- "item-template": S(({ item: m }) => [
3773
- F("div", {
3774
- class: "plugin-form-redis-configuration-dropdown-item",
3775
- "data-testid": `redis-configuration-dropdown-item-${m.name}`
3776
- }, [
3777
- F("span", xd, N(m.name), 1),
3778
- g(s, {
3779
- appearance: "info",
3780
- class: "select-item-label"
3781
- }, {
3782
- default: S(() => [
3783
- ne(N(m.tag), 1)
3784
- ]),
3785
- _: 2
3786
- }, 1024)
3787
- ], 8, Id)
3788
- ]),
3789
- empty: S(() => [
3790
- F("div", Rd, N(e.emptyStateText || r(o)("selector.empty_state")), 1)
3791
- ]),
3792
- _: 2
3793
- }, [
3794
- e.showCreateButton ? {
3795
- name: "dropdown-footer-text",
3796
- fn: S(() => [
3797
- F("div", {
3798
- class: "new-redis-config-area",
3799
- "data-testid": "new-redis-config-area",
3800
- onClick: T
3801
- }, [
3802
- g(r(bt), { size: r(wd) }, null, 8, ["size"]),
3803
- F("span", null, N(e.createButtonText || r(o)("selector.create_new")), 1)
3804
- ])
3805
- ]),
3806
- key: "0"
3807
- } : void 0
3808
- ]), 1032, ["items", "loading", "model-value", "placeholder", "onQueryChange"]),
3809
- g(Cd, {
3810
- "partial-type": e.redisType,
3811
- visible: d.value,
3812
- onCreated: h,
3813
- onModalClose: y
3814
- }, null, 8, ["partial-type", "visible"])
3815
- ], 64);
3816
- };
3817
- }
3818
- }), qd = /* @__PURE__ */ ie($d, [["__scopeId", "data-v-9e30c0c1"]]), Wd = {
3819
- useLinkedPlugins: si,
3820
- useLinkedPluginsFetcher: Ne,
3821
- useRedisConfigurationSelector: di
3822
- };
3823
- export {
3824
- yd as DeleteWarningModal,
3825
- pd as LinkedPlugins,
3826
- G as PartialType,
3827
- zd as RedisConfigurationConfigCard,
3828
- rd as RedisConfigurationForm,
3829
- Cd as RedisConfigurationFormModal,
3830
- Hd as RedisConfigurationList,
3831
- qd as RedisConfigurationSelector,
3832
- w as RedisType,
3833
- Wd as composables,
3834
- Fd as constants,
3835
- Kd as helpers
3836
- };