@superdurable/connector-airtable 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.
@@ -0,0 +1,320 @@
1
+ import { SecretString, CredentialProvider, Query, Mutation, ConnectionRef } from '@superdurable/connectors-sdk';
2
+ import { z } from 'zod';
3
+
4
+ /** Connector configuration; omitted fields use manifest defaults. */
5
+ interface Config {
6
+ /** Airtable Web API base URL; leave blank for Airtable's public API host. Enter an absolute HTTPS URL only for an explicitly supported compatible gateway, or a loopback HTTP URL for a local test server. The base and table pickers always call Airtable's public API host. */
7
+ endpoint?: string;
8
+ /** Maximum complete Airtable API response in bytes; leave blank to keep the safety limit, or enter a larger positive integer only when one page of records carries very long text or many attachments. Oversized responses select invalidResponse. */
9
+ maxResponseBytes?: number;
10
+ }
11
+ /** Runtime schema for manifest configuration. */
12
+ declare const ConfigSchema: z.ZodObject<{
13
+ endpoint: z.ZodOptional<z.ZodString>;
14
+ maxResponseBytes: z.ZodOptional<z.ZodNumber>;
15
+ }, z.core.$strip>;
16
+ /** Private connector credentials resolved by the host. */
17
+ interface Credentials {
18
+ /** Secret Airtable personal access token copied once from https://airtable.com/create/tokens after choosing Create new token; it starts with pat and is otherwise an opaque string, Dex Web stores it as a secret, and blank means no Airtable call can authenticate. */
19
+ personalAccessToken: SecretString;
20
+ }
21
+ /** Host-owned source of private connector credentials. */
22
+ type CredentialSource = CredentialProvider<Credentials>;
23
+ /** FieldEqualityFilter matches records whose field equals one typed value.
24
+ * Exactly one of Text, Number, and Checkbox is set; prefer the constructors
25
+ * TextFieldEquals, NumberFieldEquals, and CheckboxFieldEquals.
26
+ *
27
+ * The connector writes the filter as an Airtable formula such as
28
+ * {Policy Key} = "refund-standard", so it follows Airtable's formula
29
+ * comparison rules. A linked record, lookup, or multiple select field compares
30
+ * its displayed text, such as the linked records' primary field values joined
31
+ * by commas. */
32
+ interface FieldEqualityFilter {
33
+ /** Field is the field name, or its field ID such as fldXXXXXXXXXXXXXX. A
34
+ * name cannot contain a brace or a backslash, because Airtable documents no
35
+ * escape for them inside a field reference; use the field ID instead. */
36
+ "field": string;
37
+ /** Text matches a text, email, URL, phone, single select, or date field.
38
+ * It cannot contain a backslash or a control character such as a line
39
+ * break; use ListRecordsInput.Formula for such values. */
40
+ "text"?: string | undefined;
41
+ /** Number matches a number, currency, percent, rating, duration, count, or
42
+ * autonumber field. It must be finite. */
43
+ "number"?: number | undefined;
44
+ /** Checkbox matches a checked box when true and an unchecked box when false. */
45
+ "checkbox"?: boolean | undefined;
46
+ }
47
+ /** RecordSort orders listed records by one field. */
48
+ interface RecordSort {
49
+ /** Field is the field name or field ID. */
50
+ "field": string;
51
+ /** Direction is asc or desc; blank sorts ascending. */
52
+ "direction"?: "asc" | "desc" | (string & {}) | undefined;
53
+ }
54
+ /** ListRecordsInput selects one page of a table's records.
55
+ *
56
+ * Filters and Formula combine with AND into Airtable's filterByFormula: typed
57
+ * equality filters are escaped by the connector, and Formula is passed through
58
+ * as written, so it should come from application code rather than end users.
59
+ * Leaving both blank lists every record. Without Sort or View, Airtable
60
+ * returns records in no particular order. */
61
+ interface ListRecordsInput {
62
+ /** BaseID is the base ID, such as appXXXXXXXXXXXXXX, from the base picker. */
63
+ "baseId": string;
64
+ /** TableIDOrName is the table ID, such as tblXXXXXXXXXXXXXX from the table
65
+ * picker, which survives renames, or the table name. */
66
+ "tableIdOrName": string;
67
+ /** Filters match records whose fields equal typed values, at most 25. */
68
+ "filters"?: Array<FieldEqualityFilter> | undefined;
69
+ /** Formula is an optional raw Airtable formula, such as {Amount} > 100, ANDed with Filters. */
70
+ "formula"?: string | undefined;
71
+ /** Fields limits each returned record to these field names or IDs; blank returns every non-empty field. */
72
+ "fields"?: Array<string> | undefined;
73
+ /** Sort orders the records and overrides View's order, at most 10 entries. */
74
+ "sort"?: Array<RecordSort> | undefined;
75
+ /** ViewIDOrName limits the records to one view, in its order unless Sort is set. */
76
+ "viewIdOrName"?: string | undefined;
77
+ /** PageSize is the most records returned, 1 to 100; zero returns up to 100. */
78
+ "pageSize"?: number | undefined;
79
+ /** Offset continues a listing from the previous page's Offset; blank starts at the first page. */
80
+ "offset"?: string | undefined;
81
+ }
82
+ /** Record is one Airtable record as Airtable returned it. */
83
+ interface Record {
84
+ /** ID is the record ID, such as recXXXXXXXXXXXXXX. */
85
+ "id": string;
86
+ /** CreatedTime is when Airtable created the record, in UTC. */
87
+ "createdTime": string;
88
+ /** Fields maps each non-empty field, by field name, to its cell value.
89
+ * Airtable omits empty fields, so a missing key means the field is empty. */
90
+ "fields": {
91
+ [key: string]: unknown | null;
92
+ } | null;
93
+ }
94
+ /** RecordPage is one page of listed records. */
95
+ interface RecordPage {
96
+ /** Records holds at most the requested page size of records; an empty page is an empty list. */
97
+ "records": Array<Record> | null;
98
+ /** Offset continues the listing on the next call; blank means this is the last page. */
99
+ "offset"?: string | undefined;
100
+ /** FilterFormula is the filterByFormula the connector sent, blank when the call had no filter. */
101
+ "filterFormula"?: string | undefined;
102
+ }
103
+ /** GetRecordInput identifies one record. */
104
+ interface GetRecordInput {
105
+ /** BaseID is the base ID, such as appXXXXXXXXXXXXXX. */
106
+ "baseId": string;
107
+ /** TableIDOrName is the table ID, such as tblXXXXXXXXXXXXXX, or the table name. */
108
+ "tableIdOrName": string;
109
+ /** RecordID is the record ID, such as recXXXXXXXXXXXXXX. */
110
+ "recordId": string;
111
+ }
112
+ /** RecordUpsert is one record written by UpsertRecords. */
113
+ interface RecordUpsert {
114
+ /** Fields maps field names or IDs to cell values. It must hold a non-null
115
+ * value for every merge field, under the same name or ID the merge list uses. */
116
+ "fields": {
117
+ [key: string]: unknown | null;
118
+ } | null;
119
+ }
120
+ /** UpsertRecordsInput creates or updates up to 10 records in one table.
121
+ *
122
+ * Airtable matches each record to an existing record whose merge fields equal
123
+ * the record's values for them: no match creates a record, one match updates
124
+ * it, leaving fields the write does not name unchanged, and several matches
125
+ * reject the whole request. A repeated write of the same input therefore
126
+ * updates the records the first write created instead of adding duplicates. */
127
+ interface UpsertRecordsInput {
128
+ /** BaseID is the base ID, such as appXXXXXXXXXXXXXX. */
129
+ "baseId": string;
130
+ /** TableIDOrName is the table ID, such as tblXXXXXXXXXXXXXX, or the table name. */
131
+ "tableIdOrName": string;
132
+ /** FieldsToMergeOn names one to three fields whose values identify a record,
133
+ * such as a case ID. Airtable lists number, text, long text, single
134
+ * select, multiple select, and date fields as merge fields, never a
135
+ * computed field such as a formula, lookup, or rollup. */
136
+ "fieldsToMergeOn": Array<string> | null;
137
+ /** Records are the one to ten records to write; no two may share merge values. */
138
+ "records": Array<RecordUpsert> | null;
139
+ /** Typecast lets Airtable convert text to the field's type, such as adding a
140
+ * new select option; false rejects a value of the wrong type. */
141
+ "typecast"?: boolean | undefined;
142
+ }
143
+ /** UpsertedRecords reports the records an upsert wrote. */
144
+ interface UpsertedRecords {
145
+ /** Records are the written records in input order, with every non-empty field. */
146
+ "records": Array<Record> | null;
147
+ /** CreatedRecordIDs are the records this answered request created. After a
148
+ * retry whose earlier attempt created a record but lost the response, that
149
+ * record appears in UpdatedRecordIDs instead. */
150
+ "createdRecordIds": Array<string> | null;
151
+ /** UpdatedRecordIDs are the existing records this answered request updated. */
152
+ "updatedRecordIds": Array<string> | null;
153
+ /** PartialSuccessReasons names why Airtable saved the records without every
154
+ * attachment, such as attachmentsFailedUploading; empty when nothing failed. */
155
+ "partialSuccessReasons"?: Array<string> | undefined;
156
+ }
157
+ /** RecordUpdate sets fields on one existing record. */
158
+ interface RecordUpdate {
159
+ /** ID is the record ID, such as recXXXXXXXXXXXXXX. */
160
+ "id": string;
161
+ /** Fields maps field names or IDs to their new cell values. Fields the
162
+ * update does not name keep their values. */
163
+ "fields": {
164
+ [key: string]: unknown | null;
165
+ } | null;
166
+ }
167
+ /** UpdateRecordsInput updates up to 10 records in one table by record ID.
168
+ *
169
+ * Each value replaces the field's whole value, including every link of a
170
+ * linked record field, so repeating the same update leaves the records
171
+ * unchanged. */
172
+ interface UpdateRecordsInput {
173
+ /** BaseID is the base ID, such as appXXXXXXXXXXXXXX. */
174
+ "baseId": string;
175
+ /** TableIDOrName is the table ID, such as tblXXXXXXXXXXXXXX, or the table name. */
176
+ "tableIdOrName": string;
177
+ /** Records are the one to ten records to update, each named once. */
178
+ "records": Array<RecordUpdate> | null;
179
+ /** Typecast lets Airtable convert text to the field's type, such as adding a
180
+ * new select option; false rejects a value of the wrong type. */
181
+ "typecast"?: boolean | undefined;
182
+ }
183
+ /** UpdatedRecords reports the records an update wrote. */
184
+ interface UpdatedRecords {
185
+ /** Records are the updated records with every non-empty field. */
186
+ "records": Array<Record> | null;
187
+ /** PartialSuccessReasons names why Airtable saved the records without every
188
+ * attachment, such as attachmentsFailedUploading; empty when nothing failed. */
189
+ "partialSuccessReasons"?: Array<string> | undefined;
190
+ }
191
+ /** Runtime validator for FieldEqualityFilter. */
192
+ declare const FieldEqualityFilterSchema: z.ZodObject<{
193
+ field: z.ZodString;
194
+ text: z.ZodOptional<z.ZodString>;
195
+ number: z.ZodOptional<z.ZodNumber>;
196
+ checkbox: z.ZodOptional<z.ZodBoolean>;
197
+ }, z.core.$strict>;
198
+ /** Runtime validator for RecordSort. */
199
+ declare const RecordSortSchema: z.ZodObject<{
200
+ field: z.ZodString;
201
+ direction: z.ZodOptional<z.ZodString>;
202
+ }, z.core.$strict>;
203
+ /** Runtime validator for ListRecordsInput. */
204
+ declare const ListRecordsInputSchema: z.ZodObject<{
205
+ baseId: z.ZodString;
206
+ tableIdOrName: z.ZodString;
207
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
208
+ field: z.ZodString;
209
+ text: z.ZodOptional<z.ZodString>;
210
+ number: z.ZodOptional<z.ZodNumber>;
211
+ checkbox: z.ZodOptional<z.ZodBoolean>;
212
+ }, z.core.$strict>>>;
213
+ formula: z.ZodOptional<z.ZodString>;
214
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
+ sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
216
+ field: z.ZodString;
217
+ direction: z.ZodOptional<z.ZodString>;
218
+ }, z.core.$strict>>>;
219
+ viewIdOrName: z.ZodOptional<z.ZodString>;
220
+ pageSize: z.ZodOptional<z.ZodNumber>;
221
+ offset: z.ZodOptional<z.ZodString>;
222
+ }, z.core.$strict>;
223
+ /** Runtime validator for Record. */
224
+ declare const RecordSchema: z.ZodObject<{
225
+ id: z.ZodString;
226
+ createdTime: z.ZodISODateTime;
227
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
228
+ }, z.core.$strict>;
229
+ /** Runtime validator for RecordPage. */
230
+ declare const RecordPageSchema: z.ZodObject<{
231
+ records: z.ZodNullable<z.ZodArray<z.ZodObject<{
232
+ id: z.ZodString;
233
+ createdTime: z.ZodISODateTime;
234
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
235
+ }, z.core.$strict>>>;
236
+ offset: z.ZodOptional<z.ZodString>;
237
+ filterFormula: z.ZodOptional<z.ZodString>;
238
+ }, z.core.$strict>;
239
+ /** Runtime validator for GetRecordInput. */
240
+ declare const GetRecordInputSchema: z.ZodObject<{
241
+ baseId: z.ZodString;
242
+ tableIdOrName: z.ZodString;
243
+ recordId: z.ZodString;
244
+ }, z.core.$strict>;
245
+ /** Runtime validator for RecordUpsert. */
246
+ declare const RecordUpsertSchema: z.ZodObject<{
247
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
248
+ }, z.core.$strict>;
249
+ /** Runtime validator for UpsertRecordsInput. */
250
+ declare const UpsertRecordsInputSchema: z.ZodObject<{
251
+ baseId: z.ZodString;
252
+ tableIdOrName: z.ZodString;
253
+ fieldsToMergeOn: z.ZodNullable<z.ZodArray<z.ZodString>>;
254
+ records: z.ZodNullable<z.ZodArray<z.ZodObject<{
255
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
256
+ }, z.core.$strict>>>;
257
+ typecast: z.ZodOptional<z.ZodBoolean>;
258
+ }, z.core.$strict>;
259
+ /** Runtime validator for UpsertedRecords. */
260
+ declare const UpsertedRecordsSchema: z.ZodObject<{
261
+ records: z.ZodNullable<z.ZodArray<z.ZodObject<{
262
+ id: z.ZodString;
263
+ createdTime: z.ZodISODateTime;
264
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
265
+ }, z.core.$strict>>>;
266
+ createdRecordIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
267
+ updatedRecordIds: z.ZodNullable<z.ZodArray<z.ZodString>>;
268
+ partialSuccessReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
269
+ }, z.core.$strict>;
270
+ /** Runtime validator for RecordUpdate. */
271
+ declare const RecordUpdateSchema: z.ZodObject<{
272
+ id: z.ZodString;
273
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
274
+ }, z.core.$strict>;
275
+ /** Runtime validator for UpdateRecordsInput. */
276
+ declare const UpdateRecordsInputSchema: z.ZodObject<{
277
+ baseId: z.ZodString;
278
+ tableIdOrName: z.ZodString;
279
+ records: z.ZodNullable<z.ZodArray<z.ZodObject<{
280
+ id: z.ZodString;
281
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
282
+ }, z.core.$strict>>>;
283
+ typecast: z.ZodOptional<z.ZodBoolean>;
284
+ }, z.core.$strict>;
285
+ /** Runtime validator for UpdatedRecords. */
286
+ declare const UpdatedRecordsSchema: z.ZodObject<{
287
+ records: z.ZodNullable<z.ZodArray<z.ZodObject<{
288
+ id: z.ZodString;
289
+ createdTime: z.ZodISODateTime;
290
+ fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodUnknown>>>;
291
+ }, z.core.$strict>>>;
292
+ partialSuccessReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
293
+ }, z.core.$strict>;
294
+
295
+ /** Typed operations supplied by a client or mock. */
296
+ interface Operations {
297
+ /** Invoke listRecords through this connection. */
298
+ listRecords(): Query<ListRecordsInput, RecordPage>;
299
+ /** Invoke getRecord through this connection. */
300
+ getRecord(): Query<GetRecordInput, Record>;
301
+ /** Invoke upsertRecords through this connection. */
302
+ upsertRecords(): Mutation<UpsertRecordsInput, UpsertedRecords>;
303
+ /** Invoke updateRecords through this connection. */
304
+ updateRecords(): Mutation<UpdateRecordsInput, UpdatedRecords>;
305
+ }
306
+ /** Named connector connection kept outside Flow state. */
307
+ declare class Connection<BoundOperations = Operations> {
308
+ /** Stable provider and connection name. */
309
+ readonly reference: ConnectionRef;
310
+ /** Bound provider operations. */
311
+ readonly operations: BoundOperations;
312
+ /** Validate a reference and bind operations. */
313
+ constructor(reference: ConnectionRef, operations: BoundOperations);
314
+ }
315
+ /** Bind a client to a named connection. */
316
+ declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
317
+ /** Bind scripted operations to a named connection. */
318
+ declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
319
+
320
+ export { Connection as C, type FieldEqualityFilter as F, type GetRecordInput as G, type ListRecordsInput as L, type Operations as O, type Record as R, type UpdateRecordsInput as U, type RecordPage as a, type UpdatedRecords as b, type UpsertRecordsInput as c, type UpsertedRecords as d, type Config as e, type Credentials as f, ConfigSchema as g, type CredentialSource as h, FieldEqualityFilterSchema as i, GetRecordInputSchema as j, ListRecordsInputSchema as k, RecordPageSchema as l, RecordSchema as m, type RecordSort as n, RecordSortSchema as o, type RecordUpdate as p, RecordUpdateSchema as q, type RecordUpsert as r, RecordUpsertSchema as s, UpdateRecordsInputSchema as t, UpdatedRecordsSchema as u, UpsertRecordsInputSchema as v, UpsertedRecordsSchema as w, newConnection as x, newConnectionWithOperations as y };
@@ -0,0 +1,290 @@
1
+ import { G as GetRecordInput, R as Record, C as Connection, L as ListRecordsInput, a as RecordPage, U as UpdateRecordsInput, b as UpdatedRecords, c as UpsertRecordsInput, d as UpsertedRecords, O as Operations, e as Config, f as Credentials } from './connection-C93OyKtn.js';
2
+ export { g as ConfigSchema, h as CredentialSource, F as FieldEqualityFilter, i as FieldEqualityFilterSchema, j as GetRecordInputSchema, k as ListRecordsInputSchema, l as RecordPageSchema, m as RecordSchema, n as RecordSort, o as RecordSortSchema, p as RecordUpdate, q as RecordUpdateSchema, r as RecordUpsert, s as RecordUpsertSchema, t as UpdateRecordsInputSchema, u as UpdatedRecordsSchema, v as UpsertRecordsInputSchema, w as UpsertedRecordsSchema, x as newConnection, y as newConnectionWithOperations } from './connection-C93OyKtn.js';
3
+ import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
4
+ import { QueryDefinition, MutationDefinition, QueryStepConfig, Query, QueryResult, MutationStepConfig, Mutation, MutationResult, QueryStep, MutationStep, Call, QueryAttempt, MutationAttempt, CredentialProvider, ReceiptDraft, Failure } from '@superdurable/connectors-sdk';
5
+ import { StepTarget } from '@superdurable/dex';
6
+ import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
7
+ import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
8
+ import 'zod';
9
+
10
+ /** Stable connector identity. */
11
+ declare const ConnectorID = "airtable";
12
+ /** Provider identity for named connections. */
13
+ declare const ProviderID = "airtable";
14
+ /** Branch IDs for listRecords. */
15
+ declare const ListRecordsBranch: {
16
+ readonly Listed: "listed";
17
+ readonly OffsetExpired: "offsetExpired";
18
+ readonly ProviderRejected: "providerRejected";
19
+ readonly InvalidResponse: "invalidResponse";
20
+ readonly Defect: "defect";
21
+ };
22
+ /** Airtable returned one bounded page of matching records; the page may be empty. */
23
+ declare const ListRecordsBranchListed: "listed";
24
+ /** Airtable no longer recognizes the offset cursor, so the listing must restart from the first page. */
25
+ declare const ListRecordsBranchOffsetExpired: "offsetExpired";
26
+ /** Airtable conclusively rejected the list, such as an unknown base, table, view, or field, an invalid formula, a missing scope, or a rejected token. */
27
+ declare const ListRecordsBranchProviderRejected: "providerRejected";
28
+ /** Airtable returned an invalid or oversized list response. */
29
+ declare const ListRecordsBranchInvalidResponse: "invalidResponse";
30
+ /** Local input, connection configuration, or connector definition is invalid. */
31
+ declare const ListRecordsBranchDefect: "defect";
32
+ /** Manifest definition for listRecords. */
33
+ declare const ListRecordsDefinition: QueryDefinition;
34
+ /** Manifest metadata for listRecords. */
35
+ declare const ListRecordsMetadata: {
36
+ readonly kind: "query";
37
+ readonly idempotency: "none";
38
+ readonly authorization: "required";
39
+ };
40
+ /** Branch IDs for getRecord. */
41
+ declare const GetRecordBranch: {
42
+ readonly Found: "found";
43
+ readonly NotFound: "notFound";
44
+ readonly ProviderRejected: "providerRejected";
45
+ readonly InvalidResponse: "invalidResponse";
46
+ readonly Defect: "defect";
47
+ };
48
+ /** The record exists and was returned. */
49
+ declare const GetRecordBranchFound: "found";
50
+ /** No record in the base has the record ID. */
51
+ declare const GetRecordBranchNotFound: "notFound";
52
+ /** Airtable conclusively rejected the read, such as an unknown base or table, a missing scope, or a rejected token. */
53
+ declare const GetRecordBranchProviderRejected: "providerRejected";
54
+ /** Airtable returned an invalid or oversized record response. */
55
+ declare const GetRecordBranchInvalidResponse: "invalidResponse";
56
+ /** Local input, connection configuration, or connector definition is invalid. */
57
+ declare const GetRecordBranchDefect: "defect";
58
+ /** Manifest definition for getRecord. */
59
+ declare const GetRecordDefinition: QueryDefinition;
60
+ /** Manifest metadata for getRecord. */
61
+ declare const GetRecordMetadata: {
62
+ readonly kind: "query";
63
+ readonly idempotency: "none";
64
+ readonly authorization: "required";
65
+ };
66
+ /** Branch IDs for upsertRecords. */
67
+ declare const UpsertRecordsBranch: {
68
+ readonly Upserted: "upserted";
69
+ readonly ProviderRejected: "providerRejected";
70
+ readonly InvalidResponse: "invalidResponse";
71
+ readonly Defect: "defect";
72
+ };
73
+ /** Airtable created each record without a match and updated each record that matched. */
74
+ declare const UpsertRecordsBranchUpserted: "upserted";
75
+ /** Airtable conclusively rejected the upsert, such as several existing records matching one merge key, an invalid cell value, a computed merge field, a missing scope, or a rejected token. */
76
+ declare const UpsertRecordsBranchProviderRejected: "providerRejected";
77
+ /** Airtable applied or rejected the upsert but returned an invalid or oversized response. */
78
+ declare const UpsertRecordsBranchInvalidResponse: "invalidResponse";
79
+ /** Local input, connection configuration, or connector definition is invalid. */
80
+ declare const UpsertRecordsBranchDefect: "defect";
81
+ /** Manifest definition for upsertRecords. */
82
+ declare const UpsertRecordsDefinition: MutationDefinition;
83
+ /** Manifest metadata for upsertRecords. */
84
+ declare const UpsertRecordsMetadata: {
85
+ readonly kind: "mutation";
86
+ readonly idempotency: "required";
87
+ readonly authorization: "required";
88
+ };
89
+ /** Branch IDs for updateRecords. */
90
+ declare const UpdateRecordsBranch: {
91
+ readonly Updated: "updated";
92
+ readonly NotFound: "notFound";
93
+ readonly ProviderRejected: "providerRejected";
94
+ readonly InvalidResponse: "invalidResponse";
95
+ readonly Defect: "defect";
96
+ };
97
+ /** Airtable updated every record and returned it. */
98
+ declare const UpdateRecordsBranchUpdated: "updated";
99
+ /** A record ID does not exist in the table. */
100
+ declare const UpdateRecordsBranchNotFound: "notFound";
101
+ /** Airtable conclusively rejected the update, such as an invalid cell value, a computed field, a missing scope, or a rejected token. */
102
+ declare const UpdateRecordsBranchProviderRejected: "providerRejected";
103
+ /** Airtable applied or rejected the update but returned an invalid or oversized response. */
104
+ declare const UpdateRecordsBranchInvalidResponse: "invalidResponse";
105
+ /** Local input, connection configuration, or connector definition is invalid. */
106
+ declare const UpdateRecordsBranchDefect: "defect";
107
+ /** Manifest definition for updateRecords. */
108
+ declare const UpdateRecordsDefinition: MutationDefinition;
109
+ /** Manifest metadata for updateRecords. */
110
+ declare const UpdateRecordsMetadata: {
111
+ readonly kind: "mutation";
112
+ readonly idempotency: "required";
113
+ readonly authorization: "required";
114
+ };
115
+
116
+ /** Configuration for the listRecords connector Step. */
117
+ interface ListRecordsStepConfig<StepInput, OperationInput = ListRecordsInput, OperationOutput = RecordPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
118
+ /** Named connection supplying this operation. */
119
+ connection: Connection<{
120
+ listRecords(): Query<OperationInput, OperationOutput>;
121
+ }>;
122
+ /** Name matching the bound connection. */
123
+ connectionName: string;
124
+ /** Airtable returned one bounded page of matching records; the page may be empty. */
125
+ listed: StepTarget<QueryResult<OperationOutput>>;
126
+ /** Airtable no longer recognizes the offset cursor, so the listing must restart from the first page. */
127
+ offsetExpired?: StepTarget<QueryResult<OperationOutput>>;
128
+ /** Airtable conclusively rejected the list, such as an unknown base, table, view, or field, an invalid formula, a missing scope, or a rejected token. */
129
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
130
+ /** Airtable returned an invalid or oversized list response. */
131
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
132
+ /** Local input, connection configuration, or connector definition is invalid. */
133
+ defect?: StepTarget<QueryResult<OperationOutput>>;
134
+ }
135
+ /** Build the listRecords Step from a named connection. */
136
+ declare function newListRecordsStep<StepInput, OperationInput = ListRecordsInput, OperationOutput = RecordPage>(configuration: ListRecordsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
137
+ /** Configuration for the getRecord connector Step. */
138
+ interface GetRecordStepConfig<StepInput, OperationInput = GetRecordInput, OperationOutput = Record> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
139
+ /** Named connection supplying this operation. */
140
+ connection: Connection<{
141
+ getRecord(): Query<OperationInput, OperationOutput>;
142
+ }>;
143
+ /** Name matching the bound connection. */
144
+ connectionName: string;
145
+ /** The record exists and was returned. */
146
+ found: StepTarget<QueryResult<OperationOutput>>;
147
+ /** No record in the base has the record ID. */
148
+ notFound?: StepTarget<QueryResult<OperationOutput>>;
149
+ /** Airtable conclusively rejected the read, such as an unknown base or table, a missing scope, or a rejected token. */
150
+ providerRejected?: StepTarget<QueryResult<OperationOutput>>;
151
+ /** Airtable returned an invalid or oversized record response. */
152
+ invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
153
+ /** Local input, connection configuration, or connector definition is invalid. */
154
+ defect?: StepTarget<QueryResult<OperationOutput>>;
155
+ }
156
+ /** Build the getRecord Step from a named connection. */
157
+ declare function newGetRecordStep<StepInput, OperationInput = GetRecordInput, OperationOutput = Record>(configuration: GetRecordStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
158
+ /** Configuration for the upsertRecords connector Step. */
159
+ interface UpsertRecordsStepConfig<StepInput, OperationInput = UpsertRecordsInput, OperationOutput = UpsertedRecords> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
160
+ /** Named connection supplying this operation. */
161
+ connection: Connection<{
162
+ upsertRecords(): Mutation<OperationInput, OperationOutput>;
163
+ }>;
164
+ /** Name matching the bound connection. */
165
+ connectionName: string;
166
+ /** Airtable created each record without a match and updated each record that matched. */
167
+ upserted: StepTarget<MutationResult<OperationOutput>>;
168
+ /** Airtable conclusively rejected the upsert, such as several existing records matching one merge key, an invalid cell value, a computed merge field, a missing scope, or a rejected token. */
169
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
170
+ /** Airtable applied or rejected the upsert but returned an invalid or oversized response. */
171
+ invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
172
+ /** Local input, connection configuration, or connector definition is invalid. */
173
+ defect?: StepTarget<MutationResult<OperationOutput>>;
174
+ }
175
+ /** Build the upsertRecords Step from a named connection. */
176
+ declare function newUpsertRecordsStep<StepInput, OperationInput = UpsertRecordsInput, OperationOutput = UpsertedRecords>(configuration: UpsertRecordsStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
177
+ /** Configuration for the updateRecords connector Step. */
178
+ interface UpdateRecordsStepConfig<StepInput, OperationInput = UpdateRecordsInput, OperationOutput = UpdatedRecords> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
179
+ /** Named connection supplying this operation. */
180
+ connection: Connection<{
181
+ updateRecords(): Mutation<OperationInput, OperationOutput>;
182
+ }>;
183
+ /** Name matching the bound connection. */
184
+ connectionName: string;
185
+ /** Airtable updated every record and returned it. */
186
+ updated: StepTarget<MutationResult<OperationOutput>>;
187
+ /** A record ID does not exist in the table. */
188
+ notFound?: StepTarget<MutationResult<OperationOutput>>;
189
+ /** Airtable conclusively rejected the update, such as an invalid cell value, a computed field, a missing scope, or a rejected token. */
190
+ providerRejected?: StepTarget<MutationResult<OperationOutput>>;
191
+ /** Airtable applied or rejected the update but returned an invalid or oversized response. */
192
+ invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
193
+ /** Local input, connection configuration, or connector definition is invalid. */
194
+ defect?: StepTarget<MutationResult<OperationOutput>>;
195
+ }
196
+ /** Build the updateRecords Step from a named connection. */
197
+ declare function newUpdateRecordsStep<StepInput, OperationInput = UpdateRecordsInput, OperationOutput = UpdatedRecords>(configuration: UpdateRecordsStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
198
+
199
+ /** Open one static Airtable connection declared in a Dex project. */
200
+ declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
201
+
202
+ /** Query one bounded Airtable record page. */
203
+ declare class ListRecordsOperation implements Query<ListRecordsInput, RecordPage> {
204
+ private readonly client;
205
+ /** Bind one authenticated client. */ constructor(client: AirtableClient);
206
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
207
+ /** Validate, send, and classify one list attempt. */
208
+ invoke(call: Call, input: ListRecordsInput): Promise<QueryAttempt<RecordPage>>;
209
+ }
210
+ /** Query one Airtable record by ID. */
211
+ declare class GetRecordOperation implements Query<GetRecordInput, Record> {
212
+ private readonly client;
213
+ /** Bind one authenticated client. */ constructor(client: AirtableClient);
214
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
215
+ /** Validate, send, and classify one record read. */
216
+ invoke(call: Call, input: GetRecordInput): Promise<QueryAttempt<Record>>;
217
+ }
218
+ /** Mutation that replaces records by stable merge fields. */
219
+ declare class UpsertRecordsOperation implements Mutation<UpsertRecordsInput, UpsertedRecords> {
220
+ private readonly client;
221
+ /** Bind one authenticated client. */ constructor(client: AirtableClient);
222
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
223
+ /** Reuse the Dex Call ID; Airtable does not accept an idempotency header. */ idempotencyKey(callId: string): string;
224
+ /** Validate and send one repeat-safe merge-field upsert. */
225
+ invoke(call: Call, input: UpsertRecordsInput): Promise<MutationAttempt<UpsertedRecords>>;
226
+ }
227
+ /** Mutation that sets absolute field values on named records. */
228
+ declare class UpdateRecordsOperation implements Mutation<UpdateRecordsInput, UpdatedRecords> {
229
+ private readonly client;
230
+ /** Bind one authenticated client. */ constructor(client: AirtableClient);
231
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
232
+ /** Reuse the Dex Call ID; absolute replacement makes retries safe. */ idempotencyKey(callId: string): string;
233
+ /** Validate and send one repeat-safe update by record ID. */
234
+ invoke(call: Call, input: UpdateRecordsInput): Promise<MutationAttempt<UpdatedRecords>>;
235
+ }
236
+
237
+ /** HTTP sender used by Airtable requests, injectable for deterministic provider tests. */
238
+ type AirtableRequestSender = (request: ProviderRequest) => Promise<ProviderResponse>;
239
+ /** Dependencies for deterministic provider tests. */
240
+ interface AirtableClientOptions {
241
+ /** Sender; omit to use the SDK's pinned DNS, bounded, no redirect transport. */
242
+ send?: AirtableRequestSender;
243
+ /** Clock used for receipts, pacing, and Retry-After dates. */
244
+ now?: () => Date;
245
+ }
246
+ /** One unsuccessful provider exchange. */
247
+ interface ExchangeFailure {
248
+ /** Retry or terminal classification. */
249
+ disposition: 'retry' | 'notFound' | 'offsetExpired' | 'rejected' | 'invalidResponse' | 'defect';
250
+ /** Secret-safe connector failure. */
251
+ failure: Failure;
252
+ /** Provider-directed retry delay in milliseconds. */
253
+ retryAfterMs: number;
254
+ /** Correlation receipt after a provider attempt. */
255
+ receipt: ReceiptDraft;
256
+ }
257
+ /** Successful bounded response or classified failure. */
258
+ type ExchangeResult = {
259
+ response: ProviderResponse;
260
+ } | {
261
+ outcome: ExchangeFailure;
262
+ };
263
+ /** Validated Airtable API client with per-base pacing and live credential resolution. */
264
+ declare class AirtableClient {
265
+ private readonly endpoint;
266
+ private readonly maxResponseBytes;
267
+ private readonly credentials;
268
+ private readonly send;
269
+ private readonly now;
270
+ private readonly nextRequestAt;
271
+ /** Construct one client without contacting Airtable. */
272
+ constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: AirtableClientOptions);
273
+ /** Bind the list query. */
274
+ listRecords(): ListRecordsOperation;
275
+ /** Bind the record query. */
276
+ getRecord(): GetRecordOperation;
277
+ /** Bind the upsert mutation. */
278
+ upsertRecords(): UpsertRecordsOperation;
279
+ /** Bind the update mutation. */
280
+ updateRecords(): UpdateRecordsOperation;
281
+ /** Produce one safe receipt after an exchange. */
282
+ receipt(call: Call, objectId: string): ReceiptDraft;
283
+ /** Resolve credentials, pace one base, send a bounded request, and classify non-2xx responses. */
284
+ exchange(call: Call, operation: string, baseId: string, objectId: string, method: string, path: string, body?: unknown): Promise<ExchangeResult>;
285
+ private reserveRequestSlot;
286
+ private classifyResponse;
287
+ private failure;
288
+ }
289
+
290
+ export { AirtableClient, type AirtableClientOptions, type AirtableRequestSender, Config, Connection, ConnectorID, Credentials, GetRecordBranch, GetRecordBranchDefect, GetRecordBranchFound, GetRecordBranchInvalidResponse, GetRecordBranchNotFound, GetRecordBranchProviderRejected, GetRecordDefinition, GetRecordInput, GetRecordMetadata, GetRecordOperation, type GetRecordStepConfig, ListRecordsBranch, ListRecordsBranchDefect, ListRecordsBranchInvalidResponse, ListRecordsBranchListed, ListRecordsBranchOffsetExpired, ListRecordsBranchProviderRejected, ListRecordsDefinition, ListRecordsInput, ListRecordsMetadata, ListRecordsOperation, type ListRecordsStepConfig, ProviderID, Record, RecordPage, UpdateRecordsBranch, UpdateRecordsBranchDefect, UpdateRecordsBranchInvalidResponse, UpdateRecordsBranchNotFound, UpdateRecordsBranchProviderRejected, UpdateRecordsBranchUpdated, UpdateRecordsDefinition, UpdateRecordsInput, UpdateRecordsMetadata, UpdateRecordsOperation, type UpdateRecordsStepConfig, UpdatedRecords, UpsertRecordsBranch, UpsertRecordsBranchDefect, UpsertRecordsBranchInvalidResponse, UpsertRecordsBranchProviderRejected, UpsertRecordsBranchUpserted, UpsertRecordsDefinition, UpsertRecordsInput, UpsertRecordsMetadata, UpsertRecordsOperation, type UpsertRecordsStepConfig, UpsertedRecords, newGetRecordStep, newListRecordsStep, newProjectConnection, newUpdateRecordsStep, newUpsertRecordsStep };