@divyacon/piece-dropbox 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +65 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/copy-file.d.ts +7 -0
  7. package/dist/lib/actions/copy-file.d.ts.map +1 -0
  8. package/dist/lib/actions/copy-file.js +65 -0
  9. package/dist/lib/actions/copy-file.js.map +1 -0
  10. package/dist/lib/actions/copy-folder.d.ts +7 -0
  11. package/dist/lib/actions/copy-folder.d.ts.map +1 -0
  12. package/dist/lib/actions/copy-folder.js +65 -0
  13. package/dist/lib/actions/copy-folder.js.map +1 -0
  14. package/dist/lib/actions/create-new-folder.d.ts +5 -0
  15. package/dist/lib/actions/create-new-folder.d.ts.map +1 -0
  16. package/dist/lib/actions/create-new-folder.js +54 -0
  17. package/dist/lib/actions/create-new-folder.js.map +1 -0
  18. package/dist/lib/actions/create-new-text-file.d.ts +8 -0
  19. package/dist/lib/actions/create-new-text-file.d.ts.map +1 -0
  20. package/dist/lib/actions/create-new-text-file.js +76 -0
  21. package/dist/lib/actions/create-new-text-file.js.map +1 -0
  22. package/dist/lib/actions/delete-file.d.ts +4 -0
  23. package/dist/lib/actions/delete-file.d.ts.map +1 -0
  24. package/dist/lib/actions/delete-file.js +45 -0
  25. package/dist/lib/actions/delete-file.js.map +1 -0
  26. package/dist/lib/actions/delete-folder.d.ts +4 -0
  27. package/dist/lib/actions/delete-folder.d.ts.map +1 -0
  28. package/dist/lib/actions/delete-folder.js +45 -0
  29. package/dist/lib/actions/delete-folder.js.map +1 -0
  30. package/dist/lib/actions/download-file.d.ts +4 -0
  31. package/dist/lib/actions/download-file.d.ts.map +1 -0
  32. package/dist/lib/actions/download-file.js +53 -0
  33. package/dist/lib/actions/download-file.js.map +1 -0
  34. package/dist/lib/actions/get-file-link.d.ts +4 -0
  35. package/dist/lib/actions/get-file-link.d.ts.map +1 -0
  36. package/dist/lib/actions/get-file-link.js +45 -0
  37. package/dist/lib/actions/get-file-link.js.map +1 -0
  38. package/dist/lib/actions/list-a-folder.d.ts +6 -0
  39. package/dist/lib/actions/list-a-folder.d.ts.map +1 -0
  40. package/dist/lib/actions/list-a-folder.js +58 -0
  41. package/dist/lib/actions/list-a-folder.js.map +1 -0
  42. package/dist/lib/actions/move-file.d.ts +7 -0
  43. package/dist/lib/actions/move-file.d.ts.map +1 -0
  44. package/dist/lib/actions/move-file.js +65 -0
  45. package/dist/lib/actions/move-file.js.map +1 -0
  46. package/dist/lib/actions/move-folder.d.ts +7 -0
  47. package/dist/lib/actions/move-folder.d.ts.map +1 -0
  48. package/dist/lib/actions/move-folder.js +65 -0
  49. package/dist/lib/actions/move-folder.js.map +1 -0
  50. package/dist/lib/actions/search.d.ts +12 -0
  51. package/dist/lib/actions/search.d.ts.map +1 -0
  52. package/dist/lib/actions/search.js +114 -0
  53. package/dist/lib/actions/search.js.map +1 -0
  54. package/dist/lib/actions/upload-file.d.ts +8 -0
  55. package/dist/lib/actions/upload-file.d.ts.map +1 -0
  56. package/dist/lib/actions/upload-file.js +75 -0
  57. package/dist/lib/actions/upload-file.js.map +1 -0
  58. package/dist/lib/auth.d.ts +2 -0
  59. package/dist/lib/auth.d.ts.map +1 -0
  60. package/dist/lib/auth.js +21 -0
  61. package/dist/lib/auth.js.map +1 -0
  62. package/dist/lib/triggers/new-folder.d.ts +15 -0
  63. package/dist/lib/triggers/new-folder.d.ts.map +1 -0
  64. package/dist/lib/triggers/new-folder.js +114 -0
  65. package/dist/lib/triggers/new-folder.js.map +1 -0
  66. package/package.json +43 -3
  67. package/src/index.ts +59 -0
  68. package/src/lib/actions/copy-file.ts +66 -0
  69. package/src/lib/actions/copy-folder.ts +66 -0
  70. package/src/lib/actions/create-new-folder.ts +54 -0
  71. package/src/lib/actions/create-new-text-file.ts +78 -0
  72. package/src/lib/actions/delete-file.ts +44 -0
  73. package/src/lib/actions/delete-folder.ts +43 -0
  74. package/src/lib/actions/download-file.ts +51 -0
  75. package/src/lib/actions/get-file-link.ts +43 -0
  76. package/src/lib/actions/list-a-folder.ts +59 -0
  77. package/src/lib/actions/move-file.ts +65 -0
  78. package/src/lib/actions/move-folder.ts +67 -0
  79. package/src/lib/actions/search.ts +117 -0
  80. package/src/lib/actions/upload-file.ts +79 -0
  81. package/src/lib/auth.ts +16 -0
  82. package/src/lib/triggers/new-folder.ts +167 -0
  83. package/README.md +0 -3
