@activepieces/piece-google-drive 0.6.4 → 0.7.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.
- package/package.json +13 -18
- package/src/index.d.ts +6 -2
- package/src/index.d.ts.map +1 -0
- package/src/index.js +9 -11
- package/src/index.js.map +1 -1
- package/src/lib/action/add-permission.action.d.ts +5 -1
- package/src/lib/action/add-permission.action.d.ts.map +1 -0
- package/src/lib/action/add-permission.action.js +3 -5
- package/src/lib/action/add-permission.action.js.map +1 -1
- package/src/lib/action/create-new-folder.d.ts +9 -2
- package/src/lib/action/create-new-folder.d.ts.map +1 -0
- package/src/lib/action/create-new-folder.js +3 -5
- package/src/lib/action/create-new-folder.js.map +1 -1
- package/src/lib/action/create-new-text-file.d.ts +9 -2
- package/src/lib/action/create-new-text-file.d.ts.map +1 -0
- package/src/lib/action/create-new-text-file.js +3 -3
- package/src/lib/action/create-new-text-file.js.map +1 -1
- package/src/lib/action/delete-file.d.ts +5 -1
- package/src/lib/action/delete-file.d.ts.map +1 -0
- package/src/lib/action/delete-file.js +3 -5
- package/src/lib/action/delete-file.js.map +1 -1
- package/src/lib/action/delete-permission.action.d.ts +5 -1
- package/src/lib/action/delete-permission.action.d.ts.map +1 -0
- package/src/lib/action/delete-permission.action.js +3 -5
- package/src/lib/action/delete-permission.action.js.map +1 -1
- package/src/lib/action/duplicate-file.action.d.ts +5 -1
- package/src/lib/action/duplicate-file.action.d.ts.map +1 -0
- package/src/lib/action/duplicate-file.action.js +3 -5
- package/src/lib/action/duplicate-file.action.js.map +1 -1
- package/src/lib/action/get-file-by-id.d.ts +5 -1
- package/src/lib/action/get-file-by-id.d.ts.map +1 -0
- package/src/lib/action/get-file-by-id.js +3 -5
- package/src/lib/action/get-file-by-id.js.map +1 -1
- package/src/lib/action/list-files.action.d.ts +5 -1
- package/src/lib/action/list-files.action.d.ts.map +1 -0
- package/src/lib/action/list-files.action.js +8 -6
- package/src/lib/action/list-files.action.js.map +1 -1
- package/src/lib/action/move-file.d.ts +9 -2
- package/src/lib/action/move-file.d.ts.map +1 -0
- package/src/lib/action/move-file.js +3 -5
- package/src/lib/action/move-file.js.map +1 -1
- package/src/lib/action/read-file.d.ts +5 -1
- package/src/lib/action/read-file.d.ts.map +1 -0
- package/src/lib/action/read-file.js +2 -2
- package/src/lib/action/read-file.js.map +1 -1
- package/src/lib/action/save-file-as-pdf.action.d.ts +5 -1
- package/src/lib/action/save-file-as-pdf.action.d.ts.map +1 -0
- package/src/lib/action/save-file-as-pdf.action.js +3 -5
- package/src/lib/action/save-file-as-pdf.action.js.map +1 -1
- package/src/lib/action/search-folder-or-file.action.d.ts +9 -2
- package/src/lib/action/search-folder-or-file.action.d.ts.map +1 -0
- package/src/lib/action/search-folder-or-file.action.js +26 -19
- package/src/lib/action/search-folder-or-file.action.js.map +1 -1
- package/src/lib/action/send-to-trash.d.ts +5 -1
- package/src/lib/action/send-to-trash.d.ts.map +1 -0
- package/src/lib/action/send-to-trash.js +3 -5
- package/src/lib/action/send-to-trash.js.map +1 -1
- package/src/lib/action/set-public-access.d.ts +5 -1
- package/src/lib/action/set-public-access.d.ts.map +1 -0
- package/src/lib/action/set-public-access.js +3 -5
- package/src/lib/action/set-public-access.js.map +1 -1
- package/src/lib/action/upload-file.d.ts +9 -2
- package/src/lib/action/upload-file.d.ts.map +1 -0
- package/src/lib/action/upload-file.js +3 -3
- package/src/lib/action/upload-file.js.map +1 -1
- package/src/lib/auth.d.ts +11 -0
- package/src/lib/auth.d.ts.map +1 -0
- package/src/lib/auth.js +86 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/get-file-content.d.ts +4 -2
- package/src/lib/common/get-file-content.d.ts.map +1 -0
- package/src/lib/common/get-file-content.js +5 -6
- package/src/lib/common/get-file-content.js.map +1 -1
- package/src/lib/common/index.d.ts +10 -9
- package/src/lib/common/index.d.ts.map +1 -0
- package/src/lib/common/index.js +42 -30
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/triggers/new-file.d.ts +33 -8
- package/src/lib/triggers/new-file.d.ts.map +1 -0
- package/src/lib/triggers/new-file.js +2 -2
- package/src/lib/triggers/new-file.js.map +1 -1
- package/src/lib/triggers/new-folder.d.ts +33 -8
- package/src/lib/triggers/new-folder.d.ts.map +1 -0
- package/src/lib/triggers/new-folder.js +2 -2
- package/src/lib/triggers/new-folder.js.map +1 -1
- package/README.md +0 -7
package/package.json
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-drive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"main": "./src/index.js",
|
|
5
|
+
"types": "./src/index.d.ts",
|
|
4
6
|
"dependencies": {
|
|
5
|
-
"@
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"axios-retry": "4.4.1",
|
|
7
|
+
"@activepieces/pieces-common": "0.12.0",
|
|
8
|
+
"@activepieces/pieces-framework": "0.26.0",
|
|
9
|
+
"@activepieces/shared": "0.42.0",
|
|
9
10
|
"dayjs": "1.11.9",
|
|
10
|
-
"deepmerge-ts": "7.1.0",
|
|
11
11
|
"form-data": "4.0.4",
|
|
12
12
|
"googleapis": "129.0.0",
|
|
13
|
+
"googleapis-common": "7.2.0",
|
|
13
14
|
"mime-types": "2.1.35",
|
|
14
|
-
"nanoid": "3.3.8",
|
|
15
|
-
"semver": "7.6.0",
|
|
16
|
-
"socket.io-client": "4.8.1",
|
|
17
|
-
"zod": "4.1.13",
|
|
18
|
-
"@activepieces/pieces-common": "0.11.6",
|
|
19
|
-
"@activepieces/pieces-framework": "0.25.4",
|
|
20
|
-
"@activepieces/shared": "0.37.0",
|
|
21
15
|
"tslib": "2.6.2"
|
|
22
16
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
19
|
+
"lint": "eslint 'src/**/*.ts'"
|
|
25
20
|
},
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/mime-types": "2.1.1"
|
|
23
|
+
}
|
|
29
24
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const googleDrive: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export { googleDriveAuth, getAccessToken, GoogleDriveAuthValue, createGoogleClient } from './lib/auth';
|
|
2
|
+
export declare const googleDrive: import("@activepieces/pieces-framework").Piece<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
}>)[]>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEvG,eAAO,MAAM,WAAW;;;MA8CtB,CAAC"}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleDrive = exports.googleDriveAuth = void 0;
|
|
3
|
+
exports.googleDrive = exports.createGoogleClient = exports.getAccessToken = exports.googleDriveAuth = 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");
|
|
@@ -22,13 +22,11 @@ const set_public_access_1 = require("./lib/action/set-public-access");
|
|
|
22
22
|
const move_file_1 = require("./lib/action/move-file");
|
|
23
23
|
const delete_file_1 = require("./lib/action/delete-file");
|
|
24
24
|
const send_to_trash_1 = require("./lib/action/send-to-trash");
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
scope: ['https://www.googleapis.com/auth/drive'],
|
|
31
|
-
});
|
|
25
|
+
const auth_1 = require("./lib/auth");
|
|
26
|
+
var auth_2 = require("./lib/auth");
|
|
27
|
+
Object.defineProperty(exports, "googleDriveAuth", { enumerable: true, get: function () { return auth_2.googleDriveAuth; } });
|
|
28
|
+
Object.defineProperty(exports, "getAccessToken", { enumerable: true, get: function () { return auth_2.getAccessToken; } });
|
|
29
|
+
Object.defineProperty(exports, "createGoogleClient", { enumerable: true, get: function () { return auth_2.createGoogleClient; } });
|
|
32
30
|
exports.googleDrive = (0, pieces_framework_1.createPiece)({
|
|
33
31
|
minimumSupportedRelease: '0.5.6',
|
|
34
32
|
logoUrl: 'https://cdn.activepieces.com/pieces/google-drive.png',
|
|
@@ -68,14 +66,14 @@ exports.googleDrive = (0, pieces_framework_1.createPiece)({
|
|
|
68
66
|
send_to_trash_1.googleDriveTrashFile,
|
|
69
67
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
70
68
|
baseUrl: () => 'https://www.googleapis.com/drive/v3',
|
|
71
|
-
auth:
|
|
69
|
+
auth: auth_1.googleDriveAuth,
|
|
72
70
|
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
73
71
|
return ({
|
|
74
|
-
Authorization: `Bearer ${(auth)
|
|
72
|
+
Authorization: `Bearer ${yield (0, auth_1.getAccessToken)(auth)}`,
|
|
75
73
|
});
|
|
76
74
|
}),
|
|
77
75
|
}),
|
|
78
76
|
],
|
|
79
|
-
auth:
|
|
77
|
+
auth: auth_1.googleDriveAuth,
|
|
80
78
|
});
|
|
81
79
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAEwC;AAExC,+DAAwE;AACxE,iDAAqD;AACrD,8EAAmE;AACnE,sEAA4E;AAC5E,4EAAiF;AACjF,oFAAyE;AACzE,8EAAyE;AACzE,gEAAyE;AACzE,sEAAsE;AACtE,sDAAkD;AAClD,kFAAqE;AACrE,4FAAoF;AACpF,0DAAiE;AACjE,sDAAkD;AAClD,0DAAsD;AACtD,sEAAiE;AACjE,sDAAwD;AACxD,0DAAiE;AACjE,8DAAkE;AAClE,qCAAmF;AAEnF,mCAAuG;AAA9F,uGAAA,eAAe,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAwB,0GAAA,kBAAkB,OAAA;AAErE,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,sDAAsD;IAC/D,UAAU,EAAE,CAAC,sBAAa,CAAC,iBAAiB,CAAC;IAC7C,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,+BAA+B;IAC5C,OAAO,EAAE;QACP,WAAW;QACX,YAAY;QACZ,UAAU;QACV,cAAc;QACd,UAAU;QACV,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,sBAAsB;QACtB,eAAe;QACf,UAAU;QACV,SAAS;KACV;IACD,QAAQ,EAAE,CAAC,kBAAO,EAAE,sBAAS,CAAC;IAC9B,OAAO,EAAE;QACP,8CAA0B;QAC1B,mDAA4B;QAC5B,mCAAqB;QACrB,oBAAQ;QACR,2CAA0B;QAC1B,wCAAoB;QACpB,sDAAuB;QACvB,2CAAmB;QACnB,uCAAa;QACb,qCAAa;QACb,2CAAgB;QAChB,mCAAe;QACf,0BAAc;QACd,mCAAqB;QACrB,oCAAoB;QACpB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,qCAAqC;YACpD,IAAI,EAAE,sBAAe;YACrB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,MAAM,IAAA,qBAAc,EAAC,IAA4B,CAAC,EAAE;iBAC9E,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,IAAI,EAAE,sBAAe;CACtB,CAAC,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export declare const addPermission: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const addPermission: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
fileId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
user_email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
7
|
permission_name: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
5
8
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
9
|
send_invitation_email: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
7
10
|
}>;
|
|
11
|
+
//# sourceMappingURL=add-permission.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-permission.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/add-permission.action.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;;;;;;;EAwExB,CAAC"}
|
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addPermission = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const googleapis_1 = require("googleapis");
|
|
8
|
-
const googleapis_common_1 = require("googleapis-common");
|
|
9
8
|
const common_1 = require("../common");
|
|
10
9
|
exports.addPermission = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth:
|
|
10
|
+
auth: auth_1.googleDriveAuth,
|
|
12
11
|
name: 'update_permissions',
|
|
13
12
|
description: 'Update permissions for a file or folder',
|
|
14
13
|
displayName: 'Update permissions',
|
|
@@ -62,8 +61,7 @@ exports.addPermission = (0, pieces_framework_1.createAction)({
|
|
|
62
61
|
run(context) {
|
|
63
62
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
63
|
const { fileId, user_email, permission_name, send_invitation_email, include_team_drives } = context.propsValue;
|
|
65
|
-
const authClient =
|
|
66
|
-
authClient.setCredentials(context.auth);
|
|
64
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
67
65
|
const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
|
|
68
66
|
const permission = { 'type': 'user', 'role': permission_name, 'emailAddress': user_email };
|
|
69
67
|
const result = yield drive.permissions.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-permission.action.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"add-permission.action.js","sourceRoot":"","sources":["../../../../src/lib/action/add-permission.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA8D;AAC9D,2CAAoC;AACpC,sCAAmC;AAEtB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,yCAAyC;IACtD,WAAW,EAA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G,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEhE,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;YAE3F,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;gBAC1C,WAAW,EAAE,UAAU;gBACvB,MAAM,EAAE,MAAM;gBACd,qBAAqB,EAAE,qBAAqB;gBAC5C,iBAAiB,EAAE,mBAAmB;aACzC,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
export declare const googleDriveCreateNewFolder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const googleDriveCreateNewFolder: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
folderName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
parentFolder: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
6
|
+
parentFolder: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
8
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
}>)[]>;
|
|
4
10
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
11
|
}>;
|
|
12
|
+
//# sourceMappingURL=create-new-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-new-folder.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/create-new-folder.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,0BAA0B;;;;;;;;;;EAgCrC,CAAC"}
|
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.googleDriveCreateNewFolder = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const googleapis_1 = require("googleapis");
|
|
9
|
-
const googleapis_common_1 = require("googleapis-common");
|
|
10
9
|
exports.googleDriveCreateNewFolder = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth:
|
|
10
|
+
auth: auth_1.googleDriveAuth,
|
|
12
11
|
name: 'create_new_gdrive_folder',
|
|
13
12
|
description: 'Create a new empty folder in your Google Drive',
|
|
14
13
|
displayName: 'Create new folder',
|
|
@@ -23,8 +22,7 @@ exports.googleDriveCreateNewFolder = (0, pieces_framework_1.createAction)({
|
|
|
23
22
|
},
|
|
24
23
|
run(context) {
|
|
25
24
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const authClient =
|
|
27
|
-
authClient.setCredentials(context.auth);
|
|
25
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
28
26
|
const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
|
|
29
27
|
const response = yield drive.files.create({
|
|
30
28
|
requestBody: Object.assign({ mimeType: 'application/vnd.google-apps.folder', name: context.propsValue.folderName }, (context.propsValue.parentFolder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-folder.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"create-new-folder.js","sourceRoot":"","sources":["../../../../src/lib/action/create-new-folder.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA8D;AAC9D,sCAAmC;AACnC,2CAAoC;AAEvB,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,gDAAgD;IAC7D,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,eAAM,CAAC,UAAU,CAAC,YAAY;QAC5C,mBAAmB,EAAE,eAAM,CAAC,UAAU,CAAC,mBAAmB;KAC3D;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,KAAK,GAAG,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEhE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;gBACxC,WAAW,kBACT,QAAQ,EAAE,oCAAoC,EAC9C,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,IAChC,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY;oBACjC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;oBAChD,CAAC,CAAC,EAAE,CAAC,CACR;gBACD,iBAAiB,EAAE,OAAO,CAAC,UAAU,CAAC,mBAAmB;aAC1D,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
export declare const googleDriveCreateNewTextFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const googleDriveCreateNewTextFile: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
fileName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
7
|
fileType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
5
|
-
parentFolder: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
8
|
+
parentFolder: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
10
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
+
}>)[]>;
|
|
6
12
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
13
|
}>;
|
|
14
|
+
//# 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/action/create-new-text-file.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;EA8EvC,CAAC"}
|
|
@@ -5,10 +5,10 @@ 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
7
|
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
8
|
-
const
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
9
|
const common_1 = require("../common");
|
|
10
10
|
exports.googleDriveCreateNewTextFile = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth:
|
|
11
|
+
auth: auth_1.googleDriveAuth,
|
|
12
12
|
name: 'create_new_gdrive_file',
|
|
13
13
|
description: 'Create a new text file in your Google Drive from text',
|
|
14
14
|
displayName: 'Create new file',
|
|
@@ -70,7 +70,7 @@ exports.googleDriveCreateNewTextFile = (0, pieces_framework_1.createAction)({
|
|
|
70
70
|
},
|
|
71
71
|
authentication: {
|
|
72
72
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
73
|
-
token: context.auth
|
|
73
|
+
token: yield (0, auth_1.getAccessToken)(context.auth),
|
|
74
74
|
},
|
|
75
75
|
});
|
|
76
76
|
console.debug('File creation response', result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-text-file.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"create-new-text-file.js","sourceRoot":"","sources":["../../../../src/lib/action/create-new-text-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAIqC;AACrC,kEAAiC;AACjC,kCAA0D;AAC1D,sCAAmC;AAEtB,QAAA,4BAA4B,GAAG,IAAA,+BAAY,EAAC;IACvD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,uD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AAC;YAC9D,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAK,EAAE,OAAO,CAAC,CAAC;YAElE,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,CAAC;YACzE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE;gBAC/B,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;aACzC,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,uEAAuE;gBAC5E,IAAI,EAAE,IAAI;gBACV,OAAO,oBACF,IAAI,CAAC,UAAU,EAAE,CACrB;gBACD,WAAW,EAAE;oBACX,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,IAAI,KAAK,CAAC;iBAC3E;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,MAAM,IAAA,qBAAc,EAAC,OAAO,CAAC,IAAI,CAAC;iBAC1C;aACF,CAAC,CAAC;YAEH,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;YAChD,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export declare const googleDriveDeleteFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const googleDriveDeleteFile: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
fileId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
7
|
}>;
|
|
8
|
+
//# sourceMappingURL=delete-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/delete-file.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB;;;;;;EAyBhC,CAAC"}
|
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.googleDriveDeleteFile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const googleapis_1 = require("googleapis");
|
|
9
|
-
const googleapis_common_1 = require("googleapis-common");
|
|
10
9
|
exports.googleDriveDeleteFile = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth:
|
|
10
|
+
auth: auth_1.googleDriveAuth,
|
|
12
11
|
name: 'delete_gdrive_file',
|
|
13
12
|
description: 'Delete permanently a file from your Google Drive',
|
|
14
13
|
displayName: 'Delete file',
|
|
@@ -22,8 +21,7 @@ exports.googleDriveDeleteFile = (0, pieces_framework_1.createAction)({
|
|
|
22
21
|
},
|
|
23
22
|
run(context) {
|
|
24
23
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const authClient =
|
|
26
|
-
authClient.setCredentials(context.auth);
|
|
24
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
27
25
|
const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
|
|
28
26
|
const response = yield drive.files.delete({
|
|
29
27
|
fileId: context.propsValue.fileId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-file.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"delete-file.js","sourceRoot":"","sources":["../../../../src/lib/action/delete-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA8D;AAC9D,sCAAmC;AACnC,2CAAoC;AAEvB,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,kDAAkD;IAC/D,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,mBAAmB,EAAE,eAAM,CAAC,UAAU,CAAC,mBAAmB;KAC3D;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,KAAK,GAAG,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEhE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;gBACxC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;gBACjC,iBAAiB,EAAE,OAAO,CAAC,UAAU,CAAC,mBAAmB;aAC1D,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export declare const deletePermission: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const deletePermission: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
fileId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
user_email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
7
|
permission_name: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
5
8
|
}>;
|
|
9
|
+
//# sourceMappingURL=delete-permission.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-permission.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/delete-permission.action.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB;;;;;;;EA2E3B,CAAC"}
|
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deletePermission = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const googleapis_1 = require("googleapis");
|
|
8
|
-
const googleapis_common_1 = require("googleapis-common");
|
|
9
8
|
exports.deletePermission = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth:
|
|
9
|
+
auth: auth_1.googleDriveAuth,
|
|
11
10
|
name: 'delete_permissions',
|
|
12
11
|
description: 'Removes a role from an user for a file or folder',
|
|
13
12
|
displayName: 'Delete permissions',
|
|
@@ -55,8 +54,7 @@ exports.deletePermission = (0, pieces_framework_1.createAction)({
|
|
|
55
54
|
run(context) {
|
|
56
55
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
56
|
const [fileId, user_email] = [context.propsValue.fileId, context.propsValue.user_email];
|
|
58
|
-
const authClient =
|
|
59
|
-
authClient.setCredentials(context.auth);
|
|
57
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
60
58
|
const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
|
|
61
59
|
const response_permissions_list = yield drive.permissions.list({
|
|
62
60
|
fileId: fileId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-permission.action.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"delete-permission.action.js","sourceRoot":"","sources":["../../../../src/lib/action/delete-permission.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAA8D;AAC9D,2CAAoC;AAEvB,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,kDAAkD;IAC/D,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE;QACH,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,wDAAwD;YACrE,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,eAAe,EAAG,2BAAQ,CAAC,cAAc,CAAC;YACtC,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACT,OAAO,EAAE;oBACL;wBACI,KAAK,EAAE,WAAW;wBAClB,KAAK,EAAE,WAAW;qBACrB;oBACD;wBACI,KAAK,EAAE,gBAAgB;wBAC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EAAE,oBAAoB,EAAC,CAAC;oBAC1D,CAAC;gBACL,CAAC;YACL,CAAC;YAED,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAC,CAAC;QAE7D,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export declare const duplicateFileAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const duplicateFileAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
fileId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
7
|
folderId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
8
|
mimeType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
9
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
10
|
}>;
|
|
11
|
+
//# sourceMappingURL=duplicate-file.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate-file.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/duplicate-file.action.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;;;;;;;;EAwE9B,CAAC"}
|
|
@@ -4,12 +4,11 @@ exports.duplicateFileAction = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const googleapis_1 = require("googleapis");
|
|
7
|
-
const
|
|
8
|
-
const index_1 = require("../../index");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
9
8
|
const common_1 = require("../common");
|
|
10
9
|
exports.duplicateFileAction = (0, pieces_framework_1.createAction)({
|
|
11
10
|
displayName: 'Duplicate File',
|
|
12
|
-
auth:
|
|
11
|
+
auth: auth_1.googleDriveAuth,
|
|
13
12
|
name: 'duplicate_file',
|
|
14
13
|
description: 'Duplicate a file from Google Drive. Returns the new file ID.',
|
|
15
14
|
props: {
|
|
@@ -49,8 +48,7 @@ exports.duplicateFileAction = (0, pieces_framework_1.createAction)({
|
|
|
49
48
|
},
|
|
50
49
|
run(context) {
|
|
51
50
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
const authClient =
|
|
53
|
-
authClient.setCredentials(context.auth);
|
|
51
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
54
52
|
const fileId = context.propsValue.fileId;
|
|
55
53
|
const nameForNewFile = context.propsValue.name;
|
|
56
54
|
const parentFolderId = context.propsValue.folderId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate-file.action.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"duplicate-file.action.js","sourceRoot":"","sources":["../../../../src/lib/action/duplicate-file.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAoC;AACpC,kCAA8D;AAC9D,sCAAmC;AAEtB,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,8DAA8D;IAC3E,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAA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C;YAClC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;gBACtC,MAAM;gBACN,IAAI,EAAE,UAAU;gBAChB,WAAW;gBACX,iBAAiB,EAAE,OAAO,CAAC,UAAU,CAAC,mBAAmB;aAC1D,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC5C,CAAC;YAED,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export declare const googleDriveGetResourceById: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const googleDriveGetResourceById: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
7
|
}>;
|
|
8
|
+
//# sourceMappingURL=get-file-by-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-by-id.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/get-file-by-id.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,0BAA0B;;;;;;EA4BrC,CAAC"}
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.googleDriveGetResourceById = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const googleapis_1 = require("googleapis");
|
|
8
|
-
const googleapis_common_1 = require("googleapis-common");
|
|
9
8
|
const common_1 = require("../common");
|
|
10
9
|
exports.googleDriveGetResourceById = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth:
|
|
10
|
+
auth: auth_1.googleDriveAuth,
|
|
12
11
|
name: 'get-file-or-folder-by-id',
|
|
13
12
|
displayName: 'Get File Information',
|
|
14
13
|
description: 'Get a file folder for files/sub-folders',
|
|
@@ -22,8 +21,7 @@ exports.googleDriveGetResourceById = (0, pieces_framework_1.createAction)({
|
|
|
22
21
|
},
|
|
23
22
|
run(context) {
|
|
24
23
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const authClient =
|
|
26
|
-
authClient.setCredentials(context.auth);
|
|
24
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
27
25
|
const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
|
|
28
26
|
const response = yield drive.files.get({
|
|
29
27
|
fileId: context.propsValue.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-by-id.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"get-file-by-id.js","sourceRoot":"","sources":["../../../../src/lib/action/get-file-by-id.ts"],"names":[],"mappings":";;;;AAAA,kCAA8D;AAC9D,qEAAwE;AACxE,2CAAoC;AACpC,sCAAmC;AAEtB,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE;QACL,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,mBAAmB,EAAE,eAAM,CAAC,UAAU,CAAC,mBAAmB;KAC3D;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1D,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;gBACrC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE;gBAC7B,iBAAiB,EAAE,OAAO,CAAC,UAAU,CAAC,mBAAmB;aAC1D,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAClB,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;gBACzE,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export declare const googleDriveListFiles: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props
|
|
1
|
+
export declare const googleDriveListFiles: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
2
5
|
folderId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
6
|
include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
7
|
includeTrashed: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
8
|
depthLevel: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
9
|
downloadFiles: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
10
|
}>;
|
|
11
|
+
//# sourceMappingURL=list-files.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-files.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/list-files.action.ts"],"names":[],"mappings":"AA0GA,eAAO,MAAM,oBAAoB;;;;;;;;;EAkF/B,CAAC"}
|
|
@@ -3,32 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.googleDriveListFiles = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
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
10
|
const get_file_content_1 = require("../common/get-file-content");
|
|
11
|
-
function getFilesRecursively(
|
|
11
|
+
function getFilesRecursively(auth_2, folderId_1, maxLevel_1, includeTrashed_1, includeTeamDrives_1) {
|
|
12
12
|
return tslib_1.__awaiter(this, arguments, void 0, function* (auth, folderId, maxLevel, includeTrashed, includeTeamDrives, currentLevel = 0) {
|
|
13
13
|
const files = [];
|
|
14
14
|
if (currentLevel > maxLevel) {
|
|
15
15
|
return files;
|
|
16
16
|
}
|
|
17
|
+
const accessToken = yield (0, auth_1.getAccessToken)(auth);
|
|
17
18
|
let q = `'${folderId}' in parents`;
|
|
18
19
|
if (!includeTrashed) {
|
|
19
20
|
q += ' and trashed=false';
|
|
20
21
|
}
|
|
21
22
|
const params = {
|
|
22
23
|
q: q,
|
|
23
|
-
fields: 'files(id,kind,mimeType,name,trashed,parents)',
|
|
24
|
+
fields: 'nextPageToken,files(id,kind,mimeType,name,trashed,parents)',
|
|
24
25
|
supportsAllDrives: 'true',
|
|
25
26
|
includeItemsFromAllDrives: includeTeamDrives ? 'true' : 'false',
|
|
27
|
+
pageSize: '1000',
|
|
26
28
|
};
|
|
27
29
|
let response = yield pieces_common_1.httpClient.sendRequest({
|
|
28
30
|
method: pieces_common_1.HttpMethod.GET,
|
|
29
31
|
url: `https://www.googleapis.com/drive/v3/files?${querystring_1.default.stringify(params)}`,
|
|
30
32
|
headers: {
|
|
31
|
-
Authorization: `Bearer ${
|
|
33
|
+
Authorization: `Bearer ${accessToken}`,
|
|
32
34
|
},
|
|
33
35
|
});
|
|
34
36
|
// Add files from current level
|
|
@@ -46,7 +48,7 @@ function getFilesRecursively(auth_1, folderId_1, maxLevel_1, includeTrashed_1, i
|
|
|
46
48
|
method: pieces_common_1.HttpMethod.GET,
|
|
47
49
|
url: `https://www.googleapis.com/drive/v3/files?${querystring_1.default.stringify(params)}`,
|
|
48
50
|
headers: {
|
|
49
|
-
Authorization: `Bearer ${
|
|
51
|
+
Authorization: `Bearer ${accessToken}`,
|
|
50
52
|
},
|
|
51
53
|
});
|
|
52
54
|
for (const file of response.body.files) {
|
|
@@ -69,7 +71,7 @@ function getFilesRecursively(auth_1, folderId_1, maxLevel_1, includeTrashed_1, i
|
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
73
|
exports.googleDriveListFiles = (0, pieces_framework_1.createAction)({
|
|
72
|
-
auth:
|
|
74
|
+
auth: auth_1.googleDriveAuth,
|
|
73
75
|
name: 'list-files',
|
|
74
76
|
displayName: 'List files',
|
|
75
77
|
description: 'List files from a Google Drive folder',
|