@divyacon/piece-google-drive 0.0.0-stage → 0.1.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.
Files changed (293) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +155 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/action/add-permission.action.d.ts +11 -0
  7. package/dist/lib/action/add-permission.action.d.ts.map +1 -0
  8. package/dist/lib/action/add-permission.action.js +83 -0
  9. package/dist/lib/action/add-permission.action.js.map +1 -0
  10. package/dist/lib/action/create-new-folder.d.ts +12 -0
  11. package/dist/lib/action/create-new-folder.d.ts.map +1 -0
  12. package/dist/lib/action/create-new-folder.js +43 -0
  13. package/dist/lib/action/create-new-folder.js.map +1 -0
  14. package/dist/lib/action/create-new-text-file.d.ts +14 -0
  15. package/dist/lib/action/create-new-text-file.d.ts.map +1 -0
  16. package/dist/lib/action/create-new-text-file.js +81 -0
  17. package/dist/lib/action/create-new-text-file.js.map +1 -0
  18. package/dist/lib/action/delete-file.d.ts +8 -0
  19. package/dist/lib/action/delete-file.d.ts.map +1 -0
  20. package/dist/lib/action/delete-file.js +38 -0
  21. package/dist/lib/action/delete-file.js.map +1 -0
  22. package/dist/lib/action/delete-permission.action.d.ts +9 -0
  23. package/dist/lib/action/delete-permission.action.d.ts.map +1 -0
  24. package/dist/lib/action/delete-permission.action.js +84 -0
  25. package/dist/lib/action/delete-permission.action.js.map +1 -0
  26. package/dist/lib/action/drive-copy-file.d.ts +10 -0
  27. package/dist/lib/action/drive-copy-file.d.ts.map +1 -0
  28. package/dist/lib/action/drive-copy-file.js +84 -0
  29. package/dist/lib/action/drive-copy-file.js.map +1 -0
  30. package/dist/lib/action/drive-create-comment.d.ts +8 -0
  31. package/dist/lib/action/drive-create-comment.d.ts.map +1 -0
  32. package/dist/lib/action/drive-create-comment.js +60 -0
  33. package/dist/lib/action/drive-create-comment.js.map +1 -0
  34. package/dist/lib/action/drive-create-file-from-text.d.ts +10 -0
  35. package/dist/lib/action/drive-create-file-from-text.d.ts.map +1 -0
  36. package/dist/lib/action/drive-create-file-from-text.js +91 -0
  37. package/dist/lib/action/drive-create-file-from-text.js.map +1 -0
  38. package/dist/lib/action/drive-create-folder.d.ts +8 -0
  39. package/dist/lib/action/drive-create-folder.d.ts.map +1 -0
  40. package/dist/lib/action/drive-create-folder.js +48 -0
  41. package/dist/lib/action/drive-create-folder.js.map +1 -0
  42. package/dist/lib/action/drive-create-reply.d.ts +10 -0
  43. package/dist/lib/action/drive-create-reply.d.ts.map +1 -0
  44. package/dist/lib/action/drive-create-reply.js +81 -0
  45. package/dist/lib/action/drive-create-reply.js.map +1 -0
  46. package/dist/lib/action/drive-create-shared-drive.d.ts +7 -0
  47. package/dist/lib/action/drive-create-shared-drive.d.ts.map +1 -0
  48. package/dist/lib/action/drive-create-shared-drive.js +53 -0
  49. package/dist/lib/action/drive-create-shared-drive.js.map +1 -0
  50. package/dist/lib/action/drive-delete-file.d.ts +7 -0
  51. package/dist/lib/action/drive-delete-file.d.ts.map +1 -0
  52. package/dist/lib/action/drive-delete-file.js +39 -0
  53. package/dist/lib/action/drive-delete-file.js.map +1 -0
  54. package/dist/lib/action/drive-delete-reply.d.ts +9 -0
  55. package/dist/lib/action/drive-delete-reply.d.ts.map +1 -0
  56. package/dist/lib/action/drive-delete-reply.js +64 -0
  57. package/dist/lib/action/drive-delete-reply.js.map +1 -0
  58. package/dist/lib/action/drive-delete-shared-drive.d.ts +7 -0
  59. package/dist/lib/action/drive-delete-shared-drive.d.ts.map +1 -0
  60. package/dist/lib/action/drive-delete-shared-drive.js +55 -0
  61. package/dist/lib/action/drive-delete-shared-drive.js.map +1 -0
  62. package/dist/lib/action/drive-download-file.d.ts +8 -0
  63. package/dist/lib/action/drive-download-file.d.ts.map +1 -0
  64. package/dist/lib/action/drive-download-file.js +37 -0
  65. package/dist/lib/action/drive-download-file.js.map +1 -0
  66. package/dist/lib/action/drive-empty-trash.d.ts +7 -0
  67. package/dist/lib/action/drive-empty-trash.d.ts.map +1 -0
  68. package/dist/lib/action/drive-empty-trash.js +47 -0
  69. package/dist/lib/action/drive-empty-trash.js.map +1 -0
  70. package/dist/lib/action/drive-export-workspace-file.d.ts +8 -0
  71. package/dist/lib/action/drive-export-workspace-file.d.ts.map +1 -0
  72. package/dist/lib/action/drive-export-workspace-file.js +116 -0
  73. package/dist/lib/action/drive-export-workspace-file.js.map +1 -0
  74. package/dist/lib/action/drive-get-about.d.ts +5 -0
  75. package/dist/lib/action/drive-get-about.d.ts.map +1 -0
  76. package/dist/lib/action/drive-get-about.js +43 -0
  77. package/dist/lib/action/drive-get-about.js.map +1 -0
  78. package/dist/lib/action/drive-get-file.d.ts +7 -0
  79. package/dist/lib/action/drive-get-file.d.ts.map +1 -0
  80. package/dist/lib/action/drive-get-file.js +46 -0
  81. package/dist/lib/action/drive-get-file.js.map +1 -0
  82. package/dist/lib/action/drive-get-reply.d.ts +9 -0
  83. package/dist/lib/action/drive-get-reply.d.ts.map +1 -0
  84. package/dist/lib/action/drive-get-reply.js +66 -0
  85. package/dist/lib/action/drive-get-reply.js.map +1 -0
  86. package/dist/lib/action/drive-get-shared-drive.d.ts +7 -0
  87. package/dist/lib/action/drive-get-shared-drive.d.ts.map +1 -0
  88. package/dist/lib/action/drive-get-shared-drive.js +52 -0
  89. package/dist/lib/action/drive-get-shared-drive.js.map +1 -0
  90. package/dist/lib/action/drive-list-comments.d.ts +7 -0
  91. package/dist/lib/action/drive-list-comments.d.ts.map +1 -0
  92. package/dist/lib/action/drive-list-comments.js +60 -0
  93. package/dist/lib/action/drive-list-comments.js.map +1 -0
  94. package/dist/lib/action/drive-list-files.d.ts +11 -0
  95. package/dist/lib/action/drive-list-files.d.ts.map +1 -0
  96. package/dist/lib/action/drive-list-files.js +174 -0
  97. package/dist/lib/action/drive-list-files.js.map +1 -0
  98. package/dist/lib/action/drive-list-permissions.d.ts +7 -0
  99. package/dist/lib/action/drive-list-permissions.d.ts.map +1 -0
  100. package/dist/lib/action/drive-list-permissions.js +59 -0
  101. package/dist/lib/action/drive-list-permissions.js.map +1 -0
  102. package/dist/lib/action/drive-list-replies.d.ts +8 -0
  103. package/dist/lib/action/drive-list-replies.d.ts.map +1 -0
  104. package/dist/lib/action/drive-list-replies.js +65 -0
  105. package/dist/lib/action/drive-list-replies.js.map +1 -0
  106. package/dist/lib/action/drive-list-shared-drives.d.ts +8 -0
  107. package/dist/lib/action/drive-list-shared-drives.d.ts.map +1 -0
  108. package/dist/lib/action/drive-list-shared-drives.js +60 -0
  109. package/dist/lib/action/drive-list-shared-drives.js.map +1 -0
  110. package/dist/lib/action/drive-move-file.d.ts +8 -0
  111. package/dist/lib/action/drive-move-file.d.ts.map +1 -0
  112. package/dist/lib/action/drive-move-file.js +57 -0
  113. package/dist/lib/action/drive-move-file.js.map +1 -0
  114. package/dist/lib/action/drive-remove-permission.d.ts +9 -0
  115. package/dist/lib/action/drive-remove-permission.d.ts.map +1 -0
  116. package/dist/lib/action/drive-remove-permission.js +75 -0
  117. package/dist/lib/action/drive-remove-permission.js.map +1 -0
  118. package/dist/lib/action/drive-replace-file-content.d.ts +9 -0
  119. package/dist/lib/action/drive-replace-file-content.d.ts.map +1 -0
  120. package/dist/lib/action/drive-replace-file-content.js +67 -0
  121. package/dist/lib/action/drive-replace-file-content.js.map +1 -0
  122. package/dist/lib/action/drive-save-file-as-pdf.d.ts +9 -0
  123. package/dist/lib/action/drive-save-file-as-pdf.d.ts.map +1 -0
  124. package/dist/lib/action/drive-save-file-as-pdf.js +73 -0
  125. package/dist/lib/action/drive-save-file-as-pdf.js.map +1 -0
  126. package/dist/lib/action/drive-search-files.d.ts +12 -0
  127. package/dist/lib/action/drive-search-files.d.ts.map +1 -0
  128. package/dist/lib/action/drive-search-files.js +130 -0
  129. package/dist/lib/action/drive-search-files.js.map +1 -0
  130. package/dist/lib/action/drive-set-public-access.d.ts +8 -0
  131. package/dist/lib/action/drive-set-public-access.d.ts.map +1 -0
  132. package/dist/lib/action/drive-set-public-access.js +71 -0
  133. package/dist/lib/action/drive-set-public-access.js.map +1 -0
  134. package/dist/lib/action/drive-share-file.d.ts +10 -0
  135. package/dist/lib/action/drive-share-file.d.ts.map +1 -0
  136. package/dist/lib/action/drive-share-file.js +69 -0
  137. package/dist/lib/action/drive-share-file.js.map +1 -0
  138. package/dist/lib/action/drive-trash-file.d.ts +7 -0
  139. package/dist/lib/action/drive-trash-file.d.ts.map +1 -0
  140. package/dist/lib/action/drive-trash-file.js +45 -0
  141. package/dist/lib/action/drive-trash-file.js.map +1 -0
  142. package/dist/lib/action/drive-untrash-file.d.ts +7 -0
  143. package/dist/lib/action/drive-untrash-file.d.ts.map +1 -0
  144. package/dist/lib/action/drive-untrash-file.js +54 -0
  145. package/dist/lib/action/drive-untrash-file.js.map +1 -0
  146. package/dist/lib/action/drive-update-file-metadata.d.ts +10 -0
  147. package/dist/lib/action/drive-update-file-metadata.d.ts.map +1 -0
  148. package/dist/lib/action/drive-update-file-metadata.js +79 -0
  149. package/dist/lib/action/drive-update-file-metadata.js.map +1 -0
  150. package/dist/lib/action/drive-update-permission.d.ts +9 -0
  151. package/dist/lib/action/drive-update-permission.d.ts.map +1 -0
  152. package/dist/lib/action/drive-update-permission.js +93 -0
  153. package/dist/lib/action/drive-update-permission.js.map +1 -0
  154. package/dist/lib/action/drive-update-reply.d.ts +10 -0
  155. package/dist/lib/action/drive-update-reply.d.ts.map +1 -0
  156. package/dist/lib/action/drive-update-reply.js +72 -0
  157. package/dist/lib/action/drive-update-reply.js.map +1 -0
  158. package/dist/lib/action/drive-update-shared-drive.d.ts +8 -0
  159. package/dist/lib/action/drive-update-shared-drive.d.ts.map +1 -0
  160. package/dist/lib/action/drive-update-shared-drive.js +62 -0
  161. package/dist/lib/action/drive-update-shared-drive.js.map +1 -0
  162. package/dist/lib/action/drive-upload-file.d.ts +9 -0
  163. package/dist/lib/action/drive-upload-file.d.ts.map +1 -0
  164. package/dist/lib/action/drive-upload-file.js +71 -0
  165. package/dist/lib/action/drive-upload-file.js.map +1 -0
  166. package/dist/lib/action/drive-upload-from-url.d.ts +10 -0
  167. package/dist/lib/action/drive-upload-from-url.d.ts.map +1 -0
  168. package/dist/lib/action/drive-upload-from-url.js +90 -0
  169. package/dist/lib/action/drive-upload-from-url.js.map +1 -0
  170. package/dist/lib/action/duplicate-file.action.d.ts +11 -0
  171. package/dist/lib/action/duplicate-file.action.d.ts.map +1 -0
  172. package/dist/lib/action/duplicate-file.action.js +83 -0
  173. package/dist/lib/action/duplicate-file.action.js.map +1 -0
  174. package/dist/lib/action/get-file-by-id.d.ts +8 -0
  175. package/dist/lib/action/get-file-by-id.d.ts.map +1 -0
  176. package/dist/lib/action/get-file-by-id.js +45 -0
  177. package/dist/lib/action/get-file-by-id.js.map +1 -0
  178. package/dist/lib/action/list-files.action.d.ts +11 -0
  179. package/dist/lib/action/list-files.action.d.ts.map +1 -0
  180. package/dist/lib/action/list-files.action.js +165 -0
  181. package/dist/lib/action/list-files.action.js.map +1 -0
  182. package/dist/lib/action/move-file.d.ts +12 -0
  183. package/dist/lib/action/move-file.d.ts.map +1 -0
  184. package/dist/lib/action/move-file.js +52 -0
  185. package/dist/lib/action/move-file.js.map +1 -0
  186. package/dist/lib/action/read-file.d.ts +8 -0
  187. package/dist/lib/action/read-file.d.ts.map +1 -0
  188. package/dist/lib/action/read-file.js +34 -0
  189. package/dist/lib/action/read-file.js.map +1 -0
  190. package/dist/lib/action/save-file-as-pdf.action.d.ts +10 -0
  191. package/dist/lib/action/save-file-as-pdf.action.d.ts.map +1 -0
  192. package/dist/lib/action/save-file-as-pdf.action.js +72 -0
  193. package/dist/lib/action/save-file-as-pdf.action.js.map +1 -0
  194. package/dist/lib/action/search-folder-or-file.action.d.ts +15 -0
  195. package/dist/lib/action/search-folder-or-file.action.d.ts.map +1 -0
  196. package/dist/lib/action/search-folder-or-file.action.js +119 -0
  197. package/dist/lib/action/search-folder-or-file.action.js.map +1 -0
  198. package/dist/lib/action/send-to-trash.d.ts +8 -0
  199. package/dist/lib/action/send-to-trash.d.ts.map +1 -0
  200. package/dist/lib/action/send-to-trash.js +44 -0
  201. package/dist/lib/action/send-to-trash.js.map +1 -0
  202. package/dist/lib/action/set-public-access.d.ts +8 -0
  203. package/dist/lib/action/set-public-access.d.ts.map +1 -0
  204. package/dist/lib/action/set-public-access.js +66 -0
  205. package/dist/lib/action/set-public-access.js.map +1 -0
  206. package/dist/lib/action/upload-file.d.ts +13 -0
  207. package/dist/lib/action/upload-file.d.ts.map +1 -0
  208. package/dist/lib/action/upload-file.js +58 -0
  209. package/dist/lib/action/upload-file.js.map +1 -0
  210. package/dist/lib/auth.d.ts +11 -0
  211. package/dist/lib/auth.d.ts.map +1 -0
  212. package/dist/lib/auth.js +87 -0
  213. package/dist/lib/auth.js.map +1 -0
  214. package/dist/lib/common/get-file-content.d.ts +4 -0
  215. package/dist/lib/common/get-file-content.d.ts.map +1 -0
  216. package/dist/lib/common/get-file-content.js +69 -0
  217. package/dist/lib/common/get-file-content.js.map +1 -0
  218. package/dist/lib/common/index.d.ts +23 -0
  219. package/dist/lib/common/index.d.ts.map +1 -0
  220. package/dist/lib/common/index.js +152 -0
  221. package/dist/lib/common/index.js.map +1 -0
  222. package/dist/lib/output-schemas.d.ts +53 -0
  223. package/dist/lib/output-schemas.d.ts.map +1 -0
  224. package/dist/lib/output-schemas.js +2022 -0
  225. package/dist/lib/output-schemas.js.map +1 -0
  226. package/dist/lib/triggers/new-file.d.ts +43 -0
  227. package/dist/lib/triggers/new-file.d.ts.map +1 -0
  228. package/dist/lib/triggers/new-file.js +107 -0
  229. package/dist/lib/triggers/new-file.js.map +1 -0
  230. package/dist/lib/triggers/new-folder.d.ts +39 -0
  231. package/dist/lib/triggers/new-folder.d.ts.map +1 -0
  232. package/dist/lib/triggers/new-folder.js +71 -0
  233. package/dist/lib/triggers/new-folder.js.map +1 -0
  234. package/package.json +49 -3
  235. package/src/index.ts +149 -0
  236. package/src/lib/action/add-permission.action.ts +82 -0
  237. package/src/lib/action/create-new-folder.ts +42 -0
  238. package/src/lib/action/create-new-text-file.ts +80 -0
  239. package/src/lib/action/delete-file.ts +33 -0
  240. package/src/lib/action/delete-permission.action.ts +84 -0
  241. package/src/lib/action/drive-copy-file.ts +86 -0
  242. package/src/lib/action/drive-create-comment.ts +61 -0
  243. package/src/lib/action/drive-create-file-from-text.ts +99 -0
  244. package/src/lib/action/drive-create-folder.ts +49 -0
  245. package/src/lib/action/drive-create-reply.ts +84 -0
  246. package/src/lib/action/drive-create-shared-drive.ts +52 -0
  247. package/src/lib/action/drive-delete-file.ts +36 -0
  248. package/src/lib/action/drive-delete-reply.ts +65 -0
  249. package/src/lib/action/drive-delete-shared-drive.ts +57 -0
  250. package/src/lib/action/drive-download-file.ts +38 -0
  251. package/src/lib/action/drive-empty-trash.ts +47 -0
  252. package/src/lib/action/drive-export-workspace-file.ts +129 -0
  253. package/src/lib/action/drive-get-about.ts +40 -0
  254. package/src/lib/action/drive-get-file.ts +40 -0
  255. package/src/lib/action/drive-get-reply.ts +67 -0
  256. package/src/lib/action/drive-get-shared-drive.ts +52 -0
  257. package/src/lib/action/drive-list-comments.ts +61 -0
  258. package/src/lib/action/drive-list-files.ts +238 -0
  259. package/src/lib/action/drive-list-permissions.ts +60 -0
  260. package/src/lib/action/drive-list-replies.ts +66 -0
  261. package/src/lib/action/drive-list-shared-drives.ts +59 -0
  262. package/src/lib/action/drive-move-file.ts +56 -0
  263. package/src/lib/action/drive-remove-permission.ts +75 -0
  264. package/src/lib/action/drive-replace-file-content.ts +71 -0
  265. package/src/lib/action/drive-save-file-as-pdf.ts +80 -0
  266. package/src/lib/action/drive-search-files.ts +127 -0
  267. package/src/lib/action/drive-set-public-access.ts +75 -0
  268. package/src/lib/action/drive-share-file.ts +69 -0
  269. package/src/lib/action/drive-trash-file.ts +41 -0
  270. package/src/lib/action/drive-untrash-file.ts +54 -0
  271. package/src/lib/action/drive-update-file-metadata.ts +82 -0
  272. package/src/lib/action/drive-update-permission.ts +100 -0
  273. package/src/lib/action/drive-update-reply.ts +73 -0
  274. package/src/lib/action/drive-update-shared-drive.ts +63 -0
  275. package/src/lib/action/drive-upload-file.ts +80 -0
  276. package/src/lib/action/drive-upload-from-url.ts +107 -0
  277. package/src/lib/action/duplicate-file.action.ts +82 -0
  278. package/src/lib/action/get-file-by-id.ts +37 -0
  279. package/src/lib/action/list-files.action.ts +214 -0
  280. package/src/lib/action/move-file.ts +48 -0
  281. package/src/lib/action/read-file.ts +28 -0
  282. package/src/lib/action/save-file-as-pdf.action.ts +76 -0
  283. package/src/lib/action/search-folder-or-file.action.ts +112 -0
  284. package/src/lib/action/send-to-trash.ts +38 -0
  285. package/src/lib/action/set-public-access.ts +68 -0
  286. package/src/lib/action/upload-file.ts +55 -0
  287. package/src/lib/auth.ts +79 -0
  288. package/src/lib/common/get-file-content.ts +109 -0
  289. package/src/lib/common/index.ts +182 -0
  290. package/src/lib/output-schemas.ts +2070 -0
  291. package/src/lib/triggers/new-file.ts +119 -0
  292. package/src/lib/triggers/new-folder.ts +78 -0
  293. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drive-update-shared-drive.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-update-shared-drive.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB;;;;;;EAyDjC,CAAC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.driveUpdateSharedDrive = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-update-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 auth_1 = require("../auth");
