@activepieces/piece-dropbox 0.2.2 → 0.4.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.
Files changed (40) hide show
  1. package/package.json +11 -8
  2. package/src/index.d.ts +2 -1
  3. package/src/index.js +23 -3
  4. package/src/index.js.map +1 -1
  5. package/src/lib/actions/copy-file.d.ts +6 -0
  6. package/src/lib/actions/copy-file.js +61 -0
  7. package/src/lib/actions/copy-file.js.map +1 -0
  8. package/src/lib/actions/copy-folder.d.ts +6 -0
  9. package/src/lib/actions/copy-folder.js +61 -0
  10. package/src/lib/actions/copy-folder.js.map +1 -0
  11. package/src/lib/actions/create-new-folder.d.ts +4 -1
  12. package/src/lib/actions/create-new-folder.js +4 -35
  13. package/src/lib/actions/create-new-folder.js.map +1 -1
  14. package/src/lib/actions/create-new-text-file.d.ts +7 -1
  15. package/src/lib/actions/create-new-text-file.js +5 -45
  16. package/src/lib/actions/create-new-text-file.js.map +1 -1
  17. package/src/lib/actions/delete-file.d.ts +3 -0
  18. package/src/lib/actions/delete-file.js +41 -0
  19. package/src/lib/actions/delete-file.js.map +1 -0
  20. package/src/lib/actions/delete-folder.d.ts +3 -0
  21. package/src/lib/actions/delete-folder.js +41 -0
  22. package/src/lib/actions/delete-folder.js.map +1 -0
  23. package/src/lib/actions/get-file-link.d.ts +3 -0
  24. package/src/lib/actions/get-file-link.js +41 -0
  25. package/src/lib/actions/get-file-link.js.map +1 -0
  26. package/src/lib/actions/list-a-folder.d.ts +5 -0
  27. package/src/lib/actions/list-a-folder.js +54 -0
  28. package/src/lib/actions/list-a-folder.js.map +1 -0
  29. package/src/lib/actions/move-file.d.ts +6 -0
  30. package/src/lib/actions/move-file.js +61 -0
  31. package/src/lib/actions/move-file.js.map +1 -0
  32. package/src/lib/actions/move-folder.d.ts +6 -0
  33. package/src/lib/actions/move-folder.js +61 -0
  34. package/src/lib/actions/move-folder.js.map +1 -0
  35. package/src/lib/actions/search.d.ts +11 -0
  36. package/src/lib/actions/search.js +106 -0
  37. package/src/lib/actions/search.js.map +1 -0
  38. package/src/lib/actions/upload-file.d.ts +7 -0
  39. package/src/lib/actions/upload-file.js +69 -0
  40. package/src/lib/actions/upload-file.js.map +1 -0
package/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "@activepieces/piece-dropbox",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "dependencies": {
5
5
  "@sinclair/typebox": "0.26.8",
6
- "axios": "1.2.4",
6
+ "axios": "^1.0.0",
7
+ "dayjs": "1.11.9",
8
+ "is-base64": "1.1.0",
7
9
  "lodash": "4.17.21",
8
- "nanoid": "3.3.4",
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"
10
+ "nanoid": "3.3.6",
11
+ "semver": "7.5.4",
12
+ "@activepieces/pieces-common": "0.2.3",
13
+ "@activepieces/pieces-framework": "0.7.0",
14
+ "@activepieces/shared": "0.10.5",
15
+ "tslib": "2.6.2"
13
16
  },
14
17
  "main": "./src/index.js",
15
- "types": "./src/index.d.ts"
18
+ "type": "commonjs"
16
19
  }
package/src/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export declare const dropbox: import("@activepieces/pieces-framework").Piece;
1
+ export declare const dropboxAuth: import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>;
2
+ export declare const dropbox: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>>;
package/src/index.js CHANGED
@@ -1,14 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dropbox = void 0;
3
+ exports.dropbox = exports.dropboxAuth = void 0;
4
4
  const pieces_framework_1 = require("@activepieces/pieces-framework");
