@particle-academy/gmail-inbox-js 0.0.0 → 0.2.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.cjs ADDED
@@ -0,0 +1,580 @@
1
+ 'use strict';
2
+
3
+ var fancyConnectorCore = require('@particle-academy/fancy-connector-core');
4
+
5
+ // src/faker.ts
6
+ function fakeHistoryList({ config, fake }) {
7
+ return {
8
+ "history": [
9
+ {
10
+ "id": "1234567891",
11
+ "messagesAdded": [
12
+ {
13
+ "message": {
14
+ "id": fake.hex(16),
15
+ "threadId": fake.hex(16),
16
+ "labelIds": [
17
+ "INBOX",
18
+ "UNREAD"
19
+ ]
20
+ }
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "historyId": "1234567891"
26
+ };
27
+ }
28
+ function fakeLabelList({ config, fake }) {
29
+ return {
30
+ "labels": [
31
+ {
32
+ "id": "INBOX",
33
+ "name": "INBOX",
34
+ "type": "system"
35
+ },
36
+ {
37
+ "id": "UNREAD",
38
+ "name": "UNREAD",
39
+ "type": "system"
40
+ },
41
+ {
42
+ "id": "IMPORTANT",
43
+ "name": "IMPORTANT",
44
+ "type": "system",
45
+ "messagesTotal": 412,
46
+ "messagesUnread": 18,
47
+ "threadsTotal": 203,
48
+ "threadsUnread": 11
49
+ },
50
+ {
51
+ "id": fake.id("Label"),
52
+ "name": "Design Reviews",
53
+ "type": "user",
54
+ "messageListVisibility": "show",
55
+ "labelListVisibility": "labelShow",
56
+ "messagesTotal": 27,
57
+ "messagesUnread": 2,
58
+ "threadsTotal": 9,
59
+ "threadsUnread": 1
60
+ }
61
+ ]
62
+ };
63
+ }
64
+ function fakeMailboxStop({ config, fake }) {
65
+ return {};
66
+ }
67
+ function fakeMailboxWatch({ config, fake }) {
68
+ return {
69
+ "historyId": "1234567890",
70
+ "expiration": "1767312000000"
71
+ };
72
+ }
73
+ function fakeMessageGet({ config, fake }) {
74
+ return {
75
+ "id": config.id !== void 0 && config.id !== null && config.id !== "" ? String(config.id) : fake.hex(16),
76
+ "threadId": fake.hex(16),
77
+ "labelIds": [
78
+ "INBOX",
79
+ "UNREAD",
80
+ "IMPORTANT"
81
+ ],
82
+ "snippet": "Hi Ada, just confirming the design review is still on for Thursday at 2pm. Let me know if...",
83
+ "internalDate": "1790712000000",
84
+ "payload": {
85
+ "mimeType": "text/plain",
86
+ "headers": [
87
+ {
88
+ "name": "From",
89
+ "value": "Grace Hopper <grace@example.test>"
90
+ },
91
+ {
92
+ "name": "To",
93
+ "value": "Ada Lovelace <ada@example.test>"
94
+ },
95
+ {
96
+ "name": "Subject",
97
+ "value": "Re: Design review Thursday"
98
+ },
99
+ {
100
+ "name": "Date",
101
+ "value": "Tue, 29 Sep 2026 14:03:00 -0400"
102
+ }
103
+ ],
104
+ "body": {
105
+ "size": 612,
106
+ "data": fake.id("base64url_body")
107
+ }
108
+ }
109
+ };
110
+ }
111
+ function fakeMessageList({ config, fake }) {
112
+ return {
113
+ "messages": [
114
+ {
115
+ "id": fake.hex(16),
116
+ "threadId": fake.hex(16)
117
+ },
118
+ {
119
+ "id": fake.hex(16),
120
+ "threadId": fake.hex(16)
121
+ }
122
+ ],
123
+ "resultSizeEstimate": 2
124
+ };
125
+ }
126
+ function fakeThreadGet({ config, fake }) {
127
+ return {
128
+ "id": config.id !== void 0 && config.id !== null && config.id !== "" ? String(config.id) : fake.hex(16),
129
+ "historyId": Array.from({ length: 10 }, () => fake.int(0, 9)).join(""),
130
+ "messages": [
131
+ {
132
+ "id": fake.hex(16),
133
+ "labelIds": [
134
+ "INBOX",
135
+ "IMPORTANT"
136
+ ],
137
+ "snippet": "Hey team, scheduling the Q3 design review for Thursday at 2pm. Conference room B...",
138
+ "internalDate": "1790625600000",
139
+ "payload": {
140
+ "mimeType": "text/plain",
141
+ "headers": [
142
+ {
143
+ "name": "From",
144
+ "value": "Ada Lovelace <ada@example.test>"
145
+ },
146
+ {
147
+ "name": "To",
148
+ "value": "Grace Hopper <grace@example.test>"
149
+ },
150
+ {
151
+ "name": "Subject",
152
+ "value": "Design review Thursday"
153
+ },
154
+ {
155
+ "name": "Date",
156
+ "value": "Mon, 28 Sep 2026 09:00:00 -0400"
157
+ }
158
+ ],
159
+ "body": {
160
+ "size": 540,
161
+ "data": fake.id("base64url_body")
162
+ }
163
+ }
164
+ },
165
+ {
166
+ "id": fake.hex(16),
167
+ "labelIds": [
168
+ "INBOX",
169
+ "UNREAD",
170
+ "IMPORTANT"
171
+ ],
172
+ "snippet": "Hi Ada, just confirming the design review is still on for Thursday at 2pm. Let me know if...",
173
+ "internalDate": "1790712000000",
174
+ "payload": {
175
+ "mimeType": "text/plain",
176
+ "headers": [
177
+ {
178
+ "name": "From",
179
+ "value": "Grace Hopper <grace@example.test>"
180
+ },
181
+ {
182
+ "name": "To",
183
+ "value": "Ada Lovelace <ada@example.test>"
184
+ },
185
+ {
186
+ "name": "Subject",
187
+ "value": "Re: Design review Thursday"
188
+ },
189
+ {
190
+ "name": "Date",
191
+ "value": "Tue, 29 Sep 2026 14:03:00 -0400"
192
+ }
193
+ ],
194
+ "body": {
195
+ "size": 612,
196
+ "data": fake.id("base64url_body")
197
+ }
198
+ }
199
+ }
200
+ ]
201
+ };
202
+ }
203
+ function fakeMessageReceived({ config, fake }) {
204
+ return {
205
+ "subscription": "projects/my-project/subscriptions/gmail-push",
206
+ "messageId": Array.from({ length: 16 }, () => fake.int(0, 9)).join(""),
207
+ "publishTime": "2026-11-08T09:00:00.000Z",
208
+ "attributes": {},
209
+ "deliveryAttempt": null,
210
+ "data": {
211
+ "emailAddress": "user@example.test",
212
+ "historyId": 1234567891
213
+ }
214
+ };
215
+ }
216
+ var gmailInboxFaker = (operation, request) => {
217
+ switch (operation) {
218
+ case "history_list":
219
+ return fakeHistoryList(request);
220
+ case "label_list":
221
+ return fakeLabelList(request);
222
+ case "mailbox_stop":
223
+ return fakeMailboxStop(request);
224
+ case "mailbox_watch":
225
+ return fakeMailboxWatch(request);
226
+ case "message_get":
227
+ return fakeMessageGet(request);
228
+ case "message_list":
229
+ return fakeMessageList(request);
230
+ case "thread_get":
231
+ return fakeThreadGet(request);
232
+ case "message_received":
233
+ return fakeMessageReceived(request);
234
+ default:
235
+ throw new Error(
236
+ `gmail_inbox: no fake response is defined for "${operation}". Add a fixture under provider/fixtures/ and regenerate \u2014 a connector without a faker cannot be developed against, tested, or demonstrated.`
237
+ );
238
+ }
239
+ };
240
+
241
+ // src/service.ts
242
+ var CONNECTOR_API_VERSION = 1;
243
+ var GMAIL_INBOX_BASE_URLS = {
244
+ "live": "https://gmail.googleapis.com"
245
+ };
246
+ var GMAIL_INBOX_REQUIRES = [
247
+ "accessToken",
248
+ "refreshToken",
249
+ "clientId",
250
+ "clientSecret"
251
+ ];
252
+ function gmailInboxAuthorize(credentials, request, _mode) {
253
+ request.headers.Authorization = `Bearer ${credentials.accessToken ?? ""}`;
254
+ }
255
+ var GMAIL_INBOX = {
256
+ service: "gmail_inbox",
257
+ title: "Gmail Inbox",
258
+ sandbox: "none",
259
+ baseUrls: { ...GMAIL_INBOX_BASE_URLS },
260
+ requires: [...GMAIL_INBOX_REQUIRES],
261
+ authorize: gmailInboxAuthorize,
262
+ faker: gmailInboxFaker
263
+ };
264
+ var HISTORY_LIST_OPERATION = "history_list";
265
+ async function gmailInboxHistoryList(options) {
266
+ const config = options.config ?? {};
267
+ if (config.userId === void 0 || config.userId === null || config.userId === "") {
268
+ throw new Error(`history_list: "userId" is required (Mailbox).`);
269
+ }
270
+ if (config.startHistoryId === void 0 || config.startHistoryId === null || config.startHistoryId === "") {
271
+ throw new Error(`history_list: "startHistoryId" is required (Start history id).`);
272
+ }
273
+ {
274
+ const n = Number(config.maxResults);
275
+ const given = config.maxResults !== void 0 && config.maxResults !== null && config.maxResults !== "";
276
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 500)) {
277
+ throw new Error(
278
+ `history_list: "maxResults" must be a integer, got ${JSON.stringify(config.maxResults)}.`
279
+ );
280
+ }
281
+ }
282
+ return fancyConnectorCore.callConnector(GMAIL_INBOX, {
283
+ operation: HISTORY_LIST_OPERATION,
284
+ config,
285
+ input: options.input,
286
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
287
+ ...options.mode === void 0 ? {} : { mode: options.mode },
288
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
289
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
290
+ ...options.transport === void 0 ? {} : { transport: options.transport },
291
+ request: {
292
+ method: "GET",
293
+ path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/history`,
294
+ query: {
295
+ "startHistoryId": String(config.startHistoryId),
296
+ ...config.historyTypes !== void 0 && config.historyTypes !== null && config.historyTypes !== "" ? { "historyTypes": String(config.historyTypes) } : {},
297
+ ...config.labelId !== void 0 && config.labelId !== null && config.labelId !== "" ? { "labelId": String(config.labelId) } : {},
298
+ "maxResults": config.maxResults !== void 0 && config.maxResults !== null && config.maxResults !== "" ? Math.trunc(Number(config.maxResults)) : 100,
299
+ ...config.pageToken !== void 0 && config.pageToken !== null && config.pageToken !== "" ? { "pageToken": String(config.pageToken) } : {}
300
+ }
301
+ }
302
+ });
303
+ }
304
+ var LABEL_LIST_OPERATION = "label_list";
305
+ async function gmailInboxLabelList(options) {
306
+ const config = options.config ?? {};
307
+ if (config.userId === void 0 || config.userId === null || config.userId === "") {
308
+ throw new Error(`label_list: "userId" is required (Mailbox).`);
309
+ }
310
+ return fancyConnectorCore.callConnector(GMAIL_INBOX, {
311
+ operation: LABEL_LIST_OPERATION,
312
+ config,
313
+ input: options.input,
314
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
315
+ ...options.mode === void 0 ? {} : { mode: options.mode },
316
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
317
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
318
+ ...options.transport === void 0 ? {} : { transport: options.transport },
319
+ request: {
320
+ method: "GET",
321
+ path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/labels`,
322
+ query: {}
323
+ }
324
+ });
325
+ }
326
+ var MAILBOX_STOP_OPERATION = "mailbox_stop";
327
+ async function gmailInboxMailboxStop(options) {
328
+ const config = options.config ?? {};
329
+ if (config.userId === void 0 || config.userId === null || config.userId === "") {
330
+ throw new Error(`mailbox_stop: "userId" is required (Mailbox).`);
331
+ }
332
+ return fancyConnectorCore.callConnector(GMAIL_INBOX, {
333
+ operation: MAILBOX_STOP_OPERATION,
334
+ config,
335
+ input: options.input,
336
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
337
+ ...options.mode === void 0 ? {} : { mode: options.mode },
338
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
339
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
340
+ ...options.transport === void 0 ? {} : { transport: options.transport },
341
+ request: {
342
+ method: "POST",
343
+ path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/stop`,
344
+ json: {}
345
+ }
346
+ });
347
+ }
348
+ var MAILBOX_WATCH_OPERATION = "mailbox_watch";
349
+ async function gmailInboxMailboxWatch(options) {
350
+ const config = options.config ?? {};
351
+ if (config.userId === void 0 || config.userId === null || config.userId === "") {
352
+ throw new Error(`mailbox_watch: "userId" is required (Mailbox).`);
353
+ }
354
+ if (config.topicName === void 0 || config.topicName === null || config.topicName === "") {
355
+ throw new Error(`mailbox_watch: "topicName" is required (Pub/Sub topic).`);
356
+ }
357
+ return fancyConnectorCore.callConnector(GMAIL_INBOX, {
358
+ operation: MAILBOX_WATCH_OPERATION,
359
+ config,
360
+ input: options.input,
361
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
362
+ ...options.mode === void 0 ? {} : { mode: options.mode },
363
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
364
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
365
+ ...options.transport === void 0 ? {} : { transport: options.transport },
366
+ request: {
367
+ method: "POST",
368
+ path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/watch`,
369
+ json: {
370
+ "topicName": String(config.topicName).trim(),
371
+ ...config.labelIds !== void 0 && config.labelIds !== null && config.labelIds !== "" ? { "labelIds": labelidsList(config.labelIds) } : {},
372
+ ...config.labelFilterBehavior !== void 0 && config.labelFilterBehavior !== null && config.labelFilterBehavior !== "" ? { "labelFilterBehavior": String(config.labelFilterBehavior) } : {}
373
+ }
374
+ }
375
+ });
376
+ }
377
+ function labelidsList(value) {
378
+ const items = Array.isArray(value) ? value.map(String) : typeof value === "string" ? value.split(",") : [];
379
+ return items.map((item) => item.trim()).filter(Boolean);
380
+ }
381
+ var MESSAGE_GET_OPERATION = "message_get";
382
+ async function gmailInboxMessageGet(options) {
383
+ const config = options.config ?? {};
384
+ if (config.userId === void 0 || config.userId === null || config.userId === "") {
385
+ throw new Error(`message_get: "userId" is required (Mailbox).`);
386
+ }
387
+ if (config.id === void 0 || config.id === null || config.id === "") {
388
+ throw new Error(`message_get: "id" is required (Message ID).`);
389
+ }
390
+ return fancyConnectorCore.callConnector(GMAIL_INBOX, {
391
+ operation: MESSAGE_GET_OPERATION,
392
+ config,
393
+ input: options.input,
394
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
395
+ ...options.mode === void 0 ? {} : { mode: options.mode },
396
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
397
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
398
+ ...options.transport === void 0 ? {} : { transport: options.transport },
399
+ request: {
400
+ method: "GET",
401
+ path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/messages/${encodeURIComponent(String(config.id))}`,
402
+ query: {
403
+ "format": "full"
404
+ }
405
+ }
406
+ });
407
+ }
408
+ var MESSAGE_LIST_OPERATION = "message_list";
409
+ async function gmailInboxMessageList(options) {
410
+ const config = options.config ?? {};
411
+ if (config.userId === void 0 || config.userId === null || config.userId === "") {
412
+ throw new Error(`message_list: "userId" is required (Mailbox).`);
413
+ }
414
+ {
415
+ const n = Number(config.maxResults);
416
+ const given = config.maxResults !== void 0 && config.maxResults !== null && config.maxResults !== "";
417
+ if (given && !(Number.isInteger(n) && n >= 1 && n <= 500)) {
418
+ throw new Error(
419
+ `message_list: "maxResults" must be a integer, got ${JSON.stringify(config.maxResults)}.`
420
+ );
421
+ }
422
+ }
423
+ return fancyConnectorCore.callConnector(GMAIL_INBOX, {
424
+ operation: MESSAGE_LIST_OPERATION,
425
+ config,
426
+ input: options.input,
427
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
428
+ ...options.mode === void 0 ? {} : { mode: options.mode },
429
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
430
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
431
+ ...options.transport === void 0 ? {} : { transport: options.transport },
432
+ request: {
433
+ method: "GET",
434
+ path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/messages`,
435
+ query: {
436
+ ...config.q !== void 0 && config.q !== null && config.q !== "" ? { "q": String(config.q) } : {},
437
+ ...config.labelId !== void 0 && config.labelId !== null && config.labelId !== "" ? { "labelIds": String(config.labelId) } : {},
438
+ ...config.includeSpamTrash !== void 0 && config.includeSpamTrash !== null && config.includeSpamTrash !== "" ? { "includeSpamTrash": Boolean(config.includeSpamTrash) } : {},
439
+ "maxResults": config.maxResults !== void 0 && config.maxResults !== null && config.maxResults !== "" ? Math.trunc(Number(config.maxResults)) : 100,
440
+ ...config.pageToken !== void 0 && config.pageToken !== null && config.pageToken !== "" ? { "pageToken": String(config.pageToken) } : {}
441
+ }
442
+ }
443
+ });
444
+ }
445
+ var THREAD_GET_OPERATION = "thread_get";
446
+ async function gmailInboxThreadGet(options) {
447
+ const config = options.config ?? {};
448
+ if (config.userId === void 0 || config.userId === null || config.userId === "") {
449
+ throw new Error(`thread_get: "userId" is required (Mailbox).`);
450
+ }
451
+ if (config.id === void 0 || config.id === null || config.id === "") {
452
+ throw new Error(`thread_get: "id" is required (Thread ID).`);
453
+ }
454
+ return fancyConnectorCore.callConnector(GMAIL_INBOX, {
455
+ operation: THREAD_GET_OPERATION,
456
+ config,
457
+ input: options.input,
458
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
459
+ ...options.mode === void 0 ? {} : { mode: options.mode },
460
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
461
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
462
+ ...options.transport === void 0 ? {} : { transport: options.transport },
463
+ request: {
464
+ method: "GET",
465
+ path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/threads/${encodeURIComponent(String(config.id))}`,
466
+ query: {
467
+ "format": "full"
468
+ }
469
+ }
470
+ });
471
+ }
472
+ var GMAIL_INBOX_MESSAGE_RECEIVED_OIDC_SCHEME = {
473
+ kind: "oidc-jwt",
474
+ header: "Authorization",
475
+ issuers: ["https://accounts.google.com", "accounts.google.com"],
476
+ principalClaim: "email",
477
+ verifiedClaim: "email_verified"
478
+ };
479
+ var GMAIL_INBOX_MESSAGE_RECEIVED_LEASE = {
480
+ expiresAtFrom: "expiration",
481
+ expiresAtUnit: "epoch-ms",
482
+ renewBeforeSeconds: 86400,
483
+ renewOperation: "mailbox_watch"
484
+ };
485
+ var GMAIL_INBOX_MESSAGE_RECEIVED_SUBSCRIPTION = { create: "mailbox_watch", renew: "mailbox_watch", stop: "mailbox_stop" };
486
+ var GMAIL_INBOX_MESSAGE_RECEIVED_DECODE = {
487
+ kind: "pubsub-push"
488
+ };
489
+ var GMAIL_INBOX_MESSAGE_RECEIVED = {
490
+ service: "gmail_inbox",
491
+ operation: "message_received",
492
+ delivery: "subscription",
493
+ setup: "In YOUR app's Google Cloud project (the one owning the OAuth client): create a Pub/Sub topic, grant publish on it to gmail-api-push@system.gserviceaccount.com, and create a PUSH subscription to the route your host mounts for this trigger, with authentication on (a service account you choose; the endpoint URL as the audience). Put that audience and service account on the connection as pushAudience and pushServiceAccount, and fetch Google's signing keys for verification. Then call mailbox_watch with the topic for each mailbox and store its historyId as the trigger's cursor (startHistoryId); renew the watch daily. ONE topic serves every mailbox: route each push by its emailAddress, and only after the token verifies, to a mailbox you watched; drop an unmapped address with a 2xx. Persist cursor.next when a run succeeds. On cursor-expired or cursor-overflow, watch again for a fresh historyId FIRST, then list with message_list using the resyncQuery, and match it against the mail you already handled. This trigger never changes read state.",
494
+ subscriptionTtl: 604800,
495
+ lease: GMAIL_INBOX_MESSAGE_RECEIVED_LEASE,
496
+ verification: {
497
+ scheme: GMAIL_INBOX_MESSAGE_RECEIVED_OIDC_SCHEME
498
+ },
499
+ decode: GMAIL_INBOX_MESSAGE_RECEIVED_DECODE,
500
+ route: { by: "emailAddress", path: "data.emailAddress" },
501
+ faker: gmailInboxFaker
502
+ };
503
+ var GMAIL_INBOX_MESSAGE_RECEIVED_CURSOR = {
504
+ param: "startHistoryId",
505
+ advanceFrom: "historyId",
506
+ page: { param: "pageToken", from: "nextPageToken", collect: "history", maxPages: 20 },
507
+ expiredStatus: 404
508
+ };
509
+ async function readGmailInboxMessageReceivedAfter(event, config, options = {}) {
510
+ const stored = config.startHistoryId ?? (config.mode === "fake" ? "1" : void 0);
511
+ const read = await fancyConnectorCore.readWithCursor(
512
+ GMAIL_INBOX_MESSAGE_RECEIVED_CURSOR,
513
+ stored,
514
+ async (params) => {
515
+ const result = await gmailInboxHistoryList({
516
+ config: {
517
+ userId: "me",
518
+ maxResults: 100,
519
+ ...config.connection === void 0 || config.connection === null ? {} : { connection: config.connection },
520
+ ...config.mode === void 0 || config.mode === null ? {} : { mode: config.mode },
521
+ labelId: config.labelId ?? "INBOX",
522
+ historyTypes: config.historyTypes ?? "messageAdded",
523
+ ...params
524
+ },
525
+ input: event,
526
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
527
+ ...options.transport === void 0 ? {} : { transport: options.transport }
528
+ });
529
+ return result.data;
530
+ },
531
+ { resyncQuery: `newer_than:${String(config.resyncWindowDays ?? 7)}d` }
532
+ );
533
+ return {
534
+ ...event !== null && typeof event === "object" ? event : {},
535
+ history: read.data,
536
+ cursor: read.cursor
537
+ };
538
+ }
539
+ function verifyGmailInboxDelivery(delivery, expected, now) {
540
+ return fancyConnectorCore.verifyDelivery(GMAIL_INBOX_MESSAGE_RECEIVED, delivery, void 0, now, {
541
+ keys: expected.keys,
542
+ audience: expected.pushAudience ?? null,
543
+ principal: expected.pushServiceAccount ?? null
544
+ });
545
+ }
546
+ function decodeGmailInboxDelivery(raw) {
547
+ return fancyConnectorCore.decodeDelivery(GMAIL_INBOX_MESSAGE_RECEIVED_DECODE, raw);
548
+ }
549
+
550
+ exports.CONNECTOR_API_VERSION = CONNECTOR_API_VERSION;
551
+ exports.GMAIL_INBOX = GMAIL_INBOX;
552
+ exports.GMAIL_INBOX_BASE_URLS = GMAIL_INBOX_BASE_URLS;
553
+ exports.GMAIL_INBOX_MESSAGE_RECEIVED = GMAIL_INBOX_MESSAGE_RECEIVED;
554
+ exports.GMAIL_INBOX_MESSAGE_RECEIVED_CURSOR = GMAIL_INBOX_MESSAGE_RECEIVED_CURSOR;
555
+ exports.GMAIL_INBOX_MESSAGE_RECEIVED_DECODE = GMAIL_INBOX_MESSAGE_RECEIVED_DECODE;
556
+ exports.GMAIL_INBOX_MESSAGE_RECEIVED_LEASE = GMAIL_INBOX_MESSAGE_RECEIVED_LEASE;
557
+ exports.GMAIL_INBOX_MESSAGE_RECEIVED_OIDC_SCHEME = GMAIL_INBOX_MESSAGE_RECEIVED_OIDC_SCHEME;
558
+ exports.GMAIL_INBOX_MESSAGE_RECEIVED_SUBSCRIPTION = GMAIL_INBOX_MESSAGE_RECEIVED_SUBSCRIPTION;
559
+ exports.GMAIL_INBOX_REQUIRES = GMAIL_INBOX_REQUIRES;
560
+ exports.HISTORY_LIST_OPERATION = HISTORY_LIST_OPERATION;
561
+ exports.LABEL_LIST_OPERATION = LABEL_LIST_OPERATION;
562
+ exports.MAILBOX_STOP_OPERATION = MAILBOX_STOP_OPERATION;
563
+ exports.MAILBOX_WATCH_OPERATION = MAILBOX_WATCH_OPERATION;
564
+ exports.MESSAGE_GET_OPERATION = MESSAGE_GET_OPERATION;
565
+ exports.MESSAGE_LIST_OPERATION = MESSAGE_LIST_OPERATION;
566
+ exports.THREAD_GET_OPERATION = THREAD_GET_OPERATION;
567
+ exports.decodeGmailInboxDelivery = decodeGmailInboxDelivery;
568
+ exports.gmailInboxAuthorize = gmailInboxAuthorize;
569
+ exports.gmailInboxFaker = gmailInboxFaker;
570
+ exports.gmailInboxHistoryList = gmailInboxHistoryList;
571
+ exports.gmailInboxLabelList = gmailInboxLabelList;
572
+ exports.gmailInboxMailboxStop = gmailInboxMailboxStop;
573
+ exports.gmailInboxMailboxWatch = gmailInboxMailboxWatch;
574
+ exports.gmailInboxMessageGet = gmailInboxMessageGet;
575
+ exports.gmailInboxMessageList = gmailInboxMessageList;
576
+ exports.gmailInboxThreadGet = gmailInboxThreadGet;
577
+ exports.readGmailInboxMessageReceivedAfter = readGmailInboxMessageReceivedAfter;
578
+ exports.verifyGmailInboxDelivery = verifyGmailInboxDelivery;
579
+ //# sourceMappingURL=index.cjs.map
580
+ //# sourceMappingURL=index.cjs.map