@activepieces/piece-dropbox 0.7.1 → 0.7.4
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/package.json +7 -12
- package/src/index.js +13 -63
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/copy-file.d.ts +0 -7
- package/src/lib/actions/copy-file.d.ts.map +0 -1
- package/src/lib/actions/copy-file.js +0 -61
- package/src/lib/actions/copy-file.js.map +0 -1
- package/src/lib/actions/copy-folder.d.ts +0 -7
- package/src/lib/actions/copy-folder.d.ts.map +0 -1
- package/src/lib/actions/copy-folder.js +0 -61
- package/src/lib/actions/copy-folder.js.map +0 -1
- package/src/lib/actions/create-new-folder.d.ts +0 -5
- package/src/lib/actions/create-new-folder.d.ts.map +0 -1
- package/src/lib/actions/create-new-folder.js +0 -51
- package/src/lib/actions/create-new-folder.js.map +0 -1
- package/src/lib/actions/create-new-text-file.d.ts +0 -8
- package/src/lib/actions/create-new-text-file.d.ts.map +0 -1
- package/src/lib/actions/create-new-text-file.js +0 -73
- package/src/lib/actions/create-new-text-file.js.map +0 -1
- package/src/lib/actions/delete-file.d.ts +0 -4
- package/src/lib/actions/delete-file.d.ts.map +0 -1
- package/src/lib/actions/delete-file.js +0 -41
- package/src/lib/actions/delete-file.js.map +0 -1
- package/src/lib/actions/delete-folder.d.ts +0 -4
- package/src/lib/actions/delete-folder.d.ts.map +0 -1
- package/src/lib/actions/delete-folder.js +0 -41
- package/src/lib/actions/delete-folder.js.map +0 -1
- package/src/lib/actions/download-file.d.ts +0 -4
- package/src/lib/actions/download-file.d.ts.map +0 -1
- package/src/lib/actions/download-file.js +0 -49
- package/src/lib/actions/download-file.js.map +0 -1
- package/src/lib/actions/get-file-link.d.ts +0 -4
- package/src/lib/actions/get-file-link.d.ts.map +0 -1
- package/src/lib/actions/get-file-link.js +0 -41
- package/src/lib/actions/get-file-link.js.map +0 -1
- package/src/lib/actions/list-a-folder.d.ts +0 -6
- package/src/lib/actions/list-a-folder.d.ts.map +0 -1
- package/src/lib/actions/list-a-folder.js +0 -54
- package/src/lib/actions/list-a-folder.js.map +0 -1
- package/src/lib/actions/move-file.d.ts +0 -7
- package/src/lib/actions/move-file.d.ts.map +0 -1
- package/src/lib/actions/move-file.js +0 -61
- package/src/lib/actions/move-file.js.map +0 -1
- package/src/lib/actions/move-folder.d.ts +0 -7
- package/src/lib/actions/move-folder.d.ts.map +0 -1
- package/src/lib/actions/move-folder.js +0 -61
- package/src/lib/actions/move-folder.js.map +0 -1
- package/src/lib/actions/search.d.ts +0 -12
- package/src/lib/actions/search.d.ts.map +0 -1
- package/src/lib/actions/search.js +0 -110
- package/src/lib/actions/search.js.map +0 -1
- package/src/lib/actions/upload-file.d.ts +0 -8
- package/src/lib/actions/upload-file.d.ts.map +0 -1
- package/src/lib/actions/upload-file.js +0 -71
- package/src/lib/actions/upload-file.js.map +0 -1
- package/src/lib/auth.d.ts +0 -2
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -19
- package/src/lib/auth.js.map +0 -1
- package/src/lib/triggers/new-folder.d.ts +0 -15
- package/src/lib/triggers/new-folder.d.ts.map +0 -1
- package/src/lib/triggers/new-folder.js +0 -109
- package/src/lib/triggers/new-folder.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy-folder.js","sourceRoot":"","sources":["../../../../src/lib/actions/copy-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,kCAAsC;AAEzB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,8EAA8E;YAChF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,gGAAgG;YAClG,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,wBAAwB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1C,WAAW,EAAE,0BAA0B;YACvC,WAAW,EACT,wEAAwE;YAC1E,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"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const dropboxCreateNewFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
autorename: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=create-new-folder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-folder.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-new-folder.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,sBAAsB;;;EA2CjC,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxCreateNewFolder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxCreateNewFolder = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'create_new_dropbox_folder',
|
|
11
|
-
description: 'Create a new empty folder',
|
|
12
|
-
displayName: 'Create New Folder',
|
|
13
|
-
props: {
|
|
14
|
-
path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'Path',
|
|
16
|
-
description: 'The path of the new folder e.g. /Homework/math',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
autorename: pieces_framework_1.Property.Checkbox({
|
|
20
|
-
displayName: 'Auto Rename',
|
|
21
|
-
description: "If there's a conflict, have the Dropbox server try to autorename the folder to avoid the conflict. The default for this field is False.",
|
|
22
|
-
required: false,
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
25
|
-
run(context) {
|
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const body = {
|
|
28
|
-
autorename: context.propsValue.autorename ? true : false,
|
|
29
|
-
path: context.propsValue.path,
|
|
30
|
-
};
|
|
31
|
-
const request = {
|
|
32
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
33
|
-
url: `https://api.dropboxapi.com/2/files/create_folder_v2`,
|
|
34
|
-
body,
|
|
35
|
-
authentication: {
|
|
36
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
37
|
-
token: context.auth.access_token,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const result = yield pieces_common_1.httpClient.sendRequest(request);
|
|
41
|
-
console.debug('Folder creation response', result);
|
|
42
|
-
if (result.status == 200) {
|
|
43
|
-
return result.body;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=create-new-folder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-folder.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-new-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,kCAAsC;AAEzB,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,yIAAyI;YAC3I,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG;gBACX,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;gBACxD,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;aAC9B,CAAC;YAEF,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,qDAAqD;gBAC1D,IAAI;gBACJ,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;aACF,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACrD,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;YAElD,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBACzB,OAAO,MAAM,CAAC,IAAI,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACN,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const dropboxCreateNewTextFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
-
autorename: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
|
-
mute: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
|
-
strict_conflict: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=create-new-text-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-text-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-new-text-file.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,wBAAwB;;;;;;EAmEnC,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxCreateNewTextFile = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxCreateNewTextFile = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'create_new_dropbox_text_file',
|
|
11
|
-
description: 'Create a new text file from text input',
|
|
12
|
-
displayName: 'Create New Text File',
|
|
13
|
-
props: {
|
|
14
|
-
path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'Path',
|
|
16
|
-
description: 'The path of the new folder e.g. /Homework/math',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
text: pieces_framework_1.Property.LongText({
|
|
20
|
-
displayName: 'Text',
|
|
21
|
-
description: 'The text to write into the file.',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
autorename: pieces_framework_1.Property.Checkbox({
|
|
25
|
-
displayName: 'Autorename',
|
|
26
|
-
description: "If there's a conflict, have the Dropbox server try to autorename the folder to avoid the conflict. The default for this field is False.",
|
|
27
|
-
required: false,
|
|
28
|
-
}),
|
|
29
|
-
mute: pieces_framework_1.Property.Checkbox({
|
|
30
|
-
displayName: 'Mute',
|
|
31
|
-
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.",
|
|
32
|
-
required: false,
|
|
33
|
-
}),
|
|
34
|
-
strict_conflict: pieces_framework_1.Property.Checkbox({
|
|
35
|
-
displayName: 'Strict conflict',
|
|
36
|
-
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.',
|
|
37
|
-
required: false,
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
run(context) {
|
|
41
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const params = {
|
|
43
|
-
autorename: context.propsValue.autorename,
|
|
44
|
-
path: context.propsValue.path,
|
|
45
|
-
mode: 'add',
|
|
46
|
-
mute: context.propsValue.mute,
|
|
47
|
-
strict_conflict: context.propsValue.strict_conflict,
|
|
48
|
-
};
|
|
49
|
-
const request = {
|
|
50
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
51
|
-
url: `https://content.dropboxapi.com/2/files/upload`,
|
|
52
|
-
body: Buffer.from(context.propsValue.text, 'utf-8'),
|
|
53
|
-
authentication: {
|
|
54
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
55
|
-
token: context.auth.access_token,
|
|
56
|
-
},
|
|
57
|
-
headers: {
|
|
58
|
-
'Dropbox-API-Arg': JSON.stringify(params),
|
|
59
|
-
'Content-Type': 'application/octet-stream',
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
const result = yield pieces_common_1.httpClient.sendRequest(request);
|
|
63
|
-
console.debug('Folder creation response', result);
|
|
64
|
-
if (result.status == 200) {
|
|
65
|
-
return result.body;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=create-new-text-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-text-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-new-text-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,kCAAsC;AAEzB,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,wCAAwC;IACrD,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,yIAAyI;YAC3I,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,6NAA6N;YAC/N,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EACT,+OAA+O;YACjP,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG;gBACb,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;gBACzC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;gBAC7B,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;gBAC7B,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,eAAe;aACpD,CAAC;YAEF,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,+CAA+C;gBACpD,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC;gBACnD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACjC;gBACD,OAAO,EAAE;oBACP,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACzC,cAAc,EAAE,0BAA0B;iBAC3C;aACF,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACrD,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;YAElD,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBACzB,OAAO,MAAM,CAAC,IAAI,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACN,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const dropboxDeleteFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=delete-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-file.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;EAiC5B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxDeleteFile = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxDeleteFile = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'delete_dropbox_file',
|
|
11
|
-
description: 'Delete a file',
|
|
12
|
-
displayName: 'Delete file',
|
|
13
|
-
props: {
|
|
14
|
-
path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'Path',
|
|
16
|
-
description: 'The path of the file to be deleted (e.g. /folder1/file.txt)',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
},
|
|
20
|
-
run(context) {
|
|
21
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const params = {
|
|
23
|
-
path: context.propsValue.path,
|
|
24
|
-
};
|
|
25
|
-
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
26
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
-
url: `https://api.dropboxapi.com/2/files/delete_v2`,
|
|
28
|
-
headers: {
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
},
|
|
31
|
-
body: { path: context.propsValue.path },
|
|
32
|
-
authentication: {
|
|
33
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
34
|
-
token: context.auth.access_token,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
return result.body;
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=delete-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,kCAAsC;AAEzB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,6DAA6D;YAC/D,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,8CAA8C;gBACnD,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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const dropboxDeleteFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=delete-folder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-folder.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-folder.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB;;EAgC9B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxDeleteFolder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxDeleteFolder = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'delete_dropbox_folder',
|
|
11
|
-
description: 'Delete a folder',
|
|
12
|
-
displayName: 'Delete folder',
|
|
13
|
-
props: {
|
|
14
|
-
path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'Path',
|
|
16
|
-
description: 'The path of the folder to be deleted (e.g. /folder1)',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
},
|
|
20
|
-
run(context) {
|
|
21
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const params = {
|
|
23
|
-
path: context.propsValue.path,
|
|
24
|
-
};
|
|
25
|
-
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
26
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
-
url: `https://api.dropboxapi.com/2/files/delete_v2`,
|
|
28
|
-
headers: {
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
},
|
|
31
|
-
body: params,
|
|
32
|
-
authentication: {
|
|
33
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
34
|
-
token: context.auth.access_token,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
return result.body;
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=delete-folder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-folder.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,kCAAsC;AAEzB,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,sDAAsD;YACnE,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,8CAA8C;gBACnD,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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const dropboxDownloadFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=download-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/download-file.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB;;EAwC9B,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxDownloadFile = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxDownloadFile = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'downloadFile',
|
|
11
|
-
displayName: 'Download File',
|
|
12
|
-
description: 'Download a File from Dropbox',
|
|
13
|
-
props: {
|
|
14
|
-
path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: "Path",
|
|
16
|
-
description: "The path of the file (e.g. /folder1/file.txt)",
|
|
17
|
-
required: true
|
|
18
|
-
})
|
|
19
|
-
},
|
|
20
|
-
run(context) {
|
|
21
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
var _a;
|
|
23
|
-
// Capture file name, if unsuccesfull default to output.pdf
|
|
24
|
-
const fileName = ((_a = context.propsValue.path.match(/[^/]+$/)) !== null && _a !== void 0 ? _a : ['output.pdf'])[0];
|
|
25
|
-
// For information about Dropbox JSON encoding, see https://www.dropbox.com/developers/reference/json-encoding
|
|
26
|
-
const dropboxApiArg = JSON.stringify({ path: context.propsValue.path }).replace(/[\u007f-\uffff]/g, (c) => '\\u' + ('000' + c.charCodeAt(0).toString(16)).slice(-4));
|
|
27
|
-
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
28
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
29
|
-
url: `https://content.dropboxapi.com/2/files/download`,
|
|
30
|
-
headers: {
|
|
31
|
-
'Content-Type': 'application/octet-stream',
|
|
32
|
-
'Dropbox-API-Arg': dropboxApiArg
|
|
33
|
-
},
|
|
34
|
-
authentication: {
|
|
35
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
36
|
-
token: context.auth.access_token,
|
|
37
|
-
},
|
|
38
|
-
responseType: 'arraybuffer'
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
file: yield context.files.write({
|
|
42
|
-
fileName: fileName,
|
|
43
|
-
data: Buffer.from(result.body)
|
|
44
|
-
})
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=download-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/download-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,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,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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const dropboxGetFileLink: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=get-file-link.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-link.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-file-link.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB;;EAgC7B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxGetFileLink = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxGetFileLink = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'get_dropbox_file_link',
|
|
11
|
-
description: 'Get a temporary file link',
|
|
12
|
-
displayName: 'Get temporary file link',
|
|
13
|
-
props: {
|
|
14
|
-
path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'Path',
|
|
16
|
-
description: 'The path of the file (e.g. /folder1/file.txt)',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
},
|
|
20
|
-
run(context) {
|
|
21
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const params = {
|
|
23
|
-
path: context.propsValue.path,
|
|
24
|
-
};
|
|
25
|
-
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
26
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
-
url: `https://api.dropboxapi.com/2/files/get_temporary_link`,
|
|
28
|
-
headers: {
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
},
|
|
31
|
-
body: { path: context.propsValue.path },
|
|
32
|
-
authentication: {
|
|
33
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
34
|
-
token: context.auth.access_token,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
return result.body;
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=get-file-link.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-link.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-file-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,kCAAsC;AAEzB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,2BAA2B;IACxC,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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const dropboxListAFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
recursive: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=list-a-folder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-a-folder.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-a-folder.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB;;;;EAgD7B,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxListAFolder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxListAFolder = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'list_dropbox_folder',
|
|
11
|
-
description: 'List the contents of a folder',
|
|
12
|
-
displayName: 'List a folder',
|
|
13
|
-
props: {
|
|
14
|
-
path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'Path',
|
|
16
|
-
description: 'The path of the folder to be listed (e.g. /folder1). Use an empty string for the root folder.',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
recursive: pieces_framework_1.Property.Checkbox({
|
|
20
|
-
displayName: 'Recursive',
|
|
21
|
-
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.',
|
|
22
|
-
defaultValue: false,
|
|
23
|
-
required: false,
|
|
24
|
-
}),
|
|
25
|
-
limit: pieces_framework_1.Property.Number({
|
|
26
|
-
displayName: 'Limit',
|
|
27
|
-
description: 'The maximum number of results to return (between 1 and 2000). Default is 2000 if not specified.',
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
run(context) {
|
|
32
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const params = {
|
|
34
|
-
path: context.propsValue.path,
|
|
35
|
-
recursive: context.propsValue.recursive,
|
|
36
|
-
limit: context.propsValue.limit || 2000,
|
|
37
|
-
};
|
|
38
|
-
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
39
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
40
|
-
url: `https://api.dropboxapi.com/2/files/list_folder`,
|
|
41
|
-
headers: {
|
|
42
|
-
'Content-Type': 'application/json',
|
|
43
|
-
},
|
|
44
|
-
body: params,
|
|
45
|
-
authentication: {
|
|
46
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
47
|
-
token: context.auth.access_token,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
return result.body;
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=list-a-folder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-a-folder.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-a-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,kCAAsC;AAEzB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,+FAA+F;YACjG,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EACT,mJAAmJ;YACrJ,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EACT,iGAAiG;YACnG,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG;gBACb,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;gBAC7B,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBACvC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,IAAI;aACxC,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,gDAAgD;gBACrD,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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const dropboxMoveFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
from_path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
to_path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
autorename: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
|
-
allow_ownership_transfer: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=move-file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"move-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/move-file.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe;;;;;EAsD1B,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxMoveFile = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxMoveFile = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'move_dropbox_file',
|
|
11
|
-
description: 'Move a file',
|
|
12
|
-
displayName: 'Move file',
|
|
13
|
-
props: {
|
|
14
|
-
from_path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'From Path',
|
|
16
|
-
description: 'The current path of the file (e.g. /folder1/oldfile.txt)',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
to_path: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'To Path',
|
|
21
|
-
description: 'The new path for the file (e.g. /folder2/newfile.txt)',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
autorename: pieces_framework_1.Property.Checkbox({
|
|
25
|
-
displayName: 'Auto Rename',
|
|
26
|
-
description: "If there's a conflict, have the Dropbox server try to autorename the file to avoid conflict.",
|
|
27
|
-
defaultValue: false,
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
allow_ownership_transfer: pieces_framework_1.Property.Checkbox({
|
|
31
|
-
displayName: 'Allow Ownership Transfer',
|
|
32
|
-
description: 'Allows moves by owner even if it would result in an ownership transfer.',
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
run(context) {
|
|
38
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const params = {
|
|
40
|
-
from_path: context.propsValue.from_path,
|
|
41
|
-
to_path: context.propsValue.to_path,
|
|
42
|
-
autorename: context.propsValue.autorename,
|
|
43
|
-
allow_ownership_transfer: context.propsValue.allow_ownership_transfer,
|
|
44
|
-
};
|
|
45
|
-
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
46
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
47
|
-
url: `https://api.dropboxapi.com/2/files/move_v2`,
|
|
48
|
-
headers: {
|
|
49
|
-
'Content-Type': 'application/json',
|
|
50
|
-
},
|
|
51
|
-
body: params,
|
|
52
|
-
authentication: {
|
|
53
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
54
|
-
token: context.auth.access_token,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
return result.body;
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=move-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"move-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/move-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,kCAAsC;AAEzB,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,aAAa;IAC1B,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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const dropboxMoveFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
from_path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
to_path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
autorename: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
|
-
allow_ownership_transfer: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=move-folder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"move-folder.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/move-folder.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;;;;EAwD5B,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dropboxMoveFolder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.dropboxMoveFolder = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.dropboxAuth,
|
|
10
|
-
name: 'move_dropbox_folder',
|
|
11
|
-
description: 'Move a folder',
|
|
12
|
-
displayName: 'Move folder',
|
|
13
|
-
props: {
|
|
14
|
-
from_path: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: 'From Path',
|
|
16
|
-
description: 'The current path of the folder (e.g. /folder1/sourceFolder)',
|
|
17
|
-
required: true,
|
|
18
|
-
}),
|
|
19
|
-
to_path: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'To Path',
|
|
21
|
-
description: 'The new path for the folder (e.g. /folder2/destinationFolder)',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
autorename: pieces_framework_1.Property.Checkbox({
|
|
25
|
-
displayName: 'Auto Rename',
|
|
26
|
-
description: "If there's a conflict, have the Dropbox server try to autorename the folder to avoid conflict.",
|
|
27
|
-
defaultValue: false,
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
allow_ownership_transfer: pieces_framework_1.Property.Checkbox({
|
|
31
|
-
displayName: 'Allow Ownership Transfer',
|
|
32
|
-
description: 'Allows moves by owner even if it would result in an ownership transfer.',
|
|
33
|
-
defaultValue: false,
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
run(context) {
|
|
38
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const params = {
|
|
40
|
-
from_path: context.propsValue.from_path,
|
|
41
|
-
to_path: context.propsValue.to_path,
|
|
42
|
-
autorename: context.propsValue.autorename,
|
|
43
|
-
allow_ownership_transfer: context.propsValue.allow_ownership_transfer,
|
|
44
|
-
};
|
|
45
|
-
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
46
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
47
|
-
url: `https://api.dropboxapi.com/2/files/move_v2`,
|
|
48
|
-
headers: {
|
|
49
|
-
'Content-Type': 'application/json',
|
|
50
|
-
},
|
|
51
|
-
body: params,
|
|
52
|
-
authentication: {
|
|
53
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
54
|
-
token: context.auth.access_token,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
return result.body;
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=move-folder.js.map
|