package/LICENSE.MIT-AP ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) Activepieces AB
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Derived helpers in this folder are adapted from Activepieces (MIT) for use
24
+ inside CX without depending on @activepieces/* packages at runtime.
@@ -0,0 +1,2 @@
1
+ export declare const dropbox: import("@agnocon/pieces-framework").Piece<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,OAAO,gJAqClB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropbox = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/index.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_common_1 = require("@agnocon/pieces-common");
8
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
9
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
10
+ const copy_file_1 = require("./lib/actions/copy-file");
11
+ const copy_folder_1 = require("./lib/actions/copy-folder");
12
+ const create_new_folder_1 = require("./lib/actions/create-new-folder");
13
+ const create_new_text_file_1 = require("./lib/actions/create-new-text-file");
14
+ const delete_file_1 = require("./lib/actions/delete-file");
15
+ const delete_folder_1 = require("./lib/actions/delete-folder");
16
+ const get_file_link_1 = require("./lib/actions/get-file-link");
17
+ const list_a_folder_1 = require("./lib/actions/list-a-folder");
18
+ const move_file_1 = require("./lib/actions/move-file");
19
+ const move_folder_1 = require("./lib/actions/move-folder");
20
+ const search_1 = require("./lib/actions/search");
21
+ const upload_file_1 = require("./lib/actions/upload-file");
22
+ const download_file_1 = require("./lib/actions/download-file");
23
+ const auth_1 = require("./lib/auth");
24
+ const new_folder_1 = require("./lib/triggers/new-folder");
25
+ exports.dropbox = (0, pieces_framework_1.createPiece)({
26
+ minimumSupportedRelease: '0.30.0',
27
+ logoUrl: 'https://cdn.activepieces.com/pieces/dropbox.png',
28
+ actions: [
29
+ search_1.dropboxSearch,
30
+ create_new_text_file_1.dropboxCreateNewTextFile,
31
+ upload_file_1.dropboxUploadFile,
32
+ download_file_1.dropboxDownloadFile,
33
+ get_file_link_1.dropboxGetFileLink,
34
+ delete_file_1.dropboxDeleteFile,
35
+ move_file_1.dropboxMoveFile,
36
+ copy_file_1.dropboxCopyFile,
37
+ create_new_folder_1.dropboxCreateNewFolder,
38
+ delete_folder_1.dropboxDeleteFolder,
39
+ move_folder_1.dropboxMoveFolder,
40
+ copy_folder_1.dropboxCopyFolder,
41
+ list_a_folder_1.dropboxListAFolder,
42
+ (0, pieces_common_1.createCustomApiCallAction)({
43
+ baseUrl: () => 'https://api.dropboxapi.com/2',
44
+ auth: auth_1.dropboxAuth,
45
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
46
+ return ({
47
+ Authorization: `Bearer ${auth.access_token}`,
48
+ });
49
+ }),
50
+ }),
51
+ ],
52
+ displayName: 'Dropbox',
53
+ description: 'Cloud storage and file synchronization',
54
+ authors: [
55
+ 'BastienMe',
56
+ 'kishanprmr',
57
+ 'MoShizzle',
58
+ 'khaledmashaly',
59
+ 'abuaboud',
60
+ ],
61
+ categories: [pieces_framework_2.PieceCategory.CONTENT_AND_FILES],
62
+ triggers: [new_folder_1.dropboxNewFolder],
63
+ auth: auth_1.dropboxAuth,
64
+ });
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,mFAAmF;AACnF,qEAAqE;AACrE,0DAAmE;AACnE,gEAEmC;AACnC,gEAA0D;AAC1D,uDAA0D;AAC1D,2DAA8D;AAC9D,uEAAyE;AACzE,6EAA8E;AAC9E,2DAA8D;AAC9D,+DAAkE;AAClE,+DAAiE;AACjE,+DAAiE;AACjE,uDAA0D;AAC1D,2DAA8D;AAC9D,iDAAqD;AACrD,2DAA8D;AAC9D,+DAAkE;AAClE,qCAAyC;AACzC,0DAA6D;AAEhD,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE;QACP,sBAAa;QACb,+CAAwB;QACxB,+BAAiB;QACjB,mCAAmB;QACnB,kCAAkB;QAClB,+BAAiB;QACjB,2BAAe;QACf,2BAAe;QACf,0CAAsB;QACtB,mCAAmB;QACnB,+BAAiB;QACjB,+BAAiB;QACjB,kCAAkB;QAClB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,8BAA8B;YAC7C,IAAI,EAAE,kBAAW;YACjB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,YAAY,EAAE;iBAC7C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,wCAAwC;IACrD,OAAO,EAAE;QACP,WAAW;QACX,YAAY;QACZ,WAAW;QACX,eAAe;QACf,UAAU;KACX;IACD,UAAU,EAAE,CAAC,gCAAa,CAAC,iBAAiB,CAAC;IAC7C,QAAQ,EAAE,CAAC,6BAAgB,CAAC;IAC5B,IAAI,EAAE,kBAAW;CAClB,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const dropboxCopyFile: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ from_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ to_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ autorename: import("@agnocon/pieces-framework").CheckboxProperty<false>;
5
+ allow_ownership_transfer: import("@agnocon/pieces-framework").CheckboxProperty<false>;
6
+ }>;
7
+ //# sourceMappingURL=copy-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-file.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/copy-file.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe;;;;;EAyD1B,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxCopyFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/copy-file.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ exports.dropboxCopyFile = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.dropboxAuth,
12
+ name: 'copy_dropbox_file',
13
+ description: 'Copy a file',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Copies the file at the source path to a new destination path within Dropbox, leaving the original in place; optionally autorenames on conflict. Use to duplicate a single file. Not idempotent: each call creates a copy, so repeating it errors on conflict or, with autorename, produces additional duplicates.', idempotent: false },
16
+ displayName: 'Copy file',
17
+ props: {
18
+ from_path: pieces_framework_1.Property.ShortText({
19
+ displayName: 'From Path',
20
+ description: 'The source path of the file (e.g. /folder1/sourcefile.txt)',
21
+ required: true,
22
+ }),
23
+ to_path: pieces_framework_1.Property.ShortText({
24
+ displayName: 'To Path',
25
+ description: 'The destination path for the copied (e.g. /folder2/destinationfile.txt)',
26
+ required: true,
27
+ }),
28
+ autorename: pieces_framework_1.Property.Checkbox({
29
+ displayName: 'Auto Rename',
30
+ description: "If there's a conflict, have the Dropbox server try to autorename the file to avoid conflict.",
31
+ defaultValue: false,
32
+ required: false,
33
+ }),
34
+ allow_ownership_transfer: pieces_framework_1.Property.Checkbox({
35
+ displayName: 'Allow Ownership Transfer',
36
+ description: 'Allows copy by owner even if it would result in an ownership transfer.',
37
+ defaultValue: false,
38
+ required: false,
39
+ }),
40
+ },
41
+ run(context) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ const params = {
44
+ from_path: context.propsValue.from_path,
45
+ to_path: context.propsValue.to_path,
46
+ autorename: context.propsValue.autorename,
47
+ allow_ownership_transfer: context.propsValue.allow_ownership_transfer,
48
+ };
49
+ const result = yield pieces_common_1.httpClient.sendRequest({
50
+ method: pieces_common_1.HttpMethod.POST,
51
+ url: `https://api.dropboxapi.com/2/files/copy_v2`,
52
+ headers: {
53
+ 'Content-Type': 'application/json',
54
+ },
55
+ body: params,
56
+ authentication: {
57
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
58
+ token: context.auth.access_token,
59
+ },
60
+ });
61
+ return result.body;
62
+ });
63
+ },
64
+ });
65
+ //# sourceMappingURL=copy-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-file.js","sourceRoot":"","sources":["../../../src/lib/actions/copy-file.ts"],"names":[],"mappings":";;;;AAAA,mGAAmG;AACnG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,mTAAmT,EAAE,UAAU,EAAE,KAAK,EAAE;IACnW,WAAW,EAAE,WAAW;IACxB,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,yEAAyE;YAC3E,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,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"}
@@ -0,0 +1,7 @@
1
+ export declare const dropboxCopyFolder: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ from_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ to_path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ autorename: import("@agnocon/pieces-framework").CheckboxProperty<false>;
5
+ allow_ownership_transfer: import("@agnocon/pieces-framework").CheckboxProperty<false>;
6
+ }>;
7
+ //# sourceMappingURL=copy-folder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-folder.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/copy-folder.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB;;;;;EAyD5B,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxCopyFolder = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/copy-folder.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ exports.dropboxCopyFolder = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.dropboxAuth,
12
+ name: 'copy_dropbox_folder',
13
+ description: 'Copy a folder',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Copies the folder at the source path, including its contents, to a new destination path within Dropbox, leaving the original in place; optionally autorenames on conflict. Use to duplicate an entire directory. Not idempotent: each call creates a copy, so repeating it errors on conflict or, with autorename, produces additional duplicates.', idempotent: false },
16
+ displayName: 'Copy folder',
17
+ props: {
18
+ from_path: pieces_framework_1.Property.ShortText({
19
+ displayName: 'From Path',
20
+ description: 'The source path of the folder (e.g. /folder1/sourceFolder)',
21
+ required: true,
22
+ }),
23
+ to_path: pieces_framework_1.Property.ShortText({
24
+ displayName: 'To Path',
25
+ description: 'The destination path for the copied folder (e.g. /folder2/destinationFolder)',
26
+ required: true,
27
+ }),
28
+ autorename: pieces_framework_1.Property.Checkbox({
29
+ displayName: 'Auto Rename',
30
+ description: "If there's a conflict, have the Dropbox server try to autorename the folder to avoid conflict.",
31
+ defaultValue: false,
32
+ required: false,
33
+ }),
34
+ allow_ownership_transfer: pieces_framework_1.Property.Checkbox({
35
+ displayName: 'Allow Ownership Transfer',
36
+ description: 'Allows copy by owner even if it would result in an ownership transfer.',
37
+ defaultValue: false,
38
+ required: false,
39
+ }),
40
+ },
41
+ run(context) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ const params = {
44
+ from_path: context.propsValue.from_path,
45
+ to_path: context.propsValue.to_path,
46
+ autorename: context.propsValue.autorename,
47
+ allow_ownership_transfer: context.propsValue.allow_ownership_transfer,
48
+ };
49
+ const result = yield pieces_common_1.httpClient.sendRequest({
50
+ method: pieces_common_1.HttpMethod.POST,
51
+ url: `https://api.dropboxapi.com/2/files/copy_v2`,
52
+ headers: {
53
+ 'Content-Type': 'application/json',
54
+ },
55
+ body: params,
56
+ authentication: {
57
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
58
+ token: context.auth.access_token,
59
+ },
60
+ });
61
+ return result.body;
62
+ });
63
+ },
64
+ });
65
+ //# sourceMappingURL=copy-folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-folder.js","sourceRoot":"","sources":["../../../src/lib/actions/copy-folder.ts"],"names":[],"mappings":";;;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,oVAAoV,EAAE,UAAU,EAAE,KAAK,EAAE;IACpY,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"}
@@ -0,0 +1,5 @@
1
+ export declare const dropboxCreateNewFolder: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ autorename: import("@agnocon/pieces-framework").CheckboxProperty<false>;
4
+ }>;
5
+ //# sourceMappingURL=create-new-folder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-new-folder.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-new-folder.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,sBAAsB;;;EA4CjC,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxCreateNewFolder = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/create-new-folder.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ exports.dropboxCreateNewFolder = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.dropboxAuth,
12
+ name: 'create_new_dropbox_folder',
13
+ description: 'Create a new empty folder',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Creates a new empty folder at the given Dropbox path; optionally autorenames on conflict. Use to set up a destination directory before placing files. Not idempotent: a repeat call for an existing path errors (or, with autorename, creates a differently named folder).', idempotent: false },
16
+ displayName: 'Create New Folder',
17
+ props: {
18
+ path: pieces_framework_1.Property.ShortText({
19
+ displayName: 'Path',
20
+ description: 'The path of the new folder e.g. /Homework/math',
21
+ required: true,
22
+ }),
23
+ autorename: pieces_framework_1.Property.Checkbox({
24
+ displayName: 'Auto Rename',
25
+ 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.",
26
+ required: false,
27
+ }),
28
+ },
29
+ run(context) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ const body = {
32
+ autorename: context.propsValue.autorename ? true : false,
33
+ path: context.propsValue.path,
34
+ };
35
+ const request = {
36
+ method: pieces_common_1.HttpMethod.POST,
37
+ url: `https://api.dropboxapi.com/2/files/create_folder_v2`,
38
+ body,
39
+ authentication: {
40
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
41
+ token: context.auth.access_token,
42
+ },
43
+ };
44
+ const result = yield pieces_common_1.httpClient.sendRequest(request);
45
+ if (result.status == 200) {
46
+ return result.body;
47
+ }
48
+ else {
49
+ return result;
50
+ }
51
+ });
52
+ },
53
+ });
54
+ //# sourceMappingURL=create-new-folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-new-folder.js","sourceRoot":"","sources":["../../../src/lib/actions/create-new-folder.ts"],"names":[],"mappings":";;;;AAAA,2GAA2G;AAC3G,qEAAqE;AACrE,gEAAmE;AACnE,0DAKgC;AAChC,kCAAsC;AAEzB,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,2BAA2B;IACxC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4QAA4Q,EAAE,UAAU,EAAE,KAAK,EAAE;IAC5T,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;YAErD,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"}
@@ -0,0 +1,8 @@
1
+ export declare const dropboxCreateNewTextFile: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ text: import("@agnocon/pieces-framework").LongTextProperty<true>;
4
+ autorename: import("@agnocon/pieces-framework").CheckboxProperty<false>;
5
+ mute: import("@agnocon/pieces-framework").CheckboxProperty<false>;
6
+ strict_conflict: import("@agnocon/pieces-framework").CheckboxProperty<false>;
7
+ }>;
8
+ //# sourceMappingURL=create-new-text-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-new-text-file.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-new-text-file.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,wBAAwB;;;;;;EAoEnC,CAAC"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxCreateNewTextFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/create-new-text-file.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ exports.dropboxCreateNewTextFile = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.dropboxAuth,
12
+ name: 'create_new_dropbox_text_file',
13
+ description: 'Create a new text file from text input',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Writes the provided text content to a new file at the given Dropbox path (upload in add mode). Use when an agent needs to persist generated or supplied text directly as a file without first producing a file object. Not idempotent: each call uploads, so repeating it can create autorenamed duplicates rather than overwriting.', idempotent: false },
16
+ displayName: 'Create New Text File',
17
+ props: {
18
+ path: pieces_framework_1.Property.ShortText({
19
+ displayName: 'Path',
20
+ description: 'The path of the new folder e.g. /Homework/math',
21
+ required: true,
22
+ }),
23
+ text: pieces_framework_1.Property.LongText({
24
+ displayName: 'Text',
25
+ description: 'The text to write into the file.',
26
+ required: true,
27
+ }),
28
+ autorename: pieces_framework_1.Property.Checkbox({
29
+ displayName: 'Autorename',
30
+ 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.",
31
+ required: false,
32
+ }),
33
+ mute: pieces_framework_1.Property.Checkbox({
34
+ displayName: 'Mute',
35
+ 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.",
36
+ required: false,
37
+ }),
38
+ strict_conflict: pieces_framework_1.Property.Checkbox({
39
+ displayName: 'Strict conflict',
40
+ 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.',
41
+ required: false,
42
+ }),
43
+ },
44
+ run(context) {
45
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
+ const params = {
47
+ autorename: context.propsValue.autorename,
48
+ path: context.propsValue.path,
49
+ mode: 'add',
50
+ mute: context.propsValue.mute,
51
+ strict_conflict: context.propsValue.strict_conflict,
52
+ };
53
+ const request = {
54
+ method: pieces_common_1.HttpMethod.POST,
55
+ url: `https://content.dropboxapi.com/2/files/upload`,
56
+ body: Buffer.from(context.propsValue.text, 'utf-8'),
57
+ authentication: {
58
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
59
+ token: context.auth.access_token,
60
+ },
61
+ headers: {
62
+ 'Dropbox-API-Arg': JSON.stringify(params),
63
+ 'Content-Type': 'application/octet-stream',
64
+ },
65
+ };
66
+ const result = yield pieces_common_1.httpClient.sendRequest(request);
67
+ if (result.status == 200) {
68
+ return result.body;
69
+ }
70
+ else {
71
+ return result;
72
+ }
73
+ });
74
+ },
75
+ });
76
+ //# sourceMappingURL=create-new-text-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-new-text-file.js","sourceRoot":"","sources":["../../../src/lib/actions/create-new-text-file.ts"],"names":[],"mappings":";;;;AAAA,8GAA8G;AAC9G,qEAAqE;AACrE,gEAAmE;AACnE,0DAKgC;AAChC,kCAAsC;AAEzB,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,wCAAwC;IACrD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sUAAsU,EAAE,UAAU,EAAE,KAAK,EAAE;IACtX,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;YAErD,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"}
@@ -0,0 +1,4 @@
1
+ export declare const dropboxDeleteFile: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ }>;
4
+ //# sourceMappingURL=delete-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-file.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/delete-file.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB;;EAmC5B,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxDeleteFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/delete-file.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ exports.dropboxDeleteFile = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.dropboxAuth,
12
+ name: 'delete_dropbox_file',
13
+ description: 'Delete a file',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Permanently deletes the file at the given Dropbox path. Use to remove a specific file an agent has resolved the path for. Effectively idempotent on the end state once the path is gone, but a repeat call fails because the path no longer exists; treat as a destructive, non-recoverable mutation.', idempotent: false },
16
+ displayName: 'Delete file',
17
+ props: {
18
+ path: pieces_framework_1.Property.ShortText({
19
+ displayName: 'Path',
20
+ description: 'The path of the file to be deleted (e.g. /folder1/file.txt)',
21
+ required: true,
22
+ }),
23
+ },
24
+ run(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ const params = {
27
+ path: context.propsValue.path,
28
+ };
29
+ const result = yield pieces_common_1.httpClient.sendRequest({
30
+ method: pieces_common_1.HttpMethod.POST,
31
+ url: `https://api.dropboxapi.com/2/files/delete_v2`,
32
+ headers: {
33
+ 'Content-Type': 'application/json',
34
+ },
35
+ body: { path: context.propsValue.path },
36
+ authentication: {
37
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
38
+ token: context.auth.access_token,
39
+ },
40
+ });
41
+ return result.body;
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=delete-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-file.js","sourceRoot":"","sources":["../../../src/lib/actions/delete-file.ts"],"names":[],"mappings":";;;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uSAAuS,EAAE,UAAU,EAAE,KAAK,EAAE;IACvV,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"}
@@ -0,0 +1,4 @@
1
+ export declare const dropboxDeleteFolder: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ }>;
4
+ //# sourceMappingURL=delete-folder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-folder.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/delete-folder.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB;;EAkC9B,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxDeleteFolder = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/delete-folder.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ exports.dropboxDeleteFolder = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.dropboxAuth,
12
+ name: 'delete_dropbox_folder',
13
+ description: 'Delete a folder',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Permanently deletes the folder at the given Dropbox path along with all of its contents. Use to remove an entire directory. Effectively idempotent on the end state once the path is gone, but a repeat call fails because the path no longer exists; treat as a destructive, non-recoverable mutation.', idempotent: false },
16
+ displayName: 'Delete folder',
17
+ props: {
18
+ path: pieces_framework_1.Property.ShortText({
19
+ displayName: 'Path',
20
+ description: 'The path of the folder to be deleted (e.g. /folder1)',
21
+ required: true,
22
+ }),
23
+ },
24
+ run(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ const params = {
27
+ path: context.propsValue.path,
28
+ };
29
+ const result = yield pieces_common_1.httpClient.sendRequest({
30
+ method: pieces_common_1.HttpMethod.POST,
31
+ url: `https://api.dropboxapi.com/2/files/delete_v2`,
32
+ headers: {
33
+ 'Content-Type': 'application/json',
34
+ },
35
+ body: params,
36
+ authentication: {
37
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
38
+ token: context.auth.access_token,
39
+ },
40
+ });
41
+ return result.body;
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=delete-folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-folder.js","sourceRoot":"","sources":["../../../src/lib/actions/delete-folder.ts"],"names":[],"mappings":";;;;AAAA,uGAAuG;AACvG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kCAAsC;AAEzB,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,iBAAiB;IAC9B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,ySAAyS,EAAE,UAAU,EAAE,KAAK,EAAE;IACzV,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"}
@@ -0,0 +1,4 @@
1
+ export declare const dropboxDownloadFile: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props>, {
2
+ path: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ }>;
4
+ //# sourceMappingURL=download-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download-file.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/download-file.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB;;EA0C9B,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropboxDownloadFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/dropbox/src/lib/actions/download-file.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ exports.dropboxDownloadFile = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.dropboxAuth,
12
+ name: 'downloadFile',
13
+ displayName: 'Download File',
14
+ description: 'Download a File from Dropbox',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Downloads the file at the given Dropbox path and returns it as a file object for use by later steps. Use to retrieve file contents into a flow. Read-only on Dropbox; repeating the call with the same path is safe and yields the same file.', idempotent: true },
17
+ props: {
18
+ path: pieces_framework_1.Property.ShortText({
19
+ displayName: "Path",
20
+ description: "The path of the file (e.g. /folder1/file.txt)",
21
+ required: true
22
+ })
23
+ },
24
+ run(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ var _a;
27
+ // Capture file name, if unsuccesfull default to output.pdf
28
+ const fileName = ((_a = context.propsValue.path.match(/[^/]+$/)) !== null && _a !== void 0 ? _a : ['output.pdf'])[0];
29
+ // For information about Dropbox JSON encoding, see https://www.dropbox.com/developers/reference/json-encoding
30
+ const dropboxApiArg = JSON.stringify({ path: context.propsValue.path }).replace(/[\u007f-\uffff]/g, (c) => '\\u' + ('000' + c.charCodeAt(0).toString(16)).slice(-4));
31
+ const result = yield pieces_common_1.httpClient.sendRequest({
32
+ method: pieces_common_1.HttpMethod.POST,
33
+ url: `https://content.dropboxapi.com/2/files/download`,
34
+ headers: {
35
+ 'Content-Type': 'application/octet-stream',
36
+ 'Dropbox-API-Arg': dropboxApiArg
37
+ },
38
+ authentication: {
39
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
40
+ token: context.auth.access_token,
41
+ },
42
+ responseType: 'arraybuffer'
43
+ });
44
+ return {
45
+ file: yield context.files.write({
46
+ fileName: fileName,
47
+ data: Buffer.from(result.body)
48
+ })
49
+ };
50
+ });
51
+ },
52
+ });
53
+ //# sourceMappingURL=download-file.js.map