@activepieces/piece-dropbox 0.2.0 → 0.2.2
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 -6
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -6
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-new-folder.d.ts +1 -1
- package/src/lib/actions/create-new-folder.js +9 -8
- package/src/lib/actions/create-new-folder.js.map +1 -1
- package/src/lib/actions/create-new-text-file.d.ts +1 -1
- package/src/lib/actions/create-new-text-file.js +12 -11
- package/src/lib/actions/create-new-text-file.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-dropbox",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.
|
|
5
|
+
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
|
-
"
|
|
7
|
+
"lodash": "4.17.21",
|
|
8
8
|
"nanoid": "3.3.4",
|
|
9
|
-
"@activepieces/framework": "0.
|
|
10
|
-
"@activepieces/shared": "0.
|
|
11
|
-
"
|
|
9
|
+
"@activepieces/pieces-framework": "0.3.27",
|
|
10
|
+
"@activepieces/shared": "0.3.44",
|
|
11
|
+
"@activepieces/pieces-common": "0.0.7",
|
|
12
|
+
"tslib": "2.5.3"
|
|
12
13
|
},
|
|
13
14
|
"main": "./src/index.js",
|
|
14
15
|
"types": "./src/index.d.ts"
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dropbox: import("@activepieces/framework").Piece;
|
|
1
|
+
export declare const dropbox: import("@activepieces/pieces-framework").Piece;
|
package/src/index.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dropbox = void 0;
|
|
4
|
-
const
|
|
5
|
-
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
-
const framework_1 = require("@activepieces/framework");
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
5
|
const create_new_folder_1 = require("./lib/actions/create-new-folder");
|
|
8
6
|
const create_new_text_file_1 = require("./lib/actions/create-new-text-file");
|
|
9
|
-
exports.dropbox = (0,
|
|
10
|
-
name: 'dropbox',
|
|
7
|
+
exports.dropbox = (0, pieces_framework_1.createPiece)({
|
|
11
8
|
logoUrl: 'https://cdn.activepieces.com/pieces/dropbox.png',
|
|
12
9
|
actions: [create_new_folder_1.dropboxCreateNewFolder, create_new_text_file_1.dropboxCreateNewTextFile],
|
|
13
10
|
displayName: "DropBox",
|
|
14
11
|
authors: ['kanarelo'],
|
|
15
12
|
triggers: [],
|
|
16
|
-
version: package_json_1.default.version,
|
|
17
13
|
});
|
|
18
14
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/dropbox/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/dropbox/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAA6D;AAC7D,uEAAyE;AACzE,6EAA8E;AAEjE,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,CAAC,0CAAsB,EAAE,+CAAwB,CAAC;IAC3D,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const dropboxCreateNewFolder: import("@activepieces/framework").Action;
|
|
1
|
+
export declare const dropboxCreateNewFolder: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dropboxCreateNewFolder = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
exports.dropboxCreateNewFolder = (0, pieces_framework_1.createAction)({
|
|
7
8
|
name: 'create_new_dropbox_folder',
|
|
8
9
|
description: 'Create a new empty folder in your Dropbox',
|
|
9
10
|
displayName: 'Create New Folder',
|
|
10
11
|
props: {
|
|
11
|
-
authentication:
|
|
12
|
+
authentication: pieces_framework_1.Property.OAuth2({
|
|
12
13
|
description: "",
|
|
13
14
|
displayName: 'Authentication',
|
|
14
15
|
authUrl: "https://www.dropbox.com/oauth2/authorize",
|
|
@@ -16,12 +17,12 @@ exports.dropboxCreateNewFolder = (0, framework_1.createAction)({
|
|
|
16
17
|
required: true,
|
|
17
18
|
scope: ["files.content.write"]
|
|
18
19
|
}),
|
|
19
|
-
path:
|
|
20
|
+
path: pieces_framework_1.Property.ShortText({
|
|
20
21
|
displayName: 'Path',
|
|
21
22
|
description: 'The path of the new folder e.g. /Homework/math',
|
|
22
23
|
required: true
|
|
23
24
|
}),
|
|
24
|
-
autorename:
|
|
25
|
+
autorename: pieces_framework_1.Property.Checkbox({
|
|
25
26
|
displayName: 'Auto Rename',
|
|
26
27
|
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
28
|
required: false
|
|
@@ -59,15 +60,15 @@ exports.dropboxCreateNewFolder = (0, framework_1.createAction)({
|
|
|
59
60
|
path: context.propsValue.path,
|
|
60
61
|
};
|
|
61
62
|
const request = {
|
|
62
|
-
method:
|
|
63
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
63
64
|
url: `https://api.dropboxapi.com/2/files/create_folder_v2`,
|
|
64
65
|
body,
|
|
65
66
|
authentication: {
|
|
66
|
-
type:
|
|
67
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
67
68
|
token: context.propsValue.authentication.access_token,
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
|
-
const result = yield
|
|
71
|
+
const result = yield pieces_common_1.httpClient.sendRequest(request);
|
|
71
72
|
console.debug("Folder creation response", result);
|
|
72
73
|
if (result.status == 200) {
|
|
73
74
|
return result.body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-folder.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/create-new-folder.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-new-folder.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/create-new-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAsE;AACtE,+DAAqG;AAExF,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,2CAA2C;IACxD,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;QACL,cAAc,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC9B,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,gBAAgB;YAC7B,OAAO,EAAE,0CAA0C;YACnD,QAAQ,EAAE,yCAAyC;YACnD,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,CAAC,qBAAqB,CAAC;SAC/B,CAAC;QACF,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,EAAE,yIAAyI;YACtJ,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD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activepieces/framework").Action;
|
|
1
|
+
export declare const dropboxCreateNewTextFile: import("@activepieces/pieces-framework").Action;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dropboxCreateNewTextFile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
exports.dropboxCreateNewTextFile = (0, pieces_framework_1.createAction)({
|
|
7
8
|
name: 'create_new_dropbox_text_file',
|
|
8
9
|
description: 'Create a new text file in your Dropbox from text input',
|
|
9
10
|
displayName: 'Create New Text File',
|
|
10
11
|
props: {
|
|
11
|
-
authentication:
|
|
12
|
+
authentication: pieces_framework_1.Property.OAuth2({
|
|
12
13
|
description: "",
|
|
13
14
|
displayName: 'Authentication',
|
|
14
15
|
authUrl: "https://www.dropbox.com/oauth2/authorize",
|
|
@@ -16,27 +17,27 @@ exports.dropboxCreateNewTextFile = (0, framework_1.createAction)({
|
|
|
16
17
|
required: true,
|
|
17
18
|
scope: ["files.content.write"]
|
|
18
19
|
}),
|
|
19
|
-
path:
|
|
20
|
+
path: pieces_framework_1.Property.ShortText({
|
|
20
21
|
displayName: 'Path',
|
|
21
22
|
description: 'The path of the new folder e.g. /Homework/math',
|
|
22
23
|
required: true
|
|
23
24
|
}),
|
|
24
|
-
text:
|
|
25
|
+
text: pieces_framework_1.Property.LongText({
|
|
25
26
|
displayName: 'Text',
|
|
26
27
|
description: "The text to write into the file.",
|
|
27
28
|
required: true
|
|
28
29
|
}),
|
|
29
|
-
autorename:
|
|
30
|
+
autorename: pieces_framework_1.Property.Checkbox({
|
|
30
31
|
displayName: 'Autorename',
|
|
31
32
|
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.",
|
|
32
33
|
required: false
|
|
33
34
|
}),
|
|
34
|
-
mute:
|
|
35
|
+
mute: pieces_framework_1.Property.Checkbox({
|
|
35
36
|
displayName: 'Mute',
|
|
36
37
|
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
38
|
required: false
|
|
38
39
|
}),
|
|
39
|
-
strict_conflict:
|
|
40
|
+
strict_conflict: pieces_framework_1.Property.Checkbox({
|
|
40
41
|
displayName: 'Strict conflict',
|
|
41
42
|
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
43
|
required: false
|
|
@@ -86,11 +87,11 @@ exports.dropboxCreateNewTextFile = (0, framework_1.createAction)({
|
|
|
86
87
|
strict_conflict: context.propsValue.strict_conflict
|
|
87
88
|
};
|
|
88
89
|
const request = {
|
|
89
|
-
method:
|
|
90
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
90
91
|
url: `https://content.dropboxapi.com/2/files/upload`,
|
|
91
92
|
body: Buffer.from(context.propsValue.text, 'utf-8'),
|
|
92
93
|
authentication: {
|
|
93
|
-
type:
|
|
94
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
94
95
|
token: context.propsValue.authentication.access_token,
|
|
95
96
|
},
|
|
96
97
|
headers: {
|
|
@@ -98,7 +99,7 @@ exports.dropboxCreateNewTextFile = (0, framework_1.createAction)({
|
|
|
98
99
|
"Content-Type": "application/octet-stream"
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
|
-
const result = yield
|
|
102
|
+
const result = yield pieces_common_1.httpClient.sendRequest(request);
|
|
102
103
|
console.debug("Folder creation response", result);
|
|
103
104
|
if (result.status == 200) {
|
|
104
105
|
return result.body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-text-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/create-new-text-file.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create-new-text-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/create-new-text-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAsE;AACtE,+DAAqG;AAExF,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,wDAAwD;IACrE,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE;QACL,cAAc,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC9B,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,gBAAgB;YAC7B,OAAO,EAAE,0CAA0C;YACnD,QAAQ,EAAE,yCAAyC;YACnD,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,CAAC,qBAAqB,CAAC;SAC/B,CAAC;QACF,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,EAAE,yIAAyI;YACtJ,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,6NAA6N;YAC1O,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,+OAA+O;YAC5P,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,UAAU,EAAE;QACV,iBAA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