@divyacon/piece-google-docs 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.
Files changed (243) 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 +128 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/append-text.d.ts +8 -0
  7. package/dist/lib/actions/append-text.d.ts.map +1 -0
  8. package/dist/lib/actions/append-text.js +40 -0
  9. package/dist/lib/actions/append-text.js.map +1 -0
  10. package/dist/lib/actions/batch-update.action.d.ts +8 -0
  11. package/dist/lib/actions/batch-update.action.d.ts.map +1 -0
  12. package/dist/lib/actions/batch-update.action.js +63 -0
  13. package/dist/lib/actions/batch-update.action.js.map +1 -0
  14. package/dist/lib/actions/copy-document.action.d.ts +12 -0
  15. package/dist/lib/actions/copy-document.action.d.ts.map +1 -0
  16. package/dist/lib/actions/copy-document.action.js +72 -0
  17. package/dist/lib/actions/copy-document.action.js.map +1 -0
  18. package/dist/lib/actions/create-and-populate-table.action.d.ts +8 -0
  19. package/dist/lib/actions/create-and-populate-table.action.d.ts.map +1 -0
  20. package/dist/lib/actions/create-and-populate-table.action.js +138 -0
  21. package/dist/lib/actions/create-and-populate-table.action.js.map +1 -0
  22. package/dist/lib/actions/create-document-based-on-template.action.d.ts +10 -0
  23. package/dist/lib/actions/create-document-based-on-template.action.d.ts.map +1 -0
  24. package/dist/lib/actions/create-document-based-on-template.action.js +107 -0
  25. package/dist/lib/actions/create-document-based-on-template.action.js.map +1 -0
  26. package/dist/lib/actions/create-document-from-markdown.action.d.ts +8 -0
  27. package/dist/lib/actions/create-document-from-markdown.action.d.ts.map +1 -0
  28. package/dist/lib/actions/create-document-from-markdown.action.js +69 -0
  29. package/dist/lib/actions/create-document-from-markdown.action.js.map +1 -0
  30. package/dist/lib/actions/create-document.d.ts +8 -0
  31. package/dist/lib/actions/create-document.d.ts.map +1 -0
  32. package/dist/lib/actions/create-document.js +35 -0
  33. package/dist/lib/actions/create-document.js.map +1 -0
  34. package/dist/lib/actions/create-footer.action.d.ts +8 -0
  35. package/dist/lib/actions/create-footer.action.d.ts.map +1 -0
  36. package/dist/lib/actions/create-footer.action.js +66 -0
  37. package/dist/lib/actions/create-footer.action.js.map +1 -0
  38. package/dist/lib/actions/create-footnote.action.d.ts +8 -0
  39. package/dist/lib/actions/create-footnote.action.d.ts.map +1 -0
  40. package/dist/lib/actions/create-footnote.action.js +58 -0
  41. package/dist/lib/actions/create-footnote.action.js.map +1 -0
  42. package/dist/lib/actions/create-header.action.d.ts +8 -0
  43. package/dist/lib/actions/create-header.action.d.ts.map +1 -0
  44. package/dist/lib/actions/create-header.action.js +66 -0
  45. package/dist/lib/actions/create-header.action.js.map +1 -0
  46. package/dist/lib/actions/create-named-range.action.d.ts +10 -0
  47. package/dist/lib/actions/create-named-range.action.d.ts.map +1 -0
  48. package/dist/lib/actions/create-named-range.action.js +74 -0
  49. package/dist/lib/actions/create-named-range.action.js.map +1 -0
  50. package/dist/lib/actions/create-paragraph-bullets.action.d.ts +10 -0
  51. package/dist/lib/actions/create-paragraph-bullets.action.d.ts.map +1 -0
  52. package/dist/lib/actions/create-paragraph-bullets.action.js +98 -0
  53. package/dist/lib/actions/create-paragraph-bullets.action.js.map +1 -0
  54. package/dist/lib/actions/create-text-document.action.d.ts +8 -0
  55. package/dist/lib/actions/create-text-document.action.d.ts.map +1 -0
  56. package/dist/lib/actions/create-text-document.action.js +42 -0
  57. package/dist/lib/actions/create-text-document.action.js.map +1 -0
  58. package/dist/lib/actions/delete-content-range.action.d.ts +9 -0
  59. package/dist/lib/actions/delete-content-range.action.d.ts.map +1 -0
  60. package/dist/lib/actions/delete-content-range.action.js +64 -0
  61. package/dist/lib/actions/delete-content-range.action.js.map +1 -0
  62. package/dist/lib/actions/delete-footer.action.d.ts +8 -0
  63. package/dist/lib/actions/delete-footer.action.d.ts.map +1 -0
  64. package/dist/lib/actions/delete-footer.action.js +56 -0
  65. package/dist/lib/actions/delete-footer.action.js.map +1 -0
  66. package/dist/lib/actions/delete-header.action.d.ts +8 -0
  67. package/dist/lib/actions/delete-header.action.d.ts.map +1 -0
  68. package/dist/lib/actions/delete-header.action.js +56 -0
  69. package/dist/lib/actions/delete-header.action.js.map +1 -0
  70. package/dist/lib/actions/delete-named-range.action.d.ts +9 -0
  71. package/dist/lib/actions/delete-named-range.action.d.ts.map +1 -0
  72. package/dist/lib/actions/delete-named-range.action.js +69 -0
  73. package/dist/lib/actions/delete-named-range.action.js.map +1 -0
  74. package/dist/lib/actions/delete-paragraph-bullets.action.d.ts +9 -0
  75. package/dist/lib/actions/delete-paragraph-bullets.action.d.ts.map +1 -0
  76. package/dist/lib/actions/delete-paragraph-bullets.action.js +66 -0
  77. package/dist/lib/actions/delete-paragraph-bullets.action.js.map +1 -0
  78. package/dist/lib/actions/delete-table-column.action.d.ts +10 -0
  79. package/dist/lib/actions/delete-table-column.action.d.ts.map +1 -0
  80. package/dist/lib/actions/delete-table-column.action.js +72 -0
  81. package/dist/lib/actions/delete-table-column.action.js.map +1 -0
  82. package/dist/lib/actions/delete-table-row.action.d.ts +10 -0
  83. package/dist/lib/actions/delete-table-row.action.d.ts.map +1 -0
  84. package/dist/lib/actions/delete-table-row.action.js +72 -0
  85. package/dist/lib/actions/delete-table-row.action.js.map +1 -0
  86. package/dist/lib/actions/export-as-pdf.action.d.ts +7 -0
  87. package/dist/lib/actions/export-as-pdf.action.d.ts.map +1 -0
  88. package/dist/lib/actions/export-as-pdf.action.js +61 -0
  89. package/dist/lib/actions/export-as-pdf.action.js.map +1 -0
  90. package/dist/lib/actions/find-document.d.ts +16 -0
  91. package/dist/lib/actions/find-document.d.ts.map +1 -0
  92. package/dist/lib/actions/find-document.js +127 -0
  93. package/dist/lib/actions/find-document.js.map +1 -0
  94. package/dist/lib/actions/get-document-end-index.action.d.ts +7 -0
  95. package/dist/lib/actions/get-document-end-index.action.d.ts.map +1 -0
  96. package/dist/lib/actions/get-document-end-index.action.js +54 -0
  97. package/dist/lib/actions/get-document-end-index.action.js.map +1 -0
  98. package/dist/lib/actions/get-document-plaintext.action.d.ts +7 -0
  99. package/dist/lib/actions/get-document-plaintext.action.d.ts.map +1 -0
  100. package/dist/lib/actions/get-document-plaintext.action.js +76 -0
  101. package/dist/lib/actions/get-document-plaintext.action.js.map +1 -0
  102. package/dist/lib/actions/get-document.action.d.ts +7 -0
  103. package/dist/lib/actions/get-document.action.d.ts.map +1 -0
  104. package/dist/lib/actions/get-document.action.js +45 -0
  105. package/dist/lib/actions/get-document.action.js.map +1 -0
  106. package/dist/lib/actions/insert-image-in-table-cell.action.d.ts +13 -0
  107. package/dist/lib/actions/insert-image-in-table-cell.action.d.ts.map +1 -0
  108. package/dist/lib/actions/insert-image-in-table-cell.action.js +128 -0
  109. package/dist/lib/actions/insert-image-in-table-cell.action.js.map +1 -0
  110. package/dist/lib/actions/insert-inline-image.action.d.ts +11 -0
  111. package/dist/lib/actions/insert-inline-image.action.d.ts.map +1 -0
  112. package/dist/lib/actions/insert-inline-image.action.js +84 -0
  113. package/dist/lib/actions/insert-inline-image.action.js.map +1 -0
  114. package/dist/lib/actions/insert-page-break.action.d.ts +8 -0
  115. package/dist/lib/actions/insert-page-break.action.d.ts.map +1 -0
  116. package/dist/lib/actions/insert-page-break.action.js +60 -0
  117. package/dist/lib/actions/insert-page-break.action.js.map +1 -0
  118. package/dist/lib/actions/insert-table-column.action.d.ts +11 -0
  119. package/dist/lib/actions/insert-table-column.action.d.ts.map +1 -0
  120. package/dist/lib/actions/insert-table-column.action.js +86 -0
  121. package/dist/lib/actions/insert-table-column.action.js.map +1 -0
  122. package/dist/lib/actions/insert-table-row.action.d.ts +11 -0
  123. package/dist/lib/actions/insert-table-row.action.d.ts.map +1 -0
  124. package/dist/lib/actions/insert-table-row.action.js +86 -0
  125. package/dist/lib/actions/insert-table-row.action.js.map +1 -0
  126. package/dist/lib/actions/insert-table.action.d.ts +10 -0
  127. package/dist/lib/actions/insert-table.action.d.ts.map +1 -0
  128. package/dist/lib/actions/insert-table.action.js +72 -0
  129. package/dist/lib/actions/insert-table.action.js.map +1 -0
  130. package/dist/lib/actions/insert-text-in-table-cell.action.d.ts +11 -0
  131. package/dist/lib/actions/insert-text-in-table-cell.action.d.ts.map +1 -0
  132. package/dist/lib/actions/insert-text-in-table-cell.action.js +115 -0
  133. package/dist/lib/actions/insert-text-in-table-cell.action.js.map +1 -0
  134. package/dist/lib/actions/insert-text.action.d.ts +9 -0
  135. package/dist/lib/actions/insert-text.action.d.ts.map +1 -0
  136. package/dist/lib/actions/insert-text.action.js +66 -0
  137. package/dist/lib/actions/insert-text.action.js.map +1 -0
  138. package/dist/lib/actions/read-document.action.d.ts +7 -0
  139. package/dist/lib/actions/read-document.action.d.ts.map +1 -0
  140. package/dist/lib/actions/read-document.action.js +44 -0
  141. package/dist/lib/actions/read-document.action.js.map +1 -0
  142. package/dist/lib/actions/replace-all-text.action.d.ts +10 -0
  143. package/dist/lib/actions/replace-all-text.action.d.ts.map +1 -0
  144. package/dist/lib/actions/replace-all-text.action.js +92 -0
  145. package/dist/lib/actions/replace-all-text.action.js.map +1 -0
  146. package/dist/lib/actions/replace-body-with-markdown.action.d.ts +8 -0
  147. package/dist/lib/actions/replace-body-with-markdown.action.d.ts.map +1 -0
  148. package/dist/lib/actions/replace-body-with-markdown.action.js +79 -0
  149. package/dist/lib/actions/replace-body-with-markdown.action.js.map +1 -0
  150. package/dist/lib/actions/replace-image.action.d.ts +9 -0
  151. package/dist/lib/actions/replace-image.action.d.ts.map +1 -0
  152. package/dist/lib/actions/replace-image.action.js +65 -0
  153. package/dist/lib/actions/replace-image.action.js.map +1 -0
  154. package/dist/lib/actions/replace-section-with-markdown.action.d.ts +10 -0
  155. package/dist/lib/actions/replace-section-with-markdown.action.d.ts.map +1 -0
  156. package/dist/lib/actions/replace-section-with-markdown.action.js +106 -0
  157. package/dist/lib/actions/replace-section-with-markdown.action.js.map +1 -0
  158. package/dist/lib/actions/search-documents.action.d.ts +11 -0
  159. package/dist/lib/actions/search-documents.action.d.ts.map +1 -0
  160. package/dist/lib/actions/search-documents.action.js +121 -0
  161. package/dist/lib/actions/search-documents.action.js.map +1 -0
  162. package/dist/lib/actions/unmerge-table-cells.action.d.ts +12 -0
  163. package/dist/lib/actions/unmerge-table-cells.action.d.ts.map +1 -0
  164. package/dist/lib/actions/unmerge-table-cells.action.js +94 -0
  165. package/dist/lib/actions/unmerge-table-cells.action.js.map +1 -0
  166. package/dist/lib/actions/update-document-style.action.d.ts +11 -0
  167. package/dist/lib/actions/update-document-style.action.d.ts.map +1 -0
  168. package/dist/lib/actions/update-document-style.action.js +95 -0
  169. package/dist/lib/actions/update-document-style.action.js.map +1 -0
  170. package/dist/lib/actions/update-table-row-style.action.d.ts +10 -0
  171. package/dist/lib/actions/update-table-row-style.action.d.ts.map +1 -0
  172. package/dist/lib/actions/update-table-row-style.action.js +78 -0
  173. package/dist/lib/actions/update-table-row-style.action.js.map +1 -0
  174. package/dist/lib/auth.d.ts +11 -0
  175. package/dist/lib/auth.d.ts.map +1 -0
  176. package/dist/lib/auth.js +92 -0
  177. package/dist/lib/auth.js.map +1 -0
  178. package/dist/lib/common/index.d.ts +11 -0
  179. package/dist/lib/common/index.d.ts.map +1 -0
  180. package/dist/lib/common/index.js +124 -0
  181. package/dist/lib/common/index.js.map +1 -0
  182. package/dist/lib/common/props.d.ts +5 -0
  183. package/dist/lib/common/props.d.ts.map +1 -0
  184. package/dist/lib/common/props.js +53 -0
  185. package/dist/lib/common/props.js.map +1 -0
  186. package/dist/lib/output-schemas.d.ts +43 -0
  187. package/dist/lib/output-schemas.d.ts.map +1 -0
  188. package/dist/lib/output-schemas.js +554 -0
  189. package/dist/lib/output-schemas.js.map +1 -0
  190. package/dist/lib/triggers/new-document.d.ts +35 -0
  191. package/dist/lib/triggers/new-document.d.ts.map +1 -0
  192. package/dist/lib/triggers/new-document.js +104 -0
  193. package/dist/lib/triggers/new-document.js.map +1 -0
  194. package/package.json +48 -4
  195. package/src/index.ts +120 -0
  196. package/src/lib/actions/append-text.ts +37 -0
  197. package/src/lib/actions/batch-update.action.ts +58 -0
  198. package/src/lib/actions/copy-document.action.ts +74 -0
  199. package/src/lib/actions/create-and-populate-table.action.ts +141 -0
  200. package/src/lib/actions/create-document-based-on-template.action.ts +110 -0
  201. package/src/lib/actions/create-document-from-markdown.action.ts +63 -0
  202. package/src/lib/actions/create-document.ts +36 -0
  203. package/src/lib/actions/create-footer.action.ts +59 -0
  204. package/src/lib/actions/create-footnote.action.ts +53 -0
  205. package/src/lib/actions/create-header.action.ts +59 -0
  206. package/src/lib/actions/create-named-range.action.ts +70 -0
  207. package/src/lib/actions/create-paragraph-bullets.action.ts +95 -0
  208. package/src/lib/actions/create-text-document.action.ts +35 -0
  209. package/src/lib/actions/delete-content-range.action.ts +59 -0
  210. package/src/lib/actions/delete-footer.action.ts +51 -0
  211. package/src/lib/actions/delete-header.action.ts +51 -0
  212. package/src/lib/actions/delete-named-range.action.ts +65 -0
  213. package/src/lib/actions/delete-paragraph-bullets.action.ts +62 -0
  214. package/src/lib/actions/delete-table-column.action.ts +67 -0
  215. package/src/lib/actions/delete-table-row.action.ts +67 -0
  216. package/src/lib/actions/export-as-pdf.action.ts +59 -0
  217. package/src/lib/actions/find-document.ts +136 -0
  218. package/src/lib/actions/get-document-end-index.action.ts +47 -0
  219. package/src/lib/actions/get-document-plaintext.action.ts +74 -0
  220. package/src/lib/actions/get-document.action.ts +37 -0
  221. package/src/lib/actions/insert-image-in-table-cell.action.ts +139 -0
  222. package/src/lib/actions/insert-inline-image.action.ts +83 -0
  223. package/src/lib/actions/insert-page-break.action.ts +56 -0
  224. package/src/lib/actions/insert-table-column.action.ts +80 -0
  225. package/src/lib/actions/insert-table-row.action.ts +80 -0
  226. package/src/lib/actions/insert-table.action.ts +68 -0
  227. package/src/lib/actions/insert-text-in-table-cell.action.ts +120 -0
  228. package/src/lib/actions/insert-text.action.ts +62 -0
  229. package/src/lib/actions/read-document.action.ts +40 -0
  230. package/src/lib/actions/replace-all-text.action.ts +95 -0
  231. package/src/lib/actions/replace-body-with-markdown.action.ts +76 -0
  232. package/src/lib/actions/replace-image.action.ts +60 -0
  233. package/src/lib/actions/replace-section-with-markdown.action.ts +104 -0
  234. package/src/lib/actions/search-documents.action.ts +131 -0
  235. package/src/lib/actions/unmerge-table-cells.action.ts +88 -0
  236. package/src/lib/actions/update-document-style.action.ts +93 -0
  237. package/src/lib/actions/update-table-row-style.action.ts +73 -0
  238. package/src/lib/auth.ts +84 -0
  239. package/src/lib/common/index.ts +126 -0
  240. package/src/lib/common/props.ts +55 -0
  241. package/src/lib/output-schemas.ts +593 -0
  242. package/src/lib/triggers/new-document.ts +108 -0
  243. package/README.md +0 -3
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDocument = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/actions/get-document.action.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
10
+ const docs_1 = require("@googleapis/docs");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.getDocument = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDocsAuth,
14
+ name: 'get_document',
15
+ displayName: 'Get Document',
16
+ description: 'Get the full content and structure of a Google Docs document',
17
+ audience: 'ai',
18
+ aiMetadata: {
19
+ description: 'Fetches the full content and structure of a Google Docs document by its ID — the raw document JSON including body elements and their character indices. Use when an agent needs the complete structure, e.g. to locate element indices before editing. For only the readable text use Get Document Plaintext; for just the body end index use Get Document End Index. Requires the document ID; read-only and idempotent.',
20
+ idempotent: true,
21
+ },
22
+ outputSchema: output_schemas_1.readDocumentActionOutputSchema,
23
+ props: {
24
+ documentId: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Document ID',
26
+ description: 'The ID of the document to read (from the document URL or Search Documents).',
27
+ required: true,
28
+ }),
29
+ },
30
+ run(context) {
31
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
+ const { documentId } = context.propsValue;
33
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
34
+ const docs = (0, docs_1.docs)({ version: 'v1', auth: authClient });
35
+ try {
36
+ const response = yield docs.documents.get({ documentId });
37
+ return response.data;
38
+ }
39
+ catch (error) {
40
+ throw new Error(common_1.docsCommon.formatError(error, 'read'));
41
+ }
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=get-document.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-document.action.js","sourceRoot":"","sources":["../../../src/lib/actions/get-document.action.ts"],"names":[],"mappings":";;;;AAAA,iHAAiH;AACjH,qEAAqE;AACrE,kCAA6D;AAC7D,sCAAuC;AACvC,gEAAmE;AACnE,2CAAsD;AACtD,sDAAmE;AAEtD,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,WAAW,EACT,2ZAA2Z;QAC7Z,UAAU,EAAE,IAAI;KACjB;IACD,YAAY,EAAE,+CAA8B;IAC5C,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,6EAA6E;YAC1F,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC1C,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1D,MAAM,IAAI,GAAG,IAAA,WAAU,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAC7D,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC1D,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mBAAU,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const insertImageInTableCell: 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
+ documentId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ tableStartIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
7
+ rowIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
8
+ columnIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
9
+ uri: import("@agnocon/pieces-framework").ShortTextProperty<true>;
10
+ width: import("@agnocon/pieces-framework").NumberProperty<false>;
11
+ height: import("@agnocon/pieces-framework").NumberProperty<false>;
12
+ }>;
13
+ //# sourceMappingURL=insert-image-in-table-cell.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-image-in-table-cell.action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/insert-image-in-table-cell.action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,sBAAsB;;;;;;;;;;;EAoIjC,CAAC"}
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertImageInTableCell = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/actions/insert-image-in-table-cell.action.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
10
+ const docs_1 = require("@googleapis/docs");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.insertImageInTableCell = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDocsAuth,
14
+ name: 'insert_image_in_table_cell',
15
+ displayName: 'Insert Image in Table Cell',
16
+ description: 'Insert an inline image into a specific table cell in a Google Docs document',
17
+ audience: 'ai',
18
+ aiMetadata: {
19
+ description: 'Inserts an inline image at the start of a specific table cell in a Google Docs document. The action reads the document to resolve the correct character index for the target cell, then inserts the image from the given URI. Optionally accepts width and height in points. Requires the table start index (from Read Document — cannot be guessed). Not idempotent: each call inserts another image.',
20
+ idempotent: false,
21
+ },
22
+ outputSchema: output_schemas_1.insertImageInTableCellActionOutputSchema,
23
+ props: {
24
+ documentId: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Document ID',
26
+ description: 'The ID of the document containing the table.',
27
+ required: true,
28
+ }),
29
+ tableStartIndex: pieces_framework_1.Property.Number({
30
+ displayName: 'Table Start Index',
31
+ description: 'Obtain the table start index from Read Document — cannot be guessed.',
32
+ required: true,
33
+ }),
34
+ rowIndex: pieces_framework_1.Property.Number({
35
+ displayName: 'Row Index',
36
+ description: 'Zero-based row index of the target cell.',
37
+ required: true,
38
+ }),
39
+ columnIndex: pieces_framework_1.Property.Number({
40
+ displayName: 'Column Index',
41
+ description: 'Zero-based column index of the target cell.',
42
+ required: true,
43
+ }),
44
+ uri: pieces_framework_1.Property.ShortText({
45
+ displayName: 'Image URI',
46
+ description: 'Publicly accessible URL of the image to insert.',
47
+ required: true,
48
+ }),
49
+ width: pieces_framework_1.Property.Number({
50
+ displayName: 'Width (points)',
51
+ description: 'Optional width of the image in points. If omitted, the image uses its natural size.',
52
+ required: false,
53
+ }),
54
+ height: pieces_framework_1.Property.Number({
55
+ displayName: 'Height (points)',
56
+ description: 'Optional height of the image in points. If omitted, the image uses its natural size.',
57
+ required: false,
58
+ }),
59
+ },
60
+ run(context) {
61
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
+ var _a, _b, _c, _d, _e, _f;
63
+ const { documentId, tableStartIndex, rowIndex, columnIndex, uri, width, height } = context.propsValue;
64
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
65
+ const docs = (0, docs_1.docs)({ version: 'v1', auth: authClient });
66
+ let cellContentIndex;
67
+ try {
68
+ const docResponse = yield docs.documents.get({ documentId });
69
+ const content = (_b = (_a = docResponse.data.body) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : [];
70
+ const tableElement = content.find((el) => el.table !== undefined && el.startIndex === tableStartIndex);
71
+ if (!(tableElement === null || tableElement === void 0 ? void 0 : tableElement.table)) {
72
+ throw new Error(`No table found at start index ${tableStartIndex}. Verify the table start index from Read Document.`);
73
+ }
74
+ const tableRows = (_c = tableElement.table.tableRows) !== null && _c !== void 0 ? _c : [];
75
+ const targetRow = tableRows[rowIndex];
76
+ if (!targetRow) {
77
+ throw new Error(`Row index ${rowIndex} is out of range — table has ${tableRows.length} row(s).`);
78
+ }
79
+ const targetCell = ((_d = targetRow.tableCells) !== null && _d !== void 0 ? _d : [])[columnIndex];
80
+ if (!targetCell) {
81
+ throw new Error(`Column index ${columnIndex} is out of range — row has ${((_e = targetRow.tableCells) !== null && _e !== void 0 ? _e : []).length} cell(s).`);
82
+ }
83
+ const firstContent = ((_f = targetCell.content) !== null && _f !== void 0 ? _f : [])[0];
84
+ if ((firstContent === null || firstContent === void 0 ? void 0 : firstContent.startIndex) === undefined || firstContent.startIndex === null) {
85
+ throw new Error('Could not resolve the content start index for the target cell.');
86
+ }
87
+ cellContentIndex = firstContent.startIndex;
88
+ }
89
+ catch (error) {
90
+ if (error instanceof Error && error.message.startsWith('No table') ||
91
+ error instanceof Error && error.message.startsWith('Row index') ||
92
+ error instanceof Error && error.message.startsWith('Column index') ||
93
+ error instanceof Error && error.message.startsWith('Could not')) {
94
+ throw error;
95
+ }
96
+ throw new Error(common_1.docsCommon.formatError(error, 'read'));
97
+ }
98
+ const objectSize = width !== undefined || height !== undefined
99
+ ? {
100
+ width: width !== undefined ? { magnitude: width, unit: 'PT' } : undefined,
101
+ height: height !== undefined ? { magnitude: height, unit: 'PT' } : undefined,
102
+ }
103
+ : undefined;
104
+ const request = {
105
+ insertInlineImage: Object.assign({ uri, location: { index: cellContentIndex } }, (objectSize ? { objectSize } : {})),
106
+ };
107
+ try {
108
+ yield docs.documents.batchUpdate({
109
+ documentId,
110
+ requestBody: { requests: [request] },
111
+ });
112
+ return {
113
+ success: true,
114
+ documentId,
115
+ tableStartIndex,
116
+ rowIndex,
117
+ columnIndex,
118
+ insertedAtIndex: cellContentIndex,
119
+ uri,
120
+ };
121
+ }
122
+ catch (error) {
123
+ throw new Error(common_1.docsCommon.formatError(error, 'insert image into table cell in'));
124
+ }
125
+ });
126
+ },
127
+ });
128
+ //# sourceMappingURL=insert-image-in-table-cell.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-image-in-table-cell.action.js","sourceRoot":"","sources":["../../../src/lib/actions/insert-image-in-table-cell.action.ts"],"names":[],"mappings":";;;;AAAA,+HAA+H;AAC/H,qEAAqE;AACrE,kCAA6D;AAC7D,sCAAuC;AACvC,gEAAmE;AACnE,2CAA+D;AAC/D,sDAA6E;AAEhE,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,4BAA4B;IACzC,WAAW,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AE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;iBAC7E;gBACH,CAAC,CAAC,SAAS,CAAC;YAEhB,MAAM,OAAO,GAA2B;gBACtC,iBAAiB,kBACf,GAAG,EACH,QAAQ,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAClC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACtC;aACF,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;oBAC/B,UAAU;oBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE;iBACrC,CAAC,CAAC;gBACH,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,UAAU;oBACV,eAAe;oBACf,QAAQ;oBACR,WAAW;oBACX,eAAe,EAAE,gBAAgB;oBACjC,GAAG;iBACJ,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mBAAU,CAAC,WAAW,CAAC,KAAK,EAAE,iCAAiC,CAAC,CAAC,CAAC;YACpF,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const insertInlineImage: 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
+ documentId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ uri: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ index: import("@agnocon/pieces-framework").NumberProperty<false>;
8
+ widthPt: import("@agnocon/pieces-framework").NumberProperty<false>;
9
+ heightPt: import("@agnocon/pieces-framework").NumberProperty<false>;
10
+ }>;
11
+ //# sourceMappingURL=insert-inline-image.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-inline-image.action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/insert-inline-image.action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;;;;;;;;EA4E5B,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertInlineImage = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/actions/insert-inline-image.action.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
10
+ const docs_1 = require("@googleapis/docs");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.insertInlineImage = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDocsAuth,
14
+ name: 'insert_inline_image',
15
+ displayName: 'Insert Inline Image',
16
+ description: 'Insert an inline image into a Google Docs document at a position or at the end.',
17
+ audience: 'ai',
18
+ aiMetadata: {
19
+ description: 'Inserts an inline image from a publicly fetchable URI into a Google Docs document. If "index" is omitted the image is placed at the end of the document body; if "index" is provided it is inserted at that character index — obtain a valid index from Get Document End Index first (indices cannot be guessed). The URI must be publicly accessible by Google at call time. Not idempotent: each call inserts another copy of the image.',
20
+ idempotent: false,
21
+ },
22
+ outputSchema: output_schemas_1.insertInlineImageActionOutputSchema,
23
+ props: {
24
+ documentId: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Document ID',
26
+ description: 'The ID of the document to insert the image into.',
27
+ required: true,
28
+ }),
29
+ uri: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Image URI',
31
+ description: 'A publicly accessible URL of the image to insert. Google must be able to fetch this URL at the time of the call.',
32
+ required: true,
33
+ }),
34
+ index: pieces_framework_1.Property.Number({
35
+ displayName: 'Index',
36
+ description: 'Character index at which to insert the image. Leave empty to insert at the end of the document. Obtain a valid index from Get Document End Index.',
37
+ required: false,
38
+ }),
39
+ widthPt: pieces_framework_1.Property.Number({
40
+ displayName: 'Width (pt)',
41
+ description: 'Desired width of the image in points. Leave empty to use the image\'s natural size.',
42
+ required: false,
43
+ }),
44
+ heightPt: pieces_framework_1.Property.Number({
45
+ displayName: 'Height (pt)',
46
+ description: 'Desired height of the image in points. Leave empty to use the image\'s natural size.',
47
+ required: false,
48
+ }),
49
+ },
50
+ run(context) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ var _a, _b, _c, _d;
53
+ const { documentId, uri, index, widthPt, heightPt } = context.propsValue;
54
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
55
+ const docs = (0, docs_1.docs)({ version: 'v1', auth: authClient });
56
+ const objectSize = widthPt !== undefined && widthPt !== null && heightPt !== undefined && heightPt !== null
57
+ ? {
58
+ width: { magnitude: widthPt, unit: 'PT' },
59
+ height: { magnitude: heightPt, unit: 'PT' },
60
+ }
61
+ : undefined;
62
+ const location = index === undefined || index === null
63
+ ? Object.assign({ uri, endOfSegmentLocation: {} }, (objectSize ? { objectSize } : {})) : Object.assign({ uri, location: { index } }, (objectSize ? { objectSize } : {}));
64
+ const request = { insertInlineImage: location };
65
+ try {
66
+ const response = yield docs.documents.batchUpdate({
67
+ documentId,
68
+ requestBody: { requests: [request] },
69
+ });
70
+ const insertedObjectId = (_d = (_c = (_b = (_a = response.data.replies) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.insertInlineImage) === null || _c === void 0 ? void 0 : _c.objectId) !== null && _d !== void 0 ? _d : null;
71
+ return {
72
+ success: true,
73
+ documentId,
74
+ insertedObjectId,
75
+ mode: index === undefined || index === null ? 'append' : 'insert_at_index',
76
+ };
77
+ }
78
+ catch (error) {
79
+ throw new Error(common_1.docsCommon.formatError(error, 'insert inline image into'));
80
+ }
81
+ });
82
+ },
83
+ });
84
+ //# sourceMappingURL=insert-inline-image.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-inline-image.action.js","sourceRoot":"","sources":["../../../src/lib/actions/insert-inline-image.action.ts"],"names":[],"mappings":";;;;AAAA,wHAAwH;AACxH,qEAAqE;AACrE,kCAA6D;AAC7D,sCAAuC;AACvC,gEAAmE;AACnE,2CAA+D;AAC/D,sDAAwE;AAE3D,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,iFAAiF;IAC9F,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACX,WAAW,EACV,4aAA4a;QAC7a,UAAU,EAAE,KAAK;KACjB;IACD,YAAY,EAAE,oDAAmC;IACjD,KAAK,EAAE;QACN,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,kHAAkH;YAC/H,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,OAAO;YACpB,WAAW,EACV,mJAAmJ;YACpJ,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,qFAAqF;YAClG,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACzB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,sFAAsF;YACnG,QAA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Q,EAAE,CAAC,OAAO,CAAC,EAAE;iBACpC,CAAC,CAAC;gBACH,MAAM,gBAAgB,GAAG,MAAA,MAAA,MAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,0CAAG,CAAC,CAAC,0CAAE,iBAAiB,0CAAE,QAAQ,mCAAI,IAAI,CAAC;gBACzF,OAAO;oBACN,OAAO,EAAE,IAAI;oBACb,UAAU;oBACV,gBAAgB;oBAChB,IAAI,EAAE,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB;iBAC1E,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,mBAAU,CAAC,WAAW,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC;YAC5E,CAAC;QACF,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const insertPageBreak: 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
+ documentId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ index: import("@agnocon/pieces-framework").NumberProperty<false>;
7
+ }>;
8
+ //# sourceMappingURL=insert-page-break.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-page-break.action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/insert-page-break.action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe;;;;;;EAiD1B,CAAC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertPageBreak = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/actions/insert-page-break.action.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
10
+ const docs_1 = require("@googleapis/docs");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.insertPageBreak = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDocsAuth,
14
+ name: 'insert_page_break',
15
+ displayName: 'Insert Page Break',
16
+ description: 'Insert a page break into a Google Docs document at a position or at the end.',
17
+ audience: 'ai',
18
+ aiMetadata: {
19
+ description: 'Inserts a page break into a Google Docs document. If "index" is omitted the page break is appended at the end of the document body; if "index" is provided it is inserted at that character index — obtain a valid index from Get Document End Index first (indices cannot be guessed and must fall inside an existing paragraph). Not idempotent: each call inserts another page break.',
20
+ idempotent: false,
21
+ },
22
+ outputSchema: output_schemas_1.insertPageBreakActionOutputSchema,
23
+ props: {
24
+ documentId: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Document ID',
26
+ description: 'The ID of the document to insert the page break into.',
27
+ required: true,
28
+ }),
29
+ index: pieces_framework_1.Property.Number({
30
+ displayName: 'Index',
31
+ description: 'Character index at which to insert the page break. Leave empty to insert at the end of the document. Obtain a valid index from Get Document End Index.',
32
+ required: false,
33
+ }),
34
+ },
35
+ run(context) {
36
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
+ const { documentId, index } = context.propsValue;
38
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
39
+ const docs = (0, docs_1.docs)({ version: 'v1', auth: authClient });
40
+ const request = index === undefined || index === null
41
+ ? { insertPageBreak: { endOfSegmentLocation: {} } }
42
+ : { insertPageBreak: { location: { index } } };
43
+ try {
44
+ yield docs.documents.batchUpdate({
45
+ documentId,
46
+ requestBody: { requests: [request] },
47
+ });
48
+ return {
49
+ success: true,
50
+ documentId,
51
+ mode: index === undefined || index === null ? 'append' : 'insert_at_index',
52
+ };
53
+ }
54
+ catch (error) {
55
+ throw new Error(common_1.docsCommon.formatError(error, 'insert page break into'));
56
+ }
57
+ });
58
+ },
59
+ });
60
+ //# sourceMappingURL=insert-page-break.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-page-break.action.js","sourceRoot":"","sources":["../../../src/lib/actions/insert-page-break.action.ts"],"names":[],"mappings":";;;;AAAA,sHAAsH;AACtH,qEAAqE;AACrE,kCAA6D;AAC7D,sCAAuC;AACvC,gEAAmE;AACnE,2CAA+D;AAC/D,sDAAsE;AAEzD,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,8EAA8E;IAC3F,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACX,WAAW,EACV,0XAA0X;QAC3X,UAAU,EAAE,KAAK;KACjB;IACD,YAAY,EAAE,kDAAiC;IAC/C,KAAK,EAAE;QACN,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,OAAO;YACpB,WAAW,EACV,wJAAwJ;YACzJ,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACjD,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1D,MAAM,IAAI,GAAG,IAAA,WAAU,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAE7D,MAAM,OAAO,GACZ,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;gBACpC,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,oBAAoB,EAAE,EAAE,EAAE,EAAE;gBACnD,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YAEjD,IAAI,CAAC;gBACJ,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;oBAChC,UAAU;oBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE;iBACpC,CAAC,CAAC;gBACH,OAAO;oBACN,OAAO,EAAE,IAAI;oBACb,UAAU;oBACV,IAAI,EAAE,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB;iBAC1E,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,mBAAU,CAAC,WAAW,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC,CAAC;YAC1E,CAAC;QACF,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const insertTableColumn: 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
+ documentId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ tableStartIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
7
+ rowIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
8
+ columnIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
9
+ insertRight: import("@agnocon/pieces-framework").CheckboxProperty<false>;
10
+ }>;
11
+ //# sourceMappingURL=insert-table-column.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-table-column.action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/insert-table-column.action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;;;;;;;;EAyE5B,CAAC"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertTableColumn = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/actions/insert-table-column.action.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
10
+ const docs_1 = require("@googleapis/docs");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.insertTableColumn = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDocsAuth,
14
+ name: 'insert_table_column',
15
+ displayName: 'Insert Table Column',
16
+ description: 'Insert a column into an existing table in a Google Docs document',
17
+ audience: 'ai',
18
+ aiMetadata: {
19
+ description: 'Inserts a new column into an existing table in a Google Docs document. The column is inserted to the left or right of the cell identified by rowIndex and columnIndex. Use "insertRight" to control the insertion side. Not idempotent: each call inserts another column.',
20
+ idempotent: false,
21
+ },
22
+ outputSchema: output_schemas_1.insertTableColumnActionOutputSchema,
23
+ props: {
24
+ documentId: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Document ID',
26
+ description: 'The ID of the document containing the table.',
27
+ required: true,
28
+ }),
29
+ tableStartIndex: pieces_framework_1.Property.Number({
30
+ displayName: 'Table Start Index',
31
+ description: 'Obtain the table start index from Read Document — cannot be guessed.',
32
+ required: true,
33
+ }),
34
+ rowIndex: pieces_framework_1.Property.Number({
35
+ displayName: 'Row Index',
36
+ description: 'Zero-based row index of the reference cell used to identify the column.',
37
+ required: true,
38
+ }),
39
+ columnIndex: pieces_framework_1.Property.Number({
40
+ displayName: 'Column Index',
41
+ description: 'Zero-based column index of the reference cell.',
42
+ required: true,
43
+ }),
44
+ insertRight: pieces_framework_1.Property.Checkbox({
45
+ displayName: 'Insert to the Right',
46
+ description: 'If true, the new column is inserted to the right of the reference cell; if false, to the left.',
47
+ required: false,
48
+ defaultValue: false,
49
+ }),
50
+ },
51
+ run(context) {
52
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
53
+ const { documentId, tableStartIndex, rowIndex, columnIndex, insertRight } = context.propsValue;
54
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
55
+ const docs = (0, docs_1.docs)({ version: 'v1', auth: authClient });
56
+ const request = {
57
+ insertTableColumn: {
58
+ tableCellLocation: {
59
+ tableStartLocation: { index: tableStartIndex },
60
+ rowIndex,
61
+ columnIndex,
62
+ },
63
+ insertRight: insertRight !== null && insertRight !== void 0 ? insertRight : false,
64
+ },
65
+ };
66
+ try {
67
+ yield docs.documents.batchUpdate({
68
+ documentId,
69
+ requestBody: { requests: [request] },
70
+ });
71
+ return {
72
+ success: true,
73
+ documentId,
74
+ tableStartIndex,
75
+ rowIndex,
76
+ columnIndex,
77
+ insertRight: insertRight !== null && insertRight !== void 0 ? insertRight : false,
78
+ };
79
+ }
80
+ catch (error) {
81
+ throw new Error(common_1.docsCommon.formatError(error, 'insert table column into'));
82
+ }
83
+ });
84
+ },
85
+ });
86
+ //# sourceMappingURL=insert-table-column.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-table-column.action.js","sourceRoot":"","sources":["../../../src/lib/actions/insert-table-column.action.ts"],"names":[],"mappings":";;;;AAAA,wHAAwH;AACxH,qEAAqE;AACrE,kCAA6D;AAC7D,sCAAuC;AACvC,gEAAmE;AACnE,2CAA+D;AAC/D,sDAAwE;AAE3D,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,qBAAqB;IAC3B,W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A2B;gBACtC,iBAAiB,EAAE;oBACjB,iBAAiB,EAAE;wBACjB,kBAAkB,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE;wBAC9C,QAAQ;wBACR,WAAW;qBACZ;oBACD,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,KAAK;iBAClC;aACF,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;oBAC/B,UAAU;oBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE;iBACrC,CAAC,CAAC;gBACH,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,UAAU;oBACV,eAAe;oBACf,QAAQ;oBACR,WAAW;oBACX,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,KAAK;iBAClC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mBAAU,CAAC,WAAW,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC;YAC7E,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const insertTableRow: 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
+ documentId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ tableStartIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
7
+ rowIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
8
+ columnIndex: import("@agnocon/pieces-framework").NumberProperty<true>;
9
+ insertBelow: import("@agnocon/pieces-framework").CheckboxProperty<false>;
10
+ }>;
11
+ //# sourceMappingURL=insert-table-row.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-table-row.action.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/insert-table-row.action.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc;;;;;;;;;EAyEzB,CAAC"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.insertTableRow = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/actions/insert-table-row.action.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
10
+ const docs_1 = require("@googleapis/docs");
11
+ const output_schemas_1 = require("../output-schemas");
12
+ exports.insertTableRow = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDocsAuth,
14
+ name: 'insert_table_row',
15
+ displayName: 'Insert Table Row',
16
+ description: 'Insert a row into an existing table in a Google Docs document',
17
+ audience: 'ai',
18
+ aiMetadata: {
19
+ description: 'Inserts a new row into an existing table in a Google Docs document. The row is inserted above or below the cell identified by rowIndex and columnIndex. Use "insertBelow" to control the insertion side. Not idempotent: each call inserts another row.',
20
+ idempotent: false,
21
+ },
22
+ outputSchema: output_schemas_1.insertTableRowActionOutputSchema,
23
+ props: {
24
+ documentId: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Document ID',
26
+ description: 'The ID of the document containing the table.',
27
+ required: true,
28
+ }),
29
+ tableStartIndex: pieces_framework_1.Property.Number({
30
+ displayName: 'Table Start Index',
31
+ description: 'Obtain the table start index from Read Document — cannot be guessed.',
32
+ required: true,
33
+ }),
34
+ rowIndex: pieces_framework_1.Property.Number({
35
+ displayName: 'Row Index',
36
+ description: 'Zero-based row index of the reference cell used to identify the row.',
37
+ required: true,
38
+ }),
39
+ columnIndex: pieces_framework_1.Property.Number({
40
+ displayName: 'Column Index',
41
+ description: 'Zero-based column index of the reference cell.',
42
+ required: true,
43
+ }),
44
+ insertBelow: pieces_framework_1.Property.Checkbox({
45
+ displayName: 'Insert Below',
46
+ description: 'If true, the new row is inserted below the reference cell; if false, above.',
47
+ required: false,
48
+ defaultValue: false,
49
+ }),
50
+ },
51
+ run(context) {
52
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
53
+ const { documentId, tableStartIndex, rowIndex, columnIndex, insertBelow } = context.propsValue;
54
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
55
+ const docs = (0, docs_1.docs)({ version: 'v1', auth: authClient });
56
+ const request = {
57
+ insertTableRow: {
58
+ tableCellLocation: {
59
+ tableStartLocation: { index: tableStartIndex },
60
+ rowIndex,
61
+ columnIndex,
62
+ },
63
+ insertBelow: insertBelow !== null && insertBelow !== void 0 ? insertBelow : false,
64
+ },
65
+ };
66
+ try {
67
+ yield docs.documents.batchUpdate({
68
+ documentId,
69
+ requestBody: { requests: [request] },
70
+ });
71
+ return {
72
+ success: true,
73
+ documentId,
74
+ tableStartIndex,
75
+ rowIndex,
76
+ columnIndex,
77
+ insertBelow: insertBelow !== null && insertBelow !== void 0 ? insertBelow : false,
78
+ };
79
+ }
80
+ catch (error) {
81
+ throw new Error(common_1.docsCommon.formatError(error, 'insert table row into'));
82
+ }
83
+ });
84
+ },
85
+ });
86
+ //# sourceMappingURL=insert-table-row.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-table-row.action.js","sourceRoot":"","sources":["../../../src/lib/actions/insert-table-row.action.ts"],"names":[],"mappings":";;;;AAAA,qHAAqH;AACrH,qEAAqE;AACrE,kCAA6D;AAC7D,sCAAuC;AACvC,gEAAmE;AACnE,2CAA+D;AAC/D,sDAAqE;AAExD,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,+DA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;wBACjB,kBAAkB,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE;wBAC9C,QAAQ;wBACR,WAAW;qBACZ;oBACD,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,KAAK;iBAClC;aACF,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;oBAC/B,UAAU;oBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE;iBACrC,CAAC,CAAC;gBACH,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,UAAU;oBACV,eAAe;oBACf,QAAQ;oBACR,WAAW;oBACX,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,KAAK;iBAClC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mBAAU,CAAC,WAAW,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const insertTable: 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
+ documentId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ rows: import("@agnocon/pieces-framework").NumberProperty<true>;
7
+ columns: import("@agnocon/pieces-framework").NumberProperty<true>;
8
+ index: import("@agnocon/pieces-framework").NumberProperty<false>;
9
+ }>;
10
+ //# sourceMappingURL=insert-table.action.d.ts.map