@particle-academy/gmail-inbox-ui 0.0.0-stage → 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog — Gmail Inbox
2
+
3
+ All four packages — `@particle-academy/gmail-inbox-ui`, `@particle-academy/gmail-inbox-js`,
4
+ `particle-academy/gmail-inbox-php` and `fancy-gmail-inbox` — are released together
5
+ under one version. They are generated from one `provider/` definition, so a
6
+ change to it changes all four, and separate version lines would only record
7
+ which of the four somebody remembered to bump.
8
+
9
+ **Write entries HERE**, in the weaver envelope at `providers/gmail-inbox/CHANGELOG.md`,
10
+ then regenerate. This file is the one thing in a release that cannot be
11
+ derived — somebody has to write what changed — but writing it in the
12
+ provider repo would be a hand-edit that `.weaver.json` flags and the next
13
+ sync destroys.
14
+
15
+ ## [0.1.0] — 2026-10-01
16
+
17
+ ### Added
18
+
19
+ - **First release.** `message_list` (search, label filter, pagination),
20
+ `message_get`, `thread_get`, `label_list`. OAuth2 with `gmail.readonly`.
21
+ - **A SEPARATE connector from `gmail`, by design, not a scope widening of
22
+ it.** `gmail.readonly` is a RESTRICTED Google OAuth scope requiring an
23
+ annual CASA security assessment on the app that requests it, and
24
+ Google's verification is per OAUTH CLIENT — attaching it to `gmail`'s
25
+ own client would have put the recurring assessment on every existing
26
+ send-only consumer. A second connector, a second OAuth client, puts it
27
+ only where it is actually needed. Part of the owner's Google Workspace
28
+ commission (Tynn #19) — Fancy's own compliance audit found this before
29
+ any code was written, and the split was decided before this connector
30
+ existed.
31
+ - `message_get` and `thread_get` publish `payload.headers` (From, To,
32
+ Subject, Date, unparsed) and Gmail's own `snippet` preview, but do NOT
33
+ decode the MIME body tree — `payload.parts` can nest arbitrarily for a
34
+ multipart message, and flattening it to plain text/HTML is real parsing
35
+ work this connector does not do yet. The raw `payload` is still
36
+ published for a host that wants to decode it. Noted rather than
37
+ rushed, the same shape as Drive's deferred file upload.
38
+ - Gmail has no sandbox — every read reaches the connected account's real
39
+ mailbox. The faker is the only way to develop against it without doing
40
+ that.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Particle Academy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,138 @@
1
- # Temporary Holding Version
1
+ # Gmail Inbox
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Fancified](art/fancified.svg)](https://particle.academy)
4
+
5
+ Gmail Inbox for [fancy-flow][flow] — as **four imported, versioned packages**, one
6
+ per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
7
+ change.
8
+
9
+ [flow]: https://github.com/Particle-Academy/fancy-flow
10
+
11
+ | Runtime | Package | Install |
12
+ |---|---|---|
13
+ | Authoring surface (every host) | `@particle-academy/gmail-inbox-ui` | `npm install @particle-academy/gmail-inbox-ui` |
14
+ | Node | `@particle-academy/gmail-inbox-js` | `npm install @particle-academy/gmail-inbox-js` |
15
+ | PHP 8.4+ | `particle-academy/gmail-inbox-php` | `composer require particle-academy/gmail-inbox-php` |
16
+ | Python 3.11+ | `fancy-gmail-inbox` | `pip install fancy-gmail-inbox` |
17
+
18
+ The `ui` package is the editor surface and is React on every host — a PHP or
19
+ Python project installs it *and* its own runtime package, and never the `js` one.
20
+
21
+ ## What it costs you
22
+
23
+ One dependency: `@particle-academy/fancy-connector-core` (or
24
+ `particle-academy/fancy-connector-core` on Composer), which the `js` and `php`
25
+ packages pull in themselves. The Python package has **zero** runtime
26
+ dependencies.
27
+
28
+ **No Gmail Inbox SDK.** Plain HTTP, deliberately: a vendor SDK is third-party code
29
+ subject to the kit's full approval bar, and one per provider is hundreds of
30
+ dependencies nobody is tracking.
31
+
32
+ ## Setting it up
33
+
34
+ Everything below is generated from `provider/manifest.json`, so it cannot disagree with what the packages do.
35
+
36
+ ### Credentials
37
+
38
+ A Gmail Inbox connection holds 4 values.
39
+
40
+ **Two kinds of value, and mixing them up matters.** A `provider` credential is ONE value for the whole installation — an OAuth app's client secret serves every connected account. An `account` credential is one per connected account. A host that stores the second where it stores the first lets one account's credentials reach another's.
41
+
42
+ | Field | Scope | Secret | Where it comes from |
43
+ |---|---|---|---|
44
+ | **OAuth client ID** | per installation | not secret | A DIFFERENT OAuth app than `gmail`'s, from Google Cloud Console -> APIs & Services -> Credentials. This one requests a restricted scope and carries Google's annual CASA assessment; `gmail`'s does not. Do not reuse the same client for both. |
45
+ | **OAuth client secret** | per installation | **secret** | The client secret for the same OAuth app. One value for the whole installation. |
46
+ | **Access token** | per connected account | **secret** | Per connected Google account, and it expires after ONE HOUR. The host refreshes it with the refresh token. |
47
+ | **Refresh token** | per connected account | **secret** | Per connected Google account. Google issues one only when the consent request asks for offline access; without it the connection dies within the hour. |
48
+
49
+ ### Authorising
50
+
51
+ Gmail Inbox uses OAuth2 (authorization_code). The package DECLARES the exchange; the HOST performs it — a consent screen needs a browser, a redirect URI and somewhere to persist the result, and all three belong to the host.
52
+
53
+ - **Authorize URL** — https://accounts.google.com/o/oauth2/v2/auth
54
+ - **Token URL** — https://oauth2.googleapis.com/token
55
+ - **Scopes** — `https://www.googleapis.com/auth/gmail.readonly`
56
+ - **Access token lifetime** — 3600 seconds (1 hours). A host that never refreshes works all afternoon and is broken by morning.
57
+
58
+ The refresh tokens do **not** rotate: the same one is reusable, so a refresh may safely be retried and may run concurrently. Stated rather than assumed, because the opposite — a provider that spends the token and revokes the grant on a replay — looks identical until it happens.
59
+
60
+ ### The estate
61
+
62
+ **Gmail Inbox has no test estate, and somebody checked.** Everything this connector does is real. Use the faker to build against it.
63
+
64
+ > Gmail has no sandbox. Every read reaches the connected account's real mail. The faker is the only way to develop against it without touching a real mailbox.
65
+
66
+ ## What it can do
67
+
68
+ ### Actions
69
+
70
+ #### `label_list` — List Gmail labels
71
+
72
+ List every label on the mailbox, system and user-created.
73
+
74
+ `GET /gmail/v1/users/{userId}/labels` · reads only — safe to replay
75
+
76
+ | Input | Required | What it is |
77
+ |---|---|---|
78
+ | `userId` | yes | Mailbox |
79
+
80
+ #### `message_get` — Gmail message
81
+
82
+ Read one message's headers and preview. The body's plain/HTML text is NOT decoded -- see the raw payload for that.
83
+
84
+ `GET /gmail/v1/users/{userId}/messages/{id}` · reads only — safe to replay
85
+
86
+ | Input | Required | What it is |
87
+ |---|---|---|
88
+ | `userId` | yes | Mailbox |
89
+ | `id` | yes | From message_list, or another node's output. |
90
+
91
+ #### `message_list` — List Gmail messages
92
+
93
+ List message ids matching a search, newest first.
94
+
95
+ `GET /gmail/v1/users/{userId}/messages` · reads only — safe to replay
96
+
97
+ | Input | Required | What it is |
98
+ |---|---|---|
99
+ | `userId` | yes | `me` is the connected account and is almost always what you want. |
100
+ | `q` | no | Gmail's own search syntax, exactly as typed into the Gmail search box -- e.g. "from:ada@example.test has:attachment newer_than:7d". Leave blank to list everything. |
101
+ | `labelId` | no | Only messages with this label -- e.g. INBOX, or a label_list id. Gmail's own query parameter accepts several, repeated; this connector offers one for now -- combine more in the search field above instead, using Gmail's own label: search operator. |
102
+ | `includeSpamTrash` | no | Include spam and trash |
103
+ | `maxResults` | no | Gmail's own maximum is 500. |
104
+ | `pageToken` | no | From a previous page's nextPageToken. |
105
+
106
+ #### `thread_get` — Gmail thread
107
+
108
+ Read every message in a conversation thread, oldest first.
109
+
110
+ `GET /gmail/v1/users/{userId}/threads/{id}` · reads only — safe to replay
111
+
112
+ | Input | Required | What it is |
113
+ |---|---|---|
114
+ | `userId` | yes | Mailbox |
115
+ | `id` | yes | A message's threadId, from message_list or message_get. |
116
+
117
+ ## Run it before you have credentials
118
+
119
+ Every operation ships a **faker**, whether or not Gmail Inbox has a sandbox. Set a
120
+ node's mode to `fake` and it returns the shape Gmail Inbox actually publishes — the
121
+ same field names, deterministically — so you can wire the downstream nodes before
122
+ touching an account, a key, or a network.
123
+
124
+ ## This repository is generated
125
+
126
+ `provider/` is the source. Everything under `packages/` is emitted from it and
127
+ **must not be hand-edited** — CI regenerates and diffs on every push, and the
128
+ next protocol sync destroys anything it finds. See [`AGENTS.md`](AGENTS.md).
129
+
130
+ ## Two namespaces, which do not match on purpose
131
+
132
+ The repo is `github.com/Fancy-Friends/gmail-inbox`; the packages publish under
133
+ `particle-academy`. Nothing derives one from the other — the names come from
134
+ weaver's `friends.json` and nowhere else.
135
+
136
+ ## Licence
137
+
138
+ MIT.
@@ -0,0 +1,26 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="128" height="28" role="img" aria-label="Fancified — built with Fancy UI">
2
+ <title>Fancified · built with Fancy UI</title>
3
+ <defs>
4
+ <linearGradient id="fcdBg" x1="0" y1="0" x2="1" y2="1">
5
+ <stop offset="0" stop-color="#6d28d9"/>
6
+ <stop offset=".5" stop-color="#9333ea"/>
7
+ <stop offset="1" stop-color="#d946ef"/>
8
+ </linearGradient>
9
+ <linearGradient id="fcdGloss" x1="0" y1="0" x2="0" y2="1">
10
+ <stop offset="0" stop-color="#ffffff" stop-opacity=".30"/>
11
+ <stop offset=".55" stop-color="#ffffff" stop-opacity="0"/>
12
+ </linearGradient>
13
+ <clipPath id="fcdClip"><rect width="128" height="28" rx="7"/></clipPath>
14
+ </defs>
15
+ <g clip-path="url(#fcdClip)">
16
+ <rect width="128" height="28" fill="url(#fcdBg)"/>
17
+ <rect width="34" height="28" fill="#3b0764" fill-opacity=".5"/>
18
+ <rect width="128" height="13" fill="url(#fcdGloss)"/>
19
+ <g fill="#fff">
20
+ <path transform="translate(17 14)" d="M0 -7 C.6 -2.2 2.2 -.6 7 0 C2.2 .6 .6 2.2 0 7 C-.6 2.2 -2.2 .6 -7 0 C-2.2 -.6 -.6 -2.2 0 -7 Z"/>
21
+ <path transform="translate(25.5 7.5) scale(.34)" fill-opacity=".85" d="M0 -7 C.6 -2.2 2.2 -.6 7 0 C2.2 .6 .6 2.2 0 7 C-.6 2.2 -2.2 .6 -7 0 C-2.2 -.6 -.6 -2.2 0 -7 Z"/>
22
+ </g>
23
+ <text x="81" y="18.5" fill="#ffffff" text-anchor="middle" font-family="'Segoe UI',Verdana,'DejaVu Sans',sans-serif" font-size="12" font-weight="700" letter-spacing=".3">Fancified</text>
24
+ </g>
25
+ <rect x=".5" y=".5" width="127" height="27" rx="6.5" fill="none" stroke="#ffffff" stroke-opacity=".22"/>
26
+ </svg>
package/dist/index.cjs ADDED
@@ -0,0 +1,339 @@
1
+ 'use strict';
2
+
3
+ var connectors = require('@particle-academy/fancy-flow/connectors');
4
+
5
+ // src/service.ts
6
+ var CONNECTOR_API_VERSION = 1;
7
+ var GMAIL_INBOX_SERVICE = {
8
+ service: "gmail_inbox",
9
+ serviceTitle: "Gmail Inbox",
10
+ domain: "email",
11
+ sandbox: "none"
12
+ };
13
+ var GMAIL_INBOX_CREDENTIALS = [
14
+ {
15
+ "key": "clientId",
16
+ "label": "OAuth client ID",
17
+ "scope": "provider",
18
+ "secret": false,
19
+ "help": "A DIFFERENT OAuth app than `gmail`'s, from Google Cloud Console -> APIs & Services -> Credentials. This one requests a restricted scope and carries Google's annual CASA assessment; `gmail`'s does not. Do not reuse the same client for both."
20
+ },
21
+ {
22
+ "key": "clientSecret",
23
+ "label": "OAuth client secret",
24
+ "scope": "provider",
25
+ "secret": true,
26
+ "help": "The client secret for the same OAuth app. One value for the whole installation."
27
+ },
28
+ {
29
+ "key": "accessToken",
30
+ "label": "Access token",
31
+ "scope": "account",
32
+ "secret": true,
33
+ "help": "Per connected Google account, and it expires after ONE HOUR. The host refreshes it with the refresh token."
34
+ },
35
+ {
36
+ "key": "refreshToken",
37
+ "label": "Refresh token",
38
+ "scope": "account",
39
+ "secret": true,
40
+ "help": "Per connected Google account. Google issues one only when the consent request asks for offline access; without it the connection dies within the hour."
41
+ }
42
+ ];
43
+ var GMAIL_INBOX_OAUTH = {
44
+ "flow": "authorization_code",
45
+ "authorizeUrl": "https://accounts.google.com/o/oauth2/v2/auth",
46
+ "tokenUrl": "https://oauth2.googleapis.com/token",
47
+ "scopes": [
48
+ "https://www.googleapis.com/auth/gmail.readonly"
49
+ ],
50
+ "accessTokenCredential": "accessToken",
51
+ "refreshTokenCredential": "refreshToken",
52
+ "refreshTokenRotates": false,
53
+ "accessTokenTtlSeconds": 3600
54
+ };
55
+ function gmailInboxMeta(role, operation, docs) {
56
+ return { ...GMAIL_INBOX_SERVICE, role, operation, docs };
57
+ }
58
+ var GMAIL_INBOX_LABEL_LIST_KIND = "@particle-academy/gmail_inbox_label_list";
59
+ var GMAIL_INBOX_LABEL_LIST_OPERATION = "label_list";
60
+ var GMAIL_INBOX_LABEL_LIST_META = gmailInboxMeta("action", "list labels", "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/list");
61
+ var GMAIL_INBOX_LABEL_LIST_OUTPUT = [
62
+ {
63
+ "path": "data.labels",
64
+ "type": "array",
65
+ "description": "Each with id, name and type (system or user). messagesTotal/messagesUnread/threadsTotal/threadsUnread are part of Label's schema but not confirmed present on every list row -- read one label with labels.get if a count comes back missing."
66
+ }
67
+ ];
68
+ var gmailInboxLabelListKind = connectors.defineConnectorKind(GMAIL_INBOX_LABEL_LIST_META, {
69
+ name: GMAIL_INBOX_LABEL_LIST_KIND,
70
+ aliases: ["gmail_inbox_label_list"],
71
+ label: "List Gmail labels",
72
+ description: "List every label on the mailbox, system and user-created.",
73
+ inputs: [{ id: "in" }],
74
+ outputs: [{ id: "out" }],
75
+ sideEffects: "none",
76
+ outputShape: GMAIL_INBOX_LABEL_LIST_OUTPUT,
77
+ configSchema: [
78
+ {
79
+ "type": "text",
80
+ "key": "userId",
81
+ "label": "Mailbox",
82
+ "required": true,
83
+ "default": "me"
84
+ }
85
+ ],
86
+ defaultConfig: {
87
+ "mode": "auto"
88
+ },
89
+ renderBody: ({ config }) => connectors.summarize(GMAIL_INBOX_LABEL_LIST_META, config, "list labels")
90
+ });
91
+ var GMAIL_INBOX_MESSAGE_GET_KIND = "@particle-academy/gmail_inbox_message_get";
92
+ var GMAIL_INBOX_MESSAGE_GET_OPERATION = "message_get";
93
+ var GMAIL_INBOX_MESSAGE_GET_META = gmailInboxMeta("action", "read a message", "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/get");
94
+ var GMAIL_INBOX_MESSAGE_GET_OUTPUT = [
95
+ {
96
+ "path": "data.id",
97
+ "type": "string",
98
+ "description": "The message id."
99
+ },
100
+ {
101
+ "path": "data.threadId",
102
+ "type": "string",
103
+ "description": "The thread this message belongs to."
104
+ },
105
+ {
106
+ "path": "data.labelIds",
107
+ "type": "array",
108
+ "description": "System and user label ids currently on this message."
109
+ },
110
+ {
111
+ "path": "data.snippet",
112
+ "type": "string",
113
+ "description": "Gmail's own short plain-text preview of the body -- a few hundred characters, not the whole message."
114
+ },
115
+ {
116
+ "path": "data.internalDate",
117
+ "type": "string",
118
+ "description": "Unix epoch MILLISECONDS, as a string -- when Gmail received it, which can differ from the Date header."
119
+ },
120
+ {
121
+ "path": "data.payload.headers",
122
+ "type": "array",
123
+ "description": "Every RFC 2822 header as { name, value }, unparsed. From/To/Subject/Date live here."
124
+ },
125
+ {
126
+ "path": "data.payload",
127
+ "type": "unknown",
128
+ "description": "The full MIME tree, raw -- mimeType, body (base64url in body.data for a leaf part), and nested parts for a multipart message. Decode it yourself for plain-text or HTML content; this connector does not flatten it."
129
+ },
130
+ {
131
+ "path": "mode",
132
+ "type": "string",
133
+ "description": "Which estate this ran against. Google has no sandbox, so: fake or live."
134
+ }
135
+ ];
136
+ var gmailInboxMessageGetKind = connectors.defineConnectorKind(GMAIL_INBOX_MESSAGE_GET_META, {
137
+ name: GMAIL_INBOX_MESSAGE_GET_KIND,
138
+ aliases: ["gmail_inbox_message_get"],
139
+ label: "Gmail message",
140
+ description: "Read one message's headers and preview. The body's plain/HTML text is NOT decoded -- see the raw payload for that.",
141
+ inputs: [{ id: "in" }],
142
+ outputs: [{ id: "out" }],
143
+ sideEffects: "none",
144
+ outputShape: GMAIL_INBOX_MESSAGE_GET_OUTPUT,
145
+ configSchema: [
146
+ {
147
+ "type": "text",
148
+ "key": "userId",
149
+ "label": "Mailbox",
150
+ "required": true,
151
+ "default": "me"
152
+ },
153
+ {
154
+ "type": "text",
155
+ "key": "id",
156
+ "label": "Message ID",
157
+ "required": true,
158
+ "description": "From message_list, or another node's output."
159
+ }
160
+ ],
161
+ defaultConfig: {
162
+ "mode": "auto"
163
+ },
164
+ renderBody: ({ config }) => connectors.summarize(GMAIL_INBOX_MESSAGE_GET_META, config, "read a message")
165
+ });
166
+ var GMAIL_INBOX_MESSAGE_LIST_KIND = "@particle-academy/gmail_inbox_message_list";
167
+ var GMAIL_INBOX_MESSAGE_LIST_OPERATION = "message_list";
168
+ var GMAIL_INBOX_MESSAGE_LIST_META = gmailInboxMeta("action", "list messages", "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/list");
169
+ var GMAIL_INBOX_MESSAGE_LIST_OUTPUT = [
170
+ {
171
+ "path": "data.messages",
172
+ "type": "array",
173
+ "description": "Each row is { id, threadId } only. Read a message's content with message_get."
174
+ },
175
+ {
176
+ "path": "data.nextPageToken",
177
+ "type": "string",
178
+ "description": "Present when there is another page."
179
+ },
180
+ {
181
+ "path": "data.resultSizeEstimate",
182
+ "type": "number",
183
+ "description": "Gmail's own word for it: an ESTIMATE, not an exact count."
184
+ },
185
+ {
186
+ "path": "mode",
187
+ "type": "string",
188
+ "description": "Which estate this ran against. Google has no sandbox, so: fake or live."
189
+ }
190
+ ];
191
+ var gmailInboxMessageListKind = connectors.defineConnectorKind(GMAIL_INBOX_MESSAGE_LIST_META, {
192
+ name: GMAIL_INBOX_MESSAGE_LIST_KIND,
193
+ aliases: ["gmail_inbox_message_list"],
194
+ label: "List Gmail messages",
195
+ description: "List message ids matching a search, newest first.",
196
+ inputs: [{ id: "in" }],
197
+ outputs: [{ id: "out" }],
198
+ sideEffects: "none",
199
+ outputShape: GMAIL_INBOX_MESSAGE_LIST_OUTPUT,
200
+ configSchema: [
201
+ {
202
+ "type": "text",
203
+ "key": "userId",
204
+ "label": "Mailbox",
205
+ "required": true,
206
+ "default": "me",
207
+ "description": "`me` is the connected account and is almost always what you want."
208
+ },
209
+ {
210
+ "type": "text",
211
+ "key": "q",
212
+ "label": "Search",
213
+ "description": `Gmail's own search syntax, exactly as typed into the Gmail search box -- e.g. "from:ada@example.test has:attachment newer_than:7d". Leave blank to list everything.`
214
+ },
215
+ {
216
+ "type": "text",
217
+ "key": "labelId",
218
+ "label": "Label ID",
219
+ "description": "Only messages with this label -- e.g. INBOX, or a label_list id. Gmail's own query parameter accepts several, repeated; this connector offers one for now -- combine more in the search field above instead, using Gmail's own label: search operator."
220
+ },
221
+ {
222
+ "type": "switch",
223
+ "key": "includeSpamTrash",
224
+ "label": "Include spam and trash",
225
+ "default": false
226
+ },
227
+ {
228
+ "type": "number",
229
+ "key": "maxResults",
230
+ "label": "Page size",
231
+ "min": 1,
232
+ "max": 500,
233
+ "default": 100,
234
+ "description": "Gmail's own maximum is 500."
235
+ },
236
+ {
237
+ "type": "text",
238
+ "key": "pageToken",
239
+ "label": "Page token",
240
+ "description": "From a previous page's nextPageToken."
241
+ }
242
+ ],
243
+ defaultConfig: {
244
+ "mode": "auto"
245
+ },
246
+ renderBody: ({ config }) => connectors.summarize(GMAIL_INBOX_MESSAGE_LIST_META, config, "list messages")
247
+ });
248
+ var GMAIL_INBOX_THREAD_GET_KIND = "@particle-academy/gmail_inbox_thread_get";
249
+ var GMAIL_INBOX_THREAD_GET_OPERATION = "thread_get";
250
+ var GMAIL_INBOX_THREAD_GET_META = gmailInboxMeta("action", "read a thread", "https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get");
251
+ var GMAIL_INBOX_THREAD_GET_OUTPUT = [
252
+ {
253
+ "path": "data.id",
254
+ "type": "string",
255
+ "description": "The thread id."
256
+ },
257
+ {
258
+ "path": "data.historyId",
259
+ "type": "string",
260
+ "description": "Gmail's change-tracking cursor as of this read."
261
+ },
262
+ {
263
+ "path": "data.messages",
264
+ "type": "array",
265
+ "description": "Every message in the thread, oldest first, each shaped like message_get's output."
266
+ },
267
+ {
268
+ "path": "mode",
269
+ "type": "string",
270
+ "description": "Which estate this ran against. Google has no sandbox, so: fake or live."
271
+ }
272
+ ];
273
+ var gmailInboxThreadGetKind = connectors.defineConnectorKind(GMAIL_INBOX_THREAD_GET_META, {
274
+ name: GMAIL_INBOX_THREAD_GET_KIND,
275
+ aliases: ["gmail_inbox_thread_get"],
276
+ label: "Gmail thread",
277
+ description: "Read every message in a conversation thread, oldest first.",
278
+ inputs: [{ id: "in" }],
279
+ outputs: [{ id: "out" }],
280
+ sideEffects: "none",
281
+ outputShape: GMAIL_INBOX_THREAD_GET_OUTPUT,
282
+ configSchema: [
283
+ {
284
+ "type": "text",
285
+ "key": "userId",
286
+ "label": "Mailbox",
287
+ "required": true,
288
+ "default": "me"
289
+ },
290
+ {
291
+ "type": "text",
292
+ "key": "id",
293
+ "label": "Thread ID",
294
+ "required": true,
295
+ "description": "A message's threadId, from message_list or message_get."
296
+ }
297
+ ],
298
+ defaultConfig: {
299
+ "mode": "auto"
300
+ },
301
+ renderBody: ({ config }) => connectors.summarize(GMAIL_INBOX_THREAD_GET_META, config, "read a thread")
302
+ });
303
+
304
+ // src/index.ts
305
+ var GMAIL_INBOX_KINDS = [
306
+ gmailInboxLabelListKind,
307
+ gmailInboxMessageGetKind,
308
+ gmailInboxMessageListKind,
309
+ gmailInboxThreadGetKind
310
+ ];
311
+
312
+ exports.CONNECTOR_API_VERSION = CONNECTOR_API_VERSION;
313
+ exports.GMAIL_INBOX_CREDENTIALS = GMAIL_INBOX_CREDENTIALS;
314
+ exports.GMAIL_INBOX_KINDS = GMAIL_INBOX_KINDS;
315
+ exports.GMAIL_INBOX_LABEL_LIST_KIND = GMAIL_INBOX_LABEL_LIST_KIND;
316
+ exports.GMAIL_INBOX_LABEL_LIST_META = GMAIL_INBOX_LABEL_LIST_META;
317
+ exports.GMAIL_INBOX_LABEL_LIST_OPERATION = GMAIL_INBOX_LABEL_LIST_OPERATION;
318
+ exports.GMAIL_INBOX_LABEL_LIST_OUTPUT = GMAIL_INBOX_LABEL_LIST_OUTPUT;
319
+ exports.GMAIL_INBOX_MESSAGE_GET_KIND = GMAIL_INBOX_MESSAGE_GET_KIND;
320
+ exports.GMAIL_INBOX_MESSAGE_GET_META = GMAIL_INBOX_MESSAGE_GET_META;
321
+ exports.GMAIL_INBOX_MESSAGE_GET_OPERATION = GMAIL_INBOX_MESSAGE_GET_OPERATION;
322
+ exports.GMAIL_INBOX_MESSAGE_GET_OUTPUT = GMAIL_INBOX_MESSAGE_GET_OUTPUT;
323
+ exports.GMAIL_INBOX_MESSAGE_LIST_KIND = GMAIL_INBOX_MESSAGE_LIST_KIND;
324
+ exports.GMAIL_INBOX_MESSAGE_LIST_META = GMAIL_INBOX_MESSAGE_LIST_META;
325
+ exports.GMAIL_INBOX_MESSAGE_LIST_OPERATION = GMAIL_INBOX_MESSAGE_LIST_OPERATION;
326
+ exports.GMAIL_INBOX_MESSAGE_LIST_OUTPUT = GMAIL_INBOX_MESSAGE_LIST_OUTPUT;
327
+ exports.GMAIL_INBOX_OAUTH = GMAIL_INBOX_OAUTH;
328
+ exports.GMAIL_INBOX_SERVICE = GMAIL_INBOX_SERVICE;
329
+ exports.GMAIL_INBOX_THREAD_GET_KIND = GMAIL_INBOX_THREAD_GET_KIND;
330
+ exports.GMAIL_INBOX_THREAD_GET_META = GMAIL_INBOX_THREAD_GET_META;
331
+ exports.GMAIL_INBOX_THREAD_GET_OPERATION = GMAIL_INBOX_THREAD_GET_OPERATION;
332
+ exports.GMAIL_INBOX_THREAD_GET_OUTPUT = GMAIL_INBOX_THREAD_GET_OUTPUT;
333
+ exports.gmailInboxLabelListKind = gmailInboxLabelListKind;
334
+ exports.gmailInboxMessageGetKind = gmailInboxMessageGetKind;
335
+ exports.gmailInboxMessageListKind = gmailInboxMessageListKind;
336
+ exports.gmailInboxMeta = gmailInboxMeta;
337
+ exports.gmailInboxThreadGetKind = gmailInboxThreadGetKind;
338
+ //# sourceMappingURL=index.cjs.map
339
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/service.ts","../src/kinds/label-list.ts","../src/kinds/message-get.ts","../src/kinds/message-list.ts","../src/kinds/thread-get.ts","../src/index.ts"],"names":["defineConnectorKind","summarize"],"mappings":";;;;;AAkCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,mBAAA,GAAsB;AAAA,EACjC,OAAA,EAAS,aAAA;AAAA,EACT,YAAA,EAAc,aAAA;AAAA,EACd,MAAA,EAAQ,OAAA;AAAA,EACR,OAAA,EAAS;AACX;AA+BO,IAAM,uBAAA,GAA0B;AAAA,EACrC;AAAA,IACE,KAAA,EAAO,UAAA;AAAA,IACP,OAAA,EAAS,iBAAA;AAAA,IACT,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,KAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AA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rD,uBAAA;AAAA,EACA,wBAAA;AAAA,EACA,yBAAA;AAAA,EACA;AACF","file":"index.cjs","sourcesContent":["/**\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's identity on the authoring surface, shared by every Gmail Inbox\n * node.\n *\n * This file must import nothing from the js package: a PHP or Python project\n * installs the ui package and never that one, and the import would be a\n * dangling module the moment it did.\n *\n * ## The sandbox trap\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 { ConnectorDomain, ConnectorMeta } from \"@particle-academy/fancy-flow/connectors\";\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.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\n/** The parts of a connector's identity that belong to the SERVICE, not the node. */\nexport const GMAIL_INBOX_SERVICE = {\n service: \"gmail_inbox\",\n serviceTitle: \"Gmail Inbox\",\n domain: \"email\",\n sandbox: \"none\",\n} as const satisfies Pick<ConnectorMeta, \"service\" | \"serviceTitle\" | \"domain\" | \"sandbox\">;\n\n/**\n * Every connector domain weaver knows, pinned against fancy-flow's union.\n *\n * A closed set copied into three codebases stays correct only while something\n * MAKES it: this line fails to compile the moment weaver carries a value\n * fancy-flow does not, including the values no provider uses yet.\n */\nconst WEAVER_DOMAINS: readonly ConnectorDomain[] = [\n \"payments\",\n \"commerce\",\n \"messaging\",\n \"email\",\n \"crm\",\n \"support\",\n \"storage\",\n \"calendar\",\n \"productivity\",\n \"database\",\n \"devtools\",\n \"analytics\",\n \"marketing\",\n \"ai\",\n \"forms\",\n \"hr\",\n \"geo\"\n];\nvoid WEAVER_DOMAINS;\n\n/** The credentials a Gmail Inbox connection holds. */\nexport const GMAIL_INBOX_CREDENTIALS = [\n {\n \"key\": \"clientId\",\n \"label\": \"OAuth client ID\",\n \"scope\": \"provider\",\n \"secret\": false,\n \"help\": \"A DIFFERENT OAuth app than `gmail`'s, from Google Cloud Console -> APIs & Services -> Credentials. This one requests a restricted scope and carries Google's annual CASA assessment; `gmail`'s does not. Do not reuse the same client for both.\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"OAuth client secret\",\n \"scope\": \"provider\",\n \"secret\": true,\n \"help\": \"The client secret for the same OAuth app. One value for the whole installation.\"\n },\n {\n \"key\": \"accessToken\",\n \"label\": \"Access token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected Google account, and it expires after ONE HOUR. The host refreshes it with the refresh token.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected Google account. Google issues one only when the consent request asks for offline access; without it the connection dies within the hour.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange Gmail Inbox requires — DECLARED here, performed by the\n * host.\n *\n * A consent screen needs a browser, a redirect URI and somewhere to persist\n * the result, and all three belong to the host; a package that ran the dance\n * itself would have to own a web server. So this says precisely enough for a\n * host to do it.\n *\n * The access token lasts 3600 seconds. A host that never refreshes will work\n * all afternoon and be broken by morning, which is why the lifetime is stated\n * rather than left to be discovered.\n *\n * Its refresh tokens do NOT rotate: the same one is reusable, so a refresh may\n * safely be retried and may run concurrently. That is stated rather than\n * assumed because the opposite — a provider that spends the token and revokes\n * the grant on a replay — looks identical until it happens.\n */\nexport const GMAIL_INBOX_OAUTH = {\n \"flow\": \"authorization_code\",\n \"authorizeUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"scopes\": [\n \"https://www.googleapis.com/auth/gmail.readonly\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600\n} as const;\n\n/** Build a Gmail Inbox node's connector metadata from the operation it performs. */\nexport function gmailInboxMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...GMAIL_INBOX_SERVICE, role, operation, docs };\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 Gmail labels — List every label on the mailbox, system and\n * user-created.\n *\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/list\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { gmailInboxMeta } from \"../service.js\";\n\nexport const GMAIL_INBOX_LABEL_LIST_KIND = \"@particle-academy/gmail_inbox_label_list\";\nexport const GMAIL_INBOX_LABEL_LIST_OPERATION = \"label_list\";\n\nexport const GMAIL_INBOX_LABEL_LIST_META = gmailInboxMeta(\"action\", \"list labels\", \"https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/list\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const GMAIL_INBOX_LABEL_LIST_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.labels\",\n \"type\": \"array\",\n \"description\": \"Each with id, name and type (system or user). messagesTotal/messagesUnread/threadsTotal/threadsUnread are part of Label's schema but not confirmed present on every list row -- read one label with labels.get if a count comes back missing.\"\n }\n];\n\nexport const gmailInboxLabelListKind: NodeKindDefinition = defineConnectorKind(GMAIL_INBOX_LABEL_LIST_META, {\n name: GMAIL_INBOX_LABEL_LIST_KIND,\n aliases: [\"gmail_inbox_label_list\"],\n label: \"List Gmail labels\",\n description: \"List every label on the mailbox, system and user-created.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GMAIL_INBOX_LABEL_LIST_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"userId\",\n \"label\": \"Mailbox\",\n \"required\": true,\n \"default\": \"me\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GMAIL_INBOX_LABEL_LIST_META, config as Record<string, unknown>, \"list labels\"),\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 * Gmail message — Read one message's headers and preview. The body's\n * plain/HTML text is NOT decoded -- see the raw payload for that.\n *\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/get\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { gmailInboxMeta } from \"../service.js\";\n\nexport const GMAIL_INBOX_MESSAGE_GET_KIND = \"@particle-academy/gmail_inbox_message_get\";\nexport const GMAIL_INBOX_MESSAGE_GET_OPERATION = \"message_get\";\n\nexport const GMAIL_INBOX_MESSAGE_GET_META = gmailInboxMeta(\"action\", \"read a message\", \"https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/get\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const GMAIL_INBOX_MESSAGE_GET_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The message id.\"\n },\n {\n \"path\": \"data.threadId\",\n \"type\": \"string\",\n \"description\": \"The thread this message belongs to.\"\n },\n {\n \"path\": \"data.labelIds\",\n \"type\": \"array\",\n \"description\": \"System and user label ids currently on this message.\"\n },\n {\n \"path\": \"data.snippet\",\n \"type\": \"string\",\n \"description\": \"Gmail's own short plain-text preview of the body -- a few hundred characters, not the whole message.\"\n },\n {\n \"path\": \"data.internalDate\",\n \"type\": \"string\",\n \"description\": \"Unix epoch MILLISECONDS, as a string -- when Gmail received it, which can differ from the Date header.\"\n },\n {\n \"path\": \"data.payload.headers\",\n \"type\": \"array\",\n \"description\": \"Every RFC 2822 header as { name, value }, unparsed. From/To/Subject/Date live here.\"\n },\n {\n \"path\": \"data.payload\",\n \"type\": \"unknown\",\n \"description\": \"The full MIME tree, raw -- mimeType, body (base64url in body.data for a leaf part), and nested parts for a multipart message. Decode it yourself for plain-text or HTML content; this connector does not flatten it.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const gmailInboxMessageGetKind: NodeKindDefinition = defineConnectorKind(GMAIL_INBOX_MESSAGE_GET_META, {\n name: GMAIL_INBOX_MESSAGE_GET_KIND,\n aliases: [\"gmail_inbox_message_get\"],\n label: \"Gmail message\",\n description: \"Read one message's headers and preview. The body's plain/HTML text is NOT decoded -- see the raw payload for that.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GMAIL_INBOX_MESSAGE_GET_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"userId\",\n \"label\": \"Mailbox\",\n \"required\": true,\n \"default\": \"me\"\n },\n {\n \"type\": \"text\",\n \"key\": \"id\",\n \"label\": \"Message ID\",\n \"required\": true,\n \"description\": \"From message_list, or another node's output.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GMAIL_INBOX_MESSAGE_GET_META, config as Record<string, unknown>, \"read a message\"),\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 Gmail messages — List message ids matching a search, newest first.\n *\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/list\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { gmailInboxMeta } from \"../service.js\";\n\nexport const GMAIL_INBOX_MESSAGE_LIST_KIND = \"@particle-academy/gmail_inbox_message_list\";\nexport const GMAIL_INBOX_MESSAGE_LIST_OPERATION = \"message_list\";\n\nexport const GMAIL_INBOX_MESSAGE_LIST_META = gmailInboxMeta(\"action\", \"list messages\", \"https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/list\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const GMAIL_INBOX_MESSAGE_LIST_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.messages\",\n \"type\": \"array\",\n \"description\": \"Each row is { id, threadId } only. Read a message's content with message_get.\"\n },\n {\n \"path\": \"data.nextPageToken\",\n \"type\": \"string\",\n \"description\": \"Present when there is another page.\"\n },\n {\n \"path\": \"data.resultSizeEstimate\",\n \"type\": \"number\",\n \"description\": \"Gmail's own word for it: an ESTIMATE, not an exact count.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const gmailInboxMessageListKind: NodeKindDefinition = defineConnectorKind(GMAIL_INBOX_MESSAGE_LIST_META, {\n name: GMAIL_INBOX_MESSAGE_LIST_KIND,\n aliases: [\"gmail_inbox_message_list\"],\n label: \"List Gmail messages\",\n description: \"List message ids matching a search, newest first.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GMAIL_INBOX_MESSAGE_LIST_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"userId\",\n \"label\": \"Mailbox\",\n \"required\": true,\n \"default\": \"me\",\n \"description\": \"`me` is the connected account and is almost always what you want.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"q\",\n \"label\": \"Search\",\n \"description\": \"Gmail's own search syntax, exactly as typed into the Gmail search box -- e.g. \\\"from:ada@example.test has:attachment newer_than:7d\\\". Leave blank to list everything.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"labelId\",\n \"label\": \"Label ID\",\n \"description\": \"Only messages with this label -- e.g. INBOX, or a label_list id. Gmail's own query parameter accepts several, repeated; this connector offers one for now -- combine more in the search field above instead, using Gmail's own label: search operator.\"\n },\n {\n \"type\": \"switch\",\n \"key\": \"includeSpamTrash\",\n \"label\": \"Include spam and trash\",\n \"default\": false\n },\n {\n \"type\": \"number\",\n \"key\": \"maxResults\",\n \"label\": \"Page size\",\n \"min\": 1,\n \"max\": 500,\n \"default\": 100,\n \"description\": \"Gmail's own maximum is 500.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"pageToken\",\n \"label\": \"Page token\",\n \"description\": \"From a previous page's nextPageToken.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GMAIL_INBOX_MESSAGE_LIST_META, config as Record<string, unknown>, \"list messages\"),\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 * Gmail thread — Read every message in a conversation thread, oldest first.\n *\n * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { gmailInboxMeta } from \"../service.js\";\n\nexport const GMAIL_INBOX_THREAD_GET_KIND = \"@particle-academy/gmail_inbox_thread_get\";\nexport const GMAIL_INBOX_THREAD_GET_OPERATION = \"thread_get\";\n\nexport const GMAIL_INBOX_THREAD_GET_META = gmailInboxMeta(\"action\", \"read a thread\", \"https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const GMAIL_INBOX_THREAD_GET_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The thread id.\"\n },\n {\n \"path\": \"data.historyId\",\n \"type\": \"string\",\n \"description\": \"Gmail's change-tracking cursor as of this read.\"\n },\n {\n \"path\": \"data.messages\",\n \"type\": \"array\",\n \"description\": \"Every message in the thread, oldest first, each shaped like message_get's output.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const gmailInboxThreadGetKind: NodeKindDefinition = defineConnectorKind(GMAIL_INBOX_THREAD_GET_META, {\n name: GMAIL_INBOX_THREAD_GET_KIND,\n aliases: [\"gmail_inbox_thread_get\"],\n label: \"Gmail thread\",\n description: \"Read every message in a conversation thread, oldest first.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GMAIL_INBOX_THREAD_GET_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"userId\",\n \"label\": \"Mailbox\",\n \"required\": true,\n \"default\": \"me\"\n },\n {\n \"type\": \"text\",\n \"key\": \"id\",\n \"label\": \"Thread ID\",\n \"required\": true,\n \"description\": \"A message's threadId, from message_list or message_get.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GMAIL_INBOX_THREAD_GET_META, config as Record<string, unknown>, \"read a thread\"),\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's node kinds for fancy-flow.\n *\n * Install this on every host. The TypeScript executors live in the js\n * package's `./flow` subpath; PHP and Python hosts run their own and need only\n * this.\n */\n\nexport * from \"./service.js\";\nexport * from \"./kinds/label-list.js\";\nexport * from \"./kinds/message-get.js\";\nexport * from \"./kinds/message-list.js\";\nexport * from \"./kinds/thread-get.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { gmailInboxLabelListKind } from \"./kinds/label-list.js\";\nimport { gmailInboxMessageGetKind } from \"./kinds/message-get.js\";\nimport { gmailInboxMessageListKind } from \"./kinds/message-list.js\";\nimport { gmailInboxThreadGetKind } from \"./kinds/thread-get.js\";\n\n/** Every Gmail Inbox kind, for a host that registers the lot. */\nexport const GMAIL_INBOX_KINDS: NodeKindDefinition[] = [\n gmailInboxLabelListKind,\n gmailInboxMessageGetKind,\n gmailInboxMessageListKind,\n gmailInboxThreadGetKind,\n];\n"]}