@datapos/datapos-shared 0.1.867
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.
- package/LICENSE.md +7 -0
- package/README.md +113 -0
- package/dist/datapos-shared.es.js +255 -0
- package/dist/types/src/Z_ContentAuditColumn.d.ts +33 -0
- package/dist/types/src/Z_PreviewColumn.d.ts +5 -0
- package/dist/types/src/Z_dataConnector.d.ts +0 -0
- package/dist/types/src/Z_nodeConnector.d.ts +0 -0
- package/dist/types/src/component.d.ts +18 -0
- package/dist/types/src/connection.d.ts +73 -0
- package/dist/types/src/connector.d.ts +142 -0
- package/dist/types/src/context.d.ts +49 -0
- package/dist/types/src/dataView.d.ts +71 -0
- package/dist/types/src/engine.d.ts +15 -0
- package/dist/types/src/errors.d.ts +49 -0
- package/dist/types/src/eventQuery.d.ts +4 -0
- package/dist/types/src/index.d.ts +36 -0
- package/dist/types/src/location.d.ts +0 -0
- package/dist/types/src/monitor.d.ts +0 -0
- package/dist/types/src/package.d.ts +0 -0
- package/dist/types/src/presenter.d.ts +56 -0
- package/dist/types/src/service.d.ts +10 -0
- package/dist/types/src/timestamp.d.ts +4 -0
- package/dist/types/src/tutorial.d.ts +4 -0
- package/dist/types/src/utilities.d.ts +9 -0
- package/dist/types/vite.config.d.ts +2 -0
- package/package.json +45 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
ISC License (ISC)
|
|
2
|
+
|
|
3
|
+
Copyright 2013 Jonathan Terrell
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Datapos - Core Share Library
|
|
2
|
+
|
|
3
|
+
A TypeScript library of core declarations and utilities shared between Datapos applications and plugin components.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install --save-dev @datapos-shared
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Component Configuration Declarations
|
|
12
|
+
|
|
13
|
+
The following diagram illustrates the component configuration class hierarchy, showcasing the relationships and inheritance structure between different **Component Configuration** classes.
|
|
14
|
+
|
|
15
|
+
## Component Instance Declarations
|
|
16
|
+
|
|
17
|
+
The following diagram illustrates the component class hierarchy, showcasing the relationships and inheritance structure between different **Component** classes.
|
|
18
|
+
|
|
19
|
+
## Connector Configuration Declarations
|
|
20
|
+
|
|
21
|
+
The following diagram illustrates the connector class hierarchies, showcasing the relationships and inheritance structure between different **Connector Configuration** classes and detailing referenced enumeration types.
|
|
22
|
+
|
|
23
|
+
## Data Connector Instance Declarations
|
|
24
|
+
|
|
25
|
+
The following diagram illustrates the connector class hierarchies, showcasing the relationships and inheritance structure between different **Data Connector** classes and detailing referenced enumeration types.
|
|
26
|
+
|
|
27
|
+
## Node Connector Instance Declarations
|
|
28
|
+
|
|
29
|
+
The following diagram illustrates the connector class hierarchies, showcasing the relationships and inheritance structure between different **Node Connector** classes and detailing referenced enumeration types.
|
|
30
|
+
|
|
31
|
+
## Connection Declarations
|
|
32
|
+
|
|
33
|
+
The following diagram illustrates the connection class hierarchy, showcasing the relationships and inheritance structure between different **Connection** classes and detailing referenced enumeration types.
|
|
34
|
+
|
|
35
|
+
## Connection Entry Declarations
|
|
36
|
+
|
|
37
|
+
The following diagram illustrates the connection entry class hierarchy, showcasing the relationships and inheritance structure between different **Connection Entry** classes and detailing referenced enumeration types.
|
|
38
|
+
|
|
39
|
+
## Context Model Declarations
|
|
40
|
+
|
|
41
|
+
...
|
|
42
|
+
|
|
43
|
+
## Data View Declarations
|
|
44
|
+
|
|
45
|
+
...
|
|
46
|
+
|
|
47
|
+
## Dimension Declarations
|
|
48
|
+
|
|
49
|
+
...
|
|
50
|
+
|
|
51
|
+
## Entity Declarations
|
|
52
|
+
|
|
53
|
+
...
|
|
54
|
+
|
|
55
|
+
## Event Query Declarations
|
|
56
|
+
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
## Usage Kit Declarations
|
|
60
|
+
|
|
61
|
+
...
|
|
62
|
+
|
|
63
|
+
## View Template Declarations
|
|
64
|
+
|
|
65
|
+
...
|
|
66
|
+
|
|
67
|
+
## Other Declarations
|
|
68
|
+
|
|
69
|
+
...
|
|
70
|
+
|
|
71
|
+
## Utilities
|
|
72
|
+
|
|
73
|
+
### Conversion
|
|
74
|
+
|
|
75
|
+
- convertODataTypeToDataType
|
|
76
|
+
|
|
77
|
+
### Extraction
|
|
78
|
+
|
|
79
|
+
- extractDirectoryPathFromEntryPath
|
|
80
|
+
- extractExtensionFromEntryPath
|
|
81
|
+
- extractLastFolderNameFromFolderPath
|
|
82
|
+
|
|
83
|
+
### Formatting
|
|
84
|
+
|
|
85
|
+
- formatNumberAsDecimalNumber
|
|
86
|
+
- formatNumberAsStorageSize
|
|
87
|
+
- formatNumberAsWholeNumber
|
|
88
|
+
|
|
89
|
+
### Lookup
|
|
90
|
+
|
|
91
|
+
- lookupMimeTypeForFileExtension
|
|
92
|
+
|
|
93
|
+
### Security
|
|
94
|
+
|
|
95
|
+
- establishVendorAccessToken
|
|
96
|
+
|
|
97
|
+
## Repository Management Commands
|
|
98
|
+
|
|
99
|
+
The following list details the repository management commands implementation by this project. For more details, please refer to the scripts section of the 'package.json' file in this project.
|
|
100
|
+
|
|
101
|
+
| Name | Key Code | Notes |
|
|
102
|
+
| ------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| audit | alt+ctrl+shift+a | Audit the project's dependencies for known security vulnerabilities. |
|
|
104
|
+
| build | alt+ctrl+shift+b | Build the package using Vite build. |
|
|
105
|
+
| check | alt+ctrl+shift+c | List the dependencies in the project that are outdated. |
|
|
106
|
+
| document | alt+ctrl+shift+d | Identify the licenses of the project's dependencies. |
|
|
107
|
+
| format | alt+ctrl+shift+f | NOT implemented. |
|
|
108
|
+
| lint | alt+ctrl+shift+l | Check the code for potential errors and enforces coding styles. |
|
|
109
|
+
| publishToNPM | alt+ctrl+shift+n | Publishes the package to the [npm](https://www.npmjs.com/) registry. This action will publish the last synchronised version. Use the command line command 'npm publish' when publishing for the first time. |
|
|
110
|
+
| release | alt+ctrl+shift+r | Synchronise the local repository with the main GitHub repository and publish the package to the [npm](https://www.npmjs.com/) registry. |
|
|
111
|
+
| syncWithGitHub | alt+ctrl+shift+s | Synchronise the local repository with the main GitHub repository. |
|
|
112
|
+
| test | alt+ctrl+shift+l | NOT implemented. |
|
|
113
|
+
| updateDependencies | alt+ctrl+shift+l | Install the latest version of outdated Data Position package dependencies. |
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
const x = 0, h = (e) => e, w = () => Date.now();
|
|
2
|
+
class d extends Error {
|
|
3
|
+
locator;
|
|
4
|
+
constructor(t, n, r) {
|
|
5
|
+
super(t, r), this.name = "DataPosError", this.locator = n, Error.captureStackTrace?.(this, new.target);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class i extends d {
|
|
9
|
+
constructor(t, n, r) {
|
|
10
|
+
super(t, n, r), this.name = "ApplicationError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class N extends i {
|
|
14
|
+
constructor(t, n, r) {
|
|
15
|
+
super(t, n, r), this.name = "APIError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
class S extends i {
|
|
19
|
+
constructor(t, n, r) {
|
|
20
|
+
super(t, n, r), this.name = "EngineError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
class u extends i {
|
|
24
|
+
body;
|
|
25
|
+
constructor(t, n, r, a) {
|
|
26
|
+
super(t, n, a), this.name = "FetchError", this.body = r;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
class f extends i {
|
|
30
|
+
componentName;
|
|
31
|
+
info;
|
|
32
|
+
constructor(t, n, r, a, s) {
|
|
33
|
+
super(t, n, s), this.name = "VueHandledError", this.info = r, this.componentName = a;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class y extends i {
|
|
37
|
+
constructor(t, n, r) {
|
|
38
|
+
super(t, n, r), this.name = "WindowHandledRuntimeError";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
class D extends i {
|
|
42
|
+
constructor(t, n, r) {
|
|
43
|
+
super(t, n, r), this.name = "WindowHandledPromiseRejectionError";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class $ extends d {
|
|
47
|
+
constructor(t, n, r) {
|
|
48
|
+
super(t, n, r), this.name = "OperationalError";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function v(e, t, n) {
|
|
52
|
+
const r = `${t} Response status '${e.status}${e.statusText ? ` - ${e.statusText}` : ""}' received.`, a = await e.text();
|
|
53
|
+
return new u(r, n, a);
|
|
54
|
+
}
|
|
55
|
+
function T(e) {
|
|
56
|
+
return e.map((t) => t.message).join(" ");
|
|
57
|
+
}
|
|
58
|
+
function I(e, t = "Unknown error.") {
|
|
59
|
+
if (e instanceof Error) return e;
|
|
60
|
+
if (typeof e == "string") return new Error(e);
|
|
61
|
+
try {
|
|
62
|
+
return new Error(JSON.stringify(e ?? t));
|
|
63
|
+
} catch {
|
|
64
|
+
return new Error(t);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function F(e) {
|
|
68
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
69
|
+
let r = e;
|
|
70
|
+
for (; r && !t.has(r); ) {
|
|
71
|
+
t.add(r);
|
|
72
|
+
let a;
|
|
73
|
+
if (r instanceof u)
|
|
74
|
+
a = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
75
|
+
else if (r instanceof f)
|
|
76
|
+
a = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
77
|
+
else if (r instanceof d)
|
|
78
|
+
a = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
|
|
79
|
+
else if (r instanceof Error) {
|
|
80
|
+
const s = r;
|
|
81
|
+
a = { locator: "", message: s.message, name: s.name, stack: s.stack }, r = s.cause;
|
|
82
|
+
} else r ? (a = { locator: "", message: String(r), name: "Error" }, r = void 0) : (a = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
|
|
83
|
+
/(?:\.{3}|[.!?])$/.test(a.message) || (a.message += "."), n.push(a);
|
|
84
|
+
}
|
|
85
|
+
return n;
|
|
86
|
+
}
|
|
87
|
+
const m = "en-US", l = {}, k = (e) => {
|
|
88
|
+
switch (e) {
|
|
89
|
+
case "Edm.Binary":
|
|
90
|
+
return "unknown";
|
|
91
|
+
// Binary...
|
|
92
|
+
case "Edm.Boolean":
|
|
93
|
+
return "boolean";
|
|
94
|
+
case "Edm.Byte":
|
|
95
|
+
return "wholeNumber";
|
|
96
|
+
case "Edm.DateTime":
|
|
97
|
+
return "moment";
|
|
98
|
+
// DateTime...
|
|
99
|
+
case "Edm.DateTimeOffset":
|
|
100
|
+
return "moment";
|
|
101
|
+
// DateTimeOffset...
|
|
102
|
+
case "Edm.Decimal":
|
|
103
|
+
return "decimalNumber";
|
|
104
|
+
case "Edm.Double":
|
|
105
|
+
return "decimalNumber";
|
|
106
|
+
case "Edm.Guid":
|
|
107
|
+
return "string";
|
|
108
|
+
case "Edm.Int16":
|
|
109
|
+
return "wholeNumber";
|
|
110
|
+
case "Edm.Int32":
|
|
111
|
+
return "wholeNumber";
|
|
112
|
+
case "Edm.Int64":
|
|
113
|
+
return "wholeNumber";
|
|
114
|
+
case "Edm.SByte":
|
|
115
|
+
return "wholeNumber";
|
|
116
|
+
case "Edm.Single":
|
|
117
|
+
return "decimalNumber";
|
|
118
|
+
case "Edm.String":
|
|
119
|
+
return "string";
|
|
120
|
+
case "Edm.Time":
|
|
121
|
+
return "momentTime";
|
|
122
|
+
// Time...
|
|
123
|
+
default:
|
|
124
|
+
return "unknown";
|
|
125
|
+
}
|
|
126
|
+
}, A = (e) => {
|
|
127
|
+
if (e) {
|
|
128
|
+
const t = e.lastIndexOf("/"), n = e.lastIndexOf(".", t > -1 ? t : e.length);
|
|
129
|
+
return n > -1 ? e.substring(0, n) : e;
|
|
130
|
+
}
|
|
131
|
+
}, B = (e) => {
|
|
132
|
+
if (e) {
|
|
133
|
+
const t = e.lastIndexOf(".");
|
|
134
|
+
if (t > -1) return e.substring(t + 1);
|
|
135
|
+
}
|
|
136
|
+
}, o = (e, t = 2, n = t, r = m) => {
|
|
137
|
+
if (e == null) return "";
|
|
138
|
+
const a = `${r}decimal${t}.${n}`;
|
|
139
|
+
let s = l[a];
|
|
140
|
+
return s || (s = new Intl.NumberFormat(r, {
|
|
141
|
+
localeMatcher: "best fit",
|
|
142
|
+
maximumFractionDigits: t,
|
|
143
|
+
minimumFractionDigits: n,
|
|
144
|
+
minimumIntegerDigits: 1,
|
|
145
|
+
style: "decimal",
|
|
146
|
+
useGrouping: !0
|
|
147
|
+
}), l[a] = s), s.format(e);
|
|
148
|
+
}, M = (e) => e == null ? "" : e < 1e3 ? c(e) : e < 1e6 ? `${o(e / 1e3, 2, 0)}K` : e < 1e9 ? `${o(e / 1e6, 2, 0)}M` : e < 1e12 ? `${o(e / 1e9, 2, 0)}B` : `${o(e / 1e12, 2, 0)}T`, R = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${c(e)} bytes` : e < 1048576 ? `${o(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${o(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${o(e / 1073741824, 2, 0)} GB` : `${o(e / 1099511627776, 2, 0)} TB`, O = (e) => e == null ? "" : e < 1e3 ? `${c(e)} ms` : e === 1e3 ? `${c(e)} sec` : e < 6e4 ? `${o(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${o(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${o(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${o(e / 864e5, 2, 0)} days`, c = (e, t = m) => {
|
|
149
|
+
if (e == null) return "";
|
|
150
|
+
const n = `${t}decimal0.0`;
|
|
151
|
+
let r = l[n];
|
|
152
|
+
return r || (r = new Intl.NumberFormat(t, {
|
|
153
|
+
localeMatcher: "best fit",
|
|
154
|
+
maximumFractionDigits: 0,
|
|
155
|
+
minimumFractionDigits: 0,
|
|
156
|
+
minimumIntegerDigits: 1,
|
|
157
|
+
style: "decimal",
|
|
158
|
+
useGrouping: !0
|
|
159
|
+
}), l[n] = r), r.format(e);
|
|
160
|
+
}, C = (e) => {
|
|
161
|
+
switch (e) {
|
|
162
|
+
case "csv":
|
|
163
|
+
return "text/csv";
|
|
164
|
+
case "tab":
|
|
165
|
+
case "tsv":
|
|
166
|
+
return "text/tab-separated-values";
|
|
167
|
+
case "xls":
|
|
168
|
+
return "application/vnd.ms-excel";
|
|
169
|
+
case "xlsx":
|
|
170
|
+
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
171
|
+
default:
|
|
172
|
+
return "application/octet-stream";
|
|
173
|
+
}
|
|
174
|
+
}, p = [
|
|
175
|
+
{ id: "dtv", label: { en: "Delimited Text" } },
|
|
176
|
+
{ id: "e/e", label: { en: "Entity/Event" } },
|
|
177
|
+
{ id: "jsonArray", label: { en: "JSON Array" } },
|
|
178
|
+
{ id: "spss", label: { en: "SPSS" } },
|
|
179
|
+
{ id: "xls", label: { en: "XLS" } },
|
|
180
|
+
{ id: "xlsx", label: { en: "XLSX" } },
|
|
181
|
+
{ id: "xml", label: { en: "XML" } }
|
|
182
|
+
], U = (e = "en") => {
|
|
183
|
+
const t = [];
|
|
184
|
+
for (const n of p) t.push({ ...n, label: n.label[e] || n.label.en || n.id });
|
|
185
|
+
return t;
|
|
186
|
+
}, E = [
|
|
187
|
+
{ id: `
|
|
188
|
+
`, label: { en: "Newline" } },
|
|
189
|
+
{ id: "\r", label: { en: "Carriage Return" } },
|
|
190
|
+
{ id: `\r
|
|
191
|
+
`, label: { en: "Carriage Return/Newline" } }
|
|
192
|
+
], W = (e = "en") => {
|
|
193
|
+
const t = [];
|
|
194
|
+
for (const n of E) t.push({ ...n, label: n.label[e] || n.label.en || n.id });
|
|
195
|
+
return t;
|
|
196
|
+
}, b = [
|
|
197
|
+
{ id: ":", label: { en: "Colon" } },
|
|
198
|
+
{ id: ",", label: { en: "Comma" } },
|
|
199
|
+
{ id: "!", label: { en: "Exclamation Mark" } },
|
|
200
|
+
// { id: '', label: { en: 'Other' } }, // TODO: Maybe set this to a 'not printing' or special ascii character when there is a user supplied delimited, rather than ''?
|
|
201
|
+
{ id: "0x1E", label: { en: "Record Separator" } },
|
|
202
|
+
{ id: ";", label: { en: "Semicolon" } },
|
|
203
|
+
{ id: " ", label: { en: "Space" } },
|
|
204
|
+
{ id: " ", label: { en: "Tab" } },
|
|
205
|
+
{ id: "_", label: { en: "Underscore" } },
|
|
206
|
+
{ id: "0x1F", label: { en: "Unit Separator" } },
|
|
207
|
+
{ id: "|", label: { en: "Vertical Bar" } }
|
|
208
|
+
], j = (e = "en") => {
|
|
209
|
+
const t = [];
|
|
210
|
+
for (const n of b) t.push({ ...n, label: n.label[e] || n.label.en || n.id });
|
|
211
|
+
return t;
|
|
212
|
+
}, g = [
|
|
213
|
+
{ id: "alpha", color: "#d62728", label: { en: "alpha" } },
|
|
214
|
+
{ id: "beta", color: "#8c564b", label: { en: "beta" } },
|
|
215
|
+
{ id: "generalAvailability", label: { en: "" } },
|
|
216
|
+
{ id: "notApplicable", label: { en: "not-applicable" } },
|
|
217
|
+
{ id: "preAlpha", color: "#d62728", label: { en: "pre-alpha" } },
|
|
218
|
+
{ id: "proposed", color: "#666666", label: { en: "proposed" } },
|
|
219
|
+
{ id: "releaseCandidate", color: "#ff7f0e", label: { en: "release-candidate" } },
|
|
220
|
+
{ id: "unavailable", color: "#d62728", label: { en: "unavailable" } },
|
|
221
|
+
{ id: "underReview", color: "#666666", label: { en: "under-review" } }
|
|
222
|
+
], G = (e, t = "en") => {
|
|
223
|
+
const n = g.find((r) => r.id === e);
|
|
224
|
+
return n ? { ...n, label: n.label[t] || n.label.en || e } : { id: e, color: "#d62728", label: e };
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
N as APIError,
|
|
228
|
+
i as ApplicationError,
|
|
229
|
+
x as DefaultTimestamp,
|
|
230
|
+
S as EngineError,
|
|
231
|
+
u as FetchError,
|
|
232
|
+
$ as OperationalError,
|
|
233
|
+
f as VueError,
|
|
234
|
+
D as WindowPromiseRejectionError,
|
|
235
|
+
y as WindowRuntimeError,
|
|
236
|
+
v as buildFetchError,
|
|
237
|
+
T as concatenateSerialisedErrorMessages,
|
|
238
|
+
h as convertMillisecondsToTimestamp,
|
|
239
|
+
k as convertODataTypeIdToUsageTypeId,
|
|
240
|
+
B as extractExtensionFromPath,
|
|
241
|
+
A as extractNameFromPath,
|
|
242
|
+
o as formatNumberAsDecimalNumber,
|
|
243
|
+
O as formatNumberAsDuration,
|
|
244
|
+
M as formatNumberAsSize,
|
|
245
|
+
R as formatNumberAsStorageSize,
|
|
246
|
+
c as formatNumberAsWholeNumber,
|
|
247
|
+
G as getComponentStatus,
|
|
248
|
+
w as getCurrentTimestamp,
|
|
249
|
+
U as getDataFormats,
|
|
250
|
+
W as getRecordDelimiters,
|
|
251
|
+
j as getValueDelimiters,
|
|
252
|
+
C as lookupMimeTypeForExtension,
|
|
253
|
+
I as normalizeToError,
|
|
254
|
+
F as serialiseError
|
|
255
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PreviewColumn } from './Z_PreviewColumn';
|
|
2
|
+
export type ParsedValue = {
|
|
3
|
+
isValid: boolean;
|
|
4
|
+
value: bigint | boolean | number | string | null;
|
|
5
|
+
};
|
|
6
|
+
export declare class ContentAuditColumn extends PreviewColumn {
|
|
7
|
+
doCountIndividualValidValues: boolean;
|
|
8
|
+
doCountPatterns: boolean;
|
|
9
|
+
invalidValueCount: number;
|
|
10
|
+
invalidValues: {
|
|
11
|
+
recordNumber: number;
|
|
12
|
+
value: string;
|
|
13
|
+
}[];
|
|
14
|
+
isRequired: boolean;
|
|
15
|
+
isUnique: boolean;
|
|
16
|
+
maxDecimals: number;
|
|
17
|
+
maxSize: number;
|
|
18
|
+
maxValue: boolean | number | string | undefined;
|
|
19
|
+
minDecimals: number;
|
|
20
|
+
minSize: number;
|
|
21
|
+
minValue: boolean | number | string | undefined;
|
|
22
|
+
patterns: Record<string, number>;
|
|
23
|
+
validValueCount: number;
|
|
24
|
+
validValues: Record<string, number>;
|
|
25
|
+
voidValueCount: number;
|
|
26
|
+
constructor(dataUsageTypeId: string, label: string);
|
|
27
|
+
addInvalidValue(originalValue: string, recordNumber: number): string;
|
|
28
|
+
addValidValue(originalValue: string, parsedValue: ParsedValue, wholeDigitCount?: number, decimalDigitCount?: number): ParsedValue;
|
|
29
|
+
addVoidValue(): null;
|
|
30
|
+
finalise(): void;
|
|
31
|
+
private determineNumericPattern;
|
|
32
|
+
private determineTextPattern;
|
|
33
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Timestamp } from './timestamp';
|
|
2
|
+
export interface ComponentConfig extends Record<string, unknown> {
|
|
3
|
+
description?: Record<string, string>;
|
|
4
|
+
firstCreatedAt?: Timestamp;
|
|
5
|
+
id: string;
|
|
6
|
+
label: Record<string, string>;
|
|
7
|
+
lastUpdatedAt?: Timestamp;
|
|
8
|
+
logo?: string;
|
|
9
|
+
status?: ComponentStatus;
|
|
10
|
+
statusId: 'alpha' | 'beta' | 'generalAvailability' | 'notApplicable' | 'preAlpha' | 'proposed' | 'releaseCandidate' | 'unavailable' | 'underReview';
|
|
11
|
+
typeId: 'connection' | 'connector' | 'focus' | 'model' | 'dataView' | 'eventQuery' | 'presentation' | 'presenter' | 'tutorial';
|
|
12
|
+
}
|
|
13
|
+
export type ComponentStatus = {
|
|
14
|
+
id: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const getComponentStatus: (id: string, localeId?: string) => ComponentStatus;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ComponentConfig } from './component';
|
|
2
|
+
import { ConnectorConfig } from './connector';
|
|
3
|
+
import { Timestamp } from './timestamp';
|
|
4
|
+
export interface ConnectionAuthorizationConfig {
|
|
5
|
+
accessToken: string;
|
|
6
|
+
accountId: string;
|
|
7
|
+
expiresAt: Timestamp;
|
|
8
|
+
expiresIn: number;
|
|
9
|
+
refreshToken: string;
|
|
10
|
+
scope: string;
|
|
11
|
+
tokenType: string;
|
|
12
|
+
uid: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ConnectionConfig extends ComponentConfig {
|
|
15
|
+
authorisation: Record<string, ConnectionAuthorizationConfig>;
|
|
16
|
+
connectorConfig: ConnectorConfig;
|
|
17
|
+
lastVerifiedAt: Timestamp;
|
|
18
|
+
notation?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ConnectionNodeConfig {
|
|
21
|
+
childCount?: number;
|
|
22
|
+
columnsConfigs?: ConnectionColumnConfig[];
|
|
23
|
+
extension?: string;
|
|
24
|
+
folderPath: string;
|
|
25
|
+
handle?: DPAFileSystemFileHandle;
|
|
26
|
+
id: string;
|
|
27
|
+
nodeDisplayHeight?: number;
|
|
28
|
+
nodes?: ConnectionNodeConfig[];
|
|
29
|
+
label: string;
|
|
30
|
+
lastModifiedAt?: Timestamp;
|
|
31
|
+
mimeType?: string;
|
|
32
|
+
name: string;
|
|
33
|
+
size?: number;
|
|
34
|
+
typeId: ConnectionNodeTypeId;
|
|
35
|
+
}
|
|
36
|
+
export type ConnectionNodeTypeId = 'folder' | 'object';
|
|
37
|
+
export interface ConnectionDescription {
|
|
38
|
+
objects: {
|
|
39
|
+
id: string;
|
|
40
|
+
label: Record<string, string>;
|
|
41
|
+
columns: ConnectionColumnConfig[];
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
export interface ConnectionColumnConfig {
|
|
45
|
+
invalidValueCount?: number;
|
|
46
|
+
invalidValues?: string[];
|
|
47
|
+
isIgnored?: boolean;
|
|
48
|
+
isRequired?: boolean;
|
|
49
|
+
isUnique?: boolean;
|
|
50
|
+
label: Record<string, string>;
|
|
51
|
+
maxDecimals?: number;
|
|
52
|
+
maxSize?: number;
|
|
53
|
+
maxValue?: string;
|
|
54
|
+
minDecimals?: number;
|
|
55
|
+
minSize?: number;
|
|
56
|
+
minValue?: string;
|
|
57
|
+
patterns?: Record<string, string>;
|
|
58
|
+
storageTypeId?: StorageTypeId;
|
|
59
|
+
usageTypeId?: UsageTypeId;
|
|
60
|
+
validValueCount?: number;
|
|
61
|
+
validValues?: Record<string, string>;
|
|
62
|
+
voidValueCount?: number;
|
|
63
|
+
}
|
|
64
|
+
export type DPAFileSystemFileHandle = {
|
|
65
|
+
readonly kind: 'file';
|
|
66
|
+
getFile(): Promise<File>;
|
|
67
|
+
};
|
|
68
|
+
export type StorageTypeId = 'binary' | 'boolean' | 'byte' | 'date' | 'dateTime' | 'dateTimeOffset' | 'decimal' | 'double' | 'int8' | 'int16' | 'int32' | 'int64' | 'object' | 'single' | 'string' | 'time' | 'unknown';
|
|
69
|
+
export type UsageTypeId = 'boolean' | 'decimalNumber' | 'moment' | 'momentDate' | 'momentTime' | 'string' | 'unknown' | 'wholeNumber';
|
|
70
|
+
export interface Encoding {
|
|
71
|
+
id: string;
|
|
72
|
+
confidenceLevel?: number;
|
|
73
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Callback, Options, Parser } from 'csv-parse/browser/esm';
|
|
2
|
+
import { ComponentConfig } from './component';
|
|
3
|
+
import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
4
|
+
import { DataViewContentAuditConfig, ValueDelimiterId } from './dataView';
|
|
5
|
+
export interface Connector {
|
|
6
|
+
abortController?: AbortController | undefined;
|
|
7
|
+
readonly config: ConnectorConfig;
|
|
8
|
+
readonly connectionConfig: ConnectionConfig;
|
|
9
|
+
abortOperation?(connector: Connector): void;
|
|
10
|
+
authenticateConnection?(accountId: string, windowCenterX: number, windowCenterY: number): Window;
|
|
11
|
+
createObject?(connector: Connector, settings: CreateSettings): Promise<void>;
|
|
12
|
+
describeConnection?(connector: Connector, settings: DescribeSettings): Promise<DescribeResult>;
|
|
13
|
+
dropObject?(connector: Connector, settings: DropSettings): Promise<void>;
|
|
14
|
+
findObject?(connector: Connector, findSettings: FindSettings): Promise<FindResult>;
|
|
15
|
+
getRecord?(connector: Connector, getSettings: GetSettings): Promise<GetResult>;
|
|
16
|
+
listNodes?(connector: Connector, settings: ListSettings): Promise<ListResult>;
|
|
17
|
+
previewObject?(connector: Connector, settings: PreviewSettings): Promise<PreviewResult>;
|
|
18
|
+
removeRecords?(connector: Connector, settings: RemoveSettings): Promise<void>;
|
|
19
|
+
retrieveRecords?(connector: Connector, settings: RetrieveSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveSummary) => void, tools?: RetrieveTools): Promise<void>;
|
|
20
|
+
upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export interface ConnectorCallbackData {
|
|
23
|
+
typeId: string;
|
|
24
|
+
properties: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
export interface ConnectorConfig extends ComponentConfig {
|
|
27
|
+
category?: ConnectorCategory;
|
|
28
|
+
categoryId: string;
|
|
29
|
+
implementations: Record<string, ConnectorImplementation>;
|
|
30
|
+
usageId: 'bidirectional' | 'destination' | 'source';
|
|
31
|
+
vendorAccountURL?: string;
|
|
32
|
+
vendorDocumentationURL?: string;
|
|
33
|
+
vendorHomeURL?: string;
|
|
34
|
+
version: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ConnectorImplementation {
|
|
37
|
+
activeConnectionCount?: number;
|
|
38
|
+
canDescribe?: boolean;
|
|
39
|
+
id?: string;
|
|
40
|
+
authMethodId: 'apiKey' | 'disabled' | 'oAuth2' | 'none';
|
|
41
|
+
label?: Record<string, string>;
|
|
42
|
+
maxConnectionCount?: number;
|
|
43
|
+
params?: Record<string, string>[];
|
|
44
|
+
}
|
|
45
|
+
export interface ConnectorOperationSettings {
|
|
46
|
+
accountId?: string;
|
|
47
|
+
appCheckToken?: string;
|
|
48
|
+
sessionAccessToken?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface AuditContentResult {
|
|
51
|
+
contentAuditConfig: DataViewContentAuditConfig;
|
|
52
|
+
}
|
|
53
|
+
export interface AuditContentSettings extends ConnectorOperationSettings {
|
|
54
|
+
chunkSize?: number;
|
|
55
|
+
encodingId: string;
|
|
56
|
+
path: string;
|
|
57
|
+
valueDelimiterId: ValueDelimiterId;
|
|
58
|
+
}
|
|
59
|
+
export interface CreateSettings extends ConnectorOperationSettings {
|
|
60
|
+
accountId?: string;
|
|
61
|
+
path: string;
|
|
62
|
+
structure: string;
|
|
63
|
+
}
|
|
64
|
+
interface DescribeSettings extends ConnectorOperationSettings {
|
|
65
|
+
}
|
|
66
|
+
interface DescribeResult {
|
|
67
|
+
description: ConnectionDescription;
|
|
68
|
+
}
|
|
69
|
+
export interface DropSettings extends ConnectorOperationSettings {
|
|
70
|
+
path: string;
|
|
71
|
+
}
|
|
72
|
+
export interface FindResult {
|
|
73
|
+
folderPath?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface FindSettings extends ConnectorOperationSettings {
|
|
76
|
+
containerName?: string;
|
|
77
|
+
objectName: string;
|
|
78
|
+
}
|
|
79
|
+
export interface GetResult {
|
|
80
|
+
record?: string[] | Record<string, unknown>;
|
|
81
|
+
}
|
|
82
|
+
export interface GetSettings extends ConnectorOperationSettings {
|
|
83
|
+
id: string;
|
|
84
|
+
path: string;
|
|
85
|
+
}
|
|
86
|
+
export interface InitialiseSettings {
|
|
87
|
+
connectorStorageURLPrefix: string;
|
|
88
|
+
}
|
|
89
|
+
export interface ListResult {
|
|
90
|
+
cursor: string | number | undefined;
|
|
91
|
+
connectionNodeConfigs: ConnectionNodeConfig[];
|
|
92
|
+
isMore: boolean;
|
|
93
|
+
totalCount: number;
|
|
94
|
+
}
|
|
95
|
+
export interface ListSettings extends ConnectorOperationSettings {
|
|
96
|
+
folderPath: string;
|
|
97
|
+
limit?: number;
|
|
98
|
+
offset?: number;
|
|
99
|
+
totalCount?: number;
|
|
100
|
+
}
|
|
101
|
+
export interface PreviewResult {
|
|
102
|
+
data: Record<string, unknown>[] | Uint8Array;
|
|
103
|
+
typeId: 'jsonArray' | 'uint8Array';
|
|
104
|
+
}
|
|
105
|
+
export interface PreviewSettings extends ConnectorOperationSettings {
|
|
106
|
+
chunkSize?: number;
|
|
107
|
+
extension?: string;
|
|
108
|
+
path: string;
|
|
109
|
+
}
|
|
110
|
+
export interface RemoveSettings extends ConnectorOperationSettings {
|
|
111
|
+
keys: string[];
|
|
112
|
+
path: string;
|
|
113
|
+
}
|
|
114
|
+
export interface RetrieveSettings extends ConnectorOperationSettings {
|
|
115
|
+
chunkSize?: number;
|
|
116
|
+
encodingId: string;
|
|
117
|
+
path: string;
|
|
118
|
+
valueDelimiterId: ValueDelimiterId;
|
|
119
|
+
}
|
|
120
|
+
export interface RetrieveResult {
|
|
121
|
+
records: (string[] | Record<string, unknown>)[];
|
|
122
|
+
}
|
|
123
|
+
export interface RetrieveSummary {
|
|
124
|
+
byteCount: number;
|
|
125
|
+
commentLineCount: number;
|
|
126
|
+
emptyLineCount: number;
|
|
127
|
+
invalidFieldLengthCount: number;
|
|
128
|
+
lineCount: number;
|
|
129
|
+
recordCount: number;
|
|
130
|
+
}
|
|
131
|
+
export interface RetrieveTools {
|
|
132
|
+
csvParse: (options?: Options, callback?: Callback) => Parser | undefined;
|
|
133
|
+
}
|
|
134
|
+
export interface UpsertSettings extends ConnectorOperationSettings {
|
|
135
|
+
records: Record<string, unknown>[];
|
|
136
|
+
path: string;
|
|
137
|
+
}
|
|
138
|
+
type ConnectorCategory = {
|
|
139
|
+
id: string;
|
|
140
|
+
label: string;
|
|
141
|
+
};
|
|
142
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ComponentConfig } from './component';
|
|
2
|
+
export interface ContextConfig extends ComponentConfig {
|
|
3
|
+
focuses: FocusConfig[];
|
|
4
|
+
}
|
|
5
|
+
export interface FocusConfig extends ComponentConfig {
|
|
6
|
+
models: ModelConfig[];
|
|
7
|
+
}
|
|
8
|
+
export interface ModelConfig extends ComponentConfig {
|
|
9
|
+
dimensions: DimensionConfig[];
|
|
10
|
+
entities: EntityConfig[];
|
|
11
|
+
views: ViewConfig[];
|
|
12
|
+
}
|
|
13
|
+
export interface DimensionConfig extends ComponentConfig {
|
|
14
|
+
id: string;
|
|
15
|
+
hierarchies: HierarchyConfig[];
|
|
16
|
+
label: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export interface HierarchyConfig extends ComponentConfig {
|
|
19
|
+
id: string;
|
|
20
|
+
label: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export interface EntityConfig extends ComponentConfig {
|
|
23
|
+
labelPlural: Record<string, string>;
|
|
24
|
+
characteristics: EntityCharacteristicConfig[];
|
|
25
|
+
computations: EntityComputationConfig[];
|
|
26
|
+
events: EntityEventConfig[];
|
|
27
|
+
}
|
|
28
|
+
export interface EntityCharacteristicConfig {
|
|
29
|
+
id: string;
|
|
30
|
+
label: Record<string, string>;
|
|
31
|
+
}
|
|
32
|
+
export interface EntityComputationConfig {
|
|
33
|
+
id: string;
|
|
34
|
+
label: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
export interface EntityEventConfig {
|
|
37
|
+
id: string;
|
|
38
|
+
labelAction: Record<string, string>;
|
|
39
|
+
labelState: Record<string, string>;
|
|
40
|
+
}
|
|
41
|
+
export interface ViewConfig extends ComponentConfig {
|
|
42
|
+
placeholder: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Event {
|
|
45
|
+
id?: number;
|
|
46
|
+
entityId: string;
|
|
47
|
+
effDate: number;
|
|
48
|
+
typeId: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ComponentConfig } from './component';
|
|
2
|
+
import { Timestamp } from './timestamp';
|
|
3
|
+
import { ConnectionColumnConfig, ConnectionNodeConfig } from './connection';
|
|
4
|
+
export interface DataViewConfig extends ComponentConfig {
|
|
5
|
+
connectionId?: string;
|
|
6
|
+
connectionNodeConfig?: ConnectionNodeConfig;
|
|
7
|
+
previewConfig?: DataViewPreviewConfig;
|
|
8
|
+
contentAuditConfig?: DataViewContentAuditConfig;
|
|
9
|
+
relationshipsAuditConfig?: DataViewRelationshipsAuditConfig;
|
|
10
|
+
}
|
|
11
|
+
export interface DataViewContentAuditConfig {
|
|
12
|
+
asAt: Timestamp;
|
|
13
|
+
columns: ConnectionColumnConfig[];
|
|
14
|
+
commentLineCount: number;
|
|
15
|
+
emptyLineCount: number;
|
|
16
|
+
invalidFieldLengthCount: number;
|
|
17
|
+
duration: number;
|
|
18
|
+
lineCount: number;
|
|
19
|
+
recordCount: number;
|
|
20
|
+
}
|
|
21
|
+
export interface DataViewPreviewConfig {
|
|
22
|
+
asAt: Timestamp;
|
|
23
|
+
columnConfigs: ConnectionColumnConfig[];
|
|
24
|
+
dataFormatId: DataFormatId;
|
|
25
|
+
duration: number;
|
|
26
|
+
encodingConfidenceLevel?: number;
|
|
27
|
+
encodingId?: string;
|
|
28
|
+
errorMessage?: string;
|
|
29
|
+
hasHeaders?: boolean;
|
|
30
|
+
recordDelimiterId?: RecordDelimiterId;
|
|
31
|
+
records: {
|
|
32
|
+
isValid: boolean;
|
|
33
|
+
value: ParsedValue;
|
|
34
|
+
}[][];
|
|
35
|
+
size: number;
|
|
36
|
+
text: string;
|
|
37
|
+
valueDelimiterId?: ValueDelimiterId;
|
|
38
|
+
}
|
|
39
|
+
export interface DataViewRelationshipsAuditConfig {
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface EncodingConfig {
|
|
43
|
+
id: string;
|
|
44
|
+
groupLabel: string;
|
|
45
|
+
label: string;
|
|
46
|
+
isDetectable: boolean;
|
|
47
|
+
isDecodable: boolean;
|
|
48
|
+
}
|
|
49
|
+
type DataFormat = {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
};
|
|
53
|
+
export declare const getDataFormat: (id: string, localeId?: string) => DataFormat;
|
|
54
|
+
export declare const getDataFormats: (localeId?: string) => DataFormat[];
|
|
55
|
+
type RecordDelimiter = {
|
|
56
|
+
id: string;
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
export declare const getRecordDelimiter: (id: string, localeId?: string) => RecordDelimiter;
|
|
60
|
+
export declare const getRecordDelimiters: (localeId?: string) => RecordDelimiter[];
|
|
61
|
+
type ValueDelimiter = {
|
|
62
|
+
id: string;
|
|
63
|
+
label: string;
|
|
64
|
+
};
|
|
65
|
+
export declare const getValueDelimiter: (id: string, localeId?: string) => ValueDelimiter;
|
|
66
|
+
export declare const getValueDelimiters: (localeId?: string) => ValueDelimiter[];
|
|
67
|
+
export type ParsedValue = bigint | boolean | number | string | null;
|
|
68
|
+
export type DataFormatId = 'dtv' | 'e/e' | 'jsonArray' | 'spss' | 'xls' | 'xlsx' | 'xml';
|
|
69
|
+
export type RecordDelimiterId = '\n' | '\r' | '\r\n';
|
|
70
|
+
export type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\t' | '_' | '0x1F' | '|';
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ConnectionConfig } from './connection';
|
|
2
|
+
import { AuditContentResult, ConnectorCallbackData, ConnectorOperationSettings, InitialiseSettings, ListResult, RetrieveResult } from './connector';
|
|
3
|
+
import { DataViewPreviewConfig, EncodingConfig } from './dataView';
|
|
4
|
+
type InitialiseEngine = (settings: InitialiseSettings) => Promise<void>;
|
|
5
|
+
type ProcessConnectorRequest = (id: string, connectionConfig: ConnectionConfig, settings: ConnectorOperationSettings, callback?: ((callbackData: ConnectorCallbackData) => void) | undefined) => Promise<ConnectorInterfaceResult>;
|
|
6
|
+
export type ConnectorInterfaceResult = AuditContentResult | DataViewPreviewConfig | ListResult | RetrieveResult;
|
|
7
|
+
export interface Engine {
|
|
8
|
+
getEncodingConfigs: (localeId: string) => EncodingConfig[];
|
|
9
|
+
invokeWorker(errorEventCallback: (errorEvent: ErrorEvent) => void): EngineWorkerInterface;
|
|
10
|
+
}
|
|
11
|
+
export interface EngineWorkerInterface {
|
|
12
|
+
initialise: InitialiseEngine;
|
|
13
|
+
processConnectorRequest: ProcessConnectorRequest;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface SerialisedError {
|
|
2
|
+
body?: string;
|
|
3
|
+
componentName?: string;
|
|
4
|
+
info?: string;
|
|
5
|
+
locator: string;
|
|
6
|
+
message: string;
|
|
7
|
+
name: string;
|
|
8
|
+
stack?: string;
|
|
9
|
+
}
|
|
10
|
+
declare class DataPosError extends Error {
|
|
11
|
+
locator: string;
|
|
12
|
+
constructor(message: string, locator: string, options?: ErrorOptions);
|
|
13
|
+
}
|
|
14
|
+
export declare class ApplicationError extends DataPosError {
|
|
15
|
+
constructor(message: string, locator: string, options?: ErrorOptions);
|
|
16
|
+
}
|
|
17
|
+
export declare class APIError extends ApplicationError {
|
|
18
|
+
constructor(message: string, locator: string, options?: ErrorOptions);
|
|
19
|
+
}
|
|
20
|
+
export declare class EngineError extends ApplicationError {
|
|
21
|
+
constructor(message: string, locator: string, options?: ErrorOptions);
|
|
22
|
+
}
|
|
23
|
+
export declare class FetchError extends ApplicationError {
|
|
24
|
+
body: string;
|
|
25
|
+
constructor(message: string, locator: string, body: string, options?: ErrorOptions);
|
|
26
|
+
}
|
|
27
|
+
export declare class VueError extends ApplicationError {
|
|
28
|
+
componentName?: string;
|
|
29
|
+
info: string;
|
|
30
|
+
constructor(message: string, locator: string, info: string, componentName?: string, options?: ErrorOptions);
|
|
31
|
+
}
|
|
32
|
+
export declare class WindowRuntimeError extends ApplicationError {
|
|
33
|
+
constructor(message: string, locator: string, options?: ErrorOptions);
|
|
34
|
+
}
|
|
35
|
+
export declare class WindowPromiseRejectionError extends ApplicationError {
|
|
36
|
+
constructor(message: string, locator: string, options?: ErrorOptions);
|
|
37
|
+
}
|
|
38
|
+
export declare class OperationalError extends DataPosError {
|
|
39
|
+
constructor(message: string, locator: string, options?: ErrorOptions);
|
|
40
|
+
}
|
|
41
|
+
export declare function buildFetchError(response: {
|
|
42
|
+
status: number;
|
|
43
|
+
statusText: string;
|
|
44
|
+
text: () => Promise<string>;
|
|
45
|
+
}, message: string, locator: string): Promise<FetchError>;
|
|
46
|
+
export declare function concatenateSerialisedErrorMessages(serialisedErrors: SerialisedError[]): string;
|
|
47
|
+
export declare function normalizeToError(value: unknown, fallbackMessage?: string): Error;
|
|
48
|
+
export declare function serialiseError(error?: unknown): SerialisedError[];
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { DefaultTimestamp } from './timestamp';
|
|
2
|
+
export type { ComponentConfig, ComponentStatus } from './component';
|
|
3
|
+
export type { ConnectionAuthorizationConfig, ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig } from './connection';
|
|
4
|
+
export type { DPAFileSystemFileHandle, Encoding, StorageTypeId, UsageTypeId } from './connection';
|
|
5
|
+
export type { AuditContentResult, AuditContentSettings } from './connector';
|
|
6
|
+
export type { Connector, ConnectorCallbackData, ConnectorConfig, ConnectorImplementation, ConnectorOperationSettings } from './connector';
|
|
7
|
+
export type { CreateSettings } from './connector';
|
|
8
|
+
export type { DropSettings } from './connector';
|
|
9
|
+
export type { FindResult, FindSettings } from './connector';
|
|
10
|
+
export type { GetResult, GetSettings } from './connector';
|
|
11
|
+
export type { InitialiseSettings } from './connector';
|
|
12
|
+
export type { ListResult, ListSettings } from './connector';
|
|
13
|
+
export type { PreviewResult, PreviewSettings } from './connector';
|
|
14
|
+
export type { RemoveSettings } from './connector';
|
|
15
|
+
export type { RetrieveResult, RetrieveSettings, RetrieveSummary, RetrieveTools } from './connector';
|
|
16
|
+
export type { UpsertSettings } from './connector';
|
|
17
|
+
export type { ContextConfig, FocusConfig, ModelConfig, DimensionConfig, EntityCharacteristicConfig, EntityComputationConfig } from './context';
|
|
18
|
+
export type { EntityConfig, EntityEventConfig, HierarchyConfig, ViewConfig, Event } from './context';
|
|
19
|
+
export type { DataFormatId, EncodingConfig, RecordDelimiterId, ValueDelimiterId } from './dataView';
|
|
20
|
+
export type { DataViewConfig, DataViewContentAuditConfig, DataViewPreviewConfig, DataViewRelationshipsAuditConfig, ParsedValue } from './dataView';
|
|
21
|
+
export type { ConnectorInterfaceResult, Engine, EngineWorkerInterface } from './engine';
|
|
22
|
+
export { APIError, ApplicationError, EngineError, FetchError, OperationalError, VueError, WindowRuntimeError, WindowPromiseRejectionError } from './errors';
|
|
23
|
+
export type { SerialisedError } from './errors';
|
|
24
|
+
export type { EventQueryConfig } from './eventQuery';
|
|
25
|
+
export type { IPresenter, IPresenterConfig, IPresenterItemConfig } from './presenter';
|
|
26
|
+
export type { ServiceData } from './service';
|
|
27
|
+
export type { Timestamp } from './timestamp';
|
|
28
|
+
export type { TutorialConfig } from './tutorial';
|
|
29
|
+
export { buildFetchError, concatenateSerialisedErrorMessages, normalizeToError, serialiseError } from './errors';
|
|
30
|
+
export { convertMillisecondsToTimestamp, getCurrentTimestamp } from './timestamp';
|
|
31
|
+
export { convertODataTypeIdToUsageTypeId } from './utilities';
|
|
32
|
+
export { extractExtensionFromPath, extractNameFromPath } from './utilities';
|
|
33
|
+
export { formatNumberAsDecimalNumber, formatNumberAsDuration, formatNumberAsSize, formatNumberAsStorageSize, formatNumberAsWholeNumber } from './utilities';
|
|
34
|
+
export { getDataFormats, getRecordDelimiters, getValueDelimiters } from './dataView';
|
|
35
|
+
export { getComponentStatus } from './component';
|
|
36
|
+
export { lookupMimeTypeForExtension } from './utilities';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentConfig } from './component';
|
|
2
|
+
export interface IPresenter {
|
|
3
|
+
readonly config: IPresenterConfig;
|
|
4
|
+
list(path: string): IPresenterItemConfig[];
|
|
5
|
+
render(id: string, renderTo: string | HTMLElement): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export interface IPresenterConfig extends ComponentConfig {
|
|
8
|
+
index: IPresenterItemConfig[];
|
|
9
|
+
}
|
|
10
|
+
export interface IPresenterItemConfig {
|
|
11
|
+
items?: IPresenterItemConfig[];
|
|
12
|
+
label: Record<string, string>;
|
|
13
|
+
name: string;
|
|
14
|
+
typeId: 'folder' | 'object';
|
|
15
|
+
}
|
|
16
|
+
export interface IPresentation {
|
|
17
|
+
readonly config: IPresentationConfig;
|
|
18
|
+
render(data: IPresentationData, renderTo: string | HTMLElement | null, localeId?: string): void;
|
|
19
|
+
resize: () => void;
|
|
20
|
+
update: () => void;
|
|
21
|
+
}
|
|
22
|
+
export interface IPresentationConfig {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
typeId: 'declarative' | 'coded';
|
|
26
|
+
blocks?: IPresentationBlockConfig[];
|
|
27
|
+
}
|
|
28
|
+
export interface IPresentationBlockConfig {
|
|
29
|
+
config: IHighchartsBasicConfig | Record<string, unknown>;
|
|
30
|
+
typeId?: 'chartJSBasic' | 'cytoscapeMarkov' | 'cytoscapeNetwork' | 'highchartsBasic' | 'table' | 'text';
|
|
31
|
+
}
|
|
32
|
+
export interface IPresentationData {
|
|
33
|
+
dimensions: {
|
|
34
|
+
id: string;
|
|
35
|
+
type: {
|
|
36
|
+
id: string;
|
|
37
|
+
spanId?: string;
|
|
38
|
+
intervalId?: string;
|
|
39
|
+
};
|
|
40
|
+
intervals: {
|
|
41
|
+
label: string;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
measures: {
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
values: number[];
|
|
48
|
+
}[];
|
|
49
|
+
}
|
|
50
|
+
interface IHighchartsBasicConfig {
|
|
51
|
+
series: {
|
|
52
|
+
typeId: TChartSeriesTypeId;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
type TChartSeriesTypeId = 'areaLine' | 'areaSpline' | 'bar' | 'column' | 'line' | 'pyramid' | 'spline';
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const convertODataTypeIdToUsageTypeId: (oDataTypeId: string) => string;
|
|
2
|
+
export declare const extractNameFromPath: (itemPath: string) => string | undefined;
|
|
3
|
+
export declare const extractExtensionFromPath: (itemPath: string) => string | undefined;
|
|
4
|
+
export declare const formatNumberAsDecimalNumber: (number?: number, decimalPlaces?: number, minimumFractionDigits?: number, locale?: string) => string;
|
|
5
|
+
export declare const formatNumberAsSize: (number?: number) => string;
|
|
6
|
+
export declare const formatNumberAsStorageSize: (number?: number) => string;
|
|
7
|
+
export declare const formatNumberAsDuration: (number?: number) => string;
|
|
8
|
+
export declare const formatNumberAsWholeNumber: (number?: number, locale?: string) => string;
|
|
9
|
+
export declare const lookupMimeTypeForExtension: (extension: string) => string;
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@datapos/datapos-shared",
|
|
3
|
+
"license": "ISC",
|
|
4
|
+
"private": false,
|
|
5
|
+
"version": "0.1.867",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"module": "./dist/datapos-shared.es.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/datapos-shared.es.js",
|
|
14
|
+
"types": "./dist/types/src/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"types": "./dist/types/src/index.d.ts",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@datapos/datapos-dev-operations": "^0.2.25",
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
21
|
+
"@typescript-eslint/parser": "^8.32.0",
|
|
22
|
+
"csv-parse": "^5.6.0",
|
|
23
|
+
"eslint": "^9.26.0",
|
|
24
|
+
"eslint-plugin-import": "^2.31.0",
|
|
25
|
+
"prettier": "^3.5.3",
|
|
26
|
+
"typescript": "^5.8.3",
|
|
27
|
+
"vite": "^6.3.5",
|
|
28
|
+
"vite-plugin-dts": "^4.5.3"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"audit": "npm audit",
|
|
32
|
+
"build": "npx vite build",
|
|
33
|
+
"bumpVersion": "node -e \"require('@datapos/datapos-dev-operations/scriptHelpers').bumpVersion()\"",
|
|
34
|
+
"check": "npx npm-check-updates && npm outdated",
|
|
35
|
+
"document": "npx npm-license-crawler --onlyDirectDependencies --production --relativeLicensePath --json LICENSES.json",
|
|
36
|
+
"format": "prettier --write *.ts",
|
|
37
|
+
"lint": "npx eslint **/*.ts",
|
|
38
|
+
"publishToNPM": "npm publish",
|
|
39
|
+
"release": "npm run syncWithGitHub && npm run build && npm run publishToNPM",
|
|
40
|
+
"syncWithGitHub": "npm run bumpVersion && node -e \"require('@datapos/datapos-dev-operations/scriptHelpers').syncWithGitHub()\"",
|
|
41
|
+
"test": "echo \"***** TEST SCRIPT NOT IMPLEMENTED. *****\"",
|
|
42
|
+
"updateDependencies": "npm run updateOperations",
|
|
43
|
+
"updateOperations": "npm install --save-dev @datapos/datapos-dev-operations@latest"
|
|
44
|
+
}
|
|
45
|
+
}
|