@divyacon/piece-google-docs 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 (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 +47 -3
  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,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateTableRowStyle = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/actions/update-table-row-style.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.updateTableRowStyle = (0, pieces_framework_1.createAction)({
13
+ auth: auth_1.googleDocsAuth,
14
+ name: 'update_table_row_style',
15
+ displayName: 'Update Table Row Style',
16
+ description: 'Update style properties of one or more rows in a Google Docs table',
17
+ audience: 'ai',
18
+ aiMetadata: {
19
+ description: 'Updates the minimum height of one or more rows in a Google Docs table. Requires the table start index from Read Document — cannot be guessed. (Google Docs does not support toggling a header row via this request.) Idempotent: applying the same height again is a no-op.',
20
+ idempotent: true,
21
+ },
22
+ outputSchema: output_schemas_1.updateTableRowStyleActionOutputSchema,
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
+ rowIndices: pieces_framework_1.Property.Array({
35
+ displayName: 'Row Indices',
36
+ description: 'Zero-based indices of the rows to update (e.g. [0, 1] to update the first two rows).',
37
+ required: true,
38
+ }),
39
+ minRowHeightPt: pieces_framework_1.Property.Number({
40
+ displayName: 'Minimum Row Height (points)',
41
+ description: 'Minimum height of each selected row, in points.',
42
+ required: true,
43
+ }),
44
+ },
45
+ run(context) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ const { documentId, tableStartIndex, rowIndices, minRowHeightPt } = context.propsValue;
48
+ const authClient = yield (0, auth_1.createGoogleClient)(context.auth);
49
+ const docs = (0, docs_1.docs)({ version: 'v1', auth: authClient });
50
+ const rowIndexNumbers = rowIndices.map((v) => Number(v));
51
+ const request = {
52
+ updateTableRowStyle: {
53
+ tableStartLocation: { index: tableStartIndex },
54
+ rowIndices: rowIndexNumbers,
55
+ tableRowStyle: { minRowHeight: { magnitude: minRowHeightPt, unit: 'PT' } },
56
+ fields: 'minRowHeight',
57
+ },
58
+ };
59
+ try {
60
+ yield docs.documents.batchUpdate({
61
+ documentId,
62
+ requestBody: { requests: [request] },
63
+ });
64
+ return {
65
+ success: true,
66
+ documentId,
67
+ tableStartIndex,
68
+ rowIndices: rowIndexNumbers,
69
+ updatedFields: ['minRowHeight'],
70
+ };
71
+ }
72
+ catch (error) {
73
+ throw new Error(common_1.docsCommon.formatError(error, 'update table row style in'));
74
+ }
75
+ });
76
+ },
77
+ });
78
+ //# sourceMappingURL=update-table-row-style.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-table-row-style.action.js","sourceRoot":"","sources":["../../../src/lib/actions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AAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAE7D,MAAM,eAAe,GAAI,UAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAExE,MAAM,OAAO,GAA2B;gBACtC,mBAAmB,EAAE;oBACnB,kBAAkB,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE;oBAC9C,UAAU,EAAE,eAAe;oBAC3B,aAAa,EAAE,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;oBAC1E,MAAM,EAAE,cAAc;iBACvB;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,UAAU,EAAE,eAAe;oBAC3B,aAAa,EAAE,CAAC,cAAc,CAAC;iBAChC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mBAAU,CAAC,WAAW,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { AppConnectionValueForAuthProperty } from '@agnocon/pieces-framework';
2
+ import { OAuth2Client } from 'google-auth-library';
3
+ export declare const googleDocsScopes: string[];
4
+ export declare const googleDocsAuth: (import("@agnocon/pieces-framework").OAuth2Property<import("@agnocon/pieces-framework").OAuth2Props> | import("@agnocon/pieces-framework").CustomAuthProperty<{
5
+ serviceAccount: import("@agnocon/pieces-framework").LongTextProperty<true>;
6
+ userEmail: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>)[];
8
+ export type GoogleDocsAuthValue = AppConnectionValueForAuthProperty<typeof googleDocsAuth>;
9
+ export declare function createGoogleClient(auth: GoogleDocsAuthValue): Promise<OAuth2Client>;
10
+ export declare const getAccessToken: (auth: GoogleDocsAuthValue) => Promise<string>;
11
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAuB,MAAM,2BAA2B,CAAC;AAEnG,OAAO,EAAO,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAO,MAAM,gBAAgB,UAK5B,CAAC;AAEF,eAAO,MAAM,cAAc;;;KAqCxB,CAAC;AAEJ,MAAM,MAAM,mBAAmB,GAAG,iCAAiC,CAAC,OAAO,cAAc,CAAC,CAAC;AAE3F,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAkBzF;AAED,eAAO,MAAM,cAAc,SAAgB,mBAAmB,KAAG,OAAO,CAAC,MAAM,CAW9E,CAAC"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAccessToken = exports.googleDocsAuth = exports.googleDocsScopes = void 0;
4
+ exports.createGoogleClient = createGoogleClient;
5
+ const tslib_1 = require("tslib");
6
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/auth.ts (MIT).
7
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
8
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
9
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
10
+ const google_auth_library_1 = require("google-auth-library");
11
+ exports.googleDocsScopes = [
12
+ 'https://www.googleapis.com/auth/documents',
13
+ 'https://www.googleapis.com/auth/drive.readonly',
14
+ 'https://www.googleapis.com/auth/drive',
15
+ 'email',
16
+ ];
17
+ exports.googleDocsAuth = [pieces_framework_1.PieceAuth.OAuth2({
18
+ description: '',
19
+ authUrl: 'https://accounts.google.com/o/oauth2/auth',
20
+ tokenUrl: 'https://oauth2.googleapis.com/token',
21
+ required: true,
22
+ scope: exports.googleDocsScopes,
23
+ }), pieces_framework_1.PieceAuth.CustomAuth({
24
+ displayName: 'Service Account (Advanced)',
25
+ description: 'Authenticate via service account from https://console.cloud.google.com/ > IAM & Admin > Service Accounts > Create Service Account > Keys > Add key. <br> <br> You can optionally use domain-wide delegation (https://support.google.com/a/answer/162106?hl=en#zippy=%2Cset-up-domain-wide-delegation-for-a-client) to access documents without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to files/folders you explicitly share with it.',
26
+ required: true,
27
+ props: {
28
+ serviceAccount: pieces_framework_1.Property.LongText({
29
+ displayName: 'Service Account JSON Key',
30
+ required: true,
31
+ }),
32
+ userEmail: pieces_framework_1.Property.ShortText({
33
+ displayName: 'User Email',
34
+ required: false,
35
+ description: 'Email address of the user to impersonate for domain-wide delegation.',
36
+ }),
37
+ },
38
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
39
+ try {
40
+ yield (0, exports.getAccessToken)({
41
+ type: pieces_framework_2.AppConnectionType.CUSTOM_AUTH,
42
+ props: Object.assign({}, auth),
43
+ });
44
+ }
45
+ catch (e) {
46
+ return {
47
+ valid: false,
48
+ error: e.message,
49
+ };
50
+ }
51
+ return {
52
+ valid: true,
53
+ };
54
+ }),
55
+ })];
56
+ function createGoogleClient(auth) {
57
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
+ if (auth.type === pieces_framework_2.AppConnectionType.CUSTOM_AUTH) {
59
+ let serviceAccount;
60
+ try {
61
+ serviceAccount = JSON.parse(auth.props.serviceAccount);
62
+ }
63
+ catch (_a) {
64
+ throw new Error('Invalid Service Account JSON Key. Please provide a valid JSON string.');
65
+ }
66
+ return new google_auth_library_1.JWT({
67
+ email: serviceAccount.client_email,
68
+ key: serviceAccount.private_key,
69
+ scopes: exports.googleDocsScopes,
70
+ subject: auth.props.userEmail,
71
+ });
72
+ }
73
+ const authClient = new google_auth_library_1.OAuth2Client();
74
+ authClient.setCredentials(auth);
75
+ return authClient;
76
+ });
77
+ }
78
+ const getAccessToken = (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
79
+ if (auth.type === pieces_framework_2.AppConnectionType.CUSTOM_AUTH) {
80
+ const googleClient = yield createGoogleClient(auth);
81
+ const response = yield googleClient.getAccessToken();
82
+ if (response.token) {
83
+ return response.token;
84
+ }
85
+ else {
86
+ throw new Error('Could not retrieve access token from service account json');
87
+ }
88
+ }
89
+ return auth.access_token;
90
+ });
91
+ exports.getAccessToken = getAccessToken;
92
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":";;;AAsDA,gDAkBC;;AAxED,0FAA0F;AAC1F,qEAAqE;AACrE,gEAAmG;AACnG,gEAA8D;AAC9D,6DAAwD;AAE3C,QAAA,gBAAgB,GAAG;IAC/B,2CAA2C;IAC3C,gDAAgD;IAChD,uCAAuC;IACvC,OAAO;CACP,CAAC;AAEW,QAAA,cAAc,GAAG,CAAC,4BAAS,CAAC,MAAM,CAAC;QAC/C,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,2CAA2C;QACpD,QAAQ,EAAE,qCAAqC;QAC/C,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,wBAAgB;KACvB,CAAC,EAAE,4BAAS,CAAC,UAAU,CAAC;QACxB,WAAW,EAAE,4BAA4B;QACzC,WAAW,EAAE,sfAAsf;QACngB,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE;YACN,cAAc,EAAE,2BAAQ,CAAC,QAAQ,CAAC;gBACjC,WAAW,EAAE,0BAA0B;gBACvC,QAAQ,EAAE,IAAI;aACd,CAAC;YACF,SAAS,EAAE,2BAAQ,CAAC,S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AAG,CAAO,IAAyB,EAAmB,EAAE;IAClF,IAAI,IAAI,CAAC,IAAI,KAAK,oCAAiB,CAAC,WAAW,EAAE,CAAC;QACjD,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,cAAc,EAAE,CAAC;QACrD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpB,OAAO,QAAQ,CAAC,KAAK,CAAC;QACvB,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC9E,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC,YAAY,CAAC;AAC1B,CAAC,CAAA,CAAC;AAXW,QAAA,cAAc,kBAWzB"}
@@ -0,0 +1,11 @@
1
+ import { docs_v1 } from '@googleapis/docs';
2
+ export declare const docsCommon: {
3
+ baseUrl: string;
4
+ title: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ body: import("@agnocon/pieces-framework").LongTextProperty<true>;
6
+ createDocument: (title: string, accessToken: string) => Promise<any>;
7
+ writeToDocument: (documentId: string, body: string, accessToken: string) => Promise<any>;
8
+ markdownToBatchRequests: (markdown: string, baseIndex?: number) => docs_v1.Schema$Request[];
9
+ formatError: (error: any, action: string) => string;
10
+ };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,eAAO,MAAM,UAAU;;;;4BAYQ,MAAM,eAAe,MAAM;kCAiBrB,MAAM,QAAQ,MAAM,eAAe,MAAM;wCA8BzC,MAAM,yBAAkB,OAAO,CAAC,cAAc,EAAE;yBAmD/D,GAAG,UAAU,MAAM,KAAG,MAAM;CAUjD,CAAC"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.docsCommon = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/common/index.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
9
+ const pieces_common_1 = require("@agnocon/pieces-common");
10
+ exports.docsCommon = {
11
+ baseUrl: 'https://docs.googleapis.com/v1',
12
+ title: pieces_framework_1.Property.ShortText({
13
+ displayName: 'Document Title',
14
+ required: true,
15
+ }),
16
+ body: pieces_framework_1.Property.LongText({
17
+ displayName: 'Document Content',
18
+ required: true,
19
+ }),
20
+ // Creates an empty document with the title provided
21
+ createDocument: (title, accessToken) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
22
+ const createRequest = yield pieces_common_1.httpClient.sendRequest({
23
+ url: `${exports.docsCommon.baseUrl}/documents`,
24
+ method: pieces_common_1.HttpMethod.POST,
25
+ authentication: {
26
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
27
+ token: accessToken,
28
+ },
29
+ body: {
30
+ title: title,
31
+ },
32
+ });
33
+ return createRequest.body;
34
+ }),
35
+ // Writes provided content to the end of an existing document
36
+ writeToDocument: (documentId, body, accessToken) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
37
+ const writeRequest = yield pieces_common_1.httpClient.sendRequest({
38
+ url: `${exports.docsCommon.baseUrl}/documents/${documentId}:batchUpdate`,
39
+ method: pieces_common_1.HttpMethod.POST,
40
+ authentication: {
41
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
42
+ token: accessToken,
43
+ },
44
+ body: {
45
+ requests: [
46
+ {
47
+ insertText: {
48
+ text: body,
49
+ endOfSegmentLocation: {},
50
+ },
51
+ },
52
+ ],
53
+ },
54
+ });
55
+ return writeRequest.body;
56
+ }),
57
+ // Converts block-level Markdown into Google Docs batchUpdate requests.
58
+ // Inserts each line left-to-right at a running cursor (starting at baseIndex)
59
+ // so every index references the document state after the prior inserts in the
60
+ // same batch (indices stay stable because each insert is at the prior insert's
61
+ // end). Block-level only: headings and bullets; inline marks are left as literal
62
+ // text. baseIndex defaults to 1 (start of body); pass a section start index to
63
+ // insert markdown into a freshly-emptied range mid-document.
64
+ markdownToBatchRequests: (markdown, baseIndex = 1) => {
65
+ const lines = markdown.replace(/\r\n/g, '\n').split('\n');
66
+ const requests = [];
67
+ const bulletRanges = [];
68
+ let cursor = baseIndex;
69
+ for (const line of lines) {
70
+ const headingMatch = /^(#{1,3})\s+(.*)$/.exec(line);
71
+ const bulletMatch = /^\s*[-*+]\s+(.*)$/.exec(line);
72
+ let textToInsert = line;
73
+ let headingLevel = 0;
74
+ let isBullet = false;
75
+ if (headingMatch) {
76
+ headingLevel = headingMatch[1].length;
77
+ textToInsert = headingMatch[2];
78
+ }
79
+ else if (bulletMatch) {
80
+ isBullet = true;
81
+ textToInsert = bulletMatch[1];
82
+ }
83
+ requests.push({ insertText: { text: textToInsert + '\n', location: { index: cursor } } });
84
+ const paragraphStart = cursor;
85
+ const paragraphEnd = cursor + textToInsert.length + 1;
86
+ if (headingLevel > 0) {
87
+ requests.push({
88
+ updateParagraphStyle: {
89
+ range: { startIndex: paragraphStart, endIndex: paragraphEnd },
90
+ paragraphStyle: { namedStyleType: `HEADING_${headingLevel}` },
91
+ fields: 'namedStyleType',
92
+ },
93
+ });
94
+ }
95
+ if (isBullet) {
96
+ bulletRanges.push({ startIndex: paragraphStart, endIndex: paragraphEnd });
97
+ }
98
+ cursor = paragraphEnd;
99
+ }
100
+ for (const range of bulletRanges) {
101
+ requests.push({
102
+ createParagraphBullets: { range, bulletPreset: 'BULLET_DISC_CIRCLE_SQUARE' },
103
+ });
104
+ }
105
+ return requests;
106
+ },
107
+ // Maps a Google API (Gaxios) error to a concise, agent-readable message.
108
+ formatError: (error, action) => {
109
+ var _a, _b, _c, _d, _e, _f;
110
+ const status = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : error === null || error === void 0 ? void 0 : error.code;
111
+ const apiMessage = (_f = (_e = (_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error) === null || _e === void 0 ? void 0 : _e.message) !== null && _f !== void 0 ? _f : error === null || error === void 0 ? void 0 : error.message;
112
+ const suffix = apiMessage ? ` ${apiMessage}` : '';
113
+ if (status === 400)
114
+ return `Invalid request trying to ${action} the document (400) — often a bad index or range.${suffix}`;
115
+ if (status === 403)
116
+ return `Permission denied trying to ${action} the document (403) — check the connection has access.${suffix}`;
117
+ if (status === 404)
118
+ return `Document not found trying to ${action} (404) — verify the document ID.${suffix}`;
119
+ if (status === 429)
120
+ return `Rate limit exceeded trying to ${action} the document (429) — retry later.${suffix}`;
121
+ return `Failed to ${action} the document${status ? ` (${status})` : ''}:${suffix || ' unknown error'}`;
122
+ },
123
+ };
124
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,kGAAkG;AAClG,qEAAqE;AACrE,uDAAuD;AACvD,gEAAqD;AACrD,0DAAoF;AAGvE,QAAA,UAAU,GAAG;IACzB,OAAO,EAAE,gCAAgC;IACzC,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;QACzB,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,IAAI;KACd,CAAC;IACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QACvB,WAAW,EAAE,kBAAkB;QAC/B,QAAQ,EAAE,IAAI;KACd,CAAC;IAEF,oDAAoD;IACpD,cAAc,EAAE,CAAO,KAAa,EAAE,WAAmB,EAAE,EAAE;QAC5D,MAAM,aAAa,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAClD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,IAAI,MAAM,IAAI,gBAAgB,EAAE,CAAC;IACxG,CAAC;CACD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const folderIdProp: import("@agnocon/pieces-framework").DropdownProperty<string, false, (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
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/lib/common/props.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;MAkDvB,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.folderIdProp = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/google-docs/src/lib/common/props.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
+ exports.folderIdProp = pieces_framework_1.Property.Dropdown({
11
+ displayName: 'Folder',
12
+ refreshers: [],
13
+ auth: auth_1.googleDocsAuth,
14
+ required: false,
15
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
16
+ if (!auth) {
17
+ return {
18
+ disabled: true,
19
+ placeholder: 'Please connect to your Google Drive account.',
20
+ options: [],
21
+ };
22
+ }
23
+ const authValue = auth;
24
+ const authClient = yield (0, auth_1.createGoogleClient)(authValue);
25
+ const drive = (0, drive_1.drive)({ version: 'v3', auth: authClient });
26
+ const options = [];
27
+ let nextPageToken;
28
+ do {
29
+ const response = yield drive.files.list({
30
+ q: "mimeType='application/vnd.google-apps.folder' and trashed = false",
31
+ supportsAllDrives: true,
32
+ orderBy: 'createdTime desc',
33
+ includeItemsFromAllDrives: true,
34
+ corpora: 'allDrives',
35
+ pageToken: nextPageToken,
36
+ });
37
+ const fileList = response.data;
38
+ if (fileList.files) {
39
+ for (const file of fileList.files)
40
+ options.push({
41
+ label: file.name,
42
+ value: file.id,
43
+ });
44
+ }
45
+ nextPageToken = response.data.nextPageToken;
46
+ } while (nextPageToken);
47
+ return {
48
+ disabled: false,
49
+ options,
50
+ };
51
+ }),
52
+ });
53
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,kGAAkG;AAClG,qEAAqE;AACrE,kCAAkF;AAClF,gEAAqE;AACrE,6CAAmE;AAEtD,QAAA,YAAY,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAC7C,WAAW,EAAE,QAAQ;IACrB,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,qBAAc;IACpB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,OAAO;gBACN,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,8CAA8C;gBAC3D,OAAO,EAAE,EAAE;aACX,CAAC;QACH,CAAC;QACD,MAAM,SAAS,GAAG,IAA2B,CAAC;QAE9C,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAkB,EAAC,SAAS,CAAC,CAAC;QAEvD,MAAM,KAAK,GAAG,IAAA,aAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAE/D,MAAM,OAAO,GAA6B,EAAE,CAAC;QAE7C,IAAI,aAAa,CAAC;QAElB,GAAG,CAAC;YACH,MAAM,QAAQ,GAAQ,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;gBAC5C,CAAC,EAAE,mEAAmE;gBACtE,iBAAiB,EAAE,IAAI;gBACX,OAAO,EAAC,kBAAkB;gBACtC,yBAAyB,EAAE,IAAI;gBAC/B,OAAO,EAAE,WAAW;gBACpB,SAAS,EAAE,aAAa;aACxB,CAAC,CAAC;YAEH,MAAM,QAAQ,GAA6B,QAAQ,CAAC,IAAI,CAAC;YAEzD,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACpB,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK;oBAChC,OAAO,CAAC,IAAI,CAAC;wBACZ,KAAK,EAAE,IAAI,CAAC,IAAK;wBACjB,KAAK,EAAE,IAAI,CAAC,EAAG;qBACf,CAAC,CAAC;YACL,CAAC;YACD,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;QAC7C,CAAC,QAAQ,aAAa,EAAE;QAExB,OAAO;YACN,QAAQ,EAAE,KAAK;YACf,OAAO;SACP,CAAC;IACH,CAAC,CAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { OutputSchema } from '@agnocon/pieces-framework';
2
+ export declare const createDocumentActionOutputSchema: OutputSchema;
3
+ export declare const appendTextActionOutputSchema: OutputSchema;
4
+ export declare const editTemplateActionOutputSchema: OutputSchema;
5
+ export declare const readDocumentActionOutputSchema: OutputSchema;
6
+ export declare const findDocumentActionOutputSchema: OutputSchema;
7
+ export declare const newDocumentTriggerOutputSchema: OutputSchema;
8
+ export declare const insertTextActionOutputSchema: OutputSchema;
9
+ export declare const deleteContentRangeActionOutputSchema: OutputSchema;
10
+ export declare const replaceAllTextActionOutputSchema: OutputSchema;
11
+ export declare const createParagraphBulletsActionOutputSchema: OutputSchema;
12
+ export declare const deleteParagraphBulletsActionOutputSchema: OutputSchema;
13
+ export declare const createFooterActionOutputSchema: OutputSchema;
14
+ export declare const createHeaderActionOutputSchema: OutputSchema;
15
+ export declare const createFootnoteActionOutputSchema: OutputSchema;
16
+ export declare const createNamedRangeActionOutputSchema: OutputSchema;
17
+ export declare const deleteFooterActionOutputSchema: OutputSchema;
18
+ export declare const deleteHeaderActionOutputSchema: OutputSchema;
19
+ export declare const deleteNamedRangeActionOutputSchema: OutputSchema;
20
+ export declare const insertTableActionOutputSchema: OutputSchema;
21
+ export declare const insertTableRowActionOutputSchema: OutputSchema;
22
+ export declare const insertTableColumnActionOutputSchema: OutputSchema;
23
+ export declare const deleteTableRowActionOutputSchema: OutputSchema;
24
+ export declare const deleteTableColumnActionOutputSchema: OutputSchema;
25
+ export declare const insertTextInTableCellActionOutputSchema: OutputSchema;
26
+ export declare const insertImageInTableCellActionOutputSchema: OutputSchema;
27
+ export declare const unmergeTableCellsActionOutputSchema: OutputSchema;
28
+ export declare const updateTableRowStyleActionOutputSchema: OutputSchema;
29
+ export declare const updateDocumentStyleActionOutputSchema: OutputSchema;
30
+ export declare const insertInlineImageActionOutputSchema: OutputSchema;
31
+ export declare const insertPageBreakActionOutputSchema: OutputSchema;
32
+ export declare const replaceImageActionOutputSchema: OutputSchema;
33
+ export declare const getDocumentEndIndexActionOutputSchema: OutputSchema;
34
+ export declare const getDocumentPlaintextActionOutputSchema: OutputSchema;
35
+ export declare const copyDocumentActionOutputSchema: OutputSchema;
36
+ export declare const searchDocumentsActionOutputSchema: OutputSchema;
37
+ export declare const batchUpdateActionOutputSchema: OutputSchema;
38
+ export declare const createAndPopulateTableActionOutputSchema: OutputSchema;
39
+ export declare const replaceSectionWithMarkdownActionOutputSchema: OutputSchema;
40
+ export declare const replaceBodyWithMarkdownActionOutputSchema: OutputSchema;
41
+ export declare const createDocumentFromMarkdownActionOutputSchema: OutputSchema;
42
+ export declare const exportAsPdfActionOutputSchema: OutputSchema;
43
+ //# sourceMappingURL=output-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-schemas.d.ts","sourceRoot":"","sources":["../../src/lib/output-schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,2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