@achyutlabsau/vue-payment-gateway 1.0.0-beta.2 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./PBtn-B_JOD69N.js";
2
- import { a as t, c as n, l as r } from "./logger-Chsffh2c.js";
2
+ import { a as t, c as n, l as r } from "./logger-bcgKGDGU.js";
3
3
  import { Fragment as i, createBlock as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, openBlock as u, renderList as d, toDisplayString as f, unref as p, withCtx as m } from "vue";
4
4
  import { QCard as h, QIcon as g } from "quasar";
5
5
  //#region src/components/PairInstructions.vue?vue&type=script&setup=true&lang.ts
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { c as e, l as t, n, o as r, s as i } from "./PBtn-B_JOD69N.js";
2
- import { D as a, E as o, T as s, h as c, p as l, t as u, x as d } from "./logger-Chsffh2c.js";
3
- import { f, m as p } from "./mx51-CYfhvzmv.js";
2
+ import { D as a, E as o, T as s, h as c, p as l, t as u, x as d } from "./logger-bcgKGDGU.js";
3
+ import { f, m as p } from "./mx51-B6PiGlK6.js";
4
4
  import { CardScheme as m, formatCents as h, generateTransactionId as g, maskPan as _, normalizeCardScheme as v, toCents as y, toMajorUnits as b } from "./utils.js";
5
- import { a as x, i as S, r as C } from "./worldline-bWeQvvEs.js";
6
- import { o as w, t as T } from "./tyro-P_beqaoJ.js";
7
- import { t as E } from "./linkly-C9NDmzIU.js";
8
- import { t as D } from "./smartpay-BlPtSJAm.js";
9
- import { t as O } from "./till-payment-DFyssYl7.js";
10
- import { t as k } from "./valpay-C31V13Nz.js";
5
+ import { a as x, i as S, r as C } from "./worldline-Czd_t09O.js";
6
+ import { o as w, t as T } from "./tyro-Cwj6n8b5.js";
7
+ import { t as E } from "./linkly-CYp85iRw.js";
8
+ import { t as D } from "./smartpay-V-LInsZT.js";
9
+ import { t as O } from "./till-payment-CQh1RH7y.js";
10
+ import { t as k } from "./valpay-BiqumlSN.js";
11
11
  import { createBlock as A, createCommentVNode as j, createElementBlock as M, defineComponent as N, openBlock as P, unref as F } from "vue";
12
12
  import { useEventListener as I, useScriptTag as L } from "@vueuse/core";
13
13
  //#region src/plugin/types.ts
@@ -1,6 +1,6 @@
1
1
  import { a as e, n as t, u as n } from "./PBtn-B_JOD69N.js";
2
- import { T as r, d as i, h as a, i as o, o as s, r as c, u as l } from "./logger-Chsffh2c.js";
3
- import { t as ee } from "./PairInstructions-Dt9aD4Qn.js";
2
+ import { T as r, d as i, h as a, i as o, o as s, r as c, u as l } from "./logger-bcgKGDGU.js";
3
+ import { t as ee } from "./PairInstructions-BIyXy5Xu.js";
4
4
  import { delay as u, formatCents as d, generateTransactionId as f, isNetworkError as p, isServerError as m, isTimeoutError as h, maskPan as g, normalizeCardScheme as _ } from "./utils.js";
5
5
  import { n as te, t as ne } from "./core-ExhZA5wz.js";
6
6
  import { createBlock as v, createElementBlock as y, createElementVNode as b, createTextVNode as x, createVNode as S, defineComponent as C, onMounted as re, openBlock as w, ref as T, renderSlot as ie, resolveDirective as ae, toDisplayString as oe, unref as E, useModel as se, withCtx as D, withDirectives as O } from "vue";
package/dist/linkly.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./linkly-C9NDmzIU.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./linkly-CYp85iRw.js";
2
2
  export { o as CurrencyCodes, n as LinklyKeyType, c as PairLinkly, e as ReceiptAutoPrint, a as ResponseCodes, r as TransactionNotFoundError, s as TransactionOutcome, t as TransactionTypes, i as useLinkly };
@@ -1,25 +1,25 @@
1
1
  import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, resolveDirective as m, toDisplayString as h, unref as g, useModel as ee, watch as te, withCtx as _, withDirectives as ne } from "vue";
2
2
  import { Dexie as v } from "dexie";
3
- import { QBadge as y, QBtn as b, QCard as re, QDialog as ie, QIcon as x, QInput as ae, QItem as oe, QItemSection as S, QList as se, QMenu as ce, QSelect as C, QToggle as le, QToolbar as ue, QToolbarTitle as de, QTooltip as w } from "quasar";
4
- import T from "dayjs";
3
+ import { QBadge as y, QBtn as b, QCard as re, QDialog as ie, QIcon as x, QInput as ae, QItem as S, QItemSection as C, QList as oe, QMenu as se, QSelect as w, QToggle as ce, QToolbar as le, QToolbarTitle as ue, QTooltip as T } from "quasar";
4
+ import E from "dayjs";
5
5
  //#region src/logger/logger.enums.ts
