@divyacon/piece-google-drive 0.0.0-stage → 0.1.1
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.MIT-AP +24 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/action/add-permission.action.d.ts +11 -0
- package/dist/lib/action/add-permission.action.d.ts.map +1 -0
- package/dist/lib/action/add-permission.action.js +83 -0
- package/dist/lib/action/add-permission.action.js.map +1 -0
- package/dist/lib/action/create-new-folder.d.ts +12 -0
- package/dist/lib/action/create-new-folder.d.ts.map +1 -0
- package/dist/lib/action/create-new-folder.js +43 -0
- package/dist/lib/action/create-new-folder.js.map +1 -0
- package/dist/lib/action/create-new-text-file.d.ts +14 -0
- package/dist/lib/action/create-new-text-file.d.ts.map +1 -0
- package/dist/lib/action/create-new-text-file.js +81 -0
- package/dist/lib/action/create-new-text-file.js.map +1 -0
- package/dist/lib/action/delete-file.d.ts +8 -0
- package/dist/lib/action/delete-file.d.ts.map +1 -0
- package/dist/lib/action/delete-file.js +38 -0
- package/dist/lib/action/delete-file.js.map +1 -0
- package/dist/lib/action/delete-permission.action.d.ts +9 -0
- package/dist/lib/action/delete-permission.action.d.ts.map +1 -0
- package/dist/lib/action/delete-permission.action.js +84 -0
- package/dist/lib/action/delete-permission.action.js.map +1 -0
- package/dist/lib/action/drive-copy-file.d.ts +10 -0
- package/dist/lib/action/drive-copy-file.d.ts.map +1 -0
- package/dist/lib/action/drive-copy-file.js +84 -0
- package/dist/lib/action/drive-copy-file.js.map +1 -0
- package/dist/lib/action/drive-create-comment.d.ts +8 -0
- package/dist/lib/action/drive-create-comment.d.ts.map +1 -0
- package/dist/lib/action/drive-create-comment.js +60 -0
- package/dist/lib/action/drive-create-comment.js.map +1 -0
- package/dist/lib/action/drive-create-file-from-text.d.ts +10 -0
- package/dist/lib/action/drive-create-file-from-text.d.ts.map +1 -0
- package/dist/lib/action/drive-create-file-from-text.js +91 -0
- package/dist/lib/action/drive-create-file-from-text.js.map +1 -0
- package/dist/lib/action/drive-create-folder.d.ts +8 -0
- package/dist/lib/action/drive-create-folder.d.ts.map +1 -0
- package/dist/lib/action/drive-create-folder.js +48 -0
- package/dist/lib/action/drive-create-folder.js.map +1 -0
- package/dist/lib/action/drive-create-reply.d.ts +10 -0
- package/dist/lib/action/drive-create-reply.d.ts.map +1 -0
- package/dist/lib/action/drive-create-reply.js +81 -0
- package/dist/lib/action/drive-create-reply.js.map +1 -0
- package/dist/lib/action/drive-create-shared-drive.d.ts +7 -0
- package/dist/lib/action/drive-create-shared-drive.d.ts.map +1 -0
- package/dist/lib/action/drive-create-shared-drive.js +53 -0
- package/dist/lib/action/drive-create-shared-drive.js.map +1 -0
- package/dist/lib/action/drive-delete-file.d.ts +7 -0
- package/dist/lib/action/drive-delete-file.d.ts.map +1 -0
- package/dist/lib/action/drive-delete-file.js +39 -0
- package/dist/lib/action/drive-delete-file.js.map +1 -0
- package/dist/lib/action/drive-delete-reply.d.ts +9 -0
- package/dist/lib/action/drive-delete-reply.d.ts.map +1 -0
- package/dist/lib/action/drive-delete-reply.js +64 -0
- package/dist/lib/action/drive-delete-reply.js.map +1 -0
- package/dist/lib/action/drive-delete-shared-drive.d.ts +7 -0
- package/dist/lib/action/drive-delete-shared-drive.d.ts.map +1 -0
- package/dist/lib/action/drive-delete-shared-drive.js +55 -0
- package/dist/lib/action/drive-delete-shared-drive.js.map +1 -0
- package/dist/lib/action/drive-download-file.d.ts +8 -0
- package/dist/lib/action/drive-download-file.d.ts.map +1 -0
- package/dist/lib/action/drive-download-file.js +37 -0
- package/dist/lib/action/drive-download-file.js.map +1 -0
- package/dist/lib/action/drive-empty-trash.d.ts +7 -0
- package/dist/lib/action/drive-empty-trash.d.ts.map +1 -0
- package/dist/lib/action/drive-empty-trash.js +47 -0
- package/dist/lib/action/drive-empty-trash.js.map +1 -0
- package/dist/lib/action/drive-export-workspace-file.d.ts +8 -0
- package/dist/lib/action/drive-export-workspace-file.d.ts.map +1 -0
- package/dist/lib/action/drive-export-workspace-file.js +116 -0
- package/dist/lib/action/drive-export-workspace-file.js.map +1 -0
- package/dist/lib/action/drive-get-about.d.ts +5 -0
- package/dist/lib/action/drive-get-about.d.ts.map +1 -0
- package/dist/lib/action/drive-get-about.js +43 -0
- package/dist/lib/action/drive-get-about.js.map +1 -0
- package/dist/lib/action/drive-get-file.d.ts +7 -0
- package/dist/lib/action/drive-get-file.d.ts.map +1 -0
- package/dist/lib/action/drive-get-file.js +46 -0
- package/dist/lib/action/drive-get-file.js.map +1 -0
- package/dist/lib/action/drive-get-reply.d.ts +9 -0
- package/dist/lib/action/drive-get-reply.d.ts.map +1 -0
- package/dist/lib/action/drive-get-reply.js +66 -0
- package/dist/lib/action/drive-get-reply.js.map +1 -0
- package/dist/lib/action/drive-get-shared-drive.d.ts +7 -0
- package/dist/lib/action/drive-get-shared-drive.d.ts.map +1 -0
- package/dist/lib/action/drive-get-shared-drive.js +52 -0
- package/dist/lib/action/drive-get-shared-drive.js.map +1 -0
- package/dist/lib/action/drive-list-comments.d.ts +7 -0
- package/dist/lib/action/drive-list-comments.d.ts.map +1 -0
- package/dist/lib/action/drive-list-comments.js +60 -0
- package/dist/lib/action/drive-list-comments.js.map +1 -0
- package/dist/lib/action/drive-list-files.d.ts +11 -0
- package/dist/lib/action/drive-list-files.d.ts.map +1 -0
- package/dist/lib/action/drive-list-files.js +174 -0
- package/dist/lib/action/drive-list-files.js.map +1 -0
- package/dist/lib/action/drive-list-permissions.d.ts +7 -0
- package/dist/lib/action/drive-list-permissions.d.ts.map +1 -0
- package/dist/lib/action/drive-list-permissions.js +59 -0
- package/dist/lib/action/drive-list-permissions.js.map +1 -0
- package/dist/lib/action/drive-list-replies.d.ts +8 -0
- package/dist/lib/action/drive-list-replies.d.ts.map +1 -0
- package/dist/lib/action/drive-list-replies.js +65 -0
- package/dist/lib/action/drive-list-replies.js.map +1 -0
- package/dist/lib/action/drive-list-shared-drives.d.ts +8 -0
- package/dist/lib/action/drive-list-shared-drives.d.ts.map +1 -0
- package/dist/lib/action/drive-list-shared-drives.js +60 -0
- package/dist/lib/action/drive-list-shared-drives.js.map +1 -0
- package/dist/lib/action/drive-move-file.d.ts +8 -0
- package/dist/lib/action/drive-move-file.d.ts.map +1 -0
- package/dist/lib/action/drive-move-file.js +57 -0
- package/dist/lib/action/drive-move-file.js.map +1 -0
- package/dist/lib/action/drive-remove-permission.d.ts +9 -0
- package/dist/lib/action/drive-remove-permission.d.ts.map +1 -0
- package/dist/lib/action/drive-remove-permission.js +75 -0
- package/dist/lib/action/drive-remove-permission.js.map +1 -0
- package/dist/lib/action/drive-replace-file-content.d.ts +9 -0
- package/dist/lib/action/drive-replace-file-content.d.ts.map +1 -0
- package/dist/lib/action/drive-replace-file-content.js +67 -0
- package/dist/lib/action/drive-replace-file-content.js.map +1 -0
- package/dist/lib/action/drive-save-file-as-pdf.d.ts +9 -0
- package/dist/lib/action/drive-save-file-as-pdf.d.ts.map +1 -0
- package/dist/lib/action/drive-save-file-as-pdf.js +73 -0
- package/dist/lib/action/drive-save-file-as-pdf.js.map +1 -0
- package/dist/lib/action/drive-search-files.d.ts +12 -0
- package/dist/lib/action/drive-search-files.d.ts.map +1 -0
- package/dist/lib/action/drive-search-files.js +130 -0
- package/dist/lib/action/drive-search-files.js.map +1 -0
- package/dist/lib/action/drive-set-public-access.d.ts +8 -0
- package/dist/lib/action/drive-set-public-access.d.ts.map +1 -0
- package/dist/lib/action/drive-set-public-access.js +71 -0
- package/dist/lib/action/drive-set-public-access.js.map +1 -0
- package/dist/lib/action/drive-share-file.d.ts +10 -0
- package/dist/lib/action/drive-share-file.d.ts.map +1 -0
- package/dist/lib/action/drive-share-file.js +69 -0
- package/dist/lib/action/drive-share-file.js.map +1 -0
- package/dist/lib/action/drive-trash-file.d.ts +7 -0
- package/dist/lib/action/drive-trash-file.d.ts.map +1 -0
- package/dist/lib/action/drive-trash-file.js +45 -0
- package/dist/lib/action/drive-trash-file.js.map +1 -0
- package/dist/lib/action/drive-untrash-file.d.ts +7 -0
- package/dist/lib/action/drive-untrash-file.d.ts.map +1 -0
- package/dist/lib/action/drive-untrash-file.js +54 -0
- package/dist/lib/action/drive-untrash-file.js.map +1 -0
- package/dist/lib/action/drive-update-file-metadata.d.ts +10 -0
- package/dist/lib/action/drive-update-file-metadata.d.ts.map +1 -0
- package/dist/lib/action/drive-update-file-metadata.js +79 -0
- package/dist/lib/action/drive-update-file-metadata.js.map +1 -0
- package/dist/lib/action/drive-update-permission.d.ts +9 -0
- package/dist/lib/action/drive-update-permission.d.ts.map +1 -0
- package/dist/lib/action/drive-update-permission.js +93 -0
- package/dist/lib/action/drive-update-permission.js.map +1 -0
- package/dist/lib/action/drive-update-reply.d.ts +10 -0
- package/dist/lib/action/drive-update-reply.d.ts.map +1 -0
- package/dist/lib/action/drive-update-reply.js +72 -0
- package/dist/lib/action/drive-update-reply.js.map +1 -0
- package/dist/lib/action/drive-update-shared-drive.d.ts +8 -0
- package/dist/lib/action/drive-update-shared-drive.d.ts.map +1 -0
- package/dist/lib/action/drive-update-shared-drive.js +62 -0
- package/dist/lib/action/drive-update-shared-drive.js.map +1 -0
- package/dist/lib/action/drive-upload-file.d.ts +9 -0
- package/dist/lib/action/drive-upload-file.d.ts.map +1 -0
- package/dist/lib/action/drive-upload-file.js +71 -0
- package/dist/lib/action/drive-upload-file.js.map +1 -0
- package/dist/lib/action/drive-upload-from-url.d.ts +10 -0
- package/dist/lib/action/drive-upload-from-url.d.ts.map +1 -0
- package/dist/lib/action/drive-upload-from-url.js +90 -0
- package/dist/lib/action/drive-upload-from-url.js.map +1 -0
- package/dist/lib/action/duplicate-file.action.d.ts +11 -0
- package/dist/lib/action/duplicate-file.action.d.ts.map +1 -0
- package/dist/lib/action/duplicate-file.action.js +83 -0
- package/dist/lib/action/duplicate-file.action.js.map +1 -0
- package/dist/lib/action/get-file-by-id.d.ts +8 -0
- package/dist/lib/action/get-file-by-id.d.ts.map +1 -0
- package/dist/lib/action/get-file-by-id.js +45 -0
- package/dist/lib/action/get-file-by-id.js.map +1 -0
- package/dist/lib/action/list-files.action.d.ts +11 -0
- package/dist/lib/action/list-files.action.d.ts.map +1 -0
- package/dist/lib/action/list-files.action.js +165 -0
- package/dist/lib/action/list-files.action.js.map +1 -0
- package/dist/lib/action/move-file.d.ts +12 -0
- package/dist/lib/action/move-file.d.ts.map +1 -0
- package/dist/lib/action/move-file.js +52 -0
- package/dist/lib/action/move-file.js.map +1 -0
- package/dist/lib/action/read-file.d.ts +8 -0
- package/dist/lib/action/read-file.d.ts.map +1 -0
- package/dist/lib/action/read-file.js +34 -0
- package/dist/lib/action/read-file.js.map +1 -0
- package/dist/lib/action/save-file-as-pdf.action.d.ts +10 -0
- package/dist/lib/action/save-file-as-pdf.action.d.ts.map +1 -0
- package/dist/lib/action/save-file-as-pdf.action.js +72 -0
- package/dist/lib/action/save-file-as-pdf.action.js.map +1 -0
- package/dist/lib/action/search-folder-or-file.action.d.ts +15 -0
- package/dist/lib/action/search-folder-or-file.action.d.ts.map +1 -0
- package/dist/lib/action/search-folder-or-file.action.js +119 -0
- package/dist/lib/action/search-folder-or-file.action.js.map +1 -0
- package/dist/lib/action/send-to-trash.d.ts +8 -0
- package/dist/lib/action/send-to-trash.d.ts.map +1 -0
- package/dist/lib/action/send-to-trash.js +44 -0
- package/dist/lib/action/send-to-trash.js.map +1 -0
- package/dist/lib/action/set-public-access.d.ts +8 -0
- package/dist/lib/action/set-public-access.d.ts.map +1 -0
- package/dist/lib/action/set-public-access.js +66 -0
- package/dist/lib/action/set-public-access.js.map +1 -0
- package/dist/lib/action/upload-file.d.ts +13 -0
- package/dist/lib/action/upload-file.d.ts.map +1 -0
- package/dist/lib/action/upload-file.js +58 -0
- package/dist/lib/action/upload-file.js.map +1 -0
- package/dist/lib/auth.d.ts +11 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +87 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/common/get-file-content.d.ts +4 -0
- package/dist/lib/common/get-file-content.d.ts.map +1 -0
- package/dist/lib/common/get-file-content.js +69 -0
- package/dist/lib/common/get-file-content.js.map +1 -0
- package/dist/lib/common/index.d.ts +23 -0
- package/dist/lib/common/index.d.ts.map +1 -0
- package/dist/lib/common/index.js +152 -0
- package/dist/lib/common/index.js.map +1 -0
- package/dist/lib/output-schemas.d.ts +53 -0
- package/dist/lib/output-schemas.d.ts.map +1 -0
- package/dist/lib/output-schemas.js +2022 -0
- package/dist/lib/output-schemas.js.map +1 -0
- package/dist/lib/triggers/new-file.d.ts +43 -0
- package/dist/lib/triggers/new-file.d.ts.map +1 -0
- package/dist/lib/triggers/new-file.js +107 -0
- package/dist/lib/triggers/new-file.js.map +1 -0
- package/dist/lib/triggers/new-folder.d.ts +39 -0
- package/dist/lib/triggers/new-folder.d.ts.map +1 -0
- package/dist/lib/triggers/new-folder.js +71 -0
- package/dist/lib/triggers/new-folder.js.map +1 -0
- package/package.json +50 -4
- package/src/index.ts +149 -0
- package/src/lib/action/add-permission.action.ts +82 -0
- package/src/lib/action/create-new-folder.ts +42 -0
- package/src/lib/action/create-new-text-file.ts +80 -0
- package/src/lib/action/delete-file.ts +33 -0
- package/src/lib/action/delete-permission.action.ts +84 -0
- package/src/lib/action/drive-copy-file.ts +86 -0
- package/src/lib/action/drive-create-comment.ts +61 -0
- package/src/lib/action/drive-create-file-from-text.ts +99 -0
- package/src/lib/action/drive-create-folder.ts +49 -0
- package/src/lib/action/drive-create-reply.ts +84 -0
- package/src/lib/action/drive-create-shared-drive.ts +52 -0
- package/src/lib/action/drive-delete-file.ts +36 -0
- package/src/lib/action/drive-delete-reply.ts +65 -0
- package/src/lib/action/drive-delete-shared-drive.ts +57 -0
- package/src/lib/action/drive-download-file.ts +38 -0
- package/src/lib/action/drive-empty-trash.ts +47 -0
- package/src/lib/action/drive-export-workspace-file.ts +129 -0
- package/src/lib/action/drive-get-about.ts +40 -0
- package/src/lib/action/drive-get-file.ts +40 -0
- package/src/lib/action/drive-get-reply.ts +67 -0
- package/src/lib/action/drive-get-shared-drive.ts +52 -0
- package/src/lib/action/drive-list-comments.ts +61 -0
- package/src/lib/action/drive-list-files.ts +238 -0
- package/src/lib/action/drive-list-permissions.ts +60 -0
- package/src/lib/action/drive-list-replies.ts +66 -0
- package/src/lib/action/drive-list-shared-drives.ts +59 -0
- package/src/lib/action/drive-move-file.ts +56 -0
- package/src/lib/action/drive-remove-permission.ts +75 -0
- package/src/lib/action/drive-replace-file-content.ts +71 -0
- package/src/lib/action/drive-save-file-as-pdf.ts +80 -0
- package/src/lib/action/drive-search-files.ts +127 -0
- package/src/lib/action/drive-set-public-access.ts +75 -0
- package/src/lib/action/drive-share-file.ts +69 -0
- package/src/lib/action/drive-trash-file.ts +41 -0
- package/src/lib/action/drive-untrash-file.ts +54 -0
- package/src/lib/action/drive-update-file-metadata.ts +82 -0
- package/src/lib/action/drive-update-permission.ts +100 -0
- package/src/lib/action/drive-update-reply.ts +73 -0
- package/src/lib/action/drive-update-shared-drive.ts +63 -0
- package/src/lib/action/drive-upload-file.ts +80 -0
- package/src/lib/action/drive-upload-from-url.ts +107 -0
- package/src/lib/action/duplicate-file.action.ts +82 -0
- package/src/lib/action/get-file-by-id.ts +37 -0
- package/src/lib/action/list-files.action.ts +214 -0
- package/src/lib/action/move-file.ts +48 -0
- package/src/lib/action/read-file.ts +28 -0
- package/src/lib/action/save-file-as-pdf.action.ts +76 -0
- package/src/lib/action/search-folder-or-file.action.ts +112 -0
- package/src/lib/action/send-to-trash.ts +38 -0
- package/src/lib/action/set-public-access.ts +68 -0
- package/src/lib/action/upload-file.ts +55 -0
- package/src/lib/auth.ts +79 -0
- package/src/lib/common/get-file-content.ts +109 -0
- package/src/lib/common/index.ts +182 -0
- package/src/lib/output-schemas.ts +2070 -0
- package/src/lib/triggers/new-file.ts +119 -0
- package/src/lib/triggers/new-folder.ts +78 -0
- package/README.md +0 -3
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deletePermission = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/delete-permission.action.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
const drive_1 = require("@googleapis/drive");
|
|
10
|
+
const output_schemas_1 = require("../output-schemas");
|
|
11
|
+
exports.deletePermission = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.googleDriveAuth,
|
|
13
|
+
name: 'delete_permissions',
|
|
14
|
+
description: 'Removes a role from an user for a file or folder',
|
|
15
|
+
audience: 'human',
|
|
16
|
+
aiMetadata: { description: 'Revokes a specific role from a user (matched by email and role) on a Drive file or folder. Use to unshare or downgrade access for someone. Requires the file/folder ID, the user email, and the role to remove. Idempotent: if no matching permission exists, the call is a no-op.', idempotent: true },
|
|
17
|
+
displayName: 'Delete permissions',
|
|
18
|
+
props: {
|
|
19
|
+
fileId: pieces_framework_1.Property.ShortText({
|
|
20
|
+
displayName: 'File or Folder ID',
|
|
21
|
+
description: 'The ID of the file or folder to update permissions for',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
user_email: pieces_framework_1.Property.ShortText({
|
|
25
|
+
displayName: 'User email',
|
|
26
|
+
description: 'The email address of the user to update permissions for',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
permission_name: pieces_framework_1.Property.StaticDropdown({
|
|
30
|
+
displayName: 'Role',
|
|
31
|
+
description: 'The role to remove from user.',
|
|
32
|
+
required: true,
|
|
33
|
+
options: {
|
|
34
|
+
options: [
|
|
35
|
+
{
|
|
36
|
+
label: 'Organizer',
|
|
37
|
+
value: 'organizer',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'File Organizer',
|
|
41
|
+
value: 'fileOrganizer',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Writer',
|
|
45
|
+
value: 'writer',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Commenter',
|
|
49
|
+
value: 'commenter',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Reader',
|
|
53
|
+
value: 'reader',
|
|
54
|
+
},
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
outputSchema: output_schemas_1.deletePermissionsActionOutputSchema,
|
|
60
|
+
run(context) {
|
|
61
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const [fileId, user_email] = [context.propsValue.fileId, context.propsValue.user_email];
|
|
63
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
64
|
+
const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
|
|
65
|
+
const response_permissions_list = yield drive.permissions.list({
|
|
66
|
+
fileId: fileId,
|
|
67
|
+
fields: 'permissions(id, emailAddress, role)',
|
|
68
|
+
});
|
|
69
|
+
if (response_permissions_list.data.permissions) {
|
|
70
|
+
for (const permission of response_permissions_list.data.permissions) {
|
|
71
|
+
if (permission.emailAddress === user_email && permission.role === context.propsValue.permission_name) {
|
|
72
|
+
yield drive.permissions.delete({
|
|
73
|
+
fileId: fileId,
|
|
74
|
+
permissionId: permission.id ? permission.id : '',
|
|
75
|
+
});
|
|
76
|
+
return { removed: true, message: 'Permission removed' };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { removed: false, message: 'Permission not found' };
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=delete-permission.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-permission.action.js","sourceRoot":"","sources":["../../../src/lib/action/delete-permission.action.ts"],"names":[],"mappings":";;;;AAAA,sHAAsH;AACtH,qEAAqE;AACrE,gEAAmE;AACnE,kCAA8D;AAC9D,6CAAyD;AACzD,sDAAwE;AAE3D,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,oRAAoR,EAAE,UAAU,EAAE,IAAI,EAAE;IACnU,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;wBACvB,KAAK,EAAE,eAAe;qBACzB;oBACD;wBACI,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,QAAQ;qBAClB;oBACD;wBACI,KAAK,EAAE,WAAW;wBAClB,KAAK,EAAE,WAAW;qBACrB;oBACD;wBACI,KAAK,EAAE,QAAQ;wBACf,KAAK,EAAE,QAAQ;qBAClB;iBAEJ;aACA;SACJ,CAAC;KACL;IACD,YAAY,EAAE,oD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IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
file_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
folder_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
convert_to: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=drive-copy-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-copy-file.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-copy-file.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;;;;;;;;EAgFxB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.driveCopyFile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-copy-file.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const drive_1 = require("@googleapis/drive");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
const output_schemas_1 = require("../output-schemas");
|
|
11
|
+
exports.driveCopyFile = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.googleDriveAuth,
|
|
13
|
+
name: 'drive_copy_file',
|
|
14
|
+
displayName: 'Copy File',
|
|
15
|
+
description: 'Duplicate a file from Google Drive. Returns the new file ID.',
|
|
16
|
+
audience: 'ai',
|
|
17
|
+
aiMetadata: {
|
|
18
|
+
description: 'Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Doc. Use to clone a file or make an editable Google-format copy; to relocate the original instead of copying use `drive_move_file`. Requires source file ID and destination folder ID. Each call creates a new copy.',
|
|
19
|
+
idempotent: false,
|
|
20
|
+
},
|
|
21
|
+
outputSchema: output_schemas_1.driveCopyFileOutputSchema,
|
|
22
|
+
props: {
|
|
23
|
+
file_id: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'File ID',
|
|
25
|
+
description: 'The ID of the file to duplicate. Resolve it via `drive_search_files`.',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
name: pieces_framework_1.Property.ShortText({
|
|
29
|
+
displayName: 'Name',
|
|
30
|
+
description: 'The name of the new file',
|
|
31
|
+
required: true,
|
|
32
|
+
}),
|
|
33
|
+
folder_id: pieces_framework_1.Property.ShortText({
|
|
34
|
+
displayName: 'Folder ID',
|
|
35
|
+
description: 'The ID of the folder where the file will be duplicated. Resolve it via `drive_search_files`.',
|
|
36
|
+
required: true,
|
|
37
|
+
}),
|
|
38
|
+
convert_to: pieces_framework_1.Property.StaticDropdown({
|
|
39
|
+
displayName: 'Duplicate as',
|
|
40
|
+
description: 'If left unselected the file will be duplicated as it is',
|
|
41
|
+
required: false,
|
|
42
|
+
options: {
|
|
43
|
+
options: [
|
|
44
|
+
{
|
|
45
|
+
label: 'Google Sheets',
|
|
46
|
+
value: 'application/vnd.google-apps.spreadsheet',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'Google Docs',
|
|
50
|
+
value: 'application/vnd.google-apps.document',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
56
|
+
run(context) {
|
|
57
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
59
|
+
const fileId = context.propsValue.file_id;
|
|
60
|
+
const nameForNewFile = context.propsValue.name;
|
|
61
|
+
const parentFolderId = context.propsValue.folder_id;
|
|
62
|
+
const mimeType = context.propsValue.convert_to;
|
|
63
|
+
const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
|
|
64
|
+
const requestBody = {
|
|
65
|
+
name: nameForNewFile,
|
|
66
|
+
parents: [parentFolderId],
|
|
67
|
+
};
|
|
68
|
+
if (mimeType) {
|
|
69
|
+
requestBody.mimeType = mimeType;
|
|
70
|
+
}
|
|
71
|
+
const response = yield drive.files.copy({
|
|
72
|
+
fileId,
|
|
73
|
+
auth: authClient,
|
|
74
|
+
requestBody,
|
|
75
|
+
supportsAllDrives: true,
|
|
76
|
+
});
|
|
77
|
+
if (response.status !== 200) {
|
|
78
|
+
throw new Error('Error duplicating file');
|
|
79
|
+
}
|
|
80
|
+
return response.data;
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=drive-copy-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-copy-file.js","sourceRoot":"","sources":["../../../src/lib/action/drive-copy-file.ts"],"names":[],"mappings":";;;;AAAA,6GAA6G;AAC7G,qEAAqE;AACrE,gEAAmE;AACnE,6CAAyD;AACzD,kCAA8D;AAC9D,sDAA8D;AAEjD,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,yUAAyU;QAC3U,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,0CAAyB;IACvC,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SA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ACb,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAClC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;gBACtC,MAAM;gBACN,IAAI,EAAE,UAAU;gBAChB,WAAW;gBACX,iBAAiB,EAAE,IAAI;aACxB,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const driveCreateComment: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
file_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
content: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=drive-create-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-comment.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-create-comment.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB;;;;;;EAuD7B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.driveCreateComment = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-create-comment.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
const drive_1 = require("@googleapis/drive");
|
|
10
|
+
const output_schemas_1 = require("../output-schemas");
|
|
11
|
+
exports.driveCreateComment = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.googleDriveAuth,
|
|
13
|
+
name: 'drive_create_comment',
|
|
14
|
+
displayName: 'Create Comment',
|
|
15
|
+
description: 'Add a new comment to a Drive file.',
|
|
16
|
+
audience: 'ai',
|
|
17
|
+
aiMetadata: {
|
|
18
|
+
description: 'Adds a new top-level comment to a file. Use to leave feedback or a note on a file (resolve the file ID via drive_search_files); to respond to an existing comment use drive_create_reply instead. Each call creates a new comment, so retries duplicate.',
|
|
19
|
+
idempotent: false,
|
|
20
|
+
},
|
|
21
|
+
outputSchema: output_schemas_1.driveCreateCommentOutputSchema,
|
|
22
|
+
props: {
|
|
23
|
+
file_id: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'File ID',
|
|
25
|
+
description: 'The ID of the file to comment on. Resolve it via drive_search_files or drive_get_file.',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
content: pieces_framework_1.Property.LongText({
|
|
29
|
+
displayName: 'Content',
|
|
30
|
+
description: 'The plain-text content of the comment.',
|
|
31
|
+
required: true,
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
run(context) {
|
|
35
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const { file_id, content } = context.propsValue;
|
|
37
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
38
|
+
const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
|
|
39
|
+
try {
|
|
40
|
+
// The Drive comments endpoints require a fields parameter or the API returns 400.
|
|
41
|
+
const response = yield drive.comments.create({
|
|
42
|
+
fileId: file_id,
|
|
43
|
+
fields: '*',
|
|
44
|
+
requestBody: { content },
|
|
45
|
+
});
|
|
46
|
+
return response.data;
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (error.code === 404) {
|
|
50
|
+
throw new Error(`File not found (ID: ${file_id}). Resolve a valid ID via drive_search_files or drive_get_file.`);
|
|
51
|
+
}
|
|
52
|
+
if (error.code === 403) {
|
|
53
|
+
throw new Error(`Permission denied commenting on file ${file_id}. You may lack comment access to this file.`);
|
|
54
|
+
}
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=drive-create-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-comment.js","sourceRoot":"","sources":["../../../src/lib/action/drive-create-comment.ts"],"names":[],"mappings":";;;;AAAA,kHAAkH;AAClH,qEAAqE;AACrE,gEAAmE;AACnE,kCAA8D;AAC9D,6CAAyD;AACzD,sDAAmE;AAEtD,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,oCAAoC;IACjD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,0PAA0P;QAC5P,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,+CAA8B;IAC5C,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,wFAAwF;YAC1F,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEhD,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,KAAK,GAAG,IAAA,aAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAE/D,IAAI,CAAC;gBACH,kFAAkF;gBAClF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAC3C,MAAM,EAAE,OAAO;oBACf,MAAM,EAAE,GAAG;oBACX,WAAW,EAAE,EAAE,OAAO,EAAE;iBACzB,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CACb,uBAAuB,OAAO,iEAAiE,CAChG,CAAC;gBACJ,CAAC;gBACD,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CACb,wCAAwC,OAAO,6CAA6C,CAC7F,CAAC;gBACJ,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const driveCreateFileFromText: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
file_name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
text: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
7
|
+
content_type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
|
|
8
|
+
parent_folder_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=drive-create-file-from-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-file-from-text.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-create-file-from-text.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,uBAAuB;;;;;;;;EAwFlC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.driveCreateFileFromText = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-create-file-from-text.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const pieces_common_1 = require("@agnocon/pieces-common");
|
|
9
|
+
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
10
|
+
const auth_1 = require("../auth");
|
|
11
|
+
const output_schemas_1 = require("../output-schemas");
|
|
12
|
+
exports.driveCreateFileFromText = (0, pieces_framework_1.createAction)({
|
|
13
|
+
auth: auth_1.googleDriveAuth,
|
|
14
|
+
name: 'drive_create_file_from_text',
|
|
15
|
+
displayName: 'Create File from Text',
|
|
16
|
+
description: 'Create a new text file in your Google Drive from text',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
aiMetadata: {
|
|
19
|
+
description: 'Creates a new Drive file from inline text content as plain text, CSV, or XML. Use when an agent has generated text it needs to persist as a Drive file; for binary or existing files use `drive_upload_file` instead. Each call creates a new file.',
|
|
20
|
+
idempotent: false,
|
|
21
|
+
},
|
|
22
|
+
outputSchema: output_schemas_1.driveCreateFileFromTextOutputSchema,
|
|
23
|
+
props: {
|
|
24
|
+
file_name: pieces_framework_1.Property.ShortText({
|
|
25
|
+
displayName: 'File name',
|
|
26
|
+
description: 'The name of the new text file',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
text: pieces_framework_1.Property.LongText({
|
|
30
|
+
displayName: 'Text',
|
|
31
|
+
description: 'The text content to add to file',
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
content_type: pieces_framework_1.Property.StaticDropdown({
|
|
35
|
+
displayName: 'Content type',
|
|
36
|
+
description: 'Select file type',
|
|
37
|
+
required: true,
|
|
38
|
+
defaultValue: 'plain/text',
|
|
39
|
+
options: {
|
|
40
|
+
options: [
|
|
41
|
+
{
|
|
42
|
+
label: 'Text',
|
|
43
|
+
value: 'plain/text',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'CSV',
|
|
47
|
+
value: 'text/csv',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: 'XML',
|
|
51
|
+
value: 'text/xml',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
parent_folder_id: pieces_framework_1.Property.ShortText({
|
|
57
|
+
displayName: 'Parent Folder ID',
|
|
58
|
+
description: 'The ID of the folder to create the file inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.',
|
|
59
|
+
required: false,
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
run(context) {
|
|
63
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const meta = Object.assign({ mimeType: context.propsValue.content_type, name: context.propsValue.file_name }, (context.propsValue.parent_folder_id
|
|
65
|
+
? { parents: [context.propsValue.parent_folder_id] }
|
|
66
|
+
: {}));
|
|
67
|
+
const metaBuffer = Buffer.from(JSON.stringify(meta), 'utf-8');
|
|
68
|
+
const textBuffer = Buffer.from(context.propsValue.text, 'utf-8');
|
|
69
|
+
const form = new form_data_1.default();
|
|
70
|
+
form.append('Metadata', metaBuffer, { contentType: 'application/json' });
|
|
71
|
+
form.append('Media', textBuffer, {
|
|
72
|
+
contentType: context.propsValue.content_type,
|
|
73
|
+
});
|
|
74
|
+
const result = yield pieces_common_1.httpClient.sendRequest({
|
|
75
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
76
|
+
url: `https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart`,
|
|
77
|
+
body: form,
|
|
78
|
+
headers: Object.assign({}, form.getHeaders()),
|
|
79
|
+
queryParams: {
|
|
80
|
+
supportsAllDrives: 'true',
|
|
81
|
+
},
|
|
82
|
+
authentication: {
|
|
83
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
84
|
+
token: yield (0, auth_1.getAccessToken)(context.auth),
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return result.body;
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=drive-create-file-from-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-file-from-text.js","sourceRoot":"","sources":["../../../src/lib/action/drive-create-file-from-text.ts"],"names":[],"mappings":";;;;AAAA,yHAAyH;AACzH,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kEAAiC;AACjC,kCAA0D;AAC1D,sDAAwE;AAE3D,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,uDAAuD;IACpE,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,qPAAqP;QACvP,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,oDAAmC;IACjD,KAAK,EAAE;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,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,YAAY;aAC7C,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;iBAC1B;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,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const driveCreateFolder: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
folder_name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
parent_folder_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=drive-create-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-folder.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-create-folder.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB;;;;;;EA2C5B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.driveCreateFolder = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-create-folder.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
const drive_1 = require("@googleapis/drive");
|
|
10
|
+
const output_schemas_1 = require("../output-schemas");
|
|
11
|
+
exports.driveCreateFolder = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.googleDriveAuth,
|
|
13
|
+
name: 'drive_create_folder',
|
|
14
|
+
displayName: 'Create Folder',
|
|
15
|
+
description: 'Create a new empty folder in your Google Drive',
|
|
16
|
+
audience: 'ai',
|
|
17
|
+
aiMetadata: {
|
|
18
|
+
description: 'Creates a new empty folder in Google Drive, optionally nested under a parent folder (resolve the parent ID via `drive_search_files`). Use to set up a destination before uploading or moving files. Each call creates a distinct folder even with the same name, so retries duplicate.',
|
|
19
|
+
idempotent: false,
|
|
20
|
+
},
|
|
21
|
+
outputSchema: output_schemas_1.driveCreateFolderOutputSchema,
|
|
22
|
+
props: {
|
|
23
|
+
folder_name: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'Folder name',
|
|
25
|
+
description: 'The name of the new folder',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
parent_folder_id: pieces_framework_1.Property.ShortText({
|
|
29
|
+
displayName: 'Parent Folder ID',
|
|
30
|
+
description: 'The ID of the folder to create the new folder inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.',
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
run(context) {
|
|
35
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
37
|
+
const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
|
|
38
|
+
const response = yield drive.files.create({
|
|
39
|
+
requestBody: Object.assign({ mimeType: 'application/vnd.google-apps.folder', name: context.propsValue.folder_name }, (context.propsValue.parent_folder_id
|
|
40
|
+
? { parents: [context.propsValue.parent_folder_id] }
|
|
41
|
+
: {})),
|
|
42
|
+
supportsAllDrives: true,
|
|
43
|
+
});
|
|
44
|
+
return response.data;
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=drive-create-folder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-folder.js","sourceRoot":"","sources":["../../../src/lib/action/drive-create-folder.ts"],"names":[],"mappings":";;;;AAAA,iHAAiH;AACjH,qEAAqE;AACrE,gEAAmE;AACnE,kCAA8D;AAC9D,6CAAyD;AACzD,sDAAkE;AAErD,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,gDAAgD;IAC7D,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,wRAAwR;QAC1R,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,8CAA6B;IAC3C,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,gBAAgB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACnC,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,wJAAwJ;YAC1J,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,KAAK,GAAG,IAAA,aAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAE/D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;gBACxC,WAAW,kBACT,QAAQ,EAAE,oCAAoC,EAC9C,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW,IACjC,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB;oBACrC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;oBACpD,CAAC,CAAC,EAAE,CAAC,CACR;gBACD,iBAAiB,EAAE,IAAI;aACxB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const driveCreateReply: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
file_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
comment_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
content: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
8
|
+
action: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=drive-create-reply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-reply.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-create-reply.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;EA8E3B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.driveCreateReply = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-create-reply.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
9
|
+
const drive_1 = require("@googleapis/drive");
|
|
10
|
+
const output_schemas_1 = require("../output-schemas");
|
|
11
|
+
exports.driveCreateReply = (0, pieces_framework_1.createAction)({
|
|
12
|
+
auth: auth_1.googleDriveAuth,
|
|
13
|
+
name: 'drive_create_reply',
|
|
14
|
+
displayName: 'Reply to Comment',
|
|
15
|
+
description: 'Add a reply to an existing comment on a Drive file.',
|
|
16
|
+
audience: 'ai',
|
|
17
|
+
aiMetadata: {
|
|
18
|
+
description: 'Adds a reply to an existing comment, optionally resolving or reopening the comment via the action field. Use to respond to a comment (resolve the commentId via drive_list_comments); to start a new top-level comment use drive_create_comment instead. Each call creates a new reply, so retries duplicate.',
|
|
19
|
+
idempotent: false,
|
|
20
|
+
},
|
|
21
|
+
outputSchema: output_schemas_1.driveCreateReplyOutputSchema,
|
|
22
|
+
props: {
|
|
23
|
+
file_id: pieces_framework_1.Property.ShortText({
|
|
24
|
+
displayName: 'File ID',
|
|
25
|
+
description: 'The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.',
|
|
26
|
+
required: true,
|
|
27
|
+
}),
|
|
28
|
+
comment_id: pieces_framework_1.Property.ShortText({
|
|
29
|
+
displayName: 'Comment ID',
|
|
30
|
+
description: 'The ID of the comment to reply to. Resolve it via drive_list_comments.',
|
|
31
|
+
required: true,
|
|
32
|
+
}),
|
|
33
|
+
content: pieces_framework_1.Property.LongText({
|
|
34
|
+
displayName: 'Content',
|
|
35
|
+
description: 'The plain-text content of the reply.',
|
|
36
|
+
required: true,
|
|
37
|
+
}),
|
|
38
|
+
action: pieces_framework_1.Property.StaticDropdown({
|
|
39
|
+
displayName: 'Action',
|
|
40
|
+
description: 'Optionally change the parent comment\'s state: resolve (mark resolved) or reopen.',
|
|
41
|
+
required: false,
|
|
42
|
+
options: {
|
|
43
|
+
options: [
|
|
44
|
+
{ label: 'Resolve', value: 'resolve' },
|
|
45
|
+
{ label: 'Reopen', value: 'reopen' },
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
run(context) {
|
|
51
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const { file_id, comment_id, content, action } = context.propsValue;
|
|
53
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
54
|
+
const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
|
|
55
|
+
const requestBody = { content };
|
|
56
|
+
if (action) {
|
|
57
|
+
requestBody.action = action;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
// The Drive replies endpoints require a fields parameter or the API returns 400.
|
|
61
|
+
const response = yield drive.replies.create({
|
|
62
|
+
fileId: file_id,
|
|
63
|
+
commentId: comment_id,
|
|
64
|
+
fields: '*',
|
|
65
|
+
requestBody,
|
|
66
|
+
});
|
|
67
|
+
return response.data;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (error.code === 404) {
|
|
71
|
+
throw new Error(`File or comment not found (file ID: ${file_id}, comment ID: ${comment_id}). Resolve the comment ID via drive_list_comments.`);
|
|
72
|
+
}
|
|
73
|
+
if (error.code === 403) {
|
|
74
|
+
throw new Error(`Permission denied replying to comment ${comment_id} on file ${file_id}. You may lack comment access to this file.`);
|
|
75
|
+
}
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=drive-create-reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-reply.js","sourceRoot":"","sources":["../../../src/lib/action/drive-create-reply.ts"],"names":[],"mappings":";;;;AAAA,gHAAgH;AAChH,qEAAqE;AACrE,gEAAmE;AACnE,kCAA8D;AAC9D,6CAAyD;AACzD,sDAAiE;AAEpD,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,qDAAqD;IAClE,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,+SAA+S;QACjT,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,6CAA4B;IAC1C,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,iGAAiG;YACnG,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,wEAAwE;YACrF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;Y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CAAC;gBACJ,CAAC;gBACD,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CACb,yCAAyC,UAAU,YAAY,OAAO,6CAA6C,CACpH,CAAC;gBACJ,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const driveCreateSharedDrive: import("@agnocon/pieces-framework").IAction<(import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
userEmail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
}>)[], {
|
|
5
|
+
name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=drive-create-shared-drive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-shared-drive.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-create-shared-drive.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,sBAAsB;;;;;EA6CjC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.driveCreateSharedDrive = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-create-shared-drive.ts (MIT).
|
|
6
|
+
// Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
|
|
7
|
+
const pieces_framework_1 = require("@agnocon/pieces-framework");
|
|
8
|
+
const crypto_1 = require("crypto");
|
|
9
|
+
const auth_1 = require("../auth");
|
|
10
|
+
const drive_1 = require("@googleapis/drive");
|
|
11
|
+
const output_schemas_1 = require("../output-schemas");
|
|
12
|
+
exports.driveCreateSharedDrive = (0, pieces_framework_1.createAction)({
|
|
13
|
+
auth: auth_1.googleDriveAuth,
|
|
14
|
+
name: 'drive_create_shared_drive',
|
|
15
|
+
displayName: 'Create Shared Drive',
|
|
16
|
+
description: 'Create a new shared drive (Team Drive).',
|
|
17
|
+
audience: 'ai',
|
|
18
|
+
aiMetadata: {
|
|
19
|
+
description: 'Creates a new shared drive (Team Drive) with the given name; the action supplies the required idempotency requestId internally. Use to set up a shared workspace. Each call creates a distinct shared drive. Your Workspace admin must have shared-drive creation enabled (a 403 here is an admin-policy issue, not a scope issue).',
|
|
20
|
+
idempotent: false,
|
|
21
|
+
},
|
|
22
|
+
outputSchema: output_schemas_1.driveCreateSharedDriveOutputSchema,
|
|
23
|
+
props: {
|
|
24
|
+
name: pieces_framework_1.Property.ShortText({
|
|
25
|
+
displayName: 'Name',
|
|
26
|
+
description: 'The name of the new shared drive.',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
run(context) {
|
|
31
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const { name } = context.propsValue;
|
|
33
|
+
const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
|
|
34
|
+
const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
|
|
35
|
+
// drives.create requires a requestId (idempotency key); omitting it returns a 400.
|
|
36
|
+
const requestId = (0, crypto_1.randomUUID)();
|
|
37
|
+
try {
|
|
38
|
+
const response = yield drive.drives.create({
|
|
39
|
+
requestId,
|
|
40
|
+
requestBody: { name },
|
|
41
|
+
});
|
|
42
|
+
return response.data;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (error.code === 403) {
|
|
46
|
+
throw new Error('Permission denied creating a shared drive. Your Google Workspace admin may have disabled shared-drive creation for your account.');
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=drive-create-shared-drive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-create-shared-drive.js","sourceRoot":"","sources":["../../../src/lib/action/drive-create-shared-drive.ts"],"names":[],"mappings":";;;;AAAA,uHAAuH;AACvH,qEAAqE;AACrE,gEAAmE;AACnE,mCAAoC;AACpC,kCAA8D;AAC9D,6CAAyD;AACzD,sDAAuE;AAE1D,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,qUAAqU;QACvU,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,mDAAkC;IAChD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEpC,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,KAAK,GAAG,IAAA,aAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAE/D,mFAAmF;YACnF,MAAM,SAAS,GAAG,IAAA,mBAAU,GAAE,CAAC;YAE/B,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;oBACzC,SAAS;oBACT,WAAW,EAAE,EAAE,IAAI,EAAE;iBACtB,CAAC,CAA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