@dpuse/dpuse-connector-application-emulator 0.0.8
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 +21 -0
- package/README.md +81 -0
- package/dist/dpuse-connector-application-emulator.es.js +327 -0
- package/dist/dpuse-connector-application-emulator.es.js.map +1 -0
- package/dist/types/src/index.d.ts +17 -0
- package/dist/types/vite.config.d.ts +2 -0
- package/dist/types/vitest.config.d.ts +5 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DPUse Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# DPUse Application Emulator Connector
|
|
2
|
+
|
|
3
|
+
[](./LICENSE)
|
|
4
|
+
<span><!-- OWASP_BADGES_START -->
|
|
5
|
+
[](https://dpuse.github.io/dpuse-connector-application-emulator/dependency-check-reports/dependency-check-report.html)
|
|
6
|
+
|
|
7
|
+
<!-- OWASP_BADGES_END --></span>
|
|
8
|
+
|
|
9
|
+
A TypeScript library that implements the File Store Emulator connector. It provides easy access to a curated set of files for demonstration and evaluation purposes.
|
|
10
|
+
|
|
11
|
+
## Rust WebAssembly Helpers
|
|
12
|
+
|
|
13
|
+
The connector now ships with a lightweight Rust crate located in [rust/dpuse-connector-application-emulator-core](rust/dpuse-connector-application-emulator-core). It is compiled to WebAssembly with `wasm-pack` so TypeScript can call native Rust logic.
|
|
14
|
+
|
|
15
|
+
- Run `npm run build:rust` (requires the [`wasm-pack` CLI](https://rustwasm.github.io/wasm-pack/installer/)) whenever you change the Rust sources. The command rebuilds the package into [rust/dpuse-connector-application-emulator-core/pkg](rust/dpuse-connector-application-emulator-core/pkg).
|
|
16
|
+
- The async wrapper in [src/rustBridge.ts](src/rustBridge.ts) lazy-loads the generated bindings and surfaces helpers like `addNumbersWithRust()` and `checksumWithRust()`.
|
|
17
|
+
- `FileStoreEmulatorConnector` exposes `addUsingRust()` and `versionChecksumUsingRust()` so consumers can exercise the Rust-backed functionality without dealing with low-level WebAssembly plumbing.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
There’s no need to install this connector manually. Once released, it’s uploaded to the Data Positioning Engine cloud and becomes instantly available to all new instances of the browser app. A notification about the new version is also sent to all existing browser apps.
|
|
22
|
+
|
|
23
|
+
## Reports & Compliance
|
|
24
|
+
|
|
25
|
+
### Dependency Check Report
|
|
26
|
+
|
|
27
|
+
The OWASP Dependency Check Report identifies known vulnerabilities in project dependencies. It is generated automatically on each release using the npm package `owasp-dependency-check`. We also rely on GitHub Dependabot to continuously check for vulnerabilities across all dependencies.
|
|
28
|
+
|
|
29
|
+
[View the OWASP Dependency Check Report](https://dpuse.github.io/dpuse-connector-application-emulator/dependency-check-reports/dependency-check-report.html)
|
|
30
|
+
|
|
31
|
+
### Dependency Licenses
|
|
32
|
+
|
|
33
|
+
The following table lists top-level production and peer dependencies. All these dependencies (including transitive ones) have been recursively verified to use Apache-2.0, CC0-1.0, or MIT—commercially friendly licenses with minimal restrictions. Developers cloning this repository should independently verify dev and optional dependencies; users of the uploaded library are covered by these checks.
|
|
34
|
+
|
|
35
|
+
<!-- DEPENDENCY_LICENSES_START -->
|
|
36
|
+
|
|
37
|
+
| Name | Type | Installed | Latest | Latest Released | Deps | Document |
|
|
38
|
+
| :------------------------------- | :--- | :-------: | :-----: | :--------------------- | ---: | :---------------------------------------------------------------------------------------- |
|
|
39
|
+
| @dpuse/dpuse-shared | MIT | 0.3.595 | 0.3.595 | this month: 2026-03-23 | 0 | [LICENSE](https://raw.githubusercontent.com/dpuse/dpuse-shared/main/LICENSE) |
|
|
40
|
+
| @dpuse/dpuse-tool-csv-parse | MIT | 0.0.137 | 0.0.137 | this month: 2026-03-23 | 2 | [LICENSE](https://raw.githubusercontent.com/dpuse/dpuse-tool-csv-parse/main/LICENSE) |
|
|
41
|
+
| @dpuse/dpuse-tool-file-operators | MIT | 0.0.17 | 0.0.17 | this month: 2026-03-25 | 3 | [LICENSE](https://raw.githubusercontent.com/dpuse/dpuse-tool-file-operators/main/LICENSE) |
|
|
42
|
+
| @dpuse/dpuse-tool-rust-csv-core | MIT | 0.1.20 | 0.1.20 | this month: 2026-03-25 | 1 | [LICENSE](https://raw.githubusercontent.com/dpuse/dpuse-tool-rust-csv-core/main/LICENSE) |
|
|
43
|
+
| nanoid | MIT | 5.1.7 | 5.1.7 | this month: 2026-03-15 | 0 | [LICENSE](https://raw.githubusercontent.com/ai/nanoid/main/LICENSE) |
|
|
44
|
+
|
|
45
|
+
<!-- DEPENDENCY_LICENSES_END -->
|
|
46
|
+
|
|
47
|
+
**Installed dependencies are kept up-to-date with latest releases.**
|
|
48
|
+
|
|
49
|
+
### Bundle Analysis Report
|
|
50
|
+
|
|
51
|
+
The Bundle Analysis Report provides a detailed breakdown of the bundle's composition and module sizes, helping to identify which modules contribute most to the final build. It is generated automatically on each release using the npm package `rollup-plugin-visualizer`.
|
|
52
|
+
|
|
53
|
+
[View the Bundle Analysis Report](https://dpuse.github.io/dpuse-connector-application-emulator/stats/index.html)
|
|
54
|
+
|
|
55
|
+
## Repository Management Commands
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
| Name | VSCode Shortcuts | Notes |
|
|
60
|
+
| -------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| audit | alt+ctrl+shift+a | Audit the project's dependencies for known security vulnerabilities. |
|
|
62
|
+
| build | alt+ctrl+shift+b | Type-check, compile and minify for production. Output in '/dist' directory. |
|
|
63
|
+
| build:rust | | Compile the Rust helper crate to WebAssembly via `wasm-pack`. Requires the `wasm-pack` CLI in your PATH. |
|
|
64
|
+
| buildConnectorConfig | | |
|
|
65
|
+
| bumpVersion | alt+ctrl+shift+v | |
|
|
66
|
+
| check | alt+ctrl+shift+c | List the dependencies in the project that are outdated. |
|
|
67
|
+
| document | alt+ctrl+shift+d | Identify the licenses of the project's dependencies. |
|
|
68
|
+
| format | alt+ctrl+shift+f | Enforce formatting style rules. |
|
|
69
|
+
| lint | alt+ctrl+shift+l | Check the code for potential errors and enforces coding styles. |
|
|
70
|
+
| publishToNPM | alt+ctrl+shift+p | ❌ Not implemented. |
|
|
71
|
+
| release | alt+ctrl+shift+r | Synchronise local repository with the main GitHub repository and upload connector to Data Positioning platform. |
|
|
72
|
+
| syncWithGitHub | alt+ctrl+shift+s | Synchronise local repository with the main GitHub repository. |
|
|
73
|
+
| updateDependencies | alt+ctrl+shift+l | Install the latest version of all Data Positioning dependencies. |
|
|
74
|
+
|
|
75
|
+
## Compliance
|
|
76
|
+
|
|
77
|
+
The following badge reflects FOSSA's assessment of this repository's open-source license compliance.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
[MIT](./LICENSE) © 2026 Data Positioning Pty Ltd
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
//#region node_modules/nanoid/url-alphabet/index.js
|
|
2
|
+
var e = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", t = (t = 21) => {
|
|
3
|
+
let n = "", r = crypto.getRandomValues(new Uint8Array(t |= 0));
|
|
4
|
+
for (; t--;) n += e[r[t] & 63];
|
|
5
|
+
return n;
|
|
6
|
+
}, n = 2048, r = class extends Error {
|
|
7
|
+
data;
|
|
8
|
+
locator;
|
|
9
|
+
constructor(e, t, n, r) {
|
|
10
|
+
super(e, r), this.name = "DPUseError", this.data = n, this.locator = t;
|
|
11
|
+
}
|
|
12
|
+
}, i = class extends r {
|
|
13
|
+
constructor(e, t, n, r) {
|
|
14
|
+
super(e, t, n, r), this.name = "ConnectorError";
|
|
15
|
+
}
|
|
16
|
+
}, a = class extends r {
|
|
17
|
+
constructor(e, t, n, r) {
|
|
18
|
+
super(e, t, n, r), this.name = "FetchError";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
async function o(e, t, n) {
|
|
22
|
+
let r = ` - ${e.statusText}`, i = `${t} Response status '${e.status}${e.statusText ? r : ""}' received.`, o;
|
|
23
|
+
try {
|
|
24
|
+
o = await e.text();
|
|
25
|
+
} catch (e) {
|
|
26
|
+
o = `<body unavailable: ${s(e).message}>`;
|
|
27
|
+
}
|
|
28
|
+
return new a(i, n, { body: c(o) });
|
|
29
|
+
}
|
|
30
|
+
function s(e) {
|
|
31
|
+
if (e instanceof Error) return e;
|
|
32
|
+
if (typeof e == "string") return Error(e);
|
|
33
|
+
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return Error(String(e));
|
|
34
|
+
if (typeof e == "symbol") return Error(e.description ?? "Unknown error");
|
|
35
|
+
if (typeof e == "object") try {
|
|
36
|
+
return Error(JSON.stringify(e));
|
|
37
|
+
} catch {
|
|
38
|
+
return /* @__PURE__ */ Error("Unknown error");
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ Error("Unknown error");
|
|
41
|
+
}
|
|
42
|
+
function c(e) {
|
|
43
|
+
if (!(e == null || e === "")) return e.length > n ? `${e.slice(0, n)}... [truncated]` : e;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-utilities.es.js
|
|
47
|
+
function l(e) {
|
|
48
|
+
if (e) {
|
|
49
|
+
let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
|
|
50
|
+
return n <= t || n === -1 ? e : e.slice(0, Math.max(0, n));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function u(e) {
|
|
54
|
+
if (e) {
|
|
55
|
+
let t = e.lastIndexOf("/") + 1, n = e.lastIndexOf(".");
|
|
56
|
+
if (n <= t) return;
|
|
57
|
+
if (n !== -1) return e.slice(Math.max(0, n + 1));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function d(e) {
|
|
61
|
+
switch (e) {
|
|
62
|
+
case "csv": return "text/csv";
|
|
63
|
+
case "tab":
|
|
64
|
+
case "tsv": return "text/tab-separated-values";
|
|
65
|
+
case "xls": return "application/vnd.ms-excel";
|
|
66
|
+
case "xlsx": return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
67
|
+
default: return "application/octet-stream";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleTool.es.js
|
|
72
|
+
var f = "https://engine-eu.dpuse.app/tools";
|
|
73
|
+
async function p(e, t) {
|
|
74
|
+
let n = `dpuse-tool-${t}`, r = e.find((e) => e.id === n);
|
|
75
|
+
if (!r) throw Error(`Connector could not load unknown tool '${t}'.`);
|
|
76
|
+
return new (await (import(
|
|
77
|
+
/* @vite-ignore */
|
|
78
|
+
`${f}/${t}_v${r.version}/${n}.es.js`
|
|
79
|
+
))).Tool();
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-locale.es.js
|
|
83
|
+
function m(e) {
|
|
84
|
+
return new Map(Object.entries(e));
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentDataView.es.js
|
|
88
|
+
m({ en: "Data Positioning Events" }), m({ en: "Delimited Text" }), m({ en: "JSON" }), m({ en: "SPSS" }), m({ en: "XLSX" }), m({ en: "XML" }), m({ en: "Newline" }), m({ en: "Carriage Return" }), m({ en: "Carriage Return/Newline" }), m({ en: "Colon" }), m({ en: "Comma" }), m({ en: "Exclamation Mark" }), m({ en: "Record Separator" }), m({ en: "Semicolon" }), m({ en: "Space" }), m({ en: "Tab" }), m({ en: "Underscore" }), m({ en: "Unit Separator" }), m({ en: "Vertical Bar" });
|
|
89
|
+
var h = [
|
|
90
|
+
",",
|
|
91
|
+
";",
|
|
92
|
+
" ",
|
|
93
|
+
"|",
|
|
94
|
+
" ",
|
|
95
|
+
":",
|
|
96
|
+
"_",
|
|
97
|
+
"!",
|
|
98
|
+
"0x1F",
|
|
99
|
+
"0x1E"
|
|
100
|
+
], g = {
|
|
101
|
+
"": [
|
|
102
|
+
{
|
|
103
|
+
childCount: 1,
|
|
104
|
+
name: "humanResources",
|
|
105
|
+
typeId: "folder"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: "GGxX3yzmdW8_7G_MSwyi5",
|
|
109
|
+
lastModifiedAt: 1774197102385.2441,
|
|
110
|
+
name: "organisations.csv",
|
|
111
|
+
size: 72,
|
|
112
|
+
typeId: "object"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "14xGczulW60Z5vLEVVyZy",
|
|
116
|
+
lastModifiedAt: 1774197102385.3625,
|
|
117
|
+
name: "people.csv",
|
|
118
|
+
size: 72320,
|
|
119
|
+
typeId: "object"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"/humanResources": [{
|
|
123
|
+
childCount: 2,
|
|
124
|
+
name: "workforce",
|
|
125
|
+
typeId: "folder"
|
|
126
|
+
}],
|
|
127
|
+
"/humanResources/workforce": [{
|
|
128
|
+
id: "XJgBt7TVnPf8l7-vArbui",
|
|
129
|
+
lastModifiedAt: 1774197102385.1426,
|
|
130
|
+
name: "empty.csv",
|
|
131
|
+
size: 0,
|
|
132
|
+
typeId: "object"
|
|
133
|
+
}, {
|
|
134
|
+
id: "_d5Au6rZg-0KlXPhkU0qj",
|
|
135
|
+
lastModifiedAt: 1774197102385.1821,
|
|
136
|
+
name: "engagements.csv",
|
|
137
|
+
size: 0,
|
|
138
|
+
typeId: "object"
|
|
139
|
+
}]
|
|
140
|
+
}, _ = {
|
|
141
|
+
id: "dpuse-connector-application-emulator",
|
|
142
|
+
label: { en: "File Store Emulator" },
|
|
143
|
+
description: { en: "Imitates a cloud-based file storage solution. It hosts a read-only set of files for demonstration, evaluation and testing purposes and is freely available to all users." },
|
|
144
|
+
category: null,
|
|
145
|
+
categoryId: "fileStore",
|
|
146
|
+
firstCreatedAt: null,
|
|
147
|
+
implementations: { default: {
|
|
148
|
+
authMethodId: "none",
|
|
149
|
+
maxConnectionCount: 1
|
|
150
|
+
} },
|
|
151
|
+
icon: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"black\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 17v4\"/><path d=\"m14.305 7.53.923-.382\"/><path d=\"m15.228 4.852-.923-.383\"/><path d=\"m16.852 3.228-.383-.924\"/><path d=\"m16.852 8.772-.383.923\"/><path d=\"m19.148 3.228.383-.924\"/><path d=\"m19.53 9.696-.382-.924\"/><path d=\"m20.772 4.852.924-.383\"/><path d=\"m20.772 7.148.924.383\"/><path d=\"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7\"/><path d=\"M8 21h8\"/><circle cx=\"18\" cy=\"6\" r=\"3\"/></svg>",
|
|
152
|
+
iconDark: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"white\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 17v4\"/><path d=\"m14.305 7.53.923-.382\"/><path d=\"m15.228 4.852-.923-.383\"/><path d=\"m16.852 3.228-.383-.924\"/><path d=\"m16.852 8.772-.383.923\"/><path d=\"m19.148 3.228.383-.924\"/><path d=\"m19.53 9.696-.382-.924\"/><path d=\"m20.772 4.852.924-.383\"/><path d=\"m20.772 7.148.924.383\"/><path d=\"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7\"/><path d=\"M8 21h8\"/><circle cx=\"18\" cy=\"6\" r=\"3\"/></svg>",
|
|
153
|
+
iconNeutral: "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 17v4\"/><path d=\"m14.305 7.53.923-.382\"/><path d=\"m15.228 4.852-.923-.383\"/><path d=\"m16.852 3.228-.383-.924\"/><path d=\"m16.852 8.772-.383.923\"/><path d=\"m19.148 3.228.383-.924\"/><path d=\"m19.53 9.696-.382-.924\"/><path d=\"m20.772 4.852.924-.383\"/><path d=\"m20.772 7.148.924.383\"/><path d=\"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7\"/><path d=\"M8 21h8\"/><circle cx=\"18\" cy=\"6\" r=\"3\"/></svg>",
|
|
154
|
+
lastUpdatedAt: null,
|
|
155
|
+
operations: [
|
|
156
|
+
"abortOperation",
|
|
157
|
+
"auditObjectContent",
|
|
158
|
+
"findObject",
|
|
159
|
+
"getReadableStream",
|
|
160
|
+
"listNodes",
|
|
161
|
+
"previewObject",
|
|
162
|
+
"retrieveRecords"
|
|
163
|
+
],
|
|
164
|
+
status: null,
|
|
165
|
+
statusId: "beta",
|
|
166
|
+
typeId: "connector",
|
|
167
|
+
usageId: "source",
|
|
168
|
+
vendorAccountURL: null,
|
|
169
|
+
vendorDocumentationURL: null,
|
|
170
|
+
vendorHomeURL: null,
|
|
171
|
+
version: "0.0.8"
|
|
172
|
+
}, v = "https://sample-data-eu.dpuse.app/application", y = class {
|
|
173
|
+
abortController;
|
|
174
|
+
config;
|
|
175
|
+
connectorUtilities;
|
|
176
|
+
toolConfigs;
|
|
177
|
+
constructor(e, t) {
|
|
178
|
+
this.abortController = void 0, this.config = _, this.connectorUtilities = e, this.toolConfigs = t;
|
|
179
|
+
}
|
|
180
|
+
abortOperation() {
|
|
181
|
+
this.abortController &&= (this.abortController.abort(), void 0);
|
|
182
|
+
}
|
|
183
|
+
async auditObjectContent(e, t) {
|
|
184
|
+
this.abortController = new AbortController();
|
|
185
|
+
try {
|
|
186
|
+
if (e.parsingToolName === "dpuse-tool-rust-csv-core") {
|
|
187
|
+
let n = await this.getReadableStream({
|
|
188
|
+
id: "",
|
|
189
|
+
path: e.path
|
|
190
|
+
}), r = await p(this.toolConfigs, "rust-csv-core"), i = {
|
|
191
|
+
delimiter: ",",
|
|
192
|
+
hasHeaders: !0
|
|
193
|
+
}, a = e.supportsTransferableStreams ? await r.processWithTransferableStream(n, i, t) : await r.processWithChunks(n, i, t);
|
|
194
|
+
return {
|
|
195
|
+
processedRowCount: a.processedRowCount,
|
|
196
|
+
durationMs: a.durationMs ?? 0
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
let n = await p(this.toolConfigs, "csv-parse"), r = {
|
|
200
|
+
delimiter: e.valueDelimiterId,
|
|
201
|
+
relax_column_count: !0,
|
|
202
|
+
relax_quotes: !0
|
|
203
|
+
}, i = `${v}${e.path}`, a = await n.parseStream(e, r, i, this.abortController, (e) => console.log(e));
|
|
204
|
+
return console.log("summary", a), {
|
|
205
|
+
processedRowCount: 0,
|
|
206
|
+
durationMs: 0
|
|
207
|
+
};
|
|
208
|
+
} catch (e) {
|
|
209
|
+
throw s(e);
|
|
210
|
+
} finally {
|
|
211
|
+
this.abortController = void 0;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
findObject(e) {
|
|
215
|
+
let t = g;
|
|
216
|
+
for (let n in t) if (Object.hasOwn(t, n) && t[n]?.find((t) => t.typeId === "object" && t.id === e.nodeId)) return Promise.resolve({
|
|
217
|
+
path: n,
|
|
218
|
+
object: void 0
|
|
219
|
+
});
|
|
220
|
+
return Promise.reject(/* @__PURE__ */ Error("Not found."));
|
|
221
|
+
}
|
|
222
|
+
async getReadableStream(e) {
|
|
223
|
+
let { signal: t } = this.abortController = new AbortController();
|
|
224
|
+
try {
|
|
225
|
+
let n = await fetch(`${v}${e.path}`, { signal: t });
|
|
226
|
+
if (!n.ok) throw await o(n, `Failed to fetch '${e.path}' file.`, "dpuse-connector-file-store-emulator|Connector|getReadableStream");
|
|
227
|
+
if (n.body == null) throw new i("Readable streams are not supported in this runtime.", "dpuse-connector-file-store-emulator|Connector|getReadableStream.unsupported");
|
|
228
|
+
return await Promise.resolve(n.body);
|
|
229
|
+
} catch (e) {
|
|
230
|
+
throw s(e);
|
|
231
|
+
} finally {
|
|
232
|
+
this.abortController = void 0;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
listNodes(e) {
|
|
236
|
+
let t = g[e.folderPath] ?? [], n = [];
|
|
237
|
+
for (let r of t) r.typeId === "folder" ? n.push(b(e.folderPath, r.name, r.childCount)) : n.push(x(e.folderPath, r.id, r.name, r.lastModifiedAt, r.size));
|
|
238
|
+
return Promise.resolve({
|
|
239
|
+
cursor: void 0,
|
|
240
|
+
isMore: !1,
|
|
241
|
+
connectionNodeConfigs: n,
|
|
242
|
+
totalCount: n.length
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
async previewObject(e) {
|
|
246
|
+
let { signal: t } = this.abortController = new AbortController();
|
|
247
|
+
try {
|
|
248
|
+
let n = Date.now(), r = performance.now(), i = await (await p(this.toolConfigs, "file-operators")).previewFile(`${v}${e.path}`, t, e.chunkSize);
|
|
249
|
+
if (i.dataFormatId == null) throw Error(`File '${e.path}' has unknown type.`);
|
|
250
|
+
if (i.text == null) throw Error(`File '${e.path}' is empty.`);
|
|
251
|
+
let a = await (await p(this.toolConfigs, "csv-parse")).parseText(i.text, h), o = this.connectorUtilities.inferDataTypes(a.parsedRecords);
|
|
252
|
+
return {
|
|
253
|
+
asAt: n,
|
|
254
|
+
columnConfigs: o.columnConfigs,
|
|
255
|
+
dataFormatId: i.dataFormatId,
|
|
256
|
+
duration: performance.now() - r,
|
|
257
|
+
encodingId: i.encodingId,
|
|
258
|
+
encodingConfidenceLevel: i.encodingConfidenceLevel,
|
|
259
|
+
fileType: i.fileTypeConfig,
|
|
260
|
+
hasHeaders: o.hasHeaderRow,
|
|
261
|
+
recordDelimiterId: a.recordDelimiterId,
|
|
262
|
+
parsedRecords: a.parsedRecords,
|
|
263
|
+
inferenceRecords: o.typedRecords,
|
|
264
|
+
size: i.bytes.length,
|
|
265
|
+
text: i.text,
|
|
266
|
+
valueDelimiterId: a.valueDelimiterId
|
|
267
|
+
};
|
|
268
|
+
} catch (e) {
|
|
269
|
+
throw s(e);
|
|
270
|
+
} finally {
|
|
271
|
+
this.abortController = void 0;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
async retrieveRecords(e, t, n) {
|
|
275
|
+
this.abortController = new AbortController();
|
|
276
|
+
try {
|
|
277
|
+
let r = await p(this.toolConfigs, "csv-parse"), i = {
|
|
278
|
+
delimiter: e.valueDelimiterId,
|
|
279
|
+
info: !0,
|
|
280
|
+
relax_column_count: !0,
|
|
281
|
+
relax_quotes: !0
|
|
282
|
+
}, a = `${v}${e.path}`;
|
|
283
|
+
n(await r.parseStream(e, i, a, this.abortController, t));
|
|
284
|
+
} catch (e) {
|
|
285
|
+
throw s(e);
|
|
286
|
+
} finally {
|
|
287
|
+
this.abortController = void 0;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
function b(e, n, r) {
|
|
292
|
+
return {
|
|
293
|
+
childCount: r,
|
|
294
|
+
childNodes: [],
|
|
295
|
+
extension: void 0,
|
|
296
|
+
folderPath: e,
|
|
297
|
+
handle: void 0,
|
|
298
|
+
id: t(),
|
|
299
|
+
label: n,
|
|
300
|
+
lastModifiedAt: void 0,
|
|
301
|
+
mimeType: void 0,
|
|
302
|
+
name: n,
|
|
303
|
+
size: void 0,
|
|
304
|
+
typeId: "folder"
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function x(e, t, n, r, i) {
|
|
308
|
+
let a = l(n) ?? "", o = u(n);
|
|
309
|
+
return {
|
|
310
|
+
childCount: void 0,
|
|
311
|
+
childNodes: [],
|
|
312
|
+
extension: o,
|
|
313
|
+
folderPath: e,
|
|
314
|
+
handle: void 0,
|
|
315
|
+
id: t,
|
|
316
|
+
label: n,
|
|
317
|
+
lastModifiedAt: r,
|
|
318
|
+
mimeType: d(o),
|
|
319
|
+
name: a,
|
|
320
|
+
size: i,
|
|
321
|
+
typeId: "object"
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
export { y as Connector };
|
|
326
|
+
|
|
327
|
+
//# sourceMappingURL=dpuse-connector-application-emulator.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-connector-application-emulator.es.js","names":["scopedUrlAlphabet","e","t","n","r","i","t","e"],"sources":["../node_modules/nanoid/url-alphabet/index.js","../node_modules/nanoid/index.browser.js","../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-errors.es.js","../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-utilities.es.js","../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentModuleTool.es.js","../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-locale.es.js","../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-componentDataView.es.js","../src/applicationIndex.json","../config.json","../src/index.ts"],"sourcesContent":["export let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n","/* @ts-self-types=\"./index.d.ts\" */\nimport { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js'\nexport { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let safeByteCutoff = 256 - (256 % alphabet.length)\n if (safeByteCutoff === 256) {\n let mask = alphabet.length - 1\n return (size = defaultSize) => {\n if (!size) return ''\n let id = ''\n while (true) {\n let bytes = getRandom(size)\n let j = size\n while (j--) {\n id += alphabet[bytes[j] & mask]\n if (id.length >= size) return id\n }\n }\n }\n }\n let step = Math.ceil((1.6 * 256 * defaultSize) / safeByteCutoff)\n return (size = defaultSize) => {\n if (!size) return ''\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n if (bytes[j] < safeByteCutoff) {\n id += alphabet[bytes[j] % alphabet.length]\n if (id.length >= size) return id\n }\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size | 0, random)\nexport let nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)))\n while (size--) {\n id += scopedUrlAlphabet[bytes[size] & 63]\n }\n return id\n}\n","//#region src/errors/index.ts\nvar e = 2048, t = class extends Error {\n\tdata;\n\tlocator;\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, r), this.name = \"DPUseError\", this.data = n, this.locator = t;\n\t}\n}, n = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"AppError\";\n\t}\n}, r = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"APIError\";\n\t}\n}, i = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"EngineError\";\n\t}\n}, a = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"ConnectorError\";\n\t}\n}, o = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"FetchError\";\n\t}\n};\nasync function s(e, t, n) {\n\tlet r = ` - ${e.statusText}`, i = `${t} Response status '${e.status}${e.statusText ? r : \"\"}' received.`, a;\n\ttry {\n\t\ta = await e.text();\n\t} catch (e) {\n\t\ta = `<body unavailable: ${u(e).message}>`;\n\t}\n\treturn new o(i, n, { body: m(a) });\n}\nfunction c(e) {\n\treturn e.map((e) => e.message).join(\" \");\n}\nfunction l(e) {\n\ttry {\n\t\te();\n\t} catch {}\n}\nfunction u(e) {\n\tif (e instanceof Error) return e;\n\tif (typeof e == \"string\") return Error(e);\n\tif (typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"bigint\") return Error(String(e));\n\tif (typeof e == \"symbol\") return Error(e.description ?? \"Unknown error\");\n\tif (typeof e == \"object\") try {\n\t\treturn Error(JSON.stringify(e));\n\t} catch {\n\t\treturn /* @__PURE__ */ Error(\"Unknown error\");\n\t}\n\treturn /* @__PURE__ */ Error(\"Unknown error\");\n}\nfunction d(e) {\n\tlet t = /* @__PURE__ */ new Set(), n = [], r = u(e);\n\tfor (; r != null && !t.has(r);) {\n\t\tt.add(r);\n\t\tlet e;\n\t\tswitch (r.name) {\n\t\t\tcase \"APIError\": {\n\t\t\t\tlet t = r;\n\t\t\t\te = {\n\t\t\t\t\tdata: t.data,\n\t\t\t\t\tlocator: t.locator,\n\t\t\t\t\tmessage: r.message,\n\t\t\t\t\tname: \"APIError\",\n\t\t\t\t\tstack: r.stack\n\t\t\t\t}, r = r.cause == null ? null : u(r.cause);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"AppError\": {\n\t\t\t\tlet t = r;\n\t\t\t\te = {\n\t\t\t\t\tdata: t.data,\n\t\t\t\t\tlocator: t.locator,\n\t\t\t\t\tmessage: r.message,\n\t\t\t\t\tname: \"AppError\",\n\t\t\t\t\tstack: r.stack\n\t\t\t\t}, r = r.cause == null ? null : u(r.cause);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"ConnectorError\": {\n\t\t\t\tlet t = r;\n\t\t\t\te = {\n\t\t\t\t\tdata: t.data,\n\t\t\t\t\tlocator: t.locator,\n\t\t\t\t\tmessage: r.message,\n\t\t\t\t\tname: \"ConnectorError\",\n\t\t\t\t\tstack: r.stack\n\t\t\t\t}, r = r.cause == null ? null : u(r.cause);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"EngineError\": {\n\t\t\t\tlet t = r;\n\t\t\t\te = {\n\t\t\t\t\tdata: t.data,\n\t\t\t\t\tlocator: t.locator,\n\t\t\t\t\tmessage: r.message,\n\t\t\t\t\tname: \"EngineError\",\n\t\t\t\t\tstack: r.stack\n\t\t\t\t}, r = r.cause == null ? null : u(r.cause);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"FetchError\": {\n\t\t\t\tlet t = r;\n\t\t\t\te = {\n\t\t\t\t\tdata: t.data,\n\t\t\t\t\tlocator: t.locator,\n\t\t\t\t\tmessage: r.message,\n\t\t\t\t\tname: \"FetchError\",\n\t\t\t\t\tstack: r.stack\n\t\t\t\t}, r = r.cause == null ? null : u(r.cause);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tlet { cause: t, ...n } = Object.fromEntries(Object.entries(r));\n\t\t\t\tr.name ? (e = {\n\t\t\t\t\tdata: n,\n\t\t\t\t\tlocator: \"\",\n\t\t\t\t\tmessage: r.message,\n\t\t\t\t\tname: r.name,\n\t\t\t\t\tstack: r.stack\n\t\t\t\t}, r = r.cause == null ? null : u(r.cause)) : (e = {\n\t\t\t\t\tdata: n,\n\t\t\t\t\tlocator: \"\",\n\t\t\t\t\tmessage: p(r),\n\t\t\t\t\tname: \"Error\",\n\t\t\t\t\tstack: void 0\n\t\t\t\t}, r = null);\n\t\t}\n\t\t/(?:\\.{3}|[.!?])$/.test(e.message) || (e.message += \".\"), n.push(e);\n\t}\n\treturn n;\n}\nfunction f(e) {\n\tif (e.length === 0) return;\n\tlet t;\n\tfor (let s of e.toReversed()) {\n\t\tlet e;\n\t\tswitch (s.name) {\n\t\t\tcase \"APIError\":\n\t\t\t\te = new r(s.message, s.locator, s.data, { cause: t });\n\t\t\t\tbreak;\n\t\t\tcase \"AppError\":\n\t\t\t\te = new n(s.message, s.locator, s.data, { cause: t });\n\t\t\t\tbreak;\n\t\t\tcase \"ConnectorError\":\n\t\t\t\te = new a(s.message, s.locator, s.data, { cause: t });\n\t\t\t\tbreak;\n\t\t\tcase \"EngineError\":\n\t\t\t\te = new i(s.message, s.locator, s.data, { cause: t });\n\t\t\t\tbreak;\n\t\t\tcase \"FetchError\":\n\t\t\t\te = new o(s.message, s.locator, s.data, { cause: t });\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\te = Error(s.message, { cause: t }), e.name = s.name;\n\t\t\t\tbreak;\n\t\t}\n\t\ts.stack !== void 0 && (e.stack = s.stack), t = e;\n\t}\n\treturn t;\n}\nfunction p(e) {\n\tlet t;\n\ttry {\n\t\tt = JSON.stringify(e);\n\t} catch {\n\t\tt = typeof e == \"symbol\" ? e.description ?? \"Unknown error\" : typeof e == \"bigint\" ? e.toString() : \"Unknown error\";\n\t}\n\treturn t === \"\" && (t = \"Unknown error\"), t;\n}\nfunction m(t) {\n\tif (!(t == null || t === \"\")) return t.length > e ? `${t.slice(0, e)}... [truncated]` : t;\n}\n//#endregion\nexport { r as APIError, n as AppError, a as ConnectorError, t as DPUseError, i as EngineError, o as FetchError, s as buildFetchError, c as concatenateSerialisedErrorMessages, l as ignoreErrors, u as normalizeToError, d as serialiseError, f as unserialiseError };\n","//#region src/utilities/index.ts\nvar e = \"en-US\", t = /* @__PURE__ */ new Map();\nfunction n(e) {\n\tswitch (e) {\n\t\tcase \"Edm.Binary\": return \"unknown\";\n\t\tcase \"Edm.Boolean\": return \"boolean\";\n\t\tcase \"Edm.Byte\": return \"wholeNumber\";\n\t\tcase \"Edm.DateTime\": return \"moment\";\n\t\tcase \"Edm.DateTimeOffset\": return \"moment\";\n\t\tcase \"Edm.Decimal\": return \"decimalNumber\";\n\t\tcase \"Edm.Double\": return \"decimalNumber\";\n\t\tcase \"Edm.Guid\": return \"string\";\n\t\tcase \"Edm.Int16\": return \"wholeNumber\";\n\t\tcase \"Edm.Int32\": return \"wholeNumber\";\n\t\tcase \"Edm.Int64\": return \"wholeNumber\";\n\t\tcase \"Edm.SByte\": return \"wholeNumber\";\n\t\tcase \"Edm.Single\": return \"decimalNumber\";\n\t\tcase \"Edm.String\": return \"string\";\n\t\tcase \"Edm.Time\": return \"momentTime\";\n\t\tdefault: return \"unknown\";\n\t}\n}\nfunction r(e) {\n\tif (e) {\n\t\tlet t = e.lastIndexOf(\"/\") + 1, n = e.lastIndexOf(\".\");\n\t\treturn n <= t || n === -1 ? e : e.slice(0, Math.max(0, n));\n\t}\n}\nfunction i(e) {\n\tif (e) {\n\t\tlet t = e.lastIndexOf(\"/\") + 1, n = e.lastIndexOf(\".\");\n\t\tif (n <= t) return;\n\t\tif (n !== -1) return e.slice(Math.max(0, n + 1));\n\t}\n}\nfunction a(n, r = 2, i = r, a = e) {\n\tif (n == null) return \"\";\n\tlet o = `${a}decimal${r}.${i}`, s = t.get(o);\n\treturn s || (s = new Intl.NumberFormat(a, {\n\t\tlocaleMatcher: \"best fit\",\n\t\tmaximumFractionDigits: r,\n\t\tminimumFractionDigits: i,\n\t\tminimumIntegerDigits: 1,\n\t\tstyle: \"decimal\",\n\t\tuseGrouping: !0\n\t}), t.set(o, s)), s.format(n);\n}\nfunction o(e, t = 1) {\n\treturn e == null ? \"\" : e < 1e3 ? u(e) : e < 1e6 ? `${a(e / 1e3, t, 0)}K` : e < 1e9 ? `${a(e / 1e6, t, 0)}M` : e < 0xe8d4a51000 ? `${a(e / 1e9, t, 0)}B` : `${a(e / 0xe8d4a51000, t, 0)}T`;\n}\nfunction s(e, t = 1) {\n\treturn e == null ? \"\" : e === 1 ? \"1 byte\" : e < 1024 ? `${u(e)} bytes` : e < 1048576 ? `${a(e / 1024, t, 0)} KB` : e < 1073741824 ? `${a(e / 1048576, t, 0)} MB` : e < 1099511627776 ? `${a(e / 1073741824, t, 0)} GB` : `${a(e / 1099511627776, t, 0)} TB`;\n}\nvar c = [\n\t[\n\t\t\"days\",\n\t\t864e5,\n\t\t(e) => e === 1 ? \"1 day\" : `${u(e)} days`\n\t],\n\t[\n\t\t\"hrs\",\n\t\t36e5,\n\t\t(e) => e === 1 ? \"1 hr\" : `${u(e)} hrs`\n\t],\n\t[\n\t\t\"mins\",\n\t\t6e4,\n\t\t(e) => e === 1 ? \"1 min\" : `${u(e)} mins`\n\t],\n\t[\n\t\t\"secs\",\n\t\t1e3,\n\t\t(e) => e === 1 ? \"1 sec\" : `${u(e)} secs`\n\t],\n\t[\n\t\t\"ms\",\n\t\t0,\n\t\t(e) => `${u(e)} ms`\n\t]\n];\nfunction l(e, t = \"ms\") {\n\tif (e == null) return \"\";\n\tlet n = c.findIndex(([e]) => e === t);\n\tif (e < (c[n]?.[1] ?? 0)) {\n\t\tlet t = c.find(([, t]) => e >= t);\n\t\tif (t == null) return `${u(e)} ms`;\n\t\tlet [, n, r] = t;\n\t\treturn r(n > 0 ? Math.floor(e / n) : e);\n\t}\n\tlet r = [], i = e;\n\tfor (let [, e, t] of c.slice(0, n + 1)) e === 0 ? (i > 0 || r.length === 0) && r.push(t(i)) : i >= e && (r.push(t(Math.floor(i / e))), i %= e);\n\treturn r.join(\" \");\n}\nfunction u(n, r = e) {\n\tif (n == null) return \"\";\n\tlet i = `${r}decimal0.0`, a = t.get(i);\n\treturn a || (a = new Intl.NumberFormat(r, {\n\t\tlocaleMatcher: \"best fit\",\n\t\tmaximumFractionDigits: 0,\n\t\tminimumFractionDigits: 0,\n\t\tminimumIntegerDigits: 1,\n\t\tstyle: \"decimal\",\n\t\tuseGrouping: !0\n\t}), t.set(i, a)), a.format(n);\n}\nfunction d(e) {\n\tswitch (e) {\n\t\tcase \"csv\": return \"text/csv\";\n\t\tcase \"tab\":\n\t\tcase \"tsv\": return \"text/tab-separated-values\";\n\t\tcase \"xls\": return \"application/vnd.ms-excel\";\n\t\tcase \"xlsx\": return \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\n\t\tdefault: return \"application/octet-stream\";\n\t}\n}\n//#endregion\nexport { n as convertODataTypeIdToUsageTypeId, i as extractExtensionFromPath, r as extractNameFromPath, a as formatNumberAsDecimalNumber, l as formatNumberAsDuration, o as formatNumberAsSize, s as formatNumberAsStorageSize, u as formatNumberAsWholeNumber, d as lookupMimeTypeForExtension };\n","//#region src/component/module/tool/index.ts\nvar e = \"https://engine-eu.dpuse.app/tools\";\nasync function t(t, n) {\n\tlet r = `dpuse-tool-${n}`, i = t.find((e) => e.id === r);\n\tif (!i) throw Error(`Connector could not load unknown tool '${n}'.`);\n\treturn new (await (import(\n\t\t/* @vite-ignore */\n\t\t`${e}/${n}_v${i.version}/${r}.es.js`\n))).Tool();\n}\n//#endregion\nexport { t as loadTool };\n","//#region src/locale/index.ts\nvar e = \"en\", t = [{\n\tid: \"en\",\n\tflag: \"gb\",\n\tlabel: \"English\"\n}, {\n\tid: \"es\",\n\tflag: \"es\",\n\tlabel: \"Español\"\n}];\nfunction n(e) {\n\treturn new Map(Object.entries(e));\n}\nfunction r(e, t) {\n\treturn {\n\t\t...e,\n\t\tlabel: e.label[t] ?? e.id,\n\t\tdescription: e.description[t] ?? e.id,\n\t\tverb: e.verb?.[t] ?? void 0\n\t};\n}\nfunction i(e, t) {\n\treturn e.map((e) => ({\n\t\t...e,\n\t\tlabel: e.label[t] ?? e.id,\n\t\tdescription: e.description[t] ?? e.id,\n\t\tverb: e.verb?.[t] ?? void 0\n\t}));\n}\nfunction a(e, t, n = \"en\") {\n\tlet r = e.get(t);\n\tif (r !== void 0) return r;\n\tif (n !== t) return e.get(n);\n}\n//#endregion\nexport { e as DEFAULT_LOCALE_ID, t as SUPPORTED_LANGUAGES, n as createLabelMap, r as localiseConfig, i as localiseConfigs, a as resolveLabel };\n","import { createLabelMap as e } from \"./dpuse-shared-locale.es.js\";\ne({ en: \"Data Positioning Events\" }), e({ en: \"Delimited Text\" }), e({ en: \"JSON\" }), e({ en: \"SPSS\" }), e({ en: \"XLSX\" }), e({ en: \"XML\" }), e({ en: \"Newline\" }), e({ en: \"Carriage Return\" }), e({ en: \"Carriage Return/Newline\" }), e({ en: \"Colon\" }), e({ en: \"Comma\" }), e({ en: \"Exclamation Mark\" }), e({ en: \"Record Separator\" }), e({ en: \"Semicolon\" }), e({ en: \"Space\" }), e({ en: \"Tab\" }), e({ en: \"Underscore\" }), e({ en: \"Unit Separator\" }), e({ en: \"Vertical Bar\" });\nvar t = [\n\t\",\",\n\t\";\",\n\t\"\t\",\n\t\"|\",\n\t\" \",\n\t\":\",\n\t\"_\",\n\t\"!\",\n\t\"0x1F\",\n\t\"0x1E\"\n];\n//#endregion\nexport { t as ORDERED_VALUE_DELIMITER_IDS };\n","{\n \"\": [\n { \"childCount\": 1, \"name\": \"humanResources\", \"typeId\": \"folder\" },\n { \"id\": \"GGxX3yzmdW8_7G_MSwyi5\", \"lastModifiedAt\": 1774197102385.2441, \"name\": \"organisations.csv\", \"size\": 72, \"typeId\": \"object\" },\n { \"id\": \"14xGczulW60Z5vLEVVyZy\", \"lastModifiedAt\": 1774197102385.3625, \"name\": \"people.csv\", \"size\": 72320, \"typeId\": \"object\" }\n ],\n \"/humanResources\": [{ \"childCount\": 2, \"name\": \"workforce\", \"typeId\": \"folder\" }],\n \"/humanResources/workforce\": [\n { \"id\": \"XJgBt7TVnPf8l7-vArbui\", \"lastModifiedAt\": 1774197102385.1426, \"name\": \"empty.csv\", \"size\": 0, \"typeId\": \"object\" },\n { \"id\": \"_d5Au6rZg-0KlXPhkU0qj\", \"lastModifiedAt\": 1774197102385.1821, \"name\": \"engagements.csv\", \"size\": 0, \"typeId\": \"object\" }\n ]\n}\n","{\n \"id\": \"dpuse-connector-application-emulator\",\n \"label\": {\n \"en\": \"File Store Emulator\"\n },\n \"description\": {\n \"en\": \"Imitates a cloud-based file storage solution. It hosts a read-only set of files for demonstration, evaluation and testing purposes and is freely available to all users.\"\n },\n \"category\": null,\n \"categoryId\": \"fileStore\",\n \"firstCreatedAt\": null,\n \"implementations\": {\n \"default\": {\n \"authMethodId\": \"none\",\n \"maxConnectionCount\": 1\n }\n },\n \"icon\": \"<svg viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"black\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M12 17v4\\\"/><path d=\\\"m14.305 7.53.923-.382\\\"/><path d=\\\"m15.228 4.852-.923-.383\\\"/><path d=\\\"m16.852 3.228-.383-.924\\\"/><path d=\\\"m16.852 8.772-.383.923\\\"/><path d=\\\"m19.148 3.228.383-.924\\\"/><path d=\\\"m19.53 9.696-.382-.924\\\"/><path d=\\\"m20.772 4.852.924-.383\\\"/><path d=\\\"m20.772 7.148.924.383\\\"/><path d=\\\"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7\\\"/><path d=\\\"M8 21h8\\\"/><circle cx=\\\"18\\\" cy=\\\"6\\\" r=\\\"3\\\"/></svg>\",\n \"iconDark\": \"<svg viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"white\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M12 17v4\\\"/><path d=\\\"m14.305 7.53.923-.382\\\"/><path d=\\\"m15.228 4.852-.923-.383\\\"/><path d=\\\"m16.852 3.228-.383-.924\\\"/><path d=\\\"m16.852 8.772-.383.923\\\"/><path d=\\\"m19.148 3.228.383-.924\\\"/><path d=\\\"m19.53 9.696-.382-.924\\\"/><path d=\\\"m20.772 4.852.924-.383\\\"/><path d=\\\"m20.772 7.148.924.383\\\"/><path d=\\\"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7\\\"/><path d=\\\"M8 21h8\\\"/><circle cx=\\\"18\\\" cy=\\\"6\\\" r=\\\"3\\\"/></svg>\",\n \"iconNeutral\": \"<svg viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"><path d=\\\"M12 17v4\\\"/><path d=\\\"m14.305 7.53.923-.382\\\"/><path d=\\\"m15.228 4.852-.923-.383\\\"/><path d=\\\"m16.852 3.228-.383-.924\\\"/><path d=\\\"m16.852 8.772-.383.923\\\"/><path d=\\\"m19.148 3.228.383-.924\\\"/><path d=\\\"m19.53 9.696-.382-.924\\\"/><path d=\\\"m20.772 4.852.924-.383\\\"/><path d=\\\"m20.772 7.148.924.383\\\"/><path d=\\\"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7\\\"/><path d=\\\"M8 21h8\\\"/><circle cx=\\\"18\\\" cy=\\\"6\\\" r=\\\"3\\\"/></svg>\",\n \"lastUpdatedAt\": null,\n \"operations\": [\n \"abortOperation\",\n \"auditObjectContent\",\n \"findObject\",\n \"getReadableStream\",\n \"listNodes\",\n \"previewObject\",\n \"retrieveRecords\"\n ],\n \"status\": null,\n \"statusId\": \"beta\",\n \"typeId\": \"connector\",\n \"usageId\": \"source\",\n \"vendorAccountURL\": null,\n \"vendorDocumentationURL\": null,\n \"vendorHomeURL\": null,\n \"version\": \"0.0.8\"\n}","// External Dependencies\nimport { nanoid } from 'nanoid';\n\n// DPUse Framework\nimport type { ConnectionNodeConfig } from '@dpuse/dpuse-shared/component/connection';\nimport type {\n AuditObjectContentOptions,\n AuditObjectContentResult,\n ConnectorConfig,\n ConnectorInterface,\n ConnectorUtilities,\n FindObjectOptions,\n FindObjectResult,\n GetReadableStreamOptions,\n ListNodesOptions,\n ListNodesResult,\n PreviewObjectOptions,\n RetrievalTypeId,\n RetrieveRecordsOptions,\n RetrieveRecordsSummary\n} from '@dpuse/dpuse-shared/component/module/connector';\nimport { buildFetchError, ConnectorError, normalizeToError } from '@dpuse/dpuse-shared/errors';\nimport { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from '@dpuse/dpuse-shared/utilities';\nimport { loadTool, type ToolConfig } from '@dpuse/dpuse-shared/component/module/tool';\nimport { ORDERED_VALUE_DELIMITER_IDS, type ParsingRecord, type PreviewConfig } from '@dpuse/dpuse-shared/component/dataView';\n\n// DPUse Tools\nimport type { Tool as CSVParseTool } from '@dpuse/dpuse-tool-csv-parse';\nimport type { Tool as FileOperatorsTool } from '@dpuse/dpuse-tool-file-operators';\nimport type { Tool as RustCsvCoreTool } from '@dpuse/dpuse-tool-rust-csv-core';\n\n// Data\nimport applicationFolderPathData from '@/applicationIndex.json';\nimport config from '~/config.json';\n\n/**\n * File store folder paths.\n */\ntype ApplicationFolderNode =\n | ({ typeId: 'folder'; childCount: number } & { name: string })\n | ({ typeId: 'object'; id: string; lastModifiedAt: number; size: number } & { name: string });\n\n/**\n * File store folder paths.\n */\ntype ApplicationFolderPaths = Record<string, ApplicationFolderNode[]>;\n\n/**\n * Cloudflare R2 file store directory prefix.\n */\nconst URL_PREFIX = 'https://sample-data-eu.dpuse.app/application';\n\n// Connectors\nexport class Connector implements ConnectorInterface {\n abortController: AbortController | undefined;\n readonly config: ConnectorConfig;\n connectorUtilities: ConnectorUtilities;\n readonly toolConfigs;\n\n constructor(connectorUtilities: ConnectorUtilities, toolConfigs: ToolConfig[]) {\n this.abortController = undefined;\n this.config = config as ConnectorConfig;\n this.connectorUtilities = connectorUtilities;\n this.toolConfigs = toolConfigs;\n }\n\n // Operations ──────────────────────────────────────────────────────────────────────────────────────────────────────\n\n // Abort the currently running operation\n abortOperation(): void {\n if (!this.abortController) return;\n this.abortController.abort();\n this.abortController = undefined;\n }\n\n // Audit object content\n async auditObjectContent(options: AuditObjectContentOptions, chunk: (rowCount: number) => void): Promise<AuditObjectContentResult> {\n this.abortController = new AbortController();\n\n try {\n if (options.parsingToolName === 'dpuse-tool-rust-csv-core') {\n // Get the readable stream\n const stream = await this.getReadableStream({ id: '', path: options.path });\n\n // Load the Rust CSV core tool\n const rustCsvTool = await loadTool<RustCsvCoreTool>(this.toolConfigs, 'rust-csv-core');\n\n // Choose processing mode based on browser capability\n const options2 = { delimiter: ',', hasHeaders: true };\n const result = options.supportsTransferableStreams\n ? await rustCsvTool.processWithTransferableStream(stream, options2, chunk)\n : await rustCsvTool.processWithChunks(stream, options2, chunk);\n\n return { processedRowCount: result.processedRowCount, durationMs: result.durationMs ?? 0 };\n }\n\n const csvParseTool = await loadTool<CSVParseTool>(this.toolConfigs, 'csv-parse');\n const parseStreamOptions = { delimiter: options.valueDelimiterId, relax_column_count: true, relax_quotes: true };\n const url = `${URL_PREFIX}${options.path}`;\n const summary = await csvParseTool.parseStream(options, parseStreamOptions, url, this.abortController, (parameter) => console.log(parameter));\n console.log('summary', summary);\n // complete(summary);\n\n return { processedRowCount: 0, durationMs: 0 };\n } catch (error) {\n throw normalizeToError(error);\n } finally {\n this.abortController = undefined;\n }\n }\n\n // Find the folder path containing the specified object node\n findObject(options: FindObjectOptions): Promise<FindObjectResult> {\n const fileStoreFolderPaths = applicationFolderPathData as ApplicationFolderPaths;\n // Loop through the folder path data checking for an object entry with an identifier equal to the object name.\n for (const folderPath in fileStoreFolderPaths) {\n if (Object.hasOwn(fileStoreFolderPaths, folderPath)) {\n const folderPathNodes = fileStoreFolderPaths[folderPath];\n const folderPathNode = folderPathNodes?.find((folderPathNode) => folderPathNode.typeId === 'object' && folderPathNode.id === options.nodeId);\n if (folderPathNode) return Promise.resolve({ path: folderPath, object: undefined }); // Found, return folder path.\n }\n }\n return Promise.reject(new Error('Not found.')); // Not found.\n }\n\n // Get a readable stream for the specified object node path\n async getReadableStream(options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>> {\n // Create an abort controller and extract its signal.\n const { signal } = (this.abortController = new AbortController());\n\n try {\n const response = await fetch(`${URL_PREFIX}${options.path}`, { signal });\n if (!response.ok) {\n throw await buildFetchError(response, `Failed to fetch '${options.path}' file.`, 'dpuse-connector-file-store-emulator|Connector|getReadableStream');\n }\n if (response.body == null) {\n throw new ConnectorError('Readable streams are not supported in this runtime.', 'dpuse-connector-file-store-emulator|Connector|getReadableStream.unsupported');\n }\n return await Promise.resolve(response.body);\n } catch (error) {\n throw normalizeToError(error);\n } finally {\n this.abortController = undefined;\n }\n }\n\n // Lists all nodes (folders and objects) in the specified folder path\n listNodes(options: ListNodesOptions): Promise<ListNodesResult> {\n const fileStoreFolderPaths = applicationFolderPathData as ApplicationFolderPaths;\n const folderNodes = fileStoreFolderPaths[options.folderPath] ?? [];\n const connectionNodeConfigs: ConnectionNodeConfig[] = [];\n for (const folderNode of folderNodes) {\n if (folderNode.typeId === 'folder') {\n connectionNodeConfigs.push(constructFolderNodeConfig(options.folderPath, folderNode.name, folderNode.childCount));\n } else {\n connectionNodeConfigs.push(constructObjectNodeConfig(options.folderPath, folderNode.id, folderNode.name, folderNode.lastModifiedAt, folderNode.size));\n }\n }\n return Promise.resolve({ cursor: undefined, isMore: false, connectionNodeConfigs, totalCount: connectionNodeConfigs.length });\n }\n\n // Preview the contents of the object node with the specified path\n async previewObject(options: PreviewObjectOptions): Promise<PreviewConfig> {\n // Create an abort controller and extract its signal.\n const { signal } = (this.abortController = new AbortController());\n\n try {\n const asAt = Date.now();\n const startedAt = performance.now();\n\n // Preview file to determine file format and decode text.\n const fileOperatorsTool = await loadTool<FileOperatorsTool>(this.toolConfigs, 'file-operators');\n const filePreviewResult = await fileOperatorsTool.previewFile(`${URL_PREFIX}${options.path}`, signal, options.chunkSize);\n if (filePreviewResult.dataFormatId == null) throw new Error(`File '${options.path}' has unknown type.`);\n if (filePreviewResult.text == null) throw new Error(`File '${options.path}' is empty.`);\n\n // Parse text, identify delimiters, and produce string value records.\n const csvParseTool = await loadTool<CSVParseTool>(this.toolConfigs, 'csv-parse');\n const parseTextResult = await csvParseTool.parseText(filePreviewResult.text, ORDERED_VALUE_DELIMITER_IDS);\n\n // Infer and cast values for each parsed record.\n const inferenceSummary = this.connectorUtilities.inferDataTypes(parseTextResult.parsedRecords);\n\n return {\n asAt,\n columnConfigs: inferenceSummary.columnConfigs,\n dataFormatId: filePreviewResult.dataFormatId,\n duration: performance.now() - startedAt,\n encodingId: filePreviewResult.encodingId,\n encodingConfidenceLevel: filePreviewResult.encodingConfidenceLevel,\n fileType: filePreviewResult.fileTypeConfig,\n hasHeaders: inferenceSummary.hasHeaderRow,\n recordDelimiterId: parseTextResult.recordDelimiterId,\n parsedRecords: parseTextResult.parsedRecords,\n inferenceRecords: inferenceSummary.typedRecords,\n size: filePreviewResult.bytes.length,\n text: filePreviewResult.text,\n valueDelimiterId: parseTextResult.valueDelimiterId\n };\n } catch (error) {\n throw normalizeToError(error);\n } finally {\n this.abortController = undefined;\n }\n }\n // Retrieves all records from a CSV object node using streaming and chunked processing\n async retrieveRecords(\n options: RetrieveRecordsOptions,\n chunk: (typeId: RetrievalTypeId, records: ParsingRecord[]) => void,\n complete: (result: RetrieveRecordsSummary) => void\n ): Promise<void> {\n this.abortController = new AbortController();\n try {\n const csvParseTool = await loadTool<CSVParseTool>(this.toolConfigs, 'csv-parse');\n const parseStreamOptions = { delimiter: options.valueDelimiterId, info: true, relax_column_count: true, relax_quotes: true };\n const url = `${URL_PREFIX}${options.path}`;\n const summary = await csvParseTool.parseStream(options, parseStreamOptions, url, this.abortController, chunk);\n complete(summary);\n } catch (error) {\n throw normalizeToError(error);\n } finally {\n this.abortController = undefined;\n }\n }\n}\n\n// Helpers ─────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Construct folder node configuration.\nfunction constructFolderNodeConfig(folderPath: string, name: string, childCount: number): ConnectionNodeConfig {\n return {\n childCount,\n childNodes: [],\n extension: undefined,\n folderPath,\n handle: undefined,\n id: nanoid(),\n label: name,\n lastModifiedAt: undefined,\n mimeType: undefined,\n name,\n size: undefined,\n typeId: 'folder'\n };\n}\n\n// Construct object (file) node configuration.\nfunction constructObjectNodeConfig(folderPath: string, id: string, fullName: string, lastModifiedAt: number, size: number): ConnectionNodeConfig {\n const name = extractNameFromPath(fullName) ?? '';\n const extension = extractExtensionFromPath(fullName);\n const lastModifiedAtTimestamp = lastModifiedAt;\n const mimeType = lookupMimeTypeForExtension(extension);\n return {\n childCount: undefined,\n childNodes: [],\n extension,\n folderPath,\n handle: undefined,\n id,\n label: fullName,\n lastModifiedAt: lastModifiedAtTimestamp,\n mimeType,\n name,\n size,\n typeId: 'object'\n };\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";AAAA,IAAW,IACT,oECsCS,KAAU,IAAO,OAAO;CACjC,IAAI,IAAK,IACL,IAAQ,OAAO,gBAAgB,IAAI,WAAY,KAAQ,CAAE,CAAC;CAC9D,OAAO,MACL,KAAMA,EAAkB,EAAM,KAAQ;CAExC,OAAO;AACT,GC7CIC,IAAI,MAAMC,IAAI,cAAc,MAAM;CACrC;CACA;CACA,YAAY,GAAG,GAAG,GAAG,GAAG;EACvB,MAAM,GAAG,CAAC,GAAG,KAAK,OAAO,cAAc,KAAK,OAAO,GAAG,KAAK,UAAU;CACtE;AACD,GAYG,IAAI,cAAcA,EAAE;CACtB,YAAY,GAAG,GAAG,GAAG,GAAG;EACvB,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK,OAAO;CAChC;AACD,GAAG,IAAI,cAAcA,EAAE;CACtB,YAAY,GAAG,GAAG,GAAG,GAAG;EACvB,MAAM,GAAG,G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AAe,MAAM,EAAuB,KAAK,aAAa,WAAW,GACzE,IAAqB;IAAE,WAAW,EAAQ;IAAkB,MAAM;IAAM,oBAAoB;IAAM,cAAc;GAAK,GACrH,IAAM,GAAG,IAAa,EAAQ;GAEpC,EAAS,MADa,EAAa,YAAY,GAAS,GAAoB,GAAK,KAAK,iBAAiB,CAAK,CAC5F;EACpB,SAAS,GAAO;GACZ,MAAM,EAAiB,CAAK;EAChC,UAAU;GACN,KAAK,kBAAkB,KAAA;EAC3B;CACJ;AACJ;AAKA,SAAS,EAA0B,GAAoB,GAAc,GAA0C;CAC3G,OAAO;EACH;EACA,YAAY,CAAC;EACb,WAAW,KAAA;EACX;EACA,QAAQ,KAAA;EACR,IAAI,EAAO;EACX,OAAO;EACP,gBAAgB,KAAA;EAChB,UAAU,KAAA;EACV;EACA,MAAM,KAAA;EACN,QAAQ;CACZ;AACJ;AAGA,SAAS,EAA0B,GAAoB,GAAY,GAAkB,GAAwB,GAAoC;CAC7I,IAAM,IAAO,EAAoB,CAAQ,KAAK,IACxC,IAAY,EAAyB,CAAQ;CAGnD,OAAO;EACH,YAAY,KAAA;EACZ,YAAY,CAAC;EACb;EACA;EACA,QAAQ,KAAA;EACR;EACA,OAAO;EACS;EAChB,UAVa,EAA2B,CAUxC;EACA;EACA;EACA,QAAQ;CACZ;AACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AuditObjectContentOptions, AuditObjectContentResult, ConnectorConfig, ConnectorInterface, ConnectorUtilities, FindObjectOptions, FindObjectResult, GetReadableStreamOptions, ListNodesOptions, ListNodesResult, PreviewObjectOptions, RetrievalTypeId, RetrieveRecordsOptions, RetrieveRecordsSummary } from '@dpuse/dpuse-shared/component/module/connector';
|
|
2
|
+
import { ToolConfig } from '@dpuse/dpuse-shared/component/module/tool';
|
|
3
|
+
import { ParsingRecord, PreviewConfig } from '@dpuse/dpuse-shared/component/dataView';
|
|
4
|
+
export declare class Connector implements ConnectorInterface {
|
|
5
|
+
abortController: AbortController | undefined;
|
|
6
|
+
readonly config: ConnectorConfig;
|
|
7
|
+
connectorUtilities: ConnectorUtilities;
|
|
8
|
+
readonly toolConfigs: ToolConfig[];
|
|
9
|
+
constructor(connectorUtilities: ConnectorUtilities, toolConfigs: ToolConfig[]);
|
|
10
|
+
abortOperation(): void;
|
|
11
|
+
auditObjectContent(options: AuditObjectContentOptions, chunk: (rowCount: number) => void): Promise<AuditObjectContentResult>;
|
|
12
|
+
findObject(options: FindObjectOptions): Promise<FindObjectResult>;
|
|
13
|
+
getReadableStream(options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>>;
|
|
14
|
+
listNodes(options: ListNodesOptions): Promise<ListNodesResult>;
|
|
15
|
+
previewObject(options: PreviewObjectOptions): Promise<PreviewConfig>;
|
|
16
|
+
retrieveRecords(options: RetrieveRecordsOptions, chunk: (typeId: RetrievalTypeId, records: ParsingRecord[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
17
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dpuse/dpuse-connector-application-emulator",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Jonathan Terrell <terrell.jm@gmail.com>",
|
|
6
|
+
"private": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"homepage": "https://www.dpuse.app",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/dpuse/dpuse-connector-application-emulator.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/dpuse/dpuse-connector-application-emulator/issues"
|
|
15
|
+
},
|
|
16
|
+
"module": "./dist/dpuse-connector-application-emulator.es.js",
|
|
17
|
+
"types": "./dist/types/src/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/dpuse-connector-application-emulator.es.js",
|
|
21
|
+
"types": "./dist/types/src/index.d.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"prettier": "@dpuse/dpuse-development/prettierrc",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@dpuse/dpuse-shared": "^0.3.668",
|
|
30
|
+
"@dpuse/dpuse-tool-csv-parse": "^0.0.143",
|
|
31
|
+
"@dpuse/dpuse-tool-file-operators": "^0.0.24",
|
|
32
|
+
"@dpuse/dpuse-tool-rust-csv-core": "^0.1.21",
|
|
33
|
+
"nanoid": "^5.1.11"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@dpuse/dpuse-development": "^0.3.500",
|
|
37
|
+
"@dpuse/eslint-config-dpuse": "^1.0.69",
|
|
38
|
+
"@types/node": "^25.7.0",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
40
|
+
"@typescript-eslint/parser": "^8.59.3",
|
|
41
|
+
"eslint": "^10.3.0",
|
|
42
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
43
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
44
|
+
"eslint-plugin-security": "^4.0.0",
|
|
45
|
+
"eslint-plugin-sonarjs": "^4.0.3",
|
|
46
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
47
|
+
"jiti": "^2.7.0",
|
|
48
|
+
"license-downloader": "^2.0.0",
|
|
49
|
+
"license-report": "^6.8.2",
|
|
50
|
+
"license-report-check": "^1.0.0",
|
|
51
|
+
"license-report-recursive": "^6.8.4",
|
|
52
|
+
"npm-check-updates": "^22.2.0",
|
|
53
|
+
"owasp-dependency-check": "^1.0.1",
|
|
54
|
+
"prettier": "^3.8.3",
|
|
55
|
+
"rollup-plugin-visualizer": "^7.0.1",
|
|
56
|
+
"sonda": "^0.11.1",
|
|
57
|
+
"typescript": "^6.0.3",
|
|
58
|
+
"vite": "^8.0.13",
|
|
59
|
+
"vite-plugin-dts": "^5.0.0",
|
|
60
|
+
"vitest": "^4.1.6"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"audit": "op run --env-file=.env -- node -e \"import('@dpuse/dpuse-development').then(m => m.auditDependencies())\"",
|
|
64
|
+
"build": "node -e \"import('@dpuse/dpuse-development').then(m => m.buildProject())\"",
|
|
65
|
+
"check": "node -e \"import('@dpuse/dpuse-development').then(m => m.checkDependencies())\"",
|
|
66
|
+
"document": "op run --env-file=.env -- node -e \"import('@dpuse/dpuse-development').then(m => m.documentDependencies(['MIT']))\"",
|
|
67
|
+
"format": "node -e \"import('@dpuse/dpuse-development').then(m => m.formatCode())\"",
|
|
68
|
+
"lint": "node -e \"import('@dpuse/dpuse-development').then(m => m.lintCode())\"",
|
|
69
|
+
"release": "op run --env-file=.env -- node -e \"import('@dpuse/dpuse-development').then(m => m.releaseProject())\"",
|
|
70
|
+
"sync": "node -e \"import('@dpuse/dpuse-development').then(m => m.syncProjectWithGitHub())\"",
|
|
71
|
+
"test": "node -e \"import('@dpuse/dpuse-development').then(m => m.testProject())\"",
|
|
72
|
+
"update": "node -e \"import('@dpuse/dpuse-development').then(m => m.updateDPUseDependencies(['development', 'eslint', 'shared']))\""
|
|
73
|
+
}
|
|
74
|
+
}
|