@superdurable/connector-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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Super Durable
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,20 @@
1
- # Temporary Holding Version
1
+ # Google Docs TypeScript connector
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@superdurable/connector-google-docs` provides operation-specific Dex Steps
4
+ for `getDocumentText`, `createDocument`, `replaceDocumentText`, and `appendText`.
5
+ The manifest supplies generated models, factories, mocks, and refresh wiring
6
+ for Google OAuth and Workspace domain delegation. The provider client bounds
7
+ responses and text, reads only the first tab, and uses revision guards for
8
+ writes. `createDocument` uses a single-dispatch fence and Drive app-property
9
+ lookup to recover an earlier create before every resend; an unknown outcome is
10
+ resent only up to the send cap (`maxSends`, default 3), and `uncertain` is
11
+ selected only at the cap.
12
+
13
+ The runnable [policy documents example](examples/policy-documents/README.md)
14
+ uses the static `policy-docs` connection and exercises every operation through
15
+ a Dex Worker. Its input file contains no credentials.
16
+
17
+ Run `npm ci && npm run check`, then run `npm run test:integration` with a local
18
+ `dexcli dev` and `DEX_FLOW_SERVICE_ADDRESS` set to its gRPC address. The
19
+ conformance test replays Go-recorded provider exchanges. Live Google provider
20
+ authorization and calls have not been verified.
@@ -0,0 +1,327 @@
1
+ {
2
+ "connectorId": "google-docs",
3
+ "releaseTag": "connectors/google/docs/go/v0.24.1",
4
+ "package": {
5
+ "ecosystem": "npm",
6
+ "name": "@superdurable/connector-google-docs",
7
+ "version": "0.1.1"
8
+ },
9
+ "factories": [
10
+ {
11
+ "name": "newGetDocumentTextStep",
12
+ "kind": "query",
13
+ "operationId": "getDocumentText",
14
+ "inputType": "GetDocumentTextInput",
15
+ "description": "Read the first tab of one document, without pending suggestions, as bounded Markdown or plain text with its title and revision ID.",
16
+ "fields": {
17
+ "stepType": "stepType",
18
+ "annotations": "annotations",
19
+ "connectionName": "connectionName",
20
+ "resultAttribute": "resultAttribute"
21
+ },
22
+ "branches": [
23
+ {
24
+ "id": "read",
25
+ "field": "read",
26
+ "optional": false
27
+ },
28
+ {
29
+ "id": "notFound",
30
+ "field": "notFound",
31
+ "optional": true
32
+ },
33
+ {
34
+ "id": "tooLarge",
35
+ "field": "tooLarge",
36
+ "optional": true
37
+ },
38
+ {
39
+ "id": "providerRejected",
40
+ "field": "providerRejected",
41
+ "optional": true
42
+ },
43
+ {
44
+ "id": "invalidResponse",
45
+ "field": "invalidResponse",
46
+ "optional": true
47
+ },
48
+ {
49
+ "id": "defect",
50
+ "field": "defect",
51
+ "optional": true
52
+ }
53
+ ],
54
+ "inputSchema": {
55
+ "additionalProperties": false,
56
+ "description": "GetDocumentTextInput identifies the document whose first tab is read.",
57
+ "properties": {
58
+ "documentId": {
59
+ "description": "DocumentID is the Google Docs document ID, the part of a docs.google.com/document/d/{documentId}/edit link after /d/.",
60
+ "type": "string"
61
+ },
62
+ "format": {
63
+ "description": "Format is markdown or plainText; blank renders Markdown.",
64
+ "enum": [
65
+ "markdown",
66
+ "plainText"
67
+ ],
68
+ "type": "string"
69
+ }
70
+ },
71
+ "required": [
72
+ "documentId"
73
+ ],
74
+ "type": "object"
75
+ }
76
+ },
77
+ {
78
+ "name": "newCreateDocumentStep",
79
+ "kind": "mutation",
80
+ "operationId": "createDocument",
81
+ "inputType": "CreateDocumentInput",
82
+ "description": "Create one Google Doc from a title and optional plain-text or Markdown text in an optional Drive folder. Google offers no idempotency key, so the single-dispatch fence requires sync durability to persist its heartbeat across attempts; a private Drive app property supports read-back before every resend, and an unconfirmed create is resent only up to the send cap.",
83
+ "fields": {
84
+ "stepType": "stepType",
85
+ "annotations": "annotations",
86
+ "connectionName": "connectionName",
87
+ "resultAttribute": "resultAttribute"
88
+ },
89
+ "branches": [
90
+ {
91
+ "id": "created",
92
+ "field": "created",
93
+ "optional": false
94
+ },
95
+ {
96
+ "id": "providerRejected",
97
+ "field": "providerRejected",
98
+ "optional": true
99
+ },
100
+ {
101
+ "id": "invalidResponse",
102
+ "field": "invalidResponse",
103
+ "optional": true
104
+ },
105
+ {
106
+ "id": "uncertain",
107
+ "field": "uncertain",
108
+ "optional": true
109
+ },
110
+ {
111
+ "id": "defect",
112
+ "field": "defect",
113
+ "optional": true
114
+ }
115
+ ],
116
+ "inputSchema": {
117
+ "additionalProperties": false,
118
+ "description": "CreateDocumentInput describes one new Google Doc.",
119
+ "properties": {
120
+ "initialText": {
121
+ "description": "InitialText is the document's first content; blank creates an empty document.",
122
+ "type": "string"
123
+ },
124
+ "initialTextFormat": {
125
+ "description": "InitialTextFormat is plainText or markdown; blank imports plain text. Markdown asks Drive's Markdown import to create headings, lists, and tables.",
126
+ "enum": [
127
+ "markdown",
128
+ "plainText"
129
+ ],
130
+ "type": "string"
131
+ },
132
+ "parentFolderId": {
133
+ "description": "ParentFolderID is the destination Drive folder ID; blank creates the document in the My Drive root of the connection's account.",
134
+ "type": "string"
135
+ },
136
+ "title": {
137
+ "description": "Title is the new document's title; it must not be blank or contain line breaks.",
138
+ "type": "string"
139
+ }
140
+ },
141
+ "required": [
142
+ "title"
143
+ ],
144
+ "type": "object"
145
+ }
146
+ },
147
+ {
148
+ "name": "newReplaceDocumentTextStep",
149
+ "kind": "mutation",
150
+ "operationId": "replaceDocumentText",
151
+ "inputType": "ReplaceDocumentTextInput",
152
+ "description": "Replace the whole body text or named text placeholders in the first tab of one document in one batch that Google applies only at the required revision, so a repeated dispatch cannot apply it twice.",
153
+ "fields": {
154
+ "stepType": "stepType",
155
+ "annotations": "annotations",
156
+ "connectionName": "connectionName",
157
+ "resultAttribute": "resultAttribute"
158
+ },
159
+ "branches": [
160
+ {
161
+ "id": "replaced",
162
+ "field": "replaced",
163
+ "optional": false
164
+ },
165
+ {
166
+ "id": "placeholderNotFound",
167
+ "field": "placeholderNotFound",
168
+ "optional": true
169
+ },
170
+ {
171
+ "id": "revisionChanged",
172
+ "field": "revisionChanged",
173
+ "optional": true
174
+ },
175
+ {
176
+ "id": "notFound",
177
+ "field": "notFound",
178
+ "optional": true
179
+ },
180
+ {
181
+ "id": "providerRejected",
182
+ "field": "providerRejected",
183
+ "optional": true
184
+ },
185
+ {
186
+ "id": "invalidResponse",
187
+ "field": "invalidResponse",
188
+ "optional": true
189
+ },
190
+ {
191
+ "id": "defect",
192
+ "field": "defect",
193
+ "optional": true
194
+ }
195
+ ],
196
+ "inputSchema": {
197
+ "$defs": {
198
+ "PlaceholderReplacement": {
199
+ "additionalProperties": false,
200
+ "description": "PlaceholderReplacement is one named text placeholder and its replacement.",
201
+ "properties": {
202
+ "placeholder": {
203
+ "description": "Placeholder is the exact, case-sensitive text to replace, such as {{effectiveDate}}. It is 1 to 256 bytes on one line.",
204
+ "type": "string"
205
+ },
206
+ "text": {
207
+ "description": "Text replaces every occurrence; blank removes the placeholder. It cannot contain any requested placeholder.",
208
+ "type": "string"
209
+ }
210
+ },
211
+ "required": [
212
+ "placeholder",
213
+ "text"
214
+ ],
215
+ "type": "object"
216
+ }
217
+ },
218
+ "additionalProperties": false,
219
+ "description": "ReplaceDocumentTextInput describes one guarded replacement in a document's first tab.",
220
+ "properties": {
221
+ "documentId": {
222
+ "description": "DocumentID is the Google Docs document ID.",
223
+ "type": "string"
224
+ },
225
+ "placeholders": {
226
+ "description": "Placeholders lists the placeholders to replace for placeholders, such as {{effectiveDate}}; every one must occur in the body at RequiredRevisionID.",
227
+ "items": {
228
+ "$ref": "#/$defs/PlaceholderReplacement"
229
+ },
230
+ "type": "array"
231
+ },
232
+ "requiredRevisionId": {
233
+ "description": "RequiredRevisionID is the revision the replacement applies to, normally the RevisionID of a getDocumentText Step. Google applies the change only while the document is still at this revision.",
234
+ "type": "string"
235
+ },
236
+ "target": {
237
+ "description": "Target is wholeBody or placeholders.",
238
+ "enum": [
239
+ "placeholders",
240
+ "wholeBody"
241
+ ],
242
+ "type": "string"
243
+ },
244
+ "text": {
245
+ "description": "Text is the new body text for wholeBody; blank empties the body. It is inserted literally, so Markdown markup is not interpreted.",
246
+ "type": "string"
247
+ }
248
+ },
249
+ "required": [
250
+ "documentId",
251
+ "requiredRevisionId",
252
+ "target"
253
+ ],
254
+ "type": "object"
255
+ }
256
+ },
257
+ {
258
+ "name": "newAppendTextStep",
259
+ "kind": "mutation",
260
+ "operationId": "appendText",
261
+ "inputType": "AppendTextInput",
262
+ "description": "Append plain-text paragraphs to the end of the first tab's body of one document in one batch that Google applies only at the required revision, so a repeated dispatch cannot append twice.",
263
+ "fields": {
264
+ "stepType": "stepType",
265
+ "annotations": "annotations",
266
+ "connectionName": "connectionName",
267
+ "resultAttribute": "resultAttribute"
268
+ },
269
+ "branches": [
270
+ {
271
+ "id": "appended",
272
+ "field": "appended",
273
+ "optional": false
274
+ },
275
+ {
276
+ "id": "revisionChanged",
277
+ "field": "revisionChanged",
278
+ "optional": true
279
+ },
280
+ {
281
+ "id": "notFound",
282
+ "field": "notFound",
283
+ "optional": true
284
+ },
285
+ {
286
+ "id": "providerRejected",
287
+ "field": "providerRejected",
288
+ "optional": true
289
+ },
290
+ {
291
+ "id": "invalidResponse",
292
+ "field": "invalidResponse",
293
+ "optional": true
294
+ },
295
+ {
296
+ "id": "defect",
297
+ "field": "defect",
298
+ "optional": true
299
+ }
300
+ ],
301
+ "inputSchema": {
302
+ "additionalProperties": false,
303
+ "description": "AppendTextInput describes text appended to the end of a document's first tab.",
304
+ "properties": {
305
+ "documentId": {
306
+ "description": "DocumentID is the Google Docs document ID.",
307
+ "type": "string"
308
+ },
309
+ "requiredRevisionId": {
310
+ "description": "RequiredRevisionID is the revision the text is appended to, normally the RevisionID of a getDocumentText or replaceDocumentText Step. Google appends only while the document is still at this revision.",
311
+ "type": "string"
312
+ },
313
+ "text": {
314
+ "description": "Text is appended as one or more plain normal-style paragraphs, one per line, after the body's last paragraph. It must not be blank.",
315
+ "type": "string"
316
+ }
317
+ },
318
+ "required": [
319
+ "documentId",
320
+ "requiredRevisionId",
321
+ "text"
322
+ ],
323
+ "type": "object"
324
+ }
325
+ }
326
+ ]
327
+ }