@datapos/datapos-shared 0.3.349 → 0.3.350

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,8 +1,8 @@
1
1
  class i extends Error {
2
2
  locator;
3
3
  /** Logical source of the error. */
4
- constructor(n, s, r) {
5
- super(n, r), this.name = new.target.name, this.locator = s;
4
+ constructor(o, t, r) {
5
+ super(o, r), this.name = new.target.name, this.locator = t;
6
6
  }
7
7
  }
8
8
  class a extends i {
@@ -14,39 +14,39 @@ class p extends a {
14
14
  class c extends a {
15
15
  body;
16
16
  /** Sanitized HTTP response body. */
17
- constructor(n, s, r, t) {
18
- super(n, s, t), this.name = new.target.name, this.body = E(r ?? void 0);
17
+ constructor(o, t, r, n) {
18
+ super(o, t, n), this.name = new.target.name, this.body = E(r ?? void 0);
19
19
  }
20
20
  }
21
- class w extends i {
21
+ class y extends i {
22
22
  }
23
23
  class m extends a {
24
24
  componentName;
25
25
  /** Vue component name, if available. */
26
26
  info;
27
27
  /** Vue error info string. */
28
- constructor(n, s, r, t, o) {
29
- super(n, s, o), this.name = new.target.name, this.info = r, this.componentName = t;
28
+ constructor(o, t, r, n, s) {
29
+ super(o, t, s), this.name = new.target.name, this.info = r, this.componentName = n;
30
30
  }
31
31
  }
32
- class y extends a {
32
+ class w extends a {
33
33
  }
34
- class h extends a {
34
+ class b extends a {
35
35
  }
36
- async function k(e, n, s) {
37
- const r = ` - ${e.statusText}`, t = `${n} Response status '${e.status}${e.statusText ? r : ""}' received.`;
38
- let o;
36
+ async function h(e, o, t) {
37
+ const r = ` - ${e.statusText}`, n = `${o} Response status '${e.status}${e.statusText ? r : ""}' received.`;
38
+ let s;
39
39
  try {
40
- o = await e.text();
41
- } catch (l) {
42
- o = `<body unavailable: ${f(l).message}>`;
40
+ s = await e.text();
41
+ } catch (d) {
42
+ s = `<body unavailable: ${l(d).message}>`;
43
43
  }
44
- return new c(t, s, o);
44
+ return new c(n, t, s);
45
45
  }
46
- function b(e) {
47
- return e.map((n) => n.message).join(" ");
46
+ function k(e) {
47
+ return e.map((o) => o.message).join(" ");
48
48
  }
49
- function f(e) {
49
+ function l(e) {
50
50
  if (e instanceof Error) return e;
51
51
  if (typeof e == "string") return new Error(e);
52
52
  if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return new Error(String(e));
@@ -60,34 +60,42 @@ function f(e) {
60
60
  return new Error("Unknown error");
61
61
  }
62
62
  function x(e) {
63
- const n = /* @__PURE__ */ new Set(), s = [];
63
+ const o = /* @__PURE__ */ new Set(), t = [];
64
64
  let r = e;
65
- for (; r != null && !n.has(r); ) {
66
- n.add(r);
67
- let t;
65
+ for (; r != null && !o.has(r); ) {
66
+ o.add(r);
67
+ let n;
68
68
  if (r instanceof c)
69
- t = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
69
+ n = { componentName: void 0, body: r.body, info: void 0, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
70
70
  else if (r instanceof m)
71
- t = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
71
+ n = {
72
+ componentName: r.componentName,
73
+ body: void 0,
74
+ info: r.info,
75
+ locator: r.locator,
76
+ message: r.message,
77
+ name: r.name,
78
+ stack: r.stack
79
+ }, r = r.cause;
72
80
  else if (r instanceof i)
73
- t = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
81
+ n = { componentName: void 0, body: void 0, info: void 0, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
74
82
  else if (r instanceof Error) {
75
- const o = r;
76
- t = { locator: "", message: o.message, name: o.name, stack: o.stack }, r = o.cause;
83
+ const s = r;
84
+ n = { componentName: void 0, body: void 0, info: void 0, locator: "", message: s.message, name: s.name, stack: s.stack }, r = s.cause;
77
85
  } else
78
- t = { locator: "", message: d(r), name: "Error" }, r = void 0;
79
- /(?:\.{3}|[.!?])$/.test(t.message) || (t.message += "."), s.push(t);
86
+ n = { componentName: void 0, body: void 0, info: void 0, locator: "", message: f(r), name: "Error", stack: void 0 }, r = void 0;
87
+ /(?:\.{3}|[.!?])$/.test(n.message) || (n.message += "."), t.push(n);
80
88
  }
81
- return s;
89
+ return t;
82
90
  }
83
- function d(e) {
84
- let n;
91
+ function f(e) {
92
+ let o;
85
93
  try {
86
- n = JSON.stringify(e);
94
+ o = JSON.stringify(e);
87
95
  } catch {
88
- typeof e == "symbol" ? n = e.description ?? "Unknown error" : typeof e == "bigint" ? n = e.toString() : n = "Unknown error";
96
+ typeof e == "symbol" ? o = e.description ?? "Unknown error" : typeof e == "bigint" ? o = e.toString() : o = "Unknown error";
89
97
  }
90
- return n === "" && (n = "Unknown error"), n;
98
+ return o === "" && (o = "Unknown error"), o;
91
99
  }
92
100
  function E(e) {
93
101
  if (!(e == null || e === ""))
@@ -98,12 +106,12 @@ export {
98
106
  a as ApplicationError,
99
107
  p as EngineError,
100
108
  c as FetchError,
101
- w as OperationalError,
109
+ y as OperationalError,
102
110
  m as VueHandledError,
103
- h as WindowHandledPromiseRejectionError,
104
- y as WindowHandledRuntimeError,
105
- k as buildFetchError,
106
- b as concatenateSerialisedErrorMessages,
107
- f as normalizeToError,
111
+ b as WindowHandledPromiseRejectionError,
112
+ w as WindowHandledRuntimeError,
113
+ h as buildFetchError,
114
+ k as concatenateSerialisedErrorMessages,
115
+ l as normalizeToError,
108
116
  x as serialiseError
109
117
  };
@@ -5,13 +5,13 @@
5
5
  * Used for logging, reporting, and transport across process or network boundaries.
6
6
  */
7
7
  interface SerialisedError {
8
- /** HTTP response body (Fetch errors only). */ body?: string;
9
- /** Vue component name (Vue errors only). */ componentName?: string;
10
- /** Vue error info string. */ info?: string;
8
+ /** HTTP response body (Fetch errors only). */ body: string | undefined;
9
+ /** Vue component name (Vue errors only). */ componentName: string | undefined;
10
+ /** Vue error info string. */ info: string | undefined;
11
11
  /** Logical source of the error. */ locator: string;
12
12
  /** Human-readable error message. */ message: string;
13
13
  /** Error class or type name. */ name: string;
14
- /** Stack trace, if available. */ stack?: string;
14
+ /** Stack trace, if available. */ stack: string | undefined;
15
15
  }
16
16
  /** Base class for all Data Positioning errors.
17
17
  * All errors include a `locator` identifying the logical source of the error (module, feature, or operation).
@@ -37,7 +37,7 @@ declare class EngineError extends ApplicationError {
37
37
  * Includes a sanitized snapshot of the response body for diagnostic purposes.
38
38
  */
39
39
  declare class FetchError extends ApplicationError {
40
- readonly body?: string; /** Sanitized HTTP response body. */
40
+ readonly body: string | undefined; /** Sanitized HTTP response body. */
41
41
  constructor(message: string, locator: string, body?: string | null, options?: ErrorOptions);
42
42
  }
43
43
  /** Represents operational failures not caused by application logic. */
@@ -47,7 +47,7 @@ declare class OperationalError extends DataPosError {
47
47
  * Used when capturing Vue error handler output with additional component context.
48
48
  */
49
49
  declare class VueHandledError extends ApplicationError {
50
- readonly componentName?: string; /** Vue component name, if available. */
50
+ readonly componentName: string | undefined; /** Vue component name, if available. */
51
51
  readonly info: string; /** Vue error info string. */
52
52
  constructor(message: string, locator: string, info: string, componentName?: string, options?: ErrorOptions);
53
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.349",
3
+ "version": "0.3.350",
4
4
  "description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",