5
5
  const create_new_folder_1 = require("./lib/actions/create-new-folder");
6
6
  const create_new_text_file_1 = require("./lib/actions/create-new-text-file");
7
+ const upload_file_1 = require("./lib/actions/upload-file");
8
+ const get_file_link_1 = require("./lib/actions/get-file-link");
9
+ const delete_file_1 = require("./lib/actions/delete-file");
10
+ const move_file_1 = require("./lib/actions/move-file");
11
+ const copy_file_1 = require("./lib/actions/copy-file");
12
+ const delete_folder_1 = require("./lib/actions/delete-folder");
13
+ const move_folder_1 = require("./lib/actions/move-folder");
14
+ const copy_folder_1 = require("./lib/actions/copy-folder");
15
+ const list_a_folder_1 = require("./lib/actions/list-a-folder");
16
+ const search_1 = require("./lib/actions/search");
17
+ exports.dropboxAuth = pieces_framework_1.PieceAuth.OAuth2({
18
+ description: "",
19
+ authUrl: "https://www.dropbox.com/oauth2/authorize",
20
+ tokenUrl: "https://api.dropboxapi.com/oauth2/token",
21
+ required: true,
22
+ scope: ["files.metadata.write", "files.metadata.read", "files.content.write", "files.content.read"]
23
+ });
7
24
  exports.dropbox = (0, pieces_framework_1.createPiece)({
25
+ minimumSupportedRelease: '0.5.0',
8
26
  logoUrl: 'https://cdn.activepieces.com/pieces/dropbox.png',
9
- actions: [create_new_folder_1.dropboxCreateNewFolder, create_new_text_file_1.dropboxCreateNewTextFile],
27
+ actions: [search_1.dropboxSearch, create_new_text_file_1.dropboxCreateNewTextFile, upload_file_1.dropboxUploadFile,
28
+ get_file_link_1.dropboxGetFileLink, delete_file_1.dropboxDeleteFile, move_file_1.dropboxMoveFile, copy_file_1.dropboxCopyFile, create_new_folder_1.dropboxCreateNewFolder, delete_folder_1.dropboxDeleteFolder, move_folder_1.dropboxMoveFolder, copy_folder_1.dropboxCopyFolder, list_a_folder_1.dropboxListAFolder],
10
29
  displayName: "DropBox",
11
- authors: ['kanarelo'],
30
+ authors: ['kanarelo', 'BastienMe'],
12
31
  triggers: [],
32
+ auth: exports.dropboxAuth,
13
33
  });
14
34
  //# 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":";;;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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/dropbox/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,uEAAyE;AACzE,6EAA8E;AAC9E,2DAA8D;AAC9D,+DAAiE;AACjE,2DAA8D;AAC9D,uDAA0D;AAC1D,uDAA0D;AAC1D,+DAAkE;AAClE,2DAA8D;AAC9D,2DAA8D;AAC9D,+DAAiE;AACjE,iDAAqD;AAExC,QAAA,WAAW,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,0CAA0C;IACnD,QAAQ,EAAE,yCAAyC;IACnD,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,CAAC;CACpG,CAAC,CAAA;AAEW,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,CAAC,sBAAa,EAAE,+CAAwB,EAAE,+BAAiB;QAClE,kCAAkB,EAAE,+BAAiB,EAAE,2BAAe,EAAE,2BAAe,EAAE,0CAAsB,EAAE,mCAAmB,EAAE,+BAAiB,EAAE,+BAAiB,EAAE,kCAAkB,CAAC;IACjL,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;IAClC,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,mBAAW;CAClB,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const dropboxCopyFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, 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