6
- var E = /* @__PURE__ */ function(e) {
6
+ var D = /* @__PURE__ */ function(e) {
7
7
  return e.Debug = "debug", e.Info = "info", e.Warn = "warn", e.Error = "error", e;
8
- }({}), D = {
8
+ }({}), O = {
9
9
  debug: 10,
10
10
  info: 20,
11
11
  warn: 30,
12
12
  error: 40
13
- }, O = /* @__PURE__ */ function(e) {
13
+ }, k = /* @__PURE__ */ function(e) {
14
14
  return e.Plugin = "plugin", e.Core = "core", e;
15
- }({}), k = /* @__PURE__ */ function(e) {
15
+ }({}), A = /* @__PURE__ */ function(e) {
16
16
  return e.SdkInit = "sdk.init", e.SdkInitFailed = "sdk.init.failed", e.TerminalStatus = "terminal.status", e.PairStart = "pair.start", e.PairOk = "pair.ok", e.PairFailed = "pair.failed", e.Unpair = "unpair", e.PurchaseStart = "purchase.start", e.PurchaseOk = "purchase.ok", e.PurchaseDeclined = "purchase.declined", e.PurchaseFailed = "purchase.failed", e.RefundStart = "refund.start", e.RefundOk = "refund.ok", e.RefundDeclined = "refund.declined", e.RefundFailed = "refund.failed", e.CancelRequested = "cancel.requested", e.SettleStart = "settle.start", e.SettleOk = "settle.ok", e.SettleFailed = "settle.failed", e.ReprintStart = "reprint.start", e.ReprintOk = "reprint.ok", e.ReprintFailed = "reprint.failed", e.PollTick = "poll.tick", e.PollRetry = "poll.retry", e.PollTimeout = "poll.timeout", e.HttpRequest = "http.request", e.HttpResponse = "http.response", e.HttpError = "http.error", e.AuthStart = "auth.start", e.AuthOk = "auth.ok", e.AuthFailed = "auth.failed", e.ReceiptEmit = "receipt.emit", e.LoggerRotate = "logger.rotate", e.LoggerError = "logger.error", e;
17
- }({}), A = "paymentGatewayLogs", j = "timapiLogs", M = "entries", N = 1e3, P = 200, F = 3e5, I = 864e5, L = class extends v {
17
+ }({}), j = "paymentGatewayLogs", M = "timapiLogs", N = "entries", P = 1e3, F = 200, I = 3e5, L = 864e5, R = class extends v {
18
18
  entries;
19
- constructor(e = A) {
20
- super(e), this.version(1).stores({ [M]: "++id, timestamp, gateway, level, transactionId, [gateway+timestamp]" });
19
+ constructor(e = j) {
20
+ super(e), this.version(1).stores({ [N]: "++id, timestamp, gateway, level, transactionId, [gateway+timestamp]" });
21
21
  }
22
- }, R = class {
22
+ }, z = class {
23
23
  dbName;
24
24
  db = null;
25
25
  degraded = !1;
@@ -28,7 +28,7 @@ var E = /* @__PURE__ */ function(e) {
28
28
  writesSinceRotation = 0;
29
29
  lastRotationAt = 0;
30
30
  degradationReported = !1;
31
- constructor(e = A) {
31
+ constructor(e = j) {
32
32
  this.dbName = e;
33
33
  }
34
34
  getDb() {
@@ -36,7 +36,7 @@ var E = /* @__PURE__ */ function(e) {
36
36
  if (this.db) return this.db;
37
37
  if (typeof indexedDB > "u") return this.degrade("indexedDB is unavailable in this environment"), null;
38
38
  try {
39
- return this.db = new L(this.dbName), this.db;
39
+ return this.db = new R(this.dbName), this.db;
40
40
  } catch (e) {
41
41
  return this.degrade(e), null;
42
42
  }
@@ -52,7 +52,7 @@ var E = /* @__PURE__ */ function(e) {
52
52
  ...t,
53
53
  id: this.memoryNextId++
54
54
  });
55
- this.memory.length > N && (this.memory = this.memory.slice(this.memory.length - N));
55
+ this.memory.length > P && (this.memory = this.memory.slice(this.memory.length - P));
56
56
  }
57
57
  async write(e) {
58
58
  if (e.length === 0) return;
@@ -68,14 +68,14 @@ var E = /* @__PURE__ */ function(e) {
68
68
  }
69
69
  }
70
70
  shouldRotate(e = Date.now()) {
71
- return this.degraded || this.writesSinceRotation < P ? !1 : e - this.lastRotationAt >= F;
71
+ return this.degraded || this.writesSinceRotation < F ? !1 : e - this.lastRotationAt >= I;
72
72
  }
73
73
  async rotate(e, t, n = Date.now()) {
74
74
  let r = this.getDb();
75
75
  if (!r) return 0;
76
76
  this.writesSinceRotation = 0, this.lastRotationAt = n;
77
77
  try {
78
- let i = n - e * I, a = await r.entries.where("timestamp").below(i).delete(), o = await r.entries.count();
78
+ let i = n - e * L, a = await r.entries.where("timestamp").below(i).delete(), o = await r.entries.count();
79
79
  if (o > t) {
80
80
  let e = o - t, n = await r.entries.orderBy("id").limit(e).primaryKeys();
81
81
  await r.entries.bulkDelete(n), a += n.length;
@@ -93,8 +93,8 @@ var E = /* @__PURE__ */ function(e) {
93
93
  to: a
94
94
  }) : this.queryMemory(e);
95
95
  if (n) {
96
- let e = D[n];
97
- l = l.filter((t) => (D[t.level] ?? 0) >= e);
96
+ let e = O[n];
97
+ l = l.filter((t) => (O[t.level] ?? 0) >= e);
98
98
  }
99
99
  if (o) {
100
100
  let e = o.toLowerCase();
@@ -162,7 +162,7 @@ var E = /* @__PURE__ */ function(e) {
162
162
  get table() {
163
163
  return this.getDb()?.entries ?? null;
164
164
  }
165
- }, z = "[redacted]", B = "[truncated]", V = 5, H = 50, U = 50, W = 2e3, G = 8e3, fe = /(api[-_]?key|secret|password|passwd|credential|token|authorization|auth[-_]?header|bearer|\bpin\b|cvv|cvc|track[12]?|magstripe|emv|cardholder[-_]?name|account[-_]?number)/i, pe = /(card[-_]?number|maskedcard|masked[-_]?pan|\bpan\b|primary[-_]?account)/i, me = /\b(?:\d[ -]?){12,18}\d\b/g, K = (e) => {
165
+ }, B = "[redacted]", V = "[truncated]", H = 5, U = 50, W = 50, G = 2e3, K = 8e3, de = /(api[-_]?key|secret|password|passwd|credential|token|authorization|auth[-_]?header|bearer|\bpin\b|cvv|cvc|track[12]?|magstripe|emv|cardholder[-_]?name|account[-_]?number)/i, fe = /(card[-_]?number|maskedcard|masked[-_]?pan|\bpan\b|primary[-_]?account)/i, pe = /\b(?:\d[ -]?){12,18}\d\b/g, q = (e) => {
166
166
  if (e.length < 13 || e.length > 19) return !1;
167
167
  let t = 0, n = !1;
168
168
  for (let r = e.length - 1; r >= 0; r--) {
@@ -173,16 +173,16 @@ var E = /* @__PURE__ */ function(e) {
173
173
  n && (a *= 2, a > 9 && (a -= 9)), t += a, n = !n;
174
174
  }
175
175
  return t % 10 == 0;
176
- }, q = (e) => `**** **** **** ${e.slice(-4)}`, J = (e) => {
177
- let t = e.replace(me, (e) => {
176
+ }, J = (e) => `**** **** **** ${e.slice(-4)}`, Y = (e) => {
177
+ let t = e.replace(pe, (e) => {
178
178
  let t = e.replace(/[ -]/g, "");
179
- return K(t) ? q(t) : e;
179
+ return q(t) ? J(t) : e;
180
180
  });
181
- return t.length > W ? `${t.slice(0, W)}...${B}` : t;
182
- }, Y = (e, t, n) => {
181
+ return t.length > G ? `${t.slice(0, G)}...${V}` : t;
182
+ }, X = (e, t, n) => {
183
183
  if (e == null) return e;
184
184
  let r = typeof e;
185
- if (r === "string") return J(e);
185
+ if (r === "string") return Y(e);
186
186
  if (r === "number" || r === "boolean") return e;
187
187
  if (r === "bigint") return `${e.toString()}n`;
188
188
  if (r === "function") return "[function]";
@@ -191,42 +191,42 @@ var E = /* @__PURE__ */ function(e) {
191
191
  if (e instanceof RegExp) return e.toString();
192
192
  if (e instanceof Error) return {
193
193
  name: e.name,
194
- message: J(e.message),
195
- stack: e.stack ? J(e.stack.split("\n").slice(0, 5).join("\n")) : void 0
194
+ message: Y(e.message),
195
+ stack: e.stack ? Y(e.stack.split("\n").slice(0, 5).join("\n")) : void 0
196
196
  };
197
- if (t >= V) return B;
197
+ if (t >= H) return V;
198
198
  if (n.has(e)) return "[circular]";
199
199
  if (n.add(e), Array.isArray(e)) {
200
- let r = e.slice(0, H).map((e) => Y(e, t + 1, n));
201
- return e.length > H && r.push(`${B} (${e.length - H} more)`), r;
200
+ let r = e.slice(0, U).map((e) => X(e, t + 1, n));
201
+ return e.length > U && r.push(`${V} (${e.length - U} more)`), r;
202
202
  }
203
- if (e instanceof Map) return Y(Object.fromEntries(e), t, n);
204
- if (e instanceof Set) return Y([...e], t, n);
203
+ if (e instanceof Map) return X(Object.fromEntries(e), t, n);
204
+ if (e instanceof Set) return X([...e], t, n);
205
205
  let i = {}, a = Object.entries(e);
206
- for (let [e, r] of a.slice(0, U)) {
207
- if (pe.test(e)) {
206
+ for (let [e, r] of a.slice(0, W)) {
207
+ if (fe.test(e)) {
208
208
  let t = typeof r == "string" ? r.replace(/\D/g, "") : "";
209
- i[e] = t ? q(t) : z;
209
+ i[e] = t ? J(t) : B;
210
210
  continue;
211
211
  }
212
- if (fe.test(e)) {
213
- i[e] = z;
212
+ if (de.test(e)) {
213
+ i[e] = B;
214
214
  continue;
215
215
  }
216
- i[e] = Y(r, t + 1, n);
216
+ i[e] = X(r, t + 1, n);
217
217
  }
218
- return a.length > U && (i[B] = `${a.length - U} more keys`), i;
219
- }, X = (e) => {
218
+ return a.length > W && (i[V] = `${a.length - W} more keys`), i;
219
+ }, Z = (e) => {
220
220
  if (e == null) return;
221
- let t = Y(e, 0, /* @__PURE__ */ new WeakSet());
221
+ let t = X(e, 0, /* @__PURE__ */ new WeakSet());
222
222
  try {
223
223
  let e = JSON.stringify(t);
224
- if (e && e.length > G) return { [B]: `data exceeded ${G} characters (${e.length})` };
224
+ if (e && e.length > K) return { [V]: `data exceeded ${K} characters (${e.length})` };
225
225
  } catch {
226
- return { [B]: "data was not serializable" };
226
+ return { [V]: "data was not serializable" };
227
227
  }
228
228
  return t;
229
- }, Z = (e) => J(e);
229
+ }, me = (e) => Y(e);
230
230
  //#endregion
231
231
  //#region src/utils/downloadFile.ts
232
232
  function he(e, t) {
@@ -237,16 +237,16 @@ function he(e, t) {
237
237
  //#region src/logger/logger.ts
238
238
  var ge = {
239
239
  enabled: !0,
240
- level: E.Info,
240
+ level: D.Info,
241
241
  retentionDays: 15,
242
242
  maxEntries: 2e4,
243
243
  consoleMirror: !1,
244
244
  sinks: []
245
245
  }, _e = 250, ve = 100, ye = {
246
- [E.Debug]: "debug",
247
- [E.Info]: "info",
248
- [E.Warn]: "warn",
249
- [E.Error]: "error"
246
+ [D.Debug]: "debug",
247
+ [D.Info]: "info",
248
+ [D.Warn]: "warn",
249
+ [D.Error]: "error"
250
250
  }, be = () => {
251
251
  let e = Math.random().toString(36).slice(2, 10);
252
252
  return `${Date.now().toString(36)}-${e}`;
@@ -267,7 +267,7 @@ var ge = {
267
267
  ...ge,
268
268
  sinks: []
269
269
  },
270
- store: new R(),
270
+ store: new z(),
271
271
  sessionId: be(),
272
272
  queue: [],
273
273
  flushTimer: null,
@@ -297,16 +297,16 @@ var ge = {
297
297
  });
298
298
  }
299
299
  debug(e, t, n) {
300
- this.log(E.Debug, e, t, n);
300
+ this.log(D.Debug, e, t, n);
301
301
  }
302
302
  info(e, t, n) {
303
- this.log(E.Info, e, t, n);
303
+ this.log(D.Info, e, t, n);
304
304
  }
305
305
  warn(e, t, n) {
306
- this.log(E.Warn, e, t, n);
306
+ this.log(D.Warn, e, t, n);
307
307
  }
308
308
  error(e, t, n) {
309
- this.log(E.Error, e, t, n);
309
+ this.log(D.Error, e, t, n);
310
310
  }
311
311
  log(e, t, n, r, i) {
312
312
  try {
@@ -314,13 +314,13 @@ var ge = {
314
314
  let a = {
315
315
  timestamp: Date.now(),
316
316
  level: e,
317
- gateway: this.context.gateway ?? O.Core,
317
+ gateway: this.context.gateway ?? k.Core,
318
318
  event: t,
319
- message: Z(n),
319
+ message: me(n),
320
320
  sessionId: this.core.sessionId
321
321
  };
322
322
  this.context.transactionId !== void 0 && (a.transactionId = this.context.transactionId), i !== void 0 && (a.durationMs = i);
323
- let o = X(r);
323
+ let o = Z(r);
324
324
  o !== void 0 && (a.data = o), this.core.options.consoleMirror && this.mirrorToConsole(a), this.enqueue(a);
325
325
  } catch (e) {
326
326
  console.warn("[vue-payment-gateway] failed to record log entry:", e);
@@ -328,16 +328,16 @@ var ge = {
328
328
  }
329
329
  time(e, t, n) {
330
330
  let r = Date.now();
331
- return this.log(E.Debug, e, t, n), { end: (e, n, i) => {
331
+ return this.log(D.Debug, e, t, n), { end: (e, n, i) => {
332
332
  let a = this.levelForEvent(e);
333
333
  this.log(a, e, n ?? t, i, Date.now() - r);
334
334
  } };
335
335
  }
336
336
  isLevelEnabled(e) {
337
- return this.core.options.enabled ? D[e] >= D[this.core.options.level] : !1;
337
+ return this.core.options.enabled ? O[e] >= O[this.core.options.level] : !1;
338
338
  }
339
339
  levelForEvent(e) {
340
- return e.endsWith(".failed") || e === k.PollTimeout || e === k.HttpError ? E.Error : e.endsWith(".declined") || e === k.PollRetry ? E.Warn : E.Info;
340
+ return e.endsWith(".failed") || e === A.PollTimeout || e === A.HttpError ? D.Error : e.endsWith(".declined") || e === A.PollRetry ? D.Warn : D.Info;
341
341
  }
342
342
  mirrorToConsole(e) {
343
343
  let t = ye[e.level], n = `[${e.gateway}] ${e.event}`, r = e.transactionId ? ` (txn ${e.transactionId})` : "";
@@ -379,7 +379,7 @@ var ge = {
379
379
  }
380
380
  async rotate() {
381
381
  let { retentionDays: e, maxEntries: t } = this.core.options, n = await this.core.store.rotate(e, t);
382
- return n > 0 && this.log(E.Debug, k.LoggerRotate, `Trimmed ${n} expired log entries`, {
382
+ return n > 0 && this.log(D.Debug, A.LoggerRotate, `Trimmed ${n} expired log entries`, {
383
383
  retentionDays: e,
384
384
  maxEntries: t
385
385
  }), n;
@@ -413,14 +413,14 @@ var ge = {
413
413
  __name: "LogRow",
414
414
  props: { entry: {} },
415
415
  setup(e) {
416
- let n = e, o = f(!1), c = t(() => T(n.entry.timestamp).format("YYYY-MM-DD HH:mm:ss.SSS")), l = t(() => {
416
+ let n = e, o = f(!1), c = t(() => E(n.entry.timestamp).format("YYYY-MM-DD HH:mm:ss.SSS")), l = t(() => {
417
417
  if (n.entry.data === void 0) return null;
418
418
  try {
419
419
  return JSON.stringify(n.entry.data, null, 2);
420
420
  } catch {
421
421
  return String(n.entry.data);
422
422
  }
423
- }), p = t(() => n.entry.level === E.Error ? "negative" : n.entry.level === E.Warn ? "orange" : n.entry.level === E.Debug ? "grey-6" : "primary"), m = t(() => n.entry.level === E.Error ? "bg-red-50 text-red-900 dark:bg-red-950/40 dark:text-red-200 dark:hover:bg-red-950/60" : n.entry.level === E.Warn ? "bg-orange-50 text-orange-900 dark:bg-amber-950/40 dark:text-amber-200 dark:hover:bg-amber-950/60" : n.entry.level === E.Debug ? "text-gray-500 dark:text-gray-400" : "");
423
+ }), p = t(() => n.entry.level === D.Error ? "negative" : n.entry.level === D.Warn ? "orange" : n.entry.level === D.Debug ? "grey-6" : "primary"), m = t(() => n.entry.level === D.Error ? "bg-red-50 text-red-900 dark:bg-red-950/40 dark:text-red-200 dark:hover:bg-red-950/60" : n.entry.level === D.Warn ? "bg-orange-50 text-orange-900 dark:bg-amber-950/40 dark:text-amber-200 dark:hover:bg-amber-950/60" : n.entry.level === D.Debug ? "text-gray-500 dark:text-gray-400" : "");
424
424
  return (t, n) => (d(), i("div", { class: u(["px-2 py-1.5 hover:bg-gray-50 dark:hover:bg-slate-800", m.value]) }, [a("div", ze, [
425
425
  s(g(y), {
426
426
  class: "uppercase",
@@ -460,30 +460,30 @@ var ge = {
460
460
  }),
461
461
  emits: ["update:modelValue"],
462
462
  setup(c) {
463
- let l = c, u = ee(c, "modelValue"), v = f(!1), T = f(null), D = f(null), O = f(""), k = f([]), A = f(0), j = f([]), M = f(!1), N = f(!1), P = f(/* @__PURE__ */ new Set()), F = Object.values(E).map((e) => ({
463
+ let l = c, u = ee(c, "modelValue"), v = f(!1), E = f(null), O = f(null), k = f(""), A = f([]), j = f(0), M = f([]), N = f(!1), P = f(!1), F = f(/* @__PURE__ */ new Set()), I = Object.values(D).map((e) => ({
464
464
  label: e.toUpperCase(),
465
465
  value: e
466
- })), I = async () => {
467
- N.value = !0;
466
+ })), L = async () => {
467
+ P.value = !0;
468
468
  try {
469
- if (k.value = await Q.query({
470
- gateway: l.gateway ?? T.value ?? void 0,
471
- level: D.value ?? void 0,
472
- search: O.value || void 0,
469
+ if (A.value = await Q.query({
470
+ gateway: l.gateway ?? E.value ?? void 0,
471
+ level: O.value ?? void 0,
472
+ search: k.value || void 0,
473
473
  limit: $
474
- }), A.value = await Q.count(), M.value = Q.isDegraded(), !l.gateway) {
474
+ }), j.value = await Q.count(), N.value = Q.isDegraded(), !l.gateway) {
475
475
  let e = await Q.gateways();
476
- j.value = e.map((e) => ({
476
+ M.value = e.map((e) => ({
477
477
  label: String(e),
478
478
  value: e
479
- }));
479
+ })), E.value !== null && !e.includes(E.value) && (E.value = null);
480
480
  }
481
481
  } finally {
482
- N.value = !1;
482
+ P.value = !1;
483
483
  }
484
- }, L = t(() => {
484
+ }, R = t(() => {
485
485
  let e = /* @__PURE__ */ new Map();
486
- for (let t of k.value) {
486
+ for (let t of A.value) {
487
487
  let n = t.transactionId ?? nt, r = e.get(n);
488
488
  r ? r.push(t) : e.set(n, [t]);
489
489
  }
@@ -491,27 +491,29 @@ var ge = {
491
491
  key: e,
492
492
  entries: t
493
493
  }));
494
- }), R = (e) => !P.value.has(e), z = (e) => {
495
- let t = new Set(P.value);
496
- t.has(e) ? t.delete(e) : t.add(e), P.value = t;
497
- }, B = async (e) => {
494
+ }), z = t(() => !!(E.value || O.value || k.value)), B = t(() => P.value ? "Loading…" : j.value === 0 ? "No log entries recorded yet." : z.value ? `No entries match these filters — ${j.value} logged events are hidden.` : "No log entries match these filters."), V = () => {
495
+ E.value = null, O.value = null, k.value = "";
496
+ }, H = (e) => !F.value.has(e), U = (e) => {
497
+ let t = new Set(F.value);
498
+ t.has(e) ? t.delete(e) : t.add(e), F.value = t;
499
+ }, W = async (e) => {
498
500
  await Q.export({
499
501
  format: e,
500
- gateway: l.gateway ?? T.value ?? void 0,
501
- level: D.value ?? void 0,
502
- search: O.value || void 0
502
+ gateway: l.gateway ?? E.value ?? void 0,
503
+ level: O.value ?? void 0,
504
+ search: k.value || void 0
503
505
  });
504
- }, V = async () => {
505
- await Q.clear({ gateway: l.gateway ?? T.value ?? void 0 }), await I();
506
+ }, G = async () => {
507
+ await Q.clear({ gateway: l.gateway ?? E.value ?? void 0 }), l.gateway || (E.value = null), await L();
506
508
  };
507
509
  return te([
508
510
  u,
509
- T,
510
- D,
511
- O
511
+ E,
512
+ O,
513
+ k
512
514
  ], ([e]) => {
513
- e && I();
514
- }), (t, l) => {
515
+ e && L();
516
+ }, { immediate: !0 }), (t, l) => {
515
517
  let f = m("close-popup");
516
518
  return d(), n(g(ie), {
517
519
  modelValue: u.value,
@@ -520,9 +522,9 @@ var ge = {
520
522
  }, {
521
523
  default: _(() => [s(g(re), { class: "dark:!bg-slate-900 dark:text-gray-100 flex h-full w-full flex-col overflow-hidden" }, {
522
524
  default: _(() => [
523
- s(g(ue), { class: "bg-primary text-white gap-3" }, {
525
+ s(g(le), { class: "bg-primary text-white gap-3" }, {
524
526
  default: _(() => [
525
- s(g(de), null, {
527
+ s(g(ue), null, {
526
528
  default: _(() => [o(h(c.title), 1)]),
527
529
  _: 1
528
530
  }),
@@ -530,11 +532,11 @@ var ge = {
530
532
  dense: "",
531
533
  flat: "",
532
534
  icon: g(Le),
533
- loading: N.value,
535
+ loading: P.value,
534
536
  round: "",
535
- onClick: I
537
+ onClick: L
536
538
  }, {
537
- default: _(() => [s(g(w), { class: "bg-slate-700 text-base" }, {
539
+ default: _(() => [s(g(T), { class: "bg-slate-700 text-base" }, {
538
540
  default: _(() => [...l[7] ||= [o("Refresh", -1)]]),
539
541
  _: 1
540
542
  })]),
@@ -546,25 +548,25 @@ var ge = {
546
548
  icon: g(Me),
547
549
  round: ""
548
550
  }, {
549
- default: _(() => [s(g(w), { class: "bg-slate-700 text-base" }, {
551
+ default: _(() => [s(g(T), { class: "bg-slate-700 text-base" }, {
550
552
  default: _(() => [...l[8] ||= [o("Export", -1)]]),
551
553
  _: 1
552
- }), s(g(ce), { "auto-close": "" }, {
553
- default: _(() => [s(g(se), { style: { "min-width": "160px" } }, {
554
- default: _(() => [s(g(oe), {
554
+ }), s(g(se), { "auto-close": "" }, {
555
+ default: _(() => [s(g(oe), { style: { "min-width": "160px" } }, {
556
+ default: _(() => [s(g(S), {
555
557
  clickable: "",
556
- onClick: l[0] ||= (e) => B("txt")
558
+ onClick: l[0] ||= (e) => W("txt")
557
559
  }, {
558
- default: _(() => [s(g(S), null, {
560
+ default: _(() => [s(g(C), null, {
559
561
  default: _(() => [...l[9] ||= [o("Download .txt", -1)]]),
560
562
  _: 1
561
563
  })]),
562
564
  _: 1
563
- }), s(g(oe), {
565
+ }), s(g(S), {
564
566
  clickable: "",
565
- onClick: l[1] ||= (e) => B("json")
567
+ onClick: l[1] ||= (e) => W("json")
566
568
  }, {
567
- default: _(() => [s(g(S), null, {
569
+ default: _(() => [s(g(C), null, {
568
570
  default: _(() => [...l[10] ||= [o("Download .json", -1)]]),
569
571
  _: 1
570
572
  })]),
@@ -581,9 +583,9 @@ var ge = {
581
583
  flat: "",
582
584
  icon: g(Re),
583
585
  round: "",
584
- onClick: V
586
+ onClick: G
585
587
  }, {
586
- default: _(() => [s(g(w), { class: "bg-slate-700 text-base" }, {
588
+ default: _(() => [s(g(T), { class: "bg-slate-700 text-base" }, {
587
589
  default: _(() => [...l[11] ||= [o("Clear logs", -1)]]),
588
590
  _: 1
589
591
  })]),
@@ -595,7 +597,7 @@ var ge = {
595
597
  icon: g(ke),
596
598
  round: ""
597
599
  }, {
598
- default: _(() => [s(g(w), { class: "bg-slate-700 text-base" }, {
600
+ default: _(() => [s(g(T), { class: "bg-slate-700 text-base" }, {
599
601
  default: _(() => [...l[12] ||= [o("Close", -1)]]),
600
602
  _: 1
601
603
  })]),
@@ -605,11 +607,11 @@ var ge = {
605
607
  _: 1
606
608
  }),
607
609
  a("div", qe, [
608
- c.gateway ? r("", !0) : (d(), n(g(C), {
610
+ c.gateway ? r("", !0) : (d(), n(g(w), {
609
611
  key: 0,
610
- modelValue: T.value,
611
- "onUpdate:modelValue": l[2] ||= (e) => T.value = e,
612
- options: j.value,
612
+ modelValue: E.value,
613
+ "onUpdate:modelValue": l[2] ||= (e) => E.value = e,
614
+ options: M.value,
613
615
  class: "min-w-40",
614
616
  clearable: "",
615
617
  dense: "",
@@ -618,10 +620,10 @@ var ge = {
618
620
  "map-options": "",
619
621
  outlined: ""
620
622
  }, null, 8, ["modelValue", "options"])),
621
- s(g(C), {
622
- modelValue: D.value,
623
- "onUpdate:modelValue": l[3] ||= (e) => D.value = e,
624
- options: g(F),
623
+ s(g(w), {
624
+ modelValue: O.value,
625
+ "onUpdate:modelValue": l[3] ||= (e) => O.value = e,
626
+ options: g(I),
625
627
  class: "min-w-32",
626
628
  clearable: "",
627
629
  dense: "",
@@ -631,8 +633,8 @@ var ge = {
631
633
  outlined: ""
632
634
  }, null, 8, ["modelValue", "options"]),
633
635
  s(g(ae), {
634
- modelValue: O.value,
635
- "onUpdate:modelValue": l[4] ||= (e) => O.value = e,
636
+ modelValue: k.value,
637
+ "onUpdate:modelValue": l[4] ||= (e) => k.value = e,
636
638
  class: "min-w-56 grow",
637
639
  clearable: "",
638
640
  debounce: "250",
@@ -643,7 +645,7 @@ var ge = {
643
645
  prepend: _(() => [s(g(x), { name: g(Ie) }, null, 8, ["name"])]),
644
646
  _: 1
645
647
  }, 8, ["modelValue"]),
646
- s(g(le), {
648
+ s(g(ce), {
647
649
  modelValue: v.value,
648
650
  "onUpdate:modelValue": l[5] ||= (e) => v.value = e,
649
651
  label: "Group by transaction"
@@ -652,34 +654,34 @@ var ge = {
652
654
  a("div", Je, [
653
655
  a("span", null, [
654
656
  l[13] ||= o(" Showing ", -1),
655
- a("strong", null, h(k.value.length), 1),
657
+ a("strong", null, h(A.value.length), 1),
656
658
  l[14] ||= o(" of ", -1),
657
- a("strong", null, h(A.value), 1),
659
+ a("strong", null, h(j.value), 1),
658
660
  l[15] ||= o(" logged events ", -1)
659
661
  ]),
660
- k.value.length === $ ? (d(), n(g(y), {
662
+ A.value.length === $ ? (d(), n(g(y), {
661
663
  key: 0,
662
664
  color: "grey-7",
663
665
  label: `capped at ${$}`,
664
666
  outline: ""
665
667
  }, null, 8, ["label"])) : r("", !0),
666
- M.value ? (d(), n(g(y), {
668
+ N.value ? (d(), n(g(y), {
667
669
  key: 1,
668
670
  color: "orange",
669
671
  label: "in-memory fallback — persistent storage unavailable",
670
672
  outline: ""
671
673
  })) : r("", !0)
672
674
  ]),
673
- a("div", Ye, [k.value.length ? v.value ? (d(!0), i(e, { key: 1 }, p(L.value, (t) => (d(), i("div", {
675
+ a("div", Ye, [A.value.length ? v.value ? (d(!0), i(e, { key: 1 }, p(R.value, (t) => (d(), i("div", {
674
676
  key: t.key,
675
677
  class: "mb-3 rounded border-gray-200 dark:border-slate-700 border"
676
678
  }, [a("button", {
677
679
  class: "gap-2 bg-gray-50 px-3 py-2 text-sm font-semibold dark:bg-slate-800 dark:text-gray-100 flex w-full cursor-pointer items-center text-left",
678
680
  type: "button",
679
- onClick: (e) => z(t.key)
681
+ onClick: (e) => U(t.key)
680
682
  }, [
681
683
  s(g(x), {
682
- name: R(t.key) ? g(Ee) : g(Oe),
684
+ name: H(t.key) ? g(Ee) : g(Oe),
683
685
  size: "20px"
684
686
  }, null, 8, ["name"]),
685
687
  a("span", $e, h(t.key === nt ? "No transaction" : `Transaction ${t.key}`), 1),
@@ -688,16 +690,27 @@ var ge = {
688
690
  color: "grey-6",
689
691
  label: String(t.entries.length)
690
692
  }, null, 8, ["label"])
691
- ], 8, Qe), R(t.key) ? (d(), i("div", et, [(d(!0), i(e, null, p(t.entries, (e) => (d(), n(Ke, {
693
+ ], 8, Qe), H(t.key) ? (d(), i("div", et, [(d(!0), i(e, null, p(t.entries, (e) => (d(), n(Ke, {
692
694
  key: e.id,
693
695
  entry: e
694
- }, null, 8, ["entry"]))), 128))])) : r("", !0)]))), 128)) : (d(), i("div", tt, [(d(!0), i(e, null, p(k.value, (e) => (d(), n(Ke, {
696
+ }, null, 8, ["entry"]))), 128))])) : r("", !0)]))), 128)) : (d(), i("div", tt, [(d(!0), i(e, null, p(A.value, (e) => (d(), n(Ke, {
695
697
  key: e.id,
696
698
  entry: e
697
- }, null, 8, ["entry"]))), 128))])) : (d(), i("div", Xe, [s(g(x), {
698
- name: g(Ne),
699
- size: "48px"
700
- }, null, 8, ["name"]), a("span", Ze, h(N.value ? "Loading…" : "No log entries match these filters."), 1)]))])
699
+ }, null, 8, ["entry"]))), 128))])) : (d(), i("div", Xe, [
700
+ s(g(x), {
701
+ name: g(Ne),
702
+ size: "48px"
703
+ }, null, 8, ["name"]),
704
+ a("span", Ze, h(B.value), 1),
705
+ !P.value && z.value ? (d(), n(g(b), {
706
+ key: 0,
707
+ dense: "",
708
+ flat: "",
709
+ "no-caps": "",
710
+ label: "Clear filters",
711
+ onClick: V
712
+ })) : r("", !0)
713
+ ]))])
701
714
  ]),
702
715
  _: 1
703
716
  })]),
@@ -707,4 +720,4 @@ var ge = {
707
720
  }
708
721
  });
709
722
  //#endregion
710
- export { R as C, O as D, E, A as S, k as T, K as _, Oe as a, J as b, je as c, Le as d, ge as f, z as g, Q as h, De as i, Pe as l, xe as m, we as n, ke as o, Ce as p, Te as r, Ae as s, rt as t, Fe as u, X as v, D as w, j as x, Z as y };
723
+ export { z as C, k as D, D as E, j as S, A as T, q as _, Oe as a, Y as b, je as c, Le as d, ge as f, B as g, Q as h, De as i, Pe as l, xe as m, we as n, ke as o, Ce as p, Te as r, Ae as s, rt as t, Fe as u, Z as v, O as w, M as x, me as y };
package/dist/logger.js CHANGED
@@ -1,2 +1,2 @@
1
- import { C as e, D as t, E as n, S as r, T as i, _ as a, b as o, f as s, g as c, h as l, m as u, p as d, t as f, v as p, w as m, x as h, y as g } from "./logger-Chsffh2c.js";
1
+ import { C as e, D as t, E as n, S as r, T as i, _ as a, b as o, f as s, g as c, h as l, m as u, p as d, t as f, v as p, w as m, x as h, y as g } from "./logger-bcgKGDGU.js";
2
2
  export { s as DEFAULT_LOGGER_OPTIONS, h as LEGACY_TIMAPI_LOGS_DB_NAME, r as LOG_DB_NAME, m as LOG_LEVEL_SEVERITY, i as LogEvent, n as LogLevel, t as LogSource, e as LogStore, f as LogViewer, d as Logger, c as REDACTED, u as formatEntry, a as isLuhnValid, l as logger, p as redact, g as redactMessage, o as redactString };