@dpuse/dpuse-connector-dropbox 0.2.474
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 +69 -0
- package/dist/dpuse-connector-dropbox.es.js +120 -0
- package/dist/dpuse-connector-dropbox.es.js.map +1 -0
- package/dist/types/src/index.d.ts +19 -0
- package/dist/types/vite.config.d.ts +5 -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,69 @@
|
|
|
1
|
+
# DPUse Dropbox Connector
|
|
2
|
+
|
|
3
|
+
[](./LICENSE)
|
|
4
|
+
<span><!-- OWASP_BADGES_START -->
|
|
5
|
+
[](https://dpuse.github.io/dpuse-connector-dropbox/dependency-check-reports/dependency-check-report.html)
|
|
6
|
+
<!-- OWASP_BADGES_END --></span>
|
|
7
|
+
|
|
8
|
+
A TypeScript library that implements the Dropbox connector. It provides easy access to a curated set of files for demonstration and evaluation purposes.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
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.
|
|
13
|
+
|
|
14
|
+
## Reports & Compliance
|
|
15
|
+
|
|
16
|
+
### Dependency Check Report
|
|
17
|
+
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
[View the OWASP Dependency Check Report](https://dpuse.github.io/dpuse-connector-dropbox/dependency-check-reports/dependency-check-report.html)
|
|
21
|
+
|
|
22
|
+
### Dependency Licenses
|
|
23
|
+
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
<!-- DEPENDENCY_LICENSES_START -->
|
|
27
|
+
|Name|Type|Installed|Latest|Latest Released|Deps|Document|
|
|
28
|
+
|:-|:-|:-:|:-:|:-|-:|:-|
|
|
29
|
+
|@dpuse/dpuse-shared|MIT|0.3.598|0.3.598|this month: 2026-03-28|0|[LICENSE](https://raw.githubusercontent.com/dpuse/dpuse-shared/main/LICENSE)|
|
|
30
|
+
|@dpuse/dpuse-tool-csv-parse|MIT|0.0.141|0.0.141|this month: 2026-03-28|2|[LICENSE](https://raw.githubusercontent.com/dpuse/dpuse-tool-csv-parse/main/LICENSE)|
|
|
31
|
+
|@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)|
|
|
32
|
+
|
|
33
|
+
<!-- DEPENDENCY_LICENSES_END -->
|
|
34
|
+
|
|
35
|
+
**Installed dependencies are kept up-to-date with latest releases.**
|
|
36
|
+
|
|
37
|
+
### Bundle Analysis Report
|
|
38
|
+
|
|
39
|
+
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`.
|
|
40
|
+
|
|
41
|
+
[View the Bundle Analysis Report](https://dpuse.github.io/dpuse-connector-dropbox/stats/index.html)
|
|
42
|
+
|
|
43
|
+
## Repository Management Commands
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
| Name | VSCode Shortcuts | Notes |
|
|
48
|
+
| -------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| audit | alt+ctrl+shift+a | Audit the project's dependencies for known security vulnerabilities. |
|
|
50
|
+
| build | alt+ctrl+shift+b | Type-check, compile and minify for production. Output in '/dist' directory. |
|
|
51
|
+
| build:rust | | Compile the Rust helper crate to WebAssembly via `wasm-pack`. Requires the `wasm-pack` CLI in your PATH. |
|
|
52
|
+
| buildConnectorConfig | | |
|
|
53
|
+
| bumpVersion | alt+ctrl+shift+v | |
|
|
54
|
+
| check | alt+ctrl+shift+c | List the dependencies in the project that are outdated. |
|
|
55
|
+
| document | alt+ctrl+shift+d | Identify the licenses of the project's dependencies. |
|
|
56
|
+
| format | alt+ctrl+shift+f | Enforce formatting style rules. |
|
|
57
|
+
| lint | alt+ctrl+shift+l | Check the code for potential errors and enforces coding styles. |
|
|
58
|
+
| publishToNPM | alt+ctrl+shift+p | ❌ Not implemented. |
|
|
59
|
+
| release | alt+ctrl+shift+r | Synchronise local repository with the main GitHub repository and upload connector to Data Positioning platform. |
|
|
60
|
+
| syncWithGitHub | alt+ctrl+shift+s | Synchronise local repository with the main GitHub repository. |
|
|
61
|
+
| updateDependencies | alt+ctrl+shift+l | Install the latest version of all Data Positioning dependencies. |
|
|
62
|
+
|
|
63
|
+
## Compliance
|
|
64
|
+
|
|
65
|
+
The following badge reflects FOSSA's assessment of this repository's open-source license compliance.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
[MIT](./LICENSE) © 2026 Data Positioning Pty Ltd
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-errors.es.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (e instanceof Error) return e;
|
|
4
|
+
if (typeof e == "string") return Error(e);
|
|
5
|
+
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return Error(String(e));
|
|
6
|
+
if (typeof e == "symbol") return Error(e.description ?? "Unknown error");
|
|
7
|
+
if (typeof e == "object") try {
|
|
8
|
+
return Error(JSON.stringify(e));
|
|
9
|
+
} catch {
|
|
10
|
+
return /* @__PURE__ */ Error("Unknown error");
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ Error("Unknown error");
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-tools.es.js
|
|
16
|
+
async function t(e, t) {
|
|
17
|
+
let n = `dpuse-tool-${t}`, r = e.find((e) => e.id === n);
|
|
18
|
+
if (!r) throw Error(`Connector could not load unknown tool '${t}'.`);
|
|
19
|
+
return new (await (import(`https://engine-eu.dpuse.app/tools/${t}_v${r.version}/${n}.es.js`))).Tool();
|
|
20
|
+
}
|
|
21
|
+
var n = {
|
|
22
|
+
id: "dpuse-connector-dropbox",
|
|
23
|
+
label: { en: "Dropbox" },
|
|
24
|
+
description: { en: "Dropbox is a cloud-based file storage solution. It provides for the storage and sharing of files, as well as synchronising them across multiple devices." },
|
|
25
|
+
category: null,
|
|
26
|
+
categoryId: "fileStore",
|
|
27
|
+
implementations: { default: {
|
|
28
|
+
authMethodId: "oAuth2",
|
|
29
|
+
maxConnectionCount: -1
|
|
30
|
+
} },
|
|
31
|
+
icon: "<svg fill=\"none\" viewBox=\"0 0 128 128\"><path fill=\"#0061FE\" d=\"M0 0h128v128H0z\"/><path fill=\"#F7F5F2\" d=\"M43.7 32 23.404 44.75 43.701 57.5 64 44.75 84.3 57.5l20.298-12.75L84.299 32 64.002 44.75 43.7 32Zm0 51L23.404 70.25 43.701 57.5 64 70.25 43.702 83Zm20.302-12.75L84.299 57.5l20.298 12.75L84.299 83 64.002 70.25Zm0 29.75L43.7 87.25 64 74.5l20.3 12.75L64.002 100Z\"/></svg>",
|
|
32
|
+
iconDark: "",
|
|
33
|
+
lastUpdatedAt: null,
|
|
34
|
+
operations: [
|
|
35
|
+
"abortOperation",
|
|
36
|
+
"authenticate",
|
|
37
|
+
"auditObjectContent",
|
|
38
|
+
"findObject",
|
|
39
|
+
"getReadableStream",
|
|
40
|
+
"listNodes",
|
|
41
|
+
"previewObject",
|
|
42
|
+
"retrieveRecords"
|
|
43
|
+
],
|
|
44
|
+
status: null,
|
|
45
|
+
statusId: "beta",
|
|
46
|
+
typeId: "connector",
|
|
47
|
+
usageId: "source",
|
|
48
|
+
vendorAccountURL: null,
|
|
49
|
+
vendorDocumentationURL: null,
|
|
50
|
+
vendorHomeURL: null,
|
|
51
|
+
version: "0.2.474"
|
|
52
|
+
}, r = "lo38r2co3ixibhn", i = "https://api.dpuse.app/authenticate", a = class {
|
|
53
|
+
abortController;
|
|
54
|
+
config;
|
|
55
|
+
engineUtilities;
|
|
56
|
+
toolConfigs;
|
|
57
|
+
constructor(e, t) {
|
|
58
|
+
this.abortController = void 0, this.config = n, this.engineUtilities = e, this.toolConfigs = t;
|
|
59
|
+
}
|
|
60
|
+
abortOperation() {
|
|
61
|
+
this.abortController &&= (this.abortController.abort(), void 0);
|
|
62
|
+
}
|
|
63
|
+
authenticate(e, t, n, a) {
|
|
64
|
+
let o = `https://www.dropbox.com/oauth2/authorize?client_id=${r}&force_reapprove=true&redirect_uri=${i}&response_type=code&state=dropbox|${t}|${e.id}&token_access_type=offline`, s = n - 700 / 2, c = a - 800 / 2, l = window.open(o, "DPUseAuthenticationWindow", `height=800,width=700,top=${c},left=${s}`);
|
|
65
|
+
if (l != null) return l.focus(), l;
|
|
66
|
+
}
|
|
67
|
+
async auditObjectContent(n, r) {
|
|
68
|
+
this.abortController = new AbortController();
|
|
69
|
+
try {
|
|
70
|
+
return await t(this.toolConfigs, "csv-parse"), n.valueDelimiterId, {
|
|
71
|
+
processedRowCount: 0,
|
|
72
|
+
durationMs: 0
|
|
73
|
+
};
|
|
74
|
+
} catch (t) {
|
|
75
|
+
throw e(t);
|
|
76
|
+
} finally {
|
|
77
|
+
this.abortController = void 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
findObject(e) {
|
|
81
|
+
return Promise.reject(/* @__PURE__ */ Error("Not found."));
|
|
82
|
+
}
|
|
83
|
+
async getReadableStream(t) {
|
|
84
|
+
let { signal: n } = this.abortController = new AbortController();
|
|
85
|
+
try {
|
|
86
|
+
return await Promise.resolve({});
|
|
87
|
+
} catch (t) {
|
|
88
|
+
throw e(t);
|
|
89
|
+
} finally {
|
|
90
|
+
this.abortController = void 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
listNodes(e) {
|
|
94
|
+
return Promise.resolve({});
|
|
95
|
+
}
|
|
96
|
+
async previewObject(n) {
|
|
97
|
+
let { signal: r } = this.abortController = new AbortController();
|
|
98
|
+
try {
|
|
99
|
+
return performance.now(), await t(this.toolConfigs, "file-operators"), await t(this.toolConfigs, "csv-parse"), {};
|
|
100
|
+
} catch (t) {
|
|
101
|
+
throw e(t);
|
|
102
|
+
} finally {
|
|
103
|
+
this.abortController = void 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async retrieveRecords(n, r, i) {
|
|
107
|
+
this.abortController = new AbortController();
|
|
108
|
+
try {
|
|
109
|
+
await t(this.toolConfigs, "csv-parse"), n.valueDelimiterId, i({});
|
|
110
|
+
} catch (t) {
|
|
111
|
+
throw e(t);
|
|
112
|
+
} finally {
|
|
113
|
+
this.abortController = void 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
export { a as Connector };
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=dpuse-connector-dropbox.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpuse-connector-dropbox.es.js","names":[],"sources":["../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-errors.es.js","../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-tools.es.js","../config.json","../src/index.ts"],"sourcesContent":["//#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/component/tool/index.ts\nasync function e(e, t) {\n\tlet n = `dpuse-tool-${t}`, r = e.find((e) => e.id === n);\n\tif (!r) throw Error(`Connector could not load unknown tool '${t}'.`);\n\treturn new (await (import(`https://engine-eu.dpuse.app/tools/${t}_v${r.version}/${n}.es.js`))).Tool();\n}\n//#endregion\nexport { e as loadTool };\n","{\n \"id\": \"dpuse-connector-dropbox\",\n \"label\": {\n \"en\": \"Dropbox\"\n },\n \"description\": {\n \"en\": \"Dropbox is a cloud-based file storage solution. It provides for the storage and sharing of files, as well as synchronising them across multiple devices.\"\n },\n \"category\": null,\n \"categoryId\": \"fileStore\",\n \"implementations\": {\n \"default\": {\n \"authMethodId\": \"oAuth2\",\n \"maxConnectionCount\": -1\n }\n },\n \"icon\": \"<svg fill=\\\"none\\\" viewBox=\\\"0 0 128 128\\\"><path fill=\\\"#0061FE\\\" d=\\\"M0 0h128v128H0z\\\"/><path fill=\\\"#F7F5F2\\\" d=\\\"M43.7 32 23.404 44.75 43.701 57.5 64 44.75 84.3 57.5l20.298-12.75L84.299 32 64.002 44.75 43.7 32Zm0 51L23.404 70.25 43.701 57.5 64 70.25 43.702 83Zm20.302-12.75L84.299 57.5l20.298 12.75L84.299 83 64.002 70.25Zm0 29.75L43.7 87.25 64 74.5l20.3 12.75L64.002 100Z\\\"/></svg>\",\n \"iconDark\": \"\",\n \"lastUpdatedAt\": null,\n \"operations\": [\n \"abortOperation\",\n \"authenticate\",\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.2.474\"\n}","// External dependencies\n\n// DPU framework\nimport type { EngineUtilities } from '@dpuse/dpuse-shared/engine';\nimport { normalizeToError } from '@dpuse/dpuse-shared/errors';\nimport type {\n AuditObjectContentOptions,\n AuditObjectContentResult,\n ConnectionConfig,\n ConnectorConfig,\n ConnectorInterface,\n FindObjectOptions,\n FindObjectResult,\n GetReadableStreamOptions,\n ListNodesOptions,\n ListNodesResult,\n PreviewObjectOptions,\n RetrievalTypeId,\n RetrieveRecordsOptions,\n RetrieveRecordsSummary\n} from '@dpuse/dpuse-shared/component/connector';\nimport { loadTool, type ToolConfig } from '@dpuse/dpuse-shared/component/tool';\nimport type { ParsingRecord, PreviewConfig } from '@dpuse/dpuse-shared/component/dataView';\n\n// DPU tools\nimport type { Tool as CSVParseTool } from '@dpuse/dpuse-tool-csv-parse';\nimport type { Tool as FileOperatorsTool } from '@dpuse/dpuse-tool-file-operators';\n\n// Data\nimport config from '~/config.json';\n\n// Constants\nconst AUTHORISE_URL = 'https://www.dropbox.com/oauth2/authorize';\nconst CLIENT_ID = 'lo38r2co3ixibhn';\nconst REDIRECT_URI = 'https://api.dpuse.app/authenticate';\n\n// Connectors\nexport class 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 // 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 // Authenticate a connection.\n authenticate(connectionConfig: ConnectionConfig, accountId: string, windowCenterX: number, windowCenterY: number): Window | undefined {\n const url =\n AUTHORISE_URL +\n `?client_id=${CLIENT_ID}` +\n '&force_reapprove=true' +\n `&redirect_uri=${REDIRECT_URI}` +\n '&response_type=code' +\n `&state=dropbox|${accountId}|${connectionConfig.id}` +\n '&token_access_type=offline';\n const popupHeight = 800;\n const popupWidth = 700;\n const popupLeft = windowCenterX - popupWidth / 2;\n const popupTop = windowCenterY - popupHeight / 2;\n const popup = window.open(url, 'DPUseAuthenticationWindow', `height=${popupHeight},width=${popupWidth},top=${popupTop},left=${popupLeft}`);\n if (popup == null) return undefined;\n popup.focus();\n return popup;\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 const csvParseTool = await loadTool<CSVParseTool>(this.toolConfigs, 'csv-parse');\n const parseStreamOptions = { delimiter: options.valueDelimiterId, relax_column_count: true, relax_quotes: true };\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 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 return await Promise.resolve({} as ReadableStream<Uint8Array>);\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 return Promise.resolve({} as ListNodesResult);\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\n // Parse text, identify delimiters, and produce string value records.\n const csvParseTool = await loadTool<CSVParseTool>(this.toolConfigs, 'csv-parse');\n\n return {} as PreviewConfig;\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 complete({} as RetrieveRecordsSummary);\n } catch (error) {\n throw normalizeToError(error);\n } finally {\n this.abortController = undefined;\n }\n }\n}\n"],"x_google_ignoreList":[0,1],"mappings":";AA6CA,SAAS,EAAE,GAAG;AACb,KAAI,aAAa,MAAO,QAAO;AAC/B,KAAI,OAAO,KAAK,SAAU,QAAO,MAAM,EAAE;AACzC,KAAI,OAAO,KAAK,YAAY,OAAO,KAAK,aAAa,OAAO,KAAK,SAAU,QAAO,MAAM,OAAO,EAAE,CAAC;AAClG,KAAI,OAAO,KAAK,SAAU,QAAO,MAAM,EAAE,eAAe,gBAAgB;AACxE,KAAI,OAAO,KAAK,SAAU,KAAI;AAC7B,SAAO,MAAM,KAAK,UAAU,EAAE,CAAC;SACxB;AACP,SAAuB,sBAAM,gBAAgB;;AAE9C,QAAuB,sBAAM,gBAAgB;;;;ACtD9C,eAAe,EAAE,GAAG,GAAG;CACtB,IAAI,IAAI,cAAc,KAAK,IAAI,EAAE,MAAM,MAAM,EAAE,OAAO,EAAE;AACxD,KAAI,CAAC,EAAG,OAAM,MAAM,0CAA0C,EAAE,IAAI;AACpE,QAAO,KAAK,OAAO,OAAO,qCAAqC,EAAE,IAAI,EAAE,QAAQ,GAAG,EAAE,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GE6BhG,IAAY,mBACZ,IAAe,sCAGR,IAAb,MAAqD;CACjD;CACA;CACA;CACA;CAEA,YAAY,GAAkC,GAA2B;AAIrE,EAHA,KAAK,kBAAkB,KAAA,GACvB,KAAK,SAAS,GACd,KAAK,kBAAkB,GACvB,KAAK,cAAc;;CAMvB,iBAAuB;AACd,EAEL,KAAK,qBADL,KAAK,gBAAgB,OAAO,EACL,KAAA;;CAI3B,aAAa,GAAoC,GAAmB,GAAuB,GAA2C;EAClI,IAAM,IACF,sDACc,EAAA,qCAEG,EAAA,oCAEC,EAAU,GAAG,EAAiB,GAAA,6BAI9C,IAAY,IAAgB,MAAa,GACzC,IAAW,IAAgB,MAAc,GACzC,IAAQ,OAAO,KAAK,GAAK,6BAA6B,4BAAiD,EAAS,QAAQ,IAAY;AACtI,WAAS,KAEb,QADA,EAAM,OAAO,EACN;;CAIX,MAAM,mBAAmB,GAAoC,GAAsE;AAC/H,OAAK,kBAAkB,IAAI,iBAAiB;AAE5C,MAAI;AAGA,UAFqB,MAAM,EAAuB,KAAK,aAAa,YAAY,EACxC,EAAQ,kBACzC;IAAE,mBAAmB;IAAG,YAAY;IAAG;WACzC,GAAO;AACZ,SAAM,EAAiB,EAAM;YACvB;AACN,QAAK,kBAAkB,KAAA;;;CAK/B,WAAW,GAAuD;AAC9D,SAAO,QAAQ,OAAO,gBAAI,MAAM,aAAa,CAAC;;CAIlD,MAAM,kBAAkB,GAAwE;EAE5F,IAAM,EAAE,cAAY,KAAK,kBAAkB,IAAI,iBAAiB;AAEhE,MAAI;AACA,UAAO,MAAM,QAAQ,QAAQ,EAAE,CAA+B;WACzD,GAAO;AACZ,SAAM,EAAiB,EAAM;YACvB;AACN,QAAK,kBAAkB,KAAA;;;CAK/B,UAAU,GAAqD;AAC3D,SAAO,QAAQ,QAAQ,EAAE,CAAoB;;CAIjD,MAAM,cAAc,GAAuD;EAEvE,IAAM,EAAE,cAAY,KAAK,kBAAkB,IAAI,iBAAiB;AAEhE,MAAI;AAUA,UARkB,YAAY,KAAK,EAGT,MAAM,EAA4B,KAAK,aAAa,iBAAiB,EAG1E,MAAM,EAAuB,KAAK,aAAa,YAAY,EAEzE,EAAE;WACJ,GAAO;AACZ,SAAM,EAAiB,EAAM;YACvB;AACN,QAAK,kBAAkB,KAAA;;;CAI/B,MAAM,gBACF,GACA,GACA,GACa;AACb,OAAK,kBAAkB,IAAI,iBAAiB;AAC5C,MAAI;AAGA,GAFqB,MAAM,EAAuB,KAAK,aAAa,YAAY,EACxC,EAAQ,kBAChD,EAAS,EAAE,CAA2B;WACjC,GAAO;AACZ,SAAM,EAAiB,EAAM;YACvB;AACN,QAAK,kBAAkB,KAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EngineUtilities } from '@dpuse/dpuse-shared/engine';
|
|
2
|
+
import { AuditObjectContentOptions, AuditObjectContentResult, ConnectionConfig, ConnectorConfig, ConnectorInterface, FindObjectOptions, FindObjectResult, GetReadableStreamOptions, ListNodesOptions, ListNodesResult, PreviewObjectOptions, RetrievalTypeId, RetrieveRecordsOptions, RetrieveRecordsSummary } from '@dpuse/dpuse-shared/component/connector';
|
|
3
|
+
import { ToolConfig } from '@dpuse/dpuse-shared/component/tool';
|
|
4
|
+
import { ParsingRecord, PreviewConfig } from '@dpuse/dpuse-shared/component/dataView';
|
|
5
|
+
export declare class Connector implements ConnectorInterface {
|
|
6
|
+
abortController: AbortController | undefined;
|
|
7
|
+
readonly config: ConnectorConfig;
|
|
8
|
+
engineUtilities: EngineUtilities;
|
|
9
|
+
readonly toolConfigs: ToolConfig[];
|
|
10
|
+
constructor(engineUtilities: EngineUtilities, toolConfigs: ToolConfig[]);
|
|
11
|
+
abortOperation(): void;
|
|
12
|
+
authenticate(connectionConfig: ConnectionConfig, accountId: string, windowCenterX: number, windowCenterY: number): Window | undefined;
|
|
13
|
+
auditObjectContent(options: AuditObjectContentOptions, chunk: (rowCount: number) => void): Promise<AuditObjectContentResult>;
|
|
14
|
+
findObject(options: FindObjectOptions): Promise<FindObjectResult>;
|
|
15
|
+
getReadableStream(options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>>;
|
|
16
|
+
listNodes(options: ListNodesOptions): Promise<ListNodesResult>;
|
|
17
|
+
previewObject(options: PreviewObjectOptions): Promise<PreviewConfig>;
|
|
18
|
+
retrieveRecords(options: RetrieveRecordsOptions, chunk: (typeId: RetrievalTypeId, records: ParsingRecord[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
19
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dpuse/dpuse-connector-dropbox",
|
|
3
|
+
"version": "0.2.474",
|
|
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-dropbox.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/dpuse/dpuse-connector-dropbox/issues"
|
|
15
|
+
},
|
|
16
|
+
"module": "./dist/dpuse-connector-dropbox.es.js",
|
|
17
|
+
"types": "./dist/types/src/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/dpuse-connector-dropbox.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.598",
|
|
30
|
+
"@dpuse/dpuse-tool-csv-parse": "^0.0.141",
|
|
31
|
+
"@dpuse/dpuse-tool-file-operators": "^0.0.17",
|
|
32
|
+
"p-queue": "^9.1.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@dpuse/dpuse-development": "^0.3.487",
|
|
36
|
+
"@dpuse/eslint-config-dpuse": "^1.0.55",
|
|
37
|
+
"@types/node": "^25.5.0",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.57.2",
|
|
39
|
+
"@typescript-eslint/parser": "^8.57.2",
|
|
40
|
+
"eslint": "^9.39.2",
|
|
41
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
42
|
+
"eslint-plugin-import": "^2.32.0",
|
|
43
|
+
"eslint-plugin-security": "^4.0.0",
|
|
44
|
+
"eslint-plugin-sonarjs": "^4.0.2",
|
|
45
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
46
|
+
"jiti": "^2.6.1",
|
|
47
|
+
"license-downloader": "^1.3.3",
|
|
48
|
+
"license-report": "^6.8.2",
|
|
49
|
+
"license-report-check": "^0.1.2",
|
|
50
|
+
"license-report-recursive": "^6.8.3",
|
|
51
|
+
"npm-check-updates": "^19.6.6",
|
|
52
|
+
"owasp-dependency-check": "^1.0.1",
|
|
53
|
+
"prettier": "^3.8.1",
|
|
54
|
+
"rollup-plugin-visualizer": "^7.0.1",
|
|
55
|
+
"sonda": "^0.11.1",
|
|
56
|
+
"typescript": "^5.9.3",
|
|
57
|
+
"vite": "^8.0.3",
|
|
58
|
+
"vite-plugin-dts": "^4.5.4",
|
|
59
|
+
"vite-plugin-wasm": "^3.6.0",
|
|
60
|
+
"vitest": "^4.1.2"
|
|
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
|
+
}
|