@activepieces/piece-google-drive 0.5.24 → 0.5.25

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.24",
3
+ "version": "0.5.25",
4
4
  "dependencies": {
5
5
  "@sinclair/typebox": "0.26.8",
6
6
  "axios": "1.6.7",
@@ -14,8 +14,8 @@
14
14
  "nanoid": "3.3.6",
15
15
  "semver": "7.6.0",
16
16
  "@activepieces/pieces-common": "0.2.12",
17
- "@activepieces/pieces-framework": "0.7.28",
18
- "@activepieces/shared": "0.10.101",
17
+ "@activepieces/pieces-framework": "0.7.29",
18
+ "@activepieces/shared": "0.10.102",
19
19
  "tslib": "1.14.1"
20
20
  },
21
21
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -17,6 +17,8 @@ const search_folder_or_file_action_1 = require("./lib/action/search-folder-or-fi
17
17
  const upload_file_1 = require("./lib/action/upload-file");
18
18
  const new_file_1 = require("./lib/triggers/new-file");
19
19
  const new_folder_1 = require("./lib/triggers/new-folder");
20
+ const set_public_access_1 = require("./lib/action/set-public-access");
21
+ const move_file_1 = require("./lib/action/move-file");
20
22
  exports.googleDriveAuth = pieces_framework_1.PieceAuth.OAuth2({
21
23
  description: '',
22
24
  authUrl: 'https://accounts.google.com/o/oauth2/auth',
@@ -30,7 +32,19 @@ exports.googleDrive = (0, pieces_framework_1.createPiece)({
30
32
  categories: [shared_1.PieceCategory.CONTENT_AND_FILES],
31
33
  displayName: 'Google Drive',
32
34
  description: 'Cloud storage and file backup',
33
- authors: ["BastienMe", "ArmanGiau3", "Vitalini", "pfernandez98", "kanarelo", "Salem-Alaa", "kishanprmr", "MoShizzle", "AbdulTheActivePiecer", "khaledmashaly", "abuaboud"],
35
+ authors: [
36
+ 'BastienMe',
37
+ 'ArmanGiau3',
38
+ 'Vitalini',
39
+ 'pfernandez98',
40
+ 'kanarelo',
41
+ 'Salem-Alaa',
42
+ 'kishanprmr',
43
+ 'MoShizzle',
44
+ 'AbdulTheActivePiecer',
45
+ 'khaledmashaly',
46
+ 'abuaboud',
47
+ ],
34
48
  triggers: [new_file_1.newFile, new_folder_1.newFolder],
35
49
  actions: [
36
50
  create_new_folder_1.googleDriveCreateNewFolder,
@@ -44,6 +58,8 @@ exports.googleDrive = (0, pieces_framework_1.createPiece)({
44
58
  save_file_as_pdf_action_1.saveFileAsPdf,
45
59
  add_permission_action_1.addPermission,
46
60
  delete_permission_action_1.deletePermission,
61
+ set_public_access_1.setPublicAccess,
62
+ move_file_1.moveFileAction,
47
63
  (0, pieces_common_1.createCustomApiCallAction)({
48
64
  baseUrl: () => 'https://www.googleapis.com/drive/v3',
49
65
  auth: exports.googleDriveAuth,
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,qEAIwC;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;AAEzC,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,UAAU,EAAE,CAAC,sBAAa,CAAC,iBAAiB,CAAC;IAC7C,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,+BAA+B;IAC5C,OAAO,EAAE,CAAC,WAAW,EAAC,YAAY,EAAC,UAAU,EAAC,cAAc,EAAC,UAAU,EAAC,YAAY,EAAC,YAAY,EAAC,WAAW,EAAC,sBAAsB,EAAC,eAAe,EAAC,UAAU,CAAC;IAChK,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,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,qCAAqC;YACpD,IAAI,EAAE,uBAAe;YACrB,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtB,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;aACtE,CAAC;SACH,CAAC;KACH;IACD,IAAI,EAAE,uBAAe;CACtB,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/google-drive/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAIwC;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;AAE3C,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,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;KACX;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,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,qCAAqC;YACpD,IAAI,EAAE,uBAAe;YACrB,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtB,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;aACtE,CAAC;SACH,CAAC;KACH;IACD,IAAI,EAAE,uBAAe;CACtB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const moveFileAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ fileId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ include_team_drives: import("@activepieces/pieces-framework").CheckboxProperty<false>;
4
+ folderId: import("@activepieces/pieces-framework").DropdownProperty<string, false>;
5
+ }>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.moveFileAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const __1 = require("../../");
6
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const googleapis_1 = require("googleapis");
9
+ const googleapis_common_1 = require("googleapis-common");
10
+ exports.moveFileAction = (0, pieces_framework_1.createAction)({
11
+ auth: __1.googleDriveAuth,
12
+ name: 'google-drive-move-file',
13
+ displayName: 'Move File',
14
+ description: 'Moves a file from one folder to another.',
15
+ props: {
16
+ fileId: pieces_framework_1.Property.ShortText({
17
+ displayName: 'File ID',
18
+ description: 'You can use **Search Folder/File** action to retrive ID.',
19
+ required: true,
20
+ }),
21
+ include_team_drives: common_1.common.properties.include_team_drives,
22
+ folderId: common_1.common.properties.parentFolder,
23
+ },
24
+ run(context) {
25
+ var _a;
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const fileId = context.propsValue.fileId;
28
+ const folderId = context.propsValue.folderId;
29
+ const authClient = new googleapis_common_1.OAuth2Client();
30
+ authClient.setCredentials(context.auth);
31
+ const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
32
+ const file = yield drive.files.get({ fileId });
33
+ const response = yield drive.files.update({
34
+ fileId: fileId,
35
+ fields: '*',
36
+ removeParents: (_a = file.data.parents) === null || _a === void 0 ? void 0 : _a.join(','),
37
+ addParents: folderId,
38
+ });
39
+ return response.data;
40
+ });
41
+ },
42
+ });
43
+ //# sourceMappingURL=move-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-drive/src/lib/action/move-file.ts"],"names":[],"mappings":";;;;AAAA,8BAAyC;AACzC,qEAAwE;AACxE,sCAAmC;AACnC,2CAAoC;AACpC,yDAAiD;AAEpC,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,0CAA0C;IACvD,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,mBAAmB,EAAE,eAAM,CAAC,UAAU,CAAC,mBAAmB;QAC1D,QAAQ,EAAE,eAAM,CAAC,UAAU,CAAC,YAAY;KACzC;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;YAE7C,MAAM,UAAU,GAAG,IAAI,gCAAY,EAAE,CAAC;YACtC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAExC,MAAM,KAAK,GAAG,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEhE,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;YAE/C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;gBACxC,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,GAAG;gBACX,aAAa,EAAE,MAAA,IAAI,CAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,GAAG,CAAC;gBAC3C,UAAU,EAAE,QAAQ;aACrB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;;KACtB;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const setPublicAccess: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
+ fileId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setPublicAccess = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const __1 = require("../../");
7
+ const googleapis_1 = require("googleapis");
8
+ const googleapis_common_1 = require("googleapis-common");
9
+ const get_file_content_1 = require("../common/get-file-content");
10
+ exports.setPublicAccess = (0, pieces_framework_1.createAction)({
11
+ auth: __1.googleDriveAuth,
12
+ name: 'set_public_access',
13
+ description: 'Set public access for a file or folder',
14
+ displayName: 'Set public access',
15
+ props: {
16
+ fileId: pieces_framework_1.Property.ShortText({
17
+ displayName: 'File or Folder ID',
18
+ description: 'The ID of the file or folder to update permissions for',
19
+ required: true,
20
+ }),
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const authClient = new googleapis_common_1.OAuth2Client();
25
+ authClient.setCredentials(context.auth);
26
+ const fileId = context.propsValue.fileId;
27
+ const drive = googleapis_1.google.drive({ version: 'v3', auth: authClient });
28
+ const permission = {
29
+ role: 'reader',
30
+ type: 'anyone',
31
+ };
32
+ const res = yield drive.permissions.create({
33
+ fileId: fileId,
34
+ requestBody: permission,
35
+ });
36
+ const file = yield drive.files.get({
37
+ fileId: fileId,
38
+ fields: 'name,webContentLink',
39
+ });
40
+ const content = yield (0, get_file_content_1.downloadFileFromDrive)(context.auth, context.files, fileId, file.data.name);
41
+ return Object.assign(Object.assign({}, res.data), { downloadUrl: content });
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=set-public-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-public-access.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-drive/src/lib/action/set-public-access.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,8BAAyC;AACzC,2CAAoC;AACpC,yDAAiD;AACjD,iEAAmE;AAEtD,QAAA,eAAe,GAAG,IAAA,+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