@pipedream/dropbox 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,7 +1,41 @@
1
- Copyright 2020 Pipedream, Inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Pipedream Source Available License Version 1.0
2
+
3
+ This Pipedream Source Available License Agreement Version 1.0 (this “Agreement”) sets forth the terms on which Pipedream, Inc., a Delaware corporation (“Pipedream”) makes available certain software (the Software). By installing, downloading, accessing, using or distributing the Software, you agree to the terms of this Agreement. If you do not agree to such terms, you must not use the Software. If you are receiving the Software on behalf of a legal entity, you represent and warrant that you have the actual authority to agree to the terms and conditions of this Agreement on behalf of such entity. “Licensee” means you, an individual, or the entity on whose behalf you are receiving the Software.
4
+
5
+ LICENSE GRANT AND CONDITIONS.
6
+
7
+ 1.1 License. Subject to the terms and conditions of this Agreement, Pipedream hereby grants to Licensee a non-exclusive, royalty-free, worldwide, non-transferable, non-sublicenseable license during the term of this Agreement to use, prepare modifications and derivative works, distribute (including without limitation in source code or object code form) and reproduce copies of the Software (the “License”). Licensee is not granted the right to, and Licensee shall not, exercise the License for an Excluded Purpose. For purposes of this Agreement, “Excluded Purpose” means any commercial use of the software including, but not limited to, making available any software-as-a-service, platform-as-a-service, infrastructure-as-a-service or other online service that competes with the Software or any other Pipedream products or services.
8
+
9
+ 1.2 Conditions. In consideration of the License, Licensee’s distribution of the Software is subject to the following conditions:
10
+
11
+ a. Licensee must cause any Software modified by Licensee to carry prominent notices stating that Licensee modified the Software.
12
+
13
+ b. On each Software copy, Licensee shall reproduce and not remove or alter all Pipedream or third party copyright or other proprietary notices contained in the Software, and Licensee must provide this with each copy: “This software is made available by Pipedream, Inc., under the terms of the Pipedream Source Available License, Version 1.0 located at https://github.com/PipedreamHQ/pipedream/blob/master/LICENSE. By installing, downloading, accessing, using or distributing the Software, you agree to the terms of such License Agreement.”
14
+
15
+ 1.3 Modifications. Licensee may add its own copyright notices to modifications made by Licensee and may provide additional or different license terms and conditions for use, reproduction, or distribution of Licensee’s modifications. While redistributing the Software or modifications thereof, Licensee may choose to offer, for a fee or free of charge, support, warranty, indemnity, or other obligations. Licensee, and not Pipedream, will be responsible for any such obligations.
16
+
17
+ 1.4 No Sublicensing. The License does not include the right to sublicense the Software; provided, however, that any recipient to which Licensee provides the Software may exercise the License so long as such recipient agrees to the terms and conditions of this Agreement.
18
+
19
+ TERM AND TERMINATION.
20
+
21
+ This Agreement will continue unless and until earlier terminated as set forth herein. If Licensee breaches any of its conditions or obligations under this Agreement, this Agreement will terminate automatically and the License will terminate automatically and permanently.
22
+
23
+ INTELLECTUAL PROPERTY.
24
+
25
+ As between the parties, Pipedream retains all right, title, and interest in the Software, and all intellectual property rights therein. Pipedream hereby reserves all rights not expressly granted to Licensee in this Agreement. Pipedream reserves all rights in its trademarks and service marks, and no licenses thereto are granted by this Agreement.
26
+
27
+ DISCLAIMER.
28
+
29
+ PIPEDREAM HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE.
30
+
31
+ LIMITATION OF LIABILITY.
32
+
33
+ PIPEDREAM WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL, SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT. THE FOREGOING SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
34
+
35
+ GENERAL.
36
+
37
+ 6.1 Governing Law. This Agreement will be governed by and interpreted in accordance with the laws of the state of California, without reference to its conflict of laws principles. If Licensee is located outside of the United States, any dispute, controversy or claim arising out of or relating to this Agreement will be referred to and finally determined by arbitration in accordance with the JAMS International Arbitration Rules. The tribunal will consist of one arbitrator. Judgment upon the award rendered by the arbitrator may be entered in any court having jurisdiction thereof. All disputes including arbitrations shall take place in Santa Clara County, California. The language to be used in any such proceedings shall be English.
38
+
39
+ 6.2. Assignment. Licensee is not authorized to assign its rights under this Agreement to any third party. Pipedream may freely assign its rights under this Agreement to any third party.
40
+
41
+ 6.3. Other. This Agreement is the entire agreement between the parties regarding the subject matter hereof. No amendment or modification of this Agreement will be valid or binding upon the parties unless made in writing and signed by the duly authorized representatives of both parties. In the event that any provision, including without limitation any condition, of this Agreement is held to be unenforceable, this Agreement and all licenses and rights granted hereunder will immediately terminate. Waiver by Pipedream of a breach of any provision of this Agreement or the failure by Pipedream to exercise any right hereunder will not be construed as a waiver of any subsequent breach of that right or as a waiver of any other right.
@@ -6,7 +6,7 @@ export default {
6
6
  name: "Create a Text File",
7
7
  description: "Creates a brand new text file from plain text content you specify. [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesUpload__anchor)",
8
8
  key: "dropbox-create-a-text-file",
9
- version: "0.0.4",
9
+ version: "0.0.5",
10
10
  type: "action",
11
11
  props: {
12
12
  dropbox,
@@ -6,7 +6,7 @@ export default {
6
6
  name: "Create folder",
7
7
  description: "Create a folder. [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesCreateFolderV2__anchor)",
8
8
  key: "dropbox-create-folder",
9
- version: "0.0.4",
9
+ version: "0.0.5",
10
10
  type: "action",
11
11
  props: {
12
12
  dropbox,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Create or Append to a Text File",
6
6
  description: "Adds a new line to an existing text file, or creates a file if it doesn't exist. [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesUpload__anchor)",
7
7
  key: "dropbox-create-or-append-to-a-text-file",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  type: "action",
10
10
  props: {
11
11
  dropbox,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "Create/Update a Share Link",
6
6
  description: "Creates or updates a public share link to the file or folder (It allows to share the file or folder with anyone). [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#sharingCreateSharedLinkWithSettings__anchor)",
7
7
  key: "dropbox-create-update-share-link",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  type: "action",
10
10
  props: {
11
11
  dropbox,
@@ -4,7 +4,7 @@ export default {
4
4
  name: "Delete a File/Folder",
5
5
  description: "Permanently removes a file/folder from the server. [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesDeleteV2__anchor)",
6
6
  key: "dropbox-delete-file-folder",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
8
  type: "action",
9
9
  props: {
10
10
  dropbox,
@@ -4,7 +4,7 @@ export default {
4
4
  name: "List All Files/Subfolders in a Folder",
5
5
  description: "Retrieves a list of files or subfolders in a specified folder [See the docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListFolder__anchor)",
6
6
  key: "dropbox-list-file-folders-in-a-folder",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
8
  type: "action",
9
9
  props: {
10
10
  dropbox,
@@ -5,7 +5,7 @@ export default {
5
5
  name: "List File Revisions",
6
6
  description: "Retrieves a list of file revisions needed to recover previous content. [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListRevisions__anchor)",
7
7
  key: "dropbox-list-file-revisions",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
9
  type: "action",
10
10
  props: {
11
11
  dropbox,
@@ -4,7 +4,7 @@ export default {
4
4
  name: "Move a File/Folder",
5
5
  description: "Moves a file or folder to a different location in the user's Dropbox [See the docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesMoveV2__anchor)",
6
6
  key: "dropbox-move-file-folder",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
8
  type: "action",
9
9
  props: {
10
10
  dropbox,
@@ -4,7 +4,7 @@ export default {
4
4
  name: "Rename a File/Folder",
5
5
  description: "Renames a file or folder in the user's Dropbox [See the docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesMoveV2__anchor)",
6
6
  key: "dropbox-rename-file-folder",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
8
  type: "action",
9
9
  props: {
10
10
  dropbox,
@@ -4,7 +4,7 @@ export default {
4
4
  name: "Restore a File",
5
5
  description: "Restores a previous file version. [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesRestore__anchor)",
6
6
  key: "dropbox-restore-a-file",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
8
  type: "action",
9
9
  props: {
10
10
  dropbox,
@@ -7,7 +7,7 @@ export default {
7
7
  name: "Search files and folders",
8
8
  description: "Searches for files and folders by name. [See the docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesSearchV2__anchor)",
9
9
  key: "dropbox-search-files-folders",
10
- version: "0.0.4",
10
+ version: "0.0.5",
11
11
  type: "action",
12
12
  props: {
13
13
  dropbox,
@@ -9,7 +9,7 @@ export default {
9
9
  name: "Upload a File",
10
10
  description: "Uploads a file to a selected folder. [See docs here](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesUpload__anchor)",
11
11
  key: "dropbox-upload-file",
12
- version: "0.0.5",
12
+ version: "0.0.6",
13
13
  type: "action",
14
14
  props: {
15
15
  dropbox,
package/dropbox.app.mjs CHANGED
@@ -173,38 +173,49 @@ export default {
173
173
  omitFiles,
174
174
  } = opts;
175
175
 
176
- const LIMIT = config.GET_PATH_OPTIONS.DEFAULT_MAX_RESULTS;
177
-
178
176
  let data = [];
179
177
  let res = null;
180
- let nextCursor = null;
181
- let lastPage = false;
182
178
  path = path === "/" || path === null
183
179
  ? ""
184
180
  : path;
185
- const dpx = await this.sdk();
186
181
 
187
- if (prevCursor) {
188
- res = await dpx.filesListFolderContinue({
189
- cursor: prevCursor,
190
- });
191
- } else {
182
+ const dpx = await this.sdk();
183
+ if (path === "") {
192
184
  res = await dpx.filesListFolder({
193
185
  path,
194
- limit: LIMIT,
186
+ limit: config.GET_PATH_OPTIONS.DEFAULT_MAX_RESULTS,
195
187
  recursive: true,
196
188
  });
197
- }
198
-
199
- data = res.result.entries.map((item) => ({
200
- path: item.path_display,
201
- type: item[".tag"],
202
- }));
203
189
 
204
- if (res.result.has_more) {
205
- nextCursor = res.result.cursor;
190
+ data = res.result.entries.map((item) => ({
191
+ path: item.path_display,
192
+ type: item[".tag"],
193
+ }));
206
194
  } else {
207
- lastPage = true;
195
+ res = await this.searchFilesFolders({
196
+ query: path,
197
+ options: {
198
+ path: "",
199
+ },
200
+ });
201
+
202
+ data = res.map(({ metadata }) => ({
203
+ path: metadata.metadata.path_display,
204
+ type: metadata.metadata[".tag"],
205
+ }));
206
+
207
+ const folders = data.filter((item) => item.type !== "file");
208
+ for (const folder of folders) {
209
+ res = await dpx.filesListFolder({
210
+ path: folder.path,
211
+ recursive: true,
212
+ });
213
+ const folderData = res.result?.entries?.map((item) => ({
214
+ path: item.path_display,
215
+ type: item[".tag"],
216
+ }));
217
+ data.push(...folderData);
218
+ }
208
219
  }
209
220
 
210
221
  if (omitFiles) {
@@ -223,13 +234,8 @@ export default {
223
234
  -1;
224
235
  });
225
236
 
226
- return {
227
- options: data,
228
- context: {
229
- cursor: nextCursor,
230
- reachedLastPage: lastPage,
231
- },
232
- };
237
+ return data;
238
+
233
239
  } catch (err) {
234
240
  console.log(err);
235
241
  return [];
package/package.json CHANGED
@@ -1,15 +1,14 @@
1
1
  {
2
2
  "name": "@pipedream/dropbox",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Pipedream Dropbox Components",
5
- "main": "dropbox.app.js",
5
+ "main": "dropbox.app.mjs",
6
6
  "keywords": [
7
7
  "pipedream",
8
8
  "dropbox"
9
9
  ],
10
10
  "homepage": "https://pipedream.com/apps/dropbox",
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
- "license": "MIT",
13
12
  "dependencies": {
14
13
  "dropbox": "^8.2.0",
15
14
  "isomorphic-fetch": "^3.0.0"
@@ -6,7 +6,7 @@ export default {
6
6
  type: "source",
7
7
  key: "dropbox-all-updates",
8
8
  name: "New or Modified File or Folder",
9
- version: "0.0.10",
9
+ version: "0.0.11",
10
10
  description: "Emit new event when a file or folder is added or modified. Make sure the number of files/folders in the watched folder does not exceed 4000.",
11
11
  props: {
12
12
  ...common.props,
@@ -6,7 +6,7 @@ export default {
6
6
  type: "source",
7
7
  key: "dropbox-new-file",
8
8
  name: "New File",
9
- version: "0.0.10",
9
+ version: "0.0.11",
10
10
  description: "Emit new event when a new file is added to your account or a specific folder. Make sure the number of files/folders in the watched folder does not exceed 4000.",
11
11
  props: {
12
12
  ...common.props,
@@ -6,7 +6,7 @@ export default {
6
6
  type: "source",
7
7
  key: "dropbox-new-folder",
8
8
  name: "New Folder",
9
- version: "0.0.10",
9
+ version: "0.0.11",
10
10
  description: "Emit new event when a new folder is created. Make sure the number of files/folders in the watched folder does not exceed 4000.",
11
11
  hooks: {
12
12
  async activate() {