@activepieces/piece-google-drive 0.5.12 → 0.5.14
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-drive",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.14",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "^1.6.3",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@activepieces/pieces-common": "0.2.6",
|
|
17
17
|
"@activepieces/pieces-framework": "0.7.11",
|
|
18
18
|
"@activepieces/shared": "0.10.61",
|
|
19
|
-
"tslib": "2.6.
|
|
19
|
+
"tslib": "2.6.2"
|
|
20
20
|
},
|
|
21
21
|
"main": "./src/index.js",
|
|
22
22
|
"type": "commonjs"
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,9 @@ const list_files_action_1 = require("./lib/action/list-files.action");
|
|
|
12
12
|
const search_folder_action_1 = require("./lib/action/search-folder.action");
|
|
13
13
|
const duplicate_file_action_1 = require("./lib/action/duplicate-file.action");
|
|
14
14
|
const save_file_as_pdf_action_1 = require("./lib/action/save-file-as-pdf.action");
|
|
15
|
+
const add_permission_action_1 = require("./lib/action/add-permission.action");
|
|
16
|
+
const delete_permission_action_1 = require("./lib/action/delete-permission.action");
|
|
17
|
+
const get_file_by_id_1 = require("./lib/action/get-file-by-id");
|
|
15
18
|
exports.googleDriveAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
16
19
|
description: '',
|
|
17
20
|
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
@@ -30,11 +33,14 @@ exports.googleDrive = (0, pieces_framework_1.createPiece)({
|
|
|
30
33
|
create_new_text_file_1.googleDriveCreateNewTextFile,
|
|
31
34
|
upload_file_1.googleDriveUploadFile,
|
|
32
35
|
read_file_1.readFile,
|
|
36
|
+
get_file_by_id_1.googleDriveGetResourceById,
|
|
33
37
|
list_files_action_1.googleDriveListFiles,
|
|
34
38
|
search_folder_action_1.googleDriveSearchFolder,
|
|
35
39
|
duplicate_file_action_1.duplicateFileAction,
|
|
36
|
-
save_file_as_pdf_action_1.saveFileAsPdf
|
|
40
|
+
save_file_as_pdf_action_1.saveFileAsPdf,
|
|
41
|
+
add_permission_action_1.addPermission,
|
|
42
|
+
delete_permission_action_1.deletePermission
|
|
37
43
|
],
|
|
38
|
-
auth: exports.googleDriveAuth
|
|
44
|
+
auth: exports.googleDriveAuth
|
|
39
45
|
});
|
|
40
46
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/google-drive/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AAExE,sEAA4E;AAC5E,4EAAiF;AACjF,0DAAiE;AACjE,sDAAkD;AAClD,0DAAsD;AACtD,sDAAkD;AAClD,sEAAsE;AACtE,4EAA4E;AAC5E,8EAAyE;AACzE,kFAAqE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/google-drive/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AAExE,sEAA4E;AAC5E,4EAAiF;AACjF,0DAAiE;AACjE,sDAAkD;AAClD,0DAAsD;AACtD,sDAAkD;AAClD,sEAAsE;AACtE,4EAA4E;AAC5E,8EAAyE;AACzE,kFAAqE;AACrE,8EAAmE;AACnE,oFAAyE;AACzE,gEAAyE;AAE5D,QAAA,eAAe,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,CAAC,uCAAuC,CAAC;CACjD,CAAC,CAAC;AAEU,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,sDAAsD;IAC/D,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC;IACxF,QAAQ,EAAE,CAAC,kBAAO,EAAE,sBAAS,CAAC;IAC9B,OAAO,EAAE;QACP,8CAA0B;QAC1B,mDAA4B;QAC5B,mCAAqB;QACrB,oBAAQ;QACR,2CAA0B;QAC1B,wCAAoB;QACpB,8CAAuB;QACvB,2CAAmB;QACnB,uCAAa;QACb,qCAAa;QACb,2CAAgB;KACjB;IACD,IAAI,EAAE,uBAAe;CACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const googleDriveGetResourceById: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleDriveGetResourceById = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const googleapis_1 = require("googleapis");
|
|
8
|
+
const googleapis_common_1 = require("googleapis-common");
|
|
9
|
+
exports.googleDriveGetResourceById = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.googleDriveAuth,
|
|
11
|
+
name: 'get-file-or-folder-by-id',
|
|
12
|
+
displayName: 'Get File',
|
|
13
|
+
description: 'Get a file folder for files/sub-folders',
|
|
14
|
+
props: {
|
|
15
|
+
id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'File / Folder Id',
|
|
17
|
+
description: 'The Id of the file/folder to search for.',
|
|
18
|
+
required: true,
|
|
19
|
+
})
|
|
20
|
+
},
|
|
21
|
+
run(context) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const authClient = new googleapis_common_1.OAuth2Client();
|
|
24
|
+
authClient.setCredentials(context.auth);
|
|
25
|
+
const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
|
|
26
|
+
const response = yield drive.files.get({ fileId: context.propsValue.id });
|
|
27
|
+
if (response.data) {
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
console.log('The specified ID corresponds to a folder. Returning null.');
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=get-file-by-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-by-id.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-drive/src/lib/action/get-file-by-id.ts"],"names":[],"mappings":";;;;AAAA,uCAA8C;AAC9C,qEAAwE;AACxE,2CAAoC;AACpC,yDAAiD;AAGpC,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,uBAAe;IACrB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE;QACH,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACnB,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,UAAU,GAAG,IAAI,gCAAY,EAAE,CAAC;YACtC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YACvC,MAAM,KAAK,GAAG,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAChE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;YAE1E,IAAI,QAAQ,CAAC,IAAI,EAAE;gBACf,OAAO,QAAQ,CAAC,IAAI,CAAC;aACxB;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;gBACzE,OAAO,IAAI,CAAC;aACf;QAEL,CAAC;KAAA;CACJ,CAAC,CAAC"}
|