@divyacon/piece-dropbox 0.0.0-stage → 0.1.0
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.MIT-AP +24 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actions/copy-file.d.ts +7 -0
- package/dist/lib/actions/copy-file.d.ts.map +1 -0
- package/dist/lib/actions/copy-file.js +65 -0
- package/dist/lib/actions/copy-file.js.map +1 -0
- package/dist/lib/actions/copy-folder.d.ts +7 -0
- package/dist/lib/actions/copy-folder.d.ts.map +1 -0
- package/dist/lib/actions/copy-folder.js +65 -0
- package/dist/lib/actions/copy-folder.js.map +1 -0
- package/dist/lib/actions/create-new-folder.d.ts +5 -0
- package/dist/lib/actions/create-new-folder.d.ts.map +1 -0
- package/dist/lib/actions/create-new-folder.js +54 -0
- package/dist/lib/actions/create-new-folder.js.map +1 -0
- package/dist/lib/actions/create-new-text-file.d.ts +8 -0
- package/dist/lib/actions/create-new-text-file.d.ts.map +1 -0
- package/dist/lib/actions/create-new-text-file.js +76 -0
- package/dist/lib/actions/create-new-text-file.js.map +1 -0
- package/dist/lib/actions/delete-file.d.ts +4 -0
- package/dist/lib/actions/delete-file.d.ts.map +1 -0
- package/dist/lib/actions/delete-file.js +45 -0
- package/dist/lib/actions/delete-file.js.map +1 -0
- package/dist/lib/actions/delete-folder.d.ts +4 -0
- package/dist/lib/actions/delete-folder.d.ts.map +1 -0
- package/dist/lib/actions/delete-folder.js +45 -0
- package/dist/lib/actions/delete-folder.js.map +1 -0
- package/dist/lib/actions/download-file.d.ts +4 -0
- package/dist/lib/actions/download-file.d.ts.map +1 -0
- package/dist/lib/actions/download-file.js +53 -0
- package/dist/lib/actions/download-file.js.map +1 -0
- package/dist/lib/actions/get-file-link.d.ts +4 -0
- package/dist/lib/actions/get-file-link.d.ts.map +1 -0
- package/dist/lib/actions/get-file-link.js +45 -0
- package/dist/lib/actions/get-file-link.js.map +1 -0
- package/dist/lib/actions/list-a-folder.d.ts +6 -0
- package/dist/lib/actions/list-a-folder.d.ts.map +1 -0
- package/dist/lib/actions/list-a-folder.js +58 -0
- package/dist/lib/actions/list-a-folder.js.map +1 -0
- package/dist/lib/actions/move-file.d.ts +7 -0
- package/dist/lib/actions/move-file.d.ts.map +1 -0
- package/dist/lib/actions/move-file.js +65 -0
- package/dist/lib/actions/move-file.js.map +1 -0
- package/dist/lib/actions/move-folder.d.ts +7 -0
- package/dist/lib/actions/move-folder.d.ts.map +1 -0
- package/dist/lib/actions/move-folder.js +65 -0
- package/dist/lib/actions/move-folder.js.map +1 -0
- package/dist/lib/actions/search.d.ts +12 -0
- package/dist/lib/actions/search.d.ts.map +1 -0
- package/dist/lib/actions/search.js +114 -0
- package/dist/lib/actions/search.js.map +1 -0
- package/dist/lib/actions/upload-file.d.ts +8 -0
- package/dist/lib/actions/upload-file.d.ts.map +1 -0
- package/dist/lib/actions/upload-file.js +75 -0
- package/dist/lib/actions/upload-file.js.map +1 -0
- package/dist/lib/auth.d.ts +2 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +21 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/triggers/new-folder.d.ts +15 -0
- package/dist/lib/triggers/new-folder.d.ts.map +1 -0
- package/dist/lib/triggers/new-folder.js +114 -0
- package/dist/lib/triggers/new-folder.js.map +1 -0
- package/package.json +43 -3
- package/src/index.ts +59 -0
- package/src/lib/actions/copy-file.ts +66 -0
- package/src/lib/actions/copy-folder.ts +66 -0
- package/src/lib/actions/create-new-folder.ts +54 -0
- package/src/lib/actions/create-new-text-file.ts +78 -0
- package/src/lib/actions/delete-file.ts +44 -0
- package/src/lib/actions/delete-folder.ts +43 -0
- package/src/lib/actions/download-file.ts +51 -0
- package/src/lib/actions/get-file-link.ts +43 -0
- package/src/lib/actions/list-a-folder.ts +59 -0
- package/src/lib/actions/move-file.ts +65 -0
- package/src/lib/actions/move-folder.ts +67 -0
- package/src/lib/actions/search.ts +117 -0
- package/src/lib/actions/upload-file.ts +79 -0
- package/src/lib/auth.ts +16 -0
- package/src/lib/triggers/new-folder.ts +167 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-file.js","sourceRoot":"","sources":["../../../src/lib/actions/download-file.ts"],"names":[],"mappings":";;;;AAAA,uGAAuG;AACvG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,8BAA8B;IAC3C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,+OAA+O,EAAE,UAAU,EAAE,IAAI,EAAE;IAC9R,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,2DAA2D;YAC3D,MAAM,QAAQ,GAAG,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,mCAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAE9E,8GAA8G;YAC/G,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,EAAC,IAAI,EAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,GAAC,CAAC,KAAK,GAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAE9J,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,iDAAiD;gBACtD,OAAO,EAAE;oBACP,cAAc,EAAE,0BAA0B;oBAC1C,iBAAiB,EAAE,aAAa;iBACjC;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;gBACD,YAAY,EAAC,aAAa;aAC3B,CAAC,CAAC;YAEH,OAAO;gBACL,IAAI,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;oBAC9B,QAAQ,EAAE,QAAQ;oBAClB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;iBAC/B,CAAC;aACH,CAAA;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const dropboxGetFileLink: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
2
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
}>;
|
|
4
|
+
//# sourceMappingURL=get-file-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-link.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/get-file-link.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB;;EAkC7B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dropboxGetFileLink = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/get-file-link.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
exports.dropboxGetFileLink = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.dropboxAuth,
|
|
12
|
+
name: 'get_dropbox_file_link',
|
|
13
|
+
description: 'Get a temporary file link',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: { description: 'Returns a temporary, directly downloadable URL for the file at the given Dropbox path. Use when an agent needs a shareable or fetchable link to file contents rather than downloading the bytes into the flow. Read-only lookup; safe to repeat, though the returned URL is short-lived.', idempotent: true },
|
|
16
|
+
displayName: 'Get temporary file link',
|
|
17
|
+
props: {
|
|
18
|
+
path: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'Path',
|
|
20
|
+
description: 'The path of the file (e.g. /folder1/file.txt)',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
run(context) {
|
|
25
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const params = {
|
|
27
|
+
path: context.propsValue.path,
|
|
28
|
+
};
|
|
29
|
+
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
30
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
31
|
+
url: `https://api.dropboxapi.com/2/files/get_temporary_link`,
|
|
32
|
+
headers: {
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
},
|
|
35
|
+
body: { path: context.propsValue.path },
|
|
36
|
+
authentication: {
|
|
37
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
38
|
+
token: context.auth.access_token,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
return result.body;
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=get-file-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-link.js","sourceRoot":"","sources":["../../../src/lib/actions/get-file-link.ts"],"names":[],"mappings":";;;;AAAA,uGAAuG;AACvG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,2BAA2B;IACxC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,0RAA0R,EAAE,UAAU,EAAE,IAAI,EAAE;IACzU,WAAW,EAAE,yBAAyB;IACtC,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG;gBACb,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;aAC9B,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,uDAAuD;gBAC5D,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE;gBACvC,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const dropboxListAFolder: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
2
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
recursive: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
4
|
+
limit: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=list-a-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-a-folder.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/list-a-folder.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB;;;;EAkD7B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dropboxListAFolder = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/list-a-folder.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
exports.dropboxListAFolder = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.dropboxAuth,
|
|
12
|
+
name: 'list_dropbox_folder',
|
|
13
|
+
description: 'List the contents of a folder',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: { description: 'Lists the files and subfolders within the given Dropbox folder path (use an empty string for the root), optionally recursing into all subfolders. Use to enumerate folder contents and discover item paths/IDs. Read-only; safe to repeat and returns the same listing for unchanged folders.', idempotent: true },
|
|
16
|
+
displayName: 'List a folder',
|
|
17
|
+
props: {
|
|
18
|
+
path: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'Path',
|
|
20
|
+
description: 'The path of the folder to be listed (e.g. /folder1). Use an empty string for the root folder.',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
recursive: pieces_framework_1.Property.Checkbox({
|
|
24
|
+
displayName: 'Recursive',
|
|
25
|
+
description: 'If set to true, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.',
|
|
26
|
+
defaultValue: false,
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
29
|
+
limit: pieces_framework_1.Property.Number({
|
|
30
|
+
displayName: 'Limit',
|
|
31
|
+
description: 'The maximum number of results to return (between 1 and 2000). Default is 2000 if not specified.',
|
|
32
|
+
required: false,
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
run(context) {
|
|
36
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const params = {
|
|
38
|
+
path: context.propsValue.path,
|
|
39
|
+
recursive: context.propsValue.recursive,
|
|
40
|
+
limit: context.propsValue.limit || 2000,
|
|
41
|
+
};
|
|
42
|
+
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
43
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
44
|
+
url: `https://api.dropboxapi.com/2/files/list_folder`,
|
|
45
|
+
headers: {
|
|
46
|
+
'Content-Type': 'application/json',
|
|
47
|
+
},
|
|
48
|
+
body: params,
|
|
49
|
+
authentication: {
|
|
50
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
51
|
+
token: context.auth.access_token,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
return result.body;
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=list-a-folder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-a-folder.js","sourceRoot":"","sources":["../../../src/lib/actions/list-a-folder.ts"],"names":[],"mappings":";;;;AAAA,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YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const dropboxMoveFile: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
2
|
+
from_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
to_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
autorename: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
5
|
+
allow_ownership_transfer: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=move-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-file.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/move-file.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe;;;;;EAwD1B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dropboxMoveFile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/move-file.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
exports.dropboxMoveFile = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.dropboxAuth,
|
|
12
|
+
name: 'move_dropbox_file',
|
|
13
|
+
description: 'Move a file',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: { description: 'Moves (or renames) the file at the source path to a new destination path within Dropbox; optionally autorenames on conflict. Use to relocate or rename a single file. Not idempotent: after a successful move the source no longer exists, so repeating the call fails or, with autorename, can produce a differently named copy.', idempotent: false },
|
|
16
|
+
displayName: 'Move file',
|
|
17
|
+
props: {
|
|
18
|
+
from_path: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'From Path',
|
|
20
|
+
description: 'The current path of the file (e.g. /folder1/oldfile.txt)',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
to_path: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'To Path',
|
|
25
|
+
description: 'The new path for the file (e.g. /folder2/newfile.txt)',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
autorename: pieces_framework_1.Property.Checkbox({
|
|
29
|
+
displayName: 'Auto Rename',
|
|
30
|
+
description: "If there's a conflict, have the Dropbox server try to autorename the file to avoid conflict.",
|
|
31
|
+
defaultValue: false,
|
|
32
|
+
required: false,
|
|
33
|
+
}),
|
|
34
|
+
allow_ownership_transfer: pieces_framework_1.Property.Checkbox({
|
|
35
|
+
displayName: 'Allow Ownership Transfer',
|
|
36
|
+
description: 'Allows moves by owner even if it would result in an ownership transfer.',
|
|
37
|
+
defaultValue: false,
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
run(context) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const params = {
|
|
44
|
+
from_path: context.propsValue.from_path,
|
|
45
|
+
to_path: context.propsValue.to_path,
|
|
46
|
+
autorename: context.propsValue.autorename,
|
|
47
|
+
allow_ownership_transfer: context.propsValue.allow_ownership_transfer,
|
|
48
|
+
};
|
|
49
|
+
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
50
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
51
|
+
url: `https://api.dropboxapi.com/2/files/move_v2`,
|
|
52
|
+
headers: {
|
|
53
|
+
'Content-Type': 'application/json',
|
|
54
|
+
},
|
|
55
|
+
body: params,
|
|
56
|
+
authentication: {
|
|
57
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
58
|
+
token: context.auth.access_token,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
return result.body;
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=move-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-file.js","sourceRoot":"","sources":["../../../src/lib/actions/move-file.ts"],"names":[],"mappings":";;;;AAAA,mGAAmG;AACnG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,mUAAmU,EAAE,UAAU,EAAE,KAAK,EAAE;IACnX,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,8FAA8F;YAChG,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,wBAAwB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1C,WAAW,EAAE,0BAA0B;YACvC,WAAW,EACT,yEAAyE;YAC3E,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG;gBACb,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBACvC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACnC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;gBACzC,wBAAwB,EAAE,OAAO,CAAC,UAAU,CAAC,wBAAwB;aACtE,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,4CAA4C;gBACjD,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const dropboxMoveFolder: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
2
|
+
from_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
to_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
autorename: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
5
|
+
allow_ownership_transfer: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=move-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-folder.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/move-folder.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB;;;;;EA0D5B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dropboxMoveFolder = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/move-folder.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
exports.dropboxMoveFolder = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.dropboxAuth,
|
|
12
|
+
name: 'move_dropbox_folder',
|
|
13
|
+
description: 'Move a folder',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: { description: 'Moves (or renames) the folder at the source path, including its contents, to a new destination path within Dropbox; optionally autorenames on conflict. Use to relocate or rename an entire directory. Not idempotent: after a successful move the source no longer exists, so repeating the call fails or, with autorename, produces a differently named folder.', idempotent: false },
|
|
16
|
+
displayName: 'Move folder',
|
|
17
|
+
props: {
|
|
18
|
+
from_path: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'From Path',
|
|
20
|
+
description: 'The current path of the folder (e.g. /folder1/sourceFolder)',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
to_path: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'To Path',
|
|
25
|
+
description: 'The new path for the folder (e.g. /folder2/destinationFolder)',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
autorename: pieces_framework_1.Property.Checkbox({
|
|
29
|
+
displayName: 'Auto Rename',
|
|
30
|
+
description: "If there's a conflict, have the Dropbox server try to autorename the folder to avoid conflict.",
|
|
31
|
+
defaultValue: false,
|
|
32
|
+
required: false,
|
|
33
|
+
}),
|
|
34
|
+
allow_ownership_transfer: pieces_framework_1.Property.Checkbox({
|
|
35
|
+
displayName: 'Allow Ownership Transfer',
|
|
36
|
+
description: 'Allows moves by owner even if it would result in an ownership transfer.',
|
|
37
|
+
defaultValue: false,
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
run(context) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const params = {
|
|
44
|
+
from_path: context.propsValue.from_path,
|
|
45
|
+
to_path: context.propsValue.to_path,
|
|
46
|
+
autorename: context.propsValue.autorename,
|
|
47
|
+
allow_ownership_transfer: context.propsValue.allow_ownership_transfer,
|
|
48
|
+
};
|
|
49
|
+
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
50
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
51
|
+
url: `https://api.dropboxapi.com/2/files/move_v2`,
|
|
52
|
+
headers: {
|
|
53
|
+
'Content-Type': 'application/json',
|
|
54
|
+
},
|
|
55
|
+
body: params,
|
|
56
|
+
authentication: {
|
|
57
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
58
|
+
token: context.auth.access_token,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
return result.body;
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=move-folder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-folder.js","sourceRoot":"","sources":["../../../src/lib/actions/move-folder.ts"],"names":[],"mappings":";;;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW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EAAE,MAAM;gBACZ,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const dropboxSearch: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
2
|
+
query: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
max_results: import("@agnocon/pieces-framework").NumberProperty<false>;
|
|
5
|
+
order_by: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
|
+
file_status: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
7
|
+
filename_only: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
8
|
+
file_extensions: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
file_categories: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
account_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/search.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa;;;;;;;;;;EA4GxB,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dropboxSearch = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/search.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
exports.dropboxSearch = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.dropboxAuth,
|
|
12
|
+
name: 'search_dropbox',
|
|
13
|
+
description: 'Search for files and folders',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: { description: 'Searches a Dropbox account for files and folders whose name or content matches a query string (minimum 3 characters), optionally scoped to a path and filtered by file status, extensions, categories, or account. Use to locate items and obtain their paths/IDs before acting on them. Read-only; repeating the same search is safe and returns the same matches.', idempotent: true },
|
|
16
|
+
displayName: 'Search',
|
|
17
|
+
props: {
|
|
18
|
+
query: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'Query',
|
|
20
|
+
description: 'The search string. Must be at least 3 characters.',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
path: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'Path',
|
|
25
|
+
description: 'The path to search in. If not specified, the search is performed from the root.',
|
|
26
|
+
required: false,
|
|
27
|
+
}),
|
|
28
|
+
max_results: pieces_framework_1.Property.Number({
|
|
29
|
+
displayName: 'Max Results',
|
|
30
|
+
description: 'The maximum number of search results to return (up to 1000). Default is 100 if not specified.',
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
order_by: pieces_framework_1.Property.StaticDropdown({
|
|
34
|
+
displayName: 'Order By',
|
|
35
|
+
description: 'Specified property of the order of search results.',
|
|
36
|
+
options: {
|
|
37
|
+
options: [
|
|
38
|
+
{ label: 'Relevance', value: 'relevance' },
|
|
39
|
+
{ label: 'Modified Time', value: 'modified_time' },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
defaultValue: 'relevance',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
file_status: pieces_framework_1.Property.StaticDropdown({
|
|
46
|
+
displayName: 'File Status',
|
|
47
|
+
description: 'Restricts search to the given file status.',
|
|
48
|
+
options: {
|
|
49
|
+
options: [
|
|
50
|
+
{ label: 'Active', value: 'active' },
|
|
51
|
+
{ label: 'Deleted', value: 'deleted' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
defaultValue: 'active',
|
|
55
|
+
required: false,
|
|
56
|
+
}),
|
|
57
|
+
filename_only: pieces_framework_1.Property.Checkbox({
|
|
58
|
+
displayName: 'Filename Only',
|
|
59
|
+
description: 'Restricts search to only match on filenames.',
|
|
60
|
+
defaultValue: false,
|
|
61
|
+
required: false,
|
|
62
|
+
}),
|
|
63
|
+
file_extensions: pieces_framework_1.Property.ShortText({
|
|
64
|
+
displayName: 'File Extensions',
|
|
65
|
+
description: 'Restricts search to only the extensions specified (comma-separated).',
|
|
66
|
+
required: false,
|
|
67
|
+
}),
|
|
68
|
+
file_categories: pieces_framework_1.Property.ShortText({
|
|
69
|
+
displayName: 'File Categories',
|
|
70
|
+
description: 'Restricts search to only the file categories specified (comma-separated).',
|
|
71
|
+
required: false,
|
|
72
|
+
}),
|
|
73
|
+
account_id: pieces_framework_1.Property.ShortText({
|
|
74
|
+
displayName: 'Account ID',
|
|
75
|
+
description: 'Restricts results to the given account id.',
|
|
76
|
+
required: false,
|
|
77
|
+
}),
|
|
78
|
+
},
|
|
79
|
+
run(context) {
|
|
80
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const options = {
|
|
82
|
+
path: context.propsValue.path || '',
|
|
83
|
+
max_results: context.propsValue.max_results || 100,
|
|
84
|
+
file_status: context.propsValue.file_status,
|
|
85
|
+
filename_only: context.propsValue.filename_only,
|
|
86
|
+
file_extensions: context.propsValue.file_extensions
|
|
87
|
+
? context.propsValue.file_extensions.split(',')
|
|
88
|
+
: undefined,
|
|
89
|
+
file_categories: context.propsValue.file_categories
|
|
90
|
+
? context.propsValue.file_categories.split(',')
|
|
91
|
+
: undefined,
|
|
92
|
+
account_id: context.propsValue.account_id,
|
|
93
|
+
};
|
|
94
|
+
const requestBody = {
|
|
95
|
+
query: context.propsValue.query,
|
|
96
|
+
options: options,
|
|
97
|
+
};
|
|
98
|
+
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
99
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
100
|
+
url: `https://api.dropboxapi.com/2/files/search_v2`,
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
},
|
|
104
|
+
body: requestBody,
|
|
105
|
+
authentication: {
|
|
106
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
107
|
+
token: context.auth.access_token,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
return result.body;
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/lib/actions/search.ts"],"names":[],"mappings":";;;;AAAA,gGAAgG;AAChG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,8BAA8B;IAC3C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,qWAAqW,EAAE,UAAU,EAAE,IAAI,EAAE;IACpZ,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACv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OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const dropboxUploadFile: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
2
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
file: import("@agnocon/pieces-framework").FileProperty<true, false>;
|
|
4
|
+
autorename: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
5
|
+
mute: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
6
|
+
strict_conflict: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=upload-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB;;;;;;EAsE5B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dropboxUploadFile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/upload-file.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
exports.dropboxUploadFile = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: auth_1.dropboxAuth,
|
|
12
|
+
name: 'upload_dropbox_file',
|
|
13
|
+
description: 'Upload a file',
|
|
14
|
+
audience: 'both',
|
|
15
|
+
aiMetadata: { description: 'Uploads a file (provided as a URL or base64 file object) to the given Dropbox path in add mode. Use to store binary or arbitrary file content; prefer the create-text-file action when the source is plain text. Not idempotent: each call uploads, so repeating it can create autorenamed duplicates rather than overwriting.', idempotent: false },
|
|
16
|
+
displayName: 'Upload file',
|
|
17
|
+
props: {
|
|
18
|
+
path: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'Path',
|
|
20
|
+
description: 'The path where the file should be saved (e.g. /folder1/file.txt)',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
file: pieces_framework_1.Property.File({
|
|
24
|
+
displayName: 'File',
|
|
25
|
+
description: 'The file URL or base64 to upload',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
autorename: pieces_framework_1.Property.Checkbox({
|
|
29
|
+
displayName: 'Auto Rename',
|
|
30
|
+
description: "If there's a conflict, as determined by mode, have the Dropbox server try to autorename the file to avoid conflict.",
|
|
31
|
+
defaultValue: false,
|
|
32
|
+
required: false,
|
|
33
|
+
}),
|
|
34
|
+
mute: pieces_framework_1.Property.Checkbox({
|
|
35
|
+
displayName: 'Mute',
|
|
36
|
+
description: "Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software. If true, this tells the clients that this modification shouldn't result in a user notification.",
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
strict_conflict: pieces_framework_1.Property.Checkbox({
|
|
40
|
+
displayName: 'Strict conflict',
|
|
41
|
+
description: 'Be more strict about how each WriteMode detects conflict. For example, always return a conflict error when mode = WriteMode.update and the given "rev" doesn\'t match the existing file\'s "rev", even if the existing file has been deleted.',
|
|
42
|
+
required: false,
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
run(context) {
|
|
46
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const fileData = context.propsValue.file;
|
|
48
|
+
const params = {
|
|
49
|
+
autorename: context.propsValue.autorename,
|
|
50
|
+
path: context.propsValue.path,
|
|
51
|
+
mode: 'add',
|
|
52
|
+
mute: context.propsValue.mute,
|
|
53
|
+
strict_conflict: context.propsValue.strict_conflict,
|
|
54
|
+
};
|
|
55
|
+
const fileBuffer = Buffer.from(fileData.base64, 'base64');
|
|
56
|
+
// For information about Dropbox JSON encoding, see https://www.dropbox.com/developers/reference/json-encoding
|
|
57
|
+
const dropboxApiArg = JSON.stringify(params).replace(/[\u007f-\uffff]/g, (c) => '\\u' + ('000' + c.charCodeAt(0).toString(16)).slice(-4));
|
|
58
|
+
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
59
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
60
|
+
url: `https://content.dropboxapi.com/2/files/upload`,
|
|
61
|
+
body: fileBuffer,
|
|
62
|
+
headers: {
|
|
63
|
+
'Dropbox-API-Arg': dropboxApiArg,
|
|
64
|
+
'Content-Type': 'application/octet-stream',
|
|
65
|
+
},
|
|
66
|
+
authentication: {
|
|
67
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
68
|
+
token: context.auth.access_token,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
return result.body;
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=upload-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,gUAAgU,EAAE,U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,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,GAAC,CAAC,KAAK,GAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAEtI,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,+CAA+C;gBACpD,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE;oBACP,iBAAiB,EAAE,aAAa;oBAChC,cAAc,EAAE,0BAA0B;iBAC3C;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,qGAatB,CAAC"}
|
package/dist/lib/auth.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dropboxAuth = void 0;
|
|
4
|
+
// Vendored from Activepieces packages/pieces/community/dropbox/src/lib/auth.ts (MIT).
|
|
5
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
6
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
7
|
+
exports.dropboxAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
8
|
+
description: '',
|
|
9
|
+
authUrl: 'https://www.dropbox.com/oauth2/authorize',
|
|
10
|
+
tokenUrl: 'https://api.dropboxapi.com/oauth2/token',
|
|
11
|
+
required: true,
|
|
12
|
+
// include token_access_type=offline as a parameter on Authorization URL in order to return a refresh_token
|
|
13
|
+
extra: { token_access_type: 'offline' },
|
|
14
|
+
scope: [
|
|
15
|
+
'files.metadata.write',
|
|
16
|
+
'files.metadata.read',
|
|
17
|
+
'files.content.write',
|
|
18
|
+
'files.content.read',
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,sFAAsF;AACtF,qEAAqE;AACrE,gEAAsD;AAEzC,QAAA,WAAW,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,0CAA0C;IACnD,QAAQ,EAAE,yCAAyC;IACnD,QAAQ,EAAE,IAAI;IACd,2GAA2G;IAC3G,KAAK,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE;IACvC,KAAK,EAAE;QACL,sBAAsB;QACtB,qBAAqB;QACrB,qBAAqB;QACrB,oBAAoB;KACrB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@agnocon/pieces-framework';
|
|
2
|
+
export declare const dropboxNewFolder: import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
3
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
recursive: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
5
|
+
}> | import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
6
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
recursive: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
8
|
+
}> | import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
9
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
recursive: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
11
|
+
}> | import("@agnocon/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
|
|
12
|
+
path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
13
|
+
recursive: import("@agnocon/pieces-framework").CheckboxProperty<false>;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=new-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-folder.d.ts","sourceRoot":"","sources":["../../../src/lib/triggers/new-folder.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,eAAe,EAChB,MAAM,2BAA2B,CAAC;AA8FnC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAoE3B,CAAC"}
|