@mshindi-labs/google 0.0.0-stage → 1.0.2

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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -2
  3. package/dist/chunk-JVP7HHFU.js +76 -0
  4. package/dist/chunk-JVP7HHFU.js.map +1 -0
  5. package/dist/chunk-KJPQ3DMR.cjs +76 -0
  6. package/dist/chunk-KJPQ3DMR.cjs.map +1 -0
  7. package/dist/chunk-RWT25QHA.js +190 -0
  8. package/dist/chunk-RWT25QHA.js.map +1 -0
  9. package/dist/chunk-SHDP4A3A.cjs +190 -0
  10. package/dist/chunk-SHDP4A3A.cjs.map +1 -0
  11. package/dist/chunk-SIDO26T7.js +949 -0
  12. package/dist/chunk-SIDO26T7.js.map +1 -0
  13. package/dist/chunk-V22QP2AM.cjs +49 -0
  14. package/dist/chunk-V22QP2AM.cjs.map +1 -0
  15. package/dist/chunk-VN5VWVCT.cjs +949 -0
  16. package/dist/chunk-VN5VWVCT.cjs.map +1 -0
  17. package/dist/chunk-Z7O6GO3C.js +49 -0
  18. package/dist/chunk-Z7O6GO3C.js.map +1 -0
  19. package/dist/core.cjs +289 -0
  20. package/dist/core.cjs.map +1 -0
  21. package/dist/core.d.cts +173 -0
  22. package/dist/core.d.ts +173 -0
  23. package/dist/core.js +289 -0
  24. package/dist/core.js.map +1 -0
  25. package/dist/create-google-CPGcK-3G.d.cts +107 -0
  26. package/dist/create-google-nP9f9jd9.d.ts +107 -0
  27. package/dist/events-BsWOMtza.d.cts +160 -0
  28. package/dist/events-BsWOMtza.d.ts +160 -0
  29. package/dist/gmail.cjs +489 -0
  30. package/dist/gmail.cjs.map +1 -0
  31. package/dist/gmail.d.cts +53 -0
  32. package/dist/gmail.d.ts +53 -0
  33. package/dist/gmail.js +489 -0
  34. package/dist/gmail.js.map +1 -0
  35. package/dist/key-provider-Cq_14Bh6.d.cts +53 -0
  36. package/dist/key-provider-Cq_14Bh6.d.ts +53 -0
  37. package/dist/postgres.cjs +455 -0
  38. package/dist/postgres.cjs.map +1 -0
  39. package/dist/postgres.d.cts +22 -0
  40. package/dist/postgres.d.ts +22 -0
  41. package/dist/postgres.js +455 -0
  42. package/dist/postgres.js.map +1 -0
  43. package/dist/static-key-provider-BhyRhY6-.d.ts +18 -0
  44. package/dist/static-key-provider-CPNt4YvF.d.cts +18 -0
  45. package/dist/testing.cjs +829 -0
  46. package/dist/testing.cjs.map +1 -0
  47. package/dist/testing.d.cts +147 -0
  48. package/dist/testing.d.ts +147 -0
  49. package/dist/testing.js +829 -0
  50. package/dist/testing.js.map +1 -0
  51. package/dist/transport-CVOgr9XP.d.cts +20 -0
  52. package/dist/transport-CVOgr9XP.d.ts +20 -0
  53. package/package.json +143 -4
