@superdurable/connector-airtable 0.1.2 → 0.2.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/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
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';
1
+ import { G as GetRecordInput, R as Record$1, C as Connection, L as ListRecordsInput, a as RecordPage, U as UpdateRecordsInput, b as UpdatedRecords, c as UpsertRecordsInput, d as UpsertedRecords, e as Config, f as Credentials, O as Operations } from './connection-D07xrUMb.js';
2
+ export { g as ConfigSchema, h as CredentialMaterialError, i as CredentialSource, F as FieldEqualityFilter, j as FieldEqualityFilterSchema, k as GetRecordInputSchema, l as ListRecordsInputSchema, m as RecordPageSchema, n as RecordSchema, o as RecordSort, p as RecordSortSchema, q as RecordUpdate, r as RecordUpdateSchema, s as RecordUpsert, t as RecordUpsertSchema, u as UpdateRecordsInputSchema, v as UpdatedRecordsSchema, w as UpsertRecordsInputSchema, x as UpsertedRecordsSchema, y as decodeCredentials, z as isCredentialMaterialError, A as newConnection, B as newConnectionWithOperations } from './connection-D07xrUMb.js';
3
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';
4
+ import { QueryDefinition, MutationDefinition, QueryStepConfig, Query, QueryResult, MutationStepConfig, Mutation, MutationResult, QueryStep, MutationStep, Call, QueryAttempt, MutationAttempt, TriggerLogger, CredentialProvider, ReceiptDraft, Failure, TriggerTarget, ConnectorConfigurationUI, TriggerDefinition, TriggerBindingDefinition, TriggerRunner } from '@superdurable/connectors-sdk';
5
5
  import { StepTarget } from '@superdurable/dex';
6
6
  import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
7
7
  import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
8
- import 'zod';
8
+ import { CursorStore, RequestLimiter, Runner } from '@superdurable/connectors-sdk/pollingtrigger';
9
+ import { z } from 'zod';
9
10
 
10
11
  /** Stable connector identity. */
11
12
  declare const ConnectorID = "airtable";
