@datapos/datapos-shared 0.3.537 → 0.3.539

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,14 +1,14 @@
1
- import { DEFAULT_LOCALE_CODE as m, createLabelMap as p, resolveLabel as C } from "./datapos-shared-locale.es.js";
2
- import { l as n, o as i, f as t, r as s, d as u, s as e, g as o, b as g, n as l, h, i as S, p as f } from "./componentConfig.schema-C0C6ceb5.js";
1
+ import { DEFAULT_LOCALE_CODE as p, createLabelMap as C, resolveLabel as u } from "./datapos-shared-locale.es.js";
2
+ import { l as n, o as i, f as t, b as l, r as d, d as g, s as e, g as o, n as s, h, i as S, p as f } from "./componentConfig.schema-C0C6ceb5.js";
3
3
  import { m as O } from "./moduleConfig.schema-DNq1iU4S.js";
4
4
  const L = n(["apiKey", "disabled", "oAuth2", "none"]), R = i({
5
5
  authMethodId: L,
6
- activeConnectionCount: o(l()),
6
+ activeConnectionCount: o(s()),
7
7
  canDescribe: o(S()),
8
8
  id: o(e()),
9
9
  label: o(h),
10
- maxConnectionCount: t(l()),
11
- params: o(g(s(e(), e())))
10
+ maxConnectionCount: t(s()),
11
+ params: o(l(d(e(), e())))
12
12
  }), v = n(["application", "curatedDataset", "database", "fileStore"]), y = n([
13
13
  "abortOperation",
14
14
  "auditObjectContent",
@@ -16,7 +16,7 @@ const L = n(["apiKey", "disabled", "oAuth2", "none"]), R = i({
16
16
  "createObject",
17
17
  "describeConnection",
18
18
  "dropObject",
19
- "findObjectFolderPath",
19
+ "findObject",
20
20
  "getReadableStream",
21
21
  "getRecord",
22
22
  "listNodes",
@@ -28,13 +28,13 @@ const L = n(["apiKey", "disabled", "oAuth2", "none"]), R = i({
28
28
  ]), I = n(["bidirectional", "destination", "source", "unknown"]), D = i({
29
29
  id: e(),
30
30
  label: f
31
- }), F = i({
31
+ }), N = i({
32
32
  ...O,
33
- typeId: u("connector"),
33
+ typeId: g("connector"),
34
34
  category: t(D),
35
35
  categoryId: v,
36
- implementations: s(e(), R),
37
- operations: y,
36
+ implementations: d(e(), R),
37
+ operations: l(y),
38
38
  usageId: I,
39
39
  vendorAccountURL: t(e()),
40
40
  vendorDocumentationURL: t(e()),
@@ -44,15 +44,15 @@ const L = n(["apiKey", "disabled", "oAuth2", "none"]), R = i({
44
44
  { id: "curatedDataset", label: { "en-gb": "Curated Dataset" } },
45
45
  { id: "database", label: { "en-gb": "Database" } },
46
46
  { id: "fileStore", label: { "en-gb": "File Store" } }
47
- ], N = (c, d = m) => {
47
+ ], F = (c, b = p) => {
48
48
  const a = A.find((r) => r.id === c);
49
49
  if (a) {
50
- const r = p(a.label), b = C(r, d);
51
- return { id: a.id, label: b ?? a.id };
50
+ const r = C(a.label), m = u(r, b);
51
+ return { id: a.id, label: m ?? a.id };
52
52
  }
53
53
  return { id: c, label: c };
54
54
  };
55
55
  export {
56
- F as connectorConfigSchema,
57
- N as constructConnectorCategoryConfig
56
+ N as connectorConfigSchema,
57
+ F as constructConnectorCategoryConfig
58
58
  };
@@ -1,52 +1,52 @@
1
1
  class c extends Error {
2
2
  locator;
3
3
  /** Logical source of the error. */
4
- constructor(n, o, e) {
5
- super(n, e), this.name = new.target.name, this.locator = o;
4
+ constructor(o, n, e) {
5
+ super(o, e), this.name = new.target.name, this.locator = n;
6
6
  }
7
7
  }
8
- class a extends c {
8
+ class s extends c {
9
9
  }
10
- class f extends a {
10
+ class m extends s {
11
11
  }
12
- class u extends a {
12
+ class f extends s {
13
13
  }
14
- class m extends a {
14
+ class l extends s {
15
15
  body;
16
16
  /** Sanitized HTTP response body. */
17
- constructor(n, o, e, s) {
18
- super(n, o, s), this.name = new.target.name, this.body = p(e ?? void 0);
17
+ constructor(o, n, e, t) {
18
+ super(o, n, t), this.name = new.target.name, this.body = b(e ?? void 0);
19
19
  }
20
20
  }
21
- class E extends c {
21
+ class u extends c {
22
22
  }
23
- class d extends a {
23
+ class y extends s {
24
24
  componentName;
25
25
  /** Vue component name, if available. */
26
26
  info;
27
27
  /** Vue error info string. */
28
- constructor(n, o, e, s, t) {
29
- super(n, o, t), this.name = new.target.name, this.info = e, this.componentName = s;
28
+ constructor(o, n, e, t, a) {
29
+ super(o, n, a), this.name = new.target.name, this.info = e, this.componentName = t;
30
30
  }
31
31
  }
32
- class g extends a {
32
+ class E extends s {
33
33
  }
34
- class w extends a {
34
+ class g extends s {
35
35
  }
36
- async function k(r, n, o) {
37
- const e = ` - ${r.statusText}`, s = `${n} Response status '${r.status}${r.statusText ? e : ""}' received.`;
38
- let t;
36
+ async function p(r, o, n) {
37
+ const e = ` - ${r.statusText}`, t = `${o} Response status '${r.status}${r.statusText ? e : ""}' received.`;
38
+ let a;
39
39
  try {
40
- t = await r.text();
41
- } catch (l) {
42
- t = `<body unavailable: ${i(l).message}>`;
40
+ a = await r.text();
41
+ } catch (d) {
42
+ a = `<body unavailable: ${i(d).message}>`;
43
43
  }
44
- return new m(s, o, t);
44
+ return new l(t, n, a);
45
45
  }
46
46
  function h(r) {
47
- return r.map((n) => n.message).join(" ");
47
+ return r.map((o) => o.message).join(" ");
48
48
  }
49
- function y(r) {
49
+ function R(r) {
50
50
  try {
51
51
  r();
52
52
  } catch {
@@ -65,90 +65,79 @@ function i(r) {
65
65
  }
66
66
  return new Error("Unknown error");
67
67
  }
68
- function R(r) {
69
- const n = /* @__PURE__ */ new Set(), o = [];
68
+ function x(r) {
69
+ const o = /* @__PURE__ */ new Set(), n = [];
70
70
  let e = i(r);
71
- for (; e != null && !n.has(e); ) {
72
- n.add(e);
73
- let s;
74
- if (e instanceof m)
75
- s = { componentName: void 0, body: e.body, info: void 0, locator: e.locator, message: e.message, name: e.name, stack: e.stack }, e = i(e.cause);
76
- else if (e instanceof d)
77
- s = {
78
- componentName: e.componentName,
79
- body: void 0,
80
- info: e.info,
81
- locator: e.locator,
82
- message: e.message,
83
- name: e.name,
84
- stack: e.stack
85
- }, e = i(e.cause);
86
- else if (e instanceof c)
87
- s = { componentName: void 0, body: void 0, info: void 0, locator: e.locator, message: e.message, name: e.name, stack: e.stack }, e = i(e.cause);
88
- else {
89
- const t = e;
90
- s = { componentName: void 0, body: void 0, info: void 0, locator: "", message: t.message, name: t.name, stack: t.stack }, e = i(e.cause);
91
- }
92
- /(?:\.{3}|[.!?])$/.test(s.message) || (s.message += "."), o.push(s);
71
+ for (; e != null && !o.has(e); ) {
72
+ o.add(e);
73
+ let t;
74
+ e instanceof l ? (t = { body: e.body, locator: e.locator, message: e.message, name: e.name, stack: e.stack }, e = e.cause == null ? null : i(e.cause)) : e instanceof c ? (t = { body: void 0, locator: e.locator, message: e.message, name: e.name, stack: e.stack }, e = e.cause == null ? null : i(e.cause)) : e instanceof Error ? (t = { body: void 0, locator: "", message: e.message, name: e.name, stack: e.stack }, e = e.cause == null ? null : i(e.cause)) : (t = { body: void 0, locator: "", message: w(e), name: "Error", stack: void 0 }, e = null), /(?:\.{3}|[.!?])$/.test(t.message) || (t.message += "."), n.push(t);
93
75
  }
94
- return o;
76
+ return n;
95
77
  }
96
- function x(r) {
78
+ function O(r) {
97
79
  if (r.length === 0) return;
98
- let n;
99
- for (const o of r.toReversed()) {
80
+ let o;
81
+ for (const n of r.toReversed()) {
100
82
  let e;
101
- if (o.body !== void 0)
102
- e = new m(o.message, o.locator, o.body, { cause: n });
103
- else if (o.info !== void 0)
104
- e = new d(o.message, o.locator, o.info, o.componentName, { cause: n });
105
- else if (o.locator === "")
106
- e = new Error(o.message, { cause: n }), e.name = o.name;
83
+ if (n.body !== void 0)
84
+ e = new l(n.message, n.locator, n.body, { cause: o });
85
+ else if (n.locator === "")
86
+ e = new Error(n.message, { cause: o }), e.name = n.name;
107
87
  else
108
- switch (o.name) {
88
+ switch (n.name) {
109
89
  case "APIError":
110
- e = new f(o.message, o.locator, { cause: n });
90
+ e = new m(n.message, n.locator, { cause: o });
111
91
  break;
112
92
  case "EngineError":
113
- e = new u(o.message, o.locator, { cause: n });
93
+ e = new f(n.message, n.locator, { cause: o });
114
94
  break;
115
95
  case "ApplicationError":
116
- e = new a(o.message, o.locator, { cause: n });
96
+ e = new s(n.message, n.locator, { cause: o });
117
97
  break;
118
98
  case "OperationalError":
119
- e = new E(o.message, o.locator, { cause: n });
99
+ e = new u(n.message, n.locator, { cause: o });
120
100
  break;
121
101
  case "WindowHandledRuntimeError":
122
- e = new g(o.message, o.locator, { cause: n });
102
+ e = new E(n.message, n.locator, { cause: o });
123
103
  break;
124
104
  case "WindowHandledPromiseRejectionError":
125
- e = new w(o.message, o.locator, { cause: n });
105
+ e = new g(n.message, n.locator, { cause: o });
126
106
  break;
127
107
  default:
128
- e = new c(o.message, o.locator, { cause: n });
108
+ e = new c(n.message, n.locator, { cause: o });
129
109
  break;
130
110
  }
131
- o.stack !== void 0 && (e.stack = o.stack), n = e;
111
+ n.stack !== void 0 && (e.stack = n.stack), o = e;
132
112
  }
133
- return n;
113
+ return o;
114
+ }
115
+ function w(r) {
116
+ let o;
117
+ try {
118
+ o = JSON.stringify(r);
119
+ } catch {
120
+ typeof r == "symbol" ? o = r.description ?? "Unknown error" : typeof r == "bigint" ? o = r.toString() : o = "Unknown error";
121
+ }
122
+ return o === "" && (o = "Unknown error"), o;
134
123
  }
135
- function p(r) {
124
+ function b(r) {
136
125
  if (!(r == null || r === ""))
137
126
  return r.length > 2048 ? `${r.slice(0, 2048)}... [truncated]` : r;
138
127
  }
139
128
  export {
140
- f as APIError,
141
- a as ApplicationError,
142
- u as EngineError,
143
- m as FetchError,
144
- E as OperationalError,
145
- d as VueHandledError,
146
- w as WindowHandledPromiseRejectionError,
147
- g as WindowHandledRuntimeError,
148
- k as buildFetchError,
129
+ m as APIError,
130
+ s as ApplicationError,
131
+ f as EngineError,
132
+ l as FetchError,
133
+ u as OperationalError,
134
+ y as VueHandledError,
135
+ g as WindowHandledPromiseRejectionError,
136
+ E as WindowHandledRuntimeError,
137
+ p as buildFetchError,
149
138
  h as concatenateSerialisedErrorMessages,
150
- y as ignoreErrors,
139
+ R as ignoreErrors,
151
140
  i as normalizeToError,
152
- R as serialiseError,
153
- x as unserialiseError
141
+ x as serialiseError,
142
+ O as unserialiseError
154
143
  };
@@ -5,7 +5,7 @@
5
5
  * of connector manifests and capability discovery at runtime.
6
6
  */
7
7
  /** Operation names a connector may support. */
8
- declare const connectorOperationNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObjectFolderPath", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
8
+ declare const connectorOperationNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
9
9
  /** Connector data pipeline usage identifiers. */
10
10
  declare const connectorUsageIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"bidirectional", undefined>, import('valibot').LiteralSchema<"destination", undefined>, import('valibot').LiteralSchema<"source", undefined>, import('valibot').LiteralSchema<"unknown", undefined>], undefined>;
11
11
  /**
@@ -47,7 +47,7 @@ declare const connectorConfigSchema: import('valibot').ObjectSchema<{
47
47
  readonly maxConnectionCount: import('valibot').NullableSchema<import('valibot').NumberSchema<undefined>, undefined>;
48
48
  readonly params: import('valibot').OptionalSchema<import('valibot').ArraySchema<import('valibot').RecordSchema<import('valibot').StringSchema<undefined>, import('valibot').StringSchema<undefined>, undefined>, undefined>, undefined>;
49
49
  }, undefined>, undefined>;
50
- readonly operations: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObjectFolderPath", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
50
+ readonly operations: import('valibot').ArraySchema<import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>, undefined>;
51
51
  readonly usageId: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"bidirectional", undefined>, import('valibot').LiteralSchema<"destination", undefined>, import('valibot').LiteralSchema<"source", undefined>, import('valibot').LiteralSchema<"unknown", undefined>], undefined>;
52
52
  readonly vendorAccountURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
53
53
  readonly vendorDocumentationURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
@@ -6,8 +6,6 @@
6
6
  */
7
7
  interface SerialisedError {
8
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
9
  /** Logical source of the error. */ locator: string;
12
10
  /** Human-readable error message. */ message: string;
13
11
  /** Error class or type name. */ name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.537",
3
+ "version": "0.3.539",
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>",