@decaf-ts/integrations 0.12.0 → 0.14.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 (144) hide show
  1. package/dist/integrations.cjs +1 -1
  2. package/lib/cjs/calendar/environment.cjs +48 -0
  3. package/lib/cjs/calendar/environment.cjs.map +1 -0
  4. package/lib/cjs/calendar/google-calendar/GoogleCalendarService.cjs +338 -0
  5. package/lib/cjs/calendar/google-calendar/GoogleCalendarService.cjs.map +1 -0
  6. package/lib/cjs/calendar/google-calendar/index.cjs +20 -0
  7. package/lib/cjs/calendar/google-calendar/index.cjs.map +1 -0
  8. package/lib/cjs/comms/discord/DiscordService.cjs +318 -0
  9. package/lib/cjs/comms/discord/DiscordService.cjs.map +1 -0
  10. package/lib/cjs/comms/discord/index.cjs +19 -0
  11. package/lib/cjs/comms/discord/index.cjs.map +1 -0
  12. package/lib/cjs/comms/environment.cjs +16 -0
  13. package/lib/cjs/comms/environment.cjs.map +1 -1
  14. package/lib/cjs/comms/index.cjs +3 -0
  15. package/lib/cjs/comms/index.cjs.map +1 -1
  16. package/lib/cjs/comms/outlook/MicrosoftOutlookService.cjs +325 -0
  17. package/lib/cjs/comms/outlook/MicrosoftOutlookService.cjs.map +1 -0
  18. package/lib/cjs/comms/outlook/index.cjs +19 -0
  19. package/lib/cjs/comms/outlook/index.cjs.map +1 -0
  20. package/lib/cjs/comms/whatsapp/WhatsAppService.cjs +274 -0
  21. package/lib/cjs/comms/whatsapp/WhatsAppService.cjs.map +1 -0
  22. package/lib/cjs/comms/whatsapp/index.cjs +19 -0
  23. package/lib/cjs/comms/whatsapp/index.cjs.map +1 -0
  24. package/lib/cjs/index.cjs +3 -3
  25. package/lib/cjs/io/confluence/ConfluenceService.cjs +317 -0
  26. package/lib/cjs/io/confluence/ConfluenceService.cjs.map +1 -0
  27. package/lib/cjs/io/confluence/index.cjs +19 -0
  28. package/lib/cjs/io/confluence/index.cjs.map +1 -0
  29. package/lib/cjs/io/environment.cjs +28 -0
  30. package/lib/cjs/io/environment.cjs.map +1 -1
  31. package/lib/cjs/io/google-docs/GoogleDocsService.cjs +275 -0
  32. package/lib/cjs/io/google-docs/GoogleDocsService.cjs.map +1 -0
  33. package/lib/cjs/io/google-docs/index.cjs +19 -0
  34. package/lib/cjs/io/google-docs/index.cjs.map +1 -0
  35. package/lib/cjs/io/index.cjs +5 -0
  36. package/lib/cjs/io/index.cjs.map +1 -1
  37. package/lib/cjs/io/jira/JiraService.cjs +354 -0
  38. package/lib/cjs/io/jira/JiraService.cjs.map +1 -0
  39. package/lib/cjs/io/jira/index.cjs +19 -0
  40. package/lib/cjs/io/jira/index.cjs.map +1 -0
  41. package/lib/cjs/io/microsoft-excel/MicrosoftExcelService.cjs +253 -0
  42. package/lib/cjs/io/microsoft-excel/MicrosoftExcelService.cjs.map +1 -0
  43. package/lib/cjs/io/microsoft-excel/index.cjs +19 -0
  44. package/lib/cjs/io/microsoft-excel/index.cjs.map +1 -0
  45. package/lib/cjs/io/microsoft-sharepoint/MicrosoftSharePointService.cjs +261 -0
  46. package/lib/cjs/io/microsoft-sharepoint/MicrosoftSharePointService.cjs.map +1 -0
  47. package/lib/cjs/io/microsoft-sharepoint/index.cjs +19 -0
  48. package/lib/cjs/io/microsoft-sharepoint/index.cjs.map +1 -0
  49. package/lib/esm/calendar/environment.js +44 -0
  50. package/lib/esm/calendar/environment.js.map +1 -0
  51. package/lib/esm/calendar/google-calendar/GoogleCalendarService.js +333 -0
  52. package/lib/esm/calendar/google-calendar/GoogleCalendarService.js.map +1 -0
  53. package/lib/esm/calendar/google-calendar/index.js +3 -0
  54. package/lib/esm/calendar/google-calendar/index.js.map +1 -0
  55. package/lib/esm/comms/discord/DiscordService.js +313 -0
  56. package/lib/esm/comms/discord/DiscordService.js.map +1 -0
  57. package/lib/esm/comms/discord/index.js +2 -0
  58. package/lib/esm/comms/discord/index.js.map +1 -0
  59. package/lib/esm/comms/environment.js +16 -0
  60. package/lib/esm/comms/environment.js.map +1 -1
  61. package/lib/esm/comms/index.js +3 -0
  62. package/lib/esm/comms/index.js.map +1 -1
  63. package/lib/esm/comms/outlook/MicrosoftOutlookService.js +320 -0
  64. package/lib/esm/comms/outlook/MicrosoftOutlookService.js.map +1 -0
  65. package/lib/esm/comms/outlook/index.js +2 -0
  66. package/lib/esm/comms/outlook/index.js.map +1 -0
  67. package/lib/esm/comms/whatsapp/WhatsAppService.js +269 -0
  68. package/lib/esm/comms/whatsapp/WhatsAppService.js.map +1 -0
  69. package/lib/esm/comms/whatsapp/index.js +2 -0
  70. package/lib/esm/comms/whatsapp/index.js.map +1 -0
  71. package/lib/esm/index.js +3 -3
  72. package/lib/esm/io/confluence/ConfluenceService.js +312 -0
  73. package/lib/esm/io/confluence/ConfluenceService.js.map +1 -0
  74. package/lib/esm/io/confluence/index.js +2 -0
  75. package/lib/esm/io/confluence/index.js.map +1 -0
  76. package/lib/esm/io/environment.js +28 -0
  77. package/lib/esm/io/environment.js.map +1 -1
  78. package/lib/esm/io/google-docs/GoogleDocsService.js +270 -0
  79. package/lib/esm/io/google-docs/GoogleDocsService.js.map +1 -0
  80. package/lib/esm/io/google-docs/index.js +2 -0
  81. package/lib/esm/io/google-docs/index.js.map +1 -0
  82. package/lib/esm/io/index.js +5 -0
  83. package/lib/esm/io/index.js.map +1 -1
  84. package/lib/esm/io/jira/JiraService.js +349 -0
  85. package/lib/esm/io/jira/JiraService.js.map +1 -0
  86. package/lib/esm/io/jira/index.js +2 -0
  87. package/lib/esm/io/jira/index.js.map +1 -0
  88. package/lib/esm/io/microsoft-excel/MicrosoftExcelService.js +248 -0
  89. package/lib/esm/io/microsoft-excel/MicrosoftExcelService.js.map +1 -0
  90. package/lib/esm/io/microsoft-excel/index.js +2 -0
  91. package/lib/esm/io/microsoft-excel/index.js.map +1 -0
  92. package/lib/esm/io/microsoft-sharepoint/MicrosoftSharePointService.js +256 -0
  93. package/lib/esm/io/microsoft-sharepoint/MicrosoftSharePointService.js.map +1 -0
  94. package/lib/esm/io/microsoft-sharepoint/index.js +2 -0
  95. package/lib/esm/io/microsoft-sharepoint/index.js.map +1 -0
  96. package/lib/types/calendar/environment.d.cts +48 -0
  97. package/lib/types/calendar/environment.d.mts +48 -0
  98. package/lib/types/calendar/google-calendar/GoogleCalendarService.d.cts +316 -0
  99. package/lib/types/calendar/google-calendar/GoogleCalendarService.d.mts +316 -0
  100. package/lib/types/calendar/google-calendar/index.d.cts +2 -0
  101. package/lib/types/calendar/google-calendar/index.d.mts +2 -0
  102. package/lib/types/comms/discord/DiscordService.d.cts +285 -0
  103. package/lib/types/comms/discord/DiscordService.d.mts +285 -0
  104. package/lib/types/comms/discord/index.d.cts +1 -0
  105. package/lib/types/comms/discord/index.d.mts +1 -0
  106. package/lib/types/comms/environment.d.cts +34 -8
  107. package/lib/types/comms/environment.d.mts +34 -8
  108. package/lib/types/comms/index.d.cts +3 -0
  109. package/lib/types/comms/index.d.mts +3 -0
  110. package/lib/types/comms/outlook/MicrosoftOutlookService.d.cts +282 -0
  111. package/lib/types/comms/outlook/MicrosoftOutlookService.d.mts +282 -0
  112. package/lib/types/comms/outlook/index.d.cts +1 -0
  113. package/lib/types/comms/outlook/index.d.mts +1 -0
  114. package/lib/types/comms/whatsapp/WhatsAppService.d.cts +258 -0
  115. package/lib/types/comms/whatsapp/WhatsAppService.d.mts +258 -0
  116. package/lib/types/comms/whatsapp/index.d.cts +1 -0
  117. package/lib/types/comms/whatsapp/index.d.mts +1 -0
  118. package/lib/types/index.d.cts +2 -2
  119. package/lib/types/index.d.mts +2 -2
  120. package/lib/types/io/confluence/ConfluenceService.d.cts +250 -0
  121. package/lib/types/io/confluence/ConfluenceService.d.mts +250 -0
  122. package/lib/types/io/confluence/index.d.cts +1 -0
  123. package/lib/types/io/confluence/index.d.mts +1 -0
  124. package/lib/types/io/environment.d.cts +52 -12
  125. package/lib/types/io/environment.d.mts +52 -12
  126. package/lib/types/io/google-docs/GoogleDocsService.d.cts +188 -0
  127. package/lib/types/io/google-docs/GoogleDocsService.d.mts +188 -0
  128. package/lib/types/io/google-docs/index.d.cts +1 -0
  129. package/lib/types/io/google-docs/index.d.mts +1 -0
  130. package/lib/types/io/index.d.cts +5 -0
  131. package/lib/types/io/index.d.mts +5 -0
  132. package/lib/types/io/jira/JiraService.d.cts +300 -0
  133. package/lib/types/io/jira/JiraService.d.mts +300 -0
  134. package/lib/types/io/jira/index.d.cts +1 -0
  135. package/lib/types/io/jira/index.d.mts +1 -0
  136. package/lib/types/io/microsoft-excel/MicrosoftExcelService.d.cts +230 -0
  137. package/lib/types/io/microsoft-excel/MicrosoftExcelService.d.mts +230 -0
  138. package/lib/types/io/microsoft-excel/index.d.cts +1 -0
  139. package/lib/types/io/microsoft-excel/index.d.mts +1 -0
  140. package/lib/types/io/microsoft-sharepoint/MicrosoftSharePointService.d.cts +226 -0
  141. package/lib/types/io/microsoft-sharepoint/MicrosoftSharePointService.d.mts +226 -0
  142. package/lib/types/io/microsoft-sharepoint/index.d.cts +1 -0
  143. package/lib/types/io/microsoft-sharepoint/index.d.mts +1 -0
  144. package/package.json +101 -5
