@particle-academy/gmail-inbox-js 0.1.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.
@@ -1,326 +0,0 @@
1
- import { callConnector } from '@particle-academy/fancy-connector-core';
2
-
3
- // src/faker.ts
4
- function fakeLabelList({ config, fake }) {
5
- return {
6
- "labels": [
7
- {
8
- "id": "INBOX",
9
- "name": "INBOX",
10
- "type": "system"
11
- },
12
- {
13
- "id": "UNREAD",
14
- "name": "UNREAD",
15
- "type": "system"
16
- },
17
- {
18
- "id": "IMPORTANT",
19
- "name": "IMPORTANT",
20
- "type": "system",
21
- "messagesTotal": 412,
22
- "messagesUnread": 18,
23
- "threadsTotal": 203,
24
- "threadsUnread": 11
25
- },
26
- {
27
- "id": fake.id("Label"),
28
- "name": "Design Reviews",
29
- "type": "user",
30
- "messageListVisibility": "show",
31
- "labelListVisibility": "labelShow",
32
- "messagesTotal": 27,
33
- "messagesUnread": 2,
34
- "threadsTotal": 9,
35
- "threadsUnread": 1
36
- }
37
- ]
38
- };
39
- }
40
- function fakeMessageGet({ config, fake }) {
41
- return {
42
- "id": config.id !== void 0 && config.id !== null && config.id !== "" ? String(config.id) : fake.hex(16),
43
- "threadId": fake.hex(16),
44
- "labelIds": [
45
- "INBOX",
46
- "UNREAD",
47
- "IMPORTANT"
48
- ],
49
- "snippet": "Hi Ada, just confirming the design review is still on for Thursday at 2pm. Let me know if...",
50
- "internalDate": "1790712000000",
51
- "payload": {
52
- "mimeType": "text/plain",
53
- "headers": [
54
- {
55
- "name": "From",
56
- "value": "Grace Hopper <grace@example.test>"
57
- },
58
- {
59
- "name": "To",
60
- "value": "Ada Lovelace <ada@example.test>"
61
- },
62
- {
63
- "name": "Subject",
64
- "value": "Re: Design review Thursday"
65
- },
66
- {
67
- "name": "Date",
68
- "value": "Tue, 29 Sep 2026 14:03:00 -0400"
69
- }
70
- ],
71
- "body": {
72
- "size": 612,
73
- "data": fake.id("base64url_body")
74
- }
75
- }
76
- };
77
- }
78
- function fakeMessageList({ config, fake }) {
79
- return {
80
- "messages": [
81
- {
82
- "id": fake.hex(16),
83
- "threadId": fake.hex(16)
84
- },
85
- {
86
- "id": fake.hex(16),
87
- "threadId": fake.hex(16)
88
- }
89
- ],
90
- "resultSizeEstimate": 2
91
- };
92
- }
93
- function fakeThreadGet({ config, fake }) {
94
- return {
95
- "id": config.id !== void 0 && config.id !== null && config.id !== "" ? String(config.id) : fake.hex(16),
96
- "historyId": Array.from({ length: 10 }, () => fake.int(0, 9)).join(""),
97
- "messages": [
98
- {
99
- "id": fake.hex(16),
100
- "labelIds": [
101
- "INBOX",
102
- "IMPORTANT"
103
- ],
104
- "snippet": "Hey team, scheduling the Q3 design review for Thursday at 2pm. Conference room B...",
105
- "internalDate": "1790625600000",
106
- "payload": {
107
- "mimeType": "text/plain",
108
- "headers": [
109
- {
110
- "name": "From",
111
- "value": "Ada Lovelace <ada@example.test>"
112
- },
113
- {
114
- "name": "To",
115
- "value": "Grace Hopper <grace@example.test>"
116
- },
117
- {
118
- "name": "Subject",
119
- "value": "Design review Thursday"
120
- },
121
- {
122
- "name": "Date",
123
- "value": "Mon, 28 Sep 2026 09:00:00 -0400"
124
- }
125
- ],
126
- "body": {
127
- "size": 540,
128
- "data": fake.id("base64url_body")
129
- }
130
- }
131
- },
132
- {
133
- "id": fake.hex(16),
134
- "labelIds": [
135
- "INBOX",
136
- "UNREAD",
137
- "IMPORTANT"
138
- ],
139
- "snippet": "Hi Ada, just confirming the design review is still on for Thursday at 2pm. Let me know if...",
140
- "internalDate": "1790712000000",
141
- "payload": {
142
- "mimeType": "text/plain",
143
- "headers": [
144
- {
145
- "name": "From",
146
- "value": "Grace Hopper <grace@example.test>"
147
- },
148
- {
149
- "name": "To",
150
- "value": "Ada Lovelace <ada@example.test>"
151
- },
152
- {
153
- "name": "Subject",
154
- "value": "Re: Design review Thursday"
155
- },
156
- {
157
- "name": "Date",
158
- "value": "Tue, 29 Sep 2026 14:03:00 -0400"
159
- }
160
- ],
161
- "body": {
162
- "size": 612,
163
- "data": fake.id("base64url_body")
164
- }
165
- }
166
- }
167
- ]
168
- };
169
- }
170
- var gmailInboxFaker = (operation, request) => {
171
- switch (operation) {
172
- case "label_list":
173
- return fakeLabelList(request);
174
- case "message_get":
175
- return fakeMessageGet(request);
176
- case "message_list":
177
- return fakeMessageList(request);
178
- case "thread_get":
179
- return fakeThreadGet(request);
180
- default:
181
- throw new Error(
182
- `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.`
183
- );
184
- }
185
- };
186
-
187
- // src/service.ts
188
- var CONNECTOR_API_VERSION = 1;
189
- var GMAIL_INBOX_BASE_URLS = {
190
- "live": "https://gmail.googleapis.com"
191
- };
192
- var GMAIL_INBOX_REQUIRES = [
193
- "accessToken",
194
- "refreshToken",
195
- "clientId",
196
- "clientSecret"
197
- ];
198
- function gmailInboxAuthorize(credentials, request, _mode) {
199
- request.headers.Authorization = `Bearer ${credentials.accessToken ?? ""}`;
200
- }
201
- var GMAIL_INBOX = {
202
- service: "gmail_inbox",
203
- title: "Gmail Inbox",
204
- sandbox: "none",
205
- baseUrls: { ...GMAIL_INBOX_BASE_URLS },
206
- requires: [...GMAIL_INBOX_REQUIRES],
207
- authorize: gmailInboxAuthorize,
208
- faker: gmailInboxFaker
209
- };
210
- var LABEL_LIST_OPERATION = "label_list";
211
- async function gmailInboxLabelList(options) {
212
- const config = options.config ?? {};
213
- if (config.userId === void 0 || config.userId === null || config.userId === "") {
214
- throw new Error(`label_list: "userId" is required (Mailbox).`);
215
- }
216
- return callConnector(GMAIL_INBOX, {
217
- operation: LABEL_LIST_OPERATION,
218
- config,
219
- input: options.input,
220
- ...options.credentials === void 0 ? {} : { credentials: options.credentials },
221
- ...options.mode === void 0 ? {} : { mode: options.mode },
222
- ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
223
- ...options.attempts === void 0 ? {} : { attempts: options.attempts },
224
- ...options.transport === void 0 ? {} : { transport: options.transport },
225
- request: {
226
- method: "GET",
227
- path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/labels`,
228
- query: {}
229
- }
230
- });
231
- }
232
- var MESSAGE_GET_OPERATION = "message_get";
233
- async function gmailInboxMessageGet(options) {
234
- const config = options.config ?? {};
235
- if (config.userId === void 0 || config.userId === null || config.userId === "") {
236
- throw new Error(`message_get: "userId" is required (Mailbox).`);
237
- }
238
- if (config.id === void 0 || config.id === null || config.id === "") {
239
- throw new Error(`message_get: "id" is required (Message ID).`);
240
- }
241
- return callConnector(GMAIL_INBOX, {
242
- operation: MESSAGE_GET_OPERATION,
243
- config,
244
- input: options.input,
245
- ...options.credentials === void 0 ? {} : { credentials: options.credentials },
246
- ...options.mode === void 0 ? {} : { mode: options.mode },
247
- ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
248
- ...options.attempts === void 0 ? {} : { attempts: options.attempts },
249
- ...options.transport === void 0 ? {} : { transport: options.transport },
250
- request: {
251
- method: "GET",
252
- path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/messages/${encodeURIComponent(String(config.id))}`,
253
- query: {
254
- "format": "full"
255
- }
256
- }
257
- });
258
- }
259
- var MESSAGE_LIST_OPERATION = "message_list";
260
- async function gmailInboxMessageList(options) {
261
- const config = options.config ?? {};
262
- if (config.userId === void 0 || config.userId === null || config.userId === "") {
263
- throw new Error(`message_list: "userId" is required (Mailbox).`);
264
- }
265
- {
266
- const n = Number(config.maxResults);
267
- const given = config.maxResults !== void 0 && config.maxResults !== null && config.maxResults !== "";
268
- if (given && !(Number.isInteger(n) && n >= 1 && n <= 500)) {
269
- throw new Error(
270
- `message_list: "maxResults" must be a integer, got ${JSON.stringify(config.maxResults)}.`
271
- );
272
- }
273
- }
274
- return callConnector(GMAIL_INBOX, {
275
- operation: MESSAGE_LIST_OPERATION,
276
- config,
277
- input: options.input,
278
- ...options.credentials === void 0 ? {} : { credentials: options.credentials },
279
- ...options.mode === void 0 ? {} : { mode: options.mode },
280
- ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
281
- ...options.attempts === void 0 ? {} : { attempts: options.attempts },
282
- ...options.transport === void 0 ? {} : { transport: options.transport },
283
- request: {
284
- method: "GET",
285
- path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/messages`,
286
- query: {
287
- ...config.q !== void 0 && config.q !== null && config.q !== "" ? { "q": String(config.q) } : {},
288
- ...config.labelId !== void 0 && config.labelId !== null && config.labelId !== "" ? { "labelIds": String(config.labelId) } : {},
289
- ...config.includeSpamTrash !== void 0 && config.includeSpamTrash !== null && config.includeSpamTrash !== "" ? { "includeSpamTrash": Boolean(config.includeSpamTrash) } : {},
290
- "maxResults": config.maxResults !== void 0 && config.maxResults !== null && config.maxResults !== "" ? Math.trunc(Number(config.maxResults)) : 100,
291
- ...config.pageToken !== void 0 && config.pageToken !== null && config.pageToken !== "" ? { "pageToken": String(config.pageToken) } : {}
292
- }
293
- }
294
- });
295
- }
296
- var THREAD_GET_OPERATION = "thread_get";
297
- async function gmailInboxThreadGet(options) {
298
- const config = options.config ?? {};
299
- if (config.userId === void 0 || config.userId === null || config.userId === "") {
300
- throw new Error(`thread_get: "userId" is required (Mailbox).`);
301
- }
302
- if (config.id === void 0 || config.id === null || config.id === "") {
303
- throw new Error(`thread_get: "id" is required (Thread ID).`);
304
- }
305
- return callConnector(GMAIL_INBOX, {
306
- operation: THREAD_GET_OPERATION,
307
- config,
308
- input: options.input,
309
- ...options.credentials === void 0 ? {} : { credentials: options.credentials },
310
- ...options.mode === void 0 ? {} : { mode: options.mode },
311
- ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
312
- ...options.attempts === void 0 ? {} : { attempts: options.attempts },
313
- ...options.transport === void 0 ? {} : { transport: options.transport },
314
- request: {
315
- method: "GET",
316
- path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/threads/${encodeURIComponent(String(config.id))}`,
317
- query: {
318
- "format": "full"
319
- }
320
- }
321
- });
322
- }
323
-
324
- export { CONNECTOR_API_VERSION, GMAIL_INBOX, GMAIL_INBOX_BASE_URLS, GMAIL_INBOX_REQUIRES, LABEL_LIST_OPERATION, MESSAGE_GET_OPERATION, MESSAGE_LIST_OPERATION, THREAD_GET_OPERATION, gmailInboxAuthorize, gmailInboxFaker, gmailInboxLabelList, gmailInboxMessageGet, gmailInboxMessageList, gmailInboxThreadGet };
325
- //# sourceMappingURL=chunk-UT3U2BPM.js.map
326
- //# sourceMappingURL=chunk-UT3U2BPM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/label-list.ts","../src/actions/message-get.ts","../src/actions/message-list.ts","../src/actions/thread-get.ts"],"names":["callConnector"],"mappings":";;;AAyBA,SAAS,aAAA,CAAc,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC7D,EAAA,OAAO;AAAA,IACL,QAAA,EAAU;AAAA,MACR;AAAA,QACE,IAAA,EAAM,OAAA;AAAA,QACN,MAAA,EAAQ,OAAA;AAAA,QACR,MAAA,EAAQ;AAAA,OACV;AAAA,MACA;AAAA,QACE,IAAA,EAAM,QAAA;AAAA,QACN,MAAA,EAAQ,QAAA;AAAA,QACR,MAAA,EAAQ;AAAA,OACV;AAAA,MACA;AAAA,QACE,IAAA,EAAM,WAAA;AAAA,QACN,MAAA,EAAQ,WAAA;AAAA,QACR,MAAA,EAAQ,QAAA;AAAA,QACR,eAAA,EAAiB,GAAA;AAAA,QACjB,gBAAA,EAAkB,EAAA;AAAA,QAClB,cAAA,EAAgB,GAAA;AAAA,QAChB,eAAA,EAAiB;AAAA,OACnB;AAAA,MACA;AAAA,QACE,IAAA,EAAM,IAAA,CAAK,EAAA,CAAG,OAAO,CAAA;AAAA,QACrB,MAAA,EAAQ,gBAAA;AAAA,QACR,MAAA,EAAQ,MAAA;AAAA,QACR,uBAAA,EAAyB,MAAA;AAAA,QACzB,qBAAA,EAAuB,W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L,QAAA,EAAU;AAAA;AACZ;AACF,GACD,CAAA;AACH","file":"chunk-UT3U2BPM.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/fixtures/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/fixtures/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- gmail_inbox\n */\n\n/**\n * The Gmail Inbox faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Gmail Inbox actually publishes, so an author can wire {{ $json.data.id\n * }} against a fake and have it keep working against the real thing.\n *\n * Deterministic — same inputs, same output. A faker returning a fresh uuid\n * every call cannot be asserted on, so its fixtures degrade to \"it did not\n * throw\", which is the assertion that catches nothing.\n */\n\nimport type { ConnectorFaker, FakeRequest } from \"@particle-academy/fancy-connector-core\";\n\nfunction fakeLabelList({ config, fake }: FakeRequest): unknown {\n return {\n \"labels\": [\n {\n \"id\": \"INBOX\",\n \"name\": \"INBOX\",\n \"type\": \"system\",\n },\n {\n \"id\": \"UNREAD\",\n \"name\": \"UNREAD\",\n \"type\": \"system\",\n },\n {\n \"id\": \"IMPORTANT\",\n \"name\": \"IMPORTANT\",\n \"type\": \"system\",\n \"messagesTotal\": 412,\n \"messagesUnread\": 18,\n \"threadsTotal\": 203,\n \"threadsUnread\": 11,\n },\n {\n \"id\": fake.id(\"Label\"),\n \"name\": \"Design Reviews\",\n \"type\": \"user\",\n \"messageListVisibility\": \"show\",\n \"labelListVisibility\": \"labelShow\",\n \"messagesTotal\": 27,\n \"messagesUnread\": 2,\n \"threadsTotal\": 9,\n \"threadsUnread\": 1,\n },\n ],\n };\n}\n\nfunction fakeMessageGet({ config, fake }: FakeRequest): unknown {\n return {\n \"id\": (config.id !== undefined && config.id !== null && config.id !== \"\" ? String(config.id) : fake.hex(16)),\n \"threadId\": fake.hex(16),\n \"labelIds\": [\n \"INBOX\",\n \"UNREAD\",\n \"IMPORTANT\",\n ],\n \"snippet\": \"Hi Ada, just confirming the design review is still on for Thursday at 2pm. Let me know if...\",\n \"internalDate\": \"1790712000000\",\n \"payload\": {\n \"mimeType\": \"text/plain\",\n \"headers\": [\n {\n \"name\": \"From\",\n \"value\": \"Grace Hopper <grace@example.test>\",\n },\n {\n \"name\": \"To\",\n \"value\": \"Ada Lovelace <ada@example.test>\",\n },\n {\n \"name\": \"Subject\",\n \"value\": \"Re: Design review Thursday\",\n },\n {\n \"name\": \"Date\",\n \"value\": \"Tue, 29 Sep 2026 14:03:00 -0400\",\n },\n ],\n \"body\": {\n \"size\": 612,\n \"data\": fake.id(\"base64url_body\"),\n },\n },\n };\n}\n\nfunction fakeMessageList({ config, fake }: FakeRequest): unknown {\n return {\n \"messages\": [\n {\n \"id\": fake.hex(16),\n \"threadId\": fake.hex(16),\n },\n {\n \"id\": fake.hex(16),\n \"threadId\": fake.hex(16),\n },\n ],\n \"resultSizeEstimate\": 2,\n };\n}\n\nfunction fakeThreadGet({ config, fake }: FakeRequest): unknown {\n return {\n \"id\": (config.id !== undefined && config.id !== null && config.id !== \"\" ? String(config.id) : fake.hex(16)),\n \"historyId\": Array.from({ length: 10 }, () => fake.int(0, 9)).join(\"\"),\n \"messages\": [\n {\n \"id\": fake.hex(16),\n \"labelIds\": [\n \"INBOX\",\n \"IMPORTANT\",\n ],\n \"snippet\": \"Hey team, scheduling the Q3 design review for Thursday at 2pm. Conference room B...\",\n \"internalDate\": \"1790625600000\",\n \"payload\": {\n \"mimeType\": \"text/plain\",\n \"headers\": [\n {\n \"name\": \"From\",\n \"value\": \"Ada Lovelace <ada@example.test>\",\n },\n {\n \"name\": \"To\",\n \"value\": \"Grace Hopper <grace@example.test>\",\n },\n {\n \"name\": \"Subject\",\n \"value\": \"Design review Thursday\",\n },\n {\n \"name\": \"Date\",\n \"value\": \"Mon, 28 Sep 2026 09:00:00 -0400\",\n },\n ],\n \"body\": {\n \"size\": 540,\n \"data\": fake.id(\"base64url_body\"),\n },\n },\n },\n {\n \"id\": fake.hex(16),\n \"labelIds\": [\n \"INBOX\",\n \"UNREAD\",\n \"IMPORTANT\",\n ],\n \"snippet\": \"Hi Ada, just confirming the design review is still on for Thursday at 2pm. Let me know if...\",\n \"internalDate\": \"1790712000000\",\n \"payload\": {\n \"mimeType\": \"text/plain\",\n \"headers\": [\n {\n \"name\": \"From\",\n \"value\": \"Grace Hopper <grace@example.test>\",\n },\n {\n \"name\": \"To\",\n \"value\": \"Ada Lovelace <ada@example.test>\",\n },\n {\n \"name\": \"Subject\",\n \"value\": \"Re: Design review Thursday\",\n },\n {\n \"name\": \"Date\",\n \"value\": \"Tue, 29 Sep 2026 14:03:00 -0400\",\n },\n ],\n \"body\": {\n \"size\": 612,\n \"data\": fake.id(\"base64url_body\"),\n },\n },\n },\n ],\n };\n}\n\nexport const gmailInboxFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"label_list\":\n return fakeLabelList(request);\n\n case \"message_get\":\n return fakeMessageGet(request);\n\n case \"message_list\":\n return fakeMessageList(request);\n\n case \"thread_get\":\n return fakeThreadGet(request);\n\n default:\n // A faker asked for an operation it has no shape for must SAY so. Making\n // something up would produce a green run whose output silently has none\n // of the fields the author is about to reference.\n throw new Error(\n `gmail_inbox: no fake response is defined for \"${operation}\". ` +\n \"Add a fixture under provider/fixtures/ and regenerate — a connector without a faker \" +\n \"cannot be developed against, tested, or demonstrated.\",\n );\n }\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- gmail_inbox\n */\n\n/**\n * Gmail Inbox, as one service descriptor shared by every Gmail Inbox\n * operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Gmail Inbox: its base URL, its auth\n * scheme, its idempotency header, and its faker.\n *\n * ## The sandbox trap, written down where it is used\n *\n * Gmail has no sandbox. Every read reaches the connected account's real mail.\n * The faker is the only way to develop against it without touching a real\n * mailbox.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { gmailInboxFaker } from \"./faker.js\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported. An imported constant lets an upgrade rewrite the\n * very claim it exists to detect, after which the copy agrees with itself\n * forever.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\nexport const GMAIL_INBOX_BASE_URLS = {\n \"live\": \"https://gmail.googleapis.com\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const GMAIL_INBOX_REQUIRES = [\n \"accessToken\",\n \"refreshToken\",\n \"clientId\",\n \"clientSecret\"\n] as const;\n\n/**\n * Apply Gmail Inbox's auth scheme to an outgoing request.\n *\n *\n *\n * The mode is passed in because for some providers auth and estate are the\n * same decision expressed in the URL; here it is unused, and saying so is\n * cheaper than wondering later whether it was forgotten.\n */\nexport function gmailInboxAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers.Authorization = `Bearer ${credentials.accessToken ?? \"\"}`;\n}\n\n/** The Gmail Inbox service, for the TypeScript runtime. */\nexport const GMAIL_INBOX: ServiceDescriptor = {\n service: \"gmail_inbox\",\n title: \"Gmail Inbox\",\n sandbox: \"none\",\n baseUrls: { ...GMAIL_INBOX_BASE_URLS },\n requires: [...GMAIL_INBOX_REQUIRES],\n authorize: gmailInboxAuthorize,\n faker: gmailInboxFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/label-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/label-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- gmail_inbox\n */\n\n/**\n * List every label on the mailbox, system and user-created.\n *\n * GET /gmail/v1/users/{userId}/labels —\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/list\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Gmail Inbox or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GMAIL_INBOX } from \"../service.js\";\n\nexport const LABEL_LIST_OPERATION = \"label_list\";\n\nexport type LabelListOptions = {\n /** The node's resolved config. Keys: userId. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function gmailInboxLabelList(options: LabelListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.userId === undefined || config.userId === null || config.userId === \"\") {\n throw new Error(`label_list: \"userId\" is required (Mailbox).`);\n }\n\n return callConnector(GMAIL_INBOX, {\n operation: LABEL_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/labels`,\n query: {},\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-get.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/message-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- gmail_inbox\n */\n\n/**\n * Read one message's headers and preview. The body's plain/HTML text is NOT\n * decoded -- see the raw payload for that.\n *\n * GET /gmail/v1/users/{userId}/messages/{id} —\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/get\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Gmail Inbox or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GMAIL_INBOX } from \"../service.js\";\n\nexport const MESSAGE_GET_OPERATION = \"message_get\";\n\nexport type MessageGetOptions = {\n /** The node's resolved config. Keys: userId, id. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function gmailInboxMessageGet(options: MessageGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.userId === undefined || config.userId === null || config.userId === \"\") {\n throw new Error(`message_get: \"userId\" is required (Mailbox).`);\n }\n\n if (config.id === undefined || config.id === null || config.id === \"\") {\n throw new Error(`message_get: \"id\" is required (Message ID).`);\n }\n\n return callConnector(GMAIL_INBOX, {\n operation: MESSAGE_GET_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/messages/${encodeURIComponent(String(config.id))}`,\n query: {\n \"format\": \"full\",\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-list.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/message-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- gmail_inbox\n */\n\n/**\n * List message ids matching a search, newest first.\n *\n * GET /gmail/v1/users/{userId}/messages —\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/list\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Gmail Inbox or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GMAIL_INBOX } from \"../service.js\";\n\nexport const MESSAGE_LIST_OPERATION = \"message_list\";\n\nexport type MessageListOptions = {\n /** The node's resolved config. Keys: userId, q, labelId, includeSpamTrash, maxResults, pageToken. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function gmailInboxMessageList(options: MessageListOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.userId === undefined || config.userId === null || config.userId === \"\") {\n throw new Error(`message_list: \"userId\" is required (Mailbox).`);\n }\n\n {\n const n = Number(config.maxResults);\n const given = config.maxResults !== undefined && config.maxResults !== null && config.maxResults !== \"\";\n if (given && !(Number.isInteger(n) && n >= 1 && n <= 500)) {\n throw new Error(\n `message_list: \"maxResults\" must be a integer, got ${JSON.stringify(config.maxResults)}.`,\n );\n }\n }\n\n return callConnector(GMAIL_INBOX, {\n operation: MESSAGE_LIST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/messages`,\n query: {\n ...(config.q !== undefined && config.q !== null && config.q !== \"\" ? { \"q\": String(config.q) } : {}),\n ...(config.labelId !== undefined && config.labelId !== null && config.labelId !== \"\" ? { \"labelIds\": String(config.labelId) } : {}),\n ...(config.includeSpamTrash !== undefined && config.includeSpamTrash !== null && config.includeSpamTrash !== \"\" ? { \"includeSpamTrash\": Boolean(config.includeSpamTrash) } : {}),\n \"maxResults\": config.maxResults !== undefined && config.maxResults !== null && config.maxResults !== \"\" ? Math.trunc(Number(config.maxResults)) : 100,\n ...(config.pageToken !== undefined && config.pageToken !== null && config.pageToken !== \"\" ? { \"pageToken\": String(config.pageToken) } : {}),\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/thread-get.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/thread-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- gmail_inbox\n */\n\n/**\n * Read every message in a conversation thread, oldest first.\n *\n * GET /gmail/v1/users/{userId}/threads/{id} —\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Gmail Inbox or calls the\n * faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { GMAIL_INBOX } from \"../service.js\";\n\nexport const THREAD_GET_OPERATION = \"thread_get\";\n\nexport type ThreadGetOptions = {\n /** The node's resolved config. Keys: userId, id. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function gmailInboxThreadGet(options: ThreadGetOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.userId === undefined || config.userId === null || config.userId === \"\") {\n throw new Error(`thread_get: \"userId\" is required (Mailbox).`);\n }\n\n if (config.id === undefined || config.id === null || config.id === \"\") {\n throw new Error(`thread_get: \"id\" is required (Thread ID).`);\n }\n\n return callConnector(GMAIL_INBOX, {\n operation: THREAD_GET_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: `/gmail/v1/users/${encodeURIComponent(String(config.userId))}/threads/${encodeURIComponent(String(config.id))}`,\n query: {\n \"format\": \"full\",\n },\n },\n });\n}\n"]}