@superdurable/connector-google-gmail 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,99 +0,0 @@
1
- import { RefreshingCredentialProvider, SecretString, ConnectionRef, Query, Mutation } from '@superdurable/connectors-sdk';
2
- import { z } from 'zod';
3
-
4
- /** Stable Gmail connector identity. */
5
- declare const ConnectorID = "gmail";
6
- /** Provider identity used by named connections. */
7
- declare const ProviderID = "google";
8
- /** Google OAuth authorization method. */
9
- declare const GoogleOAuthAuthMethodID = "google-oauth";
10
- /** Google Workspace domain delegation authorization method. */
11
- declare const WorkspaceDomainDelegationAuthMethodID = "workspace-domain-delegation";
12
- /** Public configuration; omitted fields use the manifest defaults. */
13
- interface Config {
14
- /** Gmail API base URL. */ endpoint?: string;
15
- /** Complete API response limit in bytes. */ maxResponseBytes?: number;
16
- /** Encoded MIME message limit in bytes. */ maxMessageBytes?: number;
17
- /** Trigger poll interval in milliseconds. */ pollIntervalMs?: number;
18
- /** Number of recent messages per Trigger poll. */ pollPageSize?: number;
19
- }
20
- /** Credential material held outside Dex Flow state. */
21
- interface Credentials {
22
- /** Selected authorization method. */ authMethodId?: string;
23
- /** Google OAuth application identifier. */ oauthClientId?: string;
24
- /** Private Google OAuth application secret. */ oauthClientSecret?: SecretString;
25
- /** Private short-lived bearer token. */ accessToken: SecretString;
26
- /** Private long-lived OAuth renewal token. */ refreshToken?: SecretString;
27
- /** Verified sender or delegated mailbox. */ primaryEmail: string;
28
- /** Private Workspace service-account JSON. */ serviceAccountKey?: SecretString;
29
- /** Workspace user to impersonate. */ delegatedUser?: string;
30
- }
31
- /** Host-owned refreshing credential source required by the Gmail client. */
32
- type CredentialSource = RefreshingCredentialProvider<Credentials>;
33
- /** Input for one Gmail message read. */
34
- declare const GetMessageInputSchema: z.ZodObject<{
35
- messageId: z.ZodString;
36
- }, z.core.$strict>;
37
- /** Input for one Gmail message read. */
38
- type GetMessageInput = z.infer<typeof GetMessageInputSchema>;
39
- /** Input for one outbound Gmail message. */
40
- declare const SendMessageInputSchema: z.ZodObject<{
41
- to: z.ZodArray<z.ZodString>;
42
- subject: z.ZodString;
43
- textBody: z.ZodString;
44
- htmlBody: z.ZodOptional<z.ZodString>;
45
- }, z.core.$strict>;
46
- /** Input for one outbound Gmail message. */
47
- type SendMessageInput = z.infer<typeof SendMessageInputSchema>;
48
- /** Input for a reply to an existing Gmail message. */
49
- declare const ReplyToMessageInputSchema: z.ZodObject<{
50
- messageId: z.ZodString;
51
- textBody: z.ZodString;
52
- htmlBody: z.ZodOptional<z.ZodString>;
53
- }, z.core.$strict>;
54
- /** Input for a reply to an existing Gmail message. */
55
- type ReplyToMessageInput = z.infer<typeof ReplyToMessageInputSchema>;
56
- /** Decoded Gmail message returned by getMessage. */
57
- declare const MessageSchema: z.ZodObject<{
58
- messageId: z.ZodString;
59
- threadId: z.ZodString;
60
- rfcMessageId: z.ZodOptional<z.ZodString>;
61
- inReplyTo: z.ZodOptional<z.ZodString>;
62
- references: z.ZodOptional<z.ZodString>;
63
- from: z.ZodString;
64
- replyTo: z.ZodOptional<z.ZodString>;
65
- to: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
- subject: z.ZodString;
67
- textBody: z.ZodOptional<z.ZodString>;
68
- htmlBody: z.ZodOptional<z.ZodString>;
69
- snippet: z.ZodOptional<z.ZodString>;
70
- receivedAt: z.ZodISODateTime;
71
- labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
- }, z.core.$strict>;
73
- /** Decoded Gmail message returned by getMessage. */
74
- type Message = z.infer<typeof MessageSchema>;
75
- /** Gmail accepted-send identity and safe recipients. */
76
- declare const SendMessageOutputSchema: z.ZodObject<{
77
- sender: z.ZodString;
78
- recipients: z.ZodArray<z.ZodString>;
79
- messageId: z.ZodString;
80
- threadId: z.ZodString;
81
- }, z.core.$strict>;
82
- /** Gmail accepted-send identity and safe recipients. */
83
- type SendMessageOutput = z.infer<typeof SendMessageOutputSchema>;
84
-
85
- /** Three operation contracts supplied by a real client or scripted mock. */
86
- interface GmailOperations {
87
- /** Read one message. */ getMessage(): Query<GetMessageInput, Message>;
88
- /** Send a new message. */ sendMessage(): Mutation<SendMessageInput, SendMessageOutput>;
89
- /** Reply in an existing thread. */ replyToMessage(): Mutation<ReplyToMessageInput, SendMessageOutput>;
90
- }
91
- /** Named Gmail connection passed to operation Step factories. */
92
- declare class GmailConnection {
93
- /** Stable logical credential reference. */ readonly reference: ConnectionRef;
94
- /** Provider or mock operation implementations. */ readonly operations: GmailOperations;
95
- /** Bind operation implementations to a static named Google connection. */
96
- constructor(operations: GmailOperations, reference: ConnectionRef);
97
- }
98
-
99
- export { type Config as C, type GetMessageInput as G, type Message as M, ProviderID as P, type ReplyToMessageInput as R, type SendMessageInput as S, WorkspaceDomainDelegationAuthMethodID as W, type CredentialSource as a, type Credentials as b, type SendMessageOutput as c, type GmailOperations as d, GmailConnection as e, ConnectorID as f, GetMessageInputSchema as g, GoogleOAuthAuthMethodID as h, MessageSchema as i, ReplyToMessageInputSchema as j, SendMessageInputSchema as k, SendMessageOutputSchema as l };