@superdurable/connector-google-gmail 0.2.2 → 0.3.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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { M as Message, R as ReplyToMessageInput, S as SendMessageInput, C as Config, a as CredentialSource, b as Credentials, c as SendMessageOutput, G as GetMessageInput, d as GmailOperations, e as GmailConnection } from './connection-D8OV_Hfe.cjs';
2
2
  export { f as ConnectorID, g as GetMessageInputSchema, h as GoogleOAuthAuthMethodID, i as MessageSchema, P as ProviderID, j as ReplyToMessageInputSchema, k as SendMessageInputSchema, l as SendMessageOutputSchema, W as WorkspaceDomainDelegationAuthMethodID } from './connection-D8OV_Hfe.cjs';
3
3
  import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
4
- import { QueryDefinition, MutationDefinition, CredentialRefreshDriver, Call, FailureKind, CredentialRefreshState, CredentialRefreshResult, Mutation, MutationAttempt, Query, QueryAttempt, Failure, ReceiptDraft, QueryStepConfig, QueryResult, MutationStepConfig, MutationResult, QueryStep, MutationStep } from '@superdurable/connectors-sdk';
4
+ import { QueryDefinition, MutationDefinition, CredentialRefreshDriver, Call, FailureKind, CredentialRefreshState, CredentialRefreshResult, Mutation, MutationAttempt, Query, QueryAttempt, TriggerLogger, Failure, ReceiptDraft, QueryStepConfig, QueryResult, MutationStepConfig, MutationResult, QueryStep, MutationStep, ConnectionRef, TriggerContext, TriggerTarget, ConnectorConfigurationUI, TriggerDefinition, TriggerBindingDefinition, TriggerRunner } from '@superdurable/connectors-sdk';
5
5
  import { z } from 'zod';
6
6
  import { ProviderRequest, ProviderResponse, AddressPolicy } from '@superdurable/connectors-sdk/providerhttp';
7
7
  import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
@@ -99,6 +99,8 @@ interface GmailClientSettings {
99
99
  /** Maximum complete response bytes. */ readonly maxResponseBytes: number;
100
100
  /** Maximum encoded MIME message bytes. */ readonly maxMessageBytes: number;
101
101
  /** Address policy for the configured endpoint. */ readonly addressPolicy: AddressPolicy;
102
+ /** Delay between Trigger polls in milliseconds. */ readonly pollIntervalMs: number;
103
+ /** Recent inbox messages inspected per Trigger poll. */ readonly pollPageSize: number;
102
104
  }
103
105
  /** Apply and validate the Gmail manifest's transport defaults. */
104
106
  declare function gmailClientSettings(config?: Config): GmailClientSettings;
