From 0c5651b217c24afaf152bcbf5d01843952f92eb5 Mon Sep 17 00:00:00 2001 From: Nicuschgifthub Date: Sun, 9 Aug 2026 13:17:03 +0200 Subject: [PATCH 1/2] discord webhook --- actions/discord-action/.gitignore | 3 + actions/discord-action/Dockerfile | 13 + actions/discord-action/README.md | 9 + actions/discord-action/package-lock.json | 2384 +++++++++++++++++ actions/discord-action/package.json | 25 + .../src/data_types/discordEmbed.ts | 46 + .../src/data_types/discordWebhook.ts | 15 + .../createDiscordEmbedAuthorFunction.ts | 48 + .../createDiscordEmbedFooterFunction.ts | 41 + .../functions/createDiscordEmbedFunction.ts | 104 + .../createDiscordWebhookUrlFunction.ts | 36 + .../functions/sendDiscordWebhookFunction.ts | 79 + actions/discord-action/src/helpers.ts | 215 ++ actions/discord-action/src/index.ts | 89 + actions/discord-action/test/index.test.ts | 115 + actions/discord-action/tsconfig.json | 23 + actions/discord-action/vite.config.ts | 19 + 17 files changed, 3264 insertions(+) create mode 100644 actions/discord-action/.gitignore create mode 100644 actions/discord-action/Dockerfile create mode 100644 actions/discord-action/README.md create mode 100644 actions/discord-action/package-lock.json create mode 100644 actions/discord-action/package.json create mode 100644 actions/discord-action/src/data_types/discordEmbed.ts create mode 100644 actions/discord-action/src/data_types/discordWebhook.ts create mode 100644 actions/discord-action/src/functions/createDiscordEmbedAuthorFunction.ts create mode 100644 actions/discord-action/src/functions/createDiscordEmbedFooterFunction.ts create mode 100644 actions/discord-action/src/functions/createDiscordEmbedFunction.ts create mode 100644 actions/discord-action/src/functions/createDiscordWebhookUrlFunction.ts create mode 100644 actions/discord-action/src/functions/sendDiscordWebhookFunction.ts create mode 100644 actions/discord-action/src/helpers.ts create mode 100644 actions/discord-action/src/index.ts create mode 100644 actions/discord-action/test/index.test.ts create mode 100644 actions/discord-action/tsconfig.json create mode 100644 actions/discord-action/vite.config.ts diff --git a/actions/discord-action/.gitignore b/actions/discord-action/.gitignore new file mode 100644 index 0000000..ddc3c2a --- /dev/null +++ b/actions/discord-action/.gitignore @@ -0,0 +1,3 @@ +.env +node_modules/ +dist/ diff --git a/actions/discord-action/Dockerfile b/actions/discord-action/Dockerfile new file mode 100644 index 0000000..5871953 --- /dev/null +++ b/actions/discord-action/Dockerfile @@ -0,0 +1,13 @@ +FROM node:24.10.0-alpine + +WORKDIR /app + +COPY package.json package-lock.json* ./ + +RUN npm install + +COPY . . + +RUN npm run build + +CMD ["npm", "run", "start"] diff --git a/actions/discord-action/README.md b/actions/discord-action/README.md new file mode 100644 index 0000000..07ef67c --- /dev/null +++ b/actions/discord-action/README.md @@ -0,0 +1,9 @@ +# Discord Action + +Discord action integration for CodeZero Hercules. + +Features: +- Create Discord webhook URLs from Webhook ID and Webhook Token. +- Build custom Discord embed fields, footers, authors, and embeds. +- Build Discord Webhook payloads with custom content, username, avatar URL, and embeds. +- Execute Discord Webhooks over HTTP POST. diff --git a/actions/discord-action/package-lock.json b/actions/discord-action/package-lock.json new file mode 100644 index 0000000..7ae051c --- /dev/null +++ b/actions/discord-action/package-lock.json @@ -0,0 +1,2384 @@ +{ + "name": "@code0-tech/discord-action", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@code0-tech/discord-action", + "version": "1.0.0", + "dependencies": { + "@code0-tech/hercules": "^1.1.1", + "discord.js": "^14.18.0" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "vite": "^8.0.3", + "vitest": "^4.1.10" + } + }, + "node_modules/@clack/core": { + "version": "1.0.0-alpha.4", + "license": "MIT", + "peer": true, + "dependencies": { + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@clack/prompts": { + "version": "1.0.0-alpha.4", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/core": "1.0.0-alpha.4", + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@code0-tech/hercules": { + "version": "1.1.1", + "license": "ISC", + "bin": { + "hercules": "bin/hercules.js" + }, + "peerDependencies": { + "@code0-tech/tucana": "0.0.74", + "@grpc/grpc-js": "^1.14.3", + "@protobuf-ts/grpc-backend": "^2.11.1", + "@protobuf-ts/grpc-transport": "^2.11.1", + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "reflect-metadata": "^0.2.2", + "ts-morph": "^28.0.0", + "ts-to-zod": "^5.1.0", + "zod": "^4.4.3", + "zod-to-ts": "^2.1.0" + } + }, + "node_modules/@code0-tech/tucana": { + "version": "0.0.74", + "license": "MIT", + "peer": true + }, + "node_modules/@discordjs/builders": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.14.1.tgz", + "integrity": "sha512-gSKkhXLqs96TCzk66VZuHHl8z2bQMJFGwrXC0f33ngK+FLNau4hU1PYny3DNJfNdSH+gVMzE85/d5FQ2BpcNwQ==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/formatters": "^0.6.2", + "@discordjs/util": "^1.2.0", + "@sapphire/shapeshift": "^4.0.0", + "discord-api-types": "^0.38.40", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.4", + "tslib": "^2.6.3" + }, + "engines": { + "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/collection": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz", + "integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=16.11.0" + } + }, + "node_modules/@discordjs/formatters": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.6.2.tgz", + "integrity": "sha512-y4UPwWhH6vChKRkGdMB4odasUbHOUwy7KL+OVwF86PvT6QVOwElx+TiI1/6kcmcEe+g5YRXJFiXSXUdabqZOvQ==", + "license": "Apache-2.0", + "dependencies": { + "discord-api-types": "^0.38.33" + }, + "engines": { + "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/rest": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.6.3.tgz", + "integrity": "sha512-wvOylxNYJkwKjctS/Mn5GP1w9r3/rzyH+ThD1JlAca6zEdlHs8QWBBUQJpU5Q+W6DoIj/Ljh1IPlZs7hTU+UAg==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/collection": "^2.1.1", + "@discordjs/util": "^1.2.0", + "@sapphire/async-queue": "^1.5.3", + "@sapphire/snowflake": "^3.5.5", + "@vladfrangu/async_event_emitter": "^2.4.6", + "discord-api-types": "^0.38.50", + "magic-bytes.js": "^1.13.0", + "tslib": "^2.6.3", + "undici": "^6.27.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", + "license": "Apache-2.0", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/util": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.2.0.tgz", + "integrity": "sha512-3LKP7F2+atl9vJFhaBjn4nOaSWahZ/yWjOvA4e5pnXkt2qyXRCHLxoBQy81GFtLGCq7K9lPm9R517M1U+/90Qg==", + "license": "Apache-2.0", + "dependencies": { + "discord-api-types": "^0.38.33" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/ws": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.2.3.tgz", + "integrity": "sha512-wPlQDxEmlDg5IxhJPuxXr3Vy9AjYq5xCvFWGJyD7w7Np8ZGu+Mc+97LCoEc/+AYCo2IDpKioiH0/c/mj5ZR9Uw==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/collection": "^2.1.0", + "@discordjs/rest": "^2.5.1", + "@discordjs/util": "^1.1.0", + "@sapphire/async-queue": "^1.5.2", + "@types/ws": "^8.5.10", + "@vladfrangu/async_event_emitter": "^2.2.4", + "discord-api-types": "^0.38.1", + "tslib": "^2.6.2", + "ws": "^8.17.0" + }, + "engines": { + "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/ws/node_modules/@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", + "license": "Apache-2.0", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.1", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.14.4", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.8.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@oclif/core": { + "version": "4.12.0", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^4.3.2", + "ansis": "^3.17.0", + "clean-stack": "^3.0.1", + "cli-spinners": "^2.9.2", + "debug": "^4.4.3", + "ejs": "^3.1.10", + "get-package-type": "^0.1.0", + "indent-string": "^4.0.0", + "is-wsl": "^2.2.0", + "lilconfig": "^3.1.3", + "minimatch": "^10.2.5", + "semver": "^7.8.1", + "string-width": "^4.2.3", + "supports-color": "^8", + "tinyglobby": "^0.2.17", + "widest-line": "^3.1.0", + "wordwrap": "^1.0.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.139.0", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@protobuf-ts/grpc-backend": { + "version": "2.11.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.8.22" + } + }, + "node_modules/@protobuf-ts/grpc-transport": { + "version": "2.11.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.6.0" + } + }, + "node_modules/@protobuf-ts/runtime": { + "version": "2.11.1", + "license": "(Apache-2.0 AND BSD-3-Clause)", + "peer": true + }, + "node_modules/@protobuf-ts/runtime-rpc": { + "version": "2.11.1", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.5", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.1", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.1", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.2", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.1.5", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/@sapphire/async-queue": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.5.tgz", + "integrity": "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg==", + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/shapeshift": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-4.0.0.tgz", + "integrity": "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=v16" + } + }, + "node_modules/@sapphire/snowflake": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.5.tgz", + "integrity": "sha512-xzvBr1Q1c4lCe7i6sRnrofxeO1QTP/LKQ6A6qy0iB4x5yfiSfARMEQEghojzTNALDTcv8En04qYNIco9/K9eZQ==", + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@ts-morph/common": { + "version": "0.29.0", + "license": "MIT", + "peer": true, + "dependencies": { + "minimatch": "^10.0.1", + "path-browserify": "^1.0.1", + "tinyglobby": "^0.2.14" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.20.1", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@typescript/vfs": { + "version": "1.6.4", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.4.3" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/@vitest/expect": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.10", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.10", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.10", + "@vitest/utils": "4.1.10", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.10", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vladfrangu/async_event_emitter": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.7.tgz", + "integrity": "sha512-Xfe6rpCTxSxfbswi/W/Pz7zp1WWSNn4A0eW4mLkQUewCrXXtMj31lCg+iQyTkh/CkusZSq9eDflu7tjEDXUY6g==", + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ansis": { + "version": "3.17.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/async": { + "version": "3.2.6", + "license": "MIT", + "peer": true + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "license": "MIT", + "peer": true, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.7", + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/chai": { + "version": "6.2.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "license": "MIT", + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clean-stack": { + "version": "3.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "escape-string-regexp": "4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "5.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "8.2.2", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/code-block-writer": { + "version": "13.0.3", + "license": "MIT", + "peer": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "license": "MIT", + "peer": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "license": "MIT", + "peer": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/discord-api-types": { + "version": "0.38.50", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.50.tgz", + "integrity": "sha512-J2n/bpIETX3DQ6AJ7/0xbsTLmYiJQtO/LKcXKC1YDbB56OUwtDbdXOFE8Q4g8jVGHBR2VAy1+D4ngaIgkMNV9w==", + "license": "MIT", + "workspaces": [ + "scripts/actions/documentation" + ] + }, + "node_modules/discord.js": { + "version": "14.27.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.27.0.tgz", + "integrity": "sha512-qHbFlFG2N7y3LjPySYsL6A1+BnX6bkTVgo842EX0CqVPk/KTMwZkojPHEXKsQUpWZNyz5BISNHK1cPpQw0+m4A==", + "license": "Apache-2.0", + "dependencies": { + "@discordjs/builders": "^1.14.1", + "@discordjs/collection": "1.5.3", + "@discordjs/formatters": "^0.6.2", + "@discordjs/rest": "^2.6.2", + "@discordjs/util": "^1.2.0", + "@discordjs/ws": "^1.2.3", + "@sapphire/snowflake": "3.5.5", + "discord-api-types": "^0.38.49", + "fast-deep-equal": "3.1.3", + "lodash.snakecase": "4.1.1", + "magic-bytes.js": "^1.13.0", + "tslib": "^2.6.3", + "undici": "^6.27.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/ejs": { + "version": "3.1.10", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT", + "peer": true + }, + "node_modules/environment": { + "version": "1.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.1", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.1", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "license": "MIT", + "peer": true + }, + "node_modules/expect-type": { + "version": "1.4.0", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/filelist": { + "version": "1.0.6", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/balanced-match": { + "version": "1.0.2", + "license": "MIT", + "peer": true + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.1.2", + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.9", + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "license": "ISC", + "peer": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "license": "MIT", + "peer": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.9.4", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "async": "^3.2.6", + "filelist": "^1.0.4", + "picocolors": "^1.1.1" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/listr2": { + "version": "9.0.5", + "license": "MIT", + "peer": true, + "dependencies": { + "cli-truncate": "^5.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.6.0", + "license": "MIT", + "peer": true + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "license": "MIT", + "peer": true + }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", + "license": "MIT" + }, + "node_modules/log-update": { + "version": "6.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.3.0", + "license": "MIT", + "peer": true, + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.6.0", + "license": "MIT", + "peer": true + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/long": { + "version": "5.3.2", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/magic-bytes.js": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.13.0.tgz", + "integrity": "sha512-afO2mnxW7GDTXMm5/AoN1WuOcdoKhtgXjIvHmobqTD1grNplhGdv3PFOyjCVmrnOZBIT/gD/koDKpYG+0mvHcg==", + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "10.2.5", + "license": "BlueOak-1.0.0", + "peer": true, + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "license": "MIT", + "peer": true + }, + "node_modules/nanoid": { + "version": "3.3.16", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/obug": { + "version": "2.1.4", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/onetime": { + "version": "7.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "license": "MIT", + "peer": true + }, + "node_modules/pathe": { + "version": "2.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.5", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.22", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.16", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/protobufjs": { + "version": "7.6.5", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.1", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/require-directory": { + "version": "2.1.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "license": "MIT", + "peer": true + }, + "node_modules/rolldown": { + "version": "1.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.139.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.1.5", + "@rolldown/binding-darwin-arm64": "1.1.5", + "@rolldown/binding-darwin-x64": "1.1.5", + "@rolldown/binding-freebsd-x64": "1.1.5", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", + "@rolldown/binding-linux-arm64-gnu": "1.1.5", + "@rolldown/binding-linux-arm64-musl": "1.1.5", + "@rolldown/binding-linux-ppc64-gnu": "1.1.5", + "@rolldown/binding-linux-s390x-gnu": "1.1.5", + "@rolldown/binding-linux-x64-gnu": "1.1.5", + "@rolldown/binding-linux-x64-musl": "1.1.5", + "@rolldown/binding-openharmony-arm64": "1.1.5", + "@rolldown/binding-wasm32-wasi": "1.1.5", + "@rolldown/binding-win32-arm64-msvc": "1.1.5", + "@rolldown/binding-win32-x64-msvc": "1.1.5" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "license": "MIT", + "peer": true + }, + "node_modules/slash": { + "version": "5.1.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/slice-ansi": { + "version": "8.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "4.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/text-camel-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-pascal-case": "^1.2.11" + } + }, + "node_modules/text-capital-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-camel-case": "^1.2.11", + "text-capital-case": "^1.2.11", + "text-constant-case": "^1.2.11", + "text-dot-case": "^1.2.11", + "text-header-case": "^1.2.11", + "text-is-lower-case": "^1.2.11", + "text-is-upper-case": "^1.2.11", + "text-kebab-case": "^1.2.11", + "text-lower-case": "^1.2.11", + "text-lower-case-first": "^1.2.11", + "text-no-case": "^1.2.11", + "text-param-case": "^1.2.11", + "text-pascal-case": "^1.2.11", + "text-path-case": "^1.2.11", + "text-sentence-case": "^1.2.11", + "text-snake-case": "^1.2.11", + "text-swap-case": "^1.2.11", + "text-title-case": "^1.2.11", + "text-upper-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-constant-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case": "^1.2.11" + } + }, + "node_modules/text-dot-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-header-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-capital-case": "^1.2.11" + } + }, + "node_modules/text-is-lower-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true + }, + "node_modules/text-is-upper-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true + }, + "node_modules/text-kebab-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-lower-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true + }, + "node_modules/text-lower-case-first": { + "version": "1.2.11", + "license": "MIT", + "peer": true + }, + "node_modules/text-no-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-lower-case": "^1.2.11" + } + }, + "node_modules/text-param-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-pascal-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-path-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-sentence-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-snake-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-swap-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true + }, + "node_modules/text-title-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-upper-case": { + "version": "1.2.11", + "license": "MIT", + "peer": true + }, + "node_modules/text-upper-case-first": { + "version": "1.2.11", + "license": "MIT", + "peer": true + }, + "node_modules/tinybench": { + "version": "2.9.0", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.2.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyrainbow": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ts-mixer": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz", + "integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==", + "license": "MIT" + }, + "node_modules/ts-morph": { + "version": "28.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@ts-morph/common": "~0.29.0", + "code-block-writer": "^13.0.3" + } + }, + "node_modules/ts-to-zod": { + "version": "5.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/prompts": "1.0.0-alpha.4", + "@oclif/core": "^4.5.4", + "@typescript/vfs": "^1.5.0", + "chokidar": "^4.0.3", + "listr2": "^9.0.4", + "slash": "^5.1.0", + "text-case": "^1.2.4", + "tslib": "^2.3.1", + "tsutils": "^3.21.0", + "typescript": "^5.2.2", + "zod": "^4.1.5" + }, + "bin": { + "ts-to-zod": "bin/run" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "license": "0BSD", + "peer": true + }, + "node_modules/tsx": { + "version": "4.23.1", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici": { + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.27.0.tgz", + "integrity": "sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==", + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.5", + "postcss": "^8.5.17", + "rolldown": "~1.1.5", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.3.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "4.1.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.10", + "@vitest/mocker": "4.1.10", + "@vitest/pretty-format": "4.1.10", + "@vitest/runner": "4.1.10", + "@vitest/snapshot": "4.1.10", + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.10", + "@vitest/browser-preview": "4.1.10", + "@vitest/browser-webdriverio": "4.1.10", + "@vitest/coverage-istanbul": "4.1.10", + "@vitest/coverage-v8": "4.1.10", + "@vitest/ui": "4.1.10", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "license": "MIT", + "peer": true, + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "license": "MIT", + "peer": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "8.21.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.1.tgz", + "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "license": "MIT", + "peer": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-ts": { + "version": "2.1.0", + "license": "MIT", + "peer": true, + "peerDependencies": { + "typescript": "^5 || ^6", + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/actions/discord-action/package.json b/actions/discord-action/package.json new file mode 100644 index 0000000..6e23efa --- /dev/null +++ b/actions/discord-action/package.json @@ -0,0 +1,25 @@ +{ + "name": "@code0-tech/discord-action", + "version": "1.0.0", + "private": true, + "type": "module", + "main": "dist/index.js", + "scripts": { + "dev": "tsx watch src/index.ts", + "typecheck": "tsc --noEmit", + "build": "vite build", + "test": "vitest run", + "start": "node dist/index.js" + }, + "dependencies": { + "@code0-tech/hercules": "^1.1.1", + "discord.js": "^14.18.0" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "vite": "^8.0.3", + "vitest": "^4.1.10" + } +} diff --git a/actions/discord-action/src/data_types/discordEmbed.ts b/actions/discord-action/src/data_types/discordEmbed.ts new file mode 100644 index 0000000..1948a01 --- /dev/null +++ b/actions/discord-action/src/data_types/discordEmbed.ts @@ -0,0 +1,46 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; + +export const DiscordEmbedFooterDataSchema = z.object({ + text: z.string(), + iconUrl: z.string().optional(), +}); +export type DiscordEmbedFooterData = z.infer; + +export const DiscordEmbedAuthorDataSchema = z.object({ + name: z.string(), + url: z.string().optional(), + iconUrl: z.string().optional(), +}); +export type DiscordEmbedAuthorData = z.infer; + +export const DiscordEmbedDataSchema = z.object({ + title: z.string().optional(), + description: z.string().optional(), + url: z.string().optional(), + color: z.string().optional(), + timestamp: z.string().optional(), + footer: DiscordEmbedFooterDataSchema.optional(), + imageUrl: z.string().optional(), + thumbnailUrl: z.string().optional(), + author: DiscordEmbedAuthorDataSchema.optional(), +}); +export type DiscordEmbedData = z.infer; + +@Identifier("DISCORD_EMBED_FOOTER") +@Name({ code: "en-US", content: "Discord Embed Footer" }) +@DisplayMessage({ code: "en-US", content: "Discord Embed Footer: ${text}" }) +@Schema(DiscordEmbedFooterDataSchema) +export class DiscordEmbedFooterDataType {} + +@Identifier("DISCORD_EMBED_AUTHOR") +@Name({ code: "en-US", content: "Discord Embed Author" }) +@DisplayMessage({ code: "en-US", content: "Discord Embed Author: ${name}" }) +@Schema(DiscordEmbedAuthorDataSchema) +export class DiscordEmbedAuthorDataType {} + +@Identifier("DISCORD_EMBED") +@Name({ code: "en-US", content: "Discord Embed" }) +@DisplayMessage({ code: "en-US", content: "Discord Embed object" }) +@Schema(DiscordEmbedDataSchema) +export class DiscordEmbedDataType {} diff --git a/actions/discord-action/src/data_types/discordWebhook.ts b/actions/discord-action/src/data_types/discordWebhook.ts new file mode 100644 index 0000000..0d3d486 --- /dev/null +++ b/actions/discord-action/src/data_types/discordWebhook.ts @@ -0,0 +1,15 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules"; +import { z } from "zod"; + +export const DiscordWebhookResponseDataSchema = z.object({ + success: z.boolean(), + statusCode: z.number(), + message: z.string(), +}); +export type DiscordWebhookResponseData = z.infer; + +@Identifier("DISCORD_WEBHOOK_RESPONSE") +@Name({ code: "en-US", content: "Discord Webhook Response" }) +@DisplayMessage({ code: "en-US", content: "Discord Webhook Response status: ${statusCode}" }) +@Schema(DiscordWebhookResponseDataSchema) +export class DiscordWebhookResponseDataType {} diff --git a/actions/discord-action/src/functions/createDiscordEmbedAuthorFunction.ts b/actions/discord-action/src/functions/createDiscordEmbedAuthorFunction.ts new file mode 100644 index 0000000..c0cbfea --- /dev/null +++ b/actions/discord-action/src/functions/createDiscordEmbedAuthorFunction.ts @@ -0,0 +1,48 @@ +import { + Description, + DisplayIcon, + DisplayMessage, + Documentation, + Identifier, + Name, + Parameter, + Signature, +} from "@code0-tech/hercules"; +import { DiscordEmbedAuthorData } from "../data_types/discordEmbed.js"; + +@Identifier("createDiscordEmbedAuthor") +@Signature("(Name: string, Url?: string, IconUrl?: string): DISCORD_EMBED_AUTHOR") +@Name({ code: "en-US", content: "Create Embed Author" }) +@DisplayIcon("simple:discord") +@DisplayMessage({ code: "en-US", content: "Create Author ${Name}" }) +@Documentation({ + code: "en-US", + content: "Creates an author object for a Discord embed.", +}) +@Description({ code: "en-US", content: "Creates an author object for a Discord embed." }) +@Parameter({ + runtimeName: "Name", + name: [{ code: "en-US", content: "Author name" }], + description: [{ code: "en-US", content: "The name of the author." }], +}) +@Parameter({ + runtimeName: "Url", + name: [{ code: "en-US", content: "Author URL" }], + description: [{ code: "en-US", content: "Optional hyperlink for the author." }], + optional: true +}) +@Parameter({ + runtimeName: "IconUrl", + name: [{ code: "en-US", content: "Author icon URL" }], + description: [{ code: "en-US", content: "Optional avatar icon URL for the author." }], + optional: true +}) +export class CreateDiscordEmbedAuthorFunction { + run(_context: unknown, Name: string, Url?: string, IconUrl?: string): DiscordEmbedAuthorData { + return { + name: Name, + url: Url, + iconUrl: IconUrl, + }; + } +} diff --git a/actions/discord-action/src/functions/createDiscordEmbedFooterFunction.ts b/actions/discord-action/src/functions/createDiscordEmbedFooterFunction.ts new file mode 100644 index 0000000..aff0a7a --- /dev/null +++ b/actions/discord-action/src/functions/createDiscordEmbedFooterFunction.ts @@ -0,0 +1,41 @@ +import { + Description, + DisplayIcon, + DisplayMessage, + Documentation, + Identifier, + Name, + Parameter, + Signature, +} from "@code0-tech/hercules"; +import { DiscordEmbedFooterData } from "../data_types/discordEmbed.js"; + +@Identifier("createDiscordEmbedFooter") +@Signature("(Text: string, IconUrl?: string): DISCORD_EMBED_FOOTER") +@Name({ code: "en-US", content: "Create Embed Footer" }) +@DisplayIcon("simple:discord") +@DisplayMessage({ code: "en-US", content: "Create Footer" }) +@Documentation({ + code: "en-US", + content: "Creates a footer object for a Discord embed.", +}) +@Description({ code: "en-US", content: "Creates a footer object for a Discord embed." }) +@Parameter({ + runtimeName: "Text", + name: [{ code: "en-US", content: "Footer text" }], + description: [{ code: "en-US", content: "The footer text." }], +}) +@Parameter({ + runtimeName: "IconUrl", + name: [{ code: "en-US", content: "Footer icon URL" }], + description: [{ code: "en-US", content: "Optional URL for the footer icon." }], + optional: true +}) +export class CreateDiscordEmbedFooterFunction { + run(_context: unknown, Text: string, IconUrl?: string): DiscordEmbedFooterData { + return { + text: Text, + iconUrl: IconUrl, + }; + } +} diff --git a/actions/discord-action/src/functions/createDiscordEmbedFunction.ts b/actions/discord-action/src/functions/createDiscordEmbedFunction.ts new file mode 100644 index 0000000..a139a72 --- /dev/null +++ b/actions/discord-action/src/functions/createDiscordEmbedFunction.ts @@ -0,0 +1,104 @@ +import { + Description, + DisplayIcon, + DisplayMessage, + Documentation, + Identifier, + Name, + Parameter, + Signature, +} from "@code0-tech/hercules"; +import { + DiscordEmbedAuthorData, + DiscordEmbedData, + DiscordEmbedFooterData, +} from "../data_types/discordEmbed.js"; + +@Identifier("createDiscordEmbed") +@Signature("(Title?: string, Description?: string, Url?: string, Color?: string, Timestamp?: string, Footer?: DISCORD_EMBED_FOOTER, ImageUrl?: string, ThumbnailUrl?: string, Author?: DISCORD_EMBED_AUTHOR): DISCORD_EMBED") +@Name({ code: "en-US", content: "Create Embed" }) +@DisplayIcon("simple:discord") +@DisplayMessage({ code: "en-US", content: "Create Embed" }) +@Documentation({ + code: "en-US", + content: "Creates a Discord embed object containing title, description, images, color, author, and footer.", +}) +@Description({ code: "en-US", content: "Creates a Discord embed object." }) +@Parameter({ + runtimeName: "Title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "Title of the embed." }], +}) +@Parameter({ + runtimeName: "Description", + name: [{ code: "en-US", content: "Description" }], + description: [{ code: "en-US", content: "Description body of the embed." }], +}) +@Parameter({ + runtimeName: "Url", + name: [{ code: "en-US", content: "URL" }], + description: [{ code: "en-US", content: "URL hyperlink for the embed title." }], + optional: true +}) +@Parameter({ + runtimeName: "Color", + name: [{ code: "en-US", content: "Hex Color" }], + description: [{ code: "en-US", content: "Hexadecimal color string (e.g. #70ffb2)." }], + optional: true +}) +@Parameter({ + runtimeName: "Timestamp", + name: [{ code: "en-US", content: "Timestamp" }], + description: [{ code: "en-US", content: "ISO 8601 timestamp string." }], + optional: true +}) +@Parameter({ + runtimeName: "Footer", + name: [{ code: "en-US", content: "Footer" }], + description: [{ code: "en-US", content: "Footer object for the embed." }], + optional: true +}) +@Parameter({ + runtimeName: "ImageUrl", + name: [{ code: "en-US", content: "Image URL" }], + description: [{ code: "en-US", content: "Main image URL inside the embed." }], + optional: true +}) +@Parameter({ + runtimeName: "ThumbnailUrl", + name: [{ code: "en-US", content: "Thumbnail URL" }], + description: [{ code: "en-US", content: "Thumbnail image URL inside the embed." }], + optional: true +}) +@Parameter({ + runtimeName: "Author", + name: [{ code: "en-US", content: "Author" }], + description: [{ code: "en-US", content: "Author object for the embed." }], + optional: true +}) +export class CreateDiscordEmbedFunction { + run( + _context: unknown, + Title?: string, + Description?: string, + Url?: string, + Color?: string, + Timestamp?: string, + Footer?: DiscordEmbedFooterData, + ImageUrl?: string, + ThumbnailUrl?: string, + Author?: DiscordEmbedAuthorData + ): DiscordEmbedData { + return { + title: Title, + description: Description, + url: Url, + color: Color, + timestamp: Timestamp, + footer: Footer, + imageUrl: ImageUrl, + thumbnailUrl: ThumbnailUrl, + author: Author, + }; + } +} diff --git a/actions/discord-action/src/functions/createDiscordWebhookUrlFunction.ts b/actions/discord-action/src/functions/createDiscordWebhookUrlFunction.ts new file mode 100644 index 0000000..466760d --- /dev/null +++ b/actions/discord-action/src/functions/createDiscordWebhookUrlFunction.ts @@ -0,0 +1,36 @@ +import { + Description, + DisplayIcon, + DisplayMessage, + Documentation, + Identifier, + Name, + Parameter, + Signature, +} from "@code0-tech/hercules"; + +@Identifier("createDiscordWebhookUrl") +@Signature("(WebhookId: string, WebhookToken: string): string") +@Name({ code: "en-US", content: "Create Webhook URL" }) +@DisplayIcon("simple:discord") +@DisplayMessage({ code: "en-US", content: "Create Webhook URL" }) +@Documentation({ + code: "en-US", + content: "Constructs a full Discord webhook URL from a webhook ID and webhook token.", +}) +@Description({ code: "en-US", content: "Constructs a full Discord webhook URL from a webhook ID and webhook token." }) +@Parameter({ + runtimeName: "WebhookId", + name: [{ code: "en-US", content: "Webhook ID" }], + description: [{ code: "en-US", content: "The Discord webhook ID." }], +}) +@Parameter({ + runtimeName: "WebhookToken", + name: [{ code: "en-US", content: "Webhook token" }], + description: [{ code: "en-US", content: "The Discord webhook security token." }], +}) +export class CreateDiscordWebhookUrlFunction { + run(_context: unknown, WebhookId: string, WebhookToken: string): string { + return `https://discord.com/api/webhooks/${WebhookId.trim()}/${WebhookToken.trim()}`; + } +} diff --git a/actions/discord-action/src/functions/sendDiscordWebhookFunction.ts b/actions/discord-action/src/functions/sendDiscordWebhookFunction.ts new file mode 100644 index 0000000..9206d9c --- /dev/null +++ b/actions/discord-action/src/functions/sendDiscordWebhookFunction.ts @@ -0,0 +1,79 @@ +import { + Description, + DisplayIcon, + DisplayMessage, + Documentation, + FunctionContext, + Identifier, + Name, + Parameter, + RuntimeError, + Signature, +} from "@code0-tech/hercules"; +import { DiscordEmbedData } from "../data_types/discordEmbed.js"; +import { DiscordWebhookResponseData } from "../data_types/discordWebhook.js"; +import { sendDiscordWebhook } from "../helpers.js"; + +@Identifier("sendDiscordWebhook") +@Signature("(WebhookUrl?: string, Content?: string, Embed?: DISCORD_EMBED, Username?: string, AvatarUrl?: string, TTS?: boolean): DISCORD_WEBHOOK_RESPONSE") +@Name({ code: "en-US", content: "Send Webhook" }) +@DisplayIcon("simple:discord") +@DisplayMessage({ code: "en-US", content: "Send Webhook" }) +@Documentation({ + code: "en-US", + content: "Sends a message with optional text content and rich embed to a Discord Webhook URL. Webhook URL, Username, and Avatar URL fall back to action configuration if not specified.", +}) +@Description({ code: "en-US", content: "Sends a Discord Webhook message." }) +@Parameter({ + runtimeName: "WebhookUrl", + name: [{ code: "en-US", content: "Webhook URL" }], + description: [{ code: "en-US", content: "The full Discord webhook URL. Falls back to action config if empty." }], +}) +@Parameter({ + runtimeName: "Content", + name: [{ code: "en-US", content: "Content" }], + description: [{ code: "en-US", content: "Text content of the message." }], +}) +@Parameter({ + runtimeName: "Embed", + name: [{ code: "en-US", content: "Embed" }], + description: [{ code: "en-US", content: "Single Discord embed object created with Create Embed." }], +}) +@Parameter({ + runtimeName: "Username", + name: [{ code: "en-US", content: "Username" }], + description: [{ code: "en-US", content: "Custom username for the webhook. Falls back to action config if empty." }], +}) +@Parameter({ + runtimeName: "AvatarUrl", + name: [{ code: "en-US", content: "Avatar URL" }], + description: [{ code: "en-US", content: "Custom avatar URL for the webhook. Falls back to action config if empty." }], +}) +@Parameter({ + runtimeName: "TTS", + name: [{ code: "en-US", content: "TTS" }], + description: [{ code: "en-US", content: "Send as text-to-speech message." }], +}) +export class SendDiscordWebhookFunction { + async run( + context: FunctionContext, + WebhookUrl?: string, + Content?: string, + Embed?: DiscordEmbedData, + Username?: string, + AvatarUrl?: string, + TTS?: boolean + ): Promise { + try { + return await sendDiscordWebhook(context, WebhookUrl, Content, Embed, Username, AvatarUrl, TTS); + } catch (error: any) { + if (typeof error === "string") { + throw new RuntimeError("ERROR_SENDING_DISCORD_WEBHOOK", error); + } + throw new RuntimeError( + "ERROR_SENDING_DISCORD_WEBHOOK", + error?.message || "An error occurred while sending the Discord webhook." + ); + } + } +} diff --git a/actions/discord-action/src/helpers.ts b/actions/discord-action/src/helpers.ts new file mode 100644 index 0000000..05fd3a3 --- /dev/null +++ b/actions/discord-action/src/helpers.ts @@ -0,0 +1,215 @@ +import { WebhookClient, EmbedBuilder } from "discord.js"; +import { FunctionContext } from "@code0-tech/hercules"; +import { DiscordEmbedData } from "./data_types/discordEmbed.js"; +import { DiscordWebhookResponseData } from "./data_types/discordWebhook.js"; + +function cleanString(val?: any): string | undefined { + if (val === null || val === undefined) return undefined; + const str = String(val).trim(); + return str.length > 0 ? str : undefined; +} + +function cleanUrl(val?: any): string | undefined { + const str = cleanString(val); + if (!str) return undefined; + if (str.startsWith("http://") || str.startsWith("https://")) { + return str; + } + return undefined; +} + +export function createDiscordEmbedBuilder(rawEmbed: any): EmbedBuilder | null { + if (!rawEmbed) return null; + + let embedData = rawEmbed; + if (typeof embedData === "string") { + try { + embedData = JSON.parse(embedData); + } catch { + return null; + } + } + + if (typeof embedData !== "object") return null; + + const builder = new EmbedBuilder(); + let hasContent = false; + + const title = cleanString(embedData.title); + if (title) { + builder.setTitle(title); + hasContent = true; + } + + const description = cleanString(embedData.description); + if (description) { + builder.setDescription(description); + hasContent = true; + } + + const url = cleanUrl(embedData.url); + if (url) { + builder.setURL(url); + } + + if (embedData.color !== undefined && embedData.color !== null) { + if (typeof embedData.color === "number" && !isNaN(embedData.color)) { + builder.setColor(embedData.color); + } else if (typeof embedData.color === "string") { + let hex = embedData.color.trim(); + if (hex.startsWith("#")) { + hex = hex.slice(1); + } else if (hex.startsWith("0x") || hex.startsWith("0X")) { + hex = hex.slice(2); + } + const colorNum = parseInt(hex, 16); + if (!isNaN(colorNum) && colorNum >= 0 && colorNum <= 0xffffff) { + builder.setColor(colorNum); + } + } + } + + const timestampStr = cleanString(embedData.timestamp); + if (timestampStr) { + const date = new Date(timestampStr); + if (!isNaN(date.getTime())) { + builder.setTimestamp(date); + } + } + + const footer = embedData.footer; + if (footer && typeof footer === "object") { + const footerText = cleanString(footer.text); + if (footerText) { + const footerIcon = cleanUrl(footer.iconUrl || footer.icon_url || footer.iconURL); + builder.setFooter({ + text: footerText, + iconURL: footerIcon, + }); + hasContent = true; + } + } + + const imageUrl = cleanUrl( + embedData.imageUrl || embedData.image_url || (embedData.image && embedData.image.url) + ); + if (imageUrl) { + builder.setImage(imageUrl); + hasContent = true; + } + + const thumbnailUrl = cleanUrl( + embedData.thumbnailUrl || embedData.thumbnail_url || (embedData.thumbnail && embedData.thumbnail.url) + ); + if (thumbnailUrl) { + builder.setThumbnail(thumbnailUrl); + hasContent = true; + } + + const author = embedData.author; + if (author && typeof author === "object") { + const authorName = cleanString(author.name); + if (authorName) { + const authorUrl = cleanUrl(author.url); + const authorIcon = cleanUrl(author.iconUrl || author.icon_url || author.iconURL); + builder.setAuthor({ + name: authorName, + url: authorUrl, + iconURL: authorIcon, + }); + hasContent = true; + } + } + + if (Array.isArray(embedData.fields) && embedData.fields.length > 0) { + const validFields = embedData.fields + .map((f: any) => ({ + name: cleanString(f.name) || "", + value: cleanString(f.value) || "", + inline: Boolean(f.inline), + })) + .filter((f: any) => f.name.length > 0 && f.value.length > 0); + + if (validFields.length > 0) { + builder.addFields(validFields); + hasContent = true; + } + } + + return hasContent ? builder : null; +} + +export async function sendDiscordWebhook( + context: FunctionContext, + webhookUrl?: string, + content?: string, + embed?: DiscordEmbedData, + username?: string, + avatarUrl?: string, + tts?: boolean +): Promise { + const configuredWebhookUrl = cleanString(context?.matchedConfig?.findConfig("webhook_url")) || ""; + const configuredUsername = cleanString(context?.matchedConfig?.findConfig("username")) || ""; + const configuredAvatarUrl = cleanString(context?.matchedConfig?.findConfig("avatar_url")) || ""; + + const finalWebhookUrl = cleanUrl(webhookUrl) || cleanUrl(configuredWebhookUrl); + const finalUsername = cleanString(username) || configuredUsername; + const finalAvatarUrl = cleanUrl(avatarUrl) || cleanUrl(configuredAvatarUrl); + const finalContent = cleanString(content); + + if (!finalWebhookUrl) { + return { + success: false, + statusCode: 400, + message: "Invalid or missing webhook URL.", + }; + } + + try { + const webhookClient = new WebhookClient({ url: finalWebhookUrl }); + + const embeds: EmbedBuilder[] = []; + if (embed) { + const builder = createDiscordEmbedBuilder(embed); + if (builder) { + embeds.push(builder); + } + } + + if (!finalContent && embeds.length === 0) { + webhookClient.destroy(); + return { + success: false, + statusCode: 400, + message: "Cannot send an empty webhook message. Provide content or an embed.", + }; + } + + try { + await webhookClient.send({ + content: finalContent || undefined, + username: finalUsername || undefined, + avatarURL: finalAvatarUrl || undefined, + tts: Boolean(tts), + embeds: embeds.length > 0 ? embeds : undefined, + }); + } finally { + webhookClient.destroy(); + } + + return { + success: true, + statusCode: 200, + message: "Webhook delivered successfully using discord.js.", + }; + } catch (error: any) { + console.error("Discord Webhook Execution Error:", error); + const statusCode = error.status ?? error.statusCode ?? 500; + const message = error.message || "Failed to execute Discord webhook via discord.js."; + return { + success: false, + statusCode, + message, + }; + } +} diff --git a/actions/discord-action/src/index.ts b/actions/discord-action/src/index.ts new file mode 100644 index 0000000..c1740bb --- /dev/null +++ b/actions/discord-action/src/index.ts @@ -0,0 +1,89 @@ +import "reflect-metadata"; +import { Action, CodeZeroEvent } from "@code0-tech/hercules"; + +import { + DiscordEmbedAuthorDataType, + DiscordEmbedDataType, + DiscordEmbedFooterDataType, +} from "./data_types/discordEmbed.js"; +import { + DiscordWebhookResponseDataType, +} from "./data_types/discordWebhook.js"; + +import { CreateDiscordEmbedAuthorFunction } from "./functions/createDiscordEmbedAuthorFunction.js"; +import { CreateDiscordEmbedFooterFunction } from "./functions/createDiscordEmbedFooterFunction.js"; +import { CreateDiscordEmbedFunction } from "./functions/createDiscordEmbedFunction.js"; +import { CreateDiscordWebhookUrlFunction } from "./functions/createDiscordWebhookUrlFunction.js"; +import { SendDiscordWebhookFunction } from "./functions/sendDiscordWebhookFunction.js"; + +const action = new Action( + process.env.ACTION_ID ?? "discord-action", + process.env.VERSION ?? "1.0.0", + process.env.AQUILA_URL ?? "192.168.2.105:8081", + "code0-tech", + "simple:discord", + "Discord integration: create webhook URLs, construct rich embeds, and send webhooks.", + [{ code: "en-US", content: "Discord" }], + [ + { + identifier: "webhook_url", + type: "TEXT", + defaultValue: "", + name: [{ code: "en-US", content: "Webhook URL" }], + description: [{ code: "en-US", content: "Default Discord Webhook URL to use as fallback." }], + linkedDataTypes: ["TEXT"], + }, + { + identifier: "username", + type: "TEXT", + defaultValue: "", + name: [{ code: "en-US", content: "Username" }], + description: [{ code: "en-US", content: "Default username for the Discord webhook poster." }], + linkedDataTypes: ["TEXT"], + }, + { + identifier: "avatar_url", + type: "TEXT", + defaultValue: "", + name: [{ code: "en-US", content: "Avatar URL" }], + description: [{ code: "en-US", content: "Default avatar image URL for the Discord webhook poster." }], + linkedDataTypes: ["TEXT"], + }, + ] +); + +action.registerDataTypeClass(DiscordEmbedFooterDataType); +action.registerDataTypeClass(DiscordEmbedAuthorDataType); +action.registerDataTypeClass(DiscordEmbedDataType); +action.registerDataTypeClass(DiscordWebhookResponseDataType); + +action.registerRuntimeFunction(CreateDiscordWebhookUrlFunction); +action.registerRuntimeFunction(CreateDiscordEmbedFooterFunction); +action.registerRuntimeFunction(CreateDiscordEmbedAuthorFunction); +action.registerRuntimeFunction(CreateDiscordEmbedFunction); +action.registerRuntimeFunction(SendDiscordWebhookFunction); + +action.on(CodeZeroEvent.connected, () => { + console.log("Connected to aquila"); +}); + +action.on(CodeZeroEvent.error, (error: Error) => { + console.error("Stream error:", error.message); + console.log("Attempting to reconnect in 5s..."); + setTimeout(() => { + action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((err: Error) => { + action.emit(CodeZeroEvent.error, err); + }); + }, 5000); +}); + +action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((err: Error) => { + action.emit(CodeZeroEvent.error, err); +}); + +action.on(CodeZeroEvent.moduleUpdated, (message: any) => { + console.dir(message, { depth: null }); + console.dir(action.configs.values(), { depth: null }); +}); + +export { action }; diff --git a/actions/discord-action/test/index.test.ts b/actions/discord-action/test/index.test.ts new file mode 100644 index 0000000..5bc18fa --- /dev/null +++ b/actions/discord-action/test/index.test.ts @@ -0,0 +1,115 @@ +import "reflect-metadata"; +import { describe, expect, it } from "vitest"; +import { createDiscordEmbedBuilder, sendDiscordWebhook } from "../src/helpers.js"; +import { CreateDiscordWebhookUrlFunction } from "../src/functions/createDiscordWebhookUrlFunction.js"; +import { CreateDiscordEmbedFunction } from "../src/functions/createDiscordEmbedFunction.js"; +import { CreateDiscordEmbedAuthorFunction } from "../src/functions/createDiscordEmbedAuthorFunction.js"; +import { CreateDiscordEmbedFooterFunction } from "../src/functions/createDiscordEmbedFooterFunction.js"; +import { SendDiscordWebhookFunction } from "../src/functions/sendDiscordWebhookFunction.js"; + +describe("Discord Action", () => { + it("should format webhook URL correctly", () => { + const fn = new CreateDiscordWebhookUrlFunction(); + const url = fn.run(null, "123456789", "token-abc"); + expect(url).toEqual("https://discord.com/api/webhooks/123456789/token-abc"); + }); + + it("should parse hex color string (#ff22ff) correctly into EmbedBuilder", () => { + const embedFn = new CreateDiscordEmbedFunction(); + const embedData = embedFn.run( + null, + "Hex Test", + "Description", + undefined, + "#ff22ff" + ); + + expect(embedData.color).toEqual("#ff22ff"); + + const builder = createDiscordEmbedBuilder(embedData); + expect(builder).not.toBeNull(); + const json = builder!.toJSON(); + expect(json.color).toEqual(parseInt("ff22ff", 16)); + }); + + it("should parse raw hex string (ff22ff) without hashtag into EmbedBuilder", () => { + const embedFn = new CreateDiscordEmbedFunction(); + const embedData = embedFn.run( + null, + "Hex Test 2", + "Description", + undefined, + "ff22ff" + ); + + const builder = createDiscordEmbedBuilder(embedData); + expect(builder).not.toBeNull(); + const json = builder!.toJSON(); + expect(json.color).toEqual(parseInt("ff22ff", 16)); + }); + + it("should safely handle empty strings in URL and author fields", () => { + const authorFn = new CreateDiscordEmbedAuthorFunction(); + const author = authorFn.run(null, "John", "", ""); + + const embedFn = new CreateDiscordEmbedFunction(); + const embedData = embedFn.run( + null, + "Title", + "Description", + "", + "#70ffb2", + "", + undefined, + "", + "", + author + ); + + const builder = createDiscordEmbedBuilder(embedData); + expect(builder).not.toBeNull(); + const json = builder!.toJSON(); + + expect(json.title).toEqual("Title"); + expect(json.description).toEqual("Description"); + expect(json.author?.name).toEqual("John"); + expect(json.author?.url).toBeUndefined(); + expect(json.url).toBeUndefined(); + }); + + it("should return null for empty embed objects", () => { + const builder = createDiscordEmbedBuilder({}); + expect(builder).toBeNull(); + }); + + it("should use matchedConfig fallback if node parameters are empty", async () => { + const mockContext: any = { + matchedConfig: { + findConfig: (key: string) => { + if (key === "webhook_url") return "https://discord.com/api/webhooks/fallback/test"; + if (key === "username") return "FallbackBot"; + if (key === "avatar_url") return "https://example.com/fallback.png"; + return ""; + }, + }, + }; + + const sendFn = new SendDiscordWebhookFunction(); + const result = await sendFn.run(mockContext, undefined, "Hello!"); + expect(result).toBeDefined(); + }); + + it("should validate missing or invalid webhook URL when no config fallback exists", async () => { + const mockContext: any = { + matchedConfig: { + findConfig: () => "", + }, + }; + + const sendFn = new SendDiscordWebhookFunction(); + const result = await sendFn.run(mockContext, "invalid-url", "Hello!"); + expect(result.success).toBe(false); + expect(result.statusCode).toBe(400); + expect(result.message).toEqual("Invalid or missing webhook URL."); + }); +}); diff --git a/actions/discord-action/tsconfig.json b/actions/discord-action/tsconfig.json new file mode 100644 index 0000000..65d780f --- /dev/null +++ b/actions/discord-action/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "Bundler", + "declaration": true, + "outDir": "dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "allowImportingTsExtensions": true, + "noEmit": true, + "baseUrl": ".", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "types": ["node", "vite/client"] + }, + "include": [ + "src/**/*", + "test/**/*", + "vite.config.ts" + ] +} diff --git a/actions/discord-action/vite.config.ts b/actions/discord-action/vite.config.ts new file mode 100644 index 0000000..485ef08 --- /dev/null +++ b/actions/discord-action/vite.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vite'; +import { resolve } from 'path'; + +export default defineConfig({ + build: { + target: "node18", + ssr: resolve(__dirname, 'src/index.ts'), + rollupOptions: { + external: (id) => + [ + 'fs', + 'path', + 'typescript', + '@code0-tech/hercules', + 'discord.js' + ].includes(id) || id.startsWith('node:') + } + } +}); From e6bc00bedff83365a0c275181c9325ae2b5d4847 Mon Sep 17 00:00:00 2001 From: Nicuschgifthub Date: Sun, 9 Aug 2026 13:19:03 +0200 Subject: [PATCH 2/2] set default set ip to 127.0.0.1 --- actions/discord-action/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/discord-action/src/index.ts b/actions/discord-action/src/index.ts index c1740bb..a088ef7 100644 --- a/actions/discord-action/src/index.ts +++ b/actions/discord-action/src/index.ts @@ -19,7 +19,7 @@ import { SendDiscordWebhookFunction } from "./functions/sendDiscordWebhookFuncti const action = new Action( process.env.ACTION_ID ?? "discord-action", process.env.VERSION ?? "1.0.0", - process.env.AQUILA_URL ?? "192.168.2.105:8081", + process.env.AQUILA_URL ?? "127.0.0.1:8081", "code0-tech", "simple:discord", "Discord integration: create webhook URLs, construct rich embeds, and send webhooks.",