@@ -0,0 +1,188 @@
1
+ import { HttpApiService, type HttpApiServiceConfig } from "../../shared/http/index.d.cts";
2
+ /**
3
+ * @description Configuration for the Google Docs service
4
+ * @summary Extends {@link HttpApiServiceConfig} with an optional OAuth
5
+ * `token` (preferred) and an optional `apiKey`. When omitted, the
6
+ * `io.googleDocs` environment slice supplies the same values (plus optional
7
+ * `baseUrl`/`timeout`). At least one credential is required; the token wins
8
+ * when both are set.
9
+ * @category IO
10
+ * @memberOf module:integrations/io/google-docs/service
11
+ */
12
+ export interface GoogleDocsServiceConfig extends HttpApiServiceConfig {
13
+ /**
14
+ * @description Google OAuth access token
15
+ * @summary Sent as `Authorization: Bearer <token>` when present.
16
+ */
17
+ token?: string;
18
+ /**
19
+ * @description Google API key
20
+ * @summary Sent as `X-Goog-Api-Key` only when no OAuth token is configured.
21
+ */
22
+ apiKey?: string;
23
+ }
24
+ /**
25
+ * @description Input for replacing all matching text in a document
26
+ * @summary Carries the `documentId`, the `find` text, its `replace`ment, and
27
+ * whether matching is case-sensitive.
28
+ * @category IO
29
+ * @memberOf module:integrations/io/google-docs/service
30
+ */
31
+ export interface GoogleDocsReplaceInput {
32
+ /**
33
+ * @description Document ID to update
34
+ */
35
+ documentId: string;
36
+ /**
37
+ * @description Text to search for
38
+ */
39
+ find: string;
40
+ /**
41
+ * @description Replacement text (defaults to the empty string)
42
+ */
43
+ replace: string;
44
+ /**
45
+ * @description Whether matching is case-sensitive (default `false`)
46
+ */
47
+ matchCase?: boolean;
48
+ }
49
+ /**
50
+ * @description Google Docs API integration service
51
+ * @summary An undecorated HTTP service for reading and creating documents,
52
+ * running raw batch updates, appending text, and replacing all matching text.
53
+ * Every operation needs either an OAuth token or an API key; missing
54
+ * credentials or identifiers raise `InternalError`, and transport failures are
55
+ * mapped to decaf errors via {@link httpError}.
56
+ * @class GoogleDocsService
57
+ * @extends HttpApiService
58
+ * @category IO
59
+ * @example
60
+ * ```ts
61
+ * import { GoogleDocsService } from "@decaf-ts/integrations/io/google-docs";
62
+ *
63
+ * const docs = new GoogleDocsService();
64
+ * await docs.initialize({
65
+ * token: process.env.GRAPH_CREDENTIAL_GOOGLE_DOCS_TOKEN,
66
+ * });
67
+ * await docs.appendText(process.env.GOOGLE_DOC_ID ?? "", "New paragraph");
68
+ * ```
69
+ * @mermaid
70
+ * sequenceDiagram
71
+ * autonumber
72
+ * participant Caller
73
+ * participant Service as GoogleDocsService
74
+ * participant API as Google Docs API
75
+ * Caller->>Service: appendText(documentId, text)
76
+ * activate Service
77
+ * Service->>Service: requireAuth()
78
+ * Service->>API: GET /documents/{id}
79
+ * activate API
80
+ * API-->>Service: body content endIndex
81
+ * deactivate API
82
+ * Service->>API: POST /documents/{id}:batchUpdate
83
+ * activate API
84
+ * API-->>Service: batch update result
85
+ * deactivate API
86
+ * Service-->>Caller: batch update result
87
+ * deactivate Service
88
+ * @memberOf module:integrations/io/google-docs/service
89
+ */
90
+ export declare class GoogleDocsService extends HttpApiService<GoogleDocsServiceConfig> {
91
+ /**
92
+ * @description The provider name used in error messages
93
+ */
94
+ protected readonly serviceName = "Google Docs";
95
+ /**
96
+ * @description The Google Docs API base URL
97
+ * @summary Used when the resolved config carries no `baseUrl`.
98
+ * @returns {string} `"https://docs.googleapis.com/v1"`.
99
+ */
100
+ protected defaultBaseUrl(): string;
101
+ /**
102
+ * @description Builds the Google Docs authentication headers
103
+ * @summary Prefers `Authorization: Bearer <token>`, falls back to
104
+ * `X-Goog-Api-Key: <apiKey>`, and returns no headers when neither is set.
105
+ * @param {GoogleDocsServiceConfig} config - The resolved service configuration.
106
+ * @returns {Record<string, string>} The authentication headers.
107
+ */
108
+ protected authHeaders(config: GoogleDocsServiceConfig): Record<string, string>;
109
+ /**
110
+ * @description Reads the Google Docs credentials and defaults from the environment
111
+ * @summary Reads the `io.googleDocs` slice and returns a partial config when
112
+ * a token or API key is configured, `undefined` otherwise. Values pass
113
+ * through `envString`/`envNumber` to reject unset-leaf proxies.
114
+ * @returns {Partial<GoogleDocsServiceConfig> | undefined} A partial config, or `undefined` when no credential is configured.
115
+ */
116
+ protected configFromEnvironment(): Partial<GoogleDocsServiceConfig> | undefined;
117
+ /**
118
+ * @description Asserts that an OAuth token or API key is configured
119
+ * @summary Called by every operation before it touches the network.
120
+ * @returns {void}
121
+ * @throws {InternalError} When neither a token nor an API key is configured.
122
+ */
123
+ protected requireAuth(): void;
124
+ /**
125
+ * @description Fetches a Google Docs document
126
+ * @summary `GET`s `/documents/<id>` and returns the full document payload.
127
+ * @param {string} documentId - The document ID.
128
+ * @returns {Promise<unknown>} The document payload.
129
+ * @throws {InternalError} When no credential is configured or the document ID is empty.
130
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
131
+ * @throws {BadRequestError} When Google rejects the request.
132
+ */
133
+ getDocument(documentId: string): Promise<unknown>;
134
+ /**
135
+ * @description Creates a Google Docs document
136
+ * @summary `POST`s a new document with the given title and returns its
137
+ * payload (including `documentId`).
138
+ * @param {string} title - The new document title.
139
+ * @returns {Promise<unknown>} The created document payload.
140
+ * @throws {InternalError} When no credential is configured or the title is empty.
141
+ * @throws {BadRequestError} When Google rejects the request.
142
+ */
143
+ createDocument(title: string): Promise<unknown>;
144
+ /**
145
+ * @description Applies a raw Google Docs batch update
146
+ * @summary `POST`s the `requests` array to `/documents/<id>:batchUpdate`
147
+ * unchanged, allowing any Docs API request type.
148
+ * @param {string} documentId - The document ID.
149
+ * @param {unknown[]} requests - The Docs API request objects.
150
+ * @returns {Promise<unknown>} The batch update response payload.
151
+ * @throws {InternalError} When no credential is configured, or the document ID or requests are missing.
152
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
153
+ * @throws {BadRequestError} When Google rejects a request.
154
+ */
155
+ batchUpdate(documentId: string, requests: unknown[]): Promise<unknown>;
156
+ /**
157
+ * @description Appends text to the end of a Google Docs document
158
+ * @summary Reads the document to find the final `endIndex`, then inserts the
159
+ * text just before it through a `batchUpdate`.
160
+ * @param {string} documentId - The document ID.
161
+ * @param {string} text - The text to append.
162
+ * @returns {Promise<unknown>} The batch update response payload.
163
+ * @throws {InternalError} When no credential is configured, or the document ID or text is empty.
164
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
165
+ * @throws {BadRequestError} When Google rejects the update.
166
+ */
167
+ appendText(documentId: string, text: string): Promise<unknown>;
168
+ /**
169
+ * @description Replaces all matching text in a Google Docs document
170
+ * @summary Sends a `replaceAllText` request honoring the `matchCase` option
171
+ * and returns the batch update response payload.
172
+ * @param {GoogleDocsReplaceInput} input - The document, find/replace text, and case option.
173
+ * @returns {Promise<unknown>} The batch update response payload.
174
+ * @throws {InternalError} When no credential is configured, or the document ID or find text is empty.
175
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
176
+ * @throws {BadRequestError} When Google rejects the update.
177
+ * @example
178
+ * ```ts
179
+ * await docs.replaceAllText({
180
+ * documentId: "abc123",
181
+ * find: "TODO",
182
+ * replace: "DONE",
183
+ * matchCase: true,
184
+ * });
185
+ * ```
186
+ */
187
+ replaceAllText(input: GoogleDocsReplaceInput): Promise<unknown>;
188
+ }
@@ -0,0 +1,188 @@
1
+ import { HttpApiService, type HttpApiServiceConfig } from "../../shared/http/index.d.mts";
2
+ /**
3
+ * @description Configuration for the Google Docs service
4
+ * @summary Extends {@link HttpApiServiceConfig} with an optional OAuth
5
+ * `token` (preferred) and an optional `apiKey`. When omitted, the
6
+ * `io.googleDocs` environment slice supplies the same values (plus optional
7
+ * `baseUrl`/`timeout`). At least one credential is required; the token wins
8
+ * when both are set.
9
+ * @category IO
10
+ * @memberOf module:integrations/io/google-docs/service
11
+ */
12
+ export interface GoogleDocsServiceConfig extends HttpApiServiceConfig {
13
+ /**
14
+ * @description Google OAuth access token
15
+ * @summary Sent as `Authorization: Bearer <token>` when present.
16
+ */
17
+ token?: string;
18
+ /**
19
+ * @description Google API key
20
+ * @summary Sent as `X-Goog-Api-Key` only when no OAuth token is configured.
21
+ */
22
+ apiKey?: string;
23
+ }
24
+ /**
25
+ * @description Input for replacing all matching text in a document
26
+ * @summary Carries the `documentId`, the `find` text, its `replace`ment, and
27
+ * whether matching is case-sensitive.
28
+ * @category IO
29
+ * @memberOf module:integrations/io/google-docs/service
30
+ */
31
+ export interface GoogleDocsReplaceInput {
32
+ /**
33
+ * @description Document ID to update
34
+ */
35
+ documentId: string;
36
+ /**
37
+ * @description Text to search for
38
+ */
39
+ find: string;
40
+ /**
41
+ * @description Replacement text (defaults to the empty string)
42
+ */
43
+ replace: string;
44
+ /**
45
+ * @description Whether matching is case-sensitive (default `false`)
46
+ */
47
+ matchCase?: boolean;
48
+ }
49
+ /**
50
+ * @description Google Docs API integration service
51
+ * @summary An undecorated HTTP service for reading and creating documents,
52
+ * running raw batch updates, appending text, and replacing all matching text.
53
+ * Every operation needs either an OAuth token or an API key; missing
54
+ * credentials or identifiers raise `InternalError`, and transport failures are
55
+ * mapped to decaf errors via {@link httpError}.
56
+ * @class GoogleDocsService
57
+ * @extends HttpApiService
58
+ * @category IO
59
+ * @example
60
+ * ```ts
61
+ * import { GoogleDocsService } from "@decaf-ts/integrations/io/google-docs";
62
+ *
63
+ * const docs = new GoogleDocsService();
64
+ * await docs.initialize({
65
+ * token: process.env.GRAPH_CREDENTIAL_GOOGLE_DOCS_TOKEN,
66
+ * });
67
+ * await docs.appendText(process.env.GOOGLE_DOC_ID ?? "", "New paragraph");
68
+ * ```
69
+ * @mermaid
70
+ * sequenceDiagram
71
+ * autonumber
72
+ * participant Caller
73
+ * participant Service as GoogleDocsService
74
+ * participant API as Google Docs API
75
+ * Caller->>Service: appendText(documentId, text)
76
+ * activate Service
77
+ * Service->>Service: requireAuth()
78
+ * Service->>API: GET /documents/{id}
79
+ * activate API
80
+ * API-->>Service: body content endIndex
81
+ * deactivate API
82
+ * Service->>API: POST /documents/{id}:batchUpdate
83
+ * activate API
84
+ * API-->>Service: batch update result
85
+ * deactivate API
86
+ * Service-->>Caller: batch update result
87
+ * deactivate Service
88
+ * @memberOf module:integrations/io/google-docs/service
89
+ */
90
+ export declare class GoogleDocsService extends HttpApiService<GoogleDocsServiceConfig> {
91
+ /**
92
+ * @description The provider name used in error messages
93
+ */
94
+ protected readonly serviceName = "Google Docs";
95
+ /**
96
+ * @description The Google Docs API base URL
97
+ * @summary Used when the resolved config carries no `baseUrl`.
98
+ * @returns {string} `"https://docs.googleapis.com/v1"`.
99
+ */
100
+ protected defaultBaseUrl(): string;
101
+ /**
102
+ * @description Builds the Google Docs authentication headers
103
+ * @summary Prefers `Authorization: Bearer <token>`, falls back to
104
+ * `X-Goog-Api-Key: <apiKey>`, and returns no headers when neither is set.
105
+ * @param {GoogleDocsServiceConfig} config - The resolved service configuration.
106
+ * @returns {Record<string, string>} The authentication headers.
107
+ */
108
+ protected authHeaders(config: GoogleDocsServiceConfig): Record<string, string>;
109
+ /**
110
+ * @description Reads the Google Docs credentials and defaults from the environment
111
+ * @summary Reads the `io.googleDocs` slice and returns a partial config when
112
+ * a token or API key is configured, `undefined` otherwise. Values pass
113
+ * through `envString`/`envNumber` to reject unset-leaf proxies.
114
+ * @returns {Partial<GoogleDocsServiceConfig> | undefined} A partial config, or `undefined` when no credential is configured.
115
+ */
116
+ protected configFromEnvironment(): Partial<GoogleDocsServiceConfig> | undefined;
117
+ /**
118
+ * @description Asserts that an OAuth token or API key is configured
119
+ * @summary Called by every operation before it touches the network.
120
+ * @returns {void}
121
+ * @throws {InternalError} When neither a token nor an API key is configured.
122
+ */
123
+ protected requireAuth(): void;
124
+ /**
125
+ * @description Fetches a Google Docs document
126
+ * @summary `GET`s `/documents/<id>` and returns the full document payload.
127
+ * @param {string} documentId - The document ID.
128
+ * @returns {Promise<unknown>} The document payload.
129
+ * @throws {InternalError} When no credential is configured or the document ID is empty.
130
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
131
+ * @throws {BadRequestError} When Google rejects the request.
132
+ */
133
+ getDocument(documentId: string): Promise<unknown>;
134
+ /**
135
+ * @description Creates a Google Docs document
136
+ * @summary `POST`s a new document with the given title and returns its
137
+ * payload (including `documentId`).
138
+ * @param {string} title - The new document title.
139
+ * @returns {Promise<unknown>} The created document payload.
140
+ * @throws {InternalError} When no credential is configured or the title is empty.
141
+ * @throws {BadRequestError} When Google rejects the request.
142
+ */
143
+ createDocument(title: string): Promise<unknown>;
144
+ /**
145
+ * @description Applies a raw Google Docs batch update
146
+ * @summary `POST`s the `requests` array to `/documents/<id>:batchUpdate`
147
+ * unchanged, allowing any Docs API request type.
148
+ * @param {string} documentId - The document ID.
149
+ * @param {unknown[]} requests - The Docs API request objects.
150
+ * @returns {Promise<unknown>} The batch update response payload.
151
+ * @throws {InternalError} When no credential is configured, or the document ID or requests are missing.
152
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
153
+ * @throws {BadRequestError} When Google rejects a request.
154
+ */
155
+ batchUpdate(documentId: string, requests: unknown[]): Promise<unknown>;
156
+ /**
157
+ * @description Appends text to the end of a Google Docs document
158
+ * @summary Reads the document to find the final `endIndex`, then inserts the
159
+ * text just before it through a `batchUpdate`.
160
+ * @param {string} documentId - The document ID.
161
+ * @param {string} text - The text to append.
162
+ * @returns {Promise<unknown>} The batch update response payload.
163
+ * @throws {InternalError} When no credential is configured, or the document ID or text is empty.
164
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
165
+ * @throws {BadRequestError} When Google rejects the update.
166
+ */
167
+ appendText(documentId: string, text: string): Promise<unknown>;
168
+ /**
169
+ * @description Replaces all matching text in a Google Docs document
170
+ * @summary Sends a `replaceAllText` request honoring the `matchCase` option
171
+ * and returns the batch update response payload.
172
+ * @param {GoogleDocsReplaceInput} input - The document, find/replace text, and case option.
173
+ * @returns {Promise<unknown>} The batch update response payload.
174
+ * @throws {InternalError} When no credential is configured, or the document ID or find text is empty.
175
+ * @throws {NotFoundError} When the document does not exist (HTTP 404).
176
+ * @throws {BadRequestError} When Google rejects the update.
177
+ * @example
178
+ * ```ts
179
+ * await docs.replaceAllText({
180
+ * documentId: "abc123",
181
+ * find: "TODO",
182
+ * replace: "DONE",
183
+ * matchCase: true,
184
+ * });
185
+ * ```
186
+ */
187
+ replaceAllText(input: GoogleDocsReplaceInput): Promise<unknown>;
188
+ }
@@ -0,0 +1 @@
1
+ export * from "./GoogleDocsService.d.cts";
@@ -0,0 +1 @@
1
+ export * from "./GoogleDocsService.d.mts";
@@ -9,4 +9,9 @@ export * from "./airtable/index.d.cts";
9
9
  export * from "./google-sheets/index.d.cts";
10
10
  export * from "./graphql/index.d.cts";
11
11
  export * from "./spreadsheet/index.d.cts";
12
+ export * from "./microsoft-excel/index.d.cts";
13
+ export * from "./confluence/index.d.cts";
14
+ export * from "./jira/index.d.cts";
15
+ export * from "./google-docs/index.d.cts";
16
+ export * from "./microsoft-sharepoint/index.d.cts";
12
17
  export * from "./environment.d.cts";
@@ -9,4 +9,9 @@ export * from "./airtable/index.d.mts";
9
9
  export * from "./google-sheets/index.d.mts";
10
10
  export * from "./graphql/index.d.mts";
11
11
  export * from "./spreadsheet/index.d.mts";
12
+ export * from "./microsoft-excel/index.d.mts";
13
+ export * from "./confluence/index.d.mts";
14
+ export * from "./jira/index.d.mts";
15
+ export * from "./google-docs/index.d.mts";
16
+ export * from "./microsoft-sharepoint/index.d.mts";
12
17
  export * from "./environment.d.mts";