@activepieces/piece-google-drive 0.5.40 → 0.5.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-drive",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.41",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@ai-sdk/anthropic": "1.2.12",
|
|
6
|
+
"@ai-sdk/google": "1.2.19",
|
|
6
7
|
"@ai-sdk/openai": "1.3.22",
|
|
7
8
|
"@ai-sdk/replicate": "0.2.8",
|
|
8
9
|
"@sinclair/typebox": "0.34.11",
|
|
@@ -18,11 +19,11 @@
|
|
|
18
19
|
"mime-types": "2.1.35",
|
|
19
20
|
"nanoid": "3.3.8",
|
|
20
21
|
"semver": "7.6.0",
|
|
21
|
-
"zod": "3.25.
|
|
22
|
-
"@activepieces/pieces-common": "0.
|
|
23
|
-
"@activepieces/pieces-framework": "0.14.
|
|
24
|
-
"@activepieces/shared": "0.
|
|
25
|
-
"tslib": "
|
|
22
|
+
"zod": "3.25.67",
|
|
23
|
+
"@activepieces/pieces-common": "0.5.2",
|
|
24
|
+
"@activepieces/pieces-framework": "0.14.1",
|
|
25
|
+
"@activepieces/shared": "0.14.5",
|
|
26
|
+
"tslib": "2.8.1"
|
|
26
27
|
},
|
|
27
28
|
"overrides": {
|
|
28
29
|
"@tryfabric/martian": {
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"resolutions": {
|
|
36
37
|
"rollup": "npm:@rollup/wasm-node"
|
|
37
38
|
},
|
|
39
|
+
"types": "./src/index.d.ts",
|
|
38
40
|
"main": "./src/index.js",
|
|
39
|
-
"type": "commonjs"
|
|
40
|
-
"types": "./src/index.d.ts"
|
|
41
|
+
"type": "commonjs"
|
|
41
42
|
}
|
|
@@ -2,4 +2,5 @@ export declare const googleDriveListFiles: import("@activepieces/pieces-framewor
|
|
|
2
2
|
folderId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
3
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
4
|
includeTrashed: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
|
+
downloadFiles: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
6
|
}>;
|
|
@@ -7,6 +7,7 @@ const index_1 = require("../../index");
|
|
|
7
7
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
8
8
|
const querystring_1 = tslib_1.__importDefault(require("querystring"));
|
|
9
9
|
const common_1 = require("../common");
|
|
10
|
+
const get_file_content_1 = require("../common/get-file-content");
|
|
10
11
|
exports.googleDriveListFiles = (0, pieces_framework_1.createAction)({
|
|
11
12
|
auth: index_1.googleDriveAuth,
|
|
12
13
|
name: 'list-files',
|
|
@@ -25,13 +26,19 @@ exports.googleDriveListFiles = (0, pieces_framework_1.createAction)({
|
|
|
25
26
|
required: false,
|
|
26
27
|
defaultValue: false
|
|
27
28
|
}),
|
|
29
|
+
downloadFiles: pieces_framework_1.Property.Checkbox({
|
|
30
|
+
displayName: 'Download Files',
|
|
31
|
+
description: 'Download all file contents in a list',
|
|
32
|
+
required: false,
|
|
33
|
+
defaultValue: false
|
|
34
|
+
}),
|
|
28
35
|
},
|
|
29
36
|
run(context) {
|
|
30
37
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
38
|
const result = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
type: 'drive#fileList',
|
|
40
|
+
incompleteSearch: false,
|
|
41
|
+
files: [],
|
|
35
42
|
};
|
|
36
43
|
let q = `'${context.propsValue.folderId}' in parents`;
|
|
37
44
|
// When include_trashed is false, we add a filter to exclude trashed files.
|
|
@@ -65,6 +72,20 @@ exports.googleDriveListFiles = (0, pieces_framework_1.createAction)({
|
|
|
65
72
|
result.files.push(...response.body.files);
|
|
66
73
|
result.incompleteSearch = result.incompleteSearch || response.body.incompleteSearch;
|
|
67
74
|
}
|
|
75
|
+
// If downloadFiles is enabled, download each file and add URLs to array
|
|
76
|
+
if (context.propsValue.downloadFiles) {
|
|
77
|
+
const downloadedFiles = [];
|
|
78
|
+
for (const file of result.files) {
|
|
79
|
+
try {
|
|
80
|
+
const fileUrl = yield (0, get_file_content_1.downloadFileFromDrive)(context.auth, context.files, file.id, file.name);
|
|
81
|
+
downloadedFiles.push(fileUrl);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.warn(`Failed to download file ${file.name}: ${error instanceof Error ? error.message : 'Download failed'}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
result.downloadedFiles = downloadedFiles;
|
|
88
|
+
}
|
|
68
89
|
return result;
|
|
69
90
|
});
|
|
70
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-files.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-drive/src/lib/action/list-files.action.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,uCAA8C;AAC9C,qEAAwE;AACxE,sEAAsC;AACtC,sCAAmC;
|
|
1
|
+
{"version":3,"file":"list-files.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-drive/src/lib/action/list-files.action.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,uCAA8C;AAC9C,qEAAwE;AACxE,sEAAsC;AACtC,sCAAmC;AACnC,iEAAmE;AAStD,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,uBAAe;IACrB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,uCAAuC;IACpD,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,IAAI;SACf,CAAC;QACF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