@@ -128,6 +130,11 @@ declare function gmailRetryAfterMs(headers: Record<string, string | string[] | u
128
130
  /** Read the safe Gmail request correlation ID. */
129
131
  declare function gmailRequestID(headers: Record<string, string | string[] | undefined>): string;
130
132
 
133
+ /** One message reference in an inbox listing, newest first as Gmail lists it. */
134
+ interface GmailMessageReference {
135
+ /** Gmail message ID; empty when Gmail omitted it. */ id: string;
136
+ /** Gmail thread ID; empty when Gmail omitted it. */ threadId: string;
137
+ }
131
138
  /** Provider identity returned by a Gmail send or Sent Mail lookup. */
132
139
  interface SentMessageIdentity {
133
140
  /** Gmail message ID. */ id: string;
@@ -146,6 +153,14 @@ declare class GmailProvider {
146
153
  constructor(http: GmailHTTPClient);
147
154
  /** Read one full or metadata message, returning the raw response on refusal or malformed JSON. */
148
155
  readMessage(call: Call, credentials: Credentials, messageId: string, format: 'full' | 'metadata' | 'minimal', signal?: AbortSignal): Promise<GmailReadResult>;
156
+ /**
157
+ * List the newest inbox page that matches searchQuery, as the Go Trigger poller does. It rejects with
158
+ * an error that names no query value when Gmail does not answer 2xx with a usable listing.
159
+ */
160
+ listInboxMessages(call: Call, credentials: Credentials, searchQuery: string, pageSize: number, signal?: AbortSignal): Promise<{
161
+ messages: GmailMessageReference[];
162
+ credentials: Credentials;
163
+ }>;
149
164
  /** Search Sent Mail once for the run-specific RFC Message-ID. */
150
165
  findSentMessage(call: Call, credentials: Credentials, messageIdAddress: string, signal?: AbortSignal): Promise<SentMessageIdentity | undefined>;
151
166
  /** Post one encoded Gmail messages.send request without redirects or transport replay. */
@@ -174,7 +189,7 @@ declare class SendMessageOperation implements Mutation<SendMessageInput, SendMes
174
189
  /** Inject the provider sender used by each Dex attempt. */
175
190
  constructor(sender: GmailSender);
176
191
  /** Return the immutable manifest operation definition. */
177
- definition(): _superdurable_connectors_sdk.QueryDefinition;
192
+ definition(): _superdurable_connectors_sdk.MutationDefinition;
178
193
  /** Use the stable connector Call ID as the send correlation key. */
179
194
  idempotencyKey(callId: string, input: SendMessageInput): string;
180
195
  /** Classify a send using Dex's public current-attempt deadline. */
@@ -186,7 +201,7 @@ declare class ReplyToMessageOperation implements Mutation<ReplyToMessageInput, S
186
201
  /** Inject the provider sender used by each Dex attempt. */
187
202
  constructor(sender: GmailSender);
188
203
  /** Return the immutable manifest operation definition. */
189
- definition(): _superdurable_connectors_sdk.QueryDefinition;
204
+ definition(): _superdurable_connectors_sdk.MutationDefinition;
190
205
  /** Use the stable connector Call ID as the reply correlation key. */
191
206
  idempotencyKey(callId: string, input: ReplyToMessageInput): string;
192
207
  /** Classify a reply using Dex's public current-attempt deadline. */
@@ -211,12 +226,25 @@ interface GmailClientOptions {
211
226
  transport?: GmailTransport;
212
227
  /** Observation clock for receipts. */
213
228
  now?: () => Date;
229
+ /**
230
+ * Receives the Trigger pollers' records: failed polls, ignored and skipped messages, delivery retries,
231
+ * and the durable inboxes that newProjectMessageTriggerRunner creates. Omitted uses
232
+ * defaultTriggerLogger. Records carry message and thread IDs, never senders, subjects, snippets,
233
+ * bodies, or tokens.
234
+ */
235
+ logger?: TriggerLogger;
214
236
  }
215
237
  /** Gmail connection with operation-specific provider interfaces. */
216
238
  declare class GmailClient implements GmailOperations {
217
239
  #private;
240
+ /** Trigger record destination. */ readonly triggerLogger: TriggerLogger;
218
241
  /** Validate settings and inject a host-owned credential source. */
219
242
  constructor(config: Config, credentials: CredentialSource, options?: GmailClientOptions);
243
+ /** @internal The authenticated transport and provider methods that the Trigger pollers share. */
244
+ triggerTransport(): {
245
+ http: GmailHTTPClient;
246
+ provider: GmailProvider;
247
+ };
220
248
  /** Return the getMessage Query bound to this connection. */
221
249
  getMessage(): GetMessageOperation;
222
250
  /** Return the sendMessage Mutation bound to this connection. */
@@ -280,4 +308,180 @@ declare function newSendMessageStep<StepInput>(configuration: SendMessageStepCon
280
308
  /** Build a Gmail reply Step with its typed connection. */
281
309
  declare function newReplyToMessageStep<StepInput>(configuration: ReplyToMessageStepConfig<StepInput>): MutationStep<StepInput, ReplyToMessageInput, SendMessageOutput>;
282
310
 
283
- export { Config, CredentialSource, Credentials, GetMessageBranch, GetMessageDefinition, GetMessageInput, GetMessageOperation, type GetMessageStepConfig, GmailClient, type GmailClientOptions, type GmailClientSettings, GmailConnection, GmailCredentialError, GmailCredentialRefreshDriver, GmailHTTPClient, type GmailMessagePart, type GmailMessageResource, GmailMessageResourceSchema, GmailOperations, GmailProvider, type GmailReadResult, type GmailTransport, Message, ReplyToMessageBranch, ReplyToMessageDefinition, ReplyToMessageInput, ReplyToMessageOperation, type ReplyToMessageStepConfig, SendMessageBranch, SendMessageDefinition, SendMessageInput, SendMessageOperation, SendMessageOutput, type SendMessageStepConfig, type SentMessageIdentity, buildMIMEMessage, buildReplyMIMEMessage, decodeGmailMessage, emptyMessage, gmailClientSettings, gmailFailure, gmailRequestID, gmailRetryAfterMs, newGetMessageStep, newProjectConnection, newProjectGmailClient, newReplyToMessageStep, newSendMessageStep, parseMailbox, parseSentResponse, receiptFor, replyRecipient, rfcMessageIDAddress, statusFailureKind, validateSendInput };
311
+ /** One poller's source and the target it delivers to. */
312
+ interface MessageTriggerRoute {
313
+ source: MessagePollingTriggerSource;
314
+ target: TriggerTarget<MessageEvent>;
315
+ }
316
+ /** One inbox list call, delivered later by MessagePollingTriggerSource.deliver. */
317
+ interface MessageListing {
318
+ credentials: Credentials;
319
+ messages: GmailMessageReference[];
320
+ }
321
+ /**
322
+ * Polls one Gmail binding: it lists the newest inbox page, reads each new message's metadata, and
323
+ * delivers matching roots or replies oldest first, as the Go connector's poller does. The delivered set
324
+ * covers the last listed page in memory; a restart rescans the page, and the Flow start request ID and
325
+ * the application's RPC absorb the duplicates.
326
+ */
327
+ declare class MessagePollingTriggerSource {
328
+ #private;
329
+ /** Bind one binding's query and matcher; an empty bindingName omits the binding log attribute. */
330
+ constructor(client: GmailClient, connection: ConnectionRef, triggerName: string, bindingName: string, searchQuery: string, matcher: MessageMatcher, requiresReply: boolean);
331
+ /** Scan, then wait one poll interval, until the context ends. */
332
+ run(context: TriggerContext, target: TriggerTarget<MessageEvent>): Promise<void>;
333
+ /** List the inbox and deliver the listed messages. */
334
+ scan(context: TriggerContext, target: TriggerTarget<MessageEvent>): Promise<void>;
335
+ /** Read the newest inbox page that matches the source's search query. */
336
+ list(context: TriggerContext): Promise<MessageListing>;
337
+ /**
338
+ * Hand target the event that failed on an earlier poll, if any, then every new matching message in
339
+ * listing, oldest first. It stops at the first failure, so the next poll retries that event before any
340
+ * later message, even after newer mail pushes it off the listed page.
341
+ */
342
+ deliver(context: TriggerContext, target: TriggerTarget<MessageEvent>, listing: MessageListing): Promise<void>;
343
+ }
344
+
345
+ /** Filters received Gmail messages by sender and text. */
346
+ declare const MessageMatcherSchema: z.ZodObject<{
347
+ messageContains: z.ZodOptional<z.ZodString>;
348
+ senderEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
349
+ }, z.core.$strict>;
350
+ /** Sender and text filter of one Gmail message Trigger binding. */
351
+ type MessageMatcher = z.infer<typeof MessageMatcherSchema>;
352
+ /** Configuration of messageReceived: an optional Gmail search query and the root-message matcher. */
353
+ declare const MessageReceivedTriggerConfigurationSchema: z.ZodObject<{
354
+ searchQuery: z.ZodOptional<z.ZodString>;
355
+ messageMatcher: z.ZodOptional<z.ZodObject<{
356
+ messageContains: z.ZodOptional<z.ZodString>;
357
+ senderEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
358
+ }, z.core.$strict>>;
359
+ }, z.core.$strict>;
360
+ /** Search query and root-message matcher of one messageReceived binding. */
361
+ type MessageReceivedTriggerConfiguration = z.infer<typeof MessageReceivedTriggerConfigurationSchema>;
362
+ /** Configuration of replyReceived: an optional Gmail search query and the reply matcher. */
363
+ declare const ReplyReceivedTriggerConfigurationSchema: z.ZodObject<{
364
+ searchQuery: z.ZodOptional<z.ZodString>;
365
+ replyMatcher: z.ZodOptional<z.ZodObject<{
366
+ messageContains: z.ZodOptional<z.ZodString>;
367
+ senderEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
368
+ }, z.core.$strict>>;
369
+ }, z.core.$strict>;
370
+ /** Search query and reply matcher of one replyReceived binding. */
371
+ type ReplyReceivedTriggerConfiguration = z.infer<typeof ReplyReceivedTriggerConfigurationSchema>;
372
+ /** The metadata-only payload of both Gmail Triggers; field names and order match the Go connector. */
373
+ declare const MessageEventSchema: z.ZodObject<{
374
+ primaryEmail: z.ZodString;
375
+ messageId: z.ZodString;
376
+ threadId: z.ZodString;
377
+ from: z.ZodString;
378
+ subject: z.ZodString;
379
+ snippet: z.ZodOptional<z.ZodString>;
380
+ receivedAt: z.ZodString;
381
+ isReply: z.ZodBoolean;
382
+ }, z.core.$strip>;
383
+ /** One received Gmail message. */
384
+ type MessageEvent = z.infer<typeof MessageEventSchema>;
385
+ /** Manifest definition of messageReceived. */
386
+ declare const MessageReceivedTriggerDefinition: TriggerDefinition;
387
+ /** Manifest definition of replyReceived. */
388
+ declare const ReplyReceivedTriggerDefinition: TriggerDefinition;
389
+ /** Gmail search query input UI unit. */ declare const UIUnitSearchQueryInput = "searchQueryInput";
390
+ /** Search query input output port. */ declare const UISearchQueryInputPortQuery = "query";
391
+ /** Email address list input UI unit. */ declare const UIUnitEmailListInput = "emailListInput";
392
+ /** Email list input output port. */ declare const UIEmailListInputPortEmails = "emails";
393
+ /** Plain text input UI unit. */ declare const UIUnitTextInput = "textInput";
394
+ /** Text input output port. */ declare const UITextInputPortText = "text";
395
+ /** One static application binding of a Gmail message Trigger. */
396
+ interface GmailTriggerBindingConfig {
397
+ /** Static connection name. */ connectionName: string;
398
+ /** Static binding name. */ bindingName: string;
399
+ /** Connector Studio configuration units for the binding. */ configurationUI: ConnectorConfigurationUI;
400
+ }
401
+ /** Declare a static messageReceived binding for Flow Definition tooling and Dex Web. */
402
+ declare function defineMessageReceivedTriggerBinding(config: GmailTriggerBindingConfig): TriggerBindingDefinition;
403
+ /** Declare a static replyReceived binding for Flow Definition tooling and Dex Web. */
404
+ declare function defineReplyReceivedTriggerBinding(config: GmailTriggerBindingConfig): TriggerBindingDefinition;
405
+ /** Configuration of one standalone Gmail message Trigger. */
406
+ interface GmailMessageTriggerConfig<Configuration> {
407
+ /** Gmail connection bound to a GmailClient. */ connection: GmailConnection;
408
+ /** Static connection name; must equal the connection's name. */ connectionName: string;
409
+ /** Static binding name. */ bindingName: string;
410
+ /** Search query and matcher. */ configuration: Configuration;
411
+ /** Routes accepted events into the application. */ target: TriggerTarget<MessageEvent>;
412
+ }
413
+ /**
414
+ * Create one messageReceived Trigger that polls on its own. Prefer one MessageTriggerRunner per
415
+ * connection, which delivers every root before any reply.
416
+ */
417
+ declare function newMessageReceivedTrigger(config: GmailMessageTriggerConfig<MessageReceivedTriggerConfiguration>): TriggerRunner;
418
+ /**
419
+ * Create one replyReceived Trigger that polls on its own. Prefer one MessageTriggerRunner per
420
+ * connection, which delivers every root before any reply.
421
+ */
422
+ declare function newReplyReceivedTrigger(config: GmailMessageTriggerConfig<ReplyReceivedTriggerConfiguration>): TriggerRunner;
423
+ /** One root-message binding and its application target. */
424
+ interface MessageReceivedTriggerRoute {
425
+ /** Configured binding name. */ bindingName: string;
426
+ /** Search query and root-message matcher. */ configuration: MessageReceivedTriggerConfiguration;
427
+ /** Routes accepted events into the application. */ target: TriggerTarget<MessageEvent>;
428
+ }
429
+ /** One reply binding and its application target. */
430
+ interface ReplyReceivedTriggerRoute {
431
+ /** Configured binding name. */ bindingName: string;
432
+ /** Search query and reply matcher. */ configuration: ReplyReceivedTriggerConfiguration;
433
+ /** Routes accepted events into the application. */ target: TriggerTarget<MessageEvent>;
434
+ }
435
+ /** Gmail message Triggers that share one ordered poller. */
436
+ interface MessageTriggerRunnerConfig {
437
+ /** Gmail connection bound to a GmailClient. */ connection: GmailConnection;
438
+ /** Root-message bindings. */ messageReceivedRoutes?: readonly MessageReceivedTriggerRoute[];
439
+ /** Reply bindings. */ replyReceivedRoutes?: readonly ReplyReceivedTriggerRoute[];
440
+ }
441
+ /** One root-message binding saved in the project configuration and its application target. */
442
+ interface ProjectMessageReceivedTriggerRoute {
443
+ bindingName: string; /** Application target. */
444
+ target: TriggerTarget<MessageEvent>;
445
+ }
446
+ /** One reply binding saved in the project configuration and its application target. */
447
+ interface ProjectReplyReceivedTriggerRoute {
448
+ bindingName: string; /** Application target. */
449
+ target: TriggerTarget<MessageEvent>;
450
+ }
451
+ /** Gmail message Trigger bindings selected from the project configuration. */
452
+ interface ProjectMessageTriggerRunnerConfig {
453
+ /** Root-message bindings. */ messageReceivedRoutes?: readonly ProjectMessageReceivedTriggerRoute[];
454
+ /** Reply bindings. */ replyReceivedRoutes?: readonly ProjectReplyReceivedTriggerRoute[];
455
+ }
456
+ /** Polls every configured Gmail route of one connection and delivers root messages before replies. */
457
+ declare class MessageTriggerRunner {
458
+ #private;
459
+ /** @internal Use newMessageTriggerRunner or newProjectMessageTriggerRunner. */
460
+ constructor(rootRoutes: readonly MessageTriggerRoute[], replyRoutes: readonly MessageTriggerRoute[], pollIntervalMs: number);
461
+ /**
462
+ * Replay each route's durable inbox in order, roots first, then poll until the context ends. Each poll
463
+ * lists every reply route before any root route, then delivers every root before any reply, and ends
464
+ * at the first failure. Every later poll retries the failed event before that route's listed messages,
465
+ * even after Gmail stops listing it. Gmail receives a thread's root before any reply to it, so the
466
+ * root of every listed reply is in the later root listing and reaches Dex first.
467
+ *
468
+ * It logs through the client's logger: WARN "gmail poll failed; retrying" with the consecutive failed
469
+ * polls as attempt and the poll interval as delay_ms when a list or read fails, WARN "trigger delivery
470
+ * failed; retrying" with the attempt number when a target fails, INFO "trigger delivered after retry"
471
+ * when a later poll delivers that message, DEBUG "trigger event ignored" with its reason, and the
472
+ * durable inbox records. It rejects with TriggerDeliveryAbortedError once the context ends, and when
473
+ * an inbox replay fails.
474
+ */
475
+ run(context: TriggerContext): Promise<void>;
476
+ }
477
+ /** Create one ordered runner for every configured Gmail message Trigger route of a connection; throws on invalid wiring. */
478
+ declare function newMessageTriggerRunner(config: MessageTriggerRunnerConfig): MessageTriggerRunner;
479
+ /**
480
+ * Open connectionName from the loaded project, load the selected bindings' saved configuration, and
481
+ * create one durable, ordered runner. Each route keeps acknowledged events in its binding's project
482
+ * Trigger inbox until its target consumes them, so a restarted or replaced replica replays them. A
483
+ * route whose binding is not configured throws. The options' logger also applies to those inboxes.
484
+ */
485
+ declare function newProjectMessageTriggerRunner(project: LoadedProject, connectionName: string, config: ProjectMessageTriggerRunnerConfig, options?: GmailClientOptions): MessageTriggerRunner;
486
+
487
+ export { Config, CredentialSource, Credentials, GetMessageBranch, GetMessageDefinition, GetMessageInput, GetMessageOperation, type GetMessageStepConfig, GmailClient, type GmailClientOptions, type GmailClientSettings, GmailConnection, GmailCredentialError, GmailCredentialRefreshDriver, GmailHTTPClient, type GmailMessagePart, type GmailMessageReference, type GmailMessageResource, GmailMessageResourceSchema, type GmailMessageTriggerConfig, GmailOperations, GmailProvider, type GmailReadResult, type GmailTransport, type GmailTriggerBindingConfig, Message, type MessageEvent, MessageEventSchema, type MessageMatcher, MessageMatcherSchema, type MessageReceivedTriggerConfiguration, MessageReceivedTriggerConfigurationSchema, MessageReceivedTriggerDefinition, type MessageReceivedTriggerRoute, MessageTriggerRunner, type MessageTriggerRunnerConfig, type ProjectMessageReceivedTriggerRoute, type ProjectMessageTriggerRunnerConfig, type ProjectReplyReceivedTriggerRoute, type ReplyReceivedTriggerConfiguration, ReplyReceivedTriggerConfigurationSchema, ReplyReceivedTriggerDefinition, type ReplyReceivedTriggerRoute, ReplyToMessageBranch, ReplyToMessageDefinition, ReplyToMessageInput, ReplyToMessageOperation, type ReplyToMessageStepConfig, SendMessageBranch, SendMessageDefinition, SendMessageInput, SendMessageOperation, SendMessageOutput, type SendMessageStepConfig, type SentMessageIdentity, UIEmailListInputPortEmails, UISearchQueryInputPortQuery, UITextInputPortText, UIUnitEmailListInput, UIUnitSearchQueryInput, UIUnitTextInput, buildMIMEMessage, buildReplyMIMEMessage, decodeGmailMessage, defineMessageReceivedTriggerBinding, defineReplyReceivedTriggerBinding, emptyMessage, gmailClientSettings, gmailFailure, gmailRequestID, gmailRetryAfterMs, newGetMessageStep, newMessageReceivedTrigger, newMessageTriggerRunner, newProjectConnection, newProjectGmailClient, newProjectMessageTriggerRunner, newReplyReceivedTrigger, newReplyToMessageStep, newSendMessageStep, parseMailbox, parseSentResponse, receiptFor, replyRecipient, rfcMessageIDAddress, statusFailureKind, validateSendInput };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { M as Message, R as ReplyToMessageInput, S as SendMessageInput, C as Config, a as CredentialSource, b as Credentials, c as SendMessageOutput, G as GetMessageInput, d as GmailOperations, e as GmailConnection } from './connection-D8OV_Hfe.js';
2
2
  export { f as ConnectorID, g as GetMessageInputSchema, h as GoogleOAuthAuthMethodID, i as MessageSchema, P as ProviderID, j as ReplyToMessageInputSchema, k as SendMessageInputSchema, l as SendMessageOutputSchema, W as WorkspaceDomainDelegationAuthMethodID } from './connection-D8OV_Hfe.js';
3
3
  import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
4
- import { QueryDefinition, MutationDefinition, CredentialRefreshDriver, Call, FailureKind, CredentialRefreshState, CredentialRefreshResult, Mutation, MutationAttempt, Query, QueryAttempt, Failure, ReceiptDraft, QueryStepConfig, QueryResult, MutationStepConfig, MutationResult, QueryStep, MutationStep } from '@superdurable/connectors-sdk';
4
+ import { QueryDefinition, MutationDefinition, CredentialRefreshDriver, Call, FailureKind, CredentialRefreshState, CredentialRefreshResult, Mutation, MutationAttempt, Query, QueryAttempt, TriggerLogger, Failure, ReceiptDraft, QueryStepConfig, QueryResult, MutationStepConfig, MutationResult, QueryStep, MutationStep, ConnectionRef, TriggerContext, TriggerTarget, ConnectorConfigurationUI, TriggerDefinition, TriggerBindingDefinition, TriggerRunner } from '@superdurable/connectors-sdk';
5
5
  import { z } from 'zod';
6
6
  import { ProviderRequest, ProviderResponse, AddressPolicy } from '@superdurable/connectors-sdk/providerhttp';
7
7
  import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
@@ -99,6 +99,8 @@ interface GmailClientSettings {
99
99
  /** Maximum complete response bytes. */ readonly maxResponseBytes: number;
100
100
  /** Maximum encoded MIME message bytes. */ readonly maxMessageBytes: number;
101
101
  /** Address policy for the configured endpoint. */ readonly addressPolicy: AddressPolicy;
102
+ /** Delay between Trigger polls in milliseconds. */ readonly pollIntervalMs: number;
103
+ /** Recent inbox messages inspected per Trigger poll. */ readonly pollPageSize: number;
102
104
  }
103
105
  /** Apply and validate the Gmail manifest's transport defaults. */
104
106
  declare function gmailClientSettings(config?: Config): GmailClientSettings;
@@ -128,6 +130,11 @@ declare function gmailRetryAfterMs(headers: Record<string, string | string[] | u
128
130
  /** Read the safe Gmail request correlation ID. */
129
131
  declare function gmailRequestID(headers: Record<string, string | string[] | undefined>): string;
130
132
 
133
+ /** One message reference in an inbox listing, newest first as Gmail lists it. */
134
+ interface GmailMessageReference {
135
+ /** Gmail message ID; empty when Gmail omitted it. */ id: string;
136
+ /** Gmail thread ID; empty when Gmail omitted it. */ threadId: string;
137
+ }
131
138
  /** Provider identity returned by a Gmail send or Sent Mail lookup. */
132
139
  interface SentMessageIdentity {
133
140
  /** Gmail message ID. */ id: string;
@@ -146,6 +153,14 @@ declare class GmailProvider {
146
153
  constructor(http: GmailHTTPClient);
147
154
  /** Read one full or metadata message, returning the raw response on refusal or malformed JSON. */
148
155
  readMessage(call: Call, credentials: Credentials, messageId: string, format: 'full' | 'metadata' | 'minimal', signal?: AbortSignal): Promise<GmailReadResult>;
156
+ /**
157
+ * List the newest inbox page that matches searchQuery, as the Go Trigger poller does. It rejects with
158
+ * an error that names no query value when Gmail does not answer 2xx with a usable listing.
159
+ */
160
+ listInboxMessages(call: Call, credentials: Credentials, searchQuery: string, pageSize: number, signal?: AbortSignal): Promise<{
161
+ messages: GmailMessageReference[];
162
+ credentials: Credentials;
163
+ }>;
149
164
  /** Search Sent Mail once for the run-specific RFC Message-ID. */
150
165
  findSentMessage(call: Call, credentials: Credentials, messageIdAddress: string, signal?: AbortSignal): Promise<SentMessageIdentity | undefined>;
151
166
  /** Post one encoded Gmail messages.send request without redirects or transport replay. */
@@ -174,7 +189,7 @@ declare class SendMessageOperation implements Mutation<SendMessageInput, SendMes
174
189
  /** Inject the provider sender used by each Dex attempt. */
175
190
  constructor(sender: GmailSender);
176
191
  /** Return the immutable manifest operation definition. */
177
- definition(): _superdurable_connectors_sdk.QueryDefinition;
192
+ definition(): _superdurable_connectors_sdk.MutationDefinition;
178
193
  /** Use the stable connector Call ID as the send correlation key. */
179
194
  idempotencyKey(callId: string, input: SendMessageInput): string;
180
195
  /** Classify a send using Dex's public current-attempt deadline. */
@@ -186,7 +201,7 @@ declare class ReplyToMessageOperation implements Mutation<ReplyToMessageInput, S
186
201
  /** Inject the provider sender used by each Dex attempt. */
187
202
  constructor(sender: GmailSender);
188
203
  /** Return the immutable manifest operation definition. */
189
- definition(): _superdurable_connectors_sdk.QueryDefinition;
204
+ definition(): _superdurable_connectors_sdk.MutationDefinition;
190
205
  /** Use the stable connector Call ID as the reply correlation key. */
191
206
  idempotencyKey(callId: string, input: ReplyToMessageInput): string;
192
207
  /** Classify a reply using Dex's public current-attempt deadline. */
@@ -211,12 +226,25 @@ interface GmailClientOptions {
211
226
  transport?: GmailTransport;
212
227
  /** Observation clock for receipts. */
213
228
  now?: () => Date;
229
+ /**
230
+ * Receives the Trigger pollers' records: failed polls, ignored and skipped messages, delivery retries,
231
+ * and the durable inboxes that newProjectMessageTriggerRunner creates. Omitted uses
232
+ * defaultTriggerLogger. Records carry message and thread IDs, never senders, subjects, snippets,
233
+ * bodies, or tokens.
234
+ */
235
+ logger?: TriggerLogger;
214
236
  }
215
237
  /** Gmail connection with operation-specific provider interfaces. */
216
238
  declare class GmailClient implements GmailOperations {
217
239
  #private;
240
+ /** Trigger record destination. */ readonly triggerLogger: TriggerLogger;
218
241
  /** Validate settings and inject a host-owned credential source. */
219
242
  constructor(config: Config, credentials: CredentialSource, options?: GmailClientOptions);
243
+ /** @internal The authenticated transport and provider methods that the Trigger pollers share. */
244
+ triggerTransport(): {
245
+ http: GmailHTTPClient;
246
+ provider: GmailProvider;
247
+ };
220
248
  /** Return the getMessage Query bound to this connection. */
221
249
  getMessage(): GetMessageOperation;
222
250
  /** Return the sendMessage Mutation bound to this connection. */
@@ -280,4 +308,180 @@ declare function newSendMessageStep<StepInput>(configuration: SendMessageStepCon
280
308
  /** Build a Gmail reply Step with its typed connection. */
281
309
  declare function newReplyToMessageStep<StepInput>(configuration: ReplyToMessageStepConfig<StepInput>): MutationStep<StepInput, ReplyToMessageInput, SendMessageOutput>;
282
310
 
283
- export { Config, CredentialSource, Credentials, GetMessageBranch, GetMessageDefinition, GetMessageInput, GetMessageOperation, type GetMessageStepConfig, GmailClient, type GmailClientOptions, type GmailClientSettings, GmailConnection, GmailCredentialError, GmailCredentialRefreshDriver, GmailHTTPClient, type GmailMessagePart, type GmailMessageResource, GmailMessageResourceSchema, GmailOperations, GmailProvider, type GmailReadResult, type GmailTransport, Message, ReplyToMessageBranch, ReplyToMessageDefinition, ReplyToMessageInput, ReplyToMessageOperation, type ReplyToMessageStepConfig, SendMessageBranch, SendMessageDefinition, SendMessageInput, SendMessageOperation, SendMessageOutput, type SendMessageStepConfig, type SentMessageIdentity, buildMIMEMessage, buildReplyMIMEMessage, decodeGmailMessage, emptyMessage, gmailClientSettings, gmailFailure, gmailRequestID, gmailRetryAfterMs, newGetMessageStep, newProjectConnection, newProjectGmailClient, newReplyToMessageStep, newSendMessageStep, parseMailbox, parseSentResponse, receiptFor, replyRecipient, rfcMessageIDAddress, statusFailureKind, validateSendInput };
311
+ /** One poller's source and the target it delivers to. */
312
+ interface MessageTriggerRoute {
313
+ source: MessagePollingTriggerSource;
314
+ target: TriggerTarget<MessageEvent>;
315
+ }
316
+ /** One inbox list call, delivered later by MessagePollingTriggerSource.deliver. */
317
+ interface MessageListing {
318
+ credentials: Credentials;
319
+ messages: GmailMessageReference[];
320
+ }
321
+ /**
322
+ * Polls one Gmail binding: it lists the newest inbox page, reads each new message's metadata, and
323
+ * delivers matching roots or replies oldest first, as the Go connector's poller does. The delivered set
324
+ * covers the last listed page in memory; a restart rescans the page, and the Flow start request ID and
325
+ * the application's RPC absorb the duplicates.
326
+ */
327
+ declare class MessagePollingTriggerSource {
328
+ #private;
329
+ /** Bind one binding's query and matcher; an empty bindingName omits the binding log attribute. */
330
+ constructor(client: GmailClient, connection: ConnectionRef, triggerName: string, bindingName: string, searchQuery: string, matcher: MessageMatcher, requiresReply: boolean);
331
+ /** Scan, then wait one poll interval, until the context ends. */
332
+ run(context: TriggerContext, target: TriggerTarget<MessageEvent>): Promise<void>;
333
+ /** List the inbox and deliver the listed messages. */
334
+ scan(context: TriggerContext, target: TriggerTarget<MessageEvent>): Promise<void>;
335
+ /** Read the newest inbox page that matches the source's search query. */
336
+ list(context: TriggerContext): Promise<MessageListing>;
337
+ /**
338
+ * Hand target the event that failed on an earlier poll, if any, then every new matching message in
339
+ * listing, oldest first. It stops at the first failure, so the next poll retries that event before any
340
+ * later message, even after newer mail pushes it off the listed page.
341
+ */
342
+ deliver(context: TriggerContext, target: TriggerTarget<MessageEvent>, listing: MessageListing): Promise<void>;
343
+ }
344
+
345
+ /** Filters received Gmail messages by sender and text. */
346
+ declare const MessageMatcherSchema: z.ZodObject<{
347
+ messageContains: z.ZodOptional<z.ZodString>;
348
+ senderEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
349
+ }, z.core.$strict>;
350
+ /** Sender and text filter of one Gmail message Trigger binding. */
351
+ type MessageMatcher = z.infer<typeof MessageMatcherSchema>;
352
+ /** Configuration of messageReceived: an optional Gmail search query and the root-message matcher. */
353
+ declare const MessageReceivedTriggerConfigurationSchema: z.ZodObject<{
354
+ searchQuery: z.ZodOptional<z.ZodString>;
355
+ messageMatcher: z.ZodOptional<z.ZodObject<{
356
+ messageContains: z.ZodOptional<z.ZodString>;
357
+ senderEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
358
+ }, z.core.$strict>>;
359
+ }, z.core.$strict>;
360
+ /** Search query and root-message matcher of one messageReceived binding. */
361
+ type MessageReceivedTriggerConfiguration = z.infer<typeof MessageReceivedTriggerConfigurationSchema>;
362
+ /** Configuration of replyReceived: an optional Gmail search query and the reply matcher. */
363
+ declare const ReplyReceivedTriggerConfigurationSchema: z.ZodObject<{
364
+ searchQuery: z.ZodOptional<z.ZodString>;
365
+ replyMatcher: z.ZodOptional<z.ZodObject<{
366
+ messageContains: z.ZodOptional<z.ZodString>;
367
+ senderEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
368
+ }, z.core.$strict>>;
369
+ }, z.core.$strict>;
370
+ /** Search query and reply matcher of one replyReceived binding. */
371
+ type ReplyReceivedTriggerConfiguration = z.infer<typeof ReplyReceivedTriggerConfigurationSchema>;
372
+ /** The metadata-only payload of both Gmail Triggers; field names and order match the Go connector. */
373
+ declare const MessageEventSchema: z.ZodObject<{
374
+ primaryEmail: z.ZodString;
375
+ messageId: z.ZodString;
376
+ threadId: z.ZodString;
377
+ from: z.ZodString;
378
+ subject: z.ZodString;
379
+ snippet: z.ZodOptional<z.ZodString>;
380
+ receivedAt: z.ZodString;
381
+ isReply: z.ZodBoolean;
382
+ }, z.core.$strip>;
383
+ /** One received Gmail message. */
384
+ type MessageEvent = z.infer<typeof MessageEventSchema>;
385
+ /** Manifest definition of messageReceived. */
386
+ declare const MessageReceivedTriggerDefinition: TriggerDefinition;
387
+ /** Manifest definition of replyReceived. */
388
+ declare const ReplyReceivedTriggerDefinition: TriggerDefinition;
389
+ /** Gmail search query input UI unit. */ declare const UIUnitSearchQueryInput = "searchQueryInput";
390
+ /** Search query input output port. */ declare const UISearchQueryInputPortQuery = "query";
391
+ /** Email address list input UI unit. */ declare const UIUnitEmailListInput = "emailListInput";
392
+ /** Email list input output port. */ declare const UIEmailListInputPortEmails = "emails";
393
+ /** Plain text input UI unit. */ declare const UIUnitTextInput = "textInput";
394
+ /** Text input output port. */ declare const UITextInputPortText = "text";
395
+ /** One static application binding of a Gmail message Trigger. */
396
+ interface GmailTriggerBindingConfig {
397
+ /** Static connection name. */ connectionName: string;
398
+ /** Static binding name. */ bindingName: string;
399
+ /** Connector Studio configuration units for the binding. */ configurationUI: ConnectorConfigurationUI;
400
+ }
401
+ /** Declare a static messageReceived binding for Flow Definition tooling and Dex Web. */
402
+ declare function defineMessageReceivedTriggerBinding(config: GmailTriggerBindingConfig): TriggerBindingDefinition;
403
+ /** Declare a static replyReceived binding for Flow Definition tooling and Dex Web. */
404
+ declare function defineReplyReceivedTriggerBinding(config: GmailTriggerBindingConfig): TriggerBindingDefinition;
405
+ /** Configuration of one standalone Gmail message Trigger. */
406
+ interface GmailMessageTriggerConfig<Configuration> {
407
+ /** Gmail connection bound to a GmailClient. */ connection: GmailConnection;
408
+ /** Static connection name; must equal the connection's name. */ connectionName: string;
409
+ /** Static binding name. */ bindingName: string;
410
+ /** Search query and matcher. */ configuration: Configuration;
411
+ /** Routes accepted events into the application. */ target: TriggerTarget<MessageEvent>;
412
+ }
413
+ /**
414
+ * Create one messageReceived Trigger that polls on its own. Prefer one MessageTriggerRunner per
415
+ * connection, which delivers every root before any reply.
416
+ */
417
+ declare function newMessageReceivedTrigger(config: GmailMessageTriggerConfig<MessageReceivedTriggerConfiguration>): TriggerRunner;
418
+ /**
419
+ * Create one replyReceived Trigger that polls on its own. Prefer one MessageTriggerRunner per
420
+ * connection, which delivers every root before any reply.
421
+ */
422
+ declare function newReplyReceivedTrigger(config: GmailMessageTriggerConfig<ReplyReceivedTriggerConfiguration>): TriggerRunner;
423
+ /** One root-message binding and its application target. */
424
+ interface MessageReceivedTriggerRoute {
425
+ /** Configured binding name. */ bindingName: string;
426
+ /** Search query and root-message matcher. */ configuration: MessageReceivedTriggerConfiguration;
427
+ /** Routes accepted events into the application. */ target: TriggerTarget<MessageEvent>;
428
+ }
429
+ /** One reply binding and its application target. */
430
+ interface ReplyReceivedTriggerRoute {
431
+ /** Configured binding name. */ bindingName: string;
432
+ /** Search query and reply matcher. */ configuration: ReplyReceivedTriggerConfiguration;
433
+ /** Routes accepted events into the application. */ target: TriggerTarget<MessageEvent>;
434
+ }
435
+ /** Gmail message Triggers that share one ordered poller. */
436
+ interface MessageTriggerRunnerConfig {
437
+ /** Gmail connection bound to a GmailClient. */ connection: GmailConnection;
438
+ /** Root-message bindings. */ messageReceivedRoutes?: readonly MessageReceivedTriggerRoute[];
439
+ /** Reply bindings. */ replyReceivedRoutes?: readonly ReplyReceivedTriggerRoute[];
440
+ }
441
+ /** One root-message binding saved in the project configuration and its application target. */
442
+ interface ProjectMessageReceivedTriggerRoute {
443
+ bindingName: string; /** Application target. */
444
+ target: TriggerTarget<MessageEvent>;
445
+ }
446
+ /** One reply binding saved in the project configuration and its application target. */
447
+ interface ProjectReplyReceivedTriggerRoute {
448
+ bindingName: string; /** Application target. */
449
+ target: TriggerTarget<MessageEvent>;
450
+ }
451
+ /** Gmail message Trigger bindings selected from the project configuration. */
452
+ interface ProjectMessageTriggerRunnerConfig {
453
+ /** Root-message bindings. */ messageReceivedRoutes?: readonly ProjectMessageReceivedTriggerRoute[];
454
+ /** Reply bindings. */ replyReceivedRoutes?: readonly ProjectReplyReceivedTriggerRoute[];
455
+ }
456
+ /** Polls every configured Gmail route of one connection and delivers root messages before replies. */
457
+ declare class MessageTriggerRunner {
458
+ #private;
459
+ /** @internal Use newMessageTriggerRunner or newProjectMessageTriggerRunner. */
460
+ constructor(rootRoutes: readonly MessageTriggerRoute[], replyRoutes: readonly MessageTriggerRoute[], pollIntervalMs: number);
461
+ /**
462
+ * Replay each route's durable inbox in order, roots first, then poll until the context ends. Each poll
463
+ * lists every reply route before any root route, then delivers every root before any reply, and ends
464
+ * at the first failure. Every later poll retries the failed event before that route's listed messages,
465
+ * even after Gmail stops listing it. Gmail receives a thread's root before any reply to it, so the
466
+ * root of every listed reply is in the later root listing and reaches Dex first.
467
+ *
468
+ * It logs through the client's logger: WARN "gmail poll failed; retrying" with the consecutive failed
469
+ * polls as attempt and the poll interval as delay_ms when a list or read fails, WARN "trigger delivery
470
+ * failed; retrying" with the attempt number when a target fails, INFO "trigger delivered after retry"
471
+ * when a later poll delivers that message, DEBUG "trigger event ignored" with its reason, and the
472
+ * durable inbox records. It rejects with TriggerDeliveryAbortedError once the context ends, and when
473
+ * an inbox replay fails.
474
+ */
475
+ run(context: TriggerContext): Promise<void>;
476
+ }
477
+ /** Create one ordered runner for every configured Gmail message Trigger route of a connection; throws on invalid wiring. */
478
+ declare function newMessageTriggerRunner(config: MessageTriggerRunnerConfig): MessageTriggerRunner;
479
+ /**
480
+ * Open connectionName from the loaded project, load the selected bindings' saved configuration, and
481
+ * create one durable, ordered runner. Each route keeps acknowledged events in its binding's project
482
+ * Trigger inbox until its target consumes them, so a restarted or replaced replica replays them. A
483
+ * route whose binding is not configured throws. The options' logger also applies to those inboxes.
484
+ */
485
+ declare function newProjectMessageTriggerRunner(project: LoadedProject, connectionName: string, config: ProjectMessageTriggerRunnerConfig, options?: GmailClientOptions): MessageTriggerRunner;
486
+
487
+ export { Config, CredentialSource, Credentials, GetMessageBranch, GetMessageDefinition, GetMessageInput, GetMessageOperation, type GetMessageStepConfig, GmailClient, type GmailClientOptions, type GmailClientSettings, GmailConnection, GmailCredentialError, GmailCredentialRefreshDriver, GmailHTTPClient, type GmailMessagePart, type GmailMessageReference, type GmailMessageResource, GmailMessageResourceSchema, type GmailMessageTriggerConfig, GmailOperations, GmailProvider, type GmailReadResult, type GmailTransport, type GmailTriggerBindingConfig, Message, type MessageEvent, MessageEventSchema, type MessageMatcher, MessageMatcherSchema, type MessageReceivedTriggerConfiguration, MessageReceivedTriggerConfigurationSchema, MessageReceivedTriggerDefinition, type MessageReceivedTriggerRoute, MessageTriggerRunner, type MessageTriggerRunnerConfig, type ProjectMessageReceivedTriggerRoute, type ProjectMessageTriggerRunnerConfig, type ProjectReplyReceivedTriggerRoute, type ReplyReceivedTriggerConfiguration, ReplyReceivedTriggerConfigurationSchema, ReplyReceivedTriggerDefinition, type ReplyReceivedTriggerRoute, ReplyToMessageBranch, ReplyToMessageDefinition, ReplyToMessageInput, ReplyToMessageOperation, type ReplyToMessageStepConfig, SendMessageBranch, SendMessageDefinition, SendMessageInput, SendMessageOperation, SendMessageOutput, type SendMessageStepConfig, type SentMessageIdentity, UIEmailListInputPortEmails, UISearchQueryInputPortQuery, UITextInputPortText, UIUnitEmailListInput, UIUnitSearchQueryInput, UIUnitTextInput, buildMIMEMessage, buildReplyMIMEMessage, decodeGmailMessage, defineMessageReceivedTriggerBinding, defineReplyReceivedTriggerBinding, emptyMessage, gmailClientSettings, gmailFailure, gmailRequestID, gmailRetryAfterMs, newGetMessageStep, newMessageReceivedTrigger, newMessageTriggerRunner, newProjectConnection, newProjectGmailClient, newProjectMessageTriggerRunner, newReplyReceivedTrigger, newReplyToMessageStep, newSendMessageStep, parseMailbox, parseSentResponse, receiptFor, replyRecipient, rfcMessageIDAddress, statusFailureKind, validateSendInput };
package/dist/index.js CHANGED
@@ -12,8 +12,15 @@ import {
12
12
  GmailMessageResourceSchema,
13
13
  GmailProvider,
14
14
  GoogleOAuthAuthMethodID,
15
+ MessageEventSchema,
16
+ MessageMatcherSchema,
17
+ MessageReceivedTriggerConfigurationSchema,
18
+ MessageReceivedTriggerDefinition,
15
19
  MessageSchema,
20
+ MessageTriggerRunner,
16
21
  ProviderID,
22
+ ReplyReceivedTriggerConfigurationSchema,
23
+ ReplyReceivedTriggerDefinition,
17
24
  ReplyToMessageBranch,
18
25
  ReplyToMessageDefinition,
19
26
  ReplyToMessageInputSchema,
@@ -23,18 +30,30 @@ import {
23
30
  SendMessageInputSchema2 as SendMessageInputSchema,
24
31
  SendMessageOperation,
25
32
  SendMessageOutputSchema2 as SendMessageOutputSchema,
33
+ UIEmailListInputPortEmails,
34
+ UISearchQueryInputPortQuery,
35
+ UITextInputPortText,
36
+ UIUnitEmailListInput,
37
+ UIUnitSearchQueryInput,
38
+ UIUnitTextInput,
26
39
  WorkspaceDomainDelegationAuthMethodID,
27
40
  buildMIMEMessage,
28
41
  buildReplyMIMEMessage,
29
42
  decodeGmailMessage,
43
+ defineMessageReceivedTriggerBinding,
44
+ defineReplyReceivedTriggerBinding,
30
45
  emptyMessage,
31
46
  gmailClientSettings,
32
47
  gmailFailure,
33
48
  gmailRequestID,
34
49
  gmailRetryAfterMs,
35
50
  newGetMessageStep,
51
+ newMessageReceivedTrigger,
52
+ newMessageTriggerRunner,
36
53
  newProjectConnection,
37
54
  newProjectGmailClient,
55
+ newProjectMessageTriggerRunner,
56
+ newReplyReceivedTrigger,
38
57
  newReplyToMessageStep,
39
58
  newSendMessageStep,
40
59
  parseMailbox,
@@ -44,7 +63,7 @@ import {
44
63
  rfcMessageIDAddress,
45
64
  statusFailureKind,
46
65
  validateSendInput
47
- } from "./chunk-OKDZ42YK.js";
66
+ } from "./chunk-PW3NTBVH.js";
48
67
  export {
49
68
  ConnectorID,
50
69
  GetMessageBranch,
@@ -59,8 +78,15 @@ export {
59
78
  GmailMessageResourceSchema,
60
79
  GmailProvider,
61
80
  GoogleOAuthAuthMethodID,
81
+ MessageEventSchema,
82
+ MessageMatcherSchema,
83
+ MessageReceivedTriggerConfigurationSchema,
84
+ MessageReceivedTriggerDefinition,
62
85
  MessageSchema,
86
+ MessageTriggerRunner,
63
87
  ProviderID,
88
+ ReplyReceivedTriggerConfigurationSchema,
89
+ ReplyReceivedTriggerDefinition,
64
90
  ReplyToMessageBranch,
65
91
  ReplyToMessageDefinition,
66
92
  ReplyToMessageInputSchema,
@@ -70,18 +96,30 @@ export {
70
96
  SendMessageInputSchema,
71
97
  SendMessageOperation,
72
98
  SendMessageOutputSchema,
99
+ UIEmailListInputPortEmails,
100
+ UISearchQueryInputPortQuery,
101
+ UITextInputPortText,
102
+ UIUnitEmailListInput,
103
+ UIUnitSearchQueryInput,
104
+ UIUnitTextInput,
73
105
  WorkspaceDomainDelegationAuthMethodID,
74
106
  buildMIMEMessage,
75
107
  buildReplyMIMEMessage,
76
108
  decodeGmailMessage,
109
+ defineMessageReceivedTriggerBinding,
110
+ defineReplyReceivedTriggerBinding,
77
111
  emptyMessage,
78
112
  gmailClientSettings,
79
113
  gmailFailure,
80
114
  gmailRequestID,
81
115
  gmailRetryAfterMs,
82
116
  newGetMessageStep,
117
+ newMessageReceivedTrigger,
118
+ newMessageTriggerRunner,
83
119
  newProjectConnection,
84
120
  newProjectGmailClient,
121
+ newProjectMessageTriggerRunner,
122
+ newReplyReceivedTrigger,
85
123
  newReplyToMessageStep,
86
124
  newSendMessageStep,
87
125
  parseMailbox,