@particle-academy/gmail-inbox-js 0.0.0 → 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.
@@ -0,0 +1,223 @@
1
+ import { ServiceDescriptor, PreparedRequest, ConnectorMode, ConnectorFaker, RequestedMode, Transport, ConnectorResult } from '@particle-academy/fancy-connector-core';
2
+
3
+ /**
4
+ * GENERATED FILE — do not edit.
5
+ *
6
+ * Emitted from provider/manifest.json by weaver's generator.
7
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
8
+ * being rejected, because it works until it silently does not. Fix
9
+ * provider/manifest.json (or weaver's template/) and regenerate:
10
+ *
11
+ * npm run provider -- gmail_inbox
12
+ */
13
+ /**
14
+ * Gmail Inbox, as one service descriptor shared by every Gmail Inbox
15
+ * operation.
16
+ *
17
+ * @particle-academy/fancy-connector-core carries what is true of ALL
18
+ * connectors. This carries what is true of Gmail Inbox: its base URL, its auth
19
+ * scheme, its idempotency header, and its faker.
20
+ *
21
+ * ## The sandbox trap, written down where it is used
22
+ *
23
+ * Gmail has no sandbox. Every read reaches the connected account's real mail.
24
+ * The faker is the only way to develop against it without touching a real
25
+ * mailbox.
26
+ */
27
+
28
+ /**
29
+ * The connector API version this package was GENERATED against.
30
+ *
31
+ * A literal, never imported. An imported constant lets an upgrade rewrite the
32
+ * very claim it exists to detect, after which the copy agrees with itself
33
+ * forever.
34
+ */
35
+ declare const CONNECTOR_API_VERSION = 1;
36
+ declare const GMAIL_INBOX_BASE_URLS: {
37
+ readonly live: "https://gmail.googleapis.com";
38
+ };
39
+ /** Credential keys a remote call cannot proceed without. */
40
+ declare const GMAIL_INBOX_REQUIRES: readonly ["accessToken", "refreshToken", "clientId", "clientSecret"];
41
+ /**
42
+ * Apply Gmail Inbox's auth scheme to an outgoing request.
43
+ *
44
+ *
45
+ *
46
+ * The mode is passed in because for some providers auth and estate are the
47
+ * same decision expressed in the URL; here it is unused, and saying so is
48
+ * cheaper than wondering later whether it was forgotten.
49
+ */
50
+ declare function gmailInboxAuthorize(credentials: Record<string, string | undefined>, request: PreparedRequest, _mode: ConnectorMode): void;
51
+ /** The Gmail Inbox service, for the TypeScript runtime. */
52
+ declare const GMAIL_INBOX: ServiceDescriptor;
53
+
54
+ /**
55
+ * GENERATED FILE — do not edit.
56
+ *
57
+ * Emitted from provider/fixtures/ by weaver's generator.
58
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
59
+ * being rejected, because it works until it silently does not. Fix
60
+ * provider/fixtures/ (or weaver's template/) and regenerate:
61
+ *
62
+ * npm run provider -- gmail_inbox
63
+ */
64
+ /**
65
+ * The Gmail Inbox faker.
66
+ *
67
+ * Shapes, not behaviour: the goal is that a downstream node sees the field
68
+ * NAMES Gmail Inbox actually publishes, so an author can wire {{ $json.data.id
69
+ * }} against a fake and have it keep working against the real thing.
70
+ *
71
+ * Deterministic — same inputs, same output. A faker returning a fresh uuid
72
+ * every call cannot be asserted on, so its fixtures degrade to "it did not
73
+ * throw", which is the assertion that catches nothing.
74
+ */
75
+
76
+ declare const gmailInboxFaker: ConnectorFaker;
77
+
78
+ /**
79
+ * GENERATED FILE — do not edit.
80
+ *
81
+ * Emitted from provider/actions/label-list.json by weaver's generator.
82
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
83
+ * being rejected, because it works until it silently does not. Fix
84
+ * provider/actions/label-list.json (or weaver's template/) and regenerate:
85
+ *
86
+ * npm run provider -- gmail_inbox
87
+ */
88
+ /**
89
+ * List every label on the mailbox, system and user-created.
90
+ *
91
+ * GET /gmail/v1/users/{userId}/labels —
92
+ * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/list
93
+ *
94
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
95
+ * no fake/real branch. This describes the request; callConnector resolves the
96
+ * connection, picks the estate, and either calls Gmail Inbox or calls the
97
+ * faker.
98
+ */
99
+
100
+ declare const LABEL_LIST_OPERATION = "label_list";
101
+ type LabelListOptions = {
102
+ /** The node's resolved config. Keys: userId. */
103
+ config: Record<string, unknown>;
104
+ credentials?: Record<string, string | undefined>;
105
+ mode?: RequestedMode;
106
+ connectionId?: string | null;
107
+ input?: unknown;
108
+ attempts?: number;
109
+ /** Override the transport. The only way to exercise this without a network. */
110
+ transport?: Transport;
111
+ };
112
+ declare function gmailInboxLabelList(options: LabelListOptions): Promise<ConnectorResult>;
113
+
114
+ /**
115
+ * GENERATED FILE — do not edit.
116
+ *
117
+ * Emitted from provider/actions/message-get.json by weaver's generator.
118
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
119
+ * being rejected, because it works until it silently does not. Fix
120
+ * provider/actions/message-get.json (or weaver's template/) and regenerate:
121
+ *
122
+ * npm run provider -- gmail_inbox
123
+ */
124
+ /**
125
+ * Read one message's headers and preview. The body's plain/HTML text is NOT
126
+ * decoded -- see the raw payload for that.
127
+ *
128
+ * GET /gmail/v1/users/{userId}/messages/{id} —
129
+ * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/get
130
+ *
131
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
132
+ * no fake/real branch. This describes the request; callConnector resolves the
133
+ * connection, picks the estate, and either calls Gmail Inbox or calls the
134
+ * faker.
135
+ */
136
+
137
+ declare const MESSAGE_GET_OPERATION = "message_get";
138
+ type MessageGetOptions = {
139
+ /** The node's resolved config. Keys: userId, id. */
140
+ config: Record<string, unknown>;
141
+ credentials?: Record<string, string | undefined>;
142
+ mode?: RequestedMode;
143
+ connectionId?: string | null;
144
+ input?: unknown;
145
+ attempts?: number;
146
+ /** Override the transport. The only way to exercise this without a network. */
147
+ transport?: Transport;
148
+ };
149
+ declare function gmailInboxMessageGet(options: MessageGetOptions): Promise<ConnectorResult>;
150
+
151
+ /**
152
+ * GENERATED FILE — do not edit.
153
+ *
154
+ * Emitted from provider/actions/message-list.json by weaver's generator.
155
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
156
+ * being rejected, because it works until it silently does not. Fix
157
+ * provider/actions/message-list.json (or weaver's template/) and regenerate:
158
+ *
159
+ * npm run provider -- gmail_inbox
160
+ */
161
+ /**
162
+ * List message ids matching a search, newest first.
163
+ *
164
+ * GET /gmail/v1/users/{userId}/messages —
165
+ * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/list
166
+ *
167
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
168
+ * no fake/real branch. This describes the request; callConnector resolves the
169
+ * connection, picks the estate, and either calls Gmail Inbox or calls the
170
+ * faker.
171
+ */
172
+
173
+ declare const MESSAGE_LIST_OPERATION = "message_list";
174
+ type MessageListOptions = {
175
+ /** The node's resolved config. Keys: userId, q, labelId, includeSpamTrash, maxResults, pageToken. */
176
+ config: Record<string, unknown>;
177
+ credentials?: Record<string, string | undefined>;
178
+ mode?: RequestedMode;
179
+ connectionId?: string | null;
180
+ input?: unknown;
181
+ attempts?: number;
182
+ /** Override the transport. The only way to exercise this without a network. */
183
+ transport?: Transport;
184
+ };
185
+ declare function gmailInboxMessageList(options: MessageListOptions): Promise<ConnectorResult>;
186
+
187
+ /**
188
+ * GENERATED FILE — do not edit.
189
+ *
190
+ * Emitted from provider/actions/thread-get.json by weaver's generator.
191
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
192
+ * being rejected, because it works until it silently does not. Fix
193
+ * provider/actions/thread-get.json (or weaver's template/) and regenerate:
194
+ *
195
+ * npm run provider -- gmail_inbox
196
+ */
197
+ /**
198
+ * Read every message in a conversation thread, oldest first.
199
+ *
200
+ * GET /gmail/v1/users/{userId}/threads/{id} —
201
+ * https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get
202
+ *
203
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
204
+ * no fake/real branch. This describes the request; callConnector resolves the
205
+ * connection, picks the estate, and either calls Gmail Inbox or calls the
206
+ * faker.
207
+ */
208
+
209
+ declare const THREAD_GET_OPERATION = "thread_get";
210
+ type ThreadGetOptions = {
211
+ /** The node's resolved config. Keys: userId, id. */
212
+ config: Record<string, unknown>;
213
+ credentials?: Record<string, string | undefined>;
214
+ mode?: RequestedMode;
215
+ connectionId?: string | null;
216
+ input?: unknown;
217
+ attempts?: number;
218
+ /** Override the transport. The only way to exercise this without a network. */
219
+ transport?: Transport;
220
+ };
221
+ declare function gmailInboxThreadGet(options: ThreadGetOptions): Promise<ConnectorResult>;
222
+
223
+ export { CONNECTOR_API_VERSION, GMAIL_INBOX, GMAIL_INBOX_BASE_URLS, GMAIL_INBOX_REQUIRES, LABEL_LIST_OPERATION, type LabelListOptions, MESSAGE_GET_OPERATION, MESSAGE_LIST_OPERATION, type MessageGetOptions, type MessageListOptions, THREAD_GET_OPERATION, type ThreadGetOptions, gmailInboxAuthorize, gmailInboxFaker, gmailInboxLabelList, gmailInboxMessageGet, gmailInboxMessageList, gmailInboxThreadGet };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ 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 } from './chunk-UT3U2BPM.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,18 +1,90 @@
1
1
  {
2
2
  "name": "@particle-academy/gmail-inbox-js",
3
- "version": "0.0.0",
4
- "description": "A placeholder that claims the name @particle-academy/gmail-inbox-js; the real release follows through Fancy-Friends/gmail-inbox's publish.yml with provenance. Do not install this version.",
5
- "license": "MIT",
3
+ "version": "0.1.0",
4
+ "description": "Gmail Inbox for Node — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP on @particle-academy/fancy-connector-core; no vendor SDK.",
6
5
  "repository": {
7
6
  "type": "git",
8
7
  "url": "git+https://github.com/Fancy-Friends/gmail-inbox.git",
9
8
  "directory": "packages/js"
10
9
  },
11
10
  "homepage": "https://github.com/Fancy-Friends/gmail-inbox#readme",
11
+ "bugs": "https://github.com/Fancy-Friends/gmail-inbox/issues",
12
+ "type": "module",
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "require": {
23
+ "types": "./dist/index.d.cts",
24
+ "default": "./dist/index.cjs"
25
+ }
26
+ },
27
+ "./flow": {
28
+ "import": {
29
+ "types": "./dist/flow.d.ts",
30
+ "default": "./dist/flow.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/flow.d.cts",
34
+ "default": "./dist/flow.cjs"
35
+ }
36
+ },
37
+ "./package.json": "./package.json"
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "art",
42
+ "README.md",
43
+ "CHANGELOG.md",
44
+ "LICENSE"
45
+ ],
46
+ "scripts": {
47
+ "build": "tsup",
48
+ "lint": "tsc --noEmit",
49
+ "test": "node --import tsx --test tests/*.test.ts",
50
+ "prepublishOnly": "tsup"
51
+ },
52
+ "dependencies": {
53
+ "@particle-academy/fancy-connector-core": ">=0.4.0 <2.0"
54
+ },
55
+ "peerDependencies": {
56
+ "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
57
+ "@particle-academy/gmail-inbox-ui": ">=0.1.0 <0.2.0"
58
+ },
59
+ "peerDependenciesMeta": {
60
+ "@particle-academy/fancy-flow": {
61
+ "optional": true
62
+ },
63
+ "@particle-academy/gmail-inbox-ui": {
64
+ "optional": true
65
+ }
66
+ },
67
+ "devDependencies": {
68
+ "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
69
+ "@types/node": "^26.2.0",
70
+ "tsup": "^8.5.0",
71
+ "tsx": "^4.19.0",
72
+ "typescript": "^5.8.0"
73
+ },
12
74
  "publishConfig": {
13
75
  "access": "public"
14
76
  },
15
- "files": [
16
- "README.md"
17
- ]
77
+ "keywords": [
78
+ "gmail_inbox",
79
+ "email",
80
+ "connector",
81
+ "api",
82
+ "fancy-ui",
83
+ "particle-academy"
84
+ ],
85
+ "license": "MIT",
86
+ "sideEffects": false,
87
+ "engines": {
88
+ "node": ">=22"
89
+ }
18
90
  }