datapos-connector-file-store-emulator 0.2.410 → 0.2.411
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const A = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
2
|
+
let M = (e = 21) => {
|
|
3
3
|
let t = "", i = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
4
4
|
for (; e--; )
|
|
5
|
-
t +=
|
|
5
|
+
t += A[i[e] & 63];
|
|
6
6
|
return t;
|
|
7
7
|
}, I = class extends Error {
|
|
8
8
|
locator;
|
|
@@ -10,28 +10,28 @@ let z = (e = 21) => {
|
|
|
10
10
|
constructor(t, i, d) {
|
|
11
11
|
super(t, d), this.name = new.target.name, this.locator = i;
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, z = class extends I {
|
|
14
14
|
};
|
|
15
|
-
class
|
|
15
|
+
class j extends z {
|
|
16
16
|
body;
|
|
17
17
|
/** Sanitized HTTP response body. */
|
|
18
18
|
constructor(t, i, d, s) {
|
|
19
|
-
super(t, i, s), this.name = new.target.name, this.body =
|
|
19
|
+
super(t, i, s), this.name = new.target.name, this.body = C(d ?? void 0);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
22
|
+
class v extends I {
|
|
23
23
|
}
|
|
24
|
-
async function
|
|
24
|
+
async function u(e, t, i) {
|
|
25
25
|
const d = ` - ${e.statusText}`, s = `${t} Response status '${e.status}${e.statusText ? d : ""}' received.`;
|
|
26
26
|
let o;
|
|
27
27
|
try {
|
|
28
28
|
o = await e.text();
|
|
29
|
-
} catch (
|
|
30
|
-
o = `<body unavailable: ${
|
|
29
|
+
} catch (a) {
|
|
30
|
+
o = `<body unavailable: ${r(a).message}>`;
|
|
31
31
|
}
|
|
32
|
-
return new
|
|
32
|
+
return new j(s, i, o);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function r(e) {
|
|
35
35
|
if (e instanceof Error) return e;
|
|
36
36
|
if (typeof e == "string") return new Error(e);
|
|
37
37
|
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return new Error(String(e));
|
|
@@ -44,7 +44,7 @@ function l(e) {
|
|
|
44
44
|
}
|
|
45
45
|
return new Error("Unknown error");
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function C(e) {
|
|
48
48
|
if (!(e == null || e === ""))
|
|
49
49
|
return e.length > 2048 ? `${e.slice(0, 2048)}... [truncated]` : e;
|
|
50
50
|
}
|
|
@@ -54,13 +54,13 @@ function h(e) {
|
|
|
54
54
|
return i === -1 ? e : e.slice(0, Math.max(0, i));
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function g(e) {
|
|
58
58
|
if (e) {
|
|
59
59
|
const t = e.lastIndexOf(".");
|
|
60
60
|
if (t !== -1) return e.slice(Math.max(0, t + 1));
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function w(e) {
|
|
64
64
|
switch (e) {
|
|
65
65
|
case "csv":
|
|
66
66
|
return "text/csv";
|
|
@@ -75,35 +75,35 @@ function P(e) {
|
|
|
75
75
|
return "application/octet-stream";
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
78
|
+
async function p(e, t) {
|
|
79
79
|
const i = `datapos-tool-${t}`, d = e.find((o) => o.id === i);
|
|
80
80
|
if (!d) throw new Error(`Connector could not load unknown tool '${t}'.`);
|
|
81
81
|
const s = await import(`https://engine-eu.datapos.app/tools/${t}_v${d.version}/${i}.es.js`);
|
|
82
82
|
return new s.Tool();
|
|
83
83
|
}
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
id:
|
|
90
|
-
label:
|
|
91
|
-
description:
|
|
92
|
-
category:
|
|
93
|
-
categoryId:
|
|
94
|
-
implementations:
|
|
95
|
-
icon:
|
|
96
|
-
iconDark:
|
|
97
|
-
lastUpdatedAt:
|
|
98
|
-
operations:
|
|
99
|
-
status:
|
|
100
|
-
statusId:
|
|
101
|
-
typeId:
|
|
102
|
-
usageId:
|
|
103
|
-
vendorAccountURL:
|
|
104
|
-
vendorDocumentationURL:
|
|
105
|
-
vendorHomeURL:
|
|
106
|
-
version:
|
|
84
|
+
const n = (e) => new Map(Object.entries(e));
|
|
85
|
+
n({ "en-gb": "Data Positioning Events" }), n({ "en-gb": "Delimited Text" }), n({ "en-gb": "JSON" }), n({ "en-gb": "SPSS" }), n({ "en-gb": "XLSX" }), n({ "en-gb": "XML" });
|
|
86
|
+
n({ "en-gb": "Newline" }), n({ "en-gb": "Carriage Return" }), n({ "en-gb": "Carriage Return/Newline" });
|
|
87
|
+
n({ "en-gb": "Colon" }), n({ "en-gb": "Comma" }), n({ "en-gb": "Exclamation Mark" }), n({ "en-gb": "Record Separator" }), n({ "en-gb": "Semicolon" }), n({ "en-gb": "Space" }), n({ "en-gb": "Tab" }), n({ "en-gb": "Underscore" }), n({ "en-gb": "Unit Separator" }), n({ "en-gb": "Vertical Bar" });
|
|
88
|
+
const P = [",", ";", " ", "|", " ", ":", "_", "!", "0x1F", "0x1E"], R = "datapos-connector-file-store-emulator", E = { en: "File Store Emulator" }, S = { "en-gb": "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." }, T = null, x = "fileStore", k = { default: { authMethodId: "none", maxConnectionCount: 1 } }, _ = '<svg fill="#000000" height="100%" viewBox="0 0 576 512"><path d="M320 32H64C46.33 32 32 46.33 32 64V448C32 465.7 46.33 480 64 480H296.2C305.1 491.8 317.3 502.3 329.7 511.3C326.6 511.7 323.3 512 320 512H64C28.65 512 0 483.3 0 448V64C0 28.65 28.65 0 64 0H320C355.3 0 384 28.65 384 64V198.6C372.8 201.8 362.1 206 352 211.2V64C352 46.33 337.7 32 320 32V32zM64 144C64 135.2 71.16 128 80 128H304C312.8 128 320 135.2 320 144C320 152.8 312.8 160 304 160H80C71.16 160 64 152.8 64 144zM272 224C280.8 224 288 231.2 288 240C288 248.8 280.8 256 272 256H80C71.16 256 64 248.8 64 240C64 231.2 71.16 224 80 224H272zM208 320C216.8 320 224 327.2 224 336C224 344.8 216.8 352 208 352H80C71.16 352 64 344.8 64 336C64 327.2 71.16 320 80 320H208zM476.7 324.7C482.9 318.4 493.1 318.4 499.3 324.7C505.6 330.9 505.6 341.1 499.3 347.3L427.3 419.3C421.1 425.6 410.9 425.6 404.7 419.3L364.7 379.3C358.4 373.1 358.4 362.9 364.7 356.7C370.9 350.4 381.1 350.4 387.3 356.7L416 385.4L476.7 324.7zM288 368C288 288.5 352.5 224 432 224C511.5 224 576 288.5 576 368C576 447.5 511.5 512 432 512C352.5 512 288 447.5 288 368zM432 480C493.9 480 544 429.9 544 368C544 306.1 493.9 256 432 256C370.1 256 320 306.1 320 368C320 429.9 370.1 480 432 480z"/></svg>', F = '<svg fill="#ffffff" height="100%" viewBox="0 0 576 512"><path d="M320 32H64C46.33 32 32 46.33 32 64V448C32 465.7 46.33 480 64 480H296.2C305.1 491.8 317.3 502.3 329.7 511.3C326.6 511.7 323.3 512 320 512H64C28.65 512 0 483.3 0 448V64C0 28.65 28.65 0 64 0H320C355.3 0 384 28.65 384 64V198.6C372.8 201.8 362.1 206 352 211.2V64C352 46.33 337.7 32 320 32V32zM64 144C64 135.2 71.16 128 80 128H304C312.8 128 320 135.2 320 144C320 152.8 312.8 160 304 160H80C71.16 160 64 152.8 64 144zM272 224C280.8 224 288 231.2 288 240C288 248.8 280.8 256 272 256H80C71.16 256 64 248.8 64 240C64 231.2 71.16 224 80 224H272zM208 320C216.8 320 224 327.2 224 336C224 344.8 216.8 352 208 352H80C71.16 352 64 344.8 64 336C64 327.2 71.16 320 80 320H208zM476.7 324.7C482.9 318.4 493.1 318.4 499.3 324.7C505.6 330.9 505.6 341.1 499.3 347.3L427.3 419.3C421.1 425.6 410.9 425.6 404.7 419.3L364.7 379.3C358.4 373.1 358.4 362.9 364.7 356.7C370.9 350.4 381.1 350.4 387.3 356.7L416 385.4L476.7 324.7zM288 368C288 288.5 352.5 224 432 224C511.5 224 576 288.5 576 368C576 447.5 511.5 512 432 512C352.5 512 288 447.5 288 368zM432 480C493.9 480 544 429.9 544 368C544 306.1 493.9 256 432 256C370.1 256 320 306.1 320 368C320 429.9 370.1 480 432 480z"/></svg>', O = null, U = ["abortOperation", "findObjectFolderPath", "getReadableStream", "listNodes", "previewObject", "retrieveRecords"], N = null, L = "beta", D = "connector", V = "source", B = null, G = null, q = null, H = "0.2.411", Z = {
|
|
89
|
+
id: R,
|
|
90
|
+
label: E,
|
|
91
|
+
description: S,
|
|
92
|
+
category: T,
|
|
93
|
+
categoryId: x,
|
|
94
|
+
implementations: k,
|
|
95
|
+
icon: _,
|
|
96
|
+
iconDark: F,
|
|
97
|
+
lastUpdatedAt: O,
|
|
98
|
+
operations: U,
|
|
99
|
+
status: N,
|
|
100
|
+
statusId: L,
|
|
101
|
+
typeId: D,
|
|
102
|
+
usageId: V,
|
|
103
|
+
vendorAccountURL: B,
|
|
104
|
+
vendorDocumentationURL: G,
|
|
105
|
+
vendorHomeURL: q,
|
|
106
|
+
version: H
|
|
107
107
|
}, f = {
|
|
108
108
|
"": [{ id: "cpB45vx36UWghglh18MUS", lastModifiedAt: 17435076862165598e-4, name: "ENGAGEMENT_START_EVENTS_202405121858.csv", size: 122800, typeId: "object" }, { id: "GUIHoZJcLIFZ6B7A1bu0r", lastModifiedAt: 1743507686221789e-3, name: "PEOPLE_BIRTH_EVENTS_202405121857.csv", size: 114287, typeId: "object" }, { childCount: 3, name: "AUDATACY Interchange Format", typeId: "folder" }, { childCount: 12, name: "Formula 1", typeId: "folder" }, { childCount: 7, name: "Salesforce API", typeId: "folder" }, { childCount: 156, name: "Salesforce Extract", typeId: "folder" }, { childCount: 20, name: "SAP Employee Central Extract", typeId: "folder" }, { childCount: 7, name: "SAP SuccessFactors API", typeId: "folder" }, { childCount: 12, name: "Test Files", typeId: "folder" }],
|
|
109
109
|
"/AUDATACY Interchange Format": [{ childCount: 11, name: "Coded Data", typeId: "folder" }, { childCount: 1, name: "Human Resources", typeId: "folder" }, { childCount: 1, name: "Party", typeId: "folder" }],
|
|
@@ -124,27 +124,27 @@ const R = [",", ";", " ", "|", " ", ":", "_", "!", "0x1F", "0x1E"], E = "datapos
|
|
|
124
124
|
"/Test Files/Encoding Test Files/encodings": [{ id: "irBUQdMBx4ZhLXyti4t0W", lastModifiedAt: 1743507686243765e-3, name: "big5", size: 614, typeId: "object" }, { id: "BPyMwzoNSnGdUV_dzYEWz", lastModifiedAt: 17435076862438152e-4, name: "euc_jp", size: 3919, typeId: "object" }, { id: "FXjFtwUcRxKmH_ZCAaNz6", lastModifiedAt: 1743507686243867e-3, name: "euc_kr", size: 2480, typeId: "object" }, { id: "5fBDsObvTXORIIgptb-sl", lastModifiedAt: 17435076862439092e-4, name: "gb18030", size: 1665, typeId: "object" }, { id: "7Jt6_ku8bzWNBFjRaagdR", lastModifiedAt: 17435076862439512e-4, name: "iso2022cn", size: 1749, typeId: "object" }, { id: "WLvdjjUGMGnEv3FmDQJ9p", lastModifiedAt: 1743507686243999e-3, name: "iso2022jp", size: 2924, typeId: "object" }, { id: "6CsULI8SIvo4zwFjKAA1_", lastModifiedAt: 17435076862440513e-4, name: "iso2022kr", size: 3172, typeId: "object" }, { id: "SqbmllHEuS76me2jsWjLI", lastModifiedAt: 17435076862440952e-4, name: "iso88591_en", size: 2955, typeId: "object" }, { id: "5oCOldZaxX2XoavVBBgdc", lastModifiedAt: 1743507686244138e-3, name: "iso88592_cs", size: 1600, typeId: "object" }, { id: "UATsUFbSUtqVhVhMJ2sec", lastModifiedAt: 1743507686244182e-3, name: "iso88595_ru", size: 1024, typeId: "object" }, { id: "wC1_pjcjj0NZZWTxqiGaw", lastModifiedAt: 17435076862442336e-4, name: "iso88596_ar", size: 2241, typeId: "object" }, { id: "Pe8RK8l_zBAjLODUX34IB", lastModifiedAt: 1743507686244275e-3, name: "iso88597_el", size: 1033, typeId: "object" }, { id: "Ga6Z1yRgs99Vpa5QrR70_", lastModifiedAt: 17435076862445083e-4, name: "iso88598", size: 2352, typeId: "object" }, { id: "XmtdLSxT84HsoF7OIqye4", lastModifiedAt: 1743507686244566e-3, name: "iso88598_he", size: 2353, typeId: "object" }, { id: "3HCk8XXlua9KEOtc5iseJ", lastModifiedAt: 1743507686244627e-3, name: "iso88599_tr", size: 2424, typeId: "object" }, { id: "zjfA3EHpzaPHAvTkBICWG", lastModifiedAt: 17435076862446736e-4, name: "koi8r", size: 1024, typeId: "object" }, { id: "IRnhQiGe4mxsoQpaJCdRM", lastModifiedAt: 17435076862447236e-4, name: "lang_arabic", size: 4059, typeId: "object" }, { id: "ih-RgplBSErEYOcna-NlI", lastModifiedAt: 17435076862447717e-4, name: "lang_chinese", size: 916, typeId: "object" }, { id: "9EYQqNjgOksavPn--KH46", lastModifiedAt: 17435076862448289e-4, name: "lang_czech", size: 1795, typeId: "object" }, { id: "Xaeq_CiSthaccRyGw22Bx", lastModifiedAt: 17435076862448726e-4, name: "lang_greek", size: 1895, typeId: "object" }, { id: "421DaSaIy8ywB26Rc2GV1", lastModifiedAt: 1743507686244933e-3, name: "lang_hebrew", size: 4124, typeId: "object" }, { id: "N01Ggo186R8phM3c0zLa2", lastModifiedAt: 17435076862449873e-4, name: "lang_japanese", size: 3978, typeId: "object" }, { id: "T8jzTqgGlU30YQd1QvMm3", lastModifiedAt: 17435076862450503e-4, name: "lang_korean", size: 3466, typeId: "object" }, { id: "R-Fkzl2BW0o9Hios70WwI", lastModifiedAt: 17435076862450947e-4, name: "lang_russian", size: 1873, typeId: "object" }, { id: "KiKbYoPDMht0f9ElSfTYZ", lastModifiedAt: 1743507686245141e-3, name: "lang_turkish", size: 2678, typeId: "object" }, { id: "a_RPqwZdZ5DmZOCDUVeiZ", lastModifiedAt: 17435076862451846e-4, name: "shiftjis", size: 2816, typeId: "object" }, { id: "rXd90uYo_IZSqu9U_3Sr6", lastModifiedAt: 1743507686245242e-3, name: "utf16be", size: 1334, typeId: "object" }, { id: "83XbTcV0_WKdvcPEKeuDy", lastModifiedAt: 17435076862452773e-4, name: "utf16le", size: 1334, typeId: "object" }, { id: "Upq9-WDaQTs--Ogg1Qtev", lastModifiedAt: 17435076862453193e-4, name: "utf32be", size: 2664, typeId: "object" }, { id: "mm0RGQoiYeYc7ORPPI2S8", lastModifiedAt: 17435076862453613e-4, name: "utf32le", size: 2664, typeId: "object" }, { id: "J9FIyiit-zK4HquqAwGNE", lastModifiedAt: 17435076862454148e-4, name: "utf8", size: 1125, typeId: "object" }, { id: "pZQOaI1tOrcy2Km0Z7Enb", lastModifiedAt: 17435076862454595e-4, name: "windows_1250", size: 1617, typeId: "object" }, { id: "da-PPmwaWqLyqUz6SRw1v", lastModifiedAt: 1743507686245507e-3, name: "windows_1251", size: 1024, typeId: "object" }, { id: "aw_8vVm1CvdxaiiI3CX-L", lastModifiedAt: 17435076862456494e-4, name: "windows_1252", size: 2976, typeId: "object" }, { id: "-JYzWLdhtRIWC0vwZFj0I", lastModifiedAt: 17435076862456982e-4, name: "windows_1253", size: 1052, typeId: "object" }, { id: "ImvMAQPnb13Mf7mqB7t6m", lastModifiedAt: 17435076862458247e-4, name: "windows_1254", size: 2445, typeId: "object" }, { id: "mYnEtUyasG7Cub5f7WgsT", lastModifiedAt: 17435076862458765e-4, name: "windows_1255", size: 2405, typeId: "object" }, { id: "clQEg9g9e9QiBJcsOcKcs", lastModifiedAt: 17435076862459272e-4, name: "windows_1256", size: 2241, typeId: "object" }]
|
|
125
125
|
};
|
|
126
126
|
let b;
|
|
127
|
-
async function
|
|
127
|
+
async function K(e, t) {
|
|
128
128
|
const { add_my_numbers: i } = await y();
|
|
129
129
|
console.log(1111, e, t);
|
|
130
130
|
const d = i(Math.trunc(e), Math.trunc(t));
|
|
131
131
|
return console.log(2222, d), d;
|
|
132
132
|
}
|
|
133
|
-
async function
|
|
133
|
+
async function Q(e) {
|
|
134
134
|
const { checksum_from_rust: t } = await y();
|
|
135
135
|
return t(e);
|
|
136
136
|
}
|
|
137
137
|
async function y() {
|
|
138
138
|
return b ??= import("./datapos_connector_file_store_emulator_core-CBVDrOML.js"), b;
|
|
139
139
|
}
|
|
140
|
-
const
|
|
141
|
-
class
|
|
140
|
+
const m = "https://sample-data-eu.datapos.app";
|
|
141
|
+
class $ {
|
|
142
142
|
abortController;
|
|
143
143
|
config;
|
|
144
144
|
engineUtilities;
|
|
145
145
|
toolConfigs;
|
|
146
146
|
constructor(t, i) {
|
|
147
|
-
this.abortController = void 0, this.config =
|
|
147
|
+
this.abortController = void 0, this.config = Z, this.engineUtilities = t, this.toolConfigs = i;
|
|
148
148
|
}
|
|
149
149
|
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
150
150
|
//#region: Operations.
|
|
@@ -161,7 +161,7 @@ class ee {
|
|
|
161
161
|
findObjectFolderPath(t) {
|
|
162
162
|
const i = f;
|
|
163
163
|
for (const d in i)
|
|
164
|
-
if (Object.hasOwn(i, d) && i[d]?.find((
|
|
164
|
+
if (Object.hasOwn(i, d) && i[d]?.find((a) => a.typeId === "object" && a.id === t.nodeId))
|
|
165
165
|
return Promise.resolve(d);
|
|
166
166
|
return Promise.resolve(null);
|
|
167
167
|
}
|
|
@@ -171,15 +171,15 @@ class ee {
|
|
|
171
171
|
async getReadableStream(t) {
|
|
172
172
|
const { signal: i } = this.abortController = new AbortController();
|
|
173
173
|
try {
|
|
174
|
-
const d = await fetch(`${
|
|
174
|
+
const d = await fetch(`${m}/fileStore${t.path}`, { signal: i });
|
|
175
175
|
if (!d.ok)
|
|
176
|
-
throw await
|
|
176
|
+
throw await u(d, `Failed to fetch '${t.path}' file.`, "datapos-connector-file-store-emulator|Connector|getReadableStream");
|
|
177
177
|
if (d.body == null)
|
|
178
|
-
throw new
|
|
179
|
-
const s = await
|
|
178
|
+
throw new v("Readable streams are not supported in this runtime.", "datapos-connector-file-store-emulator|Connector|getReadableStream.unsupported");
|
|
179
|
+
const s = await K(12, 56), o = await Q(this.config.version);
|
|
180
180
|
return console.log("sum", o, s), await Promise.resolve(d.body);
|
|
181
181
|
} catch (d) {
|
|
182
|
-
throw
|
|
182
|
+
throw r(d);
|
|
183
183
|
} finally {
|
|
184
184
|
this.abortController = void 0;
|
|
185
185
|
}
|
|
@@ -190,7 +190,7 @@ class ee {
|
|
|
190
190
|
listNodes(t) {
|
|
191
191
|
const d = f[t.folderPath] ?? [], s = [];
|
|
192
192
|
for (const o of d)
|
|
193
|
-
o.typeId === "folder" ? s.push(
|
|
193
|
+
o.typeId === "folder" ? s.push(J(t.folderPath, o.name, o.childCount)) : s.push(X(t.folderPath, o.id, o.name, o.lastModifiedAt, o.size));
|
|
194
194
|
return Promise.resolve({ cursor: void 0, isMore: !1, connectionNodeConfigs: s, totalCount: s.length });
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
@@ -199,28 +199,30 @@ class ee {
|
|
|
199
199
|
async previewObject(t) {
|
|
200
200
|
const { signal: i } = this.abortController = new AbortController();
|
|
201
201
|
try {
|
|
202
|
-
const d = Date.now(), s = performance.now(),
|
|
203
|
-
if (
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
202
|
+
const d = Date.now(), s = performance.now(), a = await (await p(this.toolConfigs, "file-operators")).previewFile(`${m}/fileStore${t.path}`, i, t.chunkSize);
|
|
203
|
+
if (a.dataFormatId == null) throw new Error(`File '${t.path}' has unknown type.`);
|
|
204
|
+
if (a.text == null) throw new Error(`File '${t.path}' is empty.`);
|
|
205
|
+
const c = await (await p(this.toolConfigs, "csv-parse")).parseText(a.text, P);
|
|
206
206
|
return {
|
|
207
207
|
asAt: d,
|
|
208
|
-
columnConfigs:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
columnConfigs: void 0,
|
|
209
|
+
// schemaConfig.columnConfigs,
|
|
210
|
+
dataFormatId: a.dataFormatId,
|
|
211
|
+
duration: performance.now() - s,
|
|
212
|
+
encodingId: a.encodingId,
|
|
213
|
+
encodingConfidenceLevel: a.encodingConfidenceLevel,
|
|
214
|
+
fileType: a.fileTypeConfig,
|
|
214
215
|
hasHeaders: !1,
|
|
215
|
-
|
|
216
|
-
parsingRecords:
|
|
217
|
-
inferenceRecords:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
216
|
+
recordDelimiterId: c.recordDelimiterId,
|
|
217
|
+
parsingRecords: c.parsingRecords,
|
|
218
|
+
inferenceRecords: void 0,
|
|
219
|
+
// schemaConfig.inferenceRecords,
|
|
220
|
+
size: a.bytes.length,
|
|
221
|
+
text: a.text,
|
|
222
|
+
valueDelimiterId: c.valueDelimiterId
|
|
221
223
|
};
|
|
222
224
|
} catch (d) {
|
|
223
|
-
throw
|
|
225
|
+
throw r(d);
|
|
224
226
|
} finally {
|
|
225
227
|
this.abortController = void 0;
|
|
226
228
|
}
|
|
@@ -231,24 +233,24 @@ class ee {
|
|
|
231
233
|
async retrieveRecords(t, i, d) {
|
|
232
234
|
this.abortController = new AbortController();
|
|
233
235
|
try {
|
|
234
|
-
const s = await
|
|
235
|
-
d(
|
|
236
|
+
const s = await p(this.toolConfigs, "csv-parse"), o = { delimiter: t.valueDelimiterId, info: !0, relax_column_count: !0, relax_quotes: !0 }, a = `${m}/fileStore${t.path}`, l = await s.parseStream(t, o, a, this.abortController, i);
|
|
237
|
+
d(l);
|
|
236
238
|
} catch (s) {
|
|
237
|
-
throw
|
|
239
|
+
throw r(s);
|
|
238
240
|
} finally {
|
|
239
241
|
this.abortController = void 0;
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
244
|
//#endregion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
243
245
|
}
|
|
244
|
-
function
|
|
245
|
-
return { id:
|
|
246
|
+
function J(e, t, i) {
|
|
247
|
+
return { id: M(), childCount: i, extension: void 0, folderPath: e, label: t, name: t, typeId: "folder" };
|
|
246
248
|
}
|
|
247
|
-
function
|
|
248
|
-
const o = h(i) ?? "",
|
|
249
|
-
return { id: t, extension:
|
|
249
|
+
function X(e, t, i, d, s) {
|
|
250
|
+
const o = h(i) ?? "", a = g(i), l = d, c = w(a);
|
|
251
|
+
return { id: t, extension: a, folderPath: e, label: i, lastModifiedAt: l, mimeType: c, name: o, size: s, typeId: "object" };
|
|
250
252
|
}
|
|
251
253
|
export {
|
|
252
|
-
|
|
254
|
+
$ as Connector
|
|
253
255
|
};
|
|
254
256
|
//# sourceMappingURL=datapos-connector-file-store-emulator.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datapos-connector-file-store-emulator.es.js","sources":["../node_modules/nanoid/url-alphabet/index.js","../node_modules/nanoid/index.browser.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-errors.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-utilities.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-tools.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-locale.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-dataview.es.js","../src/rustBridge.ts","../src/index.ts"],"sourcesContent":["export const 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 mask = (2 << Math.log2(alphabet.length - 1)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step | 0\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length >= size) return id\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","class i extends Error {\n locator;\n /** Logical source of the error. */\n constructor(o, t, r) {\n super(o, r), this.name = new.target.name, this.locator = t;\n }\n}\nclass a extends i {\n}\nclass g extends a {\n}\nclass p extends a {\n}\nclass c extends a {\n body;\n /** Sanitized HTTP response body. */\n constructor(o, t, r, n) {\n super(o, t, n), this.name = new.target.name, this.body = E(r ?? void 0);\n }\n}\nclass y extends i {\n}\nclass m extends a {\n componentName;\n /** Vue component name, if available. */\n info;\n /** Vue error info string. */\n constructor(o, t, r, n, s) {\n super(o, t, s), this.name = new.target.name, this.info = r, this.componentName = n;\n }\n}\nclass w extends a {\n}\nclass h extends a {\n}\nasync function b(e, o, t) {\n const r = ` - ${e.statusText}`, n = `${o} Response status '${e.status}${e.statusText ? r : \"\"}' received.`;\n let s;\n try {\n s = await e.text();\n } catch (d) {\n s = `<body unavailable: ${l(d).message}>`;\n }\n return new c(n, t, s);\n}\nfunction k(e) {\n return e.map((o) => o.message).join(\" \");\n}\nfunction x(e) {\n try {\n e();\n } catch {\n }\n}\nfunction l(e) {\n if (e instanceof Error) return e;\n if (typeof e == \"string\") return new Error(e);\n if (typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"bigint\") return new Error(String(e));\n if (typeof e == \"symbol\") return new Error(e.description ?? \"Unknown error\");\n if (e != null && typeof e == \"object\")\n try {\n return new Error(JSON.stringify(e));\n } catch {\n return new Error(\"Unknown error\");\n }\n return new Error(\"Unknown error\");\n}\nfunction R(e) {\n const o = /* @__PURE__ */ new Set(), t = [];\n let r = e;\n for (; r != null && !o.has(r); ) {\n o.add(r);\n let n;\n if (r instanceof c)\n n = { componentName: void 0, body: r.body, info: void 0, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;\n else if (r instanceof m)\n n = {\n componentName: r.componentName,\n body: void 0,\n info: r.info,\n locator: r.locator,\n message: r.message,\n name: r.name,\n stack: r.stack\n }, r = r.cause;\n else if (r instanceof i)\n n = { componentName: void 0, body: void 0, info: void 0, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;\n else if (r instanceof Error) {\n const s = r;\n n = { componentName: void 0, body: void 0, info: void 0, locator: \"\", message: s.message, name: s.name, stack: s.stack }, r = s.cause;\n } else\n n = { componentName: void 0, body: void 0, info: void 0, locator: \"\", message: f(r), name: \"Error\", stack: void 0 }, r = void 0;\n /(?:\\.{3}|[.!?])$/.test(n.message) || (n.message += \".\"), t.push(n);\n }\n return t;\n}\nfunction f(e) {\n let o;\n try {\n o = JSON.stringify(e);\n } catch {\n typeof e == \"symbol\" ? o = e.description ?? \"Unknown error\" : typeof e == \"bigint\" ? o = e.toString() : o = \"Unknown error\";\n }\n return o === \"\" && (o = \"Unknown error\"), o;\n}\nfunction E(e) {\n if (!(e == null || e === \"\"))\n return e.length > 2048 ? `${e.slice(0, 2048)}... [truncated]` : e;\n}\nexport {\n g as APIError,\n a as ApplicationError,\n p as EngineError,\n c as FetchError,\n y as OperationalError,\n m as VueHandledError,\n h as WindowHandledPromiseRejectionError,\n w as WindowHandledRuntimeError,\n b as buildFetchError,\n k as concatenateSerialisedErrorMessages,\n x as ignoreErrors,\n l as normalizeToError,\n R as serialiseError\n};\n","const c = \"en-US\", s = /* @__PURE__ */ new Map();\nfunction f(e) {\n switch (e) {\n case \"Edm.Binary\":\n return \"unknown\";\n // Binary...\n case \"Edm.Boolean\":\n return \"boolean\";\n case \"Edm.Byte\":\n return \"wholeNumber\";\n case \"Edm.DateTime\":\n return \"moment\";\n // DateTime...\n case \"Edm.DateTimeOffset\":\n return \"moment\";\n // DateTimeOffset...\n case \"Edm.Decimal\":\n return \"decimalNumber\";\n case \"Edm.Double\":\n return \"decimalNumber\";\n case \"Edm.Guid\":\n return \"string\";\n case \"Edm.Int16\":\n return \"wholeNumber\";\n case \"Edm.Int32\":\n return \"wholeNumber\";\n case \"Edm.Int64\":\n return \"wholeNumber\";\n case \"Edm.SByte\":\n return \"wholeNumber\";\n case \"Edm.Single\":\n return \"decimalNumber\";\n case \"Edm.String\":\n return \"string\";\n case \"Edm.Time\":\n return \"momentTime\";\n // Time...\n default:\n return \"unknown\";\n }\n}\nfunction l(e) {\n if (e) {\n const t = e.lastIndexOf(\"/\"), n = e.lastIndexOf(\".\", t === -1 ? e.length : t);\n return n === -1 ? e : e.slice(0, Math.max(0, n));\n }\n}\nfunction m(e) {\n if (e) {\n const t = e.lastIndexOf(\".\");\n if (t !== -1) return e.slice(Math.max(0, t + 1));\n }\n}\nfunction r(e, t = 2, n = t, i = c) {\n if (e == null) return \"\";\n const u = `${i}decimal${t}.${n}`;\n let a = s.get(u);\n return a || (a = new Intl.NumberFormat(i, {\n localeMatcher: \"best fit\",\n maximumFractionDigits: t,\n minimumFractionDigits: n,\n minimumIntegerDigits: 1,\n style: \"decimal\",\n useGrouping: !0\n }), s.set(u, a)), a.format(e);\n}\nfunction d(e) {\n return e == null ? \"\" : e < 1e3 ? o(e) : e < 1e6 ? `${r(e / 1e3, 2, 0)}K` : e < 1e9 ? `${r(e / 1e6, 2, 0)}M` : e < 1e12 ? `${r(e / 1e9, 2, 0)}B` : `${r(e / 1e12, 2, 0)}T`;\n}\nfunction x(e) {\n return e == null ? \"\" : e === 1 ? \"1 byte\" : e < 1024 ? `${o(e)} bytes` : e < 1048576 ? `${r(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${r(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${r(e / 1073741824, 2, 0)} GB` : `${r(e / 1099511627776, 2, 0)} TB`;\n}\nfunction p(e) {\n return e == null ? \"\" : e < 1e3 ? `${o(e)} ms` : e === 1e3 ? `${o(e)} sec` : e < 6e4 ? `${r(e / 1e3, 2, 0)} secs` : e === 6e4 ? \"1 min\" : e < 36e5 ? `${r(e / 6e4, 2, 0)} mins` : e === 36e5 ? \"1 hr\" : e < 864e5 ? `${r(e / 36e5, 2, 0)} hrs` : e === 864e5 ? \"1 day\" : `${r(e / 864e5, 2, 0)} days`;\n}\nfunction o(e, t = c) {\n if (e == null) return \"\";\n const n = `${t}decimal0.0`;\n let i = s.get(n);\n return i || (i = new Intl.NumberFormat(t, {\n localeMatcher: \"best fit\",\n maximumFractionDigits: 0,\n minimumFractionDigits: 0,\n minimumIntegerDigits: 1,\n style: \"decimal\",\n useGrouping: !0\n }), s.set(n, i)), i.format(e);\n}\nfunction E(e) {\n switch (e) {\n case \"csv\":\n return \"text/csv\";\n case \"tab\":\n case \"tsv\":\n return \"text/tab-separated-values\";\n case \"xls\":\n return \"application/vnd.ms-excel\";\n case \"xlsx\":\n return \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\n default:\n return \"application/octet-stream\";\n }\n}\nexport {\n f as convertODataTypeIdToUsageTypeId,\n m as extractExtensionFromPath,\n l as extractNameFromPath,\n r as formatNumberAsDecimalNumber,\n p as formatNumberAsDuration,\n d as formatNumberAsSize,\n x as formatNumberAsStorageSize,\n o as formatNumberAsWholeNumber,\n E as lookupMimeTypeForExtension\n};\n","async function a(e, o) {\n const n = `datapos-tool-${o}`, t = e.find((r) => r.id === n);\n if (!t) throw new Error(`Connector could not load unknown tool '${o}'.`);\n const l = await import(`https://engine-eu.datapos.app/tools/${o}_v${t.version}/${n}.es.js`);\n return new l.Tool();\n}\nexport {\n a as loadTool\n};\n","const o = \"en-gb\", i = (e) => new Map(Object.entries(e)), s = (e, t, n = o) => {\n const r = e.get(t);\n if (r !== void 0) return r;\n if (n !== t)\n return e.get(n);\n};\nexport {\n o as DEFAULT_LOCALE_CODE,\n i as createLabelMap,\n s as resolveLabel\n};\n","import { createLabelMap as e } from \"./datapos-shared-locale.es.js\";\ne({ \"en-gb\": \"Data Positioning Events\" }), e({ \"en-gb\": \"Delimited Text\" }), e({ \"en-gb\": \"JSON\" }), e({ \"en-gb\": \"SPSS\" }), e({ \"en-gb\": \"XLSX\" }), e({ \"en-gb\": \"XML\" });\ne({ \"en-gb\": \"Newline\" }), e({ \"en-gb\": \"Carriage Return\" }), e({ \"en-gb\": \"Carriage Return/Newline\" });\ne({ \"en-gb\": \"Colon\" }), e({ \"en-gb\": \"Comma\" }), e({ \"en-gb\": \"Exclamation Mark\" }), e({ \"en-gb\": \"Record Separator\" }), e({ \"en-gb\": \"Semicolon\" }), e({ \"en-gb\": \"Space\" }), e({ \"en-gb\": \"Tab\" }), e({ \"en-gb\": \"Underscore\" }), e({ \"en-gb\": \"Unit Separator\" }), e({ \"en-gb\": \"Vertical Bar\" });\nconst a = [\",\", \";\", \"\t\", \"|\", \" \", \":\", \"_\", \"!\", \"0x1F\", \"0x1E\"];\nexport {\n a as ORDERED_VALUE_DELIMITER_IDS\n};\n","// Dependencies - Framework\nimport type * as RustModule from '../rust/datapos-connector-file-store-emulator-core/pkg/datapos_connector_file_store_emulator_core.js';\n\n// Interfaces/Types\ntype RustBindings = typeof RustModule;\n\n// Module Variables\nlet rustBindingsPromise: Promise<RustBindings> | undefined;\n\n// Utilities\nasync function addNumbersWithRust(left: number, right: number): Promise<number> {\n const { add_my_numbers } = await loadRustBindings();\n console.log(1111, left, right);\n const yyyy = add_my_numbers(Math.trunc(left), Math.trunc(right));\n console.log(2222, yyyy);\n return yyyy;\n}\n\n// Utilities\nasync function checksumWithRust(input: string): Promise<number> {\n const { checksum_from_rust } = await loadRustBindings();\n return checksum_from_rust(input);\n}\n\n// Helpers\nasync function loadRustBindings(): Promise<RustBindings> {\n rustBindingsPromise ??= import('../rust/datapos-connector-file-store-emulator-core/pkg/datapos_connector_file_store_emulator_core.js');\n return rustBindingsPromise;\n}\n\n// Exposures\nexport { addNumbersWithRust, checksumWithRust };\n","/**\n * File store emulator connector class.\n */\n\n/* TODO: Consider Cloudflare R2 Download URL: https://plugins-eu.datapositioning.app/connectors/datapos-connector-file-store-emulator-es.js.\n This would allow us to secure the bucket? */\n\n// Vendor dependencies.\nimport { nanoid } from 'nanoid';\n\n// Framework dependencies.\nimport type { Tool as CSVParseTool } from '@datapos/datapos-tool-csv-parse';\nimport type { EngineUtilities } from '@datapos/datapos-shared/engine';\nimport type { Tool as FileOperatorsTool } from '@datapos/datapos-tool-file-operators';\nimport { buildFetchError, normalizeToError, OperationalError } from '@datapos/datapos-shared/errors';\nimport type {\n ConnectionNodeConfig,\n ConnectorConfig,\n ConnectorInterface,\n FindObjectFolderPathOptions,\n GetReadableStreamOptions,\n ListNodesOptions,\n ListNodesResult,\n PreviewObjectOptions,\n RetrieveRecordsOptions,\n RetrieveRecordsSummary\n} from '@datapos/datapos-shared/component/connector';\nimport { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from '@datapos/datapos-shared/utilities';\nimport { loadTool, type ToolConfig } from '@datapos/datapos-shared/component/tool';\nimport { ORDERED_VALUE_DELIMITER_IDS, type ParsingRecord, type PreviewConfig } from '@datapos/datapos-shared/component/dataView';\n\n// Data dependencies.\nimport config from '~/config.json';\nimport fileStoreFolderPathData from '@/fileStoreFolderPaths.json';\n\nimport { addNumbersWithRust, checksumWithRust } from '@/rustBridge';\n\n/**\n * File store folder paths.\n */\ntype FileStoreFolderNode =\n | ({ typeId: 'folder'; childCount: number } & { name: string })\n | ({ typeId: 'object'; id: string; lastModifiedAt: number; size: number } & { name: string });\ntype FileStoreFolderPaths = Record<string, FileStoreFolderNode[]>;\n\n// Constants.\nconst URL_PREFIX = 'https://sample-data-eu.datapos.app';\n\n/**\n * File store emulator connector.\n */\nclass Connector implements ConnectorInterface {\n abortController: AbortController | undefined;\n readonly config: ConnectorConfig;\n engineUtilities: EngineUtilities;\n readonly toolConfigs;\n\n constructor(engineUtilities: EngineUtilities, toolConfigs: ToolConfig[]) {\n this.abortController = undefined;\n this.config = config as ConnectorConfig;\n this.engineUtilities = engineUtilities;\n this.toolConfigs = toolConfigs;\n }\n\n //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n //#region: Operations.\n //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n /**\n * Abort the currently running operation.\n */\n abortOperation(): void {\n if (!this.abortController) return;\n this.abortController.abort();\n this.abortController = undefined;\n }\n\n /**\n * Find the folder path containing the specified object node.\n */\n findObjectFolderPath(options: FindObjectFolderPathOptions): Promise<string | null> {\n const fileStoreFolderPaths = fileStoreFolderPathData as FileStoreFolderPaths;\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 // eslint-disable-next-line security/detect-object-injection\n const folderPathNodes = fileStoreFolderPaths[folderPath];\n const folderPathNode = folderPathNodes?.find((folderPathNode) => folderPathNode.typeId === 'object' && folderPathNode.id === options.nodeId);\n if (folderPathNode) return Promise.resolve(folderPath); // Found, return folder path.\n }\n }\n return Promise.resolve(null); // Not found.\n }\n\n /**\n * Get a readable stream for the specified object node path.\n */\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}/fileStore${options.path}`, { signal });\n if (!response.ok) {\n throw await buildFetchError(response, `Failed to fetch '${options.path}' file.`, 'datapos-connector-file-store-emulator|Connector|getReadableStream');\n }\n if (response.body == null) {\n throw new OperationalError('Readable streams are not supported in this runtime.', 'datapos-connector-file-store-emulator|Connector|getReadableStream.unsupported');\n }\n\n // TODO: Remove after testing.\n const xxx = await addNumbersWithRust(12, 56);\n const sum = await checksumWithRust(this.config.version);\n console.log('sum', sum, xxx);\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 /**\n * Lists all nodes (folders and objects) in the specified folder path.\n */\n listNodes(options: ListNodesOptions): Promise<ListNodesResult> {\n const fileStoreFolderPaths = fileStoreFolderPathData as FileStoreFolderPaths;\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 /**\n * Preview the contents of the object node with the specified path.\n */\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 identify type and decode text.\n const fileOperatorsTool = await loadTool<FileOperatorsTool>(this.toolConfigs, 'file-operators');\n const filePreviewConfig = await fileOperatorsTool.previewFile(`${URL_PREFIX}/fileStore${options.path}`, signal, options.chunkSize);\n if (filePreviewConfig.dataFormatId == null) throw new Error(`File '${options.path}' has unknown type.`);\n if (filePreviewConfig.text == null) throw new Error(`File '${options.path}' is empty.`);\n\n // Parse text to identify delimiters and return record.\n const csvParseTool = await loadTool<CSVParseTool>(this.toolConfigs, 'csv-parse');\n const parsePreviewConfig = await csvParseTool.parsePreview(filePreviewConfig.text, ORDERED_VALUE_DELIMITER_IDS);\n\n // // Infer values and initialise column configurations.\n // const columnConfigs: ObjectColumnConfig[] = [];\n // const inferenceRecords: InferenceRecord[] = [];\n // for (const parsingRecord of parsingRecords) {\n // const inferredValues = engineUtilities.inferValues(parsingRecord, columnConfigs);\n // inferenceRecords.push(inferredValues);\n // }\n\n // // Infer column labels.\n // // TODO: Only do this if headers detected.\n // let firstDataRowIndex = 0;\n // const headerRecord = inferenceRecords[0];\n // if (headerRecord) {\n // const headerValueCount = headerRecord.length;\n // for (let headerValueIndex = 0; headerValueIndex < headerValueCount; headerValueIndex++) {\n // // eslint-disable-next-line security/detect-object-injection\n // const headerValue = headerRecord[headerValueIndex]?.inferredValue;\n // const headerLabel = headerValue == undefined ? `Column ${headerValueIndex}` : String(headerValue); // TODO: Default not needed, set in 'inferValues'.\n // // eslint-disable-next-line security/detect-object-injection\n // const columnConfig = columnConfigs[headerValueIndex];\n // if (columnConfig == null) continue;\n // columnConfig.label = { en: headerLabel };\n // }\n // firstDataRowIndex = 1;\n // }\n\n // // Infer column characteristics.\n // for (let recordIndex = firstDataRowIndex; recordIndex < inferenceRecords.length; recordIndex++) {\n // // eslint-disable-next-line security/detect-object-injection\n // const inferenceRecord = inferenceRecords[recordIndex] ?? [];\n // for (let inferenceIndex = 0; inferenceIndex < inferenceRecord.length; inferenceIndex++) {\n // // eslint-disable-next-line security/detect-object-injection\n // const columnConfig = columnConfigs[inferenceIndex];\n // }\n // }\n\n const duration = performance.now() - startedAt;\n return {\n asAt,\n columnConfigs: schemaConfig.columnConfigs,\n dataFormatId: previewConfig.dataFormatId,\n duration,\n encodingId: previewConfig.encodingId,\n encodingConfidenceLevel: previewConfig.encodingConfidenceLevel,\n fileType: previewConfig.fileTypeConfig,\n hasHeaders: false,\n recordDelimiterCharSeq: schemaConfig.recordDelimiterId,\n parsingRecords: schemaConfig.parsingRecords,\n inferenceRecords: schemaConfig.inferenceRecords,\n size: previewConfig.bytes.length,\n text: previewConfig.text,\n valueDelimiterCharSeq: schemaConfig.valueDelimiterId\n } as PreviewConfig;\n } catch (error) {\n throw normalizeToError(error);\n } finally {\n this.abortController = undefined;\n }\n }\n /**\n * Retrieves all records from a CSV object node using streaming and chunked processing.\n */\n async retrieveRecords(options: RetrieveRecordsOptions, chunk: (records: ParsingRecord[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void> {\n this.abortController = new AbortController();\n\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}/fileStore${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 //#endregion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n}\n\n//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n//#region: Helpers.\n//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n/**\n * Construct folder node configuration.\n */\nfunction constructFolderNodeConfig(folderPath: string, name: string, childCount: number): ConnectionNodeConfig {\n return { id: nanoid(), childCount, extension: undefined, folderPath, label: name, name, typeId: 'folder' };\n}\n\n/**\n * Construct object (file) node configuration.\n */\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 { id, extension, folderPath, label: fullName, lastModifiedAt: lastModifiedAtTimestamp, mimeType, name, size, typeId: 'object' };\n}\n\n//#endregion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n// Exports.\nexport { Connector };\n"],"names":["urlAlphabet","nanoid","size","id","bytes","scopedUrlAlphabet","o","t","r","i","c","a","n","E","y","b","s","d","l","m","e","rustBindingsPromise","addNumbersWithRust","left","right","add_my_numbers","loadRustBindings","yyyy","checksumWithRust","input","checksum_from_rust","URL_PREFIX","Connector","engineUtilities","toolConfigs","config","options","fileStoreFolderPaths","fileStoreFolderPathData","folderPath","folderPathNode","signal","response","buildFetchError","OperationalError","xxx","sum","error","normalizeToError","folderNodes","connectionNodeConfigs","folderNode","constructFolderNodeConfig","constructObjectNodeConfig","asAt","startedAt","filePreviewConfig","loadTool","parsePreviewConfig","ORDERED_VALUE_DELIMITER_IDS","duration","chunk","complete","csvParseTool","parseStreamOptions","url","summary","name","childCount","fullName","lastModifiedAt","extractNameFromPath","extension","extractExtensionFromPath","lastModifiedAtTimestamp","mimeType","lookupMimeTypeForExtension"],"mappings":"AAAO,MAAMA,IACX;ACoBK,IAAIC,IAAS,CAACC,IAAO,OAAO;AACjC,MAAIC,IAAK,IACLC,IAAQ,OAAO,gBAAgB,IAAI,WAAYF,KAAQ,CAAC,CAAE;AAC9D,SAAOA;AACL,IAAAC,KAAME,EAAkBD,EAAMF,CAAI,IAAI,EAAE;AAE1C,SAAOC;AACT,OC5BA,cAAgB,MAAM;AAAA,EACpB;AAAA;AAAA,EAEA,YAAYG,GAAGC,GAAGC,GAAG;AACnB,UAAMF,G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WAAAqE,GAAW,YAAAjC,GAAY,OAAO8B,GAAU,gBAAgBK,GAAyB,UAAAC,GAAU,MAAAR,GAAM,MAAAjE,GAAM,QAAQ,SAAA;AAChI;","x_google_ignoreList":[0,1,2,3,4,5,6]}
|
|
1
|
+
{"version":3,"file":"datapos-connector-file-store-emulator.es.js","sources":["../node_modules/nanoid/url-alphabet/index.js","../node_modules/nanoid/index.browser.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-errors.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-utilities.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-tools.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-locale.es.js","../node_modules/@datapos/datapos-shared/dist/datapos-shared-dataview.es.js","../src/rustBridge.ts","../src/index.ts"],"sourcesContent":["export const 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 mask = (2 << Math.log2(alphabet.length - 1)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step | 0\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length >= size) return id\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","class i extends Error {\n locator;\n /** Logical source of the error. */\n constructor(o, t, r) {\n super(o, r), this.name = new.target.name, this.locator = t;\n }\n}\nclass a extends i {\n}\nclass g extends a {\n}\nclass p extends a {\n}\nclass c extends a {\n body;\n /** Sanitized HTTP response body. */\n constructor(o, t, r, n) {\n super(o, t, n), this.name = new.target.name, this.body = E(r ?? void 0);\n }\n}\nclass y extends i {\n}\nclass m extends a {\n componentName;\n /** Vue component name, if available. */\n info;\n /** Vue error info string. */\n constructor(o, t, r, n, s) {\n super(o, t, s), this.name = new.target.name, this.info = r, this.componentName = n;\n }\n}\nclass w extends a {\n}\nclass h extends a {\n}\nasync function b(e, o, t) {\n const r = ` - ${e.statusText}`, n = `${o} Response status '${e.status}${e.statusText ? r : \"\"}' received.`;\n let s;\n try {\n s = await e.text();\n } catch (d) {\n s = `<body unavailable: ${l(d).message}>`;\n }\n return new c(n, t, s);\n}\nfunction k(e) {\n return e.map((o) => o.message).join(\" \");\n}\nfunction x(e) {\n try {\n e();\n } catch {\n }\n}\nfunction l(e) {\n if (e instanceof Error) return e;\n if (typeof e == \"string\") return new Error(e);\n if (typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"bigint\") return new Error(String(e));\n if (typeof e == \"symbol\") return new Error(e.description ?? \"Unknown error\");\n if (e != null && typeof e == \"object\")\n try {\n return new Error(JSON.stringify(e));\n } catch {\n return new Error(\"Unknown error\");\n }\n return new Error(\"Unknown error\");\n}\nfunction R(e) {\n const o = /* @__PURE__ */ new Set(), t = [];\n let r = e;\n for (; r != null && !o.has(r); ) {\n o.add(r);\n let n;\n if (r instanceof c)\n n = { componentName: void 0, body: r.body, info: void 0, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;\n else if (r instanceof m)\n n = {\n componentName: r.componentName,\n body: void 0,\n info: r.info,\n locator: r.locator,\n message: r.message,\n name: r.name,\n stack: r.stack\n }, r = r.cause;\n else if (r instanceof i)\n n = { componentName: void 0, body: void 0, info: void 0, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;\n else if (r instanceof Error) {\n const s = r;\n n = { componentName: void 0, body: void 0, info: void 0, locator: \"\", message: s.message, name: s.name, stack: s.stack }, r = s.cause;\n } else\n n = { componentName: void 0, body: void 0, info: void 0, locator: \"\", message: f(r), name: \"Error\", stack: void 0 }, r = void 0;\n /(?:\\.{3}|[.!?])$/.test(n.message) || (n.message += \".\"), t.push(n);\n }\n return t;\n}\nfunction f(e) {\n let o;\n try {\n o = JSON.stringify(e);\n } catch {\n typeof e == \"symbol\" ? o = e.description ?? \"Unknown error\" : typeof e == \"bigint\" ? o = e.toString() : o = \"Unknown error\";\n }\n return o === \"\" && (o = \"Unknown error\"), o;\n}\nfunction E(e) {\n if (!(e == null || e === \"\"))\n return e.length > 2048 ? `${e.slice(0, 2048)}... [truncated]` : e;\n}\nexport {\n g as APIError,\n a as ApplicationError,\n p as EngineError,\n c as FetchError,\n y as OperationalError,\n m as VueHandledError,\n h as WindowHandledPromiseRejectionError,\n w as WindowHandledRuntimeError,\n b as buildFetchError,\n k as concatenateSerialisedErrorMessages,\n x as ignoreErrors,\n l as normalizeToError,\n R as serialiseError\n};\n","const c = \"en-US\", s = /* @__PURE__ */ new Map();\nfunction f(e) {\n switch (e) {\n case \"Edm.Binary\":\n return \"unknown\";\n // Binary...\n case \"Edm.Boolean\":\n return \"boolean\";\n case \"Edm.Byte\":\n return \"wholeNumber\";\n case \"Edm.DateTime\":\n return \"moment\";\n // DateTime...\n case \"Edm.DateTimeOffset\":\n return \"moment\";\n // DateTimeOffset...\n case \"Edm.Decimal\":\n return \"decimalNumber\";\n case \"Edm.Double\":\n return \"decimalNumber\";\n case \"Edm.Guid\":\n return \"string\";\n case \"Edm.Int16\":\n return \"wholeNumber\";\n case \"Edm.Int32\":\n return \"wholeNumber\";\n case \"Edm.Int64\":\n return \"wholeNumber\";\n case \"Edm.SByte\":\n return \"wholeNumber\";\n case \"Edm.Single\":\n return \"decimalNumber\";\n case \"Edm.String\":\n return \"string\";\n case \"Edm.Time\":\n return \"momentTime\";\n // Time...\n default:\n return \"unknown\";\n }\n}\nfunction l(e) {\n if (e) {\n const t = e.lastIndexOf(\"/\"), n = e.lastIndexOf(\".\", t === -1 ? e.length : t);\n return n === -1 ? e : e.slice(0, Math.max(0, n));\n }\n}\nfunction m(e) {\n if (e) {\n const t = e.lastIndexOf(\".\");\n if (t !== -1) return e.slice(Math.max(0, t + 1));\n }\n}\nfunction r(e, t = 2, n = t, i = c) {\n if (e == null) return \"\";\n const u = `${i}decimal${t}.${n}`;\n let a = s.get(u);\n return a || (a = new Intl.NumberFormat(i, {\n localeMatcher: \"best fit\",\n maximumFractionDigits: t,\n minimumFractionDigits: n,\n minimumIntegerDigits: 1,\n style: \"decimal\",\n useGrouping: !0\n }), s.set(u, a)), a.format(e);\n}\nfunction d(e) {\n return e == null ? \"\" : e < 1e3 ? o(e) : e < 1e6 ? `${r(e / 1e3, 2, 0)}K` : e < 1e9 ? `${r(e / 1e6, 2, 0)}M` : e < 1e12 ? `${r(e / 1e9, 2, 0)}B` : `${r(e / 1e12, 2, 0)}T`;\n}\nfunction x(e) {\n return e == null ? \"\" : e === 1 ? \"1 byte\" : e < 1024 ? `${o(e)} bytes` : e < 1048576 ? `${r(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${r(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${r(e / 1073741824, 2, 0)} GB` : `${r(e / 1099511627776, 2, 0)} TB`;\n}\nfunction p(e) {\n return e == null ? \"\" : e < 1e3 ? `${o(e)} ms` : e === 1e3 ? `${o(e)} sec` : e < 6e4 ? `${r(e / 1e3, 2, 0)} secs` : e === 6e4 ? \"1 min\" : e < 36e5 ? `${r(e / 6e4, 2, 0)} mins` : e === 36e5 ? \"1 hr\" : e < 864e5 ? `${r(e / 36e5, 2, 0)} hrs` : e === 864e5 ? \"1 day\" : `${r(e / 864e5, 2, 0)} days`;\n}\nfunction o(e, t = c) {\n if (e == null) return \"\";\n const n = `${t}decimal0.0`;\n let i = s.get(n);\n return i || (i = new Intl.NumberFormat(t, {\n localeMatcher: \"best fit\",\n maximumFractionDigits: 0,\n minimumFractionDigits: 0,\n minimumIntegerDigits: 1,\n style: \"decimal\",\n useGrouping: !0\n }), s.set(n, i)), i.format(e);\n}\nfunction E(e) {\n switch (e) {\n case \"csv\":\n return \"text/csv\";\n case \"tab\":\n case \"tsv\":\n return \"text/tab-separated-values\";\n case \"xls\":\n return \"application/vnd.ms-excel\";\n case \"xlsx\":\n return \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\n default:\n return \"application/octet-stream\";\n }\n}\nexport {\n f as convertODataTypeIdToUsageTypeId,\n m as extractExtensionFromPath,\n l as extractNameFromPath,\n r as formatNumberAsDecimalNumber,\n p as formatNumberAsDuration,\n d as formatNumberAsSize,\n x as formatNumberAsStorageSize,\n o as formatNumberAsWholeNumber,\n E as lookupMimeTypeForExtension\n};\n","async function a(e, o) {\n const n = `datapos-tool-${o}`, t = e.find((r) => r.id === n);\n if (!t) throw new Error(`Connector could not load unknown tool '${o}'.`);\n const l = await import(`https://engine-eu.datapos.app/tools/${o}_v${t.version}/${n}.es.js`);\n return new l.Tool();\n}\nexport {\n a as loadTool\n};\n","const o = \"en-gb\", i = (e) => new Map(Object.entries(e)), s = (e, t, n = o) => {\n const r = e.get(t);\n if (r !== void 0) return r;\n if (n !== t)\n return e.get(n);\n};\nexport {\n o as DEFAULT_LOCALE_CODE,\n i as createLabelMap,\n s as resolveLabel\n};\n","import { createLabelMap as e } from \"./datapos-shared-locale.es.js\";\ne({ \"en-gb\": \"Data Positioning Events\" }), e({ \"en-gb\": \"Delimited Text\" }), e({ \"en-gb\": \"JSON\" }), e({ \"en-gb\": \"SPSS\" }), e({ \"en-gb\": \"XLSX\" }), e({ \"en-gb\": \"XML\" });\ne({ \"en-gb\": \"Newline\" }), e({ \"en-gb\": \"Carriage Return\" }), e({ \"en-gb\": \"Carriage Return/Newline\" });\ne({ \"en-gb\": \"Colon\" }), e({ \"en-gb\": \"Comma\" }), e({ \"en-gb\": \"Exclamation Mark\" }), e({ \"en-gb\": \"Record Separator\" }), e({ \"en-gb\": \"Semicolon\" }), e({ \"en-gb\": \"Space\" }), e({ \"en-gb\": \"Tab\" }), e({ \"en-gb\": \"Underscore\" }), e({ \"en-gb\": \"Unit Separator\" }), e({ \"en-gb\": \"Vertical Bar\" });\nconst a = [\",\", \";\", \"\t\", \"|\", \" \", \":\", \"_\", \"!\", \"0x1F\", \"0x1E\"];\nexport {\n a as ORDERED_VALUE_DELIMITER_IDS\n};\n","// Dependencies - Framework\nimport type * as RustModule from '../rust/datapos-connector-file-store-emulator-core/pkg/datapos_connector_file_store_emulator_core.js';\n\n// Interfaces/Types\ntype RustBindings = typeof RustModule;\n\n// Module Variables\nlet rustBindingsPromise: Promise<RustBindings> | undefined;\n\n// Utilities\nasync function addNumbersWithRust(left: number, right: number): Promise<number> {\n const { add_my_numbers } = await loadRustBindings();\n console.log(1111, left, right);\n const yyyy = add_my_numbers(Math.trunc(left), Math.trunc(right));\n console.log(2222, yyyy);\n return yyyy;\n}\n\n// Utilities\nasync function checksumWithRust(input: string): Promise<number> {\n const { checksum_from_rust } = await loadRustBindings();\n return checksum_from_rust(input);\n}\n\n// Helpers\nasync function loadRustBindings(): Promise<RustBindings> {\n rustBindingsPromise ??= import('../rust/datapos-connector-file-store-emulator-core/pkg/datapos_connector_file_store_emulator_core.js');\n return rustBindingsPromise;\n}\n\n// Exposures\nexport { addNumbersWithRust, checksumWithRust };\n","/**\n * File store emulator connector class.\n */\n\n/* TODO: Consider Cloudflare R2 Download URL: https://plugins-eu.datapositioning.app/connectors/datapos-connector-file-store-emulator-es.js.\n This would allow us to secure the bucket? */\n\n// Vendor dependencies.\nimport { nanoid } from 'nanoid';\n\n// Framework dependencies.\nimport type { Tool as CSVParseTool } from '@datapos/datapos-tool-csv-parse';\nimport type { EngineUtilities } from '@datapos/datapos-shared/engine';\nimport type { Tool as FileOperatorsTool } from '@datapos/datapos-tool-file-operators';\nimport { buildFetchError, normalizeToError, OperationalError } from '@datapos/datapos-shared/errors';\nimport type {\n ConnectionNodeConfig,\n ConnectorConfig,\n ConnectorInterface,\n FindObjectFolderPathOptions,\n GetReadableStreamOptions,\n ListNodesOptions,\n ListNodesResult,\n PreviewObjectOptions,\n RetrieveRecordsOptions,\n RetrieveRecordsSummary\n} from '@datapos/datapos-shared/component/connector';\nimport { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from '@datapos/datapos-shared/utilities';\nimport { loadTool, type ToolConfig } from '@datapos/datapos-shared/component/tool';\nimport { ORDERED_VALUE_DELIMITER_IDS, type ParsingRecord, type PreviewConfig } from '@datapos/datapos-shared/component/dataView';\n\n// Data dependencies.\nimport config from '~/config.json';\nimport fileStoreFolderPathData from '@/fileStoreFolderPaths.json';\n\nimport { addNumbersWithRust, checksumWithRust } from '@/rustBridge';\n\n/**\n * File store folder paths.\n */\ntype FileStoreFolderNode =\n | ({ typeId: 'folder'; childCount: number } & { name: string })\n | ({ typeId: 'object'; id: string; lastModifiedAt: number; size: number } & { name: string });\ntype FileStoreFolderPaths = Record<string, FileStoreFolderNode[]>;\n\n// Constants.\nconst URL_PREFIX = 'https://sample-data-eu.datapos.app';\n\n/**\n * File store emulator connector.\n */\nclass Connector implements ConnectorInterface {\n abortController: AbortController | undefined;\n readonly config: ConnectorConfig;\n engineUtilities: EngineUtilities;\n readonly toolConfigs;\n\n constructor(engineUtilities: EngineUtilities, toolConfigs: ToolConfig[]) {\n this.abortController = undefined;\n this.config = config as ConnectorConfig;\n this.engineUtilities = engineUtilities;\n this.toolConfigs = toolConfigs;\n }\n\n //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n //#region: Operations.\n //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n /**\n * Abort the currently running operation.\n */\n abortOperation(): void {\n if (!this.abortController) return;\n this.abortController.abort();\n this.abortController = undefined;\n }\n\n /**\n * Find the folder path containing the specified object node.\n */\n findObjectFolderPath(options: FindObjectFolderPathOptions): Promise<string | null> {\n const fileStoreFolderPaths = fileStoreFolderPathData as FileStoreFolderPaths;\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 // eslint-disable-next-line security/detect-object-injection\n const folderPathNodes = fileStoreFolderPaths[folderPath];\n const folderPathNode = folderPathNodes?.find((folderPathNode) => folderPathNode.typeId === 'object' && folderPathNode.id === options.nodeId);\n if (folderPathNode) return Promise.resolve(folderPath); // Found, return folder path.\n }\n }\n return Promise.resolve(null); // Not found.\n }\n\n /**\n * Get a readable stream for the specified object node path.\n */\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}/fileStore${options.path}`, { signal });\n if (!response.ok) {\n throw await buildFetchError(response, `Failed to fetch '${options.path}' file.`, 'datapos-connector-file-store-emulator|Connector|getReadableStream');\n }\n if (response.body == null) {\n throw new OperationalError('Readable streams are not supported in this runtime.', 'datapos-connector-file-store-emulator|Connector|getReadableStream.unsupported');\n }\n\n // TODO: Remove after testing.\n const xxx = await addNumbersWithRust(12, 56);\n const sum = await checksumWithRust(this.config.version);\n console.log('sum', sum, xxx);\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 /**\n * Lists all nodes (folders and objects) in the specified folder path.\n */\n listNodes(options: ListNodesOptions): Promise<ListNodesResult> {\n const fileStoreFolderPaths = fileStoreFolderPathData as FileStoreFolderPaths;\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 /**\n * Preview the contents of the object node with the specified path.\n */\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 identify type and decode text.\n const fileOperatorsTool = await loadTool<FileOperatorsTool>(this.toolConfigs, 'file-operators');\n const filePreviewConfig = await fileOperatorsTool.previewFile(`${URL_PREFIX}/fileStore${options.path}`, signal, options.chunkSize);\n if (filePreviewConfig.dataFormatId == null) throw new Error(`File '${options.path}' has unknown type.`);\n if (filePreviewConfig.text == null) throw new Error(`File '${options.path}' is empty.`);\n\n // Parse text to identify delimiters and transform to string value records.\n const csvParseTool = await loadTool<CSVParseTool>(this.toolConfigs, 'csv-parse');\n const parseTextConfig = await csvParseTool.parseText(filePreviewConfig.text, ORDERED_VALUE_DELIMITER_IDS);\n\n // // Infer values and initialise column configurations.\n // const columnConfigs: ObjectColumnConfig[] = [];\n // const inferenceRecords: InferenceRecord[] = [];\n // for (const parsingRecord of parsingRecords) {\n // const inferredValues = engineUtilities.inferValues(parsingRecord, columnConfigs);\n // inferenceRecords.push(inferredValues);\n // }\n\n // // Infer column labels.\n // // TODO: Only do this if headers detected.\n // let firstDataRowIndex = 0;\n // const headerRecord = inferenceRecords[0];\n // if (headerRecord) {\n // const headerValueCount = headerRecord.length;\n // for (let headerValueIndex = 0; headerValueIndex < headerValueCount; headerValueIndex++) {\n // // eslint-disable-next-line security/detect-object-injection\n // const headerValue = headerRecord[headerValueIndex]?.inferredValue;\n // const headerLabel = headerValue == undefined ? `Column ${headerValueIndex}` : String(headerValue); // TODO: Default not needed, set in 'inferValues'.\n // // eslint-disable-next-line security/detect-object-injection\n // const columnConfig = columnConfigs[headerValueIndex];\n // if (columnConfig == null) continue;\n // columnConfig.label = { en: headerLabel };\n // }\n // firstDataRowIndex = 1;\n // }\n\n // // Infer column characteristics.\n // for (let recordIndex = firstDataRowIndex; recordIndex < inferenceRecords.length; recordIndex++) {\n // // eslint-disable-next-line security/detect-object-injection\n // const inferenceRecord = inferenceRecords[recordIndex] ?? [];\n // for (let inferenceIndex = 0; inferenceIndex < inferenceRecord.length; inferenceIndex++) {\n // // eslint-disable-next-line security/detect-object-injection\n // const columnConfig = columnConfigs[inferenceIndex];\n // }\n // }\n\n return {\n asAt,\n columnConfigs: undefined, // schemaConfig.columnConfigs,\n dataFormatId: filePreviewConfig.dataFormatId,\n duration: performance.now() - startedAt,\n encodingId: filePreviewConfig.encodingId,\n encodingConfidenceLevel: filePreviewConfig.encodingConfidenceLevel,\n fileType: filePreviewConfig.fileTypeConfig,\n hasHeaders: false,\n recordDelimiterId: parseTextConfig.recordDelimiterId,\n parsingRecords: parseTextConfig.parsingRecords,\n inferenceRecords: undefined, // schemaConfig.inferenceRecords,\n size: filePreviewConfig.bytes.length,\n text: filePreviewConfig.text,\n valueDelimiterId: parseTextConfig.valueDelimiterId\n } as PreviewConfig;\n } catch (error) {\n throw normalizeToError(error);\n } finally {\n this.abortController = undefined;\n }\n }\n /**\n * Retrieves all records from a CSV object node using streaming and chunked processing.\n */\n async retrieveRecords(options: RetrieveRecordsOptions, chunk: (records: ParsingRecord[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void> {\n this.abortController = new AbortController();\n\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}/fileStore${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 //#endregion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n}\n\n//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n//#region: Helpers.\n//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n/**\n * Construct folder node configuration.\n */\nfunction constructFolderNodeConfig(folderPath: string, name: string, childCount: number): ConnectionNodeConfig {\n return { id: nanoid(), childCount, extension: undefined, folderPath, label: name, name, typeId: 'folder' };\n}\n\n/**\n * Construct object (file) node configuration.\n */\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 { id, extension, folderPath, label: fullName, lastModifiedAt: lastModifiedAtTimestamp, mimeType, name, size, typeId: 'object' };\n}\n\n//#endregion ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n// Exports.\nexport { Connector };\n"],"names":["urlAlphabet","nanoid","size","id","bytes","scopedUrlAlphabet","o","t","r","i","c","a","n","E","y","b","s","d","l","m","e","rustBindingsPromise","addNumbersWithRust","left","right","add_my_numbers","loadRustBindings","yyyy","checksumWithRust","input","checksum_from_rust","URL_PREFIX","Connector","engineUtilities","toolConfigs","config","options","fileStoreFolderPaths","fileStoreFolderPathData","folderPath","folderPathNode","signal","response","buildFetchError","OperationalError","xxx","sum","error","normalizeToError","folderNodes","connectionNodeConfigs","folderNode","constructFolderNodeConfig","constructObjectNodeConfig","asAt","startedAt","filePreviewConfig","loadTool","parseTextConfig","ORDERED_VALUE_DELIMITER_IDS","chunk","complete","csvParseTool","parseStreamOptions","url","summary","name","childCount","fullName","lastModifiedAt","extractNameFromPath","extension","extractExtensionFromPath","lastModifiedAtTimestamp","mimeType","lookupMimeTypeForExtension"],"mappings":"AAAO,MAAMA,IACX;ACoBK,IAAIC,IAAS,CAACC,IAAO,OAAO;AACjC,MAAIC,IAAK,IACLC,IAAQ,OAAO,gBAAgB,IAAI,WAAYF,KAAQ,CAAC,CAAE;AAC9D,SAAOA;AACL,IAAAC,KAAME,EAAkBD,EAAMF,CAAI,IAAI,EAAE;AAE1C,SAAOC;AACT,OC5BA,cAAgB,MAAM;AAAA,EACpB;AAAA;AAAA,EAEA,YAAYG,GAAGC,GAAGC,GAAG;AACnB,UAAMF,GAAGE,CAAC,GAAG,KAAK,OAAO,WAAW,MAAM,KAAK,UAAUD;AAAA,EAC3D;AACF,OACA,cAAgBE,EAAE;AAClB;AAKA,MAAMC,UAAUC,EAAE;AAAA,EAChB;AAAA;AAAA,EAEA,YAAYL,GAAGC,GAAGC,GAAGI,GAAG;AACtB,UAAMN,GAAGC,GAAGK,CAAC,GAAG,KAAK,OAAO,WAAW,MAAM,KAAK,OAAOC,EAAEL,KAAK,MAAM;AAAA,EACxE;AACF;AACA,MAAMM,UAAUL,EAAE;AAClB;AAcA,eAAeM,EAAE,GAAGT,GAAGC,GAAG;AACxB,QAAMC,IAAI,MAAM,EAAE,UAAU,IAAII,IAAI,GAAGN,CAAC,qBAAqB,E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