@@ -0,0 +1,107 @@
1
+ import { K as KeyProvider, O as OAuthGateway } from './key-provider-Cq_14Bh6.cjs';
2
+ import { a as ConnectionRecord, c as ConnectionView, C as CredentialStore, G as GoogleEvent, L as Logger, f as Emit } from './events-BsWOMtza.cjs';
3
+
4
+ type TokenManager = {
5
+ getAccessToken(tenantId: string, connectionId: string, opts?: {
6
+ forceRefresh?: boolean;
7
+ }): Promise<{
8
+ accessToken: string;
9
+ connection: ConnectionRecord;
10
+ }>;
11
+ prime(tenantId: string, connectionId: string, accessToken: string, expiresAt: Date): void;
12
+ evict(connectionId: string): void;
13
+ evictTenant(tenantId: string): void;
14
+ };
15
+
16
+ type ClientsApi = {
17
+ configure(p: {
18
+ tenantId: string;
19
+ actorId: string;
20
+ clientId: string;
21
+ clientSecret: string;
22
+ hostedDomain?: string | null;
23
+ }): Promise<void>;
24
+ get(tenantId: string): Promise<{
25
+ clientId: string;
26
+ secretHint: string;
27
+ hostedDomain: string | null;
28
+ updatedAt: Date;
29
+ } | null>;
30
+ };
31
+
32
+ declare const BASE_SCOPES: readonly string[];
33
+ declare const SERVICE_SCOPES: {
34
+ readonly gmail: readonly ["https://www.googleapis.com/auth/gmail.send"];
35
+ };
36
+ type GoogleService = keyof typeof SERVICE_SCOPES;
37
+ /** Base scopes plus every requested service's scopes, de-duplicated. */
38
+ declare function scopesFor(services: GoogleService[]): string[];
39
+
40
+ type ConnectionsApi = {
41
+ list(tenantId: string): Promise<ConnectionView[]>;
42
+ get(tenantId: string, connectionId: string): Promise<ConnectionView>;
43
+ disconnect(p: {
44
+ tenantId: string;
45
+ connectionId: string;
46
+ actorId: string;
47
+ }): Promise<void>;
48
+ setDisplayName(p: {
49
+ tenantId: string;
50
+ connectionId: string;
51
+ displayName: string | null;
52
+ }): Promise<ConnectionView>;
53
+ };
54
+
55
+ type CreateGoogleOptions = {
56
+ store: CredentialStore;
57
+ keyProvider: KeyProvider;
58
+ callbackUrl: string;
59
+ onEvent?: (e: GoogleEvent) => void | Promise<void>;
60
+ logger?: Logger;
61
+ redactRecipients?: boolean;
62
+ oauthGateway?: OAuthGateway;
63
+ now?: () => Date;
64
+ };
65
+ type OAuthApi = {
66
+ createAuthUrl(p: {
67
+ tenantId: string;
68
+ actorId: string;
69
+ services: GoogleService[];
70
+ intendedEmail?: string;
71
+ connectionId?: string;
72
+ }): Promise<{
73
+ url: string;
74
+ expiresAt: Date;
75
+ }>;
76
+ handleCallback(p: {
77
+ code?: string;
78
+ state?: string;
79
+ error?: string;
80
+ }): Promise<{
81
+ connection: ConnectionView;
82
+ tenantId: string;
83
+ actorId: string;
84
+ created: boolean;
85
+ }>;
86
+ purgeExpiredStates(): Promise<number>;
87
+ };
88
+ declare const internals: unique symbol;
89
+ type Internals = {
90
+ store: CredentialStore;
91
+ keyProvider: KeyProvider;
92
+ emit: Emit;
93
+ now: () => Date;
94
+ callbackUrl: string;
95
+ logger?: Logger;
96
+ gateway: OAuthGateway;
97
+ tokens: TokenManager;
98
+ };
99
+ type GoogleCore = {
100
+ clients: ClientsApi;
101
+ oauth: OAuthApi;
102
+ connections: ConnectionsApi;
103
+ [internals]: Internals;
104
+ };
105
+ declare function createGoogle(opts: CreateGoogleOptions): GoogleCore;
106
+
107
+ export { BASE_SCOPES as B, type ClientsApi as C, type GoogleCore as G, type OAuthApi as O, SERVICE_SCOPES as S, type ConnectionsApi as a, type CreateGoogleOptions as b, type GoogleService as c, createGoogle as d, scopesFor as s };
@@ -0,0 +1,107 @@
1
+ import { K as KeyProvider, O as OAuthGateway } from './key-provider-Cq_14Bh6.js';
2
+ import { a as ConnectionRecord, c as ConnectionView, C as CredentialStore, G as GoogleEvent, L as Logger, f as Emit } from './events-BsWOMtza.js';
3
+
4
+ type TokenManager = {
5
+ getAccessToken(tenantId: string, connectionId: string, opts?: {
6
+ forceRefresh?: boolean;
7
+ }): Promise<{
8
+ accessToken: string;
9
+ connection: ConnectionRecord;
10
+ }>;
11
+ prime(tenantId: string, connectionId: string, accessToken: string, expiresAt: Date): void;
12
+ evict(connectionId: string): void;
13
+ evictTenant(tenantId: string): void;
14
+ };
15
+
16
+ type ClientsApi = {
17
+ configure(p: {
18
+ tenantId: string;
19
+ actorId: string;
20
+ clientId: string;
21
+ clientSecret: string;
22
+ hostedDomain?: string | null;
23
+ }): Promise<void>;
24
+ get(tenantId: string): Promise<{
25
+ clientId: string;
26
+ secretHint: string;
27
+ hostedDomain: string | null;
28
+ updatedAt: Date;
29
+ } | null>;
30
+ };
31
+
32
+ declare const BASE_SCOPES: readonly string[];
33
+ declare const SERVICE_SCOPES: {
34
+ readonly gmail: readonly ["https://www.googleapis.com/auth/gmail.send"];
35
+ };
36
+ type GoogleService = keyof typeof SERVICE_SCOPES;
37
+ /** Base scopes plus every requested service's scopes, de-duplicated. */
38
+ declare function scopesFor(services: GoogleService[]): string[];
39
+
40
+ type ConnectionsApi = {
41
+ list(tenantId: string): Promise<ConnectionView[]>;
42
+ get(tenantId: string, connectionId: string): Promise<ConnectionView>;
43
+ disconnect(p: {
44
+ tenantId: string;
45
+ connectionId: string;
46
+ actorId: string;
47
+ }): Promise<void>;
48
+ setDisplayName(p: {
49
+ tenantId: string;
50
+ connectionId: string;
51
+ displayName: string | null;
52
+ }): Promise<ConnectionView>;
53
+ };
54
+
55
+ type CreateGoogleOptions = {
56
+ store: CredentialStore;
57
+ keyProvider: KeyProvider;
58
+ callbackUrl: string;
59
+ onEvent?: (e: GoogleEvent) => void | Promise<void>;
60
+ logger?: Logger;
61
+ redactRecipients?: boolean;
62
+ oauthGateway?: OAuthGateway;
63
+ now?: () => Date;
64
+ };
65
+ type OAuthApi = {
66
+ createAuthUrl(p: {
67
+ tenantId: string;
68
+ actorId: string;
69
+ services: GoogleService[];
70
+ intendedEmail?: string;
71
+ connectionId?: string;
72
+ }): Promise<{
73
+ url: string;
74
+ expiresAt: Date;
75
+ }>;
76
+ handleCallback(p: {
77
+ code?: string;
78
+ state?: string;
79
+ error?: string;
80
+ }): Promise<{
81
+ connection: ConnectionView;
82
+ tenantId: string;
83
+ actorId: string;
84
+ created: boolean;
85
+ }>;
86
+ purgeExpiredStates(): Promise<number>;
87
+ };
88
+ declare const internals: unique symbol;
89
+ type Internals = {
90
+ store: CredentialStore;
91
+ keyProvider: KeyProvider;
92
+ emit: Emit;
93
+ now: () => Date;
94
+ callbackUrl: string;
95
+ logger?: Logger;
96
+ gateway: OAuthGateway;
97
+ tokens: TokenManager;
98
+ };
99
+ type GoogleCore = {
100
+ clients: ClientsApi;
101
+ oauth: OAuthApi;
102
+ connections: ConnectionsApi;
103
+ [internals]: Internals;
104
+ };
105
+ declare function createGoogle(opts: CreateGoogleOptions): GoogleCore;
106
+
107
+ export { BASE_SCOPES as B, type ClientsApi as C, type GoogleCore as G, type OAuthApi as O, SERVICE_SCOPES as S, type ConnectionsApi as a, type CreateGoogleOptions as b, type GoogleService as c, createGoogle as d, scopesFor as s };
@@ -0,0 +1,160 @@
1
+ type EncryptedValue = {
2
+ v: 1;
3
+ kid: string;
4
+ wdek: string;
5
+ iv: string;
6
+ ct: string;
7
+ tag: string;
8
+ };
9
+ type AadRecord = "oauth_client" | "connection" | "oauth_state";
10
+
11
+ type ConnectionStatus = "active" | "revoked" | "error";
12
+ type OAuthClientRecord = {
13
+ tenantId: string;
14
+ clientId: string;
15
+ clientSecret: EncryptedValue;
16
+ secretHint: string;
17
+ hostedDomain: string | null;
18
+ createdBy: string;
19
+ createdAt: Date;
20
+ updatedBy: string;
21
+ updatedAt: Date;
22
+ };
23
+ type ConnectionRecord = {
24
+ id: string;
25
+ tenantId: string;
26
+ googleSub: string;
27
+ email: string;
28
+ displayName: string | null;
29
+ scopes: string[];
30
+ refreshToken: EncryptedValue | null;
31
+ status: ConnectionStatus;
32
+ statusReason: string | null;
33
+ connectedBy: string;
34
+ connectedAt: Date;
35
+ updatedAt: Date;
36
+ lastUsedAt: Date | null;
37
+ };
38
+ type ConnectionView = Omit<ConnectionRecord, "refreshToken">;
39
+ type OAuthStateRecord = {
40
+ stateHash: Uint8Array;
41
+ tenantId: string;
42
+ actorId: string;
43
+ intendedEmail: string | null;
44
+ connectionId: string | null;
45
+ scopes: string[];
46
+ codeVerifier: EncryptedValue;
47
+ expiresAt: Date;
48
+ };
49
+ /** Points at one encrypted field of one stored record (used for key rotation). */
50
+ type EncryptedValueRef = {
51
+ tenantId: string;
52
+ record: AadRecord;
53
+ /** tenantId for oauth_client, connection id for connection, hex stateHash for oauth_state. */
54
+ recordId: string;
55
+ field: string;
56
+ value: EncryptedValue;
57
+ };
58
+ interface Logger {
59
+ warn(msg: string, meta?: Record<string, unknown>): void;
60
+ error(msg: string, meta?: Record<string, unknown>): void;
61
+ }
62
+
63
+ interface CredentialStore {
64
+ getOAuthClient(tenantId: string): Promise<OAuthClientRecord | null>;
65
+ /**
66
+ * When `revokeConnections` is true, every connection of the tenant must be set to
67
+ * status 'revoked' / statusReason 'client_changed' atomically with the upsert.
68
+ */
69
+ upsertOAuthClient(rec: OAuthClientRecord, opts: {
70
+ revokeConnections: boolean;
71
+ }): Promise<void>;
72
+ getConnection(tenantId: string, connectionId: string): Promise<ConnectionRecord | null>;
73
+ findConnectionBySub(tenantId: string, googleSub: string): Promise<ConnectionRecord | null>;
74
+ listConnections(tenantId: string): Promise<ConnectionRecord[]>;
75
+ /** Rejects if another id already holds the same (tenantId, googleSub). */
76
+ upsertConnection(rec: ConnectionRecord): Promise<void>;
77
+ updateConnectionStatus(tenantId: string, connectionId: string, status: ConnectionStatus, reason: string): Promise<void>;
78
+ touchConnection(tenantId: string, connectionId: string, at: Date): Promise<void>;
79
+ /**
80
+ * Targeted update of `displayName` and `updatedAt` only (never status or
81
+ * refresh token). Returns false when the connection does not exist in the tenant.
82
+ */
83
+ setConnectionDisplayName(tenantId: string, connectionId: string, displayName: string | null, at: Date): Promise<boolean>;
84
+ /**
85
+ * Targeted update: refreshToken = null, status 'revoked', statusReason
86
+ * 'disconnected', updatedAt = at. Returns false when the connection does not
87
+ * exist in the tenant.
88
+ */
89
+ disconnectConnection(tenantId: string, connectionId: string, at: Date): Promise<boolean>;
90
+ insertOAuthState(rec: OAuthStateRecord): Promise<void>;
91
+ /** Atomic: at most one concurrent caller receives the record. `stateHash` is lowercase hex. */
92
+ consumeOAuthState(stateHash: string, now: Date): Promise<OAuthStateRecord | null>;
93
+ deleteExpiredOAuthStates(now: Date): Promise<number>;
94
+ iterateEncryptedValues(batchSize: number): AsyncIterable<EncryptedValueRef>;
95
+ /**
96
+ * Compare-and-swap: replaces the stored value only if it still equals `ref.value`
97
+ * (and the tenant matches). Returns true if replaced, false otherwise (e.g. a
98
+ * concurrent write changed the field, or the tenant/record does not match).
99
+ */
100
+ replaceEncryptedValue(ref: EncryptedValueRef, value: EncryptedValue): Promise<boolean>;
101
+ insertAuditEvent?(event: GoogleEvent): Promise<void>;
102
+ }
103
+
104
+ type GoogleEvent = {
105
+ type: "oauth_client.configured" | "oauth_client.rotated";
106
+ tenantId: string;
107
+ actorId: string;
108
+ clientIdChanged: boolean;
109
+ at: Date;
110
+ } | {
111
+ type: "connection.created" | "connection.scopes_added";
112
+ tenantId: string;
113
+ actorId: string;
114
+ connectionId: string;
115
+ email: string;
116
+ scopes: string[];
117
+ at: Date;
118
+ } | {
119
+ type: "connection.revoked";
120
+ tenantId: string;
121
+ connectionId: string;
122
+ reason: string;
123
+ at: Date;
124
+ } | {
125
+ type: "connection.disconnected";
126
+ tenantId: string;
127
+ actorId: string;
128
+ connectionId: string;
129
+ googleRevoke: "ok" | "failed";
130
+ at: Date;
131
+ } | {
132
+ type: "message.sent";
133
+ tenantId: string;
134
+ actorId: string;
135
+ connectionId: string;
136
+ messageId: string;
137
+ threadId: string;
138
+ to: string[];
139
+ cc: string[];
140
+ bcc: string[];
141
+ subject: string;
142
+ attachmentCount: number;
143
+ at: Date;
144
+ } | {
145
+ type: "message.failed";
146
+ tenantId: string;
147
+ actorId: string;
148
+ connectionId: string;
149
+ errorCode: string;
150
+ to: string[];
151
+ cc: string[];
152
+ bcc: string[];
153
+ subject: string;
154
+ at: Date;
155
+ };
156
+ type Emit = (e: GoogleEvent, perCall?: {
157
+ redactRecipients?: boolean;
158
+ }) => Promise<void>;
159
+
160
+ export type { AadRecord as A, CredentialStore as C, EncryptedValue as E, GoogleEvent as G, Logger as L, OAuthClientRecord as O, ConnectionRecord as a, ConnectionStatus as b, ConnectionView as c, EncryptedValueRef as d, OAuthStateRecord as e, Emit as f };
@@ -0,0 +1,160 @@
1
+ type EncryptedValue = {
2
+ v: 1;
3
+ kid: string;
4
+ wdek: string;
5
+ iv: string;
6
+ ct: string;
7
+ tag: string;
8
+ };
9
+ type AadRecord = "oauth_client" | "connection" | "oauth_state";
10
+
11
+ type ConnectionStatus = "active" | "revoked" | "error";
12
+ type OAuthClientRecord = {
13
+ tenantId: string;
14
+ clientId: string;
15
+ clientSecret: EncryptedValue;
16
+ secretHint: string;
17
+ hostedDomain: string | null;
18
+ createdBy: string;
19
+ createdAt: Date;
20
+ updatedBy: string;
21
+ updatedAt: Date;
22
+ };
23
+ type ConnectionRecord = {
24
+ id: string;
25
+ tenantId: string;
26
+ googleSub: string;
27
+ email: string;
28
+ displayName: string | null;
29
+ scopes: string[];
30
+ refreshToken: EncryptedValue | null;
31
+ status: ConnectionStatus;
32
+ statusReason: string | null;
33
+ connectedBy: string;
34
+ connectedAt: Date;
35
+ updatedAt: Date;
36
+ lastUsedAt: Date | null;
37
+ };
38
+ type ConnectionView = Omit<ConnectionRecord, "refreshToken">;
39
+ type OAuthStateRecord = {
40
+ stateHash: Uint8Array;
41
+ tenantId: string;
42
+ actorId: string;
43
+ intendedEmail: string | null;
44
+ connectionId: string | null;
45
+ scopes: string[];
46
+ codeVerifier: EncryptedValue;
47
+ expiresAt: Date;
48
+ };
49
+ /** Points at one encrypted field of one stored record (used for key rotation). */
50
+ type EncryptedValueRef = {
51
+ tenantId: string;
52
+ record: AadRecord;
53
+ /** tenantId for oauth_client, connection id for connection, hex stateHash for oauth_state. */
54
+ recordId: string;
55
+ field: string;
56
+ value: EncryptedValue;
57
+ };
58
+ interface Logger {
59
+ warn(msg: string, meta?: Record<string, unknown>): void;
60
+ error(msg: string, meta?: Record<string, unknown>): void;
61
+ }
62
+
63
+ interface CredentialStore {
64
+ getOAuthClient(tenantId: string): Promise<OAuthClientRecord | null>;
65
+ /**
66
+ * When `revokeConnections` is true, every connection of the tenant must be set to
67
+ * status 'revoked' / statusReason 'client_changed' atomically with the upsert.
68
+ */
69
+ upsertOAuthClient(rec: OAuthClientRecord, opts: {
70
+ revokeConnections: boolean;
71
+ }): Promise<void>;
72
+ getConnection(tenantId: string, connectionId: string): Promise<ConnectionRecord | null>;
73
+ findConnectionBySub(tenantId: string, googleSub: string): Promise<ConnectionRecord | null>;
74
+ listConnections(tenantId: string): Promise<ConnectionRecord[]>;
75
+ /** Rejects if another id already holds the same (tenantId, googleSub). */
76
+ upsertConnection(rec: ConnectionRecord): Promise<void>;
77
+ updateConnectionStatus(tenantId: string, connectionId: string, status: ConnectionStatus, reason: string): Promise<void>;
78
+ touchConnection(tenantId: string, connectionId: string, at: Date): Promise<void>;
79
+ /**
80
+ * Targeted update of `displayName` and `updatedAt` only (never status or
81
+ * refresh token). Returns false when the connection does not exist in the tenant.
82
+ */
83
+ setConnectionDisplayName(tenantId: string, connectionId: string, displayName: string | null, at: Date): Promise<boolean>;
84
+ /**
85
+ * Targeted update: refreshToken = null, status 'revoked', statusReason
86
+ * 'disconnected', updatedAt = at. Returns false when the connection does not
87
+ * exist in the tenant.
88
+ */
89
+ disconnectConnection(tenantId: string, connectionId: string, at: Date): Promise<boolean>;
90
+ insertOAuthState(rec: OAuthStateRecord): Promise<void>;
91
+ /** Atomic: at most one concurrent caller receives the record. `stateHash` is lowercase hex. */
92
+ consumeOAuthState(stateHash: string, now: Date): Promise<OAuthStateRecord | null>;
93
+ deleteExpiredOAuthStates(now: Date): Promise<number>;
94
+ iterateEncryptedValues(batchSize: number): AsyncIterable<EncryptedValueRef>;
95
+ /**
96
+ * Compare-and-swap: replaces the stored value only if it still equals `ref.value`
97
+ * (and the tenant matches). Returns true if replaced, false otherwise (e.g. a
98
+ * concurrent write changed the field, or the tenant/record does not match).
99
+ */
100
+ replaceEncryptedValue(ref: EncryptedValueRef, value: EncryptedValue): Promise<boolean>;
101
+ insertAuditEvent?(event: GoogleEvent): Promise<void>;
102
+ }
103
+
104
+ type GoogleEvent = {
105
+ type: "oauth_client.configured" | "oauth_client.rotated";
106
+ tenantId: string;
107
+ actorId: string;
108
+ clientIdChanged: boolean;
109
+ at: Date;
110
+ } | {
111
+ type: "connection.created" | "connection.scopes_added";
112
+ tenantId: string;
113
+ actorId: string;
114
+ connectionId: string;
115
+ email: string;
116
+ scopes: string[];
117
+ at: Date;
118
+ } | {
119
+ type: "connection.revoked";
120
+ tenantId: string;
121
+ connectionId: string;
122
+ reason: string;
123
+ at: Date;
124
+ } | {
125
+ type: "connection.disconnected";
126
+ tenantId: string;
127
+ actorId: string;
128
+ connectionId: string;
129
+ googleRevoke: "ok" | "failed";
130
+ at: Date;
131
+ } | {
132
+ type: "message.sent";
133
+ tenantId: string;
134
+ actorId: string;
135
+ connectionId: string;
136
+ messageId: string;
137
+ threadId: string;
138
+ to: string[];
139
+ cc: string[];
140
+ bcc: string[];
141
+ subject: string;
142
+ attachmentCount: number;
143
+ at: Date;
144
+ } | {
145
+ type: "message.failed";
146
+ tenantId: string;
147
+ actorId: string;
148
+ connectionId: string;
149
+ errorCode: string;
150
+ to: string[];
151
+ cc: string[];
152
+ bcc: string[];
153
+ subject: string;
154
+ at: Date;
155
+ };
156
+ type Emit = (e: GoogleEvent, perCall?: {
157
+ redactRecipients?: boolean;
158
+ }) => Promise<void>;
159
+
160
+ export type { AadRecord as A, CredentialStore as C, EncryptedValue as E, GoogleEvent as G, Logger as L, OAuthClientRecord as O, ConnectionRecord as a, ConnectionStatus as b, ConnectionView as c, EncryptedValueRef as d, OAuthStateRecord as e, Emit as f };