@particle-academy/gmail-inbox-ui 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 @@
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;AAAA,IACE,KAAA,EAAO,cAAA;AAAA,IACP,OAAA,EAAS,qBAAA;AAAA,IACT,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,aAAA;AAAA,IACP,OAAA,EAAS,cAAA;AAAA,IACT,OAAA,EAAS,SAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,cAAA;AAAA,IACP,OAAA,EAAS,eAAA;AAAA,IACT,OAAA,EAAS,SAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA;AAEZ;AAoBO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,MAAA,EAAQ,oBAAA;AAAA,EACR,cAAA,EAAgB,8CAAA;AAAA,EAChB,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AC,EAAE,EAAA,EAAI,OAAO,CAAA;AAAA,EACvB,WAAA,EAAa,MAAA;AAAA,EACb,WAAA,EAAa,6BAAA;AAAA,EACb,YAAA,EAAc;AAAA,IACZ;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,QAAA;AAAA,MACP,OAAA,EAAS,SAAA;AAAA,MACT,UAAA,EAAY,IAAA;AAAA,MACZ,SAAA,EAAW;AAAA,KACb;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,IAAA;AAAA,MACP,OAAA,EAAS,WAAA;AAAA,MACT,UAAA,EAAY,IAAA;AAAA,MACZ,aAAA,EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACbC,SAAAA,CAAU,2BAAA,EAA6B,QAAmC,eAAe;AAC7F,CAAC;;;ACvDM,IAAM,iBAAA,GAA0C;AAAA,EACrD,uBAAA;AAAA,EACA,wBAAA;AAAA,EACA,yBAAA;AAAA,EACA;AACF","file":"index.js","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"]}
package/package.json CHANGED
@@ -1,18 +1,69 @@
1
1
  {
2
2
  "name": "@particle-academy/gmail-inbox-ui",
3
- "version": "0.0.0",
4
- "description": "A placeholder that claims the name @particle-academy/gmail-inbox-ui; 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's authoring surface for fancy-flow — the node kinds, their config schemas and their declared output shapes. React on every host; carries no executor.",
6
5
  "repository": {
7
6
  "type": "git",
8
7
  "url": "git+https://github.com/Fancy-Friends/gmail-inbox.git",
9
8
  "directory": "packages/ui"
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
+ "./package.json": "./package.json"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "art",
32
+ "README.md",
33
+ "CHANGELOG.md",
34
+ "LICENSE"
35
+ ],
36
+ "scripts": {
37
+ "build": "tsup",
38
+ "lint": "tsc --noEmit",
39
+ "test": "node --import tsx --test tests/*.test.ts",
40
+ "prepublishOnly": "tsup"
41
+ },
42
+ "dependencies": {},
43
+ "peerDependencies": {
44
+ "@particle-academy/fancy-flow": ">=0.48.0 <2.0"
45
+ },
46
+ "devDependencies": {
47
+ "@particle-academy/fancy-flow": ">=0.48.0 <2.0",
48
+ "@types/node": "^26.2.0",
49
+ "tsup": "^8.5.0",
50
+ "tsx": "^4.19.0",
51
+ "typescript": "^5.8.0"
52
+ },
12
53
  "publishConfig": {
13
54
  "access": "public"
14
55
  },
15
- "files": [
16
- "README.md"
17
- ]
56
+ "keywords": [
57
+ "gmail_inbox",
58
+ "email",
59
+ "connector",
60
+ "fancy-flow",
61
+ "fancy-ui",
62
+ "particle-academy"
63
+ ],
64
+ "license": "MIT",
65
+ "sideEffects": false,
66
+ "engines": {
67
+ "node": ">=22"
68
+ }
18
69
  }