@superdurable/connector-coda 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # Coda TypeScript connector
2
2
 
3
- `@superdurable/connector-coda` provides the read-only `listRows` and
4
- `getRow` operations for Dex TypeScript Flows. The generated operation
3
+ `@superdurable/connector-coda` provides read-only document, table, column, and row queries for Dex TypeScript Flows. The generated operation
5
4
  factories and models come from [the connector manifest](../connector.yaml);
6
5
  `CodaClient` resolves the private API token for each call.
7
- The encoded Step output preserves provider JSON number text, including integers
6
+ The encoded row output preserves provider JSON number text, including integers
8
7
  above JavaScript's safe integer range. Consumers that parse those values as
9
8
  JavaScript numbers must use a lossless JSON parser to retain their precision.
10
9
 
@@ -28,3 +27,23 @@ verify request paths, headers, query parameters, outputs, branches, and retry
28
27
  classification in TypeScript. The real Dex integration test uses a local Coda
29
28
  HTTP fixture. Live Coda authorization, document permissions, and response
30
29
  variants have not been verified.
30
+
31
+
32
+ ## Table schema discovery
33
+
34
+ The [schema discovery Flow](examples/schema-discovery/flow.ts) uses `listDocs`, `getDoc`, `listTables`, `getTable`, and `listColumns`. Metadata list results contain `items` and `nextPageToken`. Each item exposes its provider `id` and `name`. Pass the opaque token back as `pageToken` on a subsequent page. The limit ranges from zero (provider default) to 500 and the token may contain up to 2048 UTF-8 bytes. A response that echoes the connection token selects `defect`.
35
+
36
+ With the private `coda` connection configured, run the [Worker](examples/schema-discovery/main.ts) from this directory.
37
+
38
+ ```sh
39
+ npm run build
40
+ npx tsx examples/schema-discovery/main.ts
41
+ ```
42
+
43
+ Start `TypeScriptCodaTableSchema` with a `ListDocsInput`. The Flow returns a `ColumnsPage`, including an empty page when the selected document page or table list is empty. To test the example, start `dexcli dev -open=false`, set `DEX_FLOW_SERVICE_ADDRESS`, and run `npm run test:integration`.
44
+
45
+ In a consuming project with the connector installed, copy the example and generate its graph.
46
+
47
+ ```sh
48
+ dexcli visualize examples/schema-discovery/flow.ts --language typescript --schema-version 2.0 --lint app --open=false --json --out /tmp/coda-typescript-schema
49
+ ```
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "connectorId": "coda",
3
- "releaseTag": "connectors/coda/go/v0.2.0",
3
+ "releaseTag": "connectors/coda/go/v0.3.1",
4
4
  "package": {
5
5
  "ecosystem": "npm",
6
6
  "name": "@superdurable/connector-coda",
7
- "version": "0.1.0"
7
+ "version": "0.2.0"
8
8
  },
9
9
  "factories": [
10
10
  {
11
11
  "name": "newListRowsStep",
12
12
  "kind": "query",
13
13
  "operationId": "listRows",
14
+ "inputType": "ListRowsInput",
15
+ "description": "List one page of rows in a Coda table.",
14
16
  "fields": {
15
17
  "stepType": "stepType",
16
18
  "annotations": "annotations",
@@ -38,12 +40,41 @@
38
40
  "field": "defect",
39
41
  "optional": true
40
42
  }
41
- ]
43
+ ],
44
+ "inputSchema": {
45
+ "additionalProperties": false,
46
+ "description": "ListRowsInput selects a Coda table page.",
47
+ "properties": {
48
+ "docId": {
49
+ "description": "DocID is the ID from the document URL.",
50
+ "type": "string"
51
+ },
52
+ "limit": {
53
+ "description": "Limit caps rows at 500; zero uses Coda's default.",
54
+ "type": "integer"
55
+ },
56
+ "pageToken": {
57
+ "description": "PageToken is the opaque nextPageToken from a prior page.",
58
+ "type": "string"
59
+ },
60
+ "tableId": {
61
+ "description": "TableID is the stable table ID, such as grid-abc.",
62
+ "type": "string"
63
+ }
64
+ },
65
+ "required": [
66
+ "docId",
67
+ "tableId"
68
+ ],
69
+ "type": "object"
70
+ }
42
71
  },