+ }>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxCopyFile = 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 __1 = require("../../");
8
+ exports.dropboxCopyFile = (0, pieces_framework_1.createAction)({
9
+ auth: __1.dropboxAuth,
10
+ name: 'copy_dropbox_file',
11
+ description: 'Copy a file',
12
+ displayName: 'Copy file',
13
+ props: {
14
+ from_path: pieces_framework_1.Property.ShortText({
15
+ displayName: 'From Path',
16
+ description: 'The source path of the file (e.g. /folder1/sourcefile.txt)',
17
+ required: true,
18
+ }),
19
+ to_path: pieces_framework_1.Property.ShortText({
20
+ displayName: 'To Path',
21
+ description: 'The destination path for the copied (e.g. /folder2/destinationfile.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 copy 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/copy_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=copy-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/copy-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE;QACH,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,yEAAyE;YACtF,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,8FAA8F;YAC3G,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,wBAAwB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxC,WAAW,EAAE,0BAA0B;YACvC,WAAW,EAAE,wEAAwE;YACrF,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,MAAM,GAAG;gBACX,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;aACxE,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACxC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,4CAA4C;gBACjD,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACnC;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const dropboxCopyFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, 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
+ }>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxCopyFolder = 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 __1 = require("../../");
8
+ exports.dropboxCopyFolder = (0, pieces_framework_1.createAction)({
9
+ auth: __1.dropboxAuth,
10
+ name: 'copy_dropbox_folder',
11
+ description: 'Copy a folder',
12
+ displayName: 'Copy folder',
13
+ props: {
14
+ from_path: pieces_framework_1.Property.ShortText({
15
+ displayName: 'From Path',
16
+ description: 'The source 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 destination path for the copied 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 copy 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/copy_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=copy-folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-folder.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/copy-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACH,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,8EAA8E;YAC3F,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,gGAAgG;YAC7G,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,wBAAwB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxC,WAAW,EAAE,0BAA0B;YACvC,WAAW,EAAE,wEAAwE;YACrF,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,MAAM,GAAG;gBACX,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;aACxE,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACxC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,4CAA4C;gBACjD,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACnC;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1 +1,4 @@
1
- export declare const dropboxCreateNewFolder: import("@activepieces/pieces-framework").Action;
1
+ export declare const dropboxCreateNewFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ autorename: import("@activepieces/pieces-framework").CheckboxProperty<false>;
4
+ }>;
@@ -4,19 +4,13 @@ exports.dropboxCreateNewFolder = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_framework_1 = require("@activepieces/pieces-framework");
6
6
  const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../../");
7
8
  exports.dropboxCreateNewFolder = (0, pieces_framework_1.createAction)({
9
+ auth: __1.dropboxAuth,
8
10
  name: 'create_new_dropbox_folder',
9
- description: 'Create a new empty folder in your Dropbox',
11
+ description: 'Create a new empty folder',
10
12
  displayName: 'Create New Folder',
11
13
  props: {
12
- authentication: pieces_framework_1.Property.OAuth2({
13
- description: "",
14
- displayName: 'Authentication',
15
- authUrl: "https://www.dropbox.com/oauth2/authorize",
16
- tokenUrl: "https://api.dropboxapi.com/oauth2/token",
17
- required: true,
18
- scope: ["files.content.write"]
19
- }),
20
14
  path: pieces_framework_1.Property.ShortText({
21
15
  displayName: 'Path',
22
16
  description: 'The path of the new folder e.g. /Homework/math',
@@ -28,31 +22,6 @@ exports.dropboxCreateNewFolder = (0, pieces_framework_1.createAction)({
28
22
  required: false
29
23
  })
30
24
  },
31
- sampleData: {
32
- "metadata": {
33
- "id": "id:a4ayc_80_OEAAAAAAAAAXz",
34
- "name": "math",
35
- "path_display": "/Homework/math",
36
- "path_lower": "/homework/math",
37
- "property_groups": [
38
- {
39
- "fields": [
40
- {
41
- "name": "Security Policy",
42
- "value": "Confidential"
43
- }
44
- ],
45
- "template_id": "ptid:1a5n2i6d3OYEAAAAAAAAAYa"
46
- }
47
- ],
48
- "sharing_info": {
49
- "no_access": false,
50
- "parent_shared_folder_id": "84528192421",
51
- "read_only": false,
52
- "traverse_only": false
53
- }
54
- }
55
- },
56
25
  run(context) {
57
26
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
27
  const body = {
@@ -65,7 +34,7 @@ exports.dropboxCreateNewFolder = (0, pieces_framework_1.createAction)({
65
34
  body,
66
35
  authentication: {
67
36
  type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
68
- token: context.propsValue.authentication.access_token,
37
+ token: context.auth.access_token,
69
38
  }
70
39
  };
71
40
  const result = yield pieces_common_1.httpClient.sendRequest(request);
@@ -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,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,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AAO,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;YAEjD,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE;gBACxB,OAAO,MAAM,CAAC,IAAI,CAAA;aACnB;iBAAM;gBACL,OAAO,MAAM,CAAA;aACd;QACH,CAAC;KAAA;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"create-new-folder.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/create-new-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAuE;AACvE,+DAAqG;AACrG,8BAAoC;AAEvB,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,eAAW;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,EAAE,yIAAyI;YACtJ,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,CAAA;YAED,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,CAAA;YAED,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;YAEjD,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE;gBACxB,OAAO,MAAM,CAAC,IAAI,CAAA;aACnB;iBAAM;gBACL,OAAO,MAAM,CAAA;aACd;QACH,CAAC;KAAA;CACF,CAAC,CAAA"}
@@ -1 +1,7 @@
1
- export declare const dropboxCreateNewTextFile: import("@activepieces/pieces-framework").Action;
1
+ export declare const dropboxCreateNewTextFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, 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
+ }>;
@@ -4,19 +4,13 @@ exports.dropboxCreateNewTextFile = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_framework_1 = require("@activepieces/pieces-framework");
6
6
  const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../../");
7
8
  exports.dropboxCreateNewTextFile = (0, pieces_framework_1.createAction)({
9
+ auth: __1.dropboxAuth,
8
10
  name: 'create_new_dropbox_text_file',
9
- description: 'Create a new text file in your Dropbox from text input',
11
+ description: 'Create a new text file from text input',
10
12
  displayName: 'Create New Text File',
11
13
  props: {
12
- authentication: pieces_framework_1.Property.OAuth2({
13
- description: "",
14
- displayName: 'Authentication',
15
- authUrl: "https://www.dropbox.com/oauth2/authorize",
16
- tokenUrl: "https://api.dropboxapi.com/oauth2/token",
17
- required: true,
18
- scope: ["files.content.write"]
19
- }),
20
14
  path: pieces_framework_1.Property.ShortText({
21
15
  displayName: 'Path',
22
16
  description: 'The path of the new folder e.g. /Homework/math',
@@ -43,40 +37,6 @@ exports.dropboxCreateNewTextFile = (0, pieces_framework_1.createAction)({
43
37
  required: false
44
38
  }),
45
39
  },
46
- sampleData: {
47
- "client_modified": "2015-05-12T15:50:38Z",
48
- "content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
49
- "file_lock_info": {
50
- "created": "2015-05-12T15:50:38Z",
51
- "is_lockholder": true,
52
- "lockholder_name": "Imaginary User"
53
- },
54
- "has_explicit_shared_members": false,
55
- "id": "id:a4ayc_80_OEAAAAAAAAAXw",
56
- "is_downloadable": true,
57
- "name": "Prime_Numbers.txt",
58
- "path_display": "/Homework/math/Prime_Numbers.txt",
59
- "path_lower": "/homework/math/prime_numbers.txt",
60
- "property_groups": [
61
- {
62
- "fields": [
63
- {
64
- "name": "Security Policy",
65
- "value": "Confidential"
66
- }
67
- ],
68
- "template_id": "ptid:1a5n2i6d3OYEAAAAAAAAAYa"
69
- }
70
- ],
71
- "rev": "a1c10ce0dd78",
72
- "server_modified": "2015-05-12T15:50:38Z",
73
- "sharing_info": {
74
- "modified_by": "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc",
75
- "parent_shared_folder_id": "84528192421",
76
- "read_only": true
77
- },
78
- "size": 7212
79
- },
80
40
  run(context) {
81
41
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
42
  const params = {
@@ -92,7 +52,7 @@ exports.dropboxCreateNewTextFile = (0, pieces_framework_1.createAction)({
92
52
  body: Buffer.from(context.propsValue.text, 'utf-8'),
93
53
  authentication: {
94
54
  type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
95
- token: context.propsValue.authentication.access_token,
55
+ token: context.auth.access_token,
96
56
  },
97
57
  headers: {
98
58
  "Dropbox-API-Arg": JSON.stringify(params),
@@ -108,6 +68,6 @@ exports.dropboxCreateNewTextFile = (0, pieces_framework_1.createAction)({
108
68
  return result;
109
69
  }
110
70
  });
111
- }
71
+ },
112
72
  });
113
73
  //# sourceMappingURL=create-new-text-file.js.map
@@ -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,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,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;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,YAAY;iBACtD;gBACD,OAAO,EAAE;oBACP,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;oBACzC,cAAc,EAAE,0BAA0B;iBAC3C;aACF,CAAA;YAED,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACpD,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;YAEjD,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE;gBACxB,OAAO,MAAM,CAAC,IAAI,CAAA;aACnB;iBAAM;gBACL,OAAO,MAAM,CAAA;aACd;QACH,CAAC;KAAA;CACF,CAAC,CAAA"}
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,qEAAuE;AACvE,+DAAqG;AACrG,8BAAoC;AAEvB,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,eAAW;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,EAAE,yIAAyI;YACtJ,QAAQ,EAAE,KA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OAAO,MAAM,CAAA;aACd;QACH,CAAC;KAAA;CACF,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const dropboxDeleteFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,41 @@
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 __1 = require("../../");
8
+ exports.dropboxDeleteFile = (0, pieces_framework_1.createAction)({
9
+ 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/delete-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACH,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,MAAM,GAAG;gBACX,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;aAChC,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACxC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,8CAA8C;gBACnD,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE;gBACvC,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACnC;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const dropboxDeleteFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,41 @@
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 __1 = require("../../");
8
+ exports.dropboxDeleteFolder = (0, pieces_framework_1.createAction)({
9
+ 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-folder.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/delete-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE;QACH,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,MAAM,GAAG;gBACX,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;aAChC,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACxC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,8CAA8C;gBACnD,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACnC;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const dropboxGetFileLink: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,41 @@
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 __1 = require("../..");
8
+ exports.dropboxGetFileLink = (0, pieces_framework_1.createAction)({
9
+ 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file-link.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/get-file-link.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,6BAAoC;AAEvB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,yBAAyB;IACtC,KAAK,EAAE;QACH,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,MAAM,GAAG;gBACX,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;aAChC,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACxC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,uDAAuD;gBAC5D,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE;gBACvC,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBAEnC;aAEJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const dropboxListAFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, 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
+ }>;
@@ -0,0 +1,54 @@
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 __1 = require("../../");
8
+ exports.dropboxListAFolder = (0, pieces_framework_1.createAction)({
9
+ 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-a-folder.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/list-a-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE;QACH,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,+FAA+F;YAC5G,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,mJAAmJ;YAChK,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACnB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,iGAAiG;YAC9G,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,MAAM,GAAG;gBACX,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;aAC1C,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACxC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,gDAAgD;gBACrD,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACnC;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const dropboxMoveFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, 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
+ }>;
@@ -0,0 +1,61 @@
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 __1 = require("../../");
8
+ exports.dropboxMoveFile = (0, pieces_framework_1.createAction)({
9
+ 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/move-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE;QACH,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,0DAA0D;YACvE,QA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framework").OAuth2Property<true, 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
+ }>;
@@ -0,0 +1,61 @@
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 __1 = require("../../");
8
+ exports.dropboxMoveFolder = (0, pieces_framework_1.createAction)({
9
+ 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-folder.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/move-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACH,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,+DAA+D;YAC5E,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,gGAAgG;YAC7G,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,wBAAwB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxC,WAAW,EAAE,0BAA0B;YACvC,WAAW,EAAE,yEAAyE;YACtF,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,MAAM,GAAG;gBACX,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;aACxE,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACxC,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,4CAA4C;gBACjD,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACnC;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const dropboxSearch: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ path: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ max_results: import("@activepieces/pieces-framework").NumberProperty<false>;
5
+ order_by: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
+ file_status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
7
+ filename_only: import("@activepieces/pieces-framework").CheckboxProperty<false>;
8
+ file_extensions: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ file_categories: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ account_id: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ }>;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxSearch = 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 __1 = require("../..");
8
+ exports.dropboxSearch = (0, pieces_framework_1.createAction)({
9
+ auth: __1.dropboxAuth,
10
+ name: 'search_dropbox',
11
+ description: 'Search for files and folders',
12
+ displayName: 'Search',
13
+ props: {
14
+ query: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Query',
16
+ description: 'The search string. Must be at least 3 characters.',
17
+ required: true,
18
+ }),
19
+ path: pieces_framework_1.Property.ShortText({
20
+ displayName: 'Path',
21
+ description: 'The path to search in. If not specified, the search is performed from the root.',
22
+ required: false,
23
+ }),
24
+ max_results: pieces_framework_1.Property.Number({
25
+ displayName: 'Max Results',
26
+ description: 'The maximum number of search results to return (up to 1000). Default is 100 if not specified.',
27
+ required: false,
28
+ }),
29
+ order_by: pieces_framework_1.Property.StaticDropdown({
30
+ displayName: 'Order By',
31
+ description: 'Specified property of the order of search results.',
32
+ options: {
33
+ options: [
34
+ { label: 'Relevance', value: 'relevance' },
35
+ { label: 'Modified Time', value: 'modified_time' }
36
+ ]
37
+ },
38
+ defaultValue: 'relevance',
39
+ required: false
40
+ }),
41
+ file_status: pieces_framework_1.Property.StaticDropdown({
42
+ displayName: 'File Status',
43
+ description: 'Restricts search to the given file status.',
44
+ options: {
45
+ options: [
46
+ { label: 'Active', value: 'active' },
47
+ { label: 'Deleted', value: 'deleted' }
48
+ ]
49
+ },
50
+ defaultValue: 'active',
51
+ required: false
52
+ }),
53
+ filename_only: pieces_framework_1.Property.Checkbox({
54
+ displayName: 'Filename Only',
55
+ description: 'Restricts search to only match on filenames.',
56
+ defaultValue: false,
57
+ required: false,
58
+ }),
59
+ file_extensions: pieces_framework_1.Property.ShortText({
60
+ displayName: 'File Extensions',
61
+ description: 'Restricts search to only the extensions specified (comma-separated).',
62
+ required: false,
63
+ }),
64
+ file_categories: pieces_framework_1.Property.ShortText({
65
+ displayName: 'File Categories',
66
+ description: 'Restricts search to only the file categories specified (comma-separated).',
67
+ required: false,
68
+ }),
69
+ account_id: pieces_framework_1.Property.ShortText({
70
+ displayName: 'Account ID',
71
+ description: 'Restricts results to the given account id.',
72
+ required: false,
73
+ }),
74
+ },
75
+ run(context) {
76
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
77
+ const options = {
78
+ path: context.propsValue.path || "",
79
+ max_results: context.propsValue.max_results || 100,
80
+ file_status: context.propsValue.file_status,
81
+ filename_only: context.propsValue.filename_only,
82
+ file_extensions: context.propsValue.file_extensions ? context.propsValue.file_extensions.split(',') : undefined,
83
+ file_categories: context.propsValue.file_categories ? context.propsValue.file_categories.split(',') : undefined,
84
+ account_id: context.propsValue.account_id
85
+ };
86
+ const requestBody = {
87
+ query: context.propsValue.query,
88
+ options: options
89
+ };
90
+ const result = yield pieces_common_1.httpClient.sendRequest({
91
+ method: pieces_common_1.HttpMethod.POST,
92
+ url: `https://api.dropboxapi.com/2/files/search_v2`,
93
+ headers: {
94
+ 'Content-Type': 'application/json'
95
+ },
96
+ body: requestBody,
97
+ authentication: {
98
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
99
+ token: context.auth.access_token,
100
+ }
101
+ });
102
+ return result.body;
103
+ });
104
+ }
105
+ });
106
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/search.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,6BAAoC;AAEvB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE;QACH,KAAK,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AAG,EAAE,8CAA8C;gBACnD,OAAO,EAAE;oBACL,cAAc,EAAE,kBAAkB;iBACrC;gBACD,IAAI,EAAE,WAAW;gBACjB,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;iBACnC;aACJ,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const dropboxUploadFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ path: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ file: import("@activepieces/pieces-framework").FileProperty<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
+ }>;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxUploadFile = 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 __1 = require("../../");
8
+ exports.dropboxUploadFile = (0, pieces_framework_1.createAction)({
9
+ auth: __1.dropboxAuth,
10
+ name: 'upload_dropbox_file',
11
+ description: 'Upload a file',
12
+ displayName: 'Upload file',
13
+ props: {
14
+ path: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Path',
16
+ description: 'The path where the file should be saved (e.g. /folder1/file.txt)',
17
+ required: true,
18
+ }),
19
+ file: pieces_framework_1.Property.File({
20
+ displayName: "File",
21
+ description: "The file URL or base64 to upload",
22
+ required: true,
23
+ }),
24
+ autorename: pieces_framework_1.Property.Checkbox({
25
+ displayName: 'Auto Rename',
26
+ description: "If there's a conflict, as determined by mode, have the Dropbox server try to autorename the file to avoid conflict.",
27
+ defaultValue: false,
28
+ required: false,
29
+ }),
30
+ mute: pieces_framework_1.Property.Checkbox({
31
+ displayName: 'Mute',
32
+ 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.",
33
+ required: false
34
+ }),
35
+ strict_conflict: pieces_framework_1.Property.Checkbox({
36
+ displayName: 'Strict conflict',
37
+ 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.',
38
+ required: false
39
+ }),
40
+ },
41
+ run(context) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ const fileData = context.propsValue.file;
44
+ const params = {
45
+ autorename: context.propsValue.autorename,
46
+ path: context.propsValue.path,
47
+ mode: "add",
48
+ mute: context.propsValue.mute,
49
+ strict_conflict: context.propsValue.strict_conflict
50
+ };
51
+ const fileBuffer = Buffer.from(fileData.base64, 'base64');
52
+ const result = yield pieces_common_1.httpClient.sendRequest({
53
+ method: pieces_common_1.HttpMethod.POST,
54
+ url: `https://content.dropboxapi.com/2/files/upload`,
55
+ body: fileBuffer,
56
+ headers: {
57
+ 'Dropbox-API-Arg': JSON.stringify(params),
58
+ 'Content-Type': 'application/octet-stream'
59
+ },
60
+ authentication: {
61
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
62
+ token: context.auth.access_token,
63
+ }
64
+ });
65
+ return result.body;
66
+ });
67
+ }
68
+ });
69
+ //# sourceMappingURL=upload-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/dropbox/src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,8BAAqC;AAExB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,E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