9
+ const drive_1 = require("@googleapis/drive");
10
+ const output_schemas_1 = require("../output-schemas");
11
+ exports.driveUpdateSharedDrive = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.googleDriveAuth,
13
+ name: 'drive_update_shared_drive',
14
+ displayName: 'Update Shared Drive',
15
+ description: 'Rename or update a shared drive by ID.',
16
+ audience: 'ai',
17
+ aiMetadata: {
18
+ description: 'Renames or updates a shared drive\'s settings by ID (resolve via drive_list_shared_drives). Use to rename a shared drive; to remove it entirely use drive_delete_shared_drive. Safe to retry — re-applying the same values is a no-op.',
19
+ idempotent: true,
20
+ },
21
+ outputSchema: output_schemas_1.driveUpdateSharedDriveOutputSchema,
22
+ props: {
23
+ drive_id: pieces_framework_1.Property.ShortText({
24
+ displayName: 'Shared Drive ID',
25
+ description: 'The ID of the shared drive to update. Resolve it via drive_list_shared_drives.',
26
+ required: true,
27
+ }),
28
+ name: pieces_framework_1.Property.ShortText({
29
+ displayName: 'Name',
30
+ description: 'The new name for the shared drive. Leave empty to keep the current name.',
31
+ required: false,
32
+ }),
33
+ },
34
+ run(context) {
35
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
36
+ const { drive_id, name } = context.propsValue;
37
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
38
+ const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
39
+ const requestBody = {};
40
+ if (name) {
41
+ requestBody.name = name;
42
+ }
43
+ try {
44
+ const response = yield drive.drives.update({
45
+ driveId: drive_id,
46
+ requestBody,
47
+ });
48
+ return response.data;
49
+ }
50
+ catch (error) {
51
+ if (error.code === 404) {
52
+ throw new Error(`Shared drive not found (ID: ${drive_id}). Resolve a valid ID via drive_list_shared_drives.`);
53
+ }
54
+ if (error.code === 403) {
55
+ throw new Error(`Permission denied updating shared drive ${drive_id}. You must be an organizer of this drive.`);
56
+ }
57
+ throw error;
58
+ }
59
+ });
60
+ },
61
+ });
62
+ //# sourceMappingURL=drive-update-shared-drive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drive-update-shared-drive.js","sourceRoot":"","sources":["../../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W;iBACZ,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,+BAA+B,QAAQ,qDAAqD,CAC7F,CAAC;gBACJ,CAAC;gBACD,IAAI,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CACb,2CAA2C,QAAQ,2CAA2C,CAC/F,CAAC;gBACJ,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const driveUploadFile: 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
+ file: import("@agnocon/pieces-framework").FileProperty<true, false>;
7
+ parent_folder_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
8
+ }>;
9
+ //# sourceMappingURL=drive-upload-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drive-upload-file.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-upload-file.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,eAAe;;;;;;;EAoE1B,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.driveUploadFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-upload-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 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 mime_types_1 = tslib_1.__importDefault(require("mime-types"));
12
+ const output_schemas_1 = require("../output-schemas");
13
+ exports.driveUploadFile = (0, pieces_framework_1.createAction)({
14
+ auth: auth_1.googleDriveAuth,
15
+ name: 'drive_upload_file',
16
+ displayName: 'Upload File',
17
+ description: 'Upload a file in your Google Drive',
18
+ audience: 'ai',
19
+ aiMetadata: {
20
+ description: 'Uploads a binary file (from a URL or base64 input) into Drive; MIME type is inferred from the extension. Use to store an existing file or attachment; for plain generated text use `drive_create_file_from_text`, and to fetch a remote URL server-side use `drive_upload_from_url`. Each call creates a new file.',
21
+ idempotent: false,
22
+ },
23
+ outputSchema: output_schemas_1.driveUploadFileOutputSchema,
24
+ props: {
25
+ file_name: pieces_framework_1.Property.ShortText({
26
+ displayName: 'File name',
27
+ description: 'The name of the file',
28
+ required: true,
29
+ }),
30
+ file: pieces_framework_1.Property.File({
31
+ displayName: 'File',
32
+ description: 'The file URL or base64 to upload',
33
+ required: true,
34
+ }),
35
+ parent_folder_id: pieces_framework_1.Property.ShortText({
36
+ displayName: 'Parent Folder ID',
37
+ description: 'The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.',
38
+ required: false,
39
+ }),
40
+ },
41
+ run(context) {
42
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
+ const fileData = context.propsValue.file;
44
+ const mimeType = mime_types_1.default.lookup(fileData.extension ? fileData.extension : '');
45
+ const meta = Object.assign({ mimeType: mimeType, name: context.propsValue.file_name }, (context.propsValue.parent_folder_id
46
+ ? { parents: [context.propsValue.parent_folder_id] }
47
+ : {}));
48
+ const metaBuffer = Buffer.from(JSON.stringify(meta), 'utf-8');
49
+ const fileBuffer = Buffer.from(fileData.base64, 'base64');
50
+ const form = new form_data_1.default();
51
+ form.append('Metadata', metaBuffer, { contentType: 'application/json' });
52
+ form.append('Media', fileBuffer);
53
+ const result = yield pieces_common_1.httpClient.sendRequest({
54
+ method: pieces_common_1.HttpMethod.POST,
55
+ url: `https://www.googleapis.com/upload/drive/v3/files`,
56
+ queryParams: {
57
+ uploadType: 'multipart',
58
+ supportsAllDrives: 'true',
59
+ },
60
+ body: form,
61
+ headers: Object.assign({}, form.getHeaders()),
62
+ authentication: {
63
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
64
+ token: yield (0, auth_1.getAccessToken)(context.auth),
65
+ },
66
+ });
67
+ return result.body;
68
+ });
69
+ },
70
+ });
71
+ //# sourceMappingURL=drive-upload-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drive-upload-file.js","sourceRoot":"","sources":["../../../src/lib/action/drive-upload-file.ts"],"names":[],"mappings":";;;;AAAA,+GAA+G;AAC/G,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAChC,kEAAiC;AACjC,kCAA0D;AAC1D,oEAA8B;AAC9B,sDAAgE;AAEnD,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,oCAAoC;IACjD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,oTAAoT;QACtT,UAAU,EAAE,KAAK;KAClB;IACD,YAAY,EAAE,4CAA2B;IACzC,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,sBAAsB;YACnC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACf,C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iBAAiB,EAAE,MAAM;iBAC1B;gBACD,IAAI,EAAE,IAAI;gBACV,OAAO,oBACF,IAAI,CAAC,UAAU,EAAE,CACrB;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,10 @@
1
+ export declare const driveUploadFromUrl: 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
+ source_url: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ file_name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ mime_type: import("@agnocon/pieces-framework").ShortTextProperty<false>;
8
+ parent_folder_id: import("@agnocon/pieces-framework").ShortTextProperty<false>;
9
+ }>;
10
+ //# sourceMappingURL=drive-upload-from-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drive-upload-from-url.d.ts","sourceRoot":"","sources":["../../../src/lib/action/drive-upload-from-url.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,kBAAkB;;;;;;;;EA+F7B,CAAC"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.driveUploadFromUrl = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/drive-upload-from-url.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 mime_types_1 = tslib_1.__importDefault(require("mime-types"));
12
+ const output_schemas_1 = require("../output-schemas");
13
+ exports.driveUploadFromUrl = (0, pieces_framework_1.createAction)({
14
+ auth: auth_1.googleDriveAuth,
15
+ name: 'drive_upload_from_url',
16
+ displayName: 'Upload File from URL',
17
+ description: 'Fetch a file from a public URL and upload it into Google Drive.',
18
+ audience: 'ai',
19
+ aiMetadata: {
20
+ description: 'Fetches a file from a public URL and uploads it into Drive in one step (server-side fetch, no base64 round-trip). Use when the agent has a downloadable link rather than file bytes; for bytes already in hand use `drive_upload_file`, and for plain generated text use `drive_create_file_from_text`. Each call creates a new file.',
21
+ idempotent: false,
22
+ },
23
+ outputSchema: output_schemas_1.driveUploadFromUrlOutputSchema,
24
+ props: {
25
+ source_url: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Source URL',
27
+ description: 'The publicly accessible URL to fetch the file from. Only public URLs are supported (no authentication headers are sent).',
28
+ required: true,
29
+ }),
30
+ file_name: pieces_framework_1.Property.ShortText({
31
+ displayName: 'File name',
32
+ description: 'The name to give the uploaded file in Drive.',
33
+ required: true,
34
+ }),
35
+ mime_type: pieces_framework_1.Property.ShortText({
36
+ displayName: 'MIME Type',
37
+ description: 'Optional MIME type for the uploaded file (e.g. application/pdf). Provide this when the URL has no file extension; otherwise the type is inferred from the URL.',
38
+ required: false,
39
+ }),
40
+ parent_folder_id: pieces_framework_1.Property.ShortText({
41
+ displayName: 'Parent Folder ID',
42
+ description: 'The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.',
43
+ required: false,
44
+ }),
45
+ },
46
+ run(context) {
47
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
+ var _a;
49
+ const { source_url, file_name, mime_type, parent_folder_id } = context.propsValue;
50
+ // SSRF: only public URLs supported — no auth headers are forwarded and the
51
+ // caller is responsible for supplying a publicly reachable link.
52
+ let download;
53
+ try {
54
+ download = yield pieces_common_1.httpClient.sendRequest({
55
+ method: pieces_common_1.HttpMethod.GET,
56
+ url: source_url,
57
+ responseType: 'arraybuffer',
58
+ });
59
+ }
60
+ catch (error) {
61
+ throw new Error(`Failed to fetch the file from the source URL (${source_url}). Ensure it is a publicly accessible link. Underlying error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
62
+ }
63
+ // Honor an explicit mime_type when the URL lacks an extension; otherwise
64
+ // infer it from the URL so Drive does not default everything to octet-stream.
65
+ const resolvedMimeType = mime_type || mime_types_1.default.lookup(source_url) || 'application/octet-stream';
66
+ const meta = Object.assign({ mimeType: resolvedMimeType, name: file_name }, (parent_folder_id ? { parents: [parent_folder_id] } : {}));
67
+ const metaBuffer = Buffer.from(JSON.stringify(meta), 'utf-8');
68
+ const fileBuffer = Buffer.from(download.body);
69
+ const form = new form_data_1.default();
70
+ form.append('Metadata', metaBuffer, { contentType: 'application/json' });
71
+ form.append('Media', fileBuffer, { contentType: resolvedMimeType });
72
+ const result = yield pieces_common_1.httpClient.sendRequest({
73
+ method: pieces_common_1.HttpMethod.POST,
74
+ url: `https://www.googleapis.com/upload/drive/v3/files`,
75
+ queryParams: {
76
+ uploadType: 'multipart',
77
+ supportsAllDrives: 'true',
78
+ },
79
+ body: form,
80
+ headers: Object.assign({}, form.getHeaders()),
81
+ authentication: {
82
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
83
+ token: yield (0, auth_1.getAccessToken)(context.auth),
84
+ },
85
+ });
86
+ return result.body;
87
+ });
88
+ },
89
+ });
90
+ //# sourceMappingURL=drive-upload-from-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drive-upload-from-url.js","sourceRoot":"","sources":["../../../src/lib/action/drive-upload-from-url.ts"],"names":[],"mappings":";;;;AAAA,mHAAmH;AACnH,qEAAqE;AACrE,gEAAmE;AAC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AAU,EAAE,CACrB;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,11 @@
1
+ export declare const duplicateFileAction: 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
+ fileId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ folderId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
8
+ mimeType: import("@agnocon/pieces-framework").StaticDropdownProperty<string, false>;
9
+ include_team_drives: import("@agnocon/pieces-framework").CheckboxProperty<false>;
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":"AAQA,eAAO,MAAM,mBAAmB;;;;;;;;;EA2E9B,CAAC"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.duplicateFileAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/duplicate-file.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 drive_1 = require("@googleapis/drive");
9
+ const auth_1 = require("../auth");
10
+ const common_1 = require("../common");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.duplicateFileAction = (0, pieces_framework_1.createAction)({
13
+ displayName: 'Duplicate File',
14
+ auth: auth_1.googleDriveAuth,
15
+ name: 'duplicate_file',
16
+ description: 'Duplicate a file from Google Drive. Returns the new file ID.',
17
+ audience: 'human',
18
+ aiMetadata: { description: 'Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Google Doc. Use to clone a file or create an editable Google-format copy. Requires the source file ID and destination folder ID. Not idempotent: each call creates a new copy.', idempotent: false },
19
+ props: {
20
+ fileId: pieces_framework_1.Property.ShortText({
21
+ displayName: 'File ID',
22
+ description: 'The ID of the file to duplicate',
23
+ required: true,
24
+ }),
25
+ name: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Name',
27
+ description: 'The name of the new file',
28
+ required: true,
29
+ }),
30
+ folderId: pieces_framework_1.Property.ShortText({
31
+ displayName: 'Folder ID',
32
+ description: 'The ID of the folder where the file will be duplicated',
33
+ required: true,
34
+ }),
35
+ mimeType: pieces_framework_1.Property.StaticDropdown({
36
+ displayName: 'Duplicate as',
37
+ description: 'If left unselected the file will be duplicated as it is',
38
+ required: false,
39
+ options: {
40
+ options: [
41
+ {
42
+ label: 'Google Sheets',
43
+ value: 'application/vnd.google-apps.spreadsheet',
44
+ },
45
+ {
46
+ label: 'Google Docs',
47
+ value: 'application/vnd.google-apps.document',
48
+ }
49
+ ],
50
+ },
51
+ }),
52
+ include_team_drives: common_1.common.properties.include_team_drives,
53
+ },
54
+ outputSchema: output_schemas_1.duplicateFileActionOutputSchema,
55
+ run(context) {
56
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
57
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
58
+ const fileId = context.propsValue.fileId;
59
+ const nameForNewFile = context.propsValue.name;
60
+ const parentFolderId = context.propsValue.folderId;
61
+ const mimeType = context.propsValue.mimeType;
62
+ const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
63
+ const requestBody = {
64
+ name: nameForNewFile,
65
+ parents: [parentFolderId],
66
+ };
67
+ if (mimeType) {
68
+ requestBody.mimeType = mimeType;
69
+ }
70
+ const response = yield drive.files.copy({
71
+ fileId,
72
+ auth: authClient,
73
+ requestBody,
74
+ supportsAllDrives: context.propsValue.include_team_drives,
75
+ });
76
+ if (response.status !== 200) {
77
+ throw new Error('Error duplicating file');
78
+ }
79
+ return response.data;
80
+ });
81
+ },
82
+ });
83
+ //# sourceMappingURL=duplicate-file.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duplicate-file.action.js","sourceRoot":"","sources":["../../../src/lib/action/duplicate-file.action.ts"],"names":[],"mappings":";;;;AAAA,mHAAmH;AACnH,qEAAqE;AACrE,gEAAmE;AACnE,6CAAyD;AACzD,kCAA8D;AAC9D,sCAAmC;AACnC,sDAAoE;AAEvD,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,mSAAmS,EAAE,UAAU,EAAE,KAAK,EAAE;IACnV,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,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,wDAAwD;YACrE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,C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AAM,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 googleDriveGetResourceById: 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
+ id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ include_team_drives: import("@agnocon/pieces-framework").CheckboxProperty<false>;
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":"AAQA,eAAO,MAAM,0BAA0B;;;;;;EA8BrC,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.googleDriveGetResourceById = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/get-file-by-id.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
9
+ const drive_1 = require("@googleapis/drive");
10
+ const common_1 = require("../common");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.googleDriveGetResourceById = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDriveAuth,
14
+ name: 'get-file-or-folder-by-id',
15
+ displayName: 'Get File Information',
16
+ description: 'Get a file folder for files/sub-folders',
17
+ audience: 'human',
18
+ aiMetadata: { description: 'Fetches metadata for a single file or folder in Google Drive by its exact ID (name, MIME type, parents, etc.). Use when an agent already has a file/folder ID and needs its details. Read-only and idempotent. Requires the resource ID, not a name or path.', idempotent: true },
19
+ props: {
20
+ id: pieces_framework_1.Property.ShortText({
21
+ displayName: 'File / Folder Id',
22
+ description: 'The Id of the file/folder to search for.',
23
+ required: true,
24
+ }),
25
+ include_team_drives: common_1.common.properties.include_team_drives,
26
+ },
27
+ outputSchema: output_schemas_1.getFileOrFolderByIdActionOutputSchema,
28
+ run(context) {
29
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
30
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
31
+ const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
32
+ const response = yield drive.files.get({
33
+ fileId: context.propsValue.id,
34
+ supportsAllDrives: context.propsValue.include_team_drives,
35
+ });
36
+ if (response.data) {
37
+ return response.data;
38
+ }
39
+ else {
40
+ return null;
41
+ }
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=get-file-by-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-file-by-id.js","sourceRoot":"","sources":["../../../src/lib/action/get-file-by-id.ts"],"names":[],"mappings":";;;;AAAA,4GAA4G;AAC5G,qEAAqE;AACrE,kCAA8D;AAC9D,gEAAmE;AACnE,6CAAyD;AACzD,sCAAmC;AACnC,sDAA0E;AAE7D,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE,WAAW,EAAE,8PAA8P,EAAE,UAAU,EAAE,IAAI,EAAE;IAC7S,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;IACD,YAAY,EAAE,sDAAqC;IAC7C,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1D,MAAM,KAAK,GAAG,IAAA,aAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAC/D,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,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const googleDriveListFiles: 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
+ folderId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ include_team_drives: import("@agnocon/pieces-framework").CheckboxProperty<false>;
7
+ includeTrashed: import("@agnocon/pieces-framework").CheckboxProperty<false>;
8
+ depthLevel: import("@agnocon/pieces-framework").NumberProperty<false>;
9
+ downloadFiles: import("@agnocon/pieces-framework").CheckboxProperty<false>;
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":"AA8GA,eAAO,MAAM,oBAAoB;;;;;;;;;EAyG/B,CAAC"}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.googleDriveListFiles = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-drive/src/lib/action/list-files.action.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_common_1 = require("@agnocon/pieces-common");
8
+ const auth_1 = require("../auth");
9
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
10
+ const querystring_1 = tslib_1.__importDefault(require("querystring"));
11
+ const common_1 = require("../common");
12
+ const get_file_content_1 = require("../common/get-file-content");
13
+ const output_schemas_1 = require("../output-schemas");
14
+ function getFilesRecursively(auth_2, folderId_1, maxLevel_1, includeTrashed_1, includeTeamDrives_1) {
15
+ return tslib_1.__awaiter(this, arguments, void 0, function* (auth, folderId, maxLevel, includeTrashed, includeTeamDrives, currentLevel = 0) {
16
+ const files = [];
17
+ if (currentLevel > maxLevel) {
18
+ return files;
19
+ }
20
+ const accessToken = yield (0, auth_1.getAccessToken)(auth);
21
+ let q = `'${folderId}' in parents`;
22
+ if (!includeTrashed) {
23
+ q += ' and trashed=false';
24
+ }
25
+ const params = {
26
+ q: q,
27
+ fields: 'nextPageToken,files(id,kind,mimeType,name,trashed,parents)',
28
+ supportsAllDrives: 'true',
29
+ includeItemsFromAllDrives: includeTeamDrives ? 'true' : 'false',
30
+ corpora: includeTeamDrives ? 'allDrives' : 'user',
31
+ pageSize: '1000',
32
+ };
33
+ let response = yield pieces_common_1.httpClient.sendRequest({
34
+ method: pieces_common_1.HttpMethod.GET,
35
+ url: `https://www.googleapis.com/drive/v3/files?${querystring_1.default.stringify(params)}`,
36
+ headers: {
37
+ Authorization: `Bearer ${accessToken}`,
38
+ },
39
+ });
40
+ // Add files from current level
41
+ for (const file of response.body.files) {
42
+ files.push({
43
+ file,
44
+ level: currentLevel,
45
+ parentFolder: folderId
46
+ });
47
+ }
48
+ // Handle pagination for current level
49
+ while (response.body.nextPageToken) {
50
+ params.pageToken = response.body.nextPageToken;
51
+ response = yield pieces_common_1.httpClient.sendRequest({
52
+ method: pieces_common_1.HttpMethod.GET,
53
+ url: `https://www.googleapis.com/drive/v3/files?${querystring_1.default.stringify(params)}`,
54
+ headers: {
55
+ Authorization: `Bearer ${accessToken}`,
56
+ },
57
+ });
58
+ for (const file of response.body.files) {
59
+ files.push({
60
+ file,
61
+ level: currentLevel,
62
+ parentFolder: folderId
63
+ });
64
+ }
65
+ }
66
+ // If we haven't reached max level, recursively get files from subfolders
67
+ if (currentLevel + 1 < maxLevel) {
68
+ const subfolders = files.filter(f => f.file.mimeType === 'application/vnd.google-apps.folder');
69
+ for (const subfolder of subfolders) {
70
+ const subfolderFiles = yield getFilesRecursively(auth, subfolder.file.id, maxLevel, includeTrashed, includeTeamDrives, currentLevel + 1);
71
+ files.push(...subfolderFiles);
72
+ }
73
+ }
74
+ return files;
75
+ });
76
+ }
77
+ exports.googleDriveListFiles = (0, pieces_framework_1.createAction)({
78
+ auth: auth_1.googleDriveAuth,
79
+ name: 'list-files',
80
+ displayName: 'List files',
81
+ description: 'List files from a Google Drive folder',
82
+ audience: 'human',
83
+ aiMetadata: { description: 'Lists files and subfolders inside a given Drive folder, with optional recursion to a chosen depth and optional download of each file\'s content. Use to enumerate the contents of a known folder ID. Read-only and idempotent. Requires the folder ID, not a name.', idempotent: true },
84
+ props: {
85
+ folderId: pieces_framework_1.Property.ShortText({
86
+ displayName: 'Folder ID',
87
+ description: 'Folder ID coming from | New Folder -> id | (or any other source)',
88
+ required: true,
89
+ }),
90
+ include_team_drives: common_1.common.properties.include_team_drives,
91
+ includeTrashed: pieces_framework_1.Property.Checkbox({
92
+ displayName: 'Include Trashed',
93
+ description: 'Include new files that have been trashed.',
94
+ required: false,
95
+ defaultValue: false
96
+ }),
97
+ depthLevel: pieces_framework_1.Property.Number({
98
+ displayName: 'Depth Level',
99
+ description: 'How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.',
100
+ required: false,
101
+ defaultValue: 1
102
+ }),
103
+ downloadFiles: pieces_framework_1.Property.Checkbox({
104
+ displayName: 'Download Files',
105
+ description: 'Download all file contents in a list',
106
+ required: false,
107
+ defaultValue: false
108
+ }),
109
+ },
110
+ outputSchema: output_schemas_1.listFilesActionOutputSchema,
111
+ run(context) {
112
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
+ var _a, _b;
114
+ const result = {
115
+ type: 'drive#fileList',
116
+ incompleteSearch: false,
117
+ files: [],
118
+ };
119
+ const depthLevel = context.propsValue.depthLevel || 1;
120
+ // Get files recursively based on depth level
121
+ const filesWithLevel = yield getFilesRecursively(context.auth, context.propsValue.folderId, depthLevel, (_a = context.propsValue.includeTrashed) !== null && _a !== void 0 ? _a : false, (_b = context.propsValue.include_team_drives) !== null && _b !== void 0 ? _b : false);
122
+ // Extract just the file objects for backward compatibility
123
+ result.files = filesWithLevel.map(f => f.file);
124
+ // If downloadFiles is enabled, download each file and add URLs to array
125
+ if (context.propsValue.downloadFiles) {
126
+ const downloadedFiles = [];
127
+ const extensionMap = {
128
+ 'application/pdf': '.pdf',
129
+ 'image/jpeg': '.jpg',
130
+ 'image/png': '.png',
131
+ 'image/tiff': '.tiff',
132
+ 'text/plain': '.txt',
133
+ 'text/csv': '.csv',
134
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': '.docx',
135
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': '.xlsx'
136
+ };
137
+ for (const fileWithLevel of filesWithLevel) {
138
+ const file = fileWithLevel.file;
139
+ // Skip folders when downloading
140
+ if (file.mimeType === 'application/vnd.google-apps.folder') {
141
+ continue;
142
+ }
143
+ let safeName = file.name;
144
+ const correctExtension = extensionMap[file.mimeType];
145
+ if (correctExtension && !safeName.toLowerCase().endsWith(correctExtension)) {
146
+ // Check for the .jpeg edge case before appending .jpg
147
+ if (!(file.mimeType === 'image/jpeg' && safeName.toLowerCase().endsWith('.jpeg'))) {
148
+ safeName = safeName + correctExtension;
149
+ }
150
+ }
151
+ try {
152
+ const fileUrl = yield (0, get_file_content_1.downloadFileFromDrive)(context.auth, context.files, file.id, safeName);
153
+ downloadedFiles.push(fileUrl);
154
+ }
155
+ catch (error) {
156
+ console.warn(`Failed to download file ${file.name}: ${error instanceof Error ? error.message : 'Download failed'}`);
157
+ }
158
+ }
159
+ result.downloadedFiles = downloadedFiles;
160
+ }
161
+ return result;
162
+ });
163
+ }
164
+ });
165
+ //# sourceMappingURL=list-files.action.js.map