@particle-academy/discord-js 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,15 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@particle-academy/discord-ui`,
4
+ `@particle-academy/discord-js`, `particle-academy/discord-php` and `fancy-discord`.
5
+
6
+ ## [0.1.0] - 2026-08-30
7
+
8
+ ### Added
9
+
10
+ - Send text messages through Discord API v10 with bot-token authentication.
11
+ - Enforced nonces for short-window retry deduplication and a 25-character key limit.
12
+ - Safe mention defaults that prevent message text from unexpectedly notifying users or roles.
13
+ - Dedicated test-server guidance and a fixture matching Discord's top-level Message object.
14
+
15
+ [0.1.0]: https://github.com/Fancy-Friends/discord/releases/tag/v0.1.0
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 ADDED
@@ -0,0 +1,86 @@
1
+ # Discord
2
+
3
+ Discord for [fancy-flow][flow] — as **four imported, versioned packages**, one
4
+ per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
5
+ change.
6
+
7
+ [flow]: https://github.com/Particle-Academy/fancy-flow
8
+
9
+ | Runtime | Package | Install |
10
+ |---|---|---|
11
+ | Authoring surface (every host) | `@particle-academy/discord-ui` | `npm install @particle-academy/discord-ui` |
12
+ | Node | `@particle-academy/discord-js` | `npm install @particle-academy/discord-js` |
13
+ | PHP 8.4+ | `particle-academy/discord-php` | `composer require particle-academy/discord-php` |
14
+ | Python 3.11+ | `fancy-discord` | `pip install fancy-discord` |
15
+
16
+ The `ui` package is the editor surface and is React on every host — a PHP or
17
+ Python project installs it *and* its own runtime package, and never the `js` one.
18
+
19
+ ## What it costs you
20
+
21
+ One dependency: `@particle-academy/fancy-connector-core` (or
22
+ `particle-academy/fancy-connector-core` on Composer), which the `js` and `php`
23
+ packages pull in themselves. The Python package has **zero** runtime
24
+ dependencies.
25
+
26
+ **No Discord SDK.** Plain HTTP, deliberately: a vendor SDK is third-party code
27
+ subject to the kit's full approval bar, and one per provider is hundreds of
28
+ dependencies nobody is tracking.
29
+
30
+ ## Setting it up
31
+
32
+ Everything below is generated from `provider/manifest.json`, so it cannot disagree with what the packages do.
33
+
34
+ ### Credentials
35
+
36
+ A Discord connection holds 1 value.
37
+
38
+ Every value here is `account` scope: one per connected account, not one per installation.
39
+
40
+ | Field | Scope | Secret | Where it comes from |
41
+ |---|---|---|---|
42
+ | **Bot token** | per connected account | **secret** | The token from the application's Bot page. Treat it as a password and install that bot into the target server with Send Messages permission. |
43
+
44
+ ### The estate
45
+
46
+ Discord has a test estate on the same host, reached with credentials from a SEPARATE test account you register. Selecting sandbox mode uses those credentials.
47
+
48
+ > Create a development-only Discord application, install its bot into a dedicated test server, and use a test channel id. Messages are real and can notify members of that server; production credentials sent in sandbox mode are not technically rejected.
49
+
50
+ ## What it can do
51
+
52
+ ### Actions
53
+
54
+ #### `message_create` — Discord message
55
+
56
+ Send a text message to a Discord channel.
57
+
58
+ `POST /channels/{channelId}/messages` · idempotent — safe to replay
59
+
60
+ | Input | Required | What it is |
61
+ |---|---|---|
62
+ | `channelId` | yes | The Discord snowflake for a guild text channel or DM channel. The bot must be present and have Send Messages permission there. |
63
+ | `content` | yes | Plain message content, up to Discord's 2,000-character limit. Mentions are rendered as text but do not notify because this action sends an empty allowed_mentions parse list. |
64
+
65
+ ## Run it before you have credentials
66
+
67
+ Every operation ships a **faker**, whether or not Discord has a sandbox. Set a
68
+ node's mode to `fake` and it returns the shape Discord actually publishes — the
69
+ same field names, deterministically — so you can wire the downstream nodes before
70
+ touching an account, a key, or a network.
71
+
72
+ ## This repository is generated
73
+
74
+ `provider/` is the source. Everything under `packages/` is emitted from it and
75
+ **must not be hand-edited** — CI regenerates and diffs on every push, and the
76
+ next protocol sync destroys anything it finds. See [`AGENTS.md`](AGENTS.md).
77
+
78
+ ## Two namespaces, which do not match on purpose
79
+
80
+ The repo is `github.com/Fancy-Friends/discord`; the packages publish under
81
+ `particle-academy`. Nothing derives one from the other — the names come from
82
+ weaver's `friends.json` and nowhere else.
83
+
84
+ ## Licence
85
+
86
+ MIT.
@@ -0,0 +1,112 @@
1
+ import { callConnector } from '@particle-academy/fancy-connector-core';
2
+
3
+ // src/faker.ts
4
+ function fakeMessageCreate({ config, fake }) {
5
+ return {
6
+ "id": "1409987654321098765",
7
+ "channel_id": "1409123456789012345",
8
+ "author": {
9
+ "id": "1409000000000000001",
10
+ "username": "Release Bot",
11
+ "avatar": null,
12
+ "discriminator": "0000",
13
+ "public_flags": 0,
14
+ "flags": 0,
15
+ "bot": true,
16
+ "banner": null,
17
+ "accent_color": null,
18
+ "global_name": null,
19
+ "avatar_decoration_data": null,
20
+ "collectibles": null,
21
+ "primary_guild": null
22
+ },
23
+ "content": "Deployment finished successfully.",
24
+ "timestamp": "2026-08-30T18:42:15.123000+00:00",
25
+ "edited_timestamp": null,
26
+ "tts": false,
27
+ "mention_everyone": false,
28
+ "mentions": [],
29
+ "mention_roles": [],
30
+ "attachments": [],
31
+ "embeds": [],
32
+ "pinned": false,
33
+ "type": 0,
34
+ "flags": 0,
35
+ "components": [],
36
+ "nonce": "run42-step7"
37
+ };
38
+ }
39
+ var discordFaker = (operation, request) => {
40
+ switch (operation) {
41
+ case "message_create":
42
+ return fakeMessageCreate(request);
43
+ default:
44
+ throw new Error(
45
+ `discord: 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.`
46
+ );
47
+ }
48
+ };
49
+
50
+ // src/service.ts
51
+ var CONNECTOR_API_VERSION = 1;
52
+ var DISCORD_BASE_URLS = {
53
+ "live": "https://discord.com/api/v10",
54
+ "sandbox": "https://discord.com/api/v10"
55
+ };
56
+ var DISCORD_REQUIRES = [
57
+ "botToken"
58
+ ];
59
+ function discordAuthorize(credentials, request, _mode) {
60
+ request.headers["Authorization"] = `Bot ${credentials.botToken ?? ""}`;
61
+ }
62
+ var DISCORD = {
63
+ service: "discord",
64
+ title: "Discord",
65
+ sandbox: "separate-account",
66
+ baseUrls: { ...DISCORD_BASE_URLS },
67
+ requires: [...DISCORD_REQUIRES],
68
+ authorize: discordAuthorize,
69
+ faker: discordFaker
70
+ };
71
+ var MESSAGE_CREATE_OPERATION = "message_create";
72
+ async function discordMessageCreate(options) {
73
+ const config = options.config ?? {};
74
+ if (config.channelId === void 0 || config.channelId === null || config.channelId === "") {
75
+ throw new Error(`message_create: "channelId" is required (Channel ID).`);
76
+ }
77
+ if (config.content === void 0 || config.content === null || config.content === "") {
78
+ throw new Error(`message_create: "content" is required (Message).`);
79
+ }
80
+ if (options.idempotencyKey === void 0 || options.idempotencyKey === "") {
81
+ throw new Error(
82
+ "message_create: an idempotencyKey is required \u2014 derive it from the RUN and the STEP, never fresh, or a retried run takes a second payment."
83
+ );
84
+ }
85
+ if (options.idempotencyKey.length > 25) {
86
+ throw new Error("message_create: idempotencyKey must be at most 25 characters.");
87
+ }
88
+ return callConnector(DISCORD, {
89
+ operation: MESSAGE_CREATE_OPERATION,
90
+ config,
91
+ input: options.input,
92
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
93
+ ...options.mode === void 0 ? {} : { mode: options.mode },
94
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
95
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
96
+ ...options.transport === void 0 ? {} : { transport: options.transport },
97
+ request: {
98
+ method: "POST",
99
+ path: `/channels/${encodeURIComponent(String(config.channelId))}/messages`,
100
+ json: {
101
+ "content": String(config.content),
102
+ "nonce": options.idempotencyKey,
103
+ "enforce_nonce": true,
104
+ "allowed_mentions": { "parse": [] }
105
+ }
106
+ }
107
+ });
108
+ }
109
+
110
+ export { CONNECTOR_API_VERSION, DISCORD, DISCORD_BASE_URLS, DISCORD_REQUIRES, MESSAGE_CREATE_OPERATION, discordAuthorize, discordFaker, discordMessageCreate };
111
+ //# sourceMappingURL=chunk-CINC5SYU.js.map
112
+ //# sourceMappingURL=chunk-CINC5SYU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/message-create.ts"],"names":[],"mappings":";;;AAyBA,SAAS,iBAAA,CAAkB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AACjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,qBAAA;AAAA,IACN,YAAA,EAAc,qBAAA;AAAA,IACd,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,qBAAA;AAAA,MACN,UAAA,EAAY,aAAA;AAAA,MACZ,QAAA,EAAU,IAAA;AAAA,MACV,eAAA,EAAiB,MAAA;AAAA,MACjB,cAAA,EAAgB,CAAA;AAAA,MAChB,OAAA,EAAS,CAAA;AAAA,MACT,KAAA,EAAO,IAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,cAAA,EA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AA,CAAQ,IAAA,EAAK;AAAA,IAC3D,GAAI,QAAQ,YAAA,KAAiB,MAAA,GAAY,EAAC,GAAI,EAAE,YAAA,EAAc,OAAA,CAAQ,YAAA,EAAa;AAAA,IACnF,GAAI,QAAQ,QAAA,KAAa,MAAA,GAAY,EAAC,GAAI,EAAE,QAAA,EAAU,OAAA,CAAQ,QAAA,EAAS;AAAA,IACvE,GAAI,QAAQ,SAAA,KAAc,MAAA,GAAY,EAAC,GAAI,EAAE,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAU;AAAA,IAC1E,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,MAAA;AAAA,MACR,MAAM,CAAA,UAAA,EAAa,kBAAA,CAAmB,OAAO,MAAA,CAAO,SAAS,CAAC,CAAC,CAAA,SAAA,CAAA;AAAA,MAC/D,IAAA,EAAM;AAAA,QACJ,SAAA,EAAW,MAAA,CAAO,MAAA,CAAO,OAAO,CAAA;AAAA,QAChC,SAAS,OAAA,CAAQ,cAAA;AAAA,QACjB,eAAA,EAAiB,IAAA;AAAA,QACjB,kBAAA,EAAoB,EAAC,OAAA,EAAQ,EAAC;AAAC;AACjC;AACF,GACD,CAAA;AACH","file":"chunk-CINC5SYU.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 -- discord\n */\n\n/**\n * The Discord faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Discord 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 fakeMessageCreate({ config, fake }: FakeRequest): unknown {\n return {\n \"id\": \"1409987654321098765\",\n \"channel_id\": \"1409123456789012345\",\n \"author\": {\n \"id\": \"1409000000000000001\",\n \"username\": \"Release Bot\",\n \"avatar\": null,\n \"discriminator\": \"0000\",\n \"public_flags\": 0,\n \"flags\": 0,\n \"bot\": true,\n \"banner\": null,\n \"accent_color\": null,\n \"global_name\": null,\n \"avatar_decoration_data\": null,\n \"collectibles\": null,\n \"primary_guild\": null,\n },\n \"content\": \"Deployment finished successfully.\",\n \"timestamp\": \"2026-08-30T18:42:15.123000+00:00\",\n \"edited_timestamp\": null,\n \"tts\": false,\n \"mention_everyone\": false,\n \"mentions\": [],\n \"mention_roles\": [],\n \"attachments\": [],\n \"embeds\": [],\n \"pinned\": false,\n \"type\": 0,\n \"flags\": 0,\n \"components\": [],\n \"nonce\": \"run42-step7\",\n };\n}\n\nexport const discordFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"message_create\":\n return fakeMessageCreate(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 `discord: 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 -- discord\n */\n\n/**\n * Discord, as one service descriptor shared by every Discord operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Discord: 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 * Create a development-only Discord application, install its bot into a\n * dedicated test server, and use a test channel id. Messages are real and can\n * notify members of that server; production credentials sent in sandbox mode\n * are not technically rejected.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { discordFaker } 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 DISCORD_BASE_URLS = {\n \"live\": \"https://discord.com/api/v10\",\n \"sandbox\": \"https://discord.com/api/v10\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const DISCORD_REQUIRES = [\n \"botToken\"\n] as const;\n\n/**\n * Apply Discord's auth scheme to an outgoing request.\n *\n * A bot token authenticates as the application's dedicated bot user, not as a\n * human through OAuth2. Discord requires the literal `Bot ` scheme; using\n * Bearer would describe a user OAuth token and a different permission model.\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 discordAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers[\"Authorization\"] = `Bot ${credentials.botToken ?? \"\"}`;\n}\n\n/** The Discord service, for the TypeScript runtime. */\nexport const DISCORD: ServiceDescriptor = {\n service: \"discord\",\n title: \"Discord\",\n sandbox: \"separate-account\",\n baseUrls: { ...DISCORD_BASE_URLS },\n requires: [...DISCORD_REQUIRES],\n authorize: discordAuthorize,\n faker: discordFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-create.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-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- discord\n */\n\n/**\n * Send a text message to a Discord channel.\n *\n * POST /channels/{channelId}/messages —\n * https://docs.discord.com/developers/resources/message#create-message\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 Discord or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { DISCORD } from \"../service.js\";\n\nexport const MESSAGE_CREATE_OPERATION = \"message_create\";\n\nexport type MessageCreateOptions = {\n /** The node's resolved config. Keys: channelId, content. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n /** Derived from the run and the step, never fresh. See the note above. */\n idempotencyKey?: string;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function discordMessageCreate(options: MessageCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.channelId === undefined || config.channelId === null || config.channelId === \"\") {\n throw new Error(`message_create: \"channelId\" is required (Channel ID).`);\n }\n\n if (config.content === undefined || config.content === null || config.content === \"\") {\n throw new Error(`message_create: \"content\" is required (Message).`);\n }\n\n if (options.idempotencyKey === undefined || options.idempotencyKey === \"\") {\n throw new Error(\n \"message_create: an idempotencyKey is required — derive it from the RUN and the STEP, \" +\n \"never fresh, or a retried run takes a second payment.\",\n );\n }\n\n if (options.idempotencyKey.length > 25) {\n throw new Error(\"message_create: idempotencyKey must be at most 25 characters.\");\n }\n\n return callConnector(DISCORD, {\n operation: MESSAGE_CREATE_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: \"POST\",\n path: `/channels/${encodeURIComponent(String(config.channelId))}/messages`,\n json: {\n \"content\": String(config.content),\n \"nonce\": options.idempotencyKey,\n \"enforce_nonce\": true,\n \"allowed_mentions\": {\"parse\":[]},\n },\n },\n });\n}\n"]}
package/dist/flow.cjs ADDED
@@ -0,0 +1,148 @@
1
+ 'use strict';
2
+
3
+ var fancyConnectorCore = require('@particle-academy/fancy-connector-core');
4
+ var discordUi = require('@particle-academy/discord-ui');
5
+
6
+ // src/flow.ts
7
+
8
+ // src/faker.ts
9
+ function fakeMessageCreate({ config, fake }) {
10
+ return {
11
+ "id": "1409987654321098765",
12
+ "channel_id": "1409123456789012345",
13
+ "author": {
14
+ "id": "1409000000000000001",
15
+ "username": "Release Bot",
16
+ "avatar": null,
17
+ "discriminator": "0000",
18
+ "public_flags": 0,
19
+ "flags": 0,
20
+ "bot": true,
21
+ "banner": null,
22
+ "accent_color": null,
23
+ "global_name": null,
24
+ "avatar_decoration_data": null,
25
+ "collectibles": null,
26
+ "primary_guild": null
27
+ },
28
+ "content": "Deployment finished successfully.",
29
+ "timestamp": "2026-08-30T18:42:15.123000+00:00",
30
+ "edited_timestamp": null,
31
+ "tts": false,
32
+ "mention_everyone": false,
33
+ "mentions": [],
34
+ "mention_roles": [],
35
+ "attachments": [],
36
+ "embeds": [],
37
+ "pinned": false,
38
+ "type": 0,
39
+ "flags": 0,
40
+ "components": [],
41
+ "nonce": "run42-step7"
42
+ };
43
+ }
44
+ var discordFaker = (operation, request) => {
45
+ switch (operation) {
46
+ case "message_create":
47
+ return fakeMessageCreate(request);
48
+ default:
49
+ throw new Error(
50
+ `discord: 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.`
51
+ );
52
+ }
53
+ };
54
+
55
+ // src/service.ts
56
+ var DISCORD_BASE_URLS = {
57
+ "live": "https://discord.com/api/v10",
58
+ "sandbox": "https://discord.com/api/v10"
59
+ };
60
+ var DISCORD_REQUIRES = [
61
+ "botToken"
62
+ ];
63
+ function discordAuthorize(credentials, request, _mode) {
64
+ request.headers["Authorization"] = `Bot ${credentials.botToken ?? ""}`;
65
+ }
66
+ var DISCORD = {
67
+ service: "discord",
68
+ title: "Discord",
69
+ sandbox: "separate-account",
70
+ baseUrls: { ...DISCORD_BASE_URLS },
71
+ requires: [...DISCORD_REQUIRES],
72
+ authorize: discordAuthorize,
73
+ faker: discordFaker
74
+ };
75
+ var MESSAGE_CREATE_OPERATION = "message_create";
76
+ async function discordMessageCreate(options) {
77
+ const config = options.config ?? {};
78
+ if (config.channelId === void 0 || config.channelId === null || config.channelId === "") {
79
+ throw new Error(`message_create: "channelId" is required (Channel ID).`);
80
+ }
81
+ if (config.content === void 0 || config.content === null || config.content === "") {
82
+ throw new Error(`message_create: "content" is required (Message).`);
83
+ }
84
+ if (options.idempotencyKey === void 0 || options.idempotencyKey === "") {
85
+ throw new Error(
86
+ "message_create: an idempotencyKey is required \u2014 derive it from the RUN and the STEP, never fresh, or a retried run takes a second payment."
87
+ );
88
+ }
89
+ if (options.idempotencyKey.length > 25) {
90
+ throw new Error("message_create: idempotencyKey must be at most 25 characters.");
91
+ }
92
+ return fancyConnectorCore.callConnector(DISCORD, {
93
+ operation: MESSAGE_CREATE_OPERATION,
94
+ config,
95
+ input: options.input,
96
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
97
+ ...options.mode === void 0 ? {} : { mode: options.mode },
98
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
99
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
100
+ ...options.transport === void 0 ? {} : { transport: options.transport },
101
+ request: {
102
+ method: "POST",
103
+ path: `/channels/${encodeURIComponent(String(config.channelId))}/messages`,
104
+ json: {
105
+ "content": String(config.content),
106
+ "nonce": options.idempotencyKey,
107
+ "enforce_nonce": true,
108
+ "allowed_mentions": { "parse": [] }
109
+ }
110
+ }
111
+ });
112
+ }
113
+
114
+ // src/flow.ts
115
+ var discordMessageExecutor = async (ctx) => {
116
+ const config = ctx.node.data?.config ?? {};
117
+ const idempotencyKey = fancyConnectorCore.idempotencyKeyFor(ctx, ctx.node.id, {
118
+ context: { service: "discord", operation: "message_create" }
119
+ });
120
+ if (idempotencyKey === null) {
121
+ ctx.emit({
122
+ type: "log",
123
+ level: "warn",
124
+ nodeId: ctx.node.id,
125
+ message: `message_create: ${fancyConnectorCore.NO_IDEMPOTENCY_KEY_WARNING}`
126
+ });
127
+ }
128
+ const result = await discordMessageCreate({
129
+ config,
130
+ input: ctx.inputs?.in,
131
+ ...idempotencyKey === null ? {} : { idempotencyKey }
132
+ });
133
+ ctx.emit({
134
+ type: "log",
135
+ level: "info",
136
+ nodeId: ctx.node.id,
137
+ message: `discord message_create ${result.data?.id} (${result.mode})`
138
+ });
139
+ return { __port: "out", value: result };
140
+ };
141
+ var DISCORD_RUNNABLE_KINDS = [
142
+ { ...discordUi.discordMessageKind, executor: discordMessageExecutor }
143
+ ];
144
+
145
+ exports.DISCORD_RUNNABLE_KINDS = DISCORD_RUNNABLE_KINDS;
146
+ exports.discordMessageExecutor = discordMessageExecutor;
147
+ //# sourceMappingURL=flow.cjs.map
148
+ //# sourceMappingURL=flow.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/message-create.ts","../src/flow.ts"],"names":["callConnector","idempotencyKeyFor","NO_IDEMPOTENCY_KEY_WARNING","discordMessageKind"],"mappings":";;;;;;;;AAyBA,SAAS,iBAAA,CAAkB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AACjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,qBAAA;AAAA,IACN,YAAA,EAAc,qBAAA;AAAA,IACd,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,qBAAA;AAAA,MACN,UAAA,EAAY,aAAA;AAAA,MACZ,QAAA,EAAU,IAAA;AAAA,MACV,eAAA,EAAiB,MAAA;AAAA,MACjB,cAAA,EAAgB,CAAA;AAAA,MAChB,OAAA,EAAS,CAAA;AAAA,MACT,KAAA,EAAO,IAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,cAAA,EAAgB,IAAA;AA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A,EAAS,mBAAmBC,6CAA0B,CAAA;AAAA,KACvD,CAAA;AAAA,EACH;AAEA,EAAA,MAAM,MAAA,GAAS,MAAM,oBAAA,CAAqB;AAAA,IACxC,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ,EAAA;AAAA,IACnB,GAAI,cAAA,KAAmB,IAAA,GAAO,EAAC,GAAI,EAAE,cAAA;AAAe,GACrD,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,uBAAA,EAA2B,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACxF,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,sBAAA,GAA+C;AAAA,EAC1D,EAAE,GAAGC,4BAAA,EAAoB,QAAA,EAAU,sBAAA;AACrC","file":"flow.cjs","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 -- discord\n */\n\n/**\n * The Discord faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Discord 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 fakeMessageCreate({ config, fake }: FakeRequest): unknown {\n return {\n \"id\": \"1409987654321098765\",\n \"channel_id\": \"1409123456789012345\",\n \"author\": {\n \"id\": \"1409000000000000001\",\n \"username\": \"Release Bot\",\n \"avatar\": null,\n \"discriminator\": \"0000\",\n \"public_flags\": 0,\n \"flags\": 0,\n \"bot\": true,\n \"banner\": null,\n \"accent_color\": null,\n \"global_name\": null,\n \"avatar_decoration_data\": null,\n \"collectibles\": null,\n \"primary_guild\": null,\n },\n \"content\": \"Deployment finished successfully.\",\n \"timestamp\": \"2026-08-30T18:42:15.123000+00:00\",\n \"edited_timestamp\": null,\n \"tts\": false,\n \"mention_everyone\": false,\n \"mentions\": [],\n \"mention_roles\": [],\n \"attachments\": [],\n \"embeds\": [],\n \"pinned\": false,\n \"type\": 0,\n \"flags\": 0,\n \"components\": [],\n \"nonce\": \"run42-step7\",\n };\n}\n\nexport const discordFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"message_create\":\n return fakeMessageCreate(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 `discord: 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 -- discord\n */\n\n/**\n * Discord, as one service descriptor shared by every Discord operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Discord: 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 * Create a development-only Discord application, install its bot into a\n * dedicated test server, and use a test channel id. Messages are real and can\n * notify members of that server; production credentials sent in sandbox mode\n * are not technically rejected.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { discordFaker } 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 DISCORD_BASE_URLS = {\n \"live\": \"https://discord.com/api/v10\",\n \"sandbox\": \"https://discord.com/api/v10\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const DISCORD_REQUIRES = [\n \"botToken\"\n] as const;\n\n/**\n * Apply Discord's auth scheme to an outgoing request.\n *\n * A bot token authenticates as the application's dedicated bot user, not as a\n * human through OAuth2. Discord requires the literal `Bot ` scheme; using\n * Bearer would describe a user OAuth token and a different permission model.\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 discordAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers[\"Authorization\"] = `Bot ${credentials.botToken ?? \"\"}`;\n}\n\n/** The Discord service, for the TypeScript runtime. */\nexport const DISCORD: ServiceDescriptor = {\n service: \"discord\",\n title: \"Discord\",\n sandbox: \"separate-account\",\n baseUrls: { ...DISCORD_BASE_URLS },\n requires: [...DISCORD_REQUIRES],\n authorize: discordAuthorize,\n faker: discordFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-create.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-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- discord\n */\n\n/**\n * Send a text message to a Discord channel.\n *\n * POST /channels/{channelId}/messages —\n * https://docs.discord.com/developers/resources/message#create-message\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 Discord or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { DISCORD } from \"../service.js\";\n\nexport const MESSAGE_CREATE_OPERATION = \"message_create\";\n\nexport type MessageCreateOptions = {\n /** The node's resolved config. Keys: channelId, content. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n /** Derived from the run and the step, never fresh. See the note above. */\n idempotencyKey?: string;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function discordMessageCreate(options: MessageCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.channelId === undefined || config.channelId === null || config.channelId === \"\") {\n throw new Error(`message_create: \"channelId\" is required (Channel ID).`);\n }\n\n if (config.content === undefined || config.content === null || config.content === \"\") {\n throw new Error(`message_create: \"content\" is required (Message).`);\n }\n\n if (options.idempotencyKey === undefined || options.idempotencyKey === \"\") {\n throw new Error(\n \"message_create: an idempotencyKey is required — derive it from the RUN and the STEP, \" +\n \"never fresh, or a retried run takes a second payment.\",\n );\n }\n\n if (options.idempotencyKey.length > 25) {\n throw new Error(\"message_create: idempotencyKey must be at most 25 characters.\");\n }\n\n return callConnector(DISCORD, {\n operation: MESSAGE_CREATE_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: \"POST\",\n path: `/channels/${encodeURIComponent(String(config.channelId))}/messages`,\n json: {\n \"content\": String(config.content),\n \"nonce\": options.idempotencyKey,\n \"enforce_nonce\": true,\n \"allowed_mentions\": {\"parse\":[]},\n },\n },\n });\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ 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/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- discord\n */\n\n/**\n * Discord's node kinds with their TypeScript executors attached — for hosts\n * that EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/discord-ui carries no executor:\n * the editor is React on every host, so a PHP or Python project installs the\n * ui package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { DISCORD } from \"./service.js\";\n\nimport {\n discordMessageKind,\n} from \"@particle-academy/discord-ui\";\n\nimport { discordMessageCreate } from \"./actions/message-create.js\";\n\nexport const discordMessageExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n // Derived from the RUN and the NODE, never fresh. A retried durable run\n // must send the same key or Discord creates a second one — the exact\n // failure \"idempotent\" exists to prevent.\n const idempotencyKey = idempotencyKeyFor(ctx, ctx.node.id, {\n context: { service: \"discord\", operation: \"message_create\" },\n });\n if (idempotencyKey === null) {\n ctx.emit({\n type: \"log\",\n level: \"warn\",\n nodeId: ctx.node.id,\n message: `message_create: ${NO_IDEMPOTENCY_KEY_WARNING}`,\n });\n }\n\n const result = await discordMessageCreate({\n config,\n input: ctx.inputs?.in,\n ...(idempotencyKey === null ? {} : { idempotencyKey }),\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `discord message_create ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const DISCORD_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...discordMessageKind, executor: discordMessageExecutor },\n];\n"]}
@@ -0,0 +1,26 @@
1
+ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/engine';
2
+
3
+ /**
4
+ * GENERATED FILE — do not edit.
5
+ *
6
+ * Emitted from provider/actions/ + triggers/ 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/actions/ + triggers/ (or weaver's template/) and regenerate:
10
+ *
11
+ * npm run provider -- discord
12
+ */
13
+ /**
14
+ * Discord's node kinds with their TypeScript executors attached — for hosts
15
+ * that EXECUTE on TS.
16
+ *
17
+ * The authoring surface in @particle-academy/discord-ui carries no executor:
18
+ * the editor is React on every host, so a PHP or Python project installs the
19
+ * ui package and never this one.
20
+ */
21
+
22
+ declare const discordMessageExecutor: NodeExecutor;
23
+ /** The kinds a TypeScript host registers. */
24
+ declare const DISCORD_RUNNABLE_KINDS: NodeKindDefinition[];
25
+
26
+ export { DISCORD_RUNNABLE_KINDS, discordMessageExecutor };
package/dist/flow.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/engine';
2
+
3
+ /**
4
+ * GENERATED FILE — do not edit.
5
+ *
6
+ * Emitted from provider/actions/ + triggers/ 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/actions/ + triggers/ (or weaver's template/) and regenerate:
10
+ *
11
+ * npm run provider -- discord
12
+ */
13
+ /**
14
+ * Discord's node kinds with their TypeScript executors attached — for hosts
15
+ * that EXECUTE on TS.
16
+ *
17
+ * The authoring surface in @particle-academy/discord-ui carries no executor:
18
+ * the editor is React on every host, so a PHP or Python project installs the
19
+ * ui package and never this one.
20
+ */
21
+
22
+ declare const discordMessageExecutor: NodeExecutor;
23
+ /** The kinds a TypeScript host registers. */
24
+ declare const DISCORD_RUNNABLE_KINDS: NodeKindDefinition[];
25
+
26
+ export { DISCORD_RUNNABLE_KINDS, discordMessageExecutor };
package/dist/flow.js ADDED
@@ -0,0 +1,37 @@
1
+ import { discordMessageCreate } from './chunk-CINC5SYU.js';
2
+ import { idempotencyKeyFor, NO_IDEMPOTENCY_KEY_WARNING } from '@particle-academy/fancy-connector-core';
3
+ import { discordMessageKind } from '@particle-academy/discord-ui';
4
+
5
+ var discordMessageExecutor = async (ctx) => {
6
+ const config = ctx.node.data?.config ?? {};
7
+ const idempotencyKey = idempotencyKeyFor(ctx, ctx.node.id, {
8
+ context: { service: "discord", operation: "message_create" }
9
+ });
10
+ if (idempotencyKey === null) {
11
+ ctx.emit({
12
+ type: "log",
13
+ level: "warn",
14
+ nodeId: ctx.node.id,
15
+ message: `message_create: ${NO_IDEMPOTENCY_KEY_WARNING}`
16
+ });
17
+ }
18
+ const result = await discordMessageCreate({
19
+ config,
20
+ input: ctx.inputs?.in,
21
+ ...idempotencyKey === null ? {} : { idempotencyKey }
22
+ });
23
+ ctx.emit({
24
+ type: "log",
25
+ level: "info",
26
+ nodeId: ctx.node.id,
27
+ message: `discord message_create ${result.data?.id} (${result.mode})`
28
+ });
29
+ return { __port: "out", value: result };
30
+ };
31
+ var DISCORD_RUNNABLE_KINDS = [
32
+ { ...discordMessageKind, executor: discordMessageExecutor }
33
+ ];
34
+
35
+ export { DISCORD_RUNNABLE_KINDS, discordMessageExecutor };
36
+ //# sourceMappingURL=flow.js.map
37
+ //# sourceMappingURL=flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flow.ts"],"names":[],"mappings":";;;;AAoCO,IAAM,sBAAA,GAAuC,OAAO,GAAA,KAAQ;AACjE,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAKpF,EAAA,MAAM,cAAA,GAAiB,iBAAA,CAAkB,GAAA,EAAK,GAAA,CAAI,KAAK,EAAA,EAAI;AAAA,IACzD,OAAA,EAAS,EAAE,OAAA,EAAS,SAAA,EAAW,WAAW,gBAAA;AAAiB,GAC5D,CAAA;AACD,EAAA,IAAI,mBAAmB,IAAA,EAAM;AAC3B,IAAA,GAAA,CAAI,IAAA,CAAK;AAAA,MACP,IAAA,EAAM,KAAA;AAAA,MACN,KAAA,EAAO,MAAA;AAAA,MACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,MACjB,OAAA,EAAS,mBAAmB,0BAA0B,CAAA;AAAA,KACvD,CAAA;AAAA,EACH;AAEA,EAAA,MAAM,MAAA,GAAS,MAAM,oBAAA,CAAqB;AAAA,IACxC,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ,EAAA;AAAA,IACnB,GAAI,cAAA,KAAmB,IAAA,GAAO,EAAC,GAAI,EAAE,cAAA;AAAe,GACrD,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,uBAAA,EAA2B,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACxF,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,sBAAA,GAA+C;AAAA,EAC1D,EAAE,GAAG,kBAAA,EAAoB,QAAA,EAAU,sBAAA;AACrC","file":"flow.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ 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/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- discord\n */\n\n/**\n * Discord's node kinds with their TypeScript executors attached — for hosts\n * that EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/discord-ui carries no executor:\n * the editor is React on every host, so a PHP or Python project installs the\n * ui package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { DISCORD } from \"./service.js\";\n\nimport {\n discordMessageKind,\n} from \"@particle-academy/discord-ui\";\n\nimport { discordMessageCreate } from \"./actions/message-create.js\";\n\nexport const discordMessageExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n // Derived from the RUN and the NODE, never fresh. A retried durable run\n // must send the same key or Discord creates a second one — the exact\n // failure \"idempotent\" exists to prevent.\n const idempotencyKey = idempotencyKeyFor(ctx, ctx.node.id, {\n context: { service: \"discord\", operation: \"message_create\" },\n });\n if (idempotencyKey === null) {\n ctx.emit({\n type: \"log\",\n level: \"warn\",\n nodeId: ctx.node.id,\n message: `message_create: ${NO_IDEMPOTENCY_KEY_WARNING}`,\n });\n }\n\n const result = await discordMessageCreate({\n config,\n input: ctx.inputs?.in,\n ...(idempotencyKey === null ? {} : { idempotencyKey }),\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `discord message_create ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const DISCORD_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...discordMessageKind, executor: discordMessageExecutor },\n];\n"]}
package/dist/index.cjs ADDED
@@ -0,0 +1,121 @@
1
+ 'use strict';
2
+
3
+ var fancyConnectorCore = require('@particle-academy/fancy-connector-core');
4
+
5
+ // src/faker.ts
6
+ function fakeMessageCreate({ config, fake }) {
7
+ return {
8
+ "id": "1409987654321098765",
9
+ "channel_id": "1409123456789012345",
10
+ "author": {
11
+ "id": "1409000000000000001",
12
+ "username": "Release Bot",
13
+ "avatar": null,
14
+ "discriminator": "0000",
15
+ "public_flags": 0,
16
+ "flags": 0,
17
+ "bot": true,
18
+ "banner": null,
19
+ "accent_color": null,
20
+ "global_name": null,
21
+ "avatar_decoration_data": null,
22
+ "collectibles": null,
23
+ "primary_guild": null
24
+ },
25
+ "content": "Deployment finished successfully.",
26
+ "timestamp": "2026-08-30T18:42:15.123000+00:00",
27
+ "edited_timestamp": null,
28
+ "tts": false,
29
+ "mention_everyone": false,
30
+ "mentions": [],
31
+ "mention_roles": [],
32
+ "attachments": [],
33
+ "embeds": [],
34
+ "pinned": false,
35
+ "type": 0,
36
+ "flags": 0,
37
+ "components": [],
38
+ "nonce": "run42-step7"
39
+ };
40
+ }
41
+ var discordFaker = (operation, request) => {
42
+ switch (operation) {
43
+ case "message_create":
44
+ return fakeMessageCreate(request);
45
+ default:
46
+ throw new Error(
47
+ `discord: 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.`
48
+ );
49
+ }
50
+ };
51
+
52
+ // src/service.ts
53
+ var CONNECTOR_API_VERSION = 1;
54
+ var DISCORD_BASE_URLS = {
55
+ "live": "https://discord.com/api/v10",
56
+ "sandbox": "https://discord.com/api/v10"
57
+ };
58
+ var DISCORD_REQUIRES = [
59
+ "botToken"
60
+ ];
61
+ function discordAuthorize(credentials, request, _mode) {
62
+ request.headers["Authorization"] = `Bot ${credentials.botToken ?? ""}`;
63
+ }
64
+ var DISCORD = {
65
+ service: "discord",
66
+ title: "Discord",
67
+ sandbox: "separate-account",
68
+ baseUrls: { ...DISCORD_BASE_URLS },
69
+ requires: [...DISCORD_REQUIRES],
70
+ authorize: discordAuthorize,
71
+ faker: discordFaker
72
+ };
73
+ var MESSAGE_CREATE_OPERATION = "message_create";
74
+ async function discordMessageCreate(options) {
75
+ const config = options.config ?? {};
76
+ if (config.channelId === void 0 || config.channelId === null || config.channelId === "") {
77
+ throw new Error(`message_create: "channelId" is required (Channel ID).`);
78
+ }
79
+ if (config.content === void 0 || config.content === null || config.content === "") {
80
+ throw new Error(`message_create: "content" is required (Message).`);
81
+ }
82
+ if (options.idempotencyKey === void 0 || options.idempotencyKey === "") {
83
+ throw new Error(
84
+ "message_create: an idempotencyKey is required \u2014 derive it from the RUN and the STEP, never fresh, or a retried run takes a second payment."
85
+ );
86
+ }
87
+ if (options.idempotencyKey.length > 25) {
88
+ throw new Error("message_create: idempotencyKey must be at most 25 characters.");
89
+ }
90
+ return fancyConnectorCore.callConnector(DISCORD, {
91
+ operation: MESSAGE_CREATE_OPERATION,
92
+ config,
93
+ input: options.input,
94
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
95
+ ...options.mode === void 0 ? {} : { mode: options.mode },
96
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
97
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
98
+ ...options.transport === void 0 ? {} : { transport: options.transport },
99
+ request: {
100
+ method: "POST",
101
+ path: `/channels/${encodeURIComponent(String(config.channelId))}/messages`,
102
+ json: {
103
+ "content": String(config.content),
104
+ "nonce": options.idempotencyKey,
105
+ "enforce_nonce": true,
106
+ "allowed_mentions": { "parse": [] }
107
+ }
108
+ }
109
+ });
110
+ }
111
+
112
+ exports.CONNECTOR_API_VERSION = CONNECTOR_API_VERSION;
113
+ exports.DISCORD = DISCORD;
114
+ exports.DISCORD_BASE_URLS = DISCORD_BASE_URLS;
115
+ exports.DISCORD_REQUIRES = DISCORD_REQUIRES;
116
+ exports.MESSAGE_CREATE_OPERATION = MESSAGE_CREATE_OPERATION;
117
+ exports.discordAuthorize = discordAuthorize;
118
+ exports.discordFaker = discordFaker;
119
+ exports.discordMessageCreate = discordMessageCreate;
120
+ //# sourceMappingURL=index.cjs.map
121
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/message-create.ts"],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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 -- discord\n */\n\n/**\n * The Discord faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Discord 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 fakeMessageCreate({ config, fake }: FakeRequest): unknown {\n return {\n \"id\": \"1409987654321098765\",\n \"channel_id\": \"1409123456789012345\",\n \"author\": {\n \"id\": \"1409000000000000001\",\n \"username\": \"Release Bot\",\n \"avatar\": null,\n \"discriminator\": \"0000\",\n \"public_flags\": 0,\n \"flags\": 0,\n \"bot\": true,\n \"banner\": null,\n \"accent_color\": null,\n \"global_name\": null,\n \"avatar_decoration_data\": null,\n \"collectibles\": null,\n \"primary_guild\": null,\n },\n \"content\": \"Deployment finished successfully.\",\n \"timestamp\": \"2026-08-30T18:42:15.123000+00:00\",\n \"edited_timestamp\": null,\n \"tts\": false,\n \"mention_everyone\": false,\n \"mentions\": [],\n \"mention_roles\": [],\n \"attachments\": [],\n \"embeds\": [],\n \"pinned\": false,\n \"type\": 0,\n \"flags\": 0,\n \"components\": [],\n \"nonce\": \"run42-step7\",\n };\n}\n\nexport const discordFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"message_create\":\n return fakeMessageCreate(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 `discord: 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 -- discord\n */\n\n/**\n * Discord, as one service descriptor shared by every Discord operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Discord: 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 * Create a development-only Discord application, install its bot into a\n * dedicated test server, and use a test channel id. Messages are real and can\n * notify members of that server; production credentials sent in sandbox mode\n * are not technically rejected.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { discordFaker } 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 DISCORD_BASE_URLS = {\n \"live\": \"https://discord.com/api/v10\",\n \"sandbox\": \"https://discord.com/api/v10\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const DISCORD_REQUIRES = [\n \"botToken\"\n] as const;\n\n/**\n * Apply Discord's auth scheme to an outgoing request.\n *\n * A bot token authenticates as the application's dedicated bot user, not as a\n * human through OAuth2. Discord requires the literal `Bot ` scheme; using\n * Bearer would describe a user OAuth token and a different permission model.\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 discordAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers[\"Authorization\"] = `Bot ${credentials.botToken ?? \"\"}`;\n}\n\n/** The Discord service, for the TypeScript runtime. */\nexport const DISCORD: ServiceDescriptor = {\n service: \"discord\",\n title: \"Discord\",\n sandbox: \"separate-account\",\n baseUrls: { ...DISCORD_BASE_URLS },\n requires: [...DISCORD_REQUIRES],\n authorize: discordAuthorize,\n faker: discordFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-create.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-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- discord\n */\n\n/**\n * Send a text message to a Discord channel.\n *\n * POST /channels/{channelId}/messages —\n * https://docs.discord.com/developers/resources/message#create-message\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 Discord or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { DISCORD } from \"../service.js\";\n\nexport const MESSAGE_CREATE_OPERATION = \"message_create\";\n\nexport type MessageCreateOptions = {\n /** The node's resolved config. Keys: channelId, content. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n /** Derived from the run and the step, never fresh. See the note above. */\n idempotencyKey?: string;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function discordMessageCreate(options: MessageCreateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.channelId === undefined || config.channelId === null || config.channelId === \"\") {\n throw new Error(`message_create: \"channelId\" is required (Channel ID).`);\n }\n\n if (config.content === undefined || config.content === null || config.content === \"\") {\n throw new Error(`message_create: \"content\" is required (Message).`);\n }\n\n if (options.idempotencyKey === undefined || options.idempotencyKey === \"\") {\n throw new Error(\n \"message_create: an idempotencyKey is required — derive it from the RUN and the STEP, \" +\n \"never fresh, or a retried run takes a second payment.\",\n );\n }\n\n if (options.idempotencyKey.length > 25) {\n throw new Error(\"message_create: idempotencyKey must be at most 25 characters.\");\n }\n\n return callConnector(DISCORD, {\n operation: MESSAGE_CREATE_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: \"POST\",\n path: `/channels/${encodeURIComponent(String(config.channelId))}/messages`,\n json: {\n \"content\": String(config.content),\n \"nonce\": options.idempotencyKey,\n \"enforce_nonce\": true,\n \"allowed_mentions\": {\"parse\":[]},\n },\n },\n });\n}\n"]}
@@ -0,0 +1,118 @@
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 -- discord
12
+ */
13
+ /**
14
+ * Discord, as one service descriptor shared by every Discord operation.
15
+ *
16
+ * @particle-academy/fancy-connector-core carries what is true of ALL
17
+ * connectors. This carries what is true of Discord: its base URL, its auth
18
+ * scheme, its idempotency header, and its faker.
19
+ *
20
+ * ## The sandbox trap, written down where it is used
21
+ *
22
+ * Create a development-only Discord application, install its bot into a
23
+ * dedicated test server, and use a test channel id. Messages are real and can
24
+ * notify members of that server; production credentials sent in sandbox mode
25
+ * are not technically rejected.
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 DISCORD_BASE_URLS: {
37
+ readonly live: "https://discord.com/api/v10";
38
+ readonly sandbox: "https://discord.com/api/v10";
39
+ };
40
+ /** Credential keys a remote call cannot proceed without. */
41
+ declare const DISCORD_REQUIRES: readonly ["botToken"];
42
+ /**
43
+ * Apply Discord's auth scheme to an outgoing request.
44
+ *
45
+ * A bot token authenticates as the application's dedicated bot user, not as a
46
+ * human through OAuth2. Discord requires the literal `Bot ` scheme; using
47
+ * Bearer would describe a user OAuth token and a different permission model.
48
+ *
49
+ * The mode is passed in because for some providers auth and estate are the
50
+ * same decision expressed in the URL; here it is unused, and saying so is
51
+ * cheaper than wondering later whether it was forgotten.
52
+ */
53
+ declare function discordAuthorize(credentials: Record<string, string | undefined>, request: PreparedRequest, _mode: ConnectorMode): void;
54
+ /** The Discord service, for the TypeScript runtime. */
55
+ declare const DISCORD: ServiceDescriptor;
56
+
57
+ /**
58
+ * GENERATED FILE — do not edit.
59
+ *
60
+ * Emitted from provider/fixtures/ by weaver's generator.
61
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
62
+ * being rejected, because it works until it silently does not. Fix
63
+ * provider/fixtures/ (or weaver's template/) and regenerate:
64
+ *
65
+ * npm run provider -- discord
66
+ */
67
+ /**
68
+ * The Discord faker.
69
+ *
70
+ * Shapes, not behaviour: the goal is that a downstream node sees the field
71
+ * NAMES Discord actually publishes, so an author can wire {{ $json.data.id }}
72
+ * against a fake and have it keep working against the real thing.
73
+ *
74
+ * Deterministic — same inputs, same output. A faker returning a fresh uuid
75
+ * every call cannot be asserted on, so its fixtures degrade to "it did not
76
+ * throw", which is the assertion that catches nothing.
77
+ */
78
+
79
+ declare const discordFaker: ConnectorFaker;
80
+
81
+ /**
82
+ * GENERATED FILE — do not edit.
83
+ *
84
+ * Emitted from provider/actions/message-create.json by weaver's generator.
85
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
86
+ * being rejected, because it works until it silently does not. Fix
87
+ * provider/actions/message-create.json (or weaver's template/) and regenerate:
88
+ *
89
+ * npm run provider -- discord
90
+ */
91
+ /**
92
+ * Send a text message to a Discord channel.
93
+ *
94
+ * POST /channels/{channelId}/messages —
95
+ * https://docs.discord.com/developers/resources/message#create-message
96
+ *
97
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
98
+ * no fake/real branch. This describes the request; callConnector resolves the
99
+ * connection, picks the estate, and either calls Discord or calls the faker.
100
+ */
101
+
102
+ declare const MESSAGE_CREATE_OPERATION = "message_create";
103
+ type MessageCreateOptions = {
104
+ /** The node's resolved config. Keys: channelId, content. */
105
+ config: Record<string, unknown>;
106
+ credentials?: Record<string, string | undefined>;
107
+ mode?: RequestedMode;
108
+ connectionId?: string | null;
109
+ input?: unknown;
110
+ /** Derived from the run and the step, never fresh. See the note above. */
111
+ idempotencyKey?: string;
112
+ attempts?: number;
113
+ /** Override the transport. The only way to exercise this without a network. */
114
+ transport?: Transport;
115
+ };
116
+ declare function discordMessageCreate(options: MessageCreateOptions): Promise<ConnectorResult>;
117
+
118
+ export { CONNECTOR_API_VERSION, DISCORD, DISCORD_BASE_URLS, DISCORD_REQUIRES, MESSAGE_CREATE_OPERATION, type MessageCreateOptions, discordAuthorize, discordFaker, discordMessageCreate };
@@ -0,0 +1,118 @@
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 -- discord
12
+ */
13
+ /**
14
+ * Discord, as one service descriptor shared by every Discord operation.
15
+ *
16
+ * @particle-academy/fancy-connector-core carries what is true of ALL
17
+ * connectors. This carries what is true of Discord: its base URL, its auth
18
+ * scheme, its idempotency header, and its faker.
19
+ *
20
+ * ## The sandbox trap, written down where it is used
21
+ *
22
+ * Create a development-only Discord application, install its bot into a
23
+ * dedicated test server, and use a test channel id. Messages are real and can
24
+ * notify members of that server; production credentials sent in sandbox mode
25
+ * are not technically rejected.
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 DISCORD_BASE_URLS: {
37
+ readonly live: "https://discord.com/api/v10";
38
+ readonly sandbox: "https://discord.com/api/v10";
39
+ };
40
+ /** Credential keys a remote call cannot proceed without. */
41
+ declare const DISCORD_REQUIRES: readonly ["botToken"];
42
+ /**
43
+ * Apply Discord's auth scheme to an outgoing request.
44
+ *
45
+ * A bot token authenticates as the application's dedicated bot user, not as a
46
+ * human through OAuth2. Discord requires the literal `Bot ` scheme; using
47
+ * Bearer would describe a user OAuth token and a different permission model.
48
+ *
49
+ * The mode is passed in because for some providers auth and estate are the
50
+ * same decision expressed in the URL; here it is unused, and saying so is
51
+ * cheaper than wondering later whether it was forgotten.
52
+ */
53
+ declare function discordAuthorize(credentials: Record<string, string | undefined>, request: PreparedRequest, _mode: ConnectorMode): void;
54
+ /** The Discord service, for the TypeScript runtime. */
55
+ declare const DISCORD: ServiceDescriptor;
56
+
57
+ /**
58
+ * GENERATED FILE — do not edit.
59
+ *
60
+ * Emitted from provider/fixtures/ by weaver's generator.
61
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
62
+ * being rejected, because it works until it silently does not. Fix
63
+ * provider/fixtures/ (or weaver's template/) and regenerate:
64
+ *
65
+ * npm run provider -- discord
66
+ */
67
+ /**
68
+ * The Discord faker.
69
+ *
70
+ * Shapes, not behaviour: the goal is that a downstream node sees the field
71
+ * NAMES Discord actually publishes, so an author can wire {{ $json.data.id }}
72
+ * against a fake and have it keep working against the real thing.
73
+ *
74
+ * Deterministic — same inputs, same output. A faker returning a fresh uuid
75
+ * every call cannot be asserted on, so its fixtures degrade to "it did not
76
+ * throw", which is the assertion that catches nothing.
77
+ */
78
+
79
+ declare const discordFaker: ConnectorFaker;
80
+
81
+ /**
82
+ * GENERATED FILE — do not edit.
83
+ *
84
+ * Emitted from provider/actions/message-create.json by weaver's generator.
85
+ * A hand-edit here is destroyed by the next protocol sync, which is worse than
86
+ * being rejected, because it works until it silently does not. Fix
87
+ * provider/actions/message-create.json (or weaver's template/) and regenerate:
88
+ *
89
+ * npm run provider -- discord
90
+ */
91
+ /**
92
+ * Send a text message to a Discord channel.
93
+ *
94
+ * POST /channels/{channelId}/messages —
95
+ * https://docs.discord.com/developers/resources/message#create-message
96
+ *
97
+ * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,
98
+ * no fake/real branch. This describes the request; callConnector resolves the
99
+ * connection, picks the estate, and either calls Discord or calls the faker.
100
+ */
101
+
102
+ declare const MESSAGE_CREATE_OPERATION = "message_create";
103
+ type MessageCreateOptions = {
104
+ /** The node's resolved config. Keys: channelId, content. */
105
+ config: Record<string, unknown>;
106
+ credentials?: Record<string, string | undefined>;
107
+ mode?: RequestedMode;
108
+ connectionId?: string | null;
109
+ input?: unknown;
110
+ /** Derived from the run and the step, never fresh. See the note above. */
111
+ idempotencyKey?: string;
112
+ attempts?: number;
113
+ /** Override the transport. The only way to exercise this without a network. */
114
+ transport?: Transport;
115
+ };
116
+ declare function discordMessageCreate(options: MessageCreateOptions): Promise<ConnectorResult>;
117
+
118
+ export { CONNECTOR_API_VERSION, DISCORD, DISCORD_BASE_URLS, DISCORD_REQUIRES, MESSAGE_CREATE_OPERATION, type MessageCreateOptions, discordAuthorize, discordFaker, discordMessageCreate };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { CONNECTOR_API_VERSION, DISCORD, DISCORD_BASE_URLS, DISCORD_REQUIRES, MESSAGE_CREATE_OPERATION, discordAuthorize, discordFaker, discordMessageCreate } from './chunk-CINC5SYU.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 ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@particle-academy/discord-js",
3
+ "version": "0.1.0",
4
+ "description": "Discord 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.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/Fancy-Friends/discord.git"
8
+ },
9
+ "homepage": "https://github.com/Fancy-Friends/discord#readme",
10
+ "bugs": "https://github.com/Fancy-Friends/discord/issues",
11
+ "type": "module",
12
+ "main": "./dist/index.cjs",
13
+ "module": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "import": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/index.d.cts",
23
+ "default": "./dist/index.cjs"
24
+ }
25
+ },
26
+ "./flow": {
27
+ "import": {
28
+ "types": "./dist/flow.d.ts",
29
+ "default": "./dist/flow.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/flow.d.cts",
33
+ "default": "./dist/flow.cjs"
34
+ }
35
+ },
36
+ "./package.json": "./package.json"
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "README.md",
41
+ "CHANGELOG.md",
42
+ "LICENSE"
43
+ ],
44
+ "scripts": {
45
+ "build": "tsup",
46
+ "lint": "tsc --noEmit",
47
+ "test": "node --import tsx --test tests/*.test.ts",
48
+ "prepublishOnly": "tsup"
49
+ },
50
+ "dependencies": {
51
+ "@particle-academy/fancy-connector-core": ">=0.3.1 <2.0"
52
+ },
53
+ "peerDependencies": {
54
+ "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
55
+ "@particle-academy/discord-ui": ">=0.1.0 <0.2.0"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "@particle-academy/fancy-flow": {
59
+ "optional": true
60
+ },
61
+ "@particle-academy/discord-ui": {
62
+ "optional": true
63
+ }
64
+ },
65
+ "devDependencies": {
66
+ "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
67
+ "@types/node": "^26.2.0",
68
+ "tsup": "^8.5.0",
69
+ "tsx": "^4.19.0",
70
+ "typescript": "^5.8.0"
71
+ },
72
+ "publishConfig": {
73
+ "access": "public"
74
+ },
75
+ "keywords": [
76
+ "discord",
77
+ "messaging",
78
+ "connector",
79
+ "api",
80
+ "fancy-ui",
81
+ "particle-academy"
82
+ ],
83
+ "license": "MIT",
84
+ "sideEffects": false,
85
+ "engines": {
86
+ "node": ">=22"
87
+ }
88
+ }