From 6a11863cca312a251a918ef6ec145e3b9c3a7449 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Wed, 2 Oct 2024 13:57:17 -0700 Subject: [PATCH 01/47] feat: create initial implementation for DP CLI with commands to manage sites and posts --- .dprc.example | 9 + .gitignore | 3 + README.md | 290 +++++++++++++++- bin/dp-cli.js | 49 +++ package-lock.json | 634 +++++++++++++++++++++++++++++++++++ package.json | 22 ++ src/api/dpApi.js | 32 ++ src/api/socialInboxApi.js | 26 ++ src/commands/createSite.js | 35 ++ src/commands/registerSite.js | 41 +++ src/commands/sendPost.js | 41 +++ src/config/config.js | 15 + 12 files changed, 1195 insertions(+), 2 deletions(-) create mode 100644 .dprc.example create mode 100755 bin/dp-cli.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/api/dpApi.js create mode 100644 src/api/socialInboxApi.js create mode 100644 src/commands/createSite.js create mode 100644 src/commands/registerSite.js create mode 100644 src/commands/sendPost.js create mode 100644 src/config/config.js diff --git a/.dprc.example b/.dprc.example new file mode 100644 index 0000000..a6aa0dc --- /dev/null +++ b/.dprc.example @@ -0,0 +1,9 @@ +{ + "dpApiUrl": "https://api.distributed.press", + "socialInboxUrl": "https://social.distributed.press", + "authToken": "your-auth-token", + "keypair": { + "publicKey": "your-public-key", + "privateKey": "your-private-key" + } +} diff --git a/.gitignore b/.gitignore index c6bba59..57641b3 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,6 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +# Configuration files +.dprc diff --git a/README.md b/README.md index 14055ac..2c47010 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,288 @@ -# distributed-press-cli -Command Line Interface for the Distributed Press API and Social Inbox +# Distributed Press CLI + +A **Command Line Interface (CLI)** for interacting with the Distributed Press API and Social Inbox. Manage your sites, register them with Social Inbox, and engage with followers seamlessly from the command line. + +## Table of Contents + +- [Installation](#installation) +- [Configuration](#configuration) +- [Usage](#usage) + - [Create a New Site](#create-a-new-site) + - [Register Site with Social Inbox](#register-site-with-social-inbox) + - [Send a Post to Followers](#send-a-post-to-followers) +- [Commands](#commands) +- [Examples](#examples) +- [License](#license) +- [Resources](#resources) + +## Installation + +### 1. Clone the Repository + +```bash +git clone https://github.com/hyphacoop/distributed-press-cli.git +cd distributed-press-cli +``` + +### 2. Install Dependencies + +```bash +npm install +``` + +### 3. Make the CLI Globally Accessible + +To use `dp-cli` from anywhere in your terminal, link the package globally: + +```bash +npm link +``` + +*Note: You might need administrative privileges to run the above command.* + +## Configuration + +The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, and keypairs. Here's how to set it up: + +### 1. Create the `.dprc` File + +Copy the example configuration file to your home directory: + +- **Unix/Linux/macOS:** + + ```bash + cp .dprc.example ~/.dprc + ``` + +- **Windows (PowerShell):** + + ```powershell + Copy-Item .dprc.example $env:USERPROFILE\.dprc + ``` + +### 2. Edit the `.dprc` File + +Open the `.dprc` file in your preferred text editor and replace the placeholder values with your actual configuration: + +```json +{ + "dpApiUrl": "https://api.distributed.press", + "socialInboxUrl": "https://social.distributed.press", + "authToken": "your-auth-token", + "keypair": { + "publicKey": "your-public-key", + "privateKey": "your-private-key" + } +} +``` + +- **`dpApiUrl`:** The base URL for the Distributed Press API. +- **`socialInboxUrl`:** The base URL for the Social Inbox. +- **`authToken`:** Your authentication token for API access. +- **`keypair`:** Your public and private keys for secure interactions. + +*Ensure that your `.dprc` file is **not** committed to version control to keep your credentials secure.* + +## Usage + +Once installed and configured, you can use the `dp-cli` command followed by specific commands to interact with the APIs. + +### Create a New Site + +Initialize a new site on Distributed Press. + +```bash +dp-cli create-site +``` + +**Prompts:** + +1. **Enter your site name:** + *(e.g., "My Awesome Site")* + +2. **Enter your site URL:** + *(e.g., "https://myawesomesite.com")* + +**Output:** + +``` +Creating a new site on Distributed Press... +Site created successfully! +Site ID: 12345 +Site URL: https://myawesomesite.com +``` + +### Register Site with Social Inbox + +Register your newly created site with the Social Inbox. + +```bash +dp-cli register-site +``` + +**Prompts:** + +1. **Select a site to register:** + *(List of your created sites)* + +**Output:** + +``` +Registering site with Social Inbox... +Site registered with Social Inbox successfully! +Registration ID: abcde-12345 +``` + +### Send a Post to Followers + +Publish a post to your followers. + +```bash +dp-cli send-post --message "Hello, Fediverse!" +``` + +**Prompts:** + +1. **Select a site to send a post from:** + *(List of your registered sites)* + +**Output:** + +``` +Sending a post to followers... +Post sent successfully! +Post ID: post-67890 +``` + +## Commands + +Here's a summary of the available commands in the Distributed Press CLI: + +### `create-site` + +**Description:** +Create a new site on Distributed Press. + +**Usage:** + +```bash +dp-cli create-site +``` + +**Prompts:** + +- Enter your site name. +- Enter your site URL. + +### `register-site` + +**Description:** +Register an existing site with the Social Inbox. + +**Usage:** + +```bash +dp-cli register-site +``` + +**Prompts:** + +- Select a site to register. + +### `send-post` + +**Description:** +Send a post to your followers. + +**Usage:** + +```bash +dp-cli send-post --message "Your message here" +``` + +**Options:** + +- `-m, --message `: The content of the post. + +**Prompts:** + +- Select a site to send the post from. + +## Examples + +### Example 1: Creating and Registering a Site + +```bash +# Create a new site +dp-cli create-site +``` + +*Prompts:* + +``` +Enter your site name: My Awesome Site +Enter your site URL: https://myawesomesite.com +``` + +*Output:* + +``` +Creating a new site on Distributed Press... +Site created successfully! +Site ID: 12345 +Site URL: https://myawesomesite.com +``` + +```bash +# Register the newly created site with Social Inbox +dp-cli register-site +``` + +*Prompts:* + +``` +Select a site to register: +> My Awesome Site (https://myawesomesite.com) +``` + +*Output:* + +``` +Registering site with Social Inbox... +Site registered with Social Inbox successfully! +Registration ID: abcde-12345 +``` + +### Example 2: Sending a Post + +```bash +# Send a post to followers +dp-cli send-post --message "Hello, Fediverse!" +``` + +*Prompts:* + +``` +Select a site to send a post from: +> My Awesome Site (https://myawesomesite.com) +``` + +*Output:* + +``` +Sending a post to followers... +Post sent successfully! +Post ID: post-67890 +``` + +## License + +This project is licensed under the [MIT License](LICENSE). + +## Resources + +- **Social Inbox:** + [https://github.com/hyphacoop/social.distributed.press](https://github.com/hyphacoop/social.distributed.press) + +- **Distributed Press Documentation:** + [https://docs.distributed.press/](https://docs.distributed.press/) diff --git a/bin/dp-cli.js b/bin/dp-cli.js new file mode 100755 index 0000000..ee6a284 --- /dev/null +++ b/bin/dp-cli.js @@ -0,0 +1,49 @@ +#!/usr/bin/env node +const { Command } = require('commander') +const chalk = require('chalk') +const createSite = require('../src/commands/createSite') +const registerSite = require('../src/commands/registerSite') +const sendPost = require('../src/commands/sendPost') + +const program = new Command() + +program + .name('dp-cli') + .description('CLI for interacting with Distributed Press API and Social Inbox') + .version('1.0.0') + +// Define commands +program + .command('create-site') + .description('Create a new site on Distributed Press') + .action(() => { + createSite() + }) + .addHelpText('after', ` + +Examples: + $ dp-cli create-site +`) + +program + .command('register-site') + .description('Register the site with Social Inbox') + .action(() => { + registerSite() + }) + +program + .command('send-post') + .description('Send a post to followers') + .requiredOption('-m, --message ', 'Post message') + .action((options) => { + sendPost(options.message) + }) + +// Parse arguments +program.parse(process.argv) + +// Show help if no arguments are provided +if (!process.argv.slice(2).length) { + program.outputHelp() +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a3477d2 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,634 @@ +{ + "name": "distributed-press-cli", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "distributed-press-cli", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.7.7", + "chalk": "^5.3.0", + "commander": "^12.1.0", + "inquirer": "^11.1.0", + "rc": "^1.2.8" + } + }, + "node_modules/@inquirer/checkbox": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-3.0.1.tgz", + "integrity": "sha512-0hm2nrToWUdD6/UHnel/UKGdk1//ke5zGUpHIvk5ZWmaKezlGxZkOJXNSWsdxO/rEqTkbB3lNC2J6nBElV2aAQ==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/figures": "^1.0.6", + "@inquirer/type": "^2.0.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/confirm": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-4.0.1.tgz", + "integrity": "sha512-46yL28o2NJ9doViqOy0VDcoTzng7rAb6yPQKU7VDLqkmbCaH4JqK4yk4XqlzNWy9PVC5pG1ZUXPBQv+VqnYs2w==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/type": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.2.1.tgz", + "integrity": "sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==", + "dependencies": { + "@inquirer/figures": "^1.0.6", + "@inquirer/type": "^2.0.0", + "@types/mute-stream": "^0.0.4", + "@types/node": "^22.5.5", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "cli-width": "^4.1.0", + "mute-stream": "^1.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/editor": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-3.0.1.tgz", + "integrity": "sha512-VA96GPFaSOVudjKFraokEEmUQg/Lub6OXvbIEZU1SDCmBzRkHGhxoFAVaF30nyiB4m5cEbDgiI2QRacXZ2hw9Q==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/type": "^2.0.0", + "external-editor": "^3.1.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/expand": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-3.0.1.tgz", + "integrity": "sha512-ToG8d6RIbnVpbdPdiN7BCxZGiHOTomOX94C2FaT5KOHupV40tKEDozp12res6cMIfRKrXLJyexAZhWVHgbALSQ==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/type": "^2.0.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.6.tgz", + "integrity": "sha512-yfZzps3Cso2UbM7WlxKwZQh2Hs6plrbjs1QnzQDZhK2DgyCo6D8AaHps9olkNcUFlcYERMqU3uJSp1gmy3s/qQ==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/input": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-3.0.1.tgz", + "integrity": "sha512-BDuPBmpvi8eMCxqC5iacloWqv+5tQSJlUafYWUe31ow1BVXjW2a5qe3dh4X/Z25Wp22RwvcaLCc2siHobEOfzg==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/type": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/number": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-2.0.1.tgz", + "integrity": "sha512-QpR8jPhRjSmlr/mD2cw3IR8HRO7lSVOnqUvQa8scv1Lsr3xoAMMworcYW3J13z3ppjBFBD2ef1Ci6AE5Qn8goQ==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/type": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/password": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-3.0.1.tgz", + "integrity": "sha512-haoeEPUisD1NeE2IanLOiFr4wcTXGWrBOyAyPZi1FfLJuXOzNmxCJPgUrGYKVh+Y8hfGJenIfz5Wb/DkE9KkMQ==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/type": "^2.0.0", + "ansi-escapes": "^4.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/prompts": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-6.0.1.tgz", + "integrity": "sha512-yl43JD/86CIj3Mz5mvvLJqAOfIup7ncxfJ0Btnl0/v5TouVUyeEdcpknfgc+yMevS/48oH9WAkkw93m7otLb/A==", + "dependencies": { + "@inquirer/checkbox": "^3.0.1", + "@inquirer/confirm": "^4.0.1", + "@inquirer/editor": "^3.0.1", + "@inquirer/expand": "^3.0.1", + "@inquirer/input": "^3.0.1", + "@inquirer/number": "^2.0.1", + "@inquirer/password": "^3.0.1", + "@inquirer/rawlist": "^3.0.1", + "@inquirer/search": "^2.0.1", + "@inquirer/select": "^3.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/rawlist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-3.0.1.tgz", + "integrity": "sha512-VgRtFIwZInUzTiPLSfDXK5jLrnpkuSOh1ctfaoygKAdPqjcjKYmGh6sCY1pb0aGnCGsmhUxoqLDUAU0ud+lGXQ==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/type": "^2.0.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/search": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-2.0.1.tgz", + "integrity": "sha512-r5hBKZk3g5MkIzLVoSgE4evypGqtOannnB3PKTG9NRZxyFRKcfzrdxXXPcoJQsxJPzvdSU2Rn7pB7lw0GCmGAg==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/figures": "^1.0.6", + "@inquirer/type": "^2.0.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/select": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-3.0.1.tgz", + "integrity": "sha512-lUDGUxPhdWMkN/fHy1Lk7pF3nK1fh/gqeyWXmctefhxLYxlDsc7vsPBEpxrfVGDsVdyYJsiJoD4bJ1b623cV1Q==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/figures": "^1.0.6", + "@inquirer/type": "^2.0.0", + "ansi-escapes": "^4.3.2", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-2.0.0.tgz", + "integrity": "sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==", + "dependencies": { + "mute-stream": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/mute-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", + "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "22.7.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", + "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/wrap-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", + "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==" + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "engines": { + "node": ">=18" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/inquirer": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-11.1.0.tgz", + "integrity": "sha512-CmLAZT65GG/v30c+D2Fk8+ceP6pxD6RL+hIUOWAltCmeyEqWYwqu9v76q03OvjyZ3AB0C1Ala2stn1z/rMqGEw==", + "dependencies": { + "@inquirer/core": "^9.2.1", + "@inquirer/prompts": "^6.0.1", + "@inquirer/type": "^2.0.0", + "@types/mute-stream": "^0.0.4", + "ansi-escapes": "^4.3.2", + "mute-stream": "^1.0.0", + "run-async": "^3.0.0", + "rxjs": "^7.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/run-async": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..43f5d5e --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "distributed-press-cli", + "version": "1.0.0", + "description": "CLI for interacting with Distributed Press API and Social Inbox", + "main": "src/index.js", + "bin": { + "dp-cli": "./bin/dp-cli.js" + }, + "scripts": { + "start": "node ./bin/dp-cli.js" + }, + "keywords": [], + "author": "distributed.press", + "license": "MIT", + "dependencies": { + "axios": "^1.7.7", + "chalk": "^5.3.0", + "commander": "^12.1.0", + "inquirer": "^11.1.0", + "rc": "^1.2.8" + } +} diff --git a/src/api/dpApi.js b/src/api/dpApi.js new file mode 100644 index 0000000..12c4ec9 --- /dev/null +++ b/src/api/dpApi.js @@ -0,0 +1,32 @@ +const axios = require('axios') +const config = require('../config/config') +const chalk = require('chalk') + +const dpApiClient = axios.create({ + baseURL: config.dpApiUrl, + headers: { + Authorization: `Bearer ${config.authToken}`, + 'Content-Type': 'application/json' + } +}) + +// Create a new site +async function createSite (name, url) { + try { + const response = await dpApiClient.post('/sites', { name, url }) + return response + } catch (error) { + console.error(chalk.red('DP API Error:', error.response ? error.response.data : error.message)) + throw error + } +} + +// Get all sites +async function getSites () { + return await dpApiClient.get('/sites') +} + +module.exports = { + createSite, + getSites +} diff --git a/src/api/socialInboxApi.js b/src/api/socialInboxApi.js new file mode 100644 index 0000000..dc6c52a --- /dev/null +++ b/src/api/socialInboxApi.js @@ -0,0 +1,26 @@ +const axios = require('axios') +const config = require('../config/config') +const chalk = require('chalk') + +const socialInboxClient = axios.create({ + baseURL: config.socialInboxUrl, + headers: { + Authorization: `Bearer ${config.authToken}`, + 'Content-Type': 'application/json' + } +}) + +// Register a site with Social Inbox +async function registerSite (siteId) { + return await socialInboxClient.post('/register', { siteId }) +} + +// Send a post to followers +async function sendPost (siteId, message) { + return await socialInboxClient.post('/posts', { siteId, message }) +} + +module.exports = { + registerSite, + sendPost +} diff --git a/src/commands/createSite.js b/src/commands/createSite.js new file mode 100644 index 0000000..4d02a25 --- /dev/null +++ b/src/commands/createSite.js @@ -0,0 +1,35 @@ +const inquirer = require('inquirer') +const dpApi = require('../api/dpApi') +const chalk = require('chalk') + +async function createSite () { + try { + console.log(chalk.blue('Creating a new site on Distributed Press...')) + + // Prompt user for site details + const answers = await inquirer.prompt([ + { + type: 'input', + name: 'siteName', + message: 'Enter your site name:', + validate: (input) => input ? true : 'Site name cannot be empty.' + }, + { + type: 'input', + name: 'siteUrl', + message: 'Enter your site URL:', + validate: (input) => /^https?:\/\/.+/.test(input) ? true : 'Please enter a valid URL.' + } + ]) + + const response = await dpApi.createSite(answers.siteName, answers.siteUrl) + + console.log(chalk.green('Site created successfully!')) + console.log(`Site ID: ${response.data.id}`) + console.log(`Site URL: ${response.data.url}`) + } catch (error) { + console.error(chalk.red('Error creating site:'), error.message) + } +} + +module.exports = createSite diff --git a/src/commands/registerSite.js b/src/commands/registerSite.js new file mode 100644 index 0000000..0077a03 --- /dev/null +++ b/src/commands/registerSite.js @@ -0,0 +1,41 @@ +const inquirer = require('inquirer') +const socialInboxApi = require('../api/socialInboxApi') +const dpApi = require('../api/dpApi') +const chalk = require('chalk') + +async function registerSite () { + try { + console.log(chalk.blue('Registering site with Social Inbox...')) + + // Fetch existing sites + const sites = await dpApi.getSites() + + if (sites.data.length === 0) { + console.log(chalk.yellow('No sites found. Please create a site first using "create-site" command.')) + return + } + + // Prompt user to select a site + const answers = await inquirer.prompt([ + { + type: 'list', + name: 'siteId', + message: 'Select a site to register:', + choices: sites.data.map(site => ({ + name: `${site.name} (${site.url})`, + value: site.id + })) + } + ]) + + // Register site with Social Inbox + const response = await socialInboxApi.registerSite(answers.siteId) + + console.log(chalk.green('Site registered with Social Inbox successfully!')) + console.log(`Registration ID: ${response.data.registrationId}`) + } catch (error) { + console.error(chalk.red('Error registering site:'), error.message) + } +} + +module.exports = registerSite diff --git a/src/commands/sendPost.js b/src/commands/sendPost.js new file mode 100644 index 0000000..5602094 --- /dev/null +++ b/src/commands/sendPost.js @@ -0,0 +1,41 @@ +const inquirer = require('inquirer') +const dpApi = require('../api/dpApi') +const socialInboxApi = require('../api/socialInboxApi') +const chalk = require('chalk') + +async function sendPost (message) { + try { + console.log(chalk.blue('Sending a post to followers...')) + + // Fetch existing sites + const sites = await dpApi.getSites() + + if (sites.data.length === 0) { + console.log(chalk.yellow('No sites found. Please create a site first using "create-site" command.')) + return + } + + // Prompt user to select a site + const answers = await inquirer.prompt([ + { + type: 'list', + name: 'siteId', + message: 'Select a site to send a post from:', + choices: sites.data.map(site => ({ + name: `${site.name} (${site.url})`, + value: site.id + })) + } + ]) + + // Send post via Social Inbox API + const response = await socialInboxApi.sendPost(answers.siteId, message) + + console.log(chalk.green('Post sent successfully!')) + console.log(`Post ID: ${response.data.postId}`) + } catch (error) { + console.error(chalk.red('Error sending post:'), error.message) + } +} + +module.exports = sendPost diff --git a/src/config/config.js b/src/config/config.js new file mode 100644 index 0000000..a0ed9a3 --- /dev/null +++ b/src/config/config.js @@ -0,0 +1,15 @@ +const rc = require('rc') + +const defaults = { + dpApiUrl: 'https://api.distributed.press', + socialInboxUrl: 'https://social.distributed.press', + authToken: '', + keypair: { + publicKey: '', + privateKey: '' + } +} + +const config = rc('dprc', defaults) + +module.exports = config From a86fcc1b88fbfee0905fce1aeb000a746ebc6460 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 17:14:39 -0800 Subject: [PATCH 02/47] docs: update installation instructions to use npx and npm for global installation --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2c47010..473a1de 100644 --- a/README.md +++ b/README.md @@ -17,28 +17,25 @@ A **Command Line Interface (CLI)** for interacting with the Distributed Press AP ## Installation -### 1. Clone the Repository +## Installation -```bash -git clone https://github.com/hyphacoop/distributed-press-cli.git -cd distributed-press-cli -``` +### Using npx -### 2. Install Dependencies +You can use `dp-cli` without installation by running: ```bash -npm install +npx dp-cli ``` -### 3. Make the CLI Globally Accessible +### Global Installation with npm -To use `dp-cli` from anywhere in your terminal, link the package globally: +To install dp-cli globally, use: ```bash -npm link +npm install -g dp-cli ``` -*Note: You might need administrative privileges to run the above command.* +Once installed, you can use `dp-cli` from anywhere in your terminal. ## Configuration From 9a910d337b2ef5a13cff1f88c40fb7b60ad9babd Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 17:17:08 -0800 Subject: [PATCH 03/47] docs: add link to RC module documentation in config section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 473a1de..19c0313 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Once installed, you can use `dp-cli` from anywhere in your terminal. ## Configuration -The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, and keypairs. Here's how to set it up: +The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, and keypairs. The configuration file follows the format expected by the [RC module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. Here’s how to set it up: ### 1. Create the `.dprc` File From edb40702806f8e3b3be7473b5136bbfdae44e01e Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 18:28:11 -0800 Subject: [PATCH 04/47] feat: add generateKeypair script --- README.md | 12 +++++++++++ bin/dp-cli.js | 6 ++++++ src/commands/generateKeypair.js | 37 +++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 src/commands/generateKeypair.js diff --git a/README.md b/README.md index 19c0313..0770977 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,18 @@ npm install -g dp-cli Once installed, you can use `dp-cli` from anywhere in your terminal. +## Setup + +Before using the CLI, you need to generate a keypair and obtain an authentication token. + +### Generate Keypair + +Run the following command to generate a new RSA keypair: + +```bash +dp-cli generate-keypair +``` + ## Configuration The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, and keypairs. The configuration file follows the format expected by the [RC module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. Here’s how to set it up: diff --git a/bin/dp-cli.js b/bin/dp-cli.js index ee6a284..e398065 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -4,6 +4,7 @@ const chalk = require('chalk') const createSite = require('../src/commands/createSite') const registerSite = require('../src/commands/registerSite') const sendPost = require('../src/commands/sendPost') +const generateKeypairCommand = require('./commands/generateKeypair') const program = new Command() @@ -40,6 +41,11 @@ program sendPost(options.message) }) +program + .command('generate-keypair') + .description('Generate a new RSA keypair') + .action(generateKeypairCommand) + // Parse arguments program.parse(process.argv) diff --git a/src/commands/generateKeypair.js b/src/commands/generateKeypair.js new file mode 100644 index 0000000..7e1f6d1 --- /dev/null +++ b/src/commands/generateKeypair.js @@ -0,0 +1,37 @@ +const { generateKeyPairSync } = require('crypto') +const fs = require('fs') +const path = require('path') +const config = require('../config/config') +const chalk = require('chalk') + +function generateKeypairCommand () { + try { + const { publicKey, privateKey } = generateKeyPairSync('rsa', { + modulusLength: 4096, + publicKeyEncoding: { + type: 'spki', + format: 'pem' + }, + privateKeyEncoding: { + type: 'pkcs8', + format: 'pem' + } + }) + + // Save the keypair to config + config.keypair = { + publicKeyPem: publicKey, + privateKeyPem: privateKey + } + + // Optionally, write to .dprc file + const configPath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + + console.log(chalk.green('Keypair generated and saved to configuration.')) + } catch (error) { + console.error(chalk.red('Failed to generate keypair:'), error.message) + } +} + +module.exports = generateKeypairCommand From 96dfaa100ee9fff6b6c94f9461e75597900a1a2a Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 19:09:39 -0800 Subject: [PATCH 05/47] fix(config): correct rc module usage in config.js to load .dprc --- .dprc.example | 10 +++++----- README.md | 10 +++++----- src/config/config.js | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.dprc.example b/.dprc.example index a6aa0dc..92e3b40 100644 --- a/.dprc.example +++ b/.dprc.example @@ -1,9 +1,9 @@ { - "dpApiUrl": "https://api.distributed.press", - "socialInboxUrl": "https://social.distributed.press", - "authToken": "your-auth-token", + "dpApiUrl": "https://api.distributed.press/v1", + "socialInboxUrl": "https://social.distributed.press/v1", + "authToken": "", "keypair": { - "publicKey": "your-public-key", - "privateKey": "your-private-key" + "publicKeyPem": "", + "privateKeyPem": "" } } diff --git a/README.md b/README.md index 0770977..8321eea 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,12 @@ Open the `.dprc` file in your preferred text editor and replace the placeholder ```json { - "dpApiUrl": "https://api.distributed.press", - "socialInboxUrl": "https://social.distributed.press", - "authToken": "your-auth-token", + "dpApiUrl": "https://api.distributed.press/v1", + "socialInboxUrl": "https://social.distributed.press/v1", + "authToken": "", "keypair": { - "publicKey": "your-public-key", - "privateKey": "your-private-key" + "publicKeyPem": "", + "privateKeyPem": "" } } ``` diff --git a/src/config/config.js b/src/config/config.js index a0ed9a3..e47ce27 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -1,15 +1,15 @@ const rc = require('rc') const defaults = { - dpApiUrl: 'https://api.distributed.press', - socialInboxUrl: 'https://social.distributed.press', + dpApiUrl: 'https://api.distributed.press/v1', + socialInboxUrl: 'https://social.distributed.press/v1', authToken: '', keypair: { - publicKey: '', - privateKey: '' + publicKeyPem: '', + privateKeyPem: '' } } -const config = rc('dprc', defaults) +const config = rc('dp', defaults) module.exports = config From e11f3a0a908f17c5fd6e88cda9aff9d35c2b6c93 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 19:38:26 -0800 Subject: [PATCH 06/47] fix(api): align API endpoints and methods with DP documentation specifications --- src/api/dpApi.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/api/dpApi.js b/src/api/dpApi.js index 12c4ec9..0bb0661 100644 --- a/src/api/dpApi.js +++ b/src/api/dpApi.js @@ -11,9 +11,14 @@ const dpApiClient = axios.create({ }) // Create a new site -async function createSite (name, url) { +async function createSite (domain, isPublic = true, protocols = { http: true, hyper: true, ipfs: true }) { try { - const response = await dpApiClient.post('/sites', { name, url }) + const payload = { + domain, + public: isPublic, + protocols + } + const response = await dpApiClient.post('/sites', payload) return response } catch (error) { console.error(chalk.red('DP API Error:', error.response ? error.response.data : error.message)) @@ -23,7 +28,13 @@ async function createSite (name, url) { // Get all sites async function getSites () { - return await dpApiClient.get('/sites') + try { + const response = await dpApiClient.get('/sites') + return response + } catch (error) { + console.error(chalk.red('DP API Error:', error.response ? error.response.data : error.message)) + throw error + } } module.exports = { From 757d4120509502417b63c93659434fae6bc70d75 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 19:46:00 -0800 Subject: [PATCH 07/47] feat: add script to set auth token --- bin/dp-cli.js | 8 ++++++++ src/commands/setAuthToken.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/commands/setAuthToken.js diff --git a/bin/dp-cli.js b/bin/dp-cli.js index e398065..efad4ef 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -5,6 +5,7 @@ const createSite = require('../src/commands/createSite') const registerSite = require('../src/commands/registerSite') const sendPost = require('../src/commands/sendPost') const generateKeypairCommand = require('./commands/generateKeypair') +const setAuthTokenCommand = require('../src/commands/setAuthToken') const program = new Command() @@ -46,6 +47,13 @@ program .description('Generate a new RSA keypair') .action(generateKeypairCommand) +program + .command('set-auth-token') + .description('Set your authentication token') + .action(() => { + setAuthTokenCommand() + }) + // Parse arguments program.parse(process.argv) diff --git a/src/commands/setAuthToken.js b/src/commands/setAuthToken.js new file mode 100644 index 0000000..acb8787 --- /dev/null +++ b/src/commands/setAuthToken.js @@ -0,0 +1,31 @@ +const inquirer = require('inquirer') +const config = require('../config/config') +const chalk = require('chalk') +const fs = require('fs') +const path = require('path') + +function setAuthTokenCommand () { + inquirer + .prompt([ + { + type: 'input', + name: 'authToken', + message: 'Enter your authentication token:', + validate: (input) => (input ? true : 'Authentication token cannot be empty.') + } + ]) + .then((answers) => { + config.authToken = answers.authToken + + // Write to .dprc file + const configPath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + + console.log(chalk.green('Authentication token saved to configuration.')) + }) + .catch((error) => { + console.error(chalk.red('Failed to set authentication token:'), error.message) + }) +} + +module.exports = setAuthTokenCommand From ee24b7f9d7e615f120c473cfb056148d98c8b259 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 19:53:09 -0800 Subject: [PATCH 08/47] feat: implement HTTP Signature authentication for requests to the Social Inbox API --- package-lock.json | 56 +++++++++++++++++++++++++++- package.json | 1 + src/api/socialInboxApi.js | 78 +++++++++++++++++++++++++++++++-------- 3 files changed, 119 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3477d2..317000f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,13 +7,29 @@ "": { "name": "distributed-press-cli", "version": "1.0.0", - "license": "ISC", + "license": "MIT", "dependencies": { "axios": "^1.7.7", "chalk": "^5.3.0", "commander": "^12.1.0", + "http-signed-fetch": "^1.0.1", "inquirer": "^11.1.0", "rc": "^1.2.8" + }, + "bin": { + "dp-cli": "bin/dp-cli.js" + } + }, + "node_modules/@digitalbazaar/http-digest-header": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@digitalbazaar/http-digest-header/-/http-digest-header-2.0.0.tgz", + "integrity": "sha512-e2dgUDht1zSSb0ZwYBKNHwqQYzmQ1vwhVV6KKZl8utyNi6EaQawsXmiqeyOLsgGanBVWmufWZVzjpHjkp2Iefg==", + "dependencies": { + "base64url-universal": "^2.0.0", + "js-base64": "^3.7.2" + }, + "engines": { + "node": ">=14" } }, "node_modules/@inquirer/checkbox": { @@ -230,6 +246,11 @@ "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==" }, + "node_modules/activitypub-http-signatures": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/activitypub-http-signatures/-/activitypub-http-signatures-2.5.0.tgz", + "integrity": "sha512-FHNWFZtYwT34qYHcMp60noHSIDh/a86F3POfTz4fn9zyrZdZWGgOYeYEv27gfSrIcvNV1iDrq3XRyaXo+QUmdA==" + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -281,6 +302,25 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/base64url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", + "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/base64url-universal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url-universal/-/base64url-universal-2.0.0.tgz", + "integrity": "sha512-6Hpg7EBf3t148C3+fMzjf+CHnADVDafWzlJUXAqqqbm4MKNXbsoPdOkWeRTjNlkYG7TpyjIpRO1Gk0SnsFD1rw==", + "dependencies": { + "base64url": "^3.0.1" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/chalk": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", @@ -406,6 +446,15 @@ "node": ">= 6" } }, + "node_modules/http-signed-fetch": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/http-signed-fetch/-/http-signed-fetch-1.0.1.tgz", + "integrity": "sha512-HSF8LDKJyjXSw//2fT2fcaOaiF28L5VbP92tHMlSpwkwnbfjcXJAZUU7d9NqaHD9FArF/NWgZQci2kdznFfSBA==", + "dependencies": { + "@digitalbazaar/http-digest-header": "^2.0.0", + "activitypub-http-signatures": "^2.0.1" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -448,6 +497,11 @@ "node": ">=8" } }, + "node_modules/js-base64": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", diff --git a/package.json b/package.json index 43f5d5e..080034e 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "axios": "^1.7.7", "chalk": "^5.3.0", "commander": "^12.1.0", + "http-signed-fetch": "^1.0.1", "inquirer": "^11.1.0", "rc": "^1.2.8" } diff --git a/src/api/socialInboxApi.js b/src/api/socialInboxApi.js index dc6c52a..63223f0 100644 --- a/src/api/socialInboxApi.js +++ b/src/api/socialInboxApi.js @@ -1,26 +1,74 @@ -const axios = require('axios') const config = require('../config/config') const chalk = require('chalk') +const httpsig = require('http-signed-fetch') -const socialInboxClient = axios.create({ - baseURL: config.socialInboxUrl, - headers: { - Authorization: `Bearer ${config.authToken}`, - 'Content-Type': 'application/json' - } -}) +async function registerActor (actorUsername, actorInfo) { + try { + const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}` + const signer = new httpsig.Signer({ + keyId: actorInfo.publicKeyId, + privateKey: actorInfo.keypair.privateKeyPem, + headers: ['(request-target)', 'host', 'date', 'digest'] + }) + + const response = await httpsig.fetch(url, { + method: 'POST', + body: JSON.stringify(actorInfo), + headers: { + 'Content-Type': 'application/json' + }, + signer + }) -// Register a site with Social Inbox -async function registerSite (siteId) { - return await socialInboxClient.post('/register', { siteId }) + if (!response.ok) { + const errorText = await response.text() + throw new Error(`HTTP error! status: ${response.status}, message: ${errorText}`) + } + + const data = await response.json() + return { data } + } catch (error) { + console.error( + chalk.red('Social Inbox API Error:', error.response ? error.response.data : error.message) + ) + throw error + } } -// Send a post to followers -async function sendPost (siteId, message) { - return await socialInboxClient.post('/posts', { siteId, message }) +async function sendPost (actorUsername, activity) { + try { + const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}/outbox` + const signer = new httpsig.Signer({ + keyId: config.publicKeyId, + privateKey: config.keypair.privateKeyPem, + headers: ['(request-target)', 'host', 'date', 'digest'] + }) + + const response = await httpsig.fetch(url, { + method: 'POST', + body: JSON.stringify(activity), + headers: { + 'Content-Type': 'application/ld+json' + }, + signer + }) + + if (!response.ok) { + const errorText = await response.text() + throw new Error(`HTTP error! status: ${response.status}, message: ${errorText}`) + } + + const data = await response.json() + return { data } + } catch (error) { + console.error( + chalk.red('Social Inbox API Error:', error.response ? error.response.data : error.message) + ) + throw error + } } module.exports = { - registerSite, + registerActor, sendPost } From a30d2162fda80b3cb9bf1f66da789504fa18dc20 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 19:54:42 -0800 Subject: [PATCH 09/47] feat: create a utility function to generate signed HTTP headers using the user's keypair --- src/utils/signing.js | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/utils/signing.js diff --git a/src/utils/signing.js b/src/utils/signing.js new file mode 100644 index 0000000..86bcad2 --- /dev/null +++ b/src/utils/signing.js @@ -0,0 +1,59 @@ +const { createHash, createSign } = require('crypto') +const { URL } = require('url') + +async function generateSignedHeaders (keypair, url, method, body) { + const parsedUrl = new URL(url) + const date = new Date().toUTCString() + const digest = createDigestHeader(body) + + const headersToSign = ['(request-target)', 'host', 'date', 'digest'] + + const signingString = createSigningString(method, parsedUrl, date, digest, headersToSign) + + const signer = createSign('RSA-SHA256') + signer.update(signingString) + signer.end() + + const signature = signer.sign(keypair.privateKeyPem).toString('base64') + + const signatureHeader = `keyId="${keypair.publicKeyId}",algorithm="rsa-sha256",headers="${headersToSign.join( + ' ' + )}",signature="${signature}"` + + const signedHeaders = { + Date: date, + Host: parsedUrl.host, + Digest: digest, + Signature: signatureHeader + } + + return signedHeaders +} + +function createDigestHeader (body) { + const bodyString = typeof body === 'string' ? body : JSON.stringify(body) + const hash = createHash('sha256').update(bodyString).digest('base64') + return `SHA-256=${hash}` +} + +function createSigningString (method, url, date, digest, headers) { + const signingParts = headers.map((header) => { + switch (header.toLowerCase()) { + case '(request-target)': + return `(request-target): ${method.toLowerCase()} ${url.pathname}` + case 'host': + return `host: ${url.host}` + case 'date': + return `date: ${date}` + case 'digest': + return `digest: ${digest}` + default: + throw new Error(`Unsupported header ${header} for signing`) + } + }) + return signingParts.join('\n') +} + +module.exports = { + generateSignedHeaders +} From 64962b23253a098d3a76499ab45db25e4635adab Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 19:59:27 -0800 Subject: [PATCH 10/47] refactor: update command to accurately reflect actor registration --- bin/dp-cli.js | 8 ++--- src/commands/registerActor.js | 58 +++++++++++++++++++++++++++++++++++ src/commands/registerSite.js | 41 ------------------------- 3 files changed, 62 insertions(+), 45 deletions(-) create mode 100644 src/commands/registerActor.js delete mode 100644 src/commands/registerSite.js diff --git a/bin/dp-cli.js b/bin/dp-cli.js index efad4ef..3bacaa4 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -2,7 +2,7 @@ const { Command } = require('commander') const chalk = require('chalk') const createSite = require('../src/commands/createSite') -const registerSite = require('../src/commands/registerSite') +const registerActor = require('../src/commands/registerActor') const sendPost = require('../src/commands/sendPost') const generateKeypairCommand = require('./commands/generateKeypair') const setAuthTokenCommand = require('../src/commands/setAuthToken') @@ -28,10 +28,10 @@ Examples: `) program - .command('register-site') - .description('Register the site with Social Inbox') + .command('register-actor') + .description('Register your actor with the Social Inbox') .action(() => { - registerSite() + registerActor() }) program diff --git a/src/commands/registerActor.js b/src/commands/registerActor.js new file mode 100644 index 0000000..095d930 --- /dev/null +++ b/src/commands/registerActor.js @@ -0,0 +1,58 @@ +const inquirer = require('inquirer') +const socialInboxApi = require('../api/socialInboxApi') +const chalk = require('chalk') +const config = require('../config/config') +const fs = require('fs') +const path = require('path') + +async function registerActor () { + try { + console.log(chalk.blue('Registering your actor with the Social Inbox...')) + + const answers = await inquirer.prompt([ + { + type: 'input', + name: 'actorUsername', + message: 'Enter your actor username (e.g., @username@domain.com):', + validate: (input) => input ? true : 'Actor username cannot be empty.' + }, + { + type: 'input', + name: 'actorUrl', + message: 'Enter your actor URL:', + validate: (input) => /^https?:\/\/.+/.test(input) ? true : 'Please enter a valid URL.' + }, + { + type: 'input', + name: 'publicKeyId', + message: 'Enter your public key ID (e.g., https://domain.com/actor#main-key):', + validate: (input) => input ? true : 'Public key ID cannot be empty.' + } + ]) + + // Save actor info to config + config.actorUsername = answers.actorUsername + config.actorUrl = answers.actorUrl + config.publicKeyId = answers.publicKeyId + + // Write updated config to .dprc + const configPath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + + const actorInfo = { + actorUrl: answers.actorUrl, + publicKeyId: answers.publicKeyId, + keypair: config.keypair + } + + // Register actor with Social Inbox + const response = await socialInboxApi.registerActor(answers.actorUsername, actorInfo) + + console.log(chalk.green('Actor registered with Social Inbox successfully!')) + console.log(`Response: ${JSON.stringify(response.data, null, 2)}`) + } catch (error) { + console.error(chalk.red('Error registering actor:'), error.message) + } +} + +module.exports = registerActor diff --git a/src/commands/registerSite.js b/src/commands/registerSite.js deleted file mode 100644 index 0077a03..0000000 --- a/src/commands/registerSite.js +++ /dev/null @@ -1,41 +0,0 @@ -const inquirer = require('inquirer') -const socialInboxApi = require('../api/socialInboxApi') -const dpApi = require('../api/dpApi') -const chalk = require('chalk') - -async function registerSite () { - try { - console.log(chalk.blue('Registering site with Social Inbox...')) - - // Fetch existing sites - const sites = await dpApi.getSites() - - if (sites.data.length === 0) { - console.log(chalk.yellow('No sites found. Please create a site first using "create-site" command.')) - return - } - - // Prompt user to select a site - const answers = await inquirer.prompt([ - { - type: 'list', - name: 'siteId', - message: 'Select a site to register:', - choices: sites.data.map(site => ({ - name: `${site.name} (${site.url})`, - value: site.id - })) - } - ]) - - // Register site with Social Inbox - const response = await socialInboxApi.registerSite(answers.siteId) - - console.log(chalk.green('Site registered with Social Inbox successfully!')) - console.log(`Registration ID: ${response.data.registrationId}`) - } catch (error) { - console.error(chalk.red('Error registering site:'), error.message) - } -} - -module.exports = registerSite From 775d27ba2f266aa9e28568229628e331d55926e6 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 20:02:09 -0800 Subject: [PATCH 11/47] fix(api): send signed requests and use correct endpoints --- package-lock.json | 15 ++++++++++++++- package.json | 3 ++- src/commands/sendPost.js | 39 +++++++++++++++++++++------------------ 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 317000f..625b1fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,8 @@ "commander": "^12.1.0", "http-signed-fetch": "^1.0.1", "inquirer": "^11.1.0", - "rc": "^1.2.8" + "rc": "^1.2.8", + "uuid": "^11.0.2" }, "bin": { "dp-cli": "bin/dp-cli.js" @@ -660,6 +661,18 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" }, + "node_modules/uuid": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.2.tgz", + "integrity": "sha512-14FfcOJmqdjbBPdDjFQyk/SdT4NySW4eM0zcG+HqbHP5jzuH56xO3J1DGhgs/cEMCfwYi3HQI1gnTO62iaG+tQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", diff --git a/package.json b/package.json index 080034e..bca3614 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "commander": "^12.1.0", "http-signed-fetch": "^1.0.1", "inquirer": "^11.1.0", - "rc": "^1.2.8" + "rc": "^1.2.8", + "uuid": "^11.0.2" } } diff --git a/src/commands/sendPost.js b/src/commands/sendPost.js index 5602094..c6388b1 100644 --- a/src/commands/sendPost.js +++ b/src/commands/sendPost.js @@ -1,38 +1,41 @@ const inquirer = require('inquirer') -const dpApi = require('../api/dpApi') const socialInboxApi = require('../api/socialInboxApi') const chalk = require('chalk') +const config = require('../config/config') +const { v4: uuidv4 } = require('uuid') async function sendPost (message) { try { console.log(chalk.blue('Sending a post to followers...')) - // Fetch existing sites - const sites = await dpApi.getSites() + const actorUsername = config.actorUsername - if (sites.data.length === 0) { - console.log(chalk.yellow('No sites found. Please create a site first using "create-site" command.')) + if (!actorUsername) { + console.log(chalk.yellow('No actor registered. Please register an actor first using "register-actor" command.')) return } - // Prompt user to select a site - const answers = await inquirer.prompt([ - { - type: 'list', - name: 'siteId', - message: 'Select a site to send a post from:', - choices: sites.data.map(site => ({ - name: `${site.name} (${site.url})`, - value: site.id - })) + const activityId = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}/outbox/${uuidv4()}` + + const activity = { + '@context': 'https://www.w3.org/ns/activitystreams', + id: activityId, + type: 'Create', + actor: config.actorUrl, + object: { + id: `${activityId}#object`, + type: 'Note', + content: message, + published: new Date().toISOString(), + to: ['https://www.w3.org/ns/activitystreams#Public'] } - ]) + } // Send post via Social Inbox API - const response = await socialInboxApi.sendPost(answers.siteId, message) + const response = await socialInboxApi.sendPost(actorUsername, activity) console.log(chalk.green('Post sent successfully!')) - console.log(`Post ID: ${response.data.postId}`) + console.log(`Response: ${JSON.stringify(response.data, null, 2)}`) } catch (error) { console.error(chalk.red('Error sending post:'), error.message) } From 4bbd038b473c9b9a9287d87929f931ea09e9a4c1 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 20:05:57 -0800 Subject: [PATCH 12/47] docs: add set-auth-token and register-actor commands --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 8321eea..433e791 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,20 @@ Run the following command to generate a new RSA keypair: dp-cli generate-keypair ``` +### Set Your Authentication Token +Obtain your `authToken` from your Distributed Press API administrator and set it using: + +```bash +dp-cli set-auth-token +``` + +### Register Your Actor +Register your ActivityPub actor with the Social Inbox: + +```bash +dp-cli register-actor +``` + ## Configuration The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, and keypairs. The configuration file follows the format expected by the [RC module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. Here’s how to set it up: From 0656ff326f48d61a737d5c2b40992f5cdd420371 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 20:16:32 -0800 Subject: [PATCH 13/47] docs: update with keypair generation, auth setup, and enhanced setup instructions --- README.md | 226 ++++++++++++++++++++++++------------------------------ 1 file changed, 102 insertions(+), 124 deletions(-) diff --git a/README.md b/README.md index 433e791..cc9ec56 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,39 @@ # Distributed Press CLI -A **Command Line Interface (CLI)** for interacting with the Distributed Press API and Social Inbox. Manage your sites, register them with Social Inbox, and engage with followers seamlessly from the command line. +A **Command Line Interface (CLI)** for interacting with the Distributed Press API and Social Inbox. Manage your sites, register your ActivityPub actor, and engage with followers seamlessly from the command line. ## Table of Contents - [Installation](#installation) +- [Setup](#setup) + - [Generate a Keypair](#generate-a-keypair) + - [Set Your Authentication Token](#set-your-authentication-token) + - [Register Your Actor](#register-your-actor) - [Configuration](#configuration) - [Usage](#usage) - - [Create a New Site](#create-a-new-site) - - [Register Site with Social Inbox](#register-site-with-social-inbox) - [Send a Post to Followers](#send-a-post-to-followers) - [Commands](#commands) + - [`generate-keypair`](#generate-keypair) + - [`set-auth-token`](#set-auth-token) + - [`register-actor`](#register-actor) + - [`send-post`](#send-post) - [Examples](#examples) - [License](#license) - [Resources](#resources) ## Installation -## Installation - ### Using npx You can use `dp-cli` without installation by running: ```bash -npx dp-cli +npx dp-cli ``` ### Global Installation with npm -To install dp-cli globally, use: +To install `dp-cli` globally, use: ```bash npm install -g dp-cli @@ -39,9 +43,9 @@ Once installed, you can use `dp-cli` from anywhere in your terminal. ## Setup -Before using the CLI, you need to generate a keypair and obtain an authentication token. +Before using the CLI, you need to generate a keypair, set your authentication token, and register your ActivityPub actor. -### Generate Keypair +### Generate a Keypair Run the following command to generate a new RSA keypair: @@ -49,43 +53,46 @@ Run the following command to generate a new RSA keypair: dp-cli generate-keypair ``` +This will generate a keypair and save it to your `.dprc` configuration file. + ### Set Your Authentication Token + Obtain your `authToken` from your Distributed Press API administrator and set it using: ```bash dp-cli set-auth-token ``` +You will be prompted to enter your authentication token. + ### Register Your Actor + Register your ActivityPub actor with the Social Inbox: ```bash dp-cli register-actor ``` -## Configuration - -The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, and keypairs. The configuration file follows the format expected by the [RC module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. Here’s how to set it up: +**Prompts:** -### 1. Create the `.dprc` File +1. **Enter your actor username:** + _(e.g., "@username@yourdomain.com")_ -Copy the example configuration file to your home directory: +2. **Enter your actor URL:** + _(e.g., "https://yourdomain.com/actor")_ -- **Unix/Linux/macOS:** +3. **Enter your public key ID:** + _(e.g., "https://yourdomain.com/actor#main-key")_ - ```bash - cp .dprc.example ~/.dprc - ``` +This will register your actor with the Social Inbox and save the details to your configuration. -- **Windows (PowerShell):** +## Configuration - ```powershell - Copy-Item .dprc.example $env:USERPROFILE\.dprc - ``` +The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, keypairs, and actor information. The configuration file follows the format expected by the [`rc` module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. -### 2. Edit the `.dprc` File +### Configuration File Structure -Open the `.dprc` file in your preferred text editor and replace the placeholder values with your actual configuration: +Your `.dprc` file should look like this: ```json { @@ -95,7 +102,10 @@ Open the `.dprc` file in your preferred text editor and replace the placeholder "keypair": { "publicKeyPem": "", "privateKeyPem": "" - } + }, + "actorUsername": "", + "actorUrl": "", + "publicKeyId": "" } ``` @@ -103,114 +113,76 @@ Open the `.dprc` file in your preferred text editor and replace the placeholder - **`socialInboxUrl`:** The base URL for the Social Inbox. - **`authToken`:** Your authentication token for API access. - **`keypair`:** Your public and private keys for secure interactions. +- **`actorUsername`:** Your ActivityPub actor username. +- **`actorUrl`:** The URL of your actor. +- **`publicKeyId`:** The ID of your public key. -*Ensure that your `.dprc` file is **not** committed to version control to keep your credentials secure.* +_Ensure that your `.dprc` file is **not** committed to version control to keep your credentials secure._ ## Usage Once installed and configured, you can use the `dp-cli` command followed by specific commands to interact with the APIs. -### Create a New Site - -Initialize a new site on Distributed Press. - -```bash -dp-cli create-site -``` - -**Prompts:** - -1. **Enter your site name:** - *(e.g., "My Awesome Site")* - -2. **Enter your site URL:** - *(e.g., "https://myawesomesite.com")* - -**Output:** - -``` -Creating a new site on Distributed Press... -Site created successfully! -Site ID: 12345 -Site URL: https://myawesomesite.com -``` - -### Register Site with Social Inbox - -Register your newly created site with the Social Inbox. - -```bash -dp-cli register-site -``` - -**Prompts:** - -1. **Select a site to register:** - *(List of your created sites)* - -**Output:** - -``` -Registering site with Social Inbox... -Site registered with Social Inbox successfully! -Registration ID: abcde-12345 -``` - ### Send a Post to Followers -Publish a post to your followers. +Publish a post to your followers: ```bash dp-cli send-post --message "Hello, Fediverse!" ``` -**Prompts:** - -1. **Select a site to send a post from:** - *(List of your registered sites)* - **Output:** ``` Sending a post to followers... Post sent successfully! -Post ID: post-67890 +Response: { ... } ``` ## Commands -Here's a summary of the available commands in the Distributed Press CLI: +### `generate-keypair` + +**Description:** +Generate a new RSA keypair and save it to your configuration. + +**Usage:** + +```bash +dp-cli generate-keypair +``` -### `create-site` +### `set-auth-token` **Description:** -Create a new site on Distributed Press. +Set your authentication token for API access. **Usage:** ```bash -dp-cli create-site +dp-cli set-auth-token ``` -**Prompts:** +**Prompt:** -- Enter your site name. -- Enter your site URL. +- Enter your authentication token. -### `register-site` +### `register-actor` **Description:** -Register an existing site with the Social Inbox. +Register your ActivityPub actor with the Social Inbox. **Usage:** ```bash -dp-cli register-site +dp-cli register-actor ``` **Prompts:** -- Select a site to register. +- Enter your actor username. +- Enter your actor URL. +- Enter your public key ID. ### `send-post` @@ -227,75 +199,70 @@ dp-cli send-post --message "Your message here" - `-m, --message `: The content of the post. -**Prompts:** +## Examples -- Select a site to send the post from. +### Example: Full Workflow -## Examples +```bash +# Generate a keypair +dp-cli generate-keypair +``` -### Example 1: Creating and Registering a Site +_Output:_ + +``` +Keypair generated and saved to configuration. +``` ```bash -# Create a new site -dp-cli create-site +# Set your authentication token +dp-cli set-auth-token ``` -*Prompts:* +_Prompt:_ ``` -Enter your site name: My Awesome Site -Enter your site URL: https://myawesomesite.com +Enter your authentication token: ``` -*Output:* +_Output:_ ``` -Creating a new site on Distributed Press... -Site created successfully! -Site ID: 12345 -Site URL: https://myawesomesite.com +Authentication token saved to configuration. ``` ```bash -# Register the newly created site with Social Inbox -dp-cli register-site +# Register your actor +dp-cli register-actor ``` -*Prompts:* +_Prompts:_ ``` -Select a site to register: -> My Awesome Site (https://myawesomesite.com) +Enter your actor username: @alice@yourdomain.com +Enter your actor URL: https://yourdomain.com/alice +Enter your public key ID: https://yourdomain.com/alice#main-key ``` -*Output:* +_Output:_ ``` -Registering site with Social Inbox... -Site registered with Social Inbox successfully! -Registration ID: abcde-12345 +Registering your actor with the Social Inbox... +Actor registered with Social Inbox successfully! +Response: { ... } ``` -### Example 2: Sending a Post - ```bash # Send a post to followers dp-cli send-post --message "Hello, Fediverse!" ``` -*Prompts:* - -``` -Select a site to send a post from: -> My Awesome Site (https://myawesomesite.com) -``` - -*Output:* +_Output:_ ``` Sending a post to followers... Post sent successfully! -Post ID: post-67890 +Response: { ... } ``` ## License @@ -309,3 +276,14 @@ This project is licensed under the [MIT License](LICENSE). - **Distributed Press Documentation:** [https://docs.distributed.press/](https://docs.distributed.press/) + +- **RC Module Documentation:** + [https://www.npmjs.com/package/rc](https://www.npmjs.com/package/rc) + +- **HTTP Signed Fetch:** + [https://www.npmjs.com/package/http-signed-fetch](https://www.npmjs.com/package/http-signed-fetch) + +## Notes + +- **Security:** Ensure that your `.dprc` file and any keys or tokens are stored securely and are not exposed publicly. +- **Dependencies:** Make sure you have the necessary dependencies installed as per the `package.json` file. From e37947d1f1f16548d3c9a008d67a68e1ee3130db Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 20:18:05 -0800 Subject: [PATCH 14/47] chore(config): add actor details to .dprc configuration file --- .dprc.example | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.dprc.example b/.dprc.example index 92e3b40..1a33b32 100644 --- a/.dprc.example +++ b/.dprc.example @@ -5,5 +5,8 @@ "keypair": { "publicKeyPem": "", "privateKeyPem": "" - } -} + }, + "actorUsername": "", + "actorUrl": "", + "publicKeyId": "" +} \ No newline at end of file From f4e3c768fa8850a54481770aeb49f6b4b0f1109d Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 20:49:04 -0800 Subject: [PATCH 15/47] fix(cli): resolve module loading errors and ESM compatibility --- bin/dp-cli.js | 2 +- package-lock.json | 59 +++++++++++++++++++++++++++------------ package.json | 2 +- src/api/socialInboxApi.js | 8 +++++- 4 files changed, 50 insertions(+), 21 deletions(-) diff --git a/bin/dp-cli.js b/bin/dp-cli.js index 3bacaa4..18b32b0 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -4,7 +4,7 @@ const chalk = require('chalk') const createSite = require('../src/commands/createSite') const registerActor = require('../src/commands/registerActor') const sendPost = require('../src/commands/sendPost') -const generateKeypairCommand = require('./commands/generateKeypair') +const generateKeypairCommand = require('../src/commands/generateKeypair') const setAuthTokenCommand = require('../src/commands/setAuthToken') const program = new Command() diff --git a/package-lock.json b/package-lock.json index 625b1fd..e7b1b29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "axios": "^1.7.7", - "chalk": "^5.3.0", + "chalk": "^4.1.2", "commander": "^12.1.0", "http-signed-fetch": "^1.0.1", "inquirer": "^11.1.0", @@ -109,9 +109,9 @@ } }, "node_modules/@inquirer/figures": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.6.tgz", - "integrity": "sha512-yfZzps3Cso2UbM7WlxKwZQh2Hs6plrbjs1QnzQDZhK2DgyCo6D8AaHps9olkNcUFlcYERMqU3uJSp1gmy3s/qQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.7.tgz", + "integrity": "sha512-m+Trk77mp54Zma6xLkLuY+mvanPxlE4A7yNKs2HBiyZ4UkVs28Mv5c/pgWrHeInx+USHeX/WEPzjrWrcJiQgjw==", "engines": { "node": ">=18" } @@ -235,11 +235,11 @@ } }, "node_modules/@types/node": { - "version": "22.7.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", - "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "version": "22.8.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.7.tgz", + "integrity": "sha512-LidcG+2UeYIWcMuMUpBKOnryBWG/rnmOHQR5apjn8myTQcx3rinFRn7DcIFhMnS0PPFSC6OafdIKEad0lj6U0Q==", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.19.8" } }, "node_modules/@types/wrap-ansi": { @@ -323,11 +323,15 @@ } }, "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" @@ -435,9 +439,9 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -447,6 +451,14 @@ "node": ">= 6" } }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/http-signed-fetch": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/http-signed-fetch/-/http-signed-fetch-1.0.1.tgz", @@ -629,6 +641,17 @@ "node": ">=0.10.0" } }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -641,9 +664,9 @@ } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/type-fest": { "version": "0.21.3", diff --git a/package.json b/package.json index bca3614..1a3cd76 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "license": "MIT", "dependencies": { "axios": "^1.7.7", - "chalk": "^5.3.0", + "chalk": "^4.1.2", "commander": "^12.1.0", "http-signed-fetch": "^1.0.1", "inquirer": "^11.1.0", diff --git a/src/api/socialInboxApi.js b/src/api/socialInboxApi.js index 63223f0..33ed930 100644 --- a/src/api/socialInboxApi.js +++ b/src/api/socialInboxApi.js @@ -1,9 +1,14 @@ const config = require('../config/config') const chalk = require('chalk') -const httpsig = require('http-signed-fetch') + +async function loadHttpSig () { + // Dynamically import the `http-signed-fetch` package. + return await import('http-signed-fetch') +} async function registerActor (actorUsername, actorInfo) { try { + const httpsig = await loadHttpSig() const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}` const signer = new httpsig.Signer({ keyId: actorInfo.publicKeyId, @@ -37,6 +42,7 @@ async function registerActor (actorUsername, actorInfo) { async function sendPost (actorUsername, activity) { try { + const httpsig = await loadHttpSig() const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}/outbox` const signer = new httpsig.Signer({ keyId: config.publicKeyId, From 987d24c77c9d0083dfa33efb2c73e24c4d8923d2 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 23:22:23 -0800 Subject: [PATCH 16/47] fix(config): prevent unwanted properties from being saved in .dprc file --- src/commands/generateKeypair.js | 7 +++++-- src/commands/setAuthToken.js | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/commands/generateKeypair.js b/src/commands/generateKeypair.js index 7e1f6d1..b0aebe0 100644 --- a/src/commands/generateKeypair.js +++ b/src/commands/generateKeypair.js @@ -18,15 +18,18 @@ function generateKeypairCommand () { } }) - // Save the keypair to config + // Update the keypair in config config.keypair = { publicKeyPem: publicKey, privateKeyPem: privateKey } + // Create a new config object excluding unwanted properties + const { _, ...cleanConfig } = config + // Optionally, write to .dprc file const configPath = path.join(process.cwd(), '.dprc') - fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + fs.writeFileSync(configPath, JSON.stringify(cleanConfig, null, 2)) console.log(chalk.green('Keypair generated and saved to configuration.')) } catch (error) { diff --git a/src/commands/setAuthToken.js b/src/commands/setAuthToken.js index acb8787..f71e9ac 100644 --- a/src/commands/setAuthToken.js +++ b/src/commands/setAuthToken.js @@ -17,9 +17,12 @@ function setAuthTokenCommand () { .then((answers) => { config.authToken = answers.authToken + // Exclude unwanted properties + const { _, ...cleanConfig } = config + // Write to .dprc file const configPath = path.join(process.cwd(), '.dprc') - fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + fs.writeFileSync(configPath, JSON.stringify(cleanConfig, null, 2)) console.log(chalk.green('Authentication token saved to configuration.')) }) From dbaeb6a48742e7c0520908aab4ea6fa12f3558e8 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sun, 3 Nov 2024 23:32:51 -0800 Subject: [PATCH 17/47] fix(dependencies): downgrade inquirer to v8.2.4 for CommonJS compatibility --- package-lock.json | 584 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 323 insertions(+), 263 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7b1b29..a7ffd0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "chalk": "^4.1.2", "commander": "^12.1.0", "http-signed-fetch": "^1.0.1", - "inquirer": "^11.1.0", + "inquirer": "^8.2.4", "rc": "^1.2.8", "uuid": "^11.0.2" }, @@ -33,220 +33,6 @@ "node": ">=14" } }, - "node_modules/@inquirer/checkbox": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-3.0.1.tgz", - "integrity": "sha512-0hm2nrToWUdD6/UHnel/UKGdk1//ke5zGUpHIvk5ZWmaKezlGxZkOJXNSWsdxO/rEqTkbB3lNC2J6nBElV2aAQ==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/confirm": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-4.0.1.tgz", - "integrity": "sha512-46yL28o2NJ9doViqOy0VDcoTzng7rAb6yPQKU7VDLqkmbCaH4JqK4yk4XqlzNWy9PVC5pG1ZUXPBQv+VqnYs2w==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/core": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-9.2.1.tgz", - "integrity": "sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==", - "dependencies": { - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", - "@types/mute-stream": "^0.0.4", - "@types/node": "^22.5.5", - "@types/wrap-ansi": "^3.0.0", - "ansi-escapes": "^4.3.2", - "cli-width": "^4.1.0", - "mute-stream": "^1.0.0", - "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^6.2.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/editor": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-3.0.1.tgz", - "integrity": "sha512-VA96GPFaSOVudjKFraokEEmUQg/Lub6OXvbIEZU1SDCmBzRkHGhxoFAVaF30nyiB4m5cEbDgiI2QRacXZ2hw9Q==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", - "external-editor": "^3.1.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/expand": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-3.0.1.tgz", - "integrity": "sha512-ToG8d6RIbnVpbdPdiN7BCxZGiHOTomOX94C2FaT5KOHupV40tKEDozp12res6cMIfRKrXLJyexAZhWVHgbALSQ==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/figures": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.7.tgz", - "integrity": "sha512-m+Trk77mp54Zma6xLkLuY+mvanPxlE4A7yNKs2HBiyZ4UkVs28Mv5c/pgWrHeInx+USHeX/WEPzjrWrcJiQgjw==", - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/input": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-3.0.1.tgz", - "integrity": "sha512-BDuPBmpvi8eMCxqC5iacloWqv+5tQSJlUafYWUe31ow1BVXjW2a5qe3dh4X/Z25Wp22RwvcaLCc2siHobEOfzg==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/number": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-2.0.1.tgz", - "integrity": "sha512-QpR8jPhRjSmlr/mD2cw3IR8HRO7lSVOnqUvQa8scv1Lsr3xoAMMworcYW3J13z3ppjBFBD2ef1Ci6AE5Qn8goQ==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/password": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-3.0.1.tgz", - "integrity": "sha512-haoeEPUisD1NeE2IanLOiFr4wcTXGWrBOyAyPZi1FfLJuXOzNmxCJPgUrGYKVh+Y8hfGJenIfz5Wb/DkE9KkMQ==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", - "ansi-escapes": "^4.3.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/prompts": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-6.0.1.tgz", - "integrity": "sha512-yl43JD/86CIj3Mz5mvvLJqAOfIup7ncxfJ0Btnl0/v5TouVUyeEdcpknfgc+yMevS/48oH9WAkkw93m7otLb/A==", - "dependencies": { - "@inquirer/checkbox": "^3.0.1", - "@inquirer/confirm": "^4.0.1", - "@inquirer/editor": "^3.0.1", - "@inquirer/expand": "^3.0.1", - "@inquirer/input": "^3.0.1", - "@inquirer/number": "^2.0.1", - "@inquirer/password": "^3.0.1", - "@inquirer/rawlist": "^3.0.1", - "@inquirer/search": "^2.0.1", - "@inquirer/select": "^3.0.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/rawlist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-3.0.1.tgz", - "integrity": "sha512-VgRtFIwZInUzTiPLSfDXK5jLrnpkuSOh1ctfaoygKAdPqjcjKYmGh6sCY1pb0aGnCGsmhUxoqLDUAU0ud+lGXQ==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/type": "^2.0.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/search": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-2.0.1.tgz", - "integrity": "sha512-r5hBKZk3g5MkIzLVoSgE4evypGqtOannnB3PKTG9NRZxyFRKcfzrdxXXPcoJQsxJPzvdSU2Rn7pB7lw0GCmGAg==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/select": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-3.0.1.tgz", - "integrity": "sha512-lUDGUxPhdWMkN/fHy1Lk7pF3nK1fh/gqeyWXmctefhxLYxlDsc7vsPBEpxrfVGDsVdyYJsiJoD4bJ1b623cV1Q==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/figures": "^1.0.6", - "@inquirer/type": "^2.0.0", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-2.0.0.tgz", - "integrity": "sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==", - "dependencies": { - "mute-stream": "^1.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@types/mute-stream": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", - "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "22.8.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.7.tgz", - "integrity": "sha512-LidcG+2UeYIWcMuMUpBKOnryBWG/rnmOHQR5apjn8myTQcx3rinFRn7DcIFhMnS0PPFSC6OafdIKEad0lj6U0Q==", - "dependencies": { - "undici-types": "~6.19.8" - } - }, - "node_modules/@types/wrap-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", - "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==" - }, "node_modules/activitypub-http-signatures": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/activitypub-http-signatures/-/activitypub-http-signatures-2.5.0.tgz", @@ -303,6 +89,25 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/base64url": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", @@ -322,6 +127,39 @@ "node": ">=14" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -342,12 +180,42 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cli-width": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", - "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "engines": { - "node": ">= 12" + "node": ">=0.8" } }, "node_modules/color-convert": { @@ -393,6 +261,17 @@ "node": ">=4.0.0" } }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -406,6 +285,14 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -419,6 +306,20 @@ "node": ">=4" } }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/follow-redirects": { "version": "1.15.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", @@ -479,27 +380,58 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/inquirer": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-11.1.0.tgz", - "integrity": "sha512-CmLAZT65GG/v30c+D2Fk8+ceP6pxD6RL+hIUOWAltCmeyEqWYwqu9v76q03OvjyZ3AB0C1Ala2stn1z/rMqGEw==", - "dependencies": { - "@inquirer/core": "^9.2.1", - "@inquirer/prompts": "^6.0.1", - "@inquirer/type": "^2.0.0", - "@types/mute-stream": "^0.0.4", - "ansi-escapes": "^4.3.2", - "mute-stream": "^1.0.0", - "run-async": "^3.0.0", - "rxjs": "^7.8.1" + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" }, "engines": { - "node": ">=18" + "node": ">=12.0.0" } }, "node_modules/is-fullwidth-code-point": { @@ -510,11 +442,50 @@ "node": ">=8" } }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/js-base64": { "version": "3.7.7", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -534,6 +505,14 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -543,11 +522,44 @@ } }, "node_modules/mute-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", - "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/os-tmpdir": { @@ -577,10 +589,35 @@ "rc": "cli.js" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/run-async": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", - "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "engines": { "node": ">=0.12.0" } @@ -593,20 +630,41 @@ "tslib": "^2.1.0" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" } }, "node_modules/string-width": { @@ -652,6 +710,11 @@ "node": ">=8" } }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -679,10 +742,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/uuid": { "version": "11.0.2", @@ -696,6 +759,14 @@ "uuid": "dist/esm/bin/uuid" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -708,17 +779,6 @@ "engines": { "node": ">=8" } - }, - "node_modules/yoctocolors-cjs": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", - "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/package.json b/package.json index 1a3cd76..a632260 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "chalk": "^4.1.2", "commander": "^12.1.0", "http-signed-fetch": "^1.0.1", - "inquirer": "^11.1.0", + "inquirer": "^8.2.4", "rc": "^1.2.8", "uuid": "^11.0.2" } From 8f6e970357d1eb79cffed02970fce8989926628f Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 9 Nov 2024 15:13:51 -0800 Subject: [PATCH 18/47] feat: add publish and patch commands for site management --- bin/dp-cli.js | 17 + package-lock.json | 687 ++++++++++++++++++++++++++++++++++++ package.json | 2 + src/commands/patchSite.js | 56 +++ src/commands/publishSite.js | 52 +++ 5 files changed, 814 insertions(+) create mode 100644 src/commands/patchSite.js create mode 100644 src/commands/publishSite.js diff --git a/bin/dp-cli.js b/bin/dp-cli.js index 18b32b0..223967d 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -6,6 +6,8 @@ const registerActor = require('../src/commands/registerActor') const sendPost = require('../src/commands/sendPost') const generateKeypairCommand = require('../src/commands/generateKeypair') const setAuthTokenCommand = require('../src/commands/setAuthToken') +const publishSite = require('../src/commands/publishSite') +const patchSite = require('../src/commands/patchSite') const program = new Command() @@ -54,6 +56,21 @@ program setAuthTokenCommand() }) +program + .command('publish ') + .description('Publish a new site with content from the specified folder') + .action((folder) => { + publishSite(folder) + }) + +program + .command('patch ') + .description('Update an existing site with content from the specified folder') + .option('-i, --id ', 'ID of the site to patch') + .action((folder, options) => { + patchSite(folder, options.id) + }) + // Parse arguments program.parse(process.argv) diff --git a/package-lock.json b/package-lock.json index a7ffd0a..a08aa34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,11 @@ "axios": "^1.7.7", "chalk": "^4.1.2", "commander": "^12.1.0", + "globby": "^14.0.2", "http-signed-fetch": "^1.0.1", "inquirer": "^8.2.4", "rc": "^1.2.8", + "tar": "^7.4.3", "uuid": "^11.0.2" }, "bin": { @@ -33,6 +35,158 @@ "node": ">=14" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/activitypub-http-signatures": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/activitypub-http-signatures/-/activitypub-http-signatures-2.5.0.tgz", @@ -89,6 +243,11 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -137,6 +296,25 @@ "readable-stream": "^3.4.0" } }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -180,6 +358,14 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "engines": { + "node": ">=18" + } + }, "node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -253,6 +439,19 @@ "node": ">=18" } }, + "node_modules/cross-spawn": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", + "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -280,6 +479,11 @@ "node": ">=0.4.0" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -306,6 +510,29 @@ "node": ">=4" } }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -320,6 +547,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/follow-redirects": { "version": "1.15.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", @@ -339,6 +577,32 @@ } } }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", @@ -352,6 +616,55 @@ "node": ">= 6" } }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", + "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -399,6 +712,14 @@ } ] }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "engines": { + "node": ">= 4" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -434,6 +755,14 @@ "node": ">=12.0.0" } }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -442,6 +771,17 @@ "node": ">=8" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-interactive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", @@ -450,6 +790,14 @@ "node": ">=8" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -461,6 +809,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-base64": { "version": "3.7.7", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", @@ -486,6 +853,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -513,6 +905,20 @@ "node": ">=6" } }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -521,6 +927,40 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", @@ -570,11 +1010,80 @@ "node": ">=0.10.0" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -614,6 +1123,29 @@ "node": ">=8" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -622,6 +1154,28 @@ "node": ">=0.12.0" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -654,11 +1208,41 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -680,6 +1264,20 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -691,6 +1289,18 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -710,6 +1320,22 @@ "node": ">=8" } }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -726,6 +1352,17 @@ "node": ">=0.6.0" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -742,6 +1379,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -767,6 +1415,20 @@ "defaults": "^1.0.3" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -779,6 +1441,31 @@ "engines": { "node": ">=8" } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "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/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "engines": { + "node": ">=18" + } } } } diff --git a/package.json b/package.json index a632260..412d5b1 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,11 @@ "axios": "^1.7.7", "chalk": "^4.1.2", "commander": "^12.1.0", + "globby": "^14.0.2", "http-signed-fetch": "^1.0.1", "inquirer": "^8.2.4", "rc": "^1.2.8", + "tar": "^7.4.3", "uuid": "^11.0.2" } } diff --git a/src/commands/patchSite.js b/src/commands/patchSite.js new file mode 100644 index 0000000..9d9f309 --- /dev/null +++ b/src/commands/patchSite.js @@ -0,0 +1,56 @@ +const fs = require('fs') +const path = require('path') +const tar = require('tar') +const axios = require('axios') +const globby = require('globby') +const chalk = require('chalk') +const config = require('../config/config') + +async function patchSite (folder, siteId) { + try { + if (!siteId) { + console.error(chalk.red('Site ID is required to patch a site.')) + return + } + + console.log(chalk.blue('Patching site...')) + + // Validate folder + if (!fs.existsSync(folder)) { + console.error(chalk.red(`Folder "${folder}" does not exist.`)) + return + } + + // Create a tarball of the folder + const tarballPath = path.join(process.cwd(), 'site-patch.tar') + await tar.c( + { + gzip: true, + file: tarballPath, + cwd: folder + }, + await globby(['**/*'], { cwd: folder }) + ) + + // Read the tarball + const tarballData = fs.createReadStream(tarballPath) + + // Send the tarball to the API + const response = await axios.patch(`${config.dpApiUrl}/sites/${siteId}`, tarballData, { + headers: { + 'Content-Type': 'application/gzip', + Authorization: `Bearer ${config.authToken}` + } + }) + + console.log(chalk.green('Site patched successfully!')) + console.log(`Updated Site Info: ${JSON.stringify(response.data, null, 2)}`) + + // Clean up the tarball + fs.unlinkSync(tarballPath) + } catch (error) { + console.error(chalk.red('Error patching site:', error.message)) + } +} + +module.exports = patchSite diff --git a/src/commands/publishSite.js b/src/commands/publishSite.js new file mode 100644 index 0000000..75cef05 --- /dev/null +++ b/src/commands/publishSite.js @@ -0,0 +1,52 @@ +const fs = require('fs') +const path = require('path') +const tar = require('tar') +const axios = require('axios') +const globby = require('globby') +const chalk = require('chalk') +const config = require('../config/config') + +async function publishSite (folder) { + try { + console.log(chalk.blue('Publishing site...')) + + // Validate folder + if (!fs.existsSync(folder)) { + console.error(chalk.red(`Folder "${folder}" does not exist.`)) + return + } + + // Create a tarball of the folder + const tarballPath = path.join(process.cwd(), 'site.tar') + await tar.c( + { + gzip: true, + file: tarballPath, + cwd: folder + }, + await globby(['**/*'], { cwd: folder }) + ) + + // Read the tarball + const tarballData = fs.createReadStream(tarballPath) + + // Send the tarball to the API + const response = await axios.post(`${config.dpApiUrl}/sites`, tarballData, { + headers: { + 'Content-Type': 'application/gzip', + Authorization: `Bearer ${config.authToken}` + } + }) + + console.log(chalk.green('Site published successfully!')) + console.log(`Site ID: ${response.data.id}`) + console.log(`Links: ${JSON.stringify(response.data.links, null, 2)}`) + + // Clean up the tarball + fs.unlinkSync(tarballPath) + } catch (error) { + console.error(chalk.red('Error publishing site:', error.message)) + } +} + +module.exports = publishSite From 61c44cb3bbeab8eb7c8050f43e67f9b72e43d5f6 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 9 Nov 2024 15:17:02 -0800 Subject: [PATCH 19/47] feat: add register command for trial publisher accounts --- bin/dp-cli.js | 8 +++++ src/commands/registerPublisher.js | 50 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 src/commands/registerPublisher.js diff --git a/bin/dp-cli.js b/bin/dp-cli.js index 223967d..75d6769 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -8,6 +8,7 @@ const generateKeypairCommand = require('../src/commands/generateKeypair') const setAuthTokenCommand = require('../src/commands/setAuthToken') const publishSite = require('../src/commands/publishSite') const patchSite = require('../src/commands/patchSite') +const registerPublisher = require('../src/commands/registerPublisher') const program = new Command() @@ -63,6 +64,13 @@ program publishSite(folder) }) +program + .command('register') + .description('Register for a trial publisher account') + .action(() => { + registerPublisher() + }) + program .command('patch ') .description('Update an existing site with content from the specified folder') diff --git a/src/commands/registerPublisher.js b/src/commands/registerPublisher.js new file mode 100644 index 0000000..2116f36 --- /dev/null +++ b/src/commands/registerPublisher.js @@ -0,0 +1,50 @@ +const inquirer = require('inquirer') +const axios = require('axios') +const chalk = require('chalk') +const config = require('../config/config') +const fs = require('fs') +const path = require('path') + +async function registerPublisher () { + try { + const answers = await inquirer.prompt([ + { + type: 'input', + name: 'name', + message: 'Enter your name or publisher name:', + validate: (input) => (input ? true : 'Name cannot be empty.') + }, + { + type: 'input', + name: 'email', + message: 'Enter your email address:', + validate: (input) => + /\S+@\S+\.\S+/.test(input) ? true : 'Please enter a valid email address.' + } + ]) + + console.log(chalk.blue('Registering for a trial account...')) + + const response = await axios.post(`${config.dpApiUrl}/publisher/trial`, { + name: answers.name, + email: answers.email, + limited: true + }) + + const authToken = response.data.authToken + + // Save authToken to config + config.authToken = authToken + + // Write updated config to .dprc + const configPath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + + console.log(chalk.green('Trial account registered successfully!')) + console.log(chalk.green('Authentication token saved to configuration.')) + } catch (error) { + console.error(chalk.red('Error registering trial account:', error.message)) + } +} + +module.exports = registerPublisher From 0e43072257e13e1d6b38cfe15b59396aaa050a17 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 9 Nov 2024 15:19:46 -0800 Subject: [PATCH 20/47] feat: add clone command to clone websites via DP API --- bin/dp-cli.js | 8 ++++++++ src/commands/cloneSite.js | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/commands/cloneSite.js diff --git a/bin/dp-cli.js b/bin/dp-cli.js index 75d6769..36b3730 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -9,6 +9,7 @@ const setAuthTokenCommand = require('../src/commands/setAuthToken') const publishSite = require('../src/commands/publishSite') const patchSite = require('../src/commands/patchSite') const registerPublisher = require('../src/commands/registerPublisher') +const cloneSite = require('../src/commands/cloneSite') const program = new Command() @@ -79,6 +80,13 @@ program patchSite(folder, options.id) }) +program + .command('clone ') + .description('Clone a website from its HTTPS version') + .action((siteId) => { + cloneSite(siteId) + }) + // Parse arguments program.parse(process.argv) diff --git a/src/commands/cloneSite.js b/src/commands/cloneSite.js new file mode 100644 index 0000000..156e08f --- /dev/null +++ b/src/commands/cloneSite.js @@ -0,0 +1,26 @@ +const axios = require('axios') +const chalk = require('chalk') +const config = require('../config/config') + +async function cloneSite (siteId) { + try { + console.log(chalk.blue(`Cloning site with ID: ${siteId}`)) + + const response = await axios.post( + `${config.dpApiUrl}/sites/${siteId}/clone`, + {}, + { + headers: { + Authorization: `Bearer ${config.authToken}` + } + } + ) + + console.log(chalk.green('Site cloned successfully!')) + console.log(`Cloned Site Info: ${JSON.stringify(response.data, null, 2)}`) + } catch (error) { + console.error(chalk.red('Error cloning site:', error.message)) + } +} + +module.exports = cloneSite From 83b16f9c88c134da43570998f22f8255b3c32547 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 9 Nov 2024 15:29:30 -0800 Subject: [PATCH 21/47] feat: add support for activity file input and DP site sync --- bin/dp-cli.js | 9 +++---- src/commands/sendPost.js | 54 +++++++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/bin/dp-cli.js b/bin/dp-cli.js index 36b3730..fa30139 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -39,11 +39,10 @@ program }) program - .command('send-post') - .description('Send a post to followers') - .requiredOption('-m, --message ', 'Post message') - .action((options) => { - sendPost(options.message) + .command('send-post ') + .description('Send a post to followers using an activity JSON file') + .action((activityPath) => { + sendPost(activityPath) }) program diff --git a/src/commands/sendPost.js b/src/commands/sendPost.js index c6388b1..f444700 100644 --- a/src/commands/sendPost.js +++ b/src/commands/sendPost.js @@ -1,34 +1,54 @@ -const inquirer = require('inquirer') -const socialInboxApi = require('../api/socialInboxApi') +const fs = require('fs') +const path = require('path') const chalk = require('chalk') const config = require('../config/config') -const { v4: uuidv4 } = require('uuid') +const socialInboxApi = require('../api/socialInboxApi') -async function sendPost (message) { +async function sendPost (activityPath) { try { console.log(chalk.blue('Sending a post to followers...')) const actorUsername = config.actorUsername if (!actorUsername) { - console.log(chalk.yellow('No actor registered. Please register an actor first using "register-actor" command.')) + console.log( + chalk.yellow( + 'No actor registered. Please register an actor first using "register-actor" command.' + ) + ) + return + } + + // Resolve the activity file path + const resolvedPath = path.resolve(activityPath) + + // Check if the file exists + if (!fs.existsSync(resolvedPath)) { + console.error(chalk.red(`Activity file not found at path: ${resolvedPath}`)) + return + } + + // Read the activity from the file + const activityData = fs.readFileSync(resolvedPath, 'utf-8') + + // Parse the activity JSON + const activity = JSON.parse(activityData) + + // Validate the activity + if (!activity || !activity.type) { + console.error(chalk.red('Invalid activity data. Please provide a valid ActivityStreams JSON.')) return } + // Optionally, update activity IDs and timestamps const activityId = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}/outbox/${uuidv4()}` + activity.id = activity.id || activityId + activity.published = activity.published || new Date().toISOString() + activity.actor = activity.actor || config.actorUrl - const activity = { - '@context': 'https://www.w3.org/ns/activitystreams', - id: activityId, - type: 'Create', - actor: config.actorUrl, - object: { - id: `${activityId}#object`, - type: 'Note', - content: message, - published: new Date().toISOString(), - to: ['https://www.w3.org/ns/activitystreams#Public'] - } + // If the activity contains an object (e.g., a Note), ensure it has an ID + if (activity.object && !activity.object.id) { + activity.object.id = `${activity.id}#object` } // Send post via Social Inbox API From b99bc8e1e079c088b4077972f0c8ea47a4f4d35c Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 9 Nov 2024 16:59:25 -0800 Subject: [PATCH 22/47] docs: update README.md with new commands, setup instructions, and latest API changes --- README.md | 110 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index cc9ec56..d012aae 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ A **Command Line Interface (CLI)** for interacting with the Distributed Press AP ## Table of Contents - [Installation](#installation) + - [Node.js and npm Setup](#nodejs-and-npm-setup) - [Setup](#setup) - [Generate a Keypair](#generate-a-keypair) - [Set Your Authentication Token](#set-your-authentication-token) @@ -23,6 +24,18 @@ A **Command Line Interface (CLI)** for interacting with the Distributed Press AP ## Installation +### Node.js and npm Setup + +To use `dp-cli`, you’ll need Node.js and npm. Please refer to the [Node.js official documentation](https://nodejs.org/) to install Node.js. Once installed, npm (Node Package Manager) will be available, allowing you to run commands like `npx` and `npm`. + +- **npm**: Comes bundled with Node.js. Verify installation by running: + ```bash + node -v + npm -v + ``` + +For additional help with npm commands, see the [npm documentation](https://docs.npmjs.com/). + ### Using npx You can use `dp-cli` without installation by running: @@ -53,9 +66,25 @@ Run the following command to generate a new RSA keypair: dp-cli generate-keypair ``` +**Purpose:** +This keypair is used for authenticating your interactions with the Social Inbox, ensuring secure communication and verifying your identity. + +**Note:** +If you only plan to use the DP API for static file publishing, generating a keypair might not be necessary. However, it's recommended for enhanced security and functionality when interacting with the Social Inbox. + This will generate a keypair and save it to your `.dprc` configuration file. -### Set Your Authentication Token +### Register as Publisher (Trial Account) + +Register a trial publisher account on Distributed Press using your email: + +```bash +dp-cli register-publisher +``` + +You will be prompted for your name and email. Note: currently, only one site per email is allowed. + +### OR Set Your Authentication Token Manually Obtain your `authToken` from your Distributed Press API administrator and set it using: @@ -152,6 +181,14 @@ Generate a new RSA keypair and save it to your configuration. dp-cli generate-keypair ``` +### `register-publisher` + +Register a trial publisher account with Distributed Press: + +```bash +dp-cli register-publisher +``` + ### `set-auth-token` **Description:** @@ -186,32 +223,47 @@ dp-cli register-actor ### `send-post` -**Description:** -Send a post to your followers. +Send an activity post to your followers and publish it on the DP site: -**Usage:** +```bash +dp-cli send-post --path ./path_to_activity.json +``` + +### `publish-site` + +Upload and publish static content to the DP site from a specified directory: ```bash -dp-cli send-post --message "Your message here" +dp-cli publish ./folder_here ``` -**Options:** +### `clone-site` -- `-m, --message `: The content of the post. +Clone a website by creating a static copy from its HTTP URL: + +```bash +dp-cli clone-site --id +``` ## Examples ### Example: Full Workflow ```bash -# Generate a keypair -dp-cli generate-keypair +# Register as a publisher +dp-cli register-publisher ``` -_Output:_ +_Prompts:_ ``` -Keypair generated and saved to configuration. +Enter your name: Alice +Enter your email: alice@example.com +``` + +```bash +# Generate a keypair +dp-cli generate-keypair ``` ```bash @@ -225,12 +277,6 @@ _Prompt:_ Enter your authentication token: ``` -_Output:_ - -``` -Authentication token saved to configuration. -``` - ```bash # Register your actor dp-cli register-actor @@ -244,25 +290,14 @@ Enter your actor URL: https://yourdomain.com/alice Enter your public key ID: https://yourdomain.com/alice#main-key ``` -_Output:_ - -``` -Registering your actor with the Social Inbox... -Actor registered with Social Inbox successfully! -Response: { ... } -``` - ```bash -# Send a post to followers -dp-cli send-post --message "Hello, Fediverse!" +# Publish site content from a folder +dp-cli publish ./folder_here ``` -_Output:_ - -``` -Sending a post to followers... -Post sent successfully! -Response: { ... } +```bash +# Send a post to followers with activity JSON +dp-cli send-post --path ./path_to_activity.json ``` ## License @@ -271,18 +306,21 @@ This project is licensed under the [MIT License](LICENSE). ## Resources -- **Social Inbox:** - [https://github.com/hyphacoop/social.distributed.press](https://github.com/hyphacoop/social.distributed.press) - - **Distributed Press Documentation:** [https://docs.distributed.press/](https://docs.distributed.press/) +- **Social Inbox Documentation:** + [https://github.com/hyphacoop/social.distributed.press](https://github.com/hyphacoop/social.distributed.press) + - **RC Module Documentation:** [https://www.npmjs.com/package/rc](https://www.npmjs.com/package/rc) - **HTTP Signed Fetch:** [https://www.npmjs.com/package/http-signed-fetch](https://www.npmjs.com/package/http-signed-fetch) +- **Setting Up Node.js**: + [https://nodejs.org/en/download/](https://nodejs.org/en/download/) + ## Notes - **Security:** Ensure that your `.dprc` file and any keys or tokens are stored securely and are not exposed publicly. From 09dc8fd7129ed47eeba0a030d16edd4700d33590 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 9 Nov 2024 17:48:22 -0800 Subject: [PATCH 23/47] refactor: CLI to support ESM-only modules and lazy load commands --- src/commands/patchSite.js | 9 ++++++++- src/commands/publishSite.js | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/commands/patchSite.js b/src/commands/patchSite.js index 9d9f309..033f4b2 100644 --- a/src/commands/patchSite.js +++ b/src/commands/patchSite.js @@ -2,10 +2,14 @@ const fs = require('fs') const path = require('path') const tar = require('tar') const axios = require('axios') -const globby = require('globby') const chalk = require('chalk') const config = require('../config/config') +async function loadGlobby () { + const globbyModule = await import('globby') + return globbyModule.globby || globbyModule.default || globbyModule +} + async function patchSite (folder, siteId) { try { if (!siteId) { @@ -21,6 +25,9 @@ async function patchSite (folder, siteId) { return } + // Load globby dynamically + const globby = await loadGlobby() + // Create a tarball of the folder const tarballPath = path.join(process.cwd(), 'site-patch.tar') await tar.c( diff --git a/src/commands/publishSite.js b/src/commands/publishSite.js index 75cef05..68f08c5 100644 --- a/src/commands/publishSite.js +++ b/src/commands/publishSite.js @@ -2,10 +2,14 @@ const fs = require('fs') const path = require('path') const tar = require('tar') const axios = require('axios') -const globby = require('globby') const chalk = require('chalk') const config = require('../config/config') +async function loadGlobby () { + const globbyModule = await import('globby') + return globbyModule.globby || globbyModule.default || globbyModule +} + async function publishSite (folder) { try { console.log(chalk.blue('Publishing site...')) @@ -16,6 +20,9 @@ async function publishSite (folder) { return } + // Load globby dynamically + const globby = await loadGlobby() + // Create a tarball of the folder const tarballPath = path.join(process.cwd(), 'site.tar') await tar.c( From d7ba597ec076c3fa730f220c06e78812b2fff71c Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 9 Nov 2024 17:54:14 -0800 Subject: [PATCH 24/47] fix(registerPublisher): correct request body to match API expectations --- src/commands/registerPublisher.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/commands/registerPublisher.js b/src/commands/registerPublisher.js index 2116f36..19f1ec1 100644 --- a/src/commands/registerPublisher.js +++ b/src/commands/registerPublisher.js @@ -11,15 +11,8 @@ async function registerPublisher () { { type: 'input', name: 'name', - message: 'Enter your name or publisher name:', + message: 'Enter your email:', validate: (input) => (input ? true : 'Name cannot be empty.') - }, - { - type: 'input', - name: 'email', - message: 'Enter your email address:', - validate: (input) => - /\S+@\S+\.\S+/.test(input) ? true : 'Please enter a valid email address.' } ]) @@ -27,11 +20,11 @@ async function registerPublisher () { const response = await axios.post(`${config.dpApiUrl}/publisher/trial`, { name: answers.name, - email: answers.email, limited: true }) - const authToken = response.data.authToken + // The response is likely a JSON string containing the authToken + const authToken = response.data // Save authToken to config config.authToken = authToken @@ -43,7 +36,7 @@ async function registerPublisher () { console.log(chalk.green('Trial account registered successfully!')) console.log(chalk.green('Authentication token saved to configuration.')) } catch (error) { - console.error(chalk.red('Error registering trial account:', error.message)) + console.error(chalk.red('Error registering trial account:'), error.response ? error.response.data : error.message) } } From 996def599507ee77ab39a3cff29e32848fb2ebd5 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Wed, 13 Nov 2024 17:56:00 -0800 Subject: [PATCH 25/47] fix: remove unnecessary fields from .dprc file --- src/commands/generateKeypair.js | 8 ++++---- src/commands/registerPublisher.js | 15 ++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/commands/generateKeypair.js b/src/commands/generateKeypair.js index b0aebe0..13f2ac4 100644 --- a/src/commands/generateKeypair.js +++ b/src/commands/generateKeypair.js @@ -25,11 +25,11 @@ function generateKeypairCommand () { } // Create a new config object excluding unwanted properties - const { _, ...cleanConfig } = config + const { _, configs, config: configPath, ...cleanConfig } = config - // Optionally, write to .dprc file - const configPath = path.join(process.cwd(), '.dprc') - fs.writeFileSync(configPath, JSON.stringify(cleanConfig, null, 2)) + // Write the cleaned config to the .dprc file + const configFilePath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configFilePath, JSON.stringify(cleanConfig, null, 2)) console.log(chalk.green('Keypair generated and saved to configuration.')) } catch (error) { diff --git a/src/commands/registerPublisher.js b/src/commands/registerPublisher.js index 19f1ec1..0274b14 100644 --- a/src/commands/registerPublisher.js +++ b/src/commands/registerPublisher.js @@ -11,7 +11,7 @@ async function registerPublisher () { { type: 'input', name: 'name', - message: 'Enter your email:', + message: 'Enter your name or publisher name:', validate: (input) => (input ? true : 'Name cannot be empty.') } ]) @@ -23,20 +23,25 @@ async function registerPublisher () { limited: true }) - // The response is likely a JSON string containing the authToken const authToken = response.data // Save authToken to config config.authToken = authToken + // Create a cleaned config object excluding unwanted properties + const { _, configs, config: configPath, ...cleanConfig } = config + // Write updated config to .dprc - const configPath = path.join(process.cwd(), '.dprc') - fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + const configFilePath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configFilePath, JSON.stringify(cleanConfig, null, 2)) console.log(chalk.green('Trial account registered successfully!')) console.log(chalk.green('Authentication token saved to configuration.')) } catch (error) { - console.error(chalk.red('Error registering trial account:'), error.response ? error.response.data : error.message) + console.error( + chalk.red('Error registering trial account:'), + error.response ? error.response.data : error.message + ) } } From 833c7c8e8b196e7f3dd0e03ad3f3b14bc4e52c29 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 14 Nov 2024 00:37:29 -0800 Subject: [PATCH 26/47] fix: correct domain usage, request format, and handle DP API responses --- .DS_Store | Bin 0 -> 6148 bytes src/api/dpApi.js | 13 ++++- src/commands/createSite.js | 45 +++++++++++----- src/commands/publishSite.js | 104 ++++++++++++++++++++++++++++++++---- 4 files changed, 138 insertions(+), 24 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f0662d126ced0a3639a98959d289d145add6ac8c GIT binary patch literal 6148 zcmeHKO^ee&7=EU$Hg#91;KF(k0$yuvRTdX7-EMnWP!Ai?gGz0hvc}D3O4HIqDfF(t z!N1_yKjMG!q|ba5OxC@LNSPOAo_FSbpUKPF7;+RQGGt2)=gcYK6!_m2P~UDDA!4K_N$&eSVx;*~n_ff}&v1fc^zi}#`i1PT zh3s9VkccqG02kVuBVjAc^Tgc(?-nK)VuW+nXUxA(melPgJ|d%En5Xzu7-6?C!d1K< z1zruOT-yb%)b8s`XOJB;5GJ@Kros4C=R!WjY(i>3FIMaWrPi+t+a# z$wgPr(bg)|0yuEu5o}LcQlZ#X; zDQSY6xwe}YH}HAmINSyW>}&RRwqY@D4Nd{4z+Y8B?GHYS!j8qYLA`ab(pLath27fd z>z{w3uR4ewi)(}Ip$S7J8mh2Y3}NpM!q6G-*!;CYLx<2$<~a7r!roAXy?O{=r$clM zy4oq=6v!)3HqE*^|NB?p|MMi*atb&Fwn_m}=>@$mmt@b@ON&!ytWHpm{D`w`GGxXLN;PZjtD8DpS| literal 0 HcmV?d00001 diff --git a/src/api/dpApi.js b/src/api/dpApi.js index 0bb0661..25bbb68 100644 --- a/src/api/dpApi.js +++ b/src/api/dpApi.js @@ -18,10 +18,15 @@ async function createSite (domain, isPublic = true, protocols = { http: true, hy public: isPublic, protocols } + console.log(chalk.blue('Sending payload to DP API:'), payload) const response = await dpApiClient.post('/sites', payload) return response } catch (error) { - console.error(chalk.red('DP API Error:', error.response ? error.response.data : error.message)) + if (error.response) { + console.error(chalk.red('DP API Error:'), error.response.status, error.response.statusText, error.response.data || '') + } else { + console.error(chalk.red('DP API Error:'), error.message) + } throw error } } @@ -32,7 +37,11 @@ async function getSites () { const response = await dpApiClient.get('/sites') return response } catch (error) { - console.error(chalk.red('DP API Error:', error.response ? error.response.data : error.message)) + if (error.response) { + console.error(chalk.red('DP API Error:'), error.response.status, error.response.statusText, error.response.data || '') + } else { + console.error(chalk.red('DP API Error:'), error.message) + } throw error } } diff --git a/src/commands/createSite.js b/src/commands/createSite.js index 4d02a25..a2e7d94 100644 --- a/src/commands/createSite.js +++ b/src/commands/createSite.js @@ -1,34 +1,55 @@ const inquirer = require('inquirer') -const dpApi = require('../api/dpApi') const chalk = require('chalk') +const axios = require('axios') +const config = require('../config/config') +const fs = require('fs') +const path = require('path') async function createSite () { try { console.log(chalk.blue('Creating a new site on Distributed Press...')) - // Prompt user for site details const answers = await inquirer.prompt([ { type: 'input', - name: 'siteName', - message: 'Enter your site name:', - validate: (input) => input ? true : 'Site name cannot be empty.' + name: 'domain', + message: 'Enter your site domain (e.g., example.com):', + validate: (input) => (input ? true : 'Domain cannot be empty.') }, { - type: 'input', - name: 'siteUrl', - message: 'Enter your site URL:', - validate: (input) => /^https?:\/\/.+/.test(input) ? true : 'Please enter a valid URL.' + type: 'confirm', + name: 'isPublic', + message: 'Is your site public?', + default: true } ]) - const response = await dpApi.createSite(answers.siteName, answers.siteUrl) + // According to the DP API: domain is a string, public is boolean + // The user input: domain, isPublic + const payload = { + domain: answers.domain, + public: answers.isPublic, + protocols: { http: true, hyper: true, ipfs: true } // default protocols + } + + console.log(chalk.blue(`Sending payload to DP API: ${JSON.stringify(payload, null, 2)}`)) + + const response = await axios.post(`${config.dpApiUrl}/sites`, payload, { + headers: { + Authorization: `Bearer ${config.authToken}`, + 'Content-Type': 'application/json' + } + }) console.log(chalk.green('Site created successfully!')) console.log(`Site ID: ${response.data.id}`) - console.log(`Site URL: ${response.data.url}`) + console.log(`Site Info: ${JSON.stringify(response.data, null, 2)}`) } catch (error) { - console.error(chalk.red('Error creating site:'), error.message) + if (error.response && error.response.data) { + console.error(chalk.red('DP API Error:'), JSON.stringify(error.response.data, null, 2)) + } else { + console.error(chalk.red('Error creating site:'), error.message) + } } } diff --git a/src/commands/publishSite.js b/src/commands/publishSite.js index 68f08c5..03fce5f 100644 --- a/src/commands/publishSite.js +++ b/src/commands/publishSite.js @@ -4,6 +4,8 @@ const tar = require('tar') const axios = require('axios') const chalk = require('chalk') const config = require('../config/config') +const inquirer = require('inquirer') +const FormData = require('form-data') async function loadGlobby () { const globbyModule = await import('globby') @@ -20,11 +22,30 @@ async function publishSite (folder) { return } + // Check if we have a domain in config or prompt for one + let domain = config.domain + if (!domain) { + const answers = await inquirer.prompt([ + { + type: 'input', + name: 'domain', + message: 'Enter your site domain (e.g., example.com):', + validate: (input) => (input ? true : 'Domain cannot be empty.') + } + ]) + domain = answers.domain + config.domain = domain + // Save domain to the `.dprc` file + const { _, configs, config: configPath, ...cleanConfig } = config + const configFilePath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configFilePath, JSON.stringify(cleanConfig, null, 2)) + } + // Load globby dynamically const globby = await loadGlobby() // Create a tarball of the folder - const tarballPath = path.join(process.cwd(), 'site.tar') + const tarballPath = path.join(process.cwd(), 'site.tar.gz') await tar.c( { gzip: true, @@ -34,25 +55,88 @@ async function publishSite (folder) { await globby(['**/*'], { cwd: folder }) ) - // Read the tarball - const tarballData = fs.createReadStream(tarballPath) + // Check if a site with this domain already exists + // If a site doesn't exist, we need to create one first. + let siteResponse + try { + siteResponse = await axios.get(`${config.dpApiUrl}/sites/${domain}`, { + headers: { + Authorization: `Bearer ${config.authToken}` + } + }) + } catch (error) { + if (error.response && error.response.status === 404) { + // site does not exist, create it + console.log(chalk.yellow(`Site with domain '${domain}' not found, creating a new site...`)) + const createSiteResponse = await axios.post(`${config.dpApiUrl}/sites`, { + domain, + public: true, + protocols: { http: true, hyper: true, ipfs: true } + }, { + headers: { + Authorization: `Bearer ${config.authToken}`, + 'Content-Type': 'application/json' + } + }) + siteResponse = createSiteResponse + } else { + throw error // rethrow any other error + } + } + + if (!siteResponse || !siteResponse.data) { + console.error(chalk.red('Unable to find or create site for the specified domain.')) + return + } - // Send the tarball to the API - const response = await axios.post(`${config.dpApiUrl}/sites`, tarballData, { + // Prepare multipart/form-data with the tarball + const form = new FormData() + form.append('file', fs.createReadStream(tarballPath), { + filename: 'site.tar.gz', + contentType: 'application/gzip' + }) + + // The server expects a PUT with multipart/form-data to /v1/sites/:id to upload site content + const siteId = siteResponse.data.id || domain // The site ID or domain + const publishUrl = `${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}` + const response = await axios.put(publishUrl, form, { headers: { - 'Content-Type': 'application/gzip', + ...form.getHeaders(), Authorization: `Bearer ${config.authToken}` } }) - console.log(chalk.green('Site published successfully!')) - console.log(`Site ID: ${response.data.id}`) - console.log(`Links: ${JSON.stringify(response.data.links, null, 2)}`) + // The server might return an empty response on success, so we attempt a new GET request to get updated site info: + if (!response.data) { + console.log(chalk.blue('Attempting to fetch updated site info...')) + const updatedSiteInfoResponse = await axios.get(`${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}`, { + headers: { + Authorization: `Bearer ${config.authToken}` + } + }) + console.log(chalk.green('Site published successfully!')) + console.log(`Site ID: ${updatedSiteInfoResponse.data.id}`) + console.log(`Links: ${JSON.stringify(updatedSiteInfoResponse.data.links, null, 2)}`) + } else { + console.log(chalk.green('Site published successfully!')) + console.log(`Response: ${JSON.stringify(response.data, null, 2)}`) + // If the response contains these fields, print them. Otherwise ignore + if (response.data.id) { + console.log(`Site ID: ${response.data.id}`) + } + if (response.data.links) { + console.log(`Links: ${JSON.stringify(response.data.links, null, 2)}`) + } + } // Clean up the tarball fs.unlinkSync(tarballPath) } catch (error) { - console.error(chalk.red('Error publishing site:', error.message)) + if (error.response && error.response.data) { + console.error(chalk.red('Error publishing site:'), JSON.stringify(error.response.data)) + } else { + console.error(chalk.red('Error publishing site:'), error.message) + } } } From f3819f0aaf8ec3b68bfc8c5a9ee6bd217e568af3 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 14 Nov 2024 00:45:40 -0800 Subject: [PATCH 27/47] chore: update prompt label for improved clarity --- src/commands/registerPublisher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/registerPublisher.js b/src/commands/registerPublisher.js index 0274b14..fa0031a 100644 --- a/src/commands/registerPublisher.js +++ b/src/commands/registerPublisher.js @@ -11,8 +11,8 @@ async function registerPublisher () { { type: 'input', name: 'name', - message: 'Enter your name or publisher name:', - validate: (input) => (input ? true : 'Name cannot be empty.') + message: 'Enter your email:', + validate: (input) => (input ? true : 'Email cannot be empty.') } ]) From 0ecf8bbbcc06be908beaa346b99819b5bbf38d53 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 14 Nov 2024 14:32:46 -0800 Subject: [PATCH 28/47] docs: update README for new workflow and add DNS setup instructions --- .DS_Store | Bin 6148 -> 0 bytes README.md | 276 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 156 insertions(+), 120 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f0662d126ced0a3639a98959d289d145add6ac8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO^ee&7=EU$Hg#91;KF(k0$yuvRTdX7-EMnWP!Ai?gGz0hvc}D3O4HIqDfF(t z!N1_yKjMG!q|ba5OxC@LNSPOAo_FSbpUKPF7;+RQGGt2)=gcYK6!_m2P~UDDA!4K_N$&eSVx;*~n_ff}&v1fc^zi}#`i1PT zh3s9VkccqG02kVuBVjAc^Tgc(?-nK)VuW+nXUxA(melPgJ|d%En5Xzu7-6?C!d1K< z1zruOT-yb%)b8s`XOJB;5GJ@Kros4C=R!WjY(i>3FIMaWrPi+t+a# z$wgPr(bg)|0yuEu5o}LcQlZ#X; zDQSY6xwe}YH}HAmINSyW>}&RRwqY@D4Nd{4z+Y8B?GHYS!j8qYLA`ab(pLath27fd z>z{w3uR4ewi)(}Ip$S7J8mh2Y3}NpM!q6G-*!;CYLx<2$<~a7r!roAXy?O{=r$clM zy4oq=6v!)3HqE*^|NB?p|MMi*atb&Fwn_m}=>@$mmt@b@ON&!ytWHpm{D`w`GGxXLN;PZjtD8DpS| diff --git a/README.md b/README.md index d012aae..11953db 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,19 @@ A **Command Line Interface (CLI)** for interacting with the Distributed Press AP - [Installation](#installation) - [Node.js and npm Setup](#nodejs-and-npm-setup) -- [Setup](#setup) - - [Generate a Keypair](#generate-a-keypair) +- [Distributed Press Setup](#distributed-press-setup) + - [Register as Publisher (Trial Account)](#register-as-publisher-trial-account) - [Set Your Authentication Token](#set-your-authentication-token) + - [Create Your Site](#create-your-site) + - [Publish Your Site](#publish-your-site) + - [DNS Setup](#dns-setup) + - [Clone an Existing Site](#clone-an-existing-site) +- [Social Inbox Setup](#social-inbox-setup-send-posts-to-fediverse) + - [Generate a Keypair](#generate-a-keypair) - [Register Your Actor](#register-your-actor) -- [Configuration](#configuration) -- [Usage](#usage) - [Send a Post to Followers](#send-a-post-to-followers) +- [Configuration](#configuration) - [Commands](#commands) - - [`generate-keypair`](#generate-keypair) - - [`set-auth-token`](#set-auth-token) - - [`register-actor`](#register-actor) - - [`send-post`](#send-post) -- [Examples](#examples) - [License](#license) - [Resources](#resources) @@ -54,64 +54,123 @@ npm install -g dp-cli Once installed, you can use `dp-cli` from anywhere in your terminal. -## Setup +## Distributed Press Setup -Before using the CLI, you need to generate a keypair, set your authentication token, and register your ActivityPub actor. +### Register as Publisher (Trial Account) -### Generate a Keypair +Register a trial publisher account on Distributed Press using your email: -Run the following command to generate a new RSA keypair: +```bash +dp-cli register +``` + +You will be prompted for your name and email. Note: currently, only one site per email is allowed. + +### OR Set Your Authentication Token Manually + +Obtain your `authToken` from your Distributed Press API administrator and set it using: ```bash -dp-cli generate-keypair +dp-cli set-auth-token ``` -**Purpose:** -This keypair is used for authenticating your interactions with the Social Inbox, ensuring secure communication and verifying your identity. +You will be prompted to enter your authentication token. -**Note:** -If you only plan to use the DP API for static file publishing, generating a keypair might not be necessary. However, it's recommended for enhanced security and functionality when interacting with the Social Inbox. +### Create Your Site -This will generate a keypair and save it to your `.dprc` configuration file. +Once registered, create a new site by specifying the domain name and whether it should be public: -### Register as Publisher (Trial Account) +```bash +dp-cli create-site +``` -Register a trial publisher account on Distributed Press using your email: +### Publish Your Site + +To upload and publish static content to the DP site from a specified directory: ```bash -dp-cli register-publisher +dp-cli publish ./folder_here ``` -You will be prompted for your name and email. Note: currently, only one site per email is allowed. +### DNS Setup -### OR Set Your Authentication Token Manually +To use a custom domain for your Distributed Press site, you'll need to set up a DNS record to point to the Distributed Press infrastructure. -Obtain your `authToken` from your Distributed Press API administrator and set it using: +### CNAME Record + +| Type | Name | Value | +| ----- | ------------- | ------------------------ | +| CNAME | `` | `api.distributed.press.` | + +- Replace `your-site`` with your domain or subdomain name. +- Ensure that the trailing dot `.` is included in `api.distributed.press.` as required. + +### \_dnslink Record + +To make your site accessible through Distributed Press, add the following **DNSLink** entries to your DNS configuration: + +| Type | Name | Value | +| ---- | ---------------------- | ---------------------------------- | +| TXT | `_dnslink.example.com` | `dnslink=/ipns/` | +| TXT | `_dnslink.example.com` | `dnslink=/hyper/` | + +### Example + +If your site links include: + +```json +"ipfs": { + "dnslink": "/ipns/k51qzi5uqu5djj6yo1nne5r2oomxgroy3tezhgupvx0v2jlbighfah1k028sc1/" +}, +"hyper": { + "dnslink": "/hyper/t685fd3snbadhqkss8spcgz454p95ap77kdfjafotsxfhhrhuqio/" +} +``` + +You would configure your DNS records as follows: + +| Type | Name | Value | +| ---- | ---------------------- | ------------------------------------------------------------------------------- | +| TXT | `_dnslink.example.com` | `dnslink=/ipns/k51qzi5uqu5djj6yo1nne5r2oomxgroy3tezhgupvx0v2jlbighfah1k028sc1/` | +| TXT | `_dnslink.example.com` | `dnslink=/hyper/t685fd3snbadhqkss8spcgz454p95ap77kdfjafotsxfhhrhuqio/` | + +After DNS propagation, users will be able to access the site at `example.com` over IPFS and Hyper. + +## Clone an Existing Site + +Clone a website by creating a static copy from its HTTP URL: ```bash -dp-cli set-auth-token +dp-cli clone-site --id ``` -You will be prompted to enter your authentication token. +## Social Inbox Setup (Send Posts to Fediverse) -### Register Your Actor +For using the Social Inbox, you need to generate a keypair and register your ActivityPub actor. -Register your ActivityPub actor with the Social Inbox: +### Generate a Keypair + +Run the following command to generate a new RSA keypair: ```bash -dp-cli register-actor +dp-cli generate-keypair ``` -**Prompts:** +**Purpose:** +This keypair is used for authenticating your interactions with the Social Inbox, ensuring secure communication and verifying your identity. -1. **Enter your actor username:** - _(e.g., "@username@yourdomain.com")_ +**Note:** +If you only plan to use the DP API for static file publishing, generating a keypair might not be necessary. However, it's recommended for enhanced security and functionality when interacting with the Social Inbox. -2. **Enter your actor URL:** - _(e.g., "https://yourdomain.com/actor")_ +This will generate a keypair and save it to your `.dprc` configuration file. -3. **Enter your public key ID:** - _(e.g., "https://yourdomain.com/actor#main-key")_ +### Register Your Actor + +Register your ActivityPub actor with the Social Inbox: + +```bash +dp-cli register-actor +``` This will register your actor with the Social Inbox and save the details to your configuration. @@ -119,7 +178,15 @@ This will register your actor with the Social Inbox and save the details to your The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, keypairs, and actor information. The configuration file follows the format expected by the [`rc` module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. -### Configuration File Structure +### Send a Post to Followers + +Publish a post to your followers: + +```bash +dp-cli send-post --message "Hello, Fediverse!" +``` + +### Configuration Your `.dprc` file should look like this: @@ -132,6 +199,7 @@ Your `.dprc` file should look like this: "publicKeyPem": "", "privateKeyPem": "" }, + "domain": "", "actorUsername": "", "actorUrl": "", "publicKeyId": "" @@ -142,51 +210,25 @@ Your `.dprc` file should look like this: - **`socialInboxUrl`:** The base URL for the Social Inbox. - **`authToken`:** Your authentication token for API access. - **`keypair`:** Your public and private keys for secure interactions. +- **`domain`:** Your custom domain for the site, e.g., example.com. - **`actorUsername`:** Your ActivityPub actor username. - **`actorUrl`:** The URL of your actor. - **`publicKeyId`:** The ID of your public key. _Ensure that your `.dprc` file is **not** committed to version control to keep your credentials secure._ -## Usage - -Once installed and configured, you can use the `dp-cli` command followed by specific commands to interact with the APIs. - -### Send a Post to Followers - -Publish a post to your followers: - -```bash -dp-cli send-post --message "Hello, Fediverse!" -``` - -**Output:** - -``` -Sending a post to followers... -Post sent successfully! -Response: { ... } -``` - ## Commands -### `generate-keypair` - -**Description:** -Generate a new RSA keypair and save it to your configuration. - -**Usage:** - -```bash -dp-cli generate-keypair -``` +### `register` -### `register-publisher` +**Description:** Register a trial publisher account with Distributed Press: +**Usage:** + ```bash -dp-cli register-publisher +dp-cli register ``` ### `set-auth-token` @@ -204,102 +246,96 @@ dp-cli set-auth-token - Enter your authentication token. -### `register-actor` +### `create-site` -**Description:** -Register your ActivityPub actor with the Social Inbox. +**Description:** + +Create a new site by specifying the domain name and whether it should be public **Usage:** ```bash -dp-cli register-actor +dp-cli create-site ``` -**Prompts:** - -- Enter your actor username. -- Enter your actor URL. -- Enter your public key ID. - -### `send-post` - -Send an activity post to your followers and publish it on the DP site: +**Prompt:** -```bash -dp-cli send-post --path ./path_to_activity.json -``` +- **Enter your site domain**: e.g., `example.com` +- **Is your site public?** _(Yes/No)_ ### `publish-site` +**Description:** + Upload and publish static content to the DP site from a specified directory: +**Usage:** + ```bash dp-cli publish ./folder_here ``` ### `clone-site` +**Description:** + Clone a website by creating a static copy from its HTTP URL: +**Usage:** + ```bash dp-cli clone-site --id ``` -## Examples - -### Example: Full Workflow - -```bash -# Register as a publisher -dp-cli register-publisher -``` +### `generate-keypair` -_Prompts:_ +**Description:** +Generate a new RSA keypair and save it to your configuration. -``` -Enter your name: Alice -Enter your email: alice@example.com -``` +**Usage:** ```bash -# Generate a keypair dp-cli generate-keypair ``` -```bash -# Set your authentication token -dp-cli set-auth-token -``` +### `register-actor` -_Prompt:_ +**Description:** +Register your ActivityPub actor with the Social Inbox. -``` -Enter your authentication token: -``` +**Usage:** ```bash -# Register your actor dp-cli register-actor ``` -_Prompts:_ +**Prompts:** -``` -Enter your actor username: @alice@yourdomain.com -Enter your actor URL: https://yourdomain.com/alice -Enter your public key ID: https://yourdomain.com/alice#main-key -``` +1. **Enter your actor username:** + _(e.g., "@username@yourdomain.com")_ -```bash -# Publish site content from a folder -dp-cli publish ./folder_here -``` +2. **Enter your actor URL:** + _(e.g., "https://yourdomain.com/actor")_ + +3. **Enter your public key ID:** + _(e.g., "https://yourdomain.com/actor#main-key")_ + +### `send-post` + +Send an activity post to your followers and publish it on the DP site: ```bash -# Send a post to followers with activity JSON dp-cli send-post --path ./path_to_activity.json ``` +**Output:** + +``` +Sending a post to followers... +Post sent successfully! +Response: { ... } +``` + ## License This project is licensed under the [MIT License](LICENSE). From 8636a7e552929570116ec1c58e357c3360ff1865 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 14 Nov 2024 23:06:48 -0800 Subject: [PATCH 29/47] fix: improve error handling for SSL certificate mismatch during site cloning --- src/commands/cloneSite.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/commands/cloneSite.js b/src/commands/cloneSite.js index 156e08f..08ddfa7 100644 --- a/src/commands/cloneSite.js +++ b/src/commands/cloneSite.js @@ -6,20 +6,30 @@ async function cloneSite (siteId) { try { console.log(chalk.blue(`Cloning site with ID: ${siteId}`)) - const response = await axios.post( - `${config.dpApiUrl}/sites/${siteId}/clone`, - {}, - { - headers: { - Authorization: `Bearer ${config.authToken}` - } + const cloneUrl = `${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}/clone` + + const response = await axios.post(cloneUrl, null, { + headers: { + Authorization: `Bearer ${config.authToken}`, + 'Content-Type': 'application/json' } - ) + }) console.log(chalk.green('Site cloned successfully!')) console.log(`Cloned Site Info: ${JSON.stringify(response.data, null, 2)}`) } catch (error) { - console.error(chalk.red('Error cloning site:', error.message)) + if (error.response) { + console.error(chalk.red('Error cloning site:'), `Status: ${error.response.status}, Message: ${error.response.statusText}`) + if (error.response.data) { + console.error(chalk.red('Response Data:'), JSON.stringify(error.response.data, null, 2)) + } + + if (error.response.status === 500 && error.response.data && error.response.data.message && error.response.data.message.includes('The certificate is NOT trusted')) { + console.error(chalk.yellow('Hint:'), 'It appears that the server is unable to clone your site due to an SSL certificate trust issue. Please ensure your domain has a valid, trusted SSL certificate that matches your domain name.') + } + } else { + console.error(chalk.red('Error cloning site:'), error.message) + } } } From cee5d26003401fb520db45aebe3822658db12ba8 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 14 Nov 2024 23:08:17 -0800 Subject: [PATCH 30/47] docs: update clone site command --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 11953db..047c4da 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ After DNS propagation, users will be able to access the site at `example.com` ov Clone a website by creating a static copy from its HTTP URL: ```bash -dp-cli clone-site --id +dp-cli clone ``` ## Social Inbox Setup (Send Posts to Fediverse) @@ -275,7 +275,7 @@ Upload and publish static content to the DP site from a specified directory: dp-cli publish ./folder_here ``` -### `clone-site` +### `clone` **Description:** @@ -284,7 +284,7 @@ Clone a website by creating a static copy from its HTTP URL: **Usage:** ```bash -dp-cli clone-site --id +dp-cli clone ``` ### `generate-keypair` From adcb198a3a25bd7fac43e251e48cd524e7002356 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 01:21:58 -0800 Subject: [PATCH 31/47] docs: improve readability with instructions --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 047c4da..79bbdd4 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,10 @@ dp-cli publish ./folder_here To use a custom domain for your Distributed Press site, you'll need to set up a DNS record to point to the Distributed Press infrastructure. +#### Using Distributed Press Infrastructure +- If you wish to use the official Distributed Press instance for your HTTPS traffic, [contact](mailto:hello@distributed.press) the Distributed Press team. +- Alternatively, refer to the [documentation for self-hosting](https://docs.distributed.press/self-hosting/) for guidance on running your own infrastructure. + ### CNAME Record | Type | Name | Value | @@ -157,7 +161,7 @@ dp-cli generate-keypair ``` **Purpose:** -This keypair is used for authenticating your interactions with the Social Inbox, ensuring secure communication and verifying your identity. +This keypair is used for authenticating your interactions with the Social Inbox and the fediverse at large, ensuring secure communication and verifying your identity. **Note:** If you only plan to use the DP API for static file publishing, generating a keypair might not be necessary. However, it's recommended for enhanced security and functionality when interacting with the Social Inbox. From 4468c14a968a1dcd03940fda57e03306674cd6c2 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 01:30:44 -0800 Subject: [PATCH 32/47] docs: update DNS setup with NS record and HTTPS certificate guidance --- README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 79bbdd4..2e707c8 100644 --- a/README.md +++ b/README.md @@ -109,14 +109,16 @@ To use a custom domain for your Distributed Press site, you'll need to set up a - Replace `your-site`` with your domain or subdomain name. - Ensure that the trailing dot `.` is included in `api.distributed.press.` as required. -### \_dnslink Record +### _dnslink Record -To make your site accessible through Distributed Press, add the following **DNSLink** entries to your DNS configuration: +To make your site accessible through Distributed Press, set an `NS Record` to delegate DNSLink lookups to Distributed Press. | Type | Name | Value | | ---- | ---------------------- | ---------------------------------- | -| TXT | `_dnslink.example.com` | `dnslink=/ipns/` | -| TXT | `_dnslink.example.com` | `dnslink=/hyper/` | +| NS | `_dnslink` | `api.distributed.press.` | + +- This eliminates the need to manually set TXT records. +- [contact](mailto:hello@distributed.press) the Distributed Press team for assistance if needed. ### Example @@ -131,14 +133,14 @@ If your site links include: } ``` -You would configure your DNS records as follows: - -| Type | Name | Value | -| ---- | ---------------------- | ------------------------------------------------------------------------------- | -| TXT | `_dnslink.example.com` | `dnslink=/ipns/k51qzi5uqu5djj6yo1nne5r2oomxgroy3tezhgupvx0v2jlbighfah1k028sc1/` | -| TXT | `_dnslink.example.com` | `dnslink=/hyper/t685fd3snbadhqkss8spcgz454p95ap77kdfjafotsxfhhrhuqio/` | +You only need to configure the `NS Record` as shown above. DNSLink propagation will handle IPFS and Hyper links automatically. After DNS propagation, users will be able to access the site at `example.com` over IPFS and Hyper. +- ipns://example.com +- hyper://example.com + +### SSL Requirements +To use your custom domain, ensure that your domain has a valid HTTPS certificate. Most DNS providers offer free certificate generation via [Let's Encrypt](https://letsencrypt.org/) or similar services. ## Clone an Existing Site From 6c8e309a9f75b694703e9b27b8d29e735fe0ca47 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 01:42:40 -0800 Subject: [PATCH 33/47] chore: add lint step with standard --fix and GitHub Action --- .github/workflows/lint.yml | 28 + package-lock.json | 3614 +++++++++++++++++++++++++++++++++--- package.json | 6 +- 3 files changed, 3430 insertions(+), 218 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..0fce42d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: Lint + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install dependencies + run: npm install + + - name: Run lint + run: npm run lint diff --git a/package-lock.json b/package-lock.json index a08aa34..465621f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,9 @@ }, "bin": { "dp-cli": "bin/dp-cli.js" + }, + "devDependencies": { + "standard": "^17.1.2" } }, "node_modules/@digitalbazaar/http-digest-header": { @@ -35,6 +38,156 @@ "node": ">=14" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -176,6 +329,12 @@ "node": ">=14" } }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true + }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", @@ -187,11 +346,60 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/activitypub-http-signatures": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/activitypub-http-signatures/-/activitypub-http-signatures-2.5.0.tgz", "integrity": "sha512-FHNWFZtYwT34qYHcMp60noHSIDh/a86F3POfTz4fn9zyrZdZWGgOYeYEv27gfSrIcvNV1iDrq3XRyaXo+QUmdA==" }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -228,11 +436,182 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/axios": { "version": "1.7.7", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", @@ -338,6 +717,55 @@ "ieee754": "^1.1.13" } }, + "node_modules/builtins": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", + "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/builtins/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -439,6 +867,12 @@ "node": ">=18" } }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", @@ -452,6 +886,74 @@ "node": ">= 8" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -460,6 +962,12 @@ "node": ">=4.0.0" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", @@ -471,6 +979,40 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -479,6 +1021,18 @@ "node": ">=0.4.0" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -489,235 +1043,1393 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" } }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "node_modules/es-abstract": { + "version": "1.23.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.5.tgz", + "integrity": "sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==", + "dev": true, "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "get-intrinsic": "^1.2.4" }, "engines": { - "node": ">=8.6.0" + "node": ">= 0.4" } }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.0.tgz", + "integrity": "sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q==", + "dev": true, "dependencies": { - "reusify": "^1.0.4" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "iterator.prototype": "^1.1.3", + "safe-array-concat": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "es-errors": "^1.3.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" }, "engines": { - "node": ">=8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "node_modules/eslint-config-standard": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz", + "integrity": "sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==", + "dev": true, "funding": [ { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } ], "engines": { - "node": ">=4.0" + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", + "eslint-plugin-promise": "^6.0.0" + } + }, + "node_modules/eslint-config-standard-jsx": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-11.0.0.tgz", + "integrity": "sha512-+1EV/R0JxEK1L0NGolAr8Iktm3Rgotx3BKwgaX+eAuSX8D952LULKtjgZD3F+e6SvibONnhLwoTi9DPxN5LvvQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peerDependencies": { + "eslint": "^8.8.0", + "eslint-plugin-react": "^7.28.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" }, "peerDependenciesMeta": { - "debug": { + "eslint": { "optional": true } } }, - "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-es": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "dev": true, + "dependencies": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" }, "engines": { - "node": ">=14" + "node": ">=8.10.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" } }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "node_modules/eslint-plugin-es/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, "engines": { - "node": ">=14" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "dev": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", + "tsconfig-paths": "^3.15.0" }, "engines": { - "node": ">= 6" + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, - "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" }, - "bin": { - "glob": "dist/esm/bin.mjs" + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": "*" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/eslint-plugin-n": { + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", + "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", + "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.11.0", + "minimatch": "^3.1.2", + "resolve": "^1.22.1", + "semver": "^7.3.8" }, "engines": { - "node": ">= 6" + "node": ">=12.22.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" } }, - "node_modules/globby": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", - "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "node_modules/eslint-plugin-n/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { - "@sindresorhus/merge-streams": "^2.1.0", - "fast-glob": "^3.3.2", - "ignore": "^5.2.4", - "path-type": "^5.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.1.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-n/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=18" + "node": "*" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-promise": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.6.0.tgz", + "integrity": "sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/eslint-plugin-react": { + "version": "7.37.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz", + "integrity": "sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.1.0", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.0", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.11", + "string.prototype.repeat": "^1.0.0" + }, "engines": { - "node": ">=8" + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" } }, - "node_modules/http-signed-fetch": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/http-signed-fetch/-/http-signed-fetch-1.0.1.tgz", - "integrity": "sha512-HSF8LDKJyjXSw//2fT2fcaOaiF28L5VbP92tHMlSpwkwnbfjcXJAZUU7d9NqaHD9FArF/NWgZQci2kdznFfSBA==", + "node_modules/eslint-plugin-react/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { - "@digitalbazaar/http-digest-header": "^2.0.0", - "activitypub-http-signatures": "^2.0.1" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "esutils": "^2.0.2" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "node_modules/eslint-plugin-react/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">= 4" + "node": "*" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "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==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/flat-cache/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flat-cache/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stdin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", + "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-signed-fetch": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/http-signed-fetch/-/http-signed-fetch-1.0.1.tgz", + "integrity": "sha512-HSF8LDKJyjXSw//2fT2fcaOaiF28L5VbP92tHMlSpwkwnbfjcXJAZUU7d9NqaHD9FArF/NWgZQci2kdznFfSBA==", + "dependencies": { + "@digitalbazaar/http-digest-header": "^2.0.0", + "activitypub-http-signatures": "^2.0.1" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" } }, "node_modules/inherits": { @@ -725,34 +2437,170 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/inquirer": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", - "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^6.0.1" + "hasown": "^2.0.2" }, "engines": { - "node": ">=12.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-extglob": { @@ -763,6 +2611,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -771,6 +2631,21 @@ "node": ">=8" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -779,29 +2654,382 @@ "is-extglob": "^2.1.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", + "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/iterator.prototype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.3.tgz", + "integrity": "sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-base64": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "node_modules/load-json-file": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.15", + "parse-json": "^4.0.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.0" + }, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/load-json-file/node_modules/type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true, "engines": { - "node": ">=0.12.0" + "node": ">=6" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, "engines": { "node": ">=10" }, @@ -809,35 +3037,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/js-base64": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", - "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" - }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -853,6 +3063,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -961,11 +3183,143 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -980,6 +3334,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -1010,11 +3381,93 @@ "node": ">=0.10.0" } }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -1023,6 +3476,12 @@ "node": ">=8" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", @@ -1060,11 +3519,132 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-conf": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", + "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0", + "load-json-file": "^5.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-conf/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-conf/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-conf/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-conf/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-conf/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1094,21 +3674,104 @@ "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, - "bin": { - "rc": "cli.js" + "bin": { + "rc": "cli.js" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", + "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", + "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, "engines": { - "node": ">= 6" + "node": ">=4" } }, "node_modules/restore-cursor": { @@ -1184,6 +3847,24 @@ "tslib": "^2.1.0" } }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1203,11 +3884,69 @@ } ] }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1227,6 +3966,24 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -1243,6 +4000,72 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/standard": { + "version": "17.1.2", + "resolved": "https://registry.npmjs.org/standard/-/standard-17.1.2.tgz", + "integrity": "sha512-WLm12WoXveKkvnPnPnaFUUHuOB2cUdAsJ4AiGHL2G0UNMrcRAWY2WriQaV8IQ3oRmYr0AWUbLNr94ekYFAHOrA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "eslint": "^8.41.0", + "eslint-config-standard": "17.1.0", + "eslint-config-standard-jsx": "^11.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.7.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-react": "^7.36.1", + "standard-engine": "^15.1.0", + "version-guard": "^1.1.1" + }, + "bin": { + "standard": "bin/cmd.cjs" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/standard-engine": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-15.1.0.tgz", + "integrity": "sha512-VHysfoyxFu/ukT+9v49d4BRXIokFRZuH3z1VRxzFArZdjSCFpro6rEIU3ji7e4AoAtuSfKBkiOmsrDqKW5ZSRw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "get-stdin": "^8.0.0", + "minimist": "^1.2.6", + "pkg-conf": "^3.1.0", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1278,6 +4101,91 @@ "node": ">=8" } }, + "node_modules/string.prototype.matchall": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", + "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "regexp.prototype.flags": "^1.5.2", + "set-function-name": "^2.0.2", + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1301,6 +4209,15 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -1320,6 +4237,18 @@ "node": ">=8" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/tar": { "version": "7.4.3", "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", @@ -1336,6 +4265,12 @@ "node": ">=18" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -1363,11 +4298,35 @@ "node": ">=8.0" } }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-fest": { "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", @@ -1379,6 +4338,94 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", @@ -1390,6 +4437,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1407,6 +4463,15 @@ "uuid": "dist/esm/bin/uuid" } }, + "node_modules/version-guard": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/version-guard/-/version-guard-1.1.3.tgz", + "integrity": "sha512-JwPr6erhX53EWH/HCSzfy1tTFrtPXUe927wdM1jqBBeYp1OM+qPHjWbsvv6pIBduqdgxxS+ScfG7S28pzyr2DQ==", + "dev": true, + "engines": { + "node": ">=0.10.48" + } + }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -1429,6 +4494,94 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.4.tgz", + "integrity": "sha512-bppkmBSsHFmIMSl8BO9TbsyzsvGjVoppt8xUiGzwiu/bhDCGxnpOKCxgqj6GuyHE0mINMDecBFPlOm2hzY084w==", + "dev": true, + "dependencies": { + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -1459,6 +4612,21 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/yallist": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", @@ -1466,6 +4634,18 @@ "engines": { "node": ">=18" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 412d5b1..cb99910 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dp-cli": "./bin/dp-cli.js" }, "scripts": { - "start": "node ./bin/dp-cli.js" + "start": "node ./bin/dp-cli.js", + "lint": "standard --fix" }, "keywords": [], "author": "distributed.press", @@ -22,5 +23,8 @@ "rc": "^1.2.8", "tar": "^7.4.3", "uuid": "^11.0.2" + }, + "devDependencies": { + "standard": "^17.1.2" } } From c38bb9d05de7fe764b740b4f6702a414bd2afb4c Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 02:02:32 -0800 Subject: [PATCH 34/47] fix: use FormData for patchSite uploads to improve API compatibility --- src/commands/patchSite.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/commands/patchSite.js b/src/commands/patchSite.js index 033f4b2..6cc3011 100644 --- a/src/commands/patchSite.js +++ b/src/commands/patchSite.js @@ -3,6 +3,7 @@ const path = require('path') const tar = require('tar') const axios = require('axios') const chalk = require('chalk') +const FormData = require('form-data') const config = require('../config/config') async function loadGlobby () { @@ -39,13 +40,17 @@ async function patchSite (folder, siteId) { await globby(['**/*'], { cwd: folder }) ) - // Read the tarball - const tarballData = fs.createReadStream(tarballPath) + // Prepare multipart/form-data with the tarball + const form = new FormData() + form.append('file', fs.createReadStream(tarballPath), { + filename: 'site-patch.tar.gz', + contentType: 'application/gzip' + }) // Send the tarball to the API - const response = await axios.patch(`${config.dpApiUrl}/sites/${siteId}`, tarballData, { + const response = await axios.patch(`${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}`, form, { headers: { - 'Content-Type': 'application/gzip', + ...form.getHeaders(), Authorization: `Bearer ${config.authToken}` } }) From 15458d3cbcdcf0d221a99b682c753b3a9a3c241e Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 02:38:01 -0800 Subject: [PATCH 35/47] refactor: remove unused modules (fs, path, chalk) from CLI and commands --- bin/dp-cli.js | 1 - src/commands/createSite.js | 2 -- src/commands/sendPost.js | 1 + 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/dp-cli.js b/bin/dp-cli.js index fa30139..d6ca9a4 100755 --- a/bin/dp-cli.js +++ b/bin/dp-cli.js @@ -1,6 +1,5 @@ #!/usr/bin/env node const { Command } = require('commander') -const chalk = require('chalk') const createSite = require('../src/commands/createSite') const registerActor = require('../src/commands/registerActor') const sendPost = require('../src/commands/sendPost') diff --git a/src/commands/createSite.js b/src/commands/createSite.js index a2e7d94..d7bd1f8 100644 --- a/src/commands/createSite.js +++ b/src/commands/createSite.js @@ -2,8 +2,6 @@ const inquirer = require('inquirer') const chalk = require('chalk') const axios = require('axios') const config = require('../config/config') -const fs = require('fs') -const path = require('path') async function createSite () { try { diff --git a/src/commands/sendPost.js b/src/commands/sendPost.js index f444700..949bea3 100644 --- a/src/commands/sendPost.js +++ b/src/commands/sendPost.js @@ -3,6 +3,7 @@ const path = require('path') const chalk = require('chalk') const config = require('../config/config') const socialInboxApi = require('../api/socialInboxApi') +const { v4: uuidv4 } = require('uuid') // Import uuidv4 async function sendPost (activityPath) { try { From ab523ef5d34ae3e5d278e28085afbaba0eb3c0a3 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 03:29:38 -0800 Subject: [PATCH 36/47] refactor: remove unused signing script --- src/utils/signing.js | 59 -------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/utils/signing.js diff --git a/src/utils/signing.js b/src/utils/signing.js deleted file mode 100644 index 86bcad2..0000000 --- a/src/utils/signing.js +++ /dev/null @@ -1,59 +0,0 @@ -const { createHash, createSign } = require('crypto') -const { URL } = require('url') - -async function generateSignedHeaders (keypair, url, method, body) { - const parsedUrl = new URL(url) - const date = new Date().toUTCString() - const digest = createDigestHeader(body) - - const headersToSign = ['(request-target)', 'host', 'date', 'digest'] - - const signingString = createSigningString(method, parsedUrl, date, digest, headersToSign) - - const signer = createSign('RSA-SHA256') - signer.update(signingString) - signer.end() - - const signature = signer.sign(keypair.privateKeyPem).toString('base64') - - const signatureHeader = `keyId="${keypair.publicKeyId}",algorithm="rsa-sha256",headers="${headersToSign.join( - ' ' - )}",signature="${signature}"` - - const signedHeaders = { - Date: date, - Host: parsedUrl.host, - Digest: digest, - Signature: signatureHeader - } - - return signedHeaders -} - -function createDigestHeader (body) { - const bodyString = typeof body === 'string' ? body : JSON.stringify(body) - const hash = createHash('sha256').update(bodyString).digest('base64') - return `SHA-256=${hash}` -} - -function createSigningString (method, url, date, digest, headers) { - const signingParts = headers.map((header) => { - switch (header.toLowerCase()) { - case '(request-target)': - return `(request-target): ${method.toLowerCase()} ${url.pathname}` - case 'host': - return `host: ${url.host}` - case 'date': - return `date: ${date}` - case 'digest': - return `digest: ${digest}` - default: - throw new Error(`Unsupported header ${header} for signing`) - } - }) - return signingParts.join('\n') -} - -module.exports = { - generateSignedHeaders -} From 2c0382b52341743c4a861feafeeb75fbf41c00a6 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 13:02:31 -0800 Subject: [PATCH 37/47] docs: add correct send-post command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e707c8..92fae56 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ The CLI uses a configuration file named `.dprc` to store API URLs, authenticatio Publish a post to your followers: ```bash -dp-cli send-post --message "Hello, Fediverse!" +dp-cli send-post --path ./path_to_activity.json ``` ### Configuration From 1db4b2bdf752365482d6642e9906beb5d1fe67ed Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 21 Nov 2024 13:49:22 -0800 Subject: [PATCH 38/47] feat: improve patchSite implementation with FormData for multipart uploads --- src/commands/patchSite.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/commands/patchSite.js b/src/commands/patchSite.js index 6cc3011..ada01cb 100644 --- a/src/commands/patchSite.js +++ b/src/commands/patchSite.js @@ -30,7 +30,7 @@ async function patchSite (folder, siteId) { const globby = await loadGlobby() // Create a tarball of the folder - const tarballPath = path.join(process.cwd(), 'site-patch.tar') + const tarballPath = path.join(process.cwd(), 'site-patch.tar.gz') await tar.c( { gzip: true, @@ -56,12 +56,34 @@ async function patchSite (folder, siteId) { }) console.log(chalk.green('Site patched successfully!')) - console.log(`Updated Site Info: ${JSON.stringify(response.data, null, 2)}`) + + // Fetch updated site info (if API returns empty response) + if (!response.data || Object.keys(response.data).length === 0) { + console.log(chalk.blue('Fetching updated site info...')) + const updatedResponse = await axios.get(`${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}`, { + headers: { + Authorization: `Bearer ${config.authToken}` + } + }) + + if (updatedResponse.data) { + console.log(chalk.green('Updated Site Info:')) + console.log(JSON.stringify(updatedResponse.data, null, 2)) + } else { + console.error(chalk.red('Failed to fetch updated site info.')) + } + } else { + console.log(`Updated Site Info: ${JSON.stringify(response.data, null, 2)}`) + } // Clean up the tarball fs.unlinkSync(tarballPath) } catch (error) { - console.error(chalk.red('Error patching site:', error.message)) + if (error.response && error.response.data) { + console.error(chalk.red('Error patching site:'), JSON.stringify(error.response.data)) + } else { + console.error(chalk.red('Error patching site:'), error.message) + } } } From c9233aa82ea6ef2684c4eab39689d00af3b18bc2 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Sat, 23 Nov 2024 01:49:06 -0800 Subject: [PATCH 39/47] docs: add staticpub template instructions and improve the workflow --- README.md | 92 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 92fae56..8fcf713 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,19 @@ A **Command Line Interface (CLI)** for interacting with the Distributed Press AP - [Installation](#installation) - [Node.js and npm Setup](#nodejs-and-npm-setup) -- [Distributed Press Setup](#distributed-press-setup) - - [Register as Publisher (Trial Account)](#register-as-publisher-trial-account) +- [Distributed Press Setup](#distributed-press-setup-publish-website) + - [Register as Publisher (Trial Account)](#register-as-publisher) - [Set Your Authentication Token](#set-your-authentication-token) - [Create Your Site](#create-your-site) - [Publish Your Site](#publish-your-site) - [DNS Setup](#dns-setup) - [Clone an Existing Site](#clone-an-existing-site) - [Social Inbox Setup](#social-inbox-setup-send-posts-to-fediverse) + - [Use Staticpub Template](#use-staticpub-template) - [Generate a Keypair](#generate-a-keypair) - [Register Your Actor](#register-your-actor) - [Send a Post to Followers](#send-a-post-to-followers) + - [Patch a Site](#patch-a-site) - [Configuration](#configuration) - [Commands](#commands) - [License](#license) @@ -54,9 +56,9 @@ npm install -g dp-cli Once installed, you can use `dp-cli` from anywhere in your terminal. -## Distributed Press Setup +## Distributed Press Setup (Publish Website) -### Register as Publisher (Trial Account) +### Register as Publisher Register a trial publisher account on Distributed Press using your email: @@ -115,7 +117,7 @@ To make your site accessible through Distributed Press, set an `NS Record` to de | Type | Name | Value | | ---- | ---------------------- | ---------------------------------- | -| NS | `_dnslink` | `api.distributed.press.` | +| NS | `_dnslink.your.domain` | `api.distributed.press.` | - This eliminates the need to manually set TXT records. - [contact](mailto:hello@distributed.press) the Distributed Press team for assistance if needed. @@ -152,6 +154,61 @@ dp-cli clone ## Social Inbox Setup (Send Posts to Fediverse) +### Use Staticpub Template +1. Fork the Repository: +Visit the [staticpub.distributed.press](https://github.com/hyphacoop/staticpub.distributed.press) repository on GitHub and click the "[Fork](https://github.com/hyphacoop/staticpub.distributed.press/fork)" button to create your own copy. + +2. Clone Your Fork: + +```bash +git clone https://github.com/hyphacoop/staticpub.distributed.press.git +cd staticpub.distributed.press +``` + +3. Replace Domain, Username, and Name: + +### For Linux Users: + +```bash +find . -type f -exec sed -i 's/staticpub\.mauve\.moe/yourdomain\.com/g; s/mauve/username/g; s/"Mauve"/"Your Name"/g' {} + +``` + +### For macOS Users: + +```bash +find . -type f -exec sed -i '' 's/staticpub\.mauve\.moe/yourdomain\.com/g; s/mauve/username/g; s/"Mauve"/"Your Name"/g' {} + +``` + +**This will replace:** +- `staticpub.mauve.moe` → `yourdomain.com` +- `mauve` → `yourusername` +- `Mauve` → `Your Name` + +Make sure to update the `publicKeyPem` field in the following files with your actual public key from the `.dprc` configuration file: + +- `about.jsonld` +- `about-ipns.jsonld` + +### How to Find Your Public Key: + +1. Open your `.dprc` file (generated during setup). +2. Copy the value of `"publicKeyPem"` (including the `BEGIN` and `END` lines). +3. Paste it into the `publicKeyPem` field in the JSON files mentioned above. + +### Example: + +```json + "publicKey": { + "@context": "https://w3id.org/security/v1", + "@type": "Key", + "id": "https://staticpub.mauve.moe/about.jsonld#main-key", + "owner": "https://staticpub.mauve.moe/about.jsonld", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nYOUR_PUBLIC_KEY_HERE\n-----END PUBLIC KEY-----\n" + } +``` + +Replace `YOUR_PUBLIC_KEY_HERE` with your actual public key from `.dprc`. + For using the Social Inbox, you need to generate a keypair and register your ActivityPub actor. ### Generate a Keypair @@ -180,19 +237,34 @@ dp-cli register-actor This will register your actor with the Social Inbox and save the details to your configuration. -## Configuration +### Publish the Staticpub Template -The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, keypairs, and actor information. The configuration file follows the format expected by the [`rc` module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. +Please follow the steps from this section: +- [Distributed Press Setup](#distributed-press-setup-publish-website) ### Send a Post to Followers -Publish a post to your followers: +Published the template? Now, let's send a post to your followers: ```bash -dp-cli send-post --path ./path_to_activity.json +dp-cli send-post ./path_to_activity.json +``` + +#### Example (as per the staticpub template): +```bash +dp-cli send-post ./posts/helloworld.jsonld ``` -### Configuration +### Patch a Site +After publishing your site and registering your actor, you might need to update your site with new content or activities. Use the `patch` command to add the note/activity JSON and update the outbox with the new activity. + +```bash +dp-cli patch -i ./path_to_patch_folder +``` + +## Configuration + +The CLI uses a configuration file named `.dprc` to store API URLs, authentication tokens, keypairs, and actor information. The configuration file follows the format expected by the [`rc` module](https://www.npmjs.com/package/rc), which loads configuration options in a flexible way. Your `.dprc` file should look like this: From 7ff614e813ca638ccad0f5ccb7e37dc579a989a5 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 28 Nov 2024 01:59:10 -0800 Subject: [PATCH 40/47] feat: resolve empty response issue and add local site download support --- package-lock.json | 541 +++++++++++++++++++++++++++++++++++++- package.json | 3 +- src/commands/cloneSite.js | 56 ++-- 3 files changed, 571 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 465621f..c6d8533 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,8 @@ "inquirer": "^8.2.4", "rc": "^1.2.8", "tar": "^7.4.3", - "uuid": "^11.0.2" + "uuid": "^11.0.2", + "website-scraper": "^5.3.1" }, "bin": { "dp-cli": "bin/dp-cli.js" @@ -335,6 +336,17 @@ "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", "dev": true }, + "node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", @@ -346,6 +358,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" + }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -675,6 +703,11 @@ "readable-stream": "^3.4.0" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -738,6 +771,42 @@ "node": ">=10" } }, + "node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/cacheable-request/node_modules/normalize-url": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -786,6 +855,42 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/chownr": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", @@ -886,6 +991,37 @@ "node": ">= 8" } }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-url-parser": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/css-url-parser/-/css-url-parser-1.1.4.tgz", + "integrity": "sha512-gIpYB7ZqfIsd+/kJ8CE4pesAbIUEaZM+30Ylfl7rr0zJONslIchmi3utzY64qHIOhD/wXDrcSo7jU2VDqG7GiQ==" + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/data-view-buffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", @@ -941,7 +1077,6 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dev": true, "dependencies": { "ms": "^2.1.3" }, @@ -954,6 +1089,31 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -979,6 +1139,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "engines": { + "node": ">=10" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -1033,6 +1201,57 @@ "node": ">=6.0.0" } }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -1043,6 +1262,17 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1810,6 +2040,11 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -2063,6 +2298,27 @@ "node": ">= 6" } }, + "node_modules/form-data-encoder": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", + "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", + "engines": { + "node": ">= 14.17" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2136,6 +2392,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-symbol-description": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", @@ -2257,11 +2524,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/graphemer": { "version": "1.4.0", @@ -2349,6 +2639,29 @@ "node": ">= 0.4" } }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, "node_modules/http-signed-fetch": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/http-signed-fetch/-/http-signed-fetch-1.0.1.tgz", @@ -2358,6 +2671,18 @@ "activitypub-http-signatures": "^2.0.1" } }, + "node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -2927,8 +3252,7 @@ "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, "node_modules/json-parse-better-errors": { "version": "1.0.2", @@ -2960,6 +3284,17 @@ "json5": "lib/cli.js" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -2979,7 +3314,6 @@ "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, "dependencies": { "json-buffer": "3.0.1" } @@ -3075,6 +3409,17 @@ "loose-envify": "cli.js" } }, + "node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -3127,6 +3472,17 @@ "node": ">=6" } }, + "node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -3186,8 +3542,7 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/mute-stream": { "version": "0.0.8", @@ -3200,6 +3555,28 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/normalize-url": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", + "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3381,6 +3758,14 @@ "node": ">=0.10.0" } }, + "node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "engines": { + "node": ">=12.20" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3411,6 +3796,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-queue": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", + "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^5.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -3450,6 +3861,29 @@ "node": ">=4" } }, + "node_modules/parse5": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", + "dependencies": { + "entities": "^4.5.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3664,6 +4098,17 @@ } ] }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -3765,6 +4210,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -3774,6 +4224,20 @@ "node": ">=4" } }, + "node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -3906,6 +4370,14 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/sanitize-filename": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", + "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "dependencies": { + "truncate-utf8-bytes": "^1.0.0" + } + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -4000,6 +4472,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/srcset": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/srcset/-/srcset-5.0.1.tgz", + "integrity": "sha512-/P1UYbGfJVlxZag7aABNRrulEXAwCSDo7fklafOQrantuPTDmYgijJMks2zusPCVzgW9+4P69mq7w6pYuZpgxw==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/standard": { "version": "17.1.2", "resolved": "https://registry.npmjs.org/standard/-/standard-17.1.2.tgz", @@ -4298,6 +4781,14 @@ "node": ">=8.0" } }, + "node_modules/truncate-utf8-bytes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", + "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", + "dependencies": { + "utf8-byte-length": "^1.0.1" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -4437,6 +4928,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -4446,6 +4945,11 @@ "punycode": "^2.1.0" } }, + "node_modules/utf8-byte-length": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==" + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -4480,6 +4984,25 @@ "defaults": "^1.0.3" } }, + "node_modules/website-scraper": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/website-scraper/-/website-scraper-5.3.1.tgz", + "integrity": "sha512-gogqPXD2gVsxoyd2yRiympw3rA5GuEpD1CaDEJ/J8zzanx7hkbTtneoO1SGs436PpLbWVcUge+6APGLhzsuZPA==", + "dependencies": { + "cheerio": "1.0.0-rc.12", + "css-url-parser": "^1.0.0", + "debug": "^4.3.1", + "fs-extra": "^10.0.0", + "got": "^12.0.0", + "normalize-url": "^7.0.2", + "p-queue": "^7.1.0", + "sanitize-filename": "^1.6.3", + "srcset": "^5.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index cb99910..65693eb 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "inquirer": "^8.2.4", "rc": "^1.2.8", "tar": "^7.4.3", - "uuid": "^11.0.2" + "uuid": "^11.0.2", + "website-scraper": "^5.3.1" }, "devDependencies": { "standard": "^17.1.2" diff --git a/src/commands/cloneSite.js b/src/commands/cloneSite.js index 08ddfa7..2144f50 100644 --- a/src/commands/cloneSite.js +++ b/src/commands/cloneSite.js @@ -1,35 +1,53 @@ const axios = require('axios') const chalk = require('chalk') const config = require('../config/config') +const path = require('path') -async function cloneSite (siteId) { +async function loadWebsiteScraper () { + // Dynamically import the ES module `website-scraper` + return await import('website-scraper') +} + +async function cloneSite (siteId, outputDir) { try { console.log(chalk.blue(`Cloning site with ID: ${siteId}`)) - const cloneUrl = `${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}/clone` - - const response = await axios.post(cloneUrl, null, { + // Trigger server-side cloning + await axios.post(`${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}/clone`, null, { headers: { Authorization: `Bearer ${config.authToken}`, 'Content-Type': 'application/json' - } + }, + validateStatus: (status) => status >= 200 && status < 300 }) - console.log(chalk.green('Site cloned successfully!')) - console.log(`Cloned Site Info: ${JSON.stringify(response.data, null, 2)}`) - } catch (error) { - if (error.response) { - console.error(chalk.red('Error cloning site:'), `Status: ${error.response.status}, Message: ${error.response.statusText}`) - if (error.response.data) { - console.error(chalk.red('Response Data:'), JSON.stringify(error.response.data, null, 2)) - } - - if (error.response.status === 500 && error.response.data && error.response.data.message && error.response.data.message.includes('The certificate is NOT trusted')) { - console.error(chalk.yellow('Hint:'), 'It appears that the server is unable to clone your site due to an SSL certificate trust issue. Please ensure your domain has a valid, trusted SSL certificate that matches your domain name.') - } - } else { - console.error(chalk.red('Error cloning site:'), error.message) + console.log(chalk.green('Server-side cloning initiated successfully!')) + + // Proceed to download the site content locally + const outputDirectory = outputDir || path.join(process.cwd(), siteId) + + let siteUrl = siteId + if (!siteUrl.startsWith('http://') && !siteUrl.startsWith('https://')) { + siteUrl = `https://${siteUrl}` } + + console.log(chalk.blue(`Downloading site content from ${siteUrl} to ${outputDirectory}...`)) + + // Dynamically load `website-scraper` + const { default: scrape } = await loadWebsiteScraper() + + await scrape({ + urls: [siteUrl], + directory: outputDirectory, + recursive: true, + maxRecursiveDepth: 10, + urlFilter: (url) => url.startsWith(siteUrl) + }) + + console.log(chalk.green('Site content downloaded successfully!')) + console.log(`Site content saved to: ${outputDirectory}`) + } catch (error) { + console.error(chalk.red('Error cloning site:'), error.message) } } From 9aa2ba3c63ec92025371c1be9bde373e93ff127f Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Mon, 2 Dec 2024 13:24:13 -0800 Subject: [PATCH 41/47] docs: update staticpub template actor commands --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8fcf713..c5e9623 100644 --- a/README.md +++ b/README.md @@ -170,19 +170,19 @@ cd staticpub.distributed.press ### For Linux Users: ```bash -find . -type f -exec sed -i 's/staticpub\.mauve\.moe/yourdomain\.com/g; s/mauve/username/g; s/"Mauve"/"Your Name"/g' {} + +find . -type f -exec sed -i 's/staticpub\.distributed\.press/yourdomain\.com/g; s/dp/username/g; s/"Distributed Press"/"Your Name"/g' {} + ``` ### For macOS Users: ```bash -find . -type f -exec sed -i '' 's/staticpub\.mauve\.moe/yourdomain\.com/g; s/mauve/username/g; s/"Mauve"/"Your Name"/g' {} + +find . -type f -exec sed -i '' 's/staticpub\.distributed\.press/yourdomain\.com/g; s/dp/username/g; s/"Distributed Press"/"Your Name"/g' {} + ``` **This will replace:** -- `staticpub.mauve.moe` → `yourdomain.com` -- `mauve` → `yourusername` -- `Mauve` → `Your Name` +- `staticpub.distributed.press` → `yourdomain.com` +- `dp` → `yourusername` +- `Distributed Press` → `Your Name` Make sure to update the `publicKeyPem` field in the following files with your actual public key from the `.dprc` configuration file: @@ -201,8 +201,8 @@ Make sure to update the `publicKeyPem` field in the following files with your ac "publicKey": { "@context": "https://w3id.org/security/v1", "@type": "Key", - "id": "https://staticpub.mauve.moe/about.jsonld#main-key", - "owner": "https://staticpub.mauve.moe/about.jsonld", + "id": "https://staticpub.distributed.press/about.jsonld#main-key", + "owner": "https://staticpub.distributed.press/about.jsonld", "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nYOUR_PUBLIC_KEY_HERE\n-----END PUBLIC KEY-----\n" } ``` From 365efb3ee7f081718241b7ba829a37eef2908208 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Tue, 3 Dec 2024 00:12:30 -0800 Subject: [PATCH 42/47] refactor(clone): remove web scraper and align with clone API behavior --- package-lock.json | 541 +------------------------------------- package.json | 3 +- src/commands/cloneSite.js | 75 ++++-- 3 files changed, 56 insertions(+), 563 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6d8533..465621f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,7 @@ "inquirer": "^8.2.4", "rc": "^1.2.8", "tar": "^7.4.3", - "uuid": "^11.0.2", - "website-scraper": "^5.3.1" + "uuid": "^11.0.2" }, "bin": { "dp-cli": "bin/dp-cli.js" @@ -336,17 +335,6 @@ "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", "dev": true }, - "node_modules/@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", @@ -358,22 +346,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -703,11 +675,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" - }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -771,42 +738,6 @@ "node": ">=10" } }, - "node_modules/cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "engines": { - "node": ">=14.16" - } - }, - "node_modules/cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dependencies": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/cacheable-request/node_modules/normalize-url": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", - "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -855,42 +786,6 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, - "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" - }, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/chownr": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", @@ -991,37 +886,6 @@ "node": ">= 8" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-url-parser": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/css-url-parser/-/css-url-parser-1.1.4.tgz", - "integrity": "sha512-gIpYB7ZqfIsd+/kJ8CE4pesAbIUEaZM+30Ylfl7rr0zJONslIchmi3utzY64qHIOhD/wXDrcSo7jU2VDqG7GiQ==" - }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/data-view-buffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", @@ -1077,6 +941,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, "dependencies": { "ms": "^2.1.3" }, @@ -1089,31 +954,6 @@ } } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -1139,14 +979,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "engines": { - "node": ">=10" - } - }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -1201,57 +1033,6 @@ "node": ">=6.0.0" } }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -1262,17 +1043,6 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2040,11 +1810,6 @@ "node": ">=0.10.0" } }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" - }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -2298,27 +2063,6 @@ "node": ">= 6" } }, - "node_modules/form-data-encoder": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", - "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", - "engines": { - "node": ">= 14.17" - } - }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2392,17 +2136,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-symbol-description": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", @@ -2524,34 +2257,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true }, "node_modules/graphemer": { "version": "1.4.0", @@ -2639,29 +2349,6 @@ "node": ">= 0.4" } }, - "node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" - }, "node_modules/http-signed-fetch": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/http-signed-fetch/-/http-signed-fetch-1.0.1.tgz", @@ -2671,18 +2358,6 @@ "activitypub-http-signatures": "^2.0.1" } }, - "node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3252,7 +2927,8 @@ "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true }, "node_modules/json-parse-better-errors": { "version": "1.0.2", @@ -3284,17 +2960,6 @@ "json5": "lib/cli.js" } }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -3314,6 +2979,7 @@ "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, "dependencies": { "json-buffer": "3.0.1" } @@ -3409,17 +3075,6 @@ "loose-envify": "cli.js" } }, - "node_modules/lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -3472,17 +3127,6 @@ "node": ">=6" } }, - "node_modules/mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -3542,7 +3186,8 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, "node_modules/mute-stream": { "version": "0.0.8", @@ -3555,28 +3200,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/normalize-url": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", - "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3758,14 +3381,6 @@ "node": ">=0.10.0" } }, - "node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "engines": { - "node": ">=12.20" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3796,32 +3411,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-queue": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz", - "integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==", - "dependencies": { - "eventemitter3": "^5.0.1", - "p-timeout": "^5.0.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-timeout": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", - "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -3861,29 +3450,6 @@ "node": ">=4" } }, - "node_modules/parse5": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", - "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", - "dependencies": { - "entities": "^4.5.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", - "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", - "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4098,17 +3664,6 @@ } ] }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -4210,11 +3765,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -4224,20 +3774,6 @@ "node": ">=4" } }, - "node_modules/responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dependencies": { - "lowercase-keys": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -4370,14 +3906,6 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "node_modules/sanitize-filename": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", - "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", - "dependencies": { - "truncate-utf8-bytes": "^1.0.0" - } - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -4472,17 +4000,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/srcset": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-5.0.1.tgz", - "integrity": "sha512-/P1UYbGfJVlxZag7aABNRrulEXAwCSDo7fklafOQrantuPTDmYgijJMks2zusPCVzgW9+4P69mq7w6pYuZpgxw==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/standard": { "version": "17.1.2", "resolved": "https://registry.npmjs.org/standard/-/standard-17.1.2.tgz", @@ -4781,14 +4298,6 @@ "node": ">=8.0" } }, - "node_modules/truncate-utf8-bytes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", - "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", - "dependencies": { - "utf8-byte-length": "^1.0.1" - } - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -4928,14 +4437,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -4945,11 +4446,6 @@ "punycode": "^2.1.0" } }, - "node_modules/utf8-byte-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", - "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==" - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -4984,25 +4480,6 @@ "defaults": "^1.0.3" } }, - "node_modules/website-scraper": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/website-scraper/-/website-scraper-5.3.1.tgz", - "integrity": "sha512-gogqPXD2gVsxoyd2yRiympw3rA5GuEpD1CaDEJ/J8zzanx7hkbTtneoO1SGs436PpLbWVcUge+6APGLhzsuZPA==", - "dependencies": { - "cheerio": "1.0.0-rc.12", - "css-url-parser": "^1.0.0", - "debug": "^4.3.1", - "fs-extra": "^10.0.0", - "got": "^12.0.0", - "normalize-url": "^7.0.2", - "p-queue": "^7.1.0", - "sanitize-filename": "^1.6.3", - "srcset": "^5.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 65693eb..cb99910 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,7 @@ "inquirer": "^8.2.4", "rc": "^1.2.8", "tar": "^7.4.3", - "uuid": "^11.0.2", - "website-scraper": "^5.3.1" + "uuid": "^11.0.2" }, "devDependencies": { "standard": "^17.1.2" diff --git a/src/commands/cloneSite.js b/src/commands/cloneSite.js index 2144f50..fbb0d6d 100644 --- a/src/commands/cloneSite.js +++ b/src/commands/cloneSite.js @@ -1,19 +1,14 @@ const axios = require('axios') const chalk = require('chalk') const config = require('../config/config') -const path = require('path') -async function loadWebsiteScraper () { - // Dynamically import the ES module `website-scraper` - return await import('website-scraper') -} - -async function cloneSite (siteId, outputDir) { +async function cloneSite (siteId) { try { console.log(chalk.blue(`Cloning site with ID: ${siteId}`)) // Trigger server-side cloning - await axios.post(`${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}/clone`, null, { + const cloneUrl = `${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}/clone` + await axios.post(cloneUrl, null, { headers: { Authorization: `Bearer ${config.authToken}`, 'Content-Type': 'application/json' @@ -23,31 +18,53 @@ async function cloneSite (siteId, outputDir) { console.log(chalk.green('Server-side cloning initiated successfully!')) - // Proceed to download the site content locally - const outputDirectory = outputDir || path.join(process.cwd(), siteId) + // Fetch updated site info + const siteInfoUrl = `${config.dpApiUrl}/sites/${encodeURIComponent(siteId)}` + const response = await axios.get(siteInfoUrl, { + headers: { + Authorization: `Bearer ${config.authToken}` + } + }) - let siteUrl = siteId - if (!siteUrl.startsWith('http://') && !siteUrl.startsWith('https://')) { - siteUrl = `https://${siteUrl}` + if (response.data && Object.keys(response.data).length > 0) { + console.log(chalk.green('Cloned Site Info:')) + console.log(JSON.stringify(response.data, null, 2)) + } else { + console.log(chalk.yellow('No site information was returned by the API.')) } + } catch (error) { + handleCloneError(error) + } +} - console.log(chalk.blue(`Downloading site content from ${siteUrl} to ${outputDirectory}...`)) - - // Dynamically load `website-scraper` - const { default: scrape } = await loadWebsiteScraper() - - await scrape({ - urls: [siteUrl], - directory: outputDirectory, - recursive: true, - maxRecursiveDepth: 10, - urlFilter: (url) => url.startsWith(siteUrl) - }) +function handleCloneError (error) { + if (error.response) { + console.error( + chalk.red('Error cloning site:'), + `Status: ${error.response.status}, Message: ${error.response.statusText}` + ) + if (error.response.data) { + console.error(chalk.red('Response Data:'), JSON.stringify(error.response.data, null, 2)) + } else { + console.error(chalk.red('No response data available.')) + } - console.log(chalk.green('Site content downloaded successfully!')) - console.log(`Site content saved to: ${outputDirectory}`) - } catch (error) { - console.error(chalk.red('Error cloning site:'), error.message) + if ( + error.response.status === 500 && + error.response.data && + error.response.data.message && + error.response.data.message.includes('The certificate is NOT trusted') + ) { + console.error( + chalk.yellow('Hint:'), + 'It appears that the server is unable to clone your site due to an SSL certificate trust issue. Please ensure your domain has a valid, trusted SSL certificate that matches your domain name.' + ) + } + } else if (error.request) { + console.error(chalk.red('No response received from the server.')) + console.error(error.request) + } else { + console.error(chalk.red('Error setting up the request:'), error.message) } } From e116f291b3a1d6d1fe8e8f72c4bd92da4e2e88c3 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Tue, 3 Dec 2024 01:44:49 -0800 Subject: [PATCH 43/47] fix(register-actor): resolve HTTP signature issues and streamline signing process --- src/api/socialInboxApi.js | 48 +++++++++++++++++++++++------------ src/commands/registerActor.js | 14 ++++++---- src/config/config.js | 6 ++++- 3 files changed, 46 insertions(+), 22 deletions(-) diff --git a/src/api/socialInboxApi.js b/src/api/socialInboxApi.js index 33ed930..efcf9aa 100644 --- a/src/api/socialInboxApi.js +++ b/src/api/socialInboxApi.js @@ -1,28 +1,44 @@ const config = require('../config/config') const chalk = require('chalk') -async function loadHttpSig () { - // Dynamically import the `http-signed-fetch` package. - return await import('http-signed-fetch') +async function loadHttpSignedFetch () { + try { + const fetchModule = await import('http-signed-fetch') + const fetch = fetchModule.default || fetchModule.fetch + + if (typeof fetch !== 'function') { + throw new Error('fetch is not a function in http-signed-fetch') + } + + return fetch + } catch (error) { + console.error(chalk.red('Failed to load http-signed-fetch:'), error.message) + throw error + } } async function registerActor (actorUsername, actorInfo) { try { - const httpsig = await loadHttpSig() - const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}` - const signer = new httpsig.Signer({ - keyId: actorInfo.publicKeyId, - privateKey: actorInfo.keypair.privateKeyPem, - headers: ['(request-target)', 'host', 'date', 'digest'] - }) + const fetch = await loadHttpSignedFetch() - const response = await httpsig.fetch(url, { + const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}` + const response = await fetch(url, { method: 'POST', - body: JSON.stringify(actorInfo), headers: { - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + date: new Date().toUTCString(), + host: new URL(url).host }, - signer + keypair: actorInfo.keypair, // Private and public key + publicKeyId: actorInfo.publicKeyId, + body: JSON.stringify({ + actorUrl: actorInfo.actorUrl, + publicKeyId: actorInfo.publicKeyId, + keypair: { + publicKeyPem: actorInfo.keypair.publicKeyPem, + privateKeyPem: actorInfo.keypair.privateKeyPem + } + }) }) if (!response.ok) { @@ -34,7 +50,7 @@ async function registerActor (actorUsername, actorInfo) { return { data } } catch (error) { console.error( - chalk.red('Social Inbox API Error:', error.response ? error.response.data : error.message) + chalk.red('Social Inbox API Error:', error.message) ) throw error } @@ -42,7 +58,7 @@ async function registerActor (actorUsername, actorInfo) { async function sendPost (actorUsername, activity) { try { - const httpsig = await loadHttpSig() + const httpsig = await loadHttpSignedFetch() const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}/outbox` const signer = new httpsig.Signer({ keyId: config.publicKeyId, diff --git a/src/commands/registerActor.js b/src/commands/registerActor.js index 095d930..0c6e6e5 100644 --- a/src/commands/registerActor.js +++ b/src/commands/registerActor.js @@ -14,19 +14,20 @@ async function registerActor () { type: 'input', name: 'actorUsername', message: 'Enter your actor username (e.g., @username@domain.com):', - validate: (input) => input ? true : 'Actor username cannot be empty.' + validate: (input) => (input ? true : 'Actor username cannot be empty.') }, { type: 'input', name: 'actorUrl', message: 'Enter your actor URL:', - validate: (input) => /^https?:\/\/.+/.test(input) ? true : 'Please enter a valid URL.' + validate: (input) => + /^https?:\/\/.+/.test(input) ? true : 'Please enter a valid URL.' }, { type: 'input', name: 'publicKeyId', message: 'Enter your public key ID (e.g., https://domain.com/actor#main-key):', - validate: (input) => input ? true : 'Public key ID cannot be empty.' + validate: (input) => (input ? true : 'Public key ID cannot be empty.') } ]) @@ -35,9 +36,12 @@ async function registerActor () { config.actorUrl = answers.actorUrl config.publicKeyId = answers.publicKeyId + // Create a cleaned config object excluding unwanted properties + const { _, configs, config: configPath, ...cleanConfig } = config + // Write updated config to .dprc - const configPath = path.join(process.cwd(), '.dprc') - fs.writeFileSync(configPath, JSON.stringify(config, null, 2)) + const configFilePath = path.join(process.cwd(), '.dprc') + fs.writeFileSync(configFilePath, JSON.stringify(cleanConfig, null, 2)) const actorInfo = { actorUrl: answers.actorUrl, diff --git a/src/config/config.js b/src/config/config.js index e47ce27..c358c21 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -7,7 +7,11 @@ const defaults = { keypair: { publicKeyPem: '', privateKeyPem: '' - } + }, + domain: '', + actorUsername: '', + actorUrl: '', + publicKeyId: '' } const config = rc('dp', defaults) From 6f2fdea001ec6461f01270d3ca2e20c7fadc733b Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Tue, 3 Dec 2024 02:20:38 -0800 Subject: [PATCH 44/47] refactor: update send-post activity command --- src/api/socialInboxApi.js | 27 ++++++++++++++++----------- src/commands/sendPost.js | 16 +++++----------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/api/socialInboxApi.js b/src/api/socialInboxApi.js index efcf9aa..e7c1801 100644 --- a/src/api/socialInboxApi.js +++ b/src/api/socialInboxApi.js @@ -58,21 +58,26 @@ async function registerActor (actorUsername, actorInfo) { async function sendPost (actorUsername, activity) { try { - const httpsig = await loadHttpSignedFetch() + const fetch = await loadHttpSignedFetch() + const url = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}/outbox` - const signer = new httpsig.Signer({ - keyId: config.publicKeyId, - privateKey: config.keypair.privateKeyPem, - headers: ['(request-target)', 'host', 'date', 'digest'] - }) - const response = await httpsig.fetch(url, { + // Debugging: Log the request details + console.log(chalk.blue('Sending to URL:'), url) + console.log(chalk.blue('Activity Payload:'), JSON.stringify(activity, null, 2)) + console.log(chalk.blue('Keypair being used:'), config.keypair) + console.log(chalk.blue('PublicKeyId being used:'), config.publicKeyId) + + const response = await fetch(url, { method: 'POST', - body: JSON.stringify(activity), headers: { - 'Content-Type': 'application/ld+json' + 'Content-Type': 'application/ld+json', + date: new Date().toUTCString(), + host: new URL(url).host }, - signer + keypair: config.keypair, // Private and public key + publicKeyId: config.publicKeyId, + body: JSON.stringify(activity) }) if (!response.ok) { @@ -84,7 +89,7 @@ async function sendPost (actorUsername, activity) { return { data } } catch (error) { console.error( - chalk.red('Social Inbox API Error:', error.response ? error.response.data : error.message) + chalk.red('Social Inbox API Error:', error.message) ) throw error } diff --git a/src/commands/sendPost.js b/src/commands/sendPost.js index 949bea3..27a6378 100644 --- a/src/commands/sendPost.js +++ b/src/commands/sendPost.js @@ -3,7 +3,6 @@ const path = require('path') const chalk = require('chalk') const config = require('../config/config') const socialInboxApi = require('../api/socialInboxApi') -const { v4: uuidv4 } = require('uuid') // Import uuidv4 async function sendPost (activityPath) { try { @@ -29,10 +28,8 @@ async function sendPost (activityPath) { return } - // Read the activity from the file + // Read and parse the activity JSON file const activityData = fs.readFileSync(resolvedPath, 'utf-8') - - // Parse the activity JSON const activity = JSON.parse(activityData) // Validate the activity @@ -41,18 +38,15 @@ async function sendPost (activityPath) { return } - // Optionally, update activity IDs and timestamps - const activityId = `${config.socialInboxUrl}/${encodeURIComponent(actorUsername)}/outbox/${uuidv4()}` - activity.id = activity.id || activityId - activity.published = activity.published || new Date().toISOString() + // Ensure required fields are present activity.actor = activity.actor || config.actorUrl + activity.published = activity.published || new Date().toISOString() - // If the activity contains an object (e.g., a Note), ensure it has an ID if (activity.object && !activity.object.id) { - activity.object.id = `${activity.id}#object` + activity.object.id = `${activity.id || config.actorUrl}#object` } - // Send post via Social Inbox API + // Send the activity to the Social Inbox API const response = await socialInboxApi.sendPost(actorUsername, activity) console.log(chalk.green('Post sent successfully!')) From 835a08d78b51dab0d5cec3f457868b4b39256946 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Wed, 4 Dec 2024 08:51:44 -0800 Subject: [PATCH 45/47] feat: wrap Note in Create Activity for sending posts --- src/api/socialInboxApi.js | 19 +++++++++------- src/commands/sendPost.js | 47 ++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/api/socialInboxApi.js b/src/api/socialInboxApi.js index e7c1801..4e8f23f 100644 --- a/src/api/socialInboxApi.js +++ b/src/api/socialInboxApi.js @@ -65,32 +65,35 @@ async function sendPost (actorUsername, activity) { // Debugging: Log the request details console.log(chalk.blue('Sending to URL:'), url) console.log(chalk.blue('Activity Payload:'), JSON.stringify(activity, null, 2)) - console.log(chalk.blue('Keypair being used:'), config.keypair) console.log(chalk.blue('PublicKeyId being used:'), config.publicKeyId) const response = await fetch(url, { method: 'POST', headers: { - 'Content-Type': 'application/ld+json', - date: new Date().toUTCString(), - host: new URL(url).host + 'Content-Type': 'application/ld+json' }, - keypair: config.keypair, // Private and public key + keypair: config.keypair, publicKeyId: config.publicKeyId, body: JSON.stringify(activity) }) if (!response.ok) { const errorText = await response.text() + + // Log the response for debugging + console.error(chalk.red('Response Headers:')) + response.headers.forEach((value, key) => { + console.error(chalk.red(`${key}: ${value}`)) + }) + console.error(chalk.red('Response Body:'), errorText) + throw new Error(`HTTP error! status: ${response.status}, message: ${errorText}`) } const data = await response.json() return { data } } catch (error) { - console.error( - chalk.red('Social Inbox API Error:', error.message) - ) + console.error(chalk.red('Social Inbox API Error:', error.message)) throw error } } diff --git a/src/commands/sendPost.js b/src/commands/sendPost.js index 27a6378..d43caec 100644 --- a/src/commands/sendPost.js +++ b/src/commands/sendPost.js @@ -1,8 +1,8 @@ const fs = require('fs') const path = require('path') const chalk = require('chalk') -const config = require('../config/config') const socialInboxApi = require('../api/socialInboxApi') +const config = require('../config/config') async function sendPost (activityPath) { try { @@ -28,29 +28,44 @@ async function sendPost (activityPath) { return } - // Read and parse the activity JSON file - const activityData = fs.readFileSync(resolvedPath, 'utf-8') - const activity = JSON.parse(activityData) + // Read and parse the Note JSON file + const noteData = fs.readFileSync(resolvedPath, 'utf-8') + const note = JSON.parse(noteData) - // Validate the activity - if (!activity || !activity.type) { - console.error(chalk.red('Invalid activity data. Please provide a valid ActivityStreams JSON.')) + // Validate the Note + if (!note || !note.type || note.type !== 'Note') { + console.error(chalk.red('Invalid Note data. Please provide a valid ActivityStreams Note JSON.')) return } - // Ensure required fields are present - activity.actor = activity.actor || config.actorUrl - activity.published = activity.published || new Date().toISOString() + // Get the domain dynamically from config + const domain = config.domain + + // Create a Create Activity that references the Note + const activityId = `https://${domain}/activities/${path.basename(activityPath, '.jsonld')}.jsonld` - if (activity.object && !activity.object.id) { - activity.object.id = `${activity.id || config.actorUrl}#object` + const createActivity = { + '@context': 'https://www.w3.org/ns/activitystreams', + id: activityId, + type: 'Create', + actor: config.actorUrl, + published: new Date().toISOString(), + to: ['https://www.w3.org/ns/activitystreams#Public'], + object: note } - // Send the activity to the Social Inbox API - const response = await socialInboxApi.sendPost(actorUsername, activity) + // Optional: Log the Create Activity being sent for debugging + console.log(chalk.blue('Create Activity being sent:'), JSON.stringify(createActivity, null, 2)) - console.log(chalk.green('Post sent successfully!')) - console.log(`Response: ${JSON.stringify(response.data, null, 2)}`) + // Send the Create Activity to the Social Inbox API + const response = await socialInboxApi.sendPost(actorUsername, createActivity) + + if (response && response.data) { + console.log(chalk.green('Post sent successfully!')) + console.log(`Response: ${JSON.stringify(response.data, null, 2)}`) + } else { + console.error(chalk.red('Error sending post: No response data received')) + } } catch (error) { console.error(chalk.red('Error sending post:'), error.message) } From d27f14d537adf91209eebf663ef09f178cf9237b Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 5 Dec 2024 09:58:41 -0800 Subject: [PATCH 46/47] feat: enable public announcement of posts as default --- src/api/socialInboxApi.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/socialInboxApi.js b/src/api/socialInboxApi.js index 4e8f23f..2180a9e 100644 --- a/src/api/socialInboxApi.js +++ b/src/api/socialInboxApi.js @@ -37,7 +37,8 @@ async function registerActor (actorUsername, actorInfo) { keypair: { publicKeyPem: actorInfo.keypair.publicKeyPem, privateKeyPem: actorInfo.keypair.privateKeyPem - } + }, + announce: true }) }) From 75c0d5faebd604aa20bfaf485fbfe586dc2d4ab0 Mon Sep 17 00:00:00 2001 From: Akhilesh Thite Date: Thu, 5 Dec 2024 10:19:47 -0800 Subject: [PATCH 47/47] refactor: improve response handling in sendPost to avoid displaying [object Object] --- src/commands/sendPost.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/sendPost.js b/src/commands/sendPost.js index d43caec..71f6783 100644 --- a/src/commands/sendPost.js +++ b/src/commands/sendPost.js @@ -62,7 +62,7 @@ async function sendPost (activityPath) { if (response && response.data) { console.log(chalk.green('Post sent successfully!')) - console.log(`Response: ${JSON.stringify(response.data, null, 2)}`) + // console.log(`Response: ${JSON.stringify(response.data, null, 2)}`) } else { console.error(chalk.red('Error sending post: No response data received')) }