43
72
  {
44
73
  "name": "newGetRowStep",
45
74
  "kind": "query",
46
75
  "operationId": "getRow",
76
+ "inputType": "GetRowInput",
77
+ "description": "Get one row in a Coda table.",
47
78
  "fields": {
48
79
  "stepType": "stepType",
49
80
  "annotations": "annotations",
@@ -76,7 +107,323 @@
76
107
  "field": "defect",
77
108
  "optional": true
78
109
  }
79
- ]
110
+ ],
111
+ "inputSchema": {
112
+ "additionalProperties": false,
113
+ "description": "GetRowInput selects one Coda row.",
114
+ "properties": {
115
+ "docId": {
116
+ "description": "DocID is the document ID.",
117
+ "type": "string"
118
+ },
119
+ "rowId": {
120
+ "description": "RowID is the stable row ID, such as i-abc.",
121
+ "type": "string"
122
+ },
123
+ "tableId": {
124
+ "description": "TableID is the stable table ID.",
125
+ "type": "string"
126
+ }
127
+ },
128
+ "required": [
129
+ "docId",
130
+ "rowId",
131
+ "tableId"
132
+ ],
133
+ "type": "object"
134
+ }
135
+ },
136
+ {
137
+ "name": "newListDocsStep",
138
+ "kind": "query",
139
+ "operationId": "listDocs",
140
+ "inputType": "ListDocsInput",
141
+ "description": "List a bounded page of accessible docs.",
142
+ "fields": {
143
+ "stepType": "stepType",
144
+ "annotations": "annotations",
145
+ "connectionName": "connectionName",
146
+ "resultAttribute": "resultAttribute"
147
+ },
148
+ "branches": [
149
+ {
150
+ "id": "listed",
151
+ "field": "listed",
152
+ "optional": false
153
+ },
154
+ {
155
+ "id": "providerRejected",
156
+ "field": "providerRejected",
157
+ "optional": true
158
+ },
159
+ {
160
+ "id": "invalidResponse",
161
+ "field": "invalidResponse",
162
+ "optional": true
163
+ },
164
+ {
165
+ "id": "defect",
166
+ "field": "defect",
167
+ "optional": true
168
+ }
169
+ ],
170
+ "inputSchema": {
171
+ "additionalProperties": false,
172
+ "description": "ListDocsInput selects one page of accessible documents.",
173
+ "properties": {
174
+ "limit": {
175
+ "description": "Limit caps returned docs at 500; zero uses the provider default.",
176
+ "type": "integer"
177
+ },
178
+ "pageToken": {
179
+ "description": "PageToken is the opaque token from a prior page.",
180
+ "type": "string"
181
+ }
182
+ },
183
+ "type": "object"
184
+ }
185
+ },
186
+ {
187
+ "name": "newGetDocStep",
188
+ "kind": "query",
189
+ "operationId": "getDoc",
190
+ "inputType": "GetDocInput",
191
+ "description": "Fetch one accessible doc.",
192
+ "fields": {
193
+ "stepType": "stepType",
194
+ "annotations": "annotations",
195
+ "connectionName": "connectionName",
196
+ "resultAttribute": "resultAttribute"
197
+ },
198
+ "branches": [
199
+ {
200
+ "id": "found",
201
+ "field": "found",
202
+ "optional": false
203
+ },
204
+ {
205
+ "id": "notFound",
206
+ "field": "notFound",
207
+ "optional": true
208
+ },
209
+ {
210
+ "id": "providerRejected",
211
+ "field": "providerRejected",
212
+ "optional": true
213
+ },
214
+ {
215
+ "id": "invalidResponse",
216
+ "field": "invalidResponse",
217
+ "optional": true
218
+ },
219
+ {
220
+ "id": "defect",
221
+ "field": "defect",
222
+ "optional": true
223
+ }
224
+ ],
225
+ "inputSchema": {
226
+ "additionalProperties": false,
227
+ "description": "GetDocInput identifies one accessible document.",
228
+ "properties": {
229
+ "docId": {
230
+ "description": "DocID is the document identifier from its URL.",
231
+ "type": "string"
232
+ }
233
+ },
234
+ "required": [
235
+ "docId"
236
+ ],
237
+ "type": "object"
238
+ }
239
+ },
240
+ {
241
+ "name": "newListTablesStep",
242
+ "kind": "query",
243
+ "operationId": "listTables",
244
+ "inputType": "ListTablesInput",
245
+ "description": "List a bounded page of tables and views in one doc.",
246
+ "fields": {
247
+ "stepType": "stepType",
248
+ "annotations": "annotations",
249
+ "connectionName": "connectionName",
250
+ "resultAttribute": "resultAttribute"
251
+ },
252
+ "branches": [
253
+ {
254
+ "id": "listed",
255
+ "field": "listed",
256
+ "optional": false
257
+ },
258
+ {
259
+ "id": "notFound",
260
+ "field": "notFound",
261
+ "optional": true
262
+ },
263
+ {
264
+ "id": "providerRejected",
265
+ "field": "providerRejected",
266
+ "optional": true
267
+ },
268
+ {
269
+ "id": "invalidResponse",
270
+ "field": "invalidResponse",
271
+ "optional": true
272
+ },
273
+ {
274
+ "id": "defect",
275
+ "field": "defect",
276
+ "optional": true
277
+ }
278
+ ],
279
+ "inputSchema": {
280
+ "additionalProperties": false,
281
+ "description": "ListTablesInput selects one table page within a doc.",
282
+ "properties": {
283
+ "docId": {
284
+ "description": "DocID identifies the parent doc.",
285
+ "type": "string"
286
+ },
287
+ "limit": {
288
+ "description": "Limit caps returned tables at 500; zero uses the provider default.",
289
+ "type": "integer"
290
+ },
291
+ "pageToken": {
292
+ "description": "PageToken is the opaque token from a prior page.",
293
+ "type": "string"
294
+ }
295
+ },
296
+ "required": [
297
+ "docId"
298
+ ],
299
+ "type": "object"
300
+ }
301
+ },
302
+ {
303
+ "name": "newGetTableStep",
304
+ "kind": "query",
305
+ "operationId": "getTable",
306
+ "inputType": "GetTableInput",
307
+ "description": "Fetch one table or view in a doc.",
308
+ "fields": {
309
+ "stepType": "stepType",
310
+ "annotations": "annotations",
311
+ "connectionName": "connectionName",
312
+ "resultAttribute": "resultAttribute"
313
+ },
314
+ "branches": [
315
+ {
316
+ "id": "found",
317
+ "field": "found",
318
+ "optional": false
319
+ },
320
+ {
321
+ "id": "notFound",
322
+ "field": "notFound",
323
+ "optional": true
324
+ },
325
+ {
326
+ "id": "providerRejected",
327
+ "field": "providerRejected",
328
+ "optional": true
329
+ },
330
+ {
331
+ "id": "invalidResponse",
332
+ "field": "invalidResponse",
333
+ "optional": true
334
+ },
335
+ {
336
+ "id": "defect",
337
+ "field": "defect",
338
+ "optional": true
339
+ }
340
+ ],
341
+ "inputSchema": {
342
+ "additionalProperties": false,
343
+ "description": "GetTableInput identifies one table or view.",
344
+ "properties": {
345
+ "docId": {
346
+ "description": "DocID identifies the parent doc.",
347
+ "type": "string"
348
+ },
349
+ "tableId": {
350
+ "description": "TableID identifies the table or view.",
351
+ "type": "string"
352
+ }
353
+ },
354
+ "required": [
355
+ "docId",
356
+ "tableId"
357
+ ],
358
+ "type": "object"
359
+ }
360
+ },
361
+ {
362
+ "name": "newListColumnsStep",
363
+ "kind": "query",
364
+ "operationId": "listColumns",
365
+ "inputType": "ListColumnsInput",
366
+ "description": "List a bounded page of columns in one table.",
367
+ "fields": {
368
+ "stepType": "stepType",
369
+ "annotations": "annotations",
370
+ "connectionName": "connectionName",
371
+ "resultAttribute": "resultAttribute"
372
+ },
373
+ "branches": [
374
+ {
375
+ "id": "listed",
376
+ "field": "listed",
377
+ "optional": false
378
+ },
379
+ {
380
+ "id": "notFound",
381
+ "field": "notFound",
382
+ "optional": true
383
+ },
384
+ {
385
+ "id": "providerRejected",
386
+ "field": "providerRejected",
387
+ "optional": true
388
+ },
389
+ {
390
+ "id": "invalidResponse",
391
+ "field": "invalidResponse",
392
+ "optional": true
393
+ },
394
+ {
395
+ "id": "defect",
396
+ "field": "defect",
397
+ "optional": true
398
+ }
399
+ ],
400
+ "inputSchema": {
401
+ "additionalProperties": false,
402
+ "description": "ListColumnsInput selects one column page within a table.",
403
+ "properties": {
404
+ "docId": {
405
+ "description": "DocID identifies the parent doc.",
406
+ "type": "string"
407
+ },
408
+ "limit": {
409
+ "description": "Limit caps returned columns at 500; zero uses the provider default.",
410
+ "type": "integer"
411
+ },
412
+ "pageToken": {
413
+ "description": "PageToken is the opaque token from a prior page.",
414
+ "type": "string"
415
+ },
416
+ "tableId": {
417
+ "description": "TableID identifies the parent table.",
418
+ "type": "string"
419
+ }
420
+ },
421
+ "required": [
422
+ "docId",
423
+ "tableId"
424
+ ],
425
+ "type": "object"
426
+ }
80
427
  }
81
428
  ]
82
429
  }