@@ -74,7 +75,7 @@ declare const UpsertRecordsBranch: {
74
75
  declare const UpsertRecordsBranchUpserted: "upserted";
75
76
  /** 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
77
  declare const UpsertRecordsBranchProviderRejected: "providerRejected";
77
- /** Airtable applied or rejected the upsert but returned an invalid or oversized response. */
78
+ /** Kept for compatibility and no longer selected: an invalid or oversized upsert response now retries, because repeating the upsert is safe. */
78
79
  declare const UpsertRecordsBranchInvalidResponse: "invalidResponse";
79
80
  /** Local input, connection configuration, or connector definition is invalid. */
80
81
  declare const UpsertRecordsBranchDefect: "defect";
@@ -100,7 +101,7 @@ declare const UpdateRecordsBranchUpdated: "updated";
100
101
  declare const UpdateRecordsBranchNotFound: "notFound";
101
102
  /** Airtable conclusively rejected the update, such as an invalid cell value, a computed field, a missing scope, or a rejected token. */
102
103
  declare const UpdateRecordsBranchProviderRejected: "providerRejected";
103
- /** Airtable applied or rejected the update but returned an invalid or oversized response. */
104
+ /** Kept for compatibility and no longer selected: an invalid or oversized update response now retries, because repeating absolute values is safe. */
104
105
  declare const UpdateRecordsBranchInvalidResponse: "invalidResponse";
105
106
  /** Local input, connection configuration, or connector definition is invalid. */
106
107
  declare const UpdateRecordsBranchDefect: "defect";
@@ -135,7 +136,7 @@ interface ListRecordsStepConfig<StepInput, OperationInput = ListRecordsInput, Op
135
136
  /** Build the listRecords Step from a named connection. */
136
137
  declare function newListRecordsStep<StepInput, OperationInput = ListRecordsInput, OperationOutput = RecordPage>(configuration: ListRecordsStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
137
138
  /** Configuration for the getRecord connector Step. */
138
- interface GetRecordStepConfig<StepInput, OperationInput = GetRecordInput, OperationOutput = Record> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
139
+ interface GetRecordStepConfig<StepInput, OperationInput = GetRecordInput, OperationOutput = Record$1> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
139
140
  /** Named connection supplying this operation. */
140
141
  connection: Connection<{
141
142
  getRecord(): Query<OperationInput, OperationOutput>;
@@ -154,7 +155,7 @@ interface GetRecordStepConfig<StepInput, OperationInput = GetRecordInput, Operat
154
155
  defect?: StepTarget<QueryResult<OperationOutput>>;
155
156
  }
156
157
  /** 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
+ declare function newGetRecordStep<StepInput, OperationInput = GetRecordInput, OperationOutput = Record$1>(configuration: GetRecordStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
158
159
  /** Configuration for the upsertRecords connector Step. */
159
160
  interface UpsertRecordsStepConfig<StepInput, OperationInput = UpsertRecordsInput, OperationOutput = UpsertedRecords> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
160
161
  /** Named connection supplying this operation. */
@@ -167,10 +168,12 @@ interface UpsertRecordsStepConfig<StepInput, OperationInput = UpsertRecordsInput
167
168
  upserted: StepTarget<MutationResult<OperationOutput>>;
168
169
  /** 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
170
  providerRejected?: StepTarget<MutationResult<OperationOutput>>;
170
- /** Airtable applied or rejected the upsert but returned an invalid or oversized response. */
171
+ /** Kept for compatibility and no longer selected: an invalid or oversized upsert response now retries, because repeating the upsert is safe. */
171
172
  invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
172
173
  /** Local input, connection configuration, or connector definition is invalid. */
173
174
  defect?: StepTarget<MutationResult<OperationOutput>>;
175
+ /** Accepted for compatibility; ignored because the operation is safe to repeat. */
176
+ maxSends?: number;
174
177
  }
175
178
  /** Build the upsertRecords Step from a named connection. */
176
179
  declare function newUpsertRecordsStep<StepInput, OperationInput = UpsertRecordsInput, OperationOutput = UpsertedRecords>(configuration: UpsertRecordsStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
@@ -188,17 +191,16 @@ interface UpdateRecordsStepConfig<StepInput, OperationInput = UpdateRecordsInput
188
191
  notFound?: StepTarget<MutationResult<OperationOutput>>;
189
192
  /** Airtable conclusively rejected the update, such as an invalid cell value, a computed field, a missing scope, or a rejected token. */
190
193
  providerRejected?: StepTarget<MutationResult<OperationOutput>>;
191
- /** Airtable applied or rejected the update but returned an invalid or oversized response. */
194
+ /** Kept for compatibility and no longer selected: an invalid or oversized update response now retries, because repeating absolute values is safe. */
192
195
  invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
193
196
  /** Local input, connection configuration, or connector definition is invalid. */
194
197
  defect?: StepTarget<MutationResult<OperationOutput>>;
198
+ /** Accepted for compatibility; ignored because the operation is safe to repeat. */
199
+ maxSends?: number;
195
200
  }
196
201
  /** Build the updateRecords Step from a named connection. */
197
202
  declare function newUpdateRecordsStep<StepInput, OperationInput = UpdateRecordsInput, OperationOutput = UpdatedRecords>(configuration: UpdateRecordsStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
198
203
 
199
- /** Open one static Airtable connection declared in a Dex project. */
200
- declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
201
-
202
204
  /** Query one bounded Airtable record page. */
203
205
  declare class ListRecordsOperation implements Query<ListRecordsInput, RecordPage> {
204
206
  private readonly client;
@@ -208,18 +210,18 @@ declare class ListRecordsOperation implements Query<ListRecordsInput, RecordPage
208
210
  invoke(call: Call, input: ListRecordsInput): Promise<QueryAttempt<RecordPage>>;
209
211
  }
210
212
  /** Query one Airtable record by ID. */
211
- declare class GetRecordOperation implements Query<GetRecordInput, Record> {
213
+ declare class GetRecordOperation implements Query<GetRecordInput, Record$1> {
212
214
  private readonly client;
213
215
  /** Bind one authenticated client. */ constructor(client: AirtableClient);
214
216
  /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
215
217
  /** Validate, send, and classify one record read. */
216
- invoke(call: Call, input: GetRecordInput): Promise<QueryAttempt<Record>>;
218
+ invoke(call: Call, input: GetRecordInput): Promise<QueryAttempt<Record$1>>;
217
219
  }
218
220
  /** Mutation that replaces records by stable merge fields. */
219
221
  declare class UpsertRecordsOperation implements Mutation<UpsertRecordsInput, UpsertedRecords> {
220
222
  private readonly client;
221
223
  /** Bind one authenticated client. */ constructor(client: AirtableClient);
222
- /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
224
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
223
225
  /** Reuse the Dex Call ID; Airtable does not accept an idempotency header. */ idempotencyKey(callId: string): string;
224
226
  /** Validate and send one repeat-safe merge-field upsert. */
225
227
  invoke(call: Call, input: UpsertRecordsInput): Promise<MutationAttempt<UpsertedRecords>>;
@@ -228,7 +230,7 @@ declare class UpsertRecordsOperation implements Mutation<UpsertRecordsInput, Ups
228
230
  declare class UpdateRecordsOperation implements Mutation<UpdateRecordsInput, UpdatedRecords> {
229
231
  private readonly client;
230
232
  /** Bind one authenticated client. */ constructor(client: AirtableClient);
231
- /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
233
+ /** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.MutationDefinition;
232
234
  /** Reuse the Dex Call ID; absolute replacement makes retries safe. */ idempotencyKey(callId: string): string;
233
235
  /** Validate and send one repeat-safe update by record ID. */
234
236
  invoke(call: Call, input: UpdateRecordsInput): Promise<MutationAttempt<UpdatedRecords>>;
@@ -242,6 +244,13 @@ interface AirtableClientOptions {
242
244
  send?: AirtableRequestSender;
243
245
  /** Clock used for receipts, pacing, and Retry-After dates. */
244
246
  now?: () => Date;
247
+ /**
248
+ * Receives the recordChanged Trigger runners' records: seeded and committed cursors, failed polls, cursor
249
+ * resets, delivery outcomes, and the durable inboxes newProjectRecordChangedTriggerRunner opens. Records
250
+ * carry the connector, connection, Trigger, and binding, never record fields, field names, or the token.
251
+ * Omitted uses the SDK's default Trigger logger; operation Steps do not log.
252
+ */
253
+ logger?: TriggerLogger;
245
254
  }
246
255
  /** One unsuccessful provider exchange. */
247
256
  interface ExchangeFailure {
@@ -253,6 +262,8 @@ interface ExchangeFailure {
253
262
  retryAfterMs: number;
254
263
  /** Correlation receipt after a provider attempt. */
255
264
  receipt: ReceiptDraft;
265
+ /** HTTP status of the provider answer, or undefined when no status arrived. */
266
+ status?: number;
256
267
  }
257
268
  /** Successful bounded response or classified failure. */
258
269
  type ExchangeResult = {
@@ -260,8 +271,15 @@ type ExchangeResult = {
260
271
  } | {
261
272
  outcome: ExchangeFailure;
262
273
  };
263
- /** Validated Airtable API client with per-base pacing and live credential resolution. */
274
+ /**
275
+ * Validated Airtable API client with per-base pacing and live credential resolution, shared by the operation
276
+ * Steps and the recordChanged Trigger. The constructor throws TypeError for an invalid endpoint, a
277
+ * non-positive maxResponseBytes, a pollIntervalMs under 1000, or a pollPageSize outside 1 to 100.
278
+ */
264
279
  declare class AirtableClient {
280
+ /** Delay between recordChanged polls of one binding, in milliseconds; at least 1000, 30000 by default. */ readonly pollIntervalMs: number;
281
+ /** Records one recordChanged poll request reads, 1 to 100, 100 by default. */ readonly pollPageSize: number;
282
+ /** The recordChanged Trigger logger from AirtableClientOptions, or undefined for the SDK default. */ readonly triggerLogger: TriggerLogger | undefined;
265
283
  private readonly endpoint;
266
284
  private readonly maxResponseBytes;
267
285
  private readonly credentials;
@@ -287,4 +305,174 @@ declare class AirtableClient {
287
305
  private failure;
288
306
  }
289
307
 
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 };
308
+ /**
309
+ * Open one static Airtable connection declared in a Dex project. options supply the recordChanged Trigger
310
+ * logger and test dependencies.
311
+ */
312
+ declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: AirtableClientOptions): Connection<Operations>;
313
+
314
+ /**
315
+ * Selects the table and Last modified time field a recordChanged binding polls. Dex Web saves it from the
316
+ * basePicker, tablePicker, and lastModifiedTimeFieldPicker units; the names are shown in Dex Web only, so a
317
+ * renamed base, table, or field keeps working. Field names match the Go connector.
318
+ */
319
+ interface RecordChangedTriggerConfiguration {
320
+ /** The base ID, such as appXXXXXXXXXXXXXX. Required. */ baseId: string;
321
+ /** The base name the picker showed; informational. */ baseName?: string;
322
+ /** The table ID, such as tblXXXXXXXXXXXXXX. Required. */ tableId: string;
323
+ /** The table name the picker showed; informational. */ tableName?: string;
324
+ /**
325
+ * The field ID, such as fldXXXXXXXXXXXXXX, of a Last modified time field of the table whose value includes
326
+ * a time of day. Required. The field's own setting decides which edits count as a change.
327
+ */
328
+ fieldId: string;
329
+ /** The field name the picker showed; informational. */ fieldName?: string;
330
+ }
331
+ /**
332
+ * One record created or changed after the last processed change of the polled table. Field names and values
333
+ * match the Go connector's JSON, so Go, Python, and TypeScript replicas share one inbox.
334
+ */
335
+ interface RecordChangedEvent {
336
+ /** The polled base ID. */ baseId: string;
337
+ /** The polled table ID. */ tableId: string;
338
+ /** The record's Last modified time value when the poll read it, as Go's RFC 3339 UTC text with up to nanoseconds. */ lastModifiedTime: string;
339
+ /** Whether the record's createdTime is within one second of lastModifiedTime: created and not edited since. */ isCreatedRecord: boolean;
340
+ /** The record as Airtable returned it, with fields keyed by field name. */ record: Record$1;
341
+ }
342
+ /** Decodes a saved binding configuration strictly, as Go does: unknown fields are refused, null is blank. */
343
+ declare const RecordChangedTriggerConfigurationSchema: z.ZodPipe<z.ZodObject<{
344
+ baseId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
345
+ baseName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
346
+ tableId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
347
+ tableName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
348
+ fieldId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
349
+ fieldName: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | undefined, string | null | undefined>>;
350
+ }, z.core.$strict>, z.ZodTransform<RecordChangedTriggerConfiguration, {
351
+ baseId: string;
352
+ baseName: string | undefined;
353
+ tableId: string;
354
+ tableName: string | undefined;
355
+ fieldId: string;
356
+ fieldName: string | undefined;
357
+ }>>;
358
+ /** Decodes a stored RecordChangedEvent as Go's json.Unmarshal does: unknown fields are ignored. */
359
+ declare const RecordChangedEventSchema: z.ZodPipe<z.ZodObject<{
360
+ baseId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
361
+ tableId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
362
+ lastModifiedTime: z.ZodString;
363
+ isCreatedRecord: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
364
+ record: z.ZodObject<{
365
+ id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
366
+ createdTime: z.ZodString;
367
+ fields: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, unknown> | null, Record<string, unknown> | null | undefined>>;
368
+ }, z.core.$strip>;
369
+ }, z.core.$strip>, z.ZodTransform<RecordChangedEvent, {
370
+ baseId: string;
371
+ tableId: string;
372
+ lastModifiedTime: string;
373
+ isCreatedRecord: boolean;
374
+ record: {
375
+ id: string;
376
+ createdTime: string;
377
+ fields: Record<string, unknown> | null;
378
+ };
379
+ }>>;
380
+
381
+ /**
382
+ * The recordChanged poll Trigger: each record of one picked table that is created or changed after the last
383
+ * processed change, as reported by a picked Last modified time field, on the Connector SDK's durable poll
384
+ * Trigger kit at parity with the Go connector. Cursor documents and event IDs match Go's byte for byte, so
385
+ * Go, Python, and TypeScript replicas share them. newProjectRecordChangedTriggerRunner is the durable path.
386
+ */
387
+
388
+ /** The base picker UI unit, which saves a base ID and name. */ declare const UIUnitBasePicker = "basePicker";
389
+ /** Base picker output port: the base ID. */ declare const UIBasePickerPortBaseID = "baseId";
390
+ /** Base picker output port: the base name. */ declare const UIBasePickerPortBaseName = "baseName";
391
+ /** The table picker UI unit, which saves a table ID and name. */ declare const UIUnitTablePicker = "tablePicker";
392
+ /** Table picker port: the base ID it lists tables of. */ declare const UITablePickerPortBaseID = "baseId";
393
+ /** Table picker output port: the table ID. */ declare const UITablePickerPortTableID = "tableId";
394
+ /** Table picker output port: the table name. */ declare const UITablePickerPortTableName = "tableName";
395
+ /** The UI unit that lists a table's Last modified time fields with a time of day. */ declare const UIUnitLastModifiedTimeFieldPicker = "lastModifiedTimeFieldPicker";
396
+ /** Field picker port: the base ID. */ declare const UILastModifiedTimeFieldPickerPortBaseID = "baseId";
397
+ /** Field picker port: the table ID. */ declare const UILastModifiedTimeFieldPickerPortTableID = "tableId";
398
+ /** Field picker output port: the field ID. */ declare const UILastModifiedTimeFieldPickerPortFieldID = "fieldId";
399
+ /** Field picker output port: the field name. */ declare const UILastModifiedTimeFieldPickerPortFieldName = "fieldName";
400
+ /** Manifest definition of recordChanged. */
401
+ declare const RecordChangedTriggerDefinition: TriggerDefinition;
402
+ /** One static application binding of recordChanged. */
403
+ interface RecordChangedTriggerBindingConfig {
404
+ /** Static connection name. */ connectionName: string;
405
+ /** Static binding name. */ bindingName: string;
406
+ /** Connector Studio configuration units, such as the base, table, and Last modified time field pickers. */ configurationUI?: ConnectorConfigurationUI;
407
+ }
408
+ /** Declare a static recordChanged binding for Flow Definition tooling and Dex Web. */
409
+ declare function defineRecordChangedTriggerBinding(config: RecordChangedTriggerBindingConfig): TriggerBindingDefinition;
410
+ /** Require the base, table, and Last modified time field IDs; throws TypeError naming the first invalid one. */
411
+ declare function validateRecordChangedTriggerConfiguration(configuration: RecordChangedTriggerConfiguration): void;
412
+ /** Decode a replayed recordChanged payload from a project Trigger inbox written by Go, Python, or TypeScript. */
413
+ declare function decodeRecordChangedEventPayload(_payloadJSON: string, payloadBytes: Uint8Array): RecordChangedEvent;
414
+ /** Binds one recordChanged binding's configuration and cursor to its application target. */
415
+ interface RecordChangedTriggerRoute {
416
+ /** Names the configured Trigger binding; it is unique within one runner. */ bindingName: string;
417
+ /** Selects the polled table and its Last modified time field. */ configuration: RecordChangedTriggerConfiguration;
418
+ /**
419
+ * Persists the binding's last processed change, normally LoadedProject.pollCursorStore. Use
420
+ * newMemoryCursorStore only when changes made while the process is stopped may be skipped.
421
+ */
422
+ cursor: CursorStore;
423
+ /**
424
+ * Receives each changed record. A target from newDurableTriggerTarget records it before the cursor moves
425
+ * past it; any other target consumes it first.
426
+ */
427
+ target: TriggerTarget<RecordChangedEvent>;
428
+ }
429
+ /** Configures every recordChanged binding of one Airtable connection. */
430
+ interface RecordChangedTriggerRunnerConfig {
431
+ /** A connection from newConnection with an AirtableClient, or newProjectConnection; its pollInterval and pollPageSize apply. */ connection: Connection;
432
+ /** Polled in this order whenever several are due; at least one is required. */ routes: readonly RecordChangedTriggerRoute[];
433
+ /** Optionally paces every poll request, for example to share Airtable's 50 requests per second per token. */ requestLimiter?: RequestLimiter;
434
+ }
435
+ /**
436
+ * Validate every route and build one poll runner for the connection; it sends and reads nothing. run replays
437
+ * each durable target; each binding then reads the base schema to find the Last modified time field's
438
+ * current name and seeds its cursor at the table's most recent change, so existing records never start
439
+ * Flows. Later polls list up to pollPageSize records modified since the cursor, oldest change first, and
440
+ * deliver each before the cursor commits. The cursor stores the latest delivered modification time and the
441
+ * records delivered in the five seconds before it, so a change that becomes visible slightly late is still
442
+ * delivered and a record is delivered once per change; a long scan resumes from its stored Airtable offset.
443
+ * A failed poll backs off up to five minutes, and HTTP 429 pauses every binding of the connection for at
444
+ * least Airtable's 30 seconds. Delivery is at least once, and each event ID is a pure function of the record
445
+ * ID and its modification time. Records go to the client's logger option. Throws TypeError for a connection
446
+ * without an AirtableClient, no routes, a blank or repeated binding name, a missing cursor or target, or an
447
+ * invalid configuration.
448
+ */
449
+ declare function newRecordChangedTriggerRunner(config: RecordChangedTriggerRunnerConfig): Runner;
450
+ /** Binds one recordChanged binding saved in the project configuration to its target. */
451
+ interface ProjectRecordChangedTriggerRoute {
452
+ /** Names the binding whose base, table, and field Dex Web saved. */ bindingName: string;
453
+ /** Receives each changed record after the binding's durable project inbox records it, usually newDexFlowTriggerTarget. */ target: TriggerTarget<RecordChangedEvent>;
454
+ }
455
+ /**
456
+ * Open connectionName from the loaded project, load each route's saved binding configuration, and build a
457
+ * durable runner: each binding's cursor lives in project storage beside its Trigger inbox, and every change
458
+ * is recorded in that inbox before the cursor commits past it, so a restarted or replaced replica neither
459
+ * misses nor replays a change. options.logger also applies to the inboxes. Under dexcli dev the poll cursor
460
+ * stays in process memory; hosted project storage keeps it. Throws for a missing target, a binding without a
461
+ * saved configuration, or an invalid configuration.
462
+ */
463
+ declare function newProjectRecordChangedTriggerRunner(project: LoadedProject, connectionName: string, routes: readonly ProjectRecordChangedTriggerRoute[], options?: AirtableClientOptions): Runner;
464
+ /** One recordChanged Trigger with its cursor in memory. */
465
+ interface RecordChangedTriggerConfig {
466
+ /** A connection from newConnection with an AirtableClient, or newProjectConnection. */ connection: Connection;
467
+ /** Static binding name. */ bindingName: string;
468
+ /** Selects the polled table and field. */ configuration: RecordChangedTriggerConfiguration;
469
+ /** Receives each changed record. */ target: TriggerTarget<RecordChangedEvent>;
470
+ }
471
+ /**
472
+ * Create one recordChanged binding's TriggerRunner with its cursor in process memory, so a restart seeds
473
+ * again and changes made while the process is stopped are not delivered; use it for tests and
474
+ * demonstrations, and newProjectRecordChangedTriggerRunner otherwise. Throws as newRecordChangedTriggerRunner does.
475
+ */
476
+ declare function newRecordChangedTrigger(config: RecordChangedTriggerConfig): TriggerRunner;
477
+
478
+ 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, type ProjectRecordChangedTriggerRoute, ProviderID, Record$1 as Record, type RecordChangedEvent, RecordChangedEventSchema, type RecordChangedTriggerBindingConfig, type RecordChangedTriggerConfig, type RecordChangedTriggerConfiguration, RecordChangedTriggerConfigurationSchema, RecordChangedTriggerDefinition, type RecordChangedTriggerRoute, type RecordChangedTriggerRunnerConfig, RecordPage, UIBasePickerPortBaseID, UIBasePickerPortBaseName, UILastModifiedTimeFieldPickerPortBaseID, UILastModifiedTimeFieldPickerPortFieldID, UILastModifiedTimeFieldPickerPortFieldName, UILastModifiedTimeFieldPickerPortTableID, UITablePickerPortBaseID, UITablePickerPortTableID, UITablePickerPortTableName, UIUnitBasePicker, UIUnitLastModifiedTimeFieldPicker, UIUnitTablePicker, 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, decodeRecordChangedEventPayload, defineRecordChangedTriggerBinding, newGetRecordStep, newListRecordsStep, newProjectConnection, newProjectRecordChangedTriggerRunner, newRecordChangedTrigger, newRecordChangedTriggerRunner, newUpdateRecordsStep, newUpsertRecordsStep, validateRecordChangedTriggerConfiguration };