From a0e9e7c1c9f5b260085ed4a99ae784ab3146c79c Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 25 Dec 2025 00:22:06 +0100 Subject: [PATCH 01/42] feat: Plugin performance improvement --- .gitignore | 10 + Cargo.lock | 13 + Cargo.toml | 1 + .../basic-example-plugin/config/config.json | 10 - .../config/keys/local-signer.json | 1 + .../basic-example-plugin/test-plugin/index.ts | 132 +- .../test-plugin/package.json | 2 +- .../test-plugin/pnpm-lock.yaml | 649 +- plugins/lib/build-executor.ts | 46 + plugins/lib/compiler.ts | 157 + plugins/lib/constants.ts | 41 + plugins/lib/kv.ts | 16 + plugins/lib/pool-server.ts | 627 + plugins/lib/sandbox-executor.js | 31772 ++++++++++++++++ plugins/lib/sandbox-executor.ts | 442 + plugins/lib/worker-pool.ts | 629 + plugins/package.json | 5 +- plugins/pnpm-lock.yaml | 1123 +- src/bootstrap/initialize_plugins.rs | 161 + src/bootstrap/mod.rs | 6 +- src/constants/plugins.rs | 50 + src/main.rs | 35 + src/repositories/plugin/mod.rs | 72 + src/repositories/plugin/plugin_in_memory.rs | 64 +- src/repositories/plugin/plugin_redis.rs | 122 + src/services/plugins/mod.rs | 13 +- src/services/plugins/pool_executor.rs | 1107 + src/services/plugins/runner.rs | 202 +- src/services/plugins/shared_socket.rs | 427 + src/services/plugins/socket.rs | 67 +- 30 files changed, 37891 insertions(+), 111 deletions(-) create mode 100644 examples/basic-example-plugin/config/keys/local-signer.json create mode 100644 plugins/lib/build-executor.ts create mode 100644 plugins/lib/compiler.ts create mode 100644 plugins/lib/constants.ts create mode 100644 plugins/lib/pool-server.ts create mode 100644 plugins/lib/sandbox-executor.js create mode 100644 plugins/lib/sandbox-executor.ts create mode 100644 plugins/lib/worker-pool.ts create mode 100644 src/bootstrap/initialize_plugins.rs create mode 100644 src/services/plugins/pool_executor.rs create mode 100644 src/services/plugins/shared_socket.rs diff --git a/.gitignore b/.gitignore index 632cf7cba..23a5ccbed 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,13 @@ node_modules # Integration test artifacts test-results/ **/*lcov.info + +# Pre-compiled plugin executor (generated at build time) +plugins/lib/sandbox-executor.js + +# TypeScript compiled output in plugins (we use ts-node for runtime) +plugins/**/*.js +plugins/**/*.js.map +plugins/**/*.d.ts +# Exception: keep pre-compiled sandbox executor +!plugins/lib/sandbox-executor.js diff --git a/Cargo.lock b/Cargo.lock index 967085295..e98582c78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1473,6 +1473,18 @@ dependencies = [ "serde_json", ] +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-compression" version = "0.4.35" @@ -5516,6 +5528,7 @@ dependencies = [ "apalis", "apalis-cron", "apalis-redis", + "async-channel", "async-trait", "aws-config", "aws-sdk-kms", diff --git a/Cargo.toml b/Cargo.toml index c29597798..9cce84b7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,6 +65,7 @@ hmac = { version = "0.12" } sha2 = { version = "0.10" } sha3 = { version = "0.10" } dashmap = { version = "6.1" } +async-channel = "2.3" actix-governor = "0.8" solana-sdk = { version = "3" } solana-client = { version = "3" } diff --git a/examples/basic-example-plugin/config/config.json b/examples/basic-example-plugin/config/config.json index ad2a28e9e..c8771b3c9 100644 --- a/examples/basic-example-plugin/config/config.json +++ b/examples/basic-example-plugin/config/config.json @@ -5,7 +5,6 @@ "name": "Sepolia Example", "network": "sepolia", "paused": false, - "notification_id": "notification-example", "signer_id": "local-signer", "network_type": "evm", "policies": { @@ -14,15 +13,6 @@ } ], "notifications": [ - { - "id": "notification-example", - "type": "webhook", - "url": "", - "signing_key": { - "type": "env", - "value": "WEBHOOK_SIGNING_KEY" - } - } ], "signers": [ { diff --git a/examples/basic-example-plugin/config/keys/local-signer.json b/examples/basic-example-plugin/config/keys/local-signer.json new file mode 100644 index 000000000..0d51269f7 --- /dev/null +++ b/examples/basic-example-plugin/config/keys/local-signer.json @@ -0,0 +1 @@ +{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"f9ed974ef6977bf5f041adffa71d3b49"},"ciphertext":"7fb2ad7f0d02382aee811830ce508bef33d3e02e1bb31f9d36c52d67c8b1e1fd","kdf":"scrypt","kdfparams":{"dklen":32,"n":8192,"p":1,"r":8,"salt":"d4c4748993daf7c573df81897d68f678da578c40b53d2695ce53420056f3d7bf"},"mac":"61b0d494fb002923c6f64989d39099f84cc995f9ec4b6ef808e92a525db3798a"},"id":"0a9c551f-4194-4e5f-9561-6ffa77939d3e","version":3} \ No newline at end of file diff --git a/examples/basic-example-plugin/test-plugin/index.ts b/examples/basic-example-plugin/test-plugin/index.ts index 278fad04e..8fe29b8f9 100644 --- a/examples/basic-example-plugin/test-plugin/index.ts +++ b/examples/basic-example-plugin/test-plugin/index.ts @@ -45,72 +45,74 @@ type HandlerResult = { * @param params - Plugin parameters from the API call * @returns Promise with the plugin result */ -export async function handler(api: PluginAPI, params: HandlerParams): Promise { +export async function handler(api: PluginAPI, params: HandlerParams): Promise { console.info("๐Ÿš€ Starting example handler plugin..."); console.info(`๐Ÿ“‹ Parameters:`, JSON.stringify(params, null, 2)); - try { - // Validate required parameters - if (!params.destinationAddress) { - throw new Error("destinationAddress is required"); - } - - // Default values - const relayerId = params.relayerId || "sepolia-example"; - const amount = params.amount || 1; - const message = params.message || "Hello from OpenZeppelin Relayer Plugin!"; - - console.info(`๐Ÿ’ฐ Sending ${amount} wei to ${params.destinationAddress}`); - console.info(`๐Ÿ“ Message: ${message}`); - console.info(`๐Ÿ”— Using relayer: ${relayerId}`); - - // Get the relayer instance - const relayer = api.useRelayer(relayerId); - - // Send the transaction - console.info("๐Ÿ“ค Submitting transaction..."); - const result = await relayer.sendTransaction({ - to: params.destinationAddress, - value: amount, - data: "0x", // Empty data for simple ETH transfer - gas_limit: 21000, - speed: Speed.FAST, - }); - - console.info(`โœ… Transaction submitted!`); - console.info(`๐Ÿ“‹ Transaction ID: ${result.id}`); - console.info(`โณ Status: ${result.status}`); - - // Wait for the transaction to be mined - console.info("โณ Waiting for transaction confirmation..."); - const confirmation = await result.wait({ - interval: 5000, // Check every 5 seconds - timeout: 120000 // Timeout after 2 minutes - }); - - console.info(`๐ŸŽ‰ Transaction confirmed!`); - console.info(`๐Ÿ“‹ Final status: ${confirmation.status}`); - console.info(`๐Ÿ”— Transaction hash: ${confirmation.hash || 'pending'}`); - - // Return success result - return { - success: true, - transactionId: result.id, - transactionHash: confirmation.hash || null, - message: `Successfully sent ${amount} wei to ${params.destinationAddress}. ${message}`, - timestamp: new Date().toISOString() - }; - - } catch (error) { - console.error("โŒ Plugin execution failed:", error); - - // Return error result - return { - success: false, - transactionId: "", - transactionHash: null, - message: `Plugin failed: ${(error as Error).message}`, - timestamp: new Date().toISOString() - }; - } + return new Date().toISOString(); + + // try { + // // Validate required parameters + // if (!params.destinationAddress) { + // throw new Error("destinationAddress is required"); + // } + + // // Default values + // const relayerId = params.relayerId || "sepolia-example"; + // const amount = params.amount || 1; + // const message = params.message || "Hello from OpenZeppelin Relayer Plugin!"; + + // console.info(`๐Ÿ’ฐ Sending ${amount} wei to ${params.destinationAddress}`); + // console.info(`๐Ÿ“ Message: ${message}`); + // console.info(`๐Ÿ”— Using relayer: ${relayerId}`); + + // // Get the relayer instance + // const relayer = api.useRelayer(relayerId); + + // // Send the transaction + // console.info("๐Ÿ“ค Submitting transaction..."); + // const result = await relayer.sendTransaction({ + // to: params.destinationAddress, + // value: amount, + // data: "0x", // Empty data for simple ETH transfer + // gas_limit: 21000, + // speed: Speed.FAST, + // }); + + // console.info(`โœ… Transaction submitted!`); + // console.info(`๐Ÿ“‹ Transaction ID: ${result.id}`); + // console.info(`โณ Status: ${result.status}`); + + // // Wait for the transaction to be mined + // console.info("โณ Waiting for transaction confirmation..."); + // const confirmation = await result.wait({ + // interval: 5000, // Check every 5 seconds + // timeout: 120000 // Timeout after 2 minutes + // }); + + // console.info(`๐ŸŽ‰ Transaction confirmed!`); + // console.info(`๐Ÿ“‹ Final status: ${confirmation.status}`); + // console.info(`๐Ÿ”— Transaction hash: ${confirmation.hash || 'pending'}`); + + // // Return success result + // return { + // success: true, + // transactionId: result.id, + // transactionHash: confirmation.hash || null, + // message: `Successfully sent ${amount} wei to ${params.destinationAddress}. ${message}`, + // timestamp: new Date().toISOString() + // }; + + // } catch (error) { + // console.error("โŒ Plugin execution failed:", error); + + // // Return error result + // return { + // success: false, + // transactionId: "", + // transactionHash: null, + // message: `Plugin failed: ${(error as Error).message}`, + // timestamp: new Date().toISOString() + // }; + // } } diff --git a/examples/basic-example-plugin/test-plugin/package.json b/examples/basic-example-plugin/test-plugin/package.json index f27c9f4a9..24f3acad8 100644 --- a/examples/basic-example-plugin/test-plugin/package.json +++ b/examples/basic-example-plugin/test-plugin/package.json @@ -13,7 +13,7 @@ "author": "", "license": "", "dependencies": { - "@openzeppelin/relayer-sdk": "^1.6.0", + "@openzeppelin/relayer-sdk": "^1.8.0", "@types/node": "^24.0.3", "ethers": "^6.14.3", "uuid": "^11.1.0" diff --git a/examples/basic-example-plugin/test-plugin/pnpm-lock.yaml b/examples/basic-example-plugin/test-plugin/pnpm-lock.yaml index 81f3e65a1..76cd1878e 100644 --- a/examples/basic-example-plugin/test-plugin/pnpm-lock.yaml +++ b/examples/basic-example-plugin/test-plugin/pnpm-lock.yaml @@ -1,14 +1,16 @@ ---- lockfileVersion: '9.0' + settings: autoInstallPeers: true excludeLinksFromLockfile: false + importers: + .: dependencies: '@openzeppelin/relayer-sdk': - specifier: ^1.6.0 - version: 1.6.0 + specifier: ^1.8.0 + version: 1.8.0 '@types/node': specifier: ^24.0.3 version: 24.2.0 @@ -37,151 +39,193 @@ importers: typescript: specifier: ^5.3.3 version: 5.9.2 + packages: + '@adraffy/ens-normalize@1.10.1': resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} + '@babel/compat-data@7.28.0': resolution: {integrity: sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==} engines: {node: '>=6.9.0'} + '@babel/core@7.28.0': resolution: {integrity: sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==} engines: {node: '>=6.9.0'} + '@babel/generator@7.28.0': resolution: {integrity: sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==} engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.27.2': resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} + '@babel/helper-globals@7.28.0': resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} + '@babel/helper-module-imports@7.27.1': resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} engines: {node: '>=6.9.0'} + '@babel/helper-module-transforms@7.27.3': resolution: {integrity: sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 + '@babel/helper-plugin-utils@7.27.1': resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.27.1': resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.27.1': resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.27.1': resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} + '@babel/helpers@7.28.2': resolution: {integrity: sha512-/V9771t+EgXz62aCcyofnQhGM8DQACbRhvzKFsXKC9QM+5MadF8ZmIm0crDMaz3+o0h0zXfJnd4EhbYbxsrcFw==} engines: {node: '>=6.9.0'} + '@babel/parser@7.28.0': resolution: {integrity: sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==} engines: {node: '>=6.0.0'} hasBin: true + '@babel/plugin-syntax-async-generators@7.8.4': resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-bigint@7.8.3': resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-class-properties@7.12.13': resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-class-static-block@7.14.5': resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-attributes@7.27.1': resolution: {integrity: sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-meta@7.10.4': resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-json-strings@7.8.3': resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-jsx@7.27.1': resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-numeric-separator@7.10.4': resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-object-rest-spread@7.8.3': resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-optional-catch-binding@7.8.3': resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-optional-chaining@7.8.3': resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-private-property-in-object@7.14.5': resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-top-level-await@7.14.5': resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-typescript@7.27.1': resolution: {integrity: sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} + '@babel/traverse@7.28.0': resolution: {integrity: sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==} engines: {node: '>=6.9.0'} + '@babel/types@7.28.2': resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==} engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@istanbuljs/load-nyc-config@1.1.0': resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} + '@istanbuljs/schema@0.1.3': resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} + '@jest/console@29.7.0': resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/core@29.7.0': resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -190,21 +234,27 @@ packages: peerDependenciesMeta: node-notifier: optional: true + '@jest/environment@29.7.0': resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/expect-utils@29.7.0': resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/expect@29.7.0': resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/fake-timers@29.7.0': resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/globals@29.7.0': resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/reporters@29.7.0': resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -213,193 +263,266 @@ packages: peerDependenciesMeta: node-notifier: optional: true + '@jest/schemas@29.6.3': resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/source-map@29.6.3': resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/test-result@29.7.0': resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/test-sequencer@29.7.0': resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/transform@29.7.0': resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/types@29.6.3': resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jridgewell/gen-mapping@0.3.12': resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==} + '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} + '@jridgewell/sourcemap-codec@1.5.4': resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==} + '@jridgewell/trace-mapping@0.3.29': resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==} + '@noble/curves@1.2.0': resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/hashes@1.3.2': resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} - '@openzeppelin/relayer-sdk@1.6.0': - resolution: {integrity: sha512-UjL4TLz4tvCY1ssE3wf47FU+/2vE/bJ5HoXyufUsidL5bRXwf6ziwWZWUa0YsPiGEQNdVtsuoUR9qqHjxYqlXg==} + + '@openzeppelin/relayer-sdk@1.8.0': + resolution: {integrity: sha512-2nMn9Sg0j52kp/GdhavvL8zgwRJqDqXq4yM1uYewfYndns6WGUS3zxcDICgHenMVURo8YWdJG7E7Ockck3SNFg==} engines: {node: '>=22.14.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} + '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + '@types/babel__generator@7.27.0': resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + '@types/babel__template@7.4.4': resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + '@types/babel__traverse@7.28.0': resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + '@types/istanbul-lib-report@3.0.3': resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + '@types/jest@29.5.14': resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + '@types/node@22.7.5': resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + '@types/node@24.2.0': resolution: {integrity: sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==} + '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/uuid@10.0.0': resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} + '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} + aes-js@4.0.0-beta.5: resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} engines: {node: '>=10'} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + axios@1.11.0: resolution: {integrity: sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==} + babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 + babel-plugin-istanbul@6.1.1: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} + babel-plugin-jest-hoist@29.6.3: resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + babel-preset-current-node-syntax@1.2.0: resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} peerDependencies: '@babel/core': ^7.0.0 || ^8.0.0-0 + babel-preset-jest@29.6.3: resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + brace-expansion@1.1.12: resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + browserslist@4.25.1: resolution: {integrity: sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + bs-logger@0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} engines: {node: '>= 6'} + bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + bufferutil@4.0.9: resolution: {integrity: sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==} engines: {node: '>=6.14.2'} + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} + camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + caniuse-lite@1.0.30001731: resolution: {integrity: sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} + ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} + cjs-module-lexer@1.4.3: resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} + co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + create-jest@29.7.0: resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} + debug@4.4.1: resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} engines: {node: '>=6.0'} @@ -408,6 +531,7 @@ packages: peerDependenciesMeta: supports-color: optional: true + dedent@1.6.0: resolution: {integrity: sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==} peerDependencies: @@ -415,74 +539,99 @@ packages: peerDependenciesMeta: babel-plugin-macros: optional: true + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} + diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + electron-to-chromium@1.5.194: resolution: {integrity: sha512-SdnWJwSUot04UR51I2oPD8kuP2VI37/CADR1OHsFOUzZIvfWJBO6q11k5P/uKNyTT3cdOsnyjkrZ+DDShqYqJA==} + emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} + es-errors@1.3.0: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} + es-set-tostringtag@2.1.0: resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-string-regexp@2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} + esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true + ethers@6.15.0: resolution: {integrity: sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ==} engines: {node: '>=14.0.0'} + execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} + expect@29.7.0: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} + follow-redirects@1.15.11: resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} engines: {node: '>=4.0'} @@ -491,124 +640,164 @@ packages: peerDependenciesMeta: debug: optional: true + form-data@4.0.4: resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==} engines: {node: '>= 6'} + fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: - - darwin + os: [darwin] + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} + get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} + get-proto@1.0.1: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} + get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} hasBin: true + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + has-symbols@1.1.0: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} hasBin: true + import-local@3.2.0: resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} engines: {node: '>=8'} hasBin: true + imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + inflight@1.0.6: resolution: {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. + inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + is-core-module@2.16.1: resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-generator-fn@2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} + is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} + istanbul-lib-instrument@5.2.1: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} + istanbul-lib-instrument@6.0.3: resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} engines: {node: '>=10'} + istanbul-lib-report@3.0.1: resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} engines: {node: '>=10'} + istanbul-lib-source-maps@4.0.1: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} + istanbul-reports@3.1.7: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} + jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-circus@29.7.0: resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-cli@29.7.0: resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -618,6 +807,7 @@ packages: peerDependenciesMeta: node-notifier: optional: true + jest-config@29.7.0: resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -629,36 +819,47 @@ packages: optional: true ts-node: optional: true + jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-docblock@29.7.0: resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-each@29.7.0: resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-environment-node@29.7.0: resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-get-type@29.6.3: resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-haste-map@29.7.0: resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-leak-detector@29.7.0: resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-matcher-utils@29.7.0: resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-message-util@29.7.0: resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-mock@29.7.0: resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-pnp-resolver@1.2.3: resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} @@ -667,36 +868,47 @@ packages: peerDependenciesMeta: jest-resolve: optional: true + jest-regex-util@29.6.3: resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-resolve-dependencies@29.7.0: resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-resolve@29.7.0: resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-runner@29.7.0: resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-runtime@29.7.0: resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-snapshot@29.7.0: resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-util@29.7.0: resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-validate@29.7.0: resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-watcher@29.7.0: resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-worker@29.7.0: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest@29.7.0: resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -706,218 +918,297 @@ packages: peerDependenciesMeta: node-notifier: optional: true + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true + jsesc@3.1.0: resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} hasBin: true + json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true + kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} + leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} + lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} + make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} + mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} + mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + node-gyp-build@4.8.4: resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true + node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} + npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} + p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} + p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} + p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} + p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} + parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + pirates@4.0.7: resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} + pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + pure-rand@6.1.0: resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} + resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} + resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + resolve.exports@2.0.3: resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} engines: {node: '>=10'} + resolve@1.22.10: resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} engines: {node: '>= 0.4'} hasBin: true + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true + semver@7.7.2: resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} engines: {node: '>=10'} hasBin: true + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} + shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} + string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-bom@4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} + strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} + supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} + supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} + tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + ts-jest@29.4.1: resolution: {integrity: sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -944,59 +1235,78 @@ packages: optional: true jest-util: optional: true + tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} + type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} + type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} + typescript@5.9.2: resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} engines: {node: '>=14.17'} hasBin: true + uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} hasBin: true + undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici-types@7.10.0: resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + update-browserslist-db@1.1.3: resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' + utf-8-validate@5.0.10: resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} engines: {node: '>=6.14.2'} + uuid@11.1.0: resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} hasBin: true + v8-to-istanbul@9.3.0: resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} engines: {node: '>=10.12.0'} + walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} hasBin: true + wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + write-file-atomic@4.0.2: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + ws@8.17.1: resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} @@ -1008,32 +1318,43 @@ packages: optional: true utf-8-validate: optional: true + y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + snapshots: + '@adraffy/ens-normalize@1.10.1': {} + '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.12 '@jridgewell/trace-mapping': 0.3.29 + '@babel/code-frame@7.27.1': dependencies: '@babel/helper-validator-identifier': 7.27.1 js-tokens: 4.0.0 picocolors: 1.1.1 + '@babel/compat-data@7.28.0': {} + '@babel/core@7.28.0': dependencies: '@ampproject/remapping': 2.3.0 @@ -1053,6 +1374,7 @@ snapshots: semver: 6.3.1 transitivePeerDependencies: - supports-color + '@babel/generator@7.28.0': dependencies: '@babel/parser': 7.28.0 @@ -1060,6 +1382,7 @@ snapshots: '@jridgewell/gen-mapping': 0.3.12 '@jridgewell/trace-mapping': 0.3.29 jsesc: 3.1.0 + '@babel/helper-compilation-targets@7.27.2': dependencies: '@babel/compat-data': 7.28.0 @@ -1067,13 +1390,16 @@ snapshots: browserslist: 4.25.1 lru-cache: 5.1.1 semver: 6.3.1 + '@babel/helper-globals@7.28.0': {} + '@babel/helper-module-imports@7.27.1': dependencies: '@babel/traverse': 7.28.0 '@babel/types': 7.28.2 transitivePeerDependencies: - supports-color + '@babel/helper-module-transforms@7.27.3(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 @@ -1082,90 +1408,115 @@ snapshots: '@babel/traverse': 7.28.0 transitivePeerDependencies: - supports-color + '@babel/helper-plugin-utils@7.27.1': {} + '@babel/helper-string-parser@7.27.1': {} + '@babel/helper-validator-identifier@7.27.1': {} + '@babel/helper-validator-option@7.27.1': {} + '@babel/helpers@7.28.2': dependencies: '@babel/template': 7.27.2 '@babel/types': 7.28.2 + '@babel/parser@7.28.0': dependencies: '@babel/types': 7.28.2 + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 '@babel/helper-plugin-utils': 7.27.1 + '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 '@babel/parser': 7.28.0 '@babel/types': 7.28.2 + '@babel/traverse@7.28.0': dependencies: '@babel/code-frame': 7.27.1 @@ -1177,11 +1528,14 @@ snapshots: debug: 4.4.1 transitivePeerDependencies: - supports-color + '@babel/types@7.28.2': dependencies: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 + '@bcoe/v8-coverage@0.2.3': {} + '@istanbuljs/load-nyc-config@1.1.0': dependencies: camelcase: 5.3.1 @@ -1189,7 +1543,9 @@ snapshots: get-package-type: 0.1.0 js-yaml: 3.14.1 resolve-from: 5.0.0 + '@istanbuljs/schema@0.1.3': {} + '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 @@ -1198,6 +1554,7 @@ snapshots: jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 + '@jest/core@29.7.0': dependencies: '@jest/console': 29.7.0 @@ -1232,21 +1589,25 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + '@jest/environment@29.7.0': dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/node': 24.2.0 jest-mock: 29.7.0 + '@jest/expect-utils@29.7.0': dependencies: jest-get-type: 29.6.3 + '@jest/expect@29.7.0': dependencies: expect: 29.7.0 jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color + '@jest/fake-timers@29.7.0': dependencies: '@jest/types': 29.6.3 @@ -1255,6 +1616,7 @@ snapshots: jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 + '@jest/globals@29.7.0': dependencies: '@jest/environment': 29.7.0 @@ -1263,6 +1625,7 @@ snapshots: jest-mock: 29.7.0 transitivePeerDependencies: - supports-color + '@jest/reporters@29.7.0': dependencies: '@bcoe/v8-coverage': 0.2.3 @@ -1291,26 +1654,31 @@ snapshots: v8-to-istanbul: 9.3.0 transitivePeerDependencies: - supports-color + '@jest/schemas@29.6.3': dependencies: '@sinclair/typebox': 0.27.8 + '@jest/source-map@29.6.3': dependencies: '@jridgewell/trace-mapping': 0.3.29 callsites: 3.1.0 graceful-fs: 4.2.11 + '@jest/test-result@29.7.0': dependencies: '@jest/console': 29.7.0 '@jest/types': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 collect-v8-coverage: 1.0.2 + '@jest/test-sequencer@29.7.0': dependencies: '@jest/test-result': 29.7.0 graceful-fs: 4.2.11 jest-haste-map: 29.7.0 slash: 3.0.0 + '@jest/transform@29.7.0': dependencies: '@babel/core': 7.28.0 @@ -1330,6 +1698,7 @@ snapshots: write-file-atomic: 4.0.2 transitivePeerDependencies: - supports-color + '@jest/types@29.6.3': dependencies: '@jest/schemas': 29.6.3 @@ -1338,32 +1707,43 @@ snapshots: '@types/node': 24.2.0 '@types/yargs': 17.0.33 chalk: 4.1.2 + '@jridgewell/gen-mapping@0.3.12': dependencies: '@jridgewell/sourcemap-codec': 1.5.4 '@jridgewell/trace-mapping': 0.3.29 + '@jridgewell/resolve-uri@3.1.2': {} + '@jridgewell/sourcemap-codec@1.5.4': {} + '@jridgewell/trace-mapping@0.3.29': dependencies: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.4 + '@noble/curves@1.2.0': dependencies: '@noble/hashes': 1.3.2 + '@noble/hashes@1.3.2': {} - '@openzeppelin/relayer-sdk@1.6.0': + + '@openzeppelin/relayer-sdk@1.8.0': dependencies: axios: 1.11.0 transitivePeerDependencies: - debug + '@sinclair/typebox@0.27.8': {} + '@sinonjs/commons@3.0.1': dependencies: type-detect: 4.0.8 + '@sinonjs/fake-timers@10.3.0': dependencies: '@sinonjs/commons': 3.0.1 + '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.28.0 @@ -1371,59 +1751,82 @@ snapshots: '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.28.0 + '@types/babel__generator@7.27.0': dependencies: '@babel/types': 7.28.2 + '@types/babel__template@7.4.4': dependencies: '@babel/parser': 7.28.0 '@babel/types': 7.28.2 + '@types/babel__traverse@7.28.0': dependencies: '@babel/types': 7.28.2 + '@types/graceful-fs@4.1.9': dependencies: '@types/node': 24.2.0 + '@types/istanbul-lib-coverage@2.0.6': {} + '@types/istanbul-lib-report@3.0.3': dependencies: '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports@3.0.4': dependencies: '@types/istanbul-lib-report': 3.0.3 + '@types/jest@29.5.14': dependencies: expect: 29.7.0 pretty-format: 29.7.0 + '@types/node@22.7.5': dependencies: undici-types: 6.19.8 + '@types/node@24.2.0': dependencies: undici-types: 7.10.0 + '@types/stack-utils@2.0.3': {} + '@types/uuid@10.0.0': {} + '@types/yargs-parser@21.0.3': {} + '@types/yargs@17.0.33': dependencies: '@types/yargs-parser': 21.0.3 + aes-js@4.0.0-beta.5: {} + ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 + ansi-regex@5.0.1: {} + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 + ansi-styles@5.2.0: {} + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 + argparse@1.0.10: dependencies: sprintf-js: 1.0.3 + asynckit@0.4.0: {} + axios@1.11.0: dependencies: follow-redirects: 1.15.11 @@ -1431,6 +1834,7 @@ snapshots: proxy-from-env: 1.1.0 transitivePeerDependencies: - debug + babel-jest@29.7.0(@babel/core@7.28.0): dependencies: '@babel/core': 7.28.0 @@ -1443,6 +1847,7 @@ snapshots: slash: 3.0.0 transitivePeerDependencies: - supports-color + babel-plugin-istanbul@6.1.1: dependencies: '@babel/helper-plugin-utils': 7.27.1 @@ -1452,12 +1857,14 @@ snapshots: test-exclude: 6.0.0 transitivePeerDependencies: - supports-color + babel-plugin-jest-hoist@29.6.3: dependencies: '@babel/template': 7.27.2 '@babel/types': 7.28.2 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.28.0 + babel-preset-current-node-syntax@1.2.0(@babel/core@7.28.0): dependencies: '@babel/core': 7.28.0 @@ -1476,67 +1883,94 @@ snapshots: '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.28.0) '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.28.0) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.28.0) + babel-preset-jest@29.6.3(@babel/core@7.28.0): dependencies: '@babel/core': 7.28.0 babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.0) + balanced-match@1.0.2: {} + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + braces@3.0.3: dependencies: fill-range: 7.1.1 + browserslist@4.25.1: dependencies: caniuse-lite: 1.0.30001731 electron-to-chromium: 1.5.194 node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.25.1) + bs-logger@0.2.6: dependencies: fast-json-stable-stringify: 2.1.0 + bser@2.1.1: dependencies: node-int64: 0.4.0 + buffer-from@1.1.2: {} + bufferutil@4.0.9: dependencies: node-gyp-build: 4.8.4 optional: true + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 function-bind: 1.1.2 + callsites@3.1.0: {} + camelcase@5.3.1: {} + camelcase@6.3.0: {} + caniuse-lite@1.0.30001731: {} + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + char-regex@1.0.2: {} + ci-info@3.9.0: {} + cjs-module-lexer@1.4.3: {} + cliui@8.0.1: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + co@4.6.0: {} + collect-v8-coverage@1.0.2: {} + color-convert@2.0.1: dependencies: color-name: 1.1.4 + color-name@1.1.4: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 + concat-map@0.0.1: {} + convert-source-map@2.0.0: {} + create-jest@29.7.0(@types/node@24.2.0): dependencies: '@jest/types': 29.6.3 @@ -1551,44 +1985,64 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 + debug@4.4.1: dependencies: ms: 2.1.3 + dedent@1.6.0: {} + deepmerge@4.3.1: {} + delayed-stream@1.0.0: {} + detect-newline@3.1.0: {} + diff-sequences@29.6.3: {} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 es-errors: 1.3.0 gopd: 1.2.0 + electron-to-chromium@1.5.194: {} + emittery@0.13.1: {} + emoji-regex@8.0.0: {} + error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 + es-define-property@1.0.1: {} + es-errors@1.3.0: {} + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 + es-set-tostringtag@2.1.0: dependencies: es-errors: 1.3.0 get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 + escalade@3.2.0: {} + escape-string-regexp@2.0.0: {} + esprima@4.0.1: {} + ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): dependencies: '@adraffy/ens-normalize': 1.10.1 @@ -1601,6 +2055,7 @@ snapshots: transitivePeerDependencies: - bufferutil - utf-8-validate + execa@5.1.1: dependencies: cross-spawn: 7.0.6 @@ -1612,7 +2067,9 @@ snapshots: onetime: 5.1.2 signal-exit: 3.0.7 strip-final-newline: 2.0.0 + exit@0.1.2: {} + expect@29.7.0: dependencies: '@jest/expect-utils': 29.7.0 @@ -1620,18 +2077,24 @@ snapshots: jest-matcher-utils: 29.7.0 jest-message-util: 29.7.0 jest-util: 29.7.0 + fast-json-stable-stringify@2.1.0: {} + fb-watchman@2.0.2: dependencies: bser: 2.1.1 + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 + find-up@4.1.0: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 + follow-redirects@1.15.11: {} + form-data@4.0.4: dependencies: asynckit: 0.4.0 @@ -1639,12 +2102,18 @@ snapshots: es-set-tostringtag: 2.1.0 hasown: 2.0.2 mime-types: 2.1.35 + fs.realpath@1.0.0: {} + fsevents@2.3.3: optional: true + function-bind@1.1.2: {} + gensync@1.0.0-beta.2: {} + get-caller-file@2.0.5: {} + get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 @@ -1657,12 +2126,16 @@ snapshots: has-symbols: 1.1.0 hasown: 2.0.2 math-intrinsics: 1.1.0 + get-package-type@0.1.0: {} + get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 + get-stream@6.0.1: {} + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -1671,8 +2144,11 @@ snapshots: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + gopd@1.2.0: {} + graceful-fs@4.2.11: {} + handlebars@4.7.8: dependencies: minimist: 1.2.8 @@ -1681,37 +2157,57 @@ snapshots: wordwrap: 1.0.0 optionalDependencies: uglify-js: 3.19.3 + has-flag@4.0.0: {} + has-symbols@1.1.0: {} + has-tostringtag@1.0.2: dependencies: has-symbols: 1.1.0 + hasown@2.0.2: dependencies: function-bind: 1.1.2 + html-escaper@2.0.2: {} + human-signals@2.1.0: {} + husky@9.1.7: {} + import-local@3.2.0: dependencies: pkg-dir: 4.2.0 resolve-cwd: 3.0.0 + imurmurhash@0.1.4: {} + inflight@1.0.6: dependencies: once: 1.4.0 wrappy: 1.0.2 + inherits@2.0.4: {} + is-arrayish@0.2.1: {} + is-core-module@2.16.1: dependencies: hasown: 2.0.2 + is-fullwidth-code-point@3.0.0: {} + is-generator-fn@2.1.0: {} + is-number@7.0.0: {} + is-stream@2.0.1: {} + isexe@2.0.0: {} + istanbul-lib-coverage@3.2.2: {} + istanbul-lib-instrument@5.2.1: dependencies: '@babel/core': 7.28.0 @@ -1721,6 +2217,7 @@ snapshots: semver: 6.3.1 transitivePeerDependencies: - supports-color + istanbul-lib-instrument@6.0.3: dependencies: '@babel/core': 7.28.0 @@ -1730,11 +2227,13 @@ snapshots: semver: 7.7.2 transitivePeerDependencies: - supports-color + istanbul-lib-report@3.0.1: dependencies: istanbul-lib-coverage: 3.2.2 make-dir: 4.0.0 supports-color: 7.2.0 + istanbul-lib-source-maps@4.0.1: dependencies: debug: 4.4.1 @@ -1742,15 +2241,18 @@ snapshots: source-map: 0.6.1 transitivePeerDependencies: - supports-color + istanbul-reports@3.1.7: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 + jest-changed-files@29.7.0: dependencies: execa: 5.1.1 jest-util: 29.7.0 p-limit: 3.1.0 + jest-circus@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -1776,6 +2278,7 @@ snapshots: transitivePeerDependencies: - babel-plugin-macros - supports-color + jest-cli@29.7.0(@types/node@24.2.0): dependencies: '@jest/core': 29.7.0 @@ -1794,6 +2297,7 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + jest-config@29.7.0(@types/node@24.2.0): dependencies: '@babel/core': 7.28.0 @@ -1823,15 +2327,18 @@ snapshots: transitivePeerDependencies: - babel-plugin-macros - supports-color + jest-diff@29.7.0: dependencies: chalk: 4.1.2 diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 + jest-docblock@29.7.0: dependencies: detect-newline: 3.1.0 + jest-each@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -1839,6 +2346,7 @@ snapshots: jest-get-type: 29.6.3 jest-util: 29.7.0 pretty-format: 29.7.0 + jest-environment-node@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -1847,7 +2355,9 @@ snapshots: '@types/node': 24.2.0 jest-mock: 29.7.0 jest-util: 29.7.0 + jest-get-type@29.6.3: {} + jest-haste-map@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -1863,16 +2373,19 @@ snapshots: walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 + jest-leak-detector@29.7.0: dependencies: jest-get-type: 29.6.3 pretty-format: 29.7.0 + jest-matcher-utils@29.7.0: dependencies: chalk: 4.1.2 jest-diff: 29.7.0 jest-get-type: 29.6.3 pretty-format: 29.7.0 + jest-message-util@29.7.0: dependencies: '@babel/code-frame': 7.27.1 @@ -1884,21 +2397,26 @@ snapshots: pretty-format: 29.7.0 slash: 3.0.0 stack-utils: 2.0.6 + jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 '@types/node': 24.2.0 jest-util: 29.7.0 + jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): optionalDependencies: jest-resolve: 29.7.0 + jest-regex-util@29.6.3: {} + jest-resolve-dependencies@29.7.0: dependencies: jest-regex-util: 29.6.3 jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color + jest-resolve@29.7.0: dependencies: chalk: 4.1.2 @@ -1910,6 +2428,7 @@ snapshots: resolve: 1.22.10 resolve.exports: 2.0.3 slash: 3.0.0 + jest-runner@29.7.0: dependencies: '@jest/console': 29.7.0 @@ -1935,6 +2454,7 @@ snapshots: source-map-support: 0.5.13 transitivePeerDependencies: - supports-color + jest-runtime@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -1961,6 +2481,7 @@ snapshots: strip-bom: 4.0.0 transitivePeerDependencies: - supports-color + jest-snapshot@29.7.0: dependencies: '@babel/core': 7.28.0 @@ -1985,6 +2506,7 @@ snapshots: semver: 7.7.2 transitivePeerDependencies: - supports-color + jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -1993,6 +2515,7 @@ snapshots: ci-info: 3.9.0 graceful-fs: 4.2.11 picomatch: 2.3.1 + jest-validate@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -2001,6 +2524,7 @@ snapshots: jest-get-type: 29.6.3 leven: 3.1.0 pretty-format: 29.7.0 + jest-watcher@29.7.0: dependencies: '@jest/test-result': 29.7.0 @@ -2011,12 +2535,14 @@ snapshots: emittery: 0.13.1 jest-util: 29.7.0 string-length: 4.0.2 + jest-worker@29.7.0: dependencies: '@types/node': 24.2.0 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 + jest@29.7.0(@types/node@24.2.0): dependencies: '@jest/core': 29.7.0 @@ -2028,163 +2554,242 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + js-tokens@4.0.0: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 esprima: 4.0.1 + jsesc@3.1.0: {} + json-parse-even-better-errors@2.3.1: {} + json5@2.2.3: {} + kleur@3.0.3: {} + leven@3.1.0: {} + lines-and-columns@1.2.4: {} + locate-path@5.0.0: dependencies: p-locate: 4.1.0 + lodash.memoize@4.1.2: {} + lru-cache@5.1.1: dependencies: yallist: 3.1.1 + make-dir@4.0.0: dependencies: semver: 7.7.2 + make-error@1.3.6: {} + makeerror@1.0.12: dependencies: tmpl: 1.0.5 + math-intrinsics@1.1.0: {} + merge-stream@2.0.0: {} + micromatch@4.0.8: dependencies: braces: 3.0.3 picomatch: 2.3.1 + mime-db@1.52.0: {} + mime-types@2.1.35: dependencies: mime-db: 1.52.0 + mimic-fn@2.1.0: {} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.12 + minimist@1.2.8: {} + ms@2.1.3: {} + natural-compare@1.4.0: {} + neo-async@2.6.2: {} + node-gyp-build@4.8.4: optional: true + node-int64@0.4.0: {} + node-releases@2.0.19: {} + normalize-path@3.0.0: {} + npm-run-path@4.0.1: dependencies: path-key: 3.1.1 + once@1.4.0: dependencies: wrappy: 1.0.2 + onetime@5.1.2: dependencies: mimic-fn: 2.1.0 + p-limit@2.3.0: dependencies: p-try: 2.2.0 + p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 + p-locate@4.1.0: dependencies: p-limit: 2.3.0 + p-try@2.2.0: {} + parse-json@5.2.0: dependencies: '@babel/code-frame': 7.27.1 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + path-exists@4.0.0: {} + path-is-absolute@1.0.1: {} + path-key@3.1.1: {} + path-parse@1.0.7: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} + pirates@4.0.7: {} + pkg-dir@4.2.0: dependencies: find-up: 4.1.0 + pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 react-is: 18.3.1 + prompts@2.4.2: dependencies: kleur: 3.0.3 sisteransi: 1.0.5 + proxy-from-env@1.1.0: {} + pure-rand@6.1.0: {} + react-is@18.3.1: {} + require-directory@2.1.1: {} + resolve-cwd@3.0.0: dependencies: resolve-from: 5.0.0 + resolve-from@5.0.0: {} + resolve.exports@2.0.3: {} + resolve@1.22.10: dependencies: is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + semver@6.3.1: {} + semver@7.7.2: {} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 + shebang-regex@3.0.0: {} + signal-exit@3.0.7: {} + sisteransi@1.0.5: {} + slash@3.0.0: {} + source-map-support@0.5.13: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 + source-map@0.6.1: {} + sprintf-js@1.0.3: {} + stack-utils@2.0.6: dependencies: escape-string-regexp: 2.0.0 + string-length@4.0.2: dependencies: char-regex: 1.0.2 strip-ansi: 6.0.1 + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 + strip-bom@4.0.0: {} + strip-final-newline@2.0.0: {} + strip-json-comments@3.1.1: {} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 + supports-color@8.1.1: dependencies: has-flag: 4.0.0 + supports-preserve-symlinks-flag@1.0.0: {} + test-exclude@6.0.0: dependencies: '@istanbuljs/schema': 0.1.3 glob: 7.2.3 minimatch: 3.1.2 + tmpl@1.0.5: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - ? ts-jest@29.4.1(@babel/core@7.28.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.2.0))(typescript@5.9.2) - : dependencies: + + ts-jest@29.4.1(@babel/core@7.28.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.2.0))(typescript@5.9.2): + dependencies: bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 handlebars: 4.7.8 @@ -2202,54 +2807,77 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.28.0) jest-util: 29.7.0 + tslib@2.7.0: {} + type-detect@4.0.8: {} + type-fest@0.21.3: {} + type-fest@4.41.0: {} + typescript@5.9.2: {} + uglify-js@3.19.3: optional: true + undici-types@6.19.8: {} + undici-types@7.10.0: {} + update-browserslist-db@1.1.3(browserslist@4.25.1): dependencies: browserslist: 4.25.1 escalade: 3.2.0 picocolors: 1.1.1 + utf-8-validate@5.0.10: dependencies: node-gyp-build: 4.8.4 optional: true + uuid@11.1.0: {} + v8-to-istanbul@9.3.0: dependencies: '@jridgewell/trace-mapping': 0.3.29 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 + walker@1.0.8: dependencies: makeerror: 1.0.12 + which@2.0.2: dependencies: isexe: 2.0.0 + wordwrap@1.0.0: {} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + wrappy@1.0.2: {} + write-file-atomic@4.0.2: dependencies: imurmurhash: 0.1.4 signal-exit: 3.0.7 + ws@8.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.9 utf-8-validate: 5.0.10 + y18n@5.0.8: {} + yallist@3.1.1: {} + yargs-parser@21.1.1: {} + yargs@17.7.2: dependencies: cliui: 8.0.1 @@ -2259,4 +2887,5 @@ snapshots: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + yocto-queue@0.1.0: {} diff --git a/plugins/lib/build-executor.ts b/plugins/lib/build-executor.ts new file mode 100644 index 000000000..a11c47fc7 --- /dev/null +++ b/plugins/lib/build-executor.ts @@ -0,0 +1,46 @@ +#!/usr/bin/env ts-node +/** + * Build script to pre-compile sandbox-executor.ts + * + * Run this during build/release to generate sandbox-executor.js + * This avoids any runtime compilation overhead. + * + * Usage: npx ts-node build-executor.ts + */ + +import * as esbuild from 'esbuild'; +import * as path from 'node:path'; +import * as fs from 'node:fs'; + +async function build() { + const inputPath = path.resolve(__dirname, 'sandbox-executor.ts'); + const outputPath = path.resolve(__dirname, 'sandbox-executor.js'); + + console.log('Compiling sandbox-executor.ts...'); + + const result = await esbuild.build({ + entryPoints: [inputPath], + bundle: true, + platform: 'node', + target: 'node18', + format: 'cjs', + sourcemap: false, + write: true, + outfile: outputPath, + loader: { '.ts': 'ts' }, + external: ['node:*'], + }); + + if (result.errors.length > 0) { + console.error('Build failed:', result.errors); + process.exit(1); + } + + const stats = fs.statSync(outputPath); + console.log(`โœ“ Compiled to ${outputPath} (${(stats.size / 1024).toFixed(1)} KB)`); +} + +build().catch((err) => { + console.error('Build failed:', err); + process.exit(1); +}); diff --git a/plugins/lib/compiler.ts b/plugins/lib/compiler.ts new file mode 100644 index 000000000..8db14a62a --- /dev/null +++ b/plugins/lib/compiler.ts @@ -0,0 +1,157 @@ +/** + * Plugin Compiler Module + * + * Uses esbuild for fast in-memory TypeScript โ†’ JavaScript compilation. + * No filesystem writes - compiled code is returned for storage in memory/Redis. + */ + +import * as esbuild from 'esbuild'; +import type { Message } from 'esbuild'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; + +export interface CompilationResult { + /** The compiled JavaScript code */ + code: string; + /** Source map (optional, for debugging) */ + sourceMap?: string; + /** Compilation warnings */ + warnings: string[]; +} + +export interface CompilerOptions { + /** Target ECMAScript version */ + target?: 'es2020' | 'es2021' | 'es2022' | 'esnext'; + /** Whether to generate source maps */ + sourcemap?: boolean; + /** Whether to minify the output */ + minify?: boolean; +} + +const DEFAULT_OPTIONS: Required = { + target: 'es2022', + sourcemap: false, + minify: false, +}; + +/** + * Compiles a TypeScript plugin file to JavaScript in-memory using esbuild. + * + * @param pluginPath - Path to the TypeScript plugin file + * @param options - Compilation options + * @returns Compiled JavaScript code and metadata + */ +export async function compilePlugin( + pluginPath: string, + options: CompilerOptions = {} +): Promise { + const opts = { ...DEFAULT_OPTIONS, ...options }; + + // Read the source file + const absolutePath = path.isAbsolute(pluginPath) + ? pluginPath + : path.resolve(process.cwd(), pluginPath); + + const sourceCode = await fs.promises.readFile(absolutePath, 'utf-8'); + + return compilePluginSource(sourceCode, pluginPath, opts); +} + +/** + * Compiles TypeScript source code to JavaScript in-memory. + * This variant accepts source code directly (useful when code is already in memory). + * + * @param sourceCode - TypeScript source code + * @param sourcePath - Original path (for error messages and source maps) + * @param options - Compilation options + * @returns Compiled JavaScript code and metadata + */ +export async function compilePluginSource( + sourceCode: string, + sourcePath: string, + options: CompilerOptions = {} +): Promise { + const opts = { ...DEFAULT_OPTIONS, ...options }; + + try { + const result = await esbuild.transform(sourceCode, { + loader: 'ts', + target: opts.target, + sourcemap: opts.sourcemap ? 'inline' : false, + minify: opts.minify, + sourcefile: sourcePath, + format: 'cjs', // CommonJS for vm.Script compatibility + platform: 'node', + // Don't bundle - we want to keep imports for the sandbox to resolve + // The sandbox will provide the necessary globals + }); + + const warnings = result.warnings.map((w: Message) => { + const location = w.location + ? `${w.location.file}:${w.location.line}:${w.location.column}` + : sourcePath; + return `${location}: ${w.text}`; + }); + + return { + code: result.code, + sourceMap: result.map || undefined, + warnings, + }; + } catch (error) { + if (error instanceof Error) { + throw new Error(`Failed to compile plugin ${sourcePath}: ${error.message}`); + } + throw error; + } +} + +/** + * Batch compile multiple plugins. + * + * @param pluginPaths - Array of plugin file paths + * @param options - Compilation options + * @returns Map of plugin path to compilation result + */ +export async function compilePlugins( + pluginPaths: string[], + options: CompilerOptions = {} +): Promise> { + const results = new Map(); + + // Compile in parallel for better performance + const compilations = await Promise.allSettled( + pluginPaths.map(async (pluginPath) => { + const result = await compilePlugin(pluginPath, options); + return { pluginPath, result }; + }) + ); + + for (const compilation of compilations) { + if (compilation.status === 'fulfilled') { + results.set(compilation.value.pluginPath, compilation.value.result); + } else { + // Log compilation errors but continue with other plugins + console.error(`Compilation failed: ${compilation.reason}`); + } + } + + return results; +} + +/** + * Creates a wrapped version of compiled code that exports the handler. + * This wrapping is necessary for vm.Script execution. + * + * @param compiledCode - The compiled JavaScript code + * @returns Wrapped code ready for vm.Script + */ +export function wrapForVm(compiledCode: string): string { + // The compiled code uses CommonJS (module.exports / exports.handler) + // We wrap it to capture the exports in the vm context + return ` +(function(exports, require, module, __filename, __dirname) { +${compiledCode} +}); +`; +} diff --git a/plugins/lib/constants.ts b/plugins/lib/constants.ts new file mode 100644 index 000000000..fd6ad7dd1 --- /dev/null +++ b/plugins/lib/constants.ts @@ -0,0 +1,41 @@ +/** + * Plugin Pool Constants + * + * These values should match src/constants/plugins.rs which is the source of truth. + * When updating these values, ensure the Rust constants are updated as well. + */ + +// ============================================================================= +// Pool Configuration +// ============================================================================= + +/** Default minimum worker threads */ +export const DEFAULT_POOL_MIN_THREADS = 2; + +/** Divisor for calculating minThreads from CPU count (cpuCount / divisor) */ +export const DEFAULT_POOL_MIN_THREADS_DIVISOR = 2; + +/** Default maximum worker threads floor (minimum threads even on small machines) */ +export const DEFAULT_POOL_MAX_THREADS_FLOOR = 8; + +/** Default concurrent tasks per worker thread */ +export const DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER = 10; + +/** Default worker idle timeout in milliseconds */ +export const DEFAULT_POOL_IDLE_TIMEOUT_MS = 60000; // 60 seconds + +/** Default socket connection backlog for high concurrency */ +export const DEFAULT_POOL_SOCKET_BACKLOG = 1024; + +/** Default plugin execution timeout in milliseconds */ +export const DEFAULT_POOL_EXECUTION_TIMEOUT_MS = 30000; // 30 seconds + +// ============================================================================= +// Worker Pool Specific (may differ from pool-server defaults) +// ============================================================================= + +/** Higher thread floor for standalone worker pool usage */ +export const DEFAULT_WORKER_POOL_MAX_THREADS_FLOOR = 16; + +/** Higher concurrency for I/O bound tasks in worker pool */ +export const DEFAULT_WORKER_POOL_CONCURRENT_TASKS_PER_WORKER = 20; diff --git a/plugins/lib/kv.ts b/plugins/lib/kv.ts index 89dbb8059..8631eb8ae 100644 --- a/plugins/lib/kv.ts +++ b/plugins/lib/kv.ts @@ -274,4 +274,20 @@ export class DefaultPluginKVStore implements PluginKVStore { await this.client.eval(this.UNLOCK_SCRIPT, 1, lockKey, token); } } + + /** + * Explicitly connect to Redis. + * Normally not needed since lazyConnect will connect on first command. + */ + async connect(): Promise { + await this.client.connect(); + } + + /** + * Disconnect from Redis. + * Call this when the store is no longer needed. + */ + async disconnect(): Promise { + await this.client.disconnect(); + } } diff --git a/plugins/lib/pool-server.ts b/plugins/lib/pool-server.ts new file mode 100644 index 000000000..d82e06747 --- /dev/null +++ b/plugins/lib/pool-server.ts @@ -0,0 +1,627 @@ +#!/usr/bin/env node + +/** + * Pool Server + * + * Long-running Node.js process that manages the Piscina worker pool. + * Communicates with Rust via Unix socket using JSON-line protocol. + * + * Protocol: + * - Each message is a single JSON line terminated by \n + * - Request: { type: "execute", taskId, pluginId, compiledCode?, pluginPath?, params, headers?, socketPath, httpRequestId?, timeout? } + * - Request: { type: "precompile", taskId, pluginId, pluginPath?, sourceCode? } + * - Request: { type: "cache", taskId, pluginId, compiledCode } + * - Request: { type: "invalidate", taskId, pluginId } + * - Request: { type: "stats", taskId } + * - Request: { type: "shutdown", taskId } + * - Response: { taskId, success, result?, error?, logs? } + * + * Environment Variables for tuning (high concurrency e.g., 1000+ parallel requests): + * - PLUGIN_POOL_DEBUG: Set to 'true' to enable debug logging + * - PLUGIN_POOL_MAX_THREADS: Maximum worker threads (default: CPU count or 8, whichever is higher) + * - PLUGIN_POOL_CONCURRENT_TASKS: Concurrent tasks per worker (default: 10) + * - PLUGIN_POOL_IDLE_TIMEOUT: Idle timeout in ms (default: 60000) + * - PLUGIN_POOL_BACKLOG: Socket connection backlog (default: 1024) + * - PLUGIN_POOL_MAX_CONNECTIONS: Max Rust->Pool connections (default: 64, set in Rust) + */ + +import * as net from 'node:net'; +import * as fs from 'node:fs'; +import { WorkerPoolManager, type PluginExecutionRequest } from './worker-pool'; +import { compilePlugin, compilePluginSource } from './compiler'; +import { + DEFAULT_POOL_MIN_THREADS, + DEFAULT_POOL_MIN_THREADS_DIVISOR, + DEFAULT_POOL_MAX_THREADS_FLOOR, + DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, + DEFAULT_POOL_IDLE_TIMEOUT_MS, + DEFAULT_POOL_SOCKET_BACKLOG, +} from './constants'; + +// Debug logging helper +const DEBUG = process.env.PLUGIN_POOL_DEBUG === 'true'; +function debug(...args: any[]): void { + if (DEBUG) { + console.error('[pool-server]', ...args); + } +} + +// Message types +interface BaseMessage { + type: string; + taskId: string; +} + +interface ExecuteMessage extends BaseMessage { + type: 'execute'; + pluginId: string; + compiledCode?: string; + pluginPath?: string; + params: any; + headers?: Record; + socketPath: string; + httpRequestId?: string; + timeout?: number; +} + +interface PrecompileMessage extends BaseMessage { + type: 'precompile'; + pluginId: string; + pluginPath?: string; + sourceCode?: string; +} + +interface CacheMessage extends BaseMessage { + type: 'cache'; + pluginId: string; + compiledCode: string; +} + +interface InvalidateMessage extends BaseMessage { + type: 'invalidate'; + pluginId: string; +} + +interface StatsMessage extends BaseMessage { + type: 'stats'; +} + +interface HealthMessage extends BaseMessage { + type: 'health'; +} + +interface ShutdownMessage extends BaseMessage { + type: 'shutdown'; +} + +type Message = + | ExecuteMessage + | PrecompileMessage + | CacheMessage + | InvalidateMessage + | StatsMessage + | HealthMessage + | ShutdownMessage; + +interface Response { + taskId: string; + success: boolean; + result?: any; + error?: { + message: string; + code?: string; + status?: number; + details?: any; + }; + logs?: Array<{ level: string; message: string }>; +} + +/** + * Pool Server - manages worker pool and handles requests from Rust + */ +class PoolServer { + private pool: WorkerPoolManager; + private server: net.Server | null = null; + private socketPath: string; + private running: boolean = false; + + constructor(socketPath: string) { + this.socketPath = socketPath; + + // Default to number of CPUs for worker threads, with higher concurrency per worker + // For 1000+ parallel requests, tune via environment variables + const cpuCount = require('os').cpus().length; + const maxThreads = parseInt( + process.env.PLUGIN_POOL_MAX_THREADS || String(Math.max(cpuCount, DEFAULT_POOL_MAX_THREADS_FLOOR)), + 10 + ); + const concurrentTasksPerWorker = parseInt( + process.env.PLUGIN_POOL_CONCURRENT_TASKS || String(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER), + 10 + ); + const idleTimeout = parseInt( + process.env.PLUGIN_POOL_IDLE_TIMEOUT || String(DEFAULT_POOL_IDLE_TIMEOUT_MS), + 10 + ); + + debug(`Initializing pool with maxThreads=${maxThreads}, concurrentTasksPerWorker=${concurrentTasksPerWorker}`); + + this.pool = new WorkerPoolManager({ + minThreads: Math.max(DEFAULT_POOL_MIN_THREADS, Math.floor(cpuCount / DEFAULT_POOL_MIN_THREADS_DIVISOR)), + maxThreads, + concurrentTasksPerWorker, + idleTimeout, + }); + } + + /** + * Start the pool server + */ + async start(): Promise { + debug('Initializing worker pool...'); + // Initialize the worker pool + await this.pool.initialize(); + debug('Worker pool initialized'); + + // Clean up any existing socket file + try { + fs.unlinkSync(this.socketPath); + debug('Removed existing socket file'); + } catch { + // Ignore if doesn't exist + } + + // Create Unix socket server with high connection backlog for bursts + this.server = net.createServer((socket) => { + debug('net.createServer callback - new connection'); + this.handleConnection(socket); + }); + + // Don't set maxConnections at all - the default is unlimited + // Setting it to 0 might reject all connections! + // this.server.maxConnections = 0; // REMOVED + + // Log any server-level errors + this.server.on('error', (err) => { + console.error('[pool-server] Server error:', err); + }); + + this.server.on('connection', (socket) => { + debug('Server connection event from:', socket.remoteAddress); + }); + + // Backlog for pending connections (default 511, increase for high concurrency) + const backlog = parseInt(process.env.PLUGIN_POOL_BACKLOG || String(DEFAULT_POOL_SOCKET_BACKLOG), 10); + + return new Promise((resolve, reject) => { + this.server!.on('error', (err) => { + console.error('[pool-server] Listen error:', err); + reject(err); + }); + + this.server!.listen(this.socketPath, backlog, () => { + this.running = true; + debug(`Listening on ${this.socketPath} (backlog=${backlog})`); + + // Verify the socket file exists + try { + const stats = fs.statSync(this.socketPath); + debug(`Socket file verified: mode=${stats.mode.toString(8)}, isSocket=${stats.isSocket()}`); + } catch (e: any) { + console.warn(`[pool-server] Socket file check failed:`, e.message); + } + + // Verify server state + const addr = this.server!.address(); + debug(`Server address:`, addr); + debug(`Server listening:`, this.server!.listening); + + resolve(); + }); + }); + } + + /** + * Handle a client connection + */ + private handleConnection(socket: net.Socket): void { + const clientId = Math.random().toString(36).substring(7); + debug(`[${clientId}] Client connected`); + + // Enable keep-alive to prevent connection drops + socket.setKeepAlive(true, 30000); // 30 second keep-alive probe + socket.setNoDelay(true); // Disable Nagle's algorithm for lower latency + + let buffer = ''; + let processing = false; + const pendingLines: string[] = []; + + const processQueue = async () => { + if (processing) return; + processing = true; + + while (pendingLines.length > 0) { + const line = pendingLines.shift()!; + if (!line.trim()) continue; + + try { + const message = JSON.parse(line) as Message; + debug('Processing message type:', message.type); + const response = await this.handleMessage(message); + debug('Sending response for task:', response.taskId); + // Check if socket is still writable before writing + if (socket.writable) { + socket.write(JSON.stringify(response) + '\n'); + } else { + debug('Socket no longer writable, discarding response'); + } + } catch (err) { + const error = err as Error; + debug('Error handling message:', error); + const response: Response = { + taskId: 'unknown', + success: false, + error: { + message: error.message || 'Failed to parse message', + code: 'PARSE_ERROR', + }, + }; + if (socket.writable) { + socket.write(JSON.stringify(response) + '\n'); + } + } + } + + processing = false; + }; + + socket.on('data', (data) => { + buffer += data.toString(); + debug(`[${clientId}] Received data: ${data.length} bytes, buffer: ${buffer.length}`); + debug(`[${clientId}] Buffer content: ${buffer.substring(0, 200)}...`); + + // Extract complete messages (newline-delimited) + let newlineIndex; + while ((newlineIndex = buffer.indexOf('\n')) !== -1) { + const line = buffer.slice(0, newlineIndex); + buffer = buffer.slice(newlineIndex + 1); + pendingLines.push(line); + debug(`[${clientId}] Queued message: ${line.substring(0, 100)}...`); + } + + // Process queue (async but don't await here) + processQueue().catch((err) => { + console.error(`[pool-server] [${clientId}] Error in processQueue:`, err); + }); + }); + + socket.on('error', (err) => { + // Connection resets are normal during shutdown, don't log as errors + if ((err as any).code === 'ECONNRESET') { + debug(`[${clientId}] Connection reset`); + } else { + console.warn(`[pool-server] [${clientId}] Socket error:`, err.message); + } + }); + + socket.on('close', () => { + debug(`[${clientId}] Client disconnected`); + }); + } + + /** + * Handle a message from Rust + */ + private async handleMessage(message: Message): Promise { + const { taskId } = message; + + try { + switch (message.type) { + case 'execute': + return await this.handleExecute(message); + + case 'precompile': + return await this.handlePrecompile(message); + + case 'cache': + return this.handleCache(message); + + case 'invalidate': + return this.handleInvalidate(message); + + case 'stats': + return this.handleStats(message); + + case 'health': + return this.handleHealth(message); + + case 'shutdown': + return await this.handleShutdown(message); + + default: + return { + taskId, + success: false, + error: { + message: `Unknown message type: ${(message as any).type}`, + code: 'UNKNOWN_MESSAGE_TYPE', + }, + }; + } + } catch (err) { + const error = err as Error; + return { + taskId, + success: false, + error: { + message: error.message || String(err), + code: 'HANDLER_ERROR', + }, + }; + } + } + + /** + * Execute a plugin + */ + private async handleExecute(message: ExecuteMessage): Promise { + debug('handleExecute called with:', JSON.stringify({ + pluginId: message.pluginId, + pluginPath: message.pluginPath, + hasCompiledCode: !!message.compiledCode, + socketPath: message.socketPath, + timeout: message.timeout, + })); + + const request: PluginExecutionRequest = { + pluginId: message.pluginId, + pluginPath: message.pluginPath, + compiledCode: message.compiledCode, + params: message.params, + headers: message.headers, + socketPath: message.socketPath, + httpRequestId: message.httpRequestId, + timeout: message.timeout, + }; + + try { + debug('Calling pool.runPlugin...'); + const result = await this.pool.runPlugin(request); + debug('runPlugin returned:', JSON.stringify({ + success: result.success, + hasResult: !!result.result, + hasError: !!result.error, + })); + + return { + taskId: message.taskId, + success: result.success, + result: result.result, + error: result.error, + logs: result.logs, + }; + } catch (err) { + debug('runPlugin threw error:', err); + const error = err as any; + + // Provide detailed error context + return { + taskId: message.taskId, + success: false, + error: { + message: error?.message || String(err), + code: error?.code || 'POOL_EXECUTION_ERROR', + status: typeof error?.status === 'number' ? error.status : 500, + details: { + pluginId: message.pluginId, + errorType: error?.name || 'Error', + stack: error?.stack?.split('\n').slice(0, 5).join('\n'), + }, + }, + logs: [], + }; + } + } + + /** + * Precompile a plugin + */ + private async handlePrecompile(message: PrecompileMessage): Promise { + let compilationResult; + + if (message.sourceCode) { + compilationResult = await this.pool.precompilePluginSource( + message.pluginId, + message.sourceCode + ); + } else if (message.pluginPath) { + compilationResult = await this.pool.precompilePlugin(message.pluginPath); + } else { + return { + taskId: message.taskId, + success: false, + error: { + message: 'Either sourceCode or pluginPath is required for precompilation', + code: 'MISSING_SOURCE', + }, + }; + } + + return { + taskId: message.taskId, + success: true, + result: { + code: compilationResult.code, + warnings: compilationResult.warnings, + }, + }; + } + + /** + * Cache compiled code + */ + private handleCache(message: CacheMessage): Response { + this.pool.cacheCompiledCode(message.pluginId, message.compiledCode); + return { + taskId: message.taskId, + success: true, + }; + } + + /** + * Invalidate cached plugin + */ + private handleInvalidate(message: InvalidateMessage): Response { + this.pool.invalidatePlugin(message.pluginId); + return { + taskId: message.taskId, + success: true, + }; + } + + /** + * Get pool statistics + */ + private handleStats(message: StatsMessage): Response { + const stats = this.pool.getStats(); + return { + taskId: message.taskId, + success: true, + result: stats, + }; + } + + /** + * Health check - returns basic health status + */ + private handleHealth(message: HealthMessage): Response { + const stats = this.pool.getStats(); + const memUsage = process.memoryUsage(); + + return { + taskId: message.taskId, + success: true, + result: { + status: 'healthy', + uptime: stats.uptime, + memory: { + heapUsed: memUsage.heapUsed, + heapTotal: memUsage.heapTotal, + rss: memUsage.rss, + }, + pool: stats.pool ? { + completed: stats.pool.completed, + queued: stats.pool.queued, + } : null, + execution: { + total: stats.execution.total, + successRate: stats.execution.successRate, + }, + }, + }; + } + + /** + * Shutdown the server + */ + private async handleShutdown(message: ShutdownMessage): Promise { + // Send response first, then shutdown + setTimeout(async () => { + await this.stop(); + process.exit(0); + }, 100); + + return { + taskId: message.taskId, + success: true, + }; + } + + /** + * Stop the server + */ + async stop(): Promise { + this.running = false; + + if (this.server) { + await new Promise((resolve) => { + this.server!.close(() => resolve()); + }); + this.server = null; + } + + await this.pool.shutdown(); + + // Clean up socket file + try { + fs.unlinkSync(this.socketPath); + } catch { + // Ignore + } + + console.log('Pool server stopped'); + } +} + +// Main entry point +async function main(): Promise { + const socketPath = process.argv[2] || process.env.PLUGIN_POOL_SOCKET || '/tmp/plugin-pool.sock'; + + debug('Starting with socket path:', socketPath); + + const server = new PoolServer(socketPath); + + // Handle uncaught exceptions to prevent silent crashes + process.on('uncaughtException', (err) => { + console.error('[pool-server] Uncaught exception:', err); + }); + + process.on('unhandledRejection', (reason, promise) => { + console.error('[pool-server] Unhandled rejection at:', promise, 'reason:', reason); + }); + + // Handle signals for graceful shutdown + process.on('SIGINT', async () => { + debug('Received SIGINT, shutting down...'); + await server.stop(); + process.exit(0); + }); + + process.on('SIGTERM', async () => { + debug('Received SIGTERM, shutting down...'); + await server.stop(); + process.exit(0); + }); + + try { + await server.start(); + debug('Server started successfully, listening on', socketPath); + // Write ready signal to stdout for Rust to detect + console.log('POOL_SERVER_READY'); + + // Keep the process alive forever - the server will handle connections + debug('Entering event loop, waiting for connections...'); + + // Periodic heartbeat to verify event loop is running (debug mode only) + if (process.env.PLUGIN_POOL_DEBUG) { + let heartbeatCount = 0; + setInterval(() => { + heartbeatCount++; + if (heartbeatCount <= 5 || heartbeatCount % 60 === 0) { + debug(`Heartbeat #${heartbeatCount} - event loop is running`); + } + }, 1000); + } + + // Keep process alive + await new Promise(() => {}); + } catch (err) { + console.error('[pool-server] Failed to start pool server:', err); + process.exit(1); + } +} + +main().catch((err) => { + console.error('[pool-server] Fatal error in main:', err); + process.exit(1); +}); diff --git a/plugins/lib/sandbox-executor.js b/plugins/lib/sandbox-executor.js new file mode 100644 index 000000000..e058b4576 --- /dev/null +++ b/plugins/lib/sandbox-executor.js @@ -0,0 +1,31772 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json +var require_commands = __commonJS({ + "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json"(exports2, module2) { + module2.exports = { + acl: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + append: { + arity: 3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + asking: { + arity: 1, + flags: [ + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + auth: { + arity: -2, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "no_auth", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + bgrewriteaof: { + arity: 1, + flags: [ + "admin", + "noscript", + "no_async_loading" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + bgsave: { + arity: -1, + flags: [ + "admin", + "noscript", + "no_async_loading" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + bitcount: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + bitfield: { + arity: -2, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + bitfield_ro: { + arity: -2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + bitop: { + arity: -4, + flags: [ + "write", + "denyoom" + ], + keyStart: 2, + keyStop: -1, + step: 1 + }, + bitpos: { + arity: -3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + blmove: { + arity: 6, + flags: [ + "write", + "denyoom", + "noscript", + "blocking" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + blmpop: { + arity: -5, + flags: [ + "write", + "blocking", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + blpop: { + arity: -3, + flags: [ + "write", + "noscript", + "blocking" + ], + keyStart: 1, + keyStop: -2, + step: 1 + }, + brpop: { + arity: -3, + flags: [ + "write", + "noscript", + "blocking" + ], + keyStart: 1, + keyStop: -2, + step: 1 + }, + brpoplpush: { + arity: 4, + flags: [ + "write", + "denyoom", + "noscript", + "blocking" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + bzmpop: { + arity: -5, + flags: [ + "write", + "blocking", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + bzpopmax: { + arity: -3, + flags: [ + "write", + "noscript", + "blocking", + "fast" + ], + keyStart: 1, + keyStop: -2, + step: 1 + }, + bzpopmin: { + arity: -3, + flags: [ + "write", + "noscript", + "blocking", + "fast" + ], + keyStart: 1, + keyStop: -2, + step: 1 + }, + client: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + cluster: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + command: { + arity: -1, + flags: [ + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + config: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + copy: { + arity: -3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + dbsize: { + arity: 1, + flags: [ + "readonly", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + debug: { + arity: -2, + flags: [ + "admin", + "noscript", + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + decr: { + arity: 2, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + decrby: { + arity: 3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + del: { + arity: -2, + flags: [ + "write" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + discard: { + arity: 1, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + dump: { + arity: 2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + echo: { + arity: 2, + flags: [ + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + eval: { + arity: -3, + flags: [ + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + eval_ro: { + arity: -3, + flags: [ + "readonly", + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + evalsha: { + arity: -3, + flags: [ + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + evalsha_ro: { + arity: -3, + flags: [ + "readonly", + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + exec: { + arity: 1, + flags: [ + "noscript", + "loading", + "stale", + "skip_slowlog" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + exists: { + arity: -2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + expire: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + expireat: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + expiretime: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + failover: { + arity: -1, + flags: [ + "admin", + "noscript", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + fcall: { + arity: -3, + flags: [ + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + fcall_ro: { + arity: -3, + flags: [ + "readonly", + "noscript", + "stale", + "skip_monitor", + "no_mandatory_keys", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + flushall: { + arity: -1, + flags: [ + "write" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + flushdb: { + arity: -1, + flags: [ + "write" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + function: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + geoadd: { + arity: -5, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + geodist: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + geohash: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + geopos: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + georadius: { + arity: -6, + flags: [ + "write", + "denyoom", + "movablekeys" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + georadius_ro: { + arity: -6, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + georadiusbymember: { + arity: -5, + flags: [ + "write", + "denyoom", + "movablekeys" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + georadiusbymember_ro: { + arity: -5, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + geosearch: { + arity: -7, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + geosearchstore: { + arity: -8, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + get: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + getbit: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + getdel: { + arity: 2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + getex: { + arity: -2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + getrange: { + arity: 4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + getset: { + arity: 3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hdel: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hello: { + arity: -1, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "no_auth", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + hexists: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hexpire: { + arity: -6, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hpexpire: { + arity: -6, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hget: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hgetall: { + arity: 2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hincrby: { + arity: 4, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hincrbyfloat: { + arity: 4, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hkeys: { + arity: 2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hlen: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hmget: { + arity: -3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hmset: { + arity: -4, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hrandfield: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hscan: { + arity: -3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hset: { + arity: -4, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hsetnx: { + arity: 4, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hstrlen: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + hvals: { + arity: 2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + incr: { + arity: 2, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + incrby: { + arity: 3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + incrbyfloat: { + arity: 3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + info: { + arity: -1, + flags: [ + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + keys: { + arity: 2, + flags: [ + "readonly" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + lastsave: { + arity: 1, + flags: [ + "loading", + "stale", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + latency: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + lcs: { + arity: -3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + lindex: { + arity: 3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + linsert: { + arity: 5, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + llen: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + lmove: { + arity: 5, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + lmpop: { + arity: -4, + flags: [ + "write", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + lolwut: { + arity: -1, + flags: [ + "readonly", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + lpop: { + arity: -2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + lpos: { + arity: -3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + lpush: { + arity: -3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + lpushx: { + arity: -3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + lrange: { + arity: 4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + lrem: { + arity: 4, + flags: [ + "write" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + lset: { + arity: 4, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + ltrim: { + arity: 4, + flags: [ + "write" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + memory: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + mget: { + arity: -2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + migrate: { + arity: -6, + flags: [ + "write", + "movablekeys" + ], + keyStart: 3, + keyStop: 3, + step: 1 + }, + module: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + monitor: { + arity: 1, + flags: [ + "admin", + "noscript", + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + move: { + arity: 3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + mset: { + arity: -3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: -1, + step: 2 + }, + msetnx: { + arity: -3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: -1, + step: 2 + }, + multi: { + arity: 1, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + object: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + persist: { + arity: 2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + pexpire: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + pexpireat: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + pexpiretime: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + pfadd: { + arity: -2, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + pfcount: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + pfdebug: { + arity: 3, + flags: [ + "write", + "denyoom", + "admin" + ], + keyStart: 2, + keyStop: 2, + step: 1 + }, + pfmerge: { + arity: -2, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + pfselftest: { + arity: 1, + flags: [ + "admin" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + ping: { + arity: -1, + flags: [ + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + psetex: { + arity: 4, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + psubscribe: { + arity: -2, + flags: [ + "pubsub", + "noscript", + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + psync: { + arity: -3, + flags: [ + "admin", + "noscript", + "no_async_loading", + "no_multi" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + pttl: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + publish: { + arity: 3, + flags: [ + "pubsub", + "loading", + "stale", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + pubsub: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + punsubscribe: { + arity: -1, + flags: [ + "pubsub", + "noscript", + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + quit: { + arity: -1, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "no_auth", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + randomkey: { + arity: 1, + flags: [ + "readonly" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + readonly: { + arity: 1, + flags: [ + "loading", + "stale", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + readwrite: { + arity: 1, + flags: [ + "loading", + "stale", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + rename: { + arity: 3, + flags: [ + "write" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + renamenx: { + arity: 3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + replconf: { + arity: -1, + flags: [ + "admin", + "noscript", + "loading", + "stale", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + replicaof: { + arity: 3, + flags: [ + "admin", + "noscript", + "stale", + "no_async_loading" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + reset: { + arity: 1, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "no_auth", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + restore: { + arity: -4, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + "restore-asking": { + arity: -4, + flags: [ + "write", + "denyoom", + "asking" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + role: { + arity: 1, + flags: [ + "noscript", + "loading", + "stale", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + rpop: { + arity: -2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + rpoplpush: { + arity: 3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + rpush: { + arity: -3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + rpushx: { + arity: -3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + sadd: { + arity: -3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + save: { + arity: 1, + flags: [ + "admin", + "noscript", + "no_async_loading", + "no_multi" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + scan: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + scard: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + script: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + sdiff: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + sdiffstore: { + arity: -3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + select: { + arity: 2, + flags: [ + "loading", + "stale", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + set: { + arity: -3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + setbit: { + arity: 4, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + setex: { + arity: 4, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + setnx: { + arity: 3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + setrange: { + arity: 4, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + shutdown: { + arity: -1, + flags: [ + "admin", + "noscript", + "loading", + "stale", + "no_multi", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + sinter: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + sintercard: { + arity: -3, + flags: [ + "readonly", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + sinterstore: { + arity: -3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + sismember: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + slaveof: { + arity: 3, + flags: [ + "admin", + "noscript", + "stale", + "no_async_loading" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + slowlog: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + smembers: { + arity: 2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + smismember: { + arity: -3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + smove: { + arity: 4, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + sort: { + arity: -2, + flags: [ + "write", + "denyoom", + "movablekeys" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + sort_ro: { + arity: -2, + flags: [ + "readonly", + "movablekeys" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + spop: { + arity: -2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + spublish: { + arity: 3, + flags: [ + "pubsub", + "loading", + "stale", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + srandmember: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + srem: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + sscan: { + arity: -3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + ssubscribe: { + arity: -2, + flags: [ + "pubsub", + "noscript", + "loading", + "stale" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + strlen: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + subscribe: { + arity: -2, + flags: [ + "pubsub", + "noscript", + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + substr: { + arity: 4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + sunion: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + sunionstore: { + arity: -3, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + sunsubscribe: { + arity: -1, + flags: [ + "pubsub", + "noscript", + "loading", + "stale" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + swapdb: { + arity: 3, + flags: [ + "write", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + sync: { + arity: 1, + flags: [ + "admin", + "noscript", + "no_async_loading", + "no_multi" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + time: { + arity: 1, + flags: [ + "loading", + "stale", + "fast" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + touch: { + arity: -2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + ttl: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + type: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + unlink: { + arity: -2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + unsubscribe: { + arity: -1, + flags: [ + "pubsub", + "noscript", + "loading", + "stale" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + unwatch: { + arity: 1, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "allow_busy" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + wait: { + arity: 3, + flags: [ + "noscript" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + watch: { + arity: -2, + flags: [ + "noscript", + "loading", + "stale", + "fast", + "allow_busy" + ], + keyStart: 1, + keyStop: -1, + step: 1 + }, + xack: { + arity: -4, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xadd: { + arity: -5, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xautoclaim: { + arity: -6, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xclaim: { + arity: -6, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xdel: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xdelex: { + arity: -5, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xgroup: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + xinfo: { + arity: -2, + flags: [], + keyStart: 0, + keyStop: 0, + step: 0 + }, + xlen: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xpending: { + arity: -3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xrange: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xread: { + arity: -4, + flags: [ + "readonly", + "blocking", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + xreadgroup: { + arity: -7, + flags: [ + "write", + "blocking", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + xrevrange: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xsetid: { + arity: -3, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + xtrim: { + arity: -4, + flags: [ + "write" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zadd: { + arity: -4, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zcard: { + arity: 2, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zcount: { + arity: 4, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zdiff: { + arity: -3, + flags: [ + "readonly", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + zdiffstore: { + arity: -4, + flags: [ + "write", + "denyoom", + "movablekeys" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zincrby: { + arity: 4, + flags: [ + "write", + "denyoom", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zinter: { + arity: -3, + flags: [ + "readonly", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + zintercard: { + arity: -3, + flags: [ + "readonly", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + zinterstore: { + arity: -4, + flags: [ + "write", + "denyoom", + "movablekeys" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zlexcount: { + arity: 4, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zmpop: { + arity: -4, + flags: [ + "write", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + zmscore: { + arity: -3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zpopmax: { + arity: -2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zpopmin: { + arity: -2, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrandmember: { + arity: -2, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrange: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrangebylex: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrangebyscore: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrangestore: { + arity: -5, + flags: [ + "write", + "denyoom" + ], + keyStart: 1, + keyStop: 2, + step: 1 + }, + zrank: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrem: { + arity: -3, + flags: [ + "write", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zremrangebylex: { + arity: 4, + flags: [ + "write" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zremrangebyrank: { + arity: 4, + flags: [ + "write" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zremrangebyscore: { + arity: 4, + flags: [ + "write" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrevrange: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrevrangebylex: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrevrangebyscore: { + arity: -4, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zrevrank: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zscan: { + arity: -3, + flags: [ + "readonly" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zscore: { + arity: 3, + flags: [ + "readonly", + "fast" + ], + keyStart: 1, + keyStop: 1, + step: 1 + }, + zunion: { + arity: -3, + flags: [ + "readonly", + "movablekeys" + ], + keyStart: 0, + keyStop: 0, + step: 0 + }, + zunionstore: { + arity: -4, + flags: [ + "write", + "denyoom", + "movablekeys" + ], + keyStart: 1, + keyStop: 1, + step: 1 + } + }; + } +}); + +// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js +var require_built = __commonJS({ + "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js"(exports2) { + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getKeyIndexes = exports2.hasFlag = exports2.exists = exports2.list = void 0; + var commands_json_1 = __importDefault(require_commands()); + exports2.list = Object.keys(commands_json_1.default); + var flags = {}; + exports2.list.forEach((commandName) => { + flags[commandName] = commands_json_1.default[commandName].flags.reduce(function(flags2, flag) { + flags2[flag] = true; + return flags2; + }, {}); + }); + function exists(commandName) { + return Boolean(commands_json_1.default[commandName]); + } + exports2.exists = exists; + function hasFlag(commandName, flag) { + if (!flags[commandName]) { + throw new Error("Unknown command " + commandName); + } + return Boolean(flags[commandName][flag]); + } + exports2.hasFlag = hasFlag; + function getKeyIndexes(commandName, args, options) { + const command = commands_json_1.default[commandName]; + if (!command) { + throw new Error("Unknown command " + commandName); + } + if (!Array.isArray(args)) { + throw new Error("Expect args to be an array"); + } + const keys = []; + const parseExternalKey = Boolean(options && options.parseExternalKey); + const takeDynamicKeys = (args2, startIndex) => { + const keys2 = []; + const keyStop = Number(args2[startIndex]); + for (let i = 0; i < keyStop; i++) { + keys2.push(i + startIndex + 1); + } + return keys2; + }; + const takeKeyAfterToken = (args2, startIndex, token) => { + for (let i = startIndex; i < args2.length - 1; i += 1) { + if (String(args2[i]).toLowerCase() === token.toLowerCase()) { + return i + 1; + } + } + return null; + }; + switch (commandName) { + case "zunionstore": + case "zinterstore": + case "zdiffstore": + keys.push(0, ...takeDynamicKeys(args, 1)); + break; + case "eval": + case "evalsha": + case "eval_ro": + case "evalsha_ro": + case "fcall": + case "fcall_ro": + case "blmpop": + case "bzmpop": + keys.push(...takeDynamicKeys(args, 1)); + break; + case "sintercard": + case "lmpop": + case "zunion": + case "zinter": + case "zmpop": + case "zintercard": + case "zdiff": { + keys.push(...takeDynamicKeys(args, 0)); + break; + } + case "georadius": { + keys.push(0); + const storeKey = takeKeyAfterToken(args, 5, "STORE"); + if (storeKey) + keys.push(storeKey); + const distKey = takeKeyAfterToken(args, 5, "STOREDIST"); + if (distKey) + keys.push(distKey); + break; + } + case "georadiusbymember": { + keys.push(0); + const storeKey = takeKeyAfterToken(args, 4, "STORE"); + if (storeKey) + keys.push(storeKey); + const distKey = takeKeyAfterToken(args, 4, "STOREDIST"); + if (distKey) + keys.push(distKey); + break; + } + case "sort": + case "sort_ro": + keys.push(0); + for (let i = 1; i < args.length - 1; i++) { + let arg = args[i]; + if (typeof arg !== "string") { + continue; + } + const directive = arg.toUpperCase(); + if (directive === "GET") { + i += 1; + arg = args[i]; + if (arg !== "#") { + if (parseExternalKey) { + keys.push([i, getExternalKeyNameLength(arg)]); + } else { + keys.push(i); + } + } + } else if (directive === "BY") { + i += 1; + if (parseExternalKey) { + keys.push([i, getExternalKeyNameLength(args[i])]); + } else { + keys.push(i); + } + } else if (directive === "STORE") { + i += 1; + keys.push(i); + } + } + break; + case "migrate": + if (args[2] === "") { + for (let i = 5; i < args.length - 1; i++) { + const arg = args[i]; + if (typeof arg === "string" && arg.toUpperCase() === "KEYS") { + for (let j = i + 1; j < args.length; j++) { + keys.push(j); + } + break; + } + } + } else { + keys.push(2); + } + break; + case "xreadgroup": + case "xread": + for (let i = commandName === "xread" ? 0 : 3; i < args.length - 1; i++) { + if (String(args[i]).toUpperCase() === "STREAMS") { + for (let j = i + 1; j <= i + (args.length - 1 - i) / 2; j++) { + keys.push(j); + } + break; + } + } + break; + default: + if (command.step > 0) { + const keyStart = command.keyStart - 1; + const keyStop = command.keyStop > 0 ? command.keyStop : args.length + command.keyStop + 1; + for (let i = keyStart; i < keyStop; i += command.step) { + keys.push(i); + } + } + break; + } + return keys; + } + exports2.getKeyIndexes = getKeyIndexes; + function getExternalKeyNameLength(key) { + if (typeof key !== "string") { + key = String(key); + } + const hashPos = key.indexOf("->"); + return hashPos === -1 ? key.length : hashPos; + } + } +}); + +// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js +var require_utils = __commonJS({ + "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.tryCatch = exports2.errorObj = void 0; + exports2.errorObj = { e: {} }; + var tryCatchTarget; + function tryCatcher(err, val) { + try { + const target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + exports2.errorObj.e = e; + return exports2.errorObj; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + exports2.tryCatch = tryCatch; + } +}); + +// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js +var require_built2 = __commonJS({ + "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var utils_1 = require_utils(); + function throwLater(e) { + setTimeout(function() { + throw e; + }, 0); + } + function asCallback(promise, nodeback, options) { + if (typeof nodeback === "function") { + promise.then((val) => { + let ret; + if (options !== void 0 && Object(options).spread && Array.isArray(val)) { + ret = utils_1.tryCatch(nodeback).apply(void 0, [null].concat(val)); + } else { + ret = val === void 0 ? utils_1.tryCatch(nodeback)(null) : utils_1.tryCatch(nodeback)(null, val); + } + if (ret === utils_1.errorObj) { + throwLater(ret.e); + } + }, (cause) => { + if (!cause) { + const newReason = new Error(cause + ""); + Object.assign(newReason, { cause }); + cause = newReason; + } + const ret = utils_1.tryCatch(nodeback)(cause); + if (ret === utils_1.errorObj) { + throwLater(ret.e); + } + }); + } + return promise; + } + exports2.default = asCallback; + } +}); + +// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js +var require_old = __commonJS({ + "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js"(exports2, module2) { + "use strict"; + var assert = require("assert"); + var util = require("util"); + function RedisError(message) { + Object.defineProperty(this, "message", { + value: message || "", + configurable: true, + writable: true + }); + Error.captureStackTrace(this, this.constructor); + } + util.inherits(RedisError, Error); + Object.defineProperty(RedisError.prototype, "name", { + value: "RedisError", + configurable: true, + writable: true + }); + function ParserError(message, buffer, offset) { + assert(buffer); + assert.strictEqual(typeof offset, "number"); + Object.defineProperty(this, "message", { + value: message || "", + configurable: true, + writable: true + }); + const tmp = Error.stackTraceLimit; + Error.stackTraceLimit = 2; + Error.captureStackTrace(this, this.constructor); + Error.stackTraceLimit = tmp; + this.offset = offset; + this.buffer = buffer; + } + util.inherits(ParserError, RedisError); + Object.defineProperty(ParserError.prototype, "name", { + value: "ParserError", + configurable: true, + writable: true + }); + function ReplyError(message) { + Object.defineProperty(this, "message", { + value: message || "", + configurable: true, + writable: true + }); + const tmp = Error.stackTraceLimit; + Error.stackTraceLimit = 2; + Error.captureStackTrace(this, this.constructor); + Error.stackTraceLimit = tmp; + } + util.inherits(ReplyError, RedisError); + Object.defineProperty(ReplyError.prototype, "name", { + value: "ReplyError", + configurable: true, + writable: true + }); + function AbortError(message) { + Object.defineProperty(this, "message", { + value: message || "", + configurable: true, + writable: true + }); + Error.captureStackTrace(this, this.constructor); + } + util.inherits(AbortError, RedisError); + Object.defineProperty(AbortError.prototype, "name", { + value: "AbortError", + configurable: true, + writable: true + }); + function InterruptError(message) { + Object.defineProperty(this, "message", { + value: message || "", + configurable: true, + writable: true + }); + Error.captureStackTrace(this, this.constructor); + } + util.inherits(InterruptError, AbortError); + Object.defineProperty(InterruptError.prototype, "name", { + value: "InterruptError", + configurable: true, + writable: true + }); + module2.exports = { + RedisError, + ParserError, + ReplyError, + AbortError, + InterruptError + }; + } +}); + +// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js +var require_modern = __commonJS({ + "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js"(exports2, module2) { + "use strict"; + var assert = require("assert"); + var RedisError = class extends Error { + get name() { + return this.constructor.name; + } + }; + var ParserError = class extends RedisError { + constructor(message, buffer, offset) { + assert(buffer); + assert.strictEqual(typeof offset, "number"); + const tmp = Error.stackTraceLimit; + Error.stackTraceLimit = 2; + super(message); + Error.stackTraceLimit = tmp; + this.offset = offset; + this.buffer = buffer; + } + get name() { + return this.constructor.name; + } + }; + var ReplyError = class extends RedisError { + constructor(message) { + const tmp = Error.stackTraceLimit; + Error.stackTraceLimit = 2; + super(message); + Error.stackTraceLimit = tmp; + } + get name() { + return this.constructor.name; + } + }; + var AbortError = class extends RedisError { + get name() { + return this.constructor.name; + } + }; + var InterruptError = class extends AbortError { + get name() { + return this.constructor.name; + } + }; + module2.exports = { + RedisError, + ParserError, + ReplyError, + AbortError, + InterruptError + }; + } +}); + +// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js +var require_redis_errors = __commonJS({ + "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js"(exports2, module2) { + "use strict"; + var Errors = process.version.charCodeAt(1) < 55 && process.version.charCodeAt(2) === 46 ? require_old() : require_modern(); + module2.exports = Errors; + } +}); + +// node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js +var require_lib = __commonJS({ + "node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js"(exports2, module2) { + var lookup = [ + 0, + 4129, + 8258, + 12387, + 16516, + 20645, + 24774, + 28903, + 33032, + 37161, + 41290, + 45419, + 49548, + 53677, + 57806, + 61935, + 4657, + 528, + 12915, + 8786, + 21173, + 17044, + 29431, + 25302, + 37689, + 33560, + 45947, + 41818, + 54205, + 50076, + 62463, + 58334, + 9314, + 13379, + 1056, + 5121, + 25830, + 29895, + 17572, + 21637, + 42346, + 46411, + 34088, + 38153, + 58862, + 62927, + 50604, + 54669, + 13907, + 9842, + 5649, + 1584, + 30423, + 26358, + 22165, + 18100, + 46939, + 42874, + 38681, + 34616, + 63455, + 59390, + 55197, + 51132, + 18628, + 22757, + 26758, + 30887, + 2112, + 6241, + 10242, + 14371, + 51660, + 55789, + 59790, + 63919, + 35144, + 39273, + 43274, + 47403, + 23285, + 19156, + 31415, + 27286, + 6769, + 2640, + 14899, + 10770, + 56317, + 52188, + 64447, + 60318, + 39801, + 35672, + 47931, + 43802, + 27814, + 31879, + 19684, + 23749, + 11298, + 15363, + 3168, + 7233, + 60846, + 64911, + 52716, + 56781, + 44330, + 48395, + 36200, + 40265, + 32407, + 28342, + 24277, + 20212, + 15891, + 11826, + 7761, + 3696, + 65439, + 61374, + 57309, + 53244, + 48923, + 44858, + 40793, + 36728, + 37256, + 33193, + 45514, + 41451, + 53516, + 49453, + 61774, + 57711, + 4224, + 161, + 12482, + 8419, + 20484, + 16421, + 28742, + 24679, + 33721, + 37784, + 41979, + 46042, + 49981, + 54044, + 58239, + 62302, + 689, + 4752, + 8947, + 13010, + 16949, + 21012, + 25207, + 29270, + 46570, + 42443, + 38312, + 34185, + 62830, + 58703, + 54572, + 50445, + 13538, + 9411, + 5280, + 1153, + 29798, + 25671, + 21540, + 17413, + 42971, + 47098, + 34713, + 38840, + 59231, + 63358, + 50973, + 55100, + 9939, + 14066, + 1681, + 5808, + 26199, + 30326, + 17941, + 22068, + 55628, + 51565, + 63758, + 59695, + 39368, + 35305, + 47498, + 43435, + 22596, + 18533, + 30726, + 26663, + 6336, + 2273, + 14466, + 10403, + 52093, + 56156, + 60223, + 64286, + 35833, + 39896, + 43963, + 48026, + 19061, + 23124, + 27191, + 31254, + 2801, + 6864, + 10931, + 14994, + 64814, + 60687, + 56684, + 52557, + 48554, + 44427, + 40424, + 36297, + 31782, + 27655, + 23652, + 19525, + 15522, + 11395, + 7392, + 3265, + 61215, + 65342, + 53085, + 57212, + 44955, + 49082, + 36825, + 40952, + 28183, + 32310, + 20053, + 24180, + 11923, + 16050, + 3793, + 7920 + ]; + var toUTF8Array = function toUTF8Array2(str) { + var char; + var i = 0; + var p = 0; + var utf8 = []; + var len = str.length; + for (; i < len; i++) { + char = str.charCodeAt(i); + if (char < 128) { + utf8[p++] = char; + } else if (char < 2048) { + utf8[p++] = char >> 6 | 192; + utf8[p++] = char & 63 | 128; + } else if ((char & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) { + char = 65536 + ((char & 1023) << 10) + (str.charCodeAt(++i) & 1023); + utf8[p++] = char >> 18 | 240; + utf8[p++] = char >> 12 & 63 | 128; + utf8[p++] = char >> 6 & 63 | 128; + utf8[p++] = char & 63 | 128; + } else { + utf8[p++] = char >> 12 | 224; + utf8[p++] = char >> 6 & 63 | 128; + utf8[p++] = char & 63 | 128; + } + } + return utf8; + }; + var generate = module2.exports = function generate2(str) { + var char; + var i = 0; + var start = -1; + var result = 0; + var resultHash = 0; + var utf8 = typeof str === "string" ? toUTF8Array(str) : str; + var len = utf8.length; + while (i < len) { + char = utf8[i++]; + if (start === -1) { + if (char === 123) { + start = i; + } + } else if (char !== 125) { + resultHash = lookup[(char ^ resultHash >> 8) & 255] ^ resultHash << 8; + } else if (i - 1 !== start) { + return resultHash & 16383; + } + result = lookup[(char ^ result >> 8) & 255] ^ result << 8; + } + return result & 16383; + }; + module2.exports.generateMulti = function generateMulti(keys) { + var i = 1; + var len = keys.length; + var base = generate(keys[0]); + while (i < len) { + if (generate(keys[i++]) !== base) return -1; + } + return base; + }; + } +}); + +// node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js +var require_lodash = __commonJS({ + "node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js"(exports2, module2) { + var MAX_SAFE_INTEGER = 9007199254740991; + var argsTag = "[object Arguments]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var reIsUint = /^(?:0|[1-9]\d*)$/; + function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args[0]); + case 2: + return func.call(thisArg, args[0], args[1]); + case 3: + return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + function baseTimes(n, iteratee) { + var index = -1, result = Array(n); + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var nativeMax = Math.max; + function arrayLikeKeys(value, inherited) { + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; + var length = result.length, skipIndexes = !!length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + function assignInDefaults(objValue, srcValue, key, object) { + if (objValue === void 0 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { + return srcValue; + } + return objValue; + } + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) { + object[key] = value; + } + } + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), result = []; + for (var key in object) { + if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + function baseRest(func, start) { + start = nativeMax(start === void 0 ? func.length - 1 : start, 0); + return function() { + var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } + function copyObject(source, props, object, customizer) { + object || (object = {}); + var index = -1, length = props.length; + while (++index < length) { + var key = props[index]; + var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; + assignValue(object, key, newValue === void 0 ? source[key] : newValue); + } + return object; + } + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0; + customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? void 0 : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { + return eq(object[index], value); + } + return false; + } + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; + } + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + function eq(value, other) { + return value === other || value !== value && other !== other; + } + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); + } + var isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + function isFunction(value) { + var tag = isObject(value) ? objectToString.call(value) : ""; + return tag == funcTag || tag == genTag; + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + var defaults = baseRest(function(args) { + args.push(void 0, assignInDefaults); + return apply(assignInWith, void 0, args); + }); + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + module2.exports = defaults; + } +}); + +// node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js +var require_lodash2 = __commonJS({ + "node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js"(exports2, module2) { + var MAX_SAFE_INTEGER = 9007199254740991; + var argsTag = "[object Arguments]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); + } + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + function isFunction(value) { + var tag = isObject(value) ? objectToString.call(value) : ""; + return tag == funcTag || tag == genTag; + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + module2.exports = isArguments; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js +var require_lodash3 = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isArguments = exports2.defaults = exports2.noop = void 0; + var defaults = require_lodash(); + exports2.defaults = defaults; + var isArguments = require_lodash2(); + exports2.isArguments = isArguments; + function noop() { + } + exports2.noop = noop; + } +}); + +// node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +var require_ms = __commonJS({ + "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) { + var s = 1e3; + var m = s * 60; + var h = m * 60; + var d = h * 24; + var w = d * 7; + var y = d * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n * y; + case "weeks": + case "week": + case "w": + return n * w; + case "days": + case "day": + case "d": + return n * d; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n * h; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n * m; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n * s; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n; + default: + return void 0; + } + } + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + "d"; + } + if (msAbs >= h) { + return Math.round(ms / h) + "h"; + } + if (msAbs >= m) { + return Math.round(ms / m) + "m"; + } + if (msAbs >= s) { + return Math.round(ms / s) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, "day"); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, "hour"); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, "minute"); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, "second"); + } + return ms + " ms"; + } + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + } + } +}); + +// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js +var require_common = __commonJS({ + "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports2, module2) { + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require_ms(); + createDebug.destroy = destroy; + Object.keys(env).forEach((key) => { + createDebug[key] = env[key]; + }); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug(...args) { + if (!debug.enabled) { + return; + } + const self2 = debug; + const curr = Number(/* @__PURE__ */ new Date()); + const ms = curr - (prevTime || curr); + self2.diff = ms; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== "string") { + args.unshift("%O"); + } + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; + Object.defineProperty(debug, "enabled", { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, + set: (v) => { + enableOverride = v; + } + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug); + } + return debug; + } + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + createDebug.names = []; + createDebug.skips = []; + const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns of split) { + if (ns[0] === "-") { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { + if (template[templateIndex] === "*") { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; + } + } + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; + } + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; + } + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; + } + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + function destroy() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + createDebug.enable(createDebug.load()); + return createDebug; + } + module2.exports = setup; + } +}); + +// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js +var require_browser = __commonJS({ + "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports2, module2) { + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.storage = localstorage(); + exports2.destroy = /* @__PURE__ */ (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + }; + })(); + exports2.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; + } + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + let m; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + function formatArgs(args) { + args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); + if (!this.useColors) { + return; + } + const c = "color: " + this.color; + args.splice(1, 0, c, "color: inherit"); + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); + } + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error) { + } + } + function load() { + let r; + try { + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error) { + } + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { + try { + return localStorage; + } catch (error) { + } + } + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error) { + return "[UnexpectedJSONParseError]: " + error.message; + } + }; + } +}); + +// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) { + "use strict"; + module2.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); + }; + } +}); + +// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) { + "use strict"; + var os = require("os"); + var tty = require("tty"); + var hasFlag = require_has_flag(); + var { env } = process; + var forceColor; + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + forceColor = 0; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + forceColor = 1; + } + if ("FORCE_COLOR" in env) { + if (env.FORCE_COLOR === "true") { + forceColor = 1; + } else if (env.FORCE_COLOR === "false") { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } + } + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; + } + function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (process.platform === "win32") { + const osRelease = os.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if (env.COLORTERM === "truecolor") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": + return version >= 3 ? 3 : 2; + case "Apple_Terminal": + return 2; + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + return min; + } + function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); + } + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) + }; + } +}); + +// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.destroy = util.deprecate( + () => { + }, + "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." + ); + exports2.colors = [6, 2, 3, 4, 5, 1]; + try { + const supportsColor = require_supports_color(); + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports2.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error) { + } + exports2.inspectOpts = Object.keys(process.env).filter((key) => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === "null") { + val = null; + } else { + val = Number(val); + } + obj[prop] = val; + return obj; + }, {}); + function useColors() { + return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); + } + function formatArgs(args) { + const { namespace: name, useColors: useColors2 } = this; + if (useColors2) { + const c = this.color; + const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); + const prefix = ` ${colorCode};1m${name} \x1B[0m`; + args[0] = prefix + args[0].split("\n").join("\n" + prefix); + args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name + " " + args[0]; + } + } + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; + } + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; + } + } + function load() { + return process.env.DEBUG; + } + function init(debug) { + debug.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + } + } + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; + } +}); + +// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js +var require_src = __commonJS({ + "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports2, module2) { + if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { + module2.exports = require_browser(); + } else { + module2.exports = require_node(); + } + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js +var require_debug = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.genRedactedString = exports2.getStringValue = exports2.MAX_ARGUMENT_LENGTH = void 0; + var debug_1 = require_src(); + var MAX_ARGUMENT_LENGTH = 200; + exports2.MAX_ARGUMENT_LENGTH = MAX_ARGUMENT_LENGTH; + var NAMESPACE_PREFIX = "ioredis"; + function getStringValue(v) { + if (v === null) { + return; + } + switch (typeof v) { + case "boolean": + return; + case "number": + return; + case "object": + if (Buffer.isBuffer(v)) { + return v.toString("hex"); + } + if (Array.isArray(v)) { + return v.join(","); + } + try { + return JSON.stringify(v); + } catch (e) { + return; + } + case "string": + return v; + } + } + exports2.getStringValue = getStringValue; + function genRedactedString(str, maxLen) { + const { length } = str; + return length <= maxLen ? str : str.slice(0, maxLen) + ' ... '; + } + exports2.genRedactedString = genRedactedString; + function genDebugFunction(namespace) { + const fn = (0, debug_1.default)(`${NAMESPACE_PREFIX}:${namespace}`); + function wrappedDebug(...args) { + if (!fn.enabled) { + return; + } + for (let i = 1; i < args.length; i++) { + const str = getStringValue(args[i]); + if (typeof str === "string" && str.length > MAX_ARGUMENT_LENGTH) { + args[i] = genRedactedString(str, MAX_ARGUMENT_LENGTH); + } + } + return fn.apply(null, args); + } + Object.defineProperties(wrappedDebug, { + namespace: { + get() { + return fn.namespace; + } + }, + enabled: { + get() { + return fn.enabled; + } + }, + destroy: { + get() { + return fn.destroy; + } + }, + log: { + get() { + return fn.log; + }, + set(l) { + fn.log = l; + } + } + }); + return wrappedDebug; + } + exports2.default = genDebugFunction; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js +var require_TLSProfiles = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var RedisCloudCA = `-----BEGIN CERTIFICATE----- +MIIDTzCCAjegAwIBAgIJAKSVpiDswLcwMA0GCSqGSIb3DQEBBQUAMD4xFjAUBgNV +BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0xMzEwMDExMjE0NTVaFw0yMzA5MjkxMjE0NTVaMD4xFjAUBgNV +BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALZqkh/DczWP +JnxnHLQ7QL0T4B4CDKWBKCcisriGbA6ZePWVNo4hfKQC6JrzfR+081NeD6VcWUiz +rmd+jtPhIY4c+WVQYm5PKaN6DT1imYdxQw7aqO5j2KUCEh/cznpLxeSHoTxlR34E +QwF28Wl3eg2vc5ct8LjU3eozWVk3gb7alx9mSA2SgmuX5lEQawl++rSjsBStemY2 +BDwOpAMXIrdEyP/cVn8mkvi/BDs5M5G+09j0gfhyCzRWMQ7Hn71u1eolRxwVxgi3 +TMn+/vTaFSqxKjgck6zuAYjBRPaHe7qLxHNr1So/Mc9nPy+3wHebFwbIcnUojwbp +4nctkWbjb2cCAwEAAaNQME4wHQYDVR0OBBYEFP1whtcrydmW3ZJeuSoKZIKjze3w +MB8GA1UdIwQYMBaAFP1whtcrydmW3ZJeuSoKZIKjze3wMAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAG2erXhwRAa7+ZOBs0B6X57Hwyd1R4kfmXcs0rta +lbPpvgULSiB+TCbf3EbhJnHGyvdCY1tvlffLjdA7HJ0PCOn+YYLBA0pTU/dyvrN6 +Su8NuS5yubnt9mb13nDGYo1rnt0YRfxN+8DM3fXIVr038A30UlPX2Ou1ExFJT0MZ +uFKY6ZvLdI6/1cbgmguMlAhM+DhKyV6Sr5699LM3zqeI816pZmlREETYkGr91q7k +BpXJu/dtHaGxg1ZGu6w/PCsYGUcECWENYD4VQPd8N32JjOfu6vEgoEAwfPP+3oGp +Z4m3ewACcWOAenqflb+cQYC4PsF7qbXDmRaWrbKntOlZ3n0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGMTCCBBmgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwajELMAkGA1UEBhMCVVMx +CzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJzMS0w +KwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MTgwMjI1MTUzNzM3WhcNMjgwMjIzMTUzNzM3WjBfMQswCQYDVQQGEwJVUzELMAkG +A1UECAwCQ0ExEjAQBgNVBAoMCVJlZGlzTGFiczEvMC0GA1UEAwwmUkNQIEludGVy +bWVkaWF0ZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDf9dqbxc8Bq7Ctq9rWcxrGNKKHivqLAFpPq02yLPx6fsOv +Tq7GsDChAYBBc4v7Y2Ap9RD5Vs3dIhEANcnolf27QwrG9RMnnvzk8pCvp1o6zSU4 +VuOE1W66/O1/7e2rVxyrnTcP7UgK43zNIXu7+tiAqWsO92uSnuMoGPGpeaUm1jym +hjWKtkAwDFSqvHY+XL5qDVBEjeUe+WHkYUg40cAXjusAqgm2hZt29c2wnVrxW25W +P0meNlzHGFdA2AC5z54iRiqj57dTfBTkHoBczQxcyw6hhzxZQ4e5I5zOKjXXEhZN +r0tA3YC14CTabKRus/JmZieyZzRgEy2oti64tmLYTqSlAD78pRL40VNoaSYetXLw +hhNsXCHgWaY6d5bLOc/aIQMAV5oLvZQKvuXAF1IDmhPA+bZbpWipp0zagf1P1H3s +UzsMdn2KM0ejzgotbtNlj5TcrVwpmvE3ktvUAuA+hi3FkVx1US+2Gsp5x4YOzJ7u +P1WPk6ShF0JgnJH2ILdj6kttTWwFzH17keSFICWDfH/+kM+k7Y1v3EXMQXE7y0T9 +MjvJskz6d/nv+sQhY04xt64xFMGTnZjlJMzfQNi7zWFLTZnDD0lPowq7l3YiPoTT +t5Xky83lu0KZsZBo0WlWaDG00gLVdtRgVbcuSWxpi5BdLb1kRab66JptWjxwXQID +AQABo4HrMIHoMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHBzOi8vcmwtY2Etc2VydmVy +LnJlZGlzbGFicy5jb20vdjEvY3JsMEYGCCsGAQUFBwEBBDowODA2BggrBgEFBQcw +AYYqaHR0cHM6Ly9ybC1jYS1zZXJ2ZXIucmVkaXNsYWJzLmNvbS92MS9vY3NwMB0G +A1UdDgQWBBQHar5OKvQUpP2qWt6mckzToeCOHDAfBgNVHSMEGDAWgBQi42wH6hM4 +L2sujEvLM0/u8lRXTzASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIB +hjANBgkqhkiG9w0BAQsFAAOCAgEAirEn/iTsAKyhd+pu2W3Z5NjCko4NPU0EYUbr +AP7+POK2rzjIrJO3nFYQ/LLuC7KCXG+2qwan2SAOGmqWst13Y+WHp44Kae0kaChW +vcYLXXSoGQGC8QuFSNUdaeg3RbMDYFT04dOkqufeWVccoHVxyTSg9eD8LZuHn5jw +7QDLiEECBmIJHk5Eeo2TAZrx4Yx6ufSUX5HeVjlAzqwtAqdt99uCJ/EL8bgpWbe+ +XoSpvUv0SEC1I1dCAhCKAvRlIOA6VBcmzg5Am12KzkqTul12/VEFIgzqu0Zy2Jbc +AUPrYVu/+tOGXQaijy7YgwH8P8n3s7ZeUa1VABJHcxrxYduDDJBLZi+MjheUDaZ1 +jQRHYevI2tlqeSBqdPKG4zBY5lS0GiAlmuze5oENt0P3XboHoZPHiqcK3VECgTVh +/BkJcuudETSJcZDmQ8YfoKfBzRQNg2sv/hwvUv73Ss51Sco8GEt2lD8uEdib1Q6z +zDT5lXJowSzOD5ZA9OGDjnSRL+2riNtKWKEqvtEG3VBJoBzu9GoxbAc7wIZLxmli +iF5a/Zf5X+UXD3s4TMmy6C4QZJpAA2egsSQCnraWO2ULhh7iXMysSkF/nzVfZn43 +iqpaB8++9a37hWq14ZmOv0TJIDz//b2+KC4VFXWQ5W5QC6whsjT+OlG4p5ZYG0jo +616pxqo= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJAJ1aTT1lu2ScMA0GCSqGSIb3DQEBCwUAMGoxCzAJBgNV +BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCQ0ExEjAQBgNVBAoMCVJlZGlz +TGFiczEtMCsGA1UEAwwkUmVkaXNMYWJzIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y +aXR5MB4XDTE4MDIyNTE1MjA0MloXDTM4MDIyMDE1MjA0MlowajELMAkGA1UEBhMC +VVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJz +MS0wKwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDLEjXy7YrbN5Waau5cd6g1 +G5C2tMmeTpZ0duFAPxNU4oE3RHS5gGiok346fUXuUxbZ6QkuzeN2/2Z+RmRcJhQY +Dm0ZgdG4x59An1TJfnzKKoWj8ISmoHS/TGNBdFzXV7FYNLBuqZouqePI6ReC6Qhl +pp45huV32Q3a6IDrrvx7Wo5ZczEQeFNbCeCOQYNDdTmCyEkHqc2AGo8eoIlSTutT +ULOC7R5gzJVTS0e1hesQ7jmqHjbO+VQS1NAL4/5K6cuTEqUl+XhVhPdLWBXJQ5ag +54qhX4v+ojLzeU1R/Vc6NjMvVtptWY6JihpgplprN0Yh2556ewcXMeturcKgXfGJ +xeYzsjzXerEjrVocX5V8BNrg64NlifzTMKNOOv4fVZszq1SIHR8F9ROrqiOdh8iC +JpUbLpXH9hWCSEO6VRMB2xJoKu3cgl63kF30s77x7wLFMEHiwsQRKxooE1UhgS9K +2sO4TlQ1eWUvFvHSTVDQDlGQ6zu4qjbOpb3Q8bQwoK+ai2alkXVR4Ltxe9QlgYK3 +StsnPhruzZGA0wbXdpw0bnM+YdlEm5ffSTpNIfgHeaa7Dtb801FtA71ZlH7A6TaI +SIQuUST9EKmv7xrJyx0W1pGoPOLw5T029aTjnICSLdtV9bLwysrLhIYG5bnPq78B +cS+jZHFGzD7PUVGQD01nOQIDAQABo2MwYTAdBgNVHQ4EFgQUIuNsB+oTOC9rLoxL +yzNP7vJUV08wHwYDVR0jBBgwFoAUIuNsB+oTOC9rLoxLyzNP7vJUV08wDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBAHfg +z5pMNUAKdMzK1aS1EDdK9yKz4qicILz5czSLj1mC7HKDRy8cVADUxEICis++CsCu +rYOvyCVergHQLREcxPq4rc5Nq1uj6J6649NEeh4WazOOjL4ZfQ1jVznMbGy+fJm3 +3Hoelv6jWRG9iqeJZja7/1s6YC6bWymI/OY1e4wUKeNHAo+Vger7MlHV+RuabaX+ +hSJ8bJAM59NCM7AgMTQpJCncrcdLeceYniGy5Q/qt2b5mJkQVkIdy4TPGGB+AXDJ +D0q3I/JDRkDUFNFdeW0js7fHdsvCR7O3tJy5zIgEV/o/BCkmJVtuwPYOrw/yOlKj +TY/U7ATAx9VFF6/vYEOMYSmrZlFX+98L6nJtwDqfLB5VTltqZ4H/KBxGE3IRSt9l +FXy40U+LnXzhhW+7VBAvyYX8GEXhHkKU8Gqk1xitrqfBXY74xKgyUSTolFSfFVgj +mcM/X4K45bka+qpkj7Kfv/8D4j6aZekwhN2ly6hhC1SmQ8qjMjpG/mrWOSSHZFmf +ybu9iD2AYHeIOkshIl6xYIa++Q/00/vs46IzAbQyriOi0XxlSMMVtPx0Q3isp+ji +n8Mq9eOuxYOEQ4of8twUkUDd528iwGtEdwf0Q01UyT84S62N8AySl1ZBKXJz6W4F +UhWfa/HQYOAPDdEjNgnVwLI23b8t0TozyCWw7q8h +-----END CERTIFICATE----- + +-----BEGIN CERTIFICATE----- +MIIEjzCCA3egAwIBAgIQe55B/ALCKJDZtdNT8kD6hTANBgkqhkiG9w0BAQsFADBM +MSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xv +YmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0yMjAxMjYxMjAwMDBaFw0y +NTAxMjYwMDAwMDBaMFgxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWdu +IG52LXNhMS4wLAYDVQQDEyVHbG9iYWxTaWduIEF0bGFzIFIzIE9WIFRMUyBDQSAy +MDIyIFEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmGmg1LW9b7Lf +8zDD83yBDTEkt+FOxKJZqF4veWc5KZsQj9HfnUS2e5nj/E+JImlGPsQuoiosLuXD +BVBNAMcUFa11buFMGMeEMwiTmCXoXRrXQmH0qjpOfKgYc5gHG3BsRGaRrf7VR4eg +ofNMG9wUBw4/g/TT7+bQJdA4NfE7Y4d5gEryZiBGB/swaX6Jp/8MF4TgUmOWmalK +dZCKyb4sPGQFRTtElk67F7vU+wdGcrcOx1tDcIB0ncjLPMnaFicagl+daWGsKqTh +counQb6QJtYHa91KvCfKWocMxQ7OIbB5UARLPmC4CJ1/f8YFm35ebfzAeULYdGXu +jE9CLor0OwIDAQABo4IBXzCCAVswDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQG +CCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQW +BBSH5Zq7a7B/t95GfJWkDBpA8HHqdjAfBgNVHSMEGDAWgBSP8Et/qC5FJK5NUPpj +move4t0bvDB7BggrBgEFBQcBAQRvMG0wLgYIKwYBBQUHMAGGImh0dHA6Ly9vY3Nw +Mi5nbG9iYWxzaWduLmNvbS9yb290cjMwOwYIKwYBBQUHMAKGL2h0dHA6Ly9zZWN1 +cmUuZ2xvYmFsc2lnbi5jb20vY2FjZXJ0L3Jvb3QtcjMuY3J0MDYGA1UdHwQvMC0w +K6ApoCeGJWh0dHA6Ly9jcmwuZ2xvYmFsc2lnbi5jb20vcm9vdC1yMy5jcmwwIQYD +VR0gBBowGDAIBgZngQwBAgIwDAYKKwYBBAGgMgoBAjANBgkqhkiG9w0BAQsFAAOC +AQEAKRic9/f+nmhQU/wz04APZLjgG5OgsuUOyUEZjKVhNGDwxGTvKhyXGGAMW2B/ +3bRi+aElpXwoxu3pL6fkElbX3B0BeS5LoDtxkyiVEBMZ8m+sXbocwlPyxrPbX6mY +0rVIvnuUeBH8X0L5IwfpNVvKnBIilTbcebfHyXkPezGwz7E1yhUULjJFm2bt0SdX +y+4X/WeiiYIv+fTVgZZgl+/2MKIsu/qdBJc3f3TvJ8nz+Eax1zgZmww+RSQWeOj3 +15Iw6Z5FX+NwzY/Ab+9PosR5UosSeq+9HhtaxZttXG1nVh+avYPGYddWmiMT90J5 +ZgKnO/Fx2hBgTxhOTMYaD312kg== +-----END CERTIFICATE----- + +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 +MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 +RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT +gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm +KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd +QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ +XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o +LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU +RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp +jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK +6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX +mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs +Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH +WD9f +-----END CERTIFICATE-----`; + var TLSProfiles = { + RedisCloudFixed: { ca: RedisCloudCA }, + RedisCloudFlexible: { ca: RedisCloudCA } + }; + exports2.default = TLSProfiles; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js +var require_utils2 = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.noop = exports2.defaults = exports2.Debug = exports2.getPackageMeta = exports2.zipMap = exports2.CONNECTION_CLOSED_ERROR_MSG = exports2.shuffle = exports2.sample = exports2.resolveTLSProfile = exports2.parseURL = exports2.optimizeErrorStack = exports2.toArg = exports2.convertMapToArray = exports2.convertObjectToArray = exports2.timeout = exports2.packObject = exports2.isInt = exports2.wrapMultiResult = exports2.convertBufferToString = void 0; + var fs_1 = require("fs"); + var path_1 = require("path"); + var url_1 = require("url"); + var lodash_1 = require_lodash3(); + Object.defineProperty(exports2, "defaults", { enumerable: true, get: function() { + return lodash_1.defaults; + } }); + Object.defineProperty(exports2, "noop", { enumerable: true, get: function() { + return lodash_1.noop; + } }); + var debug_1 = require_debug(); + exports2.Debug = debug_1.default; + var TLSProfiles_1 = require_TLSProfiles(); + function convertBufferToString(value, encoding) { + if (value instanceof Buffer) { + return value.toString(encoding); + } + if (Array.isArray(value)) { + const length = value.length; + const res = Array(length); + for (let i = 0; i < length; ++i) { + res[i] = value[i] instanceof Buffer && encoding === "utf8" ? value[i].toString() : convertBufferToString(value[i], encoding); + } + return res; + } + return value; + } + exports2.convertBufferToString = convertBufferToString; + function wrapMultiResult(arr) { + if (!arr) { + return null; + } + const result = []; + const length = arr.length; + for (let i = 0; i < length; ++i) { + const item = arr[i]; + if (item instanceof Error) { + result.push([item]); + } else { + result.push([null, item]); + } + } + return result; + } + exports2.wrapMultiResult = wrapMultiResult; + function isInt(value) { + const x = parseFloat(value); + return !isNaN(value) && (x | 0) === x; + } + exports2.isInt = isInt; + function packObject(array) { + const result = {}; + const length = array.length; + for (let i = 1; i < length; i += 2) { + result[array[i - 1]] = array[i]; + } + return result; + } + exports2.packObject = packObject; + function timeout(callback, timeout2) { + let timer = null; + const run = function() { + if (timer) { + clearTimeout(timer); + timer = null; + callback.apply(this, arguments); + } + }; + timer = setTimeout(run, timeout2, new Error("timeout")); + return run; + } + exports2.timeout = timeout; + function convertObjectToArray(obj) { + const result = []; + const keys = Object.keys(obj); + for (let i = 0, l = keys.length; i < l; i++) { + result.push(keys[i], obj[keys[i]]); + } + return result; + } + exports2.convertObjectToArray = convertObjectToArray; + function convertMapToArray(map) { + const result = []; + let pos = 0; + map.forEach(function(value, key) { + result[pos] = key; + result[pos + 1] = value; + pos += 2; + }); + return result; + } + exports2.convertMapToArray = convertMapToArray; + function toArg(arg) { + if (arg === null || typeof arg === "undefined") { + return ""; + } + return String(arg); + } + exports2.toArg = toArg; + function optimizeErrorStack(error, friendlyStack, filterPath) { + const stacks = friendlyStack.split("\n"); + let lines = ""; + let i; + for (i = 1; i < stacks.length; ++i) { + if (stacks[i].indexOf(filterPath) === -1) { + break; + } + } + for (let j = i; j < stacks.length; ++j) { + lines += "\n" + stacks[j]; + } + if (error.stack) { + const pos = error.stack.indexOf("\n"); + error.stack = error.stack.slice(0, pos) + lines; + } + return error; + } + exports2.optimizeErrorStack = optimizeErrorStack; + function parseURL(url) { + if (isInt(url)) { + return { port: url }; + } + let parsed = (0, url_1.parse)(url, true, true); + if (!parsed.slashes && url[0] !== "/") { + url = "//" + url; + parsed = (0, url_1.parse)(url, true, true); + } + const options = parsed.query || {}; + const result = {}; + if (parsed.auth) { + const index = parsed.auth.indexOf(":"); + result.username = index === -1 ? parsed.auth : parsed.auth.slice(0, index); + result.password = index === -1 ? "" : parsed.auth.slice(index + 1); + } + if (parsed.pathname) { + if (parsed.protocol === "redis:" || parsed.protocol === "rediss:") { + if (parsed.pathname.length > 1) { + result.db = parsed.pathname.slice(1); + } + } else { + result.path = parsed.pathname; + } + } + if (parsed.host) { + result.host = parsed.hostname; + } + if (parsed.port) { + result.port = parsed.port; + } + if (typeof options.family === "string") { + const intFamily = Number.parseInt(options.family, 10); + if (!Number.isNaN(intFamily)) { + result.family = intFamily; + } + } + (0, lodash_1.defaults)(result, options); + return result; + } + exports2.parseURL = parseURL; + function resolveTLSProfile(options) { + let tls = options === null || options === void 0 ? void 0 : options.tls; + if (typeof tls === "string") + tls = { profile: tls }; + const profile = TLSProfiles_1.default[tls === null || tls === void 0 ? void 0 : tls.profile]; + if (profile) { + tls = Object.assign({}, profile, tls); + delete tls.profile; + options = Object.assign({}, options, { tls }); + } + return options; + } + exports2.resolveTLSProfile = resolveTLSProfile; + function sample(array, from = 0) { + const length = array.length; + if (from >= length) { + return null; + } + return array[from + Math.floor(Math.random() * (length - from))]; + } + exports2.sample = sample; + function shuffle(array) { + let counter = array.length; + while (counter > 0) { + const index = Math.floor(Math.random() * counter); + counter--; + [array[counter], array[index]] = [array[index], array[counter]]; + } + return array; + } + exports2.shuffle = shuffle; + exports2.CONNECTION_CLOSED_ERROR_MSG = "Connection is closed."; + function zipMap(keys, values) { + const map = /* @__PURE__ */ new Map(); + keys.forEach((key, index) => { + map.set(key, values[index]); + }); + return map; + } + exports2.zipMap = zipMap; + var cachedPackageMeta = null; + async function getPackageMeta() { + if (cachedPackageMeta) { + return cachedPackageMeta; + } + try { + const filePath = (0, path_1.resolve)(__dirname, "..", "..", "package.json"); + const data = await fs_1.promises.readFile(filePath, "utf8"); + const parsed = JSON.parse(data); + cachedPackageMeta = { + version: parsed.version + }; + return cachedPackageMeta; + } catch (err) { + cachedPackageMeta = { + version: "error-fetching-version" + }; + return cachedPackageMeta; + } + } + exports2.getPackageMeta = getPackageMeta; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js +var require_Command = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var commands_1 = require_built(); + var calculateSlot = require_lib(); + var standard_as_callback_1 = require_built2(); + var utils_1 = require_utils2(); + var Command = class _Command { + /** + * Creates an instance of Command. + * @param name Command name + * @param args An array of command arguments + * @param options + * @param callback The callback that handles the response. + * If omit, the response will be handled via Promise + */ + constructor(name, args = [], options = {}, callback) { + this.name = name; + this.inTransaction = false; + this.isResolved = false; + this.transformed = false; + this.replyEncoding = options.replyEncoding; + this.errorStack = options.errorStack; + this.args = args.flat(); + this.callback = callback; + this.initPromise(); + if (options.keyPrefix) { + const isBufferKeyPrefix = options.keyPrefix instanceof Buffer; + let keyPrefixBuffer = isBufferKeyPrefix ? options.keyPrefix : null; + this._iterateKeys((key) => { + if (key instanceof Buffer) { + if (keyPrefixBuffer === null) { + keyPrefixBuffer = Buffer.from(options.keyPrefix); + } + return Buffer.concat([keyPrefixBuffer, key]); + } else if (isBufferKeyPrefix) { + return Buffer.concat([options.keyPrefix, Buffer.from(String(key))]); + } + return options.keyPrefix + key; + }); + } + if (options.readOnly) { + this.isReadOnly = true; + } + } + /** + * Check whether the command has the flag + */ + static checkFlag(flagName, commandName) { + return !!this.getFlagMap()[flagName][commandName]; + } + static setArgumentTransformer(name, func) { + this._transformer.argument[name] = func; + } + static setReplyTransformer(name, func) { + this._transformer.reply[name] = func; + } + static getFlagMap() { + if (!this.flagMap) { + this.flagMap = Object.keys(_Command.FLAGS).reduce((map, flagName) => { + map[flagName] = {}; + _Command.FLAGS[flagName].forEach((commandName) => { + map[flagName][commandName] = true; + }); + return map; + }, {}); + } + return this.flagMap; + } + getSlot() { + if (typeof this.slot === "undefined") { + const key = this.getKeys()[0]; + this.slot = key == null ? null : calculateSlot(key); + } + return this.slot; + } + getKeys() { + return this._iterateKeys(); + } + /** + * Convert command to writable buffer or string + */ + toWritable(_socket) { + let result; + const commandStr = "*" + (this.args.length + 1) + "\r\n$" + Buffer.byteLength(this.name) + "\r\n" + this.name + "\r\n"; + if (this.bufferMode) { + const buffers = new MixedBuffers(); + buffers.push(commandStr); + for (let i = 0; i < this.args.length; ++i) { + const arg = this.args[i]; + if (arg instanceof Buffer) { + if (arg.length === 0) { + buffers.push("$0\r\n\r\n"); + } else { + buffers.push("$" + arg.length + "\r\n"); + buffers.push(arg); + buffers.push("\r\n"); + } + } else { + buffers.push("$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"); + } + } + result = buffers.toBuffer(); + } else { + result = commandStr; + for (let i = 0; i < this.args.length; ++i) { + const arg = this.args[i]; + result += "$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"; + } + } + return result; + } + stringifyArguments() { + for (let i = 0; i < this.args.length; ++i) { + const arg = this.args[i]; + if (typeof arg === "string") { + } else if (arg instanceof Buffer) { + this.bufferMode = true; + } else { + this.args[i] = (0, utils_1.toArg)(arg); + } + } + } + /** + * Convert buffer/buffer[] to string/string[], + * and apply reply transformer. + */ + transformReply(result) { + if (this.replyEncoding) { + result = (0, utils_1.convertBufferToString)(result, this.replyEncoding); + } + const transformer = _Command._transformer.reply[this.name]; + if (transformer) { + result = transformer(result); + } + return result; + } + /** + * Set the wait time before terminating the attempt to execute a command + * and generating an error. + */ + setTimeout(ms) { + if (!this._commandTimeoutTimer) { + this._commandTimeoutTimer = setTimeout(() => { + if (!this.isResolved) { + this.reject(new Error("Command timed out")); + } + }, ms); + } + } + initPromise() { + const promise = new Promise((resolve2, reject) => { + if (!this.transformed) { + this.transformed = true; + const transformer = _Command._transformer.argument[this.name]; + if (transformer) { + this.args = transformer(this.args); + } + this.stringifyArguments(); + } + this.resolve = this._convertValue(resolve2); + if (this.errorStack) { + this.reject = (err) => { + reject((0, utils_1.optimizeErrorStack)(err, this.errorStack.stack, __dirname)); + }; + } else { + this.reject = reject; + } + }); + this.promise = (0, standard_as_callback_1.default)(promise, this.callback); + } + /** + * Iterate through the command arguments that are considered keys. + */ + _iterateKeys(transform2 = (key) => key) { + if (typeof this.keys === "undefined") { + this.keys = []; + if ((0, commands_1.exists)(this.name)) { + const keyIndexes = (0, commands_1.getKeyIndexes)(this.name, this.args); + for (const index of keyIndexes) { + this.args[index] = transform2(this.args[index]); + this.keys.push(this.args[index]); + } + } + } + return this.keys; + } + /** + * Convert the value from buffer to the target encoding. + */ + _convertValue(resolve2) { + return (value) => { + try { + const existingTimer = this._commandTimeoutTimer; + if (existingTimer) { + clearTimeout(existingTimer); + delete this._commandTimeoutTimer; + } + resolve2(this.transformReply(value)); + this.isResolved = true; + } catch (err) { + this.reject(err); + } + return this.promise; + }; + } + }; + exports2.default = Command; + Command.FLAGS = { + VALID_IN_SUBSCRIBER_MODE: [ + "subscribe", + "psubscribe", + "unsubscribe", + "punsubscribe", + "ssubscribe", + "sunsubscribe", + "ping", + "quit" + ], + VALID_IN_MONITOR_MODE: ["monitor", "auth"], + ENTER_SUBSCRIBER_MODE: ["subscribe", "psubscribe", "ssubscribe"], + EXIT_SUBSCRIBER_MODE: ["unsubscribe", "punsubscribe", "sunsubscribe"], + WILL_DISCONNECT: ["quit"], + HANDSHAKE_COMMANDS: ["auth", "select", "client", "readonly", "info"], + IGNORE_RECONNECT_ON_ERROR: ["client"] + }; + Command._transformer = { + argument: {}, + reply: {} + }; + var msetArgumentTransformer = function(args) { + if (args.length === 1) { + if (args[0] instanceof Map) { + return (0, utils_1.convertMapToArray)(args[0]); + } + if (typeof args[0] === "object" && args[0] !== null) { + return (0, utils_1.convertObjectToArray)(args[0]); + } + } + return args; + }; + var hsetArgumentTransformer = function(args) { + if (args.length === 2) { + if (args[1] instanceof Map) { + return [args[0]].concat((0, utils_1.convertMapToArray)(args[1])); + } + if (typeof args[1] === "object" && args[1] !== null) { + return [args[0]].concat((0, utils_1.convertObjectToArray)(args[1])); + } + } + return args; + }; + Command.setArgumentTransformer("mset", msetArgumentTransformer); + Command.setArgumentTransformer("msetnx", msetArgumentTransformer); + Command.setArgumentTransformer("hset", hsetArgumentTransformer); + Command.setArgumentTransformer("hmset", hsetArgumentTransformer); + Command.setReplyTransformer("hgetall", function(result) { + if (Array.isArray(result)) { + const obj = {}; + for (let i = 0; i < result.length; i += 2) { + const key = result[i]; + const value = result[i + 1]; + if (key in obj) { + Object.defineProperty(obj, key, { + value, + configurable: true, + enumerable: true, + writable: true + }); + } else { + obj[key] = value; + } + } + return obj; + } + return result; + }); + var MixedBuffers = class { + constructor() { + this.length = 0; + this.items = []; + } + push(x) { + this.length += Buffer.byteLength(x); + this.items.push(x); + } + toBuffer() { + const result = Buffer.allocUnsafe(this.length); + let offset = 0; + for (const item of this.items) { + const length = Buffer.byteLength(item); + Buffer.isBuffer(item) ? item.copy(result, offset) : result.write(item, offset, length); + offset += length; + } + return result; + } + }; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js +var require_ClusterAllFailedError = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var redis_errors_1 = require_redis_errors(); + var ClusterAllFailedError = class extends redis_errors_1.RedisError { + constructor(message, lastNodeError) { + super(message); + this.lastNodeError = lastNodeError; + Error.captureStackTrace(this, this.constructor); + } + get name() { + return this.constructor.name; + } + }; + exports2.default = ClusterAllFailedError; + ClusterAllFailedError.defaultMessage = "Failed to refresh slots cache."; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js +var require_ScanStream = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var stream_1 = require("stream"); + var ScanStream = class extends stream_1.Readable { + constructor(opt) { + super(opt); + this.opt = opt; + this._redisCursor = "0"; + this._redisDrained = false; + } + _read() { + if (this._redisDrained) { + this.push(null); + return; + } + const args = [this._redisCursor]; + if (this.opt.key) { + args.unshift(this.opt.key); + } + if (this.opt.match) { + args.push("MATCH", this.opt.match); + } + if (this.opt.type) { + args.push("TYPE", this.opt.type); + } + if (this.opt.count) { + args.push("COUNT", String(this.opt.count)); + } + if (this.opt.noValues) { + args.push("NOVALUES"); + } + this.opt.redis[this.opt.command](args, (err, res) => { + if (err) { + this.emit("error", err); + return; + } + this._redisCursor = res[0] instanceof Buffer ? res[0].toString() : res[0]; + if (this._redisCursor === "0") { + this._redisDrained = true; + } + this.push(res[1]); + }); + } + close() { + this._redisDrained = true; + } + }; + exports2.default = ScanStream; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js +var require_autoPipelining = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.executeWithAutoPipelining = exports2.getFirstValueInFlattenedArray = exports2.shouldUseAutoPipelining = exports2.notAllowedAutoPipelineCommands = exports2.kCallbacks = exports2.kExec = void 0; + var lodash_1 = require_lodash3(); + var calculateSlot = require_lib(); + var standard_as_callback_1 = require_built2(); + exports2.kExec = Symbol("exec"); + exports2.kCallbacks = Symbol("callbacks"); + exports2.notAllowedAutoPipelineCommands = [ + "auth", + "info", + "script", + "quit", + "cluster", + "pipeline", + "multi", + "subscribe", + "psubscribe", + "unsubscribe", + "unpsubscribe", + "select", + "client" + ]; + function executeAutoPipeline(client, slotKey) { + if (client._runningAutoPipelines.has(slotKey)) { + return; + } + if (!client._autoPipelines.has(slotKey)) { + return; + } + client._runningAutoPipelines.add(slotKey); + const pipeline = client._autoPipelines.get(slotKey); + client._autoPipelines.delete(slotKey); + const callbacks = pipeline[exports2.kCallbacks]; + pipeline[exports2.kCallbacks] = null; + pipeline.exec(function(err, results) { + client._runningAutoPipelines.delete(slotKey); + if (err) { + for (let i = 0; i < callbacks.length; i++) { + process.nextTick(callbacks[i], err); + } + } else { + for (let i = 0; i < callbacks.length; i++) { + process.nextTick(callbacks[i], ...results[i]); + } + } + if (client._autoPipelines.has(slotKey)) { + executeAutoPipeline(client, slotKey); + } + }); + } + function shouldUseAutoPipelining(client, functionName, commandName) { + return functionName && client.options.enableAutoPipelining && !client.isPipeline && !exports2.notAllowedAutoPipelineCommands.includes(commandName) && !client.options.autoPipeliningIgnoredCommands.includes(commandName); + } + exports2.shouldUseAutoPipelining = shouldUseAutoPipelining; + function getFirstValueInFlattenedArray(args) { + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + if (typeof arg === "string") { + return arg; + } else if (Array.isArray(arg) || (0, lodash_1.isArguments)(arg)) { + if (arg.length === 0) { + continue; + } + return arg[0]; + } + const flattened = [arg].flat(); + if (flattened.length > 0) { + return flattened[0]; + } + } + return void 0; + } + exports2.getFirstValueInFlattenedArray = getFirstValueInFlattenedArray; + function executeWithAutoPipelining(client, functionName, commandName, args, callback) { + if (client.isCluster && !client.slots.length) { + if (client.status === "wait") + client.connect().catch(lodash_1.noop); + return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { + client.delayUntilReady((err) => { + if (err) { + reject(err); + return; + } + executeWithAutoPipelining(client, functionName, commandName, args, null).then(resolve2, reject); + }); + }), callback); + } + const prefix = client.options.keyPrefix || ""; + const slotKey = client.isCluster ? client.slots[calculateSlot(`${prefix}${getFirstValueInFlattenedArray(args)}`)].join(",") : "main"; + if (!client._autoPipelines.has(slotKey)) { + const pipeline2 = client.pipeline(); + pipeline2[exports2.kExec] = false; + pipeline2[exports2.kCallbacks] = []; + client._autoPipelines.set(slotKey, pipeline2); + } + const pipeline = client._autoPipelines.get(slotKey); + if (!pipeline[exports2.kExec]) { + pipeline[exports2.kExec] = true; + setImmediate(executeAutoPipeline, client, slotKey); + } + const autoPipelinePromise = new Promise(function(resolve2, reject) { + pipeline[exports2.kCallbacks].push(function(err, value) { + if (err) { + reject(err); + return; + } + resolve2(value); + }); + if (functionName === "call") { + args.unshift(commandName); + } + pipeline[functionName](...args); + }); + return (0, standard_as_callback_1.default)(autoPipelinePromise, callback); + } + exports2.executeWithAutoPipelining = executeWithAutoPipelining; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js +var require_Script = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var crypto_1 = require("crypto"); + var Command_1 = require_Command(); + var standard_as_callback_1 = require_built2(); + var Script2 = class { + constructor(lua, numberOfKeys = null, keyPrefix = "", readOnly = false) { + this.lua = lua; + this.numberOfKeys = numberOfKeys; + this.keyPrefix = keyPrefix; + this.readOnly = readOnly; + this.sha = (0, crypto_1.createHash)("sha1").update(lua).digest("hex"); + const sha = this.sha; + const socketHasScriptLoaded = /* @__PURE__ */ new WeakSet(); + this.Command = class CustomScriptCommand extends Command_1.default { + toWritable(socket) { + const origReject = this.reject; + this.reject = (err) => { + if (err.message.indexOf("NOSCRIPT") !== -1) { + socketHasScriptLoaded.delete(socket); + } + origReject.call(this, err); + }; + if (!socketHasScriptLoaded.has(socket)) { + socketHasScriptLoaded.add(socket); + this.name = "eval"; + this.args[0] = lua; + } else if (this.name === "eval") { + this.name = "evalsha"; + this.args[0] = sha; + } + return super.toWritable(socket); + } + }; + } + execute(container, args, options, callback) { + if (typeof this.numberOfKeys === "number") { + args.unshift(this.numberOfKeys); + } + if (this.keyPrefix) { + options.keyPrefix = this.keyPrefix; + } + if (this.readOnly) { + options.readOnly = true; + } + const evalsha = new this.Command("evalsha", [this.sha, ...args], options); + evalsha.promise = evalsha.promise.catch((err) => { + if (err.message.indexOf("NOSCRIPT") === -1) { + throw err; + } + const resend = new this.Command("evalsha", [this.sha, ...args], options); + const client = container.isPipeline ? container.redis : container; + return client.sendCommand(resend); + }); + (0, standard_as_callback_1.default)(evalsha.promise, callback); + return container.sendCommand(evalsha); + } + }; + exports2.default = Script2; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js +var require_Commander = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var commands_1 = require_built(); + var autoPipelining_1 = require_autoPipelining(); + var Command_1 = require_Command(); + var Script_1 = require_Script(); + var Commander = class { + constructor() { + this.options = {}; + this.scriptsSet = {}; + this.addedBuiltinSet = /* @__PURE__ */ new Set(); + } + /** + * Return supported builtin commands + */ + getBuiltinCommands() { + return commands.slice(0); + } + /** + * Create a builtin command + */ + createBuiltinCommand(commandName) { + return { + string: generateFunction(null, commandName, "utf8"), + buffer: generateFunction(null, commandName, null) + }; + } + /** + * Create add builtin command + */ + addBuiltinCommand(commandName) { + this.addedBuiltinSet.add(commandName); + this[commandName] = generateFunction(commandName, commandName, "utf8"); + this[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); + } + /** + * Define a custom command using lua script + */ + defineCommand(name, definition) { + const script = new Script_1.default(definition.lua, definition.numberOfKeys, this.options.keyPrefix, definition.readOnly); + this.scriptsSet[name] = script; + this[name] = generateScriptingFunction(name, name, script, "utf8"); + this[name + "Buffer"] = generateScriptingFunction(name + "Buffer", name, script, null); + } + /** + * @ignore + */ + sendCommand(command, stream, node) { + throw new Error('"sendCommand" is not implemented'); + } + }; + var commands = commands_1.list.filter((command) => command !== "monitor"); + commands.push("sentinel"); + commands.forEach(function(commandName) { + Commander.prototype[commandName] = generateFunction(commandName, commandName, "utf8"); + Commander.prototype[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); + }); + Commander.prototype.call = generateFunction("call", "utf8"); + Commander.prototype.callBuffer = generateFunction("callBuffer", null); + Commander.prototype.send_command = Commander.prototype.call; + function generateFunction(functionName, _commandName, _encoding) { + if (typeof _encoding === "undefined") { + _encoding = _commandName; + _commandName = null; + } + return function(...args) { + const commandName = _commandName || args.shift(); + let callback = args[args.length - 1]; + if (typeof callback === "function") { + args.pop(); + } else { + callback = void 0; + } + const options = { + errorStack: this.options.showFriendlyErrorStack ? new Error() : void 0, + keyPrefix: this.options.keyPrefix, + replyEncoding: _encoding + }; + if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { + return this.sendCommand( + // @ts-expect-error + new Command_1.default(commandName, args, options, callback) + ); + } + return (0, autoPipelining_1.executeWithAutoPipelining)( + this, + functionName, + commandName, + // @ts-expect-error + args, + callback + ); + }; + } + function generateScriptingFunction(functionName, commandName, script, encoding) { + return function(...args) { + const callback = typeof args[args.length - 1] === "function" ? args.pop() : void 0; + const options = { + replyEncoding: encoding + }; + if (this.options.showFriendlyErrorStack) { + options.errorStack = new Error(); + } + if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { + return script.execute(this, args, options, callback); + } + return (0, autoPipelining_1.executeWithAutoPipelining)(this, functionName, commandName, args, callback); + }; + } + exports2.default = Commander; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js +var require_Pipeline = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var calculateSlot = require_lib(); + var commands_1 = require_built(); + var standard_as_callback_1 = require_built2(); + var util_1 = require("util"); + var Command_1 = require_Command(); + var utils_1 = require_utils2(); + var Commander_1 = require_Commander(); + function generateMultiWithNodes(redis, keys) { + const slot = calculateSlot(keys[0]); + const target = redis._groupsBySlot[slot]; + for (let i = 1; i < keys.length; i++) { + if (redis._groupsBySlot[calculateSlot(keys[i])] !== target) { + return -1; + } + } + return slot; + } + var Pipeline = class extends Commander_1.default { + constructor(redis) { + super(); + this.redis = redis; + this.isPipeline = true; + this.replyPending = 0; + this._queue = []; + this._result = []; + this._transactions = 0; + this._shaToScript = {}; + this.isCluster = this.redis.constructor.name === "Cluster" || this.redis.isCluster; + this.options = redis.options; + Object.keys(redis.scriptsSet).forEach((name) => { + const script = redis.scriptsSet[name]; + this._shaToScript[script.sha] = script; + this[name] = redis[name]; + this[name + "Buffer"] = redis[name + "Buffer"]; + }); + redis.addedBuiltinSet.forEach((name) => { + this[name] = redis[name]; + this[name + "Buffer"] = redis[name + "Buffer"]; + }); + this.promise = new Promise((resolve2, reject) => { + this.resolve = resolve2; + this.reject = reject; + }); + const _this = this; + Object.defineProperty(this, "length", { + get: function() { + return _this._queue.length; + } + }); + } + fillResult(value, position) { + if (this._queue[position].name === "exec" && Array.isArray(value[1])) { + const execLength = value[1].length; + for (let i = 0; i < execLength; i++) { + if (value[1][i] instanceof Error) { + continue; + } + const cmd = this._queue[position - (execLength - i)]; + try { + value[1][i] = cmd.transformReply(value[1][i]); + } catch (err) { + value[1][i] = err; + } + } + } + this._result[position] = value; + if (--this.replyPending) { + return; + } + if (this.isCluster) { + let retriable = true; + let commonError; + for (let i = 0; i < this._result.length; ++i) { + const error = this._result[i][0]; + const command = this._queue[i]; + if (error) { + if (command.name === "exec" && error.message === "EXECABORT Transaction discarded because of previous errors.") { + continue; + } + if (!commonError) { + commonError = { + name: error.name, + message: error.message + }; + } else if (commonError.name !== error.name || commonError.message !== error.message) { + retriable = false; + break; + } + } else if (!command.inTransaction) { + const isReadOnly = (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); + if (!isReadOnly) { + retriable = false; + break; + } + } + } + if (commonError && retriable) { + const _this = this; + const errv = commonError.message.split(" "); + const queue = this._queue; + let inTransaction = false; + this._queue = []; + for (let i = 0; i < queue.length; ++i) { + if (errv[0] === "ASK" && !inTransaction && queue[i].name !== "asking" && (!queue[i - 1] || queue[i - 1].name !== "asking")) { + const asking = new Command_1.default("asking"); + asking.ignore = true; + this.sendCommand(asking); + } + queue[i].initPromise(); + this.sendCommand(queue[i]); + inTransaction = queue[i].inTransaction; + } + let matched = true; + if (typeof this.leftRedirections === "undefined") { + this.leftRedirections = {}; + } + const exec = function() { + _this.exec(); + }; + const cluster = this.redis; + cluster.handleError(commonError, this.leftRedirections, { + moved: function(_slot, key) { + _this.preferKey = key; + cluster.slots[errv[1]] = [key]; + cluster._groupsBySlot[errv[1]] = cluster._groupsIds[cluster.slots[errv[1]].join(";")]; + cluster.refreshSlotsCache(); + _this.exec(); + }, + ask: function(_slot, key) { + _this.preferKey = key; + _this.exec(); + }, + tryagain: exec, + clusterDown: exec, + connectionClosed: exec, + maxRedirections: () => { + matched = false; + }, + defaults: () => { + matched = false; + } + }); + if (matched) { + return; + } + } + } + let ignoredCount = 0; + for (let i = 0; i < this._queue.length - ignoredCount; ++i) { + if (this._queue[i + ignoredCount].ignore) { + ignoredCount += 1; + } + this._result[i] = this._result[i + ignoredCount]; + } + this.resolve(this._result.slice(0, this._result.length - ignoredCount)); + } + sendCommand(command) { + if (this._transactions > 0) { + command.inTransaction = true; + } + const position = this._queue.length; + command.pipelineIndex = position; + command.promise.then((result) => { + this.fillResult([null, result], position); + }).catch((error) => { + this.fillResult([error], position); + }); + this._queue.push(command); + return this; + } + addBatch(commands) { + let command, commandName, args; + for (let i = 0; i < commands.length; ++i) { + command = commands[i]; + commandName = command[0]; + args = command.slice(1); + this[commandName].apply(this, args); + } + return this; + } + }; + exports2.default = Pipeline; + var multi = Pipeline.prototype.multi; + Pipeline.prototype.multi = function() { + this._transactions += 1; + return multi.apply(this, arguments); + }; + var execBuffer = Pipeline.prototype.execBuffer; + Pipeline.prototype.execBuffer = (0, util_1.deprecate)(function() { + if (this._transactions > 0) { + this._transactions -= 1; + } + return execBuffer.apply(this, arguments); + }, "Pipeline#execBuffer: Use Pipeline#exec instead"); + Pipeline.prototype.exec = function(callback) { + if (this.isCluster && !this.redis.slots.length) { + if (this.redis.status === "wait") + this.redis.connect().catch(utils_1.noop); + if (callback && !this.nodeifiedPromise) { + this.nodeifiedPromise = true; + (0, standard_as_callback_1.default)(this.promise, callback); + } + this.redis.delayUntilReady((err) => { + if (err) { + this.reject(err); + return; + } + this.exec(callback); + }); + return this.promise; + } + if (this._transactions > 0) { + this._transactions -= 1; + return execBuffer.apply(this, arguments); + } + if (!this.nodeifiedPromise) { + this.nodeifiedPromise = true; + (0, standard_as_callback_1.default)(this.promise, callback); + } + if (!this._queue.length) { + this.resolve([]); + } + let pipelineSlot; + if (this.isCluster) { + const sampleKeys = []; + for (let i = 0; i < this._queue.length; i++) { + const keys = this._queue[i].getKeys(); + if (keys.length) { + sampleKeys.push(keys[0]); + } + if (keys.length && calculateSlot.generateMulti(keys) < 0) { + this.reject(new Error("All the keys in a pipeline command should belong to the same slot")); + return this.promise; + } + } + if (sampleKeys.length) { + pipelineSlot = generateMultiWithNodes(this.redis, sampleKeys); + if (pipelineSlot < 0) { + this.reject(new Error("All keys in the pipeline should belong to the same slots allocation group")); + return this.promise; + } + } else { + pipelineSlot = Math.random() * 16384 | 0; + } + } + const _this = this; + execPipeline(); + return this.promise; + function execPipeline() { + let writePending = _this.replyPending = _this._queue.length; + let node; + if (_this.isCluster) { + node = { + slot: pipelineSlot, + redis: _this.redis.connectionPool.nodes.all[_this.preferKey] + }; + } + let data = ""; + let buffers; + const stream = { + isPipeline: true, + destination: _this.isCluster ? node : { redis: _this.redis }, + write(writable) { + if (typeof writable !== "string") { + if (!buffers) { + buffers = []; + } + if (data) { + buffers.push(Buffer.from(data, "utf8")); + data = ""; + } + buffers.push(writable); + } else { + data += writable; + } + if (!--writePending) { + if (buffers) { + if (data) { + buffers.push(Buffer.from(data, "utf8")); + } + stream.destination.redis.stream.write(Buffer.concat(buffers)); + } else { + stream.destination.redis.stream.write(data); + } + writePending = _this._queue.length; + data = ""; + buffers = void 0; + } + } + }; + for (let i = 0; i < _this._queue.length; ++i) { + _this.redis.sendCommand(_this._queue[i], stream, node); + } + return _this.promise; + } + }; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js +var require_transaction = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.addTransactionSupport = void 0; + var utils_1 = require_utils2(); + var standard_as_callback_1 = require_built2(); + var Pipeline_1 = require_Pipeline(); + function addTransactionSupport(redis) { + redis.pipeline = function(commands) { + const pipeline = new Pipeline_1.default(this); + if (Array.isArray(commands)) { + pipeline.addBatch(commands); + } + return pipeline; + }; + const { multi } = redis; + redis.multi = function(commands, options) { + if (typeof options === "undefined" && !Array.isArray(commands)) { + options = commands; + commands = null; + } + if (options && options.pipeline === false) { + return multi.call(this); + } + const pipeline = new Pipeline_1.default(this); + pipeline.multi(); + if (Array.isArray(commands)) { + pipeline.addBatch(commands); + } + const exec2 = pipeline.exec; + pipeline.exec = function(callback) { + if (this.isCluster && !this.redis.slots.length) { + if (this.redis.status === "wait") + this.redis.connect().catch(utils_1.noop); + return (0, standard_as_callback_1.default)(new Promise((resolve2, reject) => { + this.redis.delayUntilReady((err) => { + if (err) { + reject(err); + return; + } + this.exec(pipeline).then(resolve2, reject); + }); + }), callback); + } + if (this._transactions > 0) { + exec2.call(pipeline); + } + if (this.nodeifiedPromise) { + return exec2.call(pipeline); + } + const promise = exec2.call(pipeline); + return (0, standard_as_callback_1.default)(promise.then(function(result) { + const execResult = result[result.length - 1]; + if (typeof execResult === "undefined") { + throw new Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it."); + } + if (execResult[0]) { + execResult[0].previousErrors = []; + for (let i = 0; i < result.length - 1; ++i) { + if (result[i][0]) { + execResult[0].previousErrors.push(result[i][0]); + } + } + throw execResult[0]; + } + return (0, utils_1.wrapMultiResult)(execResult[1]); + }), callback); + }; + const { execBuffer } = pipeline; + pipeline.execBuffer = function(callback) { + if (this._transactions > 0) { + execBuffer.call(pipeline); + } + return pipeline.exec(callback); + }; + return pipeline; + }; + const { exec } = redis; + redis.exec = function(callback) { + return (0, standard_as_callback_1.default)(exec.call(this).then(function(results) { + if (Array.isArray(results)) { + results = (0, utils_1.wrapMultiResult)(results); + } + return results; + }), callback); + }; + } + exports2.addTransactionSupport = addTransactionSupport; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js +var require_applyMixin = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + function applyMixin(derivedConstructor, mixinConstructor) { + Object.getOwnPropertyNames(mixinConstructor.prototype).forEach((name) => { + Object.defineProperty(derivedConstructor.prototype, name, Object.getOwnPropertyDescriptor(mixinConstructor.prototype, name)); + }); + } + exports2.default = applyMixin; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js +var require_ClusterOptions = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DEFAULT_CLUSTER_OPTIONS = void 0; + var dns_1 = require("dns"); + exports2.DEFAULT_CLUSTER_OPTIONS = { + clusterRetryStrategy: (times) => Math.min(100 + times * 2, 2e3), + enableOfflineQueue: true, + enableReadyCheck: true, + scaleReads: "master", + maxRedirections: 16, + retryDelayOnMoved: 0, + retryDelayOnFailover: 100, + retryDelayOnClusterDown: 100, + retryDelayOnTryAgain: 100, + slotsRefreshTimeout: 1e3, + useSRVRecords: false, + resolveSrv: dns_1.resolveSrv, + dnsLookup: dns_1.lookup, + enableAutoPipelining: false, + autoPipeliningIgnoredCommands: [], + shardedSubscribers: false + }; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js +var require_util = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getConnectionName = exports2.weightSrvRecords = exports2.groupSrvRecords = exports2.getUniqueHostnamesFromOptions = exports2.normalizeNodeOptions = exports2.nodeKeyToRedisOptions = exports2.getNodeKey = void 0; + var utils_1 = require_utils2(); + var net_1 = require("net"); + function getNodeKey(node) { + node.port = node.port || 6379; + node.host = node.host || "127.0.0.1"; + return node.host + ":" + node.port; + } + exports2.getNodeKey = getNodeKey; + function nodeKeyToRedisOptions(nodeKey) { + const portIndex = nodeKey.lastIndexOf(":"); + if (portIndex === -1) { + throw new Error(`Invalid node key ${nodeKey}`); + } + return { + host: nodeKey.slice(0, portIndex), + port: Number(nodeKey.slice(portIndex + 1)) + }; + } + exports2.nodeKeyToRedisOptions = nodeKeyToRedisOptions; + function normalizeNodeOptions(nodes) { + return nodes.map((node) => { + const options = {}; + if (typeof node === "object") { + Object.assign(options, node); + } else if (typeof node === "string") { + Object.assign(options, (0, utils_1.parseURL)(node)); + } else if (typeof node === "number") { + options.port = node; + } else { + throw new Error("Invalid argument " + node); + } + if (typeof options.port === "string") { + options.port = parseInt(options.port, 10); + } + delete options.db; + if (!options.port) { + options.port = 6379; + } + if (!options.host) { + options.host = "127.0.0.1"; + } + return (0, utils_1.resolveTLSProfile)(options); + }); + } + exports2.normalizeNodeOptions = normalizeNodeOptions; + function getUniqueHostnamesFromOptions(nodes) { + const uniqueHostsMap = {}; + nodes.forEach((node) => { + uniqueHostsMap[node.host] = true; + }); + return Object.keys(uniqueHostsMap).filter((host) => !(0, net_1.isIP)(host)); + } + exports2.getUniqueHostnamesFromOptions = getUniqueHostnamesFromOptions; + function groupSrvRecords(records) { + const recordsByPriority = {}; + for (const record of records) { + if (!recordsByPriority.hasOwnProperty(record.priority)) { + recordsByPriority[record.priority] = { + totalWeight: record.weight, + records: [record] + }; + } else { + recordsByPriority[record.priority].totalWeight += record.weight; + recordsByPriority[record.priority].records.push(record); + } + } + return recordsByPriority; + } + exports2.groupSrvRecords = groupSrvRecords; + function weightSrvRecords(recordsGroup) { + if (recordsGroup.records.length === 1) { + recordsGroup.totalWeight = 0; + return recordsGroup.records.shift(); + } + const random = Math.floor(Math.random() * (recordsGroup.totalWeight + recordsGroup.records.length)); + let total = 0; + for (const [i, record] of recordsGroup.records.entries()) { + total += 1 + record.weight; + if (total > random) { + recordsGroup.totalWeight -= record.weight; + recordsGroup.records.splice(i, 1); + return record; + } + } + } + exports2.weightSrvRecords = weightSrvRecords; + function getConnectionName(component, nodeConnectionName) { + const prefix = `ioredis-cluster(${component})`; + return nodeConnectionName ? `${prefix}:${nodeConnectionName}` : prefix; + } + exports2.getConnectionName = getConnectionName; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js +var require_ClusterSubscriber = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var util_1 = require_util(); + var utils_1 = require_utils2(); + var Redis_1 = require_Redis(); + var debug = (0, utils_1.Debug)("cluster:subscriber"); + var ClusterSubscriber = class { + constructor(connectionPool, emitter, isSharded = false) { + this.connectionPool = connectionPool; + this.emitter = emitter; + this.isSharded = isSharded; + this.started = false; + this.subscriber = null; + this.slotRange = []; + this.onSubscriberEnd = () => { + if (!this.started) { + debug("subscriber has disconnected, but ClusterSubscriber is not started, so not reconnecting."); + return; + } + debug("subscriber has disconnected, selecting a new one..."); + this.selectSubscriber(); + }; + this.connectionPool.on("-node", (_, key) => { + if (!this.started || !this.subscriber) { + return; + } + if ((0, util_1.getNodeKey)(this.subscriber.options) === key) { + debug("subscriber has left, selecting a new one..."); + this.selectSubscriber(); + } + }); + this.connectionPool.on("+node", () => { + if (!this.started || this.subscriber) { + return; + } + debug("a new node is discovered and there is no subscriber, selecting a new one..."); + this.selectSubscriber(); + }); + } + getInstance() { + return this.subscriber; + } + /** + * Associate this subscriber to a specific slot range. + * + * Returns the range or an empty array if the slot range couldn't be associated. + * + * BTW: This is more for debugging and testing purposes. + * + * @param range + */ + associateSlotRange(range) { + if (this.isSharded) { + this.slotRange = range; + } + return this.slotRange; + } + start() { + this.started = true; + this.selectSubscriber(); + debug("started"); + } + stop() { + this.started = false; + if (this.subscriber) { + this.subscriber.disconnect(); + this.subscriber = null; + } + } + isStarted() { + return this.started; + } + selectSubscriber() { + const lastActiveSubscriber = this.lastActiveSubscriber; + if (lastActiveSubscriber) { + lastActiveSubscriber.off("end", this.onSubscriberEnd); + lastActiveSubscriber.disconnect(); + } + if (this.subscriber) { + this.subscriber.off("end", this.onSubscriberEnd); + this.subscriber.disconnect(); + } + const sampleNode = (0, utils_1.sample)(this.connectionPool.getNodes()); + if (!sampleNode) { + debug("selecting subscriber failed since there is no node discovered in the cluster yet"); + this.subscriber = null; + return; + } + const { options } = sampleNode; + debug("selected a subscriber %s:%s", options.host, options.port); + let connectionPrefix = "subscriber"; + if (this.isSharded) + connectionPrefix = "ssubscriber"; + this.subscriber = new Redis_1.default({ + port: options.port, + host: options.host, + username: options.username, + password: options.password, + enableReadyCheck: true, + connectionName: (0, util_1.getConnectionName)(connectionPrefix, options.connectionName), + lazyConnect: true, + tls: options.tls, + // Don't try to reconnect the subscriber connection. If the connection fails + // we will get an end event (handled below), at which point we'll pick a new + // node from the pool and try to connect to that as the subscriber connection. + retryStrategy: null + }); + this.subscriber.on("error", utils_1.noop); + this.subscriber.on("moved", () => { + this.emitter.emit("forceRefresh"); + }); + this.subscriber.once("end", this.onSubscriberEnd); + const previousChannels = { subscribe: [], psubscribe: [], ssubscribe: [] }; + if (lastActiveSubscriber) { + const condition = lastActiveSubscriber.condition || lastActiveSubscriber.prevCondition; + if (condition && condition.subscriber) { + previousChannels.subscribe = condition.subscriber.channels("subscribe"); + previousChannels.psubscribe = condition.subscriber.channels("psubscribe"); + previousChannels.ssubscribe = condition.subscriber.channels("ssubscribe"); + } + } + if (previousChannels.subscribe.length || previousChannels.psubscribe.length || previousChannels.ssubscribe.length) { + let pending = 0; + for (const type of ["subscribe", "psubscribe", "ssubscribe"]) { + const channels = previousChannels[type]; + if (channels.length == 0) { + continue; + } + debug("%s %d channels", type, channels.length); + if (type === "ssubscribe") { + for (const channel of channels) { + pending += 1; + this.subscriber[type](channel).then(() => { + if (!--pending) { + this.lastActiveSubscriber = this.subscriber; + } + }).catch(() => { + debug("failed to ssubscribe to channel: %s", channel); + }); + } + } else { + pending += 1; + this.subscriber[type](channels).then(() => { + if (!--pending) { + this.lastActiveSubscriber = this.subscriber; + } + }).catch(() => { + debug("failed to %s %d channels", type, channels.length); + }); + } + } + } else { + this.lastActiveSubscriber = this.subscriber; + } + for (const event of [ + "message", + "messageBuffer" + ]) { + this.subscriber.on(event, (arg1, arg2) => { + this.emitter.emit(event, arg1, arg2); + }); + } + for (const event of ["pmessage", "pmessageBuffer"]) { + this.subscriber.on(event, (arg1, arg2, arg3) => { + this.emitter.emit(event, arg1, arg2, arg3); + }); + } + if (this.isSharded == true) { + for (const event of [ + "smessage", + "smessageBuffer" + ]) { + this.subscriber.on(event, (arg1, arg2) => { + this.emitter.emit(event, arg1, arg2); + }); + } + } + } + }; + exports2.default = ClusterSubscriber; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js +var require_ConnectionPool = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var events_1 = require("events"); + var utils_1 = require_utils2(); + var util_1 = require_util(); + var Redis_1 = require_Redis(); + var debug = (0, utils_1.Debug)("cluster:connectionPool"); + var ConnectionPool = class extends events_1.EventEmitter { + constructor(redisOptions) { + super(); + this.redisOptions = redisOptions; + this.nodes = { + all: {}, + master: {}, + slave: {} + }; + this.specifiedOptions = {}; + } + getNodes(role = "all") { + const nodes = this.nodes[role]; + return Object.keys(nodes).map((key) => nodes[key]); + } + getInstanceByKey(key) { + return this.nodes.all[key]; + } + getSampleInstance(role) { + const keys = Object.keys(this.nodes[role]); + const sampleKey = (0, utils_1.sample)(keys); + return this.nodes[role][sampleKey]; + } + /** + * Add a master node to the pool + * @param node + */ + addMasterNode(node) { + const key = (0, util_1.getNodeKey)(node.options); + const redis = this.createRedisFromOptions(node, node.options.readOnly); + if (!node.options.readOnly) { + this.nodes.all[key] = redis; + this.nodes.master[key] = redis; + return true; + } + return false; + } + /** + * Creates a Redis connection instance from the node options + * @param node + * @param readOnly + */ + createRedisFromOptions(node, readOnly) { + const redis = new Redis_1.default((0, utils_1.defaults)({ + // Never try to reconnect when a node is lose, + // instead, waiting for a `MOVED` error and + // fetch the slots again. + retryStrategy: null, + // Offline queue should be enabled so that + // we don't need to wait for the `ready` event + // before sending commands to the node. + enableOfflineQueue: true, + readOnly + }, node, this.redisOptions, { lazyConnect: true })); + return redis; + } + /** + * Find or create a connection to the node + */ + findOrCreate(node, readOnly = false) { + const key = (0, util_1.getNodeKey)(node); + readOnly = Boolean(readOnly); + if (this.specifiedOptions[key]) { + Object.assign(node, this.specifiedOptions[key]); + } else { + this.specifiedOptions[key] = node; + } + let redis; + if (this.nodes.all[key]) { + redis = this.nodes.all[key]; + if (redis.options.readOnly !== readOnly) { + redis.options.readOnly = readOnly; + debug("Change role of %s to %s", key, readOnly ? "slave" : "master"); + redis[readOnly ? "readonly" : "readwrite"]().catch(utils_1.noop); + if (readOnly) { + delete this.nodes.master[key]; + this.nodes.slave[key] = redis; + } else { + delete this.nodes.slave[key]; + this.nodes.master[key] = redis; + } + } + } else { + debug("Connecting to %s as %s", key, readOnly ? "slave" : "master"); + redis = this.createRedisFromOptions(node, readOnly); + this.nodes.all[key] = redis; + this.nodes[readOnly ? "slave" : "master"][key] = redis; + redis.once("end", () => { + this.removeNode(key); + this.emit("-node", redis, key); + if (!Object.keys(this.nodes.all).length) { + this.emit("drain"); + } + }); + this.emit("+node", redis, key); + redis.on("error", function(error) { + this.emit("nodeError", error, key); + }); + } + return redis; + } + /** + * Reset the pool with a set of nodes. + * The old node will be removed. + */ + reset(nodes) { + debug("Reset with %O", nodes); + const newNodes = {}; + nodes.forEach((node) => { + const key = (0, util_1.getNodeKey)(node); + if (!(node.readOnly && newNodes[key])) { + newNodes[key] = node; + } + }); + Object.keys(this.nodes.all).forEach((key) => { + if (!newNodes[key]) { + debug("Disconnect %s because the node does not hold any slot", key); + this.nodes.all[key].disconnect(); + this.removeNode(key); + } + }); + Object.keys(newNodes).forEach((key) => { + const node = newNodes[key]; + this.findOrCreate(node, node.readOnly); + }); + } + /** + * Remove a node from the pool. + */ + removeNode(key) { + const { nodes } = this; + if (nodes.all[key]) { + debug("Remove %s from the pool", key); + delete nodes.all[key]; + } + delete nodes.master[key]; + delete nodes.slave[key]; + } + }; + exports2.default = ConnectionPool; + } +}); + +// node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js +var require_denque = __commonJS({ + "node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js"(exports2, module2) { + "use strict"; + function Denque(array, options) { + var options = options || {}; + this._capacity = options.capacity; + this._head = 0; + this._tail = 0; + if (Array.isArray(array)) { + this._fromArray(array); + } else { + this._capacityMask = 3; + this._list = new Array(4); + } + } + Denque.prototype.peekAt = function peekAt(index) { + var i = index; + if (i !== (i | 0)) { + return void 0; + } + var len = this.size(); + if (i >= len || i < -len) return void 0; + if (i < 0) i += len; + i = this._head + i & this._capacityMask; + return this._list[i]; + }; + Denque.prototype.get = function get(i) { + return this.peekAt(i); + }; + Denque.prototype.peek = function peek() { + if (this._head === this._tail) return void 0; + return this._list[this._head]; + }; + Denque.prototype.peekFront = function peekFront() { + return this.peek(); + }; + Denque.prototype.peekBack = function peekBack() { + return this.peekAt(-1); + }; + Object.defineProperty(Denque.prototype, "length", { + get: function length() { + return this.size(); + } + }); + Denque.prototype.size = function size() { + if (this._head === this._tail) return 0; + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); + }; + Denque.prototype.unshift = function unshift(item) { + if (arguments.length === 0) return this.size(); + var len = this._list.length; + this._head = this._head - 1 + len & this._capacityMask; + this._list[this._head] = item; + if (this._tail === this._head) this._growArray(); + if (this._capacity && this.size() > this._capacity) this.pop(); + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); + }; + Denque.prototype.shift = function shift() { + var head = this._head; + if (head === this._tail) return void 0; + var item = this._list[head]; + this._list[head] = void 0; + this._head = head + 1 & this._capacityMask; + if (head < 2 && this._tail > 1e4 && this._tail <= this._list.length >>> 2) this._shrinkArray(); + return item; + }; + Denque.prototype.push = function push(item) { + if (arguments.length === 0) return this.size(); + var tail = this._tail; + this._list[tail] = item; + this._tail = tail + 1 & this._capacityMask; + if (this._tail === this._head) { + this._growArray(); + } + if (this._capacity && this.size() > this._capacity) { + this.shift(); + } + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); + }; + Denque.prototype.pop = function pop() { + var tail = this._tail; + if (tail === this._head) return void 0; + var len = this._list.length; + this._tail = tail - 1 + len & this._capacityMask; + var item = this._list[this._tail]; + this._list[this._tail] = void 0; + if (this._head < 2 && tail > 1e4 && tail <= len >>> 2) this._shrinkArray(); + return item; + }; + Denque.prototype.removeOne = function removeOne(index) { + var i = index; + if (i !== (i | 0)) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size) return void 0; + if (i < 0) i += size; + i = this._head + i & this._capacityMask; + var item = this._list[i]; + var k; + if (index < size / 2) { + for (k = index; k > 0; k--) { + this._list[i] = this._list[i = i - 1 + len & this._capacityMask]; + } + this._list[i] = void 0; + this._head = this._head + 1 + len & this._capacityMask; + } else { + for (k = size - 1 - index; k > 0; k--) { + this._list[i] = this._list[i = i + 1 + len & this._capacityMask]; + } + this._list[i] = void 0; + this._tail = this._tail - 1 + len & this._capacityMask; + } + return item; + }; + Denque.prototype.remove = function remove(index, count) { + var i = index; + var removed; + var del_count = count; + if (i !== (i | 0)) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size || count < 1) return void 0; + if (i < 0) i += size; + if (count === 1 || !count) { + removed = new Array(1); + removed[0] = this.removeOne(i); + return removed; + } + if (i === 0 && i + count >= size) { + removed = this.toArray(); + this.clear(); + return removed; + } + if (i + count > size) count = size - i; + var k; + removed = new Array(count); + for (k = 0; k < count; k++) { + removed[k] = this._list[this._head + i + k & this._capacityMask]; + } + i = this._head + i & this._capacityMask; + if (index + count === size) { + this._tail = this._tail - count + len & this._capacityMask; + for (k = count; k > 0; k--) { + this._list[i = i + 1 + len & this._capacityMask] = void 0; + } + return removed; + } + if (index === 0) { + this._head = this._head + count + len & this._capacityMask; + for (k = count - 1; k > 0; k--) { + this._list[i = i + 1 + len & this._capacityMask] = void 0; + } + return removed; + } + if (i < size / 2) { + this._head = this._head + index + count + len & this._capacityMask; + for (k = index; k > 0; k--) { + this.unshift(this._list[i = i - 1 + len & this._capacityMask]); + } + i = this._head - 1 + len & this._capacityMask; + while (del_count > 0) { + this._list[i = i - 1 + len & this._capacityMask] = void 0; + del_count--; + } + if (index < 0) this._tail = i; + } else { + this._tail = i; + i = i + count + len & this._capacityMask; + for (k = size - (count + index); k > 0; k--) { + this.push(this._list[i++]); + } + i = this._tail; + while (del_count > 0) { + this._list[i = i + 1 + len & this._capacityMask] = void 0; + del_count--; + } + } + if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2) this._shrinkArray(); + return removed; + }; + Denque.prototype.splice = function splice(index, count) { + var i = index; + if (i !== (i | 0)) { + return void 0; + } + var size = this.size(); + if (i < 0) i += size; + if (i > size) return void 0; + if (arguments.length > 2) { + var k; + var temp; + var removed; + var arg_len = arguments.length; + var len = this._list.length; + var arguments_index = 2; + if (!size || i < size / 2) { + temp = new Array(i); + for (k = 0; k < i; k++) { + temp[k] = this._list[this._head + k & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i > 0) { + this._head = this._head + i + len & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._head = this._head + i + len & this._capacityMask; + } + while (arg_len > arguments_index) { + this.unshift(arguments[--arg_len]); + } + for (k = i; k > 0; k--) { + this.unshift(temp[k - 1]); + } + } else { + temp = new Array(size - (i + count)); + var leng = temp.length; + for (k = 0; k < leng; k++) { + temp[k] = this._list[this._head + i + count + k & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i != size) { + this._tail = this._head + i + len & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._tail = this._tail - leng + len & this._capacityMask; + } + while (arguments_index < arg_len) { + this.push(arguments[arguments_index++]); + } + for (k = 0; k < leng; k++) { + this.push(temp[k]); + } + } + return removed; + } else { + return this.remove(i, count); + } + }; + Denque.prototype.clear = function clear() { + this._list = new Array(this._list.length); + this._head = 0; + this._tail = 0; + }; + Denque.prototype.isEmpty = function isEmpty() { + return this._head === this._tail; + }; + Denque.prototype.toArray = function toArray() { + return this._copyArray(false); + }; + Denque.prototype._fromArray = function _fromArray(array) { + var length = array.length; + var capacity = this._nextPowerOf2(length); + this._list = new Array(capacity); + this._capacityMask = capacity - 1; + this._tail = length; + for (var i = 0; i < length; i++) this._list[i] = array[i]; + }; + Denque.prototype._copyArray = function _copyArray(fullCopy, size) { + var src = this._list; + var capacity = src.length; + var length = this.length; + size = size | length; + if (size == length && this._head < this._tail) { + return this._list.slice(this._head, this._tail); + } + var dest = new Array(size); + var k = 0; + var i; + if (fullCopy || this._head > this._tail) { + for (i = this._head; i < capacity; i++) dest[k++] = src[i]; + for (i = 0; i < this._tail; i++) dest[k++] = src[i]; + } else { + for (i = this._head; i < this._tail; i++) dest[k++] = src[i]; + } + return dest; + }; + Denque.prototype._growArray = function _growArray() { + if (this._head != 0) { + var newList = this._copyArray(true, this._list.length << 1); + this._tail = this._list.length; + this._head = 0; + this._list = newList; + } else { + this._tail = this._list.length; + this._list.length <<= 1; + } + this._capacityMask = this._capacityMask << 1 | 1; + }; + Denque.prototype._shrinkArray = function _shrinkArray() { + this._list.length >>>= 1; + this._capacityMask >>>= 1; + }; + Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) { + var log2 = Math.log(num) / Math.log(2); + var nextPow2 = 1 << log2 + 1; + return Math.max(nextPow2, 4); + }; + module2.exports = Denque; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js +var require_DelayQueue = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var utils_1 = require_utils2(); + var Deque = require_denque(); + var debug = (0, utils_1.Debug)("delayqueue"); + var DelayQueue = class { + constructor() { + this.queues = {}; + this.timeouts = {}; + } + /** + * Add a new item to the queue + * + * @param bucket bucket name + * @param item function that will run later + * @param options + */ + push(bucket, item, options) { + const callback = options.callback || process.nextTick; + if (!this.queues[bucket]) { + this.queues[bucket] = new Deque(); + } + const queue = this.queues[bucket]; + queue.push(item); + if (!this.timeouts[bucket]) { + this.timeouts[bucket] = setTimeout(() => { + callback(() => { + this.timeouts[bucket] = null; + this.execute(bucket); + }); + }, options.timeout); + } + } + execute(bucket) { + const queue = this.queues[bucket]; + if (!queue) { + return; + } + const { length } = queue; + if (!length) { + return; + } + debug("send %d commands in %s queue", length, bucket); + this.queues[bucket] = null; + while (queue.length > 0) { + queue.shift()(); + } + } + }; + exports2.default = DelayQueue; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js +var require_ClusterSubscriberGroup = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var utils_1 = require_utils2(); + var ClusterSubscriber_1 = require_ClusterSubscriber(); + var ConnectionPool_1 = require_ConnectionPool(); + var util_1 = require_util(); + var calculateSlot = require_lib(); + var debug = (0, utils_1.Debug)("cluster:subscriberGroup"); + var ClusterSubscriberGroup = class { + /** + * Register callbacks + * + * @param cluster + */ + constructor(cluster, refreshSlotsCacheCallback) { + this.cluster = cluster; + this.shardedSubscribers = /* @__PURE__ */ new Map(); + this.clusterSlots = []; + this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); + this.channels = /* @__PURE__ */ new Map(); + cluster.on("+node", (redis) => { + this._addSubscriber(redis); + }); + cluster.on("-node", (redis) => { + this._removeSubscriber(redis); + }); + cluster.on("refresh", () => { + this._refreshSlots(cluster); + }); + cluster.on("forceRefresh", () => { + refreshSlotsCacheCallback(); + }); + } + /** + * Get the responsible subscriber. + * + * Returns null if no subscriber was found + * + * @param slot + */ + getResponsibleSubscriber(slot) { + const nodeKey = this.clusterSlots[slot][0]; + return this.shardedSubscribers.get(nodeKey); + } + /** + * Adds a channel for which this subscriber group is responsible + * + * @param channels + */ + addChannels(channels) { + const slot = calculateSlot(channels[0]); + channels.forEach((c) => { + if (calculateSlot(c) != slot) + return -1; + }); + const currChannels = this.channels.get(slot); + if (!currChannels) { + this.channels.set(slot, channels); + } else { + this.channels.set(slot, currChannels.concat(channels)); + } + return [...this.channels.values()].flatMap((v) => v).length; + } + /** + * Removes channels for which the subscriber group is responsible by optionally unsubscribing + * @param channels + */ + removeChannels(channels) { + const slot = calculateSlot(channels[0]); + channels.forEach((c) => { + if (calculateSlot(c) != slot) + return -1; + }); + const slotChannels = this.channels.get(slot); + if (slotChannels) { + const updatedChannels = slotChannels.filter((c) => !channels.includes(c)); + this.channels.set(slot, updatedChannels); + } + return [...this.channels.values()].flatMap((v) => v).length; + } + /** + * Disconnect all subscribers + */ + stop() { + for (const s of this.shardedSubscribers.values()) { + s.stop(); + } + } + /** + * Start all not yet started subscribers + */ + start() { + for (const s of this.shardedSubscribers.values()) { + if (!s.isStarted()) { + s.start(); + } + } + } + /** + * Add a subscriber to the group of subscribers + * + * @param redis + */ + _addSubscriber(redis) { + const pool = new ConnectionPool_1.default(redis.options); + if (pool.addMasterNode(redis)) { + const sub = new ClusterSubscriber_1.default(pool, this.cluster, true); + const nodeKey = (0, util_1.getNodeKey)(redis.options); + this.shardedSubscribers.set(nodeKey, sub); + sub.start(); + this._resubscribe(); + this.cluster.emit("+subscriber"); + return sub; + } + return null; + } + /** + * Removes a subscriber from the group + * @param redis + */ + _removeSubscriber(redis) { + const nodeKey = (0, util_1.getNodeKey)(redis.options); + const sub = this.shardedSubscribers.get(nodeKey); + if (sub) { + sub.stop(); + this.shardedSubscribers.delete(nodeKey); + this._resubscribe(); + this.cluster.emit("-subscriber"); + } + return this.shardedSubscribers; + } + /** + * Refreshes the subscriber-related slot ranges + * + * Returns false if no refresh was needed + * + * @param cluster + */ + _refreshSlots(cluster) { + if (this._slotsAreEqual(cluster.slots)) { + debug("Nothing to refresh because the new cluster map is equal to the previous one."); + } else { + debug("Refreshing the slots of the subscriber group."); + this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); + for (let slot = 0; slot < cluster.slots.length; slot++) { + const node = cluster.slots[slot][0]; + if (!this.subscriberToSlotsIndex.has(node)) { + this.subscriberToSlotsIndex.set(node, []); + } + this.subscriberToSlotsIndex.get(node).push(Number(slot)); + } + this._resubscribe(); + this.clusterSlots = JSON.parse(JSON.stringify(cluster.slots)); + this.cluster.emit("subscribersReady"); + return true; + } + return false; + } + /** + * Resubscribes to the previous channels + * + * @private + */ + _resubscribe() { + if (this.shardedSubscribers) { + this.shardedSubscribers.forEach((s, nodeKey) => { + const subscriberSlots = this.subscriberToSlotsIndex.get(nodeKey); + if (subscriberSlots) { + s.associateSlotRange(subscriberSlots); + subscriberSlots.forEach((ss) => { + const redis = s.getInstance(); + const channels = this.channels.get(ss); + if (channels && channels.length > 0) { + if (redis) { + redis.ssubscribe(channels); + redis.on("ready", () => { + redis.ssubscribe(channels); + }); + } + } + }); + } + }); + } + } + /** + * Deep equality of the cluster slots objects + * + * @param other + * @private + */ + _slotsAreEqual(other) { + if (this.clusterSlots === void 0) + return false; + else + return JSON.stringify(this.clusterSlots) === JSON.stringify(other); + } + }; + exports2.default = ClusterSubscriberGroup; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js +var require_cluster = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var commands_1 = require_built(); + var events_1 = require("events"); + var redis_errors_1 = require_redis_errors(); + var standard_as_callback_1 = require_built2(); + var Command_1 = require_Command(); + var ClusterAllFailedError_1 = require_ClusterAllFailedError(); + var Redis_1 = require_Redis(); + var ScanStream_1 = require_ScanStream(); + var transaction_1 = require_transaction(); + var utils_1 = require_utils2(); + var applyMixin_1 = require_applyMixin(); + var Commander_1 = require_Commander(); + var ClusterOptions_1 = require_ClusterOptions(); + var ClusterSubscriber_1 = require_ClusterSubscriber(); + var ConnectionPool_1 = require_ConnectionPool(); + var DelayQueue_1 = require_DelayQueue(); + var util_1 = require_util(); + var Deque = require_denque(); + var ClusterSubscriberGroup_1 = require_ClusterSubscriberGroup(); + var debug = (0, utils_1.Debug)("cluster"); + var REJECT_OVERWRITTEN_COMMANDS = /* @__PURE__ */ new WeakSet(); + var Cluster = class _Cluster extends Commander_1.default { + /** + * Creates an instance of Cluster. + */ + //TODO: Add an option that enables or disables sharded PubSub + constructor(startupNodes, options = {}) { + super(); + this.slots = []; + this._groupsIds = {}; + this._groupsBySlot = Array(16384); + this.isCluster = true; + this.retryAttempts = 0; + this.delayQueue = new DelayQueue_1.default(); + this.offlineQueue = new Deque(); + this.isRefreshing = false; + this._refreshSlotsCacheCallbacks = []; + this._autoPipelines = /* @__PURE__ */ new Map(); + this._runningAutoPipelines = /* @__PURE__ */ new Set(); + this._readyDelayedCallbacks = []; + this.connectionEpoch = 0; + events_1.EventEmitter.call(this); + this.startupNodes = startupNodes; + this.options = (0, utils_1.defaults)({}, options, ClusterOptions_1.DEFAULT_CLUSTER_OPTIONS, this.options); + if (this.options.shardedSubscribers == true) + this.shardedSubscribers = new ClusterSubscriberGroup_1.default(this, this.refreshSlotsCache.bind(this)); + if (this.options.redisOptions && this.options.redisOptions.keyPrefix && !this.options.keyPrefix) { + this.options.keyPrefix = this.options.redisOptions.keyPrefix; + } + if (typeof this.options.scaleReads !== "function" && ["all", "master", "slave"].indexOf(this.options.scaleReads) === -1) { + throw new Error('Invalid option scaleReads "' + this.options.scaleReads + '". Expected "all", "master", "slave" or a custom function'); + } + this.connectionPool = new ConnectionPool_1.default(this.options.redisOptions); + this.connectionPool.on("-node", (redis, key) => { + this.emit("-node", redis); + }); + this.connectionPool.on("+node", (redis) => { + this.emit("+node", redis); + }); + this.connectionPool.on("drain", () => { + this.setStatus("close"); + }); + this.connectionPool.on("nodeError", (error, key) => { + this.emit("node error", error, key); + }); + this.subscriber = new ClusterSubscriber_1.default(this.connectionPool, this); + if (this.options.scripts) { + Object.entries(this.options.scripts).forEach(([name, definition]) => { + this.defineCommand(name, definition); + }); + } + if (this.options.lazyConnect) { + this.setStatus("wait"); + } else { + this.connect().catch((err) => { + debug("connecting failed: %s", err); + }); + } + } + /** + * Connect to a cluster + */ + connect() { + return new Promise((resolve2, reject) => { + if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { + reject(new Error("Redis is already connecting/connected")); + return; + } + const epoch = ++this.connectionEpoch; + this.setStatus("connecting"); + this.resolveStartupNodeHostnames().then((nodes) => { + if (this.connectionEpoch !== epoch) { + debug("discard connecting after resolving startup nodes because epoch not match: %d != %d", epoch, this.connectionEpoch); + reject(new redis_errors_1.RedisError("Connection is discarded because a new connection is made")); + return; + } + if (this.status !== "connecting") { + debug("discard connecting after resolving startup nodes because the status changed to %s", this.status); + reject(new redis_errors_1.RedisError("Connection is aborted")); + return; + } + this.connectionPool.reset(nodes); + const readyHandler = () => { + this.setStatus("ready"); + this.retryAttempts = 0; + this.executeOfflineCommands(); + this.resetNodesRefreshInterval(); + resolve2(); + }; + let closeListener = void 0; + const refreshListener = () => { + this.invokeReadyDelayedCallbacks(void 0); + this.removeListener("close", closeListener); + this.manuallyClosing = false; + this.setStatus("connect"); + if (this.options.enableReadyCheck) { + this.readyCheck((err, fail) => { + if (err || fail) { + debug("Ready check failed (%s). Reconnecting...", err || fail); + if (this.status === "connect") { + this.disconnect(true); + } + } else { + readyHandler(); + } + }); + } else { + readyHandler(); + } + }; + closeListener = () => { + const error = new Error("None of startup nodes is available"); + this.removeListener("refresh", refreshListener); + this.invokeReadyDelayedCallbacks(error); + reject(error); + }; + this.once("refresh", refreshListener); + this.once("close", closeListener); + this.once("close", this.handleCloseEvent.bind(this)); + this.refreshSlotsCache((err) => { + if (err && err.message === ClusterAllFailedError_1.default.defaultMessage) { + Redis_1.default.prototype.silentEmit.call(this, "error", err); + this.connectionPool.reset([]); + } + }); + this.subscriber.start(); + if (this.options.shardedSubscribers) { + this.shardedSubscribers.start(); + } + }).catch((err) => { + this.setStatus("close"); + this.handleCloseEvent(err); + this.invokeReadyDelayedCallbacks(err); + reject(err); + }); + }); + } + /** + * Disconnect from every node in the cluster. + */ + disconnect(reconnect = false) { + const status = this.status; + this.setStatus("disconnecting"); + if (!reconnect) { + this.manuallyClosing = true; + } + if (this.reconnectTimeout && !reconnect) { + clearTimeout(this.reconnectTimeout); + this.reconnectTimeout = null; + debug("Canceled reconnecting attempts"); + } + this.clearNodesRefreshInterval(); + this.subscriber.stop(); + if (this.options.shardedSubscribers) { + this.shardedSubscribers.stop(); + } + if (status === "wait") { + this.setStatus("close"); + this.handleCloseEvent(); + } else { + this.connectionPool.reset([]); + } + } + /** + * Quit the cluster gracefully. + */ + quit(callback) { + const status = this.status; + this.setStatus("disconnecting"); + this.manuallyClosing = true; + if (this.reconnectTimeout) { + clearTimeout(this.reconnectTimeout); + this.reconnectTimeout = null; + } + this.clearNodesRefreshInterval(); + this.subscriber.stop(); + if (this.options.shardedSubscribers) { + this.shardedSubscribers.stop(); + } + if (status === "wait") { + const ret = (0, standard_as_callback_1.default)(Promise.resolve("OK"), callback); + setImmediate(function() { + this.setStatus("close"); + this.handleCloseEvent(); + }.bind(this)); + return ret; + } + return (0, standard_as_callback_1.default)(Promise.all(this.nodes().map((node) => node.quit().catch((err) => { + if (err.message === utils_1.CONNECTION_CLOSED_ERROR_MSG) { + return "OK"; + } + throw err; + }))).then(() => "OK"), callback); + } + /** + * Create a new instance with the same startup nodes and options as the current one. + * + * @example + * ```js + * var cluster = new Redis.Cluster([{ host: "127.0.0.1", port: "30001" }]); + * var anotherCluster = cluster.duplicate(); + * ``` + */ + duplicate(overrideStartupNodes = [], overrideOptions = {}) { + const startupNodes = overrideStartupNodes.length > 0 ? overrideStartupNodes : this.startupNodes.slice(0); + const options = Object.assign({}, this.options, overrideOptions); + return new _Cluster(startupNodes, options); + } + /** + * Get nodes with the specified role + */ + nodes(role = "all") { + if (role !== "all" && role !== "master" && role !== "slave") { + throw new Error('Invalid role "' + role + '". Expected "all", "master" or "slave"'); + } + return this.connectionPool.getNodes(role); + } + /** + * This is needed in order not to install a listener for each auto pipeline + * + * @ignore + */ + delayUntilReady(callback) { + this._readyDelayedCallbacks.push(callback); + } + /** + * Get the number of commands queued in automatic pipelines. + * + * This is not available (and returns 0) until the cluster is connected and slots information have been received. + */ + get autoPipelineQueueSize() { + let queued = 0; + for (const pipeline of this._autoPipelines.values()) { + queued += pipeline.length; + } + return queued; + } + /** + * Refresh the slot cache + * + * @ignore + */ + refreshSlotsCache(callback) { + if (callback) { + this._refreshSlotsCacheCallbacks.push(callback); + } + if (this.isRefreshing) { + return; + } + this.isRefreshing = true; + const _this = this; + const wrapper = (error) => { + this.isRefreshing = false; + for (const callback2 of this._refreshSlotsCacheCallbacks) { + callback2(error); + } + this._refreshSlotsCacheCallbacks = []; + }; + const nodes = (0, utils_1.shuffle)(this.connectionPool.getNodes()); + let lastNodeError = null; + function tryNode(index) { + if (index === nodes.length) { + const error = new ClusterAllFailedError_1.default(ClusterAllFailedError_1.default.defaultMessage, lastNodeError); + return wrapper(error); + } + const node = nodes[index]; + const key = `${node.options.host}:${node.options.port}`; + debug("getting slot cache from %s", key); + _this.getInfoFromNode(node, function(err) { + switch (_this.status) { + case "close": + case "end": + return wrapper(new Error("Cluster is disconnected.")); + case "disconnecting": + return wrapper(new Error("Cluster is disconnecting.")); + } + if (err) { + _this.emit("node error", err, key); + lastNodeError = err; + tryNode(index + 1); + } else { + _this.emit("refresh"); + wrapper(); + } + }); + } + tryNode(0); + } + /** + * @ignore + */ + sendCommand(command, stream, node) { + if (this.status === "wait") { + this.connect().catch(utils_1.noop); + } + if (this.status === "end") { + command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); + return command.promise; + } + let to = this.options.scaleReads; + if (to !== "master") { + const isCommandReadOnly = command.isReadOnly || (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); + if (!isCommandReadOnly) { + to = "master"; + } + } + let targetSlot = node ? node.slot : command.getSlot(); + const ttl = {}; + const _this = this; + if (!node && !REJECT_OVERWRITTEN_COMMANDS.has(command)) { + REJECT_OVERWRITTEN_COMMANDS.add(command); + const reject = command.reject; + command.reject = function(err) { + const partialTry = tryConnection.bind(null, true); + _this.handleError(err, ttl, { + moved: function(slot, key) { + debug("command %s is moved to %s", command.name, key); + targetSlot = Number(slot); + if (_this.slots[slot]) { + _this.slots[slot][0] = key; + } else { + _this.slots[slot] = [key]; + } + _this._groupsBySlot[slot] = _this._groupsIds[_this.slots[slot].join(";")]; + _this.connectionPool.findOrCreate(_this.natMapper(key)); + tryConnection(); + debug("refreshing slot caches... (triggered by MOVED error)"); + _this.refreshSlotsCache(); + }, + ask: function(slot, key) { + debug("command %s is required to ask %s:%s", command.name, key); + const mapped = _this.natMapper(key); + _this.connectionPool.findOrCreate(mapped); + tryConnection(false, `${mapped.host}:${mapped.port}`); + }, + tryagain: partialTry, + clusterDown: partialTry, + connectionClosed: partialTry, + maxRedirections: function(redirectionError) { + reject.call(command, redirectionError); + }, + defaults: function() { + reject.call(command, err); + } + }); + }; + } + tryConnection(); + function tryConnection(random, asking) { + if (_this.status === "end") { + command.reject(new redis_errors_1.AbortError("Cluster is ended.")); + return; + } + let redis; + if (_this.status === "ready" || command.name === "cluster") { + if (node && node.redis) { + redis = node.redis; + } else if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", command.name) || Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", command.name)) { + if (_this.options.shardedSubscribers == true && (command.name == "ssubscribe" || command.name == "sunsubscribe")) { + const sub = _this.shardedSubscribers.getResponsibleSubscriber(targetSlot); + let status = -1; + if (command.name == "ssubscribe") + status = _this.shardedSubscribers.addChannels(command.getKeys()); + if (command.name == "sunsubscribe") + status = _this.shardedSubscribers.removeChannels(command.getKeys()); + if (status !== -1) { + redis = sub.getInstance(); + } else { + command.reject(new redis_errors_1.AbortError("Can't add or remove the given channels. Are they in the same slot?")); + } + } else { + redis = _this.subscriber.getInstance(); + } + if (!redis) { + command.reject(new redis_errors_1.AbortError("No subscriber for the cluster")); + return; + } + } else { + if (!random) { + if (typeof targetSlot === "number" && _this.slots[targetSlot]) { + const nodeKeys = _this.slots[targetSlot]; + if (typeof to === "function") { + const nodes = nodeKeys.map(function(key) { + return _this.connectionPool.getInstanceByKey(key); + }); + redis = to(nodes, command); + if (Array.isArray(redis)) { + redis = (0, utils_1.sample)(redis); + } + if (!redis) { + redis = nodes[0]; + } + } else { + let key; + if (to === "all") { + key = (0, utils_1.sample)(nodeKeys); + } else if (to === "slave" && nodeKeys.length > 1) { + key = (0, utils_1.sample)(nodeKeys, 1); + } else { + key = nodeKeys[0]; + } + redis = _this.connectionPool.getInstanceByKey(key); + } + } + if (asking) { + redis = _this.connectionPool.getInstanceByKey(asking); + redis.asking(); + } + } + if (!redis) { + redis = (typeof to === "function" ? null : _this.connectionPool.getSampleInstance(to)) || _this.connectionPool.getSampleInstance("all"); + } + } + if (node && !node.redis) { + node.redis = redis; + } + } + if (redis) { + redis.sendCommand(command, stream); + } else if (_this.options.enableOfflineQueue) { + _this.offlineQueue.push({ + command, + stream, + node + }); + } else { + command.reject(new Error("Cluster isn't ready and enableOfflineQueue options is false")); + } + } + return command.promise; + } + sscanStream(key, options) { + return this.createScanStream("sscan", { key, options }); + } + sscanBufferStream(key, options) { + return this.createScanStream("sscanBuffer", { key, options }); + } + hscanStream(key, options) { + return this.createScanStream("hscan", { key, options }); + } + hscanBufferStream(key, options) { + return this.createScanStream("hscanBuffer", { key, options }); + } + zscanStream(key, options) { + return this.createScanStream("zscan", { key, options }); + } + zscanBufferStream(key, options) { + return this.createScanStream("zscanBuffer", { key, options }); + } + /** + * @ignore + */ + handleError(error, ttl, handlers) { + if (typeof ttl.value === "undefined") { + ttl.value = this.options.maxRedirections; + } else { + ttl.value -= 1; + } + if (ttl.value <= 0) { + handlers.maxRedirections(new Error("Too many Cluster redirections. Last error: " + error)); + return; + } + const errv = error.message.split(" "); + if (errv[0] === "MOVED") { + const timeout = this.options.retryDelayOnMoved; + if (timeout && typeof timeout === "number") { + this.delayQueue.push("moved", handlers.moved.bind(null, errv[1], errv[2]), { timeout }); + } else { + handlers.moved(errv[1], errv[2]); + } + } else if (errv[0] === "ASK") { + handlers.ask(errv[1], errv[2]); + } else if (errv[0] === "TRYAGAIN") { + this.delayQueue.push("tryagain", handlers.tryagain, { + timeout: this.options.retryDelayOnTryAgain + }); + } else if (errv[0] === "CLUSTERDOWN" && this.options.retryDelayOnClusterDown > 0) { + this.delayQueue.push("clusterdown", handlers.connectionClosed, { + timeout: this.options.retryDelayOnClusterDown, + callback: this.refreshSlotsCache.bind(this) + }); + } else if (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG && this.options.retryDelayOnFailover > 0 && this.status === "ready") { + this.delayQueue.push("failover", handlers.connectionClosed, { + timeout: this.options.retryDelayOnFailover, + callback: this.refreshSlotsCache.bind(this) + }); + } else { + handlers.defaults(); + } + } + resetOfflineQueue() { + this.offlineQueue = new Deque(); + } + clearNodesRefreshInterval() { + if (this.slotsTimer) { + clearTimeout(this.slotsTimer); + this.slotsTimer = null; + } + } + resetNodesRefreshInterval() { + if (this.slotsTimer || !this.options.slotsRefreshInterval) { + return; + } + const nextRound = () => { + this.slotsTimer = setTimeout(() => { + debug('refreshing slot caches... (triggered by "slotsRefreshInterval" option)'); + this.refreshSlotsCache(() => { + nextRound(); + }); + }, this.options.slotsRefreshInterval); + }; + nextRound(); + } + /** + * Change cluster instance's status + */ + setStatus(status) { + debug("status: %s -> %s", this.status || "[empty]", status); + this.status = status; + process.nextTick(() => { + this.emit(status); + }); + } + /** + * Called when closed to check whether a reconnection should be made + */ + handleCloseEvent(reason) { + if (reason) { + debug("closed because %s", reason); + } + let retryDelay; + if (!this.manuallyClosing && typeof this.options.clusterRetryStrategy === "function") { + retryDelay = this.options.clusterRetryStrategy.call(this, ++this.retryAttempts, reason); + } + if (typeof retryDelay === "number") { + this.setStatus("reconnecting"); + this.reconnectTimeout = setTimeout(() => { + this.reconnectTimeout = null; + debug("Cluster is disconnected. Retrying after %dms", retryDelay); + this.connect().catch(function(err) { + debug("Got error %s when reconnecting. Ignoring...", err); + }); + }, retryDelay); + } else { + this.setStatus("end"); + this.flushQueue(new Error("None of startup nodes is available")); + } + } + /** + * Flush offline queue with error. + */ + flushQueue(error) { + let item; + while (item = this.offlineQueue.shift()) { + item.command.reject(error); + } + } + executeOfflineCommands() { + if (this.offlineQueue.length) { + debug("send %d commands in offline queue", this.offlineQueue.length); + const offlineQueue = this.offlineQueue; + this.resetOfflineQueue(); + let item; + while (item = offlineQueue.shift()) { + this.sendCommand(item.command, item.stream, item.node); + } + } + } + natMapper(nodeKey) { + const key = typeof nodeKey === "string" ? nodeKey : `${nodeKey.host}:${nodeKey.port}`; + let mapped = null; + if (this.options.natMap && typeof this.options.natMap === "function") { + mapped = this.options.natMap(key); + } else if (this.options.natMap && typeof this.options.natMap === "object") { + mapped = this.options.natMap[key]; + } + if (mapped) { + debug("NAT mapping %s -> %O", key, mapped); + return Object.assign({}, mapped); + } + return typeof nodeKey === "string" ? (0, util_1.nodeKeyToRedisOptions)(nodeKey) : nodeKey; + } + getInfoFromNode(redis, callback) { + if (!redis) { + return callback(new Error("Node is disconnected")); + } + const duplicatedConnection = redis.duplicate({ + enableOfflineQueue: true, + enableReadyCheck: false, + retryStrategy: null, + connectionName: (0, util_1.getConnectionName)("refresher", this.options.redisOptions && this.options.redisOptions.connectionName) + }); + duplicatedConnection.on("error", utils_1.noop); + duplicatedConnection.cluster("SLOTS", (0, utils_1.timeout)((err, result) => { + duplicatedConnection.disconnect(); + if (err) { + debug("error encountered running CLUSTER.SLOTS: %s", err); + return callback(err); + } + if (this.status === "disconnecting" || this.status === "close" || this.status === "end") { + debug("ignore CLUSTER.SLOTS results (count: %d) since cluster status is %s", result.length, this.status); + callback(); + return; + } + const nodes = []; + debug("cluster slots result count: %d", result.length); + for (let i = 0; i < result.length; ++i) { + const items = result[i]; + const slotRangeStart = items[0]; + const slotRangeEnd = items[1]; + const keys = []; + for (let j2 = 2; j2 < items.length; j2++) { + if (!items[j2][0]) { + continue; + } + const node = this.natMapper({ + host: items[j2][0], + port: items[j2][1] + }); + node.readOnly = j2 !== 2; + nodes.push(node); + keys.push(node.host + ":" + node.port); + } + debug("cluster slots result [%d]: slots %d~%d served by %s", i, slotRangeStart, slotRangeEnd, keys); + for (let slot = slotRangeStart; slot <= slotRangeEnd; slot++) { + this.slots[slot] = keys; + } + } + this._groupsIds = /* @__PURE__ */ Object.create(null); + let j = 0; + for (let i = 0; i < 16384; i++) { + const target = (this.slots[i] || []).join(";"); + if (!target.length) { + this._groupsBySlot[i] = void 0; + continue; + } + if (!this._groupsIds[target]) { + this._groupsIds[target] = ++j; + } + this._groupsBySlot[i] = this._groupsIds[target]; + } + this.connectionPool.reset(nodes); + callback(); + }, this.options.slotsRefreshTimeout)); + } + invokeReadyDelayedCallbacks(err) { + for (const c of this._readyDelayedCallbacks) { + process.nextTick(c, err); + } + this._readyDelayedCallbacks = []; + } + /** + * Check whether Cluster is able to process commands + */ + readyCheck(callback) { + this.cluster("INFO", (err, res) => { + if (err) { + return callback(err); + } + if (typeof res !== "string") { + return callback(); + } + let state; + const lines = res.split("\r\n"); + for (let i = 0; i < lines.length; ++i) { + const parts = lines[i].split(":"); + if (parts[0] === "cluster_state") { + state = parts[1]; + break; + } + } + if (state === "fail") { + debug("cluster state not ok (%s)", state); + callback(null, state); + } else { + callback(); + } + }); + } + resolveSrv(hostname) { + return new Promise((resolve2, reject) => { + this.options.resolveSrv(hostname, (err, records) => { + if (err) { + return reject(err); + } + const self2 = this, groupedRecords = (0, util_1.groupSrvRecords)(records), sortedKeys = Object.keys(groupedRecords).sort((a, b) => parseInt(a) - parseInt(b)); + function tryFirstOne(err2) { + if (!sortedKeys.length) { + return reject(err2); + } + const key = sortedKeys[0], group = groupedRecords[key], record = (0, util_1.weightSrvRecords)(group); + if (!group.records.length) { + sortedKeys.shift(); + } + self2.dnsLookup(record.name).then((host) => resolve2({ + host, + port: record.port + }), tryFirstOne); + } + tryFirstOne(); + }); + }); + } + dnsLookup(hostname) { + return new Promise((resolve2, reject) => { + this.options.dnsLookup(hostname, (err, address) => { + if (err) { + debug("failed to resolve hostname %s to IP: %s", hostname, err.message); + reject(err); + } else { + debug("resolved hostname %s to IP %s", hostname, address); + resolve2(address); + } + }); + }); + } + /** + * Normalize startup nodes, and resolving hostnames to IPs. + * + * This process happens every time when #connect() is called since + * #startupNodes and DNS records may chanage. + */ + async resolveStartupNodeHostnames() { + if (!Array.isArray(this.startupNodes) || this.startupNodes.length === 0) { + throw new Error("`startupNodes` should contain at least one node."); + } + const startupNodes = (0, util_1.normalizeNodeOptions)(this.startupNodes); + const hostnames = (0, util_1.getUniqueHostnamesFromOptions)(startupNodes); + if (hostnames.length === 0) { + return startupNodes; + } + const configs = await Promise.all(hostnames.map((this.options.useSRVRecords ? this.resolveSrv : this.dnsLookup).bind(this))); + const hostnameToConfig = (0, utils_1.zipMap)(hostnames, configs); + return startupNodes.map((node) => { + const config = hostnameToConfig.get(node.host); + if (!config) { + return node; + } + if (this.options.useSRVRecords) { + return Object.assign({}, node, config); + } + return Object.assign({}, node, { host: config }); + }); + } + createScanStream(command, { key, options = {} }) { + return new ScanStream_1.default({ + objectMode: true, + key, + redis: this, + command, + ...options + }); + } + }; + (0, applyMixin_1.default)(Cluster, events_1.EventEmitter); + (0, transaction_1.addTransactionSupport)(Cluster.prototype); + exports2.default = Cluster; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js +var require_AbstractConnector = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var utils_1 = require_utils2(); + var debug = (0, utils_1.Debug)("AbstractConnector"); + var AbstractConnector = class { + constructor(disconnectTimeout) { + this.connecting = false; + this.disconnectTimeout = disconnectTimeout; + } + check(info) { + return true; + } + disconnect() { + this.connecting = false; + if (this.stream) { + const stream = this.stream; + const timeout = setTimeout(() => { + debug("stream %s:%s still open, destroying it", stream.remoteAddress, stream.remotePort); + stream.destroy(); + }, this.disconnectTimeout); + stream.on("close", () => clearTimeout(timeout)); + stream.end(); + } + } + }; + exports2.default = AbstractConnector; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js +var require_StandaloneConnector = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var net_1 = require("net"); + var tls_1 = require("tls"); + var utils_1 = require_utils2(); + var AbstractConnector_1 = require_AbstractConnector(); + var StandaloneConnector = class extends AbstractConnector_1.default { + constructor(options) { + super(options.disconnectTimeout); + this.options = options; + } + connect(_) { + const { options } = this; + this.connecting = true; + let connectionOptions; + if ("path" in options && options.path) { + connectionOptions = { + path: options.path + }; + } else { + connectionOptions = {}; + if ("port" in options && options.port != null) { + connectionOptions.port = options.port; + } + if ("host" in options && options.host != null) { + connectionOptions.host = options.host; + } + if ("family" in options && options.family != null) { + connectionOptions.family = options.family; + } + } + if (options.tls) { + Object.assign(connectionOptions, options.tls); + } + return new Promise((resolve2, reject) => { + process.nextTick(() => { + if (!this.connecting) { + reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); + return; + } + try { + if (options.tls) { + this.stream = (0, tls_1.connect)(connectionOptions); + } else { + this.stream = (0, net_1.createConnection)(connectionOptions); + } + } catch (err) { + reject(err); + return; + } + this.stream.once("error", (err) => { + this.firstError = err; + }); + resolve2(this.stream); + }); + }); + } + }; + exports2.default = StandaloneConnector; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js +var require_SentinelIterator = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + function isSentinelEql(a, b) { + return (a.host || "127.0.0.1") === (b.host || "127.0.0.1") && (a.port || 26379) === (b.port || 26379); + } + var SentinelIterator = class { + constructor(sentinels) { + this.cursor = 0; + this.sentinels = sentinels.slice(0); + } + next() { + const done = this.cursor >= this.sentinels.length; + return { done, value: done ? void 0 : this.sentinels[this.cursor++] }; + } + reset(moveCurrentEndpointToFirst) { + if (moveCurrentEndpointToFirst && this.sentinels.length > 1 && this.cursor !== 1) { + this.sentinels.unshift(...this.sentinels.splice(this.cursor - 1)); + } + this.cursor = 0; + } + add(sentinel) { + for (let i = 0; i < this.sentinels.length; i++) { + if (isSentinelEql(sentinel, this.sentinels[i])) { + return false; + } + } + this.sentinels.push(sentinel); + return true; + } + toString() { + return `${JSON.stringify(this.sentinels)} @${this.cursor}`; + } + }; + exports2.default = SentinelIterator; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js +var require_FailoverDetector = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FailoverDetector = void 0; + var utils_1 = require_utils2(); + var debug = (0, utils_1.Debug)("FailoverDetector"); + var CHANNEL_NAME = "+switch-master"; + var FailoverDetector = class { + // sentinels can't be used for regular commands after this + constructor(connector, sentinels) { + this.isDisconnected = false; + this.connector = connector; + this.sentinels = sentinels; + } + cleanup() { + this.isDisconnected = true; + for (const sentinel of this.sentinels) { + sentinel.client.disconnect(); + } + } + async subscribe() { + debug("Starting FailoverDetector"); + const promises2 = []; + for (const sentinel of this.sentinels) { + const promise = sentinel.client.subscribe(CHANNEL_NAME).catch((err) => { + debug("Failed to subscribe to failover messages on sentinel %s:%s (%s)", sentinel.address.host || "127.0.0.1", sentinel.address.port || 26739, err.message); + }); + promises2.push(promise); + sentinel.client.on("message", (channel) => { + if (!this.isDisconnected && channel === CHANNEL_NAME) { + this.disconnect(); + } + }); + } + await Promise.all(promises2); + } + disconnect() { + this.isDisconnected = true; + debug("Failover detected, disconnecting"); + this.connector.disconnect(); + } + }; + exports2.FailoverDetector = FailoverDetector; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js +var require_SentinelConnector = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SentinelIterator = void 0; + var net_1 = require("net"); + var utils_1 = require_utils2(); + var tls_1 = require("tls"); + var SentinelIterator_1 = require_SentinelIterator(); + exports2.SentinelIterator = SentinelIterator_1.default; + var AbstractConnector_1 = require_AbstractConnector(); + var Redis_1 = require_Redis(); + var FailoverDetector_1 = require_FailoverDetector(); + var debug = (0, utils_1.Debug)("SentinelConnector"); + var SentinelConnector = class extends AbstractConnector_1.default { + constructor(options) { + super(options.disconnectTimeout); + this.options = options; + this.emitter = null; + this.failoverDetector = null; + if (!this.options.sentinels.length) { + throw new Error("Requires at least one sentinel to connect to."); + } + if (!this.options.name) { + throw new Error("Requires the name of master."); + } + this.sentinelIterator = new SentinelIterator_1.default(this.options.sentinels); + } + check(info) { + const roleMatches = !info.role || this.options.role === info.role; + if (!roleMatches) { + debug("role invalid, expected %s, but got %s", this.options.role, info.role); + this.sentinelIterator.next(); + this.sentinelIterator.next(); + this.sentinelIterator.reset(true); + } + return roleMatches; + } + disconnect() { + super.disconnect(); + if (this.failoverDetector) { + this.failoverDetector.cleanup(); + } + } + connect(eventEmitter) { + this.connecting = true; + this.retryAttempts = 0; + let lastError; + const connectToNext = async () => { + const endpoint = this.sentinelIterator.next(); + if (endpoint.done) { + this.sentinelIterator.reset(false); + const retryDelay = typeof this.options.sentinelRetryStrategy === "function" ? this.options.sentinelRetryStrategy(++this.retryAttempts) : null; + let errorMsg = typeof retryDelay !== "number" ? "All sentinels are unreachable and retry is disabled." : `All sentinels are unreachable. Retrying from scratch after ${retryDelay}ms.`; + if (lastError) { + errorMsg += ` Last error: ${lastError.message}`; + } + debug(errorMsg); + const error = new Error(errorMsg); + if (typeof retryDelay === "number") { + eventEmitter("error", error); + await new Promise((resolve2) => setTimeout(resolve2, retryDelay)); + return connectToNext(); + } else { + throw error; + } + } + let resolved = null; + let err = null; + try { + resolved = await this.resolve(endpoint.value); + } catch (error) { + err = error; + } + if (!this.connecting) { + throw new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG); + } + const endpointAddress = endpoint.value.host + ":" + endpoint.value.port; + if (resolved) { + debug("resolved: %s:%s from sentinel %s", resolved.host, resolved.port, endpointAddress); + if (this.options.enableTLSForSentinelMode && this.options.tls) { + Object.assign(resolved, this.options.tls); + this.stream = (0, tls_1.connect)(resolved); + this.stream.once("secureConnect", this.initFailoverDetector.bind(this)); + } else { + this.stream = (0, net_1.createConnection)(resolved); + this.stream.once("connect", this.initFailoverDetector.bind(this)); + } + this.stream.once("error", (err2) => { + this.firstError = err2; + }); + return this.stream; + } else { + const errorMsg = err ? "failed to connect to sentinel " + endpointAddress + " because " + err.message : "connected to sentinel " + endpointAddress + " successfully, but got an invalid reply: " + resolved; + debug(errorMsg); + eventEmitter("sentinelError", new Error(errorMsg)); + if (err) { + lastError = err; + } + return connectToNext(); + } + }; + return connectToNext(); + } + async updateSentinels(client) { + if (!this.options.updateSentinels) { + return; + } + const result = await client.sentinel("sentinels", this.options.name); + if (!Array.isArray(result)) { + return; + } + result.map(utils_1.packObject).forEach((sentinel) => { + const flags = sentinel.flags ? sentinel.flags.split(",") : []; + if (flags.indexOf("disconnected") === -1 && sentinel.ip && sentinel.port) { + const endpoint = this.sentinelNatResolve(addressResponseToAddress(sentinel)); + if (this.sentinelIterator.add(endpoint)) { + debug("adding sentinel %s:%s", endpoint.host, endpoint.port); + } + } + }); + debug("Updated internal sentinels: %s", this.sentinelIterator); + } + async resolveMaster(client) { + const result = await client.sentinel("get-master-addr-by-name", this.options.name); + await this.updateSentinels(client); + return this.sentinelNatResolve(Array.isArray(result) ? { host: result[0], port: Number(result[1]) } : null); + } + async resolveSlave(client) { + const result = await client.sentinel("slaves", this.options.name); + if (!Array.isArray(result)) { + return null; + } + const availableSlaves = result.map(utils_1.packObject).filter((slave) => slave.flags && !slave.flags.match(/(disconnected|s_down|o_down)/)); + return this.sentinelNatResolve(selectPreferredSentinel(availableSlaves, this.options.preferredSlaves)); + } + sentinelNatResolve(item) { + if (!item || !this.options.natMap) + return item; + const key = `${item.host}:${item.port}`; + let result = item; + if (typeof this.options.natMap === "function") { + result = this.options.natMap(key) || item; + } else if (typeof this.options.natMap === "object") { + result = this.options.natMap[key] || item; + } + return result; + } + connectToSentinel(endpoint, options) { + const redis = new Redis_1.default({ + port: endpoint.port || 26379, + host: endpoint.host, + username: this.options.sentinelUsername || null, + password: this.options.sentinelPassword || null, + family: endpoint.family || // @ts-expect-error + ("path" in this.options && this.options.path ? void 0 : ( + // @ts-expect-error + this.options.family + )), + tls: this.options.sentinelTLS, + retryStrategy: null, + enableReadyCheck: false, + connectTimeout: this.options.connectTimeout, + commandTimeout: this.options.sentinelCommandTimeout, + ...options + }); + return redis; + } + async resolve(endpoint) { + const client = this.connectToSentinel(endpoint); + client.on("error", noop); + try { + if (this.options.role === "slave") { + return await this.resolveSlave(client); + } else { + return await this.resolveMaster(client); + } + } finally { + client.disconnect(); + } + } + async initFailoverDetector() { + var _a; + if (!this.options.failoverDetector) { + return; + } + this.sentinelIterator.reset(true); + const sentinels = []; + while (sentinels.length < this.options.sentinelMaxConnections) { + const { done, value } = this.sentinelIterator.next(); + if (done) { + break; + } + const client = this.connectToSentinel(value, { + lazyConnect: true, + retryStrategy: this.options.sentinelReconnectStrategy + }); + client.on("reconnecting", () => { + var _a2; + (_a2 = this.emitter) === null || _a2 === void 0 ? void 0 : _a2.emit("sentinelReconnecting"); + }); + sentinels.push({ address: value, client }); + } + this.sentinelIterator.reset(false); + if (this.failoverDetector) { + this.failoverDetector.cleanup(); + } + this.failoverDetector = new FailoverDetector_1.FailoverDetector(this, sentinels); + await this.failoverDetector.subscribe(); + (_a = this.emitter) === null || _a === void 0 ? void 0 : _a.emit("failoverSubscribed"); + } + }; + exports2.default = SentinelConnector; + function selectPreferredSentinel(availableSlaves, preferredSlaves) { + if (availableSlaves.length === 0) { + return null; + } + let selectedSlave; + if (typeof preferredSlaves === "function") { + selectedSlave = preferredSlaves(availableSlaves); + } else if (preferredSlaves !== null && typeof preferredSlaves === "object") { + const preferredSlavesArray = Array.isArray(preferredSlaves) ? preferredSlaves : [preferredSlaves]; + preferredSlavesArray.sort((a, b) => { + if (!a.prio) { + a.prio = 1; + } + if (!b.prio) { + b.prio = 1; + } + if (a.prio < b.prio) { + return -1; + } + if (a.prio > b.prio) { + return 1; + } + return 0; + }); + for (let p = 0; p < preferredSlavesArray.length; p++) { + for (let a = 0; a < availableSlaves.length; a++) { + const slave = availableSlaves[a]; + if (slave.ip === preferredSlavesArray[p].ip) { + if (slave.port === preferredSlavesArray[p].port) { + selectedSlave = slave; + break; + } + } + } + if (selectedSlave) { + break; + } + } + } + if (!selectedSlave) { + selectedSlave = (0, utils_1.sample)(availableSlaves); + } + return addressResponseToAddress(selectedSlave); + } + function addressResponseToAddress(input) { + return { host: input.ip, port: Number(input.port) }; + } + function noop() { + } + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js +var require_connectors = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SentinelConnector = exports2.StandaloneConnector = void 0; + var StandaloneConnector_1 = require_StandaloneConnector(); + exports2.StandaloneConnector = StandaloneConnector_1.default; + var SentinelConnector_1 = require_SentinelConnector(); + exports2.SentinelConnector = SentinelConnector_1.default; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js +var require_MaxRetriesPerRequestError = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var redis_errors_1 = require_redis_errors(); + var MaxRetriesPerRequestError = class extends redis_errors_1.AbortError { + constructor(maxRetriesPerRequest) { + const message = `Reached the max retries per request limit (which is ${maxRetriesPerRequest}). Refer to "maxRetriesPerRequest" option for details.`; + super(message); + Error.captureStackTrace(this, this.constructor); + } + get name() { + return this.constructor.name; + } + }; + exports2.default = MaxRetriesPerRequestError; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js +var require_errors = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MaxRetriesPerRequestError = void 0; + var MaxRetriesPerRequestError_1 = require_MaxRetriesPerRequestError(); + exports2.MaxRetriesPerRequestError = MaxRetriesPerRequestError_1.default; + } +}); + +// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js +var require_parser = __commonJS({ + "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js"(exports2, module2) { + "use strict"; + var Buffer2 = require("buffer").Buffer; + var StringDecoder = require("string_decoder").StringDecoder; + var decoder = new StringDecoder(); + var errors = require_redis_errors(); + var ReplyError = errors.ReplyError; + var ParserError = errors.ParserError; + var bufferPool = Buffer2.allocUnsafe(32 * 1024); + var bufferOffset = 0; + var interval = null; + var counter = 0; + var notDecreased = 0; + function parseSimpleNumbers(parser) { + const length = parser.buffer.length - 1; + var offset = parser.offset; + var number = 0; + var sign = 1; + if (parser.buffer[offset] === 45) { + sign = -1; + offset++; + } + while (offset < length) { + const c1 = parser.buffer[offset++]; + if (c1 === 13) { + parser.offset = offset + 1; + return sign * number; + } + number = number * 10 + (c1 - 48); + } + } + function parseStringNumbers(parser) { + const length = parser.buffer.length - 1; + var offset = parser.offset; + var number = 0; + var res = ""; + if (parser.buffer[offset] === 45) { + res += "-"; + offset++; + } + while (offset < length) { + var c1 = parser.buffer[offset++]; + if (c1 === 13) { + parser.offset = offset + 1; + if (number !== 0) { + res += number; + } + return res; + } else if (number > 429496728) { + res += number * 10 + (c1 - 48); + number = 0; + } else if (c1 === 48 && number === 0) { + res += 0; + } else { + number = number * 10 + (c1 - 48); + } + } + } + function parseSimpleString(parser) { + const start = parser.offset; + const buffer = parser.buffer; + const length = buffer.length - 1; + var offset = start; + while (offset < length) { + if (buffer[offset++] === 13) { + parser.offset = offset + 1; + if (parser.optionReturnBuffers === true) { + return parser.buffer.slice(start, offset - 1); + } + return parser.buffer.toString("utf8", start, offset - 1); + } + } + } + function parseLength(parser) { + const length = parser.buffer.length - 1; + var offset = parser.offset; + var number = 0; + while (offset < length) { + const c1 = parser.buffer[offset++]; + if (c1 === 13) { + parser.offset = offset + 1; + return number; + } + number = number * 10 + (c1 - 48); + } + } + function parseInteger(parser) { + if (parser.optionStringNumbers === true) { + return parseStringNumbers(parser); + } + return parseSimpleNumbers(parser); + } + function parseBulkString(parser) { + const length = parseLength(parser); + if (length === void 0) { + return; + } + if (length < 0) { + return null; + } + const offset = parser.offset + length; + if (offset + 2 > parser.buffer.length) { + parser.bigStrSize = offset + 2; + parser.totalChunkSize = parser.buffer.length; + parser.bufferCache.push(parser.buffer); + return; + } + const start = parser.offset; + parser.offset = offset + 2; + if (parser.optionReturnBuffers === true) { + return parser.buffer.slice(start, offset); + } + return parser.buffer.toString("utf8", start, offset); + } + function parseError(parser) { + var string = parseSimpleString(parser); + if (string !== void 0) { + if (parser.optionReturnBuffers === true) { + string = string.toString(); + } + return new ReplyError(string); + } + } + function handleError(parser, type) { + const err = new ParserError( + "Protocol error, got " + JSON.stringify(String.fromCharCode(type)) + " as reply type byte", + JSON.stringify(parser.buffer), + parser.offset + ); + parser.buffer = null; + parser.returnFatalError(err); + } + function parseArray(parser) { + const length = parseLength(parser); + if (length === void 0) { + return; + } + if (length < 0) { + return null; + } + const responses = new Array(length); + return parseArrayElements(parser, responses, 0); + } + function pushArrayCache(parser, array, pos) { + parser.arrayCache.push(array); + parser.arrayPos.push(pos); + } + function parseArrayChunks(parser) { + const tmp = parser.arrayCache.pop(); + var pos = parser.arrayPos.pop(); + if (parser.arrayCache.length) { + const res = parseArrayChunks(parser); + if (res === void 0) { + pushArrayCache(parser, tmp, pos); + return; + } + tmp[pos++] = res; + } + return parseArrayElements(parser, tmp, pos); + } + function parseArrayElements(parser, responses, i) { + const bufferLength = parser.buffer.length; + while (i < responses.length) { + const offset = parser.offset; + if (parser.offset >= bufferLength) { + pushArrayCache(parser, responses, i); + return; + } + const response = parseType(parser, parser.buffer[parser.offset++]); + if (response === void 0) { + if (!(parser.arrayCache.length || parser.bufferCache.length)) { + parser.offset = offset; + } + pushArrayCache(parser, responses, i); + return; + } + responses[i] = response; + i++; + } + return responses; + } + function parseType(parser, type) { + switch (type) { + case 36: + return parseBulkString(parser); + case 43: + return parseSimpleString(parser); + case 42: + return parseArray(parser); + case 58: + return parseInteger(parser); + case 45: + return parseError(parser); + default: + return handleError(parser, type); + } + } + function decreaseBufferPool() { + if (bufferPool.length > 50 * 1024) { + if (counter === 1 || notDecreased > counter * 2) { + const minSliceLen = Math.floor(bufferPool.length / 10); + const sliceLength = minSliceLen < bufferOffset ? bufferOffset : minSliceLen; + bufferOffset = 0; + bufferPool = bufferPool.slice(sliceLength, bufferPool.length); + } else { + notDecreased++; + counter--; + } + } else { + clearInterval(interval); + counter = 0; + notDecreased = 0; + interval = null; + } + } + function resizeBuffer(length) { + if (bufferPool.length < length + bufferOffset) { + const multiplier = length > 1024 * 1024 * 75 ? 2 : 3; + if (bufferOffset > 1024 * 1024 * 111) { + bufferOffset = 1024 * 1024 * 50; + } + bufferPool = Buffer2.allocUnsafe(length * multiplier + bufferOffset); + bufferOffset = 0; + counter++; + if (interval === null) { + interval = setInterval(decreaseBufferPool, 50); + } + } + } + function concatBulkString(parser) { + const list = parser.bufferCache; + const oldOffset = parser.offset; + var chunks = list.length; + var offset = parser.bigStrSize - parser.totalChunkSize; + parser.offset = offset; + if (offset <= 2) { + if (chunks === 2) { + return list[0].toString("utf8", oldOffset, list[0].length + offset - 2); + } + chunks--; + offset = list[list.length - 2].length + offset; + } + var res = decoder.write(list[0].slice(oldOffset)); + for (var i = 1; i < chunks - 1; i++) { + res += decoder.write(list[i]); + } + res += decoder.end(list[i].slice(0, offset - 2)); + return res; + } + function concatBulkBuffer(parser) { + const list = parser.bufferCache; + const oldOffset = parser.offset; + const length = parser.bigStrSize - oldOffset - 2; + var chunks = list.length; + var offset = parser.bigStrSize - parser.totalChunkSize; + parser.offset = offset; + if (offset <= 2) { + if (chunks === 2) { + return list[0].slice(oldOffset, list[0].length + offset - 2); + } + chunks--; + offset = list[list.length - 2].length + offset; + } + resizeBuffer(length); + const start = bufferOffset; + list[0].copy(bufferPool, start, oldOffset, list[0].length); + bufferOffset += list[0].length - oldOffset; + for (var i = 1; i < chunks - 1; i++) { + list[i].copy(bufferPool, bufferOffset); + bufferOffset += list[i].length; + } + list[i].copy(bufferPool, bufferOffset, 0, offset - 2); + bufferOffset += offset - 2; + return bufferPool.slice(start, bufferOffset); + } + var JavascriptRedisParser = class { + /** + * Javascript Redis Parser constructor + * @param {{returnError: Function, returnReply: Function, returnFatalError?: Function, returnBuffers: boolean, stringNumbers: boolean }} options + * @constructor + */ + constructor(options) { + if (!options) { + throw new TypeError("Options are mandatory."); + } + if (typeof options.returnError !== "function" || typeof options.returnReply !== "function") { + throw new TypeError("The returnReply and returnError options have to be functions."); + } + this.setReturnBuffers(!!options.returnBuffers); + this.setStringNumbers(!!options.stringNumbers); + this.returnError = options.returnError; + this.returnFatalError = options.returnFatalError || options.returnError; + this.returnReply = options.returnReply; + this.reset(); + } + /** + * Reset the parser values to the initial state + * + * @returns {undefined} + */ + reset() { + this.offset = 0; + this.buffer = null; + this.bigStrSize = 0; + this.totalChunkSize = 0; + this.bufferCache = []; + this.arrayCache = []; + this.arrayPos = []; + } + /** + * Set the returnBuffers option + * + * @param {boolean} returnBuffers + * @returns {undefined} + */ + setReturnBuffers(returnBuffers) { + if (typeof returnBuffers !== "boolean") { + throw new TypeError("The returnBuffers argument has to be a boolean"); + } + this.optionReturnBuffers = returnBuffers; + } + /** + * Set the stringNumbers option + * + * @param {boolean} stringNumbers + * @returns {undefined} + */ + setStringNumbers(stringNumbers) { + if (typeof stringNumbers !== "boolean") { + throw new TypeError("The stringNumbers argument has to be a boolean"); + } + this.optionStringNumbers = stringNumbers; + } + /** + * Parse the redis buffer + * @param {Buffer} buffer + * @returns {undefined} + */ + execute(buffer) { + if (this.buffer === null) { + this.buffer = buffer; + this.offset = 0; + } else if (this.bigStrSize === 0) { + const oldLength = this.buffer.length; + const remainingLength = oldLength - this.offset; + const newBuffer = Buffer2.allocUnsafe(remainingLength + buffer.length); + this.buffer.copy(newBuffer, 0, this.offset, oldLength); + buffer.copy(newBuffer, remainingLength, 0, buffer.length); + this.buffer = newBuffer; + this.offset = 0; + if (this.arrayCache.length) { + const arr = parseArrayChunks(this); + if (arr === void 0) { + return; + } + this.returnReply(arr); + } + } else if (this.totalChunkSize + buffer.length >= this.bigStrSize) { + this.bufferCache.push(buffer); + var tmp = this.optionReturnBuffers ? concatBulkBuffer(this) : concatBulkString(this); + this.bigStrSize = 0; + this.bufferCache = []; + this.buffer = buffer; + if (this.arrayCache.length) { + this.arrayCache[0][this.arrayPos[0]++] = tmp; + tmp = parseArrayChunks(this); + if (tmp === void 0) { + return; + } + } + this.returnReply(tmp); + } else { + this.bufferCache.push(buffer); + this.totalChunkSize += buffer.length; + return; + } + while (this.offset < this.buffer.length) { + const offset = this.offset; + const type = this.buffer[this.offset++]; + const response = parseType(this, type); + if (response === void 0) { + if (!(this.arrayCache.length || this.bufferCache.length)) { + this.offset = offset; + } + return; + } + if (type === 45) { + this.returnError(response); + } else { + this.returnReply(response); + } + } + this.buffer = null; + } + }; + module2.exports = JavascriptRedisParser; + } +}); + +// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js +var require_redis_parser = __commonJS({ + "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js"(exports2, module2) { + "use strict"; + module2.exports = require_parser(); + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js +var require_SubscriptionSet = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var SubscriptionSet = class { + constructor() { + this.set = { + subscribe: {}, + psubscribe: {}, + ssubscribe: {} + }; + } + add(set, channel) { + this.set[mapSet(set)][channel] = true; + } + del(set, channel) { + delete this.set[mapSet(set)][channel]; + } + channels(set) { + return Object.keys(this.set[mapSet(set)]); + } + isEmpty() { + return this.channels("subscribe").length === 0 && this.channels("psubscribe").length === 0 && this.channels("ssubscribe").length === 0; + } + }; + exports2.default = SubscriptionSet; + function mapSet(set) { + if (set === "unsubscribe") { + return "subscribe"; + } + if (set === "punsubscribe") { + return "psubscribe"; + } + if (set === "sunsubscribe") { + return "ssubscribe"; + } + return set; + } + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js +var require_DataHandler = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var Command_1 = require_Command(); + var utils_1 = require_utils2(); + var RedisParser = require_redis_parser(); + var SubscriptionSet_1 = require_SubscriptionSet(); + var debug = (0, utils_1.Debug)("dataHandler"); + var DataHandler = class { + constructor(redis, parserOptions) { + this.redis = redis; + const parser = new RedisParser({ + stringNumbers: parserOptions.stringNumbers, + returnBuffers: true, + returnError: (err) => { + this.returnError(err); + }, + returnFatalError: (err) => { + this.returnFatalError(err); + }, + returnReply: (reply) => { + this.returnReply(reply); + } + }); + redis.stream.prependListener("data", (data) => { + parser.execute(data); + }); + redis.stream.resume(); + } + returnFatalError(err) { + err.message += ". Please report this."; + this.redis.recoverFromFatalError(err, err, { offlineQueue: false }); + } + returnError(err) { + const item = this.shiftCommand(err); + if (!item) { + return; + } + err.command = { + name: item.command.name, + args: item.command.args + }; + if (item.command.name == "ssubscribe" && err.message.includes("MOVED")) { + this.redis.emit("moved"); + return; + } + this.redis.handleReconnection(err, item); + } + returnReply(reply) { + if (this.handleMonitorReply(reply)) { + return; + } + if (this.handleSubscriberReply(reply)) { + return; + } + const item = this.shiftCommand(reply); + if (!item) { + return; + } + if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", item.command.name)) { + this.redis.condition.subscriber = new SubscriptionSet_1.default(); + this.redis.condition.subscriber.add(item.command.name, reply[1].toString()); + if (!fillSubCommand(item.command, reply[2])) { + this.redis.commandQueue.unshift(item); + } + } else if (Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", item.command.name)) { + if (!fillUnsubCommand(item.command, reply[2])) { + this.redis.commandQueue.unshift(item); + } + } else { + item.command.resolve(reply); + } + } + handleSubscriberReply(reply) { + if (!this.redis.condition.subscriber) { + return false; + } + const replyType = Array.isArray(reply) ? reply[0].toString() : null; + debug('receive reply "%s" in subscriber mode', replyType); + switch (replyType) { + case "message": + if (this.redis.listeners("message").length > 0) { + this.redis.emit("message", reply[1].toString(), reply[2] ? reply[2].toString() : ""); + } + this.redis.emit("messageBuffer", reply[1], reply[2]); + break; + case "pmessage": { + const pattern = reply[1].toString(); + if (this.redis.listeners("pmessage").length > 0) { + this.redis.emit("pmessage", pattern, reply[2].toString(), reply[3].toString()); + } + this.redis.emit("pmessageBuffer", pattern, reply[2], reply[3]); + break; + } + case "smessage": { + if (this.redis.listeners("smessage").length > 0) { + this.redis.emit("smessage", reply[1].toString(), reply[2] ? reply[2].toString() : ""); + } + this.redis.emit("smessageBuffer", reply[1], reply[2]); + break; + } + case "ssubscribe": + case "subscribe": + case "psubscribe": { + const channel = reply[1].toString(); + this.redis.condition.subscriber.add(replyType, channel); + const item = this.shiftCommand(reply); + if (!item) { + return; + } + if (!fillSubCommand(item.command, reply[2])) { + this.redis.commandQueue.unshift(item); + } + break; + } + case "sunsubscribe": + case "unsubscribe": + case "punsubscribe": { + const channel = reply[1] ? reply[1].toString() : null; + if (channel) { + this.redis.condition.subscriber.del(replyType, channel); + } + const count = reply[2]; + if (Number(count) === 0) { + this.redis.condition.subscriber = false; + } + const item = this.shiftCommand(reply); + if (!item) { + return; + } + if (!fillUnsubCommand(item.command, count)) { + this.redis.commandQueue.unshift(item); + } + break; + } + default: { + const item = this.shiftCommand(reply); + if (!item) { + return; + } + item.command.resolve(reply); + } + } + return true; + } + handleMonitorReply(reply) { + if (this.redis.status !== "monitoring") { + return false; + } + const replyStr = reply.toString(); + if (replyStr === "OK") { + return false; + } + const len = replyStr.indexOf(" "); + const timestamp = replyStr.slice(0, len); + const argIndex = replyStr.indexOf('"'); + const args = replyStr.slice(argIndex + 1, -1).split('" "').map((elem) => elem.replace(/\\"/g, '"')); + const dbAndSource = replyStr.slice(len + 2, argIndex - 2).split(" "); + this.redis.emit("monitor", timestamp, args, dbAndSource[1], dbAndSource[0]); + return true; + } + shiftCommand(reply) { + const item = this.redis.commandQueue.shift(); + if (!item) { + const message = "Command queue state error. If you can reproduce this, please report it."; + const error = new Error(message + (reply instanceof Error ? ` Last error: ${reply.message}` : ` Last reply: ${reply.toString()}`)); + this.redis.emit("error", error); + return null; + } + return item; + } + }; + exports2.default = DataHandler; + var remainingRepliesMap = /* @__PURE__ */ new WeakMap(); + function fillSubCommand(command, count) { + let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; + remainingReplies -= 1; + if (remainingReplies <= 0) { + command.resolve(count); + remainingRepliesMap.delete(command); + return true; + } + remainingRepliesMap.set(command, remainingReplies); + return false; + } + function fillUnsubCommand(command, count) { + let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; + if (remainingReplies === 0) { + if (Number(count) === 0) { + remainingRepliesMap.delete(command); + command.resolve(count); + return true; + } + return false; + } + remainingReplies -= 1; + if (remainingReplies <= 0) { + command.resolve(count); + return true; + } + remainingRepliesMap.set(command, remainingReplies); + return false; + } + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js +var require_event_handler = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.readyHandler = exports2.errorHandler = exports2.closeHandler = exports2.connectHandler = void 0; + var redis_errors_1 = require_redis_errors(); + var Command_1 = require_Command(); + var errors_1 = require_errors(); + var utils_1 = require_utils2(); + var DataHandler_1 = require_DataHandler(); + var debug = (0, utils_1.Debug)("connection"); + function connectHandler(self2) { + return function() { + var _a; + self2.setStatus("connect"); + self2.resetCommandQueue(); + let flushed = false; + const { connectionEpoch } = self2; + if (self2.condition.auth) { + self2.auth(self2.condition.auth, function(err) { + if (connectionEpoch !== self2.connectionEpoch) { + return; + } + if (err) { + if (err.message.indexOf("no password is set") !== -1) { + console.warn("[WARN] Redis server does not require a password, but a password was supplied."); + } else if (err.message.indexOf("without any password configured for the default user") !== -1) { + console.warn("[WARN] This Redis server's `default` user does not require a password, but a password was supplied"); + } else if (err.message.indexOf("wrong number of arguments for 'auth' command") !== -1) { + console.warn(`[ERROR] The server returned "wrong number of arguments for 'auth' command". You are probably passing both username and password to Redis version 5 or below. You should only pass the 'password' option for Redis version 5 and under.`); + } else { + flushed = true; + self2.recoverFromFatalError(err, err); + } + } + }); + } + if (self2.condition.select) { + self2.select(self2.condition.select).catch((err) => { + self2.silentEmit("error", err); + }); + } + new DataHandler_1.default(self2, { + stringNumbers: self2.options.stringNumbers + }); + const clientCommandPromises = []; + if (self2.options.connectionName) { + debug("set the connection name [%s]", self2.options.connectionName); + clientCommandPromises.push(self2.client("setname", self2.options.connectionName).catch(utils_1.noop)); + } + if (!self2.options.disableClientInfo) { + debug("set the client info"); + clientCommandPromises.push((0, utils_1.getPackageMeta)().then((packageMeta) => { + return self2.client("SETINFO", "LIB-VER", packageMeta.version).catch(utils_1.noop); + }).catch(utils_1.noop)); + clientCommandPromises.push(self2.client("SETINFO", "LIB-NAME", ((_a = self2.options) === null || _a === void 0 ? void 0 : _a.clientInfoTag) ? `ioredis(${self2.options.clientInfoTag})` : "ioredis").catch(utils_1.noop)); + } + Promise.all(clientCommandPromises).catch(utils_1.noop).finally(() => { + if (!self2.options.enableReadyCheck) { + exports2.readyHandler(self2)(); + } + if (self2.options.enableReadyCheck) { + self2._readyCheck(function(err, info) { + if (connectionEpoch !== self2.connectionEpoch) { + return; + } + if (err) { + if (!flushed) { + self2.recoverFromFatalError(new Error("Ready check failed: " + err.message), err); + } + } else { + if (self2.connector.check(info)) { + exports2.readyHandler(self2)(); + } else { + self2.disconnect(true); + } + } + }); + } + }); + }; + } + exports2.connectHandler = connectHandler; + function abortError(command) { + const err = new redis_errors_1.AbortError("Command aborted due to connection close"); + err.command = { + name: command.name, + args: command.args + }; + return err; + } + function abortIncompletePipelines(commandQueue) { + var _a; + let expectedIndex = 0; + for (let i = 0; i < commandQueue.length; ) { + const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; + const pipelineIndex = command.pipelineIndex; + if (pipelineIndex === void 0 || pipelineIndex === 0) { + expectedIndex = 0; + } + if (pipelineIndex !== void 0 && pipelineIndex !== expectedIndex++) { + commandQueue.remove(i, 1); + command.reject(abortError(command)); + continue; + } + i++; + } + } + function abortTransactionFragments(commandQueue) { + var _a; + for (let i = 0; i < commandQueue.length; ) { + const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; + if (command.name === "multi") { + break; + } + if (command.name === "exec") { + commandQueue.remove(i, 1); + command.reject(abortError(command)); + break; + } + if (command.inTransaction) { + commandQueue.remove(i, 1); + command.reject(abortError(command)); + } else { + i++; + } + } + } + function closeHandler(self2) { + return function() { + const prevStatus = self2.status; + self2.setStatus("close"); + if (self2.commandQueue.length) { + abortIncompletePipelines(self2.commandQueue); + } + if (self2.offlineQueue.length) { + abortTransactionFragments(self2.offlineQueue); + } + if (prevStatus === "ready") { + if (!self2.prevCondition) { + self2.prevCondition = self2.condition; + } + if (self2.commandQueue.length) { + self2.prevCommandQueue = self2.commandQueue; + } + } + if (self2.manuallyClosing) { + self2.manuallyClosing = false; + debug("skip reconnecting since the connection is manually closed."); + return close(); + } + if (typeof self2.options.retryStrategy !== "function") { + debug("skip reconnecting because `retryStrategy` is not a function"); + return close(); + } + const retryDelay = self2.options.retryStrategy(++self2.retryAttempts); + if (typeof retryDelay !== "number") { + debug("skip reconnecting because `retryStrategy` doesn't return a number"); + return close(); + } + debug("reconnect in %sms", retryDelay); + self2.setStatus("reconnecting", retryDelay); + self2.reconnectTimeout = setTimeout(function() { + self2.reconnectTimeout = null; + self2.connect().catch(utils_1.noop); + }, retryDelay); + const { maxRetriesPerRequest } = self2.options; + if (typeof maxRetriesPerRequest === "number") { + if (maxRetriesPerRequest < 0) { + debug("maxRetriesPerRequest is negative, ignoring..."); + } else { + const remainder = self2.retryAttempts % (maxRetriesPerRequest + 1); + if (remainder === 0) { + debug("reach maxRetriesPerRequest limitation, flushing command queue..."); + self2.flushQueue(new errors_1.MaxRetriesPerRequestError(maxRetriesPerRequest)); + } + } + } + }; + function close() { + self2.setStatus("end"); + self2.flushQueue(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); + } + } + exports2.closeHandler = closeHandler; + function errorHandler(self2) { + return function(error) { + debug("error: %s", error); + self2.silentEmit("error", error); + }; + } + exports2.errorHandler = errorHandler; + function readyHandler(self2) { + return function() { + self2.setStatus("ready"); + self2.retryAttempts = 0; + if (self2.options.monitor) { + self2.call("monitor").then(() => self2.setStatus("monitoring"), (error) => self2.emit("error", error)); + const { sendCommand } = self2; + self2.sendCommand = function(command) { + if (Command_1.default.checkFlag("VALID_IN_MONITOR_MODE", command.name)) { + return sendCommand.call(self2, command); + } + command.reject(new Error("Connection is in monitoring mode, can't process commands.")); + return command.promise; + }; + self2.once("close", function() { + delete self2.sendCommand; + }); + return; + } + const finalSelect = self2.prevCondition ? self2.prevCondition.select : self2.condition.select; + if (self2.options.readOnly) { + debug("set the connection to readonly mode"); + self2.readonly().catch(utils_1.noop); + } + if (self2.prevCondition) { + const condition = self2.prevCondition; + self2.prevCondition = null; + if (condition.subscriber && self2.options.autoResubscribe) { + if (self2.condition.select !== finalSelect) { + debug("connect to db [%d]", finalSelect); + self2.select(finalSelect); + } + const subscribeChannels = condition.subscriber.channels("subscribe"); + if (subscribeChannels.length) { + debug("subscribe %d channels", subscribeChannels.length); + self2.subscribe(subscribeChannels); + } + const psubscribeChannels = condition.subscriber.channels("psubscribe"); + if (psubscribeChannels.length) { + debug("psubscribe %d channels", psubscribeChannels.length); + self2.psubscribe(psubscribeChannels); + } + const ssubscribeChannels = condition.subscriber.channels("ssubscribe"); + if (ssubscribeChannels.length) { + debug("ssubscribe %s", ssubscribeChannels.length); + for (const channel of ssubscribeChannels) { + self2.ssubscribe(channel); + } + } + } + } + if (self2.prevCommandQueue) { + if (self2.options.autoResendUnfulfilledCommands) { + debug("resend %d unfulfilled commands", self2.prevCommandQueue.length); + while (self2.prevCommandQueue.length > 0) { + const item = self2.prevCommandQueue.shift(); + if (item.select !== self2.condition.select && item.command.name !== "select") { + self2.select(item.select); + } + self2.sendCommand(item.command, item.stream); + } + } else { + self2.prevCommandQueue = null; + } + } + if (self2.offlineQueue.length) { + debug("send %d commands in offline queue", self2.offlineQueue.length); + const offlineQueue = self2.offlineQueue; + self2.resetOfflineQueue(); + while (offlineQueue.length > 0) { + const item = offlineQueue.shift(); + if (item.select !== self2.condition.select && item.command.name !== "select") { + self2.select(item.select); + } + self2.sendCommand(item.command, item.stream); + } + } + if (self2.condition.select !== finalSelect) { + debug("connect to db [%d]", finalSelect); + self2.select(finalSelect); + } + }; + } + exports2.readyHandler = readyHandler; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js +var require_RedisOptions = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DEFAULT_REDIS_OPTIONS = void 0; + exports2.DEFAULT_REDIS_OPTIONS = { + // Connection + port: 6379, + host: "localhost", + family: 0, + connectTimeout: 1e4, + disconnectTimeout: 2e3, + retryStrategy: function(times) { + return Math.min(times * 50, 2e3); + }, + keepAlive: 0, + noDelay: true, + connectionName: null, + disableClientInfo: false, + clientInfoTag: void 0, + // Sentinel + sentinels: null, + name: null, + role: "master", + sentinelRetryStrategy: function(times) { + return Math.min(times * 10, 1e3); + }, + sentinelReconnectStrategy: function() { + return 6e4; + }, + natMap: null, + enableTLSForSentinelMode: false, + updateSentinels: true, + failoverDetector: false, + // Status + username: null, + password: null, + db: 0, + // Others + enableOfflineQueue: true, + enableReadyCheck: true, + autoResubscribe: true, + autoResendUnfulfilledCommands: true, + lazyConnect: false, + keyPrefix: "", + reconnectOnError: null, + readOnly: false, + stringNumbers: false, + maxRetriesPerRequest: 20, + maxLoadingRetryTime: 1e4, + enableAutoPipelining: false, + autoPipeliningIgnoredCommands: [], + sentinelMaxConnections: 10 + }; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js +var require_Redis = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var commands_1 = require_built(); + var events_1 = require("events"); + var standard_as_callback_1 = require_built2(); + var cluster_1 = require_cluster(); + var Command_1 = require_Command(); + var connectors_1 = require_connectors(); + var SentinelConnector_1 = require_SentinelConnector(); + var eventHandler = require_event_handler(); + var RedisOptions_1 = require_RedisOptions(); + var ScanStream_1 = require_ScanStream(); + var transaction_1 = require_transaction(); + var utils_1 = require_utils2(); + var applyMixin_1 = require_applyMixin(); + var Commander_1 = require_Commander(); + var lodash_1 = require_lodash3(); + var Deque = require_denque(); + var debug = (0, utils_1.Debug)("redis"); + var Redis2 = class _Redis extends Commander_1.default { + constructor(arg1, arg2, arg3) { + super(); + this.status = "wait"; + this.isCluster = false; + this.reconnectTimeout = null; + this.connectionEpoch = 0; + this.retryAttempts = 0; + this.manuallyClosing = false; + this._autoPipelines = /* @__PURE__ */ new Map(); + this._runningAutoPipelines = /* @__PURE__ */ new Set(); + this.parseOptions(arg1, arg2, arg3); + events_1.EventEmitter.call(this); + this.resetCommandQueue(); + this.resetOfflineQueue(); + if (this.options.Connector) { + this.connector = new this.options.Connector(this.options); + } else if (this.options.sentinels) { + const sentinelConnector = new SentinelConnector_1.default(this.options); + sentinelConnector.emitter = this; + this.connector = sentinelConnector; + } else { + this.connector = new connectors_1.StandaloneConnector(this.options); + } + if (this.options.scripts) { + Object.entries(this.options.scripts).forEach(([name, definition]) => { + this.defineCommand(name, definition); + }); + } + if (this.options.lazyConnect) { + this.setStatus("wait"); + } else { + this.connect().catch(lodash_1.noop); + } + } + /** + * Create a Redis instance. + * This is the same as `new Redis()` but is included for compatibility with node-redis. + */ + static createClient(...args) { + return new _Redis(...args); + } + get autoPipelineQueueSize() { + let queued = 0; + for (const pipeline of this._autoPipelines.values()) { + queued += pipeline.length; + } + return queued; + } + /** + * Create a connection to Redis. + * This method will be invoked automatically when creating a new Redis instance + * unless `lazyConnect: true` is passed. + * + * When calling this method manually, a Promise is returned, which will + * be resolved when the connection status is ready. The promise can reject + * if the connection fails, times out, or if Redis is already connecting/connected. + */ + connect(callback) { + const promise = new Promise((resolve2, reject) => { + if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { + reject(new Error("Redis is already connecting/connected")); + return; + } + this.connectionEpoch += 1; + this.setStatus("connecting"); + const { options } = this; + this.condition = { + select: options.db, + auth: options.username ? [options.username, options.password] : options.password, + subscriber: false + }; + const _this = this; + (0, standard_as_callback_1.default)(this.connector.connect(function(type, err) { + _this.silentEmit(type, err); + }), function(err, stream) { + if (err) { + _this.flushQueue(err); + _this.silentEmit("error", err); + reject(err); + _this.setStatus("end"); + return; + } + let CONNECT_EVENT = options.tls ? "secureConnect" : "connect"; + if ("sentinels" in options && options.sentinels && !options.enableTLSForSentinelMode) { + CONNECT_EVENT = "connect"; + } + _this.stream = stream; + if (options.noDelay) { + stream.setNoDelay(true); + } + if (typeof options.keepAlive === "number") { + if (stream.connecting) { + stream.once(CONNECT_EVENT, () => { + stream.setKeepAlive(true, options.keepAlive); + }); + } else { + stream.setKeepAlive(true, options.keepAlive); + } + } + if (stream.connecting) { + stream.once(CONNECT_EVENT, eventHandler.connectHandler(_this)); + if (options.connectTimeout) { + let connectTimeoutCleared = false; + stream.setTimeout(options.connectTimeout, function() { + if (connectTimeoutCleared) { + return; + } + stream.setTimeout(0); + stream.destroy(); + const err2 = new Error("connect ETIMEDOUT"); + err2.errorno = "ETIMEDOUT"; + err2.code = "ETIMEDOUT"; + err2.syscall = "connect"; + eventHandler.errorHandler(_this)(err2); + }); + stream.once(CONNECT_EVENT, function() { + connectTimeoutCleared = true; + stream.setTimeout(0); + }); + } + } else if (stream.destroyed) { + const firstError = _this.connector.firstError; + if (firstError) { + process.nextTick(() => { + eventHandler.errorHandler(_this)(firstError); + }); + } + process.nextTick(eventHandler.closeHandler(_this)); + } else { + process.nextTick(eventHandler.connectHandler(_this)); + } + if (!stream.destroyed) { + stream.once("error", eventHandler.errorHandler(_this)); + stream.once("close", eventHandler.closeHandler(_this)); + } + const connectionReadyHandler = function() { + _this.removeListener("close", connectionCloseHandler); + resolve2(); + }; + var connectionCloseHandler = function() { + _this.removeListener("ready", connectionReadyHandler); + reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); + }; + _this.once("ready", connectionReadyHandler); + _this.once("close", connectionCloseHandler); + }); + }); + return (0, standard_as_callback_1.default)(promise, callback); + } + /** + * Disconnect from Redis. + * + * This method closes the connection immediately, + * and may lose some pending replies that haven't written to client. + * If you want to wait for the pending replies, use Redis#quit instead. + */ + disconnect(reconnect = false) { + if (!reconnect) { + this.manuallyClosing = true; + } + if (this.reconnectTimeout && !reconnect) { + clearTimeout(this.reconnectTimeout); + this.reconnectTimeout = null; + } + if (this.status === "wait") { + eventHandler.closeHandler(this)(); + } else { + this.connector.disconnect(); + } + } + /** + * Disconnect from Redis. + * + * @deprecated + */ + end() { + this.disconnect(); + } + /** + * Create a new instance with the same options as the current one. + * + * @example + * ```js + * var redis = new Redis(6380); + * var anotherRedis = redis.duplicate(); + * ``` + */ + duplicate(override) { + return new _Redis({ ...this.options, ...override }); + } + /** + * Mode of the connection. + * + * One of `"normal"`, `"subscriber"`, or `"monitor"`. When the connection is + * not in `"normal"` mode, certain commands are not allowed. + */ + get mode() { + var _a; + return this.options.monitor ? "monitor" : ((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) ? "subscriber" : "normal"; + } + /** + * Listen for all requests received by the server in real time. + * + * This command will create a new connection to Redis and send a + * MONITOR command via the new connection in order to avoid disturbing + * the current connection. + * + * @param callback The callback function. If omit, a promise will be returned. + * @example + * ```js + * var redis = new Redis(); + * redis.monitor(function (err, monitor) { + * // Entering monitoring mode. + * monitor.on('monitor', function (time, args, source, database) { + * console.log(time + ": " + util.inspect(args)); + * }); + * }); + * + * // supports promise as well as other commands + * redis.monitor().then(function (monitor) { + * monitor.on('monitor', function (time, args, source, database) { + * console.log(time + ": " + util.inspect(args)); + * }); + * }); + * ``` + */ + monitor(callback) { + const monitorInstance = this.duplicate({ + monitor: true, + lazyConnect: false + }); + return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { + monitorInstance.once("error", reject); + monitorInstance.once("monitoring", function() { + resolve2(monitorInstance); + }); + }), callback); + } + /** + * Send a command to Redis + * + * This method is used internally and in most cases you should not + * use it directly. If you need to send a command that is not supported + * by the library, you can use the `call` method: + * + * ```js + * const redis = new Redis(); + * + * redis.call('set', 'foo', 'bar'); + * // or + * redis.call(['set', 'foo', 'bar']); + * ``` + * + * @ignore + */ + sendCommand(command, stream) { + var _a, _b; + if (this.status === "wait") { + this.connect().catch(lodash_1.noop); + } + if (this.status === "end") { + command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); + return command.promise; + } + if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) && !Command_1.default.checkFlag("VALID_IN_SUBSCRIBER_MODE", command.name)) { + command.reject(new Error("Connection in subscriber mode, only subscriber commands may be used")); + return command.promise; + } + if (typeof this.options.commandTimeout === "number") { + command.setTimeout(this.options.commandTimeout); + } + let writable = this.status === "ready" || !stream && this.status === "connect" && (0, commands_1.exists)(command.name) && ((0, commands_1.hasFlag)(command.name, "loading") || Command_1.default.checkFlag("HANDSHAKE_COMMANDS", command.name)); + if (!this.stream) { + writable = false; + } else if (!this.stream.writable) { + writable = false; + } else if (this.stream._writableState && this.stream._writableState.ended) { + writable = false; + } + if (!writable) { + if (!this.options.enableOfflineQueue) { + command.reject(new Error("Stream isn't writeable and enableOfflineQueue options is false")); + return command.promise; + } + if (command.name === "quit" && this.offlineQueue.length === 0) { + this.disconnect(); + command.resolve(Buffer.from("OK")); + return command.promise; + } + if (debug.enabled) { + debug("queue command[%s]: %d -> %s(%o)", this._getDescription(), this.condition.select, command.name, command.args); + } + this.offlineQueue.push({ + command, + stream, + select: this.condition.select + }); + } else { + if (debug.enabled) { + debug("write command[%s]: %d -> %s(%o)", this._getDescription(), (_b = this.condition) === null || _b === void 0 ? void 0 : _b.select, command.name, command.args); + } + if (stream) { + if ("isPipeline" in stream && stream.isPipeline) { + stream.write(command.toWritable(stream.destination.redis.stream)); + } else { + stream.write(command.toWritable(stream)); + } + } else { + this.stream.write(command.toWritable(this.stream)); + } + this.commandQueue.push({ + command, + stream, + select: this.condition.select + }); + if (Command_1.default.checkFlag("WILL_DISCONNECT", command.name)) { + this.manuallyClosing = true; + } + if (this.options.socketTimeout !== void 0 && this.socketTimeoutTimer === void 0) { + this.setSocketTimeout(); + } + } + if (command.name === "select" && (0, utils_1.isInt)(command.args[0])) { + const db = parseInt(command.args[0], 10); + if (this.condition.select !== db) { + this.condition.select = db; + this.emit("select", db); + debug("switch to db [%d]", this.condition.select); + } + } + return command.promise; + } + setSocketTimeout() { + this.socketTimeoutTimer = setTimeout(() => { + this.stream.destroy(new Error(`Socket timeout. Expecting data, but didn't receive any in ${this.options.socketTimeout}ms.`)); + this.socketTimeoutTimer = void 0; + }, this.options.socketTimeout); + this.stream.once("data", () => { + clearTimeout(this.socketTimeoutTimer); + this.socketTimeoutTimer = void 0; + if (this.commandQueue.length === 0) + return; + this.setSocketTimeout(); + }); + } + scanStream(options) { + return this.createScanStream("scan", { options }); + } + scanBufferStream(options) { + return this.createScanStream("scanBuffer", { options }); + } + sscanStream(key, options) { + return this.createScanStream("sscan", { key, options }); + } + sscanBufferStream(key, options) { + return this.createScanStream("sscanBuffer", { key, options }); + } + hscanStream(key, options) { + return this.createScanStream("hscan", { key, options }); + } + hscanBufferStream(key, options) { + return this.createScanStream("hscanBuffer", { key, options }); + } + zscanStream(key, options) { + return this.createScanStream("zscan", { key, options }); + } + zscanBufferStream(key, options) { + return this.createScanStream("zscanBuffer", { key, options }); + } + /** + * Emit only when there's at least one listener. + * + * @ignore + */ + silentEmit(eventName, arg) { + let error; + if (eventName === "error") { + error = arg; + if (this.status === "end") { + return; + } + if (this.manuallyClosing) { + if (error instanceof Error && (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG || // @ts-expect-error + error.syscall === "connect" || // @ts-expect-error + error.syscall === "read")) { + return; + } + } + } + if (this.listeners(eventName).length > 0) { + return this.emit.apply(this, arguments); + } + if (error && error instanceof Error) { + console.error("[ioredis] Unhandled error event:", error.stack); + } + return false; + } + /** + * @ignore + */ + recoverFromFatalError(_commandError, err, options) { + this.flushQueue(err, options); + this.silentEmit("error", err); + this.disconnect(true); + } + /** + * @ignore + */ + handleReconnection(err, item) { + var _a; + let needReconnect = false; + if (this.options.reconnectOnError && !Command_1.default.checkFlag("IGNORE_RECONNECT_ON_ERROR", item.command.name)) { + needReconnect = this.options.reconnectOnError(err); + } + switch (needReconnect) { + case 1: + case true: + if (this.status !== "reconnecting") { + this.disconnect(true); + } + item.command.reject(err); + break; + case 2: + if (this.status !== "reconnecting") { + this.disconnect(true); + } + if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.select) !== item.select && item.command.name !== "select") { + this.select(item.select); + } + this.sendCommand(item.command); + break; + default: + item.command.reject(err); + } + } + /** + * Get description of the connection. Used for debugging. + */ + _getDescription() { + let description; + if ("path" in this.options && this.options.path) { + description = this.options.path; + } else if (this.stream && this.stream.remoteAddress && this.stream.remotePort) { + description = this.stream.remoteAddress + ":" + this.stream.remotePort; + } else if ("host" in this.options && this.options.host) { + description = this.options.host + ":" + this.options.port; + } else { + description = ""; + } + if (this.options.connectionName) { + description += ` (${this.options.connectionName})`; + } + return description; + } + resetCommandQueue() { + this.commandQueue = new Deque(); + } + resetOfflineQueue() { + this.offlineQueue = new Deque(); + } + parseOptions(...args) { + const options = {}; + let isTls = false; + for (let i = 0; i < args.length; ++i) { + const arg = args[i]; + if (arg === null || typeof arg === "undefined") { + continue; + } + if (typeof arg === "object") { + (0, lodash_1.defaults)(options, arg); + } else if (typeof arg === "string") { + (0, lodash_1.defaults)(options, (0, utils_1.parseURL)(arg)); + if (arg.startsWith("rediss://")) { + isTls = true; + } + } else if (typeof arg === "number") { + options.port = arg; + } else { + throw new Error("Invalid argument " + arg); + } + } + if (isTls) { + (0, lodash_1.defaults)(options, { tls: true }); + } + (0, lodash_1.defaults)(options, _Redis.defaultOptions); + if (typeof options.port === "string") { + options.port = parseInt(options.port, 10); + } + if (typeof options.db === "string") { + options.db = parseInt(options.db, 10); + } + this.options = (0, utils_1.resolveTLSProfile)(options); + } + /** + * Change instance's status + */ + setStatus(status, arg) { + if (debug.enabled) { + debug("status[%s]: %s -> %s", this._getDescription(), this.status || "[empty]", status); + } + this.status = status; + process.nextTick(this.emit.bind(this, status, arg)); + } + createScanStream(command, { key, options = {} }) { + return new ScanStream_1.default({ + objectMode: true, + key, + redis: this, + command, + ...options + }); + } + /** + * Flush offline queue and command queue with error. + * + * @param error The error object to send to the commands + * @param options options + */ + flushQueue(error, options) { + options = (0, lodash_1.defaults)({}, options, { + offlineQueue: true, + commandQueue: true + }); + let item; + if (options.offlineQueue) { + while (item = this.offlineQueue.shift()) { + item.command.reject(error); + } + } + if (options.commandQueue) { + if (this.commandQueue.length > 0) { + if (this.stream) { + this.stream.removeAllListeners("data"); + } + while (item = this.commandQueue.shift()) { + item.command.reject(error); + } + } + } + } + /** + * Check whether Redis has finished loading the persistent data and is able to + * process commands. + */ + _readyCheck(callback) { + const _this = this; + this.info(function(err, res) { + if (err) { + if (err.message && err.message.includes("NOPERM")) { + console.warn(`Skipping the ready check because INFO command fails: "${err.message}". You can disable ready check with "enableReadyCheck". More: https://github.com/luin/ioredis/wiki/Disable-ready-check.`); + return callback(null, {}); + } + return callback(err); + } + if (typeof res !== "string") { + return callback(null, res); + } + const info = {}; + const lines = res.split("\r\n"); + for (let i = 0; i < lines.length; ++i) { + const [fieldName, ...fieldValueParts] = lines[i].split(":"); + const fieldValue = fieldValueParts.join(":"); + if (fieldValue) { + info[fieldName] = fieldValue; + } + } + if (!info.loading || info.loading === "0") { + callback(null, info); + } else { + const loadingEtaMs = (info.loading_eta_seconds || 1) * 1e3; + const retryTime = _this.options.maxLoadingRetryTime && _this.options.maxLoadingRetryTime < loadingEtaMs ? _this.options.maxLoadingRetryTime : loadingEtaMs; + debug("Redis server still loading, trying again in " + retryTime + "ms"); + setTimeout(function() { + _this._readyCheck(callback); + }, retryTime); + } + }).catch(lodash_1.noop); + } + }; + Redis2.Cluster = cluster_1.default; + Redis2.Command = Command_1.default; + Redis2.defaultOptions = RedisOptions_1.DEFAULT_REDIS_OPTIONS; + (0, applyMixin_1.default)(Redis2, events_1.EventEmitter); + (0, transaction_1.addTransactionSupport)(Redis2.prototype); + exports2.default = Redis2; + } +}); + +// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js +var require_built3 = __commonJS({ + "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.print = exports2.ReplyError = exports2.SentinelIterator = exports2.SentinelConnector = exports2.AbstractConnector = exports2.Pipeline = exports2.ScanStream = exports2.Command = exports2.Cluster = exports2.Redis = exports2.default = void 0; + exports2 = module2.exports = require_Redis().default; + var Redis_1 = require_Redis(); + Object.defineProperty(exports2, "default", { enumerable: true, get: function() { + return Redis_1.default; + } }); + var Redis_2 = require_Redis(); + Object.defineProperty(exports2, "Redis", { enumerable: true, get: function() { + return Redis_2.default; + } }); + var cluster_1 = require_cluster(); + Object.defineProperty(exports2, "Cluster", { enumerable: true, get: function() { + return cluster_1.default; + } }); + var Command_1 = require_Command(); + Object.defineProperty(exports2, "Command", { enumerable: true, get: function() { + return Command_1.default; + } }); + var ScanStream_1 = require_ScanStream(); + Object.defineProperty(exports2, "ScanStream", { enumerable: true, get: function() { + return ScanStream_1.default; + } }); + var Pipeline_1 = require_Pipeline(); + Object.defineProperty(exports2, "Pipeline", { enumerable: true, get: function() { + return Pipeline_1.default; + } }); + var AbstractConnector_1 = require_AbstractConnector(); + Object.defineProperty(exports2, "AbstractConnector", { enumerable: true, get: function() { + return AbstractConnector_1.default; + } }); + var SentinelConnector_1 = require_SentinelConnector(); + Object.defineProperty(exports2, "SentinelConnector", { enumerable: true, get: function() { + return SentinelConnector_1.default; + } }); + Object.defineProperty(exports2, "SentinelIterator", { enumerable: true, get: function() { + return SentinelConnector_1.SentinelIterator; + } }); + exports2.ReplyError = require_redis_errors().ReplyError; + Object.defineProperty(exports2, "Promise", { + get() { + console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); + return Promise; + }, + set(_lib) { + console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); + } + }); + function print(err, reply) { + if (err) { + console.log("Error: " + err); + } else { + console.log("Reply: " + reply); + } + } + exports2.print = print; + } +}); + +// node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js +var require_main = __commonJS({ + "node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js"(exports2, module2) { + "use strict"; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var node_exports = {}; + __export2(node_exports, { + analyzeMetafile: () => analyzeMetafile, + analyzeMetafileSync: () => analyzeMetafileSync, + build: () => build, + buildSync: () => buildSync, + context: () => context, + default: () => node_default, + formatMessages: () => formatMessages, + formatMessagesSync: () => formatMessagesSync, + initialize: () => initialize, + stop: () => stop, + transform: () => transform2, + transformSync: () => transformSync, + version: () => version + }); + module2.exports = __toCommonJS2(node_exports); + function encodePacket(packet) { + let visit = (value) => { + if (value === null) { + bb.write8(0); + } else if (typeof value === "boolean") { + bb.write8(1); + bb.write8(+value); + } else if (typeof value === "number") { + bb.write8(2); + bb.write32(value | 0); + } else if (typeof value === "string") { + bb.write8(3); + bb.write(encodeUTF8(value)); + } else if (value instanceof Uint8Array) { + bb.write8(4); + bb.write(value); + } else if (value instanceof Array) { + bb.write8(5); + bb.write32(value.length); + for (let item of value) { + visit(item); + } + } else { + let keys = Object.keys(value); + bb.write8(6); + bb.write32(keys.length); + for (let key of keys) { + bb.write(encodeUTF8(key)); + visit(value[key]); + } + } + }; + let bb = new ByteBuffer(); + bb.write32(0); + bb.write32(packet.id << 1 | +!packet.isRequest); + visit(packet.value); + writeUInt32LE(bb.buf, bb.len - 4, 0); + return bb.buf.subarray(0, bb.len); + } + function decodePacket(bytes) { + let visit = () => { + switch (bb.read8()) { + case 0: + return null; + case 1: + return !!bb.read8(); + case 2: + return bb.read32(); + case 3: + return decodeUTF8(bb.read()); + case 4: + return bb.read(); + case 5: { + let count = bb.read32(); + let value2 = []; + for (let i = 0; i < count; i++) { + value2.push(visit()); + } + return value2; + } + case 6: { + let count = bb.read32(); + let value2 = {}; + for (let i = 0; i < count; i++) { + value2[decodeUTF8(bb.read())] = visit(); + } + return value2; + } + default: + throw new Error("Invalid packet"); + } + }; + let bb = new ByteBuffer(bytes); + let id = bb.read32(); + let isRequest = (id & 1) === 0; + id >>>= 1; + let value = visit(); + if (bb.ptr !== bytes.length) { + throw new Error("Invalid packet"); + } + return { id, isRequest, value }; + } + var ByteBuffer = class { + constructor(buf = new Uint8Array(1024)) { + this.buf = buf; + this.len = 0; + this.ptr = 0; + } + _write(delta) { + if (this.len + delta > this.buf.length) { + let clone = new Uint8Array((this.len + delta) * 2); + clone.set(this.buf); + this.buf = clone; + } + this.len += delta; + return this.len - delta; + } + write8(value) { + let offset = this._write(1); + this.buf[offset] = value; + } + write32(value) { + let offset = this._write(4); + writeUInt32LE(this.buf, value, offset); + } + write(bytes) { + let offset = this._write(4 + bytes.length); + writeUInt32LE(this.buf, bytes.length, offset); + this.buf.set(bytes, offset + 4); + } + _read(delta) { + if (this.ptr + delta > this.buf.length) { + throw new Error("Invalid packet"); + } + this.ptr += delta; + return this.ptr - delta; + } + read8() { + return this.buf[this._read(1)]; + } + read32() { + return readUInt32LE(this.buf, this._read(4)); + } + read() { + let length = this.read32(); + let bytes = new Uint8Array(length); + let ptr = this._read(bytes.length); + bytes.set(this.buf.subarray(ptr, ptr + length)); + return bytes; + } + }; + var encodeUTF8; + var decodeUTF8; + var encodeInvariant; + if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + encodeUTF8 = (text) => encoder.encode(text); + decodeUTF8 = (bytes) => decoder.decode(bytes); + encodeInvariant = 'new TextEncoder().encode("")'; + } else if (typeof Buffer !== "undefined") { + encodeUTF8 = (text) => Buffer.from(text); + decodeUTF8 = (bytes) => { + let { buffer, byteOffset, byteLength } = bytes; + return Buffer.from(buffer, byteOffset, byteLength).toString(); + }; + encodeInvariant = 'Buffer.from("")'; + } else { + throw new Error("No UTF-8 codec found"); + } + if (!(encodeUTF8("") instanceof Uint8Array)) + throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false + +This indicates that your JavaScript environment is broken. You cannot use +esbuild in this environment because esbuild relies on this invariant. This +is not a problem with esbuild. You need to fix your environment instead. +`); + function readUInt32LE(buffer, offset) { + return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; + } + function writeUInt32LE(buffer, value, offset) { + buffer[offset++] = value; + buffer[offset++] = value >> 8; + buffer[offset++] = value >> 16; + buffer[offset++] = value >> 24; + } + var quote = JSON.stringify; + var buildLogLevelDefault = "warning"; + var transformLogLevelDefault = "silent"; + function validateTarget(target) { + validateStringValue(target, "target"); + if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); + return target; + } + var canBeAnything = () => null; + var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; + var mustBeString = (value) => typeof value === "string" ? null : "a string"; + var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; + var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; + var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; + var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; + var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; + var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; + var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; + var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; + var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; + var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; + var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; + var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; + var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; + function getFlag(object, keys, key, mustBeFn) { + let value = object[key]; + keys[key + ""] = true; + if (value === void 0) return void 0; + let mustBe = mustBeFn(value); + if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); + return value; + } + function checkForInvalidFlags(object, keys, where) { + for (let key in object) { + if (!(key in keys)) { + throw new Error(`Invalid option ${where}: ${quote(key)}`); + } + } + } + function validateInitializeOptions(options) { + let keys = /* @__PURE__ */ Object.create(null); + let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); + let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); + let worker = getFlag(options, keys, "worker", mustBeBoolean); + checkForInvalidFlags(options, keys, "in initialize() call"); + return { + wasmURL, + wasmModule, + worker + }; + } + function validateMangleCache(mangleCache) { + let validated; + if (mangleCache !== void 0) { + validated = /* @__PURE__ */ Object.create(null); + for (let key in mangleCache) { + let value = mangleCache[key]; + if (typeof value === "string" || value === false) { + validated[key] = value; + } else { + throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); + } + } + } + return validated; + } + function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { + let color = getFlag(options, keys, "color", mustBeBoolean); + let logLevel = getFlag(options, keys, "logLevel", mustBeString); + let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); + if (color !== void 0) flags.push(`--color=${color}`); + else if (isTTY2) flags.push(`--color=true`); + flags.push(`--log-level=${logLevel || logLevelDefault}`); + flags.push(`--log-limit=${logLimit || 0}`); + } + function validateStringValue(value, what, key) { + if (typeof value !== "string") { + throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); + } + return value; + } + function pushCommonFlags(flags, options, keys) { + let legalComments = getFlag(options, keys, "legalComments", mustBeString); + let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); + let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); + let target = getFlag(options, keys, "target", mustBeStringOrArray); + let format = getFlag(options, keys, "format", mustBeString); + let globalName = getFlag(options, keys, "globalName", mustBeString); + let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); + let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); + let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); + let minify = getFlag(options, keys, "minify", mustBeBoolean); + let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); + let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); + let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); + let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); + let drop = getFlag(options, keys, "drop", mustBeArray); + let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); + let charset = getFlag(options, keys, "charset", mustBeString); + let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); + let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); + let jsx = getFlag(options, keys, "jsx", mustBeString); + let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); + let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); + let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); + let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); + let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); + let define = getFlag(options, keys, "define", mustBeObject); + let logOverride = getFlag(options, keys, "logOverride", mustBeObject); + let supported = getFlag(options, keys, "supported", mustBeObject); + let pure = getFlag(options, keys, "pure", mustBeArray); + let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); + let platform = getFlag(options, keys, "platform", mustBeString); + let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); + if (legalComments) flags.push(`--legal-comments=${legalComments}`); + if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); + if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); + if (target) { + if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); + else flags.push(`--target=${validateTarget(target)}`); + } + if (format) flags.push(`--format=${format}`); + if (globalName) flags.push(`--global-name=${globalName}`); + if (platform) flags.push(`--platform=${platform}`); + if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); + if (minify) flags.push("--minify"); + if (minifySyntax) flags.push("--minify-syntax"); + if (minifyWhitespace) flags.push("--minify-whitespace"); + if (minifyIdentifiers) flags.push("--minify-identifiers"); + if (lineLimit) flags.push(`--line-limit=${lineLimit}`); + if (charset) flags.push(`--charset=${charset}`); + if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); + if (ignoreAnnotations) flags.push(`--ignore-annotations`); + if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); + if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); + if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); + if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); + if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); + if (jsx) flags.push(`--jsx=${jsx}`); + if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); + if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); + if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); + if (jsxDev) flags.push(`--jsx-dev`); + if (jsxSideEffects) flags.push(`--jsx-side-effects`); + if (define) { + for (let key in define) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); + flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); + } + } + if (logOverride) { + for (let key in logOverride) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); + flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); + } + } + if (supported) { + for (let key in supported) { + if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); + const value = supported[key]; + if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); + flags.push(`--supported:${key}=${value}`); + } + } + if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); + if (keepNames) flags.push(`--keep-names`); + } + function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { + var _a2; + let flags = []; + let entries = []; + let keys = /* @__PURE__ */ Object.create(null); + let stdinContents = null; + let stdinResolveDir = null; + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let bundle = getFlag(options, keys, "bundle", mustBeBoolean); + let splitting = getFlag(options, keys, "splitting", mustBeBoolean); + let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); + let metafile = getFlag(options, keys, "metafile", mustBeBoolean); + let outfile = getFlag(options, keys, "outfile", mustBeString); + let outdir = getFlag(options, keys, "outdir", mustBeString); + let outbase = getFlag(options, keys, "outbase", mustBeString); + let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); + let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); + let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); + let mainFields = getFlag(options, keys, "mainFields", mustBeArray); + let conditions = getFlag(options, keys, "conditions", mustBeArray); + let external = getFlag(options, keys, "external", mustBeArray); + let packages = getFlag(options, keys, "packages", mustBeString); + let alias = getFlag(options, keys, "alias", mustBeObject); + let loader = getFlag(options, keys, "loader", mustBeObject); + let outExtension = getFlag(options, keys, "outExtension", mustBeObject); + let publicPath = getFlag(options, keys, "publicPath", mustBeString); + let entryNames = getFlag(options, keys, "entryNames", mustBeString); + let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); + let assetNames = getFlag(options, keys, "assetNames", mustBeString); + let inject = getFlag(options, keys, "inject", mustBeArray); + let banner = getFlag(options, keys, "banner", mustBeObject); + let footer = getFlag(options, keys, "footer", mustBeObject); + let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); + let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); + let stdin = getFlag(options, keys, "stdin", mustBeObject); + let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; + let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + keys.plugins = true; + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); + if (bundle) flags.push("--bundle"); + if (allowOverwrite) flags.push("--allow-overwrite"); + if (splitting) flags.push("--splitting"); + if (preserveSymlinks) flags.push("--preserve-symlinks"); + if (metafile) flags.push(`--metafile`); + if (outfile) flags.push(`--outfile=${outfile}`); + if (outdir) flags.push(`--outdir=${outdir}`); + if (outbase) flags.push(`--outbase=${outbase}`); + if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); + if (packages) flags.push(`--packages=${packages}`); + if (resolveExtensions) { + let values = []; + for (let value of resolveExtensions) { + validateStringValue(value, "resolve extension"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); + values.push(value); + } + flags.push(`--resolve-extensions=${values.join(",")}`); + } + if (publicPath) flags.push(`--public-path=${publicPath}`); + if (entryNames) flags.push(`--entry-names=${entryNames}`); + if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); + if (assetNames) flags.push(`--asset-names=${assetNames}`); + if (mainFields) { + let values = []; + for (let value of mainFields) { + validateStringValue(value, "main field"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); + values.push(value); + } + flags.push(`--main-fields=${values.join(",")}`); + } + if (conditions) { + let values = []; + for (let value of conditions) { + validateStringValue(value, "condition"); + if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); + values.push(value); + } + flags.push(`--conditions=${values.join(",")}`); + } + if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); + if (alias) { + for (let old in alias) { + if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); + flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); + } + } + if (banner) { + for (let type in banner) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); + flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); + } + } + if (footer) { + for (let type in footer) { + if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); + flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); + } + } + if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); + if (loader) { + for (let ext in loader) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); + flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); + } + } + if (outExtension) { + for (let ext in outExtension) { + if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); + flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); + } + } + if (entryPoints) { + if (Array.isArray(entryPoints)) { + for (let i = 0, n = entryPoints.length; i < n; i++) { + let entryPoint = entryPoints[i]; + if (typeof entryPoint === "object" && entryPoint !== null) { + let entryPointKeys = /* @__PURE__ */ Object.create(null); + let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); + let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); + checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); + if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); + if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); + entries.push([output, input]); + } else { + entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); + } + } + } else { + for (let key in entryPoints) { + entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); + } + } + } + if (stdin) { + let stdinKeys = /* @__PURE__ */ Object.create(null); + let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); + let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); + let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); + checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader2) flags.push(`--loader=${loader2}`); + if (resolveDir) stdinResolveDir = resolveDir; + if (typeof contents === "string") stdinContents = encodeUTF8(contents); + else if (contents instanceof Uint8Array) stdinContents = contents; + } + let nodePaths = []; + if (nodePathsInput) { + for (let value of nodePathsInput) { + value += ""; + nodePaths.push(value); + } + } + return { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache: validateMangleCache(mangleCache) + }; + } + function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { + let flags = []; + let keys = /* @__PURE__ */ Object.create(null); + pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); + pushCommonFlags(flags, options, keys); + let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); + let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); + let loader = getFlag(options, keys, "loader", mustBeString); + let banner = getFlag(options, keys, "banner", mustBeString); + let footer = getFlag(options, keys, "footer", mustBeString); + let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); + if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); + if (loader) flags.push(`--loader=${loader}`); + if (banner) flags.push(`--banner=${banner}`); + if (footer) flags.push(`--footer=${footer}`); + return { + flags, + mangleCache: validateMangleCache(mangleCache) + }; + } + function createChannel(streamIn) { + const requestCallbacksByKey = {}; + const closeData = { didClose: false, reason: "" }; + let responseCallbacks = {}; + let nextRequestID = 0; + let nextBuildKey = 0; + let stdout = new Uint8Array(16 * 1024); + let stdoutUsed = 0; + let readFromStdout = (chunk) => { + let limit = stdoutUsed + chunk.length; + if (limit > stdout.length) { + let swap = new Uint8Array(limit * 2); + swap.set(stdout); + stdout = swap; + } + stdout.set(chunk, stdoutUsed); + stdoutUsed += chunk.length; + let offset = 0; + while (offset + 4 <= stdoutUsed) { + let length = readUInt32LE(stdout, offset); + if (offset + 4 + length > stdoutUsed) { + break; + } + offset += 4; + handleIncomingPacket(stdout.subarray(offset, offset + length)); + offset += length; + } + if (offset > 0) { + stdout.copyWithin(0, offset, stdoutUsed); + stdoutUsed -= offset; + } + }; + let afterClose = (error) => { + closeData.didClose = true; + if (error) closeData.reason = ": " + (error.message || error); + const text = "The service was stopped" + closeData.reason; + for (let id in responseCallbacks) { + responseCallbacks[id](text, null); + } + responseCallbacks = {}; + }; + let sendRequest = (refs, value, callback) => { + if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); + let id = nextRequestID++; + responseCallbacks[id] = (error, response) => { + try { + callback(error, response); + } finally { + if (refs) refs.unref(); + } + }; + if (refs) refs.ref(); + streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); + }; + let sendResponse = (id, value) => { + if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); + streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); + }; + let handleRequest = async (id, request) => { + try { + if (request.command === "ping") { + sendResponse(id, {}); + return; + } + if (typeof request.key === "number") { + const requestCallbacks = requestCallbacksByKey[request.key]; + if (!requestCallbacks) { + return; + } + const callback = requestCallbacks[request.command]; + if (callback) { + await callback(id, request); + return; + } + } + throw new Error(`Invalid command: ` + request.command); + } catch (e) { + const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; + try { + sendResponse(id, { errors }); + } catch { + } + } + }; + let isFirstPacket = true; + let handleIncomingPacket = (bytes) => { + if (isFirstPacket) { + isFirstPacket = false; + let binaryVersion = String.fromCharCode(...bytes); + if (binaryVersion !== "0.24.2") { + throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`); + } + return; + } + let packet = decodePacket(bytes); + if (packet.isRequest) { + handleRequest(packet.id, packet.value); + } else { + let callback = responseCallbacks[packet.id]; + delete responseCallbacks[packet.id]; + if (packet.value.error) callback(packet.value.error, {}); + else callback(null, packet.value); + } + }; + let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { + let refCount = 0; + const buildKey = nextBuildKey++; + const requestCallbacks = {}; + const buildRefs = { + ref() { + if (++refCount === 1) { + if (refs) refs.ref(); + } + }, + unref() { + if (--refCount === 0) { + delete requestCallbacksByKey[buildKey]; + if (refs) refs.unref(); + } + } + }; + requestCallbacksByKey[buildKey] = requestCallbacks; + buildRefs.ref(); + buildOrContextImpl( + callName, + buildKey, + sendRequest, + sendResponse, + buildRefs, + streamIn, + requestCallbacks, + options, + isTTY2, + defaultWD2, + (err, res) => { + try { + callback(err, res); + } finally { + buildRefs.unref(); + } + } + ); + }; + let transform22 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + const details = createObjectStash(); + let start = (inputPath) => { + try { + if (typeof input !== "string" && !(input instanceof Uint8Array)) + throw new Error('The input to "transform" must be a string or a Uint8Array'); + let { + flags, + mangleCache + } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); + let request = { + command: "transform", + flags, + inputFS: inputPath !== null, + input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input + }; + if (mangleCache) request.mangleCache = mangleCache; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + let errors = replaceDetailsInMessages(response.errors, details); + let warnings = replaceDetailsInMessages(response.warnings, details); + let outstanding = 1; + let next = () => { + if (--outstanding === 0) { + let result = { + warnings, + code: response.code, + map: response.map, + mangleCache: void 0, + legalComments: void 0 + }; + if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; + if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; + callback(null, result); + } + }; + if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); + if (response.codeFS) { + outstanding++; + fs3.readFile(response.code, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.code = contents; + next(); + } + }); + } + if (response.mapFS) { + outstanding++; + fs3.readFile(response.map, (err, contents) => { + if (err !== null) { + callback(err, null); + } else { + response.map = contents; + next(); + } + }); + } + next(); + }); + } catch (e) { + let flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); + } catch { + } + const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); + sendRequest(refs, { command: "error", flags, error }, () => { + error.detail = details.load(error.detail); + callback(failureErrorWithLog("Transform failed", [error], []), null); + }); + } + }; + if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { + let next = start; + start = () => fs3.writeFile(input, next); + } + start(null); + }; + let formatMessages2 = ({ callName, refs, messages, options, callback }) => { + if (!options) throw new Error(`Missing second argument in ${callName}() call`); + let keys = {}; + let kind = getFlag(options, keys, "kind", mustBeString); + let color = getFlag(options, keys, "color", mustBeBoolean); + let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); + if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); + let request = { + command: "format-msgs", + messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), + isWarning: kind === "warning" + }; + if (color !== void 0) request.color = color; + if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.messages); + }); + }; + let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { + if (options === void 0) options = {}; + let keys = {}; + let color = getFlag(options, keys, "color", mustBeBoolean); + let verbose = getFlag(options, keys, "verbose", mustBeBoolean); + checkForInvalidFlags(options, keys, `in ${callName}() call`); + let request = { + command: "analyze-metafile", + metafile + }; + if (color !== void 0) request.color = color; + if (verbose !== void 0) request.verbose = verbose; + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + callback(null, response.result); + }); + }; + return { + readFromStdout, + afterClose, + service: { + buildOrContext, + transform: transform22, + formatMessages: formatMessages2, + analyzeMetafile: analyzeMetafile2 + } + }; + } + function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { + const details = createObjectStash(); + const isContext = callName === "context"; + const handleError = (e, pluginName) => { + const flags = []; + try { + pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); + } catch { + } + const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); + sendRequest(refs, { command: "error", flags, error: message }, () => { + message.detail = details.load(message.detail); + callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); + }); + }; + let plugins; + if (typeof options === "object") { + const value = options.plugins; + if (value !== void 0) { + if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); + plugins = value; + } + } + if (plugins && plugins.length > 0) { + if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); + handlePlugins( + buildKey, + sendRequest, + sendResponse, + refs, + streamIn, + requestCallbacks, + options, + plugins, + details + ).then( + (result) => { + if (!result.ok) return handleError(result.error, result.pluginName); + try { + buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); + } catch (e) { + handleError(e, ""); + } + }, + (e) => handleError(e, "") + ); + return; + } + try { + buildOrContextContinue(null, (result, done) => done([], []), () => { + }); + } catch (e) { + handleError(e, ""); + } + function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { + const writeDefault = streamIn.hasFS; + const { + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir, + nodePaths, + mangleCache + } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); + if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); + const request = { + command: "build", + key: buildKey, + entries, + flags, + write, + stdinContents, + stdinResolveDir, + absWorkingDir: absWorkingDir || defaultWD2, + nodePaths, + context: isContext + }; + if (requestPlugins) request.plugins = requestPlugins; + if (mangleCache) request.mangleCache = mangleCache; + const buildResponseToResult = (response, callback2) => { + const result = { + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + outputFiles: void 0, + metafile: void 0, + mangleCache: void 0 + }; + const originalErrors = result.errors.slice(); + const originalWarnings = result.warnings.slice(); + if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); + if (response.metafile) result.metafile = JSON.parse(response.metafile); + if (response.mangleCache) result.mangleCache = response.mangleCache; + if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); + runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { + if (originalErrors.length > 0 || onEndErrors.length > 0) { + const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); + return callback2(error, null, onEndErrors, onEndWarnings); + } + callback2(null, result, onEndErrors, onEndWarnings); + }); + }; + let latestResultPromise; + let provideLatestResult; + if (isContext) + requestCallbacks["on-end"] = (id, request2) => new Promise((resolve2) => { + buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { + const response = { + errors: onEndErrors, + warnings: onEndWarnings + }; + if (provideLatestResult) provideLatestResult(err, result); + latestResultPromise = void 0; + provideLatestResult = void 0; + sendResponse(id, response); + resolve2(); + }); + }); + sendRequest(refs, request, (error, response) => { + if (error) return callback(new Error(error), null); + if (!isContext) { + return buildResponseToResult(response, (err, res) => { + scheduleOnDisposeCallbacks(); + return callback(err, res); + }); + } + if (response.errors.length > 0) { + return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); + } + let didDispose = false; + const result = { + rebuild: () => { + if (!latestResultPromise) latestResultPromise = new Promise((resolve2, reject) => { + let settlePromise; + provideLatestResult = (err, result2) => { + if (!settlePromise) settlePromise = () => err ? reject(err) : resolve2(result2); + }; + const triggerAnotherBuild = () => { + const request2 = { + command: "rebuild", + key: buildKey + }; + sendRequest(refs, request2, (error2, response2) => { + if (error2) { + reject(new Error(error2)); + } else if (settlePromise) { + settlePromise(); + } else { + triggerAnotherBuild(); + } + }); + }; + triggerAnotherBuild(); + }); + return latestResultPromise; + }, + watch: (options2 = {}) => new Promise((resolve2, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); + const keys = {}; + checkForInvalidFlags(options2, keys, `in watch() call`); + const request2 = { + command: "watch", + key: buildKey + }; + sendRequest(refs, request2, (error2) => { + if (error2) reject(new Error(error2)); + else resolve2(void 0); + }); + }), + serve: (options2 = {}) => new Promise((resolve2, reject) => { + if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); + const keys = {}; + const port = getFlag(options2, keys, "port", mustBeInteger); + const host = getFlag(options2, keys, "host", mustBeString); + const servedir = getFlag(options2, keys, "servedir", mustBeString); + const keyfile = getFlag(options2, keys, "keyfile", mustBeString); + const certfile = getFlag(options2, keys, "certfile", mustBeString); + const fallback = getFlag(options2, keys, "fallback", mustBeString); + const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); + checkForInvalidFlags(options2, keys, `in serve() call`); + const request2 = { + command: "serve", + key: buildKey, + onRequest: !!onRequest + }; + if (port !== void 0) request2.port = port; + if (host !== void 0) request2.host = host; + if (servedir !== void 0) request2.servedir = servedir; + if (keyfile !== void 0) request2.keyfile = keyfile; + if (certfile !== void 0) request2.certfile = certfile; + if (fallback !== void 0) request2.fallback = fallback; + sendRequest(refs, request2, (error2, response2) => { + if (error2) return reject(new Error(error2)); + if (onRequest) { + requestCallbacks["serve-request"] = (id, request3) => { + onRequest(request3.args); + sendResponse(id, {}); + }; + } + resolve2(response2); + }); + }), + cancel: () => new Promise((resolve2) => { + if (didDispose) return resolve2(); + const request2 = { + command: "cancel", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve2(); + }); + }), + dispose: () => new Promise((resolve2) => { + if (didDispose) return resolve2(); + didDispose = true; + const request2 = { + command: "dispose", + key: buildKey + }; + sendRequest(refs, request2, () => { + resolve2(); + scheduleOnDisposeCallbacks(); + refs.unref(); + }); + }) + }; + refs.ref(); + callback(null, result); + }); + } + } + var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { + let onStartCallbacks = []; + let onEndCallbacks = []; + let onResolveCallbacks = {}; + let onLoadCallbacks = {}; + let onDisposeCallbacks = []; + let nextCallbackID = 0; + let i = 0; + let requestPlugins = []; + let isSetupDone = false; + plugins = [...plugins]; + for (let item of plugins) { + let keys = {}; + if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); + const name = getFlag(item, keys, "name", mustBeString); + if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); + try { + let setup = getFlag(item, keys, "setup", mustBeFunction); + if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); + checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); + let plugin = { + name, + onStart: false, + onEnd: false, + onResolve: [], + onLoad: [] + }; + i++; + let resolve2 = (path3, options = {}) => { + if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); + if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); + let keys2 = /* @__PURE__ */ Object.create(null); + let pluginName = getFlag(options, keys2, "pluginName", mustBeString); + let importer = getFlag(options, keys2, "importer", mustBeString); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); + let kind = getFlag(options, keys2, "kind", mustBeString); + let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); + let importAttributes = getFlag(options, keys2, "with", mustBeObject); + checkForInvalidFlags(options, keys2, "in resolve() call"); + return new Promise((resolve22, reject) => { + const request = { + command: "resolve", + path: path3, + key: buildKey, + pluginName: name + }; + if (pluginName != null) request.pluginName = pluginName; + if (importer != null) request.importer = importer; + if (namespace != null) request.namespace = namespace; + if (resolveDir != null) request.resolveDir = resolveDir; + if (kind != null) request.kind = kind; + else throw new Error(`Must specify "kind" when calling "resolve"`); + if (pluginData != null) request.pluginData = details.store(pluginData); + if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); + sendRequest(refs, request, (error, response) => { + if (error !== null) reject(new Error(error)); + else resolve22({ + errors: replaceDetailsInMessages(response.errors, details), + warnings: replaceDetailsInMessages(response.warnings, details), + path: response.path, + external: response.external, + sideEffects: response.sideEffects, + namespace: response.namespace, + suffix: response.suffix, + pluginData: details.load(response.pluginData) + }); + }); + }); + }; + let promise = setup({ + initialOptions, + resolve: resolve2, + onStart(callback) { + let registeredText = `This error came from the "onStart" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); + onStartCallbacks.push({ name, callback, note: registeredNote }); + plugin.onStart = true; + }, + onEnd(callback) { + let registeredText = `This error came from the "onEnd" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); + onEndCallbacks.push({ name, callback, note: registeredNote }); + plugin.onEnd = true; + }, + onResolve(options, callback) { + let registeredText = `This error came from the "onResolve" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onResolve() call is missing a filter`); + let id = nextCallbackID++; + onResolveCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onLoad(options, callback) { + let registeredText = `This error came from the "onLoad" callback registered here:`; + let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); + let keys2 = {}; + let filter = getFlag(options, keys2, "filter", mustBeRegExp); + let namespace = getFlag(options, keys2, "namespace", mustBeString); + checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); + if (filter == null) throw new Error(`onLoad() call is missing a filter`); + let id = nextCallbackID++; + onLoadCallbacks[id] = { name, callback, note: registeredNote }; + plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); + }, + onDispose(callback) { + onDisposeCallbacks.push(callback); + }, + esbuild: streamIn.esbuild + }); + if (promise) await promise; + requestPlugins.push(plugin); + } catch (e) { + return { ok: false, error: e, pluginName: name }; + } + } + requestCallbacks["on-start"] = async (id, request) => { + details.clear(); + let response = { errors: [], warnings: [] }; + await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { + try { + let result = await callback(); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); + if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); + if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); + } + } catch (e) { + response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); + } + })); + sendResponse(id, response); + }; + requestCallbacks["on-resolve"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onResolveCallbacks[id2]); + let result = await callback({ + path: request.path, + importer: request.importer, + namespace: request.namespace, + resolveDir: request.resolveDir, + kind: request.kind, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let path3 = getFlag(result, keys, "path", mustBeString); + let namespace = getFlag(result, keys, "namespace", mustBeString); + let suffix = getFlag(result, keys, "suffix", mustBeString); + let external = getFlag(result, keys, "external", mustBeBoolean); + let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (path3 != null) response.path = path3; + if (namespace != null) response.namespace = namespace; + if (suffix != null) response.suffix = suffix; + if (external != null) response.external = external; + if (sideEffects != null) response.sideEffects = sideEffects; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + requestCallbacks["on-load"] = async (id, request) => { + let response = {}, name = "", callback, note; + for (let id2 of request.ids) { + try { + ({ name, callback, note } = onLoadCallbacks[id2]); + let result = await callback({ + path: request.path, + namespace: request.namespace, + suffix: request.suffix, + pluginData: details.load(request.pluginData), + with: request.with + }); + if (result != null) { + if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let pluginName = getFlag(result, keys, "pluginName", mustBeString); + let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); + let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); + let pluginData = getFlag(result, keys, "pluginData", canBeAnything); + let loader = getFlag(result, keys, "loader", mustBeString); + let errors = getFlag(result, keys, "errors", mustBeArray); + let warnings = getFlag(result, keys, "warnings", mustBeArray); + let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); + let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); + checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); + response.id = id2; + if (pluginName != null) response.pluginName = pluginName; + if (contents instanceof Uint8Array) response.contents = contents; + else if (contents != null) response.contents = encodeUTF8(contents); + if (resolveDir != null) response.resolveDir = resolveDir; + if (pluginData != null) response.pluginData = details.store(pluginData); + if (loader != null) response.loader = loader; + if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); + if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); + break; + } + } catch (e) { + response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; + break; + } + } + sendResponse(id, response); + }; + let runOnEndCallbacks = (result, done) => done([], []); + if (onEndCallbacks.length > 0) { + runOnEndCallbacks = (result, done) => { + (async () => { + const onEndErrors = []; + const onEndWarnings = []; + for (const { name, callback, note } of onEndCallbacks) { + let newErrors; + let newWarnings; + try { + const value = await callback(result); + if (value != null) { + if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); + let keys = {}; + let errors = getFlag(value, keys, "errors", mustBeArray); + let warnings = getFlag(value, keys, "warnings", mustBeArray); + checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); + if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); + if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); + } + } catch (e) { + newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; + } + if (newErrors) { + onEndErrors.push(...newErrors); + try { + result.errors.push(...newErrors); + } catch { + } + } + if (newWarnings) { + onEndWarnings.push(...newWarnings); + try { + result.warnings.push(...newWarnings); + } catch { + } + } + } + done(onEndErrors, onEndWarnings); + })(); + }; + } + let scheduleOnDisposeCallbacks = () => { + for (const cb of onDisposeCallbacks) { + setTimeout(() => cb(), 0); + } + }; + isSetupDone = true; + return { + ok: true, + requestPlugins, + runOnEndCallbacks, + scheduleOnDisposeCallbacks + }; + }; + function createObjectStash() { + const map = /* @__PURE__ */ new Map(); + let nextID = 0; + return { + clear() { + map.clear(); + }, + load(id) { + return map.get(id); + }, + store(value) { + if (value === void 0) return -1; + const id = nextID++; + map.set(id, value); + return id; + } + }; + } + function extractCallerV8(e, streamIn, ident) { + let note; + let tried = false; + return () => { + if (tried) return note; + tried = true; + try { + let lines = (e.stack + "").split("\n"); + lines.splice(1, 1); + let location = parseStackLinesV8(streamIn, lines, ident); + if (location) { + note = { text: e.message, location }; + return note; + } + } catch { + } + }; + } + function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { + let text = "Internal error"; + let location = null; + try { + text = (e && e.message || e) + ""; + } catch { + } + try { + location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); + } catch { + } + return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; + } + function parseStackLinesV8(streamIn, lines, ident) { + let at = " at "; + if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { + for (let i = 1; i < lines.length; i++) { + let line = lines[i]; + if (!line.startsWith(at)) continue; + line = line.slice(at.length); + while (true) { + let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); + if (match) { + line = match[1]; + continue; + } + match = /^(\S+):(\d+):(\d+)$/.exec(line); + if (match) { + let contents; + try { + contents = streamIn.readFileSync(match[1], "utf8"); + } catch { + break; + } + let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; + let column = +match[3] - 1; + let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; + return { + file: match[1], + namespace: "file", + line: +match[2], + column: encodeUTF8(lineText.slice(0, column)).length, + length: encodeUTF8(lineText.slice(column, column + length)).length, + lineText: lineText + "\n" + lines.slice(1).join("\n"), + suggestion: "" + }; + } + break; + } + } + } + return null; + } + function failureErrorWithLog(text, errors, warnings) { + let limit = 5; + text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { + if (i === limit) return "\n..."; + if (!e.location) return ` +error: ${e.text}`; + let { file, line, column } = e.location; + let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; + return ` +${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; + }).join(""); + let error = new Error(text); + for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { + Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + get: () => value, + set: (value2) => Object.defineProperty(error, key, { + configurable: true, + enumerable: true, + value: value2 + }) + }); + } + return error; + } + function replaceDetailsInMessages(messages, stash) { + for (const message of messages) { + message.detail = stash.load(message.detail); + } + return messages; + } + function sanitizeLocation(location, where, terminalWidth) { + if (location == null) return null; + let keys = {}; + let file = getFlag(location, keys, "file", mustBeString); + let namespace = getFlag(location, keys, "namespace", mustBeString); + let line = getFlag(location, keys, "line", mustBeInteger); + let column = getFlag(location, keys, "column", mustBeInteger); + let length = getFlag(location, keys, "length", mustBeInteger); + let lineText = getFlag(location, keys, "lineText", mustBeString); + let suggestion = getFlag(location, keys, "suggestion", mustBeString); + checkForInvalidFlags(location, keys, where); + if (lineText) { + const relevantASCII = lineText.slice( + 0, + (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) + ); + if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { + lineText = relevantASCII; + } + } + return { + file: file || "", + namespace: namespace || "", + line: line || 0, + column: column || 0, + length: length || 0, + lineText: lineText || "", + suggestion: suggestion || "" + }; + } + function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { + let messagesClone = []; + let index = 0; + for (const message of messages) { + let keys = {}; + let id = getFlag(message, keys, "id", mustBeString); + let pluginName = getFlag(message, keys, "pluginName", mustBeString); + let text = getFlag(message, keys, "text", mustBeString); + let location = getFlag(message, keys, "location", mustBeObjectOrNull); + let notes = getFlag(message, keys, "notes", mustBeArray); + let detail = getFlag(message, keys, "detail", canBeAnything); + let where = `in element ${index} of "${property}"`; + checkForInvalidFlags(message, keys, where); + let notesClone = []; + if (notes) { + for (const note of notes) { + let noteKeys = {}; + let noteText = getFlag(note, noteKeys, "text", mustBeString); + let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); + checkForInvalidFlags(note, noteKeys, where); + notesClone.push({ + text: noteText || "", + location: sanitizeLocation(noteLocation, where, terminalWidth) + }); + } + } + messagesClone.push({ + id: id || "", + pluginName: pluginName || fallbackPluginName, + text: text || "", + location: sanitizeLocation(location, where, terminalWidth), + notes: notesClone, + detail: stash ? stash.store(detail) : -1 + }); + index++; + } + return messagesClone; + } + function sanitizeStringArray(values, property) { + const result = []; + for (const value of values) { + if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); + result.push(value); + } + return result; + } + function sanitizeStringMap(map, property) { + const result = /* @__PURE__ */ Object.create(null); + for (const key in map) { + const value = map[key]; + if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); + result[key] = value; + } + return result; + } + function convertOutputFiles({ path: path3, contents, hash }) { + let text = null; + return { + path: path3, + contents, + hash, + get text() { + const binary = this.contents; + if (text === null || binary !== contents) { + contents = binary; + text = decodeUTF8(binary); + } + return text; + } + }; + } + var fs2 = require("fs"); + var os = require("os"); + var path2 = require("path"); + var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; + var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; + var packageDarwin_arm64 = "@esbuild/darwin-arm64"; + var packageDarwin_x64 = "@esbuild/darwin-x64"; + var knownWindowsPackages = { + "win32 arm64 LE": "@esbuild/win32-arm64", + "win32 ia32 LE": "@esbuild/win32-ia32", + "win32 x64 LE": "@esbuild/win32-x64" + }; + var knownUnixlikePackages = { + "aix ppc64 BE": "@esbuild/aix-ppc64", + "android arm64 LE": "@esbuild/android-arm64", + "darwin arm64 LE": "@esbuild/darwin-arm64", + "darwin x64 LE": "@esbuild/darwin-x64", + "freebsd arm64 LE": "@esbuild/freebsd-arm64", + "freebsd x64 LE": "@esbuild/freebsd-x64", + "linux arm LE": "@esbuild/linux-arm", + "linux arm64 LE": "@esbuild/linux-arm64", + "linux ia32 LE": "@esbuild/linux-ia32", + "linux mips64el LE": "@esbuild/linux-mips64el", + "linux ppc64 LE": "@esbuild/linux-ppc64", + "linux riscv64 LE": "@esbuild/linux-riscv64", + "linux s390x BE": "@esbuild/linux-s390x", + "linux x64 LE": "@esbuild/linux-x64", + "linux loong64 LE": "@esbuild/linux-loong64", + "netbsd arm64 LE": "@esbuild/netbsd-arm64", + "netbsd x64 LE": "@esbuild/netbsd-x64", + "openbsd arm64 LE": "@esbuild/openbsd-arm64", + "openbsd x64 LE": "@esbuild/openbsd-x64", + "sunos x64 LE": "@esbuild/sunos-x64" + }; + var knownWebAssemblyFallbackPackages = { + "android arm LE": "@esbuild/android-arm", + "android x64 LE": "@esbuild/android-x64" + }; + function pkgAndSubpathForCurrentPlatform() { + let pkg; + let subpath; + let isWASM = false; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + if (platformKey in knownWindowsPackages) { + pkg = knownWindowsPackages[platformKey]; + subpath = "esbuild.exe"; + } else if (platformKey in knownUnixlikePackages) { + pkg = knownUnixlikePackages[platformKey]; + subpath = "bin/esbuild"; + } else if (platformKey in knownWebAssemblyFallbackPackages) { + pkg = knownWebAssemblyFallbackPackages[platformKey]; + subpath = "bin/esbuild"; + isWASM = true; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + return { pkg, subpath, isWASM }; + } + function pkgForSomeOtherPlatform() { + const libMainJS = require.resolve("esbuild"); + const nodeModulesDirectory = path2.dirname(path2.dirname(path2.dirname(libMainJS))); + if (path2.basename(nodeModulesDirectory) === "node_modules") { + for (const unixKey in knownUnixlikePackages) { + try { + const pkg = knownUnixlikePackages[unixKey]; + if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + for (const windowsKey in knownWindowsPackages) { + try { + const pkg = knownWindowsPackages[windowsKey]; + if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; + } catch { + } + } + } + return null; + } + function downloadedBinPath(pkg, subpath) { + const esbuildLibDir = path2.dirname(require.resolve("esbuild")); + return path2.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path2.basename(subpath)}`); + } + function generateBinPath() { + if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { + if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { + console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); + } else { + return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; + } + } + const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); + let binPath; + try { + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + binPath = downloadedBinPath(pkg, subpath); + if (!fs2.existsSync(binPath)) { + try { + require.resolve(pkg); + } catch { + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + let suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild on Windows or macOS and copying "node_modules" +into a Docker image that runs Linux, or by copying "node_modules" between +Windows and WSL environments. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead of npm which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { + suggestions = ` +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing esbuild with npm running inside of Rosetta 2 and then +trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta +2 is Apple's on-the-fly x86_64-to-arm64 translation service). + +If you are installing with npm, you can try ensuring that both npm and node are +not running under Rosetta 2 and then reinstalling esbuild. This likely involves +changing how you installed npm and/or node. For example, installing node with +the universal installer here should work: https://nodejs.org/en/download/. Or +you could consider using yarn instead of npm which has built-in support for +installing a package on multiple platforms simultaneously. + +If you are installing with yarn, you can try listing both "arm64" and "x64" +in your ".yarnrc.yml" file using the "supportedArchitectures" feature: +https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of esbuild will be present. +`; + } + throw new Error(` +You installed esbuild for another platform than the one you're currently using. +This won't work because esbuild is written with native code and needs to +install a platform-specific binary executable. +${suggestions} +Another alternative is to use the "esbuild-wasm" package instead, which works +the same way on all platforms. But it comes with a heavy performance cost and +can sometimes be 10x slower than the "esbuild" package, so you may also not +want to do that. +`); + } + throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. + +If you are installing esbuild with npm, make sure that you don't specify the +"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature +of "package.json" is used by esbuild to install the correct binary executable +for your current platform.`); + } + throw e; + } + } + if (/\.zip\//.test(binPath)) { + let pnpapi; + try { + pnpapi = require("pnpapi"); + } catch (e) { + } + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path2.join( + root, + "node_modules", + ".cache", + "esbuild", + `pnpapi-${pkg.replace("/", "-")}-${"0.24.2"}-${path2.basename(subpath)}` + ); + if (!fs2.existsSync(binTargetPath)) { + fs2.mkdirSync(path2.dirname(binTargetPath), { recursive: true }); + fs2.copyFileSync(binPath, binTargetPath); + fs2.chmodSync(binTargetPath, 493); + } + return { binPath: binTargetPath, isWASM }; + } + } + return { binPath, isWASM }; + } + var child_process = require("child_process"); + var crypto = require("crypto"); + var path22 = require("path"); + var fs22 = require("fs"); + var os2 = require("os"); + var tty = require("tty"); + var worker_threads; + if (process.env.ESBUILD_WORKER_THREADS !== "0") { + try { + worker_threads = require("worker_threads"); + } catch { + } + let [major, minor] = process.versions.node.split("."); + if ( + // { + if ((!ESBUILD_BINARY_PATH || false) && (path22.basename(__filename) !== "main.js" || path22.basename(__dirname) !== "lib")) { + throw new Error( + `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. + +More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` + ); + } + if (false) { + return ["node", [path22.join(__dirname, "..", "bin", "esbuild")]]; + } else { + const { binPath, isWASM } = generateBinPath(); + if (isWASM) { + return ["node", [binPath]]; + } else { + return [binPath, []]; + } + } + }; + var isTTY = () => tty.isatty(2); + var fsSync = { + readFile(tempFile, callback) { + try { + let contents = fs22.readFileSync(tempFile, "utf8"); + try { + fs22.unlinkSync(tempFile); + } catch { + } + callback(null, contents); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs22.writeFileSync(tempFile, contents); + callback(tempFile); + } catch { + callback(null); + } + } + }; + var fsAsync = { + readFile(tempFile, callback) { + try { + fs22.readFile(tempFile, "utf8", (err, contents) => { + try { + fs22.unlink(tempFile, () => callback(err, contents)); + } catch { + callback(err, contents); + } + }); + } catch (err) { + callback(err, null); + } + }, + writeFile(contents, callback) { + try { + let tempFile = randomFileName(); + fs22.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); + } catch { + callback(null); + } + } + }; + var version = "0.24.2"; + var build = (options) => ensureServiceIsRunning().build(options); + var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); + var transform2 = (input, options) => ensureServiceIsRunning().transform(input, options); + var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); + var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); + var buildSync = (options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.buildSync(options); + } + let result; + runServiceSync((service) => service.buildOrContext({ + callName: "buildSync", + refs: null, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; + }; + var transformSync = (input, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.transformSync(input, options); + } + let result; + runServiceSync((service) => service.transform({ + callName: "transformSync", + refs: null, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsSync, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; + }; + var formatMessagesSync = (messages, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.formatMessagesSync(messages, options); + } + let result; + runServiceSync((service) => service.formatMessages({ + callName: "formatMessagesSync", + refs: null, + messages, + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; + }; + var analyzeMetafileSync = (metafile, options) => { + if (worker_threads && !isInternalWorkerThread) { + if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); + return workerThreadService.analyzeMetafileSync(metafile, options); + } + let result; + runServiceSync((service) => service.analyzeMetafile({ + callName: "analyzeMetafileSync", + refs: null, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => { + if (err) throw err; + result = res; + } + })); + return result; + }; + var stop = () => { + if (stopService) stopService(); + if (workerThreadService) workerThreadService.stop(); + return Promise.resolve(); + }; + var initializeWasCalled = false; + var initialize = (options) => { + options = validateInitializeOptions(options || {}); + if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); + if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); + if (options.worker) throw new Error(`The "worker" option only works in the browser`); + if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); + ensureServiceIsRunning(); + initializeWasCalled = true; + return Promise.resolve(); + }; + var defaultWD = process.cwd(); + var longLivedService; + var stopService; + var ensureServiceIsRunning = () => { + if (longLivedService) return longLivedService; + let [command, args] = esbuildCommandAndArgs(); + let child = child_process.spawn(command, args.concat(`--service=${"0.24.2"}`, "--ping"), { + windowsHide: true, + stdio: ["pipe", "pipe", "inherit"], + cwd: defaultWD + }); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + child.stdin.write(bytes, (err) => { + if (err) afterClose(err); + }); + }, + readFileSync: fs22.readFileSync, + isSync: false, + hasFS: true, + esbuild: node_exports + }); + child.stdin.on("error", afterClose); + child.on("error", afterClose); + const stdin = child.stdin; + const stdout = child.stdout; + stdout.on("data", readFromStdout); + stdout.on("end", afterClose); + stopService = () => { + stdin.destroy(); + stdout.destroy(); + child.kill(); + initializeWasCalled = false; + longLivedService = void 0; + stopService = void 0; + }; + let refCount = 0; + child.unref(); + if (stdin.unref) { + stdin.unref(); + } + if (stdout.unref) { + stdout.unref(); + } + const refs = { + ref() { + if (++refCount === 1) child.ref(); + }, + unref() { + if (--refCount === 0) child.unref(); + } + }; + longLivedService = { + build: (options) => new Promise((resolve2, reject) => { + service.buildOrContext({ + callName: "build", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve2(res) + }); + }), + context: (options) => new Promise((resolve2, reject) => service.buildOrContext({ + callName: "context", + refs, + options, + isTTY: isTTY(), + defaultWD, + callback: (err, res) => err ? reject(err) : resolve2(res) + })), + transform: (input, options) => new Promise((resolve2, reject) => service.transform({ + callName: "transform", + refs, + input, + options: options || {}, + isTTY: isTTY(), + fs: fsAsync, + callback: (err, res) => err ? reject(err) : resolve2(res) + })), + formatMessages: (messages, options) => new Promise((resolve2, reject) => service.formatMessages({ + callName: "formatMessages", + refs, + messages, + options, + callback: (err, res) => err ? reject(err) : resolve2(res) + })), + analyzeMetafile: (metafile, options) => new Promise((resolve2, reject) => service.analyzeMetafile({ + callName: "analyzeMetafile", + refs, + metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), + options, + callback: (err, res) => err ? reject(err) : resolve2(res) + })) + }; + return longLivedService; + }; + var runServiceSync = (callback) => { + let [command, args] = esbuildCommandAndArgs(); + let stdin = new Uint8Array(); + let { readFromStdout, afterClose, service } = createChannel({ + writeToStdin(bytes) { + if (stdin.length !== 0) throw new Error("Must run at most one command"); + stdin = bytes; + }, + isSync: true, + hasFS: true, + esbuild: node_exports + }); + callback(service); + let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.2"}`), { + cwd: defaultWD, + windowsHide: true, + input: stdin, + // We don't know how large the output could be. If it's too large, the + // command will fail with ENOBUFS. Reserve 16mb for now since that feels + // like it should be enough. Also allow overriding this with an environment + // variable. + maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 + }); + readFromStdout(stdout); + afterClose(null); + }; + var randomFileName = () => { + return path22.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); + }; + var workerThreadService = null; + var startWorkerThreadService = (worker_threads2) => { + let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); + let worker = new worker_threads2.Worker(__filename, { + workerData: { workerPort, defaultWD, esbuildVersion: "0.24.2" }, + transferList: [workerPort], + // From node's documentation: https://nodejs.org/api/worker_threads.html + // + // Take care when launching worker threads from preload scripts (scripts loaded + // and run using the `-r` command line flag). Unless the `execArgv` option is + // explicitly set, new Worker threads automatically inherit the command line flags + // from the running process and will preload the same preload scripts as the main + // thread. If the preload script unconditionally launches a worker thread, every + // thread spawned will spawn another until the application crashes. + // + execArgv: [] + }); + let nextID = 0; + let fakeBuildError = (text) => { + let error = new Error(`Build failed with 1 error: +error: ${text}`); + let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; + error.errors = errors; + error.warnings = []; + return error; + }; + let validateBuildSyncOptions = (options) => { + if (!options) return; + let plugins = options.plugins; + if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); + }; + let applyProperties = (object, properties) => { + for (let key in properties) { + object[key] = properties[key]; + } + }; + let runCallSync = (command, args) => { + let id = nextID++; + let sharedBuffer = new SharedArrayBuffer(8); + let sharedBufferView = new Int32Array(sharedBuffer); + let msg = { sharedBuffer, id, command, args }; + worker.postMessage(msg); + let status = Atomics.wait(sharedBufferView, 0, 0); + if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); + let { message: { id: id2, resolve: resolve2, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); + if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); + if (reject) { + applyProperties(reject, properties); + throw reject; + } + return resolve2; + }; + worker.unref(); + return { + buildSync(options) { + validateBuildSyncOptions(options); + return runCallSync("build", [options]); + }, + transformSync(input, options) { + return runCallSync("transform", [input, options]); + }, + formatMessagesSync(messages, options) { + return runCallSync("formatMessages", [messages, options]); + }, + analyzeMetafileSync(metafile, options) { + return runCallSync("analyzeMetafile", [metafile, options]); + }, + stop() { + worker.terminate(); + workerThreadService = null; + } + }; + }; + var startSyncServiceWorker = () => { + let workerPort = worker_threads.workerData.workerPort; + let parentPort = worker_threads.parentPort; + let extractProperties = (object) => { + let properties = {}; + if (object && typeof object === "object") { + for (let key in object) { + properties[key] = object[key]; + } + } + return properties; + }; + try { + let service = ensureServiceIsRunning(); + defaultWD = worker_threads.workerData.defaultWD; + parentPort.on("message", (msg) => { + (async () => { + let { sharedBuffer, id, command, args } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + try { + switch (command) { + case "build": + workerPort.postMessage({ id, resolve: await service.build(args[0]) }); + break; + case "transform": + workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); + break; + case "formatMessages": + workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); + break; + case "analyzeMetafile": + workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); + break; + default: + throw new Error(`Invalid command: ${command}`); + } + } catch (reject) { + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + } + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + })(); + }); + } catch (reject) { + parentPort.on("message", (msg) => { + let { sharedBuffer, id } = msg; + let sharedBufferView = new Int32Array(sharedBuffer); + workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); + Atomics.add(sharedBufferView, 0, 1); + Atomics.notify(sharedBufferView, 0, Infinity); + }); + } + }; + if (isInternalWorkerThread) { + startSyncServiceWorker(); + } + var node_default = node_exports; + } +}); + +// node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js +var require_delayed_stream = __commonJS({ + "node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) { + var Stream = require("stream").Stream; + var util = require("util"); + module2.exports = DelayedStream; + function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; + } + util.inherits(DelayedStream, Stream); + DelayedStream.create = function(source, options) { + var delayedStream = new this(); + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } + delayedStream.source = source; + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; + source.on("error", function() { + }); + if (delayedStream.pauseStream) { + source.pause(); + } + return delayedStream; + }; + Object.defineProperty(DelayedStream.prototype, "readable", { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } + }); + DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); + }; + DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } + this.source.resume(); + }; + DelayedStream.prototype.pause = function() { + this.source.pause(); + }; + DelayedStream.prototype.release = function() { + this._released = true; + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; + }; + DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; + }; + DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } + if (args[0] === "data") { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } + this._bufferedEvents.push(args); + }; + DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + if (this.dataSize <= this.maxDataSize) { + return; + } + this._maxDataSizeExceeded = true; + var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; + this.emit("error", new Error(message)); + }; + } +}); + +// node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js +var require_combined_stream = __commonJS({ + "node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) { + var util = require("util"); + var Stream = require("stream").Stream; + var DelayedStream = require_delayed_stream(); + module2.exports = CombinedStream; + function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; + } + util.inherits(CombinedStream, Stream); + CombinedStream.create = function(options) { + var combinedStream = new this(); + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + return combinedStream; + }; + CombinedStream.isStreamLike = function(stream) { + return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); + }; + CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams + }); + stream.on("data", this._checkDataSize.bind(this)); + stream = newStream; + } + this._handleErrors(stream); + if (this.pauseStreams) { + stream.pause(); + } + } + this._streams.push(stream); + return this; + }; + CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; + }; + CombinedStream.prototype._getNext = function() { + this._currentStream = null; + if (this._insideLoop) { + this._pendingNext = true; + return; + } + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } + }; + CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); + if (typeof stream == "undefined") { + this.end(); + return; + } + if (typeof stream !== "function") { + this._pipeNext(stream); + return; + } + var getStream = stream; + getStream(function(stream2) { + var isStreamLike = CombinedStream.isStreamLike(stream2); + if (isStreamLike) { + stream2.on("data", this._checkDataSize.bind(this)); + this._handleErrors(stream2); + } + this._pipeNext(stream2); + }.bind(this)); + }; + CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on("end", this._getNext.bind(this)); + stream.pipe(this, { end: false }); + return; + } + var value = stream; + this.write(value); + this._getNext(); + }; + CombinedStream.prototype._handleErrors = function(stream) { + var self2 = this; + stream.on("error", function(err) { + self2._emitError(err); + }); + }; + CombinedStream.prototype.write = function(data) { + this.emit("data", data); + }; + CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); + this.emit("pause"); + }; + CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); + this.emit("resume"); + }; + CombinedStream.prototype.end = function() { + this._reset(); + this.emit("end"); + }; + CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit("close"); + }; + CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; + }; + CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; + this._emitError(new Error(message)); + }; + CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + var self2 = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + self2.dataSize += stream.dataSize; + }); + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } + }; + CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit("error", err); + }; + } +}); + +// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json +var require_db = __commonJS({ + "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports2, module2) { + module2.exports = { + "application/1d-interleaved-parityfec": { + source: "iana" + }, + "application/3gpdash-qoe-report+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/3gpp-ims+xml": { + source: "iana", + compressible: true + }, + "application/3gpphal+json": { + source: "iana", + compressible: true + }, + "application/3gpphalforms+json": { + source: "iana", + compressible: true + }, + "application/a2l": { + source: "iana" + }, + "application/ace+cbor": { + source: "iana" + }, + "application/activemessage": { + source: "iana" + }, + "application/activity+json": { + source: "iana", + compressible: true + }, + "application/alto-costmap+json": { + source: "iana", + compressible: true + }, + "application/alto-costmapfilter+json": { + source: "iana", + compressible: true + }, + "application/alto-directory+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointcost+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointcostparams+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointprop+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointpropparams+json": { + source: "iana", + compressible: true + }, + "application/alto-error+json": { + source: "iana", + compressible: true + }, + "application/alto-networkmap+json": { + source: "iana", + compressible: true + }, + "application/alto-networkmapfilter+json": { + source: "iana", + compressible: true + }, + "application/alto-updatestreamcontrol+json": { + source: "iana", + compressible: true + }, + "application/alto-updatestreamparams+json": { + source: "iana", + compressible: true + }, + "application/aml": { + source: "iana" + }, + "application/andrew-inset": { + source: "iana", + extensions: ["ez"] + }, + "application/applefile": { + source: "iana" + }, + "application/applixware": { + source: "apache", + extensions: ["aw"] + }, + "application/at+jwt": { + source: "iana" + }, + "application/atf": { + source: "iana" + }, + "application/atfx": { + source: "iana" + }, + "application/atom+xml": { + source: "iana", + compressible: true, + extensions: ["atom"] + }, + "application/atomcat+xml": { + source: "iana", + compressible: true, + extensions: ["atomcat"] + }, + "application/atomdeleted+xml": { + source: "iana", + compressible: true, + extensions: ["atomdeleted"] + }, + "application/atomicmail": { + source: "iana" + }, + "application/atomsvc+xml": { + source: "iana", + compressible: true, + extensions: ["atomsvc"] + }, + "application/atsc-dwd+xml": { + source: "iana", + compressible: true, + extensions: ["dwd"] + }, + "application/atsc-dynamic-event-message": { + source: "iana" + }, + "application/atsc-held+xml": { + source: "iana", + compressible: true, + extensions: ["held"] + }, + "application/atsc-rdt+json": { + source: "iana", + compressible: true + }, + "application/atsc-rsat+xml": { + source: "iana", + compressible: true, + extensions: ["rsat"] + }, + "application/atxml": { + source: "iana" + }, + "application/auth-policy+xml": { + source: "iana", + compressible: true + }, + "application/bacnet-xdd+zip": { + source: "iana", + compressible: false + }, + "application/batch-smtp": { + source: "iana" + }, + "application/bdoc": { + compressible: false, + extensions: ["bdoc"] + }, + "application/beep+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/calendar+json": { + source: "iana", + compressible: true + }, + "application/calendar+xml": { + source: "iana", + compressible: true, + extensions: ["xcs"] + }, + "application/call-completion": { + source: "iana" + }, + "application/cals-1840": { + source: "iana" + }, + "application/captive+json": { + source: "iana", + compressible: true + }, + "application/cbor": { + source: "iana" + }, + "application/cbor-seq": { + source: "iana" + }, + "application/cccex": { + source: "iana" + }, + "application/ccmp+xml": { + source: "iana", + compressible: true + }, + "application/ccxml+xml": { + source: "iana", + compressible: true, + extensions: ["ccxml"] + }, + "application/cdfx+xml": { + source: "iana", + compressible: true, + extensions: ["cdfx"] + }, + "application/cdmi-capability": { + source: "iana", + extensions: ["cdmia"] + }, + "application/cdmi-container": { + source: "iana", + extensions: ["cdmic"] + }, + "application/cdmi-domain": { + source: "iana", + extensions: ["cdmid"] + }, + "application/cdmi-object": { + source: "iana", + extensions: ["cdmio"] + }, + "application/cdmi-queue": { + source: "iana", + extensions: ["cdmiq"] + }, + "application/cdni": { + source: "iana" + }, + "application/cea": { + source: "iana" + }, + "application/cea-2018+xml": { + source: "iana", + compressible: true + }, + "application/cellml+xml": { + source: "iana", + compressible: true + }, + "application/cfw": { + source: "iana" + }, + "application/city+json": { + source: "iana", + compressible: true + }, + "application/clr": { + source: "iana" + }, + "application/clue+xml": { + source: "iana", + compressible: true + }, + "application/clue_info+xml": { + source: "iana", + compressible: true + }, + "application/cms": { + source: "iana" + }, + "application/cnrp+xml": { + source: "iana", + compressible: true + }, + "application/coap-group+json": { + source: "iana", + compressible: true + }, + "application/coap-payload": { + source: "iana" + }, + "application/commonground": { + source: "iana" + }, + "application/conference-info+xml": { + source: "iana", + compressible: true + }, + "application/cose": { + source: "iana" + }, + "application/cose-key": { + source: "iana" + }, + "application/cose-key-set": { + source: "iana" + }, + "application/cpl+xml": { + source: "iana", + compressible: true, + extensions: ["cpl"] + }, + "application/csrattrs": { + source: "iana" + }, + "application/csta+xml": { + source: "iana", + compressible: true + }, + "application/cstadata+xml": { + source: "iana", + compressible: true + }, + "application/csvm+json": { + source: "iana", + compressible: true + }, + "application/cu-seeme": { + source: "apache", + extensions: ["cu"] + }, + "application/cwt": { + source: "iana" + }, + "application/cybercash": { + source: "iana" + }, + "application/dart": { + compressible: true + }, + "application/dash+xml": { + source: "iana", + compressible: true, + extensions: ["mpd"] + }, + "application/dash-patch+xml": { + source: "iana", + compressible: true, + extensions: ["mpp"] + }, + "application/dashdelta": { + source: "iana" + }, + "application/davmount+xml": { + source: "iana", + compressible: true, + extensions: ["davmount"] + }, + "application/dca-rft": { + source: "iana" + }, + "application/dcd": { + source: "iana" + }, + "application/dec-dx": { + source: "iana" + }, + "application/dialog-info+xml": { + source: "iana", + compressible: true + }, + "application/dicom": { + source: "iana" + }, + "application/dicom+json": { + source: "iana", + compressible: true + }, + "application/dicom+xml": { + source: "iana", + compressible: true + }, + "application/dii": { + source: "iana" + }, + "application/dit": { + source: "iana" + }, + "application/dns": { + source: "iana" + }, + "application/dns+json": { + source: "iana", + compressible: true + }, + "application/dns-message": { + source: "iana" + }, + "application/docbook+xml": { + source: "apache", + compressible: true, + extensions: ["dbk"] + }, + "application/dots+cbor": { + source: "iana" + }, + "application/dskpp+xml": { + source: "iana", + compressible: true + }, + "application/dssc+der": { + source: "iana", + extensions: ["dssc"] + }, + "application/dssc+xml": { + source: "iana", + compressible: true, + extensions: ["xdssc"] + }, + "application/dvcs": { + source: "iana" + }, + "application/ecmascript": { + source: "iana", + compressible: true, + extensions: ["es", "ecma"] + }, + "application/edi-consent": { + source: "iana" + }, + "application/edi-x12": { + source: "iana", + compressible: false + }, + "application/edifact": { + source: "iana", + compressible: false + }, + "application/efi": { + source: "iana" + }, + "application/elm+json": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/elm+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.cap+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/emergencycalldata.comment+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.control+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.deviceinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.ecall.msd": { + source: "iana" + }, + "application/emergencycalldata.providerinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.serviceinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.subscriberinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.veds+xml": { + source: "iana", + compressible: true + }, + "application/emma+xml": { + source: "iana", + compressible: true, + extensions: ["emma"] + }, + "application/emotionml+xml": { + source: "iana", + compressible: true, + extensions: ["emotionml"] + }, + "application/encaprtp": { + source: "iana" + }, + "application/epp+xml": { + source: "iana", + compressible: true + }, + "application/epub+zip": { + source: "iana", + compressible: false, + extensions: ["epub"] + }, + "application/eshop": { + source: "iana" + }, + "application/exi": { + source: "iana", + extensions: ["exi"] + }, + "application/expect-ct-report+json": { + source: "iana", + compressible: true + }, + "application/express": { + source: "iana", + extensions: ["exp"] + }, + "application/fastinfoset": { + source: "iana" + }, + "application/fastsoap": { + source: "iana" + }, + "application/fdt+xml": { + source: "iana", + compressible: true, + extensions: ["fdt"] + }, + "application/fhir+json": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/fhir+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/fido.trusted-apps+json": { + compressible: true + }, + "application/fits": { + source: "iana" + }, + "application/flexfec": { + source: "iana" + }, + "application/font-sfnt": { + source: "iana" + }, + "application/font-tdpfr": { + source: "iana", + extensions: ["pfr"] + }, + "application/font-woff": { + source: "iana", + compressible: false + }, + "application/framework-attributes+xml": { + source: "iana", + compressible: true + }, + "application/geo+json": { + source: "iana", + compressible: true, + extensions: ["geojson"] + }, + "application/geo+json-seq": { + source: "iana" + }, + "application/geopackage+sqlite3": { + source: "iana" + }, + "application/geoxacml+xml": { + source: "iana", + compressible: true + }, + "application/gltf-buffer": { + source: "iana" + }, + "application/gml+xml": { + source: "iana", + compressible: true, + extensions: ["gml"] + }, + "application/gpx+xml": { + source: "apache", + compressible: true, + extensions: ["gpx"] + }, + "application/gxf": { + source: "apache", + extensions: ["gxf"] + }, + "application/gzip": { + source: "iana", + compressible: false, + extensions: ["gz"] + }, + "application/h224": { + source: "iana" + }, + "application/held+xml": { + source: "iana", + compressible: true + }, + "application/hjson": { + extensions: ["hjson"] + }, + "application/http": { + source: "iana" + }, + "application/hyperstudio": { + source: "iana", + extensions: ["stk"] + }, + "application/ibe-key-request+xml": { + source: "iana", + compressible: true + }, + "application/ibe-pkg-reply+xml": { + source: "iana", + compressible: true + }, + "application/ibe-pp-data": { + source: "iana" + }, + "application/iges": { + source: "iana" + }, + "application/im-iscomposing+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/index": { + source: "iana" + }, + "application/index.cmd": { + source: "iana" + }, + "application/index.obj": { + source: "iana" + }, + "application/index.response": { + source: "iana" + }, + "application/index.vnd": { + source: "iana" + }, + "application/inkml+xml": { + source: "iana", + compressible: true, + extensions: ["ink", "inkml"] + }, + "application/iotp": { + source: "iana" + }, + "application/ipfix": { + source: "iana", + extensions: ["ipfix"] + }, + "application/ipp": { + source: "iana" + }, + "application/isup": { + source: "iana" + }, + "application/its+xml": { + source: "iana", + compressible: true, + extensions: ["its"] + }, + "application/java-archive": { + source: "apache", + compressible: false, + extensions: ["jar", "war", "ear"] + }, + "application/java-serialized-object": { + source: "apache", + compressible: false, + extensions: ["ser"] + }, + "application/java-vm": { + source: "apache", + compressible: false, + extensions: ["class"] + }, + "application/javascript": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["js", "mjs"] + }, + "application/jf2feed+json": { + source: "iana", + compressible: true + }, + "application/jose": { + source: "iana" + }, + "application/jose+json": { + source: "iana", + compressible: true + }, + "application/jrd+json": { + source: "iana", + compressible: true + }, + "application/jscalendar+json": { + source: "iana", + compressible: true + }, + "application/json": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["json", "map"] + }, + "application/json-patch+json": { + source: "iana", + compressible: true + }, + "application/json-seq": { + source: "iana" + }, + "application/json5": { + extensions: ["json5"] + }, + "application/jsonml+json": { + source: "apache", + compressible: true, + extensions: ["jsonml"] + }, + "application/jwk+json": { + source: "iana", + compressible: true + }, + "application/jwk-set+json": { + source: "iana", + compressible: true + }, + "application/jwt": { + source: "iana" + }, + "application/kpml-request+xml": { + source: "iana", + compressible: true + }, + "application/kpml-response+xml": { + source: "iana", + compressible: true + }, + "application/ld+json": { + source: "iana", + compressible: true, + extensions: ["jsonld"] + }, + "application/lgr+xml": { + source: "iana", + compressible: true, + extensions: ["lgr"] + }, + "application/link-format": { + source: "iana" + }, + "application/load-control+xml": { + source: "iana", + compressible: true + }, + "application/lost+xml": { + source: "iana", + compressible: true, + extensions: ["lostxml"] + }, + "application/lostsync+xml": { + source: "iana", + compressible: true + }, + "application/lpf+zip": { + source: "iana", + compressible: false + }, + "application/lxf": { + source: "iana" + }, + "application/mac-binhex40": { + source: "iana", + extensions: ["hqx"] + }, + "application/mac-compactpro": { + source: "apache", + extensions: ["cpt"] + }, + "application/macwriteii": { + source: "iana" + }, + "application/mads+xml": { + source: "iana", + compressible: true, + extensions: ["mads"] + }, + "application/manifest+json": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["webmanifest"] + }, + "application/marc": { + source: "iana", + extensions: ["mrc"] + }, + "application/marcxml+xml": { + source: "iana", + compressible: true, + extensions: ["mrcx"] + }, + "application/mathematica": { + source: "iana", + extensions: ["ma", "nb", "mb"] + }, + "application/mathml+xml": { + source: "iana", + compressible: true, + extensions: ["mathml"] + }, + "application/mathml-content+xml": { + source: "iana", + compressible: true + }, + "application/mathml-presentation+xml": { + source: "iana", + compressible: true + }, + "application/mbms-associated-procedure-description+xml": { + source: "iana", + compressible: true + }, + "application/mbms-deregister+xml": { + source: "iana", + compressible: true + }, + "application/mbms-envelope+xml": { + source: "iana", + compressible: true + }, + "application/mbms-msk+xml": { + source: "iana", + compressible: true + }, + "application/mbms-msk-response+xml": { + source: "iana", + compressible: true + }, + "application/mbms-protection-description+xml": { + source: "iana", + compressible: true + }, + "application/mbms-reception-report+xml": { + source: "iana", + compressible: true + }, + "application/mbms-register+xml": { + source: "iana", + compressible: true + }, + "application/mbms-register-response+xml": { + source: "iana", + compressible: true + }, + "application/mbms-schedule+xml": { + source: "iana", + compressible: true + }, + "application/mbms-user-service-description+xml": { + source: "iana", + compressible: true + }, + "application/mbox": { + source: "iana", + extensions: ["mbox"] + }, + "application/media-policy-dataset+xml": { + source: "iana", + compressible: true, + extensions: ["mpf"] + }, + "application/media_control+xml": { + source: "iana", + compressible: true + }, + "application/mediaservercontrol+xml": { + source: "iana", + compressible: true, + extensions: ["mscml"] + }, + "application/merge-patch+json": { + source: "iana", + compressible: true + }, + "application/metalink+xml": { + source: "apache", + compressible: true, + extensions: ["metalink"] + }, + "application/metalink4+xml": { + source: "iana", + compressible: true, + extensions: ["meta4"] + }, + "application/mets+xml": { + source: "iana", + compressible: true, + extensions: ["mets"] + }, + "application/mf4": { + source: "iana" + }, + "application/mikey": { + source: "iana" + }, + "application/mipc": { + source: "iana" + }, + "application/missing-blocks+cbor-seq": { + source: "iana" + }, + "application/mmt-aei+xml": { + source: "iana", + compressible: true, + extensions: ["maei"] + }, + "application/mmt-usd+xml": { + source: "iana", + compressible: true, + extensions: ["musd"] + }, + "application/mods+xml": { + source: "iana", + compressible: true, + extensions: ["mods"] + }, + "application/moss-keys": { + source: "iana" + }, + "application/moss-signature": { + source: "iana" + }, + "application/mosskey-data": { + source: "iana" + }, + "application/mosskey-request": { + source: "iana" + }, + "application/mp21": { + source: "iana", + extensions: ["m21", "mp21"] + }, + "application/mp4": { + source: "iana", + extensions: ["mp4s", "m4p"] + }, + "application/mpeg4-generic": { + source: "iana" + }, + "application/mpeg4-iod": { + source: "iana" + }, + "application/mpeg4-iod-xmt": { + source: "iana" + }, + "application/mrb-consumer+xml": { + source: "iana", + compressible: true + }, + "application/mrb-publish+xml": { + source: "iana", + compressible: true + }, + "application/msc-ivr+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/msc-mixer+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/msword": { + source: "iana", + compressible: false, + extensions: ["doc", "dot"] + }, + "application/mud+json": { + source: "iana", + compressible: true + }, + "application/multipart-core": { + source: "iana" + }, + "application/mxf": { + source: "iana", + extensions: ["mxf"] + }, + "application/n-quads": { + source: "iana", + extensions: ["nq"] + }, + "application/n-triples": { + source: "iana", + extensions: ["nt"] + }, + "application/nasdata": { + source: "iana" + }, + "application/news-checkgroups": { + source: "iana", + charset: "US-ASCII" + }, + "application/news-groupinfo": { + source: "iana", + charset: "US-ASCII" + }, + "application/news-transmission": { + source: "iana" + }, + "application/nlsml+xml": { + source: "iana", + compressible: true + }, + "application/node": { + source: "iana", + extensions: ["cjs"] + }, + "application/nss": { + source: "iana" + }, + "application/oauth-authz-req+jwt": { + source: "iana" + }, + "application/oblivious-dns-message": { + source: "iana" + }, + "application/ocsp-request": { + source: "iana" + }, + "application/ocsp-response": { + source: "iana" + }, + "application/octet-stream": { + source: "iana", + compressible: false, + extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] + }, + "application/oda": { + source: "iana", + extensions: ["oda"] + }, + "application/odm+xml": { + source: "iana", + compressible: true + }, + "application/odx": { + source: "iana" + }, + "application/oebps-package+xml": { + source: "iana", + compressible: true, + extensions: ["opf"] + }, + "application/ogg": { + source: "iana", + compressible: false, + extensions: ["ogx"] + }, + "application/omdoc+xml": { + source: "apache", + compressible: true, + extensions: ["omdoc"] + }, + "application/onenote": { + source: "apache", + extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] + }, + "application/opc-nodeset+xml": { + source: "iana", + compressible: true + }, + "application/oscore": { + source: "iana" + }, + "application/oxps": { + source: "iana", + extensions: ["oxps"] + }, + "application/p21": { + source: "iana" + }, + "application/p21+zip": { + source: "iana", + compressible: false + }, + "application/p2p-overlay+xml": { + source: "iana", + compressible: true, + extensions: ["relo"] + }, + "application/parityfec": { + source: "iana" + }, + "application/passport": { + source: "iana" + }, + "application/patch-ops-error+xml": { + source: "iana", + compressible: true, + extensions: ["xer"] + }, + "application/pdf": { + source: "iana", + compressible: false, + extensions: ["pdf"] + }, + "application/pdx": { + source: "iana" + }, + "application/pem-certificate-chain": { + source: "iana" + }, + "application/pgp-encrypted": { + source: "iana", + compressible: false, + extensions: ["pgp"] + }, + "application/pgp-keys": { + source: "iana", + extensions: ["asc"] + }, + "application/pgp-signature": { + source: "iana", + extensions: ["asc", "sig"] + }, + "application/pics-rules": { + source: "apache", + extensions: ["prf"] + }, + "application/pidf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/pidf-diff+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/pkcs10": { + source: "iana", + extensions: ["p10"] + }, + "application/pkcs12": { + source: "iana" + }, + "application/pkcs7-mime": { + source: "iana", + extensions: ["p7m", "p7c"] + }, + "application/pkcs7-signature": { + source: "iana", + extensions: ["p7s"] + }, + "application/pkcs8": { + source: "iana", + extensions: ["p8"] + }, + "application/pkcs8-encrypted": { + source: "iana" + }, + "application/pkix-attr-cert": { + source: "iana", + extensions: ["ac"] + }, + "application/pkix-cert": { + source: "iana", + extensions: ["cer"] + }, + "application/pkix-crl": { + source: "iana", + extensions: ["crl"] + }, + "application/pkix-pkipath": { + source: "iana", + extensions: ["pkipath"] + }, + "application/pkixcmp": { + source: "iana", + extensions: ["pki"] + }, + "application/pls+xml": { + source: "iana", + compressible: true, + extensions: ["pls"] + }, + "application/poc-settings+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/postscript": { + source: "iana", + compressible: true, + extensions: ["ai", "eps", "ps"] + }, + "application/ppsp-tracker+json": { + source: "iana", + compressible: true + }, + "application/problem+json": { + source: "iana", + compressible: true + }, + "application/problem+xml": { + source: "iana", + compressible: true + }, + "application/provenance+xml": { + source: "iana", + compressible: true, + extensions: ["provx"] + }, + "application/prs.alvestrand.titrax-sheet": { + source: "iana" + }, + "application/prs.cww": { + source: "iana", + extensions: ["cww"] + }, + "application/prs.cyn": { + source: "iana", + charset: "7-BIT" + }, + "application/prs.hpub+zip": { + source: "iana", + compressible: false + }, + "application/prs.nprend": { + source: "iana" + }, + "application/prs.plucker": { + source: "iana" + }, + "application/prs.rdf-xml-crypt": { + source: "iana" + }, + "application/prs.xsf+xml": { + source: "iana", + compressible: true + }, + "application/pskc+xml": { + source: "iana", + compressible: true, + extensions: ["pskcxml"] + }, + "application/pvd+json": { + source: "iana", + compressible: true + }, + "application/qsig": { + source: "iana" + }, + "application/raml+yaml": { + compressible: true, + extensions: ["raml"] + }, + "application/raptorfec": { + source: "iana" + }, + "application/rdap+json": { + source: "iana", + compressible: true + }, + "application/rdf+xml": { + source: "iana", + compressible: true, + extensions: ["rdf", "owl"] + }, + "application/reginfo+xml": { + source: "iana", + compressible: true, + extensions: ["rif"] + }, + "application/relax-ng-compact-syntax": { + source: "iana", + extensions: ["rnc"] + }, + "application/remote-printing": { + source: "iana" + }, + "application/reputon+json": { + source: "iana", + compressible: true + }, + "application/resource-lists+xml": { + source: "iana", + compressible: true, + extensions: ["rl"] + }, + "application/resource-lists-diff+xml": { + source: "iana", + compressible: true, + extensions: ["rld"] + }, + "application/rfc+xml": { + source: "iana", + compressible: true + }, + "application/riscos": { + source: "iana" + }, + "application/rlmi+xml": { + source: "iana", + compressible: true + }, + "application/rls-services+xml": { + source: "iana", + compressible: true, + extensions: ["rs"] + }, + "application/route-apd+xml": { + source: "iana", + compressible: true, + extensions: ["rapd"] + }, + "application/route-s-tsid+xml": { + source: "iana", + compressible: true, + extensions: ["sls"] + }, + "application/route-usd+xml": { + source: "iana", + compressible: true, + extensions: ["rusd"] + }, + "application/rpki-ghostbusters": { + source: "iana", + extensions: ["gbr"] + }, + "application/rpki-manifest": { + source: "iana", + extensions: ["mft"] + }, + "application/rpki-publication": { + source: "iana" + }, + "application/rpki-roa": { + source: "iana", + extensions: ["roa"] + }, + "application/rpki-updown": { + source: "iana" + }, + "application/rsd+xml": { + source: "apache", + compressible: true, + extensions: ["rsd"] + }, + "application/rss+xml": { + source: "apache", + compressible: true, + extensions: ["rss"] + }, + "application/rtf": { + source: "iana", + compressible: true, + extensions: ["rtf"] + }, + "application/rtploopback": { + source: "iana" + }, + "application/rtx": { + source: "iana" + }, + "application/samlassertion+xml": { + source: "iana", + compressible: true + }, + "application/samlmetadata+xml": { + source: "iana", + compressible: true + }, + "application/sarif+json": { + source: "iana", + compressible: true + }, + "application/sarif-external-properties+json": { + source: "iana", + compressible: true + }, + "application/sbe": { + source: "iana" + }, + "application/sbml+xml": { + source: "iana", + compressible: true, + extensions: ["sbml"] + }, + "application/scaip+xml": { + source: "iana", + compressible: true + }, + "application/scim+json": { + source: "iana", + compressible: true + }, + "application/scvp-cv-request": { + source: "iana", + extensions: ["scq"] + }, + "application/scvp-cv-response": { + source: "iana", + extensions: ["scs"] + }, + "application/scvp-vp-request": { + source: "iana", + extensions: ["spq"] + }, + "application/scvp-vp-response": { + source: "iana", + extensions: ["spp"] + }, + "application/sdp": { + source: "iana", + extensions: ["sdp"] + }, + "application/secevent+jwt": { + source: "iana" + }, + "application/senml+cbor": { + source: "iana" + }, + "application/senml+json": { + source: "iana", + compressible: true + }, + "application/senml+xml": { + source: "iana", + compressible: true, + extensions: ["senmlx"] + }, + "application/senml-etch+cbor": { + source: "iana" + }, + "application/senml-etch+json": { + source: "iana", + compressible: true + }, + "application/senml-exi": { + source: "iana" + }, + "application/sensml+cbor": { + source: "iana" + }, + "application/sensml+json": { + source: "iana", + compressible: true + }, + "application/sensml+xml": { + source: "iana", + compressible: true, + extensions: ["sensmlx"] + }, + "application/sensml-exi": { + source: "iana" + }, + "application/sep+xml": { + source: "iana", + compressible: true + }, + "application/sep-exi": { + source: "iana" + }, + "application/session-info": { + source: "iana" + }, + "application/set-payment": { + source: "iana" + }, + "application/set-payment-initiation": { + source: "iana", + extensions: ["setpay"] + }, + "application/set-registration": { + source: "iana" + }, + "application/set-registration-initiation": { + source: "iana", + extensions: ["setreg"] + }, + "application/sgml": { + source: "iana" + }, + "application/sgml-open-catalog": { + source: "iana" + }, + "application/shf+xml": { + source: "iana", + compressible: true, + extensions: ["shf"] + }, + "application/sieve": { + source: "iana", + extensions: ["siv", "sieve"] + }, + "application/simple-filter+xml": { + source: "iana", + compressible: true + }, + "application/simple-message-summary": { + source: "iana" + }, + "application/simplesymbolcontainer": { + source: "iana" + }, + "application/sipc": { + source: "iana" + }, + "application/slate": { + source: "iana" + }, + "application/smil": { + source: "iana" + }, + "application/smil+xml": { + source: "iana", + compressible: true, + extensions: ["smi", "smil"] + }, + "application/smpte336m": { + source: "iana" + }, + "application/soap+fastinfoset": { + source: "iana" + }, + "application/soap+xml": { + source: "iana", + compressible: true + }, + "application/sparql-query": { + source: "iana", + extensions: ["rq"] + }, + "application/sparql-results+xml": { + source: "iana", + compressible: true, + extensions: ["srx"] + }, + "application/spdx+json": { + source: "iana", + compressible: true + }, + "application/spirits-event+xml": { + source: "iana", + compressible: true + }, + "application/sql": { + source: "iana" + }, + "application/srgs": { + source: "iana", + extensions: ["gram"] + }, + "application/srgs+xml": { + source: "iana", + compressible: true, + extensions: ["grxml"] + }, + "application/sru+xml": { + source: "iana", + compressible: true, + extensions: ["sru"] + }, + "application/ssdl+xml": { + source: "apache", + compressible: true, + extensions: ["ssdl"] + }, + "application/ssml+xml": { + source: "iana", + compressible: true, + extensions: ["ssml"] + }, + "application/stix+json": { + source: "iana", + compressible: true + }, + "application/swid+xml": { + source: "iana", + compressible: true, + extensions: ["swidtag"] + }, + "application/tamp-apex-update": { + source: "iana" + }, + "application/tamp-apex-update-confirm": { + source: "iana" + }, + "application/tamp-community-update": { + source: "iana" + }, + "application/tamp-community-update-confirm": { + source: "iana" + }, + "application/tamp-error": { + source: "iana" + }, + "application/tamp-sequence-adjust": { + source: "iana" + }, + "application/tamp-sequence-adjust-confirm": { + source: "iana" + }, + "application/tamp-status-query": { + source: "iana" + }, + "application/tamp-status-response": { + source: "iana" + }, + "application/tamp-update": { + source: "iana" + }, + "application/tamp-update-confirm": { + source: "iana" + }, + "application/tar": { + compressible: true + }, + "application/taxii+json": { + source: "iana", + compressible: true + }, + "application/td+json": { + source: "iana", + compressible: true + }, + "application/tei+xml": { + source: "iana", + compressible: true, + extensions: ["tei", "teicorpus"] + }, + "application/tetra_isi": { + source: "iana" + }, + "application/thraud+xml": { + source: "iana", + compressible: true, + extensions: ["tfi"] + }, + "application/timestamp-query": { + source: "iana" + }, + "application/timestamp-reply": { + source: "iana" + }, + "application/timestamped-data": { + source: "iana", + extensions: ["tsd"] + }, + "application/tlsrpt+gzip": { + source: "iana" + }, + "application/tlsrpt+json": { + source: "iana", + compressible: true + }, + "application/tnauthlist": { + source: "iana" + }, + "application/token-introspection+jwt": { + source: "iana" + }, + "application/toml": { + compressible: true, + extensions: ["toml"] + }, + "application/trickle-ice-sdpfrag": { + source: "iana" + }, + "application/trig": { + source: "iana", + extensions: ["trig"] + }, + "application/ttml+xml": { + source: "iana", + compressible: true, + extensions: ["ttml"] + }, + "application/tve-trigger": { + source: "iana" + }, + "application/tzif": { + source: "iana" + }, + "application/tzif-leap": { + source: "iana" + }, + "application/ubjson": { + compressible: false, + extensions: ["ubj"] + }, + "application/ulpfec": { + source: "iana" + }, + "application/urc-grpsheet+xml": { + source: "iana", + compressible: true + }, + "application/urc-ressheet+xml": { + source: "iana", + compressible: true, + extensions: ["rsheet"] + }, + "application/urc-targetdesc+xml": { + source: "iana", + compressible: true, + extensions: ["td"] + }, + "application/urc-uisocketdesc+xml": { + source: "iana", + compressible: true + }, + "application/vcard+json": { + source: "iana", + compressible: true + }, + "application/vcard+xml": { + source: "iana", + compressible: true + }, + "application/vemmi": { + source: "iana" + }, + "application/vividence.scriptfile": { + source: "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + source: "iana", + compressible: true, + extensions: ["1km"] + }, + "application/vnd.3gpp-prose+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp-v2x-local-service-information": { + source: "iana" + }, + "application/vnd.3gpp.5gnas": { + source: "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.bsf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.gmop+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.gtpc": { + source: "iana" + }, + "application/vnd.3gpp.interworking-data": { + source: "iana" + }, + "application/vnd.3gpp.lpp": { + source: "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-payload": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-signalling": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-affiliation-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mid-call+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.ngap": { + source: "iana" + }, + "application/vnd.3gpp.pfcp": { + source: "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + source: "iana", + extensions: ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + source: "iana", + extensions: ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + source: "iana", + extensions: ["pvb"] + }, + "application/vnd.3gpp.s1ap": { + source: "iana" + }, + "application/vnd.3gpp.sms": { + source: "iana" + }, + "application/vnd.3gpp.sms+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.srvcc-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.ussd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp2.sms": { + source: "iana" + }, + "application/vnd.3gpp2.tcap": { + source: "iana", + extensions: ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + source: "iana" + }, + "application/vnd.3m.post-it-notes": { + source: "iana", + extensions: ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + source: "iana", + extensions: ["aso"] + }, + "application/vnd.accpac.simply.imp": { + source: "iana", + extensions: ["imp"] + }, + "application/vnd.acucobol": { + source: "iana", + extensions: ["acu"] + }, + "application/vnd.acucorp": { + source: "iana", + extensions: ["atc", "acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + source: "apache", + compressible: false, + extensions: ["air"] + }, + "application/vnd.adobe.flash.movie": { + source: "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + source: "iana", + extensions: ["fcdt"] + }, + "application/vnd.adobe.fxp": { + source: "iana", + extensions: ["fxp", "fxpl"] + }, + "application/vnd.adobe.partial-upload": { + source: "iana" + }, + "application/vnd.adobe.xdp+xml": { + source: "iana", + compressible: true, + extensions: ["xdp"] + }, + "application/vnd.adobe.xfdf": { + source: "iana", + extensions: ["xfdf"] + }, + "application/vnd.aether.imp": { + source: "iana" + }, + "application/vnd.afpc.afplinedata": { + source: "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + source: "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + source: "iana" + }, + "application/vnd.afpc.foca-charset": { + source: "iana" + }, + "application/vnd.afpc.foca-codedfont": { + source: "iana" + }, + "application/vnd.afpc.foca-codepage": { + source: "iana" + }, + "application/vnd.afpc.modca": { + source: "iana" + }, + "application/vnd.afpc.modca-cmtable": { + source: "iana" + }, + "application/vnd.afpc.modca-formdef": { + source: "iana" + }, + "application/vnd.afpc.modca-mediummap": { + source: "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + source: "iana" + }, + "application/vnd.afpc.modca-overlay": { + source: "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + source: "iana" + }, + "application/vnd.age": { + source: "iana", + extensions: ["age"] + }, + "application/vnd.ah-barcode": { + source: "iana" + }, + "application/vnd.ahead.space": { + source: "iana", + extensions: ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + source: "iana", + extensions: ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + source: "iana", + extensions: ["azs"] + }, + "application/vnd.amadeus+json": { + source: "iana", + compressible: true + }, + "application/vnd.amazon.ebook": { + source: "apache", + extensions: ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + source: "iana" + }, + "application/vnd.americandynamics.acc": { + source: "iana", + extensions: ["acc"] + }, + "application/vnd.amiga.ami": { + source: "iana", + extensions: ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + source: "iana", + compressible: true + }, + "application/vnd.android.ota": { + source: "iana" + }, + "application/vnd.android.package-archive": { + source: "apache", + compressible: false, + extensions: ["apk"] + }, + "application/vnd.anki": { + source: "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + source: "iana", + extensions: ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + source: "apache", + extensions: ["fti"] + }, + "application/vnd.antix.game-component": { + source: "iana", + extensions: ["atx"] + }, + "application/vnd.apache.arrow.file": { + source: "iana" + }, + "application/vnd.apache.arrow.stream": { + source: "iana" + }, + "application/vnd.apache.thrift.binary": { + source: "iana" + }, + "application/vnd.apache.thrift.compact": { + source: "iana" + }, + "application/vnd.apache.thrift.json": { + source: "iana" + }, + "application/vnd.api+json": { + source: "iana", + compressible: true + }, + "application/vnd.aplextor.warrp+json": { + source: "iana", + compressible: true + }, + "application/vnd.apothekende.reservation+json": { + source: "iana", + compressible: true + }, + "application/vnd.apple.installer+xml": { + source: "iana", + compressible: true, + extensions: ["mpkg"] + }, + "application/vnd.apple.keynote": { + source: "iana", + extensions: ["key"] + }, + "application/vnd.apple.mpegurl": { + source: "iana", + extensions: ["m3u8"] + }, + "application/vnd.apple.numbers": { + source: "iana", + extensions: ["numbers"] + }, + "application/vnd.apple.pages": { + source: "iana", + extensions: ["pages"] + }, + "application/vnd.apple.pkpass": { + compressible: false, + extensions: ["pkpass"] + }, + "application/vnd.arastra.swi": { + source: "iana" + }, + "application/vnd.aristanetworks.swi": { + source: "iana", + extensions: ["swi"] + }, + "application/vnd.artisan+json": { + source: "iana", + compressible: true + }, + "application/vnd.artsquare": { + source: "iana" + }, + "application/vnd.astraea-software.iota": { + source: "iana", + extensions: ["iota"] + }, + "application/vnd.audiograph": { + source: "iana", + extensions: ["aep"] + }, + "application/vnd.autopackage": { + source: "iana" + }, + "application/vnd.avalon+json": { + source: "iana", + compressible: true + }, + "application/vnd.avistar+xml": { + source: "iana", + compressible: true + }, + "application/vnd.balsamiq.bmml+xml": { + source: "iana", + compressible: true, + extensions: ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + source: "iana" + }, + "application/vnd.banana-accounting": { + source: "iana" + }, + "application/vnd.bbf.usp.error": { + source: "iana" + }, + "application/vnd.bbf.usp.msg": { + source: "iana" + }, + "application/vnd.bbf.usp.msg+json": { + source: "iana", + compressible: true + }, + "application/vnd.bekitzur-stech+json": { + source: "iana", + compressible: true + }, + "application/vnd.bint.med-content": { + source: "iana" + }, + "application/vnd.biopax.rdf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.blink-idb-value-wrapper": { + source: "iana" + }, + "application/vnd.blueice.multipass": { + source: "iana", + extensions: ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + source: "iana" + }, + "application/vnd.bluetooth.le.oob": { + source: "iana" + }, + "application/vnd.bmi": { + source: "iana", + extensions: ["bmi"] + }, + "application/vnd.bpf": { + source: "iana" + }, + "application/vnd.bpf3": { + source: "iana" + }, + "application/vnd.businessobjects": { + source: "iana", + extensions: ["rep"] + }, + "application/vnd.byu.uapi+json": { + source: "iana", + compressible: true + }, + "application/vnd.cab-jscript": { + source: "iana" + }, + "application/vnd.canon-cpdl": { + source: "iana" + }, + "application/vnd.canon-lips": { + source: "iana" + }, + "application/vnd.capasystems-pg+json": { + source: "iana", + compressible: true + }, + "application/vnd.cendio.thinlinc.clientconf": { + source: "iana" + }, + "application/vnd.century-systems.tcp_stream": { + source: "iana" + }, + "application/vnd.chemdraw+xml": { + source: "iana", + compressible: true, + extensions: ["cdxml"] + }, + "application/vnd.chess-pgn": { + source: "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + source: "iana", + extensions: ["mmd"] + }, + "application/vnd.ciedi": { + source: "iana" + }, + "application/vnd.cinderella": { + source: "iana", + extensions: ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + source: "iana" + }, + "application/vnd.citationstyles.style+xml": { + source: "iana", + compressible: true, + extensions: ["csl"] + }, + "application/vnd.claymore": { + source: "iana", + extensions: ["cla"] + }, + "application/vnd.cloanto.rp9": { + source: "iana", + extensions: ["rp9"] + }, + "application/vnd.clonk.c4group": { + source: "iana", + extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + source: "iana", + extensions: ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + source: "iana", + extensions: ["c11amz"] + }, + "application/vnd.coffeescript": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.document": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + source: "iana" + }, + "application/vnd.collection+json": { + source: "iana", + compressible: true + }, + "application/vnd.collection.doc+json": { + source: "iana", + compressible: true + }, + "application/vnd.collection.next+json": { + source: "iana", + compressible: true + }, + "application/vnd.comicbook+zip": { + source: "iana", + compressible: false + }, + "application/vnd.comicbook-rar": { + source: "iana" + }, + "application/vnd.commerce-battelle": { + source: "iana" + }, + "application/vnd.commonspace": { + source: "iana", + extensions: ["csp"] + }, + "application/vnd.contact.cmsg": { + source: "iana", + extensions: ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + source: "iana", + compressible: true + }, + "application/vnd.cosmocaller": { + source: "iana", + extensions: ["cmc"] + }, + "application/vnd.crick.clicker": { + source: "iana", + extensions: ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + source: "iana", + extensions: ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + source: "iana", + extensions: ["clkp"] + }, + "application/vnd.crick.clicker.template": { + source: "iana", + extensions: ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + source: "iana", + extensions: ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + source: "iana", + compressible: true, + extensions: ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + source: "iana", + compressible: true + }, + "application/vnd.crypto-shade-file": { + source: "iana" + }, + "application/vnd.cryptomator.encrypted": { + source: "iana" + }, + "application/vnd.cryptomator.vault": { + source: "iana" + }, + "application/vnd.ctc-posml": { + source: "iana", + extensions: ["pml"] + }, + "application/vnd.ctct.ws+xml": { + source: "iana", + compressible: true + }, + "application/vnd.cups-pdf": { + source: "iana" + }, + "application/vnd.cups-postscript": { + source: "iana" + }, + "application/vnd.cups-ppd": { + source: "iana", + extensions: ["ppd"] + }, + "application/vnd.cups-raster": { + source: "iana" + }, + "application/vnd.cups-raw": { + source: "iana" + }, + "application/vnd.curl": { + source: "iana" + }, + "application/vnd.curl.car": { + source: "apache", + extensions: ["car"] + }, + "application/vnd.curl.pcurl": { + source: "apache", + extensions: ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + source: "iana", + compressible: true + }, + "application/vnd.cybank": { + source: "iana" + }, + "application/vnd.cyclonedx+json": { + source: "iana", + compressible: true + }, + "application/vnd.cyclonedx+xml": { + source: "iana", + compressible: true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + source: "iana", + compressible: false + }, + "application/vnd.d3m-dataset": { + source: "iana" + }, + "application/vnd.d3m-problem": { + source: "iana" + }, + "application/vnd.dart": { + source: "iana", + compressible: true, + extensions: ["dart"] + }, + "application/vnd.data-vision.rdz": { + source: "iana", + extensions: ["rdz"] + }, + "application/vnd.datapackage+json": { + source: "iana", + compressible: true + }, + "application/vnd.dataresource+json": { + source: "iana", + compressible: true + }, + "application/vnd.dbf": { + source: "iana", + extensions: ["dbf"] + }, + "application/vnd.debian.binary-package": { + source: "iana" + }, + "application/vnd.dece.data": { + source: "iana", + extensions: ["uvf", "uvvf", "uvd", "uvvd"] + }, + "application/vnd.dece.ttml+xml": { + source: "iana", + compressible: true, + extensions: ["uvt", "uvvt"] + }, + "application/vnd.dece.unspecified": { + source: "iana", + extensions: ["uvx", "uvvx"] + }, + "application/vnd.dece.zip": { + source: "iana", + extensions: ["uvz", "uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + source: "iana", + extensions: ["fe_launch"] + }, + "application/vnd.desmume.movie": { + source: "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + source: "iana" + }, + "application/vnd.dm.delegation+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dna": { + source: "iana", + extensions: ["dna"] + }, + "application/vnd.document+json": { + source: "iana", + compressible: true + }, + "application/vnd.dolby.mlp": { + source: "apache", + extensions: ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + source: "iana" + }, + "application/vnd.dolby.mobile.2": { + source: "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + source: "iana" + }, + "application/vnd.dpgraph": { + source: "iana", + extensions: ["dpg"] + }, + "application/vnd.dreamfactory": { + source: "iana", + extensions: ["dfac"] + }, + "application/vnd.drive+json": { + source: "iana", + compressible: true + }, + "application/vnd.ds-keypoint": { + source: "apache", + extensions: ["kpxx"] + }, + "application/vnd.dtg.local": { + source: "iana" + }, + "application/vnd.dtg.local.flash": { + source: "iana" + }, + "application/vnd.dtg.local.html": { + source: "iana" + }, + "application/vnd.dvb.ait": { + source: "iana", + extensions: ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.dvbj": { + source: "iana" + }, + "application/vnd.dvb.esgcontainer": { + source: "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + source: "iana" + }, + "application/vnd.dvb.ipdcroaming": { + source: "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + source: "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + source: "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-container+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-generic+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-init+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.pfr": { + source: "iana" + }, + "application/vnd.dvb.service": { + source: "iana", + extensions: ["svc"] + }, + "application/vnd.dxr": { + source: "iana" + }, + "application/vnd.dynageo": { + source: "iana", + extensions: ["geo"] + }, + "application/vnd.dzr": { + source: "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + source: "iana" + }, + "application/vnd.ecdis-update": { + source: "iana" + }, + "application/vnd.ecip.rlp": { + source: "iana" + }, + "application/vnd.eclipse.ditto+json": { + source: "iana", + compressible: true + }, + "application/vnd.ecowin.chart": { + source: "iana", + extensions: ["mag"] + }, + "application/vnd.ecowin.filerequest": { + source: "iana" + }, + "application/vnd.ecowin.fileupdate": { + source: "iana" + }, + "application/vnd.ecowin.series": { + source: "iana" + }, + "application/vnd.ecowin.seriesrequest": { + source: "iana" + }, + "application/vnd.ecowin.seriesupdate": { + source: "iana" + }, + "application/vnd.efi.img": { + source: "iana" + }, + "application/vnd.efi.iso": { + source: "iana" + }, + "application/vnd.emclient.accessrequest+xml": { + source: "iana", + compressible: true + }, + "application/vnd.enliven": { + source: "iana", + extensions: ["nml"] + }, + "application/vnd.enphase.envoy": { + source: "iana" + }, + "application/vnd.eprints.data+xml": { + source: "iana", + compressible: true + }, + "application/vnd.epson.esf": { + source: "iana", + extensions: ["esf"] + }, + "application/vnd.epson.msf": { + source: "iana", + extensions: ["msf"] + }, + "application/vnd.epson.quickanime": { + source: "iana", + extensions: ["qam"] + }, + "application/vnd.epson.salt": { + source: "iana", + extensions: ["slt"] + }, + "application/vnd.epson.ssf": { + source: "iana", + extensions: ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + source: "iana" + }, + "application/vnd.espass-espass+zip": { + source: "iana", + compressible: false + }, + "application/vnd.eszigno3+xml": { + source: "iana", + compressible: true, + extensions: ["es3", "et3"] + }, + "application/vnd.etsi.aoc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.asic-e+zip": { + source: "iana", + compressible: false + }, + "application/vnd.etsi.asic-s+zip": { + source: "iana", + compressible: false + }, + "application/vnd.etsi.cug+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvcommand+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvservice+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsync+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvueprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.mcid+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.mheg5": { + source: "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.pstn+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.sci+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.simservs+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.timestamp-token": { + source: "iana" + }, + "application/vnd.etsi.tsl+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.tsl.der": { + source: "iana" + }, + "application/vnd.eu.kasparian.car+json": { + source: "iana", + compressible: true + }, + "application/vnd.eudora.data": { + source: "iana" + }, + "application/vnd.evolv.ecig.profile": { + source: "iana" + }, + "application/vnd.evolv.ecig.settings": { + source: "iana" + }, + "application/vnd.evolv.ecig.theme": { + source: "iana" + }, + "application/vnd.exstream-empower+zip": { + source: "iana", + compressible: false + }, + "application/vnd.exstream-package": { + source: "iana" + }, + "application/vnd.ezpix-album": { + source: "iana", + extensions: ["ez2"] + }, + "application/vnd.ezpix-package": { + source: "iana", + extensions: ["ez3"] + }, + "application/vnd.f-secure.mobile": { + source: "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + source: "iana", + compressible: false + }, + "application/vnd.fastcopy-disk-image": { + source: "iana" + }, + "application/vnd.fdf": { + source: "iana", + extensions: ["fdf"] + }, + "application/vnd.fdsn.mseed": { + source: "iana", + extensions: ["mseed"] + }, + "application/vnd.fdsn.seed": { + source: "iana", + extensions: ["seed", "dataless"] + }, + "application/vnd.ffsns": { + source: "iana" + }, + "application/vnd.ficlab.flb+zip": { + source: "iana", + compressible: false + }, + "application/vnd.filmit.zfc": { + source: "iana" + }, + "application/vnd.fints": { + source: "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + source: "iana" + }, + "application/vnd.flographit": { + source: "iana", + extensions: ["gph"] + }, + "application/vnd.fluxtime.clip": { + source: "iana", + extensions: ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + source: "iana" + }, + "application/vnd.framemaker": { + source: "iana", + extensions: ["fm", "frame", "maker", "book"] + }, + "application/vnd.frogans.fnc": { + source: "iana", + extensions: ["fnc"] + }, + "application/vnd.frogans.ltf": { + source: "iana", + extensions: ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + source: "iana", + extensions: ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + source: "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + source: "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + source: "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + source: "iana", + compressible: true + }, + "application/vnd.fujitsu.oasys": { + source: "iana", + extensions: ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + source: "iana", + extensions: ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + source: "iana", + extensions: ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + source: "iana", + extensions: ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + source: "iana", + extensions: ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + source: "iana" + }, + "application/vnd.fujixerox.art4": { + source: "iana" + }, + "application/vnd.fujixerox.ddd": { + source: "iana", + extensions: ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + source: "iana", + extensions: ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + source: "iana", + extensions: ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + source: "iana" + }, + "application/vnd.fujixerox.hbpl": { + source: "iana" + }, + "application/vnd.fut-misnet": { + source: "iana" + }, + "application/vnd.futoin+cbor": { + source: "iana" + }, + "application/vnd.futoin+json": { + source: "iana", + compressible: true + }, + "application/vnd.fuzzysheet": { + source: "iana", + extensions: ["fzs"] + }, + "application/vnd.genomatix.tuxedo": { + source: "iana", + extensions: ["txd"] + }, + "application/vnd.gentics.grd+json": { + source: "iana", + compressible: true + }, + "application/vnd.geo+json": { + source: "iana", + compressible: true + }, + "application/vnd.geocube+xml": { + source: "iana", + compressible: true + }, + "application/vnd.geogebra.file": { + source: "iana", + extensions: ["ggb"] + }, + "application/vnd.geogebra.slides": { + source: "iana" + }, + "application/vnd.geogebra.tool": { + source: "iana", + extensions: ["ggt"] + }, + "application/vnd.geometry-explorer": { + source: "iana", + extensions: ["gex", "gre"] + }, + "application/vnd.geonext": { + source: "iana", + extensions: ["gxt"] + }, + "application/vnd.geoplan": { + source: "iana", + extensions: ["g2w"] + }, + "application/vnd.geospace": { + source: "iana", + extensions: ["g3w"] + }, + "application/vnd.gerber": { + source: "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + source: "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + source: "iana" + }, + "application/vnd.gmx": { + source: "iana", + extensions: ["gmx"] + }, + "application/vnd.google-apps.document": { + compressible: false, + extensions: ["gdoc"] + }, + "application/vnd.google-apps.presentation": { + compressible: false, + extensions: ["gslides"] + }, + "application/vnd.google-apps.spreadsheet": { + compressible: false, + extensions: ["gsheet"] + }, + "application/vnd.google-earth.kml+xml": { + source: "iana", + compressible: true, + extensions: ["kml"] + }, + "application/vnd.google-earth.kmz": { + source: "iana", + compressible: false, + extensions: ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + source: "iana", + compressible: true + }, + "application/vnd.gov.sk.e-form+zip": { + source: "iana", + compressible: false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + source: "iana", + compressible: true + }, + "application/vnd.grafeq": { + source: "iana", + extensions: ["gqf", "gqs"] + }, + "application/vnd.gridmp": { + source: "iana" + }, + "application/vnd.groove-account": { + source: "iana", + extensions: ["gac"] + }, + "application/vnd.groove-help": { + source: "iana", + extensions: ["ghf"] + }, + "application/vnd.groove-identity-message": { + source: "iana", + extensions: ["gim"] + }, + "application/vnd.groove-injector": { + source: "iana", + extensions: ["grv"] + }, + "application/vnd.groove-tool-message": { + source: "iana", + extensions: ["gtm"] + }, + "application/vnd.groove-tool-template": { + source: "iana", + extensions: ["tpl"] + }, + "application/vnd.groove-vcard": { + source: "iana", + extensions: ["vcg"] + }, + "application/vnd.hal+json": { + source: "iana", + compressible: true + }, + "application/vnd.hal+xml": { + source: "iana", + compressible: true, + extensions: ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + source: "iana", + compressible: true, + extensions: ["zmm"] + }, + "application/vnd.hbci": { + source: "iana", + extensions: ["hbci"] + }, + "application/vnd.hc+json": { + source: "iana", + compressible: true + }, + "application/vnd.hcl-bireports": { + source: "iana" + }, + "application/vnd.hdt": { + source: "iana" + }, + "application/vnd.heroku+json": { + source: "iana", + compressible: true + }, + "application/vnd.hhe.lesson-player": { + source: "iana", + extensions: ["les"] + }, + "application/vnd.hl7cda+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.hl7v2+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.hp-hpgl": { + source: "iana", + extensions: ["hpgl"] + }, + "application/vnd.hp-hpid": { + source: "iana", + extensions: ["hpid"] + }, + "application/vnd.hp-hps": { + source: "iana", + extensions: ["hps"] + }, + "application/vnd.hp-jlyt": { + source: "iana", + extensions: ["jlt"] + }, + "application/vnd.hp-pcl": { + source: "iana", + extensions: ["pcl"] + }, + "application/vnd.hp-pclxl": { + source: "iana", + extensions: ["pclxl"] + }, + "application/vnd.httphone": { + source: "iana" + }, + "application/vnd.hydrostatix.sof-data": { + source: "iana", + extensions: ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + source: "iana", + compressible: true + }, + "application/vnd.hyper-item+json": { + source: "iana", + compressible: true + }, + "application/vnd.hyperdrive+json": { + source: "iana", + compressible: true + }, + "application/vnd.hzn-3d-crossword": { + source: "iana" + }, + "application/vnd.ibm.afplinedata": { + source: "iana" + }, + "application/vnd.ibm.electronic-media": { + source: "iana" + }, + "application/vnd.ibm.minipay": { + source: "iana", + extensions: ["mpy"] + }, + "application/vnd.ibm.modcap": { + source: "iana", + extensions: ["afp", "listafp", "list3820"] + }, + "application/vnd.ibm.rights-management": { + source: "iana", + extensions: ["irm"] + }, + "application/vnd.ibm.secure-container": { + source: "iana", + extensions: ["sc"] + }, + "application/vnd.iccprofile": { + source: "iana", + extensions: ["icc", "icm"] + }, + "application/vnd.ieee.1905": { + source: "iana" + }, + "application/vnd.igloader": { + source: "iana", + extensions: ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + source: "iana", + compressible: false + }, + "application/vnd.imagemeter.image+zip": { + source: "iana", + compressible: false + }, + "application/vnd.immervision-ivp": { + source: "iana", + extensions: ["ivp"] + }, + "application/vnd.immervision-ivu": { + source: "iana", + extensions: ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + source: "iana" + }, + "application/vnd.ims.imsccv1p2": { + source: "iana" + }, + "application/vnd.ims.imsccv1p3": { + source: "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + source: "iana", + compressible: true + }, + "application/vnd.informedcontrol.rms+xml": { + source: "iana", + compressible: true + }, + "application/vnd.informix-visionary": { + source: "iana" + }, + "application/vnd.infotech.project": { + source: "iana" + }, + "application/vnd.infotech.project+xml": { + source: "iana", + compressible: true + }, + "application/vnd.innopath.wamp.notification": { + source: "iana" + }, + "application/vnd.insors.igm": { + source: "iana", + extensions: ["igm"] + }, + "application/vnd.intercon.formnet": { + source: "iana", + extensions: ["xpw", "xpx"] + }, + "application/vnd.intergeo": { + source: "iana", + extensions: ["i2g"] + }, + "application/vnd.intertrust.digibox": { + source: "iana" + }, + "application/vnd.intertrust.nncp": { + source: "iana" + }, + "application/vnd.intu.qbo": { + source: "iana", + extensions: ["qbo"] + }, + "application/vnd.intu.qfx": { + source: "iana", + extensions: ["qfx"] + }, + "application/vnd.iptc.g2.catalogitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.newsitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.packageitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.planningitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ipunplugged.rcprofile": { + source: "iana", + extensions: ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + source: "iana", + compressible: true, + extensions: ["irp"] + }, + "application/vnd.is-xpr": { + source: "iana", + extensions: ["xpr"] + }, + "application/vnd.isac.fcs": { + source: "iana", + extensions: ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + source: "iana", + compressible: false + }, + "application/vnd.jam": { + source: "iana", + extensions: ["jam"] + }, + "application/vnd.japannet-directory-service": { + source: "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + source: "iana" + }, + "application/vnd.japannet-payment-wakeup": { + source: "iana" + }, + "application/vnd.japannet-registration": { + source: "iana" + }, + "application/vnd.japannet-registration-wakeup": { + source: "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + source: "iana" + }, + "application/vnd.japannet-verification": { + source: "iana" + }, + "application/vnd.japannet-verification-wakeup": { + source: "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + source: "iana", + extensions: ["rms"] + }, + "application/vnd.jisp": { + source: "iana", + extensions: ["jisp"] + }, + "application/vnd.joost.joda-archive": { + source: "iana", + extensions: ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + source: "iana" + }, + "application/vnd.kahootz": { + source: "iana", + extensions: ["ktz", "ktr"] + }, + "application/vnd.kde.karbon": { + source: "iana", + extensions: ["karbon"] + }, + "application/vnd.kde.kchart": { + source: "iana", + extensions: ["chrt"] + }, + "application/vnd.kde.kformula": { + source: "iana", + extensions: ["kfo"] + }, + "application/vnd.kde.kivio": { + source: "iana", + extensions: ["flw"] + }, + "application/vnd.kde.kontour": { + source: "iana", + extensions: ["kon"] + }, + "application/vnd.kde.kpresenter": { + source: "iana", + extensions: ["kpr", "kpt"] + }, + "application/vnd.kde.kspread": { + source: "iana", + extensions: ["ksp"] + }, + "application/vnd.kde.kword": { + source: "iana", + extensions: ["kwd", "kwt"] + }, + "application/vnd.kenameaapp": { + source: "iana", + extensions: ["htke"] + }, + "application/vnd.kidspiration": { + source: "iana", + extensions: ["kia"] + }, + "application/vnd.kinar": { + source: "iana", + extensions: ["kne", "knp"] + }, + "application/vnd.koan": { + source: "iana", + extensions: ["skp", "skd", "skt", "skm"] + }, + "application/vnd.kodak-descriptor": { + source: "iana", + extensions: ["sse"] + }, + "application/vnd.las": { + source: "iana" + }, + "application/vnd.las.las+json": { + source: "iana", + compressible: true + }, + "application/vnd.las.las+xml": { + source: "iana", + compressible: true, + extensions: ["lasxml"] + }, + "application/vnd.laszip": { + source: "iana" + }, + "application/vnd.leap+json": { + source: "iana", + compressible: true + }, + "application/vnd.liberty-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + source: "iana", + extensions: ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + source: "iana", + compressible: true, + extensions: ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + source: "iana", + compressible: false + }, + "application/vnd.loom": { + source: "iana" + }, + "application/vnd.lotus-1-2-3": { + source: "iana", + extensions: ["123"] + }, + "application/vnd.lotus-approach": { + source: "iana", + extensions: ["apr"] + }, + "application/vnd.lotus-freelance": { + source: "iana", + extensions: ["pre"] + }, + "application/vnd.lotus-notes": { + source: "iana", + extensions: ["nsf"] + }, + "application/vnd.lotus-organizer": { + source: "iana", + extensions: ["org"] + }, + "application/vnd.lotus-screencam": { + source: "iana", + extensions: ["scm"] + }, + "application/vnd.lotus-wordpro": { + source: "iana", + extensions: ["lwp"] + }, + "application/vnd.macports.portpkg": { + source: "iana", + extensions: ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + source: "iana", + extensions: ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.conftoken+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.license+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.mdcf": { + source: "iana" + }, + "application/vnd.mason+json": { + source: "iana", + compressible: true + }, + "application/vnd.maxar.archive.3tz+zip": { + source: "iana", + compressible: false + }, + "application/vnd.maxmind.maxmind-db": { + source: "iana" + }, + "application/vnd.mcd": { + source: "iana", + extensions: ["mcd"] + }, + "application/vnd.medcalcdata": { + source: "iana", + extensions: ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + source: "iana", + extensions: ["cdkey"] + }, + "application/vnd.meridian-slingshot": { + source: "iana" + }, + "application/vnd.mfer": { + source: "iana", + extensions: ["mwf"] + }, + "application/vnd.mfmp": { + source: "iana", + extensions: ["mfm"] + }, + "application/vnd.micro+json": { + source: "iana", + compressible: true + }, + "application/vnd.micrografx.flo": { + source: "iana", + extensions: ["flo"] + }, + "application/vnd.micrografx.igx": { + source: "iana", + extensions: ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + source: "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + source: "iana" + }, + "application/vnd.miele+json": { + source: "iana", + compressible: true + }, + "application/vnd.mif": { + source: "iana", + extensions: ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + source: "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + source: "iana" + }, + "application/vnd.mobius.daf": { + source: "iana", + extensions: ["daf"] + }, + "application/vnd.mobius.dis": { + source: "iana", + extensions: ["dis"] + }, + "application/vnd.mobius.mbk": { + source: "iana", + extensions: ["mbk"] + }, + "application/vnd.mobius.mqy": { + source: "iana", + extensions: ["mqy"] + }, + "application/vnd.mobius.msl": { + source: "iana", + extensions: ["msl"] + }, + "application/vnd.mobius.plc": { + source: "iana", + extensions: ["plc"] + }, + "application/vnd.mobius.txf": { + source: "iana", + extensions: ["txf"] + }, + "application/vnd.mophun.application": { + source: "iana", + extensions: ["mpn"] + }, + "application/vnd.mophun.certificate": { + source: "iana", + extensions: ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + source: "iana" + }, + "application/vnd.motorola.iprm": { + source: "iana" + }, + "application/vnd.mozilla.xul+xml": { + source: "iana", + compressible: true, + extensions: ["xul"] + }, + "application/vnd.ms-3mfdocument": { + source: "iana" + }, + "application/vnd.ms-artgalry": { + source: "iana", + extensions: ["cil"] + }, + "application/vnd.ms-asf": { + source: "iana" + }, + "application/vnd.ms-cab-compressed": { + source: "iana", + extensions: ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + source: "apache" + }, + "application/vnd.ms-excel": { + source: "iana", + compressible: false, + extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + source: "iana", + extensions: ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + source: "iana", + extensions: ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + source: "iana", + extensions: ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + source: "iana", + extensions: ["xltm"] + }, + "application/vnd.ms-fontobject": { + source: "iana", + compressible: true, + extensions: ["eot"] + }, + "application/vnd.ms-htmlhelp": { + source: "iana", + extensions: ["chm"] + }, + "application/vnd.ms-ims": { + source: "iana", + extensions: ["ims"] + }, + "application/vnd.ms-lrm": { + source: "iana", + extensions: ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-officetheme": { + source: "iana", + extensions: ["thmx"] + }, + "application/vnd.ms-opentype": { + source: "apache", + compressible: true + }, + "application/vnd.ms-outlook": { + compressible: false, + extensions: ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + source: "apache" + }, + "application/vnd.ms-pki.seccat": { + source: "apache", + extensions: ["cat"] + }, + "application/vnd.ms-pki.stl": { + source: "apache", + extensions: ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-powerpoint": { + source: "iana", + compressible: false, + extensions: ["ppt", "pps", "pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + source: "iana", + extensions: ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + source: "iana", + extensions: ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + source: "iana", + extensions: ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + source: "iana", + extensions: ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + source: "iana", + extensions: ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-printing.printticket+xml": { + source: "apache", + compressible: true + }, + "application/vnd.ms-printschematicket+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-project": { + source: "iana", + extensions: ["mpp", "mpt"] + }, + "application/vnd.ms-tnef": { + source: "iana" + }, + "application/vnd.ms-windows.devicepairing": { + source: "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + source: "iana" + }, + "application/vnd.ms-windows.printerpairing": { + source: "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + source: "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + source: "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + source: "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + source: "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + source: "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + source: "iana", + extensions: ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + source: "iana", + extensions: ["dotm"] + }, + "application/vnd.ms-works": { + source: "iana", + extensions: ["wps", "wks", "wcm", "wdb"] + }, + "application/vnd.ms-wpl": { + source: "iana", + extensions: ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + source: "iana", + compressible: false, + extensions: ["xps"] + }, + "application/vnd.msa-disk-image": { + source: "iana" + }, + "application/vnd.mseq": { + source: "iana", + extensions: ["mseq"] + }, + "application/vnd.msign": { + source: "iana" + }, + "application/vnd.multiad.creator": { + source: "iana" + }, + "application/vnd.multiad.creator.cif": { + source: "iana" + }, + "application/vnd.music-niff": { + source: "iana" + }, + "application/vnd.musician": { + source: "iana", + extensions: ["mus"] + }, + "application/vnd.muvee.style": { + source: "iana", + extensions: ["msty"] + }, + "application/vnd.mynfc": { + source: "iana", + extensions: ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + source: "iana", + compressible: true + }, + "application/vnd.ncd.control": { + source: "iana" + }, + "application/vnd.ncd.reference": { + source: "iana" + }, + "application/vnd.nearst.inv+json": { + source: "iana", + compressible: true + }, + "application/vnd.nebumind.line": { + source: "iana" + }, + "application/vnd.nervana": { + source: "iana" + }, + "application/vnd.netfpx": { + source: "iana" + }, + "application/vnd.neurolanguage.nlu": { + source: "iana", + extensions: ["nlu"] + }, + "application/vnd.nimn": { + source: "iana" + }, + "application/vnd.nintendo.nitro.rom": { + source: "iana" + }, + "application/vnd.nintendo.snes.rom": { + source: "iana" + }, + "application/vnd.nitf": { + source: "iana", + extensions: ["ntf", "nitf"] + }, + "application/vnd.noblenet-directory": { + source: "iana", + extensions: ["nnd"] + }, + "application/vnd.noblenet-sealer": { + source: "iana", + extensions: ["nns"] + }, + "application/vnd.noblenet-web": { + source: "iana", + extensions: ["nnw"] + }, + "application/vnd.nokia.catalogs": { + source: "iana" + }, + "application/vnd.nokia.conml+wbxml": { + source: "iana" + }, + "application/vnd.nokia.conml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.iptv.config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.isds-radio-presets": { + source: "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + source: "iana" + }, + "application/vnd.nokia.landmark+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.landmarkcollection+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.n-gage.ac+xml": { + source: "iana", + compressible: true, + extensions: ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + source: "iana", + extensions: ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + source: "iana", + extensions: ["n-gage"] + }, + "application/vnd.nokia.ncd": { + source: "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + source: "iana" + }, + "application/vnd.nokia.pcd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.radio-preset": { + source: "iana", + extensions: ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + source: "iana", + extensions: ["rpss"] + }, + "application/vnd.novadigm.edm": { + source: "iana", + extensions: ["edm"] + }, + "application/vnd.novadigm.edx": { + source: "iana", + extensions: ["edx"] + }, + "application/vnd.novadigm.ext": { + source: "iana", + extensions: ["ext"] + }, + "application/vnd.ntt-local.content-share": { + source: "iana" + }, + "application/vnd.ntt-local.file-transfer": { + source: "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + source: "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + source: "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + source: "iana" + }, + "application/vnd.oasis.opendocument.chart": { + source: "iana", + extensions: ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + source: "iana", + extensions: ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + source: "iana", + extensions: ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + source: "iana", + extensions: ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + source: "iana", + extensions: ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + source: "iana", + compressible: false, + extensions: ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + source: "iana", + extensions: ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + source: "iana", + extensions: ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + source: "iana", + extensions: ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + source: "iana", + compressible: false, + extensions: ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + source: "iana", + extensions: ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + source: "iana", + compressible: false, + extensions: ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + source: "iana", + extensions: ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + source: "iana", + compressible: false, + extensions: ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + source: "iana", + extensions: ["odm"] + }, + "application/vnd.oasis.opendocument.text-template": { + source: "iana", + extensions: ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + source: "iana", + extensions: ["oth"] + }, + "application/vnd.obn": { + source: "iana" + }, + "application/vnd.ocf+cbor": { + source: "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + source: "iana", + compressible: true + }, + "application/vnd.oftn.l10n+json": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.cspg-hexbinary": { + source: "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.dae.xhtml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.pae.gem": { + source: "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.spdlist+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.ueprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.userprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.olpc-sugar": { + source: "iana", + extensions: ["xo"] + }, + "application/vnd.oma-scws-config": { + source: "iana" + }, + "application/vnd.oma-scws-http-request": { + source: "iana" + }, + "application/vnd.oma-scws-http-response": { + source: "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.imd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.ltkm": { + source: "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + source: "iana" + }, + "application/vnd.oma.bcast.sgboot": { + source: "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.sgdu": { + source: "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + source: "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.sprov+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.stkm": { + source: "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-feature-handler+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-pcc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-subs-invite+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-user-prefs+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.dcd": { + source: "iana" + }, + "application/vnd.oma.dcdc": { + source: "iana" + }, + "application/vnd.oma.dd2+xml": { + source: "iana", + compressible: true, + extensions: ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.group-usage-list+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.lwm2m+cbor": { + source: "iana" + }, + "application/vnd.oma.lwm2m+json": { + source: "iana", + compressible: true + }, + "application/vnd.oma.lwm2m+tlv": { + source: "iana" + }, + "application/vnd.oma.pal+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.final-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.groups+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.push": { + source: "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.xcap-directory+xml": { + source: "iana", + compressible: true + }, + "application/vnd.omads-email+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omads-file+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omads-folder+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omaloc-supl-init": { + source: "iana" + }, + "application/vnd.onepager": { + source: "iana" + }, + "application/vnd.onepagertamp": { + source: "iana" + }, + "application/vnd.onepagertamx": { + source: "iana" + }, + "application/vnd.onepagertat": { + source: "iana" + }, + "application/vnd.onepagertatp": { + source: "iana" + }, + "application/vnd.onepagertatx": { + source: "iana" + }, + "application/vnd.openblox.game+xml": { + source: "iana", + compressible: true, + extensions: ["obgx"] + }, + "application/vnd.openblox.game-binary": { + source: "iana" + }, + "application/vnd.openeye.oeb": { + source: "iana" + }, + "application/vnd.openofficeorg.extension": { + source: "apache", + extensions: ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + source: "iana", + compressible: true, + extensions: ["osm"] + }, + "application/vnd.opentimestamps.ots": { + source: "iana" + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + source: "iana", + compressible: false, + extensions: ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + source: "iana", + extensions: ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + source: "iana", + extensions: ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + source: "iana", + extensions: ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + source: "iana", + compressible: false, + extensions: ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + source: "iana", + extensions: ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + source: "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + source: "iana", + compressible: false, + extensions: ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + source: "iana", + extensions: ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oracle.resource+json": { + source: "iana", + compressible: true + }, + "application/vnd.orange.indata": { + source: "iana" + }, + "application/vnd.osa.netdeploy": { + source: "iana" + }, + "application/vnd.osgeo.mapguide.package": { + source: "iana", + extensions: ["mgp"] + }, + "application/vnd.osgi.bundle": { + source: "iana" + }, + "application/vnd.osgi.dp": { + source: "iana", + extensions: ["dp"] + }, + "application/vnd.osgi.subsystem": { + source: "iana", + extensions: ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oxli.countgraph": { + source: "iana" + }, + "application/vnd.pagerduty+json": { + source: "iana", + compressible: true + }, + "application/vnd.palm": { + source: "iana", + extensions: ["pdb", "pqa", "oprc"] + }, + "application/vnd.panoply": { + source: "iana" + }, + "application/vnd.paos.xml": { + source: "iana" + }, + "application/vnd.patentdive": { + source: "iana" + }, + "application/vnd.patientecommsdoc": { + source: "iana" + }, + "application/vnd.pawaafile": { + source: "iana", + extensions: ["paw"] + }, + "application/vnd.pcos": { + source: "iana" + }, + "application/vnd.pg.format": { + source: "iana", + extensions: ["str"] + }, + "application/vnd.pg.osasli": { + source: "iana", + extensions: ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + source: "iana" + }, + "application/vnd.picsel": { + source: "iana", + extensions: ["efif"] + }, + "application/vnd.pmi.widget": { + source: "iana", + extensions: ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + source: "iana", + compressible: true + }, + "application/vnd.pocketlearn": { + source: "iana", + extensions: ["plf"] + }, + "application/vnd.powerbuilder6": { + source: "iana", + extensions: ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + source: "iana" + }, + "application/vnd.powerbuilder7": { + source: "iana" + }, + "application/vnd.powerbuilder7-s": { + source: "iana" + }, + "application/vnd.powerbuilder75": { + source: "iana" + }, + "application/vnd.powerbuilder75-s": { + source: "iana" + }, + "application/vnd.preminet": { + source: "iana" + }, + "application/vnd.previewsystems.box": { + source: "iana", + extensions: ["box"] + }, + "application/vnd.proteus.magazine": { + source: "iana", + extensions: ["mgz"] + }, + "application/vnd.psfs": { + source: "iana" + }, + "application/vnd.publishare-delta-tree": { + source: "iana", + extensions: ["qps"] + }, + "application/vnd.pvi.ptid1": { + source: "iana", + extensions: ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + source: "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + source: "iana", + compressible: true + }, + "application/vnd.qualcomm.brew-app-res": { + source: "iana" + }, + "application/vnd.quarantainenet": { + source: "iana" + }, + "application/vnd.quark.quarkxpress": { + source: "iana", + extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] + }, + "application/vnd.quobject-quoxdocument": { + source: "iana" + }, + "application/vnd.radisys.moml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-conf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + source: "iana", + compressible: true + }, + "application/vnd.rainstor.data": { + source: "iana" + }, + "application/vnd.rapid": { + source: "iana" + }, + "application/vnd.rar": { + source: "iana", + extensions: ["rar"] + }, + "application/vnd.realvnc.bed": { + source: "iana", + extensions: ["bed"] + }, + "application/vnd.recordare.musicxml": { + source: "iana", + extensions: ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + source: "iana", + compressible: true, + extensions: ["musicxml"] + }, + "application/vnd.renlearn.rlprint": { + source: "iana" + }, + "application/vnd.resilient.logic": { + source: "iana" + }, + "application/vnd.restful+json": { + source: "iana", + compressible: true + }, + "application/vnd.rig.cryptonote": { + source: "iana", + extensions: ["cryptonote"] + }, + "application/vnd.rim.cod": { + source: "apache", + extensions: ["cod"] + }, + "application/vnd.rn-realmedia": { + source: "apache", + extensions: ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + source: "apache", + extensions: ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + source: "iana", + compressible: true, + extensions: ["link66"] + }, + "application/vnd.rs-274x": { + source: "iana" + }, + "application/vnd.ruckus.download": { + source: "iana" + }, + "application/vnd.s3sms": { + source: "iana" + }, + "application/vnd.sailingtracker.track": { + source: "iana", + extensions: ["st"] + }, + "application/vnd.sar": { + source: "iana" + }, + "application/vnd.sbm.cid": { + source: "iana" + }, + "application/vnd.sbm.mid2": { + source: "iana" + }, + "application/vnd.scribus": { + source: "iana" + }, + "application/vnd.sealed.3df": { + source: "iana" + }, + "application/vnd.sealed.csf": { + source: "iana" + }, + "application/vnd.sealed.doc": { + source: "iana" + }, + "application/vnd.sealed.eml": { + source: "iana" + }, + "application/vnd.sealed.mht": { + source: "iana" + }, + "application/vnd.sealed.net": { + source: "iana" + }, + "application/vnd.sealed.ppt": { + source: "iana" + }, + "application/vnd.sealed.tiff": { + source: "iana" + }, + "application/vnd.sealed.xls": { + source: "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + source: "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + source: "iana" + }, + "application/vnd.seemail": { + source: "iana", + extensions: ["see"] + }, + "application/vnd.seis+json": { + source: "iana", + compressible: true + }, + "application/vnd.sema": { + source: "iana", + extensions: ["sema"] + }, + "application/vnd.semd": { + source: "iana", + extensions: ["semd"] + }, + "application/vnd.semf": { + source: "iana", + extensions: ["semf"] + }, + "application/vnd.shade-save-file": { + source: "iana" + }, + "application/vnd.shana.informed.formdata": { + source: "iana", + extensions: ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + source: "iana", + extensions: ["itp"] + }, + "application/vnd.shana.informed.interchange": { + source: "iana", + extensions: ["iif"] + }, + "application/vnd.shana.informed.package": { + source: "iana", + extensions: ["ipk"] + }, + "application/vnd.shootproof+json": { + source: "iana", + compressible: true + }, + "application/vnd.shopkick+json": { + source: "iana", + compressible: true + }, + "application/vnd.shp": { + source: "iana" + }, + "application/vnd.shx": { + source: "iana" + }, + "application/vnd.sigrok.session": { + source: "iana" + }, + "application/vnd.simtech-mindmapper": { + source: "iana", + extensions: ["twd", "twds"] + }, + "application/vnd.siren+json": { + source: "iana", + compressible: true + }, + "application/vnd.smaf": { + source: "iana", + extensions: ["mmf"] + }, + "application/vnd.smart.notebook": { + source: "iana" + }, + "application/vnd.smart.teacher": { + source: "iana", + extensions: ["teacher"] + }, + "application/vnd.snesdev-page-table": { + source: "iana" + }, + "application/vnd.software602.filler.form+xml": { + source: "iana", + compressible: true, + extensions: ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + source: "iana" + }, + "application/vnd.solent.sdkm+xml": { + source: "iana", + compressible: true, + extensions: ["sdkm", "sdkd"] + }, + "application/vnd.spotfire.dxp": { + source: "iana", + extensions: ["dxp"] + }, + "application/vnd.spotfire.sfs": { + source: "iana", + extensions: ["sfs"] + }, + "application/vnd.sqlite3": { + source: "iana" + }, + "application/vnd.sss-cod": { + source: "iana" + }, + "application/vnd.sss-dtf": { + source: "iana" + }, + "application/vnd.sss-ntf": { + source: "iana" + }, + "application/vnd.stardivision.calc": { + source: "apache", + extensions: ["sdc"] + }, + "application/vnd.stardivision.draw": { + source: "apache", + extensions: ["sda"] + }, + "application/vnd.stardivision.impress": { + source: "apache", + extensions: ["sdd"] + }, + "application/vnd.stardivision.math": { + source: "apache", + extensions: ["smf"] + }, + "application/vnd.stardivision.writer": { + source: "apache", + extensions: ["sdw", "vor"] + }, + "application/vnd.stardivision.writer-global": { + source: "apache", + extensions: ["sgl"] + }, + "application/vnd.stepmania.package": { + source: "iana", + extensions: ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + source: "iana", + extensions: ["sm"] + }, + "application/vnd.street-stream": { + source: "iana" + }, + "application/vnd.sun.wadl+xml": { + source: "iana", + compressible: true, + extensions: ["wadl"] + }, + "application/vnd.sun.xml.calc": { + source: "apache", + extensions: ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + source: "apache", + extensions: ["stc"] + }, + "application/vnd.sun.xml.draw": { + source: "apache", + extensions: ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + source: "apache", + extensions: ["std"] + }, + "application/vnd.sun.xml.impress": { + source: "apache", + extensions: ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + source: "apache", + extensions: ["sti"] + }, + "application/vnd.sun.xml.math": { + source: "apache", + extensions: ["sxm"] + }, + "application/vnd.sun.xml.writer": { + source: "apache", + extensions: ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + source: "apache", + extensions: ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + source: "apache", + extensions: ["stw"] + }, + "application/vnd.sus-calendar": { + source: "iana", + extensions: ["sus", "susp"] + }, + "application/vnd.svd": { + source: "iana", + extensions: ["svd"] + }, + "application/vnd.swiftview-ics": { + source: "iana" + }, + "application/vnd.sycle+xml": { + source: "iana", + compressible: true + }, + "application/vnd.syft+json": { + source: "iana", + compressible: true + }, + "application/vnd.symbian.install": { + source: "apache", + extensions: ["sis", "sisx"] + }, + "application/vnd.syncml+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + source: "iana", + charset: "UTF-8", + extensions: ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + source: "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + source: "iana" + }, + "application/vnd.syncml.dmddf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + source: "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.syncml.ds.notification": { + source: "iana" + }, + "application/vnd.tableschema+json": { + source: "iana", + compressible: true + }, + "application/vnd.tao.intent-module-archive": { + source: "iana", + extensions: ["tao"] + }, + "application/vnd.tcpdump.pcap": { + source: "iana", + extensions: ["pcap", "cap", "dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + source: "iana", + compressible: true + }, + "application/vnd.tmd.mediaflex.api+xml": { + source: "iana", + compressible: true + }, + "application/vnd.tml": { + source: "iana" + }, + "application/vnd.tmobile-livetv": { + source: "iana", + extensions: ["tmo"] + }, + "application/vnd.tri.onesource": { + source: "iana" + }, + "application/vnd.trid.tpt": { + source: "iana", + extensions: ["tpt"] + }, + "application/vnd.triscape.mxs": { + source: "iana", + extensions: ["mxs"] + }, + "application/vnd.trueapp": { + source: "iana", + extensions: ["tra"] + }, + "application/vnd.truedoc": { + source: "iana" + }, + "application/vnd.ubisoft.webplayer": { + source: "iana" + }, + "application/vnd.ufdl": { + source: "iana", + extensions: ["ufd", "ufdl"] + }, + "application/vnd.uiq.theme": { + source: "iana", + extensions: ["utz"] + }, + "application/vnd.umajin": { + source: "iana", + extensions: ["umj"] + }, + "application/vnd.unity": { + source: "iana", + extensions: ["unityweb"] + }, + "application/vnd.uoml+xml": { + source: "iana", + compressible: true, + extensions: ["uoml"] + }, + "application/vnd.uplanet.alert": { + source: "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.bearer-choice": { + source: "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.cacheop": { + source: "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.channel": { + source: "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.list": { + source: "iana" + }, + "application/vnd.uplanet.list-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.listcmd": { + source: "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.signal": { + source: "iana" + }, + "application/vnd.uri-map": { + source: "iana" + }, + "application/vnd.valve.source.material": { + source: "iana" + }, + "application/vnd.vcx": { + source: "iana", + extensions: ["vcx"] + }, + "application/vnd.vd-study": { + source: "iana" + }, + "application/vnd.vectorworks": { + source: "iana" + }, + "application/vnd.vel+json": { + source: "iana", + compressible: true + }, + "application/vnd.verimatrix.vcas": { + source: "iana" + }, + "application/vnd.veritone.aion+json": { + source: "iana", + compressible: true + }, + "application/vnd.veryant.thin": { + source: "iana" + }, + "application/vnd.ves.encrypted": { + source: "iana" + }, + "application/vnd.vidsoft.vidconference": { + source: "iana" + }, + "application/vnd.visio": { + source: "iana", + extensions: ["vsd", "vst", "vss", "vsw"] + }, + "application/vnd.visionary": { + source: "iana", + extensions: ["vis"] + }, + "application/vnd.vividence.scriptfile": { + source: "iana" + }, + "application/vnd.vsf": { + source: "iana", + extensions: ["vsf"] + }, + "application/vnd.wap.sic": { + source: "iana" + }, + "application/vnd.wap.slc": { + source: "iana" + }, + "application/vnd.wap.wbxml": { + source: "iana", + charset: "UTF-8", + extensions: ["wbxml"] + }, + "application/vnd.wap.wmlc": { + source: "iana", + extensions: ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + source: "iana", + extensions: ["wmlsc"] + }, + "application/vnd.webturbo": { + source: "iana", + extensions: ["wtb"] + }, + "application/vnd.wfa.dpp": { + source: "iana" + }, + "application/vnd.wfa.p2p": { + source: "iana" + }, + "application/vnd.wfa.wsc": { + source: "iana" + }, + "application/vnd.windows.devicepairing": { + source: "iana" + }, + "application/vnd.wmc": { + source: "iana" + }, + "application/vnd.wmf.bootstrap": { + source: "iana" + }, + "application/vnd.wolfram.mathematica": { + source: "iana" + }, + "application/vnd.wolfram.mathematica.package": { + source: "iana" + }, + "application/vnd.wolfram.player": { + source: "iana", + extensions: ["nbp"] + }, + "application/vnd.wordperfect": { + source: "iana", + extensions: ["wpd"] + }, + "application/vnd.wqd": { + source: "iana", + extensions: ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + source: "iana" + }, + "application/vnd.wt.stf": { + source: "iana", + extensions: ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + source: "iana" + }, + "application/vnd.wv.csp+xml": { + source: "iana", + compressible: true + }, + "application/vnd.wv.ssp+xml": { + source: "iana", + compressible: true + }, + "application/vnd.xacml+json": { + source: "iana", + compressible: true + }, + "application/vnd.xara": { + source: "iana", + extensions: ["xar"] + }, + "application/vnd.xfdl": { + source: "iana", + extensions: ["xfdl"] + }, + "application/vnd.xfdl.webform": { + source: "iana" + }, + "application/vnd.xmi+xml": { + source: "iana", + compressible: true + }, + "application/vnd.xmpie.cpkg": { + source: "iana" + }, + "application/vnd.xmpie.dpkg": { + source: "iana" + }, + "application/vnd.xmpie.plan": { + source: "iana" + }, + "application/vnd.xmpie.ppkg": { + source: "iana" + }, + "application/vnd.xmpie.xlim": { + source: "iana" + }, + "application/vnd.yamaha.hv-dic": { + source: "iana", + extensions: ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + source: "iana", + extensions: ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + source: "iana", + extensions: ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + source: "iana", + extensions: ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + source: "iana", + compressible: true, + extensions: ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + source: "iana" + }, + "application/vnd.yamaha.smaf-audio": { + source: "iana", + extensions: ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + source: "iana", + extensions: ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + source: "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + source: "iana" + }, + "application/vnd.yaoweme": { + source: "iana" + }, + "application/vnd.yellowriver-custom-menu": { + source: "iana", + extensions: ["cmp"] + }, + "application/vnd.youtube.yt": { + source: "iana" + }, + "application/vnd.zul": { + source: "iana", + extensions: ["zir", "zirz"] + }, + "application/vnd.zzazz.deck+xml": { + source: "iana", + compressible: true, + extensions: ["zaz"] + }, + "application/voicexml+xml": { + source: "iana", + compressible: true, + extensions: ["vxml"] + }, + "application/voucher-cms+json": { + source: "iana", + compressible: true + }, + "application/vq-rtcpxr": { + source: "iana" + }, + "application/wasm": { + source: "iana", + compressible: true, + extensions: ["wasm"] + }, + "application/watcherinfo+xml": { + source: "iana", + compressible: true, + extensions: ["wif"] + }, + "application/webpush-options+json": { + source: "iana", + compressible: true + }, + "application/whoispp-query": { + source: "iana" + }, + "application/whoispp-response": { + source: "iana" + }, + "application/widget": { + source: "iana", + extensions: ["wgt"] + }, + "application/winhlp": { + source: "apache", + extensions: ["hlp"] + }, + "application/wita": { + source: "iana" + }, + "application/wordperfect5.1": { + source: "iana" + }, + "application/wsdl+xml": { + source: "iana", + compressible: true, + extensions: ["wsdl"] + }, + "application/wspolicy+xml": { + source: "iana", + compressible: true, + extensions: ["wspolicy"] + }, + "application/x-7z-compressed": { + source: "apache", + compressible: false, + extensions: ["7z"] + }, + "application/x-abiword": { + source: "apache", + extensions: ["abw"] + }, + "application/x-ace-compressed": { + source: "apache", + extensions: ["ace"] + }, + "application/x-amf": { + source: "apache" + }, + "application/x-apple-diskimage": { + source: "apache", + extensions: ["dmg"] + }, + "application/x-arj": { + compressible: false, + extensions: ["arj"] + }, + "application/x-authorware-bin": { + source: "apache", + extensions: ["aab", "x32", "u32", "vox"] + }, + "application/x-authorware-map": { + source: "apache", + extensions: ["aam"] + }, + "application/x-authorware-seg": { + source: "apache", + extensions: ["aas"] + }, + "application/x-bcpio": { + source: "apache", + extensions: ["bcpio"] + }, + "application/x-bdoc": { + compressible: false, + extensions: ["bdoc"] + }, + "application/x-bittorrent": { + source: "apache", + extensions: ["torrent"] + }, + "application/x-blorb": { + source: "apache", + extensions: ["blb", "blorb"] + }, + "application/x-bzip": { + source: "apache", + compressible: false, + extensions: ["bz"] + }, + "application/x-bzip2": { + source: "apache", + compressible: false, + extensions: ["bz2", "boz"] + }, + "application/x-cbr": { + source: "apache", + extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] + }, + "application/x-cdlink": { + source: "apache", + extensions: ["vcd"] + }, + "application/x-cfs-compressed": { + source: "apache", + extensions: ["cfs"] + }, + "application/x-chat": { + source: "apache", + extensions: ["chat"] + }, + "application/x-chess-pgn": { + source: "apache", + extensions: ["pgn"] + }, + "application/x-chrome-extension": { + extensions: ["crx"] + }, + "application/x-cocoa": { + source: "nginx", + extensions: ["cco"] + }, + "application/x-compress": { + source: "apache" + }, + "application/x-conference": { + source: "apache", + extensions: ["nsc"] + }, + "application/x-cpio": { + source: "apache", + extensions: ["cpio"] + }, + "application/x-csh": { + source: "apache", + extensions: ["csh"] + }, + "application/x-deb": { + compressible: false + }, + "application/x-debian-package": { + source: "apache", + extensions: ["deb", "udeb"] + }, + "application/x-dgc-compressed": { + source: "apache", + extensions: ["dgc"] + }, + "application/x-director": { + source: "apache", + extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] + }, + "application/x-doom": { + source: "apache", + extensions: ["wad"] + }, + "application/x-dtbncx+xml": { + source: "apache", + compressible: true, + extensions: ["ncx"] + }, + "application/x-dtbook+xml": { + source: "apache", + compressible: true, + extensions: ["dtb"] + }, + "application/x-dtbresource+xml": { + source: "apache", + compressible: true, + extensions: ["res"] + }, + "application/x-dvi": { + source: "apache", + compressible: false, + extensions: ["dvi"] + }, + "application/x-envoy": { + source: "apache", + extensions: ["evy"] + }, + "application/x-eva": { + source: "apache", + extensions: ["eva"] + }, + "application/x-font-bdf": { + source: "apache", + extensions: ["bdf"] + }, + "application/x-font-dos": { + source: "apache" + }, + "application/x-font-framemaker": { + source: "apache" + }, + "application/x-font-ghostscript": { + source: "apache", + extensions: ["gsf"] + }, + "application/x-font-libgrx": { + source: "apache" + }, + "application/x-font-linux-psf": { + source: "apache", + extensions: ["psf"] + }, + "application/x-font-pcf": { + source: "apache", + extensions: ["pcf"] + }, + "application/x-font-snf": { + source: "apache", + extensions: ["snf"] + }, + "application/x-font-speedo": { + source: "apache" + }, + "application/x-font-sunos-news": { + source: "apache" + }, + "application/x-font-type1": { + source: "apache", + extensions: ["pfa", "pfb", "pfm", "afm"] + }, + "application/x-font-vfont": { + source: "apache" + }, + "application/x-freearc": { + source: "apache", + extensions: ["arc"] + }, + "application/x-futuresplash": { + source: "apache", + extensions: ["spl"] + }, + "application/x-gca-compressed": { + source: "apache", + extensions: ["gca"] + }, + "application/x-glulx": { + source: "apache", + extensions: ["ulx"] + }, + "application/x-gnumeric": { + source: "apache", + extensions: ["gnumeric"] + }, + "application/x-gramps-xml": { + source: "apache", + extensions: ["gramps"] + }, + "application/x-gtar": { + source: "apache", + extensions: ["gtar"] + }, + "application/x-gzip": { + source: "apache" + }, + "application/x-hdf": { + source: "apache", + extensions: ["hdf"] + }, + "application/x-httpd-php": { + compressible: true, + extensions: ["php"] + }, + "application/x-install-instructions": { + source: "apache", + extensions: ["install"] + }, + "application/x-iso9660-image": { + source: "apache", + extensions: ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + extensions: ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + extensions: ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + extensions: ["pages"] + }, + "application/x-java-archive-diff": { + source: "nginx", + extensions: ["jardiff"] + }, + "application/x-java-jnlp-file": { + source: "apache", + compressible: false, + extensions: ["jnlp"] + }, + "application/x-javascript": { + compressible: true + }, + "application/x-keepass2": { + extensions: ["kdbx"] + }, + "application/x-latex": { + source: "apache", + compressible: false, + extensions: ["latex"] + }, + "application/x-lua-bytecode": { + extensions: ["luac"] + }, + "application/x-lzh-compressed": { + source: "apache", + extensions: ["lzh", "lha"] + }, + "application/x-makeself": { + source: "nginx", + extensions: ["run"] + }, + "application/x-mie": { + source: "apache", + extensions: ["mie"] + }, + "application/x-mobipocket-ebook": { + source: "apache", + extensions: ["prc", "mobi"] + }, + "application/x-mpegurl": { + compressible: false + }, + "application/x-ms-application": { + source: "apache", + extensions: ["application"] + }, + "application/x-ms-shortcut": { + source: "apache", + extensions: ["lnk"] + }, + "application/x-ms-wmd": { + source: "apache", + extensions: ["wmd"] + }, + "application/x-ms-wmz": { + source: "apache", + extensions: ["wmz"] + }, + "application/x-ms-xbap": { + source: "apache", + extensions: ["xbap"] + }, + "application/x-msaccess": { + source: "apache", + extensions: ["mdb"] + }, + "application/x-msbinder": { + source: "apache", + extensions: ["obd"] + }, + "application/x-mscardfile": { + source: "apache", + extensions: ["crd"] + }, + "application/x-msclip": { + source: "apache", + extensions: ["clp"] + }, + "application/x-msdos-program": { + extensions: ["exe"] + }, + "application/x-msdownload": { + source: "apache", + extensions: ["exe", "dll", "com", "bat", "msi"] + }, + "application/x-msmediaview": { + source: "apache", + extensions: ["mvb", "m13", "m14"] + }, + "application/x-msmetafile": { + source: "apache", + extensions: ["wmf", "wmz", "emf", "emz"] + }, + "application/x-msmoney": { + source: "apache", + extensions: ["mny"] + }, + "application/x-mspublisher": { + source: "apache", + extensions: ["pub"] + }, + "application/x-msschedule": { + source: "apache", + extensions: ["scd"] + }, + "application/x-msterminal": { + source: "apache", + extensions: ["trm"] + }, + "application/x-mswrite": { + source: "apache", + extensions: ["wri"] + }, + "application/x-netcdf": { + source: "apache", + extensions: ["nc", "cdf"] + }, + "application/x-ns-proxy-autoconfig": { + compressible: true, + extensions: ["pac"] + }, + "application/x-nzb": { + source: "apache", + extensions: ["nzb"] + }, + "application/x-perl": { + source: "nginx", + extensions: ["pl", "pm"] + }, + "application/x-pilot": { + source: "nginx", + extensions: ["prc", "pdb"] + }, + "application/x-pkcs12": { + source: "apache", + compressible: false, + extensions: ["p12", "pfx"] + }, + "application/x-pkcs7-certificates": { + source: "apache", + extensions: ["p7b", "spc"] + }, + "application/x-pkcs7-certreqresp": { + source: "apache", + extensions: ["p7r"] + }, + "application/x-pki-message": { + source: "iana" + }, + "application/x-rar-compressed": { + source: "apache", + compressible: false, + extensions: ["rar"] + }, + "application/x-redhat-package-manager": { + source: "nginx", + extensions: ["rpm"] + }, + "application/x-research-info-systems": { + source: "apache", + extensions: ["ris"] + }, + "application/x-sea": { + source: "nginx", + extensions: ["sea"] + }, + "application/x-sh": { + source: "apache", + compressible: true, + extensions: ["sh"] + }, + "application/x-shar": { + source: "apache", + extensions: ["shar"] + }, + "application/x-shockwave-flash": { + source: "apache", + compressible: false, + extensions: ["swf"] + }, + "application/x-silverlight-app": { + source: "apache", + extensions: ["xap"] + }, + "application/x-sql": { + source: "apache", + extensions: ["sql"] + }, + "application/x-stuffit": { + source: "apache", + compressible: false, + extensions: ["sit"] + }, + "application/x-stuffitx": { + source: "apache", + extensions: ["sitx"] + }, + "application/x-subrip": { + source: "apache", + extensions: ["srt"] + }, + "application/x-sv4cpio": { + source: "apache", + extensions: ["sv4cpio"] + }, + "application/x-sv4crc": { + source: "apache", + extensions: ["sv4crc"] + }, + "application/x-t3vm-image": { + source: "apache", + extensions: ["t3"] + }, + "application/x-tads": { + source: "apache", + extensions: ["gam"] + }, + "application/x-tar": { + source: "apache", + compressible: true, + extensions: ["tar"] + }, + "application/x-tcl": { + source: "apache", + extensions: ["tcl", "tk"] + }, + "application/x-tex": { + source: "apache", + extensions: ["tex"] + }, + "application/x-tex-tfm": { + source: "apache", + extensions: ["tfm"] + }, + "application/x-texinfo": { + source: "apache", + extensions: ["texinfo", "texi"] + }, + "application/x-tgif": { + source: "apache", + extensions: ["obj"] + }, + "application/x-ustar": { + source: "apache", + extensions: ["ustar"] + }, + "application/x-virtualbox-hdd": { + compressible: true, + extensions: ["hdd"] + }, + "application/x-virtualbox-ova": { + compressible: true, + extensions: ["ova"] + }, + "application/x-virtualbox-ovf": { + compressible: true, + extensions: ["ovf"] + }, + "application/x-virtualbox-vbox": { + compressible: true, + extensions: ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + compressible: false, + extensions: ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + compressible: true, + extensions: ["vdi"] + }, + "application/x-virtualbox-vhd": { + compressible: true, + extensions: ["vhd"] + }, + "application/x-virtualbox-vmdk": { + compressible: true, + extensions: ["vmdk"] + }, + "application/x-wais-source": { + source: "apache", + extensions: ["src"] + }, + "application/x-web-app-manifest+json": { + compressible: true, + extensions: ["webapp"] + }, + "application/x-www-form-urlencoded": { + source: "iana", + compressible: true + }, + "application/x-x509-ca-cert": { + source: "iana", + extensions: ["der", "crt", "pem"] + }, + "application/x-x509-ca-ra-cert": { + source: "iana" + }, + "application/x-x509-next-ca-cert": { + source: "iana" + }, + "application/x-xfig": { + source: "apache", + extensions: ["fig"] + }, + "application/x-xliff+xml": { + source: "apache", + compressible: true, + extensions: ["xlf"] + }, + "application/x-xpinstall": { + source: "apache", + compressible: false, + extensions: ["xpi"] + }, + "application/x-xz": { + source: "apache", + extensions: ["xz"] + }, + "application/x-zmachine": { + source: "apache", + extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] + }, + "application/x400-bp": { + source: "iana" + }, + "application/xacml+xml": { + source: "iana", + compressible: true + }, + "application/xaml+xml": { + source: "apache", + compressible: true, + extensions: ["xaml"] + }, + "application/xcap-att+xml": { + source: "iana", + compressible: true, + extensions: ["xav"] + }, + "application/xcap-caps+xml": { + source: "iana", + compressible: true, + extensions: ["xca"] + }, + "application/xcap-diff+xml": { + source: "iana", + compressible: true, + extensions: ["xdf"] + }, + "application/xcap-el+xml": { + source: "iana", + compressible: true, + extensions: ["xel"] + }, + "application/xcap-error+xml": { + source: "iana", + compressible: true + }, + "application/xcap-ns+xml": { + source: "iana", + compressible: true, + extensions: ["xns"] + }, + "application/xcon-conference-info+xml": { + source: "iana", + compressible: true + }, + "application/xcon-conference-info-diff+xml": { + source: "iana", + compressible: true + }, + "application/xenc+xml": { + source: "iana", + compressible: true, + extensions: ["xenc"] + }, + "application/xhtml+xml": { + source: "iana", + compressible: true, + extensions: ["xhtml", "xht"] + }, + "application/xhtml-voice+xml": { + source: "apache", + compressible: true + }, + "application/xliff+xml": { + source: "iana", + compressible: true, + extensions: ["xlf"] + }, + "application/xml": { + source: "iana", + compressible: true, + extensions: ["xml", "xsl", "xsd", "rng"] + }, + "application/xml-dtd": { + source: "iana", + compressible: true, + extensions: ["dtd"] + }, + "application/xml-external-parsed-entity": { + source: "iana" + }, + "application/xml-patch+xml": { + source: "iana", + compressible: true + }, + "application/xmpp+xml": { + source: "iana", + compressible: true + }, + "application/xop+xml": { + source: "iana", + compressible: true, + extensions: ["xop"] + }, + "application/xproc+xml": { + source: "apache", + compressible: true, + extensions: ["xpl"] + }, + "application/xslt+xml": { + source: "iana", + compressible: true, + extensions: ["xsl", "xslt"] + }, + "application/xspf+xml": { + source: "apache", + compressible: true, + extensions: ["xspf"] + }, + "application/xv+xml": { + source: "iana", + compressible: true, + extensions: ["mxml", "xhvml", "xvml", "xvm"] + }, + "application/yang": { + source: "iana", + extensions: ["yang"] + }, + "application/yang-data+json": { + source: "iana", + compressible: true + }, + "application/yang-data+xml": { + source: "iana", + compressible: true + }, + "application/yang-patch+json": { + source: "iana", + compressible: true + }, + "application/yang-patch+xml": { + source: "iana", + compressible: true + }, + "application/yin+xml": { + source: "iana", + compressible: true, + extensions: ["yin"] + }, + "application/zip": { + source: "iana", + compressible: false, + extensions: ["zip"] + }, + "application/zlib": { + source: "iana" + }, + "application/zstd": { + source: "iana" + }, + "audio/1d-interleaved-parityfec": { + source: "iana" + }, + "audio/32kadpcm": { + source: "iana" + }, + "audio/3gpp": { + source: "iana", + compressible: false, + extensions: ["3gpp"] + }, + "audio/3gpp2": { + source: "iana" + }, + "audio/aac": { + source: "iana" + }, + "audio/ac3": { + source: "iana" + }, + "audio/adpcm": { + source: "apache", + extensions: ["adp"] + }, + "audio/amr": { + source: "iana", + extensions: ["amr"] + }, + "audio/amr-wb": { + source: "iana" + }, + "audio/amr-wb+": { + source: "iana" + }, + "audio/aptx": { + source: "iana" + }, + "audio/asc": { + source: "iana" + }, + "audio/atrac-advanced-lossless": { + source: "iana" + }, + "audio/atrac-x": { + source: "iana" + }, + "audio/atrac3": { + source: "iana" + }, + "audio/basic": { + source: "iana", + compressible: false, + extensions: ["au", "snd"] + }, + "audio/bv16": { + source: "iana" + }, + "audio/bv32": { + source: "iana" + }, + "audio/clearmode": { + source: "iana" + }, + "audio/cn": { + source: "iana" + }, + "audio/dat12": { + source: "iana" + }, + "audio/dls": { + source: "iana" + }, + "audio/dsr-es201108": { + source: "iana" + }, + "audio/dsr-es202050": { + source: "iana" + }, + "audio/dsr-es202211": { + source: "iana" + }, + "audio/dsr-es202212": { + source: "iana" + }, + "audio/dv": { + source: "iana" + }, + "audio/dvi4": { + source: "iana" + }, + "audio/eac3": { + source: "iana" + }, + "audio/encaprtp": { + source: "iana" + }, + "audio/evrc": { + source: "iana" + }, + "audio/evrc-qcp": { + source: "iana" + }, + "audio/evrc0": { + source: "iana" + }, + "audio/evrc1": { + source: "iana" + }, + "audio/evrcb": { + source: "iana" + }, + "audio/evrcb0": { + source: "iana" + }, + "audio/evrcb1": { + source: "iana" + }, + "audio/evrcnw": { + source: "iana" + }, + "audio/evrcnw0": { + source: "iana" + }, + "audio/evrcnw1": { + source: "iana" + }, + "audio/evrcwb": { + source: "iana" + }, + "audio/evrcwb0": { + source: "iana" + }, + "audio/evrcwb1": { + source: "iana" + }, + "audio/evs": { + source: "iana" + }, + "audio/flexfec": { + source: "iana" + }, + "audio/fwdred": { + source: "iana" + }, + "audio/g711-0": { + source: "iana" + }, + "audio/g719": { + source: "iana" + }, + "audio/g722": { + source: "iana" + }, + "audio/g7221": { + source: "iana" + }, + "audio/g723": { + source: "iana" + }, + "audio/g726-16": { + source: "iana" + }, + "audio/g726-24": { + source: "iana" + }, + "audio/g726-32": { + source: "iana" + }, + "audio/g726-40": { + source: "iana" + }, + "audio/g728": { + source: "iana" + }, + "audio/g729": { + source: "iana" + }, + "audio/g7291": { + source: "iana" + }, + "audio/g729d": { + source: "iana" + }, + "audio/g729e": { + source: "iana" + }, + "audio/gsm": { + source: "iana" + }, + "audio/gsm-efr": { + source: "iana" + }, + "audio/gsm-hr-08": { + source: "iana" + }, + "audio/ilbc": { + source: "iana" + }, + "audio/ip-mr_v2.5": { + source: "iana" + }, + "audio/isac": { + source: "apache" + }, + "audio/l16": { + source: "iana" + }, + "audio/l20": { + source: "iana" + }, + "audio/l24": { + source: "iana", + compressible: false + }, + "audio/l8": { + source: "iana" + }, + "audio/lpc": { + source: "iana" + }, + "audio/melp": { + source: "iana" + }, + "audio/melp1200": { + source: "iana" + }, + "audio/melp2400": { + source: "iana" + }, + "audio/melp600": { + source: "iana" + }, + "audio/mhas": { + source: "iana" + }, + "audio/midi": { + source: "apache", + extensions: ["mid", "midi", "kar", "rmi"] + }, + "audio/mobile-xmf": { + source: "iana", + extensions: ["mxmf"] + }, + "audio/mp3": { + compressible: false, + extensions: ["mp3"] + }, + "audio/mp4": { + source: "iana", + compressible: false, + extensions: ["m4a", "mp4a"] + }, + "audio/mp4a-latm": { + source: "iana" + }, + "audio/mpa": { + source: "iana" + }, + "audio/mpa-robust": { + source: "iana" + }, + "audio/mpeg": { + source: "iana", + compressible: false, + extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] + }, + "audio/mpeg4-generic": { + source: "iana" + }, + "audio/musepack": { + source: "apache" + }, + "audio/ogg": { + source: "iana", + compressible: false, + extensions: ["oga", "ogg", "spx", "opus"] + }, + "audio/opus": { + source: "iana" + }, + "audio/parityfec": { + source: "iana" + }, + "audio/pcma": { + source: "iana" + }, + "audio/pcma-wb": { + source: "iana" + }, + "audio/pcmu": { + source: "iana" + }, + "audio/pcmu-wb": { + source: "iana" + }, + "audio/prs.sid": { + source: "iana" + }, + "audio/qcelp": { + source: "iana" + }, + "audio/raptorfec": { + source: "iana" + }, + "audio/red": { + source: "iana" + }, + "audio/rtp-enc-aescm128": { + source: "iana" + }, + "audio/rtp-midi": { + source: "iana" + }, + "audio/rtploopback": { + source: "iana" + }, + "audio/rtx": { + source: "iana" + }, + "audio/s3m": { + source: "apache", + extensions: ["s3m"] + }, + "audio/scip": { + source: "iana" + }, + "audio/silk": { + source: "apache", + extensions: ["sil"] + }, + "audio/smv": { + source: "iana" + }, + "audio/smv-qcp": { + source: "iana" + }, + "audio/smv0": { + source: "iana" + }, + "audio/sofa": { + source: "iana" + }, + "audio/sp-midi": { + source: "iana" + }, + "audio/speex": { + source: "iana" + }, + "audio/t140c": { + source: "iana" + }, + "audio/t38": { + source: "iana" + }, + "audio/telephone-event": { + source: "iana" + }, + "audio/tetra_acelp": { + source: "iana" + }, + "audio/tetra_acelp_bb": { + source: "iana" + }, + "audio/tone": { + source: "iana" + }, + "audio/tsvcis": { + source: "iana" + }, + "audio/uemclip": { + source: "iana" + }, + "audio/ulpfec": { + source: "iana" + }, + "audio/usac": { + source: "iana" + }, + "audio/vdvi": { + source: "iana" + }, + "audio/vmr-wb": { + source: "iana" + }, + "audio/vnd.3gpp.iufp": { + source: "iana" + }, + "audio/vnd.4sb": { + source: "iana" + }, + "audio/vnd.audiokoz": { + source: "iana" + }, + "audio/vnd.celp": { + source: "iana" + }, + "audio/vnd.cisco.nse": { + source: "iana" + }, + "audio/vnd.cmles.radio-events": { + source: "iana" + }, + "audio/vnd.cns.anp1": { + source: "iana" + }, + "audio/vnd.cns.inf1": { + source: "iana" + }, + "audio/vnd.dece.audio": { + source: "iana", + extensions: ["uva", "uvva"] + }, + "audio/vnd.digital-winds": { + source: "iana", + extensions: ["eol"] + }, + "audio/vnd.dlna.adts": { + source: "iana" + }, + "audio/vnd.dolby.heaac.1": { + source: "iana" + }, + "audio/vnd.dolby.heaac.2": { + source: "iana" + }, + "audio/vnd.dolby.mlp": { + source: "iana" + }, + "audio/vnd.dolby.mps": { + source: "iana" + }, + "audio/vnd.dolby.pl2": { + source: "iana" + }, + "audio/vnd.dolby.pl2x": { + source: "iana" + }, + "audio/vnd.dolby.pl2z": { + source: "iana" + }, + "audio/vnd.dolby.pulse.1": { + source: "iana" + }, + "audio/vnd.dra": { + source: "iana", + extensions: ["dra"] + }, + "audio/vnd.dts": { + source: "iana", + extensions: ["dts"] + }, + "audio/vnd.dts.hd": { + source: "iana", + extensions: ["dtshd"] + }, + "audio/vnd.dts.uhd": { + source: "iana" + }, + "audio/vnd.dvb.file": { + source: "iana" + }, + "audio/vnd.everad.plj": { + source: "iana" + }, + "audio/vnd.hns.audio": { + source: "iana" + }, + "audio/vnd.lucent.voice": { + source: "iana", + extensions: ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + source: "iana", + extensions: ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + source: "iana" + }, + "audio/vnd.nortel.vbk": { + source: "iana" + }, + "audio/vnd.nuera.ecelp4800": { + source: "iana", + extensions: ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + source: "iana", + extensions: ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + source: "iana", + extensions: ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + source: "iana" + }, + "audio/vnd.presonus.multitrack": { + source: "iana" + }, + "audio/vnd.qcelp": { + source: "iana" + }, + "audio/vnd.rhetorex.32kadpcm": { + source: "iana" + }, + "audio/vnd.rip": { + source: "iana", + extensions: ["rip"] + }, + "audio/vnd.rn-realaudio": { + compressible: false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + source: "iana" + }, + "audio/vnd.vmx.cvsd": { + source: "iana" + }, + "audio/vnd.wave": { + compressible: false + }, + "audio/vorbis": { + source: "iana", + compressible: false + }, + "audio/vorbis-config": { + source: "iana" + }, + "audio/wav": { + compressible: false, + extensions: ["wav"] + }, + "audio/wave": { + compressible: false, + extensions: ["wav"] + }, + "audio/webm": { + source: "apache", + compressible: false, + extensions: ["weba"] + }, + "audio/x-aac": { + source: "apache", + compressible: false, + extensions: ["aac"] + }, + "audio/x-aiff": { + source: "apache", + extensions: ["aif", "aiff", "aifc"] + }, + "audio/x-caf": { + source: "apache", + compressible: false, + extensions: ["caf"] + }, + "audio/x-flac": { + source: "apache", + extensions: ["flac"] + }, + "audio/x-m4a": { + source: "nginx", + extensions: ["m4a"] + }, + "audio/x-matroska": { + source: "apache", + extensions: ["mka"] + }, + "audio/x-mpegurl": { + source: "apache", + extensions: ["m3u"] + }, + "audio/x-ms-wax": { + source: "apache", + extensions: ["wax"] + }, + "audio/x-ms-wma": { + source: "apache", + extensions: ["wma"] + }, + "audio/x-pn-realaudio": { + source: "apache", + extensions: ["ram", "ra"] + }, + "audio/x-pn-realaudio-plugin": { + source: "apache", + extensions: ["rmp"] + }, + "audio/x-realaudio": { + source: "nginx", + extensions: ["ra"] + }, + "audio/x-tta": { + source: "apache" + }, + "audio/x-wav": { + source: "apache", + extensions: ["wav"] + }, + "audio/xm": { + source: "apache", + extensions: ["xm"] + }, + "chemical/x-cdx": { + source: "apache", + extensions: ["cdx"] + }, + "chemical/x-cif": { + source: "apache", + extensions: ["cif"] + }, + "chemical/x-cmdf": { + source: "apache", + extensions: ["cmdf"] + }, + "chemical/x-cml": { + source: "apache", + extensions: ["cml"] + }, + "chemical/x-csml": { + source: "apache", + extensions: ["csml"] + }, + "chemical/x-pdb": { + source: "apache" + }, + "chemical/x-xyz": { + source: "apache", + extensions: ["xyz"] + }, + "font/collection": { + source: "iana", + extensions: ["ttc"] + }, + "font/otf": { + source: "iana", + compressible: true, + extensions: ["otf"] + }, + "font/sfnt": { + source: "iana" + }, + "font/ttf": { + source: "iana", + compressible: true, + extensions: ["ttf"] + }, + "font/woff": { + source: "iana", + extensions: ["woff"] + }, + "font/woff2": { + source: "iana", + extensions: ["woff2"] + }, + "image/aces": { + source: "iana", + extensions: ["exr"] + }, + "image/apng": { + compressible: false, + extensions: ["apng"] + }, + "image/avci": { + source: "iana", + extensions: ["avci"] + }, + "image/avcs": { + source: "iana", + extensions: ["avcs"] + }, + "image/avif": { + source: "iana", + compressible: false, + extensions: ["avif"] + }, + "image/bmp": { + source: "iana", + compressible: true, + extensions: ["bmp"] + }, + "image/cgm": { + source: "iana", + extensions: ["cgm"] + }, + "image/dicom-rle": { + source: "iana", + extensions: ["drle"] + }, + "image/emf": { + source: "iana", + extensions: ["emf"] + }, + "image/fits": { + source: "iana", + extensions: ["fits"] + }, + "image/g3fax": { + source: "iana", + extensions: ["g3"] + }, + "image/gif": { + source: "iana", + compressible: false, + extensions: ["gif"] + }, + "image/heic": { + source: "iana", + extensions: ["heic"] + }, + "image/heic-sequence": { + source: "iana", + extensions: ["heics"] + }, + "image/heif": { + source: "iana", + extensions: ["heif"] + }, + "image/heif-sequence": { + source: "iana", + extensions: ["heifs"] + }, + "image/hej2k": { + source: "iana", + extensions: ["hej2"] + }, + "image/hsj2": { + source: "iana", + extensions: ["hsj2"] + }, + "image/ief": { + source: "iana", + extensions: ["ief"] + }, + "image/jls": { + source: "iana", + extensions: ["jls"] + }, + "image/jp2": { + source: "iana", + compressible: false, + extensions: ["jp2", "jpg2"] + }, + "image/jpeg": { + source: "iana", + compressible: false, + extensions: ["jpeg", "jpg", "jpe"] + }, + "image/jph": { + source: "iana", + extensions: ["jph"] + }, + "image/jphc": { + source: "iana", + extensions: ["jhc"] + }, + "image/jpm": { + source: "iana", + compressible: false, + extensions: ["jpm"] + }, + "image/jpx": { + source: "iana", + compressible: false, + extensions: ["jpx", "jpf"] + }, + "image/jxr": { + source: "iana", + extensions: ["jxr"] + }, + "image/jxra": { + source: "iana", + extensions: ["jxra"] + }, + "image/jxrs": { + source: "iana", + extensions: ["jxrs"] + }, + "image/jxs": { + source: "iana", + extensions: ["jxs"] + }, + "image/jxsc": { + source: "iana", + extensions: ["jxsc"] + }, + "image/jxsi": { + source: "iana", + extensions: ["jxsi"] + }, + "image/jxss": { + source: "iana", + extensions: ["jxss"] + }, + "image/ktx": { + source: "iana", + extensions: ["ktx"] + }, + "image/ktx2": { + source: "iana", + extensions: ["ktx2"] + }, + "image/naplps": { + source: "iana" + }, + "image/pjpeg": { + compressible: false + }, + "image/png": { + source: "iana", + compressible: false, + extensions: ["png"] + }, + "image/prs.btif": { + source: "iana", + extensions: ["btif"] + }, + "image/prs.pti": { + source: "iana", + extensions: ["pti"] + }, + "image/pwg-raster": { + source: "iana" + }, + "image/sgi": { + source: "apache", + extensions: ["sgi"] + }, + "image/svg+xml": { + source: "iana", + compressible: true, + extensions: ["svg", "svgz"] + }, + "image/t38": { + source: "iana", + extensions: ["t38"] + }, + "image/tiff": { + source: "iana", + compressible: false, + extensions: ["tif", "tiff"] + }, + "image/tiff-fx": { + source: "iana", + extensions: ["tfx"] + }, + "image/vnd.adobe.photoshop": { + source: "iana", + compressible: true, + extensions: ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + source: "iana", + extensions: ["azv"] + }, + "image/vnd.cns.inf2": { + source: "iana" + }, + "image/vnd.dece.graphic": { + source: "iana", + extensions: ["uvi", "uvvi", "uvg", "uvvg"] + }, + "image/vnd.djvu": { + source: "iana", + extensions: ["djvu", "djv"] + }, + "image/vnd.dvb.subtitle": { + source: "iana", + extensions: ["sub"] + }, + "image/vnd.dwg": { + source: "iana", + extensions: ["dwg"] + }, + "image/vnd.dxf": { + source: "iana", + extensions: ["dxf"] + }, + "image/vnd.fastbidsheet": { + source: "iana", + extensions: ["fbs"] + }, + "image/vnd.fpx": { + source: "iana", + extensions: ["fpx"] + }, + "image/vnd.fst": { + source: "iana", + extensions: ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + source: "iana", + extensions: ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + source: "iana", + extensions: ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + source: "iana" + }, + "image/vnd.microsoft.icon": { + source: "iana", + compressible: true, + extensions: ["ico"] + }, + "image/vnd.mix": { + source: "iana" + }, + "image/vnd.mozilla.apng": { + source: "iana" + }, + "image/vnd.ms-dds": { + compressible: true, + extensions: ["dds"] + }, + "image/vnd.ms-modi": { + source: "iana", + extensions: ["mdi"] + }, + "image/vnd.ms-photo": { + source: "apache", + extensions: ["wdp"] + }, + "image/vnd.net-fpx": { + source: "iana", + extensions: ["npx"] + }, + "image/vnd.pco.b16": { + source: "iana", + extensions: ["b16"] + }, + "image/vnd.radiance": { + source: "iana" + }, + "image/vnd.sealed.png": { + source: "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + source: "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + source: "iana" + }, + "image/vnd.svf": { + source: "iana" + }, + "image/vnd.tencent.tap": { + source: "iana", + extensions: ["tap"] + }, + "image/vnd.valve.source.texture": { + source: "iana", + extensions: ["vtf"] + }, + "image/vnd.wap.wbmp": { + source: "iana", + extensions: ["wbmp"] + }, + "image/vnd.xiff": { + source: "iana", + extensions: ["xif"] + }, + "image/vnd.zbrush.pcx": { + source: "iana", + extensions: ["pcx"] + }, + "image/webp": { + source: "apache", + extensions: ["webp"] + }, + "image/wmf": { + source: "iana", + extensions: ["wmf"] + }, + "image/x-3ds": { + source: "apache", + extensions: ["3ds"] + }, + "image/x-cmu-raster": { + source: "apache", + extensions: ["ras"] + }, + "image/x-cmx": { + source: "apache", + extensions: ["cmx"] + }, + "image/x-freehand": { + source: "apache", + extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] + }, + "image/x-icon": { + source: "apache", + compressible: true, + extensions: ["ico"] + }, + "image/x-jng": { + source: "nginx", + extensions: ["jng"] + }, + "image/x-mrsid-image": { + source: "apache", + extensions: ["sid"] + }, + "image/x-ms-bmp": { + source: "nginx", + compressible: true, + extensions: ["bmp"] + }, + "image/x-pcx": { + source: "apache", + extensions: ["pcx"] + }, + "image/x-pict": { + source: "apache", + extensions: ["pic", "pct"] + }, + "image/x-portable-anymap": { + source: "apache", + extensions: ["pnm"] + }, + "image/x-portable-bitmap": { + source: "apache", + extensions: ["pbm"] + }, + "image/x-portable-graymap": { + source: "apache", + extensions: ["pgm"] + }, + "image/x-portable-pixmap": { + source: "apache", + extensions: ["ppm"] + }, + "image/x-rgb": { + source: "apache", + extensions: ["rgb"] + }, + "image/x-tga": { + source: "apache", + extensions: ["tga"] + }, + "image/x-xbitmap": { + source: "apache", + extensions: ["xbm"] + }, + "image/x-xcf": { + compressible: false + }, + "image/x-xpixmap": { + source: "apache", + extensions: ["xpm"] + }, + "image/x-xwindowdump": { + source: "apache", + extensions: ["xwd"] + }, + "message/cpim": { + source: "iana" + }, + "message/delivery-status": { + source: "iana" + }, + "message/disposition-notification": { + source: "iana", + extensions: [ + "disposition-notification" + ] + }, + "message/external-body": { + source: "iana" + }, + "message/feedback-report": { + source: "iana" + }, + "message/global": { + source: "iana", + extensions: ["u8msg"] + }, + "message/global-delivery-status": { + source: "iana", + extensions: ["u8dsn"] + }, + "message/global-disposition-notification": { + source: "iana", + extensions: ["u8mdn"] + }, + "message/global-headers": { + source: "iana", + extensions: ["u8hdr"] + }, + "message/http": { + source: "iana", + compressible: false + }, + "message/imdn+xml": { + source: "iana", + compressible: true + }, + "message/news": { + source: "iana" + }, + "message/partial": { + source: "iana", + compressible: false + }, + "message/rfc822": { + source: "iana", + compressible: true, + extensions: ["eml", "mime"] + }, + "message/s-http": { + source: "iana" + }, + "message/sip": { + source: "iana" + }, + "message/sipfrag": { + source: "iana" + }, + "message/tracking-status": { + source: "iana" + }, + "message/vnd.si.simp": { + source: "iana" + }, + "message/vnd.wfa.wsc": { + source: "iana", + extensions: ["wsc"] + }, + "model/3mf": { + source: "iana", + extensions: ["3mf"] + }, + "model/e57": { + source: "iana" + }, + "model/gltf+json": { + source: "iana", + compressible: true, + extensions: ["gltf"] + }, + "model/gltf-binary": { + source: "iana", + compressible: true, + extensions: ["glb"] + }, + "model/iges": { + source: "iana", + compressible: false, + extensions: ["igs", "iges"] + }, + "model/mesh": { + source: "iana", + compressible: false, + extensions: ["msh", "mesh", "silo"] + }, + "model/mtl": { + source: "iana", + extensions: ["mtl"] + }, + "model/obj": { + source: "iana", + extensions: ["obj"] + }, + "model/step": { + source: "iana" + }, + "model/step+xml": { + source: "iana", + compressible: true, + extensions: ["stpx"] + }, + "model/step+zip": { + source: "iana", + compressible: false, + extensions: ["stpz"] + }, + "model/step-xml+zip": { + source: "iana", + compressible: false, + extensions: ["stpxz"] + }, + "model/stl": { + source: "iana", + extensions: ["stl"] + }, + "model/vnd.collada+xml": { + source: "iana", + compressible: true, + extensions: ["dae"] + }, + "model/vnd.dwf": { + source: "iana", + extensions: ["dwf"] + }, + "model/vnd.flatland.3dml": { + source: "iana" + }, + "model/vnd.gdl": { + source: "iana", + extensions: ["gdl"] + }, + "model/vnd.gs-gdl": { + source: "apache" + }, + "model/vnd.gs.gdl": { + source: "iana" + }, + "model/vnd.gtw": { + source: "iana", + extensions: ["gtw"] + }, + "model/vnd.moml+xml": { + source: "iana", + compressible: true + }, + "model/vnd.mts": { + source: "iana", + extensions: ["mts"] + }, + "model/vnd.opengex": { + source: "iana", + extensions: ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + source: "iana", + extensions: ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + source: "iana", + extensions: ["x_t"] + }, + "model/vnd.pytha.pyox": { + source: "iana" + }, + "model/vnd.rosette.annotated-data-model": { + source: "iana" + }, + "model/vnd.sap.vds": { + source: "iana", + extensions: ["vds"] + }, + "model/vnd.usdz+zip": { + source: "iana", + compressible: false, + extensions: ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + source: "iana", + extensions: ["bsp"] + }, + "model/vnd.vtu": { + source: "iana", + extensions: ["vtu"] + }, + "model/vrml": { + source: "iana", + compressible: false, + extensions: ["wrl", "vrml"] + }, + "model/x3d+binary": { + source: "apache", + compressible: false, + extensions: ["x3db", "x3dbz"] + }, + "model/x3d+fastinfoset": { + source: "iana", + extensions: ["x3db"] + }, + "model/x3d+vrml": { + source: "apache", + compressible: false, + extensions: ["x3dv", "x3dvz"] + }, + "model/x3d+xml": { + source: "iana", + compressible: true, + extensions: ["x3d", "x3dz"] + }, + "model/x3d-vrml": { + source: "iana", + extensions: ["x3dv"] + }, + "multipart/alternative": { + source: "iana", + compressible: false + }, + "multipart/appledouble": { + source: "iana" + }, + "multipart/byteranges": { + source: "iana" + }, + "multipart/digest": { + source: "iana" + }, + "multipart/encrypted": { + source: "iana", + compressible: false + }, + "multipart/form-data": { + source: "iana", + compressible: false + }, + "multipart/header-set": { + source: "iana" + }, + "multipart/mixed": { + source: "iana" + }, + "multipart/multilingual": { + source: "iana" + }, + "multipart/parallel": { + source: "iana" + }, + "multipart/related": { + source: "iana", + compressible: false + }, + "multipart/report": { + source: "iana" + }, + "multipart/signed": { + source: "iana", + compressible: false + }, + "multipart/vnd.bint.med-plus": { + source: "iana" + }, + "multipart/voice-message": { + source: "iana" + }, + "multipart/x-mixed-replace": { + source: "iana" + }, + "text/1d-interleaved-parityfec": { + source: "iana" + }, + "text/cache-manifest": { + source: "iana", + compressible: true, + extensions: ["appcache", "manifest"] + }, + "text/calendar": { + source: "iana", + extensions: ["ics", "ifb"] + }, + "text/calender": { + compressible: true + }, + "text/cmd": { + compressible: true + }, + "text/coffeescript": { + extensions: ["coffee", "litcoffee"] + }, + "text/cql": { + source: "iana" + }, + "text/cql-expression": { + source: "iana" + }, + "text/cql-identifier": { + source: "iana" + }, + "text/css": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["css"] + }, + "text/csv": { + source: "iana", + compressible: true, + extensions: ["csv"] + }, + "text/csv-schema": { + source: "iana" + }, + "text/directory": { + source: "iana" + }, + "text/dns": { + source: "iana" + }, + "text/ecmascript": { + source: "iana" + }, + "text/encaprtp": { + source: "iana" + }, + "text/enriched": { + source: "iana" + }, + "text/fhirpath": { + source: "iana" + }, + "text/flexfec": { + source: "iana" + }, + "text/fwdred": { + source: "iana" + }, + "text/gff3": { + source: "iana" + }, + "text/grammar-ref-list": { + source: "iana" + }, + "text/html": { + source: "iana", + compressible: true, + extensions: ["html", "htm", "shtml"] + }, + "text/jade": { + extensions: ["jade"] + }, + "text/javascript": { + source: "iana", + compressible: true + }, + "text/jcr-cnd": { + source: "iana" + }, + "text/jsx": { + compressible: true, + extensions: ["jsx"] + }, + "text/less": { + compressible: true, + extensions: ["less"] + }, + "text/markdown": { + source: "iana", + compressible: true, + extensions: ["markdown", "md"] + }, + "text/mathml": { + source: "nginx", + extensions: ["mml"] + }, + "text/mdx": { + compressible: true, + extensions: ["mdx"] + }, + "text/mizar": { + source: "iana" + }, + "text/n3": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["n3"] + }, + "text/parameters": { + source: "iana", + charset: "UTF-8" + }, + "text/parityfec": { + source: "iana" + }, + "text/plain": { + source: "iana", + compressible: true, + extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] + }, + "text/provenance-notation": { + source: "iana", + charset: "UTF-8" + }, + "text/prs.fallenstein.rst": { + source: "iana" + }, + "text/prs.lines.tag": { + source: "iana", + extensions: ["dsc"] + }, + "text/prs.prop.logic": { + source: "iana" + }, + "text/raptorfec": { + source: "iana" + }, + "text/red": { + source: "iana" + }, + "text/rfc822-headers": { + source: "iana" + }, + "text/richtext": { + source: "iana", + compressible: true, + extensions: ["rtx"] + }, + "text/rtf": { + source: "iana", + compressible: true, + extensions: ["rtf"] + }, + "text/rtp-enc-aescm128": { + source: "iana" + }, + "text/rtploopback": { + source: "iana" + }, + "text/rtx": { + source: "iana" + }, + "text/sgml": { + source: "iana", + extensions: ["sgml", "sgm"] + }, + "text/shaclc": { + source: "iana" + }, + "text/shex": { + source: "iana", + extensions: ["shex"] + }, + "text/slim": { + extensions: ["slim", "slm"] + }, + "text/spdx": { + source: "iana", + extensions: ["spdx"] + }, + "text/strings": { + source: "iana" + }, + "text/stylus": { + extensions: ["stylus", "styl"] + }, + "text/t140": { + source: "iana" + }, + "text/tab-separated-values": { + source: "iana", + compressible: true, + extensions: ["tsv"] + }, + "text/troff": { + source: "iana", + extensions: ["t", "tr", "roff", "man", "me", "ms"] + }, + "text/turtle": { + source: "iana", + charset: "UTF-8", + extensions: ["ttl"] + }, + "text/ulpfec": { + source: "iana" + }, + "text/uri-list": { + source: "iana", + compressible: true, + extensions: ["uri", "uris", "urls"] + }, + "text/vcard": { + source: "iana", + compressible: true, + extensions: ["vcard"] + }, + "text/vnd.a": { + source: "iana" + }, + "text/vnd.abc": { + source: "iana" + }, + "text/vnd.ascii-art": { + source: "iana" + }, + "text/vnd.curl": { + source: "iana", + extensions: ["curl"] + }, + "text/vnd.curl.dcurl": { + source: "apache", + extensions: ["dcurl"] + }, + "text/vnd.curl.mcurl": { + source: "apache", + extensions: ["mcurl"] + }, + "text/vnd.curl.scurl": { + source: "apache", + extensions: ["scurl"] + }, + "text/vnd.debian.copyright": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.dmclientscript": { + source: "iana" + }, + "text/vnd.dvb.subtitle": { + source: "iana", + extensions: ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.familysearch.gedcom": { + source: "iana", + extensions: ["ged"] + }, + "text/vnd.ficlab.flt": { + source: "iana" + }, + "text/vnd.fly": { + source: "iana", + extensions: ["fly"] + }, + "text/vnd.fmi.flexstor": { + source: "iana", + extensions: ["flx"] + }, + "text/vnd.gml": { + source: "iana" + }, + "text/vnd.graphviz": { + source: "iana", + extensions: ["gv"] + }, + "text/vnd.hans": { + source: "iana" + }, + "text/vnd.hgl": { + source: "iana" + }, + "text/vnd.in3d.3dml": { + source: "iana", + extensions: ["3dml"] + }, + "text/vnd.in3d.spot": { + source: "iana", + extensions: ["spot"] + }, + "text/vnd.iptc.newsml": { + source: "iana" + }, + "text/vnd.iptc.nitf": { + source: "iana" + }, + "text/vnd.latex-z": { + source: "iana" + }, + "text/vnd.motorola.reflex": { + source: "iana" + }, + "text/vnd.ms-mediapackage": { + source: "iana" + }, + "text/vnd.net2phone.commcenter.command": { + source: "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + source: "iana" + }, + "text/vnd.senx.warpscript": { + source: "iana" + }, + "text/vnd.si.uricatalogue": { + source: "iana" + }, + "text/vnd.sosi": { + source: "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + source: "iana", + charset: "UTF-8", + extensions: ["jad"] + }, + "text/vnd.trolltech.linguist": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.wap.si": { + source: "iana" + }, + "text/vnd.wap.sl": { + source: "iana" + }, + "text/vnd.wap.wml": { + source: "iana", + extensions: ["wml"] + }, + "text/vnd.wap.wmlscript": { + source: "iana", + extensions: ["wmls"] + }, + "text/vtt": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["vtt"] + }, + "text/x-asm": { + source: "apache", + extensions: ["s", "asm"] + }, + "text/x-c": { + source: "apache", + extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] + }, + "text/x-component": { + source: "nginx", + extensions: ["htc"] + }, + "text/x-fortran": { + source: "apache", + extensions: ["f", "for", "f77", "f90"] + }, + "text/x-gwt-rpc": { + compressible: true + }, + "text/x-handlebars-template": { + extensions: ["hbs"] + }, + "text/x-java-source": { + source: "apache", + extensions: ["java"] + }, + "text/x-jquery-tmpl": { + compressible: true + }, + "text/x-lua": { + extensions: ["lua"] + }, + "text/x-markdown": { + compressible: true, + extensions: ["mkd"] + }, + "text/x-nfo": { + source: "apache", + extensions: ["nfo"] + }, + "text/x-opml": { + source: "apache", + extensions: ["opml"] + }, + "text/x-org": { + compressible: true, + extensions: ["org"] + }, + "text/x-pascal": { + source: "apache", + extensions: ["p", "pas"] + }, + "text/x-processing": { + compressible: true, + extensions: ["pde"] + }, + "text/x-sass": { + extensions: ["sass"] + }, + "text/x-scss": { + extensions: ["scss"] + }, + "text/x-setext": { + source: "apache", + extensions: ["etx"] + }, + "text/x-sfv": { + source: "apache", + extensions: ["sfv"] + }, + "text/x-suse-ymp": { + compressible: true, + extensions: ["ymp"] + }, + "text/x-uuencode": { + source: "apache", + extensions: ["uu"] + }, + "text/x-vcalendar": { + source: "apache", + extensions: ["vcs"] + }, + "text/x-vcard": { + source: "apache", + extensions: ["vcf"] + }, + "text/xml": { + source: "iana", + compressible: true, + extensions: ["xml"] + }, + "text/xml-external-parsed-entity": { + source: "iana" + }, + "text/yaml": { + compressible: true, + extensions: ["yaml", "yml"] + }, + "video/1d-interleaved-parityfec": { + source: "iana" + }, + "video/3gpp": { + source: "iana", + extensions: ["3gp", "3gpp"] + }, + "video/3gpp-tt": { + source: "iana" + }, + "video/3gpp2": { + source: "iana", + extensions: ["3g2"] + }, + "video/av1": { + source: "iana" + }, + "video/bmpeg": { + source: "iana" + }, + "video/bt656": { + source: "iana" + }, + "video/celb": { + source: "iana" + }, + "video/dv": { + source: "iana" + }, + "video/encaprtp": { + source: "iana" + }, + "video/ffv1": { + source: "iana" + }, + "video/flexfec": { + source: "iana" + }, + "video/h261": { + source: "iana", + extensions: ["h261"] + }, + "video/h263": { + source: "iana", + extensions: ["h263"] + }, + "video/h263-1998": { + source: "iana" + }, + "video/h263-2000": { + source: "iana" + }, + "video/h264": { + source: "iana", + extensions: ["h264"] + }, + "video/h264-rcdo": { + source: "iana" + }, + "video/h264-svc": { + source: "iana" + }, + "video/h265": { + source: "iana" + }, + "video/iso.segment": { + source: "iana", + extensions: ["m4s"] + }, + "video/jpeg": { + source: "iana", + extensions: ["jpgv"] + }, + "video/jpeg2000": { + source: "iana" + }, + "video/jpm": { + source: "apache", + extensions: ["jpm", "jpgm"] + }, + "video/jxsv": { + source: "iana" + }, + "video/mj2": { + source: "iana", + extensions: ["mj2", "mjp2"] + }, + "video/mp1s": { + source: "iana" + }, + "video/mp2p": { + source: "iana" + }, + "video/mp2t": { + source: "iana", + extensions: ["ts"] + }, + "video/mp4": { + source: "iana", + compressible: false, + extensions: ["mp4", "mp4v", "mpg4"] + }, + "video/mp4v-es": { + source: "iana" + }, + "video/mpeg": { + source: "iana", + compressible: false, + extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] + }, + "video/mpeg4-generic": { + source: "iana" + }, + "video/mpv": { + source: "iana" + }, + "video/nv": { + source: "iana" + }, + "video/ogg": { + source: "iana", + compressible: false, + extensions: ["ogv"] + }, + "video/parityfec": { + source: "iana" + }, + "video/pointer": { + source: "iana" + }, + "video/quicktime": { + source: "iana", + compressible: false, + extensions: ["qt", "mov"] + }, + "video/raptorfec": { + source: "iana" + }, + "video/raw": { + source: "iana" + }, + "video/rtp-enc-aescm128": { + source: "iana" + }, + "video/rtploopback": { + source: "iana" + }, + "video/rtx": { + source: "iana" + }, + "video/scip": { + source: "iana" + }, + "video/smpte291": { + source: "iana" + }, + "video/smpte292m": { + source: "iana" + }, + "video/ulpfec": { + source: "iana" + }, + "video/vc1": { + source: "iana" + }, + "video/vc2": { + source: "iana" + }, + "video/vnd.cctv": { + source: "iana" + }, + "video/vnd.dece.hd": { + source: "iana", + extensions: ["uvh", "uvvh"] + }, + "video/vnd.dece.mobile": { + source: "iana", + extensions: ["uvm", "uvvm"] + }, + "video/vnd.dece.mp4": { + source: "iana" + }, + "video/vnd.dece.pd": { + source: "iana", + extensions: ["uvp", "uvvp"] + }, + "video/vnd.dece.sd": { + source: "iana", + extensions: ["uvs", "uvvs"] + }, + "video/vnd.dece.video": { + source: "iana", + extensions: ["uvv", "uvvv"] + }, + "video/vnd.directv.mpeg": { + source: "iana" + }, + "video/vnd.directv.mpeg-tts": { + source: "iana" + }, + "video/vnd.dlna.mpeg-tts": { + source: "iana" + }, + "video/vnd.dvb.file": { + source: "iana", + extensions: ["dvb"] + }, + "video/vnd.fvt": { + source: "iana", + extensions: ["fvt"] + }, + "video/vnd.hns.video": { + source: "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + source: "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + source: "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + source: "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + source: "iana" + }, + "video/vnd.iptvforum.ttsavc": { + source: "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + source: "iana" + }, + "video/vnd.motorola.video": { + source: "iana" + }, + "video/vnd.motorola.videop": { + source: "iana" + }, + "video/vnd.mpegurl": { + source: "iana", + extensions: ["mxu", "m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + source: "iana", + extensions: ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + source: "iana" + }, + "video/vnd.nokia.mp4vr": { + source: "iana" + }, + "video/vnd.nokia.videovoip": { + source: "iana" + }, + "video/vnd.objectvideo": { + source: "iana" + }, + "video/vnd.radgamettools.bink": { + source: "iana" + }, + "video/vnd.radgamettools.smacker": { + source: "iana" + }, + "video/vnd.sealed.mpeg1": { + source: "iana" + }, + "video/vnd.sealed.mpeg4": { + source: "iana" + }, + "video/vnd.sealed.swf": { + source: "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + source: "iana" + }, + "video/vnd.uvvu.mp4": { + source: "iana", + extensions: ["uvu", "uvvu"] + }, + "video/vnd.vivo": { + source: "iana", + extensions: ["viv"] + }, + "video/vnd.youtube.yt": { + source: "iana" + }, + "video/vp8": { + source: "iana" + }, + "video/vp9": { + source: "iana" + }, + "video/webm": { + source: "apache", + compressible: false, + extensions: ["webm"] + }, + "video/x-f4v": { + source: "apache", + extensions: ["f4v"] + }, + "video/x-fli": { + source: "apache", + extensions: ["fli"] + }, + "video/x-flv": { + source: "apache", + compressible: false, + extensions: ["flv"] + }, + "video/x-m4v": { + source: "apache", + extensions: ["m4v"] + }, + "video/x-matroska": { + source: "apache", + compressible: false, + extensions: ["mkv", "mk3d", "mks"] + }, + "video/x-mng": { + source: "apache", + extensions: ["mng"] + }, + "video/x-ms-asf": { + source: "apache", + extensions: ["asf", "asx"] + }, + "video/x-ms-vob": { + source: "apache", + extensions: ["vob"] + }, + "video/x-ms-wm": { + source: "apache", + extensions: ["wm"] + }, + "video/x-ms-wmv": { + source: "apache", + compressible: false, + extensions: ["wmv"] + }, + "video/x-ms-wmx": { + source: "apache", + extensions: ["wmx"] + }, + "video/x-ms-wvx": { + source: "apache", + extensions: ["wvx"] + }, + "video/x-msvideo": { + source: "apache", + extensions: ["avi"] + }, + "video/x-sgi-movie": { + source: "apache", + extensions: ["movie"] + }, + "video/x-smv": { + source: "apache", + extensions: ["smv"] + }, + "x-conference/x-cooltalk": { + source: "apache", + extensions: ["ice"] + }, + "x-shader/x-fragment": { + compressible: true + }, + "x-shader/x-vertex": { + compressible: true + } + }; + } +}); + +// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js +var require_mime_db = __commonJS({ + "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports2, module2) { + module2.exports = require_db(); + } +}); + +// node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js +var require_mime_types = __commonJS({ + "node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports2) { + "use strict"; + var db = require_mime_db(); + var extname = require("path").extname; + var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; + var TEXT_TYPE_REGEXP = /^text\//i; + exports2.charset = charset; + exports2.charsets = { lookup: charset }; + exports2.contentType = contentType; + exports2.extension = extension; + exports2.extensions = /* @__PURE__ */ Object.create(null); + exports2.lookup = lookup; + exports2.types = /* @__PURE__ */ Object.create(null); + populateMaps(exports2.extensions, exports2.types); + function charset(type) { + if (!type || typeof type !== "string") { + return false; + } + var match = EXTRACT_TYPE_REGEXP.exec(type); + var mime = match && db[match[1].toLowerCase()]; + if (mime && mime.charset) { + return mime.charset; + } + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return "UTF-8"; + } + return false; + } + function contentType(str) { + if (!str || typeof str !== "string") { + return false; + } + var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str; + if (!mime) { + return false; + } + if (mime.indexOf("charset") === -1) { + var charset2 = exports2.charset(mime); + if (charset2) mime += "; charset=" + charset2.toLowerCase(); + } + return mime; + } + function extension(type) { + if (!type || typeof type !== "string") { + return false; + } + var match = EXTRACT_TYPE_REGEXP.exec(type); + var exts = match && exports2.extensions[match[1].toLowerCase()]; + if (!exts || !exts.length) { + return false; + } + return exts[0]; + } + function lookup(path2) { + if (!path2 || typeof path2 !== "string") { + return false; + } + var extension2 = extname("x." + path2).toLowerCase().substr(1); + if (!extension2) { + return false; + } + return exports2.types[extension2] || false; + } + function populateMaps(extensions, types) { + var preference = ["nginx", "apache", void 0, "iana"]; + Object.keys(db).forEach(function forEachMimeType(type) { + var mime = db[type]; + var exts = mime.extensions; + if (!exts || !exts.length) { + return; + } + extensions[type] = exts; + for (var i = 0; i < exts.length; i++) { + var extension2 = exts[i]; + if (types[extension2]) { + var from = preference.indexOf(db[types[extension2]].source); + var to = preference.indexOf(mime.source); + if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) { + continue; + } + } + types[extension2] = type; + } + }); + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js +var require_defer = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js"(exports2, module2) { + module2.exports = defer; + function defer(fn) { + var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; + if (nextTick) { + nextTick(fn); + } else { + setTimeout(fn, 0); + } + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js +var require_async = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js"(exports2, module2) { + var defer = require_defer(); + module2.exports = async; + function async(callback) { + var isAsync = false; + defer(function() { + isAsync = true; + }); + return function async_callback(err, result) { + if (isAsync) { + callback(err, result); + } else { + defer(function nextTick_callback() { + callback(err, result); + }); + } + }; + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js +var require_abort = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js"(exports2, module2) { + module2.exports = abort; + function abort(state) { + Object.keys(state.jobs).forEach(clean.bind(state)); + state.jobs = {}; + } + function clean(key) { + if (typeof this.jobs[key] == "function") { + this.jobs[key](); + } + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js +var require_iterate = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js"(exports2, module2) { + var async = require_async(); + var abort = require_abort(); + module2.exports = iterate; + function iterate(list, iterator, state, callback) { + var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { + if (!(key in state.jobs)) { + return; + } + delete state.jobs[key]; + if (error) { + abort(state); + } else { + state.results[key] = output; + } + callback(error, state.results); + }); + } + function runJob(iterator, key, item, callback) { + var aborter; + if (iterator.length == 2) { + aborter = iterator(item, async(callback)); + } else { + aborter = iterator(item, key, async(callback)); + } + return aborter; + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js +var require_state = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js"(exports2, module2) { + module2.exports = state; + function state(list, sortMethod) { + var isNamedList = !Array.isArray(list), initState = { + index: 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs: {}, + results: isNamedList ? {} : [], + size: isNamedList ? Object.keys(list).length : list.length + }; + if (sortMethod) { + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { + return sortMethod(list[a], list[b]); + }); + } + return initState; + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js +var require_terminator = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js"(exports2, module2) { + var abort = require_abort(); + var async = require_async(); + module2.exports = terminator; + function terminator(callback) { + if (!Object.keys(this.jobs).length) { + return; + } + this.index = this.size; + abort(this); + async(callback)(null, this.results); + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js +var require_parallel = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"(exports2, module2) { + var iterate = require_iterate(); + var initState = require_state(); + var terminator = require_terminator(); + module2.exports = parallel; + function parallel(list, iterator, callback) { + var state = initState(list); + while (state.index < (state["keyedList"] || list).length) { + iterate(list, iterator, state, function(error, result) { + if (error) { + callback(error, result); + return; + } + if (Object.keys(state.jobs).length === 0) { + callback(null, state.results); + return; + } + }); + state.index++; + } + return terminator.bind(state, callback); + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js +var require_serialOrdered = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js"(exports2, module2) { + var iterate = require_iterate(); + var initState = require_state(); + var terminator = require_terminator(); + module2.exports = serialOrdered; + module2.exports.ascending = ascending; + module2.exports.descending = descending; + function serialOrdered(list, iterator, sortMethod, callback) { + var state = initState(list, sortMethod); + iterate(list, iterator, state, function iteratorHandler(error, result) { + if (error) { + callback(error, result); + return; + } + state.index++; + if (state.index < (state["keyedList"] || list).length) { + iterate(list, iterator, state, iteratorHandler); + return; + } + callback(null, state.results); + }); + return terminator.bind(state, callback); + } + function ascending(a, b) { + return a < b ? -1 : a > b ? 1 : 0; + } + function descending(a, b) { + return -1 * ascending(a, b); + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js +var require_serial = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js"(exports2, module2) { + var serialOrdered = require_serialOrdered(); + module2.exports = serial; + function serial(list, iterator, callback) { + return serialOrdered(list, iterator, null, callback); + } + } +}); + +// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js +var require_asynckit = __commonJS({ + "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js"(exports2, module2) { + module2.exports = { + parallel: require_parallel(), + serial: require_serial(), + serialOrdered: require_serialOrdered() + }; + } +}); + +// node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js +var require_es_object_atoms = __commonJS({ + "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports2, module2) { + "use strict"; + module2.exports = Object; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js +var require_es_errors = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports2, module2) { + "use strict"; + module2.exports = Error; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js +var require_eval = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports2, module2) { + "use strict"; + module2.exports = EvalError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js +var require_range = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports2, module2) { + "use strict"; + module2.exports = RangeError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js +var require_ref = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports2, module2) { + "use strict"; + module2.exports = ReferenceError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js +var require_syntax = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports2, module2) { + "use strict"; + module2.exports = SyntaxError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js +var require_type = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports2, module2) { + "use strict"; + module2.exports = TypeError; + } +}); + +// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js +var require_uri = __commonJS({ + "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports2, module2) { + "use strict"; + module2.exports = URIError; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js +var require_abs = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports2, module2) { + "use strict"; + module2.exports = Math.abs; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js +var require_floor = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports2, module2) { + "use strict"; + module2.exports = Math.floor; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js +var require_max = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports2, module2) { + "use strict"; + module2.exports = Math.max; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js +var require_min = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports2, module2) { + "use strict"; + module2.exports = Math.min; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js +var require_pow = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports2, module2) { + "use strict"; + module2.exports = Math.pow; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js +var require_round = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports2, module2) { + "use strict"; + module2.exports = Math.round; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js +var require_isNaN = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports2, module2) { + "use strict"; + module2.exports = Number.isNaN || function isNaN2(a) { + return a !== a; + }; + } +}); + +// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js +var require_sign = __commonJS({ + "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports2, module2) { + "use strict"; + var $isNaN = require_isNaN(); + module2.exports = function sign(number) { + if ($isNaN(number) || number === 0) { + return number; + } + return number < 0 ? -1 : 1; + }; + } +}); + +// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js +var require_gOPD = __commonJS({ + "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports2, module2) { + "use strict"; + module2.exports = Object.getOwnPropertyDescriptor; + } +}); + +// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js +var require_gopd = __commonJS({ + "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports2, module2) { + "use strict"; + var $gOPD = require_gOPD(); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e) { + $gOPD = null; + } + } + module2.exports = $gOPD; + } +}); + +// node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js +var require_es_define_property = __commonJS({ + "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports2, module2) { + "use strict"; + var $defineProperty = Object.defineProperty || false; + if ($defineProperty) { + try { + $defineProperty({}, "a", { value: 1 }); + } catch (e) { + $defineProperty = false; + } + } + module2.exports = $defineProperty; + } +}); + +// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js +var require_shams = __commonJS({ + "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports2, module2) { + "use strict"; + module2.exports = function hasSymbols() { + if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { + return false; + } + if (typeof Symbol.iterator === "symbol") { + return true; + } + var obj = {}; + var sym = Symbol("test"); + var symObj = Object(sym); + if (typeof sym === "string") { + return false; + } + if (Object.prototype.toString.call(sym) !== "[object Symbol]") { + return false; + } + if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { + return false; + } + var symVal = 42; + obj[sym] = symVal; + for (var _ in obj) { + return false; + } + if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { + return false; + } + if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + if (typeof Object.getOwnPropertyDescriptor === "function") { + var descriptor = ( + /** @type {PropertyDescriptor} */ + Object.getOwnPropertyDescriptor(obj, sym) + ); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + return true; + }; + } +}); + +// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js +var require_has_symbols = __commonJS({ + "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports2, module2) { + "use strict"; + var origSymbol = typeof Symbol !== "undefined" && Symbol; + var hasSymbolSham = require_shams(); + module2.exports = function hasNativeSymbols() { + if (typeof origSymbol !== "function") { + return false; + } + if (typeof Symbol !== "function") { + return false; + } + if (typeof origSymbol("foo") !== "symbol") { + return false; + } + if (typeof Symbol("bar") !== "symbol") { + return false; + } + return hasSymbolSham(); + }; + } +}); + +// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js +var require_Reflect_getPrototypeOf = __commonJS({ + "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2, module2) { + "use strict"; + module2.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null; + } +}); + +// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js +var require_Object_getPrototypeOf = __commonJS({ + "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports2, module2) { + "use strict"; + var $Object = require_es_object_atoms(); + module2.exports = $Object.getPrototypeOf || null; + } +}); + +// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js +var require_implementation = __commonJS({ + "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module2) { + "use strict"; + var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; + var toStr = Object.prototype.toString; + var max = Math.max; + var funcType = "[object Function]"; + var concatty = function concatty2(a, b) { + var arr = []; + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + return arr; + }; + var slicy = function slicy2(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; + }; + var joiny = function(arr, joiner) { + var str = ""; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; + }; + module2.exports = function bind(that) { + var target = this; + if (typeof target !== "function" || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + var bound; + var binder = function() { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); + }; + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs[i] = "$" + i; + } + bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); + if (target.prototype) { + var Empty = function Empty2() { + }; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; + } +}); + +// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js +var require_function_bind = __commonJS({ + "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module2) { + "use strict"; + var implementation = require_implementation(); + module2.exports = Function.prototype.bind || implementation; + } +}); + +// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js +var require_functionCall = __commonJS({ + "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports2, module2) { + "use strict"; + module2.exports = Function.prototype.call; + } +}); + +// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js +var require_functionApply = __commonJS({ + "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports2, module2) { + "use strict"; + module2.exports = Function.prototype.apply; + } +}); + +// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js +var require_reflectApply = __commonJS({ + "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports2, module2) { + "use strict"; + module2.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply; + } +}); + +// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js +var require_actualApply = __commonJS({ + "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports2, module2) { + "use strict"; + var bind = require_function_bind(); + var $apply = require_functionApply(); + var $call = require_functionCall(); + var $reflectApply = require_reflectApply(); + module2.exports = $reflectApply || bind.call($call, $apply); + } +}); + +// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js +var require_call_bind_apply_helpers = __commonJS({ + "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports2, module2) { + "use strict"; + var bind = require_function_bind(); + var $TypeError = require_type(); + var $call = require_functionCall(); + var $actualApply = require_actualApply(); + module2.exports = function callBindBasic(args) { + if (args.length < 1 || typeof args[0] !== "function") { + throw new $TypeError("a function is required"); + } + return $actualApply(bind, $call, args); + }; + } +}); + +// node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js +var require_get = __commonJS({ + "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports2, module2) { + "use strict"; + var callBind = require_call_bind_apply_helpers(); + var gOPD = require_gopd(); + var hasProtoAccessor; + try { + hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ + [].__proto__ === Array.prototype; + } catch (e) { + if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") { + throw e; + } + } + var desc = !!hasProtoAccessor && gOPD && gOPD( + Object.prototype, + /** @type {keyof typeof Object.prototype} */ + "__proto__" + ); + var $Object = Object; + var $getPrototypeOf = $Object.getPrototypeOf; + module2.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? ( + /** @type {import('./get')} */ + function getDunder(value) { + return $getPrototypeOf(value == null ? value : $Object(value)); + } + ) : false; + } +}); + +// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js +var require_get_proto = __commonJS({ + "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports2, module2) { + "use strict"; + var reflectGetProto = require_Reflect_getPrototypeOf(); + var originalGetProto = require_Object_getPrototypeOf(); + var getDunderProto = require_get(); + module2.exports = reflectGetProto ? function getProto(O) { + return reflectGetProto(O); + } : originalGetProto ? function getProto(O) { + if (!O || typeof O !== "object" && typeof O !== "function") { + throw new TypeError("getProto: not an object"); + } + return originalGetProto(O); + } : getDunderProto ? function getProto(O) { + return getDunderProto(O); + } : null; + } +}); + +// node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js +var require_hasown = __commonJS({ + "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports2, module2) { + "use strict"; + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; + var bind = require_function_bind(); + module2.exports = bind.call(call, $hasOwn); + } +}); + +// node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js +var require_get_intrinsic = __commonJS({ + "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(exports2, module2) { + "use strict"; + var undefined2; + var $Object = require_es_object_atoms(); + var $Error = require_es_errors(); + var $EvalError = require_eval(); + var $RangeError = require_range(); + var $ReferenceError = require_ref(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var $URIError = require_uri(); + var abs = require_abs(); + var floor = require_floor(); + var max = require_max(); + var min = require_min(); + var pow = require_pow(); + var round = require_round(); + var sign = require_sign(); + var $Function = Function; + var getEvalledConstructor = function(expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); + } catch (e) { + } + }; + var $gOPD = require_gopd(); + var $defineProperty = require_es_define_property(); + var throwTypeError = function() { + throw new $TypeError(); + }; + var ThrowTypeError = $gOPD ? function() { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, "callee").get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }() : throwTypeError; + var hasSymbols = require_has_symbols()(); + var getProto = require_get_proto(); + var $ObjectGPO = require_Object_getPrototypeOf(); + var $ReflectGPO = require_Reflect_getPrototypeOf(); + var $apply = require_functionApply(); + var $call = require_functionCall(); + var needsEval = {}; + var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); + var INTRINSICS = { + __proto__: null, + "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, + "%Array%": Array, + "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, + "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, + "%AsyncFromSyncIteratorPrototype%": undefined2, + "%AsyncFunction%": needsEval, + "%AsyncGenerator%": needsEval, + "%AsyncGeneratorFunction%": needsEval, + "%AsyncIteratorPrototype%": needsEval, + "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, + "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, + "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, + "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, + "%Boolean%": Boolean, + "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, + "%Date%": Date, + "%decodeURI%": decodeURI, + "%decodeURIComponent%": decodeURIComponent, + "%encodeURI%": encodeURI, + "%encodeURIComponent%": encodeURIComponent, + "%Error%": $Error, + "%eval%": eval, + // eslint-disable-line no-eval + "%EvalError%": $EvalError, + "%Float16Array%": typeof Float16Array === "undefined" ? undefined2 : Float16Array, + "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, + "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, + "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, + "%Function%": $Function, + "%GeneratorFunction%": needsEval, + "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, + "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, + "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, + "%isFinite%": isFinite, + "%isNaN%": isNaN, + "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, + "%JSON%": typeof JSON === "object" ? JSON : undefined2, + "%Map%": typeof Map === "undefined" ? undefined2 : Map, + "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), + "%Math%": Math, + "%Number%": Number, + "%Object%": $Object, + "%Object.getOwnPropertyDescriptor%": $gOPD, + "%parseFloat%": parseFloat, + "%parseInt%": parseInt, + "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, + "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, + "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, + "%RegExp%": RegExp, + "%Set%": typeof Set === "undefined" ? undefined2 : Set, + "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), + "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, + "%String%": String, + "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, + "%Symbol%": hasSymbols ? Symbol : undefined2, + "%SyntaxError%": $SyntaxError, + "%ThrowTypeError%": ThrowTypeError, + "%TypedArray%": TypedArray, + "%TypeError%": $TypeError, + "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, + "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, + "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, + "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, + "%URIError%": $URIError, + "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, + "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, + "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, + "%Function.prototype.call%": $call, + "%Function.prototype.apply%": $apply, + "%Object.defineProperty%": $defineProperty, + "%Object.getPrototypeOf%": $ObjectGPO, + "%Math.abs%": abs, + "%Math.floor%": floor, + "%Math.max%": max, + "%Math.min%": min, + "%Math.pow%": pow, + "%Math.round%": round, + "%Math.sign%": sign, + "%Reflect.getPrototypeOf%": $ReflectGPO + }; + if (getProto) { + try { + null.error; + } catch (e) { + errorProto = getProto(getProto(e)); + INTRINSICS["%Error.prototype%"] = errorProto; + } + } + var errorProto; + var doEval = function doEval2(name) { + var value; + if (name === "%AsyncFunction%") { + value = getEvalledConstructor("async function () {}"); + } else if (name === "%GeneratorFunction%") { + value = getEvalledConstructor("function* () {}"); + } else if (name === "%AsyncGeneratorFunction%") { + value = getEvalledConstructor("async function* () {}"); + } else if (name === "%AsyncGenerator%") { + var fn = doEval2("%AsyncGeneratorFunction%"); + if (fn) { + value = fn.prototype; + } + } else if (name === "%AsyncIteratorPrototype%") { + var gen = doEval2("%AsyncGenerator%"); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + INTRINSICS[name] = value; + return value; + }; + var LEGACY_ALIASES = { + __proto__: null, + "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], + "%ArrayPrototype%": ["Array", "prototype"], + "%ArrayProto_entries%": ["Array", "prototype", "entries"], + "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], + "%ArrayProto_keys%": ["Array", "prototype", "keys"], + "%ArrayProto_values%": ["Array", "prototype", "values"], + "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], + "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], + "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], + "%BooleanPrototype%": ["Boolean", "prototype"], + "%DataViewPrototype%": ["DataView", "prototype"], + "%DatePrototype%": ["Date", "prototype"], + "%ErrorPrototype%": ["Error", "prototype"], + "%EvalErrorPrototype%": ["EvalError", "prototype"], + "%Float32ArrayPrototype%": ["Float32Array", "prototype"], + "%Float64ArrayPrototype%": ["Float64Array", "prototype"], + "%FunctionPrototype%": ["Function", "prototype"], + "%Generator%": ["GeneratorFunction", "prototype"], + "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], + "%Int8ArrayPrototype%": ["Int8Array", "prototype"], + "%Int16ArrayPrototype%": ["Int16Array", "prototype"], + "%Int32ArrayPrototype%": ["Int32Array", "prototype"], + "%JSONParse%": ["JSON", "parse"], + "%JSONStringify%": ["JSON", "stringify"], + "%MapPrototype%": ["Map", "prototype"], + "%NumberPrototype%": ["Number", "prototype"], + "%ObjectPrototype%": ["Object", "prototype"], + "%ObjProto_toString%": ["Object", "prototype", "toString"], + "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], + "%PromisePrototype%": ["Promise", "prototype"], + "%PromiseProto_then%": ["Promise", "prototype", "then"], + "%Promise_all%": ["Promise", "all"], + "%Promise_reject%": ["Promise", "reject"], + "%Promise_resolve%": ["Promise", "resolve"], + "%RangeErrorPrototype%": ["RangeError", "prototype"], + "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], + "%RegExpPrototype%": ["RegExp", "prototype"], + "%SetPrototype%": ["Set", "prototype"], + "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], + "%StringPrototype%": ["String", "prototype"], + "%SymbolPrototype%": ["Symbol", "prototype"], + "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], + "%TypedArrayPrototype%": ["TypedArray", "prototype"], + "%TypeErrorPrototype%": ["TypeError", "prototype"], + "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], + "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], + "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], + "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], + "%URIErrorPrototype%": ["URIError", "prototype"], + "%WeakMapPrototype%": ["WeakMap", "prototype"], + "%WeakSetPrototype%": ["WeakSet", "prototype"] + }; + var bind = require_function_bind(); + var hasOwn = require_hasown(); + var $concat = bind.call($call, Array.prototype.concat); + var $spliceApply = bind.call($apply, Array.prototype.splice); + var $replace = bind.call($call, String.prototype.replace); + var $strSlice = bind.call($call, String.prototype.slice); + var $exec = bind.call($call, RegExp.prototype.exec); + var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + var reEscapeChar = /\\(\\)?/g; + var stringToPath = function stringToPath2(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === "%" && last !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); + } else if (last === "%" && first !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); + } + var result = []; + $replace(string, rePropName, function(match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; + }); + return result; + }; + var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = "%" + alias[0] + "%"; + } + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === "undefined" && !allowMissing) { + throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); + } + return { + alias, + name: intrinsicName, + value + }; + } + throw new $SyntaxError("intrinsic " + name + " does not exist!"); + }; + module2.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== "string" || name.length === 0) { + throw new $TypeError("intrinsic name must be a non-empty string"); + } + if (arguments.length > 1 && typeof allowMissing !== "boolean") { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; + var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { + throw new $SyntaxError("property names with quotes must have matching quotes"); + } + if (part === "constructor" || !isOwn) { + skipFurtherCaching = true; + } + intrinsicBaseName += "." + part; + intrinsicRealName = "%" + intrinsicBaseName + "%"; + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); + } + return void 0; + } + if ($gOPD && i + 1 >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + if (isOwn && "get" in desc && !("originalValue" in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; + }; + } +}); + +// node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js +var require_shams2 = __commonJS({ + "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports2, module2) { + "use strict"; + var hasSymbols = require_shams(); + module2.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; + }; + } +}); + +// node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js +var require_es_set_tostringtag = __commonJS({ + "node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js"(exports2, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); + var hasToStringTag = require_shams2()(); + var hasOwn = require_hasown(); + var $TypeError = require_type(); + var toStringTag = hasToStringTag ? Symbol.toStringTag : null; + module2.exports = function setToStringTag(object, value) { + var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; + var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; + if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") { + throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans"); + } + if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { + if ($defineProperty) { + $defineProperty(object, toStringTag, { + configurable: !nonConfigurable, + enumerable: false, + value, + writable: false + }); + } else { + object[toStringTag] = value; + } + } + }; + } +}); + +// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js +var require_populate = __commonJS({ + "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js"(exports2, module2) { + "use strict"; + module2.exports = function(dst, src) { + Object.keys(src).forEach(function(prop) { + dst[prop] = dst[prop] || src[prop]; + }); + return dst; + }; + } +}); + +// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js +var require_form_data = __commonJS({ + "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js"(exports2, module2) { + "use strict"; + var CombinedStream = require_combined_stream(); + var util = require("util"); + var path2 = require("path"); + var http = require("http"); + var https = require("https"); + var parseUrl = require("url").parse; + var fs2 = require("fs"); + var Stream = require("stream").Stream; + var crypto = require("crypto"); + var mime = require_mime_types(); + var asynckit = require_asynckit(); + var setToStringTag = require_es_set_tostringtag(); + var hasOwn = require_hasown(); + var populate = require_populate(); + function FormData2(options) { + if (!(this instanceof FormData2)) { + return new FormData2(options); + } + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; + CombinedStream.call(this); + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } + } + util.inherits(FormData2, CombinedStream); + FormData2.LINE_BREAK = "\r\n"; + FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; + FormData2.prototype.append = function(field, value, options) { + options = options || {}; + if (typeof options === "string") { + options = { filename: options }; + } + var append = CombinedStream.prototype.append.bind(this); + if (typeof value === "number" || value == null) { + value = String(value); + } + if (Array.isArray(value)) { + this._error(new Error("Arrays are not supported.")); + return; + } + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); + append(header); + append(value); + append(footer); + this._trackLength(header, value, options); + }; + FormData2.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + if (options.knownLength != null) { + valueLength += Number(options.knownLength); + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === "string") { + valueLength = Buffer.byteLength(value); + } + this._valueLength += valueLength; + this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; + if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) { + return; + } + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } + }; + FormData2.prototype._lengthRetriever = function(value, callback) { + if (hasOwn(value, "fd")) { + if (value.end != void 0 && value.end != Infinity && value.start != void 0) { + callback(null, value.end + 1 - (value.start ? value.start : 0)); + } else { + fs2.stat(value.path, function(err, stat) { + if (err) { + callback(err); + return; + } + var fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } + } else if (hasOwn(value, "httpVersion")) { + callback(null, Number(value.headers["content-length"])); + } else if (hasOwn(value, "httpModule")) { + value.on("response", function(response) { + value.pause(); + callback(null, Number(response.headers["content-length"])); + }); + value.resume(); + } else { + callback("Unknown stream"); + } + }; + FormData2.prototype._multiPartHeader = function(field, value, options) { + if (typeof options.header === "string") { + return options.header; + } + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); + var contents = ""; + var headers = { + // add custom disposition as third element or keep it two elements if not + "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + "Content-Type": [].concat(contentType || []) + }; + if (typeof options.header === "object") { + populate(headers, options.header); + } + var header; + for (var prop in headers) { + if (hasOwn(headers, prop)) { + header = headers[prop]; + if (header == null) { + continue; + } + if (!Array.isArray(header)) { + header = [header]; + } + if (header.length) { + contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK; + } + } + } + return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; + }; + FormData2.prototype._getContentDisposition = function(value, options) { + var filename; + if (typeof options.filepath === "string") { + filename = path2.normalize(options.filepath).replace(/\\/g, "/"); + } else if (options.filename || value && (value.name || value.path)) { + filename = path2.basename(options.filename || value && (value.name || value.path)); + } else if (value && value.readable && hasOwn(value, "httpVersion")) { + filename = path2.basename(value.client._httpMessage.path || ""); + } + if (filename) { + return 'filename="' + filename + '"'; + } + }; + FormData2.prototype._getContentType = function(value, options) { + var contentType = options.contentType; + if (!contentType && value && value.name) { + contentType = mime.lookup(value.name); + } + if (!contentType && value && value.path) { + contentType = mime.lookup(value.path); + } + if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) { + contentType = value.headers["content-type"]; + } + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } + if (!contentType && value && typeof value === "object") { + contentType = FormData2.DEFAULT_CONTENT_TYPE; + } + return contentType; + }; + FormData2.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData2.LINE_BREAK; + var lastPart = this._streams.length === 0; + if (lastPart) { + footer += this._lastBoundary(); + } + next(footer); + }.bind(this); + }; + FormData2.prototype._lastBoundary = function() { + return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK; + }; + FormData2.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + "content-type": "multipart/form-data; boundary=" + this.getBoundary() + }; + for (header in userHeaders) { + if (hasOwn(userHeaders, header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } + return formHeaders; + }; + FormData2.prototype.setBoundary = function(boundary) { + if (typeof boundary !== "string") { + throw new TypeError("FormData boundary must be a string"); + } + this._boundary = boundary; + }; + FormData2.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + return this._boundary; + }; + FormData2.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc(0); + var boundary = this.getBoundary(); + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== "function") { + if (Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); + } else { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); + } + if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]); + } + } + } + return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); + }; + FormData2.prototype._generateBoundary = function() { + this._boundary = "--------------------------" + crypto.randomBytes(12).toString("hex"); + }; + FormData2.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + if (!this.hasKnownLength()) { + this._error(new Error("Cannot calculate proper length in synchronous way.")); + } + return knownLength; + }; + FormData2.prototype.hasKnownLength = function() { + var hasKnownLength = true; + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } + return hasKnownLength; + }; + FormData2.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } + values.forEach(function(length) { + knownLength += length; + }); + cb(null, knownLength); + }); + }; + FormData2.prototype.submit = function(params, cb) { + var request; + var options; + var defaults = { method: "post" }; + if (typeof params === "string") { + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + } else { + options = populate(params, defaults); + if (!options.port) { + options.port = options.protocol === "https:" ? 443 : 80; + } + } + options.headers = this.getHeaders(params.headers); + if (options.protocol === "https:") { + request = https.request(options); + } else { + request = http.request(options); + } + this.getLength(function(err, length) { + if (err && err !== "Unknown stream") { + this._error(err); + return; + } + if (length) { + request.setHeader("Content-Length", length); + } + this.pipe(request); + if (cb) { + var onResponse; + var callback = function(error, responce) { + request.removeListener("error", callback); + request.removeListener("response", onResponse); + return cb.call(this, error, responce); + }; + onResponse = callback.bind(this, null); + request.on("error", callback); + request.on("response", onResponse); + } + }.bind(this)); + return request; + }; + FormData2.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit("error", err); + } + }; + FormData2.prototype.toString = function() { + return "[object FormData]"; + }; + setToStringTag(FormData2, "FormData"); + module2.exports = FormData2; + } +}); + +// node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js +var require_proxy_from_env = __commonJS({ + "node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"(exports2) { + "use strict"; + var parseUrl = require("url").parse; + var DEFAULT_PORTS = { + ftp: 21, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 + }; + var stringEndsWith = String.prototype.endsWith || function(s) { + return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; + }; + function getProxyForUrl(url) { + var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {}; + var proto = parsedUrl.protocol; + var hostname = parsedUrl.host; + var port = parsedUrl.port; + if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { + return ""; + } + proto = proto.split(":", 1)[0]; + hostname = hostname.replace(/:\d*$/, ""); + port = parseInt(port) || DEFAULT_PORTS[proto] || 0; + if (!shouldProxy(hostname, port)) { + return ""; + } + var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); + if (proxy && proxy.indexOf("://") === -1) { + proxy = proto + "://" + proxy; + } + return proxy; + } + function shouldProxy(hostname, port) { + var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); + if (!NO_PROXY) { + return true; + } + if (NO_PROXY === "*") { + return false; + } + return NO_PROXY.split(/[,\s]/).every(function(proxy) { + if (!proxy) { + return true; + } + var parsedProxy = proxy.match(/^(.+):(\d+)$/); + var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; + var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; + if (parsedProxyPort && parsedProxyPort !== port) { + return true; + } + if (!/^[.*]/.test(parsedProxyHostname)) { + return hostname !== parsedProxyHostname; + } + if (parsedProxyHostname.charAt(0) === "*") { + parsedProxyHostname = parsedProxyHostname.slice(1); + } + return !stringEndsWith.call(hostname, parsedProxyHostname); + }); + } + function getEnv(key) { + return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; + } + exports2.getProxyForUrl = getProxyForUrl; + } +}); + +// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js +var require_debug2 = __commonJS({ + "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js"(exports2, module2) { + var debug; + module2.exports = function() { + if (!debug) { + try { + debug = require_src()("follow-redirects"); + } catch (error) { + } + if (typeof debug !== "function") { + debug = function() { + }; + } + } + debug.apply(null, arguments); + }; + } +}); + +// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js +var require_follow_redirects = __commonJS({ + "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js"(exports2, module2) { + var url = require("url"); + var URL2 = url.URL; + var http = require("http"); + var https = require("https"); + var Writable = require("stream").Writable; + var assert = require("assert"); + var debug = require_debug2(); + (function detectUnsupportedEnvironment() { + var looksLikeNode = typeof process !== "undefined"; + var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var looksLikeV8 = isFunction(Error.captureStackTrace); + if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { + console.warn("The follow-redirects package should be excluded from browser builds."); + } + })(); + var useNativeURL = false; + try { + assert(new URL2("")); + } catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; + } + var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash" + ]; + var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; + var eventHandlers = /* @__PURE__ */ Object.create(null); + events.forEach(function(event) { + eventHandlers[event] = function(arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; + }); + var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError + ); + var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" + ); + var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded", + RedirectionError + ); + var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" + ); + var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" + ); + var destroy = Writable.prototype.destroy || noop; + function RedirectableRequest(options, responseCallback) { + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; + if (responseCallback) { + this.on("response", responseCallback); + } + var self2 = this; + this._onNativeResponse = function(response) { + try { + self2._processResponse(response); + } catch (cause) { + self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); + } + }; + this._performRequest(); + } + RedirectableRequest.prototype = Object.create(Writable.prototype); + RedirectableRequest.prototype.abort = function() { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); + }; + RedirectableRequest.prototype.destroy = function(error) { + destroyRequest(this._currentRequest, error); + destroy.call(this, error); + return this; + }; + RedirectableRequest.prototype.write = function(data, encoding, callback) { + if (this._ending) { + throw new WriteAfterEndError(); + } + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + if (data.length === 0) { + if (callback) { + callback(); + } + return; + } + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data, encoding }); + this._currentRequest.write(data, encoding, callback); + } else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } + }; + RedirectableRequest.prototype.end = function(data, encoding, callback) { + if (isFunction(data)) { + callback = data; + data = encoding = null; + } else if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } else { + var self2 = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function() { + self2._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } + }; + RedirectableRequest.prototype.setHeader = function(name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); + }; + RedirectableRequest.prototype.removeHeader = function(name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); + }; + RedirectableRequest.prototype.setTimeout = function(msecs, callback) { + var self2 = this; + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + function startTimer(socket) { + if (self2._timeout) { + clearTimeout(self2._timeout); + } + self2._timeout = setTimeout(function() { + self2.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } + function clearTimer() { + if (self2._timeout) { + clearTimeout(self2._timeout); + self2._timeout = null; + } + self2.removeListener("abort", clearTimer); + self2.removeListener("error", clearTimer); + self2.removeListener("response", clearTimer); + self2.removeListener("close", clearTimer); + if (callback) { + self2.removeListener("timeout", callback); + } + if (!self2.socket) { + self2._currentRequest.removeListener("socket", startTimer); + } + } + if (callback) { + this.on("timeout", callback); + } + if (this.socket) { + startTimer(this.socket); + } else { + this._currentRequest.once("socket", startTimer); + } + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + this.on("close", clearTimer); + return this; + }; + [ + "flushHeaders", + "getHeader", + "setNoDelay", + "setSocketKeepAlive" + ].forEach(function(method) { + RedirectableRequest.prototype[method] = function(a, b) { + return this._currentRequest[method](a, b); + }; + }); + ["aborted", "connection", "socket"].forEach(function(property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function() { + return this._currentRequest[property]; + } + }); + }); + RedirectableRequest.prototype._sanitizeOptions = function(options) { + if (!options.headers) { + options.headers = {}; + } + if (options.host) { + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; + } + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } + }; + RedirectableRequest.prototype._performRequest = function() { + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); + } + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } + var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } + this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : ( + // When making a request to a proxy, [โ€ฆ] + // a client MUST send the target URI in absolute-form [โ€ฆ]. + this._options.path + ); + if (this._isRedirect) { + var i = 0; + var self2 = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + if (request === self2._currentRequest) { + if (error) { + self2.emit("error", error); + } else if (i < buffers.length) { + var buffer = buffers[i++]; + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } else if (self2._ended) { + request.end(); + } + } + })(); + } + }; + RedirectableRequest.prototype._processResponse = function(response) { + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode + }); + } + var location = response.headers.location; + if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); + this._requestBodyBuffers = []; + return; + } + destroyRequest(this._currentRequest); + response.destroy(); + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); + } + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host") + }, this._options.headers); + } + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231ยง6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource [โ€ฆ] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) [โ€ฆ] + statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + var currentUrlParts = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); + this._isRedirect = true; + spreadUrlObject(redirectUrl, this._options); + if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { + removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); + } + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode + }; + var requestDetails = { + url: currentUrl, + method, + headers: requestHeaders + }; + beforeRedirect(this._options, responseDetails, requestDetails); + this._sanitizeOptions(this._options); + } + this._performRequest(); + }; + function wrap(protocols) { + var exports3 = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024 + }; + var nativeProtocols = {}; + Object.keys(protocols).forEach(function(scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); + function request(input, options, callback) { + if (isURL(input)) { + input = spreadUrlObject(input); + } else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } else { + callback = options; + options = validateUrl(input); + input = { protocol }; + } + if (isFunction(options)) { + callback = options; + options = null; + } + options = Object.assign({ + maxRedirects: exports3.maxRedirects, + maxBodyLength: exports3.maxBodyLength + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; + } + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true } + }); + }); + return exports3; + } + function noop() { + } + function parseUrl(input) { + var parsed; + if (useNativeURL) { + parsed = new URL2(input); + } else { + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } + } + return parsed; + } + function resolveUrl(relative, base) { + return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); + } + function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); + } + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; + } + function spreadUrlObject(urlObject, target) { + var spread = target || {}; + for (var key of preservedUrlFields) { + spread[key] = urlObject[key]; + } + if (spread.hostname.startsWith("[")) { + spread.hostname = spread.hostname.slice(1, -1); + } + if (spread.port !== "") { + spread.port = Number(spread.port); + } + spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; + return spread; + } + function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); + } + function createErrorType(code, message, baseClass) { + function CustomError(properties) { + if (isFunction(Error.captureStackTrace)) { + Error.captureStackTrace(this, this.constructor); + } + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; + } + CustomError.prototype = new (baseClass || Error)(); + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false + }, + name: { + value: "Error [" + code + "]", + enumerable: false + } + }); + return CustomError; + } + function destroyRequest(request, error) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error); + } + function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); + } + function isString(value) { + return typeof value === "string" || value instanceof String; + } + function isFunction(value) { + return typeof value === "function"; + } + function isBuffer(value) { + return typeof value === "object" && "length" in value; + } + function isURL(value) { + return URL2 && value instanceof URL2; + } + module2.exports = wrap({ http, https }); + module2.exports.wrap = wrap; + } +}); + +// node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs +var require_axios = __commonJS({ + "node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs"(exports2, module2) { + "use strict"; + var FormData$1 = require_form_data(); + var crypto = require("crypto"); + var url = require("url"); + var http2 = require("http2"); + var proxyFromEnv = require_proxy_from_env(); + var http = require("http"); + var https = require("https"); + var util = require("util"); + var followRedirects = require_follow_redirects(); + var zlib = require("zlib"); + var stream = require("stream"); + var events = require("events"); + function _interopDefaultLegacy(e) { + return e && typeof e === "object" && "default" in e ? e : { "default": e }; + } + var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1); + var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto); + var url__default = /* @__PURE__ */ _interopDefaultLegacy(url); + var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv); + var http__default = /* @__PURE__ */ _interopDefaultLegacy(http); + var https__default = /* @__PURE__ */ _interopDefaultLegacy(https); + var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); + var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects); + var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib); + var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream); + function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; + } + var { toString } = Object.prototype; + var { getPrototypeOf } = Object; + var { iterator, toStringTag } = Symbol; + var kindOf = /* @__PURE__ */ ((cache) => (thing) => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); + })(/* @__PURE__ */ Object.create(null)); + var kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type; + }; + var typeOfTest = (type) => (thing) => typeof thing === type; + var { isArray } = Array; + var isUndefined = typeOfTest("undefined"); + function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); + } + var isArrayBuffer = kindOfTest("ArrayBuffer"); + function isArrayBufferView(val) { + let result; + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && isArrayBuffer(val.buffer); + } + return result; + } + var isString = typeOfTest("string"); + var isFunction$1 = typeOfTest("function"); + var isNumber = typeOfTest("number"); + var isObject = (thing) => thing !== null && typeof thing === "object"; + var isBoolean = (thing) => thing === true || thing === false; + var isPlainObject = (val) => { + if (kindOf(val) !== "object") { + return false; + } + const prototype2 = getPrototypeOf(val); + return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val); + }; + var isEmptyObject = (val) => { + if (!isObject(val) || isBuffer(val)) { + return false; + } + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + return false; + } + }; + var isDate = kindOfTest("Date"); + var isFile = kindOfTest("File"); + var isBlob = kindOfTest("Blob"); + var isFileList = kindOfTest("FileList"); + var isStream = (val) => isObject(val) && isFunction$1(val.pipe); + var isFormData = (thing) => { + let kind; + return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance + kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); + }; + var isURLSearchParams = kindOfTest("URLSearchParams"); + var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); + var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); + function forEach(obj, fn, { allOwnKeys = false } = {}) { + if (obj === null || typeof obj === "undefined") { + return; + } + let i; + let l; + if (typeof obj !== "object") { + obj = [obj]; + } + if (isArray(obj)) { + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + if (isBuffer(obj)) { + return; + } + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } + } + function findKey(obj, key) { + if (isBuffer(obj)) { + return null; + } + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; + } + var _global = (() => { + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; + })(); + var isContextDefined = (context) => !isUndefined(context) && context !== _global; + function merge() { + const { caseless, skipUndefined } = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else if (!skipUndefined || !isUndefined(val)) { + result[targetKey] = val; + } + }; + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; + } + var extend = (a, b, thisArg, { allOwnKeys } = {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction$1(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, { allOwnKeys }); + return a; + }; + var stripBOM = (content) => { + if (content.charCodeAt(0) === 65279) { + content = content.slice(1); + } + return content; + }; + var inherits = (constructor, superConstructor, props, descriptors2) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors2); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, "super", { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); + }; + var toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + destObj = destObj || {}; + if (sourceObj == null) return destObj; + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + return destObj; + }; + var endsWith = (str, searchString, position) => { + str = String(str); + if (position === void 0 || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; + var toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; + }; + var isTypedArray = /* @__PURE__ */ ((TypedArray) => { + return (thing) => { + return TypedArray && thing instanceof TypedArray; + }; + })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); + var forEachEntry = (obj, fn) => { + const generator = obj && obj[iterator]; + const _iterator = generator.call(obj); + let result; + while ((result = _iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } + }; + var matchAll = (regExp, str) => { + let matches; + const arr = []; + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + return arr; + }; + var isHTMLForm = kindOfTest("HTMLFormElement"); + var toCamelCase = (str) => { + return str.toLowerCase().replace( + /[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); + }; + var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); + var isRegExp = kindOfTest("RegExp"); + var reduceDescriptors = (obj, reducer) => { + const descriptors2 = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + forEach(descriptors2, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + Object.defineProperties(obj, reducedDescriptors); + }; + var freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { + return false; + } + const value = obj[name]; + if (!isFunction$1(value)) return; + descriptor.enumerable = false; + if ("writable" in descriptor) { + descriptor.writable = false; + return; + } + if (!descriptor.set) { + descriptor.set = () => { + throw Error("Can not rewrite read-only method '" + name + "'"); + }; + } + }); + }; + var toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + const define = (arr) => { + arr.forEach((value) => { + obj[value] = true; + }); + }; + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + return obj; + }; + var noop = () => { + }; + var toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; + }; + function isSpecCompliantForm(thing) { + return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); + } + var toJSONObject = (obj) => { + const stack = new Array(10); + const visit = (source, i) => { + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + if (isBuffer(source)) { + return source; + } + if (!("toJSON" in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + stack[i] = void 0; + return target; + } + } + return source; + }; + return visit(obj, 0); + }; + var isAsyncFn = kindOfTest("AsyncFunction"); + var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); + var _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({ source, data }) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + }; + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); + })( + typeof setImmediate === "function", + isFunction$1(_global.postMessage) + ); + var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; + var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); + var utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isEmptyObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction: isFunction$1, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, + // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap, + isIterable + }; + function AxiosError(message, code, config, request, response) { + Error.call(this); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack; + } + this.message = message; + this.name = "AxiosError"; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } + } + utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.status + }; + } + }); + var prototype$1 = AxiosError.prototype; + var descriptors = {}; + [ + "ERR_BAD_OPTION_VALUE", + "ERR_BAD_OPTION", + "ECONNABORTED", + "ETIMEDOUT", + "ERR_NETWORK", + "ERR_FR_TOO_MANY_REDIRECTS", + "ERR_DEPRECATED", + "ERR_BAD_RESPONSE", + "ERR_BAD_REQUEST", + "ERR_CANCELED", + "ERR_NOT_SUPPORT", + "ERR_INVALID_URL" + // eslint-disable-next-line func-names + ].forEach((code) => { + descriptors[code] = { value: code }; + }); + Object.defineProperties(AxiosError, descriptors); + Object.defineProperty(prototype$1, "isAxiosError", { value: true }); + AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, (prop) => { + return prop !== "isAxiosError"; + }); + const msg = error && error.message ? error.message : "Error"; + const errCode = code == null && error ? error.code : code; + AxiosError.call(axiosError, msg, errCode, config, request, response); + if (error && axiosError.cause == null) { + Object.defineProperty(axiosError, "cause", { value: error, configurable: true }); + } + axiosError.name = error && error.name || "Error"; + customProps && Object.assign(axiosError, customProps); + return axiosError; + }; + function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); + } + function removeBrackets(key) { + return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key; + } + function renderKey(path2, key, dots) { + if (!path2) return key; + return path2.concat(key).map(function each(token, i) { + token = removeBrackets(token); + return !dots && i ? "[" + token + "]" : token; + }).join(dots ? "." : ""); + } + function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); + } + var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); + }); + function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError("target must be an object"); + } + formData = formData || new (FormData__default["default"] || FormData)(); + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + return !utils$1.isUndefined(source[option]); + }); + const metaTokens = options.metaTokens; + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + if (!utils$1.isFunction(visitor)) { + throw new TypeError("visitor must be a function"); + } + function convertValue(value) { + if (value === null) return ""; + if (utils$1.isDate(value)) { + return value.toISOString(); + } + if (utils$1.isBoolean(value)) { + return value.toString(); + } + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError("Blob is not supported. Use a Buffer instead."); + } + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); + } + return value; + } + function defaultVisitor(value, key, path2) { + let arr = value; + if (value && !path2 && typeof value === "object") { + if (utils$1.endsWith(key, "{}")) { + key = metaTokens ? key : key.slice(0, -2); + value = JSON.stringify(value); + } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) { + key = removeBrackets(key); + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", + convertValue(el) + ); + }); + return false; + } + } + if (isVisitable(value)) { + return true; + } + formData.append(renderKey(path2, key, dots), convertValue(value)); + return false; + } + const stack = []; + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + function build(value, path2) { + if (utils$1.isUndefined(value)) return; + if (stack.indexOf(value) !== -1) { + throw Error("Circular reference detected in " + path2.join(".")); + } + stack.push(value); + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, + el, + utils$1.isString(key) ? key.trim() : key, + path2, + exposedHelpers + ); + if (result === true) { + build(el, path2 ? path2.concat(key) : [key]); + } + }); + stack.pop(); + } + if (!utils$1.isObject(obj)) { + throw new TypeError("data must be an object"); + } + build(obj); + return formData; + } + function encode$1(str) { + const charMap = { + "!": "%21", + "'": "%27", + "(": "%28", + ")": "%29", + "~": "%7E", + "%20": "+", + "%00": "\0" + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); + } + function AxiosURLSearchParams(params, options) { + this._pairs = []; + params && toFormData(params, this, options); + } + var prototype = AxiosURLSearchParams.prototype; + prototype.append = function append(name, value) { + this._pairs.push([name, value]); + }; + prototype.toString = function toString2(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + "=" + _encode(pair[1]); + }, "").join("&"); + }; + function encode(val) { + return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); + } + function buildURL(url2, params, options) { + if (!params) { + return url2; + } + const _encode = options && options.encode || encode; + if (utils$1.isFunction(options)) { + options = { + serialize: options + }; + } + const serializeFn = options && options.serialize; + let serializedParams; + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode); + } + if (serializedParams) { + const hashmarkIndex = url2.indexOf("#"); + if (hashmarkIndex !== -1) { + url2 = url2.slice(0, hashmarkIndex); + } + url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams; + } + return url2; + } + var InterceptorManager = class { + constructor() { + this.handlers = []; + } + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } + }; + var InterceptorManager$1 = InterceptorManager; + var transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }; + var URLSearchParams2 = url__default["default"].URLSearchParams; + var ALPHA = "abcdefghijklmnopqrstuvwxyz"; + var DIGIT = "0123456789"; + var ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT + }; + var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ""; + const { length } = alphabet; + const randomValues = new Uint32Array(size); + crypto__default["default"].randomFillSync(randomValues); + for (let i = 0; i < size; i++) { + str += alphabet[randomValues[i] % length]; + } + return str; + }; + var platform$1 = { + isNode: true, + classes: { + URLSearchParams: URLSearchParams2, + FormData: FormData__default["default"], + Blob: typeof Blob !== "undefined" && Blob || null + }, + ALPHABET, + generateString, + protocols: ["http", "https", "file", "data"] + }; + var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; + var _navigator = typeof navigator === "object" && navigator || void 0; + var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); + var hasStandardBrowserWebWorkerEnv = (() => { + return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; + })(); + var origin = hasBrowserEnv && window.location.href || "http://localhost"; + var utils = /* @__PURE__ */ Object.freeze({ + __proto__: null, + hasBrowserEnv, + hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv, + navigator: _navigator, + origin + }); + var platform = { + ...utils, + ...platform$1 + }; + function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), { + visitor: function(value, key, path2, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString("base64")); + return false; + } + return helpers.defaultVisitor.apply(this, arguments); + }, + ...options + }); + } + function parsePropPath(name) { + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { + return match[0] === "[]" ? "" : match[1] || match[0]; + }); + } + function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; + } + function formDataToJSON(formData) { + function buildPath(path2, value, target, index) { + let name = path2[index++]; + if (name === "__proto__") return true; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path2.length; + name = !name && utils$1.isArray(target) ? target.length : name; + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + return !isNumericKey; + } + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + const result = buildPath(path2, value, target[name], index); + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + return !isNumericKey; + } + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + return obj; + } + return null; + } + function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== "SyntaxError") { + throw e; + } + } + } + return (encoder || JSON.stringify)(rawValue); + } + var defaults = { + transitional: transitionalDefaults, + adapter: ["xhr", "http", "fetch"], + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ""; + const hasJSONContentType = contentType.indexOf("application/json") > -1; + const isObjectPayload = utils$1.isObject(data); + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + const isFormData2 = utils$1.isFormData(data); + if (isFormData2) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); + return data.toString(); + } + let isFileList2; + if (isObjectPayload) { + if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { + const _FormData = this.env && this.env.FormData; + return toFormData( + isFileList2 ? { "files[]": data } : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + if (isObjectPayload || hasJSONContentType) { + headers.setContentType("application/json", false); + return stringifySafely(data); + } + return data; + }], + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === "json"; + if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { + return data; + } + if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + try { + return JSON.parse(data, this.parseReviver); + } catch (e) { + if (strictJSONParsing) { + if (e.name === "SyntaxError") { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + return data; + }], + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + xsrfCookieName: "XSRF-TOKEN", + xsrfHeaderName: "X-XSRF-TOKEN", + maxContentLength: -1, + maxBodyLength: -1, + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { + common: { + "Accept": "application/json, text/plain, */*", + "Content-Type": void 0 + } + } + }; + utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { + defaults.headers[method] = {}; + }); + var defaults$1 = defaults; + var ignoreDuplicateOf = utils$1.toObjectSet([ + "age", + "authorization", + "content-length", + "content-type", + "etag", + "expires", + "from", + "host", + "if-modified-since", + "if-unmodified-since", + "last-modified", + "location", + "max-forwards", + "proxy-authorization", + "referer", + "retry-after", + "user-agent" + ]); + var parseHeaders = (rawHeaders) => { + const parsed = {}; + let key; + let val; + let i; + rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { + i = line.indexOf(":"); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + if (!key || parsed[key] && ignoreDuplicateOf[key]) { + return; + } + if (key === "set-cookie") { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; + } + }); + return parsed; + }; + var $internals = Symbol("internals"); + function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); + } + function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); + } + function parseTokens(str) { + const tokens = /* @__PURE__ */ Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + while (match = tokensRE.exec(str)) { + tokens[match[1]] = match[2]; + } + return tokens; + } + var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + if (isHeaderNameFilter) { + value = header; + } + if (!utils$1.isString(value)) return; + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } + } + function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); + } + function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(" " + header); + ["get", "set", "has"].forEach((methodName) => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); + } + var AxiosHeaders = class { + constructor(headers) { + headers && this.set(headers); + } + set(header, valueOrRewrite, rewrite) { + const self2 = this; + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + if (!lHeader) { + throw new Error("header name must be a non-empty string"); + } + const key = utils$1.findKey(self2, lHeader); + if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { + self2[key || _header] = normalizeValue(_value); + } + } + const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils$1.isArray(entry)) { + throw TypeError("Object iterator must return a key-value pair"); + } + obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; + } + setHeaders(obj, valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + return this; + } + get(header, parser) { + header = normalizeHeader(header); + if (header) { + const key = utils$1.findKey(this, header); + if (key) { + const value = this[key]; + if (!parser) { + return value; + } + if (parser === true) { + return parseTokens(value); + } + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + throw new TypeError("parser must be boolean|regexp|function"); + } + } + } + has(header, matcher) { + header = normalizeHeader(header); + if (header) { + const key = utils$1.findKey(this, header); + return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + return false; + } + delete(header, matcher) { + const self2 = this; + let deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + const key = utils$1.findKey(self2, _header); + if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { + delete self2[key]; + deleted = true; + } + } + } + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + return deleted; + } + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + while (i--) { + const key = keys[i]; + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + return deleted; + } + normalize(format) { + const self2 = this; + const headers = {}; + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + if (key) { + self2[key] = normalizeValue(value); + delete self2[header]; + return; + } + const normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) { + delete self2[header]; + } + self2[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + toJSON(asStrings) { + const obj = /* @__PURE__ */ Object.create(null); + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); + }); + return obj; + } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); + } + getSetCookie() { + return this.get("set-cookie") || []; + } + get [Symbol.toStringTag]() { + return "AxiosHeaders"; + } + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + static concat(first, ...targets) { + const computed = new this(first); + targets.forEach((target) => computed.set(target)); + return computed; + } + static accessor(header) { + const internals = this[$internals] = this[$internals] = { + accessors: {} + }; + const accessors = internals.accessors; + const prototype2 = this.prototype; + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype2, _header); + accessors[lHeader] = true; + } + } + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } + }; + AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); + utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + }; + }); + utils$1.freezeMethods(AxiosHeaders); + var AxiosHeaders$1 = AxiosHeaders; + function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$1.from(context.headers); + let data = context.data; + utils$1.forEach(fns, function transform2(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); + }); + headers.normalize(); + return data; + } + function isCancel(value) { + return !!(value && value.__CANCEL__); + } + function CanceledError(message, config, request) { + AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request); + this.name = "CanceledError"; + } + utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true + }); + function settle(resolve2, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve2(response); + } else { + reject(new AxiosError( + "Request failed with status code " + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } + } + function isAbsoluteURL(url2) { + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2); + } + function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; + } + function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { + let isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; + } + var VERSION = "1.13.1"; + function parseProtocol(url2) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2); + return match && match[1] || ""; + } + var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; + function fromDataURI(uri, asBlob, options) { + const _Blob = options && options.Blob || platform.classes.Blob; + const protocol = parseProtocol(uri); + if (asBlob === void 0 && _Blob) { + asBlob = true; + } + if (protocol === "data") { + uri = protocol.length ? uri.slice(protocol.length + 1) : uri; + const match = DATA_URL_PATTERN.exec(uri); + if (!match) { + throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL); + } + const mime = match[1]; + const isBase64 = match[2]; + const body = match[3]; + const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8"); + if (asBlob) { + if (!_Blob) { + throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT); + } + return new _Blob([buffer], { type: mime }); + } + return buffer; + } + throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT); + } + var kInternals = Symbol("internals"); + var AxiosTransformStream = class extends stream__default["default"].Transform { + constructor(options) { + options = utils$1.toFlatObject(options, { + maxRate: 0, + chunkSize: 64 * 1024, + minChunkSize: 100, + timeWindow: 500, + ticksRate: 2, + samplesCount: 15 + }, null, (prop, source) => { + return !utils$1.isUndefined(source[prop]); + }); + super({ + readableHighWaterMark: options.chunkSize + }); + const internals = this[kInternals] = { + timeWindow: options.timeWindow, + chunkSize: options.chunkSize, + maxRate: options.maxRate, + minChunkSize: options.minChunkSize, + bytesSeen: 0, + isCaptured: false, + notifiedBytesLoaded: 0, + ts: Date.now(), + bytes: 0, + onReadCallback: null + }; + this.on("newListener", (event) => { + if (event === "progress") { + if (!internals.isCaptured) { + internals.isCaptured = true; + } + } + }); + } + _read(size) { + const internals = this[kInternals]; + if (internals.onReadCallback) { + internals.onReadCallback(); + } + return super._read(size); + } + _transform(chunk, encoding, callback) { + const internals = this[kInternals]; + const maxRate = internals.maxRate; + const readableHighWaterMark = this.readableHighWaterMark; + const timeWindow = internals.timeWindow; + const divider = 1e3 / timeWindow; + const bytesThreshold = maxRate / divider; + const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; + const pushChunk = (_chunk, _callback) => { + const bytes = Buffer.byteLength(_chunk); + internals.bytesSeen += bytes; + internals.bytes += bytes; + internals.isCaptured && this.emit("progress", internals.bytesSeen); + if (this.push(_chunk)) { + process.nextTick(_callback); + } else { + internals.onReadCallback = () => { + internals.onReadCallback = null; + process.nextTick(_callback); + }; + } + }; + const transformChunk = (_chunk, _callback) => { + const chunkSize = Buffer.byteLength(_chunk); + let chunkRemainder = null; + let maxChunkSize = readableHighWaterMark; + let bytesLeft; + let passed = 0; + if (maxRate) { + const now = Date.now(); + if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { + internals.ts = now; + bytesLeft = bytesThreshold - internals.bytes; + internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; + passed = 0; + } + bytesLeft = bytesThreshold - internals.bytes; + } + if (maxRate) { + if (bytesLeft <= 0) { + return setTimeout(() => { + _callback(null, _chunk); + }, timeWindow - passed); + } + if (bytesLeft < maxChunkSize) { + maxChunkSize = bytesLeft; + } + } + if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { + chunkRemainder = _chunk.subarray(maxChunkSize); + _chunk = _chunk.subarray(0, maxChunkSize); + } + pushChunk(_chunk, chunkRemainder ? () => { + process.nextTick(_callback, null, chunkRemainder); + } : _callback); + }; + transformChunk(chunk, function transformNextChunk(err, _chunk) { + if (err) { + return callback(err); + } + if (_chunk) { + transformChunk(_chunk, transformNextChunk); + } else { + callback(null); + } + }); + } + }; + var AxiosTransformStream$1 = AxiosTransformStream; + var { asyncIterator } = Symbol; + var readBlob = async function* (blob) { + if (blob.stream) { + yield* blob.stream(); + } else if (blob.arrayBuffer) { + yield await blob.arrayBuffer(); + } else if (blob[asyncIterator]) { + yield* blob[asyncIterator](); + } else { + yield blob; + } + }; + var readBlob$1 = readBlob; + var BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + "-_"; + var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder(); + var CRLF = "\r\n"; + var CRLF_BYTES = textEncoder.encode(CRLF); + var CRLF_BYTES_COUNT = 2; + var FormDataPart = class { + constructor(name, value) { + const { escapeName } = this.constructor; + const isStringValue = utils$1.isString(value); + let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`; + if (isStringValue) { + value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + } else { + headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; + } + this.headers = textEncoder.encode(headers + CRLF); + this.contentLength = isStringValue ? value.byteLength : value.size; + this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; + this.name = name; + this.value = value; + } + async *encode() { + yield this.headers; + const { value } = this; + if (utils$1.isTypedArray(value)) { + yield value; + } else { + yield* readBlob$1(value); + } + yield CRLF_BYTES; + } + static escapeName(name) { + return String(name).replace(/[\r\n"]/g, (match) => ({ + "\r": "%0D", + "\n": "%0A", + '"': "%22" + })[match]); + } + }; + var formDataToStream = (form, headersHandler, options) => { + const { + tag = "form-data-boundary", + size = 25, + boundary = tag + "-" + platform.generateString(size, BOUNDARY_ALPHABET) + } = options || {}; + if (!utils$1.isFormData(form)) { + throw TypeError("FormData instance required"); + } + if (boundary.length < 1 || boundary.length > 70) { + throw Error("boundary must be 10-70 characters long"); + } + const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); + const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF); + let contentLength = footerBytes.byteLength; + const parts = Array.from(form.entries()).map(([name, value]) => { + const part = new FormDataPart(name, value); + contentLength += part.size; + return part; + }); + contentLength += boundaryBytes.byteLength * parts.length; + contentLength = utils$1.toFiniteNumber(contentLength); + const computedHeaders = { + "Content-Type": `multipart/form-data; boundary=${boundary}` + }; + if (Number.isFinite(contentLength)) { + computedHeaders["Content-Length"] = contentLength; + } + headersHandler && headersHandler(computedHeaders); + return stream.Readable.from(async function* () { + for (const part of parts) { + yield boundaryBytes; + yield* part.encode(); + } + yield footerBytes; + }()); + }; + var formDataToStream$1 = formDataToStream; + var ZlibHeaderTransformStream = class extends stream__default["default"].Transform { + __transform(chunk, encoding, callback) { + this.push(chunk); + callback(); + } + _transform(chunk, encoding, callback) { + if (chunk.length !== 0) { + this._transform = this.__transform; + if (chunk[0] !== 120) { + const header = Buffer.alloc(2); + header[0] = 120; + header[1] = 156; + this.push(header, encoding); + } + } + this.__transform(chunk, encoding, callback); + } + }; + var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream; + var callbackify = (fn, reducer) => { + return utils$1.isAsyncFn(fn) ? function(...args) { + const cb = args.pop(); + fn.apply(this, args).then((value) => { + try { + reducer ? cb(null, ...reducer(value)) : cb(null, value); + } catch (err) { + cb(err); + } + }, cb); + } : fn; + }; + var callbackify$1 = callbackify; + function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + min = min !== void 0 ? min : 1e3; + return function push(chunkLength) { + const now = Date.now(); + const startedAt = timestamps[tail]; + if (!firstSampleTS) { + firstSampleTS = now; + } + bytes[head] = chunkLength; + timestamps[head] = now; + let i = tail; + let bytesCount = 0; + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + head = (head + 1) % samplesCount; + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + if (now - firstSampleTS < min) { + return; + } + const passed = startedAt && now - startedAt; + return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; + }; + } + function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1e3 / freq; + let lastArgs; + let timer; + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn(...args); + }; + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if (passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + const flush = () => lastArgs && invoke(lastArgs); + return [throttled, flush]; + } + var progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + return throttle((e) => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : void 0; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + bytesNotified = loaded; + const data = { + loaded, + total, + progress: total ? loaded / total : void 0, + bytes: progressBytes, + rate: rate ? rate : void 0, + estimated: rate && total && inRange ? (total - loaded) / rate : void 0, + event: e, + lengthComputable: total != null, + [isDownloadStream ? "download" : "upload"]: true + }; + listener(data); + }, freq); + }; + var progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; + }; + var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); + function estimateDataURLDecodedBytes(url2) { + if (!url2 || typeof url2 !== "string") return 0; + if (!url2.startsWith("data:")) return 0; + const comma = url2.indexOf(","); + if (comma < 0) return 0; + const meta = url2.slice(5, comma); + const body = url2.slice(comma + 1); + const isBase64 = /;base64/i.test(meta); + if (isBase64) { + let effectiveLen = body.length; + const len = body.length; + for (let i = 0; i < len; i++) { + if (body.charCodeAt(i) === 37 && i + 2 < len) { + const a = body.charCodeAt(i + 1); + const b = body.charCodeAt(i + 2); + const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102); + if (isHex) { + effectiveLen -= 2; + i += 2; + } + } + } + let pad = 0; + let idx = len - 1; + const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%' + body.charCodeAt(j - 1) === 51 && // '3' + (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); + if (idx >= 0) { + if (body.charCodeAt(idx) === 61) { + pad++; + idx--; + } else if (tailIsPct3D(idx)) { + pad++; + idx -= 3; + } + } + if (pad === 1 && idx >= 0) { + if (body.charCodeAt(idx) === 61) { + pad++; + } else if (tailIsPct3D(idx)) { + pad++; + } + } + const groups = Math.floor(effectiveLen / 4); + const bytes = groups * 3 - (pad || 0); + return bytes > 0 ? bytes : 0; + } + return Buffer.byteLength(body, "utf8"); + } + var zlibOptions = { + flush: zlib__default["default"].constants.Z_SYNC_FLUSH, + finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH + }; + var brotliOptions = { + flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH + }; + var { + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_STATUS + } = http2.constants; + var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress); + var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"]; + var isHttps = /https:?/; + var supportedProtocols = platform.protocols.map((protocol) => { + return protocol + ":"; + }); + var flushOnFinish = (stream2, [throttled, flush]) => { + stream2.on("end", flush).on("error", flush); + return throttled; + }; + var Http2Sessions = class { + constructor() { + this.sessions = /* @__PURE__ */ Object.create(null); + } + getSession(authority, options) { + options = Object.assign({ + sessionTimeout: 1e3 + }, options); + let authoritySessions; + if (authoritySessions = this.sessions[authority]) { + let len = authoritySessions.length; + for (let i = 0; i < len; i++) { + const [sessionHandle, sessionOptions] = authoritySessions[i]; + if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) { + return sessionHandle; + } + } + } + const session = http2.connect(authority, options); + let removed; + const removeSession = () => { + if (removed) { + return; + } + removed = true; + let entries2 = authoritySessions, len = entries2.length, i = len; + while (i--) { + if (entries2[i][0] === session) { + entries2.splice(i, 1); + if (len === 1) { + delete this.sessions[authority]; + return; + } + } + } + }; + const originalRequestFn = session.request; + const { sessionTimeout } = options; + if (sessionTimeout != null) { + let timer; + let streamsCount = 0; + session.request = function() { + const stream2 = originalRequestFn.apply(this, arguments); + streamsCount++; + if (timer) { + clearTimeout(timer); + timer = null; + } + stream2.once("close", () => { + if (!--streamsCount) { + timer = setTimeout(() => { + timer = null; + removeSession(); + }, sessionTimeout); + } + }); + return stream2; + }; + } + session.once("close", removeSession); + let entries = this.sessions[authority], entry = [ + session, + options + ]; + entries ? this.sessions[authority].push(entry) : authoritySessions = this.sessions[authority] = [entry]; + return session; + } + }; + var http2Sessions = new Http2Sessions(); + function dispatchBeforeRedirect(options, responseDetails) { + if (options.beforeRedirects.proxy) { + options.beforeRedirects.proxy(options); + } + if (options.beforeRedirects.config) { + options.beforeRedirects.config(options, responseDetails); + } + } + function setProxy(options, configProxy, location) { + let proxy = configProxy; + if (!proxy && proxy !== false) { + const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location); + if (proxyUrl) { + proxy = new URL(proxyUrl); + } + } + if (proxy) { + if (proxy.username) { + proxy.auth = (proxy.username || "") + ":" + (proxy.password || ""); + } + if (proxy.auth) { + if (proxy.auth.username || proxy.auth.password) { + proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || ""); + } + const base64 = Buffer.from(proxy.auth, "utf8").toString("base64"); + options.headers["Proxy-Authorization"] = "Basic " + base64; + } + options.headers.host = options.hostname + (options.port ? ":" + options.port : ""); + const proxyHost = proxy.hostname || proxy.host; + options.hostname = proxyHost; + options.host = proxyHost; + options.port = proxy.port; + options.path = location; + if (proxy.protocol) { + options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`; + } + } + options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { + setProxy(redirectOptions, configProxy, redirectOptions.href); + }; + } + var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process"; + var wrapAsync = (asyncExecutor) => { + return new Promise((resolve2, reject) => { + let onDone; + let isDone; + const done = (value, isRejected) => { + if (isDone) return; + isDone = true; + onDone && onDone(value, isRejected); + }; + const _resolve = (value) => { + done(value); + resolve2(value); + }; + const _reject = (reason) => { + done(reason, true); + reject(reason); + }; + asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject); + }); + }; + var resolveFamily = ({ address, family }) => { + if (!utils$1.isString(address)) { + throw TypeError("address must be a string"); + } + return { + address, + family: family || (address.indexOf(".") < 0 ? 6 : 4) + }; + }; + var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family }); + var http2Transport = { + request(options, cb) { + const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80); + const { http2Options, headers } = options; + const session = http2Sessions.getSession(authority, http2Options); + const http2Headers = { + [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""), + [HTTP2_HEADER_METHOD]: options.method, + [HTTP2_HEADER_PATH]: options.path + }; + utils$1.forEach(headers, (header, name) => { + name.charAt(0) !== ":" && (http2Headers[name] = header); + }); + const req = session.request(http2Headers); + req.once("response", (responseHeaders) => { + const response = req; + responseHeaders = Object.assign({}, responseHeaders); + const status = responseHeaders[HTTP2_HEADER_STATUS]; + delete responseHeaders[HTTP2_HEADER_STATUS]; + response.headers = responseHeaders; + response.statusCode = +status; + cb(response); + }); + return req; + } + }; + var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) { + return wrapAsync(async function dispatchHttpRequest(resolve2, reject, onDone) { + let { data, lookup, family, httpVersion = 1, http2Options } = config; + const { responseType, responseEncoding } = config; + const method = config.method.toUpperCase(); + let isDone; + let rejected = false; + let req; + httpVersion = +httpVersion; + if (Number.isNaN(httpVersion)) { + throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); + } + if (httpVersion !== 1 && httpVersion !== 2) { + throw TypeError(`Unsupported protocol version '${httpVersion}'`); + } + const isHttp2 = httpVersion === 2; + if (lookup) { + const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]); + lookup = (hostname, opt, cb) => { + _lookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; + opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); + }); + }; + } + const abortEmitter = new events.EventEmitter(); + function abort(reason) { + try { + abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason); + } catch (err) { + console.warn("emit error", err); + } + } + abortEmitter.once("abort", reject); + const onFinished = () => { + if (config.cancelToken) { + config.cancelToken.unsubscribe(abort); + } + if (config.signal) { + config.signal.removeEventListener("abort", abort); + } + abortEmitter.removeAllListeners(); + }; + if (config.cancelToken || config.signal) { + config.cancelToken && config.cancelToken.subscribe(abort); + if (config.signal) { + config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort); + } + } + onDone((response, isRejected) => { + isDone = true; + if (isRejected) { + rejected = true; + onFinished(); + return; + } + const { data: data2 } = response; + if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) { + const offListeners = stream__default["default"].finished(data2, () => { + offListeners(); + onFinished(); + }); + } else { + onFinished(); + } + }); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0); + const protocol = parsed.protocol || supportedProtocols[0]; + if (protocol === "data:") { + if (config.maxContentLength > -1) { + const dataUrl = String(config.url || fullPath || ""); + const estimated = estimateDataURLDecodedBytes(dataUrl); + if (estimated > config.maxContentLength) { + return reject(new AxiosError( + "maxContentLength size of " + config.maxContentLength + " exceeded", + AxiosError.ERR_BAD_RESPONSE, + config + )); + } + } + let convertedData; + if (method !== "GET") { + return settle(resolve2, reject, { + status: 405, + statusText: "method not allowed", + headers: {}, + config + }); + } + try { + convertedData = fromDataURI(config.url, responseType === "blob", { + Blob: config.env && config.env.Blob + }); + } catch (err) { + throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); + } + if (responseType === "text") { + convertedData = convertedData.toString(responseEncoding); + if (!responseEncoding || responseEncoding === "utf8") { + convertedData = utils$1.stripBOM(convertedData); + } + } else if (responseType === "stream") { + convertedData = stream__default["default"].Readable.from(convertedData); + } + return settle(resolve2, reject, { + data: convertedData, + status: 200, + statusText: "OK", + headers: new AxiosHeaders$1(), + config + }); + } + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new AxiosError( + "Unsupported protocol " + protocol, + AxiosError.ERR_BAD_REQUEST, + config + )); + } + const headers = AxiosHeaders$1.from(config.headers).normalize(); + headers.set("User-Agent", "axios/" + VERSION, false); + const { onUploadProgress, onDownloadProgress } = config; + const maxRate = config.maxRate; + let maxUploadRate = void 0; + let maxDownloadRate = void 0; + if (utils$1.isSpecCompliantForm(data)) { + const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); + data = formDataToStream$1(data, (formHeaders) => { + headers.set(formHeaders); + }, { + tag: `axios-${VERSION}-boundary`, + boundary: userBoundary && userBoundary[1] || void 0 + }); + } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) { + headers.set(data.getHeaders()); + if (!headers.hasContentLength()) { + try { + const knownLength = await util__default["default"].promisify(data.getLength).call(data); + Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); + } catch (e) { + } + } + } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { + data.size && headers.setContentType(data.type || "application/octet-stream"); + headers.setContentLength(data.size || 0); + data = stream__default["default"].Readable.from(readBlob$1(data)); + } else if (data && !utils$1.isStream(data)) { + if (Buffer.isBuffer(data)) ; + else if (utils$1.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils$1.isString(data)) { + data = Buffer.from(data, "utf-8"); + } else { + return reject(new AxiosError( + "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", + AxiosError.ERR_BAD_REQUEST, + config + )); + } + headers.setContentLength(data.length, false); + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new AxiosError( + "Request body larger than maxBodyLength limit", + AxiosError.ERR_BAD_REQUEST, + config + )); + } + } + const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); + if (utils$1.isArray(maxRate)) { + maxUploadRate = maxRate[0]; + maxDownloadRate = maxRate[1]; + } else { + maxUploadRate = maxDownloadRate = maxRate; + } + if (data && (onUploadProgress || maxUploadRate)) { + if (!utils$1.isStream(data)) { + data = stream__default["default"].Readable.from(data, { objectMode: false }); + } + data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({ + maxRate: utils$1.toFiniteNumber(maxUploadRate) + })], utils$1.noop); + onUploadProgress && data.on("progress", flushOnFinish( + data, + progressEventDecorator( + contentLength, + progressEventReducer(asyncDecorator(onUploadProgress), false, 3) + ) + )); + } + let auth = void 0; + if (config.auth) { + const username = config.auth.username || ""; + const password = config.auth.password || ""; + auth = username + ":" + password; + } + if (!auth && parsed.username) { + const urlUsername = parsed.username; + const urlPassword = parsed.password; + auth = urlUsername + ":" + urlPassword; + } + auth && headers.delete("authorization"); + let path2; + try { + path2 = buildURL( + parsed.pathname + parsed.search, + config.params, + config.paramsSerializer + ).replace(/^\?/, ""); + } catch (err) { + const customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + return reject(customErr); + } + headers.set( + "Accept-Encoding", + "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), + false + ); + const options = { + path: path2, + method, + headers: headers.toJSON(), + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth, + protocol, + family, + beforeRedirect: dispatchBeforeRedirect, + beforeRedirects: {}, + http2Options + }; + !utils$1.isUndefined(lookup) && (options.lookup = lookup); + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; + options.port = parsed.port; + setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path); + } + let transport; + const isHttpsRequest = isHttps.test(options.protocol); + options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + if (isHttp2) { + transport = http2Transport; + } else { + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsRequest ? https__default["default"] : http__default["default"]; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirects.config = config.beforeRedirect; + } + transport = isHttpsRequest ? httpsFollow : httpFollow; + } + } + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } else { + options.maxBodyLength = Infinity; + } + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + req = transport.request(options, function handleResponse(res) { + if (req.destroyed) return; + const streams = [res]; + const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]); + if (onDownloadProgress || maxDownloadRate) { + const transformStream = new AxiosTransformStream$1({ + maxRate: utils$1.toFiniteNumber(maxDownloadRate) + }); + onDownloadProgress && transformStream.on("progress", flushOnFinish( + transformStream, + progressEventDecorator( + responseLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) + ) + )); + streams.push(transformStream); + } + let responseStream = res; + const lastRequest = res.req || req; + if (config.decompress !== false && res.headers["content-encoding"]) { + if (method === "HEAD" || res.statusCode === 204) { + delete res.headers["content-encoding"]; + } + switch ((res.headers["content-encoding"] || "").toLowerCase()) { + /*eslint default-case:0*/ + case "gzip": + case "x-gzip": + case "compress": + case "x-compress": + streams.push(zlib__default["default"].createUnzip(zlibOptions)); + delete res.headers["content-encoding"]; + break; + case "deflate": + streams.push(new ZlibHeaderTransformStream$1()); + streams.push(zlib__default["default"].createUnzip(zlibOptions)); + delete res.headers["content-encoding"]; + break; + case "br": + if (isBrotliSupported) { + streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions)); + delete res.headers["content-encoding"]; + } + } + } + responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0]; + const response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: new AxiosHeaders$1(res.headers), + config, + request: lastRequest + }; + if (responseType === "stream") { + response.data = responseStream; + settle(resolve2, reject, response); + } else { + const responseBuffer = []; + let totalResponseBytes = 0; + responseStream.on("data", function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + rejected = true; + responseStream.destroy(); + abort(new AxiosError( + "maxContentLength size of " + config.maxContentLength + " exceeded", + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + )); + } + }); + responseStream.on("aborted", function handlerStreamAborted() { + if (rejected) { + return; + } + const err = new AxiosError( + "stream has been aborted", + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + ); + responseStream.destroy(err); + reject(err); + }); + responseStream.on("error", function handleStreamError(err) { + if (req.destroyed) return; + reject(AxiosError.from(err, null, config, lastRequest)); + }); + responseStream.on("end", function handleStreamEnd() { + try { + let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (responseType !== "arraybuffer") { + responseData = responseData.toString(responseEncoding); + if (!responseEncoding || responseEncoding === "utf8") { + responseData = utils$1.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + return reject(AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve2, reject, response); + }); + } + abortEmitter.once("abort", (err) => { + if (!responseStream.destroyed) { + responseStream.emit("error", err); + responseStream.destroy(); + } + }); + }); + abortEmitter.once("abort", (err) => { + if (req.close) { + req.close(); + } else { + req.destroy(err); + } + }); + req.on("error", function handleRequestError(err) { + reject(AxiosError.from(err, null, config, req)); + }); + req.on("socket", function handleRequestSocket(socket) { + socket.setKeepAlive(true, 1e3 * 60); + }); + if (config.timeout) { + const timeout = parseInt(config.timeout, 10); + if (Number.isNaN(timeout)) { + abort(new AxiosError( + "error trying to parse `config.timeout` to int", + AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); + return; + } + req.setTimeout(timeout, function handleRequestTimeout() { + if (isDone) return; + let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + abort(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + req + )); + }); + } + if (utils$1.isStream(data)) { + let ended = false; + let errored = false; + data.on("end", () => { + ended = true; + }); + data.once("error", (err) => { + errored = true; + req.destroy(err); + }); + data.on("close", () => { + if (!ended && !errored) { + abort(new CanceledError("Request stream has been aborted", config, req)); + } + }); + data.pipe(req); + } else { + data && req.write(data); + req.end(); + } + }); + }; + var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => { + url2 = new URL(url2, platform.origin); + return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port); + })( + new URL(platform.origin), + platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) + ) : () => true; + var cookies = platform.hasStandardBrowserEnv ? ( + // Standard browser envs support document.cookie + { + write(name, value, expires, path2, domain, secure, sameSite) { + if (typeof document === "undefined") return; + const cookie = [`${name}=${encodeURIComponent(value)}`]; + if (utils$1.isNumber(expires)) { + cookie.push(`expires=${new Date(expires).toUTCString()}`); + } + if (utils$1.isString(path2)) { + cookie.push(`path=${path2}`); + } + if (utils$1.isString(domain)) { + cookie.push(`domain=${domain}`); + } + if (secure === true) { + cookie.push("secure"); + } + if (utils$1.isString(sameSite)) { + cookie.push(`SameSite=${sameSite}`); + } + document.cookie = cookie.join("; "); + }, + read(name) { + if (typeof document === "undefined") return null; + const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); + return match ? decodeURIComponent(match[1]) : null; + }, + remove(name) { + this.write(name, "", Date.now() - 864e5, "/"); + } + } + ) : ( + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() { + }, + read() { + return null; + }, + remove() { + } + } + ); + var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; + function mergeConfig(config1, config2) { + config2 = config2 || {}; + const config = {}; + function getMergedValue(target, source, prop, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({ caseless }, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, prop, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(void 0, a, prop, caseless); + } + } + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(void 0, b); + } + } + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(void 0, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(void 0, a); + } + } + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(void 0, a); + } + } + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + }; + utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { + const merge2 = mergeMap[prop] || mergeDeepProperties; + const configValue = merge2(config1[prop], config2[prop], prop); + utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); + }); + return config; + } + var resolveConfig = (config) => { + const newConfig = mergeConfig({}, config); + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + newConfig.headers = headers = AxiosHeaders$1.from(headers); + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + if (auth) { + headers.set( + "Authorization", + "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) + ); + } + if (utils$1.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(void 0); + } else if (utils$1.isFunction(data.getHeaders)) { + const formHeaders = data.getHeaders(); + const allowedHeaders = ["content-type", "content-length"]; + Object.entries(formHeaders).forEach(([key, val]) => { + if (allowedHeaders.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + } + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + return newConfig; + }; + var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; + var xhrAdapter = isXHRAdapterSupported && function(config) { + return new Promise(function dispatchXhrRequest(resolve2, reject) { + const _config = resolveConfig(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); + let { responseType, onUploadProgress, onDownloadProgress } = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + function done() { + flushUpload && flushUpload(); + flushDownload && flushDownload(); + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + _config.signal && _config.signal.removeEventListener("abort", onCanceled); + } + let request = new XMLHttpRequest(); + request.open(_config.method.toUpperCase(), _config.url, true); + request.timeout = _config.timeout; + function onloadend() { + if (!request) { + return; + } + const responseHeaders = AxiosHeaders$1.from( + "getAllResponseHeaders" in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + settle(function _resolve(value) { + resolve2(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + request = null; + } + if ("onloadend" in request) { + request.onloadend = onloadend; + } else { + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { + return; + } + setTimeout(onloadend); + }; + } + request.onabort = function handleAbort() { + if (!request) { + return; + } + reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); + request = null; + }; + request.onerror = function handleError(event) { + const msg = event && event.message ? event.message : "Network Error"; + const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); + err.event = event || null; + reject(err); + request = null; + }; + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; + const transitional = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request + )); + request = null; + }; + requestData === void 0 && requestHeaders.setContentType(null); + if ("setRequestHeader" in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + if (!utils$1.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + if (responseType && responseType !== "json") { + request.responseType = _config.responseType; + } + if (onDownloadProgress) { + [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); + request.addEventListener("progress", downloadThrottled); + } + if (onUploadProgress && request.upload) { + [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); + request.upload.addEventListener("progress", uploadThrottled); + request.upload.addEventListener("loadend", flushUpload); + } + if (_config.cancelToken || _config.signal) { + onCanceled = (cancel) => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); + } + } + const protocol = parseProtocol(_config.url); + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config)); + return; + } + request.send(requestData || null); + }); + }; + var composeSignals = (signals, timeout) => { + const { length } = signals = signals ? signals.filter(Boolean) : []; + if (timeout || length) { + let controller = new AbortController(); + let aborted; + const onabort = function(reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); + }, timeout); + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach((signal2) => { + signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); + }); + signals = null; + } + }; + signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); + const { signal } = controller; + signal.unsubscribe = () => utils$1.asap(unsubscribe); + return signal; + } + }; + var composeSignals$1 = composeSignals; + var streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + let pos = 0; + let end; + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } + }; + var readBytes = async function* (iterable, chunkSize) { + for await (const chunk of readStream(iterable)) { + yield* streamChunk(chunk, chunkSize); + } + }; + var readStream = async function* (stream2) { + if (stream2[Symbol.asyncIterator]) { + yield* stream2; + return; + } + const reader = stream2.getReader(); + try { + for (; ; ) { + const { done, value } = await reader.read(); + if (done) { + break; + } + yield value; + } + } finally { + await reader.cancel(); + } + }; + var trackStream = (stream2, chunkSize, onProgress, onFinish) => { + const iterator2 = readBytes(stream2, chunkSize); + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + return new ReadableStream({ + async pull(controller) { + try { + const { done: done2, value } = await iterator2.next(); + if (done2) { + _onFinish(); + controller.close(); + return; + } + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator2.return(); + } + }, { + highWaterMark: 2 + }); + }; + var DEFAULT_CHUNK_SIZE = 64 * 1024; + var { isFunction } = utils$1; + var globalFetchAPI = (({ Request, Response }) => ({ + Request, + Response + }))(utils$1.global); + var { + ReadableStream: ReadableStream$1, + TextEncoder: TextEncoder$1 + } = utils$1.global; + var test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false; + } + }; + var factory = (env) => { + env = utils$1.merge.call({ + skipUndefined: true + }, globalFetchAPI, env); + const { fetch: envFetch, Request, Response } = env; + const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; + const isRequestSupported = isFunction(Request); + const isResponseSupported = isFunction(Response); + if (!isFetchSupported) { + return false; + } + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); + const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { + let duplexAccessed = false; + const hasContentType = new Request(platform.origin, { + body: new ReadableStream$1(), + method: "POST", + get duplex() { + duplexAccessed = true; + return "half"; + } + }).headers.has("Content-Type"); + return duplexAccessed && !hasContentType; + }); + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body)); + const resolvers = { + stream: supportsResponseStream && ((res) => res.body) + }; + isFetchSupported && (() => { + ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { + !resolvers[type] && (resolvers[type] = (res, config) => { + let method = res && res[type]; + if (method) { + return method.call(res); + } + throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); + }); + }); + })(); + const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + if (utils$1.isBlob(body)) { + return body.size; + } + if (utils$1.isSpecCompliantForm(body)) { + const _request = new Request(platform.origin, { + method: "POST", + body + }); + return (await _request.arrayBuffer()).byteLength; + } + if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { + return body.byteLength; + } + if (utils$1.isURLSearchParams(body)) { + body = body + ""; + } + if (utils$1.isString(body)) { + return (await encodeText(body)).byteLength; + } + }; + const resolveBodyLength = async (headers, body) => { + const length = utils$1.toFiniteNumber(headers.getContentLength()); + return length == null ? getBodyLength(body) : length; + }; + return async (config) => { + let { + url: url2, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = "same-origin", + fetchOptions + } = resolveConfig(config); + let _fetch = envFetch || fetch; + responseType = responseType ? (responseType + "").toLowerCase() : "text"; + let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + let request = null; + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + let requestContentLength; + try { + if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { + let _request = new Request(url2, { + method: "POST", + body: data, + duplex: "half" + }); + let contentTypeHeader; + if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { + headers.setContentType(contentTypeHeader); + } + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + } + if (!utils$1.isString(withCredentials)) { + withCredentials = withCredentials ? "include" : "omit"; + } + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + const resolvedOptions = { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : void 0 + }; + request = isRequestSupported && new Request(url2, resolvedOptions); + let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions)); + const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); + if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { + const options = {}; + ["status", "statusText", "headers"].forEach((prop) => { + options[prop] = response[prop]; + }); + const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length")); + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), + options + ); + } + responseType = responseType || "text"; + let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config); + !isStreamResponse && unsubscribe && unsubscribe(); + return await new Promise((resolve2, reject) => { + settle(resolve2, reject, { + data: responseData, + headers: AxiosHeaders$1.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }); + } catch (err) { + unsubscribe && unsubscribe(); + if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request), + { + cause: err.cause || err + } + ); + } + throw AxiosError.from(err, err && err.code, config, request); + } + }; + }; + var seedCache = /* @__PURE__ */ new Map(); + var getFetch = (config) => { + let env = config && config.env || {}; + const { fetch: fetch2, Request, Response } = env; + const seeds = [ + Request, + Response, + fetch2 + ]; + let len = seeds.length, i = len, seed, target, map = seedCache; + while (i--) { + seed = seeds[i]; + target = map.get(seed); + target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); + map = target; + } + return target; + }; + getFetch(); + var knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter, + fetch: { + get: getFetch + } + }; + utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, "name", { value }); + } catch (e) { + } + Object.defineProperty(fn, "adapterName", { value }); + } + }); + var renderReason = (reason) => `- ${reason}`; + var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; + function getAdapter(adapters2, config) { + adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2]; + const { length } = adapters2; + let nameOrAdapter; + let adapter; + const rejectedReasons = {}; + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters2[i]; + let id; + adapter = nameOrAdapter; + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + if (adapter === void 0) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { + break; + } + rejectedReasons[id || "#" + i] = adapter; + } + if (!adapter) { + const reasons = Object.entries(rejectedReasons).map( + ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") + ); + let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + "ERR_NOT_SUPPORT" + ); + } + return adapter; + } + var adapters = { + /** + * Resolve an adapter from a list of adapter names or functions. + * @type {Function} + */ + getAdapter, + /** + * Exposes all known adapters + * @type {Object} + */ + adapters: knownAdapters + }; + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } + } + function dispatchRequest(config) { + throwIfCancellationRequested(config); + config.headers = AxiosHeaders$1.from(config.headers); + config.data = transformData.call( + config, + config.transformRequest + ); + if (["post", "put", "patch"].indexOf(config.method) !== -1) { + config.headers.setContentType("application/x-www-form-urlencoded", false); + } + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + response.data = transformData.call( + config, + config.transformResponse, + response + ); + response.headers = AxiosHeaders$1.from(response.headers); + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + return Promise.reject(reason); + }); + } + var validators$1 = {}; + ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => { + validators$1[type] = function validator2(thing) { + return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; + }; + }); + var deprecatedWarnings = {}; + validators$1.transitional = function transitional(validator2, version, message) { + function formatMessage(opt, desc) { + return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); + } + return (value, opt, opts) => { + if (validator2 === false) { + throw new AxiosError( + formatMessage(opt, " has been removed" + (version ? " in " + version : "")), + AxiosError.ERR_DEPRECATED + ); + } + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + console.warn( + formatMessage( + opt, + " has been deprecated since v" + version + " and will be removed in the near future" + ) + ); + } + return validator2 ? validator2(value, opt, opts) : true; + }; + }; + validators$1.spelling = function spelling(correctSpelling) { + return (value, opt) => { + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + }; + }; + function assertOptions(options, schema, allowUnknown) { + if (typeof options !== "object") { + throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator2 = schema[opt]; + if (validator2) { + const value = options[opt]; + const result = value === void 0 || validator2(value, opt, options); + if (result !== true) { + throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); + } + } + } + var validator = { + assertOptions, + validators: validators$1 + }; + var validators = validator.validators; + var Axios = class { + constructor(instanceConfig) { + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy = {}; + Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; + try { + if (!err.stack) { + err.stack = stack; + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { + err.stack += "\n" + stack; + } + } catch (e) { + } + } + throw err; + } + } + _request(configOrUrl, config) { + if (typeof configOrUrl === "string") { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + config = mergeConfig(this.defaults, config); + const { transitional, paramsSerializer, headers } = config; + if (transitional !== void 0) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + if (config.allowAbsoluteUrls !== void 0) ; + else if (this.defaults.allowAbsoluteUrls !== void 0) { + config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + } else { + config.allowAbsoluteUrls = true; + } + validator.assertOptions(config, { + baseUrl: validators.spelling("baseURL"), + withXsrfToken: validators.spelling("withXSRFToken") + }, true); + config.method = (config.method || this.defaults.method || "get").toLowerCase(); + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + headers && utils$1.forEach( + ["delete", "get", "head", "post", "put", "patch", "common"], + (method) => { + delete headers[method]; + } + ); + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { + return; + } + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + let promise; + let i = 0; + let len; + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), void 0]; + chain.unshift(...requestInterceptorChain); + chain.push(...responseInterceptorChain); + len = chain.length; + promise = Promise.resolve(config); + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + return promise; + } + len = requestInterceptorChain.length; + let newConfig = config; + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + i = 0; + len = responseInterceptorChain.length; + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + return promise; + } + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + return buildURL(fullPath, config.params, config.paramsSerializer); + } + }; + utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { + Axios.prototype[method] = function(url2, config) { + return this.request(mergeConfig(config || {}, { + method, + url: url2, + data: (config || {}).data + })); + }; + }); + utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { + function generateHTTPMethod(isForm) { + return function httpMethod(url2, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + "Content-Type": "multipart/form-data" + } : {}, + url: url2, + data + })); + }; + } + Axios.prototype[method] = generateHTTPMethod(); + Axios.prototype[method + "Form"] = generateHTTPMethod(true); + }); + var Axios$1 = Axios; + var CancelToken = class _CancelToken { + constructor(executor) { + if (typeof executor !== "function") { + throw new TypeError("executor must be a function."); + } + let resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve2) { + resolvePromise = resolve2; + }); + const token = this; + this.promise.then((cancel) => { + if (!token._listeners) return; + let i = token._listeners.length; + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + this.promise.then = (onfulfilled) => { + let _resolve; + const promise = new Promise((resolve2) => { + token.subscribe(resolve2); + _resolve = resolve2; + }).then(onfulfilled); + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + return promise; + }; + executor(function cancel(message, config, request) { + if (token.reason) { + return; + } + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + /** + * Subscribe to the cancel signal + */ + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + /** + * Unsubscribe from the cancel signal + */ + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + toAbortSignal() { + const controller = new AbortController(); + const abort = (err) => { + controller.abort(err); + }; + this.subscribe(abort); + controller.signal.unsubscribe = () => this.unsubscribe(abort); + return controller.signal; + } + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new _CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } + }; + var CancelToken$1 = CancelToken; + function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + } + function isAxiosError(payload) { + return utils$1.isObject(payload) && payload.isAxiosError === true; + } + var HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, + WebServerIsDown: 521, + ConnectionTimedOut: 522, + OriginIsUnreachable: 523, + TimeoutOccurred: 524, + SslHandshakeFailed: 525, + InvalidSslCertificate: 526 + }; + Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; + }); + var HttpStatusCode$1 = HttpStatusCode; + function createInstance(defaultConfig) { + const context = new Axios$1(defaultConfig); + const instance = bind(Axios$1.prototype.request, context); + utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true }); + utils$1.extend(instance, context, null, { allOwnKeys: true }); + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + return instance; + } + var axios = createInstance(defaults$1); + axios.Axios = Axios$1; + axios.CanceledError = CanceledError; + axios.CancelToken = CancelToken$1; + axios.isCancel = isCancel; + axios.VERSION = VERSION; + axios.toFormData = toFormData; + axios.AxiosError = AxiosError; + axios.Cancel = axios.CanceledError; + axios.all = function all(promises2) { + return Promise.all(promises2); + }; + axios.spread = spread; + axios.isAxiosError = isAxiosError; + axios.mergeConfig = mergeConfig; + axios.AxiosHeaders = AxiosHeaders$1; + axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + axios.getAdapter = adapters.getAdapter; + axios.HttpStatusCode = HttpStatusCode$1; + axios.default = axios; + module2.exports = axios; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js +var require_base = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.operationServerMap = exports2.RequiredError = exports2.BaseAPI = exports2.COLLECTION_FORMATS = exports2.BASE_PATH = void 0; + var axios_1 = require_axios(); + exports2.BASE_PATH = "http://localhost".replace(/\/+$/, ""); + exports2.COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: " ", + pipes: "|" + }; + var BaseAPI = class { + constructor(configuration, basePath = exports2.BASE_PATH, axios = axios_1.default) { + var _a; + this.basePath = basePath; + this.axios = axios; + if (configuration) { + this.configuration = configuration; + this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath; + } + } + }; + exports2.BaseAPI = BaseAPI; + var RequiredError = class extends Error { + constructor(field, msg) { + super(msg); + this.field = field; + this.name = "RequiredError"; + } + }; + exports2.RequiredError = RequiredError; + exports2.operationServerMap = {}; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js +var require_common2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js"(exports2) { + "use strict"; + var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createRequestFunction = exports2.toPathString = exports2.serializeDataIfNeeded = exports2.setSearchParams = exports2.setOAuthToObject = exports2.setBearerAuthToObject = exports2.setBasicAuthToObject = exports2.setApiKeyToObject = exports2.assertParamExists = exports2.DUMMY_BASE_URL = void 0; + var base_1 = require_base(); + exports2.DUMMY_BASE_URL = "https://example.com"; + var assertParamExists = function(functionName, paramName, paramValue) { + if (paramValue === null || paramValue === void 0) { + throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } + }; + exports2.assertParamExists = assertParamExists; + var setApiKeyToObject = function(object, keyParamName, configuration) { + return __awaiter(this, void 0, void 0, function* () { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === "function" ? yield configuration.apiKey(keyParamName) : yield configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } + }); + }; + exports2.setApiKeyToObject = setApiKeyToObject; + var setBasicAuthToObject = function(object, configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } + }; + exports2.setBasicAuthToObject = setBasicAuthToObject; + var setBearerAuthToObject = function(object, configuration) { + return __awaiter(this, void 0, void 0, function* () { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === "function" ? yield configuration.accessToken() : yield configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } + }); + }; + exports2.setBearerAuthToObject = setBearerAuthToObject; + var setOAuthToObject = function(object, name, scopes, configuration) { + return __awaiter(this, void 0, void 0, function* () { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === "function" ? yield configuration.accessToken(name, scopes) : yield configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + }); + }; + exports2.setOAuthToObject = setOAuthToObject; + function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { + if (parameter == null) + return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key)); + } else { + Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)); + } + } else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } else { + urlSearchParams.set(key, parameter); + } + } + } + var setSearchParams = function(url, ...objects) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); + }; + exports2.setSearchParams = setSearchParams; + var serializeDataIfNeeded = function(value, requestOptions, configuration) { + const nonString = typeof value !== "string"; + const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString; + return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}) : value || ""; + }; + exports2.serializeDataIfNeeded = serializeDataIfNeeded; + var toPathString = function(url) { + return url.pathname + url.search + url.hash; + }; + exports2.toPathString = toPathString; + var createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) { + return (axios = globalAxios, basePath = BASE_PATH) => { + var _a; + const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? "" : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url }); + return axios.request(axiosRequestArgs); + }; + }; + exports2.createRequestFunction = createRequestFunction; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js +var require_health_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js"(exports2) { + "use strict"; + var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.HealthApi = exports2.HealthApiFactory = exports2.HealthApiFp = exports2.HealthApiAxiosParamCreator = void 0; + var axios_1 = require_axios(); + var common_1 = require_common2(); + var base_1 = require_base(); + var HealthApiAxiosParamCreator = function(configuration) { + return { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. + * @summary Health routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + health: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { + const localVarPath = `/v1/health`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }) + }; + }; + exports2.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator; + var HealthApiFp = function(configuration) { + const localVarAxiosParamCreator = (0, exports2.HealthApiAxiosParamCreator)(configuration); + return { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. + * @summary Health routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + health(options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.health(options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["HealthApi.health"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + } + }; + }; + exports2.HealthApiFp = HealthApiFp; + var HealthApiFactory = function(configuration, basePath, axios) { + const localVarFp = (0, exports2.HealthApiFp)(configuration); + return { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. + * @summary Health routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + health(options) { + return localVarFp.health(options).then((request) => request(axios, basePath)); + } + }; + }; + exports2.HealthApiFactory = HealthApiFactory; + var HealthApi = class extends base_1.BaseAPI { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. + * @summary Health routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HealthApi + */ + health(options) { + return (0, exports2.HealthApiFp)(this.configuration).health(options).then((request) => request(this.axios, this.basePath)); + } + }; + exports2.HealthApi = HealthApi; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js +var require_metrics_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js"(exports2) { + "use strict"; + var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MetricsApi = exports2.MetricsApiFactory = exports2.MetricsApiFp = exports2.MetricsApiAxiosParamCreator = void 0; + var axios_1 = require_axios(); + var common_1 = require_common2(); + var base_1 = require_base(); + var MetricsApiAxiosParamCreator = function(configuration) { + return { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. + * @summary Metrics routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { + const localVarPath = `/metrics`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. + * @summary Returns the details of a specific metric in plain text format. + * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metricDetail: (metricName_1, ...args_1) => __awaiter(this, [metricName_1, ...args_1], void 0, function* (metricName, options = {}) { + (0, common_1.assertParamExists)("metricDetail", "metricName", metricName); + const localVarPath = `/metrics/{metric_name}`.replace(`{${"metric_name"}}`, encodeURIComponent(String(metricName))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. + * @summary Triggers an update of system metrics and returns the result in plain text format. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + scrapeMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { + const localVarPath = `/debug/metrics/scrape`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }) + }; + }; + exports2.MetricsApiAxiosParamCreator = MetricsApiAxiosParamCreator; + var MetricsApiFp = function(configuration) { + const localVarAxiosParamCreator = (0, exports2.MetricsApiAxiosParamCreator)(configuration); + return { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. + * @summary Metrics routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listMetrics(options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.listMetrics(options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.listMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. + * @summary Returns the details of a specific metric in plain text format. + * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metricDetail(metricName, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.metricDetail(metricName, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.metricDetail"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. + * @summary Triggers an update of system metrics and returns the result in plain text format. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + scrapeMetrics(options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.scrapeMetrics(options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.scrapeMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + } + }; + }; + exports2.MetricsApiFp = MetricsApiFp; + var MetricsApiFactory = function(configuration, basePath, axios) { + const localVarFp = (0, exports2.MetricsApiFp)(configuration); + return { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. + * @summary Metrics routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listMetrics(options) { + return localVarFp.listMetrics(options).then((request) => request(axios, basePath)); + }, + /** + * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. + * @summary Returns the details of a specific metric in plain text format. + * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + metricDetail(metricName, options) { + return localVarFp.metricDetail(metricName, options).then((request) => request(axios, basePath)); + }, + /** + * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. + * @summary Triggers an update of system metrics and returns the result in plain text format. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + scrapeMetrics(options) { + return localVarFp.scrapeMetrics(options).then((request) => request(axios, basePath)); + } + }; + }; + exports2.MetricsApiFactory = MetricsApiFactory; + var MetricsApi = class extends base_1.BaseAPI { + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. + * @summary Metrics routes implementation + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetricsApi + */ + listMetrics(options) { + return (0, exports2.MetricsApiFp)(this.configuration).listMetrics(options).then((request) => request(this.axios, this.basePath)); + } + /** + * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. + * @summary Returns the details of a specific metric in plain text format. + * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetricsApi + */ + metricDetail(metricName, options) { + return (0, exports2.MetricsApiFp)(this.configuration).metricDetail(metricName, options).then((request) => request(this.axios, this.basePath)); + } + /** + * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. + * @summary Triggers an update of system metrics and returns the result in plain text format. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetricsApi + */ + scrapeMetrics(options) { + return (0, exports2.MetricsApiFp)(this.configuration).scrapeMetrics(options).then((request) => request(this.axios, this.basePath)); + } + }; + exports2.MetricsApi = MetricsApi; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js +var require_notifications_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js"(exports2) { + "use strict"; + var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.NotificationsApi = exports2.NotificationsApiFactory = exports2.NotificationsApiFp = exports2.NotificationsApiAxiosParamCreator = void 0; + var axios_1 = require_axios(); + var common_1 = require_common2(); + var base_1 = require_base(); + var NotificationsApiAxiosParamCreator = function(configuration) { + return { + /** + * + * @summary Creates a new notification. + * @param {NotificationCreateRequest} notificationCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createNotification: (notificationCreateRequest_1, ...args_1) => __awaiter(this, [notificationCreateRequest_1, ...args_1], void 0, function* (notificationCreateRequest, options = {}) { + (0, common_1.assertParamExists)("createNotification", "notificationCreateRequest", notificationCreateRequest); + const localVarPath = `/api/v1/notifications`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationCreateRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Deletes a notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { + (0, common_1.assertParamExists)("deleteNotification", "notificationId", notificationId); + const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Retrieves details of a specific notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { + (0, common_1.assertParamExists)("getNotification", "notificationId", notificationId); + const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. + * @summary Notification routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listNotifications: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { + const localVarPath = `/api/v1/notifications`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + if (page !== void 0) { + localVarQueryParameter["page"] = page; + } + if (perPage !== void 0) { + localVarQueryParameter["per_page"] = perPage; + } + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Updates an existing notification. + * @param {string} notificationId Notification ID + * @param {NotificationUpdateRequest} notificationUpdateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateNotification: (notificationId_1, notificationUpdateRequest_1, ...args_1) => __awaiter(this, [notificationId_1, notificationUpdateRequest_1, ...args_1], void 0, function* (notificationId, notificationUpdateRequest, options = {}) { + (0, common_1.assertParamExists)("updateNotification", "notificationId", notificationId); + (0, common_1.assertParamExists)("updateNotification", "notificationUpdateRequest", notificationUpdateRequest); + const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationUpdateRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }) + }; + }; + exports2.NotificationsApiAxiosParamCreator = NotificationsApiAxiosParamCreator; + var NotificationsApiFp = function(configuration) { + const localVarAxiosParamCreator = (0, exports2.NotificationsApiAxiosParamCreator)(configuration); + return { + /** + * + * @summary Creates a new notification. + * @param {NotificationCreateRequest} notificationCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createNotification(notificationCreateRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.createNotification(notificationCreateRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.createNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Deletes a notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteNotification(notificationId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteNotification(notificationId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.deleteNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Retrieves details of a specific notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getNotification(notificationId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.getNotification(notificationId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.getNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. + * @summary Notification routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listNotifications(page, perPage, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.listNotifications(page, perPage, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.listNotifications"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Updates an existing notification. + * @param {string} notificationId Notification ID + * @param {NotificationUpdateRequest} notificationUpdateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateNotification(notificationId, notificationUpdateRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.updateNotification(notificationId, notificationUpdateRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.updateNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + } + }; + }; + exports2.NotificationsApiFp = NotificationsApiFp; + var NotificationsApiFactory = function(configuration, basePath, axios) { + const localVarFp = (0, exports2.NotificationsApiFp)(configuration); + return { + /** + * + * @summary Creates a new notification. + * @param {NotificationCreateRequest} notificationCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createNotification(notificationCreateRequest, options) { + return localVarFp.createNotification(notificationCreateRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes a notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteNotification(notificationId, options) { + return localVarFp.deleteNotification(notificationId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Retrieves details of a specific notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getNotification(notificationId, options) { + return localVarFp.getNotification(notificationId, options).then((request) => request(axios, basePath)); + }, + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. + * @summary Notification routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listNotifications(page, perPage, options) { + return localVarFp.listNotifications(page, perPage, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Updates an existing notification. + * @param {string} notificationId Notification ID + * @param {NotificationUpdateRequest} notificationUpdateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateNotification(notificationId, notificationUpdateRequest, options) { + return localVarFp.updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(axios, basePath)); + } + }; + }; + exports2.NotificationsApiFactory = NotificationsApiFactory; + var NotificationsApi = class extends base_1.BaseAPI { + /** + * + * @summary Creates a new notification. + * @param {NotificationCreateRequest} notificationCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + createNotification(notificationCreateRequest, options) { + return (0, exports2.NotificationsApiFp)(this.configuration).createNotification(notificationCreateRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Deletes a notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + deleteNotification(notificationId, options) { + return (0, exports2.NotificationsApiFp)(this.configuration).deleteNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Retrieves details of a specific notification by ID. + * @param {string} notificationId Notification ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + getNotification(notificationId, options) { + return (0, exports2.NotificationsApiFp)(this.configuration).getNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. + * @summary Notification routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + listNotifications(page, perPage, options) { + return (0, exports2.NotificationsApiFp)(this.configuration).listNotifications(page, perPage, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Updates an existing notification. + * @param {string} notificationId Notification ID + * @param {NotificationUpdateRequest} notificationUpdateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationsApi + */ + updateNotification(notificationId, notificationUpdateRequest, options) { + return (0, exports2.NotificationsApiFp)(this.configuration).updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(this.axios, this.basePath)); + } + }; + exports2.NotificationsApi = NotificationsApi; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js +var require_plugins_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js"(exports2) { + "use strict"; + var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PluginsApi = exports2.PluginsApiFactory = exports2.PluginsApiFp = exports2.PluginsApiAxiosParamCreator = void 0; + var axios_1 = require_axios(); + var common_1 = require_common2(); + var base_1 = require_base(); + var PluginsApiAxiosParamCreator = function(configuration) { + return { + /** + * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. + * @summary Execute a plugin and receive the sanitized result + * @param {string} pluginId The unique identifier of the plugin + * @param {PluginCallRequest} pluginCallRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + callPlugin: (pluginId_1, pluginCallRequest_1, ...args_1) => __awaiter(this, [pluginId_1, pluginCallRequest_1, ...args_1], void 0, function* (pluginId, pluginCallRequest, options = {}) { + (0, common_1.assertParamExists)("callPlugin", "pluginId", pluginId); + (0, common_1.assertParamExists)("callPlugin", "pluginCallRequest", pluginCallRequest); + const localVarPath = `/api/v1/plugins/{plugin_id}/call`.replace(`{${"plugin_id"}}`, encodeURIComponent(String(pluginId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(pluginCallRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }) + }; + }; + exports2.PluginsApiAxiosParamCreator = PluginsApiAxiosParamCreator; + var PluginsApiFp = function(configuration) { + const localVarAxiosParamCreator = (0, exports2.PluginsApiAxiosParamCreator)(configuration); + return { + /** + * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. + * @summary Execute a plugin and receive the sanitized result + * @param {string} pluginId The unique identifier of the plugin + * @param {PluginCallRequest} pluginCallRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + callPlugin(pluginId, pluginCallRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.callPlugin(pluginId, pluginCallRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["PluginsApi.callPlugin"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + } + }; + }; + exports2.PluginsApiFp = PluginsApiFp; + var PluginsApiFactory = function(configuration, basePath, axios) { + const localVarFp = (0, exports2.PluginsApiFp)(configuration); + return { + /** + * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. + * @summary Execute a plugin and receive the sanitized result + * @param {string} pluginId The unique identifier of the plugin + * @param {PluginCallRequest} pluginCallRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + callPlugin(pluginId, pluginCallRequest, options) { + return localVarFp.callPlugin(pluginId, pluginCallRequest, options).then((request) => request(axios, basePath)); + } + }; + }; + exports2.PluginsApiFactory = PluginsApiFactory; + var PluginsApi = class extends base_1.BaseAPI { + /** + * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. + * @summary Execute a plugin and receive the sanitized result + * @param {string} pluginId The unique identifier of the plugin + * @param {PluginCallRequest} pluginCallRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PluginsApi + */ + callPlugin(pluginId, pluginCallRequest, options) { + return (0, exports2.PluginsApiFp)(this.configuration).callPlugin(pluginId, pluginCallRequest, options).then((request) => request(this.axios, this.basePath)); + } + }; + exports2.PluginsApi = PluginsApi; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js +var require_relayers_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js"(exports2) { + "use strict"; + var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RelayersApi = exports2.RelayersApiFactory = exports2.RelayersApiFp = exports2.RelayersApiAxiosParamCreator = void 0; + var axios_1 = require_axios(); + var common_1 = require_common2(); + var base_1 = require_base(); + var RelayersApiAxiosParamCreator = function(configuration) { + return { + /** + * + * @summary Cancels a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cancelTransaction: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { + (0, common_1.assertParamExists)("cancelTransaction", "relayerId", relayerId); + (0, common_1.assertParamExists)("cancelTransaction", "transactionId", transactionId); + const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Creates a new relayer. + * @param {CreateRelayerRequest} createRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRelayer: (createRelayerRequest_1, ...args_1) => __awaiter(this, [createRelayerRequest_1, ...args_1], void 0, function* (createRelayerRequest, options = {}) { + (0, common_1.assertParamExists)("createRelayer", "createRelayerRequest", createRelayerRequest); + const localVarPath = `/api/v1/relayers`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createRelayerRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Deletes all pending transactions for a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePendingTransactions: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { + (0, common_1.assertParamExists)("deletePendingTransactions", "relayerId", relayerId); + const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/pending`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Deletes a relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { + (0, common_1.assertParamExists)("deleteRelayer", "relayerId", relayerId); + const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Retrieves details of a specific relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { + (0, common_1.assertParamExists)("getRelayer", "relayerId", relayerId); + const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Retrieves the balance of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayerBalance: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { + (0, common_1.assertParamExists)("getRelayerBalance", "relayerId", relayerId); + const localVarPath = `/api/v1/relayers/{relayer_id}/balance`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Fetches the current status of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayerStatus: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { + (0, common_1.assertParamExists)("getRelayerStatus", "relayerId", relayerId); + const localVarPath = `/api/v1/relayers/{relayer_id}/status`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Retrieves a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTransactionById: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { + (0, common_1.assertParamExists)("getTransactionById", "relayerId", relayerId); + (0, common_1.assertParamExists)("getTransactionById", "transactionId", transactionId); + const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Retrieves a transaction by its nonce value. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} nonce The nonce of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTransactionByNonce: (relayerId_1, nonce_1, ...args_1) => __awaiter(this, [relayerId_1, nonce_1, ...args_1], void 0, function* (relayerId, nonce, options = {}) { + (0, common_1.assertParamExists)("getTransactionByNonce", "relayerId", relayerId); + (0, common_1.assertParamExists)("getTransactionByNonce", "nonce", nonce); + const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/by-nonce/{nonce}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"nonce"}}`, encodeURIComponent(String(nonce))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. + * @summary Relayer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRelayers: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { + const localVarPath = `/api/v1/relayers`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + if (page !== void 0) { + localVarQueryParameter["page"] = page; + } + if (perPage !== void 0) { + localVarQueryParameter["per_page"] = perPage; + } + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Lists all transactions for a specific relayer with pagination. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listTransactions: (relayerId_1, page_1, perPage_1, ...args_1) => __awaiter(this, [relayerId_1, page_1, perPage_1, ...args_1], void 0, function* (relayerId, page, perPage, options = {}) { + (0, common_1.assertParamExists)("listTransactions", "relayerId", relayerId); + const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + if (page !== void 0) { + localVarQueryParameter["page"] = page; + } + if (perPage !== void 0) { + localVarQueryParameter["per_page"] = perPage; + } + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Replaces a specific transaction with a new one. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + replaceTransaction: (relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, transactionId, networkTransactionRequest, options = {}) { + (0, common_1.assertParamExists)("replaceTransaction", "relayerId", relayerId); + (0, common_1.assertParamExists)("replaceTransaction", "transactionId", transactionId); + (0, common_1.assertParamExists)("replaceTransaction", "networkTransactionRequest", networkTransactionRequest); + const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "PUT" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Performs a JSON-RPC call using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + rpc: (relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1) => __awaiter(this, [relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1], void 0, function* (relayerId, jsonRpcRequestNetworkRpcRequest, options = {}) { + (0, common_1.assertParamExists)("rpc", "relayerId", relayerId); + (0, common_1.assertParamExists)("rpc", "jsonRpcRequestNetworkRpcRequest", jsonRpcRequestNetworkRpcRequest); + const localVarPath = `/api/v1/relayers/{relayer_id}/rpc`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(jsonRpcRequestNetworkRpcRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Sends a transaction through the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sendTransaction: (relayerId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, networkTransactionRequest, options = {}) { + (0, common_1.assertParamExists)("sendTransaction", "relayerId", relayerId); + (0, common_1.assertParamExists)("sendTransaction", "networkTransactionRequest", networkTransactionRequest); + const localVarPath = `/api/v1/relayers/{relayer_id}/transactions`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Signs data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignDataRequest} signDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sign: (relayerId_1, signDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signDataRequest_1, ...args_1], void 0, function* (relayerId, signDataRequest, options = {}) { + (0, common_1.assertParamExists)("sign", "relayerId", relayerId); + (0, common_1.assertParamExists)("sign", "signDataRequest", signDataRequest); + const localVarPath = `/api/v1/relayers/{relayer_id}/sign`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signDataRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Signs a transaction using the specified relayer (Stellar only). + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTransactionRequest} signTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signTransaction: (relayerId_1, signTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTransactionRequest_1, ...args_1], void 0, function* (relayerId, signTransactionRequest, options = {}) { + (0, common_1.assertParamExists)("signTransaction", "relayerId", relayerId); + (0, common_1.assertParamExists)("signTransaction", "signTransactionRequest", signTransactionRequest); + const localVarPath = `/api/v1/relayers/{relayer_id}/sign-transaction`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTransactionRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Signs typed data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTypedDataRequest} signTypedDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signTypedData: (relayerId_1, signTypedDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTypedDataRequest_1, ...args_1], void 0, function* (relayerId, signTypedDataRequest, options = {}) { + (0, common_1.assertParamExists)("signTypedData", "relayerId", relayerId); + (0, common_1.assertParamExists)("signTypedData", "signTypedDataRequest", signTypedDataRequest); + const localVarPath = `/api/v1/relayers/{relayer_id}/sign-typed-data`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTypedDataRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Updates a relayer\'s information based on the provided update request. + * @param {string} relayerId The unique identifier of the relayer + * @param {UpdateRelayerRequest} updateRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRelayer: (relayerId_1, updateRelayerRequest_1, ...args_1) => __awaiter(this, [relayerId_1, updateRelayerRequest_1, ...args_1], void 0, function* (relayerId, updateRelayerRequest, options = {}) { + (0, common_1.assertParamExists)("updateRelayer", "relayerId", relayerId); + (0, common_1.assertParamExists)("updateRelayer", "updateRelayerRequest", updateRelayerRequest); + const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateRelayerRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }) + }; + }; + exports2.RelayersApiAxiosParamCreator = RelayersApiAxiosParamCreator; + var RelayersApiFp = function(configuration) { + const localVarAxiosParamCreator = (0, exports2.RelayersApiAxiosParamCreator)(configuration); + return { + /** + * + * @summary Cancels a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cancelTransaction(relayerId, transactionId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelTransaction(relayerId, transactionId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.cancelTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Creates a new relayer. + * @param {CreateRelayerRequest} createRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRelayer(createRelayerRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.createRelayer(createRelayerRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.createRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Deletes all pending transactions for a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePendingTransactions(relayerId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePendingTransactions(relayerId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deletePendingTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Deletes a relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRelayer(relayerId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteRelayer(relayerId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deleteRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Retrieves details of a specific relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayer(relayerId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayer(relayerId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Retrieves the balance of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayerBalance(relayerId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerBalance(relayerId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerBalance"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Fetches the current status of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayerStatus(relayerId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerStatus(relayerId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerStatus"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Retrieves a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTransactionById(relayerId, transactionId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionById(relayerId, transactionId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionById"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Retrieves a transaction by its nonce value. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} nonce The nonce of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTransactionByNonce(relayerId, nonce, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionByNonce(relayerId, nonce, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionByNonce"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. + * @summary Relayer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRelayers(page, perPage, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.listRelayers(page, perPage, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listRelayers"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Lists all transactions for a specific relayer with pagination. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listTransactions(relayerId, page, perPage, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.listTransactions(relayerId, page, perPage, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Replaces a specific transaction with a new one. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.replaceTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Performs a JSON-RPC call using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.rpc"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Sends a transaction through the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sendTransaction(relayerId, networkTransactionRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.sendTransaction(relayerId, networkTransactionRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sendTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Signs data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignDataRequest} signDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sign(relayerId, signDataRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.sign(relayerId, signDataRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sign"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Signs a transaction using the specified relayer (Stellar only). + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTransactionRequest} signTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signTransaction(relayerId, signTransactionRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.signTransaction(relayerId, signTransactionRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Signs typed data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTypedDataRequest} signTypedDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signTypedData(relayerId, signTypedDataRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.signTypedData(relayerId, signTypedDataRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTypedData"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Updates a relayer\'s information based on the provided update request. + * @param {string} relayerId The unique identifier of the relayer + * @param {UpdateRelayerRequest} updateRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRelayer(relayerId, updateRelayerRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.updateRelayer(relayerId, updateRelayerRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.updateRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + } + }; + }; + exports2.RelayersApiFp = RelayersApiFp; + var RelayersApiFactory = function(configuration, basePath, axios) { + const localVarFp = (0, exports2.RelayersApiFp)(configuration); + return { + /** + * + * @summary Cancels a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + cancelTransaction(relayerId, transactionId, options) { + return localVarFp.cancelTransaction(relayerId, transactionId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates a new relayer. + * @param {CreateRelayerRequest} createRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRelayer(createRelayerRequest, options) { + return localVarFp.createRelayer(createRelayerRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes all pending transactions for a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePendingTransactions(relayerId, options) { + return localVarFp.deletePendingTransactions(relayerId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes a relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRelayer(relayerId, options) { + return localVarFp.deleteRelayer(relayerId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Retrieves details of a specific relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayer(relayerId, options) { + return localVarFp.getRelayer(relayerId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Retrieves the balance of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayerBalance(relayerId, options) { + return localVarFp.getRelayerBalance(relayerId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Fetches the current status of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRelayerStatus(relayerId, options) { + return localVarFp.getRelayerStatus(relayerId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Retrieves a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTransactionById(relayerId, transactionId, options) { + return localVarFp.getTransactionById(relayerId, transactionId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Retrieves a transaction by its nonce value. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} nonce The nonce of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTransactionByNonce(relayerId, nonce, options) { + return localVarFp.getTransactionByNonce(relayerId, nonce, options).then((request) => request(axios, basePath)); + }, + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. + * @summary Relayer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRelayers(page, perPage, options) { + return localVarFp.listRelayers(page, perPage, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Lists all transactions for a specific relayer with pagination. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listTransactions(relayerId, page, perPage, options) { + return localVarFp.listTransactions(relayerId, page, perPage, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Replaces a specific transaction with a new one. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { + return localVarFp.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Performs a JSON-RPC call using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { + return localVarFp.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Sends a transaction through the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sendTransaction(relayerId, networkTransactionRequest, options) { + return localVarFp.sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Signs data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignDataRequest} signDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sign(relayerId, signDataRequest, options) { + return localVarFp.sign(relayerId, signDataRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Signs a transaction using the specified relayer (Stellar only). + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTransactionRequest} signTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signTransaction(relayerId, signTransactionRequest, options) { + return localVarFp.signTransaction(relayerId, signTransactionRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Signs typed data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTypedDataRequest} signTypedDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + signTypedData(relayerId, signTypedDataRequest, options) { + return localVarFp.signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Updates a relayer\'s information based on the provided update request. + * @param {string} relayerId The unique identifier of the relayer + * @param {UpdateRelayerRequest} updateRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRelayer(relayerId, updateRelayerRequest, options) { + return localVarFp.updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(axios, basePath)); + } + }; + }; + exports2.RelayersApiFactory = RelayersApiFactory; + var RelayersApi = class extends base_1.BaseAPI { + /** + * + * @summary Cancels a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + cancelTransaction(relayerId, transactionId, options) { + return (0, exports2.RelayersApiFp)(this.configuration).cancelTransaction(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Creates a new relayer. + * @param {CreateRelayerRequest} createRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + createRelayer(createRelayerRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).createRelayer(createRelayerRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Deletes all pending transactions for a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + deletePendingTransactions(relayerId, options) { + return (0, exports2.RelayersApiFp)(this.configuration).deletePendingTransactions(relayerId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Deletes a relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + deleteRelayer(relayerId, options) { + return (0, exports2.RelayersApiFp)(this.configuration).deleteRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Retrieves details of a specific relayer by ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + getRelayer(relayerId, options) { + return (0, exports2.RelayersApiFp)(this.configuration).getRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Retrieves the balance of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + getRelayerBalance(relayerId, options) { + return (0, exports2.RelayersApiFp)(this.configuration).getRelayerBalance(relayerId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Fetches the current status of a specific relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + getRelayerStatus(relayerId, options) { + return (0, exports2.RelayersApiFp)(this.configuration).getRelayerStatus(relayerId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Retrieves a specific transaction by its ID. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + getTransactionById(relayerId, transactionId, options) { + return (0, exports2.RelayersApiFp)(this.configuration).getTransactionById(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Retrieves a transaction by its nonce value. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} nonce The nonce of the transaction + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + getTransactionByNonce(relayerId, nonce, options) { + return (0, exports2.RelayersApiFp)(this.configuration).getTransactionByNonce(relayerId, nonce, options).then((request) => request(this.axios, this.basePath)); + } + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. + * @summary Relayer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + listRelayers(page, perPage, options) { + return (0, exports2.RelayersApiFp)(this.configuration).listRelayers(page, perPage, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Lists all transactions for a specific relayer with pagination. + * @param {string} relayerId The unique identifier of the relayer + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + listTransactions(relayerId, page, perPage, options) { + return (0, exports2.RelayersApiFp)(this.configuration).listTransactions(relayerId, page, perPage, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Replaces a specific transaction with a new one. + * @param {string} relayerId The unique identifier of the relayer + * @param {string} transactionId The unique identifier of the transaction + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Performs a JSON-RPC call using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Sends a transaction through the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {NetworkTransactionRequest} networkTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + sendTransaction(relayerId, networkTransactionRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Signs data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignDataRequest} signDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + sign(relayerId, signDataRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).sign(relayerId, signDataRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Signs a transaction using the specified relayer (Stellar only). + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTransactionRequest} signTransactionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + signTransaction(relayerId, signTransactionRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).signTransaction(relayerId, signTransactionRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Signs typed data using the specified relayer. + * @param {string} relayerId The unique identifier of the relayer + * @param {SignTypedDataRequest} signTypedDataRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + signTypedData(relayerId, signTypedDataRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Updates a relayer\'s information based on the provided update request. + * @param {string} relayerId The unique identifier of the relayer + * @param {UpdateRelayerRequest} updateRelayerRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RelayersApi + */ + updateRelayer(relayerId, updateRelayerRequest, options) { + return (0, exports2.RelayersApiFp)(this.configuration).updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(this.axios, this.basePath)); + } + }; + exports2.RelayersApi = RelayersApi; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js +var require_signers_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js"(exports2) { + "use strict"; + var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SignersApi = exports2.SignersApiFactory = exports2.SignersApiFp = exports2.SignersApiAxiosParamCreator = void 0; + var axios_1 = require_axios(); + var common_1 = require_common2(); + var base_1 = require_base(); + var SignersApiAxiosParamCreator = function(configuration) { + return { + /** + * + * @summary Creates a new signer. + * @param {SignerCreateRequest} signerCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSigner: (signerCreateRequest_1, ...args_1) => __awaiter(this, [signerCreateRequest_1, ...args_1], void 0, function* (signerCreateRequest, options = {}) { + (0, common_1.assertParamExists)("createSigner", "signerCreateRequest", signerCreateRequest); + const localVarPath = `/api/v1/signers`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signerCreateRequest, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Deletes a signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { + (0, common_1.assertParamExists)("deleteSigner", "signerId", signerId); + const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Retrieves details of a specific signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { + (0, common_1.assertParamExists)("getSigner", "signerId", signerId); + const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. + * @summary Signer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSigners: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { + const localVarPath = `/api/v1/signers`; + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + if (page !== void 0) { + localVarQueryParameter["page"] = page; + } + if (perPage !== void 0) { + localVarQueryParameter["per_page"] = perPage; + } + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }), + /** + * + * @summary Updates an existing signer. + * @param {string} signerId Signer ID + * @param {{ [key: string]: any; }} requestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateSigner: (signerId_1, requestBody_1, ...args_1) => __awaiter(this, [signerId_1, requestBody_1, ...args_1], void 0, function* (signerId, requestBody, options = {}) { + (0, common_1.assertParamExists)("updateSigner", "signerId", signerId); + (0, common_1.assertParamExists)("updateSigner", "requestBody", requestBody); + const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); + const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); + const localVarHeaderParameter = {}; + const localVarQueryParameter = {}; + yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); + localVarHeaderParameter["Content-Type"] = "application/json"; + (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); + localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(requestBody, localVarRequestOptions, configuration); + return { + url: (0, common_1.toPathString)(localVarUrlObj), + options: localVarRequestOptions + }; + }) + }; + }; + exports2.SignersApiAxiosParamCreator = SignersApiAxiosParamCreator; + var SignersApiFp = function(configuration) { + const localVarAxiosParamCreator = (0, exports2.SignersApiAxiosParamCreator)(configuration); + return { + /** + * + * @summary Creates a new signer. + * @param {SignerCreateRequest} signerCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSigner(signerCreateRequest, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.createSigner(signerCreateRequest, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.createSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Deletes a signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSigner(signerId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteSigner(signerId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.deleteSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Retrieves details of a specific signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSigner(signerId, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.getSigner(signerId, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.getSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. + * @summary Signer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSigners(page, perPage, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.listSigners(page, perPage, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.listSigners"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + }, + /** + * + * @summary Updates an existing signer. + * @param {string} signerId Signer ID + * @param {{ [key: string]: any; }} requestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateSigner(signerId, requestBody, options) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b, _c; + const localVarAxiosArgs = yield localVarAxiosParamCreator.updateSigner(signerId, requestBody, options); + const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; + const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.updateSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; + return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }); + } + }; + }; + exports2.SignersApiFp = SignersApiFp; + var SignersApiFactory = function(configuration, basePath, axios) { + const localVarFp = (0, exports2.SignersApiFp)(configuration); + return { + /** + * + * @summary Creates a new signer. + * @param {SignerCreateRequest} signerCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createSigner(signerCreateRequest, options) { + return localVarFp.createSigner(signerCreateRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes a signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteSigner(signerId, options) { + return localVarFp.deleteSigner(signerId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Retrieves details of a specific signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSigner(signerId, options) { + return localVarFp.getSigner(signerId, options).then((request) => request(axios, basePath)); + }, + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. + * @summary Signer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listSigners(page, perPage, options) { + return localVarFp.listSigners(page, perPage, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Updates an existing signer. + * @param {string} signerId Signer ID + * @param {{ [key: string]: any; }} requestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateSigner(signerId, requestBody, options) { + return localVarFp.updateSigner(signerId, requestBody, options).then((request) => request(axios, basePath)); + } + }; + }; + exports2.SignersApiFactory = SignersApiFactory; + var SignersApi = class extends base_1.BaseAPI { + /** + * + * @summary Creates a new signer. + * @param {SignerCreateRequest} signerCreateRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignersApi + */ + createSigner(signerCreateRequest, options) { + return (0, exports2.SignersApiFp)(this.configuration).createSigner(signerCreateRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Deletes a signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignersApi + */ + deleteSigner(signerId, options) { + return (0, exports2.SignersApiFp)(this.configuration).deleteSigner(signerId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Retrieves details of a specific signer by ID. + * @param {string} signerId Signer ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignersApi + */ + getSigner(signerId, options) { + return (0, exports2.SignersApiFp)(this.configuration).getSigner(signerId, options).then((request) => request(this.axios, this.basePath)); + } + /** + * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. + * @summary Signer routes implementation + * @param {number} [page] Page number for pagination (starts at 1) + * @param {number} [perPage] Number of items per page (default: 10) + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignersApi + */ + listSigners(page, perPage, options) { + return (0, exports2.SignersApiFp)(this.configuration).listSigners(page, perPage, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary Updates an existing signer. + * @param {string} signerId Signer ID + * @param {{ [key: string]: any; }} requestBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SignersApi + */ + updateSigner(signerId, requestBody, options) { + return (0, exports2.SignersApiFp)(this.configuration).updateSigner(signerId, requestBody, options).then((request) => request(this.axios, this.basePath)); + } + }; + exports2.SignersApi = SignersApi; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js +var require_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js"(exports2) { + "use strict"; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar(require_health_api(), exports2); + __exportStar(require_metrics_api(), exports2); + __exportStar(require_notifications_api(), exports2); + __exportStar(require_plugins_api(), exports2); + __exportStar(require_relayers_api(), exports2); + __exportStar(require_signers_api(), exports2); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js +var require_configuration = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Configuration = void 0; + var Configuration = class { + constructor(param = {}) { + var _a; + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) }); + this.formDataCtor = param.formDataCtor; + } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + isJsonMime(mime) { + const jsonMime = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i"); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === "application/json-patch+json"); + } + }; + exports2.Configuration = Configuration; + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js +var require_api_response_balance_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js +var require_api_response_balance_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js +var require_api_response_delete_pending_transactions_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js +var require_api_response_delete_pending_transactions_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js +var require_api_response_notification_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js +var require_api_response_notification_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js +var require_api_response_plugin_handler_error = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js +var require_api_response_plugin_handler_error_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js +var require_api_response_relayer_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js +var require_api_response_relayer_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js +var require_api_response_relayer_status = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js +var require_api_response_relayer_status_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js +var require_api_response_relayer_status_data_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = void 0; + var ApiResponseRelayerStatusDataOneOfNetworkTypeEnum; + (function(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2) { + ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2["EVM"] = "evm"; + })(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js +var require_api_response_relayer_status_data_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = void 0; + var ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum; + (function(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2) { + ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2["STELLAR"] = "stellar"; + })(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js +var require_api_response_relayer_status_data_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = void 0; + var ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum; + (function(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2) { + ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2["SOLANA"] = "solana"; + })(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js +var require_api_response_sign_data_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js +var require_api_response_sign_data_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js +var require_api_response_sign_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js +var require_api_response_sign_transaction_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js +var require_api_response_signer_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js +var require_api_response_signer_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js +var require_api_response_string = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js +var require_api_response_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js +var require_api_response_transaction_response_data = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js +var require_api_response_value = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js +var require_api_response_vec_notification_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js +var require_api_response_vec_relayer_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js +var require_api_response_vec_signer_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js +var require_api_response_vec_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js +var require_asset_spec = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js +var require_asset_spec_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AssetSpecOneOfTypeEnum = void 0; + var AssetSpecOneOfTypeEnum; + (function(AssetSpecOneOfTypeEnum2) { + AssetSpecOneOfTypeEnum2["NATIVE"] = "native"; + })(AssetSpecOneOfTypeEnum || (exports2.AssetSpecOneOfTypeEnum = AssetSpecOneOfTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js +var require_asset_spec_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AssetSpecOneOf1TypeEnum = void 0; + var AssetSpecOneOf1TypeEnum; + (function(AssetSpecOneOf1TypeEnum2) { + AssetSpecOneOf1TypeEnum2["CREDIT4"] = "credit4"; + })(AssetSpecOneOf1TypeEnum || (exports2.AssetSpecOneOf1TypeEnum = AssetSpecOneOf1TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js +var require_asset_spec_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AssetSpecOneOf2TypeEnum = void 0; + var AssetSpecOneOf2TypeEnum; + (function(AssetSpecOneOf2TypeEnum2) { + AssetSpecOneOf2TypeEnum2["CREDIT12"] = "credit12"; + })(AssetSpecOneOf2TypeEnum || (exports2.AssetSpecOneOf2TypeEnum = AssetSpecOneOf2TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js +var require_auth_spec = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js +var require_auth_spec_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthSpecOneOfTypeEnum = void 0; + var AuthSpecOneOfTypeEnum; + (function(AuthSpecOneOfTypeEnum2) { + AuthSpecOneOfTypeEnum2["NONE"] = "none"; + })(AuthSpecOneOfTypeEnum || (exports2.AuthSpecOneOfTypeEnum = AuthSpecOneOfTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js +var require_auth_spec_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthSpecOneOf1TypeEnum = void 0; + var AuthSpecOneOf1TypeEnum; + (function(AuthSpecOneOf1TypeEnum2) { + AuthSpecOneOf1TypeEnum2["SOURCE_ACCOUNT"] = "source_account"; + })(AuthSpecOneOf1TypeEnum || (exports2.AuthSpecOneOf1TypeEnum = AuthSpecOneOf1TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js +var require_auth_spec_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthSpecOneOf2TypeEnum = void 0; + var AuthSpecOneOf2TypeEnum; + (function(AuthSpecOneOf2TypeEnum2) { + AuthSpecOneOf2TypeEnum2["ADDRESSES"] = "addresses"; + })(AuthSpecOneOf2TypeEnum || (exports2.AuthSpecOneOf2TypeEnum = AuthSpecOneOf2TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js +var require_auth_spec_one_of3 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthSpecOneOf3TypeEnum = void 0; + var AuthSpecOneOf3TypeEnum; + (function(AuthSpecOneOf3TypeEnum2) { + AuthSpecOneOf3TypeEnum2["XDR"] = "xdr"; + })(AuthSpecOneOf3TypeEnum || (exports2.AuthSpecOneOf3TypeEnum = AuthSpecOneOf3TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js +var require_aws_kms_signer_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js +var require_balance_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js +var require_cdp_signer_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js +var require_contract_source = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js +var require_contract_source_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ContractSourceOneOfFromEnum = void 0; + var ContractSourceOneOfFromEnum; + (function(ContractSourceOneOfFromEnum2) { + ContractSourceOneOfFromEnum2["ADDRESS"] = "address"; + })(ContractSourceOneOfFromEnum || (exports2.ContractSourceOneOfFromEnum = ContractSourceOneOfFromEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js +var require_contract_source_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ContractSourceOneOf1FromEnum = void 0; + var ContractSourceOneOf1FromEnum; + (function(ContractSourceOneOf1FromEnum2) { + ContractSourceOneOf1FromEnum2["CONTRACT"] = "contract"; + })(ContractSourceOneOf1FromEnum || (exports2.ContractSourceOneOf1FromEnum = ContractSourceOneOf1FromEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js +var require_create_relayer_policy_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js +var require_create_relayer_policy_request_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js +var require_create_relayer_policy_request_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js +var require_create_relayer_policy_request_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js +var require_create_relayer_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js +var require_delete_pending_transactions_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js +var require_disabled_reason = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js +var require_disabled_reason_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DisabledReasonOneOfTypeEnum = void 0; + var DisabledReasonOneOfTypeEnum; + (function(DisabledReasonOneOfTypeEnum2) { + DisabledReasonOneOfTypeEnum2["NONCE_SYNC_FAILED"] = "NonceSyncFailed"; + })(DisabledReasonOneOfTypeEnum || (exports2.DisabledReasonOneOfTypeEnum = DisabledReasonOneOfTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js +var require_disabled_reason_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DisabledReasonOneOf1TypeEnum = void 0; + var DisabledReasonOneOf1TypeEnum; + (function(DisabledReasonOneOf1TypeEnum2) { + DisabledReasonOneOf1TypeEnum2["RPC_VALIDATION_FAILED"] = "RpcValidationFailed"; + })(DisabledReasonOneOf1TypeEnum || (exports2.DisabledReasonOneOf1TypeEnum = DisabledReasonOneOf1TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js +var require_disabled_reason_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DisabledReasonOneOf2TypeEnum = void 0; + var DisabledReasonOneOf2TypeEnum; + (function(DisabledReasonOneOf2TypeEnum2) { + DisabledReasonOneOf2TypeEnum2["BALANCE_CHECK_FAILED"] = "BalanceCheckFailed"; + })(DisabledReasonOneOf2TypeEnum || (exports2.DisabledReasonOneOf2TypeEnum = DisabledReasonOneOf2TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js +var require_disabled_reason_one_of3 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DisabledReasonOneOf3TypeEnum = void 0; + var DisabledReasonOneOf3TypeEnum; + (function(DisabledReasonOneOf3TypeEnum2) { + DisabledReasonOneOf3TypeEnum2["SEQUENCE_SYNC_FAILED"] = "SequenceSyncFailed"; + })(DisabledReasonOneOf3TypeEnum || (exports2.DisabledReasonOneOf3TypeEnum = DisabledReasonOneOf3TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js +var require_disabled_reason_one_of4 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DisabledReasonOneOf4TypeEnum = void 0; + var DisabledReasonOneOf4TypeEnum; + (function(DisabledReasonOneOf4TypeEnum2) { + DisabledReasonOneOf4TypeEnum2["MULTIPLE"] = "Multiple"; + })(DisabledReasonOneOf4TypeEnum || (exports2.DisabledReasonOneOf4TypeEnum = DisabledReasonOneOf4TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js +var require_evm_policy_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js +var require_evm_rpc_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js +var require_evm_rpc_request_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js +var require_evm_rpc_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js +var require_evm_transaction_data_signature = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js +var require_evm_transaction_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js +var require_evm_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js +var require_fee_estimate_request_params = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js +var require_fee_estimate_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js +var require_get_features_enabled_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js +var require_get_supported_tokens_item = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js +var require_get_supported_tokens_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js +var require_google_cloud_kms_signer_key_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js +var require_google_cloud_kms_signer_key_response_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js +var require_google_cloud_kms_signer_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js +var require_google_cloud_kms_signer_service_account_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js +var require_google_cloud_kms_signer_service_account_response_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js +var require_json_rpc_error = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js +var require_json_rpc_id = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js +var require_json_rpc_request_network_rpc_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js +var require_json_rpc_response_network_rpc_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js +var require_json_rpc_response_network_rpc_result_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js +var require_jupiter_swap_options = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js +var require_local_signer_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js +var require_log_entry = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js +var require_log_level = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LogLevel = void 0; + var LogLevel; + (function(LogLevel2) { + LogLevel2["LOG"] = "log"; + LogLevel2["INFO"] = "info"; + LogLevel2["ERROR"] = "error"; + LogLevel2["WARN"] = "warn"; + LogLevel2["DEBUG"] = "debug"; + LogLevel2["RESULT"] = "result"; + })(LogLevel || (exports2.LogLevel = LogLevel = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js +var require_memo_spec = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js +var require_memo_spec_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MemoSpecOneOfTypeEnum = void 0; + var MemoSpecOneOfTypeEnum; + (function(MemoSpecOneOfTypeEnum2) { + MemoSpecOneOfTypeEnum2["NONE"] = "none"; + })(MemoSpecOneOfTypeEnum || (exports2.MemoSpecOneOfTypeEnum = MemoSpecOneOfTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js +var require_memo_spec_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MemoSpecOneOf1TypeEnum = void 0; + var MemoSpecOneOf1TypeEnum; + (function(MemoSpecOneOf1TypeEnum2) { + MemoSpecOneOf1TypeEnum2["TEXT"] = "text"; + })(MemoSpecOneOf1TypeEnum || (exports2.MemoSpecOneOf1TypeEnum = MemoSpecOneOf1TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js +var require_memo_spec_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MemoSpecOneOf2TypeEnum = void 0; + var MemoSpecOneOf2TypeEnum; + (function(MemoSpecOneOf2TypeEnum2) { + MemoSpecOneOf2TypeEnum2["ID"] = "id"; + })(MemoSpecOneOf2TypeEnum || (exports2.MemoSpecOneOf2TypeEnum = MemoSpecOneOf2TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js +var require_memo_spec_one_of3 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MemoSpecOneOf3TypeEnum = void 0; + var MemoSpecOneOf3TypeEnum; + (function(MemoSpecOneOf3TypeEnum2) { + MemoSpecOneOf3TypeEnum2["HASH"] = "hash"; + })(MemoSpecOneOf3TypeEnum || (exports2.MemoSpecOneOf3TypeEnum = MemoSpecOneOf3TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js +var require_memo_spec_one_of4 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MemoSpecOneOf4TypeEnum = void 0; + var MemoSpecOneOf4TypeEnum; + (function(MemoSpecOneOf4TypeEnum2) { + MemoSpecOneOf4TypeEnum2["RETURN"] = "return"; + })(MemoSpecOneOf4TypeEnum || (exports2.MemoSpecOneOf4TypeEnum = MemoSpecOneOf4TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js +var require_network_policy_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js +var require_network_rpc_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js +var require_network_rpc_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js +var require_network_transaction_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js +var require_notification_create_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js +var require_notification_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js +var require_notification_type = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.NotificationType = void 0; + var NotificationType; + (function(NotificationType2) { + NotificationType2["WEBHOOK"] = "webhook"; + })(NotificationType || (exports2.NotificationType = NotificationType = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js +var require_notification_update_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js +var require_operation_spec = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js +var require_operation_spec_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OperationSpecOneOfTypeEnum = void 0; + var OperationSpecOneOfTypeEnum; + (function(OperationSpecOneOfTypeEnum2) { + OperationSpecOneOfTypeEnum2["PAYMENT"] = "payment"; + })(OperationSpecOneOfTypeEnum || (exports2.OperationSpecOneOfTypeEnum = OperationSpecOneOfTypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js +var require_operation_spec_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OperationSpecOneOf1TypeEnum = void 0; + var OperationSpecOneOf1TypeEnum; + (function(OperationSpecOneOf1TypeEnum2) { + OperationSpecOneOf1TypeEnum2["INVOKE_CONTRACT"] = "invoke_contract"; + })(OperationSpecOneOf1TypeEnum || (exports2.OperationSpecOneOf1TypeEnum = OperationSpecOneOf1TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js +var require_operation_spec_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OperationSpecOneOf2TypeEnum = void 0; + var OperationSpecOneOf2TypeEnum; + (function(OperationSpecOneOf2TypeEnum2) { + OperationSpecOneOf2TypeEnum2["CREATE_CONTRACT"] = "create_contract"; + })(OperationSpecOneOf2TypeEnum || (exports2.OperationSpecOneOf2TypeEnum = OperationSpecOneOf2TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js +var require_operation_spec_one_of3 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OperationSpecOneOf3TypeEnum = void 0; + var OperationSpecOneOf3TypeEnum; + (function(OperationSpecOneOf3TypeEnum2) { + OperationSpecOneOf3TypeEnum2["UPLOAD_WASM"] = "upload_wasm"; + })(OperationSpecOneOf3TypeEnum || (exports2.OperationSpecOneOf3TypeEnum = OperationSpecOneOf3TypeEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js +var require_pagination_meta = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js +var require_plugin_call_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js +var require_plugin_handler_error = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js +var require_plugin_metadata = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js +var require_prepare_transaction_request_params = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js +var require_prepare_transaction_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js +var require_relayer_evm_policy = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js +var require_relayer_network_policy = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js +var require_relayer_network_policy_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js +var require_relayer_network_policy_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js +var require_relayer_network_policy_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js +var require_relayer_network_policy_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js +var require_relayer_network_type = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RelayerNetworkType = void 0; + var RelayerNetworkType; + (function(RelayerNetworkType2) { + RelayerNetworkType2["EVM"] = "evm"; + RelayerNetworkType2["SOLANA"] = "solana"; + RelayerNetworkType2["STELLAR"] = "stellar"; + })(RelayerNetworkType || (exports2.RelayerNetworkType = RelayerNetworkType = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js +var require_relayer_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js +var require_relayer_solana_policy = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js +var require_relayer_solana_swap_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js +var require_relayer_status = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js +var require_relayer_stellar_policy = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js +var require_rpc_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js +var require_sign_and_send_transaction_request_params = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js +var require_sign_and_send_transaction_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js +var require_sign_data_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js +var require_sign_data_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js +var require_sign_data_response_evm = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js +var require_sign_data_response_solana = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js +var require_sign_transaction_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js +var require_sign_transaction_request_params = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js +var require_sign_transaction_request_solana = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js +var require_sign_transaction_request_stellar = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js +var require_sign_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js +var require_sign_transaction_response_solana = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js +var require_sign_transaction_response_stellar = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js +var require_sign_transaction_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js +var require_sign_typed_data_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js +var require_signer_config_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js +var require_signer_config_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js +var require_signer_config_response_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js +var require_signer_config_response_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js +var require_signer_config_response_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js +var require_signer_config_response_one_of3 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js +var require_signer_config_response_one_of4 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js +var require_signer_config_response_one_of5 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js +var require_signer_create_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js +var require_signer_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js +var require_signer_type = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SignerType = void 0; + var SignerType; + (function(SignerType2) { + SignerType2["LOCAL"] = "local"; + SignerType2["AWS_KMS"] = "aws_kms"; + SignerType2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; + SignerType2["VAULT"] = "vault"; + SignerType2["VAULT_TRANSIT"] = "vault_transit"; + SignerType2["TURNKEY"] = "turnkey"; + SignerType2["CDP"] = "cdp"; + })(SignerType || (exports2.SignerType = SignerType = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js +var require_signer_type_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SignerTypeRequest = void 0; + var SignerTypeRequest; + (function(SignerTypeRequest2) { + SignerTypeRequest2["PLAIN"] = "plain"; + SignerTypeRequest2["AWS_KMS"] = "aws_kms"; + SignerTypeRequest2["VAULT"] = "vault"; + SignerTypeRequest2["VAULT_TRANSIT"] = "vault_transit"; + SignerTypeRequest2["TURNKEY"] = "turnkey"; + SignerTypeRequest2["CDP"] = "cdp"; + SignerTypeRequest2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; + })(SignerTypeRequest || (exports2.SignerTypeRequest = SignerTypeRequest = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js +var require_solana_account_meta = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js +var require_solana_allowed_tokens_policy = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js +var require_solana_allowed_tokens_swap_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js +var require_solana_fee_payment_strategy = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaFeePaymentStrategy = void 0; + var SolanaFeePaymentStrategy; + (function(SolanaFeePaymentStrategy2) { + SolanaFeePaymentStrategy2["USER"] = "user"; + SolanaFeePaymentStrategy2["RELAYER"] = "relayer"; + })(SolanaFeePaymentStrategy || (exports2.SolanaFeePaymentStrategy = SolanaFeePaymentStrategy = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js +var require_solana_instruction_spec = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js +var require_solana_policy_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js +var require_solana_rpc_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js +var require_solana_rpc_request_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOfMethodEnum = void 0; + var SolanaRpcRequestOneOfMethodEnum; + (function(SolanaRpcRequestOneOfMethodEnum2) { + SolanaRpcRequestOneOfMethodEnum2["FEE_ESTIMATE"] = "feeEstimate"; + })(SolanaRpcRequestOneOfMethodEnum || (exports2.SolanaRpcRequestOneOfMethodEnum = SolanaRpcRequestOneOfMethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js +var require_solana_rpc_request_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOf1MethodEnum = void 0; + var SolanaRpcRequestOneOf1MethodEnum; + (function(SolanaRpcRequestOneOf1MethodEnum2) { + SolanaRpcRequestOneOf1MethodEnum2["TRANSFER_TRANSACTION"] = "transferTransaction"; + })(SolanaRpcRequestOneOf1MethodEnum || (exports2.SolanaRpcRequestOneOf1MethodEnum = SolanaRpcRequestOneOf1MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js +var require_solana_rpc_request_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOf2MethodEnum = void 0; + var SolanaRpcRequestOneOf2MethodEnum; + (function(SolanaRpcRequestOneOf2MethodEnum2) { + SolanaRpcRequestOneOf2MethodEnum2["PREPARE_TRANSACTION"] = "prepareTransaction"; + })(SolanaRpcRequestOneOf2MethodEnum || (exports2.SolanaRpcRequestOneOf2MethodEnum = SolanaRpcRequestOneOf2MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js +var require_solana_rpc_request_one_of3 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOf3MethodEnum = void 0; + var SolanaRpcRequestOneOf3MethodEnum; + (function(SolanaRpcRequestOneOf3MethodEnum2) { + SolanaRpcRequestOneOf3MethodEnum2["SIGN_TRANSACTION"] = "signTransaction"; + })(SolanaRpcRequestOneOf3MethodEnum || (exports2.SolanaRpcRequestOneOf3MethodEnum = SolanaRpcRequestOneOf3MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js +var require_solana_rpc_request_one_of4 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOf4MethodEnum = void 0; + var SolanaRpcRequestOneOf4MethodEnum; + (function(SolanaRpcRequestOneOf4MethodEnum2) { + SolanaRpcRequestOneOf4MethodEnum2["SIGN_AND_SEND_TRANSACTION"] = "signAndSendTransaction"; + })(SolanaRpcRequestOneOf4MethodEnum || (exports2.SolanaRpcRequestOneOf4MethodEnum = SolanaRpcRequestOneOf4MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js +var require_solana_rpc_request_one_of5 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOf5MethodEnum = void 0; + var SolanaRpcRequestOneOf5MethodEnum; + (function(SolanaRpcRequestOneOf5MethodEnum2) { + SolanaRpcRequestOneOf5MethodEnum2["GET_SUPPORTED_TOKENS"] = "getSupportedTokens"; + })(SolanaRpcRequestOneOf5MethodEnum || (exports2.SolanaRpcRequestOneOf5MethodEnum = SolanaRpcRequestOneOf5MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js +var require_solana_rpc_request_one_of6 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOf6MethodEnum = void 0; + var SolanaRpcRequestOneOf6MethodEnum; + (function(SolanaRpcRequestOneOf6MethodEnum2) { + SolanaRpcRequestOneOf6MethodEnum2["GET_FEATURES_ENABLED"] = "getFeaturesEnabled"; + })(SolanaRpcRequestOneOf6MethodEnum || (exports2.SolanaRpcRequestOneOf6MethodEnum = SolanaRpcRequestOneOf6MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js +var require_solana_rpc_request_one_of7 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcRequestOneOf7MethodEnum = void 0; + var SolanaRpcRequestOneOf7MethodEnum; + (function(SolanaRpcRequestOneOf7MethodEnum2) { + SolanaRpcRequestOneOf7MethodEnum2["RAW_RPC_REQUEST"] = "rawRpcRequest"; + })(SolanaRpcRequestOneOf7MethodEnum || (exports2.SolanaRpcRequestOneOf7MethodEnum = SolanaRpcRequestOneOf7MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js +var require_solana_rpc_request_one_of7_params = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js +var require_solana_rpc_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js +var require_solana_rpc_result_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js +var require_solana_rpc_result_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js +var require_solana_rpc_result_one_of2 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js +var require_solana_rpc_result_one_of3 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js +var require_solana_rpc_result_one_of4 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js +var require_solana_rpc_result_one_of5 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js +var require_solana_rpc_result_one_of6 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js +var require_solana_rpc_result_one_of7 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaRpcResultOneOf7MethodEnum = void 0; + var SolanaRpcResultOneOf7MethodEnum; + (function(SolanaRpcResultOneOf7MethodEnum2) { + SolanaRpcResultOneOf7MethodEnum2["RAW_RPC"] = "rawRpc"; + })(SolanaRpcResultOneOf7MethodEnum || (exports2.SolanaRpcResultOneOf7MethodEnum = SolanaRpcResultOneOf7MethodEnum = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js +var require_solana_swap_strategy = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SolanaSwapStrategy = void 0; + var SolanaSwapStrategy; + (function(SolanaSwapStrategy2) { + SolanaSwapStrategy2["JUPITER_SWAP"] = "jupiter-swap"; + SolanaSwapStrategy2["JUPITER_ULTRA"] = "jupiter-ultra"; + SolanaSwapStrategy2["NOOP"] = "noop"; + })(SolanaSwapStrategy || (exports2.SolanaSwapStrategy = SolanaSwapStrategy = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js +var require_solana_transaction_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js +var require_solana_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js +var require_speed = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Speed = void 0; + var Speed; + (function(Speed2) { + Speed2["FASTEST"] = "fastest"; + Speed2["FAST"] = "fast"; + Speed2["AVERAGE"] = "average"; + Speed2["SAFE_LOW"] = "safeLow"; + })(Speed || (exports2.Speed = Speed = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js +var require_stellar_policy_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js +var require_stellar_rpc_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js +var require_stellar_rpc_request_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js +var require_stellar_rpc_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js +var require_stellar_transaction_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js +var require_stellar_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js +var require_transaction_response = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js +var require_transaction_status = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TransactionStatus = void 0; + var TransactionStatus2; + (function(TransactionStatus3) { + TransactionStatus3["CANCELED"] = "canceled"; + TransactionStatus3["PENDING"] = "pending"; + TransactionStatus3["SENT"] = "sent"; + TransactionStatus3["SUBMITTED"] = "submitted"; + TransactionStatus3["MINED"] = "mined"; + TransactionStatus3["CONFIRMED"] = "confirmed"; + TransactionStatus3["FAILED"] = "failed"; + TransactionStatus3["EXPIRED"] = "expired"; + })(TransactionStatus2 || (exports2.TransactionStatus = TransactionStatus2 = {})); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js +var require_transfer_transaction_request_params = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js +var require_transfer_transaction_result = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js +var require_turnkey_signer_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js +var require_update_relayer_request = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js +var require_vault_signer_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js +var require_vault_transit_signer_request_config = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js +var require_wasm_source = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js +var require_wasm_source_one_of = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js +var require_wasm_source_one_of1 = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js +var require_plugin_api = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PluginError = void 0; + exports2.pluginError = pluginError2; + var PluginError = class extends Error { + constructor(message, opts) { + super(message); + this.name = "PluginError"; + this.code = opts === null || opts === void 0 ? void 0 : opts.code; + this.status = opts === null || opts === void 0 ? void 0 : opts.status; + this.details = opts === null || opts === void 0 ? void 0 : opts.details; + } + }; + exports2.PluginError = PluginError; + function pluginError2(message, opts) { + return new PluginError(message, opts); + } + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js +var require_models = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js"(exports2) { + "use strict"; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar(require_api_response_balance_response(), exports2); + __exportStar(require_api_response_balance_response_data(), exports2); + __exportStar(require_api_response_delete_pending_transactions_response(), exports2); + __exportStar(require_api_response_delete_pending_transactions_response_data(), exports2); + __exportStar(require_api_response_notification_response(), exports2); + __exportStar(require_api_response_notification_response_data(), exports2); + __exportStar(require_api_response_plugin_handler_error(), exports2); + __exportStar(require_api_response_plugin_handler_error_data(), exports2); + __exportStar(require_api_response_relayer_response(), exports2); + __exportStar(require_api_response_relayer_response_data(), exports2); + __exportStar(require_api_response_relayer_status(), exports2); + __exportStar(require_api_response_relayer_status_data(), exports2); + __exportStar(require_api_response_relayer_status_data_one_of(), exports2); + __exportStar(require_api_response_relayer_status_data_one_of1(), exports2); + __exportStar(require_api_response_relayer_status_data_one_of2(), exports2); + __exportStar(require_api_response_sign_data_response(), exports2); + __exportStar(require_api_response_sign_data_response_data(), exports2); + __exportStar(require_api_response_sign_transaction_response(), exports2); + __exportStar(require_api_response_sign_transaction_response_data(), exports2); + __exportStar(require_api_response_signer_response(), exports2); + __exportStar(require_api_response_signer_response_data(), exports2); + __exportStar(require_api_response_string(), exports2); + __exportStar(require_api_response_transaction_response(), exports2); + __exportStar(require_api_response_transaction_response_data(), exports2); + __exportStar(require_api_response_value(), exports2); + __exportStar(require_api_response_vec_notification_response(), exports2); + __exportStar(require_api_response_vec_relayer_response(), exports2); + __exportStar(require_api_response_vec_signer_response(), exports2); + __exportStar(require_api_response_vec_transaction_response(), exports2); + __exportStar(require_asset_spec(), exports2); + __exportStar(require_asset_spec_one_of(), exports2); + __exportStar(require_asset_spec_one_of1(), exports2); + __exportStar(require_asset_spec_one_of2(), exports2); + __exportStar(require_auth_spec(), exports2); + __exportStar(require_auth_spec_one_of(), exports2); + __exportStar(require_auth_spec_one_of1(), exports2); + __exportStar(require_auth_spec_one_of2(), exports2); + __exportStar(require_auth_spec_one_of3(), exports2); + __exportStar(require_aws_kms_signer_request_config(), exports2); + __exportStar(require_balance_response(), exports2); + __exportStar(require_cdp_signer_request_config(), exports2); + __exportStar(require_contract_source(), exports2); + __exportStar(require_contract_source_one_of(), exports2); + __exportStar(require_contract_source_one_of1(), exports2); + __exportStar(require_create_relayer_policy_request(), exports2); + __exportStar(require_create_relayer_policy_request_one_of(), exports2); + __exportStar(require_create_relayer_policy_request_one_of1(), exports2); + __exportStar(require_create_relayer_policy_request_one_of2(), exports2); + __exportStar(require_create_relayer_request(), exports2); + __exportStar(require_delete_pending_transactions_response(), exports2); + __exportStar(require_disabled_reason(), exports2); + __exportStar(require_disabled_reason_one_of(), exports2); + __exportStar(require_disabled_reason_one_of1(), exports2); + __exportStar(require_disabled_reason_one_of2(), exports2); + __exportStar(require_disabled_reason_one_of3(), exports2); + __exportStar(require_disabled_reason_one_of4(), exports2); + __exportStar(require_evm_policy_response(), exports2); + __exportStar(require_evm_rpc_request(), exports2); + __exportStar(require_evm_rpc_request_one_of(), exports2); + __exportStar(require_evm_rpc_result(), exports2); + __exportStar(require_evm_transaction_data_signature(), exports2); + __exportStar(require_evm_transaction_request(), exports2); + __exportStar(require_evm_transaction_response(), exports2); + __exportStar(require_fee_estimate_request_params(), exports2); + __exportStar(require_fee_estimate_result(), exports2); + __exportStar(require_get_features_enabled_result(), exports2); + __exportStar(require_get_supported_tokens_item(), exports2); + __exportStar(require_get_supported_tokens_result(), exports2); + __exportStar(require_google_cloud_kms_signer_key_request_config(), exports2); + __exportStar(require_google_cloud_kms_signer_key_response_config(), exports2); + __exportStar(require_google_cloud_kms_signer_request_config(), exports2); + __exportStar(require_google_cloud_kms_signer_service_account_request_config(), exports2); + __exportStar(require_google_cloud_kms_signer_service_account_response_config(), exports2); + __exportStar(require_json_rpc_error(), exports2); + __exportStar(require_json_rpc_id(), exports2); + __exportStar(require_json_rpc_request_network_rpc_request(), exports2); + __exportStar(require_json_rpc_response_network_rpc_result(), exports2); + __exportStar(require_json_rpc_response_network_rpc_result_result(), exports2); + __exportStar(require_jupiter_swap_options(), exports2); + __exportStar(require_local_signer_request_config(), exports2); + __exportStar(require_log_entry(), exports2); + __exportStar(require_log_level(), exports2); + __exportStar(require_memo_spec(), exports2); + __exportStar(require_memo_spec_one_of(), exports2); + __exportStar(require_memo_spec_one_of1(), exports2); + __exportStar(require_memo_spec_one_of2(), exports2); + __exportStar(require_memo_spec_one_of3(), exports2); + __exportStar(require_memo_spec_one_of4(), exports2); + __exportStar(require_network_policy_response(), exports2); + __exportStar(require_network_rpc_request(), exports2); + __exportStar(require_network_rpc_result(), exports2); + __exportStar(require_network_transaction_request(), exports2); + __exportStar(require_notification_create_request(), exports2); + __exportStar(require_notification_response(), exports2); + __exportStar(require_notification_type(), exports2); + __exportStar(require_notification_update_request(), exports2); + __exportStar(require_operation_spec(), exports2); + __exportStar(require_operation_spec_one_of(), exports2); + __exportStar(require_operation_spec_one_of1(), exports2); + __exportStar(require_operation_spec_one_of2(), exports2); + __exportStar(require_operation_spec_one_of3(), exports2); + __exportStar(require_pagination_meta(), exports2); + __exportStar(require_plugin_call_request(), exports2); + __exportStar(require_plugin_handler_error(), exports2); + __exportStar(require_plugin_metadata(), exports2); + __exportStar(require_prepare_transaction_request_params(), exports2); + __exportStar(require_prepare_transaction_result(), exports2); + __exportStar(require_relayer_evm_policy(), exports2); + __exportStar(require_relayer_network_policy(), exports2); + __exportStar(require_relayer_network_policy_one_of(), exports2); + __exportStar(require_relayer_network_policy_one_of1(), exports2); + __exportStar(require_relayer_network_policy_one_of2(), exports2); + __exportStar(require_relayer_network_policy_response(), exports2); + __exportStar(require_relayer_network_type(), exports2); + __exportStar(require_relayer_response(), exports2); + __exportStar(require_relayer_solana_policy(), exports2); + __exportStar(require_relayer_solana_swap_config(), exports2); + __exportStar(require_relayer_status(), exports2); + __exportStar(require_relayer_stellar_policy(), exports2); + __exportStar(require_rpc_config(), exports2); + __exportStar(require_sign_and_send_transaction_request_params(), exports2); + __exportStar(require_sign_and_send_transaction_result(), exports2); + __exportStar(require_sign_data_request(), exports2); + __exportStar(require_sign_data_response(), exports2); + __exportStar(require_sign_data_response_evm(), exports2); + __exportStar(require_sign_data_response_solana(), exports2); + __exportStar(require_sign_transaction_request(), exports2); + __exportStar(require_sign_transaction_request_params(), exports2); + __exportStar(require_sign_transaction_request_solana(), exports2); + __exportStar(require_sign_transaction_request_stellar(), exports2); + __exportStar(require_sign_transaction_response(), exports2); + __exportStar(require_sign_transaction_response_solana(), exports2); + __exportStar(require_sign_transaction_response_stellar(), exports2); + __exportStar(require_sign_transaction_result(), exports2); + __exportStar(require_sign_typed_data_request(), exports2); + __exportStar(require_signer_config_request(), exports2); + __exportStar(require_signer_config_response(), exports2); + __exportStar(require_signer_config_response_one_of(), exports2); + __exportStar(require_signer_config_response_one_of1(), exports2); + __exportStar(require_signer_config_response_one_of2(), exports2); + __exportStar(require_signer_config_response_one_of3(), exports2); + __exportStar(require_signer_config_response_one_of4(), exports2); + __exportStar(require_signer_config_response_one_of5(), exports2); + __exportStar(require_signer_create_request(), exports2); + __exportStar(require_signer_response(), exports2); + __exportStar(require_signer_type(), exports2); + __exportStar(require_signer_type_request(), exports2); + __exportStar(require_solana_account_meta(), exports2); + __exportStar(require_solana_allowed_tokens_policy(), exports2); + __exportStar(require_solana_allowed_tokens_swap_config(), exports2); + __exportStar(require_solana_fee_payment_strategy(), exports2); + __exportStar(require_solana_instruction_spec(), exports2); + __exportStar(require_solana_policy_response(), exports2); + __exportStar(require_solana_rpc_request(), exports2); + __exportStar(require_solana_rpc_request_one_of(), exports2); + __exportStar(require_solana_rpc_request_one_of1(), exports2); + __exportStar(require_solana_rpc_request_one_of2(), exports2); + __exportStar(require_solana_rpc_request_one_of3(), exports2); + __exportStar(require_solana_rpc_request_one_of4(), exports2); + __exportStar(require_solana_rpc_request_one_of5(), exports2); + __exportStar(require_solana_rpc_request_one_of6(), exports2); + __exportStar(require_solana_rpc_request_one_of7(), exports2); + __exportStar(require_solana_rpc_request_one_of7_params(), exports2); + __exportStar(require_solana_rpc_result(), exports2); + __exportStar(require_solana_rpc_result_one_of(), exports2); + __exportStar(require_solana_rpc_result_one_of1(), exports2); + __exportStar(require_solana_rpc_result_one_of2(), exports2); + __exportStar(require_solana_rpc_result_one_of3(), exports2); + __exportStar(require_solana_rpc_result_one_of4(), exports2); + __exportStar(require_solana_rpc_result_one_of5(), exports2); + __exportStar(require_solana_rpc_result_one_of6(), exports2); + __exportStar(require_solana_rpc_result_one_of7(), exports2); + __exportStar(require_solana_swap_strategy(), exports2); + __exportStar(require_solana_transaction_request(), exports2); + __exportStar(require_solana_transaction_response(), exports2); + __exportStar(require_speed(), exports2); + __exportStar(require_stellar_policy_response(), exports2); + __exportStar(require_stellar_rpc_request(), exports2); + __exportStar(require_stellar_rpc_request_one_of(), exports2); + __exportStar(require_stellar_rpc_result(), exports2); + __exportStar(require_stellar_transaction_request(), exports2); + __exportStar(require_stellar_transaction_response(), exports2); + __exportStar(require_transaction_response(), exports2); + __exportStar(require_transaction_status(), exports2); + __exportStar(require_transfer_transaction_request_params(), exports2); + __exportStar(require_transfer_transaction_result(), exports2); + __exportStar(require_turnkey_signer_request_config(), exports2); + __exportStar(require_update_relayer_request(), exports2); + __exportStar(require_vault_signer_request_config(), exports2); + __exportStar(require_vault_transit_signer_request_config(), exports2); + __exportStar(require_wasm_source(), exports2); + __exportStar(require_wasm_source_one_of(), exports2); + __exportStar(require_wasm_source_one_of1(), exports2); + __exportStar(require_plugin_api(), exports2); + } +}); + +// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js +var require_dist = __commonJS({ + "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js"(exports2) { + "use strict"; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar(require_api(), exports2); + __exportStar(require_configuration(), exports2); + __exportStar(require_models(), exports2); + } +}); + +// lib/sandbox-executor.ts +var sandbox_executor_exports = {}; +__export(sandbox_executor_exports, { + default: () => executeInSandbox +}); +module.exports = __toCommonJS(sandbox_executor_exports); +var vm = __toESM(require("node:vm")); +var net = __toESM(require("node:net")); + +// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/stringify.js +var byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 256).toString(16).slice(1)); +} +function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); +} + +// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/rng.js +var import_crypto = require("crypto"); +var rnds8Pool = new Uint8Array(256); +var poolPtr = rnds8Pool.length; +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + (0, import_crypto.randomFillSync)(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} + +// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/native.js +var import_crypto2 = require("crypto"); +var native_default = { randomUUID: import_crypto2.randomUUID }; + +// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/v4.js +function v4(options, buf, offset) { + if (native_default.randomUUID && !buf && !options) { + return native_default.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? rng(); + if (rnds.length < 16) { + throw new Error("Random bytes length must be >= 16"); + } + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +var v4_default = v4; + +// lib/kv.ts +var import_ioredis = __toESM(require_built3()); +var import_crypto3 = require("crypto"); +var DefaultPluginKVStore = class { + /** + * Create a store bound to a plugin namespace. + * - pluginId: used for the namespace and Redis connection name. + * Curly braces are stripped to avoid nested hash-tags. + * - Uses REDIS_URL if provided; enables lazyConnect and auto pipelining. + */ + constructor(pluginId) { + this.KEY_REGEX = /^[A-Za-z0-9:_-]{1,512}$/; + this.UNLOCK_SCRIPT = 'if redis.call("GET", KEYS[1]) == ARGV[1] then return redis.call("UNLINK", KEYS[1]) else return 0 end'; + const url = process.env.REDIS_URL ?? "redis://localhost:6379"; + this.client = new import_ioredis.default(url, { + connectionName: `plugin_kv:${pluginId}`, + lazyConnect: true, + enableOfflineQueue: true, + enableAutoPipelining: true, + maxRetriesPerRequest: 1, + retryStrategy: (n) => Math.min(n * 50, 1e3) + }); + const pid = pluginId.replace(/[{}]/g, ""); + this.ns = `plugin_kv:{${pid}}`; + } + /** + * Build a namespaced Redis key for the given segment and user key. + * Validates the user-provided key and throws on invalid input. + * @param seg - The key segment: 'data' or 'lock'. + * @param key - The user-provided key to namespace. + * @returns The fully-qualified Redis key. + * @throws Error if the key does not match the allowed pattern. + */ + key(seg, key) { + if (!this.KEY_REGEX.test(key)) throw new Error("invalid key"); + return `${this.ns}:${seg}:${key}`; + } + /** + * Retrieve and JSON-parse the value for a key. + * Returns null if the key is not present. + * @typeParam T - Expected value type after JSON parse. + * @param key - The key to retrieve. + * @returns Resolves to the parsed value, or null if missing. + */ + async get(key) { + const v = await this.client.get(this.key("data", key)); + if (v == null) return null; + return JSON.parse(v); + } + /** + * Store a JSON-encoded value under the key. + * - If opts.ttlSec > 0, sets an expiry in seconds; otherwise no expiry. + * - Throws if value is undefined. + * Returns true on success. + * @param key - The key to set. + * @param value - Serializable value; must not be undefined. + * @param opts - Optional settings. + * @param opts.ttlSec - Time-to-live in seconds; if > 0, sets expiry. + * @returns True on success. + * @throws Error if `value` is undefined or the key is invalid. + */ + async set(key, value, opts) { + if (value === void 0) throw new Error("value must not be undefined"); + const payload = JSON.stringify(value); + const k = this.key("data", key); + const ex = Math.max(0, Math.floor(opts?.ttlSec ?? 0)); + const res = ex > 0 ? await this.client.set(k, payload, "EX", ex) : await this.client.set(k, payload); + return res === "OK"; + } + /** + * Remove the key. + * @param key - The key to remove. + * @returns True if exactly one key was unlinked. + */ + async del(key) { + const k = this.key("data", key); + const n = await this.client.unlink(k); + return n === 1; + } + /** + * Check whether a key exists. + * @param key - The key to check. + * @returns True if the key exists. + */ + async exists(key) { + return await this.client.exists(this.key("data", key)) === 1; + } + /** + * List keys in this store matching `pattern` (glob-like, default '*'). + * Returns bare keys (without namespace). Uses SCAN with COUNT=`batch`. + * @param pattern - Glob-like match pattern (default '*'). + * @param batch - SCAN COUNT per iteration (default 500). + * @returns Array of bare keys (without the namespace prefix). + */ + async listKeys(pattern = "*", batch = 500) { + const out = []; + let cursor = "0"; + const prefix = `${this.ns}:data:`; + do { + const [next, keys] = await this.client.scan(cursor, "MATCH", `${prefix}${pattern}`, "COUNT", batch); + cursor = next; + for (const k of keys) out.push(k.slice(prefix.length)); + } while (cursor !== "0"); + return out; + } + /** + * Delete all keys in this plugin namespace. + * Returns the number of keys removed. + * @returns The number of keys deleted. + */ + async clear() { + let cursor = "0"; + let deleted = 0; + do { + const [next, keys] = await this.client.scan(cursor, "MATCH", `${this.ns}:*`, "COUNT", 1e3); + cursor = next; + if (keys.length) { + const chunkSize = 512; + for (let i = 0; i < keys.length; i += chunkSize) { + const chunk = keys.slice(i, i + chunkSize); + const pipeline = this.client.pipeline(); + chunk.forEach((k) => pipeline.unlink(k)); + const results = await pipeline.exec(); + if (results) { + for (const [, res] of results) { + if (typeof res === "number") deleted += res; + } + } + } + } + } while (cursor !== "0"); + return deleted; + } + /** + * Run `fn` while holding a distributed lock for `key`. + * The lock is acquired with SET NX PX and released via a token-checked + * Lua script to avoid unlocking another client's lock. + * - opts.ttlSec: lock expiry in seconds (default 30) + * - opts.onBusy: 'throw' (default) or 'skip' to return null when busy + * @typeParam T - The return type of `fn`. + * @param key - The lock key. + * @param fn - Async function to execute while holding the lock. + * @param opts - Lock options. + * @param opts.ttlSec - Lock expiry in seconds (default 30). + * @param opts.onBusy - Behavior when the lock is busy: 'throw' or 'skip'. + * @returns The result of `fn`, or null when skipped due to a busy lock. + * @throws Error if the lock is busy and `onBusy` is 'throw'. + */ + async withLock(key, fn, opts) { + const ttlSec = opts?.ttlSec ?? 30; + const onBusy = opts?.onBusy ?? "throw"; + const lockKey = this.key("lock", key); + const token = (0, import_crypto3.randomUUID)(); + const ok = await this.client.set(lockKey, token, "PX", ttlSec * 1e3, "NX"); + if (ok !== "OK") { + if (onBusy === "skip") return null; + throw new Error("lock busy"); + } + try { + return await fn(); + } finally { + await this.client.eval(this.UNLOCK_SCRIPT, 1, lockKey, token); + } + } + /** + * Explicitly connect to Redis. + * Normally not needed since lazyConnect will connect on first command. + */ + async connect() { + await this.client.connect(); + } + /** + * Disconnect from Redis. + * Call this when the store is no longer needed. + */ + async disconnect() { + await this.client.disconnect(); + } +}; + +// lib/compiler.ts +var esbuild = __toESM(require_main()); +var fs = __toESM(require("node:fs")); +var path = __toESM(require("node:path")); +function wrapForVm(compiledCode) { + return ` +(function(exports, require, module, __filename, __dirname) { +${compiledCode} +}); +`; +} + +// lib/sandbox-executor.ts +var import_relayer_sdk = __toESM(require_dist()); +var SandboxPluginAPI = class { + constructor(socketPath, httpRequestId) { + this.socket = null; + this.connectionPromise = null; + this.connected = false; + this.socketPath = socketPath; + this.pending = /* @__PURE__ */ new Map(); + this.httpRequestId = httpRequestId; + } + async ensureConnected() { + if (this.connected) return; + if (!this.connectionPromise) { + this.socket = net.createConnection(this.socketPath); + this.connectionPromise = new Promise((resolve2, reject) => { + this.socket.on("connect", () => { + this.connected = true; + resolve2(); + }); + this.socket.on("error", (error) => { + reject(error); + }); + }); + this.socket.on("data", (data) => { + data.toString().split("\n").filter(Boolean).forEach((msg) => { + try { + const parsed = JSON.parse(msg); + const { requestId, result, error } = parsed; + const resolver = this.pending.get(requestId); + if (resolver) { + error ? resolver.reject(error) : resolver.resolve(result); + this.pending.delete(requestId); + } + } catch { + } + }); + }); + } + await this.connectionPromise; + } + useRelayer(relayerId) { + return { + sendTransaction: async (payload) => { + const result = await this.send(relayerId, "sendTransaction", payload); + return { + ...result, + wait: (options) => this.transactionWait(result, options) + }; + }, + getTransaction: (payload) => this.send(relayerId, "getTransaction", payload), + getRelayerStatus: () => this.send(relayerId, "getRelayerStatus", {}), + signTransaction: (payload) => this.send(relayerId, "signTransaction", payload), + getRelayer: () => this.send(relayerId, "getRelayer", {}), + rpc: (payload) => this.send(relayerId, "rpc", payload) + }; + } + async transactionWait(transaction, options) { + const interval = options?.interval ?? 5e3; + const timeout = options?.timeout ?? 6e4; + const relayer = this.useRelayer(transaction.relayer_id); + let shouldContinue = true; + const poll = async () => { + let tx = await relayer.getTransaction({ transactionId: transaction.id }); + while (shouldContinue && tx.status !== import_relayer_sdk.TransactionStatus.MINED && tx.status !== import_relayer_sdk.TransactionStatus.CONFIRMED && tx.status !== import_relayer_sdk.TransactionStatus.CANCELED && tx.status !== import_relayer_sdk.TransactionStatus.EXPIRED && tx.status !== import_relayer_sdk.TransactionStatus.FAILED) { + await new Promise((resolve2) => setTimeout(resolve2, interval)); + if (!shouldContinue) break; + tx = await relayer.getTransaction({ transactionId: transaction.id }); + } + return tx; + }; + let timeoutId; + const timeoutPromise = new Promise((_, reject) => { + timeoutId = setTimeout(() => { + shouldContinue = false; + reject((0, import_relayer_sdk.pluginError)(`Transaction ${transaction.id} timed out after ${timeout}ms`, { status: 504 })); + }, timeout); + }); + return Promise.race([poll(), timeoutPromise]).finally(() => { + shouldContinue = false; + if (timeoutId) clearTimeout(timeoutId); + }); + } + async send(relayerId, method, payload) { + const requestId = v4_default(); + const msg = { requestId, relayerId, method, payload }; + if (this.httpRequestId) { + msg.httpRequestId = this.httpRequestId; + } + const message = JSON.stringify(msg) + "\n"; + await this.ensureConnected(); + return new Promise((resolve2, reject) => { + this.pending.set(requestId, { resolve: resolve2, reject }); + this.socket.write(message, (error) => { + if (error) { + this.pending.delete(requestId); + reject(error); + } + }); + }); + } + close() { + if (this.socket) { + this.socket.destroy(); + } + } +}; +function createSandboxConsole(logs) { + const log = (level) => (...args) => { + const message = args.map( + (arg) => typeof arg === "object" ? JSON.stringify(arg) : String(arg) + ).join(" "); + logs.push({ level, message }); + }; + return { + log: log("log"), + info: log("info"), + warn: log("warn"), + error: log("error"), + debug: log("debug"), + trace: log("debug"), + // Required console methods (no-ops for unused ones) + assert: () => { + }, + clear: () => { + }, + count: () => { + }, + countReset: () => { + }, + dir: () => { + }, + dirxml: () => { + }, + group: () => { + }, + groupCollapsed: () => { + }, + groupEnd: () => { + }, + table: () => { + }, + time: () => { + }, + timeEnd: () => { + }, + timeLog: () => { + }, + timeStamp: () => { + }, + profile: () => { + }, + profileEnd: () => { + }, + Console: console.Console + }; +} +async function executeInSandbox(task) { + const logs = []; + const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); + const kv = new DefaultPluginKVStore(task.pluginId); + try { + const sandboxConsole = createSandboxConsole(logs); + const wrappedCode = wrapForVm(task.compiledCode); + const sandboxRequire = (id) => { + if (id === "@openzeppelin/relayer-sdk") { + return require_dist(); + } + throw new Error(`Module '${id}' is not available in plugin sandbox`); + }; + const moduleExports = {}; + const moduleObject = { exports: moduleExports }; + const context = vm.createContext({ + // Console for logging + console: sandboxConsole, + // CommonJS module system + exports: moduleExports, + require: sandboxRequire, + module: moduleObject, + __filename: `plugin-${task.pluginId}.js`, + __dirname: "/plugins", + // Timer functions + setTimeout, + setInterval, + setImmediate, + clearTimeout, + clearInterval, + clearImmediate, + // Promise (needed for async) + Promise, + // Buffer for binary data handling + Buffer, + // JSON utilities + JSON, + // Error types + Error, + TypeError, + RangeError, + SyntaxError, + // URL handling + URL, + URLSearchParams, + // TextEncoder/Decoder + TextEncoder, + TextDecoder + }); + const script = new vm.Script(wrappedCode, { + filename: `plugin-${task.pluginId}.js` + }); + const factory = script.runInContext(context, { timeout: task.timeout }); + factory(moduleExports, sandboxRequire, moduleObject, `plugin-${task.pluginId}.js`, "/plugins"); + const handler = moduleObject.exports.handler || moduleExports.handler; + if (!handler || typeof handler !== "function") { + throw new Error("Plugin must export a handler function"); + } + let result; + if (handler.length === 1) { + const pluginContext = { + api, + params: task.params, + kv, + headers: task.headers ?? {} + }; + result = await handler(pluginContext); + } else { + result = await handler(api, task.params); + } + return { + taskId: task.taskId, + success: true, + result, + logs + }; + } catch (error) { + const err = error; + let errorCode = "PLUGIN_ERROR"; + let errorMessage = String(error); + let errorStack; + let errorDetails = void 0; + let errorStatus = 500; + if (err && typeof err === "object") { + errorMessage = err.message || String(error); + if (err.name === "SyntaxError") { + errorCode = "SYNTAX_ERROR"; + } else if (err.name === "TypeError") { + errorCode = "TYPE_ERROR"; + } else if (err.name === "ReferenceError") { + errorCode = "REFERENCE_ERROR"; + } else if (err.code === "ERR_SCRIPT_EXECUTION_TIMEOUT") { + errorCode = "TIMEOUT"; + errorStatus = 504; + errorMessage = `Plugin execution timed out after ${task.timeout}ms`; + } else if (err.code) { + errorCode = err.code; + } + if (err.stack) { + errorStack = err.stack.split("\n").slice(0, 10).join("\n"); + } + if (err.details) { + errorDetails = err.details; + } + if (typeof err.status === "number") { + errorStatus = err.status; + } + } + return { + taskId: task.taskId, + success: false, + error: { + message: errorMessage, + code: errorCode, + status: errorStatus, + details: errorDetails ? { + ...errorDetails, + stack: errorStack + } : errorStack ? { stack: errorStack } : void 0 + }, + logs + }; + } finally { + api.close(); + } +} +/*! Bundled license information: + +mime-db/index.js: + (*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + *) + +mime-types/index.js: + (*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +axios/dist/node/axios.cjs: + (*! Axios v1.13.1 Copyright (c) 2025 Matt Zabriskie and contributors *) +*/ diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/sandbox-executor.ts new file mode 100644 index 000000000..4154bf07f --- /dev/null +++ b/plugins/lib/sandbox-executor.ts @@ -0,0 +1,442 @@ +/** + * Sandbox Executor Module + * + * Piscina worker that executes compiled JavaScript plugins in isolated node:vm contexts. + * Each task gets a fresh vm.createContext() for complete isolation between executions. + */ + +import * as vm from 'node:vm'; +import * as net from 'node:net'; +import { v4 as uuidv4 } from 'uuid'; +import type { PluginKVStore } from './kv'; +import { DefaultPluginKVStore } from './kv'; +import { LogInterceptor } from './logger'; +import { wrapForVm } from './compiler'; +import type { PluginAPI, PluginContext, PluginHeaders, Relayer } from './plugin'; +import { + ApiResponseRelayerResponseData, + ApiResponseRelayerStatusData, + JsonRpcRequestNetworkRpcRequest, + JsonRpcResponseNetworkRpcResult, + NetworkTransactionRequest, + SignTransactionResponse, + SignTransactionRequest, + TransactionResponse, + TransactionStatus, + pluginError, +} from '@openzeppelin/relayer-sdk'; + +/** + * Task payload received from the worker pool + */ +export interface SandboxTask { + /** Unique task ID for correlation */ + taskId: string; + /** Plugin ID for KV namespacing */ + pluginId: string; + /** Pre-compiled JavaScript code */ + compiledCode: string; + /** Plugin parameters */ + params: any; + /** HTTP headers from incoming request */ + headers?: PluginHeaders; + /** Unix socket path for relayer communication */ + socketPath: string; + /** HTTP request ID for tracing */ + httpRequestId?: string; + /** Execution timeout in milliseconds */ + timeout: number; +} + +/** + * Result returned from sandbox execution + */ +export interface SandboxResult { + /** Task ID for correlation */ + taskId: string; + /** Whether execution succeeded */ + success: boolean; + /** Return value (if success) */ + result?: any; + /** Error information (if failed) */ + error?: { + message: string; + code?: string; + status?: number; + details?: any; + }; + /** Captured console logs */ + logs: LogEntry[]; +} + +export interface LogEntry { + level: 'error' | 'warn' | 'info' | 'log' | 'debug' | 'result'; + message: string; +} + +/** + * Sandboxed Plugin API that communicates with the relayer via Unix socket. + * This is a minimal implementation for use within the vm context. + * Connection is lazy - only established when first API call is made. + */ +class SandboxPluginAPI implements PluginAPI { + private socket: net.Socket | null = null; + private pending: Map void; reject: (reason: any) => void }>; + private connectionPromise: Promise | null = null; + private connected: boolean = false; + private httpRequestId?: string; + private socketPath: string; + + constructor(socketPath: string, httpRequestId?: string) { + this.socketPath = socketPath; + this.pending = new Map(); + this.httpRequestId = httpRequestId; + } + + private async ensureConnected(): Promise { + if (this.connected) return; + + if (!this.connectionPromise) { + this.socket = net.createConnection(this.socketPath); + + this.connectionPromise = new Promise((resolve, reject) => { + this.socket!.on('connect', () => { + this.connected = true; + resolve(); + }); + + this.socket!.on('error', (error) => { + reject(error); + }); + }); + + this.socket.on('data', (data) => { + data + .toString() + .split('\n') + .filter(Boolean) + .forEach((msg: string) => { + try { + const parsed = JSON.parse(msg); + const { requestId, result, error } = parsed; + const resolver = this.pending.get(requestId); + if (resolver) { + error ? resolver.reject(error) : resolver.resolve(result); + this.pending.delete(requestId); + } + } catch { + // Ignore malformed messages + } + }); + }); + } + + await this.connectionPromise; + } + + useRelayer(relayerId: string): Relayer { + return { + sendTransaction: async (payload: NetworkTransactionRequest) => { + const result = await this.send<{ id: string; relayer_id: string }>(relayerId, 'sendTransaction', payload); + return { + ...result, + wait: (options?: { interval?: number; timeout?: number }) => + this.transactionWait(result, options), + } as any; + }, + getTransaction: (payload: { transactionId: string }) => + this.send(relayerId, 'getTransaction', payload), + getRelayerStatus: () => + this.send(relayerId, 'getRelayerStatus', {}), + signTransaction: (payload: SignTransactionRequest) => + this.send(relayerId, 'signTransaction', payload), + getRelayer: () => + this.send(relayerId, 'getRelayer', {}), + rpc: (payload: JsonRpcRequestNetworkRpcRequest) => + this.send(relayerId, 'rpc', payload), + }; + } + + async transactionWait( + transaction: { id: string; relayer_id: string }, + options?: { interval?: number; timeout?: number } + ): Promise { + const interval = options?.interval ?? 5000; + const timeout = options?.timeout ?? 60000; + const relayer = this.useRelayer(transaction.relayer_id); + let shouldContinue = true; + + const poll = async (): Promise => { + let tx = await relayer.getTransaction({ transactionId: transaction.id }); + while ( + shouldContinue && + tx.status !== TransactionStatus.MINED && + tx.status !== TransactionStatus.CONFIRMED && + tx.status !== TransactionStatus.CANCELED && + tx.status !== TransactionStatus.EXPIRED && + tx.status !== TransactionStatus.FAILED + ) { + await new Promise((resolve) => setTimeout(resolve, interval)); + if (!shouldContinue) break; + tx = await relayer.getTransaction({ transactionId: transaction.id }); + } + return tx; + }; + + let timeoutId: NodeJS.Timeout | undefined; + const timeoutPromise = new Promise((_, reject) => { + timeoutId = setTimeout(() => { + shouldContinue = false; + reject(pluginError(`Transaction ${transaction.id} timed out after ${timeout}ms`, { status: 504 })); + }, timeout); + }); + + return Promise.race([poll(), timeoutPromise]).finally(() => { + shouldContinue = false; + if (timeoutId) clearTimeout(timeoutId); + }); + } + + private async send(relayerId: string, method: string, payload: any): Promise { + const requestId = uuidv4(); + const msg: any = { requestId, relayerId, method, payload }; + if (this.httpRequestId) { + msg.httpRequestId = this.httpRequestId; + } + const message = JSON.stringify(msg) + '\n'; + + // Ensure we're connected before sending + await this.ensureConnected(); + + return new Promise((resolve, reject) => { + this.pending.set(requestId, { resolve, reject }); + this.socket!.write(message, (error) => { + if (error) { + this.pending.delete(requestId); + reject(error); + } + }); + }); + } + + close(): void { + // Only close if we actually connected + if (this.socket) { + // Use destroy() for immediate close instead of end() which is graceful + // This ensures the Rust socket reader sees EOF immediately + this.socket.destroy(); + } + } +} + +/** + * Creates a console-like object that captures logs. + */ +function createSandboxConsole(logs: LogEntry[]): Console { + const log = (level: LogEntry['level']) => (...args: any[]) => { + const message = args.map(arg => + typeof arg === 'object' ? JSON.stringify(arg) : String(arg) + ).join(' '); + logs.push({ level, message }); + }; + + return { + log: log('log'), + info: log('info'), + warn: log('warn'), + error: log('error'), + debug: log('debug'), + trace: log('debug'), + // Required console methods (no-ops for unused ones) + assert: () => {}, + clear: () => {}, + count: () => {}, + countReset: () => {}, + dir: () => {}, + dirxml: () => {}, + group: () => {}, + groupCollapsed: () => {}, + groupEnd: () => {}, + table: () => {}, + time: () => {}, + timeEnd: () => {}, + timeLog: () => {}, + timeStamp: () => {}, + profile: () => {}, + profileEnd: () => {}, + Console: console.Console, + } as Console; +} + +/** + * Executes a compiled plugin in an isolated vm context. + * This is the Piscina worker function. + */ +export default async function executeInSandbox(task: SandboxTask): Promise { + const logs: LogEntry[] = []; + const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); + const kv = new DefaultPluginKVStore(task.pluginId); + + try { + // Create isolated context with limited globals + const sandboxConsole = createSandboxConsole(logs); + + // Prepare the module wrapper + const wrappedCode = wrapForVm(task.compiledCode); + + // Create a mock require function for the sandbox + // Only allow specific safe modules + const sandboxRequire = (id: string): any => { + // Allow the relayer SDK (it's already used in the compiled code) + if (id === '@openzeppelin/relayer-sdk') { + return require('@openzeppelin/relayer-sdk'); + } + // Block all other requires for security + throw new Error(`Module '${id}' is not available in plugin sandbox`); + }; + + // Create module-like objects for CommonJS compatibility + const moduleExports: any = {}; + const moduleObject = { exports: moduleExports }; + + // Create the sandbox context + const context = vm.createContext({ + // Console for logging + console: sandboxConsole, + // CommonJS module system + exports: moduleExports, + require: sandboxRequire, + module: moduleObject, + __filename: `plugin-${task.pluginId}.js`, + __dirname: '/plugins', + // Timer functions + setTimeout, + setInterval, + setImmediate, + clearTimeout, + clearInterval, + clearImmediate, + // Promise (needed for async) + Promise, + // Buffer for binary data handling + Buffer, + // JSON utilities + JSON, + // Error types + Error, + TypeError, + RangeError, + SyntaxError, + // URL handling + URL, + URLSearchParams, + // TextEncoder/Decoder + TextEncoder, + TextDecoder, + }); + + // Compile and run the wrapped code to get the factory function + const script = new vm.Script(wrappedCode, { + filename: `plugin-${task.pluginId}.js`, + }); + + const factory = script.runInContext(context, { timeout: task.timeout }); + + // Execute the factory to populate module.exports + factory(moduleExports, sandboxRequire, moduleObject, `plugin-${task.pluginId}.js`, '/plugins'); + + // Get the handler from exports + const handler = moduleObject.exports.handler || moduleExports.handler; + + if (!handler || typeof handler !== 'function') { + throw new Error('Plugin must export a handler function'); + } + + // Execute the handler + let result: any; + + if (handler.length === 1) { + // Modern context-based handler + const pluginContext: PluginContext = { + api, + params: task.params, + kv, + headers: task.headers ?? {}, + }; + result = await handler(pluginContext); + } else { + // Legacy 2-param handler (no KV/headers access) + result = await handler(api, task.params); + } + + return { + taskId: task.taskId, + success: true, + result, + logs, + }; + } catch (error) { + const err = error as any; + + // Extract detailed error information + let errorCode = 'PLUGIN_ERROR'; + let errorMessage = String(error); + let errorStack: string | undefined; + let errorDetails: any = undefined; + let errorStatus = 500; + + if (err && typeof err === 'object') { + errorMessage = err.message || String(error); + + // Determine error code from error type + if (err.name === 'SyntaxError') { + errorCode = 'SYNTAX_ERROR'; + } else if (err.name === 'TypeError') { + errorCode = 'TYPE_ERROR'; + } else if (err.name === 'ReferenceError') { + errorCode = 'REFERENCE_ERROR'; + } else if (err.code === 'ERR_SCRIPT_EXECUTION_TIMEOUT') { + errorCode = 'TIMEOUT'; + errorStatus = 504; + errorMessage = `Plugin execution timed out after ${task.timeout}ms`; + } else if (err.code) { + errorCode = err.code; + } + + // Capture stack trace (sanitize paths) + if (err.stack) { + errorStack = err.stack + .split('\n') + .slice(0, 10) // Limit stack trace length + .join('\n'); + } + + // Capture any additional details + if (err.details) { + errorDetails = err.details; + } + + // Use status if provided + if (typeof err.status === 'number') { + errorStatus = err.status; + } + } + + return { + taskId: task.taskId, + success: false, + error: { + message: errorMessage, + code: errorCode, + status: errorStatus, + details: errorDetails ? { + ...errorDetails, + stack: errorStack, + } : (errorStack ? { stack: errorStack } : undefined), + }, + logs, + }; + } finally { + api.close(); + } +} diff --git a/plugins/lib/worker-pool.ts b/plugins/lib/worker-pool.ts new file mode 100644 index 000000000..d4a5f519b --- /dev/null +++ b/plugins/lib/worker-pool.ts @@ -0,0 +1,629 @@ +/** + * Worker Pool Manager + * + * Manages a Piscina worker pool for executing compiled plugins. + * Provides a high-level interface for running plugins with proper lifecycle management. + */ + +import Piscina from 'piscina'; +import * as path from 'node:path'; +import * as fs from 'node:fs'; +import * as os from 'node:os'; +import { v4 as uuidv4 } from 'uuid'; +import { compilePlugin, compilePluginSource, type CompilationResult } from './compiler'; +import type { SandboxTask, SandboxResult, LogEntry } from './sandbox-executor'; +import type { PluginHeaders } from './plugin'; +import { + DEFAULT_POOL_MIN_THREADS, + DEFAULT_POOL_IDLE_TIMEOUT_MS, + DEFAULT_POOL_EXECUTION_TIMEOUT_MS, + DEFAULT_WORKER_POOL_MAX_THREADS_FLOOR, + DEFAULT_WORKER_POOL_CONCURRENT_TASKS_PER_WORKER, +} from './constants'; + +/** + * Worker pool configuration options + */ +export interface WorkerPoolOptions { + /** Minimum number of worker threads to maintain */ + minThreads?: number; + /** Maximum number of worker threads */ + maxThreads?: number; + /** Number of concurrent tasks per worker */ + concurrentTasksPerWorker?: number; + /** Idle timeout before shutting down excess workers (ms) */ + idleTimeout?: number; +} + +/** + * Plugin execution request + */ +export interface PluginExecutionRequest { + /** Plugin ID */ + pluginId: string; + /** Path to plugin source file (for on-demand compilation) */ + pluginPath?: string; + /** Pre-compiled JavaScript code (if already compiled) */ + compiledCode?: string; + /** Plugin parameters */ + params: any; + /** HTTP headers from incoming request */ + headers?: PluginHeaders; + /** Unix socket path for relayer communication */ + socketPath: string; + /** HTTP request ID for tracing */ + httpRequestId?: string; + /** Execution timeout in milliseconds */ + timeout?: number; +} + +/** + * Plugin execution result + */ +export interface PluginExecutionResult { + /** Whether execution succeeded */ + success: boolean; + /** Return value (if success) */ + result?: any; + /** Error information (if failed) */ + error?: { + message: string; + code?: string; + status?: number; + details?: any; + }; + /** Captured console logs */ + logs: LogEntry[]; +} + +const DEFAULT_OPTIONS: Required = { + minThreads: DEFAULT_POOL_MIN_THREADS, + maxThreads: Math.max(os.cpus().length, DEFAULT_WORKER_POOL_MAX_THREADS_FLOOR), + concurrentTasksPerWorker: DEFAULT_WORKER_POOL_CONCURRENT_TASKS_PER_WORKER, + idleTimeout: DEFAULT_POOL_IDLE_TIMEOUT_MS, +}; + +const DEFAULT_TIMEOUT = DEFAULT_POOL_EXECUTION_TIMEOUT_MS; + +/** + * Path to the pre-compiled sandbox executor. + * This file is generated at build time by running: npx ts-node build-executor.ts + */ +const PRECOMPILED_EXECUTOR_PATH = path.resolve(__dirname, 'sandbox-executor.js'); + +/** + * Metrics tracking for plugin execution + */ +interface PluginMetrics { + // Execution metrics + totalExecutions: number; + successfulExecutions: number; + failedExecutions: number; + + // Timing metrics (in ms) + totalExecutionTime: number; + minExecutionTime: number; + maxExecutionTime: number; + + // Cache metrics + cacheHits: number; + cacheMisses: number; + + // Compilation metrics + totalCompilations: number; + totalCompilationTime: number; + + // Per-plugin execution counts + pluginExecutions: Map; + + // Error tracking + errorsByType: Map; + + // Timestamps + startTime: number; + lastExecutionTime: number | null; +} + +/** + * Create initial metrics state + */ +function createInitialMetrics(): PluginMetrics { + return { + totalExecutions: 0, + successfulExecutions: 0, + failedExecutions: 0, + totalExecutionTime: 0, + minExecutionTime: Infinity, + maxExecutionTime: 0, + cacheHits: 0, + cacheMisses: 0, + totalCompilations: 0, + totalCompilationTime: 0, + pluginExecutions: new Map(), + errorsByType: new Map(), + startTime: Date.now(), + lastExecutionTime: null, + }; +} + +/** + * In-memory cache for compiled plugin code + */ +class CompiledCodeCache { + private cache: Map = new Map(); + private maxAge: number; + + constructor(maxAgeMs: number = 3600000) { + // 1 hour default + this.maxAge = maxAgeMs; + } + + get(pluginPath: string): string | undefined { + const entry = this.cache.get(pluginPath); + if (!entry) return undefined; + + // Check if expired + if (Date.now() - entry.timestamp > this.maxAge) { + this.cache.delete(pluginPath); + return undefined; + } + + return entry.code; + } + + set(pluginPath: string, code: string): void { + this.cache.set(pluginPath, { code, timestamp: Date.now() }); + } + + delete(pluginPath: string): boolean { + return this.cache.delete(pluginPath); + } + + clear(): void { + this.cache.clear(); + } + + has(pluginPath: string): boolean { + return this.get(pluginPath) !== undefined; + } +} + +/** + * Worker Pool Manager + * + * Manages plugin execution using a Piscina worker pool. + * Handles compilation caching, task routing, and pool lifecycle. + */ +export class WorkerPoolManager { + private pool: Piscina | null = null; + private options: Required; + private compiledCache: CompiledCodeCache; + private initialized: boolean = false; + private compiledWorkerPath: string | null = null; + private metrics: PluginMetrics; + + constructor(options: WorkerPoolOptions = {}) { + this.options = { ...DEFAULT_OPTIONS, ...options }; + this.compiledCache = new CompiledCodeCache(); + this.metrics = createInitialMetrics(); + } + + /** + * Initialize the worker pool. + * Call this before executing any plugins. + * + * Uses pre-compiled sandbox-executor.js if available, + * otherwise compiles it on-the-fly (slower first startup). + */ + async initialize(): Promise { + if (this.initialized) return; + + // Use pre-compiled sandbox-executor.js if it exists + if (fs.existsSync(PRECOMPILED_EXECUTOR_PATH)) { + this.compiledWorkerPath = PRECOMPILED_EXECUTOR_PATH; + } else { + // Fallback: compile on-the-fly (for fresh checkouts, dev mode, etc.) + console.warn( + `[pool] Pre-compiled sandbox executor not found at ${PRECOMPILED_EXECUTOR_PATH}. ` + + `Compiling on-the-fly. Run 'npm run build:executor' in plugins/ for faster startup.` + ); + this.compiledWorkerPath = await this.compileExecutorOnTheFly(); + } + + this.pool = new Piscina({ + filename: this.compiledWorkerPath, + minThreads: this.options.minThreads, + maxThreads: this.options.maxThreads, + concurrentTasksPerWorker: this.options.concurrentTasksPerWorker, + idleTimeout: this.options.idleTimeout, + }); + + this.initialized = true; + } + + /** + * Compile the sandbox executor on-the-fly when pre-compiled version is not available. + * This is slower but ensures the pool can start in any environment. + */ + private async compileExecutorOnTheFly(): Promise { + const sandboxExecutorPath = path.resolve(__dirname, 'sandbox-executor.ts'); + + const esbuild = await import('esbuild'); + const result = await esbuild.build({ + entryPoints: [sandboxExecutorPath], + bundle: true, + platform: 'node', + target: 'node18', + format: 'cjs', + sourcemap: false, + write: false, + loader: { '.ts': 'ts' }, + external: ['node:*'], + }); + + // Write to temp file + const tempPath = path.join(os.tmpdir(), `sandbox-executor-${uuidv4()}.js`); + fs.writeFileSync(tempPath, result.outputFiles[0].text); + return tempPath; + } + + /** + * Pre-compile a plugin and cache the result. + * + * @param pluginPath - Path to the plugin source file + * @returns Compilation result + */ + async precompilePlugin(pluginPath: string, pluginId?: string): Promise { + const startTime = Date.now(); + const result = await compilePlugin(pluginPath); + const compilationTime = Date.now() - startTime; + + this.metrics.totalCompilations++; + this.metrics.totalCompilationTime += compilationTime; + + // Cache by pluginId if provided, otherwise by path + // Always cache by both to support lookups by either key + const cacheKey = pluginId || pluginPath; + this.compiledCache.set(cacheKey, result.code); + if (pluginId && pluginId !== pluginPath) { + this.compiledCache.set(pluginPath, result.code); + } + return result; + } + + /** + * Pre-compile a plugin from source code and cache the result. + * + * @param pluginId - Plugin identifier for caching + * @param sourceCode - TypeScript source code + * @returns Compilation result + */ + async precompilePluginSource( + pluginId: string, + sourceCode: string + ): Promise { + const startTime = Date.now(); + const result = await compilePluginSource(sourceCode, `${pluginId}.ts`); + const compilationTime = Date.now() - startTime; + + this.metrics.totalCompilations++; + this.metrics.totalCompilationTime += compilationTime; + + this.compiledCache.set(pluginId, result.code); + return result; + } + + /** + * Store pre-compiled code in the cache. + * Useful when compiled code comes from external storage (Redis). + * + * @param pluginId - Plugin identifier + * @param compiledCode - Pre-compiled JavaScript code + */ + cacheCompiledCode(pluginId: string, compiledCode: string): void { + this.compiledCache.set(pluginId, compiledCode); + } + + /** + * Get compiled code from cache. + * + * @param pluginId - Plugin identifier + * @returns Compiled code or undefined if not cached + */ + getCachedCode(pluginId: string): string | undefined { + return this.compiledCache.get(pluginId); + } + + /** + * Execute a plugin in a worker. + * + * @param request - Plugin execution request + * @returns Plugin execution result + */ + async runPlugin(request: PluginExecutionRequest): Promise { + if (!this.initialized || !this.pool) { + await this.initialize(); + } + + const executionStartTime = Date.now(); + let cacheHit = false; + + // Get compiled code (from request, cache, or compile on-demand) + let compiledCode = request.compiledCode; + + if (!compiledCode && request.pluginPath) { + // Try cache first + compiledCode = this.compiledCache.get(request.pluginPath); + + if (compiledCode) { + cacheHit = true; + this.metrics.cacheHits++; + } else { + // Compile on-demand + this.metrics.cacheMisses++; + const compileStartTime = Date.now(); + const result = await compilePlugin(request.pluginPath); + this.metrics.totalCompilations++; + this.metrics.totalCompilationTime += Date.now() - compileStartTime; + compiledCode = result.code; + this.compiledCache.set(request.pluginPath, compiledCode); + } + } + + if (!compiledCode) { + // Try by plugin ID + compiledCode = this.compiledCache.get(request.pluginId); + if (compiledCode) { + cacheHit = true; + this.metrics.cacheHits++; + } else { + this.metrics.cacheMisses++; + } + } + + if (!compiledCode) { + this.metrics.totalExecutions++; + this.metrics.failedExecutions++; + const errorCode = 'NO_COMPILED_CODE'; + this.metrics.errorsByType.set(errorCode, (this.metrics.errorsByType.get(errorCode) || 0) + 1); + return { + success: false, + error: { + message: `No compiled code available for plugin ${request.pluginId}`, + code: errorCode, + status: 500, + }, + logs: [], + }; + } + + // Create task for the worker + const task: SandboxTask = { + taskId: uuidv4(), + pluginId: request.pluginId, + compiledCode, + params: request.params, + headers: request.headers, + socketPath: request.socketPath, + httpRequestId: request.httpRequestId, + timeout: request.timeout ?? DEFAULT_TIMEOUT, + }; + + // Track per-plugin execution + this.metrics.pluginExecutions.set( + request.pluginId, + (this.metrics.pluginExecutions.get(request.pluginId) || 0) + 1 + ); + + try { + const result: SandboxResult = await this.pool!.run(task); + + // Update execution metrics + const executionTime = Date.now() - executionStartTime; + this.metrics.totalExecutions++; + this.metrics.lastExecutionTime = Date.now(); + this.metrics.totalExecutionTime += executionTime; + this.metrics.minExecutionTime = Math.min(this.metrics.minExecutionTime, executionTime); + this.metrics.maxExecutionTime = Math.max(this.metrics.maxExecutionTime, executionTime); + + if (result.success) { + this.metrics.successfulExecutions++; + } else { + this.metrics.failedExecutions++; + if (result.error?.code) { + this.metrics.errorsByType.set( + result.error.code, + (this.metrics.errorsByType.get(result.error.code) || 0) + 1 + ); + } + } + + return { + success: result.success, + result: result.result, + error: result.error, + logs: result.logs, + }; + } catch (error) { + const err = error as Error; + + // Update execution metrics for error case + const executionTime = Date.now() - executionStartTime; + this.metrics.totalExecutions++; + this.metrics.failedExecutions++; + this.metrics.lastExecutionTime = Date.now(); + this.metrics.totalExecutionTime += executionTime; + this.metrics.minExecutionTime = Math.min(this.metrics.minExecutionTime, executionTime); + this.metrics.maxExecutionTime = Math.max(this.metrics.maxExecutionTime, executionTime); + this.metrics.errorsByType.set('WORKER_ERROR', (this.metrics.errorsByType.get('WORKER_ERROR') || 0) + 1); + + return { + success: false, + error: { + message: err.message || String(error), + code: 'WORKER_ERROR', + status: 500, + }, + logs: [], + }; + } + } + + /** + * Clear the compiled code cache. + */ + clearCache(): void { + this.compiledCache.clear(); + } + + /** + * Invalidate a specific plugin from the cache. + * Removes entries by both pluginId and any associated path. + * + * @param pluginId - Plugin identifier to invalidate + * @param pluginPath - Optional path to also invalidate + */ + invalidatePlugin(pluginId: string, pluginPath?: string): void { + this.compiledCache.delete(pluginId); + if (pluginPath) { + this.compiledCache.delete(pluginPath); + } + } + + /** + * Get pool statistics including execution metrics. + */ + getStats(): { + pool: { + completed: number; + queued: number; + runTime: { average: number; max: number; min: number }; + waitTime: { average: number; max: number; min: number }; + } | null; + execution: { + total: number; + successful: number; + failed: number; + successRate: number; + avgExecutionTime: number; + minExecutionTime: number; + maxExecutionTime: number; + }; + cache: { + hits: number; + misses: number; + hitRate: number; + }; + compilation: { + total: number; + totalTime: number; + avgTime: number; + }; + plugins: Record; + errors: Record; + uptime: number; + } { + const poolStats = this.pool ? { + completed: this.pool.completed, + queued: this.pool.queueSize, + runTime: { + average: this.pool.runTime.average, + max: this.pool.runTime.max, + min: this.pool.runTime.min, + }, + waitTime: { + average: this.pool.waitTime.average, + max: this.pool.waitTime.max, + min: this.pool.waitTime.min, + }, + } : null; + + const totalCacheAccesses = this.metrics.cacheHits + this.metrics.cacheMisses; + + return { + pool: poolStats, + execution: { + total: this.metrics.totalExecutions, + successful: this.metrics.successfulExecutions, + failed: this.metrics.failedExecutions, + successRate: this.metrics.totalExecutions > 0 + ? this.metrics.successfulExecutions / this.metrics.totalExecutions + : 1, + avgExecutionTime: this.metrics.totalExecutions > 0 + ? this.metrics.totalExecutionTime / this.metrics.totalExecutions + : 0, + minExecutionTime: this.metrics.minExecutionTime === Infinity + ? 0 + : this.metrics.minExecutionTime, + maxExecutionTime: this.metrics.maxExecutionTime, + }, + cache: { + hits: this.metrics.cacheHits, + misses: this.metrics.cacheMisses, + hitRate: totalCacheAccesses > 0 + ? this.metrics.cacheHits / totalCacheAccesses + : 0, + }, + compilation: { + total: this.metrics.totalCompilations, + totalTime: this.metrics.totalCompilationTime, + avgTime: this.metrics.totalCompilations > 0 + ? this.metrics.totalCompilationTime / this.metrics.totalCompilations + : 0, + }, + plugins: Object.fromEntries(this.metrics.pluginExecutions), + errors: Object.fromEntries(this.metrics.errorsByType), + uptime: Date.now() - this.metrics.startTime, + }; + } + + /** + * Reset metrics to initial state. + * Useful for testing or periodic resets. + */ + resetMetrics(): void { + this.metrics = createInitialMetrics(); + } + + /** + * Shutdown the worker pool. + * Call this when the application is shutting down. + * Note: Cached compiled workers are NOT deleted as they can be reused. + */ + async shutdown(): Promise { + if (this.pool) { + await this.pool.destroy(); + this.pool = null; + this.initialized = false; + } + + // Don't delete the compiled worker - it's cached for reuse + // Just clear the reference + this.compiledWorkerPath = null; + + this.compiledCache.clear(); + } +} + +// Singleton instance for convenience +let defaultPool: WorkerPoolManager | null = null; + +/** + * Get or create the default worker pool instance. + */ +export function getDefaultPool(options?: WorkerPoolOptions): WorkerPoolManager { + if (!defaultPool) { + defaultPool = new WorkerPoolManager(options); + } + return defaultPool; +} + +/** + * Shutdown the default worker pool. + */ +export async function shutdownDefaultPool(): Promise { + if (defaultPool) { + await defaultPool.shutdown(); + defaultPool = null; + } +} diff --git a/plugins/package.json b/plugins/package.json index 55944d813..b1ffc96bc 100644 --- a/plugins/package.json +++ b/plugins/package.json @@ -7,7 +7,8 @@ "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage", - "build": "tsc" + "build": "ts-node lib/build-executor.ts", + "postinstall": "pnpm run build" }, "keywords": [], "author": "", @@ -15,8 +16,10 @@ "dependencies": { "@openzeppelin/relayer-sdk": "^1.7.0", "@types/node": "^24.0.3", + "esbuild": "^0.24.0", "ethers": "^6.14.3", "ioredis": "^5.7.0", + "piscina": "^4.7.0", "uuid": "^11.1.0" }, "devDependencies": { diff --git a/plugins/pnpm-lock.yaml b/plugins/pnpm-lock.yaml index 7fc814cb6..351da26b6 100644 --- a/plugins/pnpm-lock.yaml +++ b/plugins/pnpm-lock.yaml @@ -1,9 +1,11 @@ ---- lockfileVersion: '9.0' + settings: autoInstallPeers: true excludeLinksFromLockfile: false + importers: + .: dependencies: '@openzeppelin/relayer-sdk': @@ -12,12 +14,18 @@ importers: '@types/node': specifier: ^24.0.3 version: 24.9.2 + esbuild: + specifier: ^0.24.0 + version: 0.24.2 ethers: specifier: ^6.14.3 version: 6.15.0 ioredis: specifier: ^5.7.0 version: 5.8.2 + piscina: + specifier: ^4.7.0 + version: 4.9.2 uuid: specifier: ^11.1.0 version: 11.1.0 @@ -42,156 +50,349 @@ importers: version: 29.7.0(@types/node@24.9.2) ts-jest: specifier: ^29.1.2 - version: 29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2))(typescript@5.9.3) + version: 29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2))(typescript@5.9.3) typescript: specifier: ^5.3.3 version: 5.9.3 + packages: + '@adraffy/ens-normalize@1.10.1': resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} + '@babel/compat-data@7.28.5': resolution: {integrity: sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==} engines: {node: '>=6.9.0'} + '@babel/core@7.28.5': resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==} engines: {node: '>=6.9.0'} + '@babel/generator@7.28.5': resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==} engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.27.2': resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} + '@babel/helper-globals@7.28.0': resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} + '@babel/helper-module-imports@7.27.1': resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} engines: {node: '>=6.9.0'} + '@babel/helper-module-transforms@7.28.3': resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 + '@babel/helper-plugin-utils@7.27.1': resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.27.1': resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.28.5': resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.27.1': resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} + '@babel/helpers@7.28.4': resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} engines: {node: '>=6.9.0'} + '@babel/parser@7.28.5': resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} engines: {node: '>=6.0.0'} hasBin: true + '@babel/plugin-syntax-async-generators@7.8.4': resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-bigint@7.8.3': resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-class-properties@7.12.13': resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-class-static-block@7.14.5': resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-attributes@7.27.1': resolution: {integrity: sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-meta@7.10.4': resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-json-strings@7.8.3': resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-jsx@7.27.1': resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-numeric-separator@7.10.4': resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-object-rest-spread@7.8.3': resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-optional-catch-binding@7.8.3': resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-optional-chaining@7.8.3': resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-private-property-in-object@7.14.5': resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-top-level-await@7.14.5': resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-typescript@7.27.1': resolution: {integrity: sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} + '@babel/traverse@7.28.5': resolution: {integrity: sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==} engines: {node: '>=6.9.0'} + '@babel/types@7.28.5': resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + + '@esbuild/aix-ppc64@0.24.2': + resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.24.2': + resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.24.2': + resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.24.2': + resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.24.2': + resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.24.2': + resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.24.2': + resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.24.2': + resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.24.2': + resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.24.2': + resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.24.2': + resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.24.2': + resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.24.2': + resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.24.2': + resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.24.2': + resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.24.2': + resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.24.2': + resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.24.2': + resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.24.2': + resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.24.2': + resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.24.2': + resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.24.2': + resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.24.2': + resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.24.2': + resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.24.2': + resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@ioredis/as-callback@3.0.0': resolution: {integrity: sha512-Kqv1rZ3WbgOrS+hgzJ5xG5WQuhvzzSTRYvNeyPMLOAM78MHSnuKI20JeJGbpuAt//LCuP0vsexZcorqW7kWhJg==} + '@ioredis/commands@1.4.0': resolution: {integrity: sha512-aFT2yemJJo+TZCmieA7qnYGQooOS7QfNmYrzGtsYd3g9j5iDP8AimYYAesf79ohjbLG12XxC4nG5DyEnC88AsQ==} + '@istanbuljs/load-nyc-config@1.1.0': resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} + '@istanbuljs/schema@0.1.3': resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} + '@jest/console@29.7.0': resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/core@29.7.0': resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -200,21 +401,27 @@ packages: peerDependenciesMeta: node-notifier: optional: true + '@jest/environment@29.7.0': resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/expect-utils@29.7.0': resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/expect@29.7.0': resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/fake-timers@29.7.0': resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/globals@29.7.0': resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/reporters@29.7.0': resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -223,202 +430,384 @@ packages: peerDependenciesMeta: node-notifier: optional: true + '@jest/schemas@29.6.3': resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/source-map@29.6.3': resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/test-result@29.7.0': resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/test-sequencer@29.7.0': resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/transform@29.7.0': resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/types@29.6.3': resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + '@jridgewell/remapping@2.3.5': resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} + '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@napi-rs/nice-android-arm-eabi@1.1.1': + resolution: {integrity: sha512-kjirL3N6TnRPv5iuHw36wnucNqXAO46dzK9oPb0wj076R5Xm8PfUVA9nAFB5ZNMmfJQJVKACAPd/Z2KYMppthw==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + + '@napi-rs/nice-android-arm64@1.1.1': + resolution: {integrity: sha512-blG0i7dXgbInN5urONoUCNf+DUEAavRffrO7fZSeoRMJc5qD+BJeNcpr54msPF6qfDD6kzs9AQJogZvT2KD5nw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + + '@napi-rs/nice-darwin-arm64@1.1.1': + resolution: {integrity: sha512-s/E7w45NaLqTGuOjC2p96pct4jRfo61xb9bU1unM/MJ/RFkKlJyJDx7OJI/O0ll/hrfpqKopuAFDV8yo0hfT7A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@napi-rs/nice-darwin-x64@1.1.1': + resolution: {integrity: sha512-dGoEBnVpsdcC+oHHmW1LRK5eiyzLwdgNQq3BmZIav+9/5WTZwBYX7r5ZkQC07Nxd3KHOCkgbHSh4wPkH1N1LiQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@napi-rs/nice-freebsd-x64@1.1.1': + resolution: {integrity: sha512-kHv4kEHAylMYmlNwcQcDtXjklYp4FCf0b05E+0h6nDHsZ+F0bDe04U/tXNOqrx5CmIAth4vwfkjjUmp4c4JktQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + + '@napi-rs/nice-linux-arm-gnueabihf@1.1.1': + resolution: {integrity: sha512-E1t7K0efyKXZDoZg1LzCOLxgolxV58HCkaEkEvIYQx12ht2pa8hoBo+4OB3qh7e+QiBlp1SRf+voWUZFxyhyqg==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@napi-rs/nice-linux-arm64-gnu@1.1.1': + resolution: {integrity: sha512-CIKLA12DTIZlmTaaKhQP88R3Xao+gyJxNWEn04wZwC2wmRapNnxCUZkVwggInMJvtVElA+D4ZzOU5sX4jV+SmQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/nice-linux-arm64-musl@1.1.1': + resolution: {integrity: sha512-+2Rzdb3nTIYZ0YJF43qf2twhqOCkiSrHx2Pg6DJaCPYhhaxbLcdlV8hCRMHghQ+EtZQWGNcS2xF4KxBhSGeutg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@napi-rs/nice-linux-ppc64-gnu@1.1.1': + resolution: {integrity: sha512-4FS8oc0GeHpwvv4tKciKkw3Y4jKsL7FRhaOeiPei0X9T4Jd619wHNe4xCLmN2EMgZoeGg+Q7GY7BsvwKpL22Tg==} + engines: {node: '>= 10'} + cpu: [ppc64] + os: [linux] + + '@napi-rs/nice-linux-riscv64-gnu@1.1.1': + resolution: {integrity: sha512-HU0nw9uD4FO/oGCCk409tCi5IzIZpH2agE6nN4fqpwVlCn5BOq0MS1dXGjXaG17JaAvrlpV5ZeyZwSon10XOXw==} + engines: {node: '>= 10'} + cpu: [riscv64] + os: [linux] + + '@napi-rs/nice-linux-s390x-gnu@1.1.1': + resolution: {integrity: sha512-2YqKJWWl24EwrX0DzCQgPLKQBxYDdBxOHot1KWEq7aY2uYeX+Uvtv4I8xFVVygJDgf6/92h9N3Y43WPx8+PAgQ==} + engines: {node: '>= 10'} + cpu: [s390x] + os: [linux] + + '@napi-rs/nice-linux-x64-gnu@1.1.1': + resolution: {integrity: sha512-/gaNz3R92t+dcrfCw/96pDopcmec7oCcAQ3l/M+Zxr82KT4DljD37CpgrnXV+pJC263JkW572pdbP3hP+KjcIg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/nice-linux-x64-musl@1.1.1': + resolution: {integrity: sha512-xScCGnyj/oppsNPMnevsBe3pvNaoK7FGvMjT35riz9YdhB2WtTG47ZlbxtOLpjeO9SqqQ2J2igCmz6IJOD5JYw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@napi-rs/nice-openharmony-arm64@1.1.1': + resolution: {integrity: sha512-6uJPRVwVCLDeoOaNyeiW0gp2kFIM4r7PL2MczdZQHkFi9gVlgm+Vn+V6nTWRcu856mJ2WjYJiumEajfSm7arPQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [openharmony] + + '@napi-rs/nice-win32-arm64-msvc@1.1.1': + resolution: {integrity: sha512-uoTb4eAvM5B2aj/z8j+Nv8OttPf2m+HVx3UjA5jcFxASvNhQriyCQF1OB1lHL43ZhW+VwZlgvjmP5qF3+59atA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@napi-rs/nice-win32-ia32-msvc@1.1.1': + resolution: {integrity: sha512-CNQqlQT9MwuCsg1Vd/oKXiuH+TcsSPJmlAFc5frFyX/KkOh0UpBLEj7aoY656d5UKZQMQFP7vJNa1DNUNORvug==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@napi-rs/nice-win32-x64-msvc@1.1.1': + resolution: {integrity: sha512-vB+4G/jBQCAh0jelMTY3+kgFy00Hlx2f2/1zjMoH821IbplbWZOkLiTYXQkygNTzQJTq5cvwBDgn2ppHD+bglQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@napi-rs/nice@1.1.1': + resolution: {integrity: sha512-xJIPs+bYuc9ASBl+cvGsKbGrJmS6fAKaSZCnT0lhahT5rhA2VVy9/EcIgd2JhtEuFOJNx7UHNn/qiTPTY4nrQw==} + engines: {node: '>= 10'} + '@noble/curves@1.2.0': resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/hashes@1.3.2': resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} + '@openzeppelin/relayer-sdk@1.7.0': resolution: {integrity: sha512-XaQDdfooj6LC9Xa2fhq0ElaF0q/+rn4D0KNKDiwUa+QdZk18LeIiKxyZKxXuA4RynXxosISe1oQW78XYC/nE6Q==} engines: {node: '>=22.14.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} + '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + '@types/babel__generator@7.27.0': resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + '@types/babel__template@7.4.4': resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + '@types/babel__traverse@7.28.0': resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/ioredis-mock@8.2.6': resolution: {integrity: sha512-5heqtZMvQ4nXARY0o8rc8cjkJjct2ScM12yCJ/h731S9He93a2cv+kAhwPCNwTKDfNH9gjRfLG4VpAEYJU0/gQ==} peerDependencies: ioredis: '>=5' + '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + '@types/istanbul-lib-report@3.0.3': resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + '@types/jest@29.5.14': resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + '@types/node@22.7.5': resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + '@types/node@24.9.2': resolution: {integrity: sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA==} + '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/uuid@10.0.0': resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} + '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + '@types/yargs@17.0.34': resolution: {integrity: sha512-KExbHVa92aJpw9WDQvzBaGVE2/Pz+pLZQloT2hjL8IqsZnV62rlPOYvNnLmf/L2dyllfVUOVBj64M0z/46eR2A==} + aes-js@4.0.0-beta.5: resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} + ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} engines: {node: '>=10'} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + axios@1.13.1: resolution: {integrity: sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==} + babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 + babel-plugin-istanbul@6.1.1: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} + babel-plugin-jest-hoist@29.6.3: resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + babel-preset-current-node-syntax@1.2.0: resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} peerDependencies: '@babel/core': ^7.0.0 || ^8.0.0-0 + babel-preset-jest@29.6.3: resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + baseline-browser-mapping@2.8.21: resolution: {integrity: sha512-JU0h5APyQNsHOlAM7HnQnPToSDQoEBZqzu/YBlqDnEeymPnZDREeXJA3KBMQee+dKteAxZ2AtvQEvVYdZf241Q==} hasBin: true + brace-expansion@1.1.12: resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + browserslist@4.27.0: resolution: {integrity: sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + bs-logger@0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} engines: {node: '>= 6'} + bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} + camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + caniuse-lite@1.0.30001752: resolution: {integrity: sha512-vKUk7beoukxE47P5gcVNKkDRzXdVofotshHwfR9vmpeFKxmI5PBpgOMC18LUJUA/DvJ70Y7RveasIBraqsyO/g==} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} + ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} + cjs-module-lexer@1.4.3: resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} + cluster-key-slot@1.1.2: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} + co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + collect-v8-coverage@1.0.3: resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} + color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + create-jest@29.7.0: resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} + debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -427,6 +816,7 @@ packages: peerDependenciesMeta: supports-color: optional: true + dedent@1.7.0: resolution: {integrity: sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==} peerDependencies: @@ -434,83 +824,116 @@ packages: peerDependenciesMeta: babel-plugin-macros: optional: true + deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + denque@2.1.0: resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} engines: {node: '>=0.10'} + detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} + diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + electron-to-chromium@1.5.244: resolution: {integrity: sha512-OszpBN7xZX4vWMPJwB9illkN/znA8M36GQqQxi6MNy9axWxhOfJyZZJtSLQCpEFLHP2xK33BiWx9aIuIEXVCcw==} + emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + error-ex@1.3.4: resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} + es-errors@1.3.0: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} + es-set-tostringtag@2.1.0: resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} engines: {node: '>= 0.4'} + + esbuild@0.24.2: + resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-string-regexp@2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} + esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true + ethers@6.15.0: resolution: {integrity: sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ==} engines: {node: '>=14.0.0'} + execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} + expect@29.7.0: resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + fengari-interop@0.1.3: resolution: {integrity: sha512-EtZ+oTu3kEwVJnoymFPBVLIbQcCoy9uWCVnMA6h3M/RqHkUBsLYp29+RRHf9rKr6GwjubWREU1O7RretFIXjHw==} peerDependencies: fengari: ^0.1.0 + fengari@0.1.4: resolution: {integrity: sha512-6ujqUuiIYmcgkGz8MGAdERU57EIluGGPSUgGPTsco657EHa+srq0S3/YUl/r9kx1+D+d4rGfYObd+m8K22gB1g==} + fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} + follow-redirects@1.15.11: resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} engines: {node: '>=4.0'} @@ -519,133 +942,175 @@ packages: peerDependenciesMeta: debug: optional: true + form-data@4.0.4: resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==} engines: {node: '>= 6'} + fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: - - darwin + os: [darwin] + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} + get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} + get-proto@1.0.1: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} + get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} hasBin: true + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + has-symbols@1.1.0: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} hasBin: true + import-local@3.2.0: resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} engines: {node: '>=8'} hasBin: true + imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + inflight@1.0.6: resolution: {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. + inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + ioredis-mock@8.13.1: resolution: {integrity: sha512-Wsi50AU+cMiI32nAgfwpUaJVBtb4iQdVsOHl9M6R3tePCO/8vGsToCVIG82XWAxN4Se55TZoOzVseu+QngFLyw==} engines: {node: '>=12.22'} peerDependencies: '@types/ioredis-mock': ^8 ioredis: ^5 + ioredis@5.8.2: resolution: {integrity: sha512-C6uC+kleiIMmjViJINWk80sOQw5lEzse1ZmvD+S/s8p8CWapftSaC+kocGTx6xrbrJ4WmYQGC08ffHLr6ToR6Q==} engines: {node: '>=12.22.0'} + is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + is-core-module@2.16.1: resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} + is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-generator-fn@2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} + is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} + istanbul-lib-instrument@5.2.1: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} + istanbul-lib-instrument@6.0.3: resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} engines: {node: '>=10'} + istanbul-lib-report@3.0.1: resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} engines: {node: '>=10'} + istanbul-lib-source-maps@4.0.1: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} + istanbul-reports@3.2.0: resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} engines: {node: '>=8'} + jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-circus@29.7.0: resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-cli@29.7.0: resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -655,6 +1120,7 @@ packages: peerDependenciesMeta: node-notifier: optional: true + jest-config@29.7.0: resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -666,36 +1132,47 @@ packages: optional: true ts-node: optional: true + jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-docblock@29.7.0: resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-each@29.7.0: resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-environment-node@29.7.0: resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-get-type@29.6.3: resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-haste-map@29.7.0: resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-leak-detector@29.7.0: resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-matcher-utils@29.7.0: resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-message-util@29.7.0: resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-mock@29.7.0: resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-pnp-resolver@1.2.3: resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} @@ -704,36 +1181,47 @@ packages: peerDependenciesMeta: jest-resolve: optional: true + jest-regex-util@29.6.3: resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-resolve-dependencies@29.7.0: resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-resolve@29.7.0: resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-runner@29.7.0: resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-runtime@29.7.0: resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-snapshot@29.7.0: resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-util@29.7.0: resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-validate@29.7.0: resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-watcher@29.7.0: resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-worker@29.7.0: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest@29.7.0: resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -743,238 +1231,328 @@ packages: peerDependenciesMeta: node-notifier: optional: true + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true + jsesc@3.1.0: resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} hasBin: true + json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true + kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} + leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} + lodash.defaults@4.2.0: resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + lodash.isarguments@3.1.0: resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} + lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} + make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} + mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} + mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + node-releases@2.0.27: resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} + npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} + os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} + p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} + p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} + p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} + p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} + parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + pirates@4.0.7: resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} + + piscina@4.9.2: + resolution: {integrity: sha512-Fq0FERJWFEUpB4eSY59wSNwXD4RYqR+nR/WiEVcZW8IWfVBxJJafcgTEZDQo8k3w0sUarJ8RyVbbUF4GQ2LGbQ==} + pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + pure-rand@6.1.0: resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + readline-sync@1.4.10: resolution: {integrity: sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==} engines: {node: '>= 0.8.0'} + redis-errors@1.2.0: resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} engines: {node: '>=4'} + redis-parser@3.0.0: resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==} engines: {node: '>=4'} + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} + resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} + resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + resolve.exports@2.0.3: resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} engines: {node: '>=10'} + resolve@1.22.11: resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} hasBin: true + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true + semver@7.7.3: resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} engines: {node: '>=10'} hasBin: true + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} + shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + sprintf-js@1.1.3: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} + standard-as-callback@2.1.0: resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} + string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} + strip-bom@4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} + strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} + supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} + supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} + tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} + tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + ts-jest@29.4.5: resolution: {integrity: sha512-HO3GyiWn2qvTQA4kTgjDcXiMwYQt68a1Y8+JuLRVpdIzm+UOLSHgl/XqR4c6nzJkq5rOkjc02O2I7P7l/Yof0Q==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -1001,56 +1579,74 @@ packages: optional: true jest-util: optional: true + tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} + type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} + type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} hasBin: true + uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} hasBin: true + undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + update-browserslist-db@1.1.4: resolution: {integrity: sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' + uuid@11.1.0: resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} hasBin: true + v8-to-istanbul@9.3.0: resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} engines: {node: '>=10.12.0'} + walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} hasBin: true + wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + write-file-atomic@4.0.2: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + ws@8.17.1: resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} @@ -1062,28 +1658,38 @@ packages: optional: true utf-8-validate: optional: true + y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + snapshots: + '@adraffy/ens-normalize@1.10.1': {} + '@babel/code-frame@7.27.1': dependencies: '@babel/helper-validator-identifier': 7.28.5 js-tokens: 4.0.0 picocolors: 1.1.1 + '@babel/compat-data@7.28.5': {} + '@babel/core@7.28.5': dependencies: '@babel/code-frame': 7.27.1 @@ -1103,6 +1709,7 @@ snapshots: semver: 6.3.1 transitivePeerDependencies: - supports-color + '@babel/generator@7.28.5': dependencies: '@babel/parser': 7.28.5 @@ -1110,6 +1717,7 @@ snapshots: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 + '@babel/helper-compilation-targets@7.27.2': dependencies: '@babel/compat-data': 7.28.5 @@ -1117,13 +1725,16 @@ snapshots: browserslist: 4.27.0 lru-cache: 5.1.1 semver: 6.3.1 + '@babel/helper-globals@7.28.0': {} + '@babel/helper-module-imports@7.27.1': dependencies: '@babel/traverse': 7.28.5 '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color + '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 @@ -1132,90 +1743,115 @@ snapshots: '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color + '@babel/helper-plugin-utils@7.27.1': {} + '@babel/helper-string-parser@7.27.1': {} + '@babel/helper-validator-identifier@7.28.5': {} + '@babel/helper-validator-option@7.27.1': {} + '@babel/helpers@7.28.4': dependencies: '@babel/template': 7.27.2 '@babel/types': 7.28.5 + '@babel/parser@7.28.5': dependencies: '@babel/types': 7.28.5 + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.5)': dependencies: '@babel/core': 7.28.5 '@babel/helper-plugin-utils': 7.27.1 + '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 '@babel/parser': 7.28.5 '@babel/types': 7.28.5 + '@babel/traverse@7.28.5': dependencies: '@babel/code-frame': 7.27.1 @@ -1227,13 +1863,93 @@ snapshots: debug: 4.4.3 transitivePeerDependencies: - supports-color + '@babel/types@7.28.5': dependencies: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 + '@bcoe/v8-coverage@0.2.3': {} + + '@esbuild/aix-ppc64@0.24.2': + optional: true + + '@esbuild/android-arm64@0.24.2': + optional: true + + '@esbuild/android-arm@0.24.2': + optional: true + + '@esbuild/android-x64@0.24.2': + optional: true + + '@esbuild/darwin-arm64@0.24.2': + optional: true + + '@esbuild/darwin-x64@0.24.2': + optional: true + + '@esbuild/freebsd-arm64@0.24.2': + optional: true + + '@esbuild/freebsd-x64@0.24.2': + optional: true + + '@esbuild/linux-arm64@0.24.2': + optional: true + + '@esbuild/linux-arm@0.24.2': + optional: true + + '@esbuild/linux-ia32@0.24.2': + optional: true + + '@esbuild/linux-loong64@0.24.2': + optional: true + + '@esbuild/linux-mips64el@0.24.2': + optional: true + + '@esbuild/linux-ppc64@0.24.2': + optional: true + + '@esbuild/linux-riscv64@0.24.2': + optional: true + + '@esbuild/linux-s390x@0.24.2': + optional: true + + '@esbuild/linux-x64@0.24.2': + optional: true + + '@esbuild/netbsd-arm64@0.24.2': + optional: true + + '@esbuild/netbsd-x64@0.24.2': + optional: true + + '@esbuild/openbsd-arm64@0.24.2': + optional: true + + '@esbuild/openbsd-x64@0.24.2': + optional: true + + '@esbuild/sunos-x64@0.24.2': + optional: true + + '@esbuild/win32-arm64@0.24.2': + optional: true + + '@esbuild/win32-ia32@0.24.2': + optional: true + + '@esbuild/win32-x64@0.24.2': + optional: true + '@ioredis/as-callback@3.0.0': {} + '@ioredis/commands@1.4.0': {} + '@istanbuljs/load-nyc-config@1.1.0': dependencies: camelcase: 5.3.1 @@ -1241,7 +1957,9 @@ snapshots: get-package-type: 0.1.0 js-yaml: 3.14.1 resolve-from: 5.0.0 + '@istanbuljs/schema@0.1.3': {} + '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 @@ -1250,6 +1968,7 @@ snapshots: jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 + '@jest/core@29.7.0': dependencies: '@jest/console': 29.7.0 @@ -1284,21 +2003,25 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + '@jest/environment@29.7.0': dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/node': 24.9.2 jest-mock: 29.7.0 + '@jest/expect-utils@29.7.0': dependencies: jest-get-type: 29.6.3 + '@jest/expect@29.7.0': dependencies: expect: 29.7.0 jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color + '@jest/fake-timers@29.7.0': dependencies: '@jest/types': 29.6.3 @@ -1307,6 +2030,7 @@ snapshots: jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 + '@jest/globals@29.7.0': dependencies: '@jest/environment': 29.7.0 @@ -1315,6 +2039,7 @@ snapshots: jest-mock: 29.7.0 transitivePeerDependencies: - supports-color + '@jest/reporters@29.7.0': dependencies: '@bcoe/v8-coverage': 0.2.3 @@ -1343,26 +2068,31 @@ snapshots: v8-to-istanbul: 9.3.0 transitivePeerDependencies: - supports-color + '@jest/schemas@29.6.3': dependencies: '@sinclair/typebox': 0.27.8 + '@jest/source-map@29.6.3': dependencies: '@jridgewell/trace-mapping': 0.3.31 callsites: 3.1.0 graceful-fs: 4.2.11 + '@jest/test-result@29.7.0': dependencies: '@jest/console': 29.7.0 '@jest/types': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 collect-v8-coverage: 1.0.3 + '@jest/test-sequencer@29.7.0': dependencies: '@jest/test-result': 29.7.0 graceful-fs: 4.2.11 jest-haste-map: 29.7.0 slash: 3.0.0 + '@jest/transform@29.7.0': dependencies: '@babel/core': 7.28.5 @@ -1382,6 +2112,7 @@ snapshots: write-file-atomic: 4.0.2 transitivePeerDependencies: - supports-color + '@jest/types@29.6.3': dependencies: '@jest/schemas': 29.6.3 @@ -1390,36 +2121,120 @@ snapshots: '@types/node': 24.9.2 '@types/yargs': 17.0.34 chalk: 4.1.2 + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/remapping@2.3.5': dependencies: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/resolve-uri@3.1.2': {} + '@jridgewell/sourcemap-codec@1.5.5': {} + '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + + '@napi-rs/nice-android-arm-eabi@1.1.1': + optional: true + + '@napi-rs/nice-android-arm64@1.1.1': + optional: true + + '@napi-rs/nice-darwin-arm64@1.1.1': + optional: true + + '@napi-rs/nice-darwin-x64@1.1.1': + optional: true + + '@napi-rs/nice-freebsd-x64@1.1.1': + optional: true + + '@napi-rs/nice-linux-arm-gnueabihf@1.1.1': + optional: true + + '@napi-rs/nice-linux-arm64-gnu@1.1.1': + optional: true + + '@napi-rs/nice-linux-arm64-musl@1.1.1': + optional: true + + '@napi-rs/nice-linux-ppc64-gnu@1.1.1': + optional: true + + '@napi-rs/nice-linux-riscv64-gnu@1.1.1': + optional: true + + '@napi-rs/nice-linux-s390x-gnu@1.1.1': + optional: true + + '@napi-rs/nice-linux-x64-gnu@1.1.1': + optional: true + + '@napi-rs/nice-linux-x64-musl@1.1.1': + optional: true + + '@napi-rs/nice-openharmony-arm64@1.1.1': + optional: true + + '@napi-rs/nice-win32-arm64-msvc@1.1.1': + optional: true + + '@napi-rs/nice-win32-ia32-msvc@1.1.1': + optional: true + + '@napi-rs/nice-win32-x64-msvc@1.1.1': + optional: true + + '@napi-rs/nice@1.1.1': + optionalDependencies: + '@napi-rs/nice-android-arm-eabi': 1.1.1 + '@napi-rs/nice-android-arm64': 1.1.1 + '@napi-rs/nice-darwin-arm64': 1.1.1 + '@napi-rs/nice-darwin-x64': 1.1.1 + '@napi-rs/nice-freebsd-x64': 1.1.1 + '@napi-rs/nice-linux-arm-gnueabihf': 1.1.1 + '@napi-rs/nice-linux-arm64-gnu': 1.1.1 + '@napi-rs/nice-linux-arm64-musl': 1.1.1 + '@napi-rs/nice-linux-ppc64-gnu': 1.1.1 + '@napi-rs/nice-linux-riscv64-gnu': 1.1.1 + '@napi-rs/nice-linux-s390x-gnu': 1.1.1 + '@napi-rs/nice-linux-x64-gnu': 1.1.1 + '@napi-rs/nice-linux-x64-musl': 1.1.1 + '@napi-rs/nice-openharmony-arm64': 1.1.1 + '@napi-rs/nice-win32-arm64-msvc': 1.1.1 + '@napi-rs/nice-win32-ia32-msvc': 1.1.1 + '@napi-rs/nice-win32-x64-msvc': 1.1.1 + optional: true + '@noble/curves@1.2.0': dependencies: '@noble/hashes': 1.3.2 + '@noble/hashes@1.3.2': {} + '@openzeppelin/relayer-sdk@1.7.0': dependencies: axios: 1.13.1 transitivePeerDependencies: - debug + '@sinclair/typebox@0.27.8': {} + '@sinonjs/commons@3.0.1': dependencies: type-detect: 4.0.8 + '@sinonjs/fake-timers@10.3.0': dependencies: '@sinonjs/commons': 3.0.1 + '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.28.5 @@ -1427,62 +2242,86 @@ snapshots: '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.28.0 + '@types/babel__generator@7.27.0': dependencies: '@babel/types': 7.28.5 + '@types/babel__template@7.4.4': dependencies: '@babel/parser': 7.28.5 '@babel/types': 7.28.5 + '@types/babel__traverse@7.28.0': dependencies: '@babel/types': 7.28.5 + '@types/graceful-fs@4.1.9': dependencies: '@types/node': 24.9.2 + '@types/ioredis-mock@8.2.6(ioredis@5.8.2)': dependencies: ioredis: 5.8.2 + '@types/istanbul-lib-coverage@2.0.6': {} + '@types/istanbul-lib-report@3.0.3': dependencies: '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports@3.0.4': dependencies: '@types/istanbul-lib-report': 3.0.3 + '@types/jest@29.5.14': dependencies: expect: 29.7.0 pretty-format: 29.7.0 + '@types/node@22.7.5': dependencies: undici-types: 6.19.8 + '@types/node@24.9.2': dependencies: undici-types: 7.16.0 + '@types/stack-utils@2.0.3': {} + '@types/uuid@10.0.0': {} + '@types/yargs-parser@21.0.3': {} + '@types/yargs@17.0.34': dependencies: '@types/yargs-parser': 21.0.3 + aes-js@4.0.0-beta.5: {} + ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 + ansi-regex@5.0.1: {} + ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 + ansi-styles@5.2.0: {} + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 + argparse@1.0.10: dependencies: sprintf-js: 1.0.3 + asynckit@0.4.0: {} + axios@1.13.1: dependencies: follow-redirects: 1.15.11 @@ -1490,6 +2329,7 @@ snapshots: proxy-from-env: 1.1.0 transitivePeerDependencies: - debug + babel-jest@29.7.0(@babel/core@7.28.5): dependencies: '@babel/core': 7.28.5 @@ -1502,6 +2342,7 @@ snapshots: slash: 3.0.0 transitivePeerDependencies: - supports-color + babel-plugin-istanbul@6.1.1: dependencies: '@babel/helper-plugin-utils': 7.27.1 @@ -1511,12 +2352,14 @@ snapshots: test-exclude: 6.0.0 transitivePeerDependencies: - supports-color + babel-plugin-jest-hoist@29.6.3: dependencies: '@babel/template': 7.27.2 '@babel/types': 7.28.5 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.28.0 + babel-preset-current-node-syntax@1.2.0(@babel/core@7.28.5): dependencies: '@babel/core': 7.28.5 @@ -1535,20 +2378,26 @@ snapshots: '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.28.5) '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.28.5) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.28.5) + babel-preset-jest@29.6.3(@babel/core@7.28.5): dependencies: '@babel/core': 7.28.5 babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.5) + balanced-match@1.0.2: {} + baseline-browser-mapping@2.8.21: {} + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + braces@3.0.3: dependencies: fill-range: 7.1.1 + browserslist@4.27.0: dependencies: baseline-browser-mapping: 2.8.21 @@ -1556,45 +2405,67 @@ snapshots: electron-to-chromium: 1.5.244 node-releases: 2.0.27 update-browserslist-db: 1.1.4(browserslist@4.27.0) + bs-logger@0.2.6: dependencies: fast-json-stable-stringify: 2.1.0 + bser@2.1.1: dependencies: node-int64: 0.4.0 + buffer-from@1.1.2: {} + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 function-bind: 1.1.2 + callsites@3.1.0: {} + camelcase@5.3.1: {} + camelcase@6.3.0: {} + caniuse-lite@1.0.30001752: {} + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + char-regex@1.0.2: {} + ci-info@3.9.0: {} + cjs-module-lexer@1.4.3: {} + cliui@8.0.1: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + cluster-key-slot@1.1.2: {} + co@4.6.0: {} + collect-v8-coverage@1.0.3: {} + color-convert@2.0.1: dependencies: color-name: 1.1.4 + color-name@1.1.4: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 + concat-map@0.0.1: {} + convert-source-map@2.0.0: {} + create-jest@29.7.0(@types/node@24.9.2): dependencies: '@jest/types': 29.6.3 @@ -1609,45 +2480,94 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 + debug@4.4.3: dependencies: ms: 2.1.3 + dedent@1.7.0: {} + deepmerge@4.3.1: {} + delayed-stream@1.0.0: {} + denque@2.1.0: {} + detect-newline@3.1.0: {} + diff-sequences@29.6.3: {} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 es-errors: 1.3.0 gopd: 1.2.0 + electron-to-chromium@1.5.244: {} + emittery@0.13.1: {} + emoji-regex@8.0.0: {} + error-ex@1.3.4: dependencies: is-arrayish: 0.2.1 + es-define-property@1.0.1: {} + es-errors@1.3.0: {} + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 + es-set-tostringtag@2.1.0: dependencies: es-errors: 1.3.0 get-intrinsic: 1.3.0 has-tostringtag: 1.0.2 hasown: 2.0.2 + + esbuild@0.24.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.24.2 + '@esbuild/android-arm': 0.24.2 + '@esbuild/android-arm64': 0.24.2 + '@esbuild/android-x64': 0.24.2 + '@esbuild/darwin-arm64': 0.24.2 + '@esbuild/darwin-x64': 0.24.2 + '@esbuild/freebsd-arm64': 0.24.2 + '@esbuild/freebsd-x64': 0.24.2 + '@esbuild/linux-arm': 0.24.2 + '@esbuild/linux-arm64': 0.24.2 + '@esbuild/linux-ia32': 0.24.2 + '@esbuild/linux-loong64': 0.24.2 + '@esbuild/linux-mips64el': 0.24.2 + '@esbuild/linux-ppc64': 0.24.2 + '@esbuild/linux-riscv64': 0.24.2 + '@esbuild/linux-s390x': 0.24.2 + '@esbuild/linux-x64': 0.24.2 + '@esbuild/netbsd-arm64': 0.24.2 + '@esbuild/netbsd-x64': 0.24.2 + '@esbuild/openbsd-arm64': 0.24.2 + '@esbuild/openbsd-x64': 0.24.2 + '@esbuild/sunos-x64': 0.24.2 + '@esbuild/win32-arm64': 0.24.2 + '@esbuild/win32-ia32': 0.24.2 + '@esbuild/win32-x64': 0.24.2 + escalade@3.2.0: {} + escape-string-regexp@2.0.0: {} + esprima@4.0.1: {} + ethers@6.15.0: dependencies: '@adraffy/ens-normalize': 1.10.1 @@ -1660,6 +2580,7 @@ snapshots: transitivePeerDependencies: - bufferutil - utf-8-validate + execa@5.1.1: dependencies: cross-spawn: 7.0.6 @@ -1671,7 +2592,9 @@ snapshots: onetime: 5.1.2 signal-exit: 3.0.7 strip-final-newline: 2.0.0 + exit@0.1.2: {} + expect@29.7.0: dependencies: '@jest/expect-utils': 29.7.0 @@ -1679,26 +2602,34 @@ snapshots: jest-matcher-utils: 29.7.0 jest-message-util: 29.7.0 jest-util: 29.7.0 + fast-json-stable-stringify@2.1.0: {} + fb-watchman@2.0.2: dependencies: bser: 2.1.1 + fengari-interop@0.1.3(fengari@0.1.4): dependencies: fengari: 0.1.4 + fengari@0.1.4: dependencies: readline-sync: 1.4.10 sprintf-js: 1.1.3 tmp: 0.0.33 + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 + find-up@4.1.0: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 + follow-redirects@1.15.11: {} + form-data@4.0.4: dependencies: asynckit: 0.4.0 @@ -1706,12 +2637,18 @@ snapshots: es-set-tostringtag: 2.1.0 hasown: 2.0.2 mime-types: 2.1.35 + fs.realpath@1.0.0: {} + fsevents@2.3.3: optional: true + function-bind@1.1.2: {} + gensync@1.0.0-beta.2: {} + get-caller-file@2.0.5: {} + get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 @@ -1724,12 +2661,16 @@ snapshots: has-symbols: 1.1.0 hasown: 2.0.2 math-intrinsics: 1.1.0 + get-package-type@0.1.0: {} + get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 + get-stream@6.0.1: {} + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -1738,8 +2679,11 @@ snapshots: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + gopd@1.2.0: {} + graceful-fs@4.2.11: {} + handlebars@4.7.8: dependencies: minimist: 1.2.8 @@ -1748,27 +2692,39 @@ snapshots: wordwrap: 1.0.0 optionalDependencies: uglify-js: 3.19.3 + has-flag@4.0.0: {} + has-symbols@1.1.0: {} + has-tostringtag@1.0.2: dependencies: has-symbols: 1.1.0 + hasown@2.0.2: dependencies: function-bind: 1.1.2 + html-escaper@2.0.2: {} + human-signals@2.1.0: {} + husky@9.1.7: {} + import-local@3.2.0: dependencies: pkg-dir: 4.2.0 resolve-cwd: 3.0.0 + imurmurhash@0.1.4: {} + inflight@1.0.6: dependencies: once: 1.4.0 wrappy: 1.0.2 + inherits@2.0.4: {} + ioredis-mock@8.13.1(@types/ioredis-mock@8.2.6(ioredis@5.8.2))(ioredis@5.8.2): dependencies: '@ioredis/as-callback': 3.0.0 @@ -1778,6 +2734,7 @@ snapshots: fengari-interop: 0.1.3(fengari@0.1.4) ioredis: 5.8.2 semver: 7.7.3 + ioredis@5.8.2: dependencies: '@ioredis/commands': 1.4.0 @@ -1791,16 +2748,25 @@ snapshots: standard-as-callback: 2.1.0 transitivePeerDependencies: - supports-color + is-arrayish@0.2.1: {} + is-core-module@2.16.1: dependencies: hasown: 2.0.2 + is-fullwidth-code-point@3.0.0: {} + is-generator-fn@2.1.0: {} + is-number@7.0.0: {} + is-stream@2.0.1: {} + isexe@2.0.0: {} + istanbul-lib-coverage@3.2.2: {} + istanbul-lib-instrument@5.2.1: dependencies: '@babel/core': 7.28.5 @@ -1810,6 +2776,7 @@ snapshots: semver: 6.3.1 transitivePeerDependencies: - supports-color + istanbul-lib-instrument@6.0.3: dependencies: '@babel/core': 7.28.5 @@ -1819,11 +2786,13 @@ snapshots: semver: 7.7.3 transitivePeerDependencies: - supports-color + istanbul-lib-report@3.0.1: dependencies: istanbul-lib-coverage: 3.2.2 make-dir: 4.0.0 supports-color: 7.2.0 + istanbul-lib-source-maps@4.0.1: dependencies: debug: 4.4.3 @@ -1831,15 +2800,18 @@ snapshots: source-map: 0.6.1 transitivePeerDependencies: - supports-color + istanbul-reports@3.2.0: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 + jest-changed-files@29.7.0: dependencies: execa: 5.1.1 jest-util: 29.7.0 p-limit: 3.1.0 + jest-circus@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -1865,6 +2837,7 @@ snapshots: transitivePeerDependencies: - babel-plugin-macros - supports-color + jest-cli@29.7.0(@types/node@24.9.2): dependencies: '@jest/core': 29.7.0 @@ -1883,6 +2856,7 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + jest-config@29.7.0(@types/node@24.9.2): dependencies: '@babel/core': 7.28.5 @@ -1912,15 +2886,18 @@ snapshots: transitivePeerDependencies: - babel-plugin-macros - supports-color + jest-diff@29.7.0: dependencies: chalk: 4.1.2 diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 + jest-docblock@29.7.0: dependencies: detect-newline: 3.1.0 + jest-each@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -1928,6 +2905,7 @@ snapshots: jest-get-type: 29.6.3 jest-util: 29.7.0 pretty-format: 29.7.0 + jest-environment-node@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -1936,7 +2914,9 @@ snapshots: '@types/node': 24.9.2 jest-mock: 29.7.0 jest-util: 29.7.0 + jest-get-type@29.6.3: {} + jest-haste-map@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -1952,16 +2932,19 @@ snapshots: walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 + jest-leak-detector@29.7.0: dependencies: jest-get-type: 29.6.3 pretty-format: 29.7.0 + jest-matcher-utils@29.7.0: dependencies: chalk: 4.1.2 jest-diff: 29.7.0 jest-get-type: 29.6.3 pretty-format: 29.7.0 + jest-message-util@29.7.0: dependencies: '@babel/code-frame': 7.27.1 @@ -1973,21 +2956,26 @@ snapshots: pretty-format: 29.7.0 slash: 3.0.0 stack-utils: 2.0.6 + jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 '@types/node': 24.9.2 jest-util: 29.7.0 + jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): optionalDependencies: jest-resolve: 29.7.0 + jest-regex-util@29.6.3: {} + jest-resolve-dependencies@29.7.0: dependencies: jest-regex-util: 29.6.3 jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color + jest-resolve@29.7.0: dependencies: chalk: 4.1.2 @@ -1999,6 +2987,7 @@ snapshots: resolve: 1.22.11 resolve.exports: 2.0.3 slash: 3.0.0 + jest-runner@29.7.0: dependencies: '@jest/console': 29.7.0 @@ -2024,6 +3013,7 @@ snapshots: source-map-support: 0.5.13 transitivePeerDependencies: - supports-color + jest-runtime@29.7.0: dependencies: '@jest/environment': 29.7.0 @@ -2050,6 +3040,7 @@ snapshots: strip-bom: 4.0.0 transitivePeerDependencies: - supports-color + jest-snapshot@29.7.0: dependencies: '@babel/core': 7.28.5 @@ -2074,6 +3065,7 @@ snapshots: semver: 7.7.3 transitivePeerDependencies: - supports-color + jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -2082,6 +3074,7 @@ snapshots: ci-info: 3.9.0 graceful-fs: 4.2.11 picomatch: 2.3.1 + jest-validate@29.7.0: dependencies: '@jest/types': 29.6.3 @@ -2090,6 +3083,7 @@ snapshots: jest-get-type: 29.6.3 leven: 3.1.0 pretty-format: 29.7.0 + jest-watcher@29.7.0: dependencies: '@jest/test-result': 29.7.0 @@ -2100,12 +3094,14 @@ snapshots: emittery: 0.13.1 jest-util: 29.7.0 string-length: 4.0.2 + jest-worker@29.7.0: dependencies: '@types/node': 24.9.2 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 + jest@29.7.0(@types/node@24.9.2): dependencies: '@jest/core': 29.7.0 @@ -2117,174 +3113,265 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + js-tokens@4.0.0: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 esprima: 4.0.1 + jsesc@3.1.0: {} + json-parse-even-better-errors@2.3.1: {} + json5@2.2.3: {} + kleur@3.0.3: {} + leven@3.1.0: {} + lines-and-columns@1.2.4: {} + locate-path@5.0.0: dependencies: p-locate: 4.1.0 + lodash.defaults@4.2.0: {} + lodash.isarguments@3.1.0: {} + lodash.memoize@4.1.2: {} + lru-cache@5.1.1: dependencies: yallist: 3.1.1 + make-dir@4.0.0: dependencies: semver: 7.7.3 + make-error@1.3.6: {} + makeerror@1.0.12: dependencies: tmpl: 1.0.5 + math-intrinsics@1.1.0: {} + merge-stream@2.0.0: {} + micromatch@4.0.8: dependencies: braces: 3.0.3 picomatch: 2.3.1 + mime-db@1.52.0: {} + mime-types@2.1.35: dependencies: mime-db: 1.52.0 + mimic-fn@2.1.0: {} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.12 + minimist@1.2.8: {} + ms@2.1.3: {} + natural-compare@1.4.0: {} + neo-async@2.6.2: {} + node-int64@0.4.0: {} + node-releases@2.0.27: {} + normalize-path@3.0.0: {} + npm-run-path@4.0.1: dependencies: path-key: 3.1.1 + once@1.4.0: dependencies: wrappy: 1.0.2 + onetime@5.1.2: dependencies: mimic-fn: 2.1.0 + os-tmpdir@1.0.2: {} + p-limit@2.3.0: dependencies: p-try: 2.2.0 + p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 + p-locate@4.1.0: dependencies: p-limit: 2.3.0 + p-try@2.2.0: {} + parse-json@5.2.0: dependencies: '@babel/code-frame': 7.27.1 error-ex: 1.3.4 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + path-exists@4.0.0: {} + path-is-absolute@1.0.1: {} + path-key@3.1.1: {} + path-parse@1.0.7: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} + pirates@4.0.7: {} + + piscina@4.9.2: + optionalDependencies: + '@napi-rs/nice': 1.1.1 + pkg-dir@4.2.0: dependencies: find-up: 4.1.0 + pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 react-is: 18.3.1 + prompts@2.4.2: dependencies: kleur: 3.0.3 sisteransi: 1.0.5 + proxy-from-env@1.1.0: {} + pure-rand@6.1.0: {} + react-is@18.3.1: {} + readline-sync@1.4.10: {} + redis-errors@1.2.0: {} + redis-parser@3.0.0: dependencies: redis-errors: 1.2.0 + require-directory@2.1.1: {} + resolve-cwd@3.0.0: dependencies: resolve-from: 5.0.0 + resolve-from@5.0.0: {} + resolve.exports@2.0.3: {} + resolve@1.22.11: dependencies: is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + semver@6.3.1: {} + semver@7.7.3: {} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 + shebang-regex@3.0.0: {} + signal-exit@3.0.7: {} + sisteransi@1.0.5: {} + slash@3.0.0: {} + source-map-support@0.5.13: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 + source-map@0.6.1: {} + sprintf-js@1.0.3: {} + sprintf-js@1.1.3: {} + stack-utils@2.0.6: dependencies: escape-string-regexp: 2.0.0 + standard-as-callback@2.1.0: {} + string-length@4.0.2: dependencies: char-regex: 1.0.2 strip-ansi: 6.0.1 + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 + strip-bom@4.0.0: {} + strip-final-newline@2.0.0: {} + strip-json-comments@3.1.1: {} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 + supports-color@8.1.1: dependencies: has-flag: 4.0.0 + supports-preserve-symlinks-flag@1.0.0: {} + test-exclude@6.0.0: dependencies: '@istanbuljs/schema': 0.1.3 glob: 7.2.3 minimatch: 3.1.2 + tmp@0.0.33: dependencies: os-tmpdir: 1.0.2 + tmpl@1.0.5: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - ? ts-jest@29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2))(typescript@5.9.3) - : dependencies: + + ts-jest@29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2))(typescript@5.9.3): + dependencies: bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 handlebars: 4.7.8 @@ -2301,48 +3388,71 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.28.5) + esbuild: 0.24.2 jest-util: 29.7.0 + tslib@2.7.0: {} + type-detect@4.0.8: {} + type-fest@0.21.3: {} + type-fest@4.41.0: {} + typescript@5.9.3: {} + uglify-js@3.19.3: optional: true + undici-types@6.19.8: {} + undici-types@7.16.0: {} + update-browserslist-db@1.1.4(browserslist@4.27.0): dependencies: browserslist: 4.27.0 escalade: 3.2.0 picocolors: 1.1.1 + uuid@11.1.0: {} + v8-to-istanbul@9.3.0: dependencies: '@jridgewell/trace-mapping': 0.3.31 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 + walker@1.0.8: dependencies: makeerror: 1.0.12 + which@2.0.2: dependencies: isexe: 2.0.0 + wordwrap@1.0.0: {} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + wrappy@1.0.2: {} + write-file-atomic@4.0.2: dependencies: imurmurhash: 0.1.4 signal-exit: 3.0.7 + ws@8.17.1: {} + y18n@5.0.8: {} + yallist@3.1.1: {} + yargs-parser@21.1.1: {} + yargs@17.7.2: dependencies: cliui: 8.0.1 @@ -2352,4 +3462,5 @@ snapshots: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + yocto-queue@0.1.0: {} diff --git a/src/bootstrap/initialize_plugins.rs b/src/bootstrap/initialize_plugins.rs new file mode 100644 index 000000000..042d43467 --- /dev/null +++ b/src/bootstrap/initialize_plugins.rs @@ -0,0 +1,161 @@ +//! Plugin Pool Initialization +//! +//! This module handles conditional initialization of the plugin worker pool. +//! The pool is only started if plugins are configured, avoiding overhead +//! when the plugin system is not in use. + +use std::sync::Arc; +use tracing::{info, warn}; + +use crate::repositories::PluginRepositoryTrait; +use crate::services::plugins::{get_pool_manager, PoolManager}; + +/// Initialize the plugin worker pool if plugins are configured. +/// +/// This function checks if any plugins are registered in the repository. +/// If plugins exist, it starts the Piscina worker pool for efficient +/// plugin execution. If no plugins are configured, it skips initialization. +/// +/// # Arguments +/// +/// * `plugin_repository` - Reference to the plugin repository +/// +/// # Returns +/// +/// * `Ok(Some(Arc))` - Pool manager if plugins are configured +/// * `Ok(None)` - If no plugins are configured +/// * `Err` - If pool initialization fails +pub async fn initialize_plugin_pool( + plugin_repository: &PR, +) -> eyre::Result>> { + let has_plugins = plugin_repository.has_entries().await.map_err(|e| { + eyre::eyre!("Failed to check plugin repository: {}", e) + })?; + + if !has_plugins { + info!("No plugins configured, skipping plugin pool initialization"); + return Ok(None); + } + + let plugin_count = plugin_repository.count().await.unwrap_or(0); + info!(plugin_count = plugin_count, "Plugins detected, initializing worker pool"); + + let pool_manager = get_pool_manager(); + + match pool_manager.ensure_started().await { + Ok(()) => { + info!("Plugin worker pool initialized successfully"); + Ok(Some(pool_manager)) + } + Err(e) => { + warn!(error = %e, "Failed to start plugin worker pool, falling back to ts-node execution"); + Ok(None) + } + } +} + +/// Precompile all configured plugins. +/// +/// This function loads all plugins from the repository and triggers +/// precompilation via the worker pool. Compiled code is cached in +/// the pool for fast execution. +/// +/// # Arguments +/// +/// * `plugin_repository` - Reference to the plugin repository +/// * `pool_manager` - The pool manager to use for compilation +/// +/// # Returns +/// +/// * `Ok(usize)` - Number of plugins successfully precompiled +/// * `Err` - If precompilation fails critically +pub async fn precompile_plugins( + plugin_repository: &PR, + pool_manager: &PoolManager, +) -> eyre::Result { + use crate::models::PaginationQuery; + + let query = PaginationQuery { + page: 1, + per_page: 1000, + }; + + let plugins = plugin_repository.list_paginated(query).await.map_err(|e| { + eyre::eyre!("Failed to list plugins: {}", e) + })?; + + let mut compiled_count = 0; + + for plugin in plugins.items { + let plugin_path = if plugin.path.starts_with("plugins/") { + plugin.path.clone() + } else { + format!("plugins/{}", plugin.path) + }; + + match pool_manager + .precompile_plugin(plugin.id.clone(), Some(plugin_path), None) + .await + { + Ok(compiled_code) => { + if let Err(e) = pool_manager + .cache_compiled_code(plugin.id.clone(), compiled_code) + .await + { + warn!( + plugin_id = %plugin.id, + error = %e, + "Failed to cache compiled plugin code" + ); + } else { + compiled_count += 1; + info!(plugin_id = %plugin.id, "Plugin precompiled successfully"); + } + } + Err(e) => { + warn!( + plugin_id = %plugin.id, + error = %e, + "Failed to precompile plugin" + ); + } + } + } + + info!( + compiled_count = compiled_count, + total_plugins = plugins.total, + "Plugin precompilation complete" + ); + + Ok(compiled_count) +} + +/// Shutdown the plugin pool gracefully. +/// +/// This should be called during application shutdown to properly +/// terminate the worker pool and clean up resources. +pub async fn shutdown_plugin_pool() -> eyre::Result<()> { + let pool_manager = get_pool_manager(); + pool_manager.shutdown().await.map_err(|e| { + eyre::eyre!("Failed to shutdown plugin pool: {}", e) + })?; + info!("Plugin worker pool shutdown complete"); + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::repositories::MockPluginRepositoryTrait; + + #[tokio::test] + async fn test_initialize_plugin_pool_no_plugins() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_has_entries().returning(|| async { Ok(false) }); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_ok()); + assert!(result.unwrap().is_none()); + } +} diff --git a/src/bootstrap/mod.rs b/src/bootstrap/mod.rs index 51a39e917..e186fb4bb 100644 --- a/src/bootstrap/mod.rs +++ b/src/bootstrap/mod.rs @@ -2,7 +2,7 @@ //! //! This module contains functions and utilities for initializing various //! components of the relayer system, including relayers, configuration, -//! application state, and workers. +//! application state, workers, and plugins. //! //! # Submodules //! @@ -10,6 +10,7 @@ //! - `config_processor`: Functions for processing configuration files //! - `initialize_app_state`: Functions for initializing application state //! - `initialize_workers`: Functions for initializing background workers +//! - `initialize_plugins`: Functions for initializing the plugin worker pool mod initialize_relayers; pub use initialize_relayers::*; @@ -21,3 +22,6 @@ pub use initialize_app_state::*; mod initialize_workers; pub use initialize_workers::*; + +mod initialize_plugins; +pub use initialize_plugins::*; diff --git a/src/constants/plugins.rs b/src/constants/plugins.rs index 324e44d1a..267d46215 100644 --- a/src/constants/plugins.rs +++ b/src/constants/plugins.rs @@ -1 +1,51 @@ +/// Default plugin execution timeout in seconds pub const DEFAULT_PLUGIN_TIMEOUT_SECONDS: u64 = 300; // 5 minutes + +// ============================================================================= +// Plugin Pool Server Configuration +// These constants are the source of truth. The TypeScript pool-server.ts and +// worker-pool.ts files should use matching values. +// ============================================================================= + +/// Default maximum connections from Rust to the pool server +pub const DEFAULT_POOL_MAX_CONNECTIONS: usize = 64; + +/// Default minimum worker threads (floor) +pub const DEFAULT_POOL_MIN_THREADS: usize = 2; + +/// Default maximum worker threads floor (minimum threads even on small machines) +pub const DEFAULT_POOL_MAX_THREADS_FLOOR: usize = 8; + +/// Default concurrent tasks per worker thread +pub const DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER: usize = 10; + +/// Default worker idle timeout in milliseconds +pub const DEFAULT_POOL_IDLE_TIMEOUT_MS: u64 = 60000; // 60 seconds + +/// Default socket connection backlog for high concurrency +pub const DEFAULT_POOL_SOCKET_BACKLOG: u32 = 1024; + +/// Default plugin execution timeout in milliseconds (within pool) +pub const DEFAULT_POOL_EXECUTION_TIMEOUT_MS: u64 = 30000; // 30 seconds + +/// Default request timeout in seconds (for pool requests) +pub const DEFAULT_POOL_REQUEST_TIMEOUT_SECS: u64 = 30; + +/// Default maximum queue size for request throttling +pub const DEFAULT_POOL_MAX_QUEUE_SIZE: usize = 1000; + +// ============================================================================= +// Shared Socket Service Configuration +// ============================================================================= + +/// Default connection idle timeout in seconds +pub const DEFAULT_SOCKET_IDLE_TIMEOUT_SECS: u64 = 60; + +/// Default read timeout per line in seconds +pub const DEFAULT_SOCKET_READ_TIMEOUT_SECS: u64 = 30; + +/// Maximum concurrent connections (backlog limit) +pub const DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS: usize = 1024; + +/// Default trace collection timeout in seconds +pub const DEFAULT_TRACE_TIMEOUT_SECS: u64 = 5; diff --git a/src/main.rs b/src/main.rs index 6fa9e4c0d..3a4924ab5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,6 +49,7 @@ use openzeppelin_relayer::{ bootstrap::{ initialize_app_state, initialize_relayers, initialize_token_swap_workers, initialize_workers, process_config_file, + initialize_plugin_pool, precompile_plugins, shutdown_plugin_pool, }, config, constants::PUBLIC_ENDPOINTS, @@ -98,6 +99,33 @@ async fn main() -> Result<()> { // Setup workers for processing jobs initialize_workers(app_state.clone()).await?; + // Initialize plugin worker pool if pool execution is enabled + let pool_manager = if std::env::var("PLUGIN_USE_POOL") + .map(|v| v.eq_ignore_ascii_case("true") || v == "1") + .unwrap_or(false) + { + info!("Pool-based plugin execution enabled, initializing plugin pool"); + match initialize_plugin_pool(app_state.plugin_repository.as_ref()).await { + Ok(Some(pm)) => { + // Precompile all plugins + if let Err(e) = precompile_plugins( + app_state.plugin_repository.as_ref(), + pm.as_ref(), + ).await { + tracing::warn!(error = %e, "Failed to precompile some plugins"); + } + Some(pm) + } + Ok(None) => None, + Err(e) => { + tracing::warn!(error = %e, "Failed to initialize plugin pool"); + None + } + } + } else { + None + }; + // Rate limit configuration let rate_limit_config = GovernorConfigBuilder::default() .requests_per_second(config.rate_limit_requests_per_second) @@ -178,6 +206,13 @@ async fn main() -> Result<()> { app_server.await?; } + // Graceful shutdown: cleanup plugin pool if it was started + if pool_manager.is_some() { + if let Err(e) = shutdown_plugin_pool().await { + tracing::warn!(error = %e, "Failed to shutdown plugin pool gracefully"); + } + } + Ok(()) } diff --git a/src/repositories/plugin/mod.rs b/src/repositories/plugin/mod.rs index 579e2bce3..d42cc6388 100644 --- a/src/repositories/plugin/mod.rs +++ b/src/repositories/plugin/mod.rs @@ -10,6 +10,7 @@ //! - **Path Resolution**: Manage plugin script paths for execution //! - **Duplicate Prevention**: Ensure unique plugin IDs //! - **Configuration Loading**: Convert from file configurations to repository models +//! - **Compiled Code Caching**: Cache pre-compiled JavaScript code for performance //! //! ## Repository Implementations //! @@ -46,6 +47,7 @@ use crate::{ #[allow(dead_code)] #[cfg_attr(test, automock)] pub trait PluginRepositoryTrait { + // Plugin CRUD operations async fn get_by_id(&self, id: &str) -> Result, RepositoryError>; async fn add(&self, plugin: PluginModel) -> Result<(), RepositoryError>; async fn list_paginated( @@ -55,6 +57,25 @@ pub trait PluginRepositoryTrait { async fn count(&self) -> Result; async fn has_entries(&self) -> Result; async fn drop_all_entries(&self) -> Result<(), RepositoryError>; + + // Compiled code cache operations + /// Get compiled JavaScript code for a plugin + async fn get_compiled_code(&self, plugin_id: &str) -> Result, RepositoryError>; + /// Store compiled JavaScript code for a plugin + async fn store_compiled_code( + &self, + plugin_id: &str, + compiled_code: &str, + source_hash: Option<&str>, + ) -> Result<(), RepositoryError>; + /// Invalidate cached code for a plugin + async fn invalidate_compiled_code(&self, plugin_id: &str) -> Result<(), RepositoryError>; + /// Invalidate all cached plugin code + async fn invalidate_all_compiled_code(&self) -> Result<(), RepositoryError>; + /// Check if a plugin has cached compiled code + async fn has_compiled_code(&self, plugin_id: &str) -> Result; + /// Get the source hash for cache validation + async fn get_source_hash(&self, plugin_id: &str) -> Result, RepositoryError>; } /// Enum wrapper for different plugin repository implementations @@ -124,6 +145,57 @@ impl PluginRepositoryTrait for PluginRepositoryStorage { PluginRepositoryStorage::Redis(repo) => repo.drop_all_entries().await, } } + + async fn get_compiled_code(&self, plugin_id: &str) -> Result, RepositoryError> { + match self { + PluginRepositoryStorage::InMemory(repo) => repo.get_compiled_code(plugin_id).await, + PluginRepositoryStorage::Redis(repo) => repo.get_compiled_code(plugin_id).await, + } + } + + async fn store_compiled_code( + &self, + plugin_id: &str, + compiled_code: &str, + source_hash: Option<&str>, + ) -> Result<(), RepositoryError> { + match self { + PluginRepositoryStorage::InMemory(repo) => { + repo.store_compiled_code(plugin_id, compiled_code, source_hash).await + } + PluginRepositoryStorage::Redis(repo) => { + repo.store_compiled_code(plugin_id, compiled_code, source_hash).await + } + } + } + + async fn invalidate_compiled_code(&self, plugin_id: &str) -> Result<(), RepositoryError> { + match self { + PluginRepositoryStorage::InMemory(repo) => repo.invalidate_compiled_code(plugin_id).await, + PluginRepositoryStorage::Redis(repo) => repo.invalidate_compiled_code(plugin_id).await, + } + } + + async fn invalidate_all_compiled_code(&self) -> Result<(), RepositoryError> { + match self { + PluginRepositoryStorage::InMemory(repo) => repo.invalidate_all_compiled_code().await, + PluginRepositoryStorage::Redis(repo) => repo.invalidate_all_compiled_code().await, + } + } + + async fn has_compiled_code(&self, plugin_id: &str) -> Result { + match self { + PluginRepositoryStorage::InMemory(repo) => repo.has_compiled_code(plugin_id).await, + PluginRepositoryStorage::Redis(repo) => repo.has_compiled_code(plugin_id).await, + } + } + + async fn get_source_hash(&self, plugin_id: &str) -> Result, RepositoryError> { + match self { + PluginRepositoryStorage::InMemory(repo) => repo.get_source_hash(plugin_id).await, + PluginRepositoryStorage::Redis(repo) => repo.get_source_hash(plugin_id).await, + } + } } impl TryFrom for PluginModel { diff --git a/src/repositories/plugin/plugin_in_memory.rs b/src/repositories/plugin/plugin_in_memory.rs index 5baa065a5..b7b5c61d2 100644 --- a/src/repositories/plugin/plugin_in_memory.rs +++ b/src/repositories/plugin/plugin_in_memory.rs @@ -1,7 +1,7 @@ //! This module provides an in-memory implementation of plugins. //! //! The `InMemoryPluginRepository` struct is used to store and retrieve plugins -//! script paths for further execution. +//! script paths for further execution. Also provides compiled code caching. use crate::{ models::{PaginationQuery, PluginModel}, repositories::{PaginatedResult, PluginRepositoryTrait, RepositoryError}, @@ -12,9 +12,17 @@ use async_trait::async_trait; use std::collections::HashMap; use tokio::sync::{Mutex, MutexGuard}; +/// Compiled plugin code entry +#[derive(Debug, Clone)] +struct CompiledCodeEntry { + code: String, + source_hash: Option, +} + #[derive(Debug)] pub struct InMemoryPluginRepository { store: Mutex>, + compiled_cache: Mutex>, } impl Clone for InMemoryPluginRepository { @@ -25,9 +33,16 @@ impl Clone for InMemoryPluginRepository { .try_lock() .map(|guard| guard.clone()) .unwrap_or_else(|_| HashMap::new()); + + let compiled = self + .compiled_cache + .try_lock() + .map(|guard| guard.clone()) + .unwrap_or_else(|_| HashMap::new()); Self { store: Mutex::new(data), + compiled_cache: Mutex::new(compiled), } } } @@ -36,6 +51,7 @@ impl InMemoryPluginRepository { pub fn new() -> Self { Self { store: Mutex::new(HashMap::new()), + compiled_cache: Mutex::new(HashMap::new()), } } @@ -108,6 +124,52 @@ impl PluginRepositoryTrait for InMemoryPluginRepository { store.clear(); Ok(()) } + + // Compiled code cache methods + + async fn get_compiled_code(&self, plugin_id: &str) -> Result, RepositoryError> { + let cache = Self::acquire_lock(&self.compiled_cache).await?; + Ok(cache.get(plugin_id).map(|e| e.code.clone())) + } + + async fn store_compiled_code( + &self, + plugin_id: &str, + compiled_code: &str, + source_hash: Option<&str>, + ) -> Result<(), RepositoryError> { + let mut cache = Self::acquire_lock(&self.compiled_cache).await?; + cache.insert( + plugin_id.to_string(), + CompiledCodeEntry { + code: compiled_code.to_string(), + source_hash: source_hash.map(|s| s.to_string()), + }, + ); + Ok(()) + } + + async fn invalidate_compiled_code(&self, plugin_id: &str) -> Result<(), RepositoryError> { + let mut cache = Self::acquire_lock(&self.compiled_cache).await?; + cache.remove(plugin_id); + Ok(()) + } + + async fn invalidate_all_compiled_code(&self) -> Result<(), RepositoryError> { + let mut cache = Self::acquire_lock(&self.compiled_cache).await?; + cache.clear(); + Ok(()) + } + + async fn has_compiled_code(&self, plugin_id: &str) -> Result { + let cache = Self::acquire_lock(&self.compiled_cache).await?; + Ok(cache.contains_key(plugin_id)) + } + + async fn get_source_hash(&self, plugin_id: &str) -> Result, RepositoryError> { + let cache = Self::acquire_lock(&self.compiled_cache).await?; + Ok(cache.get(plugin_id).and_then(|e| e.source_hash.clone())) + } } #[cfg(test)] diff --git a/src/repositories/plugin/plugin_redis.rs b/src/repositories/plugin/plugin_redis.rs index e9870550e..936e59a50 100644 --- a/src/repositories/plugin/plugin_redis.rs +++ b/src/repositories/plugin/plugin_redis.rs @@ -12,6 +12,8 @@ use tracing::{debug, error, warn}; const PLUGIN_PREFIX: &str = "plugin"; const PLUGIN_LIST_KEY: &str = "plugin_list"; +const COMPILED_CODE_PREFIX: &str = "compiled_code"; +const SOURCE_HASH_PREFIX: &str = "source_hash"; #[derive(Clone)] pub struct RedisPluginRepository { @@ -48,6 +50,16 @@ impl RedisPluginRepository { format!("{}:{}", self.key_prefix, PLUGIN_LIST_KEY) } + /// Generate key for compiled code: compiled_code:{plugin_id} + fn compiled_code_key(&self, plugin_id: &str) -> String { + format!("{}:{}:{}", self.key_prefix, COMPILED_CODE_PREFIX, plugin_id) + } + + /// Generate key for source hash: source_hash:{plugin_id} + fn source_hash_key(&self, plugin_id: &str) -> String { + format!("{}:{}:{}", self.key_prefix, SOURCE_HASH_PREFIX, plugin_id) + } + /// Get plugin by ID using an existing connection. /// This method is useful to prevent creating new connections for /// getting individual plugins on list operations. @@ -322,6 +334,116 @@ impl PluginRepositoryTrait for RedisPluginRepository { debug!(count = %plugin_ids.len(), "dropped plugin entries"); Ok(()) } + + // Compiled code cache methods + + async fn get_compiled_code(&self, plugin_id: &str) -> Result, RepositoryError> { + let mut conn = self.client.as_ref().clone(); + let key = self.compiled_code_key(plugin_id); + + debug!(plugin_id = %plugin_id, "fetching compiled code from Redis"); + + let code: Option = conn + .get(&key) + .await + .map_err(|e| self.map_redis_error(e, &format!("get_compiled_code_{plugin_id}")))?; + + Ok(code) + } + + async fn store_compiled_code( + &self, + plugin_id: &str, + compiled_code: &str, + source_hash: Option<&str>, + ) -> Result<(), RepositoryError> { + let mut conn = self.client.as_ref().clone(); + let code_key = self.compiled_code_key(plugin_id); + + debug!(plugin_id = %plugin_id, "storing compiled code in Redis"); + + // Store the compiled code + conn.set::<_, _, ()>(&code_key, compiled_code) + .await + .map_err(|e| self.map_redis_error(e, &format!("store_compiled_code_{plugin_id}")))?; + + // Store source hash if provided + if let Some(hash) = source_hash { + let hash_key = self.source_hash_key(plugin_id); + conn.set::<_, _, ()>(&hash_key, hash) + .await + .map_err(|e| self.map_redis_error(e, &format!("store_source_hash_{plugin_id}")))?; + } + + Ok(()) + } + + async fn invalidate_compiled_code(&self, plugin_id: &str) -> Result<(), RepositoryError> { + let mut conn = self.client.as_ref().clone(); + let code_key = self.compiled_code_key(plugin_id); + let hash_key = self.source_hash_key(plugin_id); + + debug!(plugin_id = %plugin_id, "invalidating compiled code in Redis"); + + // Delete the compiled code and hash + conn.del::<_, ()>(&code_key) + .await + .map_err(|e| self.map_redis_error(e, &format!("delete_compiled_code_{plugin_id}")))?; + + conn.del::<_, ()>(&hash_key) + .await + .map_err(|e| self.map_redis_error(e, &format!("delete_source_hash_{plugin_id}")))?; + + Ok(()) + } + + async fn invalidate_all_compiled_code(&self) -> Result<(), RepositoryError> { + let mut conn = self.client.as_ref().clone(); + let plugin_list_key = self.plugin_list_key(); + + debug!("invalidating all compiled code in Redis"); + + // Get all plugin IDs from the list + let plugin_ids: Vec = conn + .smembers(&plugin_list_key) + .await + .map_err(|e| self.map_redis_error(e, "get_plugin_list_for_invalidate"))?; + + // Delete all compiled code and hash keys + for plugin_id in &plugin_ids { + let code_key = self.compiled_code_key(plugin_id); + let hash_key = self.source_hash_key(plugin_id); + + let _ = conn.del::<_, ()>(&code_key).await; + let _ = conn.del::<_, ()>(&hash_key).await; + } + + Ok(()) + } + + async fn has_compiled_code(&self, plugin_id: &str) -> Result { + let mut conn = self.client.as_ref().clone(); + let key = self.compiled_code_key(plugin_id); + + let exists: bool = conn + .exists(&key) + .await + .map_err(|e| self.map_redis_error(e, &format!("exists_compiled_code_{plugin_id}")))?; + + Ok(exists) + } + + async fn get_source_hash(&self, plugin_id: &str) -> Result, RepositoryError> { + let mut conn = self.client.as_ref().clone(); + let key = self.source_hash_key(plugin_id); + + let hash: Option = conn + .get(&key) + .await + .map_err(|e| self.map_redis_error(e, &format!("get_source_hash_{plugin_id}")))?; + + Ok(hash) + } } #[cfg(test)] diff --git a/src/services/plugins/mod.rs b/src/services/plugins/mod.rs index 648b8a42d..3695a0284 100644 --- a/src/services/plugins/mod.rs +++ b/src/services/plugins/mod.rs @@ -29,9 +29,15 @@ pub use relayer_api::*; pub mod script_executor; pub use script_executor::*; +pub mod pool_executor; +pub use pool_executor::*; + pub mod socket; pub use socket::*; +pub mod shared_socket; +pub use shared_socket::*; + #[cfg(test)] use mockall::automock; @@ -1039,9 +1045,12 @@ mod tests { .await; let captured = logs_buffer.lock().unwrap().join("\n"); + // When forward_logs is disabled, plugin log messages should not appear in tracing output + // (internal framework logs like "Calling plugin" may still appear) assert!( - captured.is_empty(), - "logs should not be forwarded when disabled" + !captured.contains("should-not-emit"), + "plugin logs should not be forwarded when disabled, but found: {}", + captured ); } diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs new file mode 100644 index 000000000..7ccea90c4 --- /dev/null +++ b/src/services/plugins/pool_executor.rs @@ -0,0 +1,1107 @@ +//! Pool-based Plugin Executor +//! +//! This module provides execution of pre-compiled JavaScript plugins via +//! a persistent Piscina worker pool, replacing the per-request ts-node approach. +//! +//! Communication with the Node.js pool server happens via Unix socket using +//! a JSON-line protocol. + +use dashmap::DashMap; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::process::Stdio; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::Arc; +use std::time::Duration; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::UnixStream; +use tokio::process::{Child, Command}; +use tokio::sync::{oneshot, RwLock, Semaphore}; +use uuid::Uuid; + +use super::{LogEntry, LogLevel, PluginError, PluginHandlerPayload, ScriptResult}; +use crate::constants::{ + DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_QUEUE_SIZE, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, +}; + +/// Health status information from the pool server +#[derive(Debug, Clone)] +pub struct HealthStatus { + pub healthy: bool, + pub status: String, + pub uptime_ms: Option, + pub memory: Option, + pub pool_completed: Option, + pub pool_queued: Option, + pub success_rate: Option, +} + +/// Message types for pool communication +#[derive(Serialize, Debug)] +#[serde(tag = "type", rename_all = "lowercase")] +pub enum PoolRequest { + Execute { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + #[serde(rename = "compiledCode", skip_serializing_if = "Option::is_none")] + compiled_code: Option, + #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] + plugin_path: Option, + params: serde_json::Value, + #[serde(skip_serializing_if = "Option::is_none")] + headers: Option>>, + #[serde(rename = "socketPath")] + socket_path: String, + #[serde(rename = "httpRequestId", skip_serializing_if = "Option::is_none")] + http_request_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + timeout: Option, + }, + Precompile { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] + plugin_path: Option, + #[serde(rename = "sourceCode", skip_serializing_if = "Option::is_none")] + source_code: Option, + }, + Cache { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + #[serde(rename = "compiledCode")] + compiled_code: String, + }, + Invalidate { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + }, + Stats { + #[serde(rename = "taskId")] + task_id: String, + }, + Health { + #[serde(rename = "taskId")] + task_id: String, + }, + Shutdown { + #[serde(rename = "taskId")] + task_id: String, + }, +} + +#[derive(Deserialize, Debug)] +pub struct PoolResponse { + #[serde(rename = "taskId")] + pub task_id: String, + pub success: bool, + pub result: Option, + pub error: Option, + pub logs: Option>, +} + +#[derive(Deserialize, Debug)] +pub struct PoolError { + pub message: String, + pub code: Option, + pub status: Option, + pub details: Option, +} + +#[derive(Deserialize, Debug)] +pub struct PoolLogEntry { + pub level: String, + pub message: String, +} + +impl From for LogEntry { + fn from(entry: PoolLogEntry) -> Self { + let level = match entry.level.as_str() { + "error" => LogLevel::Error, + "warn" => LogLevel::Warn, + "info" => LogLevel::Info, + "debug" => LogLevel::Debug, + "result" => LogLevel::Result, + _ => LogLevel::Log, + }; + LogEntry { + level, + message: entry.message, + } + } +} + +/// Pool connection state +struct PoolConnection { + stream: UnixStream, + /// Connection ID for tracking + id: usize, +} + +impl PoolConnection { + async fn new(socket_path: &str, id: usize) -> Result { + // Retry connection with backoff - socket might not be ready immediately after READY signal + let mut attempts = 0; + let max_attempts = 10; + let mut delay_ms = 10; + + tracing::debug!(connection_id = id, socket_path = %socket_path, "Connecting to pool server"); + loop { + match UnixStream::connect(socket_path).await { + Ok(stream) => { + tracing::debug!(connection_id = id, "Connected to pool server"); + return Ok(Self { stream, id }); + } + Err(e) => { + attempts += 1; + if attempts >= max_attempts { + return Err(PluginError::SocketError(format!( + "Failed to connect to pool after {max_attempts} attempts: {e}" + ))); + } + tracing::debug!( + connection_id = id, + attempt = attempts, + delay_ms = delay_ms, + "Retrying connection to pool server" + ); + tokio::time::sleep(Duration::from_millis(delay_ms)).await; + delay_ms = std::cmp::min(delay_ms * 2, 500); + } + } + } + } + + async fn send_request(&mut self, request: &PoolRequest) -> Result { + let json = serde_json::to_string(request) + .map_err(|e| PluginError::PluginError(format!("Failed to serialize request: {e}")))?; + + // Write request and flush + if let Err(e) = self.stream.write_all(format!("{json}\n").as_bytes()).await { + return Err(PluginError::SocketError(format!("Failed to send request: {e}"))); + } + + if let Err(e) = self.stream.flush().await { + return Err(PluginError::SocketError(format!("Failed to flush request: {e}"))); + } + + // Read response using BufReader on a reference to the stream + let mut reader = BufReader::new(&mut self.stream); + let mut line = String::new(); + + if let Err(e) = reader.read_line(&mut line).await { + return Err(PluginError::SocketError(format!("Failed to read response: {e}"))); + } + + tracing::debug!(response_len = line.len(), "Received response from pool"); + + serde_json::from_str(&line) + .map_err(|e| PluginError::PluginError(format!("Failed to parse response: {e}"))) + } + + /// Send request with timeout + async fn send_request_with_timeout( + &mut self, + request: &PoolRequest, + timeout_secs: u64, + ) -> Result { + tokio::time::timeout(Duration::from_secs(timeout_secs), self.send_request(request)) + .await + .map_err(|_| PluginError::SocketError("Request timed out".to_string()))? + } +} + +/// Connection pool for reusing socket connections +/// Uses DashMap for lock-free connection acquisition and release +struct ConnectionPool { + socket_path: String, + /// Available connections (connection_id -> connection) + connections: Arc>, + /// Health tracking for connections (connection_id -> is_healthy) + health: Arc>, + /// Maximum number of connections + max_connections: usize, + /// Next connection ID (atomic for lock-free increment) + next_id: Arc, + /// Semaphore for limiting concurrent connections + semaphore: Arc, +} + +impl ConnectionPool { + fn new(socket_path: String, max_connections: usize) -> Self { + Self { + socket_path, + connections: Arc::new(DashMap::new()), + health: Arc::new(DashMap::new()), + max_connections, + next_id: Arc::new(AtomicUsize::new(0)), + semaphore: Arc::new(Semaphore::new(max_connections)), + } + } + + /// Get a connection from the pool or create a new one + /// Uses semaphore for proper concurrency limiting + async fn acquire(&self) -> Result, PluginError> { + // Acquire permit first - this limits total concurrent connections + let permit = self.semaphore.clone().acquire_owned().await.map_err(|_| { + PluginError::PluginError("Connection semaphore closed".to_string()) + })?; + + // Try to find a healthy connection in the pool + let mut candidate_ids = Vec::new(); + + for entry in self.connections.iter() { + let conn_id = *entry.key(); + let is_healthy = self.health.get(&conn_id).map(|h| *h.value()).unwrap_or(false); + if is_healthy { + candidate_ids.push(conn_id); + } + } + + // Try to remove one of the candidates + for conn_id in candidate_ids { + if let Some((_, conn)) = self.connections.remove(&conn_id) { + tracing::debug!(connection_id = conn_id, "Reusing connection from pool"); + return Ok(PooledConnection { + conn: Some(conn), + pool: self, + _permit: permit, + }); + } + } + + // No available connection, create a new one + let id = self.next_id.fetch_add(1, Ordering::Relaxed); + tracing::debug!(connection_id = id, "Creating new pool connection"); + + let conn = PoolConnection::new(&self.socket_path, id).await?; + self.health.insert(id, true); + + Ok(PooledConnection { + conn: Some(conn), + pool: self, + _permit: permit, + }) + } + + /// Return a connection to the pool + fn release(&self, conn: PoolConnection) { + let conn_id = conn.id; + let is_healthy = self.health.get(&conn_id).map(|h| *h.value()).unwrap_or(false); + let pool_size = self.connections.len(); + + if is_healthy && pool_size < self.max_connections { + self.connections.insert(conn_id, conn); + tracing::debug!(connection_id = conn_id, "Connection returned to pool"); + } else { + self.health.remove(&conn_id); + tracing::debug!(connection_id = conn_id, "Connection dropped (unhealthy or pool full)"); + } + } + + /// Mark a connection as unhealthy + fn mark_unhealthy(&self, conn_id: usize) { + self.health.insert(conn_id, false); + self.connections.remove(&conn_id); + } + + /// Clear all connections + async fn clear(&self) { + self.connections.clear(); + self.health.clear(); + } +} + +/// RAII wrapper that returns connection to pool on drop +struct PooledConnection<'a> { + conn: Option, + pool: &'a ConnectionPool, + /// Semaphore permit - released when dropped + _permit: tokio::sync::OwnedSemaphorePermit, +} + +impl<'a> PooledConnection<'a> { + async fn send_request_with_timeout( + &mut self, + request: &PoolRequest, + timeout_secs: u64, + ) -> Result { + if let Some(ref mut conn) = self.conn { + match conn.send_request_with_timeout(request, timeout_secs).await { + Ok(response) => Ok(response), + Err(e) => { + if let Some(conn_id) = self.conn.as_ref().map(|c| c.id) { + self.pool.mark_unhealthy(conn_id); + } + Err(e) + } + } + } else { + Err(PluginError::PluginError("Connection already released".to_string())) + } + } + + /// Mark this connection as unhealthy (won't be returned to pool) + fn mark_unhealthy(&mut self) { + if let Some(conn_id) = self.conn.as_ref().map(|c| c.id) { + self.pool.mark_unhealthy(conn_id); + } + } +} + +impl<'a> Drop for PooledConnection<'a> { + fn drop(&mut self) { + if let Some(conn) = self.conn.take() { + self.pool.release(conn); + } + } +} + +/// Request queue entry for throttling +struct QueuedRequest { + plugin_id: String, + compiled_code: Option, + plugin_path: Option, + params: serde_json::Value, + headers: Option>>, + socket_path: String, + http_request_id: Option, + timeout_secs: Option, + response_tx: oneshot::Sender>, +} + +/// Manages the pool server process and connections +pub struct PoolManager { + socket_path: String, + process: tokio::sync::Mutex>, + initialized: RwLock, + /// Connection pool for reusing connections + connection_pool: Arc, + /// Request queue for throttling/backpressure (multi-consumer channel) + request_tx: async_channel::Sender, + /// Actual configured queue size (for error messages) + max_queue_size: usize, +} + +impl PoolManager { + /// Create a new PoolManager with default socket path + pub fn new() -> Self { + Self::init(format!("/tmp/relayer-plugin-pool-{}.sock", Uuid::new_v4())) + } + + /// Create a new PoolManager with custom socket path + pub fn with_socket_path(socket_path: String) -> Self { + Self::init(socket_path) + } + + /// Common initialization logic + fn init(socket_path: String) -> Self { + let max_connections = std::env::var("PLUGIN_POOL_MAX_CONNECTIONS") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(DEFAULT_POOL_MAX_CONNECTIONS); + let max_queue_size = std::env::var("PLUGIN_POOL_MAX_QUEUE_SIZE") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(DEFAULT_POOL_MAX_QUEUE_SIZE); + + // Use async-channel for multi-consumer queue (no mutex needed) + let (tx, rx) = async_channel::bounded(max_queue_size); + + let connection_pool = Arc::new(ConnectionPool::new(socket_path.clone(), max_connections)); + let connection_pool_clone = connection_pool.clone(); + + // Spawn background workers to process queued requests + Self::spawn_queue_workers(rx, connection_pool_clone); + + Self { + connection_pool, + socket_path, + process: tokio::sync::Mutex::new(None), + initialized: RwLock::new(false), + request_tx: tx, + max_queue_size, + } + } + + /// Spawn multiple worker tasks to process queued requests concurrently + fn spawn_queue_workers( + rx: async_channel::Receiver, + connection_pool: Arc, + ) { + let num_workers = std::env::var("PLUGIN_POOL_WORKERS") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or_else(|| { + std::thread::available_parallelism() + .map(|n| n.get().max(4).min(32)) + .unwrap_or(8) + }); + + tracing::info!(num_workers = num_workers, "Starting request queue workers"); + + for worker_id in 0..num_workers { + let rx_clone = rx.clone(); + let pool_clone = connection_pool.clone(); + + tokio::spawn(async move { + while let Ok(request) = rx_clone.recv().await { + let result = Self::execute_plugin_internal( + &pool_clone, + request.plugin_id, + request.compiled_code, + request.plugin_path, + request.params, + request.headers, + request.socket_path, + request.http_request_id, + request.timeout_secs, + ).await; + + let _ = request.response_tx.send(result); + } + + tracing::debug!(worker_id = worker_id, "Request queue worker exited"); + }); + } + } + + /// Internal execution method + async fn execute_plugin_internal( + connection_pool: &Arc, + plugin_id: String, + compiled_code: Option, + plugin_path: Option, + params: serde_json::Value, + headers: Option>>, + socket_path: String, + http_request_id: Option, + timeout_secs: Option, + ) -> Result { + let mut conn = connection_pool.acquire().await?; + + let request = PoolRequest::Execute { + task_id: Uuid::new_v4().to_string(), + plugin_id: plugin_id.clone(), + compiled_code, + plugin_path, + params, + headers, + socket_path, + http_request_id, + timeout: timeout_secs.map(|s| s * 1000), + }; + + let timeout = timeout_secs.unwrap_or(DEFAULT_POOL_REQUEST_TIMEOUT_SECS); + let response = conn.send_request_with_timeout(&request, timeout).await?; + + let logs: Vec = response + .logs + .unwrap_or_default() + .into_iter() + .map(|l| l.into()) + .collect(); + + if response.success { + let return_value = response + .result + .map(|v| { + if v.is_string() { + v.as_str().unwrap_or("").to_string() + } else { + serde_json::to_string(&v).unwrap_or_default() + } + }) + .unwrap_or_default(); + + Ok(ScriptResult { + logs, + error: String::new(), + return_value, + trace: Vec::new(), + }) + } else { + let error = response.error.unwrap_or(PoolError { + message: "Unknown error".to_string(), + code: None, + status: None, + details: None, + }); + + Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { + message: error.message, + status: error.status.unwrap_or(500), + code: error.code, + details: error.details, + logs: Some(logs), + traces: None, + }))) + } + } + + /// Start the pool server if not already running + pub async fn ensure_started(&self) -> Result<(), PluginError> { + // Fast path: check if already initialized + if *self.initialized.read().await { + return Ok(()); + } + + // Slow path: acquire write lock and start + let mut initialized = self.initialized.write().await; + if *initialized { + return Ok(()); + } + + self.start_pool_server().await?; + *initialized = true; + Ok(()) + } + + /// Ensure pool is started and healthy, with auto-recovery on failure + async fn ensure_started_and_healthy(&self) -> Result<(), PluginError> { + self.ensure_started().await?; + + // Opportunistic health check - don't block on every request + // Check health periodically or on connection errors + // This is a lightweight check that only runs health_check if we detect issues + if let Ok(health) = self.health_check().await { + if !health.healthy { + tracing::warn!( + status = %health.status, + "Pool server unhealthy, attempting automatic recovery" + ); + // Try to restart + if let Err(e) = self.restart().await { + tracing::error!(error = %e, "Failed to restart pool server"); + return Err(PluginError::PluginExecutionError(format!( + "Pool server unhealthy and restart failed: {}", health.status + ))); + } + } + } + Ok(()) + } + + async fn start_pool_server(&self) -> Result<(), PluginError> { + let mut process_guard = self.process.lock().await; + + if process_guard.is_some() { + return Ok(()); + } + + let pool_server_path = std::env::current_dir() + .map(|cwd| cwd.join("plugins/lib/pool-server.ts").display().to_string()) + .unwrap_or_else(|_| "plugins/lib/pool-server.ts".to_string()); + + tracing::info!(socket_path = %self.socket_path, "Starting plugin pool server"); + + let mut child = Command::new("ts-node") + .arg("--transpile-only") + .arg(&pool_server_path) + .arg(&self.socket_path) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .map_err(|e| { + PluginError::PluginExecutionError(format!("Failed to start pool server: {e}")) + })?; + + if let Some(stderr) = child.stderr.take() { + tokio::spawn(async move { + let reader = BufReader::new(stderr); + let mut lines = reader.lines(); + while let Ok(Some(line)) = lines.next_line().await { + tracing::error!(target: "pool_server", "{}", line); + } + }); + } + + if let Some(stdout) = child.stdout.take() { + let reader = BufReader::new(stdout); + let mut lines = reader.lines(); + + let timeout = tokio::time::timeout(Duration::from_secs(10), async { + while let Ok(Some(line)) = lines.next_line().await { + if line.contains("POOL_SERVER_READY") { + return Ok(()); + } + } + Err(PluginError::PluginExecutionError( + "Pool server did not send ready signal".to_string(), + )) + }) + .await; + + match timeout { + Ok(Ok(())) => { + tracing::info!("Plugin pool server ready"); + } + Ok(Err(e)) => return Err(e), + Err(_) => { + return Err(PluginError::PluginExecutionError( + "Timeout waiting for pool server to start".to_string(), + )) + } + } + } + + *process_guard = Some(child); + Ok(()) + } + + /// Execute a plugin via the pool + /// Uses semaphore-based concurrency limiting with queue fallback + pub async fn execute_plugin( + &self, + plugin_id: String, + compiled_code: Option, + plugin_path: Option, + params: serde_json::Value, + headers: Option>>, + socket_path: String, + http_request_id: Option, + timeout_secs: Option, + ) -> Result { + // Ensure pool is started and healthy + self.ensure_started_and_healthy().await?; + + // Try direct execution first (semaphore handles concurrency limiting) + // If semaphore can't be acquired immediately, queue the request + match self.connection_pool.semaphore.clone().try_acquire_owned() { + Ok(permit) => { + // Direct execution path - faster for normal load + let mut conn = { + // Try to get pooled connection + let mut candidate_ids = Vec::new(); + for entry in self.connection_pool.connections.iter() { + let conn_id = *entry.key(); + let is_healthy = self.connection_pool.health.get(&conn_id).map(|h| *h.value()).unwrap_or(false); + if is_healthy { + candidate_ids.push(conn_id); + } + } + + let mut found_conn = None; + for conn_id in candidate_ids { + if let Some((_, conn)) = self.connection_pool.connections.remove(&conn_id) { + found_conn = Some(conn); + break; + } + } + + match found_conn { + Some(conn) => PooledConnection { + conn: Some(conn), + pool: &self.connection_pool, + _permit: permit, + }, + None => { + let id = self.connection_pool.next_id.fetch_add(1, Ordering::Relaxed); + let conn = PoolConnection::new(&self.connection_pool.socket_path, id).await?; + self.connection_pool.health.insert(id, true); + PooledConnection { + conn: Some(conn), + pool: &self.connection_pool, + _permit: permit, + } + } + } + }; + + let request = PoolRequest::Execute { + task_id: Uuid::new_v4().to_string(), + plugin_id: plugin_id.clone(), + compiled_code, + plugin_path, + params, + headers, + socket_path, + http_request_id, + timeout: timeout_secs.map(|s| s * 1000), + }; + + let timeout = timeout_secs.unwrap_or(DEFAULT_POOL_REQUEST_TIMEOUT_SECS); + let response = conn.send_request_with_timeout(&request, timeout).await?; + + let logs: Vec = response + .logs + .unwrap_or_default() + .into_iter() + .map(|l| l.into()) + .collect(); + + if response.success { + let return_value = response + .result + .map(|v| { + if v.is_string() { + v.as_str().unwrap_or("").to_string() + } else { + serde_json::to_string(&v).unwrap_or_default() + } + }) + .unwrap_or_default(); + + Ok(ScriptResult { + logs, + error: String::new(), + return_value, + trace: Vec::new(), + }) + } else { + let error = response.error.unwrap_or(PoolError { + message: "Unknown error".to_string(), + code: None, + status: None, + details: None, + }); + + Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { + message: error.message, + status: error.status.unwrap_or(500), + code: error.code, + details: error.details, + logs: Some(logs), + traces: None, + }))) + } + } + Err(_) => { + // Semaphore full - queue the request for backpressure + let (response_tx, response_rx) = oneshot::channel(); + + let queued_request = QueuedRequest { + plugin_id, + compiled_code, + plugin_path, + params, + headers, + socket_path, + http_request_id, + timeout_secs, + response_tx, + }; + + match self.request_tx.try_send(queued_request) { + Ok(()) => { + response_rx.await.map_err(|_| { + PluginError::PluginExecutionError( + "Request queue processor closed".to_string() + ) + })? + } + Err(async_channel::TrySendError::Full(_)) => { + Err(PluginError::PluginExecutionError(format!( + "Plugin execution queue is full (max: {}). Please retry later.", + self.max_queue_size + ))) + } + Err(async_channel::TrySendError::Closed(_)) => { + Err(PluginError::PluginExecutionError( + "Plugin execution queue is closed".to_string() + )) + } + } + } + } + } + + /// Precompile a plugin + pub async fn precompile_plugin( + &self, + plugin_id: String, + plugin_path: Option, + source_code: Option, + ) -> Result { + self.ensure_started().await?; + + let mut conn = self.connection_pool.acquire().await?; + + let request = PoolRequest::Precompile { + task_id: Uuid::new_v4().to_string(), + plugin_id: plugin_id.clone(), + plugin_path, + source_code, + }; + + let response = conn.send_request_with_timeout(&request, DEFAULT_POOL_REQUEST_TIMEOUT_SECS).await?; + + if response.success { + response + .result + .and_then(|v| v.get("code").and_then(|c| c.as_str()).map(|s| s.to_string())) + .ok_or_else(|| { + PluginError::PluginExecutionError("No compiled code in response".to_string()) + }) + } else { + let error = response.error.unwrap_or(PoolError { + message: "Compilation failed".to_string(), + code: None, + status: None, + details: None, + }); + Err(PluginError::PluginExecutionError(error.message)) + } + } + + /// Cache compiled code in the pool + pub async fn cache_compiled_code( + &self, + plugin_id: String, + compiled_code: String, + ) -> Result<(), PluginError> { + self.ensure_started().await?; + + let mut conn = self.connection_pool.acquire().await?; + + let request = PoolRequest::Cache { + task_id: Uuid::new_v4().to_string(), + plugin_id: plugin_id.clone(), + compiled_code, + }; + + let response = conn.send_request_with_timeout(&request, DEFAULT_POOL_REQUEST_TIMEOUT_SECS).await?; + + if response.success { + Ok(()) + } else { + let error = response.error.unwrap_or(PoolError { + message: "Cache failed".to_string(), + code: None, + status: None, + details: None, + }); + Err(PluginError::PluginError(error.message)) + } + } + + /// Invalidate a cached plugin + pub async fn invalidate_plugin(&self, plugin_id: String) -> Result<(), PluginError> { + if !*self.initialized.read().await { + return Ok(()); + } + + let mut conn = self.connection_pool.acquire().await?; + + let request = PoolRequest::Invalidate { + task_id: Uuid::new_v4().to_string(), + plugin_id, + }; + + let _ = conn.send_request_with_timeout(&request, DEFAULT_POOL_REQUEST_TIMEOUT_SECS).await?; + Ok(()) + } + + /// Health check - verify the pool server is responding + pub async fn health_check(&self) -> Result { + if !*self.initialized.read().await { + return Ok(HealthStatus { + healthy: false, + status: "not_initialized".to_string(), + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + }); + } + + let mut conn = match self.connection_pool.acquire().await { + Ok(c) => c, + Err(e) => { + return Ok(HealthStatus { + healthy: false, + status: format!("connection_failed: {}", e), + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + }); + } + }; + + let request = PoolRequest::Health { + task_id: Uuid::new_v4().to_string(), + }; + + match conn.send_request_with_timeout(&request, 5).await { + Ok(response) => { + if response.success { + let result = response.result.unwrap_or_default(); + Ok(HealthStatus { + healthy: true, + status: result.get("status") + .and_then(|v| v.as_str()) + .unwrap_or("unknown") + .to_string(), + uptime_ms: result.get("uptime").and_then(|v| v.as_u64()), + memory: result.get("memory") + .and_then(|v| v.get("heapUsed")) + .and_then(|v| v.as_u64()), + pool_completed: result.get("pool") + .and_then(|v| v.get("completed")) + .and_then(|v| v.as_u64()), + pool_queued: result.get("pool") + .and_then(|v| v.get("queued")) + .and_then(|v| v.as_u64()), + success_rate: result.get("execution") + .and_then(|v| v.get("successRate")) + .and_then(|v| v.as_f64()), + }) + } else { + Ok(HealthStatus { + healthy: false, + status: response.error.map(|e| e.message).unwrap_or_else(|| "unknown_error".to_string()), + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + }) + } + } + Err(e) => { + conn.mark_unhealthy(); + Ok(HealthStatus { + healthy: false, + status: format!("request_failed: {}", e), + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + }) + } + } + } + + /// Check health and restart if unhealthy + pub async fn ensure_healthy(&self) -> Result { + let health = self.health_check().await?; + + if health.healthy { + return Ok(true); + } + + tracing::warn!(status = %health.status, "Pool server unhealthy, attempting restart"); + + self.restart().await?; + + let health_after = self.health_check().await?; + Ok(health_after.healthy) + } + + /// Force restart the pool server + pub async fn restart(&self) -> Result<(), PluginError> { + tracing::info!("Restarting plugin pool server"); + + self.connection_pool.clear().await; + + { + let mut process_guard = self.process.lock().await; + if let Some(mut child) = process_guard.take() { + let _ = child.kill().await; + } + } + + let _ = std::fs::remove_file(&self.socket_path); + + { + let mut initialized = self.initialized.write().await; + *initialized = false; + } + + self.ensure_started().await + } + + /// Shutdown the pool server + pub async fn shutdown(&self) -> Result<(), PluginError> { + let mut initialized = self.initialized.write().await; + if !*initialized { + return Ok(()); + } + + tracing::info!("Shutting down plugin pool server"); + + self.connection_pool.clear().await; + + if let Ok(mut conn) = PoolConnection::new(&self.socket_path, 999999).await { + let request = PoolRequest::Shutdown { + task_id: Uuid::new_v4().to_string(), + }; + let _ = conn.send_request(&request).await; + } + + let mut process_guard = self.process.lock().await; + if let Some(mut child) = process_guard.take() { + let _ = child.kill().await; + } + + let _ = std::fs::remove_file(&self.socket_path); + + *initialized = false; + Ok(()) + } +} + +impl Drop for PoolManager { + fn drop(&mut self) { + let _ = std::fs::remove_file(&self.socket_path); + } +} + +/// Global pool manager instance +static POOL_MANAGER: std::sync::OnceLock> = std::sync::OnceLock::new(); + +/// Get or create the global pool manager +pub fn get_pool_manager() -> Arc { + POOL_MANAGER + .get_or_init(|| Arc::new(PoolManager::new())) + .clone() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_pool_request_serialization() { + let request = PoolRequest::Execute { + task_id: "test-123".to_string(), + plugin_id: "my-plugin".to_string(), + compiled_code: Some("console.log('hello')".to_string()), + plugin_path: None, + params: serde_json::json!({"key": "value"}), + headers: None, + socket_path: "/tmp/test.sock".to_string(), + http_request_id: Some("req-456".to_string()), + timeout: Some(30000), + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"execute\"")); + assert!(json.contains("\"taskId\":\"test-123\"")); + assert!(json.contains("\"pluginId\":\"my-plugin\"")); + } + + #[test] + fn test_pool_log_entry_conversion() { + let pool_entry = PoolLogEntry { + level: "error".to_string(), + message: "test error".to_string(), + }; + + let log_entry: LogEntry = pool_entry.into(); + assert!(matches!(log_entry.level, LogLevel::Error)); + assert_eq!(log_entry.message, "test error"); + } +} diff --git a/src/services/plugins/runner.rs b/src/services/plugins/runner.rs index f74e968c5..38509474e 100644 --- a/src/services/plugins/runner.rs +++ b/src/services/plugins/runner.rs @@ -1,14 +1,23 @@ //! This module is the orchestrator of the plugin execution. //! //! 1. Initiates a socket connection to the relayer server - socket.rs -//! 2. Executes the plugin script - script_executor.rs +//! 2. Executes the plugin script - script_executor.rs OR pool_executor.rs //! 3. Sends the shutdown signal to the relayer server - socket.rs //! 4. Waits for the relayer server to finish the execution - socket.rs //! 5. Returns the output of the script - script_executor.rs //! -use std::{sync::Arc, time::Duration}; +//! ## Execution Modes +//! +//! - **ts-node mode** (default): Spawns ts-node per request. Simple but slower. +//! - **Pool mode** (`PLUGIN_USE_POOL=true`): Uses persistent Piscina worker pool. +//! Faster execution with precompilation and worker reuse. +//! +use std::{collections::HashMap, sync::Arc, time::Duration}; -use crate::services::plugins::{RelayerApi, ScriptExecutor, ScriptResult, SocketService}; +use crate::services::plugins::{ + ensure_shared_socket_started, get_pool_manager, get_shared_socket_service, RelayerApi, + ScriptExecutor, ScriptResult, SocketService, +}; use crate::{ jobs::JobProducerTrait, models::{ @@ -22,12 +31,32 @@ use crate::{ }; use super::PluginError; +use crate::constants::DEFAULT_TRACE_TIMEOUT_SECS; use async_trait::async_trait; use tokio::{sync::oneshot, time::timeout}; +use tracing::warn; +use uuid::Uuid; #[cfg(test)] use mockall::automock; +/// Check if pool-based execution is enabled via environment variable +fn use_pool_executor() -> bool { + std::env::var("PLUGIN_USE_POOL") + .map(|v| v.eq_ignore_ascii_case("true") || v == "1") + .unwrap_or(false) +} + +/// Get trace timeout duration - defaults to 5s but configurable +fn get_trace_timeout() -> Duration { + Duration::from_secs( + std::env::var("PLUGIN_TRACE_TIMEOUT_SECS") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(DEFAULT_TRACE_TIMEOUT_SECS) + ) +} + #[cfg_attr(test, automock)] #[async_trait] pub trait PluginRunnerTrait { @@ -75,6 +104,66 @@ impl PluginRunnerTrait for PluginRunner { headers_json: Option, state: Arc>, ) -> Result + where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + + Repository + + Send + + Sync + + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, + { + // Choose execution mode based on environment variable + if use_pool_executor() { + return self + .run_with_pool( + plugin_id, + socket_path, + script_path, + timeout_duration, + script_params, + http_request_id, + headers_json, + state, + ) + .await; + } + + // Default: ts-node execution + self.run_with_tsnode( + plugin_id, + socket_path, + script_path, + timeout_duration, + script_params, + http_request_id, + headers_json, + state, + ) + .await + } +} + +impl PluginRunner { + /// Execute plugin using ts-node (legacy mode) + #[allow(clippy::too_many_arguments)] + async fn run_with_tsnode( + &self, + plugin_id: String, + socket_path: &str, + script_path: String, + timeout_duration: Duration, + script_params: String, + http_request_id: Option, + headers_json: Option, + state: Arc>, + ) -> Result where J: JobProducerTrait + Send + Sync + 'static, RR: RelayerRepository + Repository + Send + Sync + 'static, @@ -141,6 +230,113 @@ impl PluginRunnerTrait for PluginRunner { Err(err) => Err(err.with_traces(traces)), } } + + /// Execute plugin using worker pool (new high-performance mode) + /// Uses shared socket service for better scalability + #[allow(clippy::too_many_arguments)] + async fn run_with_pool( + &self, + plugin_id: String, + _socket_path: &str, // Unused - we use shared socket instead + script_path: String, + timeout_duration: Duration, + script_params: String, + http_request_id: Option, + headers_json: Option, + state: Arc>, + ) -> Result + where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + + Repository + + Send + + Sync + + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, + { + // Ensure shared socket service is started + ensure_shared_socket_started(Arc::clone(&state)).await?; + + // Get shared socket service + let shared_socket = get_shared_socket_service()?; + let shared_socket_path = shared_socket.socket_path().to_string(); + + // Generate execution ID (use http_request_id if available, otherwise generate one) + let execution_id = http_request_id.clone().unwrap_or_else(|| { + format!("exec-{}", Uuid::new_v4()) + }); + + // Register execution to receive traces + let mut traces_rx = shared_socket.register_execution(execution_id.clone()); + + // Execute via pool manager (using shared socket path) + let pool_manager = get_pool_manager(); + + // Parse params as JSON Value + let params: serde_json::Value = serde_json::from_str(&script_params) + .unwrap_or(serde_json::Value::String(script_params.clone())); + + // Parse headers if present + let headers: Option>> = headers_json + .as_ref() + .and_then(|h| serde_json::from_str(h).ok()); + + let exec_outcome = match timeout( + timeout_duration, + pool_manager.execute_plugin( + plugin_id.clone(), + None, // compiled_code - will be fetched from cache + Some(script_path), // plugin_path + params, + headers, + shared_socket_path, // Use shared socket path instead of unique one + http_request_id, + Some(timeout_duration.as_secs()), + ), + ) + .await + { + Ok(result) => result, + Err(_) => { + shared_socket.unregister_execution(&execution_id); + return Err(PluginError::ScriptTimeout(timeout_duration.as_secs())); + } + }; + + // Wait for traces with configurable timeout + // Use minimum of trace_timeout and timeout_duration to not exceed execution timeout + let trace_timeout = get_trace_timeout().min(timeout_duration); + let traces = match timeout(trace_timeout, traces_rx.recv()).await { + Ok(Some(traces)) => traces, + Ok(None) => { + warn!("Traces channel closed before receiving traces"); + Vec::new() + } + Err(_) => { + warn!( + timeout_secs = trace_timeout.as_secs(), + "Timeout waiting for traces - consider increasing PLUGIN_TRACE_TIMEOUT_SECS" + ); + Vec::new() + } + }; + + shared_socket.unregister_execution(&execution_id); + + match exec_outcome { + Ok(mut script_result) => { + script_result.trace = traces; + Ok(script_result) + } + Err(e) => Err(e.with_traces(traces)), + } + } } #[cfg(test)] diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs new file mode 100644 index 000000000..a73749403 --- /dev/null +++ b/src/services/plugins/shared_socket.rs @@ -0,0 +1,427 @@ +//! Shared Socket Service +//! +//! This module provides a shared Unix socket service that handles multiple +//! concurrent plugin executions. Instead of creating a new socket per execution, +//! all plugins connect to a single shared socket, dramatically reducing overhead. +//! +//! The key insight: Each plugin execution creates ONE connection, and responses +//! go back over that same connection. The connection itself provides isolation, +//! so we don't need complex routing - just handle each connection independently. + +use crate::constants::{ + DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, + DEFAULT_SOCKET_READ_TIMEOUT_SECS, +}; +use crate::jobs::JobProducerTrait; +use crate::models::{ + NetworkRepoModel, NotificationRepoModel, RelayerRepoModel, SignerRepoModel, ThinDataAppState, + TransactionRepoModel, +}; +use crate::repositories::{ + ApiKeyRepositoryTrait, NetworkRepository, PluginRepositoryTrait, RelayerRepository, Repository, + TransactionCounterTrait, TransactionRepository, +}; +use crate::services::plugins::relayer_api::{RelayerApi, Request}; +use dashmap::DashMap; +use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; +use std::sync::Arc; +use std::time::Duration; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::{UnixListener, UnixStream}; +use tokio::sync::{mpsc, watch}; +use tracing::{debug, info, warn}; + +use super::PluginError; + +/// Execution context for trace collection +struct ExecutionContext { + /// Channel to send traces back to the execution + traces_tx: mpsc::Sender>, +} + +/// Shared socket service that handles multiple concurrent plugin executions +pub struct SharedSocketService { + /// Socket path + socket_path: String, + /// Active execution contexts (execution_id -> ExecutionContext) + executions: Arc>, + /// Whether the listener has been started (instance-level flag) + started: AtomicBool, + /// Shutdown signal sender + shutdown_tx: watch::Sender, + /// Current active connection count + active_connections: Arc, + /// Connection idle timeout + idle_timeout: Duration, + /// Read timeout per line + read_timeout: Duration, +} + +impl SharedSocketService { + /// Create a new shared socket service + pub fn new(socket_path: &str) -> Result { + // Remove existing socket file if it exists (from previous runs or crashed processes) + let _ = std::fs::remove_file(socket_path); + + let (shutdown_tx, _) = watch::channel(false); + + let idle_timeout = Duration::from_secs( + std::env::var("PLUGIN_SOCKET_IDLE_TIMEOUT_SECS") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(DEFAULT_SOCKET_IDLE_TIMEOUT_SECS) + ); + + let read_timeout = Duration::from_secs( + std::env::var("PLUGIN_SOCKET_READ_TIMEOUT_SECS") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(DEFAULT_SOCKET_READ_TIMEOUT_SECS) + ); + + Ok(Self { + socket_path: socket_path.to_string(), + executions: Arc::new(DashMap::new()), + started: AtomicBool::new(false), + shutdown_tx, + active_connections: Arc::new(AtomicUsize::new(0)), + idle_timeout, + read_timeout, + }) + } + + pub fn socket_path(&self) -> &str { + &self.socket_path + } + + /// Register an execution and return a receiver for traces + pub fn register_execution(&self, execution_id: String) -> mpsc::Receiver> { + let (tx, rx) = mpsc::channel(1); + self.executions.insert( + execution_id, + ExecutionContext { traces_tx: tx }, + ); + rx + } + + /// Unregister an execution + pub fn unregister_execution(&self, execution_id: &str) { + self.executions.remove(execution_id); + } + + /// Get current active connection count + pub fn active_connection_count(&self) -> usize { + self.active_connections.load(Ordering::Relaxed) + } + + /// Signal shutdown to the listener + pub fn shutdown(&self) { + let _ = self.shutdown_tx.send(true); + info!("Shared socket service: shutdown signal sent"); + } + + /// Start the shared socket service + /// This spawns a background task that listens for connections + /// Safe to call multiple times - will only start once per instance + pub async fn start( + self: Arc, + state: Arc>, + ) -> Result<(), PluginError> + where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + + Repository + + Send + + Sync + + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, + { + // Check if already started (instance-level flag) + if self.started.swap(true, Ordering::Acquire) { + return Ok(()); + } + + // Create the listener and move it into the task + let listener = UnixListener::bind(&self.socket_path) + .map_err(|e| PluginError::SocketError(format!("Failed to bind listener: {}", e)))?; + let executions = self.executions.clone(); + let relayer_api = Arc::new(RelayerApi); + let socket_path = self.socket_path.clone(); + let mut shutdown_rx = self.shutdown_tx.subscribe(); + let active_connections = self.active_connections.clone(); + let idle_timeout = self.idle_timeout; + let read_timeout = self.read_timeout; + + info!("Shared socket service: starting listener on {}", socket_path); + + // Spawn the listener task + tokio::spawn(async move { + debug!("Shared socket service: listener task started"); + loop { + tokio::select! { + // Check for shutdown signal + _ = shutdown_rx.changed() => { + if *shutdown_rx.borrow() { + info!("Shared socket service: shutting down listener"); + break; + } + } + // Accept new connections + accept_result = listener.accept() => { + match accept_result { + Ok((stream, _)) => { + // Check connection limit + let current = active_connections.load(Ordering::Relaxed); + if current >= DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS { + warn!( + current_connections = current, + max_connections = DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, + "Connection limit reached, rejecting new connection" + ); + drop(stream); + continue; + } + + active_connections.fetch_add(1, Ordering::Relaxed); + debug!( + active_connections = active_connections.load(Ordering::Relaxed), + "Shared socket service: accepted new connection" + ); + + let relayer_api_clone = relayer_api.clone(); + let state_clone = Arc::clone(&state); + let executions_clone = executions.clone(); + let active_connections_clone = active_connections.clone(); + + tokio::spawn(async move { + let result = Self::handle_connection_with_timeout( + stream, + relayer_api_clone, + state_clone, + executions_clone, + idle_timeout, + read_timeout, + ) + .await; + + // Always decrement connection count + active_connections_clone.fetch_sub(1, Ordering::Relaxed); + + if let Err(e) = result { + debug!("Connection handler finished with error: {}", e); + } + }); + } + Err(e) => { + warn!("Error accepting connection: {}", e); + } + } + } + } + } + + // Cleanup on shutdown + let _ = std::fs::remove_file(&socket_path); + info!("Shared socket service: listener stopped"); + }); + + Ok(()) + } + + /// Handle connection with overall idle timeout + async fn handle_connection_with_timeout( + stream: UnixStream, + relayer_api: Arc, + state: Arc>, + executions: Arc>, + idle_timeout: Duration, + read_timeout: Duration, + ) -> Result<(), PluginError> + where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + + Repository + + Send + + Sync + + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, + { + // Wrap the entire connection handling with an idle timeout + match tokio::time::timeout( + idle_timeout, + Self::handle_connection(stream, relayer_api, state, executions, read_timeout), + ) + .await + { + Ok(result) => result, + Err(_) => { + debug!("Connection idle timeout reached"); + Ok(()) + } + } + } + + /// Handle a connection from a plugin + async fn handle_connection( + stream: UnixStream, + relayer_api: Arc, + state: Arc>, + executions: Arc>, + read_timeout: Duration, + ) -> Result<(), PluginError> + where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + + Repository + + Send + + Sync + + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, + { + let (r, mut w) = stream.into_split(); + let mut reader = BufReader::new(r).lines(); + let mut traces = Vec::new(); + let mut execution_id: Option = None; + + loop { + // Read line with timeout to prevent hanging connections + let line = match tokio::time::timeout(read_timeout, reader.next_line()).await { + Ok(Ok(Some(line))) => line, + Ok(Ok(None)) => break, // EOF + Ok(Err(e)) => { + warn!("Error reading from connection: {}", e); + break; + } + Err(_) => { + debug!("Read timeout on connection"); + break; + } + }; + + debug!("Shared socket service: received message"); + + // Parse JSON once and reuse (fix double parsing) + let json_value: serde_json::Value = match serde_json::from_str(&line) { + Ok(v) => v, + Err(e) => { + warn!("Failed to parse JSON: {}", e); + continue; + } + }; + + // Store raw JSON for traces + traces.push(json_value.clone()); + + // Deserialize into Request from the already-parsed Value + let request: Request = match serde_json::from_value(json_value) { + Ok(req) => req, + Err(e) => { + warn!("Failed to parse request structure: {}", e); + continue; + } + }; + + if execution_id.is_none() { + execution_id = request + .http_request_id + .clone() + .or_else(|| Some(request.request_id.clone())); + } + + let response = relayer_api.handle_request(request, &state).await; + + let response_str = serde_json::to_string(&response) + .map_err(|e| PluginError::PluginError(e.to_string()))? + + "\n"; + + if let Err(e) = w.write_all(response_str.as_bytes()).await { + warn!("Failed to write response: {}", e); + break; + } + } + + if let Some(exec_id) = execution_id { + if let Some(ctx) = executions.get(&exec_id) { + let _ = ctx.traces_tx.send(traces).await; + } + } + + debug!("Shared socket service: connection closed"); + Ok(()) + } +} + +impl Drop for SharedSocketService { + fn drop(&mut self) { + // Signal shutdown and cleanup socket file + let _ = self.shutdown_tx.send(true); + let _ = std::fs::remove_file(&self.socket_path); + } +} + +/// Global shared socket service instance with proper error handling +static SHARED_SOCKET: std::sync::OnceLock, String>> = std::sync::OnceLock::new(); + +/// Get or create the global shared socket service +/// Returns error if initialization fails instead of panicking +pub fn get_shared_socket_service() -> Result, PluginError> { + let socket_path = "/tmp/relayer-plugin-shared.sock"; + + let result = SHARED_SOCKET.get_or_init(|| { + // Remove existing socket file if it exists (from previous runs) + let _ = std::fs::remove_file(socket_path); + + match SharedSocketService::new(socket_path) { + Ok(service) => Ok(Arc::new(service)), + Err(e) => Err(e.to_string()), + } + }); + + match result { + Ok(service) => Ok(service.clone()), + Err(e) => Err(PluginError::SocketError(format!( + "Failed to create shared socket service: {}", e + ))), + } +} + +/// Ensure the shared socket service is started +pub async fn ensure_shared_socket_started( + state: Arc>, +) -> Result<(), PluginError> +where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + + Repository + + Send + + Sync + + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, +{ + let service = get_shared_socket_service()?; + service.start(state).await +} diff --git a/src/services/plugins/socket.rs b/src/services/plugins/socket.rs index 8e7c7356a..a50859a1a 100644 --- a/src/services/plugins/socket.rs +++ b/src/services/plugins/socket.rs @@ -134,27 +134,63 @@ impl SocketService { let mut traces = Vec::new(); + debug!("Plugin API socket: listen loop started"); + loop { let state = Arc::clone(&state); let relayer_api = Arc::clone(&relayer_api); - tokio::select! { - Ok((stream, _)) = self.listener.accept() => { - let result = tokio::spawn(Self::handle_connection::(stream, state, relayer_api)) - .await - .map_err(|e| PluginError::SocketError(e.to_string()))?; + debug!("Plugin API socket: waiting for connection or shutdown"); - match result { - Ok(trace) => traces.extend(trace), - Err(e) => return Err(e), + // First, wait for either a connection or shutdown + let stream = tokio::select! { + biased; + + _ = &mut shutdown => { + debug!("Plugin API socket: shutdown signal received (while waiting for connection)"); + break; + } + + accept_result = self.listener.accept() => { + match accept_result { + Ok((stream, _)) => { + debug!("Plugin API socket: accepted connection"); + stream + } + Err(e) => { + debug!("Plugin API socket: accept error: {}", e); + continue; + } } } + }; + + // Now handle the connection, but also listen for shutdown + // We spawn the handler and then select between it finishing or shutdown + let handle = tokio::spawn(Self::handle_connection::(stream, state, relayer_api)); + tokio::pin!(handle); + + tokio::select! { + biased; + _ = &mut shutdown => { - debug!("Shutdown signal received. Closing listener."); + debug!("Plugin API socket: shutdown signal received (while handling connection)"); + // Abort the handler - it will be cancelled + handle.abort(); break; } + + result = &mut handle => { + debug!("Plugin API socket: connection handler completed"); + match result { + Ok(Ok(trace)) => traces.extend(trace), + Ok(Err(e)) => return Err(e), + Err(e) => return Err(PluginError::SocketError(e.to_string())), + } + } } } + debug!("Plugin API socket: listen loop exited"); Ok(traces) } @@ -195,7 +231,10 @@ impl SocketService { let mut reader = BufReader::new(r).lines(); let mut traces = Vec::new(); + debug!("Plugin API socket: handle_connection started"); + while let Ok(Some(line)) = reader.next_line().await { + debug!("Plugin API socket: received request"); let trace: serde_json::Value = serde_json::from_str(&line) .map_err(|e| PluginError::PluginError(format!("Failed to parse trace: {e}")))?; traces.push(trace); @@ -210,8 +249,10 @@ impl SocketService { + "\n"; let _ = w.write_all(response_str.as_bytes()).await; + debug!("Plugin API socket: sent response"); } + debug!("Plugin API socket: handle_connection finished (client closed)"); Ok(traces) } } @@ -327,6 +368,12 @@ mod tests { ); let bytes_read = read_result.unwrap().unwrap(); assert!(bytes_read > 0, "No data received"); + + // Close the client first, then wait a bit for the handler to complete + // before sending shutdown. This ensures the handler loop processes the + // connection closure and collects the traces. + client.shutdown().await.unwrap(); + tokio::time::sleep(Duration::from_millis(50)).await; shutdown_tx.send(()).unwrap(); let response: Response = serde_json::from_str(&response_str).unwrap(); @@ -338,8 +385,6 @@ mod tests { "Request id mismatch" ); - client.shutdown().await.unwrap(); - let traces = listen_handle.await.unwrap().unwrap(); assert_eq!(traces.len(), 1); From ef5dc59703f1137096002e2ebc192798762b34aa Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 29 Dec 2025 15:30:04 +0100 Subject: [PATCH 02/42] chore: PArtial --- docs/plugins/index.mdx | 157 ++++++ plugins/examples/example-rpc.ts | 26 +- plugins/lib/build-executor.ts | 326 +++++++++++- plugins/lib/compiler.ts | 540 ++++++++++++++++++-- plugins/lib/kv.ts | 6 + plugins/lib/logger.ts | 29 +- src/bootstrap/initialize_plugins.rs | 30 +- src/main.rs | 13 +- src/repositories/plugin/mod.rs | 10 +- src/repositories/plugin/plugin_in_memory.rs | 2 +- src/services/plugins/config.rs | 280 ++++++++++ src/services/plugins/mod.rs | 24 +- src/services/plugins/runner.rs | 77 +-- src/services/plugins/socket.rs | 15 +- 14 files changed, 1387 insertions(+), 148 deletions(-) create mode 100644 src/services/plugins/config.rs diff --git a/docs/plugins/index.mdx b/docs/plugins/index.mdx index 9cd5c5bfa..b2fddb798 100644 --- a/docs/plugins/index.mdx +++ b/docs/plugins/index.mdx @@ -644,3 +644,160 @@ The relayer will automatically detect which pattern your plugin uses: - If neither โ†’ shows clear error message This ensures a smooth transition period where both patterns work simultaneously. + +## Performance Tuning + +For production deployments handling high concurrency, the plugin system offers extensive tuning options via environment variables. + +### Execution Modes + +The plugin system supports two execution modes: + +| Mode | Environment Variable | Description | +|------|---------------------|-------------| +| **ts-node** (default) | `PLUGIN_USE_POOL=false` | Spawns a new process per request. Simple but slower. | +| **Pool mode** | `PLUGIN_USE_POOL=true` | Uses persistent worker pool. **Recommended for production.** | + + +Pool mode significantly improves performance by reusing worker processes and maintaining persistent connections. Enable it for any production deployment. + + +### Environment Variables Reference + +#### Simple Scaling (Recommended) + + +**Most users only need one variable!** Set `PLUGIN_MAX_CONCURRENCY` and everything else is auto-calculated. + + +```bash +# This is all you need for 3000 concurrent users: +export PLUGIN_MAX_CONCURRENCY=3000 +``` + +The system automatically derives on **both Rust and Node.js sides**: + +**Rust side (connection pool & queue):** +- `PLUGIN_POOL_MAX_CONNECTIONS` = 3000 (1:1 ratio) +- `PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS` = 4500 (1.5x for headroom) +- `PLUGIN_POOL_MAX_QUEUE_SIZE` = 6000 (2x for burst handling) +- `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` = 1000 (auto-scaled for high load) + +**Node.js side (worker pool):** +- `PLUGIN_POOL_MAX_THREADS` = min(cpuCountร—2, concurrency/50, 64) +- `PLUGIN_POOL_CONCURRENT_TASKS` = max(10, concurrency/maxThreads) up to 50 + +#### Advanced Overrides (Power Users) + +You can override any auto-derived value when needed: + +```bash +# Set the primary scaling knob +export PLUGIN_MAX_CONCURRENCY=3000 + +# Override just the queue size (other values still auto-derived) +export PLUGIN_POOL_MAX_QUEUE_SIZE=10000 +``` + +#### All Available Variables + +| Variable | Default | Auto-Derived From | Description | +|----------|---------|-------------------|-------------| +| `PLUGIN_MAX_CONCURRENCY` | 2048 | - | **Primary scaling knob** - sets expected concurrent load | +| **Rust Side** |||| +| `PLUGIN_POOL_MAX_CONNECTIONS` | 2048 | `MAX_CONCURRENCY` | Max connections to pool server | +| `PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS` | 4096 | `MAX_CONCURRENCY ร— 1.5` | Max plugin connections to relayer | +| `PLUGIN_POOL_MAX_QUEUE_SIZE` | 5000 | `MAX_CONCURRENCY ร— 2` | Max queued requests | +| `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` | 500 | Auto-scaled | Wait time when queue is full | +| `PLUGIN_POOL_CONNECT_RETRIES` | 15 | - | Retry attempts when connecting | +| `PLUGIN_POOL_REQUEST_TIMEOUT_SECS` | 30 | - | Timeout for pool requests | +| `PLUGIN_SOCKET_IDLE_TIMEOUT_SECS` | 60 | - | Close idle connections after | +| `PLUGIN_SOCKET_READ_TIMEOUT_SECS` | 30 | - | Read timeout per message | +| `PLUGIN_POOL_WORKERS` | auto | CPU cores | Queue processing workers | +| **Node.js Side** |||| +| `PLUGIN_POOL_MAX_THREADS` | auto | `MAX_CONCURRENCY / 50` | Worker threads in pool (capped at 64) | +| `PLUGIN_POOL_CONCURRENT_TASKS` | auto | `MAX_CONCURRENCY / maxThreads` | Tasks per worker (10-50) | +| `PLUGIN_POOL_IDLE_TIMEOUT` | 60000 | - | Worker idle timeout (ms) | + +#### Timeout Alignment + + +Timeouts must be aligned! If your plugin takes up to 120s, set these accordingly. + + +```bash +# In config.json: "timeout": 120 + +# Environment should match: +export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=120 +export PLUGIN_SOCKET_IDLE_TIMEOUT_SECS=180 # 1.5x plugin timeout +``` + +#### Health & Recovery + +Controls automatic health monitoring and recovery. + +| Variable | Default | Description | +|----------|---------|-------------| +| `PLUGIN_POOL_HEALTH_CHECK_INTERVAL_SECS` | 5 | Minimum seconds between health checks | +| `PLUGIN_TRACE_TIMEOUT_MS` | 100 | Timeout for collecting execution traces | + +### Load Profile Examples + +#### Low Load (< 100 concurrent requests) + +```bash +export PLUGIN_USE_POOL=true +# Default settings are sufficient +``` + +#### Medium Load (100-1000 concurrent requests) + +```bash +export PLUGIN_USE_POOL=true +export PLUGIN_MAX_CONCURRENCY=1000 +``` + +#### High Load (1000-5000 concurrent requests) + +```bash +export PLUGIN_USE_POOL=true +export PLUGIN_MAX_CONCURRENCY=3000 +export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=60 +``` + +#### Extreme Load (5000+ concurrent requests) + +```bash +export PLUGIN_USE_POOL=true +export PLUGIN_MAX_CONCURRENCY=8000 +export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=120 +export PLUGIN_POOL_CONNECT_RETRIES=20 +``` + +### System Limits + +For high concurrency, you may need to increase OS-level limits: + +```bash +# Increase file descriptor limit (Linux/macOS) +ulimit -n 65536 + +# For macOS, also run: +sudo sysctl -w kern.maxfiles=65536 +sudo sysctl -w kern.maxfilesperproc=65536 +``` + +### Troubleshooting Common Errors + +| Error | Cause | Solution | +|-------|-------|----------| +| `Plugin execution queue is full` | More requests than queue can hold | Increase `PLUGIN_POOL_MAX_QUEUE_SIZE` and `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` | +| `Connection limit reached` | Too many concurrent plugin connections | Increase `PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS` | +| `Failed to connect to pool after N attempts` | Pool server overwhelmed | Increase `PLUGIN_POOL_CONNECT_RETRIES` and `PLUGIN_POOL_MAX_CONNECTIONS` | +| `ScriptTimeout(N)` | Plugin execution exceeded timeout | Increase `timeout` in plugin config (config.json) | +| `All connection permits exhausted` | Connection pool at capacity | Increase `PLUGIN_POOL_MAX_CONNECTIONS` | + + +When increasing limits significantly, monitor your system's memory and CPU usage. Each connection consumes resources. + diff --git a/plugins/examples/example-rpc.ts b/plugins/examples/example-rpc.ts index 4e918dce3..f73a85713 100644 --- a/plugins/examples/example-rpc.ts +++ b/plugins/examples/example-rpc.ts @@ -6,6 +6,9 @@ import { JsonRpcResponseNetworkRpcResult, PluginAPI } from "@openzeppelin/relaye type Params = {}; +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + + /** * Plugin handler function - this is the entry point * Export it as 'handler' and the relayer will automatically call it @@ -19,12 +22,19 @@ export async function handler(api: PluginAPI, params: Params): Promise { + try { + return await import('esbuild'); + } catch { + throw new Error( + 'esbuild is not installed. Run: npm install esbuild\n' + + 'Or if using yarn: yarn add esbuild' + ); + } +} + +/** + * Calculate SHA256 hash of file content + */ +function calculateHash(filePath: string): string { + const content = fs.readFileSync(filePath); + return crypto.createHash('sha256').update(content).digest('hex'); +} + +/** + * Calculate SHA256 hash of string content + */ +function calculateContentHash(content: string): string { + return crypto.createHash('sha256').update(content).digest('hex'); +} + +/** + * Safe file deletion - handles EBUSY, ENOENT gracefully + */ +function safeUnlink(filePath: string): boolean { + try { + if (fs.existsSync(filePath)) { + fs.unlinkSync(filePath); + return true; + } + } catch (err) { + const error = err as NodeJS.ErrnoException; + // Ignore common non-critical errors + if (error.code === 'ENOENT') return false; // File doesn't exist + if (error.code === 'EBUSY') { + console.warn(` โš  File busy, skipping cleanup: ${filePath}`); + return false; + } + if (error.code === 'EPERM') { + console.warn(` โš  Permission denied, skipping cleanup: ${filePath}`); + return false; + } + // Re-throw unexpected errors + throw err; + } + return false; +} + +/** + * Clean up partial output files on failure + */ +function cleanup(tempPath?: string): void { + console.log('Cleaning up...'); + if (tempPath) safeUnlink(tempPath); + safeUnlink(outputPath); + safeUnlink(hashPath); +} + +/** + * Validate input file exists and is readable + */ +function validateInput(): void { + if (!fs.existsSync(inputPath)) { + throw new Error(`Input file not found: ${inputPath}`); + } + + const stats = fs.statSync(inputPath); + if (!stats.isFile()) { + throw new Error(`Input path is not a file: ${inputPath}`); + } + + if (stats.size === 0) { + throw new Error(`Input file is empty: ${inputPath}`); + } + + try { + fs.accessSync(inputPath, fs.constants.R_OK); + } catch { + throw new Error(`Input file is not readable: ${inputPath}`); + } +} + +/** + * Check if build can be skipped (input unchanged) + */ +function checkBuildCache(inputHash: string, force: boolean): boolean { + if (force) { + console.log(' โ†’ Force flag set, skipping cache check'); + return false; + } + + // Check if output exists + if (!fs.existsSync(outputPath)) { + console.log(' โ†’ Output file missing, rebuild required'); + return false; + } + + // Check if hash file exists + if (!fs.existsSync(cacheHashPath)) { + console.log(' โ†’ Cache hash missing, rebuild required'); + return false; + } + + // Compare input hash with cached hash + try { + const cachedHash = fs.readFileSync(cacheHashPath, 'utf-8').trim(); + if (cachedHash === inputHash) { + return true; // Cache hit - no rebuild needed + } + console.log(' โ†’ Input changed, rebuild required'); + } catch { + console.log(' โ†’ Cache read failed, rebuild required'); + } + + return false; +} + +/** + * Verify output file has valid JavaScript syntax (without executing) + */ +function verifySyntax(filePath: string): void { + const content = fs.readFileSync(filePath, 'utf-8'); + + try { + // Use vm.Script to parse without executing + // This catches syntax errors without side effects + new vm.Script(content, { filename: filePath }); + } catch (err) { + const error = err as Error; + throw new Error(`Output has invalid JavaScript syntax: ${error.message}`); + } +} + +/** + * Verify output file is valid + */ +function verifyOutput(filePath: string): void { + if (!fs.existsSync(filePath)) { + throw new Error(`Output file was not created: ${filePath}`); + } + + const stats = fs.statSync(filePath); + if (stats.size === 0) { + throw new Error(`Output file is empty: ${filePath}`); + } + + // Syntax check without execution (no side effects) + verifySyntax(filePath); +} + +/** + * Atomic file write: write to temp, then rename + */ +function atomicWriteFile(targetPath: string, content: string): string { + const tempPath = path.join( + os.tmpdir(), + `build-executor-${crypto.randomUUID()}.tmp` + ); + + fs.writeFileSync(tempPath, content, 'utf-8'); + fs.renameSync(tempPath, targetPath); + + return tempPath; +} + +/** + * Write hash to .sha256 file for runtime verification + */ +function writeHashFile(hash: string): void { + const content = `${hash} sandbox-executor.js\n`; + atomicWriteFile(hashPath, content); +} +/** + * Save input hash for build caching + */ +function saveBuildCache(inputHash: string): void { + atomicWriteFile(cacheHashPath, inputHash); +} + +/** + * Generate build metadata banner + */ +function generateBanner(inputHash: string): string { + const now = new Date().toISOString(); + const nodeVersion = process.version; + return `/** + * Auto-generated by build-executor.ts + * Build time: ${now} + * Node version: ${nodeVersion} + * Source: sandbox-executor.ts + * Source hash: ${inputHash.substring(0, 16)} + * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts + */`; +} + +async function build(): Promise { + const forceRebuild = process.argv.includes('--force'); + let tempOutputPath: string | undefined; + + console.log('=== Building sandbox-executor ==='); + console.log(`Input: ${inputPath}`); + console.log(`Output: ${outputPath}`); + + // Step 1: Validate dependencies + console.log('\n[1/7] Checking dependencies...'); + const esbuild = await validateDependencies(); + console.log(' โœ“ esbuild available'); + + // Step 2: Validate input + console.log('\n[2/7] Validating input file...'); + validateInput(); + const inputHash = calculateHash(inputPath); + console.log(` โœ“ Input valid (SHA256: ${inputHash.substring(0, 16)}...)`); + + // Step 3: Check build cache + console.log('\n[3/7] Checking build cache...'); + if (checkBuildCache(inputHash, forceRebuild)) { + console.log(' โœ“ Build cache valid - skipping rebuild'); + console.log('\n=== Build skipped (up to date) ==='); + return; + } + + // Step 4: Build to temp file (atomic write preparation) + console.log('\n[4/7] Compiling TypeScript...'); + tempOutputPath = path.join(os.tmpdir(), `sandbox-executor-${crypto.randomUUID()}.js`); + const result = await esbuild.build({ entryPoints: [inputPath], bundle: true, @@ -26,21 +272,79 @@ async function build() { format: 'cjs', sourcemap: false, write: true, - outfile: outputPath, + outfile: tempOutputPath, loader: { '.ts': 'ts' }, external: ['node:*'], + banner: { + js: generateBanner(inputHash), + }, }); + // Handle errors if (result.errors.length > 0) { - console.error('Build failed:', result.errors); + console.error('\nโŒ Build errors:'); + for (const error of result.errors) { + console.error(` - ${error.text}`); + if (error.location) { + console.error(` at ${error.location.file}:${error.location.line}:${error.location.column}`); + } + } + cleanup(tempOutputPath); process.exit(1); } + // Handle warnings + if (result.warnings.length > 0) { + console.log('\nโš ๏ธ Build warnings:'); + for (const warning of result.warnings) { + console.log(` - ${warning.text}`); + if (warning.location) { + console.log(` at ${warning.location.file}:${warning.location.line}:${warning.location.column}`); + } + } + } + + console.log(' โœ“ Compilation successful'); + + // Step 5: Verify output (syntax check, no execution) + console.log('\n[5/7] Verifying output syntax...'); + verifyOutput(tempOutputPath); + console.log(' โœ“ Output has valid JavaScript syntax'); + + // Step 6: Atomic move to final location + console.log('\n[6/7] Finalizing output...'); + fs.renameSync(tempOutputPath, outputPath); + tempOutputPath = undefined; // Clear so cleanup doesn't try to delete + console.log(' โœ“ Output written atomically'); + + // Step 7: Write hash files and cache + console.log('\n[7/7] Writing integrity hash...'); + const outputHash = calculateHash(outputPath); + writeHashFile(outputHash); + saveBuildCache(inputHash); + console.log(` โœ“ SHA256: ${outputHash}`); + console.log(` โœ“ Hash saved to: ${hashPath}`); + + // Print summary const stats = fs.statSync(outputPath); - console.log(`โœ“ Compiled to ${outputPath} (${(stats.size / 1024).toFixed(1)} KB)`); + console.log('\n=== Build complete! ==='); + console.log('โ”€'.repeat(50)); + console.log(` Output: ${outputPath}`); + console.log(` Hash file: ${hashPath}`); + console.log(` Size: ${(stats.size / 1024).toFixed(1)} KB`); + console.log(` Input hash: ${inputHash.substring(0, 16)}...`); + console.log(` Output hash: ${outputHash.substring(0, 16)}...`); + console.log('โ”€'.repeat(50)); } +// Run build with proper error handling build().catch((err) => { - console.error('Build failed:', err); + const error = err as Error; + console.error(`\nโŒ Build failed: ${error.message}`); + if (error.stack) { + console.error('\nStack trace:'); + console.error(error.stack.split('\n').slice(1, 5).join('\n')); + } + cleanup(); process.exit(1); }); diff --git a/plugins/lib/compiler.ts b/plugins/lib/compiler.ts index 8db14a62a..63a18a447 100644 --- a/plugins/lib/compiler.ts +++ b/plugins/lib/compiler.ts @@ -1,15 +1,40 @@ /** * Plugin Compiler Module * - * Uses esbuild for fast in-memory TypeScript โ†’ JavaScript compilation. - * No filesystem writes - compiled code is returned for storage in memory/Redis. + * Uses esbuild for fast TypeScript โ†’ JavaScript compilation with bundling. + * Dependencies are bundled into the output for self-contained plugins. + * + * Security: + * - Input size limits to prevent memory exhaustion + * - Path traversal protection + * - Compilation timeout + * - Sanitized error messages */ import * as esbuild from 'esbuild'; import type { Message } from 'esbuild'; import * as fs from 'node:fs'; import * as path from 'node:path'; +import * as os from 'node:os'; + +/** Maximum source file size (5MB) */ +const MAX_SOURCE_SIZE = 5 * 1024 * 1024; + +/** Maximum compiled code size (10MB) */ +const MAX_COMPILED_SIZE = 10 * 1024 * 1024; + +/** Default compilation timeout (30 seconds) */ +const DEFAULT_COMPILE_TIMEOUT_MS = 30000; +/** Maximum concurrent compilations in batch mode */ +const MAX_CONCURRENT_COMPILATIONS = 10; + +/** Default base directory for plugins */ +const DEFAULT_PLUGIN_BASE_DIR = path.resolve(process.cwd(), 'plugins'); + +/** + * Result of compiling a plugin + */ export interface CompilationResult { /** The compiled JavaScript code */ code: string; @@ -19,27 +44,282 @@ export interface CompilationResult { warnings: string[]; } +/** + * Options for plugin compilation + */ export interface CompilerOptions { /** Target ECMAScript version */ target?: 'es2020' | 'es2021' | 'es2022' | 'esnext'; - /** Whether to generate source maps */ - sourcemap?: boolean; + /** Whether to generate source maps ('inline' or 'external') */ + sourcemap?: boolean | 'inline' | 'external'; /** Whether to minify the output */ minify?: boolean; + /** Compilation timeout in milliseconds (default: 30000) */ + timeout?: number; + /** Base directory for security checks (plugins must be within this directory) */ + baseDir?: string; + /** Directory to resolve node_modules from (default: process.cwd()) */ + resolveDir?: string; +} + +/** + * Error codes for compilation failures + */ +export type CompilationErrorCode = + | 'FILE_NOT_FOUND' + | 'FILE_NOT_READABLE' + | 'SIZE_LIMIT' + | 'COMPILE_ERROR' + | 'TIMEOUT' + | 'PATH_TRAVERSAL' + | 'UNKNOWN'; + +/** + * Error information from batch compilation + */ +export interface CompilationError { + /** Path to the plugin that failed */ + pluginPath: string; + /** Error message (sanitized) */ + message: string; + /** Error code for categorization */ + code: CompilationErrorCode; +} + +/** + * Result of batch compilation + */ +export interface BatchCompilationResult { + /** Successfully compiled plugins */ + results: Map; + /** Compilation errors */ + errors: CompilationError[]; } -const DEFAULT_OPTIONS: Required = { +const DEFAULT_OPTIONS: Required> & { + timeout: number; +} = { target: 'es2022', sourcemap: false, minify: false, + timeout: DEFAULT_COMPILE_TIMEOUT_MS, }; /** - * Compiles a TypeScript plugin file to JavaScript in-memory using esbuild. + * Valid error codes for type checking + */ +const VALID_ERROR_CODES: readonly CompilationErrorCode[] = [ + 'FILE_NOT_FOUND', + 'FILE_NOT_READABLE', + 'SIZE_LIMIT', + 'COMPILE_ERROR', + 'TIMEOUT', + 'PATH_TRAVERSAL', + 'UNKNOWN', +]; + +/** + * Normalize an error code to a valid CompilationErrorCode + */ +function normalizeErrorCode(code: unknown): CompilationErrorCode { + if (typeof code === 'string' && VALID_ERROR_CODES.includes(code as CompilationErrorCode)) { + return code as CompilationErrorCode; + } + return 'UNKNOWN'; +} + +/** + * Sanitize file path for safe error messages. + * Replaces user home directories and absolute paths with safe alternatives. + * + * @param filePath - The file path to sanitize + * @returns Sanitized path safe for error messages + */ +function sanitizePath(filePath: string): string { + let sanitized = filePath; + + // Replace current working directory with '.' + const cwd = process.cwd(); + if (sanitized.startsWith(cwd)) { + sanitized = '.' + sanitized.slice(cwd.length); + } + + // Replace home directories with '~' + const homeDir = os.homedir(); + if (sanitized.startsWith(homeDir)) { + sanitized = '~' + sanitized.slice(homeDir.length); + } + + // Platform-specific home directory patterns + sanitized = sanitized + .replace(/\/home\/[^/]+/g, '~') + .replace(/\/Users\/[^/]+/g, '~') + .replace(/C:\\Users\\[^\\]+/gi, '~'); + + return sanitized; +} + +/** + * Validate that a path doesn't contain traversal attacks. + * + * @param pluginPath - Path to validate + * @param basePath - Optional base path that the plugin must be within + * @throws Error if path contains traversal sequences + */ +function validatePathSecurity(pluginPath: string, basePath?: string): void { + // Normalize the path first + const normalized = path.normalize(pluginPath); + + // Check if the NORMALIZED path still contains '..' (actual traversal) + const parts = normalized.split(path.sep); + if (parts.includes('..')) { + throw Object.assign(new Error('Path traversal not allowed'), { + code: 'PATH_TRAVERSAL', + }); + } + + // If base path specified, ensure plugin is within it + if (basePath) { + const absolutePlugin = path.isAbsolute(normalized) + ? normalized + : path.resolve(basePath, normalized); + const absoluteBase = path.resolve(basePath); + + // Ensure plugin path starts with base path (with separator to avoid partial matches) + if (!absolutePlugin.startsWith(absoluteBase + path.sep) && absolutePlugin !== absoluteBase) { + throw Object.assign(new Error('Plugin path must be within allowed directory'), { + code: 'PATH_TRAVERSAL', + }); + } + } +} + +/** + * Validate source code input. + * + * @param sourceCode - Source code to validate + * @param sourcePath - Path for error messages + * @throws Error if validation fails + */ +function validateSourceCode(sourceCode: string, sourcePath: string): void { + if (typeof sourceCode !== 'string') { + throw Object.assign(new Error(`Invalid source code type for ${sanitizePath(sourcePath)}`), { + code: 'COMPILE_ERROR', + }); + } + + if (sourceCode.length === 0) { + throw Object.assign(new Error(`Source code is empty for ${sanitizePath(sourcePath)}`), { + code: 'COMPILE_ERROR', + }); + } + + if (sourceCode.length > MAX_SOURCE_SIZE) { + throw Object.assign( + new Error( + `Source code exceeds size limit (${(sourceCode.length / 1024 / 1024).toFixed(1)}MB > ${MAX_SOURCE_SIZE / 1024 / 1024}MB)` + ), + { code: 'SIZE_LIMIT' } + ); + } +} + +/** + * Validate compiled code output. + * + * @param code - Compiled code to validate + * @throws Error if validation fails + */ +function validateCompiledCode(code: string): void { + if (code.length > MAX_COMPILED_SIZE) { + throw Object.assign( + new Error( + `Compiled code exceeds size limit (${(code.length / 1024 / 1024).toFixed(1)}MB > ${MAX_COMPILED_SIZE / 1024 / 1024}MB)` + ), + { code: 'SIZE_LIMIT' } + ); + } +} + +/** + * Check if a file exists and is readable. + * + * @param filePath - Path to check + * @throws Error with specific code if file is not accessible + */ +async function validateFileAccess(filePath: string): Promise { + try { + await fs.promises.access(filePath, fs.constants.R_OK); + } catch (err) { + const error = err as NodeJS.ErrnoException; + if (error.code === 'ENOENT') { + throw Object.assign(new Error(`File not found: ${sanitizePath(filePath)}`), { + code: 'FILE_NOT_FOUND', + }); + } + throw Object.assign(new Error(`File not readable: ${sanitizePath(filePath)}`), { + code: 'FILE_NOT_READABLE', + }); + } +} + +/** + * Run a promise with a timeout. + * + * @param promise - Promise to run + * @param timeoutMs - Timeout in milliseconds + * @param timeoutMessage - Error message on timeout + * @returns Promise result + */ +async function withTimeout( + promise: Promise, + timeoutMs: number, + timeoutMessage: string +): Promise { + let timeoutId: NodeJS.Timeout | undefined; + + const timeoutPromise = new Promise((_, reject) => { + timeoutId = setTimeout(() => { + reject(Object.assign(new Error(timeoutMessage), { code: 'TIMEOUT' })); + }, timeoutMs); + }); + + try { + const result = await Promise.race([promise, timeoutPromise]); + clearTimeout(timeoutId!); + return result; + } catch (err) { + clearTimeout(timeoutId!); + throw err; + } +} + +/** + * Format an esbuild warning/error message + */ +function formatMessage(msg: Message, defaultPath: string): string { + const file = msg.location?.file + ? sanitizePath(msg.location.file) + : sanitizePath(defaultPath); + const line = msg.location?.line ?? 0; + const column = msg.location?.column ?? 0; + return `${file}:${line}:${column}: ${msg.text}`; +} + +/** + * Compiles a TypeScript plugin file to JavaScript using esbuild with bundling. + * All imports are resolved and bundled into the output for self-contained execution. * * @param pluginPath - Path to the TypeScript plugin file * @param options - Compilation options * @returns Compiled JavaScript code and metadata + * @throws Error if compilation fails + * + * @example + * ```typescript + * const result = await compilePlugin('plugins/my-plugin.ts'); + * console.log(result.code); // Compiled and bundled JavaScript + * ``` */ export async function compilePlugin( pluginPath: string, @@ -47,24 +327,59 @@ export async function compilePlugin( ): Promise { const opts = { ...DEFAULT_OPTIONS, ...options }; - // Read the source file + // Security: validate path with base directory + const baseDir = opts.baseDir ?? DEFAULT_PLUGIN_BASE_DIR; + validatePathSecurity(pluginPath, baseDir); + + // Resolve to absolute path const absolutePath = path.isAbsolute(pluginPath) ? pluginPath : path.resolve(process.cwd(), pluginPath); + // Validate file exists and is readable + await validateFileAccess(absolutePath); + + // Read source with size check + const stats = await fs.promises.stat(absolutePath); + if (stats.size > MAX_SOURCE_SIZE) { + throw Object.assign( + new Error( + `Source file exceeds size limit (${(stats.size / 1024 / 1024).toFixed(1)}MB > ${MAX_SOURCE_SIZE / 1024 / 1024}MB)` + ), + { code: 'SIZE_LIMIT' } + ); + } + const sourceCode = await fs.promises.readFile(absolutePath, 'utf-8'); - return compilePluginSource(sourceCode, pluginPath, opts); + // Use the file's directory as resolveDir for proper import resolution + const resolveDir = opts.resolveDir ?? path.dirname(absolutePath); + + return compilePluginSource(sourceCode, pluginPath, { ...opts, resolveDir }); } /** - * Compiles TypeScript source code to JavaScript in-memory. + * Compiles TypeScript source code to JavaScript with bundling. * This variant accepts source code directly (useful when code is already in memory). + * All imports are resolved and bundled into the output. * * @param sourceCode - TypeScript source code * @param sourcePath - Original path (for error messages and source maps) * @param options - Compilation options * @returns Compiled JavaScript code and metadata + * @throws Error if compilation fails + * + * @example + * ```typescript + * const source = ` + * import { ethers } from 'ethers'; + * export async function handler({ api }) { + * return ethers.utils.formatEther('1000000000000000000'); + * } + * `; + * const result = await compilePluginSource(source, 'inline-plugin.ts'); + * // result.code contains bundled code with ethers included + * ``` */ export async function compilePluginSource( sourceCode: string, @@ -73,70 +388,159 @@ export async function compilePluginSource( ): Promise { const opts = { ...DEFAULT_OPTIONS, ...options }; - try { - const result = await esbuild.transform(sourceCode, { - loader: 'ts', - target: opts.target, - sourcemap: opts.sourcemap ? 'inline' : false, - minify: opts.minify, - sourcefile: sourcePath, - format: 'cjs', // CommonJS for vm.Script compatibility - platform: 'node', - // Don't bundle - we want to keep imports for the sandbox to resolve - // The sandbox will provide the necessary globals - }); + // Validate input + validateSourceCode(sourceCode, sourcePath); - const warnings = result.warnings.map((w: Message) => { - const location = w.location - ? `${w.location.file}:${w.location.line}:${w.location.column}` - : sourcePath; - return `${location}: ${w.text}`; - }); + const doCompile = async (): Promise => { + try { + // Use esbuild.build() with stdin to bundle imports + // This is CRITICAL - transform() does not resolve imports! + const result = await esbuild.build({ + stdin: { + contents: sourceCode, + loader: 'ts', + sourcefile: sourcePath, + resolveDir: opts.resolveDir ?? process.cwd(), + }, + bundle: true, // CRITICAL: Bundle to resolve and inline all imports + platform: 'node', + target: opts.target, + format: 'cjs', // CommonJS for vm.Script compatibility + sourcemap: opts.sourcemap === 'external' ? true : opts.sourcemap === 'inline' ? 'inline' : false, + minify: opts.minify, + write: false, // Keep in memory, don't write to disk + external: [ + // Don't bundle Node.js built-ins - they're available in the sandbox + 'node:*', + // The SDK is already available in the sandbox + '@openzeppelin/relayer-sdk', + ], + logLevel: 'silent', // We handle errors ourselves + }); + + // Validate we got output + if (!result.outputFiles || result.outputFiles.length === 0) { + throw Object.assign(new Error('esbuild produced no output'), { + code: 'COMPILE_ERROR', + }); + } + + const code = result.outputFiles[0].text; - return { - code: result.code, - sourceMap: result.map || undefined, - warnings, - }; - } catch (error) { - if (error instanceof Error) { - throw new Error(`Failed to compile plugin ${sourcePath}: ${error.message}`); + // Validate output size + validateCompiledCode(code); + + // Format warnings + const warnings = result.warnings.map((w) => formatMessage(w, sourcePath)); + + // Handle source map based on configuration + let sourceMap: string | undefined; + if (opts.sourcemap === 'external' && result.outputFiles.length > 1) { + sourceMap = result.outputFiles[1].text; + } + // For 'inline', the source map is embedded in the code + + return { + code, + sourceMap, + warnings, + }; + } catch (error) { + if (error instanceof Error) { + // Check if it's already one of our errors + if ((error as any).code && VALID_ERROR_CODES.includes((error as any).code)) { + throw error; + } + + // Sanitize error message - replace absolute paths with relative/safe versions + const sanitizedMessage = sanitizePath(error.message); + + throw Object.assign(new Error(`Compilation failed: ${sanitizedMessage}`), { + code: 'COMPILE_ERROR', + }); + } + throw error; } - throw error; - } + }; + + // Run with timeout + return withTimeout( + doCompile(), + opts.timeout ?? DEFAULT_COMPILE_TIMEOUT_MS, + `Compilation timed out after ${opts.timeout ?? DEFAULT_COMPILE_TIMEOUT_MS}ms` + ); } /** - * Batch compile multiple plugins. + * Batch compile multiple plugins with concurrency limits. + * Returns both successful results and detailed error information. * * @param pluginPaths - Array of plugin file paths * @param options - Compilation options - * @returns Map of plugin path to compilation result + * @returns Map of successful results and array of errors + * + * @example + * ```typescript + * const { results, errors } = await compilePlugins(['a.ts', 'b.ts', 'c.ts']); + * + * // Handle successes + * for (const [path, result] of results) { + * console.log(`Compiled ${path}: ${result.code.length} bytes`); + * } + * + * // Handle errors + * for (const err of errors) { + * console.error(`${err.pluginPath}: [${err.code}] ${err.message}`); + * } + * ``` */ export async function compilePlugins( pluginPaths: string[], options: CompilerOptions = {} -): Promise> { +): Promise { const results = new Map(); + const errors: CompilationError[] = []; - // Compile in parallel for better performance - const compilations = await Promise.allSettled( - pluginPaths.map(async (pluginPath) => { - const result = await compilePlugin(pluginPath, options); - return { pluginPath, result }; - }) - ); + // Process in batches to limit concurrency + for (let i = 0; i < pluginPaths.length; i += MAX_CONCURRENT_COMPILATIONS) { + const batch = pluginPaths.slice(i, i + MAX_CONCURRENT_COMPILATIONS); - for (const compilation of compilations) { - if (compilation.status === 'fulfilled') { - results.set(compilation.value.pluginPath, compilation.value.result); - } else { - // Log compilation errors but continue with other plugins - console.error(`Compilation failed: ${compilation.reason}`); + const compilations = await Promise.allSettled( + batch.map(async (pluginPath) => { + const result = await compilePlugin(pluginPath, options); + return { pluginPath, result }; + }) + ); + + // Process results with defensive checks + for (let j = 0; j < batch.length; j++) { + const pluginPath = batch[j]; + const compilation = compilations[j]; + + if (!compilation) { + // Should never happen, but defensive programming + errors.push({ + pluginPath, + message: 'Compilation result missing', + code: 'UNKNOWN', + }); + continue; + } + + if (compilation.status === 'fulfilled') { + results.set(compilation.value.pluginPath, compilation.value.result); + } else { + const error = compilation.reason as Error & { code?: string }; + errors.push({ + pluginPath, + message: error.message || 'Unknown error', + code: normalizeErrorCode(error.code), + }); + } } } - return results; + return { results, errors }; } /** @@ -145,13 +549,39 @@ export async function compilePlugins( * * @param compiledCode - The compiled JavaScript code * @returns Wrapped code ready for vm.Script + * @throws Error if input is invalid + * + * @example + * ```typescript + * const compiled = await compilePluginSource(source, 'plugin.ts'); + * const wrapped = wrapForVm(compiled.code); + * const script = new vm.Script(wrapped); + * const factory = script.runInContext(context); + * factory(exports, require, module, __filename, __dirname); + * ``` */ export function wrapForVm(compiledCode: string): string { + // Validate input + if (typeof compiledCode !== 'string') { + throw new Error('wrapForVm: compiledCode must be a string'); + } + + if (compiledCode.length === 0) { + throw new Error('wrapForVm: compiledCode cannot be empty'); + } + + if (compiledCode.length > MAX_COMPILED_SIZE) { + throw new Error( + `wrapForVm: code exceeds size limit (${(compiledCode.length / 1024 / 1024).toFixed(1)}MB)` + ); + } + // The compiled code uses CommonJS (module.exports / exports.handler) - // We wrap it to capture the exports in the vm context + // We wrap it in an IIFE to capture the exports in the vm context return ` (function(exports, require, module, __filename, __dirname) { ${compiledCode} }); `; } + diff --git a/plugins/lib/kv.ts b/plugins/lib/kv.ts index 8631eb8ae..6716bc71f 100644 --- a/plugins/lib/kv.ts +++ b/plugins/lib/kv.ts @@ -85,6 +85,12 @@ export interface PluginKVStore { fn: () => Promise, opts?: { ttlSec?: number; onBusy?: 'throw' | 'skip' } ): Promise; + + /** + * Disconnect from the backing store. + * Call this when the store is no longer needed to prevent connection leaks. + */ + disconnect(): Promise; } /** diff --git a/plugins/lib/logger.ts b/plugins/lib/logger.ts index be1d7e20a..5880fe1c3 100644 --- a/plugins/lib/logger.ts +++ b/plugins/lib/logger.ts @@ -4,6 +4,29 @@ export interface LogEntry { message: string; } +/** + * Safely stringify a value, handling circular references and BigInt. + * Falls back to String() if JSON.stringify fails. + */ +function safeStringify(value: unknown): string { + try { + return JSON.stringify(value, (_, v) => { + // Handle BigInt which JSON.stringify can't serialize + if (typeof v === 'bigint') { + return v.toString() + 'n'; + } + return v; + }); + } catch { + // Handle circular references or other stringify failures + try { + return String(value); + } catch { + return '[Unstringifiable value]'; + } + } +} + export class LogInterceptor { private logs: LogEntry[] = []; private originalConsole: { @@ -34,13 +57,13 @@ export class LogInterceptor { const message = args.map(arg => typeof arg === 'string' ? arg : arg instanceof Error ? arg.message : - JSON.stringify(arg) + safeStringify(arg) ).join(' '); const logEntry: LogEntry = { level, message }; this.logs.push(logEntry); - this.originalConsole.log(JSON.stringify(logEntry)); + this.originalConsole.log(safeStringify(logEntry)); }; console.log = createLogger("log"); @@ -59,7 +82,7 @@ export class LogInterceptor { message: message, }; this.logs.push(logEntry); - this.originalConsole.log(JSON.stringify(logEntry)); + this.originalConsole.log(safeStringify(logEntry)); } /** diff --git a/src/bootstrap/initialize_plugins.rs b/src/bootstrap/initialize_plugins.rs index 042d43467..f439f32ee 100644 --- a/src/bootstrap/initialize_plugins.rs +++ b/src/bootstrap/initialize_plugins.rs @@ -28,9 +28,10 @@ use crate::services::plugins::{get_pool_manager, PoolManager}; pub async fn initialize_plugin_pool( plugin_repository: &PR, ) -> eyre::Result>> { - let has_plugins = plugin_repository.has_entries().await.map_err(|e| { - eyre::eyre!("Failed to check plugin repository: {}", e) - })?; + let has_plugins = plugin_repository + .has_entries() + .await + .map_err(|e| eyre::eyre!("Failed to check plugin repository: {}", e))?; if !has_plugins { info!("No plugins configured, skipping plugin pool initialization"); @@ -38,7 +39,10 @@ pub async fn initialize_plugin_pool( } let plugin_count = plugin_repository.count().await.unwrap_or(0); - info!(plugin_count = plugin_count, "Plugins detected, initializing worker pool"); + info!( + plugin_count = plugin_count, + "Plugins detected, initializing worker pool" + ); let pool_manager = get_pool_manager(); @@ -80,9 +84,10 @@ pub async fn precompile_plugins( per_page: 1000, }; - let plugins = plugin_repository.list_paginated(query).await.map_err(|e| { - eyre::eyre!("Failed to list plugins: {}", e) - })?; + let plugins = plugin_repository + .list_paginated(query) + .await + .map_err(|e| eyre::eyre!("Failed to list plugins: {}", e))?; let mut compiled_count = 0; @@ -137,9 +142,10 @@ pub async fn precompile_plugins( /// terminate the worker pool and clean up resources. pub async fn shutdown_plugin_pool() -> eyre::Result<()> { let pool_manager = get_pool_manager(); - pool_manager.shutdown().await.map_err(|e| { - eyre::eyre!("Failed to shutdown plugin pool: {}", e) - })?; + pool_manager + .shutdown() + .await + .map_err(|e| eyre::eyre!("Failed to shutdown plugin pool: {}", e))?; info!("Plugin worker pool shutdown complete"); Ok(()) } @@ -152,7 +158,9 @@ mod tests { #[tokio::test] async fn test_initialize_plugin_pool_no_plugins() { let mut mock_repo = MockPluginRepositoryTrait::new(); - mock_repo.expect_has_entries().returning(|| async { Ok(false) }); + mock_repo + .expect_has_entries() + .returning(|| async { Ok(false) }); let result = initialize_plugin_pool(&mock_repo).await; assert!(result.is_ok()); diff --git a/src/main.rs b/src/main.rs index 3a4924ab5..7019669db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,9 +47,9 @@ use tracing::info; use openzeppelin_relayer::{ api, bootstrap::{ - initialize_app_state, initialize_relayers, initialize_token_swap_workers, - initialize_workers, process_config_file, - initialize_plugin_pool, precompile_plugins, shutdown_plugin_pool, + initialize_app_state, initialize_plugin_pool, initialize_relayers, + initialize_token_swap_workers, initialize_workers, precompile_plugins, process_config_file, + shutdown_plugin_pool, }, config, constants::PUBLIC_ENDPOINTS, @@ -108,10 +108,9 @@ async fn main() -> Result<()> { match initialize_plugin_pool(app_state.plugin_repository.as_ref()).await { Ok(Some(pm)) => { // Precompile all plugins - if let Err(e) = precompile_plugins( - app_state.plugin_repository.as_ref(), - pm.as_ref(), - ).await { + if let Err(e) = + precompile_plugins(app_state.plugin_repository.as_ref(), pm.as_ref()).await + { tracing::warn!(error = %e, "Failed to precompile some plugins"); } Some(pm) diff --git a/src/repositories/plugin/mod.rs b/src/repositories/plugin/mod.rs index d42cc6388..39f5030b8 100644 --- a/src/repositories/plugin/mod.rs +++ b/src/repositories/plugin/mod.rs @@ -161,17 +161,21 @@ impl PluginRepositoryTrait for PluginRepositoryStorage { ) -> Result<(), RepositoryError> { match self { PluginRepositoryStorage::InMemory(repo) => { - repo.store_compiled_code(plugin_id, compiled_code, source_hash).await + repo.store_compiled_code(plugin_id, compiled_code, source_hash) + .await } PluginRepositoryStorage::Redis(repo) => { - repo.store_compiled_code(plugin_id, compiled_code, source_hash).await + repo.store_compiled_code(plugin_id, compiled_code, source_hash) + .await } } } async fn invalidate_compiled_code(&self, plugin_id: &str) -> Result<(), RepositoryError> { match self { - PluginRepositoryStorage::InMemory(repo) => repo.invalidate_compiled_code(plugin_id).await, + PluginRepositoryStorage::InMemory(repo) => { + repo.invalidate_compiled_code(plugin_id).await + } PluginRepositoryStorage::Redis(repo) => repo.invalidate_compiled_code(plugin_id).await, } } diff --git a/src/repositories/plugin/plugin_in_memory.rs b/src/repositories/plugin/plugin_in_memory.rs index b7b5c61d2..691b998bd 100644 --- a/src/repositories/plugin/plugin_in_memory.rs +++ b/src/repositories/plugin/plugin_in_memory.rs @@ -33,7 +33,7 @@ impl Clone for InMemoryPluginRepository { .try_lock() .map(|guard| guard.clone()) .unwrap_or_else(|_| HashMap::new()); - + let compiled = self .compiled_cache .try_lock() diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs new file mode 100644 index 000000000..a66c45e5e --- /dev/null +++ b/src/services/plugins/config.rs @@ -0,0 +1,280 @@ +//! Plugin Configuration +//! +//! Centralized configuration for the plugin system with auto-derivation. +//! +//! # Simple Usage (80% of users) +//! +//! Set one variable and everything else is auto-calculated: +//! +//! ```bash +//! export PLUGIN_MAX_CONCURRENCY=3000 +//! ``` +//! +//! # Advanced Usage (power users) +//! +//! Override individual settings when needed: +//! +//! ```bash +//! export PLUGIN_MAX_CONCURRENCY=3000 +//! export PLUGIN_POOL_MAX_QUEUE_SIZE=10000 # Override just this one +//! ``` + +use crate::constants::{ + DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, DEFAULT_POOL_CONNECT_RETRIES, + DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, DEFAULT_POOL_IDLE_TIMEOUT_MS, + DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_QUEUE_SIZE, DEFAULT_POOL_MAX_THREADS_FLOOR, + DEFAULT_POOL_MIN_THREADS, DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, + DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, + DEFAULT_SOCKET_READ_TIMEOUT_SECS, DEFAULT_TRACE_TIMEOUT_MS, +}; +use std::sync::OnceLock; + +/// Cached plugin configuration (computed once at startup) +static CONFIG: OnceLock = OnceLock::new(); + +/// Plugin system configuration with auto-derived values +#[derive(Debug, Clone)] +pub struct PluginConfig { + // === Primary scaling knob === + /// Maximum concurrent plugin executions (the main knob users should adjust) + pub max_concurrency: usize, + + // === Connection Pool (Rust side, auto-derived from max_concurrency) === + /// Maximum connections to the Node.js pool server + pub pool_max_connections: usize, + /// Retry attempts when connecting to pool + pub pool_connect_retries: usize, + /// Request timeout in seconds + pub pool_request_timeout_secs: u64, + + // === Request Queue (Rust side, auto-derived from max_concurrency) === + /// Maximum queued requests + pub pool_max_queue_size: usize, + /// Wait time when queue is full before rejecting (ms) + pub pool_queue_send_timeout_ms: u64, + /// Number of queue workers (0 = auto based on CPU cores) + pub pool_workers: usize, + + // === Socket Service (Rust side, auto-derived from max_concurrency) === + /// Maximum concurrent socket connections + pub socket_max_connections: usize, + /// Idle timeout for connections (seconds) + pub socket_idle_timeout_secs: u64, + /// Read timeout per message (seconds) + pub socket_read_timeout_secs: u64, + + // === Node.js Worker Pool (passed to pool-server.ts) === + /// Minimum worker threads in Node.js pool + pub nodejs_pool_min_threads: usize, + /// Maximum worker threads in Node.js pool + pub nodejs_pool_max_threads: usize, + /// Concurrent tasks per worker thread + pub nodejs_pool_concurrent_tasks: usize, + /// Worker idle timeout in milliseconds + pub nodejs_pool_idle_timeout_ms: u64, + + // === Health & Monitoring === + /// Minimum seconds between health checks + pub health_check_interval_secs: u64, + /// Trace collection timeout (ms) + pub trace_timeout_ms: u64, +} + +impl PluginConfig { + /// Load configuration from environment variables with auto-derivation + pub fn from_env() -> Self { + // === Primary scaling knob === + // If set, this drives the auto-derivation of other values + let max_concurrency = env_parse("PLUGIN_MAX_CONCURRENCY", DEFAULT_POOL_MAX_CONNECTIONS); + + // === Auto-derived values (can be individually overridden) === + + // Pool connections = max_concurrency (1:1 ratio) + let pool_max_connections = env_parse("PLUGIN_POOL_MAX_CONNECTIONS", max_concurrency); + + // Socket connections = 1.5x max_concurrency (headroom for connection churn) + let socket_max_connections = env_parse( + "PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS", + (max_concurrency as f64 * 1.5) as usize, + ); + + // Queue size = 2x max_concurrency (absorb bursts) + let pool_max_queue_size = env_parse("PLUGIN_POOL_MAX_QUEUE_SIZE", max_concurrency * 2); + + // Queue timeout scales with concurrency (more concurrency = allow more wait) + let base_queue_timeout = DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS; + let derived_queue_timeout = if max_concurrency > 2000 { + base_queue_timeout * 2 // 1000ms for high concurrency + } else if max_concurrency > 1000 { + base_queue_timeout + 250 // 750ms for medium concurrency + } else { + base_queue_timeout // 500ms default + }; + let pool_queue_send_timeout_ms = + env_parse("PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS", derived_queue_timeout); + + // Other settings with defaults + let pool_connect_retries = + env_parse("PLUGIN_POOL_CONNECT_RETRIES", DEFAULT_POOL_CONNECT_RETRIES); + let pool_request_timeout_secs = env_parse( + "PLUGIN_POOL_REQUEST_TIMEOUT_SECS", + DEFAULT_POOL_REQUEST_TIMEOUT_SECS, + ); + let pool_workers = env_parse("PLUGIN_POOL_WORKERS", 0); // 0 = auto + + let socket_idle_timeout_secs = env_parse( + "PLUGIN_SOCKET_IDLE_TIMEOUT_SECS", + DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, + ); + let socket_read_timeout_secs = env_parse( + "PLUGIN_SOCKET_READ_TIMEOUT_SECS", + DEFAULT_SOCKET_READ_TIMEOUT_SECS, + ); + + let health_check_interval_secs = env_parse( + "PLUGIN_POOL_HEALTH_CHECK_INTERVAL_SECS", + DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, + ); + let trace_timeout_ms = env_parse("PLUGIN_TRACE_TIMEOUT_MS", DEFAULT_TRACE_TIMEOUT_MS); + + // === Node.js Worker Pool settings (auto-derived from max_concurrency) === + // These are passed to pool-server.ts when spawning the Node.js process + let cpu_count = std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(4); + + // minThreads = max(2, cpuCount / 2) - keeps some workers warm + let derived_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); + let nodejs_pool_min_threads = env_parse("PLUGIN_POOL_MIN_THREADS", derived_min_threads); + + // maxThreads = min(cpuCount * 2, concurrency / 50, 64) + // - For 1000 concurrency: ~20 threads + // - For 3000 concurrency: ~60 threads + // - For 5000+ concurrency: 64 threads (capped) + let derived_max_threads = (cpu_count * 2) + .max(DEFAULT_POOL_MAX_THREADS_FLOOR) + .min(max_concurrency / 50) + .min(64); + let nodejs_pool_max_threads = env_parse( + "PLUGIN_POOL_MAX_THREADS", + derived_max_threads.max(DEFAULT_POOL_MAX_THREADS_FLOOR), + ); + + // concurrentTasksPerWorker: Node.js async can handle many concurrent tasks + // Formula: (concurrency / threads) * 2.5 for headroom (queue buildup, variable latency) + // - 5000 VUs / 64 threads * 2.5 = ~195 tasks/worker + // - 3000 VUs / 60 threads * 2.5 = ~125 tasks/worker + // - 1000 VUs / 20 threads * 2.5 = ~125 tasks/worker + let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); + let derived_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) + .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) + .min(300); // High cap - Node.js handles async well + let nodejs_pool_concurrent_tasks = + env_parse("PLUGIN_POOL_CONCURRENT_TASKS", derived_concurrent_tasks); + + let nodejs_pool_idle_timeout_ms = + env_parse("PLUGIN_POOL_IDLE_TIMEOUT", DEFAULT_POOL_IDLE_TIMEOUT_MS); + + Self { + max_concurrency, + pool_max_connections, + pool_connect_retries, + pool_request_timeout_secs, + pool_max_queue_size, + pool_queue_send_timeout_ms, + pool_workers, + socket_max_connections, + socket_idle_timeout_secs, + socket_read_timeout_secs, + nodejs_pool_min_threads, + nodejs_pool_max_threads, + nodejs_pool_concurrent_tasks, + nodejs_pool_idle_timeout_ms, + health_check_interval_secs, + trace_timeout_ms, + } + } + + /// Log the effective configuration for debugging + pub fn log_config(&self) { + tracing::info!( + max_concurrency = self.max_concurrency, + pool_max_connections = self.pool_max_connections, + pool_max_queue_size = self.pool_max_queue_size, + socket_max_connections = self.socket_max_connections, + nodejs_max_threads = self.nodejs_pool_max_threads, + nodejs_concurrent_tasks = self.nodejs_pool_concurrent_tasks, + "Plugin configuration loaded (Rust + Node.js)" + ); + } +} + +impl Default for PluginConfig { + fn default() -> Self { + Self { + max_concurrency: DEFAULT_POOL_MAX_CONNECTIONS, + pool_max_connections: DEFAULT_POOL_MAX_CONNECTIONS, + pool_connect_retries: DEFAULT_POOL_CONNECT_RETRIES, + pool_request_timeout_secs: DEFAULT_POOL_REQUEST_TIMEOUT_SECS, + pool_max_queue_size: DEFAULT_POOL_MAX_QUEUE_SIZE, + pool_queue_send_timeout_ms: DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, + pool_workers: 0, + socket_max_connections: DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, + socket_idle_timeout_secs: DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, + socket_read_timeout_secs: DEFAULT_SOCKET_READ_TIMEOUT_SECS, + nodejs_pool_min_threads: DEFAULT_POOL_MIN_THREADS, + nodejs_pool_max_threads: DEFAULT_POOL_MAX_THREADS_FLOOR, + nodejs_pool_concurrent_tasks: DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, + nodejs_pool_idle_timeout_ms: DEFAULT_POOL_IDLE_TIMEOUT_MS, + health_check_interval_secs: DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, + trace_timeout_ms: DEFAULT_TRACE_TIMEOUT_MS, + } + } +} + +/// Get the global plugin configuration (cached after first call) +pub fn get_config() -> &'static PluginConfig { + CONFIG.get_or_init(|| { + let config = PluginConfig::from_env(); + config.log_config(); + config + }) +} + +/// Parse an environment variable or return default +fn env_parse(name: &str, default: T) -> T { + std::env::var(name) + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(default) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_default_config() { + let config = PluginConfig::default(); + assert_eq!(config.max_concurrency, DEFAULT_POOL_MAX_CONNECTIONS); + assert_eq!(config.pool_max_connections, DEFAULT_POOL_MAX_CONNECTIONS); + } + + #[test] + fn test_auto_derivation_ratios() { + // When max_concurrency is set, other values should be derived + let config = PluginConfig { + max_concurrency: 1000, + pool_max_connections: 1000, + socket_max_connections: 1500, // 1.5x + pool_max_queue_size: 2000, // 2x + ..Default::default() + }; + + assert_eq!( + config.socket_max_connections, + config.max_concurrency * 3 / 2 + ); + assert_eq!(config.pool_max_queue_size, config.max_concurrency * 2); + } +} diff --git a/src/services/plugins/mod.rs b/src/services/plugins/mod.rs index 3695a0284..3f8ad918d 100644 --- a/src/services/plugins/mod.rs +++ b/src/services/plugins/mod.rs @@ -20,6 +20,9 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use uuid::Uuid; +pub mod config; +pub use config::*; + pub mod runner; pub use runner::*; @@ -271,6 +274,7 @@ impl PluginService { script_params, request_id, headers_json, + plugin.emit_traces, state, ) .await; @@ -452,7 +456,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![LogEntry { level: LogLevel::Log, @@ -752,7 +756,7 @@ mod tests { plugin_runner .expect_run::() - .returning(move |_, _, _, _, _, _, _, _| { + .returning(move |_, _, _, _, _, _, _, _, _| { Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { status: 400, message: "Plugin handler error".to_string(), @@ -808,7 +812,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _| { Err(PluginError::PluginExecutionError("Fatal error".to_string())) }); @@ -849,7 +853,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![LogEntry { level: LogLevel::Log, @@ -940,7 +944,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![ LogEntry { @@ -1020,7 +1024,7 @@ mod tests { let mut plugin_runner = MockPluginRunnerTrait::default(); plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![LogEntry { level: LogLevel::Warn, @@ -1075,7 +1079,7 @@ mod tests { let mut plugin_runner = MockPluginRunnerTrait::default(); plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _| { Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { status: 400, message: "handler failed".to_string(), @@ -1124,7 +1128,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![], error: "".to_string(), @@ -1179,7 +1183,7 @@ mod tests { plugin_runner .expect_run::() - .returning(move |_, _, _, _, _, _, headers_json, _| { + .returning(move |_, _, _, _, _, _, headers_json, _, _| { // Capture the headers_json parameter *captured_headers_clone.lock().unwrap() = headers_json; Ok(ScriptResult { @@ -1256,7 +1260,7 @@ mod tests { plugin_runner .expect_run::() - .returning(move |_, _, _, _, _, _, headers_json, _| { + .returning(move |_, _, _, _, _, _, headers_json, _, _| { *captured_headers_clone.lock().unwrap() = headers_json; Ok(ScriptResult { logs: vec![], diff --git a/src/services/plugins/runner.rs b/src/services/plugins/runner.rs index 38509474e..3bb5df98e 100644 --- a/src/services/plugins/runner.rs +++ b/src/services/plugins/runner.rs @@ -30,11 +30,9 @@ use crate::{ }, }; -use super::PluginError; -use crate::constants::DEFAULT_TRACE_TIMEOUT_SECS; +use super::{config::get_config, PluginError}; use async_trait::async_trait; use tokio::{sync::oneshot, time::timeout}; -use tracing::warn; use uuid::Uuid; #[cfg(test)] @@ -47,14 +45,9 @@ fn use_pool_executor() -> bool { .unwrap_or(false) } -/// Get trace timeout duration - defaults to 5s but configurable +/// Get trace timeout duration from centralized config fn get_trace_timeout() -> Duration { - Duration::from_secs( - std::env::var("PLUGIN_TRACE_TIMEOUT_SECS") - .ok() - .and_then(|s| s.parse().ok()) - .unwrap_or(DEFAULT_TRACE_TIMEOUT_SECS) - ) + Duration::from_millis(get_config().trace_timeout_ms) } #[cfg_attr(test, automock)] @@ -70,6 +63,7 @@ pub trait PluginRunnerTrait { script_params: String, http_request_id: Option, headers_json: Option, + emit_traces: bool, state: Arc>, ) -> Result where @@ -102,6 +96,7 @@ impl PluginRunnerTrait for PluginRunner { script_params: String, http_request_id: Option, headers_json: Option, + emit_traces: bool, state: Arc>, ) -> Result where @@ -130,6 +125,7 @@ impl PluginRunnerTrait for PluginRunner { script_params, http_request_id, headers_json, + emit_traces, state, ) .await; @@ -144,6 +140,7 @@ impl PluginRunnerTrait for PluginRunner { script_params, http_request_id, headers_json, + emit_traces, state, ) .await @@ -162,6 +159,7 @@ impl PluginRunner { script_params: String, http_request_id: Option, headers_json: Option, + _emit_traces: bool, state: Arc>, ) -> Result where @@ -243,6 +241,7 @@ impl PluginRunner { script_params: String, http_request_id: Option, headers_json: Option, + emit_traces: bool, state: Arc>, ) -> Result where @@ -262,18 +261,22 @@ impl PluginRunner { { // Ensure shared socket service is started ensure_shared_socket_started(Arc::clone(&state)).await?; - + // Get shared socket service let shared_socket = get_shared_socket_service()?; let shared_socket_path = shared_socket.socket_path().to_string(); // Generate execution ID (use http_request_id if available, otherwise generate one) - let execution_id = http_request_id.clone().unwrap_or_else(|| { - format!("exec-{}", Uuid::new_v4()) - }); - - // Register execution to receive traces - let mut traces_rx = shared_socket.register_execution(execution_id.clone()); + let execution_id = http_request_id + .clone() + .unwrap_or_else(|| format!("exec-{}", Uuid::new_v4())); + + // Only register for traces if emit_traces is enabled + let mut traces_rx = if emit_traces { + Some(shared_socket.register_execution(execution_id.clone())) + } else { + None + }; // Execute via pool manager (using shared socket path) let pool_manager = get_pool_manager(); @@ -291,11 +294,11 @@ impl PluginRunner { timeout_duration, pool_manager.execute_plugin( plugin_id.clone(), - None, // compiled_code - will be fetched from cache - Some(script_path), // plugin_path + None, // compiled_code - will be fetched from cache + Some(script_path), // plugin_path params, headers, - shared_socket_path, // Use shared socket path instead of unique one + shared_socket_path, // Use shared socket path instead of unique one http_request_id, Some(timeout_duration.as_secs()), ), @@ -304,30 +307,28 @@ impl PluginRunner { { Ok(result) => result, Err(_) => { - shared_socket.unregister_execution(&execution_id); + if emit_traces { + shared_socket.unregister_execution(&execution_id); + } return Err(PluginError::ScriptTimeout(timeout_duration.as_secs())); } }; - // Wait for traces with configurable timeout - // Use minimum of trace_timeout and timeout_duration to not exceed execution timeout - let trace_timeout = get_trace_timeout().min(timeout_duration); - let traces = match timeout(trace_timeout, traces_rx.recv()).await { - Ok(Some(traces)) => traces, - Ok(None) => { - warn!("Traces channel closed before receiving traces"); - Vec::new() - } - Err(_) => { - warn!( - timeout_secs = trace_timeout.as_secs(), - "Timeout waiting for traces - consider increasing PLUGIN_TRACE_TIMEOUT_SECS" - ); - Vec::new() + // Collect traces only if emit_traces is enabled + let traces = if let Some(ref mut rx) = traces_rx { + // Wait for traces with short timeout - they arrive immediately if the plugin used the API + let trace_timeout = get_trace_timeout().min(timeout_duration); + match timeout(trace_timeout, rx.recv()).await { + Ok(Some(traces)) => traces, + Ok(None) | Err(_) => Vec::new(), } + } else { + Vec::new() }; - shared_socket.unregister_execution(&execution_id); + if emit_traces { + shared_socket.unregister_execution(&execution_id); + } match exec_outcome { Ok(mut script_result) => { @@ -403,6 +404,7 @@ mod tests { "{ \"test\": \"test\" }".to_string(), None, None, + false, // emit_traces Arc::new(web::ThinData(state)), ) .await; @@ -462,6 +464,7 @@ mod tests { "{}".to_string(), None, None, + false, // emit_traces Arc::new(web::ThinData(state)), ) .await; diff --git a/src/services/plugins/socket.rs b/src/services/plugins/socket.rs index a50859a1a..beb4e13df 100644 --- a/src/services/plugins/socket.rs +++ b/src/services/plugins/socket.rs @@ -166,7 +166,18 @@ impl SocketService { // Now handle the connection, but also listen for shutdown // We spawn the handler and then select between it finishing or shutdown - let handle = tokio::spawn(Self::handle_connection::(stream, state, relayer_api)); + let handle = tokio::spawn(Self::handle_connection::< + RA, + J, + RR, + TR, + NR, + NFR, + SR, + TCR, + PR, + AKR, + >(stream, state, relayer_api)); tokio::pin!(handle); tokio::select! { @@ -368,7 +379,7 @@ mod tests { ); let bytes_read = read_result.unwrap().unwrap(); assert!(bytes_read > 0, "No data received"); - + // Close the client first, then wait a bit for the handler to complete // before sending shutdown. This ensures the handler loop processes the // connection closure and collects the traces. From 6ebcb00297ba92de22fa7c4f756bad12a7ec6619 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 29 Dec 2025 15:36:41 +0100 Subject: [PATCH 03/42] chore: impartial --- build.rs | 47 ++ plugins/lib/.build-cache-hash | 1 + plugins/lib/constants.ts | 44 +- plugins/lib/plugin.ts | 70 ++- plugins/lib/pool-server.ts | 41 +- plugins/lib/sandbox-executor.js | 293 +++++++++-- plugins/lib/sandbox-executor.js.sha256 | 1 + plugins/lib/sandbox-executor.ts | 259 +++++++-- plugins/lib/worker-pool.ts | 144 ++++- src/constants/plugins.rs | 90 +++- src/services/plugins/config.rs | 34 +- src/services/plugins/pool_executor.rs | 694 ++++++++++++++++++++----- src/services/plugins/shared_socket.rs | 88 ++-- 13 files changed, 1447 insertions(+), 359 deletions(-) create mode 100644 build.rs create mode 100644 plugins/lib/.build-cache-hash create mode 100644 plugins/lib/sandbox-executor.js.sha256 diff --git a/build.rs b/build.rs new file mode 100644 index 000000000..a58a1be35 --- /dev/null +++ b/build.rs @@ -0,0 +1,47 @@ +use std::process::Command; +use std::path::Path; + +fn main() { + // Only run if plugins directory exists + let plugins_dir = Path::new("plugins"); + if !plugins_dir.exists() { + println!("cargo:warning=plugins directory not found, skipping pnpm install"); + return; + } + + // Check if pnpm is available + let pnpm_check = Command::new("pnpm") + .arg("--version") + .output(); + + if pnpm_check.is_err() { + println!("cargo:warning=pnpm not found in PATH, skipping plugin dependencies install"); + println!("cargo:warning=Please install pnpm and run 'pnpm install' in the plugins directory manually"); + return; + } + + println!("cargo:warning=Running pnpm install in plugins directory..."); + + // Run pnpm install in plugins directory + let output = Command::new("pnpm") + .arg("install") + .current_dir(plugins_dir) + .output(); + + match output { + Ok(output) => { + if output.status.success() { + println!("cargo:warning=โœ“ pnpm install completed successfully"); + } else { + let stderr = String::from_utf8_lossy(&output.stderr); + println!("cargo:warning=pnpm install failed: {}", stderr); + // Don't fail the build, just warn + } + } + Err(e) => { + println!("cargo:warning=Failed to execute pnpm install: {}", e); + // Don't fail the build, just warn + } + } +} + diff --git a/plugins/lib/.build-cache-hash b/plugins/lib/.build-cache-hash new file mode 100644 index 000000000..f4104d83d --- /dev/null +++ b/plugins/lib/.build-cache-hash @@ -0,0 +1 @@ +098340c89cdfcab522cf7ecffed10a299069afea9befdf8f83101ceab2618aa3 \ No newline at end of file diff --git a/plugins/lib/constants.ts b/plugins/lib/constants.ts index fd6ad7dd1..4bb496a46 100644 --- a/plugins/lib/constants.ts +++ b/plugins/lib/constants.ts @@ -1,41 +1,35 @@ /** * Plugin Pool Constants * - * These values should match src/constants/plugins.rs which is the source of truth. - * When updating these values, ensure the Rust constants are updated as well. + * IMPORTANT: These are fallback values only for standalone testing. + * In production, ALL configuration comes from Rust (src/services/plugins/config.rs) + * and is passed via environment variables when spawning the pool server. + * + * The single source of truth is: PLUGIN_MAX_CONCURRENCY + * Set it in .env and Rust derives everything else. */ // ============================================================================= -// Pool Configuration +// Fallbacks for standalone testing (when not spawned by Rust) // ============================================================================= -/** Default minimum worker threads */ +/** Fallback minimum worker threads if not passed from Rust */ export const DEFAULT_POOL_MIN_THREADS = 2; -/** Divisor for calculating minThreads from CPU count (cpuCount / divisor) */ -export const DEFAULT_POOL_MIN_THREADS_DIVISOR = 2; - -/** Default maximum worker threads floor (minimum threads even on small machines) */ +/** Fallback max threads if not passed from Rust */ export const DEFAULT_POOL_MAX_THREADS_FLOOR = 8; -/** Default concurrent tasks per worker thread */ -export const DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER = 10; - -/** Default worker idle timeout in milliseconds */ -export const DEFAULT_POOL_IDLE_TIMEOUT_MS = 60000; // 60 seconds +/** Fallback concurrent tasks if not passed from Rust */ +export const DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER = 20; -/** Default socket connection backlog for high concurrency */ -export const DEFAULT_POOL_SOCKET_BACKLOG = 1024; +/** Fallback idle timeout if not passed from Rust */ +export const DEFAULT_POOL_IDLE_TIMEOUT_MS = 60000; -/** Default plugin execution timeout in milliseconds */ -export const DEFAULT_POOL_EXECUTION_TIMEOUT_MS = 30000; // 30 seconds - -// ============================================================================= -// Worker Pool Specific (may differ from pool-server defaults) -// ============================================================================= +/** Socket backlog for high concurrency */ +export const DEFAULT_POOL_SOCKET_BACKLOG = 2048; -/** Higher thread floor for standalone worker pool usage */ -export const DEFAULT_WORKER_POOL_MAX_THREADS_FLOOR = 16; +/** Default execution timeout (ms) */ +export const DEFAULT_POOL_EXECUTION_TIMEOUT_MS = 30000; -/** Higher concurrency for I/O bound tasks in worker pool */ -export const DEFAULT_WORKER_POOL_CONCURRENT_TASKS_PER_WORKER = 20; +/** Default per-request timeout for socket communication (ms) */ +export const DEFAULT_SOCKET_REQUEST_TIMEOUT_MS = 30000; diff --git a/plugins/lib/plugin.ts b/plugins/lib/plugin.ts index 573f7a72d..521e94f67 100644 --- a/plugins/lib/plugin.ts +++ b/plugins/lib/plugin.ts @@ -43,6 +43,7 @@ import { import { DefaultPluginKVStore } from './kv'; import { LogInterceptor } from './logger'; import type { PluginKVStore } from './kv'; +import { DEFAULT_SOCKET_REQUEST_TIMEOUT_MS } from './constants'; import net from 'node:net'; import { v4 as uuidv4 } from 'uuid'; @@ -394,8 +395,14 @@ export class DefaultPluginAPI implements PluginAPI { this.socket.on('error', (error) => { console.error('Socket ERROR:', error); + this._rejectAllPending(error); reject(error); }); + + this.socket.on('close', () => { + this._connected = false; + this._rejectAllPending(new Error('Socket closed unexpectedly')); + }); }); this.socket.on('data', (data) => { @@ -404,17 +411,32 @@ export class DefaultPluginAPI implements PluginAPI { .split('\n') .filter(Boolean) .forEach((msg: string) => { - const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); + try { + const parsed = JSON.parse(msg); + const { requestId, result, error } = parsed; + const resolver = this.pending.get(requestId); + if (resolver) { + error ? resolver.reject(error) : resolver.resolve(result); + this.pending.delete(requestId); + } + } catch { + // Ignore malformed messages } }); }); } + /** + * Reject all pending requests with the given error. + * Called on socket error or close to prevent hanging promises. + */ + private _rejectAllPending(error: Error): void { + for (const [requestId, resolver] of this.pending.entries()) { + resolver.reject(error); + this.pending.delete(requestId); + } + } + /** * Creates a relayer API for the given relayer ID. * @param relayerId - The relayer ID. @@ -498,18 +520,34 @@ export class DefaultPluginAPI implements PluginAPI { await this._connectionPromise; } - const result = this.socket.write(message, (error) => { - if (error) { - console.error('Error sending message:', error); - } - }); + return new Promise((resolve, reject) => { + let timeoutId: NodeJS.Timeout | undefined; - if (!result) { - throw new Error(`Failed to send message to relayer: ${message}`); - } + // Set up timeout to prevent hanging forever + timeoutId = setTimeout(() => { + this.pending.delete(requestId); + reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); + }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); + + // Wrap resolvers to clear timeout on completion + this.pending.set(requestId, { + resolve: (value) => { + if (timeoutId) clearTimeout(timeoutId); + resolve(value); + }, + reject: (reason) => { + if (timeoutId) clearTimeout(timeoutId); + reject(reason); + }, + }); - return new Promise((resolve, reject) => { - this.pending.set(requestId, { resolve, reject }); + this.socket.write(message, (error) => { + if (error) { + if (timeoutId) clearTimeout(timeoutId); + this.pending.delete(requestId); + reject(error); + } + }); }); } diff --git a/plugins/lib/pool-server.ts b/plugins/lib/pool-server.ts index d82e06747..7accd55a2 100644 --- a/plugins/lib/pool-server.ts +++ b/plugins/lib/pool-server.ts @@ -16,22 +16,25 @@ * - Request: { type: "shutdown", taskId } * - Response: { taskId, success, result?, error?, logs? } * - * Environment Variables for tuning (high concurrency e.g., 1000+ parallel requests): + * Configuration: + * + * All configuration is derived from PLUGIN_MAX_CONCURRENCY in Rust's config.rs + * and passed via environment variables when spawning this process. + * See: src/services/plugins/config.rs + * + * Environment Variables (passed from Rust): + * - PLUGIN_MAX_CONCURRENCY: Primary scaling knob + * - PLUGIN_POOL_MAX_THREADS: Worker threads (derived from concurrency) + * - PLUGIN_POOL_CONCURRENT_TASKS: Tasks per worker (derived from concurrency) + * - PLUGIN_POOL_IDLE_TIMEOUT: Idle timeout in ms * - PLUGIN_POOL_DEBUG: Set to 'true' to enable debug logging - * - PLUGIN_POOL_MAX_THREADS: Maximum worker threads (default: CPU count or 8, whichever is higher) - * - PLUGIN_POOL_CONCURRENT_TASKS: Concurrent tasks per worker (default: 10) - * - PLUGIN_POOL_IDLE_TIMEOUT: Idle timeout in ms (default: 60000) - * - PLUGIN_POOL_BACKLOG: Socket connection backlog (default: 1024) - * - PLUGIN_POOL_MAX_CONNECTIONS: Max Rust->Pool connections (default: 64, set in Rust) */ import * as net from 'node:net'; import * as fs from 'node:fs'; import { WorkerPoolManager, type PluginExecutionRequest } from './worker-pool'; -import { compilePlugin, compilePluginSource } from './compiler'; import { DEFAULT_POOL_MIN_THREADS, - DEFAULT_POOL_MIN_THREADS_DIVISOR, DEFAULT_POOL_MAX_THREADS_FLOOR, DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, DEFAULT_POOL_IDLE_TIMEOUT_MS, @@ -128,9 +131,21 @@ class PoolServer { constructor(socketPath: string) { this.socketPath = socketPath; - // Default to number of CPUs for worker threads, with higher concurrency per worker - // For 1000+ parallel requests, tune via environment variables const cpuCount = require('os').cpus().length; + + // ========================================================================= + // Configuration - ALL values are passed from Rust (single source of truth) + // ========================================================================= + // Rust's config.rs derives all values from PLUGIN_MAX_CONCURRENCY and + // passes them via environment variables when spawning this process. + // + // Fallbacks are provided only for manual testing without Rust. + // + const maxConcurrency = parseInt(process.env.PLUGIN_MAX_CONCURRENCY || '2048', 10); + const minThreads = parseInt( + process.env.PLUGIN_POOL_MIN_THREADS || String(Math.max(DEFAULT_POOL_MIN_THREADS, Math.floor(cpuCount / 2))), + 10 + ); const maxThreads = parseInt( process.env.PLUGIN_POOL_MAX_THREADS || String(Math.max(cpuCount, DEFAULT_POOL_MAX_THREADS_FLOOR)), 10 @@ -144,10 +159,11 @@ class PoolServer { 10 ); - debug(`Initializing pool with maxThreads=${maxThreads}, concurrentTasksPerWorker=${concurrentTasksPerWorker}`); + // Log effective configuration (received from Rust) + console.error(`[pool-server] Configuration (from Rust): maxConcurrency=${maxConcurrency}, minThreads=${minThreads}, maxThreads=${maxThreads}, concurrentTasksPerWorker=${concurrentTasksPerWorker}, idleTimeout=${idleTimeout}ms`); this.pool = new WorkerPoolManager({ - minThreads: Math.max(DEFAULT_POOL_MIN_THREADS, Math.floor(cpuCount / DEFAULT_POOL_MIN_THREADS_DIVISOR)), + minThreads, maxThreads, concurrentTasksPerWorker, idleTimeout, @@ -179,7 +195,6 @@ class PoolServer { // Don't set maxConnections at all - the default is unlimited // Setting it to 0 might reject all connections! - // this.server.maxConnections = 0; // REMOVED // Log any server-level errors this.server.on('error', (err) => { diff --git a/plugins/lib/sandbox-executor.js b/plugins/lib/sandbox-executor.js index e058b4576..45e36a220 100644 --- a/plugins/lib/sandbox-executor.js +++ b/plugins/lib/sandbox-executor.js @@ -1,3 +1,11 @@ +/** + * Auto-generated by build-executor.ts + * Build time: 2025-12-29T08:57:30.221Z + * Node version: v25.2.1 + * Source: sandbox-executor.ts + * Source hash: 098340c89cdfcab5 + * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts + */ "use strict"; var __create = Object.create; var __defProp = Object.defineProperty; @@ -3959,7 +3967,7 @@ var require_has_flag = __commonJS({ var require_supports_color = __commonJS({ "node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - var os = require("os"); + var os2 = require("os"); var tty = require("tty"); var hasFlag = require_has_flag(); var { env } = process; @@ -4007,7 +4015,7 @@ var require_supports_color = __commonJS({ return min; } if (process.platform === "win32") { - const osRelease = os.release().split("."); + const osRelease = os2.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } @@ -4885,13 +4893,13 @@ var require_Command = __commonJS({ /** * Iterate through the command arguments that are considered keys. */ - _iterateKeys(transform2 = (key) => key) { + _iterateKeys(transform = (key) => key) { if (typeof this.keys === "undefined") { this.keys = []; if ((0, commands_1.exists)(this.name)) { const keyIndexes = (0, commands_1.getKeyIndexes)(this.name, this.args); for (const index of keyIndexes) { - this.args[index] = transform2(this.args[index]); + this.args[index] = transform(this.args[index]); this.keys.push(this.args[index]); } } @@ -9820,7 +9828,7 @@ var require_main = __commonJS({ __export2(node_exports, { analyzeMetafile: () => analyzeMetafile, analyzeMetafileSync: () => analyzeMetafileSync, - build: () => build, + build: () => build2, buildSync: () => buildSync, context: () => context, default: () => node_default, @@ -9828,7 +9836,7 @@ var require_main = __commonJS({ formatMessagesSync: () => formatMessagesSync, initialize: () => initialize, stop: () => stop, - transform: () => transform2, + transform: () => transform, transformSync: () => transformSync, version: () => version }); @@ -10500,7 +10508,7 @@ is not a problem with esbuild. You need to fix your environment instead. } ); }; - let transform22 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { + let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { const details = createObjectStash(); let start = (inputPath) => { try { @@ -10623,7 +10631,7 @@ is not a problem with esbuild. You need to fix your environment instead. afterClose, service: { buildOrContext, - transform: transform22, + transform: transform2, formatMessages: formatMessages2, analyzeMetafile: analyzeMetafile2 } @@ -11380,7 +11388,7 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; }; } var fs2 = require("fs"); - var os = require("os"); + var os2 = require("os"); var path2 = require("path"); var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; @@ -11421,7 +11429,7 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; let pkg; let subpath; let isWASM = false; - let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + let platformKey = `${process.platform} ${os2.arch()} ${os2.endianness()}`; if (platformKey in knownWindowsPackages) { pkg = knownWindowsPackages[platformKey]; subpath = "esbuild.exe"; @@ -11571,7 +11579,7 @@ for your current platform.`); var crypto = require("crypto"); var path22 = require("path"); var fs22 = require("fs"); - var os2 = require("os"); + var os22 = require("os"); var tty = require("tty"); var worker_threads; if (process.env.ESBUILD_WORKER_THREADS !== "0") { @@ -11656,9 +11664,9 @@ More information: The file containing the code for esbuild's JavaScript API (${_ } }; var version = "0.24.2"; - var build = (options) => ensureServiceIsRunning().build(options); + var build2 = (options) => ensureServiceIsRunning().build(options); var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); - var transform2 = (input, options) => ensureServiceIsRunning().transform(input, options); + var transform = (input, options) => ensureServiceIsRunning().transform(input, options); var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); var buildSync = (options) => { @@ -11876,7 +11884,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_ afterClose(null); }; var randomFileName = () => { - return path22.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); + return path22.join(os22.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); }; var workerThreadService = null; var startWorkerThreadService = (worker_threads2) => { @@ -23445,7 +23453,7 @@ var require_axios = __commonJS({ convertValue, isVisitable }); - function build(value, path2) { + function build2(value, path2) { if (utils$1.isUndefined(value)) return; if (stack.indexOf(value) !== -1) { throw Error("Circular reference detected in " + path2.join(".")); @@ -23460,7 +23468,7 @@ var require_axios = __commonJS({ exposedHelpers ); if (result === true) { - build(el, path2 ? path2.concat(key) : [key]); + build2(el, path2 ? path2.concat(key) : [key]); } }); stack.pop(); @@ -23468,7 +23476,7 @@ var require_axios = __commonJS({ if (!utils$1.isObject(obj)) { throw new TypeError("data must be an object"); } - build(obj); + build2(obj); return formData; } function encode$1(str) { @@ -24090,7 +24098,7 @@ var require_axios = __commonJS({ const context = response || config; const headers = AxiosHeaders$1.from(context.headers); let data = context.data; - utils$1.forEach(fns, function transform2(fn) { + utils$1.forEach(fns, function transform(fn) { data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); }); headers.normalize(); @@ -31458,7 +31466,22 @@ var DefaultPluginKVStore = class { var esbuild = __toESM(require_main()); var fs = __toESM(require("node:fs")); var path = __toESM(require("node:path")); +var os = __toESM(require("node:os")); +var MAX_SOURCE_SIZE = 5 * 1024 * 1024; +var MAX_COMPILED_SIZE = 10 * 1024 * 1024; +var DEFAULT_PLUGIN_BASE_DIR = path.resolve(process.cwd(), "plugins"); function wrapForVm(compiledCode) { + if (typeof compiledCode !== "string") { + throw new Error("wrapForVm: compiledCode must be a string"); + } + if (compiledCode.length === 0) { + throw new Error("wrapForVm: compiledCode cannot be empty"); + } + if (compiledCode.length > MAX_COMPILED_SIZE) { + throw new Error( + `wrapForVm: code exceeds size limit (${(compiledCode.length / 1024 / 1024).toFixed(1)}MB)` + ); + } return ` (function(exports, require, module, __filename, __dirname) { ${compiledCode} @@ -31468,6 +31491,11 @@ ${compiledCode} // lib/sandbox-executor.ts var import_relayer_sdk = __toESM(require_dist()); + +// lib/constants.ts +var DEFAULT_SOCKET_REQUEST_TIMEOUT_MS = 3e4; + +// lib/sandbox-executor.ts var SandboxPluginAPI = class { constructor(socketPath, httpRequestId) { this.socket = null; @@ -31487,8 +31515,13 @@ var SandboxPluginAPI = class { resolve2(); }); this.socket.on("error", (error) => { + this.rejectAllPending(error); reject(error); }); + this.socket.on("close", () => { + this.connected = false; + this.rejectAllPending(new Error("Socket closed unexpectedly")); + }); }); this.socket.on("data", (data) => { data.toString().split("\n").filter(Boolean).forEach((msg) => { @@ -31507,6 +31540,16 @@ var SandboxPluginAPI = class { } await this.connectionPromise; } + /** + * Reject all pending requests with the given error. + * Called on socket error or close to prevent hanging promises. + */ + rejectAllPending(error) { + for (const [requestId, resolver] of this.pending.entries()) { + resolver.reject(error); + this.pending.delete(requestId); + } + } useRelayer(relayerId) { return { sendTransaction: async (payload) => { @@ -31558,9 +31601,24 @@ var SandboxPluginAPI = class { const message = JSON.stringify(msg) + "\n"; await this.ensureConnected(); return new Promise((resolve2, reject) => { - this.pending.set(requestId, { resolve: resolve2, reject }); + let timeoutId; + timeoutId = setTimeout(() => { + this.pending.delete(requestId); + reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); + }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); + this.pending.set(requestId, { + resolve: (value) => { + if (timeoutId) clearTimeout(timeoutId); + resolve2(value); + }, + reject: (reason) => { + if (timeoutId) clearTimeout(timeoutId); + reject(reason); + } + }); this.socket.write(message, (error) => { if (error) { + if (timeoutId) clearTimeout(timeoutId); this.pending.delete(requestId); reject(error); } @@ -31573,10 +31631,26 @@ var SandboxPluginAPI = class { } } }; +function safeStringify(value) { + try { + return JSON.stringify(value, (_, v) => { + if (typeof v === "bigint") { + return v.toString() + "n"; + } + return v; + }); + } catch { + try { + return String(value); + } catch { + return "[Unstringifiable value]"; + } + } +} function createSandboxConsole(logs) { const log = (level) => (...args) => { const message = args.map( - (arg) => typeof arg === "object" ? JSON.stringify(arg) : String(arg) + (arg) => typeof arg === "object" ? safeStringify(arg) : String(arg) ).join(" "); logs.push({ level, message }); }; @@ -31630,47 +31704,159 @@ async function executeInSandbox(task) { try { const sandboxConsole = createSandboxConsole(logs); const wrappedCode = wrapForVm(task.compiledCode); + const BLOCKED_MODULES = /* @__PURE__ */ new Set([ + // Filesystem access + "fs", + "fs/promises", + "node:fs", + "node:fs/promises", + // Process/system control + "child_process", + "node:child_process", + "cluster", + "node:cluster", + "worker_threads", + "node:worker_threads", + "process", + "node:process", + // Low-level system + "os", + "node:os", + "v8", + "node:v8", + "vm", + "node:vm", + // Direct network (use PluginAPI instead) + "net", + "node:net", + "dgram", + "node:dgram", + "tls", + "node:tls", + "http", + "node:http", + "https", + "node:https", + "http2", + "node:http2", + // Dangerous utilities + "repl", + "node:repl", + "inspector", + "node:inspector", + "perf_hooks", + "node:perf_hooks", + "async_hooks", + "node:async_hooks", + "trace_events", + "node:trace_events", + // Native modules (potential escape) + "module", + "node:module" + ]); const sandboxRequire = (id) => { - if (id === "@openzeppelin/relayer-sdk") { - return require_dist(); + if (BLOCKED_MODULES.has(id)) { + throw new Error( + `Module '${id}' is blocked for security. Use the PluginAPI for network operations.` + ); + } + try { + return require(id); + } catch (err) { + throw new Error( + `Module '${id}' not found. Ensure it's installed in plugins/node_modules.` + ); } - throw new Error(`Module '${id}' is not available in plugin sandbox`); }; const moduleExports = {}; const moduleObject = { exports: moduleExports }; + const safeCrypto = { + randomUUID: () => require("crypto").randomUUID(), + getRandomValues: (arr) => require("crypto").getRandomValues(arr) + }; const context = vm.createContext({ - // Console for logging + // === Console for logging === console: sandboxConsole, - // CommonJS module system + // === CommonJS module system === exports: moduleExports, require: sandboxRequire, module: moduleObject, __filename: `plugin-${task.pluginId}.js`, __dirname: "/plugins", - // Timer functions + // === Async primitives === setTimeout, setInterval, setImmediate, clearTimeout, clearInterval, clearImmediate, - // Promise (needed for async) Promise, - // Buffer for binary data handling - Buffer, - // JSON utilities + queueMicrotask, + // === Core JS types (often needed explicitly) === + Object, + Array, + String, + Number, + Boolean, + Symbol, + BigInt, + Map, + Set, + WeakMap, + WeakSet, + Date, + RegExp, + Math, JSON, - // Error types + // === Error types === Error, TypeError, RangeError, SyntaxError, - // URL handling + ReferenceError, + URIError, + EvalError, + // === Number utilities === + parseInt, + parseFloat, + isNaN, + isFinite, + Infinity: Infinity, + NaN: NaN, + // === String/URL encoding === + encodeURI, + decodeURI, + encodeURIComponent, + decodeURIComponent, + atob, + btoa, URL, URLSearchParams, - // TextEncoder/Decoder + // === Binary data === + Buffer, + ArrayBuffer, + SharedArrayBuffer, + Uint8Array, + Uint16Array, + Uint32Array, + Int8Array, + Int16Array, + Int32Array, + Float32Array, + Float64Array, + BigInt64Array, + BigUint64Array, + DataView, TextEncoder, - TextDecoder + TextDecoder, + // === Cancellation (modern async patterns) === + AbortController, + AbortSignal, + // === Safe crypto subset (no signing/hashing secrets) === + crypto: safeCrypto, + // === Reflection (needed by some libraries) === + Reflect, + Proxy }); const script = new vm.Script(wrappedCode, { filename: `plugin-${task.pluginId}.js` @@ -31682,17 +31868,27 @@ async function executeInSandbox(task) { throw new Error("Plugin must export a handler function"); } let result; - if (handler.length === 1) { - const pluginContext = { - api, - params: task.params, - kv, - headers: task.headers ?? {} - }; - result = await handler(pluginContext); - } else { - result = await handler(api, task.params); - } + const handlerPromise = (async () => { + if (handler.length === 1) { + const pluginContext = { + api, + params: task.params, + kv, + headers: task.headers ?? {} + }; + return await handler(pluginContext); + } else { + return await handler(api, task.params); + } + })(); + const timeoutPromise = new Promise((_, reject) => { + setTimeout(() => { + const error = new Error(`Plugin handler timed out after ${task.timeout}ms`); + error.code = "ERR_HANDLER_TIMEOUT"; + reject(error); + }, task.timeout); + }); + result = await Promise.race([handlerPromise, timeoutPromise]); return { taskId: task.taskId, success: true, @@ -31717,7 +31913,10 @@ async function executeInSandbox(task) { } else if (err.code === "ERR_SCRIPT_EXECUTION_TIMEOUT") { errorCode = "TIMEOUT"; errorStatus = 504; - errorMessage = `Plugin execution timed out after ${task.timeout}ms`; + errorMessage = `Plugin module compilation timed out after ${task.timeout}ms`; + } else if (err.code === "ERR_HANDLER_TIMEOUT") { + errorCode = "TIMEOUT"; + errorStatus = 504; } else if (err.code) { errorCode = err.code; } @@ -31747,6 +31946,8 @@ async function executeInSandbox(task) { }; } finally { api.close(); + await kv.disconnect().catch(() => { + }); } } /*! Bundled license information: diff --git a/plugins/lib/sandbox-executor.js.sha256 b/plugins/lib/sandbox-executor.js.sha256 new file mode 100644 index 000000000..53d127a91 --- /dev/null +++ b/plugins/lib/sandbox-executor.js.sha256 @@ -0,0 +1 @@ +68085d93fdaf27af7529e09c797aca5b25b0a16ac22f7c96fbf34477d867ed23 sandbox-executor.js diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/sandbox-executor.ts index 4154bf07f..74652ad55 100644 --- a/plugins/lib/sandbox-executor.ts +++ b/plugins/lib/sandbox-executor.ts @@ -25,6 +25,7 @@ import { TransactionStatus, pluginError, } from '@openzeppelin/relayer-sdk'; +import { DEFAULT_SOCKET_REQUEST_TIMEOUT_MS } from './constants'; /** * Task payload received from the worker pool @@ -106,8 +107,14 @@ class SandboxPluginAPI implements PluginAPI { }); this.socket!.on('error', (error) => { + this.rejectAllPending(error); reject(error); }); + + this.socket!.on('close', () => { + this.connected = false; + this.rejectAllPending(new Error('Socket closed unexpectedly')); + }); }); this.socket.on('data', (data) => { @@ -134,6 +141,17 @@ class SandboxPluginAPI implements PluginAPI { await this.connectionPromise; } + /** + * Reject all pending requests with the given error. + * Called on socket error or close to prevent hanging promises. + */ + private rejectAllPending(error: Error): void { + for (const [requestId, resolver] of this.pending.entries()) { + resolver.reject(error); + this.pending.delete(requestId); + } + } + useRelayer(relayerId: string): Relayer { return { sendTransaction: async (payload: NetworkTransactionRequest) => { @@ -209,9 +227,29 @@ class SandboxPluginAPI implements PluginAPI { await this.ensureConnected(); return new Promise((resolve, reject) => { - this.pending.set(requestId, { resolve, reject }); + let timeoutId: NodeJS.Timeout | undefined; + + // Set up timeout to prevent hanging forever + timeoutId = setTimeout(() => { + this.pending.delete(requestId); + reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); + }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); + + // Wrap resolvers to clear timeout on completion + this.pending.set(requestId, { + resolve: (value) => { + if (timeoutId) clearTimeout(timeoutId); + resolve(value); + }, + reject: (reason) => { + if (timeoutId) clearTimeout(timeoutId); + reject(reason); + }, + }); + this.socket!.write(message, (error) => { if (error) { + if (timeoutId) clearTimeout(timeoutId); this.pending.delete(requestId); reject(error); } @@ -229,13 +267,34 @@ class SandboxPluginAPI implements PluginAPI { } } +/** + * Safely stringify a value, handling circular references and BigInt. + * Falls back to String() if JSON.stringify fails. + */ +function safeStringify(value: unknown): string { + try { + return JSON.stringify(value, (_, v) => { + if (typeof v === 'bigint') { + return v.toString() + 'n'; + } + return v; + }); + } catch { + try { + return String(value); + } catch { + return '[Unstringifiable value]'; + } + } +} + /** * Creates a console-like object that captures logs. */ function createSandboxConsole(logs: LogEntry[]): Console { const log = (level: LogEntry['level']) => (...args: any[]) => { const message = args.map(arg => - typeof arg === 'object' ? JSON.stringify(arg) : String(arg) + typeof arg === 'object' ? safeStringify(arg) : String(arg) ).join(' '); logs.push({ level, message }); }; @@ -284,55 +343,165 @@ export default async function executeInSandbox(task: SandboxTask): Promise { - // Allow the relayer SDK (it's already used in the compiled code) - if (id === '@openzeppelin/relayer-sdk') { - return require('@openzeppelin/relayer-sdk'); + // Block dangerous built-in modules + if (BLOCKED_MODULES.has(id)) { + throw new Error( + `Module '${id}' is blocked for security. ` + + `Use the PluginAPI for network operations.` + ); + } + + // Allow everything else (SDK, npm packages like uuid, ethers, etc.) + try { + return require(id); + } catch (err) { + throw new Error( + `Module '${id}' not found. Ensure it's installed in plugins/node_modules.` + ); } - // Block all other requires for security - throw new Error(`Module '${id}' is not available in plugin sandbox`); }; // Create module-like objects for CommonJS compatibility const moduleExports: any = {}; const moduleObject = { exports: moduleExports }; + // Minimal crypto exposure - only safe ID generation + const safeCrypto = { + randomUUID: () => require('crypto').randomUUID(), + getRandomValues: (arr: Uint8Array) => require('crypto').getRandomValues(arr), + }; + // Create the sandbox context + // SECURITY: Only expose safe globals. Never expose: + // - process (env vars, exit, argv) + // - fs, child_process, net, http (I/O) + // - eval, Function constructor (code execution) + // - require for arbitrary modules const context = vm.createContext({ - // Console for logging + // === Console for logging === console: sandboxConsole, - // CommonJS module system + + // === CommonJS module system === exports: moduleExports, require: sandboxRequire, module: moduleObject, __filename: `plugin-${task.pluginId}.js`, __dirname: '/plugins', - // Timer functions + + // === Async primitives === setTimeout, setInterval, setImmediate, clearTimeout, clearInterval, clearImmediate, - // Promise (needed for async) Promise, - // Buffer for binary data handling - Buffer, - // JSON utilities + queueMicrotask, + + // === Core JS types (often needed explicitly) === + Object, + Array, + String, + Number, + Boolean, + Symbol, + BigInt, + Map, + Set, + WeakMap, + WeakSet, + Date, + RegExp, + Math, JSON, - // Error types + + // === Error types === Error, TypeError, RangeError, SyntaxError, - // URL handling + ReferenceError, + URIError, + EvalError, + + // === Number utilities === + parseInt, + parseFloat, + isNaN, + isFinite, + Infinity, + NaN, + + // === String/URL encoding === + encodeURI, + decodeURI, + encodeURIComponent, + decodeURIComponent, + atob, + btoa, URL, URLSearchParams, - // TextEncoder/Decoder + + // === Binary data === + Buffer, + ArrayBuffer, + SharedArrayBuffer, + Uint8Array, + Uint16Array, + Uint32Array, + Int8Array, + Int16Array, + Int32Array, + Float32Array, + Float64Array, + BigInt64Array, + BigUint64Array, + DataView, TextEncoder, TextDecoder, + + // === Cancellation (modern async patterns) === + AbortController, + AbortSignal, + + // === Safe crypto subset (no signing/hashing secrets) === + crypto: safeCrypto, + + // === Reflection (needed by some libraries) === + Reflect, + Proxy, }); // Compile and run the wrapped code to get the factory function @@ -352,22 +521,36 @@ export default async function executeInSandbox(task: SandboxTask): Promise { + if (handler.length === 1) { + // Modern context-based handler + const pluginContext: PluginContext = { + api, + params: task.params, + kv, + headers: task.headers ?? {}, + }; + return await handler(pluginContext); + } else { + // Legacy 2-param handler (no KV/headers access) + return await handler(api, task.params); + } + })(); + + // Race handler against timeout to prevent worker starvation + const timeoutPromise = new Promise((_, reject) => { + setTimeout(() => { + const error = new Error(`Plugin handler timed out after ${task.timeout}ms`); + (error as any).code = 'ERR_HANDLER_TIMEOUT'; + reject(error); + }, task.timeout); + }); + + result = await Promise.race([handlerPromise, timeoutPromise]); return { taskId: task.taskId, @@ -398,7 +581,11 @@ export default async function executeInSandbox(task: SandboxTask): Promise { + // Ignore disconnect errors - connection may not have been established + }); } } diff --git a/plugins/lib/worker-pool.ts b/plugins/lib/worker-pool.ts index d4a5f519b..73f0bc971 100644 --- a/plugins/lib/worker-pool.ts +++ b/plugins/lib/worker-pool.ts @@ -17,8 +17,8 @@ import { DEFAULT_POOL_MIN_THREADS, DEFAULT_POOL_IDLE_TIMEOUT_MS, DEFAULT_POOL_EXECUTION_TIMEOUT_MS, - DEFAULT_WORKER_POOL_MAX_THREADS_FLOOR, - DEFAULT_WORKER_POOL_CONCURRENT_TASKS_PER_WORKER, + DEFAULT_POOL_MAX_THREADS_FLOOR, + DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, } from './constants'; /** @@ -33,6 +33,8 @@ export interface WorkerPoolOptions { concurrentTasksPerWorker?: number; /** Idle timeout before shutting down excess workers (ms) */ idleTimeout?: number; + /** Task-level timeout to prevent stuck workers (ms). Defaults to execution timeout + 5s buffer. */ + taskTimeout?: number; } /** @@ -76,15 +78,19 @@ export interface PluginExecutionResult { logs: LogEntry[]; } +const DEFAULT_TIMEOUT = DEFAULT_POOL_EXECUTION_TIMEOUT_MS; + +// Task timeout includes a 5s buffer over execution timeout for cleanup overhead +const DEFAULT_TASK_TIMEOUT = DEFAULT_TIMEOUT + 5000; + const DEFAULT_OPTIONS: Required = { minThreads: DEFAULT_POOL_MIN_THREADS, - maxThreads: Math.max(os.cpus().length, DEFAULT_WORKER_POOL_MAX_THREADS_FLOOR), - concurrentTasksPerWorker: DEFAULT_WORKER_POOL_CONCURRENT_TASKS_PER_WORKER, + maxThreads: Math.max(os.cpus().length, DEFAULT_POOL_MAX_THREADS_FLOOR), + concurrentTasksPerWorker: DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, idleTimeout: DEFAULT_POOL_IDLE_TIMEOUT_MS, + taskTimeout: DEFAULT_TASK_TIMEOUT, }; -const DEFAULT_TIMEOUT = DEFAULT_POOL_EXECUTION_TIMEOUT_MS; - /** * Path to the pre-compiled sandbox executor. * This file is generated at build time by running: npx ts-node build-executor.ts @@ -146,6 +152,26 @@ function createInitialMetrics(): PluginMetrics { }; } +/** + * Increment a counter in a bounded Map. + * If the map exceeds maxSize, removes the oldest entry (FIFO eviction). + */ +function incrementBoundedMap( + map: Map, + key: string, + maxSize: number +): void { + map.set(key, (map.get(key) || 0) + 1); + + // Evict oldest entries if over limit + if (map.size > maxSize) { + const firstKey = map.keys().next().value; + if (firstKey !== undefined) { + map.delete(firstKey); + } + } +} + /** * In-memory cache for compiled plugin code */ @@ -194,18 +220,48 @@ class CompiledCodeCache { * Manages plugin execution using a Piscina worker pool. * Handles compilation caching, task routing, and pool lifecycle. */ +/** Maximum entries in metrics Maps to prevent unbounded growth */ +const MAX_METRICS_ENTRIES = 1000; + export class WorkerPoolManager { private pool: Piscina | null = null; private options: Required; private compiledCache: CompiledCodeCache; private initialized: boolean = false; + /** Promise for in-flight initialization to prevent race conditions */ + private initPromise: Promise | null = null; private compiledWorkerPath: string | null = null; + /** Whether compiledWorkerPath is a temp file that should be cleaned up */ + private isTemporaryWorkerFile: boolean = false; private metrics: PluginMetrics; constructor(options: WorkerPoolOptions = {}) { this.options = { ...DEFAULT_OPTIONS, ...options }; this.compiledCache = new CompiledCodeCache(); this.metrics = createInitialMetrics(); + + // Register cleanup handlers for unclean shutdown (temp file leak prevention) + this.registerCleanupHandlers(); + } + + /** + * Register process handlers to clean up temp files on unexpected exit. + */ + private registerCleanupHandlers(): void { + const cleanup = () => { + if (this.isTemporaryWorkerFile && this.compiledWorkerPath) { + try { + fs.unlinkSync(this.compiledWorkerPath); + } catch { + // Ignore - best effort cleanup + } + } + }; + + // Handle various exit scenarios + process.once('beforeExit', cleanup); + process.once('SIGINT', cleanup); + process.once('SIGTERM', cleanup); } /** @@ -214,13 +270,38 @@ export class WorkerPoolManager { * * Uses pre-compiled sandbox-executor.js if available, * otherwise compiles it on-the-fly (slower first startup). + * + * Thread-safe: multiple concurrent calls will await the same initialization. */ async initialize(): Promise { + // Already initialized if (this.initialized) return; + // Another call is initializing - await it (prevents race condition) + if (this.initPromise) { + await this.initPromise; + return; + } + + // Start initialization and store promise for concurrent callers + this.initPromise = this.doInitialize(); + + try { + await this.initPromise; + } finally { + // Clear promise after completion (success or failure) + this.initPromise = null; + } + } + + /** + * Internal initialization logic. + */ + private async doInitialize(): Promise { // Use pre-compiled sandbox-executor.js if it exists if (fs.existsSync(PRECOMPILED_EXECUTOR_PATH)) { this.compiledWorkerPath = PRECOMPILED_EXECUTOR_PATH; + this.isTemporaryWorkerFile = false; } else { // Fallback: compile on-the-fly (for fresh checkouts, dev mode, etc.) console.warn( @@ -228,6 +309,7 @@ export class WorkerPoolManager { `Compiling on-the-fly. Run 'npm run build:executor' in plugins/ for faster startup.` ); this.compiledWorkerPath = await this.compileExecutorOnTheFly(); + this.isTemporaryWorkerFile = true; } this.pool = new Piscina({ @@ -385,7 +467,7 @@ export class WorkerPoolManager { this.metrics.totalExecutions++; this.metrics.failedExecutions++; const errorCode = 'NO_COMPILED_CODE'; - this.metrics.errorsByType.set(errorCode, (this.metrics.errorsByType.get(errorCode) || 0) + 1); + incrementBoundedMap(this.metrics.errorsByType, errorCode, MAX_METRICS_ENTRIES); return { success: false, error: { @@ -409,14 +491,24 @@ export class WorkerPoolManager { timeout: request.timeout ?? DEFAULT_TIMEOUT, }; - // Track per-plugin execution - this.metrics.pluginExecutions.set( - request.pluginId, - (this.metrics.pluginExecutions.get(request.pluginId) || 0) + 1 - ); + // Track per-plugin execution (bounded to prevent memory leak) + incrementBoundedMap(this.metrics.pluginExecutions, request.pluginId, MAX_METRICS_ENTRIES); + + // Use task timeout to prevent permanently stuck workers + // This is a safety net beyond the handler-level timeout in sandbox-executor + const taskTimeout = this.options.taskTimeout; + let timeoutId: NodeJS.Timeout | undefined; try { - const result: SandboxResult = await this.pool!.run(task); + const runPromise = this.pool!.run(task); + + const timeoutPromise = new Promise((_, reject) => { + timeoutId = setTimeout(() => { + reject(new Error(`Task timed out after ${taskTimeout}ms (worker may be stuck)`)); + }, taskTimeout); + }); + + const result: SandboxResult = await Promise.race([runPromise, timeoutPromise]); // Update execution metrics const executionTime = Date.now() - executionStartTime; @@ -431,10 +523,7 @@ export class WorkerPoolManager { } else { this.metrics.failedExecutions++; if (result.error?.code) { - this.metrics.errorsByType.set( - result.error.code, - (this.metrics.errorsByType.get(result.error.code) || 0) + 1 - ); + incrementBoundedMap(this.metrics.errorsByType, result.error.code, MAX_METRICS_ENTRIES); } } @@ -455,7 +544,7 @@ export class WorkerPoolManager { this.metrics.totalExecutionTime += executionTime; this.metrics.minExecutionTime = Math.min(this.metrics.minExecutionTime, executionTime); this.metrics.maxExecutionTime = Math.max(this.metrics.maxExecutionTime, executionTime); - this.metrics.errorsByType.set('WORKER_ERROR', (this.metrics.errorsByType.get('WORKER_ERROR') || 0) + 1); + incrementBoundedMap(this.metrics.errorsByType, 'WORKER_ERROR', MAX_METRICS_ENTRIES); return { success: false, @@ -466,6 +555,11 @@ export class WorkerPoolManager { }, logs: [], }; + } finally { + // Clear timeout to prevent timer leak + if (timeoutId) { + clearTimeout(timeoutId); + } } } @@ -588,7 +682,6 @@ export class WorkerPoolManager { /** * Shutdown the worker pool. * Call this when the application is shutting down. - * Note: Cached compiled workers are NOT deleted as they can be reused. */ async shutdown(): Promise { if (this.pool) { @@ -597,10 +690,17 @@ export class WorkerPoolManager { this.initialized = false; } - // Don't delete the compiled worker - it's cached for reuse - // Just clear the reference - this.compiledWorkerPath = null; + // Clean up temporary compiled worker file to prevent disk space leak + if (this.isTemporaryWorkerFile && this.compiledWorkerPath) { + try { + fs.unlinkSync(this.compiledWorkerPath); + } catch { + // Ignore errors - file may already be deleted or inaccessible + } + } + this.compiledWorkerPath = null; + this.isTemporaryWorkerFile = false; this.compiledCache.clear(); } } diff --git a/src/constants/plugins.rs b/src/constants/plugins.rs index 267d46215..bc1d7c5a1 100644 --- a/src/constants/plugins.rs +++ b/src/constants/plugins.rs @@ -1,4 +1,19 @@ -/// Default plugin execution timeout in seconds +// ============================================================================= +// Plugin Configuration Constants +// ============================================================================= +// +// All constants below can be overridden via environment variables. +// See docs/plugins/index.mdx for the full configuration guide. +// +// Environment Variable Naming Convention: +// PLUGIN_POOL_* โ†’ Pool server & connection pool settings +// PLUGIN_SOCKET_* โ†’ Shared socket service settings +// PLUGIN_TRACE_* โ†’ Trace collection settings +// +// ============================================================================= + +/// Default plugin execution timeout in seconds. +/// Override in config.json per-plugin: `"timeout": 60` pub const DEFAULT_PLUGIN_TIMEOUT_SECONDS: u64 = 300; // 5 minutes // ============================================================================= @@ -7,45 +22,80 @@ pub const DEFAULT_PLUGIN_TIMEOUT_SECONDS: u64 = 300; // 5 minutes // worker-pool.ts files should use matching values. // ============================================================================= -/// Default maximum connections from Rust to the pool server -pub const DEFAULT_POOL_MAX_CONNECTIONS: usize = 64; +/// Maximum concurrent connections from Rust to the Node.js pool server. +/// Env: PLUGIN_POOL_MAX_CONNECTIONS +/// Increase for high concurrency (3000+ VUs). +pub const DEFAULT_POOL_MAX_CONNECTIONS: usize = 2048; -/// Default minimum worker threads (floor) +/// Minimum worker threads in Node.js pool (floor). +/// Internal constant, not user-configurable. pub const DEFAULT_POOL_MIN_THREADS: usize = 2; -/// Default maximum worker threads floor (minimum threads even on small machines) +/// Maximum worker threads floor (minimum threads even on small machines). +/// Internal constant, not user-configurable. pub const DEFAULT_POOL_MAX_THREADS_FLOOR: usize = 8; -/// Default concurrent tasks per worker thread -pub const DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER: usize = 10; +/// Concurrent tasks per worker thread in Node.js pool. +/// Internal constant, not user-configurable. +pub const DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER: usize = 20; -/// Default worker idle timeout in milliseconds +/// Worker idle timeout in milliseconds. +/// Internal constant, not user-configurable. pub const DEFAULT_POOL_IDLE_TIMEOUT_MS: u64 = 60000; // 60 seconds -/// Default socket connection backlog for high concurrency -pub const DEFAULT_POOL_SOCKET_BACKLOG: u32 = 1024; +/// Socket connection backlog for the pool server. +/// Env: PLUGIN_POOL_SOCKET_BACKLOG (internal, rarely needs tuning) +pub const DEFAULT_POOL_SOCKET_BACKLOG: u32 = 2048; -/// Default plugin execution timeout in milliseconds (within pool) +/// Plugin execution timeout within the pool (milliseconds). +/// Internal constant - use per-plugin `timeout` in config.json instead. pub const DEFAULT_POOL_EXECUTION_TIMEOUT_MS: u64 = 30000; // 30 seconds -/// Default request timeout in seconds (for pool requests) +/// Timeout for individual pool requests (seconds). +/// Env: PLUGIN_POOL_REQUEST_TIMEOUT_SECS pub const DEFAULT_POOL_REQUEST_TIMEOUT_SECS: u64 = 30; -/// Default maximum queue size for request throttling -pub const DEFAULT_POOL_MAX_QUEUE_SIZE: usize = 1000; +/// Maximum queued requests before rejection. +/// Env: PLUGIN_POOL_MAX_QUEUE_SIZE +/// Increase for high concurrency (3000+ VUs). +pub const DEFAULT_POOL_MAX_QUEUE_SIZE: usize = 5000; + +/// Wait time (ms) when queue is full before rejecting. +/// Env: PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS +/// Increase for bursty traffic patterns. +pub const DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS: u64 = 500; + +/// Minimum seconds between health checks. +/// Env: PLUGIN_POOL_HEALTH_CHECK_INTERVAL_SECS +/// Prevents health check storms under high load. +pub const DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS: u64 = 5; + +/// Retry attempts when connecting to pool server. +/// Env: PLUGIN_POOL_CONNECT_RETRIES +/// Increase for high concurrency scenarios. +pub const DEFAULT_POOL_CONNECT_RETRIES: usize = 15; // ============================================================================= // Shared Socket Service Configuration +// Controls the Unix socket for plugin โ†” relayer communication. // ============================================================================= -/// Default connection idle timeout in seconds +/// Idle timeout for plugin connections (seconds). +/// Env: PLUGIN_SOCKET_IDLE_TIMEOUT_SECS +/// Connections idle longer than this are closed. pub const DEFAULT_SOCKET_IDLE_TIMEOUT_SECS: u64 = 60; -/// Default read timeout per line in seconds +/// Read timeout per line from plugins (seconds). +/// Env: PLUGIN_SOCKET_READ_TIMEOUT_SECS +/// Time to wait for a complete message from a plugin. pub const DEFAULT_SOCKET_READ_TIMEOUT_SECS: u64 = 30; -/// Maximum concurrent connections (backlog limit) -pub const DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS: usize = 1024; +/// Maximum concurrent plugin connections to the relayer. +/// Env: PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS +/// Should be >= PLUGIN_POOL_MAX_CONNECTIONS. +pub const DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS: usize = 4096; -/// Default trace collection timeout in seconds -pub const DEFAULT_TRACE_TIMEOUT_SECS: u64 = 5; +/// Trace collection timeout (milliseconds). +/// Env: PLUGIN_TRACE_TIMEOUT_MS +/// Short timeout since traces arrive immediately after plugin execution. +pub const DEFAULT_TRACE_TIMEOUT_MS: u64 = 100; diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs index a66c45e5e..169e0df30 100644 --- a/src/services/plugins/config.rs +++ b/src/services/plugins/config.rs @@ -24,8 +24,9 @@ use crate::constants::{ DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, DEFAULT_POOL_IDLE_TIMEOUT_MS, DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_QUEUE_SIZE, DEFAULT_POOL_MAX_THREADS_FLOOR, DEFAULT_POOL_MIN_THREADS, DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, - DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, - DEFAULT_SOCKET_READ_TIMEOUT_SECS, DEFAULT_TRACE_TIMEOUT_MS, + DEFAULT_POOL_SOCKET_BACKLOG, DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, + DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, DEFAULT_SOCKET_READ_TIMEOUT_SECS, + DEFAULT_TRACE_TIMEOUT_MS, }; use std::sync::OnceLock; @@ -73,6 +74,10 @@ pub struct PluginConfig { /// Worker idle timeout in milliseconds pub nodejs_pool_idle_timeout_ms: u64, + // === Socket Backlog (derived from max_concurrency) === + /// Socket connection backlog for pending connections + pub pool_socket_backlog: usize, + // === Health & Monitoring === /// Minimum seconds between health checks pub health_check_interval_secs: u64, @@ -147,17 +152,19 @@ impl PluginConfig { let derived_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); let nodejs_pool_min_threads = env_parse("PLUGIN_POOL_MIN_THREADS", derived_min_threads); - // maxThreads = min(cpuCount * 2, concurrency / 50, 64) - // - For 1000 concurrency: ~20 threads - // - For 3000 concurrency: ~60 threads - // - For 5000+ concurrency: 64 threads (capped) + // maxThreads = min(max(cpuCount * 2, concurrency / 50), 64) + // Goal: Scale threads with concurrency, but cap at 64 for efficiency + // - For 1000 concurrency: max(cpu*2, 20) capped at 64 = ~20 threads + // - For 3000 concurrency: max(cpu*2, 60) capped at 64 = ~60 threads + // - For 6000+ concurrency: max(cpu*2, 120) capped at 64 = 64 threads + let scaling_threads = max_concurrency / 50; // 6000 VUs -> 120 threads (before cap) let derived_max_threads = (cpu_count * 2) + .max(scaling_threads) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(max_concurrency / 50) - .min(64); + .min(64); // Final cap at 64 let nodejs_pool_max_threads = env_parse( "PLUGIN_POOL_MAX_THREADS", - derived_max_threads.max(DEFAULT_POOL_MAX_THREADS_FLOOR), + derived_max_threads, ); // concurrentTasksPerWorker: Node.js async can handle many concurrent tasks @@ -175,6 +182,12 @@ impl PluginConfig { let nodejs_pool_idle_timeout_ms = env_parse("PLUGIN_POOL_IDLE_TIMEOUT", DEFAULT_POOL_IDLE_TIMEOUT_MS); + // Socket backlog = max_concurrency (enough to absorb connection bursts) + let pool_socket_backlog = env_parse( + "PLUGIN_POOL_SOCKET_BACKLOG", + max_concurrency.max(DEFAULT_POOL_SOCKET_BACKLOG as usize), + ); + Self { max_concurrency, pool_max_connections, @@ -190,6 +203,7 @@ impl PluginConfig { nodejs_pool_max_threads, nodejs_pool_concurrent_tasks, nodejs_pool_idle_timeout_ms, + pool_socket_backlog, health_check_interval_secs, trace_timeout_ms, } @@ -204,6 +218,7 @@ impl PluginConfig { socket_max_connections = self.socket_max_connections, nodejs_max_threads = self.nodejs_pool_max_threads, nodejs_concurrent_tasks = self.nodejs_pool_concurrent_tasks, + socket_backlog = self.pool_socket_backlog, "Plugin configuration loaded (Rust + Node.js)" ); } @@ -226,6 +241,7 @@ impl Default for PluginConfig { nodejs_pool_max_threads: DEFAULT_POOL_MAX_THREADS_FLOOR, nodejs_pool_concurrent_tasks: DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, nodejs_pool_idle_timeout_ms: DEFAULT_POOL_IDLE_TIMEOUT_MS, + pool_socket_backlog: DEFAULT_POOL_SOCKET_BACKLOG as usize, health_check_interval_secs: DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, trace_timeout_ms: DEFAULT_TRACE_TIMEOUT_MS, } diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index 7ccea90c4..9e9303d93 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -19,9 +19,8 @@ use tokio::process::{Child, Command}; use tokio::sync::{oneshot, RwLock, Semaphore}; use uuid::Uuid; -use super::{LogEntry, LogLevel, PluginError, PluginHandlerPayload, ScriptResult}; -use crate::constants::{ - DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_QUEUE_SIZE, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, +use super::{ + config::get_config, LogEntry, LogLevel, PluginError, PluginHandlerPayload, ScriptResult, }; /// Health status information from the pool server @@ -147,33 +146,57 @@ struct PoolConnection { impl PoolConnection { async fn new(socket_path: &str, id: usize) -> Result { - // Retry connection with backoff - socket might not be ready immediately after READY signal + // Retry connection with backoff - socket might not be ready or server might be busy let mut attempts = 0; - let max_attempts = 10; - let mut delay_ms = 10; + let max_attempts = get_config().pool_connect_retries; + let mut delay_ms: u64 = 10; + let max_delay_ms: u64 = 1000; // Max 1 second between retries tracing::debug!(connection_id = id, socket_path = %socket_path, "Connecting to pool server"); loop { match UnixStream::connect(socket_path).await { Ok(stream) => { - tracing::debug!(connection_id = id, "Connected to pool server"); + if attempts > 0 { + tracing::debug!( + connection_id = id, + attempts = attempts, + "Connected to pool server after retries" + ); + } return Ok(Self { stream, id }); } Err(e) => { attempts += 1; + + // Check if it's a temporary error (EAGAIN, ECONNREFUSED, etc) + let is_temporary = matches!( + e.kind(), + std::io::ErrorKind::ConnectionRefused + | std::io::ErrorKind::WouldBlock + | std::io::ErrorKind::TimedOut + | std::io::ErrorKind::Interrupted + ); + if attempts >= max_attempts { return Err(PluginError::SocketError(format!( - "Failed to connect to pool after {max_attempts} attempts: {e}" + "Failed to connect to pool after {max_attempts} attempts: {e}. \ + Consider increasing PLUGIN_POOL_CONNECT_RETRIES or PLUGIN_POOL_MAX_CONNECTIONS." ))); } - tracing::debug!( - connection_id = id, - attempt = attempts, - delay_ms = delay_ms, - "Retrying connection to pool server" - ); + + // Only log at debug level to reduce noise under load + if attempts <= 3 || attempts % 5 == 0 { + tracing::debug!( + connection_id = id, + attempt = attempts, + max_attempts = max_attempts, + delay_ms = delay_ms, + is_temporary = is_temporary, + "Retrying connection to pool server" + ); + } tokio::time::sleep(Duration::from_millis(delay_ms)).await; - delay_ms = std::cmp::min(delay_ms * 2, 500); + delay_ms = std::cmp::min(delay_ms * 2, max_delay_ms); } } } @@ -185,11 +208,15 @@ impl PoolConnection { // Write request and flush if let Err(e) = self.stream.write_all(format!("{json}\n").as_bytes()).await { - return Err(PluginError::SocketError(format!("Failed to send request: {e}"))); + return Err(PluginError::SocketError(format!( + "Failed to send request: {e}" + ))); } if let Err(e) = self.stream.flush().await { - return Err(PluginError::SocketError(format!("Failed to flush request: {e}"))); + return Err(PluginError::SocketError(format!( + "Failed to flush request: {e}" + ))); } // Read response using BufReader on a reference to the stream @@ -197,7 +224,9 @@ impl PoolConnection { let mut line = String::new(); if let Err(e) = reader.read_line(&mut line).await { - return Err(PluginError::SocketError(format!("Failed to read response: {e}"))); + return Err(PluginError::SocketError(format!( + "Failed to read response: {e}" + ))); } tracing::debug!(response_len = line.len(), "Received response from pool"); @@ -212,9 +241,12 @@ impl PoolConnection { request: &PoolRequest, timeout_secs: u64, ) -> Result { - tokio::time::timeout(Duration::from_secs(timeout_secs), self.send_request(request)) - .await - .map_err(|_| PluginError::SocketError("Request timed out".to_string()))? + tokio::time::timeout( + Duration::from_secs(timeout_secs), + self.send_request(request), + ) + .await + .map_err(|_| PluginError::SocketError("Request timed out".to_string()))? } } @@ -249,22 +281,37 @@ impl ConnectionPool { /// Get a connection from the pool or create a new one /// Uses semaphore for proper concurrency limiting async fn acquire(&self) -> Result, PluginError> { + let available_permits = self.semaphore.available_permits(); + if available_permits == 0 { + tracing::warn!( + max_connections = self.max_connections, + "All connection permits exhausted - waiting for connection" + ); + } + // Acquire permit first - this limits total concurrent connections - let permit = self.semaphore.clone().acquire_owned().await.map_err(|_| { - PluginError::PluginError("Connection semaphore closed".to_string()) - })?; + let permit = self + .semaphore + .clone() + .acquire_owned() + .await + .map_err(|_| PluginError::PluginError("Connection semaphore closed".to_string()))?; // Try to find a healthy connection in the pool let mut candidate_ids = Vec::new(); - + for entry in self.connections.iter() { let conn_id = *entry.key(); - let is_healthy = self.health.get(&conn_id).map(|h| *h.value()).unwrap_or(false); + let is_healthy = self + .health + .get(&conn_id) + .map(|h| *h.value()) + .unwrap_or(false); if is_healthy { candidate_ids.push(conn_id); } } - + // Try to remove one of the candidates for conn_id in candidate_ids { if let Some((_, conn)) = self.connections.remove(&conn_id) { @@ -276,14 +323,14 @@ impl ConnectionPool { }); } } - + // No available connection, create a new one let id = self.next_id.fetch_add(1, Ordering::Relaxed); tracing::debug!(connection_id = id, "Creating new pool connection"); - + let conn = PoolConnection::new(&self.socket_path, id).await?; self.health.insert(id, true); - + Ok(PooledConnection { conn: Some(conn), pool: self, @@ -294,15 +341,22 @@ impl ConnectionPool { /// Return a connection to the pool fn release(&self, conn: PoolConnection) { let conn_id = conn.id; - let is_healthy = self.health.get(&conn_id).map(|h| *h.value()).unwrap_or(false); + let is_healthy = self + .health + .get(&conn_id) + .map(|h| *h.value()) + .unwrap_or(false); let pool_size = self.connections.len(); - + if is_healthy && pool_size < self.max_connections { self.connections.insert(conn_id, conn); tracing::debug!(connection_id = conn_id, "Connection returned to pool"); } else { self.health.remove(&conn_id); - tracing::debug!(connection_id = conn_id, "Connection dropped (unhealthy or pool full)"); + tracing::debug!( + connection_id = conn_id, + "Connection dropped (unhealthy or pool full)" + ); } } @@ -344,7 +398,9 @@ impl<'a> PooledConnection<'a> { } } } else { - Err(PluginError::PluginError("Connection already released".to_string())) + Err(PluginError::PluginError( + "Connection already released".to_string(), + )) } } @@ -382,12 +438,18 @@ pub struct PoolManager { socket_path: String, process: tokio::sync::Mutex>, initialized: RwLock, + /// Lock to prevent concurrent restarts (thundering herd) + restart_lock: tokio::sync::Mutex<()>, /// Connection pool for reusing connections connection_pool: Arc, /// Request queue for throttling/backpressure (multi-consumer channel) request_tx: async_channel::Sender, /// Actual configured queue size (for error messages) max_queue_size: usize, + /// Last health check timestamp (for rate limiting) + last_health_check: std::sync::atomic::AtomicU64, + /// Consecutive failure count for health checks + consecutive_failures: std::sync::atomic::AtomicU32, } impl PoolManager { @@ -403,56 +465,58 @@ impl PoolManager { /// Common initialization logic fn init(socket_path: String) -> Self { - let max_connections = std::env::var("PLUGIN_POOL_MAX_CONNECTIONS") - .ok() - .and_then(|s| s.parse().ok()) - .unwrap_or(DEFAULT_POOL_MAX_CONNECTIONS); - let max_queue_size = std::env::var("PLUGIN_POOL_MAX_QUEUE_SIZE") - .ok() - .and_then(|s| s.parse().ok()) - .unwrap_or(DEFAULT_POOL_MAX_QUEUE_SIZE); - + // Use centralized config with auto-derivation from PLUGIN_MAX_CONCURRENCY + let config = get_config(); + let max_connections = config.pool_max_connections; + let max_queue_size = config.pool_max_queue_size; + // Use async-channel for multi-consumer queue (no mutex needed) let (tx, rx) = async_channel::bounded(max_queue_size); - + let connection_pool = Arc::new(ConnectionPool::new(socket_path.clone(), max_connections)); let connection_pool_clone = connection_pool.clone(); - + // Spawn background workers to process queued requests - Self::spawn_queue_workers(rx, connection_pool_clone); - + Self::spawn_queue_workers(rx, connection_pool_clone, config.pool_workers); + Self { connection_pool, socket_path, process: tokio::sync::Mutex::new(None), initialized: RwLock::new(false), + restart_lock: tokio::sync::Mutex::new(()), request_tx: tx, max_queue_size, + last_health_check: std::sync::atomic::AtomicU64::new(0), + consecutive_failures: std::sync::atomic::AtomicU32::new(0), } } - + /// Spawn multiple worker tasks to process queued requests concurrently fn spawn_queue_workers( rx: async_channel::Receiver, connection_pool: Arc, + configured_workers: usize, ) { - let num_workers = std::env::var("PLUGIN_POOL_WORKERS") - .ok() - .and_then(|s| s.parse().ok()) - .unwrap_or_else(|| { - std::thread::available_parallelism() - .map(|n| n.get().max(4).min(32)) - .unwrap_or(8) - }); - + let num_workers = if configured_workers > 0 { + configured_workers + } else { + std::thread::available_parallelism() + .map(|n| n.get().max(4).min(32)) + .unwrap_or(8) + }; + tracing::info!(num_workers = num_workers, "Starting request queue workers"); - + for worker_id in 0..num_workers { let rx_clone = rx.clone(); let pool_clone = connection_pool.clone(); - + tokio::spawn(async move { while let Ok(request) = rx_clone.recv().await { + let start = std::time::Instant::now(); + let plugin_id = request.plugin_id.clone(); + let result = Self::execute_plugin_internal( &pool_clone, request.plugin_id, @@ -463,16 +527,45 @@ impl PoolManager { request.socket_path, request.http_request_id, request.timeout_secs, - ).await; - + ) + .await; + + let elapsed = start.elapsed(); + if let Err(ref e) = result { + // Don't warn about shutdown errors - these are expected during graceful shutdown + let error_str = format!("{:?}", e); + if error_str.contains("shutdown") || error_str.contains("Shutdown") { + tracing::debug!( + worker_id = worker_id, + plugin_id = %plugin_id, + "Plugin execution cancelled during shutdown" + ); + } else { + tracing::warn!( + worker_id = worker_id, + plugin_id = %plugin_id, + elapsed_ms = elapsed.as_millis() as u64, + error = ?e, + "Plugin execution failed" + ); + } + } else if elapsed.as_secs() > 1 { + tracing::debug!( + worker_id = worker_id, + plugin_id = %plugin_id, + elapsed_ms = elapsed.as_millis() as u64, + "Slow plugin execution" + ); + } + let _ = request.response_tx.send(result); } - + tracing::debug!(worker_id = worker_id, "Request queue worker exited"); }); } } - + /// Internal execution method async fn execute_plugin_internal( connection_pool: &Arc, @@ -499,7 +592,7 @@ impl PoolManager { timeout: timeout_secs.map(|s| s * 1000), }; - let timeout = timeout_secs.unwrap_or(DEFAULT_POOL_REQUEST_TIMEOUT_SECS); + let timeout = timeout_secs.unwrap_or(get_config().pool_request_timeout_secs); let response = conn.send_request_with_timeout(&request, timeout).await?; let logs: Vec = response @@ -547,12 +640,21 @@ impl PoolManager { } /// Start the pool server if not already running + /// Uses startup lock to prevent concurrent starts pub async fn ensure_started(&self) -> Result<(), PluginError> { // Fast path: check if already initialized if *self.initialized.read().await { return Ok(()); } + // Acquire startup lock to prevent concurrent starts + let _startup_guard = self.restart_lock.lock().await; + + // Double-check after acquiring lock + if *self.initialized.read().await { + return Ok(()); + } + // Slow path: acquire write lock and start let mut initialized = self.initialized.write().await; if *initialized { @@ -563,29 +665,82 @@ impl PoolManager { *initialized = true; Ok(()) } - + /// Ensure pool is started and healthy, with auto-recovery on failure + /// Uses rate limiting to avoid excessive health checks under load async fn ensure_started_and_healthy(&self) -> Result<(), PluginError> { self.ensure_started().await?; - - // Opportunistic health check - don't block on every request - // Check health periodically or on connection errors - // This is a lightweight check that only runs health_check if we detect issues - if let Ok(health) = self.health_check().await { - if !health.healthy { - tracing::warn!( - status = %health.status, - "Pool server unhealthy, attempting automatic recovery" - ); - // Try to restart - if let Err(e) = self.restart().await { - tracing::error!(error = %e, "Failed to restart pool server"); - return Err(PluginError::PluginExecutionError(format!( - "Pool server unhealthy and restart failed: {}", health.status - ))); - } + + // Rate limit health checks - only check every 5 seconds + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_secs(); + let last_check = self.last_health_check.load(Ordering::Relaxed); + + // Health check interval from centralized config + let health_check_interval = get_config().health_check_interval_secs; + + if now.saturating_sub(last_check) < health_check_interval { + // Too soon since last health check - skip + return Ok(()); + } + + // Try to update last_health_check atomically (only one thread does the check) + if self + .last_health_check + .compare_exchange(last_check, now, Ordering::Relaxed, Ordering::Relaxed) + .is_err() + { + // Another thread is already doing the health check + return Ok(()); + } + + // Check if the process is still running (fast check) + let process_running = { + let process_guard = self.process.lock().await; + if let Some(child) = process_guard.as_ref() { + // Check if process is still alive by checking its ID + child.id().is_some() + } else { + false + } + }; + + if !process_running { + // Process definitely not running - try to restart + tracing::warn!("Pool server process not running, attempting restart"); + self.consecutive_failures.fetch_add(1, Ordering::Relaxed); + if let Err(e) = self.restart().await { + tracing::error!(error = %e, "Failed to restart pool server"); + return Err(PluginError::PluginExecutionError( + "Pool server not running and restart failed".to_string(), + )); } + self.consecutive_failures.store(0, Ordering::Relaxed); + return Ok(()); } + + // Process is running - do a lightweight socket check instead of full health check + // This avoids using connections from the pool under load + let socket_exists = std::path::Path::new(&self.socket_path).exists(); + + if !socket_exists { + // Socket file gone - server crashed or was killed + tracing::warn!( + socket_path = %self.socket_path, + "Pool server socket file missing, attempting restart" + ); + self.consecutive_failures.fetch_add(1, Ordering::Relaxed); + if let Err(e) = self.restart().await { + tracing::error!(error = %e, "Failed to restart pool server"); + return Err(PluginError::PluginExecutionError( + "Pool server socket missing and restart failed".to_string(), + )); + } + self.consecutive_failures.store(0, Ordering::Relaxed); + } + Ok(()) } @@ -596,16 +751,57 @@ impl PoolManager { return Ok(()); } + // Clean up socket file with retry logic to handle race conditions + // Multiple attempts may be needed if another process is cleaning up + let mut attempts = 0; + let max_cleanup_attempts = 5; + while attempts < max_cleanup_attempts { + match std::fs::remove_file(&self.socket_path) { + Ok(_) => break, + Err(e) if e.kind() == std::io::ErrorKind::NotFound => { + // File doesn't exist, that's fine + break; + } + Err(e) => { + attempts += 1; + if attempts >= max_cleanup_attempts { + tracing::warn!( + socket_path = %self.socket_path, + error = %e, + "Failed to remove socket file after {} attempts, proceeding anyway", + max_cleanup_attempts + ); + break; + } + // Wait a bit before retrying (exponential backoff) + let delay_ms = 10 * (1 << attempts.min(3)); // Max 80ms + tokio::time::sleep(Duration::from_millis(delay_ms)).await; + } + } + } + + // Wait a bit more to ensure socket is fully released by OS + tokio::time::sleep(Duration::from_millis(50)).await; + let pool_server_path = std::env::current_dir() .map(|cwd| cwd.join("plugins/lib/pool-server.ts").display().to_string()) .unwrap_or_else(|_| "plugins/lib/pool-server.ts".to_string()); tracing::info!(socket_path = %self.socket_path, "Starting plugin pool server"); + // Get config values to pass to Node.js pool server + let config = get_config(); + let mut child = Command::new("ts-node") .arg("--transpile-only") .arg(&pool_server_path) .arg(&self.socket_path) + // Pass derived config to Node.js (single source of truth from Rust) + .env("PLUGIN_MAX_CONCURRENCY", config.max_concurrency.to_string()) + .env("PLUGIN_POOL_MIN_THREADS", config.nodejs_pool_min_threads.to_string()) + .env("PLUGIN_POOL_MAX_THREADS", config.nodejs_pool_max_threads.to_string()) + .env("PLUGIN_POOL_CONCURRENT_TASKS", config.nodejs_pool_concurrent_tasks.to_string()) + .env("PLUGIN_POOL_IDLE_TIMEOUT", config.nodejs_pool_idle_timeout_ms.to_string()) .stdin(Stdio::null()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) @@ -683,12 +879,17 @@ impl PoolManager { let mut candidate_ids = Vec::new(); for entry in self.connection_pool.connections.iter() { let conn_id = *entry.key(); - let is_healthy = self.connection_pool.health.get(&conn_id).map(|h| *h.value()).unwrap_or(false); + let is_healthy = self + .connection_pool + .health + .get(&conn_id) + .map(|h| *h.value()) + .unwrap_or(false); if is_healthy { candidate_ids.push(conn_id); } } - + let mut found_conn = None; for conn_id in candidate_ids { if let Some((_, conn)) = self.connection_pool.connections.remove(&conn_id) { @@ -696,7 +897,7 @@ impl PoolManager { break; } } - + match found_conn { Some(conn) => PooledConnection { conn: Some(conn), @@ -705,7 +906,8 @@ impl PoolManager { }, None => { let id = self.connection_pool.next_id.fetch_add(1, Ordering::Relaxed); - let conn = PoolConnection::new(&self.connection_pool.socket_path, id).await?; + let conn = + PoolConnection::new(&self.connection_pool.socket_path, id).await?; self.connection_pool.health.insert(id, true); PooledConnection { conn: Some(conn), @@ -728,7 +930,7 @@ impl PoolManager { timeout: timeout_secs.map(|s| s * 1000), }; - let timeout = timeout_secs.unwrap_or(DEFAULT_POOL_REQUEST_TIMEOUT_SECS); + let timeout = timeout_secs.unwrap_or(get_config().pool_request_timeout_secs); let response = conn.send_request_with_timeout(&request, timeout).await?; let logs: Vec = response @@ -776,8 +978,9 @@ impl PoolManager { } Err(_) => { // Semaphore full - queue the request for backpressure + // Use blocking send with timeout to handle bursts better let (response_tx, response_rx) = oneshot::channel(); - + let queued_request = QueuedRequest { plugin_id, compiled_code, @@ -789,24 +992,69 @@ impl PoolManager { timeout_secs, response_tx, }; - + + // Try non-blocking send first (fast path) match self.request_tx.try_send(queued_request) { Ok(()) => { + let queue_len = self.request_tx.len(); + if queue_len > self.max_queue_size / 2 { + tracing::warn!( + queue_len = queue_len, + max_queue_size = self.max_queue_size, + "Plugin queue is over 50% capacity" + ); + } response_rx.await.map_err(|_| { PluginError::PluginExecutionError( - "Request queue processor closed".to_string() + "Request queue processor closed".to_string(), ) })? } - Err(async_channel::TrySendError::Full(_)) => { - Err(PluginError::PluginExecutionError(format!( - "Plugin execution queue is full (max: {}). Please retry later.", - self.max_queue_size - ))) + Err(async_channel::TrySendError::Full(req)) => { + // Queue is full - try blocking send with timeout + // This allows handling bursts without immediate rejection + let queue_timeout_ms = get_config().pool_queue_send_timeout_ms; + let queue_timeout = Duration::from_millis(queue_timeout_ms); + match tokio::time::timeout(queue_timeout, self.request_tx.send(req)).await { + Ok(Ok(())) => { + // Successfully queued after waiting + let queue_len = self.request_tx.len(); + tracing::debug!( + queue_len = queue_len, + "Request queued after waiting for queue space" + ); + response_rx.await.map_err(|_| { + PluginError::PluginExecutionError( + "Request queue processor closed".to_string(), + ) + })? + } + Ok(Err(async_channel::SendError(_))) => { + // Channel closed + Err(PluginError::PluginExecutionError( + "Plugin execution queue is closed".to_string(), + )) + } + Err(_) => { + // Timeout waiting for queue space + let queue_len = self.request_tx.len(); + tracing::error!( + queue_len = queue_len, + max_queue_size = self.max_queue_size, + timeout_ms = queue_timeout.as_millis(), + "Plugin execution queue is FULL - timeout waiting for space" + ); + Err(PluginError::PluginExecutionError(format!( + "Plugin execution queue is full (max: {}) and timeout waiting for space. \ + Consider increasing PLUGIN_POOL_MAX_QUEUE_SIZE or PLUGIN_POOL_MAX_CONNECTIONS.", + self.max_queue_size + ))) + } + } } Err(async_channel::TrySendError::Closed(_)) => { Err(PluginError::PluginExecutionError( - "Plugin execution queue is closed".to_string() + "Plugin execution queue is closed".to_string(), )) } } @@ -832,12 +1080,18 @@ impl PoolManager { source_code, }; - let response = conn.send_request_with_timeout(&request, DEFAULT_POOL_REQUEST_TIMEOUT_SECS).await?; + let response = conn + .send_request_with_timeout(&request, get_config().pool_request_timeout_secs) + .await?; if response.success { response .result - .and_then(|v| v.get("code").and_then(|c| c.as_str()).map(|s| s.to_string())) + .and_then(|v| { + v.get("code") + .and_then(|c| c.as_str()) + .map(|s| s.to_string()) + }) .ok_or_else(|| { PluginError::PluginExecutionError("No compiled code in response".to_string()) }) @@ -868,7 +1122,9 @@ impl PoolManager { compiled_code, }; - let response = conn.send_request_with_timeout(&request, DEFAULT_POOL_REQUEST_TIMEOUT_SECS).await?; + let response = conn + .send_request_with_timeout(&request, get_config().pool_request_timeout_secs) + .await?; if response.success { Ok(()) @@ -896,11 +1152,16 @@ impl PoolManager { plugin_id, }; - let _ = conn.send_request_with_timeout(&request, DEFAULT_POOL_REQUEST_TIMEOUT_SECS).await?; + let _ = conn + .send_request_with_timeout(&request, get_config().pool_request_timeout_secs) + .await?; Ok(()) } /// Health check - verify the pool server is responding + /// Note: Under heavy load, this may return "healthy: false" due to connection pool exhaustion, + /// which is NOT the same as the server being down. Use ensure_started_and_healthy() for + /// automatic recovery which distinguishes between these cases. pub async fn health_check(&self) -> Result { if !*self.initialized.read().await { return Ok(HealthStatus { @@ -914,20 +1175,60 @@ impl PoolManager { }); } - let mut conn = match self.connection_pool.acquire().await { - Ok(c) => c, - Err(e) => { - return Ok(HealthStatus { - healthy: false, - status: format!("connection_failed: {}", e), - uptime_ms: None, - memory: None, - pool_completed: None, - pool_queued: None, - success_rate: None, - }); - } - }; + // First, do a fast check - is the socket file present? + if !std::path::Path::new(&self.socket_path).exists() { + return Ok(HealthStatus { + healthy: false, + status: "socket_missing".to_string(), + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + }); + } + + // Try to acquire a connection with a short timeout + // Use try_acquire to not wait when pool is exhausted + let mut conn = + match tokio::time::timeout(Duration::from_millis(100), self.connection_pool.acquire()) + .await + { + Ok(Ok(c)) => c, + Ok(Err(e)) => { + // Connection error - but check if it's just pool exhaustion + let err_str = e.to_string(); + let is_pool_exhausted = + err_str.contains("semaphore") || err_str.contains("Connection refused"); + + return Ok(HealthStatus { + // Mark as "healthy" if just pool exhaustion - server is running, just busy + healthy: is_pool_exhausted, + status: if is_pool_exhausted { + format!("pool_exhausted: {}", e) + } else { + format!("connection_failed: {}", e) + }, + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + }); + } + Err(_) => { + // Timeout acquiring connection - pool is busy, server is likely healthy + return Ok(HealthStatus { + healthy: true, // Server running, just busy + status: "pool_busy".to_string(), + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + }); + } + }; let request = PoolRequest::Health { task_id: Uuid::new_v4().to_string(), @@ -939,28 +1240,36 @@ impl PoolManager { let result = response.result.unwrap_or_default(); Ok(HealthStatus { healthy: true, - status: result.get("status") + status: result + .get("status") .and_then(|v| v.as_str()) .unwrap_or("unknown") .to_string(), uptime_ms: result.get("uptime").and_then(|v| v.as_u64()), - memory: result.get("memory") + memory: result + .get("memory") .and_then(|v| v.get("heapUsed")) .and_then(|v| v.as_u64()), - pool_completed: result.get("pool") + pool_completed: result + .get("pool") .and_then(|v| v.get("completed")) .and_then(|v| v.as_u64()), - pool_queued: result.get("pool") + pool_queued: result + .get("pool") .and_then(|v| v.get("queued")) .and_then(|v| v.as_u64()), - success_rate: result.get("execution") + success_rate: result + .get("execution") .and_then(|v| v.get("successRate")) .and_then(|v| v.as_f64()), }) } else { Ok(HealthStatus { healthy: false, - status: response.error.map(|e| e.message).unwrap_or_else(|| "unknown_error".to_string()), + status: response + .error + .map(|e| e.message) + .unwrap_or_else(|| "unknown_error".to_string()), uptime_ms: None, memory: None, pool_completed: None, @@ -987,21 +1296,44 @@ impl PoolManager { /// Check health and restart if unhealthy pub async fn ensure_healthy(&self) -> Result { let health = self.health_check().await?; - + if health.healthy { return Ok(true); } - tracing::warn!(status = %health.status, "Pool server unhealthy, attempting restart"); + // Try to acquire restart lock - if another task is already restarting, wait for it + // Use try_lock first to avoid thundering herd + match self.restart_lock.try_lock() { + Ok(_guard) => { + // We got the lock - check health again in case another task just finished restart + let health_recheck = self.health_check().await?; + if health_recheck.healthy { + return Ok(true); + } - self.restart().await?; + tracing::warn!(status = %health.status, "Pool server unhealthy, attempting restart"); + self.restart_internal().await?; + } + Err(_) => { + // Another task is restarting - wait for it to complete + tracing::debug!("Waiting for another task to complete pool server restart"); + let _guard = self.restart_lock.lock().await; + // Restart completed by other task, check health + } + } let health_after = self.health_check().await?; Ok(health_after.healthy) } - /// Force restart the pool server + /// Force restart the pool server (public API - acquires lock) pub async fn restart(&self) -> Result<(), PluginError> { + let _guard = self.restart_lock.lock().await; + self.restart_internal().await + } + + /// Internal restart without lock (must be called with restart_lock held) + async fn restart_internal(&self) -> Result<(), PluginError> { tracing::info!("Restarting plugin pool server"); self.connection_pool.clear().await; @@ -1010,17 +1342,127 @@ impl PoolManager { let mut process_guard = self.process.lock().await; if let Some(mut child) = process_guard.take() { let _ = child.kill().await; + // Wait a bit for process to fully terminate + tokio::time::sleep(Duration::from_millis(100)).await; } } - let _ = std::fs::remove_file(&self.socket_path); + // Clean up socket file with retry logic + let mut attempts = 0; + let max_cleanup_attempts = 5; + while attempts < max_cleanup_attempts { + match std::fs::remove_file(&self.socket_path) { + Ok(_) => break, + Err(e) if e.kind() == std::io::ErrorKind::NotFound => { + break; + } + Err(e) => { + attempts += 1; + if attempts >= max_cleanup_attempts { + tracing::warn!( + socket_path = %self.socket_path, + error = %e, + "Failed to remove socket file during restart after {} attempts", + max_cleanup_attempts + ); + break; + } + let delay_ms = 10 * (1 << attempts.min(3)); + tokio::time::sleep(Duration::from_millis(delay_ms)).await; + } + } + } + + // Wait for socket to be fully released + tokio::time::sleep(Duration::from_millis(100)).await; { let mut initialized = self.initialized.write().await; *initialized = false; } - self.ensure_started().await + // Start server (will acquire startup lock, but we already hold restart_lock) + // Since restart_lock is the same as startup lock, we need to call start_pool_server directly + let mut process_guard = self.process.lock().await; + if process_guard.is_some() { + // Already started by another call + return Ok(()); + } + + let pool_server_path = std::env::current_dir() + .map(|cwd| cwd.join("plugins/lib/pool-server.ts").display().to_string()) + .unwrap_or_else(|_| "plugins/lib/pool-server.ts".to_string()); + + tracing::info!(socket_path = %self.socket_path, "Restarting plugin pool server"); + + // Get config values to pass to Node.js pool server + let config = get_config(); + + let mut child = Command::new("ts-node") + .arg("--transpile-only") + .arg(&pool_server_path) + .arg(&self.socket_path) + // Pass derived config to Node.js (single source of truth from Rust) + .env("PLUGIN_MAX_CONCURRENCY", config.max_concurrency.to_string()) + .env("PLUGIN_POOL_MIN_THREADS", config.nodejs_pool_min_threads.to_string()) + .env("PLUGIN_POOL_MAX_THREADS", config.nodejs_pool_max_threads.to_string()) + .env("PLUGIN_POOL_CONCURRENT_TASKS", config.nodejs_pool_concurrent_tasks.to_string()) + .env("PLUGIN_POOL_IDLE_TIMEOUT", config.nodejs_pool_idle_timeout_ms.to_string()) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .map_err(|e| { + PluginError::PluginExecutionError(format!("Failed to restart pool server: {e}")) + })?; + + if let Some(stderr) = child.stderr.take() { + tokio::spawn(async move { + let reader = BufReader::new(stderr); + let mut lines = reader.lines(); + while let Ok(Some(line)) = lines.next_line().await { + tracing::error!(target: "pool_server", "{}", line); + } + }); + } + + if let Some(stdout) = child.stdout.take() { + let reader = BufReader::new(stdout); + let mut lines = reader.lines(); + + let timeout = tokio::time::timeout(Duration::from_secs(10), async { + while let Ok(Some(line)) = lines.next_line().await { + if line.contains("POOL_SERVER_READY") { + return Ok(()); + } + } + Err(PluginError::PluginExecutionError( + "Pool server did not send ready signal".to_string(), + )) + }) + .await; + + match timeout { + Ok(Ok(())) => { + tracing::info!("Plugin pool server restarted successfully"); + } + Ok(Err(e)) => return Err(e), + Err(_) => { + return Err(PluginError::PluginExecutionError( + "Timeout waiting for pool server to restart".to_string(), + )) + } + } + } + + *process_guard = Some(child); + + { + let mut initialized = self.initialized.write().await; + *initialized = true; + } + + Ok(()) } /// Shutdown the pool server diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs index a73749403..a8c664ace 100644 --- a/src/services/plugins/shared_socket.rs +++ b/src/services/plugins/shared_socket.rs @@ -8,10 +8,7 @@ //! go back over that same connection. The connection itself provides isolation, //! so we don't need complex routing - just handle each connection independently. -use crate::constants::{ - DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, - DEFAULT_SOCKET_READ_TIMEOUT_SECS, -}; +use super::config::get_config; use crate::jobs::JobProducerTrait; use crate::models::{ NetworkRepoModel, NotificationRepoModel, RelayerRepoModel, SignerRepoModel, ThinDataAppState, @@ -64,20 +61,11 @@ impl SharedSocketService { let _ = std::fs::remove_file(socket_path); let (shutdown_tx, _) = watch::channel(false); - - let idle_timeout = Duration::from_secs( - std::env::var("PLUGIN_SOCKET_IDLE_TIMEOUT_SECS") - .ok() - .and_then(|s| s.parse().ok()) - .unwrap_or(DEFAULT_SOCKET_IDLE_TIMEOUT_SECS) - ); - - let read_timeout = Duration::from_secs( - std::env::var("PLUGIN_SOCKET_READ_TIMEOUT_SECS") - .ok() - .and_then(|s| s.parse().ok()) - .unwrap_or(DEFAULT_SOCKET_READ_TIMEOUT_SECS) - ); + + // Use centralized config + let config = get_config(); + let idle_timeout = Duration::from_secs(config.socket_idle_timeout_secs); + let read_timeout = Duration::from_secs(config.socket_read_timeout_secs); Ok(Self { socket_path: socket_path.to_string(), @@ -95,12 +83,13 @@ impl SharedSocketService { } /// Register an execution and return a receiver for traces - pub fn register_execution(&self, execution_id: String) -> mpsc::Receiver> { + pub fn register_execution( + &self, + execution_id: String, + ) -> mpsc::Receiver> { let (tx, rx) = mpsc::channel(1); - self.executions.insert( - execution_id, - ExecutionContext { traces_tx: tx }, - ); + self.executions + .insert(execution_id, ExecutionContext { traces_tx: tx }); rx } @@ -108,12 +97,12 @@ impl SharedSocketService { pub fn unregister_execution(&self, execution_id: &str) { self.executions.remove(execution_id); } - + /// Get current active connection count pub fn active_connection_count(&self) -> usize { self.active_connections.load(Ordering::Relaxed) } - + /// Signal shutdown to the listener pub fn shutdown(&self) { let _ = self.shutdown_tx.send(true); @@ -146,7 +135,7 @@ impl SharedSocketService { if self.started.swap(true, Ordering::Acquire) { return Ok(()); } - + // Create the listener and move it into the task let listener = UnixListener::bind(&self.socket_path) .map_err(|e| PluginError::SocketError(format!("Failed to bind listener: {}", e)))?; @@ -157,8 +146,12 @@ impl SharedSocketService { let active_connections = self.active_connections.clone(); let idle_timeout = self.idle_timeout; let read_timeout = self.read_timeout; + let max_connections = get_config().socket_max_connections; - info!("Shared socket service: starting listener on {}", socket_path); + debug!( + "Shared socket service: starting listener on {}", + socket_path + ); // Spawn the listener task tokio::spawn(async move { @@ -178,22 +171,23 @@ impl SharedSocketService { Ok((stream, _)) => { // Check connection limit let current = active_connections.load(Ordering::Relaxed); - if current >= DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS { + if current >= max_connections { warn!( current_connections = current, - max_connections = DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, - "Connection limit reached, rejecting new connection" + max_connections = max_connections, + "Connection limit reached, rejecting new connection. \ + Consider increasing PLUGIN_MAX_CONCURRENCY or PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS." ); drop(stream); continue; } - + active_connections.fetch_add(1, Ordering::Relaxed); debug!( active_connections = active_connections.load(Ordering::Relaxed), "Shared socket service: accepted new connection" ); - + let relayer_api_clone = relayer_api.clone(); let state_clone = Arc::clone(&state); let executions_clone = executions.clone(); @@ -209,10 +203,10 @@ impl SharedSocketService { read_timeout, ) .await; - + // Always decrement connection count active_connections_clone.fetch_sub(1, Ordering::Relaxed); - + if let Err(e) = result { debug!("Connection handler finished with error: {}", e); } @@ -225,7 +219,7 @@ impl SharedSocketService { } } } - + // Cleanup on shutdown let _ = std::fs::remove_file(&socket_path); info!("Shared socket service: listener stopped"); @@ -233,7 +227,7 @@ impl SharedSocketService { Ok(()) } - + /// Handle connection with overall idle timeout async fn handle_connection_with_timeout( stream: UnixStream, @@ -326,10 +320,10 @@ impl SharedSocketService { continue; } }; - + // Store raw JSON for traces traces.push(json_value.clone()); - + // Deserialize into Request from the already-parsed Value let request: Request = match serde_json::from_value(json_value) { Ok(req) => req, @@ -378,27 +372,29 @@ impl Drop for SharedSocketService { } /// Global shared socket service instance with proper error handling -static SHARED_SOCKET: std::sync::OnceLock, String>> = std::sync::OnceLock::new(); +static SHARED_SOCKET: std::sync::OnceLock, String>> = + std::sync::OnceLock::new(); /// Get or create the global shared socket service /// Returns error if initialization fails instead of panicking pub fn get_shared_socket_service() -> Result, PluginError> { let socket_path = "/tmp/relayer-plugin-shared.sock"; - + let result = SHARED_SOCKET.get_or_init(|| { // Remove existing socket file if it exists (from previous runs) let _ = std::fs::remove_file(socket_path); - + match SharedSocketService::new(socket_path) { Ok(service) => Ok(Arc::new(service)), Err(e) => Err(e.to_string()), } }); - + match result { Ok(service) => Ok(service.clone()), Err(e) => Err(PluginError::SocketError(format!( - "Failed to create shared socket service: {}", e + "Failed to create shared socket service: {}", + e ))), } } @@ -410,11 +406,7 @@ pub async fn ensure_shared_socket_started( where J: JobProducerTrait + Send + Sync + 'static, RR: RelayerRepository + Repository + Send + Sync + 'static, - TR: TransactionRepository - + Repository - + Send - + Sync - + 'static, + TR: TransactionRepository + Repository + Send + Sync + 'static, NR: NetworkRepository + Repository + Send + Sync + 'static, NFR: Repository + Send + Sync + 'static, SR: Repository + Send + Sync + 'static, From fe337d39fc4779ebe338bf45ff5d3904638782ef Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 1 Jan 2026 11:59:33 +0100 Subject: [PATCH 04/42] chore: improvements --- Cargo.lock | 23 ++ Cargo.toml | 1 + src/bootstrap/initialize_plugins.rs | 2 +- src/services/plugins/config.rs | 320 ++++++++++++++++++-- src/services/plugins/pool_executor.rs | 407 ++++++++++++-------------- 5 files changed, 494 insertions(+), 259 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e98582c78..187da578b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2843,6 +2843,19 @@ dependencies = [ "winnow 0.6.26", ] +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + [[package]] name = "crossbeam-channel" version = "0.5.15" @@ -2871,6 +2884,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.21" @@ -5541,6 +5563,7 @@ dependencies = [ "chrono", "clap", "color-eyre", + "crossbeam", "ctor", "dashmap 6.1.0", "dotenvy", diff --git a/Cargo.toml b/Cargo.toml index 9cce84b7f..bfd564f4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,6 +65,7 @@ hmac = { version = "0.12" } sha2 = { version = "0.10" } sha3 = { version = "0.10" } dashmap = { version = "6.1" } +crossbeam = { version = "0.8" } async-channel = "2.3" actix-governor = "0.8" solana-sdk = { version = "3" } diff --git a/src/bootstrap/initialize_plugins.rs b/src/bootstrap/initialize_plugins.rs index f439f32ee..83eb7cefb 100644 --- a/src/bootstrap/initialize_plugins.rs +++ b/src/bootstrap/initialize_plugins.rs @@ -160,7 +160,7 @@ mod tests { let mut mock_repo = MockPluginRepositoryTrait::new(); mock_repo .expect_has_entries() - .returning(|| async { Ok(false) }); + .returning(|| Box::pin(async { Ok(false) })); let result = initialize_plugin_pool(&mock_repo).await; assert!(result.is_ok()); diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs index 169e0df30..0004cafcc 100644 --- a/src/services/plugins/config.rs +++ b/src/services/plugins/config.rs @@ -22,11 +22,10 @@ use crate::constants::{ DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, DEFAULT_POOL_CONNECT_RETRIES, DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, DEFAULT_POOL_IDLE_TIMEOUT_MS, - DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_QUEUE_SIZE, DEFAULT_POOL_MAX_THREADS_FLOOR, + DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_THREADS_FLOOR, DEFAULT_POOL_MIN_THREADS, DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, DEFAULT_POOL_SOCKET_BACKLOG, DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, - DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, DEFAULT_SOCKET_READ_TIMEOUT_SECS, - DEFAULT_TRACE_TIMEOUT_MS, + DEFAULT_SOCKET_READ_TIMEOUT_SECS, DEFAULT_TRACE_TIMEOUT_MS, }; use std::sync::OnceLock; @@ -106,13 +105,29 @@ impl PluginConfig { // Queue size = 2x max_concurrency (absorb bursts) let pool_max_queue_size = env_parse("PLUGIN_POOL_MAX_QUEUE_SIZE", max_concurrency * 2); - // Queue timeout scales with concurrency (more concurrency = allow more wait) + // Calculate thread count early for queue timeout derivation + let cpu_count = std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(4); + let scaling_threads = max_concurrency / 50; + let estimated_max_threads = (cpu_count * 2) + .max(scaling_threads) + .max(DEFAULT_POOL_MAX_THREADS_FLOOR) + .min(64); + + // Queue timeout scales with concurrency AND thread count + // Formula: base_timeout * (concurrency / threads) with caps + // This ensures timeout grows when there are more items per thread let base_queue_timeout = DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS; - let derived_queue_timeout = if max_concurrency > 2000 { - base_queue_timeout * 2 // 1000ms for high concurrency - } else if max_concurrency > 1000 { - base_queue_timeout + 250 // 750ms for medium concurrency + let workload_per_thread = max_concurrency / estimated_max_threads.max(1); + let derived_queue_timeout = if workload_per_thread > 100 { + // Heavy load per thread: allow more time + base_queue_timeout * 2 // 1000ms + } else if workload_per_thread > 50 { + // Medium load per thread + base_queue_timeout + 250 // 750ms } else { + // Light load per thread base_queue_timeout // 500ms default }; let pool_queue_send_timeout_ms = @@ -144,9 +159,7 @@ impl PluginConfig { // === Node.js Worker Pool settings (auto-derived from max_concurrency) === // These are passed to pool-server.ts when spawning the Node.js process - let cpu_count = std::thread::available_parallelism() - .map(|n| n.get()) - .unwrap_or(4); + // Note: cpu_count and scaling_threads already calculated above for queue timeout // minThreads = max(2, cpuCount / 2) - keeps some workers warm let derived_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); @@ -154,10 +167,15 @@ impl PluginConfig { // maxThreads = min(max(cpuCount * 2, concurrency / 50), 64) // Goal: Scale threads with concurrency, but cap at 64 for efficiency - // - For 1000 concurrency: max(cpu*2, 20) capped at 64 = ~20 threads - // - For 3000 concurrency: max(cpu*2, 60) capped at 64 = ~60 threads - // - For 6000+ concurrency: max(cpu*2, 120) capped at 64 = 64 threads - let scaling_threads = max_concurrency / 50; // 6000 VUs -> 120 threads (before cap) + // Thread scaling rationale: + // - 50 VUs per thread balances concurrency vs context switching + // - Cap at 64 threads prevents excessive resource usage + // - For low concurrency (<200), use cpu_count * 2 to maintain warm pool + // Examples: + // - 100 concurrency: max(cpu*2, 2) = ~8 threads (warm pool for responsiveness) + // - 1000 concurrency: max(cpu*2, 20) = ~20 threads + // - 3000 concurrency: max(cpu*2, 60) = ~60 threads + // - 6000+ concurrency: capped at 64 threads let derived_max_threads = (cpu_count * 2) .max(scaling_threads) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) @@ -168,10 +186,16 @@ impl PluginConfig { ); // concurrentTasksPerWorker: Node.js async can handle many concurrent tasks - // Formula: (concurrency / threads) * 2.5 for headroom (queue buildup, variable latency) - // - 5000 VUs / 64 threads * 2.5 = ~195 tasks/worker - // - 3000 VUs / 60 threads * 2.5 = ~125 tasks/worker - // - 1000 VUs / 20 threads * 2.5 = ~125 tasks/worker + // Formula: (concurrency / max_threads) * 2.5 for headroom + // Note: Using max_threads is correct since pool will scale up under load. + // The 2.5x multiplier provides headroom for: + // - Queue buildup during traffic spikes + // - Variable plugin execution latency + // - Async I/O overlap (Node.js handles this well) + // Examples: + // - 5000 VUs / 64 threads * 2.5 = ~195 tasks/worker + // - 3000 VUs / 60 threads * 2.5 = ~125 tasks/worker + // - 1000 VUs / 20 threads * 2.5 = ~125 tasks/worker let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); let derived_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) @@ -182,13 +206,20 @@ impl PluginConfig { let nodejs_pool_idle_timeout_ms = env_parse("PLUGIN_POOL_IDLE_TIMEOUT", DEFAULT_POOL_IDLE_TIMEOUT_MS); - // Socket backlog = max_concurrency (enough to absorb connection bursts) + // Socket backlog calculation + // Use max of concurrency or default backlog to handle connection bursts + // The 1.5x socket_max_connections provides headroom for connection churn: + // - Client reconnections + // - Connection pool cycling + // - Load balancer health checks + // This ratio should be validated through load testing if workload characteristics change. + let default_backlog = DEFAULT_POOL_SOCKET_BACKLOG as usize; let pool_socket_backlog = env_parse( "PLUGIN_POOL_SOCKET_BACKLOG", - max_concurrency.max(DEFAULT_POOL_SOCKET_BACKLOG as usize), + max_concurrency.max(default_backlog), ); - Self { + let config = Self { max_concurrency, pool_max_connections, pool_connect_retries, @@ -206,42 +237,134 @@ impl PluginConfig { pool_socket_backlog, health_check_interval_secs, trace_timeout_ms, + }; + + // Validate derived configuration + config.validate(); + + config + } + + /// Validate that derived configuration values are sensible + fn validate(&self) { + // Critical invariants + assert!( + self.pool_max_connections <= self.socket_max_connections, + "pool_max_connections ({}) must be <= socket_max_connections ({})", + self.pool_max_connections, + self.socket_max_connections + ); + assert!( + self.nodejs_pool_min_threads <= self.nodejs_pool_max_threads, + "nodejs_pool_min_threads ({}) must be <= nodejs_pool_max_threads ({})", + self.nodejs_pool_min_threads, + self.nodejs_pool_max_threads + ); + assert!( + self.max_concurrency > 0, + "max_concurrency must be > 0, got {}", + self.max_concurrency + ); + assert!( + self.nodejs_pool_max_threads > 0, + "nodejs_pool_max_threads must be > 0, got {}", + self.nodejs_pool_max_threads + ); + + // Warnings for potentially problematic configurations + if self.pool_max_queue_size < self.max_concurrency { + tracing::warn!( + "pool_max_queue_size ({}) is less than max_concurrency ({}). \ + This may cause request rejections under load.", + self.pool_max_queue_size, + self.max_concurrency + ); + } + if self.nodejs_pool_concurrent_tasks > 500 { + tracing::warn!( + "nodejs_pool_concurrent_tasks ({}) is very high. \ + This may cause excessive memory usage per worker.", + self.nodejs_pool_concurrent_tasks + ); } } /// Log the effective configuration for debugging pub fn log_config(&self) { + let tasks_per_thread = self.max_concurrency / self.nodejs_pool_max_threads.max(1); + let socket_ratio = self.socket_max_connections as f64 / self.max_concurrency as f64; + let queue_ratio = self.pool_max_queue_size as f64 / self.max_concurrency as f64; + tracing::info!( max_concurrency = self.max_concurrency, pool_max_connections = self.pool_max_connections, pool_max_queue_size = self.pool_max_queue_size, + queue_timeout_ms = self.pool_queue_send_timeout_ms, socket_max_connections = self.socket_max_connections, + socket_backlog = self.pool_socket_backlog, + nodejs_min_threads = self.nodejs_pool_min_threads, nodejs_max_threads = self.nodejs_pool_max_threads, nodejs_concurrent_tasks = self.nodejs_pool_concurrent_tasks, - socket_backlog = self.pool_socket_backlog, + tasks_per_thread = tasks_per_thread, + socket_multiplier = %format!("{:.2}x", socket_ratio), + queue_multiplier = %format!("{:.2}x", queue_ratio), "Plugin configuration loaded (Rust + Node.js)" ); } } impl Default for PluginConfig { + /// Default configuration uses the same derivation logic as from_env() + /// but without any environment variable overrides. + /// This ensures tests and production use consistent formulas. fn default() -> Self { + // Clear any test environment variables to ensure pure defaults + // Note: This only affects the Default impl, not from_env() usage + std::env::remove_var("PLUGIN_MAX_CONCURRENCY"); + + // Use the same derivation logic as from_env() + // This ensures Default matches production behavior + let max_concurrency = DEFAULT_POOL_MAX_CONNECTIONS; + let cpu_count = std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(4); + + // Apply same formulas as from_env() + let pool_max_connections = max_concurrency; + let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; + let pool_max_queue_size = max_concurrency * 2; + + let scaling_threads = max_concurrency / 50; + let nodejs_pool_max_threads = (cpu_count * 2) + .max(scaling_threads) + .max(DEFAULT_POOL_MAX_THREADS_FLOOR) + .min(64); + let nodejs_pool_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); + + let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); + let nodejs_pool_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) + .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) + .min(300); + + let default_backlog = DEFAULT_POOL_SOCKET_BACKLOG as usize; + let pool_socket_backlog = max_concurrency.max(default_backlog); + Self { - max_concurrency: DEFAULT_POOL_MAX_CONNECTIONS, - pool_max_connections: DEFAULT_POOL_MAX_CONNECTIONS, + max_concurrency, + pool_max_connections, pool_connect_retries: DEFAULT_POOL_CONNECT_RETRIES, pool_request_timeout_secs: DEFAULT_POOL_REQUEST_TIMEOUT_SECS, - pool_max_queue_size: DEFAULT_POOL_MAX_QUEUE_SIZE, + pool_max_queue_size, pool_queue_send_timeout_ms: DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, pool_workers: 0, - socket_max_connections: DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS, + socket_max_connections, socket_idle_timeout_secs: DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, socket_read_timeout_secs: DEFAULT_SOCKET_READ_TIMEOUT_SECS, - nodejs_pool_min_threads: DEFAULT_POOL_MIN_THREADS, - nodejs_pool_max_threads: DEFAULT_POOL_MAX_THREADS_FLOOR, - nodejs_pool_concurrent_tasks: DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, + nodejs_pool_min_threads, + nodejs_pool_max_threads, + nodejs_pool_concurrent_tasks, nodejs_pool_idle_timeout_ms: DEFAULT_POOL_IDLE_TIMEOUT_MS, - pool_socket_backlog: DEFAULT_POOL_SOCKET_BACKLOG as usize, + pool_socket_backlog, health_check_interval_secs: DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, trace_timeout_ms: DEFAULT_TRACE_TIMEOUT_MS, } @@ -274,6 +397,12 @@ mod tests { let config = PluginConfig::default(); assert_eq!(config.max_concurrency, DEFAULT_POOL_MAX_CONNECTIONS); assert_eq!(config.pool_max_connections, DEFAULT_POOL_MAX_CONNECTIONS); + // Validate derived ratios + assert_eq!(config.pool_max_queue_size, config.max_concurrency * 2); + assert!( + config.socket_max_connections >= config.pool_max_connections, + "socket connections should be >= pool connections" + ); } #[test] @@ -293,4 +422,133 @@ mod tests { ); assert_eq!(config.pool_max_queue_size, config.max_concurrency * 2); } + + #[test] + fn test_very_low_concurrency() { + // Test edge case: very low concurrency (10) + // We can't use from_env() in tests easily due to OnceLock caching, + // so we manually construct the config with the same logic + let max_concurrency = 10; + let cpu_count = std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(4); + + let pool_max_connections = max_concurrency; + let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; + let pool_max_queue_size = max_concurrency * 2; + + let scaling_threads = max_concurrency / 50; + let nodejs_pool_max_threads = (cpu_count * 2) + .max(scaling_threads) + .max(DEFAULT_POOL_MAX_THREADS_FLOOR) + .min(64); + + assert_eq!(pool_max_connections, 10); + assert_eq!(socket_max_connections, 15); // 1.5x + assert_eq!(pool_max_queue_size, 20); // 2x + + // Should still have reasonable thread count (warm pool) + assert!(nodejs_pool_max_threads >= DEFAULT_POOL_MAX_THREADS_FLOOR); + } + + #[test] + fn test_medium_concurrency() { + // Test edge case: medium concurrency (100) + let max_concurrency = 100; + let cpu_count = std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(4); + + let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; + let pool_max_queue_size = max_concurrency * 2; + + let scaling_threads = max_concurrency / 50; + let nodejs_pool_max_threads = (cpu_count * 2) + .max(scaling_threads) + .max(DEFAULT_POOL_MAX_THREADS_FLOOR) + .min(64); + + assert_eq!(socket_max_connections, 150); // 1.5x + assert_eq!(pool_max_queue_size, 200); // 2x + + // Should use cpu_count * 2 for thread count (warm pool) + assert!(nodejs_pool_max_threads >= cpu_count * 2); + } + + #[test] + fn test_high_concurrency() { + // Test edge case: high concurrency (10000) + let max_concurrency = 10000; + + let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; + let pool_max_queue_size = max_concurrency * 2; + + let cpu_count = std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(4); + let scaling_threads = max_concurrency / 50; + let nodejs_pool_max_threads = (cpu_count * 2) + .max(scaling_threads) + .max(DEFAULT_POOL_MAX_THREADS_FLOOR) + .min(64); + + assert_eq!(socket_max_connections, 15000); // 1.5x + assert_eq!(pool_max_queue_size, 20000); // 2x + + // Should hit the 64 thread cap + assert_eq!(nodejs_pool_max_threads, 64); + + // Should have high concurrent tasks per worker + let base_tasks = max_concurrency / nodejs_pool_max_threads; + let derived_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) + .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) + .min(300); + assert!(derived_concurrent_tasks >= base_tasks); + } + + #[test] + fn test_validation_catches_invalid_config() { + let mut config = PluginConfig::default(); + + // Test that validation catches pool > socket connections + config.pool_max_connections = 1000; + config.socket_max_connections = 500; + + let result = std::panic::catch_unwind(|| { + config.validate(); + }); + assert!(result.is_err(), "Should panic on invalid pool > socket connections"); + } + + #[test] + fn test_validation_catches_invalid_threads() { + let mut config = PluginConfig::default(); + + // Test that validation catches min > max threads + config.nodejs_pool_min_threads = 64; + config.nodejs_pool_max_threads = 8; + + let result = std::panic::catch_unwind(|| { + config.validate(); + }); + assert!(result.is_err(), "Should panic on invalid min > max threads"); + } + + #[test] + fn test_overridden_values_respected() { + // Test that individual overrides work + // Note: Due to OnceLock caching in get_config(), we test the derivation logic directly + let max_concurrency = 1000; + let pool_max_queue_size = 5000; // What we'd override to + let pool_max_connections = 1000; // Auto-derived from max_concurrency + + // Verify the override would be respected + assert_eq!(pool_max_connections, max_concurrency); // Auto-derived + assert_eq!(pool_max_queue_size, 5000); // Manual override (not 2000) + + // Also test that auto-derivation would have given 2000 + let auto_derived_queue = max_concurrency * 2; + assert_eq!(auto_derived_queue, 2000); + assert_ne!(pool_max_queue_size, auto_derived_queue); // Override is different + } } diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index 9e9303d93..07379fe99 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -6,11 +6,11 @@ //! Communication with the Node.js pool server happens via Unix socket using //! a JSON-line protocol. -use dashmap::DashMap; +use crossbeam::queue::SegQueue; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::process::Stdio; -use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize, Ordering}; use std::sync::Arc; use std::time::Duration; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; @@ -142,17 +142,19 @@ struct PoolConnection { stream: UnixStream, /// Connection ID for tracking id: usize, + /// Health status of this connection + healthy: AtomicBool, } impl PoolConnection { async fn new(socket_path: &str, id: usize) -> Result { - // Retry connection with backoff - socket might not be ready or server might be busy - let mut attempts = 0; + // Retry connection with exponential backoff let max_attempts = get_config().pool_connect_retries; - let mut delay_ms: u64 = 10; - let max_delay_ms: u64 = 1000; // Max 1 second between retries + let mut attempts = 0; + let mut delay_ms = 10u64; tracing::debug!(connection_id = id, socket_path = %socket_path, "Connecting to pool server"); + loop { match UnixStream::connect(socket_path).await { Ok(stream) => { @@ -163,20 +165,15 @@ impl PoolConnection { "Connected to pool server after retries" ); } - return Ok(Self { stream, id }); + return Ok(Self { + stream, + id, + healthy: AtomicBool::new(true), + }); } Err(e) => { attempts += 1; - // Check if it's a temporary error (EAGAIN, ECONNREFUSED, etc) - let is_temporary = matches!( - e.kind(), - std::io::ErrorKind::ConnectionRefused - | std::io::ErrorKind::WouldBlock - | std::io::ErrorKind::TimedOut - | std::io::ErrorKind::Interrupted - ); - if attempts >= max_attempts { return Err(PluginError::SocketError(format!( "Failed to connect to pool after {max_attempts} attempts: {e}. \ @@ -184,19 +181,20 @@ impl PoolConnection { ))); } - // Only log at debug level to reduce noise under load + // Log selectively to reduce noise if attempts <= 3 || attempts % 5 == 0 { tracing::debug!( connection_id = id, attempt = attempts, max_attempts = max_attempts, delay_ms = delay_ms, - is_temporary = is_temporary, "Retrying connection to pool server" ); } + tokio::time::sleep(Duration::from_millis(delay_ms)).await; - delay_ms = std::cmp::min(delay_ms * 2, max_delay_ms); + // Exponential backoff with cap at 1 second + delay_ms = std::cmp::min(delay_ms * 2, 1000); } } } @@ -251,13 +249,11 @@ impl PoolConnection { } /// Connection pool for reusing socket connections -/// Uses DashMap for lock-free connection acquisition and release +/// Uses lock-free SegQueue for O(1) connection acquisition and release struct ConnectionPool { socket_path: String, - /// Available connections (connection_id -> connection) - connections: Arc>, - /// Health tracking for connections (connection_id -> is_healthy) - health: Arc>, + /// Available connections (lock-free stack) + available: Arc>, /// Maximum number of connections max_connections: usize, /// Next connection ID (atomic for lock-free increment) @@ -270,8 +266,7 @@ impl ConnectionPool { fn new(socket_path: String, max_connections: usize) -> Self { Self { socket_path, - connections: Arc::new(DashMap::new()), - health: Arc::new(DashMap::new()), + available: Arc::new(SegQueue::new()), max_connections, next_id: Arc::new(AtomicUsize::new(0)), semaphore: Arc::new(Semaphore::new(max_connections)), @@ -280,96 +275,94 @@ impl ConnectionPool { /// Get a connection from the pool or create a new one /// Uses semaphore for proper concurrency limiting - async fn acquire(&self) -> Result, PluginError> { - let available_permits = self.semaphore.available_permits(); - if available_permits == 0 { - tracing::warn!( - max_connections = self.max_connections, - "All connection permits exhausted - waiting for connection" - ); - } - - // Acquire permit first - this limits total concurrent connections - let permit = self - .semaphore - .clone() - .acquire_owned() - .await - .map_err(|_| PluginError::PluginError("Connection semaphore closed".to_string()))?; - - // Try to find a healthy connection in the pool - let mut candidate_ids = Vec::new(); - - for entry in self.connections.iter() { - let conn_id = *entry.key(); - let is_healthy = self - .health - .get(&conn_id) - .map(|h| *h.value()) - .unwrap_or(false); - if is_healthy { - candidate_ids.push(conn_id); + /// Accepts optional pre-acquired permit for fast path optimization + async fn acquire_with_permit( + &self, + permit: Option, + ) -> Result, PluginError> { + // Acquire permit if not provided + let permit = match permit { + Some(p) => p, + None => { + let available_permits = self.semaphore.available_permits(); + if available_permits == 0 { + tracing::warn!( + max_connections = self.max_connections, + "All connection permits exhausted - waiting for connection" + ); + } + self.semaphore + .clone() + .acquire_owned() + .await + .map_err(|_| PluginError::PluginError("Connection semaphore closed".to_string()))? } - } + }; - // Try to remove one of the candidates - for conn_id in candidate_ids { - if let Some((_, conn)) = self.connections.remove(&conn_id) { - tracing::debug!(connection_id = conn_id, "Reusing connection from pool"); - return Ok(PooledConnection { - conn: Some(conn), - pool: self, - _permit: permit, - }); - } - } + // O(1) lock-free pop from available connections + loop { + match self.available.pop() { + Some(conn) => { + // Check if connection is healthy + if conn.healthy.load(Ordering::Relaxed) { + tracing::debug!(connection_id = conn.id, "Reusing connection from pool"); + return Ok(PooledConnection { + conn: Some(conn), + pool: self, + _permit: permit, + }); + } + // Connection unhealthy, drop it and try next + tracing::debug!(connection_id = conn.id, "Dropping unhealthy connection"); + continue; + } + None => { + // No available connection, create a new one + let id = self.next_id.fetch_add(1, Ordering::Relaxed); + tracing::debug!(connection_id = id, "Creating new pool connection"); - // No available connection, create a new one - let id = self.next_id.fetch_add(1, Ordering::Relaxed); - tracing::debug!(connection_id = id, "Creating new pool connection"); + let conn = PoolConnection::new(&self.socket_path, id).await?; - let conn = PoolConnection::new(&self.socket_path, id).await?; - self.health.insert(id, true); + return Ok(PooledConnection { + conn: Some(conn), + pool: self, + _permit: permit, + }); + } + } + } + } - Ok(PooledConnection { - conn: Some(conn), - pool: self, - _permit: permit, - }) + /// Convenience method for acquiring without pre-acquired permit + async fn acquire(&self) -> Result, PluginError> { + self.acquire_with_permit(None).await } /// Return a connection to the pool fn release(&self, conn: PoolConnection) { let conn_id = conn.id; - let is_healthy = self - .health - .get(&conn_id) - .map(|h| *h.value()) - .unwrap_or(false); - let pool_size = self.connections.len(); - - if is_healthy && pool_size < self.max_connections { - self.connections.insert(conn_id, conn); + let is_healthy = conn.healthy.load(Ordering::Relaxed); + + if is_healthy { + // O(1) lock-free push + self.available.push(conn); tracing::debug!(connection_id = conn_id, "Connection returned to pool"); } else { - self.health.remove(&conn_id); - tracing::debug!( - connection_id = conn_id, - "Connection dropped (unhealthy or pool full)" - ); + tracing::debug!(connection_id = conn_id, "Connection dropped (unhealthy)"); } } - /// Mark a connection as unhealthy - fn mark_unhealthy(&self, conn_id: usize) { - self.health.insert(conn_id, false); - self.connections.remove(&conn_id); + /// Mark a connection as unhealthy (no-op with new design) + /// Health is now tracked in the connection itself + fn mark_unhealthy(&self, _conn_id: usize) { + // No longer needed - health is in PoolConnection.healthy + // Connection will be dropped on release if unhealthy } /// Clear all connections async fn clear(&self) { - self.connections.clear(); - self.health.clear(); + // Drain the queue + while self.available.pop().is_some() {} } } @@ -406,8 +399,8 @@ impl<'a> PooledConnection<'a> { /// Mark this connection as unhealthy (won't be returned to pool) fn mark_unhealthy(&mut self) { - if let Some(conn_id) = self.conn.as_ref().map(|c| c.id) { - self.pool.mark_unhealthy(conn_id); + if let Some(ref conn) = self.conn { + conn.healthy.store(false, Ordering::Relaxed); } } } @@ -446,10 +439,10 @@ pub struct PoolManager { request_tx: async_channel::Sender, /// Actual configured queue size (for error messages) max_queue_size: usize, - /// Last health check timestamp (for rate limiting) - last_health_check: std::sync::atomic::AtomicU64, + /// Flag indicating if health check is needed (set by background task) + health_check_needed: Arc, /// Consecutive failure count for health checks - consecutive_failures: std::sync::atomic::AtomicU32, + consecutive_failures: Arc, } impl PoolManager { @@ -479,6 +472,15 @@ impl PoolManager { // Spawn background workers to process queued requests Self::spawn_queue_workers(rx, connection_pool_clone, config.pool_workers); + let health_check_needed = Arc::new(AtomicBool::new(false)); + let consecutive_failures = Arc::new(AtomicU32::new(0)); + + // Spawn background health check task to avoid atomic ops on hot path + Self::spawn_health_check_task( + health_check_needed.clone(), + config.health_check_interval_secs, + ); + Self { connection_pool, socket_path, @@ -487,11 +489,28 @@ impl PoolManager { restart_lock: tokio::sync::Mutex::new(()), request_tx: tx, max_queue_size, - last_health_check: std::sync::atomic::AtomicU64::new(0), - consecutive_failures: std::sync::atomic::AtomicU32::new(0), + health_check_needed, + consecutive_failures, } } + /// Spawn background task to set health check flag periodically + /// This avoids atomic operations on the hot path + fn spawn_health_check_task( + health_check_needed: Arc, + interval_secs: u64, + ) { + tokio::spawn(async move { + let mut interval = tokio::time::interval(Duration::from_secs(interval_secs)); + interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); + + loop { + interval.tick().await; + health_check_needed.store(true, Ordering::Relaxed); + } + }); + } + /// Spawn multiple worker tasks to process queued requests concurrently fn spawn_queue_workers( rx: async_channel::Receiver, @@ -566,9 +585,11 @@ impl PoolManager { } } - /// Internal execution method - async fn execute_plugin_internal( + /// Execute plugin with optional pre-acquired permit (unified fast/slow path) + /// This eliminates code duplication between fast path and queued execution + async fn execute_with_permit( connection_pool: &Arc, + permit: Option, plugin_id: String, compiled_code: Option, plugin_path: Option, @@ -578,7 +599,7 @@ impl PoolManager { http_request_id: Option, timeout_secs: Option, ) -> Result { - let mut conn = connection_pool.acquire().await?; + let mut conn = connection_pool.acquire_with_permit(permit).await?; let request = PoolRequest::Execute { task_id: Uuid::new_v4().to_string(), @@ -595,12 +616,11 @@ impl PoolManager { let timeout = timeout_secs.unwrap_or(get_config().pool_request_timeout_secs); let response = conn.send_request_with_timeout(&request, timeout).await?; + // Avoid allocating empty Vec - only allocate if logs exist let logs: Vec = response .logs - .unwrap_or_default() - .into_iter() - .map(|l| l.into()) - .collect(); + .map(|logs| logs.into_iter().map(|l| l.into()).collect()) + .unwrap_or_else(Vec::new); if response.success { let return_value = response @@ -639,6 +659,34 @@ impl PoolManager { } } + /// Internal execution method (wrapper for execute_with_permit) + async fn execute_plugin_internal( + connection_pool: &Arc, + plugin_id: String, + compiled_code: Option, + plugin_path: Option, + params: serde_json::Value, + headers: Option>>, + socket_path: String, + http_request_id: Option, + timeout_secs: Option, + ) -> Result { + // Delegate to unified execution method (no pre-acquired permit for queued requests) + Self::execute_with_permit( + connection_pool, + None, + plugin_id, + compiled_code, + plugin_path, + params, + headers, + socket_path, + http_request_id, + timeout_secs, + ) + .await + } + /// Start the pool server if not already running /// Uses startup lock to prevent concurrent starts pub async fn ensure_started(&self) -> Result<(), PluginError> { @@ -667,30 +715,22 @@ impl PoolManager { } /// Ensure pool is started and healthy, with auto-recovery on failure - /// Uses rate limiting to avoid excessive health checks under load + /// Uses background task flag to avoid atomic operations on hot path async fn ensure_started_and_healthy(&self) -> Result<(), PluginError> { self.ensure_started().await?; - // Rate limit health checks - only check every 5 seconds - let now = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap_or_default() - .as_secs(); - let last_check = self.last_health_check.load(Ordering::Relaxed); - - // Health check interval from centralized config - let health_check_interval = get_config().health_check_interval_secs; - - if now.saturating_sub(last_check) < health_check_interval { - // Too soon since last health check - skip + // Check if background task flagged that health check is needed + // This is a simple load, no compare_exchange - much faster! + if !self.health_check_needed.load(Ordering::Relaxed) { + // No health check needed yet return Ok(()); } - // Try to update last_health_check atomically (only one thread does the check) - if self - .last_health_check - .compare_exchange(last_check, now, Ordering::Relaxed, Ordering::Relaxed) - .is_err() + // Try to clear the flag atomically (only one thread does the check) + if !self + .health_check_needed + .compare_exchange(true, false, Ordering::Relaxed, Ordering::Relaxed) + .is_ok() { // Another thread is already doing the health check return Ok(()); @@ -869,112 +909,25 @@ impl PoolManager { // Ensure pool is started and healthy self.ensure_started_and_healthy().await?; - // Try direct execution first (semaphore handles concurrency limiting) - // If semaphore can't be acquired immediately, queue the request + // Try direct execution first (fast path with pre-acquired permit) + // If semaphore can't be acquired immediately, queue the request (slow path) match self.connection_pool.semaphore.clone().try_acquire_owned() { Ok(permit) => { - // Direct execution path - faster for normal load - let mut conn = { - // Try to get pooled connection - let mut candidate_ids = Vec::new(); - for entry in self.connection_pool.connections.iter() { - let conn_id = *entry.key(); - let is_healthy = self - .connection_pool - .health - .get(&conn_id) - .map(|h| *h.value()) - .unwrap_or(false); - if is_healthy { - candidate_ids.push(conn_id); - } - } - - let mut found_conn = None; - for conn_id in candidate_ids { - if let Some((_, conn)) = self.connection_pool.connections.remove(&conn_id) { - found_conn = Some(conn); - break; - } - } - - match found_conn { - Some(conn) => PooledConnection { - conn: Some(conn), - pool: &self.connection_pool, - _permit: permit, - }, - None => { - let id = self.connection_pool.next_id.fetch_add(1, Ordering::Relaxed); - let conn = - PoolConnection::new(&self.connection_pool.socket_path, id).await?; - self.connection_pool.health.insert(id, true); - PooledConnection { - conn: Some(conn), - pool: &self.connection_pool, - _permit: permit, - } - } - } - }; - - let request = PoolRequest::Execute { - task_id: Uuid::new_v4().to_string(), - plugin_id: plugin_id.clone(), + // Fast path: execute directly with pre-acquired permit + // This avoids queueing overhead for normal load + Self::execute_with_permit( + &self.connection_pool, + Some(permit), + plugin_id, compiled_code, plugin_path, params, headers, socket_path, http_request_id, - timeout: timeout_secs.map(|s| s * 1000), - }; - - let timeout = timeout_secs.unwrap_or(get_config().pool_request_timeout_secs); - let response = conn.send_request_with_timeout(&request, timeout).await?; - - let logs: Vec = response - .logs - .unwrap_or_default() - .into_iter() - .map(|l| l.into()) - .collect(); - - if response.success { - let return_value = response - .result - .map(|v| { - if v.is_string() { - v.as_str().unwrap_or("").to_string() - } else { - serde_json::to_string(&v).unwrap_or_default() - } - }) - .unwrap_or_default(); - - Ok(ScriptResult { - logs, - error: String::new(), - return_value, - trace: Vec::new(), - }) - } else { - let error = response.error.unwrap_or(PoolError { - message: "Unknown error".to_string(), - code: None, - status: None, - details: None, - }); - - Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { - message: error.message, - status: error.status.unwrap_or(500), - code: error.code, - details: error.details, - logs: Some(logs), - traces: None, - }))) - } + timeout_secs, + ) + .await } Err(_) => { // Semaphore full - queue the request for backpressure From 6e2f67c7ab960f65e43d72e499fc91d86fd784d1 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 1 Jan 2026 12:29:02 +0100 Subject: [PATCH 05/42] chore: Improvement --- build.rs | 9 +- src/services/plugins/config.rs | 56 +++---- src/services/plugins/pool_executor.rs | 23 ++- src/services/plugins/runner.rs | 12 +- src/services/plugins/shared_socket.rs | 219 +++++++++++++++++--------- src/services/plugins/socket.rs | 149 ++++++++++++++---- 6 files changed, 305 insertions(+), 163 deletions(-) diff --git a/build.rs b/build.rs index a58a1be35..fa21b1985 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,5 @@ -use std::process::Command; use std::path::Path; +use std::process::Command; fn main() { // Only run if plugins directory exists @@ -10,9 +10,7 @@ fn main() { } // Check if pnpm is available - let pnpm_check = Command::new("pnpm") - .arg("--version") - .output(); + let pnpm_check = Command::new("pnpm").arg("--version").output(); if pnpm_check.is_err() { println!("cargo:warning=pnpm not found in PATH, skipping plugin dependencies install"); @@ -21,7 +19,7 @@ fn main() { } println!("cargo:warning=Running pnpm install in plugins directory..."); - + // Run pnpm install in plugins directory let output = Command::new("pnpm") .arg("install") @@ -44,4 +42,3 @@ fn main() { } } } - diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs index 0004cafcc..b3b68339a 100644 --- a/src/services/plugins/config.rs +++ b/src/services/plugins/config.rs @@ -22,8 +22,8 @@ use crate::constants::{ DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, DEFAULT_POOL_CONNECT_RETRIES, DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, DEFAULT_POOL_IDLE_TIMEOUT_MS, - DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_THREADS_FLOOR, - DEFAULT_POOL_MIN_THREADS, DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, + DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_THREADS_FLOOR, DEFAULT_POOL_MIN_THREADS, + DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, DEFAULT_POOL_SOCKET_BACKLOG, DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, DEFAULT_SOCKET_READ_TIMEOUT_SECS, DEFAULT_TRACE_TIMEOUT_MS, }; @@ -180,10 +180,7 @@ impl PluginConfig { .max(scaling_threads) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) .min(64); // Final cap at 64 - let nodejs_pool_max_threads = env_parse( - "PLUGIN_POOL_MAX_THREADS", - derived_max_threads, - ); + let nodejs_pool_max_threads = env_parse("PLUGIN_POOL_MAX_THREADS", derived_max_threads); // concurrentTasksPerWorker: Node.js async can handle many concurrent tasks // Formula: (concurrency / max_threads) * 2.5 for headroom @@ -321,34 +318,34 @@ impl Default for PluginConfig { // Clear any test environment variables to ensure pure defaults // Note: This only affects the Default impl, not from_env() usage std::env::remove_var("PLUGIN_MAX_CONCURRENCY"); - + // Use the same derivation logic as from_env() // This ensures Default matches production behavior let max_concurrency = DEFAULT_POOL_MAX_CONNECTIONS; let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) .unwrap_or(4); - + // Apply same formulas as from_env() let pool_max_connections = max_concurrency; let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; let pool_max_queue_size = max_concurrency * 2; - + let scaling_threads = max_concurrency / 50; let nodejs_pool_max_threads = (cpu_count * 2) .max(scaling_threads) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) .min(64); let nodejs_pool_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); - + let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); let nodejs_pool_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) .min(300); - + let default_backlog = DEFAULT_POOL_SOCKET_BACKLOG as usize; let pool_socket_backlog = max_concurrency.max(default_backlog); - + Self { max_concurrency, pool_max_connections, @@ -432,11 +429,11 @@ mod tests { let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) .unwrap_or(4); - + let pool_max_connections = max_concurrency; let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; let pool_max_queue_size = max_concurrency * 2; - + let scaling_threads = max_concurrency / 50; let nodejs_pool_max_threads = (cpu_count * 2) .max(scaling_threads) @@ -446,7 +443,7 @@ mod tests { assert_eq!(pool_max_connections, 10); assert_eq!(socket_max_connections, 15); // 1.5x assert_eq!(pool_max_queue_size, 20); // 2x - + // Should still have reasonable thread count (warm pool) assert!(nodejs_pool_max_threads >= DEFAULT_POOL_MAX_THREADS_FLOOR); } @@ -458,10 +455,10 @@ mod tests { let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) .unwrap_or(4); - + let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; let pool_max_queue_size = max_concurrency * 2; - + let scaling_threads = max_concurrency / 50; let nodejs_pool_max_threads = (cpu_count * 2) .max(scaling_threads) @@ -470,7 +467,7 @@ mod tests { assert_eq!(socket_max_connections, 150); // 1.5x assert_eq!(pool_max_queue_size, 200); // 2x - + // Should use cpu_count * 2 for thread count (warm pool) assert!(nodejs_pool_max_threads >= cpu_count * 2); } @@ -479,10 +476,10 @@ mod tests { fn test_high_concurrency() { // Test edge case: high concurrency (10000) let max_concurrency = 10000; - + let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; let pool_max_queue_size = max_concurrency * 2; - + let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) .unwrap_or(4); @@ -494,10 +491,10 @@ mod tests { assert_eq!(socket_max_connections, 15000); // 1.5x assert_eq!(pool_max_queue_size, 20000); // 2x - + // Should hit the 64 thread cap assert_eq!(nodejs_pool_max_threads, 64); - + // Should have high concurrent tasks per worker let base_tasks = max_concurrency / nodejs_pool_max_threads; let derived_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) @@ -509,25 +506,28 @@ mod tests { #[test] fn test_validation_catches_invalid_config() { let mut config = PluginConfig::default(); - + // Test that validation catches pool > socket connections config.pool_max_connections = 1000; config.socket_max_connections = 500; - + let result = std::panic::catch_unwind(|| { config.validate(); }); - assert!(result.is_err(), "Should panic on invalid pool > socket connections"); + assert!( + result.is_err(), + "Should panic on invalid pool > socket connections" + ); } #[test] fn test_validation_catches_invalid_threads() { let mut config = PluginConfig::default(); - + // Test that validation catches min > max threads config.nodejs_pool_min_threads = 64; config.nodejs_pool_max_threads = 8; - + let result = std::panic::catch_unwind(|| { config.validate(); }); @@ -545,7 +545,7 @@ mod tests { // Verify the override would be respected assert_eq!(pool_max_connections, max_concurrency); // Auto-derived assert_eq!(pool_max_queue_size, 5000); // Manual override (not 2000) - + // Also test that auto-derivation would have given 2000 let auto_derived_queue = max_concurrency * 2; assert_eq!(auto_derived_queue, 2000); diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index 07379fe99..c9c44719a 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -154,7 +154,7 @@ impl PoolConnection { let mut delay_ms = 10u64; tracing::debug!(connection_id = id, socket_path = %socket_path, "Connecting to pool server"); - + loop { match UnixStream::connect(socket_path).await { Ok(stream) => { @@ -165,8 +165,8 @@ impl PoolConnection { "Connected to pool server after retries" ); } - return Ok(Self { - stream, + return Ok(Self { + stream, id, healthy: AtomicBool::new(true), }); @@ -191,7 +191,7 @@ impl PoolConnection { "Retrying connection to pool server" ); } - + tokio::time::sleep(Duration::from_millis(delay_ms)).await; // Exponential backoff with cap at 1 second delay_ms = std::cmp::min(delay_ms * 2, 1000); @@ -291,11 +291,9 @@ impl ConnectionPool { "All connection permits exhausted - waiting for connection" ); } - self.semaphore - .clone() - .acquire_owned() - .await - .map_err(|_| PluginError::PluginError("Connection semaphore closed".to_string()))? + self.semaphore.clone().acquire_owned().await.map_err(|_| { + PluginError::PluginError("Connection semaphore closed".to_string()) + })? } }; @@ -496,14 +494,11 @@ impl PoolManager { /// Spawn background task to set health check flag periodically /// This avoids atomic operations on the hot path - fn spawn_health_check_task( - health_check_needed: Arc, - interval_secs: u64, - ) { + fn spawn_health_check_task(health_check_needed: Arc, interval_secs: u64) { tokio::spawn(async move { let mut interval = tokio::time::interval(Duration::from_secs(interval_secs)); interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); - + loop { interval.tick().await; health_check_needed.store(true, Ordering::Relaxed); diff --git a/src/services/plugins/runner.rs b/src/services/plugins/runner.rs index 3bb5df98e..be3aba62c 100644 --- a/src/services/plugins/runner.rs +++ b/src/services/plugins/runner.rs @@ -272,8 +272,10 @@ impl PluginRunner { .unwrap_or_else(|| format!("exec-{}", Uuid::new_v4())); // Only register for traces if emit_traces is enabled + // ExecutionGuard will auto-unregister on drop (RAII pattern) let mut traces_rx = if emit_traces { - Some(shared_socket.register_execution(execution_id.clone())) + let guard = shared_socket.register_execution(execution_id.clone()).await; + Some(guard.into_receiver()) } else { None }; @@ -307,9 +309,7 @@ impl PluginRunner { { Ok(result) => result, Err(_) => { - if emit_traces { - shared_socket.unregister_execution(&execution_id); - } + // No need to manually unregister - ExecutionGuard handles it return Err(PluginError::ScriptTimeout(timeout_duration.as_secs())); } }; @@ -326,9 +326,7 @@ impl PluginRunner { Vec::new() }; - if emit_traces { - shared_socket.unregister_execution(&execution_id); - } + // ExecutionGuard auto-unregisters when traces_rx is dropped match exec_outcome { Ok(mut script_result) => { diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs index a8c664ace..b1a739810 100644 --- a/src/services/plugins/shared_socket.rs +++ b/src/services/plugins/shared_socket.rs @@ -19,13 +19,13 @@ use crate::repositories::{ TransactionCounterTrait, TransactionRepository, }; use crate::services::plugins::relayer_api::{RelayerApi, Request}; -use dashmap::DashMap; -use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; +use std::collections::HashMap; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; -use std::time::Duration; +use std::time::{Duration, Instant}; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use tokio::net::{UnixListener, UnixStream}; -use tokio::sync::{mpsc, watch}; +use tokio::sync::{mpsc, watch, RwLock, Semaphore}; use tracing::{debug, info, warn}; use super::PluginError; @@ -34,6 +34,34 @@ use super::PluginError; struct ExecutionContext { /// Channel to send traces back to the execution traces_tx: mpsc::Sender>, + /// Creation timestamp for TTL cleanup + created_at: Instant, +} + +/// RAII guard for execution registration that auto-unregisters on drop +pub struct ExecutionGuard { + execution_id: String, + executions: Arc>>, + rx: Option>>, +} + +impl ExecutionGuard { + /// Get the trace receiver + pub fn into_receiver(mut self) -> mpsc::Receiver> { + self.rx.take().expect("Receiver already taken") + } +} + +impl Drop for ExecutionGuard { + fn drop(&mut self) { + // Auto-unregister on drop (prevents memory leaks) + let executions = self.executions.clone(); + let execution_id = self.execution_id.clone(); + tokio::spawn(async move { + let mut map = executions.write().await; + map.remove(&execution_id); + }); + } } /// Shared socket service that handles multiple concurrent plugin executions @@ -41,13 +69,14 @@ pub struct SharedSocketService { /// Socket path socket_path: String, /// Active execution contexts (execution_id -> ExecutionContext) - executions: Arc>, + /// RwLock is sufficient for write-once, read-once pattern + executions: Arc>>, /// Whether the listener has been started (instance-level flag) started: AtomicBool, /// Shutdown signal sender shutdown_tx: watch::Sender, - /// Current active connection count - active_connections: Arc, + /// Semaphore for connection limiting (prevents race conditions) + connection_semaphore: Arc, /// Connection idle timeout idle_timeout: Duration, /// Read timeout per line @@ -66,13 +95,30 @@ impl SharedSocketService { let config = get_config(); let idle_timeout = Duration::from_secs(config.socket_idle_timeout_secs); let read_timeout = Duration::from_secs(config.socket_read_timeout_secs); + let max_connections = config.socket_max_connections; + + let executions: Arc>> = + Arc::new(RwLock::new(HashMap::new())); + + // Spawn background cleanup task for stale executions (prevents memory leaks) + let executions_clone = executions.clone(); + tokio::spawn(async move { + let mut interval = tokio::time::interval(Duration::from_secs(60)); + loop { + interval.tick().await; + let now = Instant::now(); + let mut map = executions_clone.write().await; + // Remove entries older than 5 minutes + map.retain(|_, ctx| now.duration_since(ctx.created_at) < Duration::from_secs(300)); + } + }); Ok(Self { socket_path: socket_path.to_string(), - executions: Arc::new(DashMap::new()), + executions, started: AtomicBool::new(false), shutdown_tx, - active_connections: Arc::new(AtomicUsize::new(0)), + connection_semaphore: Arc::new(Semaphore::new(max_connections)), idle_timeout, read_timeout, }) @@ -82,31 +128,52 @@ impl SharedSocketService { &self.socket_path } - /// Register an execution and return a receiver for traces - pub fn register_execution( - &self, - execution_id: String, - ) -> mpsc::Receiver> { + /// Register an execution and return a guard that auto-unregisters on drop + /// This prevents memory leaks from forgotten unregister calls + pub async fn register_execution(&self, execution_id: String) -> ExecutionGuard { let (tx, rx) = mpsc::channel(1); - self.executions - .insert(execution_id, ExecutionContext { traces_tx: tx }); - rx - } + let mut map = self.executions.write().await; + map.insert( + execution_id.clone(), + ExecutionContext { + traces_tx: tx, + created_at: Instant::now(), + }, + ); - /// Unregister an execution - pub fn unregister_execution(&self, execution_id: &str) { - self.executions.remove(execution_id); + ExecutionGuard { + execution_id, + executions: self.executions.clone(), + rx: Some(rx), + } } - /// Get current active connection count + /// Get current active connection count (semaphore available permits) pub fn active_connection_count(&self) -> usize { - self.active_connections.load(Ordering::Relaxed) + self.connection_semaphore.available_permits() } - /// Signal shutdown to the listener - pub fn shutdown(&self) { + /// Signal shutdown to the listener and wait for active connections to drain + pub async fn shutdown(&self) { let _ = self.shutdown_tx.send(true); info!("Shared socket service: shutdown signal sent"); + + // Wait for active connections to drain (max 30 seconds) + let max_wait = Duration::from_secs(30); + let start = Instant::now(); + + while start.elapsed() < max_wait { + let available = self.connection_semaphore.available_permits(); + if available == get_config().socket_max_connections { + // All permits returned - no active connections + break; + } + tokio::time::sleep(Duration::from_millis(100)).await; + } + + // Remove socket file after connections drained + let _ = std::fs::remove_file(&self.socket_path); + info!("Shared socket service: shutdown complete"); } /// Start the shared socket service @@ -143,10 +210,9 @@ impl SharedSocketService { let relayer_api = Arc::new(RelayerApi); let socket_path = self.socket_path.clone(); let mut shutdown_rx = self.shutdown_tx.subscribe(); - let active_connections = self.active_connections.clone(); + let connection_semaphore = self.connection_semaphore.clone(); let idle_timeout = self.idle_timeout; let read_timeout = self.read_timeout; - let max_connections = get_config().socket_max_connections; debug!( "Shared socket service: starting listener on {}", @@ -169,48 +235,42 @@ impl SharedSocketService { accept_result = listener.accept() => { match accept_result { Ok((stream, _)) => { - // Check connection limit - let current = active_connections.load(Ordering::Relaxed); - if current >= max_connections { - warn!( - current_connections = current, - max_connections = max_connections, - "Connection limit reached, rejecting new connection. \ - Consider increasing PLUGIN_MAX_CONCURRENCY or PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS." - ); - drop(stream); - continue; - } - - active_connections.fetch_add(1, Ordering::Relaxed); - debug!( - active_connections = active_connections.load(Ordering::Relaxed), - "Shared socket service: accepted new connection" - ); - - let relayer_api_clone = relayer_api.clone(); - let state_clone = Arc::clone(&state); - let executions_clone = executions.clone(); - let active_connections_clone = active_connections.clone(); - - tokio::spawn(async move { - let result = Self::handle_connection_with_timeout( - stream, - relayer_api_clone, - state_clone, - executions_clone, - idle_timeout, - read_timeout, - ) - .await; - - // Always decrement connection count - active_connections_clone.fetch_sub(1, Ordering::Relaxed); - - if let Err(e) = result { - debug!("Connection handler finished with error: {}", e); + // Try to acquire semaphore permit (no race condition!) + match connection_semaphore.clone().try_acquire_owned() { + Ok(permit) => { + debug!("Shared socket service: accepted new connection"); + + let relayer_api_clone = relayer_api.clone(); + let state_clone = Arc::clone(&state); + let executions_clone = executions.clone(); + + tokio::spawn(async move { + // Permit held until task completes (auto-released on drop) + let _permit = permit; + + let result = Self::handle_connection_with_timeout( + stream, + relayer_api_clone, + state_clone, + executions_clone, + idle_timeout, + read_timeout, + ) + .await; + + if let Err(e) = result { + debug!("Connection handler finished with error: {}", e); + } + }); + } + Err(_) => { + warn!( + "Connection limit reached, rejecting new connection. \ + Consider increasing PLUGIN_MAX_CONCURRENCY or PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS." + ); + drop(stream); } - }); + } } Err(e) => { warn!("Error accepting connection: {}", e); @@ -233,7 +293,7 @@ impl SharedSocketService { stream: UnixStream, relayer_api: Arc, state: Arc>, - executions: Arc>, + executions: Arc>>, idle_timeout: Duration, read_timeout: Duration, ) -> Result<(), PluginError> @@ -272,7 +332,7 @@ impl SharedSocketService { stream: UnixStream, relayer_api: Arc, state: Arc>, - executions: Arc>, + executions: Arc>>, read_timeout: Duration, ) -> Result<(), PluginError> where @@ -312,7 +372,7 @@ impl SharedSocketService { debug!("Shared socket service: received message"); - // Parse JSON once and reuse (fix double parsing) + // Parse JSON once and reuse (avoiding double parsing) let json_value: serde_json::Value = match serde_json::from_str(&line) { Ok(v) => v, Err(e) => { @@ -321,11 +381,8 @@ impl SharedSocketService { } }; - // Store raw JSON for traces - traces.push(json_value.clone()); - // Deserialize into Request from the already-parsed Value - let request: Request = match serde_json::from_value(json_value) { + let request: Request = match serde_json::from_value(json_value.clone()) { Ok(req) => req, Err(e) => { warn!("Failed to parse request structure: {}", e); @@ -333,6 +390,9 @@ impl SharedSocketService { } }; + // Move JSON into traces (no clone needed) + traces.push(json_value); + if execution_id.is_none() { execution_id = request .http_request_id @@ -352,8 +412,10 @@ impl SharedSocketService { } } + // Send traces back to caller if execution context exists if let Some(exec_id) = execution_id { - if let Some(ctx) = executions.get(&exec_id) { + let map = executions.read().await; + if let Some(ctx) = map.get(&exec_id) { let _ = ctx.traces_tx.send(traces).await; } } @@ -365,9 +427,10 @@ impl SharedSocketService { impl Drop for SharedSocketService { fn drop(&mut self) { - // Signal shutdown and cleanup socket file + // Signal shutdown (cleanup happens in shutdown() method) let _ = self.shutdown_tx.send(true); - let _ = std::fs::remove_file(&self.socket_path); + // Note: Socket file cleanup happens in shutdown() after connections drain + // Drop can't be async, so proper cleanup should use shutdown() method } } diff --git a/src/services/plugins/socket.rs b/src/services/plugins/socket.rs index beb4e13df..f9d4f7967 100644 --- a/src/services/plugins/socket.rs +++ b/src/services/plugins/socket.rs @@ -58,12 +58,14 @@ use crate::repositories::{ TransactionCounterTrait, TransactionRepository, }; use std::sync::Arc; +use std::time::Duration; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use tokio::net::{UnixListener, UnixStream}; -use tokio::sync::oneshot; -use tracing::debug; +use tokio::sync::{oneshot, Semaphore}; +use tracing::{debug, warn}; use super::{ + config::get_config, relayer_api::{RelayerApiTrait, Request}, PluginError, }; @@ -71,6 +73,10 @@ use super::{ pub struct SocketService { socket_path: String, listener: UnixListener, + /// Semaphore for connection limiting (prevents DoS) + connection_semaphore: Arc, + /// Read timeout per line (prevents hanging connections) + read_timeout: Duration, } impl SocketService { @@ -86,9 +92,14 @@ impl SocketService { let listener = UnixListener::bind(socket_path).map_err(|e| PluginError::SocketError(e.to_string()))?; + // Use centralized config + let config = get_config(); + Ok(Self { socket_path: socket_path.to_string(), listener, + connection_semaphore: Arc::new(Semaphore::new(config.socket_max_connections)), + read_timeout: Duration::from_secs(config.socket_read_timeout_secs), }) } @@ -164,20 +175,32 @@ impl SocketService { } }; - // Now handle the connection, but also listen for shutdown - // We spawn the handler and then select between it finishing or shutdown - let handle = tokio::spawn(Self::handle_connection::< - RA, - J, - RR, - TR, - NR, - NFR, - SR, - TCR, - PR, - AKR, - >(stream, state, relayer_api)); + // Now handle the connection with connection limiting + // Try to acquire semaphore permit (no race condition!) + let permit = match self.connection_semaphore.clone().try_acquire_owned() { + Ok(p) => p, + Err(_) => { + warn!("Plugin API socket: connection limit reached, rejecting connection"); + drop(stream); + continue; + } + }; + + let state_clone = Arc::clone(&state); + let relayer_api_clone = Arc::clone(&relayer_api); + let read_timeout = self.read_timeout; + + // Spawn handler with permit (auto-released on task completion) + let handle = tokio::spawn(async move { + let _permit = permit; // Hold until task completes + Self::handle_connection::( + stream, + state_clone, + relayer_api_clone, + read_timeout, + ) + .await + }); tokio::pin!(handle); tokio::select! { @@ -193,9 +216,21 @@ impl SocketService { result = &mut handle => { debug!("Plugin API socket: connection handler completed"); match result { - Ok(Ok(trace)) => traces.extend(trace), - Ok(Err(e)) => return Err(e), - Err(e) => return Err(PluginError::SocketError(e.to_string())), + Ok(Ok(connection_traces)) => { + // Successfully collected traces from this connection + traces.extend(connection_traces); + } + Ok(Err(e)) => { + // Connection handler error - log but don't kill service + warn!("Plugin API socket: connection handler error: {}", e); + } + Err(e) if e.is_cancelled() => { + debug!("Plugin API socket: connection handler cancelled"); + } + Err(e) => { + // Connection handler panicked - log but don't kill service + warn!("Plugin API socket: connection handler panic: {}", e); + } } } } @@ -212,6 +247,7 @@ impl SocketService { /// * `stream` - The stream to the client. /// * `state` - The application state. /// * `relayer_api` - The relayer API. + /// * `read_timeout` - Timeout for reading each line. /// /// # Returns /// @@ -221,6 +257,7 @@ impl SocketService { stream: UnixStream, state: Arc>, relayer_api: Arc, + read_timeout: Duration, ) -> Result, PluginError> where RA: RelayerApiTrait + 'static + Send + Sync, @@ -244,26 +281,78 @@ impl SocketService { debug!("Plugin API socket: handle_connection started"); - while let Ok(Some(line)) = reader.next_line().await { + loop { + // Read line with timeout to prevent hanging connections + let line = match tokio::time::timeout(read_timeout, reader.next_line()).await { + Ok(Ok(Some(line))) => line, + Ok(Ok(None)) => { + debug!("Plugin API socket: client closed connection (EOF)"); + break; + } + Ok(Err(e)) => { + warn!("Plugin API socket: read error: {}", e); + break; + } + Err(_) => { + debug!("Plugin API socket: read timeout"); + break; + } + }; + debug!("Plugin API socket: received request"); - let trace: serde_json::Value = serde_json::from_str(&line) - .map_err(|e| PluginError::PluginError(format!("Failed to parse trace: {e}")))?; - traces.push(trace); - let request: Request = - serde_json::from_str(&line).map_err(|e| PluginError::PluginError(e.to_string()))?; + // Parse JSON once and reuse (avoiding double parsing) + let json_value: serde_json::Value = match serde_json::from_str(&line) { + Ok(v) => v, + Err(e) => { + warn!("Plugin API socket: failed to parse JSON, skipping: {}", e); + continue; // Skip bad request, don't kill connection + } + }; + + // Deserialize into Request from the already-parsed Value + let request: Request = match serde_json::from_value(json_value.clone()) { + Ok(req) => req, + Err(e) => { + warn!( + "Plugin API socket: failed to parse request structure, skipping: {}", + e + ); + continue; // Skip bad request, don't kill connection + } + }; + + // Move JSON into traces (no extra clone needed) + traces.push(json_value); + // Handle request let response = relayer_api.handle_request(request, &state).await; - let response_str = serde_json::to_string(&response) - .map_err(|e| PluginError::PluginError(e.to_string()))? - + "\n"; + // Serialize response with error handling + let response_str = match serde_json::to_string(&response) { + Ok(s) => s + "\n", + Err(e) => { + warn!("Plugin API socket: failed to serialize response: {}", e); + continue; // Skip this response, don't kill connection + } + }; + + // Write response with error handling + if let Err(e) = w.write_all(response_str.as_bytes()).await { + warn!("Plugin API socket: failed to write response: {}", e); + break; // Connection broken, exit + } + + // Flush to ensure response is sent immediately + if let Err(e) = w.flush().await { + warn!("Plugin API socket: failed to flush response: {}", e); + break; // Connection broken, exit + } - let _ = w.write_all(response_str.as_bytes()).await; debug!("Plugin API socket: sent response"); } - debug!("Plugin API socket: handle_connection finished (client closed)"); + debug!("Plugin API socket: handle_connection finished"); Ok(traces) } } From 864921baea22c95b87d910ca216a9e0e111a569c Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 4 Jan 2026 00:35:20 +0100 Subject: [PATCH 06/42] feat: Implement memory pressure monitoring and cache eviction in pool server - Added a memory pressure monitor to the PoolServer class, which triggers garbage collection and cache eviction based on heap usage thresholds. - Introduced a ContextPool and ScriptCache to optimize VM context and script management, reducing overhead during plugin execution. - Updated the WorkerPoolManager to handle memory pressure awareness and improve overall performance. - Enhanced error handling and logging for better observability during high memory usage scenarios. --- plugins/lib/.build-cache-hash | 2 +- plugins/lib/pool-server.ts | 246 +++++++++- plugins/lib/sandbox-executor.js | 321 +++++++++++-- plugins/lib/sandbox-executor.js.sha256 | 2 +- plugins/lib/sandbox-executor.ts | 435 +++++++++++++++--- plugins/lib/worker-pool.ts | 330 ++++++++++++-- src/services/plugins/config.rs | 25 ++ src/services/plugins/mod.rs | 3 - src/services/plugins/pool_executor.rs | 599 ++++++++++++++++++++++++- src/services/plugins/runner.rs | 62 +-- src/services/plugins/shared_socket.rs | 575 ++++++++++++++++++++++-- src/services/plugins/socket.rs | 496 -------------------- 12 files changed, 2368 insertions(+), 728 deletions(-) delete mode 100644 src/services/plugins/socket.rs diff --git a/plugins/lib/.build-cache-hash b/plugins/lib/.build-cache-hash index f4104d83d..057afdf1c 100644 --- a/plugins/lib/.build-cache-hash +++ b/plugins/lib/.build-cache-hash @@ -1 +1 @@ -098340c89cdfcab522cf7ecffed10a299069afea9befdf8f83101ceab2618aa3 \ No newline at end of file +75bed5cbdc40fc80dbd26f0112b5d2154a1b892a90d048599753ff9725734c5a \ No newline at end of file diff --git a/plugins/lib/pool-server.ts b/plugins/lib/pool-server.ts index 7accd55a2..ceffda374 100644 --- a/plugins/lib/pool-server.ts +++ b/plugins/lib/pool-server.ts @@ -32,6 +32,7 @@ import * as net from 'node:net'; import * as fs from 'node:fs'; +import * as v8 from 'node:v8'; import { WorkerPoolManager, type PluginExecutionRequest } from './worker-pool'; import { DEFAULT_POOL_MIN_THREADS, @@ -49,6 +50,180 @@ function debug(...args: any[]): void { } } +/** + * Memory Pressure Monitor - Pool Server Edition + * Monitors main process heap and logs warnings when approaching limits. + * Pool server manages workers, code cache, and socket communication. + * + * SELF-HEALING FEATURES: + * - Proactive GC triggering at 80% heap usage + * - Cache eviction at 85% heap usage + * - Emergency restart signal at 95% (tells Rust to restart) + */ +class PoolServerMemoryMonitor { + private checkInterval: NodeJS.Timeout | null = null; + private readonly warningThreshold = 0.75; // 75% of heap - start monitoring + private readonly gcThreshold = 0.80; // 80% of heap - force GC + private readonly criticalThreshold = 0.85; // 85% of heap - evict caches + private readonly emergencyThreshold = 0.92; // 92% of heap - signal restart + private lastWarningTime = 0; + private readonly warningCooldown = 10000; // 10 seconds between warnings (more frequent) + private consecutiveHighPressure = 0; + private onCacheEvictionRequest: (() => void) | null = null; + private onEmergencyRestart: (() => void) | null = null; + + start(): void { + if (this.checkInterval) return; + + // Check memory pressure every 5 seconds (more frequent for faster response) + this.checkInterval = setInterval(() => { + this.checkMemoryPressure(); + }, 5000); + + // Don't prevent process exit + this.checkInterval.unref(); + + console.error('[pool-server] Memory monitoring started (thresholds: 75%/80%/85%/92%)'); + } + + stop(): void { + if (this.checkInterval) { + clearInterval(this.checkInterval); + this.checkInterval = null; + } + } + + /** + * Register callback for cache eviction requests. + */ + onCacheEviction(callback: () => void): void { + this.onCacheEvictionRequest = callback; + } + + /** + * Register callback for emergency restart signal. + */ + onEmergency(callback: () => void): void { + this.onEmergencyRestart = callback; + } + + private checkMemoryPressure(): void { + const usage = process.memoryUsage(); + const heapStats = v8.getHeapStatistics(); + const heapUsed = usage.heapUsed; + // Use heap_size_limit (the actual max heap) instead of heapTotal (current allocated) + // heapTotal grows dynamically and can be much smaller than the configured max, + // causing false positive pressure detection (e.g., 28MB/30MB = 93% when max is 26GB) + const heapLimit = heapStats.heap_size_limit; + const heapUsedRatio = heapUsed / heapLimit; + + // Track consecutive high pressure for emergency detection + if (heapUsedRatio >= this.criticalThreshold) { + this.consecutiveHighPressure++; + } else if (heapUsedRatio < this.warningThreshold) { + this.consecutiveHighPressure = 0; + } + + // Emergency: persistent critical pressure = GC can't keep up + if (heapUsedRatio >= this.emergencyThreshold || this.consecutiveHighPressure >= 6) { + this.handleEmergency(heapUsed, heapLimit, usage.external, usage.rss); + } else if (heapUsedRatio >= this.criticalThreshold) { + this.handleCriticalPressure(heapUsed, heapLimit, usage.external, usage.rss); + } else if (heapUsedRatio >= this.gcThreshold) { + this.handleGCPressure(heapUsed, heapLimit); + } else if (heapUsedRatio >= this.warningThreshold) { + this.handleWarningPressure(heapUsed, heapLimit, usage.external, usage.rss); + } + } + + private handleEmergency(heapUsed: number, heapLimit: number, external: number, rss: number): void { + const heapUsedMB = Math.round(heapUsed / 1024 / 1024); + const heapLimitMB = Math.round(heapLimit / 1024 / 1024); + const percent = Math.round((heapUsed / heapLimit) * 100); + + console.error( + `[pool-server] EMERGENCY: Heap at ${heapUsedMB}MB / ${heapLimitMB}MB limit (${percent}%). ` + + `Consecutive high pressure: ${this.consecutiveHighPressure}. ` + + `GC cannot keep up - signaling Rust for graceful restart.` + ); + + // Try last-ditch GC + if (global.gc) { + try { + global.gc(); + } catch { + // Ignore + } + } + + // Signal emergency to any registered handlers + if (this.onEmergencyRestart) { + this.onEmergencyRestart(); + } + + // Reset counter after emergency signal + this.consecutiveHighPressure = 0; + } + + private handleCriticalPressure(heapUsed: number, heapLimit: number, external: number, rss: number): void { + const now = Date.now(); + if (now - this.lastWarningTime < this.warningCooldown) return; + this.lastWarningTime = now; + + const heapUsedMB = Math.round(heapUsed / 1024 / 1024); + const heapLimitMB = Math.round(heapLimit / 1024 / 1024); + const externalMB = Math.round(external / 1024 / 1024); + const rssMB = Math.round(rss / 1024 / 1024); + const percent = Math.round((heapUsed / heapLimit) * 100); + + console.error( + `[pool-server] CRITICAL: Heap at ${heapUsedMB}MB / ${heapLimitMB}MB limit (${percent}%). ` + + `External: ${externalMB}MB, RSS: ${rssMB}MB. ` + + `Requesting cache eviction and forcing GC.` + ); + + // Request cache eviction + if (this.onCacheEvictionRequest) { + this.onCacheEvictionRequest(); + } + + // Force GC + if (global.gc) { + try { + global.gc(); + console.error(`[pool-server] Forced GC triggered`); + } catch (err) { + console.error(`[pool-server] Failed to trigger GC:`, err); + } + } + } + + private handleGCPressure(heapUsed: number, heapLimit: number): void { + // Silently trigger GC at 80% threshold + if (global.gc) { + try { + global.gc(); + } catch { + // Ignore + } + } + } + + private handleWarningPressure(heapUsed: number, heapLimit: number, external: number, rss: number): void { + const now = Date.now(); + if (now - this.lastWarningTime < this.warningCooldown * 3) return; // Less frequent warnings + this.lastWarningTime = now; + + const heapUsedMB = Math.round(heapUsed / 1024 / 1024); + const heapLimitMB = Math.round(heapLimit / 1024 / 1024); + const percent = Math.round((heapUsed / heapLimit) * 100); + + console.error( + `[pool-server] WARNING: Heap at ${heapUsedMB}MB / ${heapLimitMB}MB limit (${percent}%).` + ); + } +} + // Message types interface BaseMessage { type: string; @@ -162,6 +337,8 @@ class PoolServer { // Log effective configuration (received from Rust) console.error(`[pool-server] Configuration (from Rust): maxConcurrency=${maxConcurrency}, minThreads=${minThreads}, maxThreads=${maxThreads}, concurrentTasksPerWorker=${concurrentTasksPerWorker}, idleTimeout=${idleTimeout}ms`); + // WorkerPoolManager handles cache lifecycle with active eviction (runs every 5 mins) + // Cache is properly cleaned up on shutdown via pool.destroy() this.pool = new WorkerPoolManager({ minThreads, maxThreads, @@ -206,7 +383,8 @@ class PoolServer { }); // Backlog for pending connections (default 511, increase for high concurrency) - const backlog = parseInt(process.env.PLUGIN_POOL_BACKLOG || String(DEFAULT_POOL_SOCKET_BACKLOG), 10); + // Note: Rust exports PLUGIN_POOL_SOCKET_BACKLOG with derived headroom + const backlog = parseInt(process.env.PLUGIN_POOL_SOCKET_BACKLOG || String(DEFAULT_POOL_SOCKET_BACKLOG), 10); return new Promise((resolve, reject) => { this.server!.on('error', (err) => { @@ -552,6 +730,19 @@ class PoolServer { }; } + /** + * Evict code cache under memory pressure. + * Called by memory monitor when heap usage is critical. + */ + evictCache(): void { + try { + this.pool.clearCache(); + console.error('[pool-server] Code cache evicted due to memory pressure'); + } catch (err) { + console.error('[pool-server] Failed to evict cache:', err); + } + } + /** * Stop the server */ @@ -584,15 +775,64 @@ async function main(): Promise { debug('Starting with socket path:', socketPath); + // Log heap configuration from NODE_OPTIONS + const nodeOptions = process.env.NODE_OPTIONS || ''; + const maxOldSpaceMatch = nodeOptions.match(/--max-old-space-size=(\d+)/); + const configuredHeapMB = maxOldSpaceMatch ? parseInt(maxOldSpaceMatch[1], 10) : 'default'; + const currentHeapMB = Math.round(process.memoryUsage().heapTotal / 1024 / 1024); + + console.error( + `[pool-server] Heap configuration: ${configuredHeapMB}MB max ` + + `(current: ${currentHeapMB}MB, will grow as needed)` + ); + const server = new PoolServer(socketPath); + // Start memory monitoring for pool server process + const memoryMonitor = new PoolServerMemoryMonitor(); + + // Connect memory monitor to pool for cache eviction + memoryMonitor.onCacheEviction(() => { + console.error('[pool-server] Memory pressure - clearing code cache'); + server.evictCache(); + }); + + // Connect emergency handler - graceful shutdown to trigger Rust restart + memoryMonitor.onEmergency(() => { + console.error('[pool-server] Emergency memory pressure - initiating graceful shutdown for restart'); + // Don't exit immediately - let pending requests complete + // Rust will detect the exit and restart the process + setTimeout(async () => { + try { + await server.stop(); + } catch (err) { + console.error('[pool-server] Error during emergency shutdown:', err); + } + process.exit(137); // Signal OOM-like exit to Rust + }, 1000); + }); + + memoryMonitor.start(); + // Handle uncaught exceptions to prevent silent crashes - process.on('uncaughtException', (err) => { + process.on('uncaughtException', async (err) => { console.error('[pool-server] Uncaught exception:', err); + try { + await server.stop(); + } catch (stopErr) { + console.error('[pool-server] Error during cleanup:', stopErr); + } + process.exit(1); }); - process.on('unhandledRejection', (reason, promise) => { + process.on('unhandledRejection', async (reason, promise) => { console.error('[pool-server] Unhandled rejection at:', promise, 'reason:', reason); + try { + await server.stop(); + } catch (stopErr) { + console.error('[pool-server] Error during cleanup:', stopErr); + } + process.exit(1); }); // Handle signals for graceful shutdown diff --git a/plugins/lib/sandbox-executor.js b/plugins/lib/sandbox-executor.js index 45e36a220..5af712a51 100644 --- a/plugins/lib/sandbox-executor.js +++ b/plugins/lib/sandbox-executor.js @@ -1,9 +1,9 @@ /** * Auto-generated by build-executor.ts - * Build time: 2025-12-29T08:57:30.221Z + * Build time: 2026-01-03T23:12:56.400Z * Node version: v25.2.1 * Source: sandbox-executor.ts - * Source hash: 098340c89cdfcab5 + * Source hash: 75bed5cbdc40fc80 * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts */ "use strict"; @@ -31229,6 +31229,7 @@ __export(sandbox_executor_exports, { }); module.exports = __toCommonJS(sandbox_executor_exports); var vm = __toESM(require("node:vm")); +var v8 = __toESM(require("node:v8")); var net = __toESM(require("node:net")); // node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/stringify.js @@ -31496,11 +31497,159 @@ var import_relayer_sdk = __toESM(require_dist()); var DEFAULT_SOCKET_REQUEST_TIMEOUT_MS = 3e4; // lib/sandbox-executor.ts +var ContextPool = class { + constructor() { + this.available = []; + this.maxSize = 10; + } + // Max contexts to cache per worker + acquire() { + const ctx = this.available.pop(); + if (ctx) { + this.resetContext(ctx); + return ctx; + } + return this.createFreshContext(); + } + release(ctx) { + if (this.available.length < this.maxSize) { + this.available.push(ctx); + } + } + createFreshContext() { + return vm.createContext({}); + } + resetContext(ctx) { + try { + vm.runInContext(` + // Clear any plugin-added globals + if (typeof globalThis.__pluginState !== 'undefined') { + delete globalThis.__pluginState; + } + `, ctx, { timeout: 100 }); + } catch { + } + } + clear() { + this.available = []; + } +}; +var ScriptCache = class { + constructor() { + this.cache = /* @__PURE__ */ new Map(); + this.maxSize = 100; + // Max scripts to cache per worker + this.lastMemoryCheck = 0; + this.memoryCheckInterval = 5e3; + } + // Check every 5s + get(code) { + this.maybeCheckMemory(); + const entry = this.cache.get(code); + if (entry) { + entry.timestamp = Date.now(); + return entry.script; + } + return void 0; + } + set(code, script) { + this.maybeCheckMemory(); + if (this.cache.size >= this.maxSize) { + this.evictOldest(1); + } + this.cache.set(code, { script, timestamp: Date.now() }); + } + /** + * Periodic memory check - evict cache if heap is under pressure. + */ + maybeCheckMemory() { + const now = Date.now(); + if (now - this.lastMemoryCheck < this.memoryCheckInterval) { + return; + } + this.lastMemoryCheck = now; + const usage = process.memoryUsage(); + const heapStats = v8.getHeapStatistics(); + const heapUsedRatio = usage.heapUsed / heapStats.heap_size_limit; + if (heapUsedRatio >= 0.7 && this.cache.size > 0) { + const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); + console.warn( + `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` + ); + this.evictOldest(evictCount); + } + if (heapUsedRatio >= 0.85 && this.cache.size > 0) { + const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.5)); + console.warn( + `[worker-cache] HIGH memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` + ); + this.evictOldest(evictCount); + } + } + evictOldest(count) { + const entries = [...this.cache.entries()].sort( + (a, b) => a[1].timestamp - b[1].timestamp + ); + let evicted = 0; + for (const [key] of entries) { + if (evicted >= count) break; + this.cache.delete(key); + evicted++; + } + if (evicted > 0) { + console.log(`[worker-cache] Evicted ${evicted} oldest scripts`); + } + } + clear() { + const size = this.cache.size; + this.cache.clear(); + if (size > 0) { + console.log(`[worker-cache] Emergency eviction: cleared ${size} cached scripts`); + } + } + size() { + return this.cache.size; + } +}; +var SocketPool = class { + constructor() { + this.available = []; + this.maxSize = 5; + } + // Max sockets to cache per worker + acquire(socketPath) { + const socket = this.available.pop(); + if (socket && socket.writable && !socket.destroyed) { + return socket; + } + return null; + } + release(socket) { + if (socket.writable && !socket.destroyed && this.available.length < this.maxSize) { + this.available.push(socket); + } else { + socket.destroy(); + } + } + clear() { + for (const socket of this.available) { + socket.destroy(); + } + this.available = []; + } +}; +var contextPool = new ContextPool(); +var scriptCache = new ScriptCache(); +var socketPool = new SocketPool(); var SandboxPluginAPI = class { + // Track if socket is from pool constructor(socketPath, httpRequestId) { this.socket = null; this.connectionPromise = null; this.connected = false; + this.maxPendingRequests = 100; + // Prevent memory leak from unbounded pending + this.fromPool = false; this.socketPath = socketPath; this.pending = /* @__PURE__ */ new Map(); this.httpRequestId = httpRequestId; @@ -31508,38 +31657,78 @@ var SandboxPluginAPI = class { async ensureConnected() { if (this.connected) return; if (!this.connectionPromise) { - this.socket = net.createConnection(this.socketPath); - this.connectionPromise = new Promise((resolve2, reject) => { - this.socket.on("connect", () => { - this.connected = true; - resolve2(); - }); - this.socket.on("error", (error) => { - this.rejectAllPending(error); - reject(error); - }); - this.socket.on("close", () => { - this.connected = false; - this.rejectAllPending(new Error("Socket closed unexpectedly")); - }); - }); - this.socket.on("data", (data) => { - data.toString().split("\n").filter(Boolean).forEach((msg) => { - try { - const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); - } - } catch { - } + const pooledSocket = socketPool.acquire(this.socketPath); + if (pooledSocket) { + this.socket = pooledSocket; + this.fromPool = true; + this.connected = true; + this.connectionPromise = Promise.resolve(); + this.setupSocketHandlers(this.socket); + } else { + this.socket = net.createConnection(this.socketPath); + this.fromPool = false; + this.connectionPromise = new Promise((resolve2, reject) => { + this.socket.on("connect", () => { + this.connected = true; + resolve2(); + }); + this.socket.on("error", (error) => { + this.handleSocketError(error); + reject(error); + }); + this.socket.on("close", () => { + this.handleSocketClose(); + }); }); - }); + this.socket.on("data", (data) => this.handleSocketData(data)); + } } await this.connectionPromise; } + /** + * Set up error/close/data handlers for a socket (pooled or new). + * This ensures sockets can trigger reconnection on failure. + */ + setupSocketHandlers(socket) { + socket.on("error", (error) => this.handleSocketError(error)); + socket.on("close", () => this.handleSocketClose()); + socket.on("data", (data) => this.handleSocketData(data)); + } + /** + * Handle socket error - reject pending requests and reset connection state + */ + handleSocketError(error) { + this.rejectAllPending(error); + this.connected = false; + this.connectionPromise = null; + this.socket = null; + } + /** + * Handle socket close - reset connection state to enable reconnection + */ + handleSocketClose() { + this.connected = false; + this.rejectAllPending(new Error("Socket closed unexpectedly")); + this.connectionPromise = null; + this.socket = null; + } + /** + * Handle incoming data from socket + */ + handleSocketData(data) { + data.toString().split("\n").filter(Boolean).forEach((msg) => { + try { + const parsed = JSON.parse(msg); + const { requestId, result, error } = parsed; + const resolver = this.pending.get(requestId); + if (resolver) { + error ? resolver.reject(error) : resolver.resolve(result); + this.pending.delete(requestId); + } + } catch { + } + }); + } /** * Reject all pending requests with the given error. * Called on socket error or close to prevent hanging promises. @@ -31599,6 +31788,11 @@ var SandboxPluginAPI = class { msg.httpRequestId = this.httpRequestId; } const message = JSON.stringify(msg) + "\n"; + if (this.pending.size >= this.maxPendingRequests) { + throw new Error( + `Too many concurrent API requests (max ${this.maxPendingRequests}). Await previous requests before making new ones.` + ); + } await this.ensureConnected(); return new Promise((resolve2, reject) => { let timeoutId; @@ -31627,8 +31821,10 @@ var SandboxPluginAPI = class { } close() { if (this.socket) { - this.socket.destroy(); + socketPool.release(this.socket); + this.socket = null; } + this.connected = false; } }; function safeStringify(value) { @@ -31649,10 +31845,28 @@ function safeStringify(value) { } function createSandboxConsole(logs) { const log = (level) => (...args) => { - const message = args.map( - (arg) => typeof arg === "object" ? safeStringify(arg) : String(arg) - ).join(" "); - logs.push({ level, message }); + const entry = { + level, + _args: args, + // Store raw args + _stringified: false, + _message: "" + }; + Object.defineProperty(entry, "message", { + get() { + if (!this._stringified) { + this._message = this._args.map( + (arg) => typeof arg === "object" ? safeStringify(arg) : String(arg) + ).join(" "); + this._stringified = true; + delete this._args; + } + return this._message; + }, + enumerable: true, + configurable: true + }); + logs.push(entry); }; return { log: log("log"), @@ -31701,9 +31915,23 @@ async function executeInSandbox(task) { const logs = []; const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); const kv = new DefaultPluginKVStore(task.pluginId); + const context = contextPool.acquire(); try { const sandboxConsole = createSandboxConsole(logs); const wrappedCode = wrapForVm(task.compiledCode); + let script = scriptCache.get(task.compiledCode); + if (!script) { + script = new vm.Script(wrappedCode, { + filename: `plugin-${task.pluginId}.js` + }); + scriptCache.set(task.compiledCode, script); + } + const moduleExports = {}; + const moduleObject = { exports: moduleExports }; + const safeCrypto = { + randomUUID: () => require("crypto").randomUUID(), + getRandomValues: (arr) => require("crypto").getRandomValues(arr) + }; const BLOCKED_MODULES = /* @__PURE__ */ new Set([ // Filesystem access "fs", @@ -31768,13 +31996,7 @@ async function executeInSandbox(task) { ); } }; - const moduleExports = {}; - const moduleObject = { exports: moduleExports }; - const safeCrypto = { - randomUUID: () => require("crypto").randomUUID(), - getRandomValues: (arr) => require("crypto").getRandomValues(arr) - }; - const context = vm.createContext({ + Object.assign(context, { // === Console for logging === console: sandboxConsole, // === CommonJS module system === @@ -31858,9 +32080,6 @@ async function executeInSandbox(task) { Reflect, Proxy }); - const script = new vm.Script(wrappedCode, { - filename: `plugin-${task.pluginId}.js` - }); const factory = script.runInContext(context, { timeout: task.timeout }); factory(moduleExports, sandboxRequire, moduleObject, `plugin-${task.pluginId}.js`, "/plugins"); const handler = moduleObject.exports.handler || moduleExports.handler; @@ -31945,9 +32164,15 @@ async function executeInSandbox(task) { logs }; } finally { - api.close(); - await kv.disconnect().catch(() => { - }); + contextPool.release(context); + try { + api.close(); + } catch (err) { + } + try { + await kv.disconnect(); + } catch { + } } } /*! Bundled license information: diff --git a/plugins/lib/sandbox-executor.js.sha256 b/plugins/lib/sandbox-executor.js.sha256 index 53d127a91..903192a70 100644 --- a/plugins/lib/sandbox-executor.js.sha256 +++ b/plugins/lib/sandbox-executor.js.sha256 @@ -1 +1 @@ -68085d93fdaf27af7529e09c797aca5b25b0a16ac22f7c96fbf34477d867ed23 sandbox-executor.js +df18c16db22475d7e06fe35422be6ec7059fcd61568494809893429679c8c432 sandbox-executor.js diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/sandbox-executor.ts index 74652ad55..4962b93b3 100644 --- a/plugins/lib/sandbox-executor.ts +++ b/plugins/lib/sandbox-executor.ts @@ -6,6 +6,7 @@ */ import * as vm from 'node:vm'; +import * as v8 from 'node:v8'; import * as net from 'node:net'; import { v4 as uuidv4 } from 'uuid'; import type { PluginKVStore } from './kv'; @@ -27,6 +28,204 @@ import { } from '@openzeppelin/relayer-sdk'; import { DEFAULT_SOCKET_REQUEST_TIMEOUT_MS } from './constants'; +/** + * Context Pool - Reuses VM contexts to avoid expensive createContext() calls. + * Creating a VM context takes 5-20ms. By pooling, we reduce this to near-zero for warm workers. + */ +class ContextPool { + private available: vm.Context[] = []; + private readonly maxSize = 10; // Max contexts to cache per worker + + acquire(): vm.Context { + const ctx = this.available.pop(); + if (ctx) { + // Reuse context - reset any mutable state + this.resetContext(ctx); + return ctx; + } + // Create new context if pool is empty + return this.createFreshContext(); + } + + release(ctx: vm.Context): void { + // Return to pool if not at capacity + if (this.available.length < this.maxSize) { + this.available.push(ctx); + } + // Otherwise let GC collect it + } + + private createFreshContext(): vm.Context { + // This will be populated with globals in executeInSandbox + return vm.createContext({}); + } + + private resetContext(ctx: vm.Context): void { + // Reset any global pollution from previous execution + // This is much faster than creating a new context + try { + vm.runInContext(` + // Clear any plugin-added globals + if (typeof globalThis.__pluginState !== 'undefined') { + delete globalThis.__pluginState; + } + `, ctx, { timeout: 100 }); + } catch { + // Ignore reset errors - context will be replaced + } + } + + clear(): void { + // Emergency cleanup - drop all cached contexts + this.available = []; + } +} + +/** + * Script Cache - Reuses compiled VM scripts to avoid recompilation. + * Compiling a script takes 1-5ms. Caching eliminates this for repeated code. + * Memory-aware: monitors heap usage and proactively evicts under pressure. + */ +class ScriptCache { + private cache = new Map(); + private readonly maxSize = 100; // Max scripts to cache per worker + private lastMemoryCheck = 0; + private readonly memoryCheckInterval = 5000; // Check every 5s + + get(code: string): vm.Script | undefined { + // Periodic memory check on get operations + this.maybeCheckMemory(); + + const entry = this.cache.get(code); + if (entry) { + // Update access timestamp for LRU + entry.timestamp = Date.now(); + return entry.script; + } + return undefined; + } + + set(code: string, script: vm.Script): void { + // Check memory before adding + this.maybeCheckMemory(); + + // Evict oldest entry if at capacity (FIFO) + if (this.cache.size >= this.maxSize) { + this.evictOldest(1); + } + this.cache.set(code, { script, timestamp: Date.now() }); + } + + /** + * Periodic memory check - evict cache if heap is under pressure. + */ + private maybeCheckMemory(): void { + const now = Date.now(); + if (now - this.lastMemoryCheck < this.memoryCheckInterval) { + return; + } + this.lastMemoryCheck = now; + + const usage = process.memoryUsage(); + const heapStats = v8.getHeapStatistics(); + // Use heap_size_limit (the actual max heap) instead of heapTotal (current allocated) + // heapTotal grows dynamically and can be much smaller than the configured max, + // causing false positive pressure detection (e.g., 28MB/30MB = 93% when max is 26GB) + const heapUsedRatio = usage.heapUsed / heapStats.heap_size_limit; + + // At 70% heap usage, evict 25% of cache + if (heapUsedRatio >= 0.70 && this.cache.size > 0) { + const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); + console.warn( + `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + + `evicting ${evictCount} scripts` + ); + this.evictOldest(evictCount); + } + + // At 85% heap usage, evict 50% of cache + if (heapUsedRatio >= 0.85 && this.cache.size > 0) { + const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.5)); + console.warn( + `[worker-cache] HIGH memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + + `evicting ${evictCount} scripts` + ); + this.evictOldest(evictCount); + } + } + + evictOldest(count: number): void { + // Sort by timestamp (oldest first) and evict + const entries = [...this.cache.entries()].sort( + (a, b) => a[1].timestamp - b[1].timestamp + ); + + let evicted = 0; + for (const [key] of entries) { + if (evicted >= count) break; + this.cache.delete(key); + evicted++; + } + if (evicted > 0) { + console.log(`[worker-cache] Evicted ${evicted} oldest scripts`); + } + } + + clear(): void { + // Emergency cleanup - drop all cached scripts + const size = this.cache.size; + this.cache.clear(); + if (size > 0) { + console.log(`[worker-cache] Emergency eviction: cleared ${size} cached scripts`); + } + } + + size(): number { + return this.cache.size; + } +} + +/** + * Socket Pool - Reuses socket connections across tasks in the same worker. + * Creating a socket takes 0.1-1ms. Pooling reduces this overhead. + */ +class SocketPool { + private available: net.Socket[] = []; + private readonly maxSize = 5; // Max sockets to cache per worker + + acquire(socketPath: string): net.Socket | null { + // Try to reuse an available socket + const socket = this.available.pop(); + if (socket && socket.writable && !socket.destroyed) { + return socket; + } + // Socket not reusable, let caller create new one + return null; + } + + release(socket: net.Socket): void { + // Only pool if socket is still healthy and not at capacity + if (socket.writable && !socket.destroyed && this.available.length < this.maxSize) { + this.available.push(socket); + } else { + socket.destroy(); + } + } + + clear(): void { + // Clean up all pooled sockets + for (const socket of this.available) { + socket.destroy(); + } + this.available = []; + } +} + +// Worker-level pools (thread-safe since Piscina workers are single-threaded) +const contextPool = new ContextPool(); +const scriptCache = new ScriptCache(); +const socketPool = new SocketPool(); + /** * Task payload received from the worker pool */ @@ -79,6 +278,7 @@ export interface LogEntry { * Sandboxed Plugin API that communicates with the relayer via Unix socket. * This is a minimal implementation for use within the vm context. * Connection is lazy - only established when first API call is made. + * Uses socket pooling to reduce connection overhead. */ class SandboxPluginAPI implements PluginAPI { private socket: net.Socket | null = null; @@ -87,6 +287,8 @@ class SandboxPluginAPI implements PluginAPI { private connected: boolean = false; private httpRequestId?: string; private socketPath: string; + private readonly maxPendingRequests = 100; // Prevent memory leak from unbounded pending + private fromPool: boolean = false; // Track if socket is from pool constructor(socketPath: string, httpRequestId?: string) { this.socketPath = socketPath; @@ -98,49 +300,100 @@ class SandboxPluginAPI implements PluginAPI { if (this.connected) return; if (!this.connectionPromise) { - this.socket = net.createConnection(this.socketPath); - - this.connectionPromise = new Promise((resolve, reject) => { - this.socket!.on('connect', () => { - this.connected = true; - resolve(); - }); + // Try to get socket from pool first + const pooledSocket = socketPool.acquire(this.socketPath); + + if (pooledSocket) { + this.socket = pooledSocket; + this.fromPool = true; + this.connected = true; + this.connectionPromise = Promise.resolve(); + + // Set up error/close handlers for pooled socket to enable reconnection + this.setupSocketHandlers(this.socket); + } else { + // Create new socket if pool is empty + this.socket = net.createConnection(this.socketPath); + this.fromPool = false; + + this.connectionPromise = new Promise((resolve, reject) => { + this.socket!.on('connect', () => { + this.connected = true; + resolve(); + }); - this.socket!.on('error', (error) => { - this.rejectAllPending(error); - reject(error); - }); + this.socket!.on('error', (error) => { + this.handleSocketError(error); + reject(error); + }); - this.socket!.on('close', () => { - this.connected = false; - this.rejectAllPending(new Error('Socket closed unexpectedly')); + this.socket!.on('close', () => { + this.handleSocketClose(); + }); }); - }); - this.socket.on('data', (data) => { - data - .toString() - .split('\n') - .filter(Boolean) - .forEach((msg: string) => { - try { - const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); - } - } catch { - // Ignore malformed messages - } - }); - }); + this.socket.on('data', (data) => this.handleSocketData(data)); + } } await this.connectionPromise; } + /** + * Set up error/close/data handlers for a socket (pooled or new). + * This ensures sockets can trigger reconnection on failure. + */ + private setupSocketHandlers(socket: net.Socket): void { + socket.on('error', (error) => this.handleSocketError(error)); + socket.on('close', () => this.handleSocketClose()); + socket.on('data', (data) => this.handleSocketData(data)); + } + + /** + * Handle socket error - reject pending requests and reset connection state + */ + private handleSocketError(error: Error): void { + this.rejectAllPending(error); + // Reset connection state to force reconnection on next call + this.connected = false; + this.connectionPromise = null; + this.socket = null; + } + + /** + * Handle socket close - reset connection state to enable reconnection + */ + private handleSocketClose(): void { + this.connected = false; + this.rejectAllPending(new Error('Socket closed unexpectedly')); + // Reset connection state to force reconnection on next call + this.connectionPromise = null; + this.socket = null; + } + + /** + * Handle incoming data from socket + */ + private handleSocketData(data: Buffer): void { + data + .toString() + .split('\n') + .filter(Boolean) + .forEach((msg: string) => { + try { + const parsed = JSON.parse(msg); + const { requestId, result, error } = parsed; + const resolver = this.pending.get(requestId); + if (resolver) { + error ? resolver.reject(error) : resolver.resolve(result); + this.pending.delete(requestId); + } + } catch { + // Ignore malformed messages + } + }); + } + /** * Reject all pending requests with the given error. * Called on socket error or close to prevent hanging promises. @@ -223,6 +476,14 @@ class SandboxPluginAPI implements PluginAPI { } const message = JSON.stringify(msg) + '\n'; + // Check pending request limit to prevent memory leaks + if (this.pending.size >= this.maxPendingRequests) { + throw new Error( + `Too many concurrent API requests (max ${this.maxPendingRequests}). ` + + `Await previous requests before making new ones.` + ); + } + // Ensure we're connected before sending await this.ensureConnected(); @@ -258,12 +519,12 @@ class SandboxPluginAPI implements PluginAPI { } close(): void { - // Only close if we actually connected + // Return socket to pool if healthy, otherwise destroy if (this.socket) { - // Use destroy() for immediate close instead of end() which is graceful - // This ensures the Rust socket reader sees EOF immediately - this.socket.destroy(); + socketPool.release(this.socket); + this.socket = null; } + this.connected = false; } } @@ -289,14 +550,37 @@ function safeStringify(value: unknown): string { } /** - * Creates a console-like object that captures logs. + * Creates a console-like object that captures logs with lazy stringification. + * Stringification is deferred until logs are accessed to reduce overhead. */ function createSandboxConsole(logs: LogEntry[]): Console { const log = (level: LogEntry['level']) => (...args: any[]) => { - const message = args.map(arg => - typeof arg === 'object' ? safeStringify(arg) : String(arg) - ).join(' '); - logs.push({ level, message }); + // Store raw args, stringify lazily when accessed + const entry: any = { + level, + _args: args, // Store raw args + _stringified: false, + _message: '', + }; + + // Lazy getter for message + Object.defineProperty(entry, 'message', { + get() { + if (!this._stringified) { + this._message = this._args.map((arg: any) => + typeof arg === 'object' ? safeStringify(arg) : String(arg) + ).join(' '); + this._stringified = true; + // Clear raw args to free memory + delete this._args; + } + return this._message; + }, + enumerable: true, + configurable: true, + }); + + logs.push(entry); }; return { @@ -330,11 +614,15 @@ function createSandboxConsole(logs: LogEntry[]): Console { /** * Executes a compiled plugin in an isolated vm context. * This is the Piscina worker function. + * Uses context pooling and script caching for performance. */ export default async function executeInSandbox(task: SandboxTask): Promise { const logs: LogEntry[] = []; const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); const kv = new DefaultPluginKVStore(task.pluginId); + + // Acquire context from pool (much faster than creating new) + const context = contextPool.acquire(); try { // Create isolated context with limited globals @@ -342,9 +630,27 @@ export default async function executeInSandbox(task: SandboxTask): Promise require('crypto').randomUUID(), + getRandomValues: (arr: Uint8Array) => require('crypto').getRandomValues(arr), + }; + + // Create sandboxRequire function const BLOCKED_MODULES = new Set([ // Filesystem access 'fs', 'fs/promises', 'node:fs', 'node:fs/promises', @@ -393,23 +699,13 @@ export default async function executeInSandbox(task: SandboxTask): Promise require('crypto').randomUUID(), - getRandomValues: (arr: Uint8Array) => require('crypto').getRandomValues(arr), - }; - - // Create the sandbox context + // Populate context with globals (reused context from pool) // SECURITY: Only expose safe globals. Never expose: // - process (env vars, exit, argv) // - fs, child_process, net, http (I/O) // - eval, Function constructor (code execution) // - require for arbitrary modules - const context = vm.createContext({ + Object.assign(context, { // === Console for logging === console: sandboxConsole, @@ -504,11 +800,7 @@ export default async function executeInSandbox(task: SandboxTask): Promise { + // Return context to pool for reuse + contextPool.release(context); + + // Close API socket (non-blocking, don't throw) + try { + api.close(); + } catch (err) { + // Log but don't fail - cleanup is best-effort + } + + // Disconnect KV (async, don't throw) + try { + await kv.disconnect(); + } catch { // Ignore disconnect errors - connection may not have been established - }); + } } } diff --git a/plugins/lib/worker-pool.ts b/plugins/lib/worker-pool.ts index 73f0bc971..8b8b767e3 100644 --- a/plugins/lib/worker-pool.ts +++ b/plugins/lib/worker-pool.ts @@ -3,12 +3,30 @@ * * Manages a Piscina worker pool for executing compiled plugins. * Provides a high-level interface for running plugins with proper lifecycle management. + * + * ## Performance Tuning + * + * ### Memory Configuration + * Each worker thread runs with an increased heap size (512MB via resourceLimits) to prevent + * OOM errors under high load. Node.js v8 defaults to ~96MB heap per worker, which is + * insufficient when handling many concurrent plugin contexts (e.g., 2500+ VUs). + * + * Symptoms of insufficient heap: + * - "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory" + * - Workers crash during v8::internal::ContextDeserializer::Deserialize + * - Queue builds up (>50% capacity warnings) then all requests fail + * + * ### Thread Scaling + * - Worker threads scale dynamically based on PLUGIN_MAX_CONCURRENCY + * - Formula: max(cpuCount * 2, concurrency / 50, 8) with 64 thread cap + * - Each worker handles multiple concurrent tasks via Node.js async I/O */ import Piscina from 'piscina'; import * as path from 'node:path'; import * as fs from 'node:fs'; import * as os from 'node:os'; +import * as v8 from 'node:v8'; import { v4 as uuidv4 } from 'uuid'; import { compilePlugin, compilePluginSource, type CompilationResult } from './compiler'; import type { SandboxTask, SandboxResult, LogEntry } from './sandbox-executor'; @@ -105,26 +123,26 @@ interface PluginMetrics { totalExecutions: number; successfulExecutions: number; failedExecutions: number; - + // Timing metrics (in ms) totalExecutionTime: number; minExecutionTime: number; maxExecutionTime: number; - + // Cache metrics cacheHits: number; cacheMisses: number; - + // Compilation metrics totalCompilations: number; totalCompilationTime: number; - + // Per-plugin execution counts pluginExecutions: Map; - + // Error tracking errorsByType: Map; - + // Timestamps startTime: number; lastExecutionTime: number | null; @@ -174,14 +192,141 @@ function incrementBoundedMap( /** * In-memory cache for compiled plugin code + * Includes memory pressure awareness for proactive eviction */ class CompiledCodeCache { - private cache: Map = new Map(); + private cache: Map = new Map(); private maxAge: number; + private cleanupInterval!: NodeJS.Timeout; + private memoryCheckInterval!: NodeJS.Timeout; + private totalCacheSize: number = 0; + // Max cache size in bytes (100MB default - adjust under memory pressure) + private maxCacheSize: number = 100 * 1024 * 1024; + // Track last LRU access for smarter eviction + private accessOrder: string[] = []; constructor(maxAgeMs: number = 3600000) { // 1 hour default this.maxAge = maxAgeMs; + this.startCleanupTimer(); + this.startMemoryPressureMonitor(); + } + + /** + * Start periodic cleanup timer to evict expired entries. + * Runs every 5 minutes to prevent memory leaks. + */ + private startCleanupTimer(): void { + this.cleanupInterval = setInterval(() => { + this.evictExpired(); + }, 300000); // 5 minutes + // unref() allows process to exit even if timer is active + this.cleanupInterval.unref(); + } + + /** + * Start memory pressure monitoring - proactively evict cache under pressure. + * This helps prevent GC issues under high load. + */ + private startMemoryPressureMonitor(): void { + this.memoryCheckInterval = setInterval(() => { + this.checkMemoryPressure(); + }, 10000); // Every 10 seconds + this.memoryCheckInterval.unref(); + } + + /** + * Check memory pressure and evict cache entries proactively. + */ + private checkMemoryPressure(): void { + const usage = process.memoryUsage(); + const heapStats = v8.getHeapStatistics(); + // Use heap_size_limit (the actual max heap) instead of heapTotal (current allocated) + // heapTotal grows dynamically and can be much smaller than the configured max, + // causing false positive pressure detection (e.g., 28MB/30MB = 93% when max is 26GB) + const heapUsedRatio = usage.heapUsed / heapStats.heap_size_limit; + + // At 70% heap usage, start evicting oldest entries + if (heapUsedRatio >= 0.70) { + const evictCount = Math.ceil(this.cache.size * 0.25); // Evict 25% + if (evictCount > 0) { + console.warn( + `[cache] Memory pressure detected (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + + `evicting ${evictCount} oldest entries` + ); + this.evictOldest(evictCount); + + // Force GC if available + if (global.gc) { + try { + global.gc(); + } catch { + // Ignore + } + } + } + } + + // At 85% heap usage, be more aggressive + if (heapUsedRatio >= 0.85) { + const evictCount = Math.ceil(this.cache.size * 0.5); // Evict 50% + if (evictCount > 0) { + console.error( + `[cache] HIGH memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + + `evicting ${evictCount} entries` + ); + this.evictOldest(evictCount); + + // Force GC + if (global.gc) { + try { + global.gc(); + } catch { + // Ignore + } + } + } + } + } + + /** + * Evict all expired entries from the cache. + */ + private evictExpired(): void { + const now = Date.now(); + let evictedCount = 0; + for (const [key, entry] of this.cache.entries()) { + if (now - entry.timestamp > this.maxAge) { + this.totalCacheSize -= entry.size; + this.cache.delete(key); + evictedCount++; + } + } + if (evictedCount > 0) { + console.log(`[cache] Evicted ${evictedCount} expired entries`); + } + } + + /** + * Evict N oldest entries (LRU-style) - used under memory pressure. + */ + private evictOldest(count: number): void { + // Sort by timestamp (oldest first) + const entries = [...this.cache.entries()].sort( + (a, b) => a[1].timestamp - b[1].timestamp + ); + + let evicted = 0; + for (const [key, entry] of entries) { + if (evicted >= count) break; + this.totalCacheSize -= entry.size; + this.cache.delete(key); + evicted++; + } + + if (evicted > 0) { + console.log(`[cache] Evicted ${evicted} oldest entries under memory pressure`); + } } get(pluginPath: string): string | undefined { @@ -190,28 +335,74 @@ class CompiledCodeCache { // Check if expired if (Date.now() - entry.timestamp > this.maxAge) { + this.totalCacheSize -= entry.size; this.cache.delete(pluginPath); return undefined; } + // Update timestamp for LRU tracking + entry.timestamp = Date.now(); + return entry.code; } set(pluginPath: string, code: string): void { - this.cache.set(pluginPath, { code, timestamp: Date.now() }); + const size = Buffer.byteLength(code, 'utf8'); + + // Evict if adding this would exceed max cache size + while (this.totalCacheSize + size > this.maxCacheSize && this.cache.size > 0) { + this.evictOldest(1); + } + + const existing = this.cache.get(pluginPath); + if (existing) { + this.totalCacheSize -= existing.size; + } + + this.cache.set(pluginPath, { code, timestamp: Date.now(), size }); + this.totalCacheSize += size; } delete(pluginPath: string): boolean { + const entry = this.cache.get(pluginPath); + if (entry) { + this.totalCacheSize -= entry.size; + } return this.cache.delete(pluginPath); } clear(): void { this.cache.clear(); + this.totalCacheSize = 0; } has(pluginPath: string): boolean { return this.get(pluginPath) !== undefined; } + + /** + * Get current cache stats. + */ + stats(): { entries: number; totalSizeBytes: number; maxSizeBytes: number } { + return { + entries: this.cache.size, + totalSizeBytes: this.totalCacheSize, + maxSizeBytes: this.maxCacheSize, + }; + } + + /** + * Destroy the cache and stop cleanup timer. + */ + destroy(): void { + if (this.cleanupInterval) { + clearInterval(this.cleanupInterval); + } + if (this.memoryCheckInterval) { + clearInterval(this.memoryCheckInterval); + } + this.clear(); + } } /** @@ -312,12 +503,77 @@ export class WorkerPoolManager { this.isTemporaryWorkerFile = true; } + // Worker heap size from Rust config (based on concurrent tasks per worker) + // Formula: 512 + (concurrent_tasks * 8) MB - ensures enough heap for burst context creation + // Default to 2048MB if not passed (conservative for high load) + const workerHeapMb = parseInt(process.env.PLUGIN_WORKER_HEAP_MB || '2048', 10); + + console.error(`[worker-pool] Worker heap size: ${workerHeapMb}MB (per worker thread)`); + this.pool = new Piscina({ filename: this.compiledWorkerPath, minThreads: this.options.minThreads, maxThreads: this.options.maxThreads, concurrentTasksPerWorker: this.options.concurrentTasksPerWorker, idleTimeout: this.options.idleTimeout, + recordTiming: true, // Unless you need waitTime/runTime metrics + // Worker heap size scaled by concurrent tasks per worker + // Each vm.createContext() uses ~4-8MB, plus GC headroom + // Set by Rust via PLUGIN_WORKER_HEAP_MB env var + resourceLimits: { + maxOldGenerationSizeMb: workerHeapMb, + }, + }); + + // Track worker crashes for self-healing monitoring + let workerCrashCount = 0; + let lastCrashReset = Date.now(); + const CRASH_WINDOW_MS = 60000; // 1 minute window for crash rate monitoring + + // Listen to worker events for monitoring + this.pool.on('error', (err) => { + console.error('[worker-pool] Worker error (will be replaced):', err.message); + // Track errors that indicate memory issues + const errMsg = err.message.toLowerCase(); + if (errMsg.includes('heap') || errMsg.includes('memory') || errMsg.includes('allocation')) { + console.error('[worker-pool] Memory-related worker error detected - consider increasing worker heap size'); + } + // Don't throw - Piscina handles recovery + }); + + this.pool.on('workerExit', (workerId: number, exitCode: number) => { + // Reset crash counter periodically + const now = Date.now(); + if (now - lastCrashReset > CRASH_WINDOW_MS) { + workerCrashCount = 0; + lastCrashReset = now; + } + + if (exitCode !== 0) { + workerCrashCount++; + console.error( + `[worker-pool] Worker ${workerId} exited with code ${exitCode} ` + + `(replaced automatically, crashes in window: ${workerCrashCount})` + ); + + // Detect crash storms (many workers dying = likely OOM or GC issue) + if (workerCrashCount >= 3) { + console.error( + `[worker-pool] WARNING: ${workerCrashCount} worker crashes in ${CRASH_WINDOW_MS}ms - ` + + `possible memory pressure. Consider reducing PLUGIN_MAX_CONCURRENCY or increasing heap.` + ); + } + + // Exit codes that indicate memory issues + if (exitCode === 134 || exitCode === 137 || exitCode === 9) { + console.error( + `[worker-pool] Worker ${workerId} killed with signal (code ${exitCode}) - ` + + `likely OOM. Clearing script cache as mitigation.` + ); + // Clear cache as mitigation + this.compiledCache.clear(); + } + } }); this.initialized = true; @@ -329,7 +585,7 @@ export class WorkerPoolManager { */ private async compileExecutorOnTheFly(): Promise { const sandboxExecutorPath = path.resolve(__dirname, 'sandbox-executor.ts'); - + const esbuild = await import('esbuild'); const result = await esbuild.build({ entryPoints: [sandboxExecutorPath], @@ -353,23 +609,20 @@ export class WorkerPoolManager { * Pre-compile a plugin and cache the result. * * @param pluginPath - Path to the plugin source file + * @param pluginId - Optional plugin identifier for caching * @returns Compilation result */ async precompilePlugin(pluginPath: string, pluginId?: string): Promise { const startTime = Date.now(); const result = await compilePlugin(pluginPath); const compilationTime = Date.now() - startTime; - + this.metrics.totalCompilations++; this.metrics.totalCompilationTime += compilationTime; - - // Cache by pluginId if provided, otherwise by path - // Always cache by both to support lookups by either key + + // Cache by pluginId if provided, otherwise by path (single key to avoid duplication) const cacheKey = pluginId || pluginPath; this.compiledCache.set(cacheKey, result.code); - if (pluginId && pluginId !== pluginPath) { - this.compiledCache.set(pluginPath, result.code); - } return result; } @@ -387,10 +640,10 @@ export class WorkerPoolManager { const startTime = Date.now(); const result = await compilePluginSource(sourceCode, `${pluginId}.ts`); const compilationTime = Date.now() - startTime; - + this.metrics.totalCompilations++; this.metrics.totalCompilationTime += compilationTime; - + this.compiledCache.set(pluginId, result.code); return result; } @@ -501,15 +754,15 @@ export class WorkerPoolManager { try { const runPromise = this.pool!.run(task); - + const timeoutPromise = new Promise((_, reject) => { timeoutId = setTimeout(() => { reject(new Error(`Task timed out after ${taskTimeout}ms (worker may be stuck)`)); }, taskTimeout); }); - + const result: SandboxResult = await Promise.race([runPromise, timeoutPromise]); - + // Update execution metrics const executionTime = Date.now() - executionStartTime; this.metrics.totalExecutions++; @@ -517,7 +770,7 @@ export class WorkerPoolManager { this.metrics.totalExecutionTime += executionTime; this.metrics.minExecutionTime = Math.min(this.metrics.minExecutionTime, executionTime); this.metrics.maxExecutionTime = Math.max(this.metrics.maxExecutionTime, executionTime); - + if (result.success) { this.metrics.successfulExecutions++; } else { @@ -526,7 +779,7 @@ export class WorkerPoolManager { incrementBoundedMap(this.metrics.errorsByType, result.error.code, MAX_METRICS_ENTRIES); } } - + return { success: result.success, result: result.result, @@ -535,7 +788,7 @@ export class WorkerPoolManager { }; } catch (error) { const err = error as Error; - + // Update execution metrics for error case const executionTime = Date.now() - executionStartTime; this.metrics.totalExecutions++; @@ -545,7 +798,7 @@ export class WorkerPoolManager { this.metrics.minExecutionTime = Math.min(this.metrics.minExecutionTime, executionTime); this.metrics.maxExecutionTime = Math.max(this.metrics.maxExecutionTime, executionTime); incrementBoundedMap(this.metrics.errorsByType, 'WORKER_ERROR', MAX_METRICS_ENTRIES); - + return { success: false, error: { @@ -640,29 +893,29 @@ export class WorkerPoolManager { total: this.metrics.totalExecutions, successful: this.metrics.successfulExecutions, failed: this.metrics.failedExecutions, - successRate: this.metrics.totalExecutions > 0 - ? this.metrics.successfulExecutions / this.metrics.totalExecutions + successRate: this.metrics.totalExecutions > 0 + ? this.metrics.successfulExecutions / this.metrics.totalExecutions : 1, - avgExecutionTime: this.metrics.totalExecutions > 0 - ? this.metrics.totalExecutionTime / this.metrics.totalExecutions + avgExecutionTime: this.metrics.totalExecutions > 0 + ? this.metrics.totalExecutionTime / this.metrics.totalExecutions : 0, - minExecutionTime: this.metrics.minExecutionTime === Infinity - ? 0 + minExecutionTime: this.metrics.minExecutionTime === Infinity + ? 0 : this.metrics.minExecutionTime, maxExecutionTime: this.metrics.maxExecutionTime, }, cache: { hits: this.metrics.cacheHits, misses: this.metrics.cacheMisses, - hitRate: totalCacheAccesses > 0 - ? this.metrics.cacheHits / totalCacheAccesses + hitRate: totalCacheAccesses > 0 + ? this.metrics.cacheHits / totalCacheAccesses : 0, }, compilation: { total: this.metrics.totalCompilations, totalTime: this.metrics.totalCompilationTime, - avgTime: this.metrics.totalCompilations > 0 - ? this.metrics.totalCompilationTime / this.metrics.totalCompilations + avgTime: this.metrics.totalCompilations > 0 + ? this.metrics.totalCompilationTime / this.metrics.totalCompilations : 0, }, plugins: Object.fromEntries(this.metrics.pluginExecutions), @@ -689,7 +942,7 @@ export class WorkerPoolManager { this.pool = null; this.initialized = false; } - + // Clean up temporary compiled worker file to prevent disk space leak if (this.isTemporaryWorkerFile && this.compiledWorkerPath) { try { @@ -698,10 +951,11 @@ export class WorkerPoolManager { // Ignore errors - file may already be deleted or inaccessible } } - + this.compiledWorkerPath = null; this.isTemporaryWorkerFile = false; - this.compiledCache.clear(); + // Properly destroy cache (clears timer + entries) + this.compiledCache.destroy(); } } diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs index b3b68339a..16e3d695e 100644 --- a/src/services/plugins/config.rs +++ b/src/services/plugins/config.rs @@ -72,6 +72,8 @@ pub struct PluginConfig { pub nodejs_pool_concurrent_tasks: usize, /// Worker idle timeout in milliseconds pub nodejs_pool_idle_timeout_ms: u64, + /// Worker thread heap size in MB (each worker handles concurrent_tasks contexts) + pub nodejs_worker_heap_mb: usize, // === Socket Backlog (derived from max_concurrency) === /// Socket connection backlog for pending connections @@ -203,6 +205,20 @@ impl PluginConfig { let nodejs_pool_idle_timeout_ms = env_parse("PLUGIN_POOL_IDLE_TIMEOUT", DEFAULT_POOL_IDLE_TIMEOUT_MS); + // Worker heap size calculation + // Each vm.createContext() uses ~4-8MB, and we need headroom for GC + // Formula: base_heap + (concurrent_tasks * 8MB) + // This ensures workers can handle burst context creation without OOM + // Examples: + // - 50 concurrent tasks: 512 + (50 * 8) = 912MB + // - 200 concurrent tasks: 512 + (200 * 8) = 2112MB + // - 300 concurrent tasks: 512 + (300 * 8) = 2912MB + let base_worker_heap = 512_usize; + let heap_per_task = 8_usize; + let derived_worker_heap_mb = + base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task); + let nodejs_worker_heap_mb = env_parse("PLUGIN_WORKER_HEAP_MB", derived_worker_heap_mb); + // Socket backlog calculation // Use max of concurrency or default backlog to handle connection bursts // The 1.5x socket_max_connections provides headroom for connection churn: @@ -231,6 +247,7 @@ impl PluginConfig { nodejs_pool_max_threads, nodejs_pool_concurrent_tasks, nodejs_pool_idle_timeout_ms, + nodejs_worker_heap_mb, pool_socket_backlog, health_check_interval_secs, trace_timeout_ms, @@ -302,6 +319,7 @@ impl PluginConfig { nodejs_min_threads = self.nodejs_pool_min_threads, nodejs_max_threads = self.nodejs_pool_max_threads, nodejs_concurrent_tasks = self.nodejs_pool_concurrent_tasks, + nodejs_worker_heap_mb = self.nodejs_worker_heap_mb, tasks_per_thread = tasks_per_thread, socket_multiplier = %format!("{:.2}x", socket_ratio), queue_multiplier = %format!("{:.2}x", queue_ratio), @@ -343,6 +361,12 @@ impl Default for PluginConfig { .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) .min(300); + // Worker heap for Default impl + let base_worker_heap = 512_usize; + let heap_per_task = 8_usize; + let nodejs_worker_heap_mb = + base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task); + let default_backlog = DEFAULT_POOL_SOCKET_BACKLOG as usize; let pool_socket_backlog = max_concurrency.max(default_backlog); @@ -361,6 +385,7 @@ impl Default for PluginConfig { nodejs_pool_max_threads, nodejs_pool_concurrent_tasks, nodejs_pool_idle_timeout_ms: DEFAULT_POOL_IDLE_TIMEOUT_MS, + nodejs_worker_heap_mb, pool_socket_backlog, health_check_interval_secs: DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, trace_timeout_ms: DEFAULT_TRACE_TIMEOUT_MS, diff --git a/src/services/plugins/mod.rs b/src/services/plugins/mod.rs index 3f8ad918d..b97850fea 100644 --- a/src/services/plugins/mod.rs +++ b/src/services/plugins/mod.rs @@ -35,9 +35,6 @@ pub use script_executor::*; pub mod pool_executor; pub use pool_executor::*; -pub mod socket; -pub use socket::*; - pub mod shared_socket; pub use shared_socket::*; diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index c9c44719a..d2b315c34 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -10,9 +10,9 @@ use crossbeam::queue::SegQueue; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::process::Stdio; -use std::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize, Ordering}; +use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, AtomicU8, AtomicUsize, Ordering}; use std::sync::Arc; -use std::time::Duration; +use std::time::{Duration, Instant}; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use tokio::net::UnixStream; use tokio::process::{Child, Command}; @@ -23,6 +23,247 @@ use super::{ config::get_config, LogEntry, LogLevel, PluginError, PluginHandlerPayload, ScriptResult, }; +/// Lock-free ring buffer for tracking recent results (sliding window) +struct ResultRingBuffer { + buffer: Vec, // 0 = empty, 1 = success, 2 = failure + index: AtomicUsize, + size: usize, +} + +impl ResultRingBuffer { + fn new(size: usize) -> Self { + let mut buffer = Vec::with_capacity(size); + for _ in 0..size { + buffer.push(AtomicU8::new(0)); + } + Self { + buffer, + index: AtomicUsize::new(0), + size, + } + } + + fn record(&self, success: bool) { + let idx = self.index.fetch_add(1, Ordering::Relaxed) % self.size; + self.buffer[idx].store(if success { 1 } else { 2 }, Ordering::Relaxed); + } + + fn failure_rate(&self) -> f32 { + let mut total = 0; + let mut failures = 0; + + for slot in &self.buffer { + match slot.load(Ordering::Relaxed) { + 0 => {} // Empty slot + 1 => total += 1, // Success + 2 => { + total += 1; + failures += 1; + } + _ => {} + } + } + + if total < 10 { + return 0.0; // Not enough data to make decision + } + + (failures as f32) / (total as f32) + } +} + +/// Circuit breaker state for automatic degradation under stress +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CircuitState { + /// Normal operation - all requests allowed + Closed, + /// Degraded - some requests rejected to reduce load + HalfOpen, + /// Fully open - most requests rejected, recovery in progress + Open, +} + +/// Circuit breaker for managing pool health and automatic recovery +/// Tracks failure rates and response times to detect GC pressure +pub struct CircuitBreaker { + /// Current circuit state (encoded as u8 for atomic access) + /// 0 = Closed, 1 = HalfOpen, 2 = Open + state: AtomicU32, + /// Time when circuit opened (for recovery timing) + opened_at_ms: AtomicU64, + /// Consecutive successful requests in half-open state + recovery_successes: AtomicU32, + /// Average response time in ms (exponential moving average) + avg_response_time_ms: AtomicU32, + /// Number of restart attempts + restart_attempts: AtomicU32, + /// Sliding window of recent results (100 most recent) + recent_results: Arc, +} + +impl Default for CircuitBreaker { + fn default() -> Self { + Self::new() + } +} + +impl CircuitBreaker { + pub fn new() -> Self { + Self { + state: AtomicU32::new(0), // Closed + opened_at_ms: AtomicU64::new(0), + recovery_successes: AtomicU32::new(0), + avg_response_time_ms: AtomicU32::new(0), + restart_attempts: AtomicU32::new(0), + recent_results: Arc::new(ResultRingBuffer::new(100)), + } + } + + fn state(&self) -> CircuitState { + match self.state.load(Ordering::Relaxed) { + 0 => CircuitState::Closed, + 1 => CircuitState::HalfOpen, + _ => CircuitState::Open, + } + } + + fn set_state(&self, state: CircuitState) { + let val = match state { + CircuitState::Closed => 0, + CircuitState::HalfOpen => 1, + CircuitState::Open => 2, + }; + self.state.store(val, Ordering::Relaxed); + } + + /// Record a successful request with response time + pub fn record_success(&self, response_time_ms: u32) { + self.recent_results.record(true); + + // Update exponential moving average (alpha = 0.1) + let current = self.avg_response_time_ms.load(Ordering::Relaxed); + let new_avg = if current == 0 { + response_time_ms + } else { + (current * 9 + response_time_ms) / 10 + }; + self.avg_response_time_ms.store(new_avg, Ordering::Relaxed); + + // Handle state transitions on success + match self.state() { + CircuitState::HalfOpen => { + let successes = self.recovery_successes.fetch_add(1, Ordering::Relaxed) + 1; + // Require 10 consecutive successes to close circuit + if successes >= 10 { + tracing::info!("Circuit breaker closing - recovery successful"); + self.set_state(CircuitState::Closed); + self.recovery_successes.store(0, Ordering::Relaxed); + self.restart_attempts.store(0, Ordering::Relaxed); + } + } + CircuitState::Open => { + // Check if enough time has passed to try half-open + self.maybe_transition_to_half_open(); + } + CircuitState::Closed => {} + } + } + + /// Record a failed request + pub fn record_failure(&self) { + self.recent_results.record(false); + self.recovery_successes.store(0, Ordering::Relaxed); + + let failure_rate = self.recent_results.failure_rate(); + + match self.state() { + CircuitState::Closed => { + // Open circuit if failure rate > 50% (ring buffer requires at least 10 samples) + if failure_rate > 0.5 { + tracing::warn!( + failure_rate = %format!("{:.1}%", failure_rate * 100.0), + "Circuit breaker opening - high failure rate" + ); + self.open_circuit(); + } + } + CircuitState::HalfOpen => { + // Any failure in half-open sends back to open + tracing::warn!("Circuit breaker reopening - failure during recovery"); + self.open_circuit(); + } + CircuitState::Open => { + // Already open, just check for transition + self.maybe_transition_to_half_open(); + } + } + } + + fn open_circuit(&self) { + self.set_state(CircuitState::Open); + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_millis() as u64; + self.opened_at_ms.store(now, Ordering::Relaxed); + self.recovery_successes.store(0, Ordering::Relaxed); + } + + fn maybe_transition_to_half_open(&self) { + let opened_at = self.opened_at_ms.load(Ordering::Relaxed); + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_millis() as u64; + + // Wait at least 5 seconds before trying recovery + // Exponential backoff: 5s, 10s, 20s, 40s, max 60s + let attempts = self.restart_attempts.load(Ordering::Relaxed); + let backoff_ms = (5000u64 * (1 << attempts.min(4))).min(60000); + + if now - opened_at >= backoff_ms { + tracing::info!( + backoff_ms = backoff_ms, + "Circuit breaker transitioning to half-open" + ); + self.set_state(CircuitState::HalfOpen); + self.restart_attempts.fetch_add(1, Ordering::Relaxed); + } + } + + /// Check if request should be allowed based on circuit state + /// If recovery_allowance is provided, use it in HalfOpen state instead of default 10% + pub fn should_allow_request(&self, recovery_allowance: Option) -> bool { + match self.state() { + CircuitState::Closed => true, + CircuitState::HalfOpen => { + // Use recovery allowance if provided, otherwise default to 10% + let allowance = recovery_allowance.unwrap_or(10); + (rand::random::() % 100) < allowance + } + CircuitState::Open => { + // Check if we should transition to half-open + self.maybe_transition_to_half_open(); + // Recheck state after potential transition + matches!(self.state(), CircuitState::HalfOpen) + } + } + } + + /// Get current response time average for monitoring + pub fn avg_response_time(&self) -> u32 { + self.avg_response_time_ms.load(Ordering::Relaxed) + } + + /// Force circuit to closed state (for manual recovery) + pub fn force_close(&self) { + self.set_state(CircuitState::Closed); + self.recovery_successes.store(0, Ordering::Relaxed); + self.restart_attempts.store(0, Ordering::Relaxed); + // Note: Ring buffer will naturally overwrite old results, no need to clear + } +} + /// Health status information from the pool server #[derive(Debug, Clone)] pub struct HealthStatus { @@ -33,6 +274,14 @@ pub struct HealthStatus { pub pool_completed: Option, pub pool_queued: Option, pub success_rate: Option, + /// Circuit breaker state (Closed/HalfOpen/Open) + pub circuit_state: Option, + /// Average response time in ms + pub avg_response_time_ms: Option, + /// Whether recovery mode is active + pub recovering: Option, + /// Current recovery allowance percentage + pub recovery_percent: Option, } /// Message types for pool communication @@ -441,6 +690,14 @@ pub struct PoolManager { health_check_needed: Arc, /// Consecutive failure count for health checks consecutive_failures: Arc, + /// Circuit breaker for automatic degradation under GC pressure + circuit_breaker: Arc, + /// Last successful restart time (for backoff calculation) + last_restart_time_ms: Arc, + /// Is currently in recovery mode (gradual ramp-up) + recovery_mode: Arc, + /// Requests allowed during recovery (gradual increase) + recovery_allowance: Arc, } impl PoolManager { @@ -472,6 +729,10 @@ impl PoolManager { let health_check_needed = Arc::new(AtomicBool::new(false)); let consecutive_failures = Arc::new(AtomicU32::new(0)); + let circuit_breaker = Arc::new(CircuitBreaker::new()); + let last_restart_time_ms = Arc::new(AtomicU64::new(0)); + let recovery_mode = Arc::new(AtomicBool::new(false)); + let recovery_allowance = Arc::new(AtomicU32::new(0)); // Spawn background health check task to avoid atomic ops on hot path Self::spawn_health_check_task( @@ -479,6 +740,9 @@ impl PoolManager { config.health_check_interval_secs, ); + // Spawn background recovery ramp-up task + Self::spawn_recovery_task(recovery_mode.clone(), recovery_allowance.clone()); + Self { connection_pool, socket_path, @@ -489,9 +753,43 @@ impl PoolManager { max_queue_size, health_check_needed, consecutive_failures, + circuit_breaker, + last_restart_time_ms, + recovery_mode, + recovery_allowance, } } + /// Spawn background task to gradually increase recovery allowance + fn spawn_recovery_task(recovery_mode: Arc, recovery_allowance: Arc) { + tokio::spawn(async move { + let mut interval = tokio::time::interval(Duration::from_millis(500)); + interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); + + loop { + interval.tick().await; + + if recovery_mode.load(Ordering::Relaxed) { + let current = recovery_allowance.load(Ordering::Relaxed); + // Gradually increase from 10% to 100% over ~15 seconds + // 10 -> 20 -> 30 -> ... -> 100 + if current < 100 { + let new_allowance = (current + 10).min(100); + recovery_allowance.store(new_allowance, Ordering::Relaxed); + tracing::debug!( + allowance = new_allowance, + "Recovery mode: increasing request allowance" + ); + } else { + // Recovery complete + recovery_mode.store(false, Ordering::Relaxed); + tracing::info!("Recovery mode complete - full capacity restored"); + } + } + } + }); + } + /// Spawn background task to set health check flag periodically /// This avoids atomic operations on the hot path fn spawn_health_check_task(health_check_needed: Arc, interval_secs: u64) { @@ -731,12 +1029,39 @@ impl PoolManager { return Ok(()); } - // Check if the process is still running (fast check) + // Check if the process is still running (and reap zombies) let process_running = { - let process_guard = self.process.lock().await; - if let Some(child) = process_guard.as_ref() { - // Check if process is still alive by checking its ID - child.id().is_some() + let mut process_guard = self.process.lock().await; + if let Some(child) = process_guard.as_mut() { + // Actually check if process is still alive using try_wait() + // This returns Ok(Some(exit_status)) if process has exited, + // Ok(None) if still running, or Err if check failed + match child.try_wait() { + Ok(Some(exit_status)) => { + // Process has exited - log, clean up, and mark as not running + tracing::warn!( + exit_status = ?exit_status, + "Pool server process has exited" + ); + // Drop the child handle to reap zombie process + *process_guard = None; + false + } + Ok(None) => { + // Process is still running + true + } + Err(e) => { + // Failed to check status - assume dead to be safe + tracing::warn!( + error = %e, + "Failed to check pool server process status, assuming dead" + ); + // Clean up handle + *process_guard = None; + false + } + } } else { false } @@ -827,16 +1152,46 @@ impl PoolManager { // Get config values to pass to Node.js pool server let config = get_config(); + // Calculate heap size for pool server based on concurrency + // Pool server needs heap for: worker management, code cache, message buffering + // Formula: 512MB base + 32MB per 10 concurrent workers + let calculated_heap = 512 + ((config.max_concurrency / 10) * 32); + + // Cap at 8GB to prevent unreasonable allocations + let pool_server_heap_mb = calculated_heap.min(8192); + + if calculated_heap > 8192 { + tracing::warn!( + calculated_heap_mb = calculated_heap, + capped_heap_mb = pool_server_heap_mb, + max_concurrency = config.max_concurrency, + "Pool server heap calculation exceeded 8GB cap" + ); + } + + tracing::info!( + heap_mb = pool_server_heap_mb, + max_concurrency = config.max_concurrency, + "Configuring pool server heap size" + ); + + // Node.js options: heap size and expose GC for emergency recovery + let node_options = format!("--max-old-space-size={} --expose-gc", pool_server_heap_mb); + let mut child = Command::new("ts-node") .arg("--transpile-only") .arg(&pool_server_path) .arg(&self.socket_path) + // Pass Node.js flags via NODE_OPTIONS (ts-node doesn't accept them directly) + .env("NODE_OPTIONS", node_options) // Pass derived config to Node.js (single source of truth from Rust) .env("PLUGIN_MAX_CONCURRENCY", config.max_concurrency.to_string()) .env("PLUGIN_POOL_MIN_THREADS", config.nodejs_pool_min_threads.to_string()) .env("PLUGIN_POOL_MAX_THREADS", config.nodejs_pool_max_threads.to_string()) .env("PLUGIN_POOL_CONCURRENT_TASKS", config.nodejs_pool_concurrent_tasks.to_string()) .env("PLUGIN_POOL_IDLE_TIMEOUT", config.nodejs_pool_idle_timeout_ms.to_string()) + .env("PLUGIN_WORKER_HEAP_MB", config.nodejs_worker_heap_mb.to_string()) + .env("PLUGIN_POOL_SOCKET_BACKLOG", config.pool_socket_backlog.to_string()) .stdin(Stdio::null()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) @@ -890,6 +1245,7 @@ impl PoolManager { /// Execute a plugin via the pool /// Uses semaphore-based concurrency limiting with queue fallback + /// Includes circuit breaker for automatic degradation under GC pressure pub async fn execute_plugin( &self, plugin_id: String, @@ -901,16 +1257,44 @@ impl PoolManager { http_request_id: Option, timeout_secs: Option, ) -> Result { + // Get recovery allowance if in recovery mode + let recovery_allowance = if self.recovery_mode.load(Ordering::Relaxed) { + Some(self.recovery_allowance.load(Ordering::Relaxed)) + } else { + None + }; + + // Single unified check - circuit breaker handles recovery mode + if !self + .circuit_breaker + .should_allow_request(recovery_allowance) + { + let state = self.circuit_breaker.state(); + tracing::warn!( + plugin_id = %plugin_id, + circuit_state = ?state, + recovery_allowance = ?recovery_allowance, + "Request rejected by circuit breaker" + ); + return Err(PluginError::PluginExecutionError( + "Plugin system temporarily unavailable due to high load. Please retry shortly." + .to_string(), + )); + } + + let start_time = Instant::now(); + // Ensure pool is started and healthy self.ensure_started_and_healthy().await?; // Try direct execution first (fast path with pre-acquired permit) // If semaphore can't be acquired immediately, queue the request (slow path) + let circuit_breaker = self.circuit_breaker.clone(); match self.connection_pool.semaphore.clone().try_acquire_owned() { Ok(permit) => { // Fast path: execute directly with pre-acquired permit // This avoids queueing overhead for normal load - Self::execute_with_permit( + let result = Self::execute_with_permit( &self.connection_pool, Some(permit), plugin_id, @@ -922,7 +1306,33 @@ impl PoolManager { http_request_id, timeout_secs, ) - .await + .await; + + // Record result with circuit breaker + let elapsed_ms = start_time.elapsed().as_millis() as u32; + match &result { + Ok(_) => circuit_breaker.record_success(elapsed_ms), + Err(e) => { + circuit_breaker.record_failure(); + // Check if this error indicates the pool server is dead + // (EOF while parsing, broken pipe, connection refused, etc.) + if Self::is_dead_server_error(e) { + tracing::warn!( + error = %e, + "Detected dead pool server error, triggering health check for restart" + ); + // Set health check flag so next request triggers restart + self.health_check_needed.store(true, Ordering::Relaxed); + // Also clear the connection pool since connections are dead + let pool = self.connection_pool.clone(); + tokio::spawn(async move { + pool.clear().await; + }); + } + } + } + + result } Err(_) => { // Semaphore full - queue the request for backpressure @@ -942,7 +1352,7 @@ impl PoolManager { }; // Try non-blocking send first (fast path) - match self.request_tx.try_send(queued_request) { + let result = match self.request_tx.try_send(queued_request) { Ok(()) => { let queue_len = self.request_tx.len(); if queue_len > self.max_queue_size / 2 { @@ -1005,11 +1415,67 @@ impl PoolManager { "Plugin execution queue is closed".to_string(), )) } + }; + + // Record result with circuit breaker (for queued path) + let elapsed_ms = start_time.elapsed().as_millis() as u32; + match &result { + Ok(_) => circuit_breaker.record_success(elapsed_ms), + Err(e) => { + circuit_breaker.record_failure(); + // Check if this error indicates the pool server is dead + if Self::is_dead_server_error(e) { + tracing::warn!( + error = %e, + "Detected dead pool server error (queued path), triggering health check for restart" + ); + // Set health check flag so next request triggers restart + self.health_check_needed.store(true, Ordering::Relaxed); + // Also clear the connection pool since connections are dead + let pool = self.connection_pool.clone(); + tokio::spawn(async move { + pool.clear().await; + }); + } + } } + + result } } } + /// Check if an error indicates the pool server is dead and needs restart + /// Excludes plugin execution timeouts which are user errors, not server failures + fn is_dead_server_error(err: &PluginError) -> bool { + let error_str = err.to_string().to_lowercase(); + + // Exclude plugin execution timeouts (not a server issue) + if error_str.contains("handler timed out") + || (error_str.contains("plugin") && error_str.contains("timed out")) + { + return false; + } + + // Patterns that indicate the server process is dead or unreachable + let dead_server_patterns = [ + "eof while parsing", // JSON parse error - connection closed mid-message + "broken pipe", // Write to closed socket + "connection refused", // Server not listening + "connection reset", // Server forcefully closed + "not connected", // Socket not connected + "failed to connect", // Connection establishment failed + "socket file missing", // Unix socket file deleted + "no such file", // Socket file doesn't exist + "connection timed out", // Connection timeout (not execution timeout) + "connect timed out", // Connect operation timeout + ]; + + dead_server_patterns + .iter() + .any(|pattern| error_str.contains(pattern)) + } + /// Precompile a plugin pub async fn precompile_plugin( &self, @@ -1111,7 +1577,23 @@ impl PoolManager { /// which is NOT the same as the server being down. Use ensure_started_and_healthy() for /// automatic recovery which distinguishes between these cases. pub async fn health_check(&self) -> Result { + // Helper to get circuit breaker info for all responses + let circuit_info = || { + let state = match self.circuit_breaker.state() { + CircuitState::Closed => "closed", + CircuitState::HalfOpen => "half_open", + CircuitState::Open => "open", + }; + ( + Some(state.to_string()), + Some(self.circuit_breaker.avg_response_time()), + Some(self.recovery_mode.load(Ordering::Relaxed)), + Some(self.recovery_allowance.load(Ordering::Relaxed)), + ) + }; + if !*self.initialized.read().await { + let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); return Ok(HealthStatus { healthy: false, status: "not_initialized".to_string(), @@ -1120,11 +1602,16 @@ impl PoolManager { pool_completed: None, pool_queued: None, success_rate: None, + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, }); } // First, do a fast check - is the socket file present? if !std::path::Path::new(&self.socket_path).exists() { + let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); return Ok(HealthStatus { healthy: false, status: "socket_missing".to_string(), @@ -1133,6 +1620,10 @@ impl PoolManager { pool_completed: None, pool_queued: None, success_rate: None, + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, }); } @@ -1149,6 +1640,7 @@ impl PoolManager { let is_pool_exhausted = err_str.contains("semaphore") || err_str.contains("Connection refused"); + let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); return Ok(HealthStatus { // Mark as "healthy" if just pool exhaustion - server is running, just busy healthy: is_pool_exhausted, @@ -1162,10 +1654,15 @@ impl PoolManager { pool_completed: None, pool_queued: None, success_rate: None, + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, }); } Err(_) => { // Timeout acquiring connection - pool is busy, server is likely healthy + let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); return Ok(HealthStatus { healthy: true, // Server running, just busy status: "pool_busy".to_string(), @@ -1174,6 +1671,10 @@ impl PoolManager { pool_completed: None, pool_queued: None, success_rate: None, + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, }); } }; @@ -1182,6 +1683,8 @@ impl PoolManager { task_id: Uuid::new_v4().to_string(), }; + let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); + match conn.send_request_with_timeout(&request, 5).await { Ok(response) => { if response.success { @@ -1210,6 +1713,10 @@ impl PoolManager { .get("execution") .and_then(|v| v.get("successRate")) .and_then(|v| v.as_f64()), + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, }) } else { Ok(HealthStatus { @@ -1223,6 +1730,10 @@ impl PoolManager { pool_completed: None, pool_queued: None, success_rate: None, + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, }) } } @@ -1236,6 +1747,10 @@ impl PoolManager { pool_completed: None, pool_queued: None, success_rate: None, + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, }) } } @@ -1346,16 +1861,44 @@ impl PoolManager { // Get config values to pass to Node.js pool server let config = get_config(); + // Calculate heap size for pool server based on concurrency + let calculated_heap = 512 + ((config.max_concurrency / 10) * 32); + + // Cap at 8GB to prevent unreasonable allocations + let pool_server_heap_mb = calculated_heap.min(8192); + + if calculated_heap > 8192 { + tracing::warn!( + calculated_heap_mb = calculated_heap, + capped_heap_mb = pool_server_heap_mb, + max_concurrency = config.max_concurrency, + "Pool server heap calculation exceeded 8GB cap during restart" + ); + } + + tracing::info!( + heap_mb = pool_server_heap_mb, + max_concurrency = config.max_concurrency, + "Configuring pool server heap size for restart" + ); + + // Node.js options: heap size and expose GC for emergency recovery + let node_options = format!("--max-old-space-size={} --expose-gc", pool_server_heap_mb); + let mut child = Command::new("ts-node") .arg("--transpile-only") .arg(&pool_server_path) .arg(&self.socket_path) + // Pass Node.js flags via NODE_OPTIONS + .env("NODE_OPTIONS", node_options) // Pass derived config to Node.js (single source of truth from Rust) .env("PLUGIN_MAX_CONCURRENCY", config.max_concurrency.to_string()) .env("PLUGIN_POOL_MIN_THREADS", config.nodejs_pool_min_threads.to_string()) .env("PLUGIN_POOL_MAX_THREADS", config.nodejs_pool_max_threads.to_string()) .env("PLUGIN_POOL_CONCURRENT_TASKS", config.nodejs_pool_concurrent_tasks.to_string()) .env("PLUGIN_POOL_IDLE_TIMEOUT", config.nodejs_pool_idle_timeout_ms.to_string()) + .env("PLUGIN_WORKER_HEAP_MB", config.nodejs_worker_heap_mb.to_string()) + .env("PLUGIN_POOL_SOCKET_BACKLOG", config.pool_socket_backlog.to_string()) .stdin(Stdio::null()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) @@ -1410,9 +1953,45 @@ impl PoolManager { *initialized = true; } + // Enable recovery mode - gradually ramp up request allowance + self.recovery_allowance.store(10, Ordering::Relaxed); // Start at 10% + self.recovery_mode.store(true, Ordering::Relaxed); + + // Close the circuit breaker after successful restart + self.circuit_breaker.force_close(); + + // Record restart time for backoff calculation + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_millis() as u64; + self.last_restart_time_ms.store(now, Ordering::Relaxed); + + tracing::info!("Recovery mode enabled - requests will gradually increase from 10%"); + Ok(()) } + /// Get current circuit breaker state for monitoring + pub fn circuit_state(&self) -> CircuitState { + self.circuit_breaker.state() + } + + /// Get average response time in ms (for monitoring) + pub fn avg_response_time_ms(&self) -> u32 { + self.circuit_breaker.avg_response_time() + } + + /// Check if currently in recovery mode + pub fn is_recovering(&self) -> bool { + self.recovery_mode.load(Ordering::Relaxed) + } + + /// Get current recovery allowance percentage (0-100) + pub fn recovery_allowance_percent(&self) -> u32 { + self.recovery_allowance.load(Ordering::Relaxed) + } + /// Shutdown the pool server pub async fn shutdown(&self) -> Result<(), PluginError> { let mut initialized = self.initialized.write().await; diff --git a/src/services/plugins/runner.rs b/src/services/plugins/runner.rs index be3aba62c..bde1095b1 100644 --- a/src/services/plugins/runner.rs +++ b/src/services/plugins/runner.rs @@ -1,22 +1,22 @@ //! This module is the orchestrator of the plugin execution. //! -//! 1. Initiates a socket connection to the relayer server - socket.rs +//! 1. Initiates connection to shared socket service - shared_socket.rs //! 2. Executes the plugin script - script_executor.rs OR pool_executor.rs -//! 3. Sends the shutdown signal to the relayer server - socket.rs -//! 4. Waits for the relayer server to finish the execution - socket.rs -//! 5. Returns the output of the script - script_executor.rs +//! 3. Collects traces via ExecutionGuard - shared_socket.rs +//! 4. Returns the output of the script - script_executor.rs //! //! ## Execution Modes //! //! - **ts-node mode** (default): Spawns ts-node per request. Simple but slower. +//! Uses the shared socket for bidirectional communication. //! - **Pool mode** (`PLUGIN_USE_POOL=true`): Uses persistent Piscina worker pool. //! Faster execution with precompilation and worker reuse. //! use std::{collections::HashMap, sync::Arc, time::Duration}; use crate::services::plugins::{ - ensure_shared_socket_started, get_pool_manager, get_shared_socket_service, RelayerApi, - ScriptExecutor, ScriptResult, SocketService, + ensure_shared_socket_started, get_pool_manager, get_shared_socket_service, ScriptExecutor, + ScriptResult, }; use crate::{ jobs::JobProducerTrait, @@ -32,7 +32,8 @@ use crate::{ use super::{config::get_config, PluginError}; use async_trait::async_trait; -use tokio::{sync::oneshot, time::timeout}; +use tokio::time::timeout; +use tracing::debug; use uuid::Uuid; #[cfg(test)] @@ -148,12 +149,12 @@ impl PluginRunnerTrait for PluginRunner { } impl PluginRunner { - /// Execute plugin using ts-node (legacy mode) + /// Execute plugin using ts-node with shared socket #[allow(clippy::too_many_arguments)] async fn run_with_tsnode( &self, plugin_id: String, - socket_path: &str, + _socket_path: &str, // Unused - kept for signature compatibility script_path: String, timeout_duration: Duration, script_params: String, @@ -177,24 +178,29 @@ impl PluginRunner { PR: PluginRepositoryTrait + Send + Sync + 'static, AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, { - let socket_service = SocketService::new(socket_path)?; - let socket_path_clone = socket_service.socket_path().to_string(); + // Ensure shared socket is started + ensure_shared_socket_started(Arc::clone(&state)).await?; + + // Get the shared socket service + let shared_socket = get_shared_socket_service()?; + let shared_socket_path = shared_socket.socket_path().to_string(); - let (shutdown_tx, shutdown_rx) = oneshot::channel(); + // Generate execution_id from http_request_id or plugin_id + let execution_id = http_request_id + .clone() + .unwrap_or_else(|| format!("{}-{}", plugin_id, uuid::Uuid::new_v4())); - let server_handle = tokio::spawn(async move { - let relayer_api = Arc::new(RelayerApi); - socket_service.listen(shutdown_rx, state, relayer_api).await - }); + // Register execution (RAII guard auto-unregisters on drop) + let guard = shared_socket.register_execution(execution_id.clone()).await; let exec_outcome = match timeout( timeout_duration, ScriptExecutor::execute_typescript( plugin_id, script_path, - socket_path_clone, + shared_socket_path, // Use shared socket path script_params, - http_request_id, + Some(execution_id), headers_json, ), ) @@ -202,21 +208,19 @@ impl PluginRunner { { Ok(result) => result, Err(_) => { - // ensures the socket gets closed. - let _ = shutdown_tx.send(()); return Err(PluginError::ScriptTimeout(timeout_duration.as_secs())); } }; - let _ = shutdown_tx.send(()); - - let server_handle = server_handle - .await - .map_err(|e| PluginError::SocketError(e.to_string()))?; - - let traces = match server_handle { - Ok(traces) => traces, - Err(e) => return Err(PluginError::SocketError(e.to_string())), + // Collect traces from the guard + let mut traces_rx = guard.into_receiver(); + let traces = match tokio::time::timeout(Duration::from_secs(5), traces_rx.recv()).await { + Ok(Some(traces)) => traces, + Ok(None) => Vec::new(), + Err(_) => { + debug!("Timeout waiting for traces"); + Vec::new() + } }; match exec_outcome { diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs index b1a739810..0ea0fa670 100644 --- a/src/services/plugins/shared_socket.rs +++ b/src/services/plugins/shared_socket.rs @@ -1,12 +1,125 @@ //! Shared Socket Service //! -//! This module provides a shared Unix socket service that handles multiple -//! concurrent plugin executions. Instead of creating a new socket per execution, -//! all plugins connect to a single shared socket, dramatically reducing overhead. +//! This module provides a unified bidirectional Unix socket service for plugin communication. +//! Instead of creating separate sockets for registration and API calls, all communication +//! happens over a single shared socket, dramatically reducing overhead and complexity. //! -//! The key insight: Each plugin execution creates ONE connection, and responses -//! go back over that same connection. The connection itself provides isolation, -//! so we don't need complex routing - just handle each connection independently. +//! ## Architecture +//! +//! **Single Shared Socket**: All plugins connect to `/tmp/relayer-plugin-shared.sock` +//! +//! **Bidirectional Communication**: +//! - Plugins โ†’ Host: Register, ApiRequest, Trace, Shutdown +//! - Host โ†’ Plugins: ApiResponse +//! +//! **Connection Tagging (Security)**: Each connection is "tagged" with an execution_id +//! after the first Register message. All subsequent messages are validated against this +//! tagged ID to prevent spoofing attacks (Plugin A cannot impersonate Plugin B). +//! +//! ## Message Protocol +//! +//! All messages are JSON objects with a `type` field that discriminates the message type: +//! +//! ### Plugin โ†’ Host Messages +//! +//! **Register** (first message, required): +//! ```json +//! { +//! "type": "register", +//! "execution_id": "abc-123" +//! } +//! ``` +//! +//! **ApiRequest** (call Relayer API): +//! ```json +//! { +//! "type": "api_request", +//! "request_id": "req-1", +//! "relayer_id": "relayer-1", +//! "method": "sendTransaction", +//! "payload": { "to": "0x...", "value": "100" } +//! } +//! ``` +//! +//! **Trace** (observability event): +//! ```json +//! { +//! "type": "trace", +//! "trace": { "event": "processing", "timestamp": 1234567890 } +//! } +//! ``` +//! +//! **Shutdown** (graceful close): +//! ```json +//! { +//! "type": "shutdown" +//! } +//! ``` +//! +//! ### Host โ†’ Plugin Messages +//! +//! **ApiResponse** (Relayer API result): +//! ```json +//! { +//! "type": "api_response", +//! "request_id": "req-1", +//! "result": { "id": "tx-123", "status": "success" }, +//! "error": null +//! } +//! ``` +//! +//! ## Security Model +//! +//! The connection tagging mechanism prevents execution_id spoofing: +//! +//! 1. Plugin connects to shared socket +//! 2. Plugin sends Register message with execution_id +//! 3. Host "tags" the connection (file descriptor) with that execution_id +//! 4. All subsequent messages are validated against the tagged ID +//! 5. Attempts to change execution_id are rejected and connection is closed +//! +//! This ensures Plugin A cannot send requests pretending to be Plugin B, even though +//! they share the same socket file. +//! +//! ## Backward Compatibility +//! +//! The handle_connection method maintains backward compatibility with the legacy +//! Request/Response format from socket.rs. If a message doesn't parse as PluginMessage, +//! it attempts to parse as the legacy Request format and handles it accordingly. +//! +//! ## Performance Benefits vs Per-Execution Sockets +//! +//! | Metric | Shared Socket | Per-Execution Socket | +//! |--------|---------------|----------------------| +//! | File descriptors | 1 per plugin | 2 per plugin | +//! | Syscalls | ~50% fewer | Baseline | +//! | Connection setup | Reuse existing | Create new each time | +//! | Memory overhead | O(active executions) | O(active executions ร— 2) | +//! | Debugging | Single stream | Two separate streams | +//! +//! ## Example Usage +//! +//! ```rust,no_run +//! use openzeppelin_relayer::services::plugins::shared_socket::{ +//! get_shared_socket_service, ensure_shared_socket_started +//! }; +//! +//! # async fn example() -> Result<(), Box> { +//! // Get the global shared socket instance +//! let service = get_shared_socket_service()?; +//! +//! // Register an execution (returns RAII guard) +//! let guard = service.register_execution("exec-123".to_string()).await; +//! +//! // Plugin connects and sends messages over the shared socket... +//! // (handled automatically by the background listener) +//! +//! // Collect traces when done +//! let traces_rx = guard.into_receiver(); +//! let traces = traces_rx.recv().await; +//! # Ok(()) +//! # } +//! ``` use super::config::get_config; use crate::jobs::JobProducerTrait; @@ -19,6 +132,7 @@ use crate::repositories::{ TransactionCounterTrait, TransactionRepository, }; use crate::services::plugins::relayer_api::{RelayerApi, Request}; +use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; @@ -30,12 +144,41 @@ use tracing::{debug, info, warn}; use super::PluginError; +/// Unified message protocol for bidirectional communication +#[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(tag = "type", rename_all = "snake_case")] +pub enum PluginMessage { + /// Plugin registers its execution_id (first message from plugin) + Register { execution_id: String }, + /// Plugin requests a Relayer API call + ApiRequest { + request_id: String, + relayer_id: String, + method: crate::services::plugins::relayer_api::PluginMethod, + payload: serde_json::Value, + }, + /// Host responds to an API request + ApiResponse { + request_id: String, + result: Option, + error: Option, + }, + /// Plugin sends a trace event (for observability) + Trace { trace: serde_json::Value }, + /// Plugin signals completion + Shutdown, +} + /// Execution context for trace collection struct ExecutionContext { /// Channel to send traces back to the execution traces_tx: mpsc::Sender>, /// Creation timestamp for TTL cleanup created_at: Instant, + /// The execution_id bound to this connection (for security) + /// Once set, all messages must match this ID to prevent spoofing + #[allow(dead_code)] // Used for security validation, not directly read + bound_execution_id: String, } /// RAII guard for execution registration that auto-unregisters on drop @@ -138,6 +281,7 @@ impl SharedSocketService { ExecutionContext { traces_tx: tx, created_at: Instant::now(), + bound_execution_id: execution_id.clone(), }, ); @@ -328,6 +472,10 @@ impl SharedSocketService { } /// Handle a connection from a plugin + /// + /// Security: The first message must be a Register message. Once registered, + /// the connection is "tagged" with that execution_id and cannot be changed. + /// This prevents Plugin A from spoofing Plugin B's execution_id. async fn handle_connection( stream: UnixStream, relayer_api: Arc, @@ -353,7 +501,10 @@ impl SharedSocketService { let (r, mut w) = stream.into_split(); let mut reader = BufReader::new(r).lines(); let mut traces = Vec::new(); - let mut execution_id: Option = None; + + // Connection-bound execution_id (prevents spoofing) + // Once set, this cannot be changed for the lifetime of the connection + let mut bound_execution_id: Option = None; loop { // Read line with timeout to prevent hanging connections @@ -372,7 +523,7 @@ impl SharedSocketService { debug!("Shared socket service: received message"); - // Parse JSON once and reuse (avoiding double parsing) + // Parse once, discriminate on "type" field for efficiency let json_value: serde_json::Value = match serde_json::from_str(&line) { Ok(v) => v, Err(e) => { @@ -381,42 +532,149 @@ impl SharedSocketService { } }; - // Deserialize into Request from the already-parsed Value - let request: Request = match serde_json::from_value(json_value.clone()) { - Ok(req) => req, - Err(e) => { - warn!("Failed to parse request structure: {}", e); - continue; - } - }; + let has_type_field = json_value.get("type").is_some(); - // Move JSON into traces (no clone needed) - traces.push(json_value); + if has_type_field { + // New unified protocol + let message: PluginMessage = match serde_json::from_value(json_value) { + Ok(msg) => msg, + Err(e) => { + warn!("Failed to parse PluginMessage: {}", e); + continue; + } + }; + + // Handle message based on type + match message { + PluginMessage::Register { execution_id } => { + // First message must be Register + if bound_execution_id.is_some() { + warn!("Attempted to re-register connection (security violation)"); + break; + } - if execution_id.is_none() { - execution_id = request - .http_request_id - .clone() - .or_else(|| Some(request.request_id.clone())); - } + // Validate execution_id exists in registry + let map = executions.read().await; + if !map.contains_key(&execution_id) { + warn!("Unknown execution_id: {}", execution_id); + break; + } + drop(map); - let response = relayer_api.handle_request(request, &state).await; + debug!("Connection registered with execution_id: {}", execution_id); + bound_execution_id = Some(execution_id); + } - let response_str = serde_json::to_string(&response) - .map_err(|e| PluginError::PluginError(e.to_string()))? - + "\n"; + PluginMessage::ApiRequest { + request_id, + relayer_id, + method, + payload, + } => { + // Must be registered first + let exec_id = match &bound_execution_id { + Some(id) => id, + None => { + warn!("ApiRequest before Register (security violation)"); + break; + } + }; + + // Create Request for RelayerApi (method is already PluginMethod) + let request = Request { + request_id: request_id.clone(), + relayer_id, + method, + payload, + http_request_id: Some(exec_id.clone()), + }; + + // Handle the request + let response = relayer_api.handle_request(request, &state).await; + + // Send ApiResponse back + let api_response = PluginMessage::ApiResponse { + request_id: response.request_id, + result: response.result, + error: response.error, + }; + + let response_str = serde_json::to_string(&api_response) + .map_err(|e| PluginError::PluginError(e.to_string()))? + + "\n"; + + if let Err(e) = w.write_all(response_str.as_bytes()).await { + warn!("Failed to write API response: {}", e); + break; + } - if let Err(e) = w.write_all(response_str.as_bytes()).await { - warn!("Failed to write response: {}", e); - break; + if let Err(e) = w.flush().await { + warn!("Failed to flush API response: {}", e); + break; + } + } + + PluginMessage::Trace { trace } => { + // Collect trace for observability + traces.push(trace); + } + + PluginMessage::Shutdown => { + debug!("Plugin requested shutdown"); + break; + } + + PluginMessage::ApiResponse { .. } => { + warn!("Received ApiResponse from plugin (invalid direction)"); + continue; + } + } + } else { + // Legacy protocol (no "type" field) + if let Ok(request) = serde_json::from_value::(json_value.clone()) { + // Legacy format + traces.push(json_value); + + // Set execution_id from http_request_id or request_id if not bound + if bound_execution_id.is_none() { + bound_execution_id = request + .http_request_id + .clone() + .or_else(|| Some(request.request_id.clone())); + } + + // Handle legacy request + let response = relayer_api.handle_request(request, &state).await; + let response_str = serde_json::to_string(&response) + .map_err(|e| PluginError::PluginError(e.to_string()))? + + "\n"; + + if let Err(e) = w.write_all(response_str.as_bytes()).await { + warn!("Failed to write response: {}", e); + break; + } + + if let Err(e) = w.flush().await { + warn!("Failed to flush response: {}", e); + break; + } + } else { + warn!("Failed to parse message as either PluginMessage or legacy Request"); + } } } // Send traces back to caller if execution context exists - if let Some(exec_id) = execution_id { + if let Some(exec_id) = bound_execution_id { let map = executions.read().await; if let Some(ctx) = map.get(&exec_id) { - let _ = ctx.traces_tx.send(traces).await; + // Send traces with timeout to prevent blocking + match tokio::time::timeout(Duration::from_secs(5), ctx.traces_tx.send(traces)).await + { + Ok(Ok(())) => {} + Ok(Err(_)) => warn!("Trace channel closed for execution_id: {}", exec_id), + Err(_) => warn!("Timeout sending traces for execution_id: {}", exec_id), + } } } @@ -480,3 +738,254 @@ where let service = get_shared_socket_service()?; service.start(state).await } + +#[cfg(test)] +mod tests { + use super::*; + use crate::utils::mocks::mockutils::create_mock_app_state; + use actix_web::web; + use tempfile::tempdir; + use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; + use tokio::net::UnixStream; + + #[tokio::test] + async fn test_unified_protocol_register_and_api_request() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + // Start the service + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + // Register execution + let execution_id = "test-exec-123".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + // Give the listener time to start + tokio::time::sleep(Duration::from_millis(50)).await; + + // Connect as plugin + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Send Register message + let register_msg = PluginMessage::Register { + execution_id: execution_id.clone(), + }; + let msg_json = serde_json::to_string(®ister_msg).unwrap() + "\n"; + client.write_all(msg_json.as_bytes()).await.unwrap(); + + // Send ApiRequest + let api_request = PluginMessage::ApiRequest { + request_id: "req-1".to_string(), + relayer_id: "relayer-1".to_string(), + method: crate::services::plugins::relayer_api::PluginMethod::GetRelayerStatus, + payload: serde_json::json!({}), + }; + let req_json = serde_json::to_string(&api_request).unwrap() + "\n"; + client.write_all(req_json.as_bytes()).await.unwrap(); + client.flush().await.unwrap(); + + // Read ApiResponse + let (r, _w) = client.into_split(); + let mut reader = BufReader::new(r); + let mut response_line = String::new(); + reader.read_line(&mut response_line).await.unwrap(); + + let response: PluginMessage = serde_json::from_str(&response_line).unwrap(); + match response { + PluginMessage::ApiResponse { request_id, .. } => { + assert_eq!(request_id, "req-1"); + } + _ => panic!("Expected ApiResponse, got {:?}", response), + } + + service.shutdown().await; + } + + #[tokio::test] + async fn test_connection_tagging_prevents_spoofing() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared2.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-456".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register with execution_id + let register_msg = PluginMessage::Register { + execution_id: execution_id.clone(), + }; + let msg_json = serde_json::to_string(®ister_msg).unwrap() + "\n"; + client.write_all(msg_json.as_bytes()).await.unwrap(); + + // Try to re-register with different execution_id (security violation) + let spoofed_register = PluginMessage::Register { + execution_id: "different-exec-id".to_string(), + }; + let spoofed_json = serde_json::to_string(&spoofed_register).unwrap() + "\n"; + client.write_all(spoofed_json.as_bytes()).await.unwrap(); + client.flush().await.unwrap(); + + // Connection should be closed by server + tokio::time::sleep(Duration::from_millis(100)).await; + + // Try to read - should get EOF since connection was closed + let (r, _w) = client.into_split(); + let mut reader = BufReader::new(r); + let mut line = String::new(); + let result = reader.read_line(&mut line).await; + + // Should either get an error or EOF (0 bytes) + assert!(result.is_err() || result.unwrap() == 0); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_backward_compatibility_with_legacy_format() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared3.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-789".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Send legacy Request format (without PluginMessage wrapper) + let legacy_request = crate::services::plugins::relayer_api::Request { + request_id: "legacy-1".to_string(), + relayer_id: "relayer-1".to_string(), + method: crate::services::plugins::relayer_api::PluginMethod::GetRelayerStatus, + payload: serde_json::json!({}), + http_request_id: Some(execution_id.clone()), + }; + let legacy_json = serde_json::to_string(&legacy_request).unwrap() + "\n"; + client.write_all(legacy_json.as_bytes()).await.unwrap(); + client.flush().await.unwrap(); + + // Read legacy Response format + let (r, _w) = client.into_split(); + let mut reader = BufReader::new(r); + let mut response_line = String::new(); + reader.read_line(&mut response_line).await.unwrap(); + + let response: crate::services::plugins::relayer_api::Response = + serde_json::from_str(&response_line).unwrap(); + + assert_eq!(response.request_id, "legacy-1"); + // Note: GetRelayerStatus might return an error if relayer doesn't exist + // The important thing is we got a response in the correct format + assert!(response.result.is_some() || response.error.is_some()); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_trace_collection() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared4.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-trace".to_string(); + let guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register + let register_msg = PluginMessage::Register { + execution_id: execution_id.clone(), + }; + client + .write_all((serde_json::to_string(®ister_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + // Send trace events + let trace1 = PluginMessage::Trace { + trace: serde_json::json!({"event": "start", "timestamp": 1000}), + }; + client + .write_all((serde_json::to_string(&trace1).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + let trace2 = PluginMessage::Trace { + trace: serde_json::json!({"event": "processing", "timestamp": 2000}), + }; + client + .write_all((serde_json::to_string(&trace2).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + // Shutdown + let shutdown_msg = PluginMessage::Shutdown; + client + .write_all((serde_json::to_string(&shutdown_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + client.flush().await.unwrap(); + + drop(client); + + // Wait for connection to close and traces to be sent + tokio::time::sleep(Duration::from_millis(100)).await; + + // Collect traces + let mut traces_rx = guard.into_receiver(); + let traces = traces_rx.recv().await.unwrap(); + + // Should have collected 2 trace events + assert_eq!(traces.len(), 2); + assert_eq!(traces[0]["event"], "start"); + assert_eq!(traces[1]["event"], "processing"); + + service.shutdown().await; + } +} diff --git a/src/services/plugins/socket.rs b/src/services/plugins/socket.rs deleted file mode 100644 index f9d4f7967..000000000 --- a/src/services/plugins/socket.rs +++ /dev/null @@ -1,496 +0,0 @@ -//! This module is responsible for creating a socket connection to the relayer server. -//! It is used to send requests to the relayer server and processing the responses. -//! It also intercepts the logs, errors and return values. -//! -//! The socket connection is created using the `UnixListener`. -//! -//! 1. Creates a socket connection using the `UnixListener`. -//! 2. Each request payload is stringified by the client and added as a new line to the socket. -//! 3. The server reads the requests from the socket and processes them. -//! 4. The server sends the responses back to the client in the same format. By writing a new line in the socket -//! 5. When the client sends the socket shutdown signal, the server closes the socket connection. -//! -//! Example: -//! 1. Create a new socket connection using `/tmp/socket.sock` -//! 2. Client sends request (writes in `/tmp/socket.sock`): -//! ```json -//! { -//! "request_id": "123", -//! "relayer_id": "relayer1", -//! "method": "sendTransaction", -//! "payload": { -//! "to": "0x1234567890123456789012345678901234567890", -//! "value": "1000000000000000000" -//! } -//! } -//! ``` -//! 3. Server process the requests, calls the relayer API and sends back the response (writes in `/tmp/socket.sock`): -//! ```json -//! { -//! "request_id": "123", -//! "result": { -//! "id": "123", -//! "status": "success" -//! } -//! } -//! ``` -//! 4. Client reads the response (reads from `/tmp/socket.sock`): -//! ```json -//! { -//! "request_id": "123", -//! "result": { -//! "id": "123", -//! "status": "success" -//! } -//! } -//! ``` -//! 5. Once the client finishes the execution, it sends a shutdown signal to the server. -//! 6. The server closes the socket connection. -//! - -use crate::jobs::JobProducerTrait; -use crate::models::{ - NetworkRepoModel, NotificationRepoModel, RelayerRepoModel, SignerRepoModel, ThinDataAppState, - TransactionRepoModel, -}; -use crate::repositories::{ - ApiKeyRepositoryTrait, NetworkRepository, PluginRepositoryTrait, RelayerRepository, Repository, - TransactionCounterTrait, TransactionRepository, -}; -use std::sync::Arc; -use std::time::Duration; -use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; -use tokio::net::{UnixListener, UnixStream}; -use tokio::sync::{oneshot, Semaphore}; -use tracing::{debug, warn}; - -use super::{ - config::get_config, - relayer_api::{RelayerApiTrait, Request}, - PluginError, -}; - -pub struct SocketService { - socket_path: String, - listener: UnixListener, - /// Semaphore for connection limiting (prevents DoS) - connection_semaphore: Arc, - /// Read timeout per line (prevents hanging connections) - read_timeout: Duration, -} - -impl SocketService { - /// Creates a new socket service. - /// - /// # Arguments - /// - /// * `socket_path` - The path to the socket file. - pub fn new(socket_path: &str) -> Result { - // Remove existing socket file if it exists - let _ = std::fs::remove_file(socket_path); - - let listener = - UnixListener::bind(socket_path).map_err(|e| PluginError::SocketError(e.to_string()))?; - - // Use centralized config - let config = get_config(); - - Ok(Self { - socket_path: socket_path.to_string(), - listener, - connection_semaphore: Arc::new(Semaphore::new(config.socket_max_connections)), - read_timeout: Duration::from_secs(config.socket_read_timeout_secs), - }) - } - - pub fn socket_path(&self) -> &str { - &self.socket_path - } - - /// Listens for incoming connections and processes the requests. - /// - /// # Arguments - /// - /// * `shutdown_rx` - A receiver for the shutdown signal. - /// * `state` - The application state. - /// * `relayer_api` - The relayer API. - /// - /// # Returns - /// - /// A vector of traces. - #[allow(clippy::type_complexity)] - pub async fn listen( - self, - shutdown_rx: oneshot::Receiver<()>, - state: Arc>, - relayer_api: Arc, - ) -> Result, PluginError> - where - RA: RelayerApiTrait + 'static + Send + Sync, - J: JobProducerTrait + Send + Sync + 'static, - RR: RelayerRepository + Repository + Send + Sync + 'static, - TR: TransactionRepository - + Repository - + Send - + Sync - + 'static, - NR: NetworkRepository + Repository + Send + Sync + 'static, - NFR: Repository + Send + Sync + 'static, - SR: Repository + Send + Sync + 'static, - TCR: TransactionCounterTrait + Send + Sync + 'static, - PR: PluginRepositoryTrait + Send + Sync + 'static, - AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, - { - let mut shutdown = shutdown_rx; - - let mut traces = Vec::new(); - - debug!("Plugin API socket: listen loop started"); - - loop { - let state = Arc::clone(&state); - let relayer_api = Arc::clone(&relayer_api); - debug!("Plugin API socket: waiting for connection or shutdown"); - - // First, wait for either a connection or shutdown - let stream = tokio::select! { - biased; - - _ = &mut shutdown => { - debug!("Plugin API socket: shutdown signal received (while waiting for connection)"); - break; - } - - accept_result = self.listener.accept() => { - match accept_result { - Ok((stream, _)) => { - debug!("Plugin API socket: accepted connection"); - stream - } - Err(e) => { - debug!("Plugin API socket: accept error: {}", e); - continue; - } - } - } - }; - - // Now handle the connection with connection limiting - // Try to acquire semaphore permit (no race condition!) - let permit = match self.connection_semaphore.clone().try_acquire_owned() { - Ok(p) => p, - Err(_) => { - warn!("Plugin API socket: connection limit reached, rejecting connection"); - drop(stream); - continue; - } - }; - - let state_clone = Arc::clone(&state); - let relayer_api_clone = Arc::clone(&relayer_api); - let read_timeout = self.read_timeout; - - // Spawn handler with permit (auto-released on task completion) - let handle = tokio::spawn(async move { - let _permit = permit; // Hold until task completes - Self::handle_connection::( - stream, - state_clone, - relayer_api_clone, - read_timeout, - ) - .await - }); - tokio::pin!(handle); - - tokio::select! { - biased; - - _ = &mut shutdown => { - debug!("Plugin API socket: shutdown signal received (while handling connection)"); - // Abort the handler - it will be cancelled - handle.abort(); - break; - } - - result = &mut handle => { - debug!("Plugin API socket: connection handler completed"); - match result { - Ok(Ok(connection_traces)) => { - // Successfully collected traces from this connection - traces.extend(connection_traces); - } - Ok(Err(e)) => { - // Connection handler error - log but don't kill service - warn!("Plugin API socket: connection handler error: {}", e); - } - Err(e) if e.is_cancelled() => { - debug!("Plugin API socket: connection handler cancelled"); - } - Err(e) => { - // Connection handler panicked - log but don't kill service - warn!("Plugin API socket: connection handler panic: {}", e); - } - } - } - } - } - - debug!("Plugin API socket: listen loop exited"); - Ok(traces) - } - - /// Handles a new connection. - /// - /// # Arguments - /// - /// * `stream` - The stream to the client. - /// * `state` - The application state. - /// * `relayer_api` - The relayer API. - /// * `read_timeout` - Timeout for reading each line. - /// - /// # Returns - /// - /// A vector of traces. - #[allow(clippy::type_complexity)] - async fn handle_connection( - stream: UnixStream, - state: Arc>, - relayer_api: Arc, - read_timeout: Duration, - ) -> Result, PluginError> - where - RA: RelayerApiTrait + 'static + Send + Sync, - J: JobProducerTrait + 'static, - RR: RelayerRepository + Repository + Send + Sync + 'static, - TR: TransactionRepository - + Repository - + Send - + Sync - + 'static, - NR: NetworkRepository + Repository + Send + Sync + 'static, - NFR: Repository + Send + Sync + 'static, - SR: Repository + Send + Sync + 'static, - TCR: TransactionCounterTrait + Send + Sync + 'static, - PR: PluginRepositoryTrait + Send + Sync + 'static, - AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, - { - let (r, mut w) = stream.into_split(); - let mut reader = BufReader::new(r).lines(); - let mut traces = Vec::new(); - - debug!("Plugin API socket: handle_connection started"); - - loop { - // Read line with timeout to prevent hanging connections - let line = match tokio::time::timeout(read_timeout, reader.next_line()).await { - Ok(Ok(Some(line))) => line, - Ok(Ok(None)) => { - debug!("Plugin API socket: client closed connection (EOF)"); - break; - } - Ok(Err(e)) => { - warn!("Plugin API socket: read error: {}", e); - break; - } - Err(_) => { - debug!("Plugin API socket: read timeout"); - break; - } - }; - - debug!("Plugin API socket: received request"); - - // Parse JSON once and reuse (avoiding double parsing) - let json_value: serde_json::Value = match serde_json::from_str(&line) { - Ok(v) => v, - Err(e) => { - warn!("Plugin API socket: failed to parse JSON, skipping: {}", e); - continue; // Skip bad request, don't kill connection - } - }; - - // Deserialize into Request from the already-parsed Value - let request: Request = match serde_json::from_value(json_value.clone()) { - Ok(req) => req, - Err(e) => { - warn!( - "Plugin API socket: failed to parse request structure, skipping: {}", - e - ); - continue; // Skip bad request, don't kill connection - } - }; - - // Move JSON into traces (no extra clone needed) - traces.push(json_value); - - // Handle request - let response = relayer_api.handle_request(request, &state).await; - - // Serialize response with error handling - let response_str = match serde_json::to_string(&response) { - Ok(s) => s + "\n", - Err(e) => { - warn!("Plugin API socket: failed to serialize response: {}", e); - continue; // Skip this response, don't kill connection - } - }; - - // Write response with error handling - if let Err(e) = w.write_all(response_str.as_bytes()).await { - warn!("Plugin API socket: failed to write response: {}", e); - break; // Connection broken, exit - } - - // Flush to ensure response is sent immediately - if let Err(e) = w.flush().await { - warn!("Plugin API socket: failed to flush response: {}", e); - break; // Connection broken, exit - } - - debug!("Plugin API socket: sent response"); - } - - debug!("Plugin API socket: handle_connection finished"); - Ok(traces) - } -} - -#[cfg(test)] -mod tests { - use crate::{ - services::plugins::{MockRelayerApiTrait, PluginMethod, Response}, - utils::mocks::mockutils::{create_mock_app_state, create_mock_evm_transaction_request}, - }; - use actix_web::web; - use std::time::Duration; - - use super::*; - - use tempfile::tempdir; - use tokio::{ - io::{AsyncBufReadExt, BufReader}, - time::timeout, - }; - - #[tokio::test] - async fn test_socket_service_listen_and_shutdown() { - let temp_dir = tempdir().unwrap(); - let socket_path = temp_dir.path().join("test.sock"); - - let mock_relayer = MockRelayerApiTrait::default(); - - let service = SocketService::new(socket_path.to_str().unwrap()).unwrap(); - - let state = create_mock_app_state(None, None, None, None, None, None).await; - let (shutdown_tx, shutdown_rx) = oneshot::channel(); - - let listen_handle = tokio::spawn(async move { - service - .listen( - shutdown_rx, - Arc::new(web::ThinData(state)), - Arc::new(mock_relayer), - ) - .await - }); - - shutdown_tx.send(()).unwrap(); - - let result = timeout(Duration::from_millis(100), listen_handle).await; - assert!(result.is_ok(), "Listen handle timed out"); - assert!(result.unwrap().is_ok(), "Listen handle returned error"); - } - - #[tokio::test] - async fn test_socket_service_handle_connection() { - let temp_dir = tempdir().unwrap(); - let socket_path = temp_dir.path().join("test.sock"); - - let mut mock_relayer = MockRelayerApiTrait::default(); - - mock_relayer.expect_handle_request().returning(|_, _| { - Box::pin(async move { - Response { - request_id: "test".to_string(), - result: Some(serde_json::json!("test")), - error: None, - } - }) - }); - - let service = SocketService::new(socket_path.to_str().unwrap()).unwrap(); - - let state = create_mock_app_state(None, None, None, None, None, None).await; - let (shutdown_tx, shutdown_rx) = oneshot::channel(); - - let listen_handle = tokio::spawn(async move { - service - .listen( - shutdown_rx, - Arc::new(web::ThinData(state)), - Arc::new(mock_relayer), - ) - .await - }); - - tokio::time::sleep(Duration::from_millis(50)).await; - - let mut client = UnixStream::connect(socket_path.to_str().unwrap()) - .await - .unwrap(); - - let request = Request { - request_id: "test".to_string(), - relayer_id: "test".to_string(), - method: PluginMethod::SendTransaction, - payload: serde_json::json!(create_mock_evm_transaction_request()), - http_request_id: None, - }; - - let request_json = serde_json::to_string(&request).unwrap() + "\n"; - - client.write_all(request_json.as_bytes()).await.unwrap(); - - let mut reader = BufReader::new(&mut client); - let mut response_str = String::new(); - let read_result = timeout( - Duration::from_millis(1000), - reader.read_line(&mut response_str), - ) - .await; - - assert!( - read_result.is_ok(), - "Reading response timed out: {:?}", - read_result - ); - let bytes_read = read_result.unwrap().unwrap(); - assert!(bytes_read > 0, "No data received"); - - // Close the client first, then wait a bit for the handler to complete - // before sending shutdown. This ensures the handler loop processes the - // connection closure and collects the traces. - client.shutdown().await.unwrap(); - tokio::time::sleep(Duration::from_millis(50)).await; - shutdown_tx.send(()).unwrap(); - - let response: Response = serde_json::from_str(&response_str).unwrap(); - - assert!(response.error.is_none(), "Error should be none"); - assert!(response.result.is_some(), "Result should be some"); - assert_eq!( - response.request_id, request.request_id, - "Request id mismatch" - ); - - let traces = listen_handle.await.unwrap().unwrap(); - - assert_eq!(traces.len(), 1); - let expected: serde_json::Value = serde_json::from_str(&request_json).unwrap(); - let actual: serde_json::Value = - serde_json::from_str(&serde_json::to_string(&traces[0]).unwrap()).unwrap(); - assert_eq!(expected, actual, "Request json mismatch with trace"); - } -} From 907a2b69154f86f300897de86a73d477ba9e8094 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Tue, 6 Jan 2026 15:34:36 +0100 Subject: [PATCH 07/42] chore: Refactor --- .gitignore | 4 + build.rs | 85 +- docs/plugins/index.mdx | 67 +- plugins/lib/pool-server.ts | 369 +++-- plugins/lib/worker-pool.ts | 107 +- plugins/tests/lib/pool-server.test.ts | 567 ++++++++ plugins/tests/lib/sandbox-executor.test.ts | 1014 ++++++++++++++ plugins/tests/lib/worker-pool.test.ts | 454 ++++++ src/main.rs | 5 +- src/services/plugins/config.rs | 242 +++- src/services/plugins/connection.rs | 333 +++++ src/services/plugins/health.rs | 608 +++++++++ src/services/plugins/mod.rs | 9 + src/services/plugins/pool_executor.rs | 1439 ++++++-------------- src/services/plugins/protocol.rs | 290 ++++ src/services/plugins/runner.rs | 22 +- src/services/plugins/script_executor.rs | 463 +++++++ src/services/plugins/shared_socket.rs | 568 ++++++++ 18 files changed, 5368 insertions(+), 1278 deletions(-) create mode 100644 plugins/tests/lib/pool-server.test.ts create mode 100644 plugins/tests/lib/sandbox-executor.test.ts create mode 100644 plugins/tests/lib/worker-pool.test.ts create mode 100644 src/services/plugins/connection.rs create mode 100644 src/services/plugins/health.rs create mode 100644 src/services/plugins/protocol.rs diff --git a/.gitignore b/.gitignore index 23a5ccbed..27b23f9b9 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,10 @@ test-results/ # Pre-compiled plugin executor (generated at build time) plugins/lib/sandbox-executor.js +# Build executor cache files +plugins/lib/.build-cache-hash +plugins/lib/sandbox-executor.js.sha256 + # TypeScript compiled output in plugins (we use ts-node for runtime) plugins/**/*.js plugins/**/*.js.map diff --git a/build.rs b/build.rs index fa21b1985..d06d05e02 100644 --- a/build.rs +++ b/build.rs @@ -2,43 +2,86 @@ use std::path::Path; use std::process::Command; fn main() { - // Only run if plugins directory exists let plugins_dir = Path::new("plugins"); if !plugins_dir.exists() { - println!("cargo:warning=plugins directory not found, skipping pnpm install"); + println!("cargo:warning=plugins directory not found, skipping plugin setup"); return; } + let node_modules = plugins_dir.join("node_modules"); + let sandbox_executor_ts = plugins_dir.join("lib/sandbox-executor.ts"); + let sandbox_executor_js = plugins_dir.join("lib/sandbox-executor.js"); + + // Tell Cargo when to rerun this script + println!("cargo:rerun-if-changed=plugins/lib/sandbox-executor.ts"); + println!("cargo:rerun-if-changed=plugins/package.json"); + // Check if pnpm is available let pnpm_check = Command::new("pnpm").arg("--version").output(); - if pnpm_check.is_err() { - println!("cargo:warning=pnpm not found in PATH, skipping plugin dependencies install"); - println!("cargo:warning=Please install pnpm and run 'pnpm install' in the plugins directory manually"); + println!("cargo:warning=pnpm not found in PATH, skipping plugin setup"); + println!("cargo:warning=Run 'pnpm install && pnpm run build' in plugins/ manually"); return; } - println!("cargo:warning=Running pnpm install in plugins directory..."); - - // Run pnpm install in plugins directory - let output = Command::new("pnpm") - .arg("install") - .current_dir(plugins_dir) - .output(); + // Only run pnpm install if node_modules is missing + if !node_modules.exists() { + println!("cargo:warning=Installing plugin dependencies..."); + let output = Command::new("pnpm") + .arg("install") + .arg("--ignore-scripts") // Skip postinstall, we'll build explicitly below + .current_dir(plugins_dir) + .output(); - match output { - Ok(output) => { - if output.status.success() { - println!("cargo:warning=โœ“ pnpm install completed successfully"); - } else { + match output { + Ok(output) if output.status.success() => { + println!("cargo:warning=โœ“ pnpm install completed"); + } + Ok(output) => { let stderr = String::from_utf8_lossy(&output.stderr); println!("cargo:warning=pnpm install failed: {}", stderr); - // Don't fail the build, just warn + return; + } + Err(e) => { + println!("cargo:warning=Failed to execute pnpm install: {}", e); + return; } } - Err(e) => { - println!("cargo:warning=Failed to execute pnpm install: {}", e); - // Don't fail the build, just warn + } + + // Build sandbox-executor if source is newer than output (or output missing) + let needs_build = if !sandbox_executor_js.exists() { + true + } else { + // Compare modification times + match ( + sandbox_executor_ts.metadata().and_then(|m| m.modified()), + sandbox_executor_js.metadata().and_then(|m| m.modified()), + ) { + (Ok(src_time), Ok(out_time)) => src_time > out_time, + _ => true, // Rebuild if we can't determine + } + }; + + if needs_build { + println!("cargo:warning=Building sandbox-executor..."); + let output = Command::new("pnpm") + .arg("run") + .arg("build") + .current_dir(plugins_dir) + .output(); + + match output { + Ok(output) if output.status.success() => { + println!("cargo:warning=โœ“ sandbox-executor built successfully"); + } + Ok(output) => { + let stderr = String::from_utf8_lossy(&output.stderr); + println!("cargo:warning=sandbox-executor build failed: {}", stderr); + } + Err(e) => { + println!("cargo:warning=Failed to build sandbox-executor: {}", e); + } } } } diff --git a/docs/plugins/index.mdx b/docs/plugins/index.mdx index b2fddb798..d203882db 100644 --- a/docs/plugins/index.mdx +++ b/docs/plugins/index.mdx @@ -655,11 +655,11 @@ The plugin system supports two execution modes: | Mode | Environment Variable | Description | |------|---------------------|-------------| -| **ts-node** (default) | `PLUGIN_USE_POOL=false` | Spawns a new process per request. Simple but slower. | -| **Pool mode** | `PLUGIN_USE_POOL=true` | Uses persistent worker pool. **Recommended for production.** | +| **Pool mode** (default) | `PLUGIN_USE_POOL=true` | Uses persistent worker pool. Best performance. | +| **ts-node mode** | `PLUGIN_USE_POOL=false` | Spawns a new process per request. Simpler but slower. | -Pool mode significantly improves performance by reusing worker processes and maintaining persistent connections. Enable it for any production deployment. +Pool mode is enabled by default since v1.4. It significantly improves performance by reusing worker processes and maintaining persistent connections. Use `PLUGIN_USE_POOL=false` only for debugging or if you encounter issues. ### Environment Variables Reference @@ -681,11 +681,12 @@ The system automatically derives on **both Rust and Node.js sides**: - `PLUGIN_POOL_MAX_CONNECTIONS` = 3000 (1:1 ratio) - `PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS` = 4500 (1.5x for headroom) - `PLUGIN_POOL_MAX_QUEUE_SIZE` = 6000 (2x for burst handling) -- `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` = 1000 (auto-scaled for high load) +- `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` = auto-scaled based on workload per thread (500-1000ms) **Node.js side (worker pool):** -- `PLUGIN_POOL_MAX_THREADS` = min(cpuCountร—2, concurrency/50, 64) -- `PLUGIN_POOL_CONCURRENT_TASKS` = max(10, concurrency/maxThreads) up to 50 +- `PLUGIN_POOL_MAX_THREADS` = memory-aware scaling (see below), capped at 32 +- `PLUGIN_POOL_CONCURRENT_TASKS` = (concurrency / maxThreads) ร— 1.2, capped at 250 +- `PLUGIN_WORKER_HEAP_MB` = 512 + (concurrent_tasks ร— 5), between 1024-2048MB #### Advanced Overrides (Power Users) @@ -707,18 +708,56 @@ export PLUGIN_POOL_MAX_QUEUE_SIZE=10000 | **Rust Side** |||| | `PLUGIN_POOL_MAX_CONNECTIONS` | 2048 | `MAX_CONCURRENCY` | Max connections to pool server | | `PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS` | 4096 | `MAX_CONCURRENCY ร— 1.5` | Max plugin connections to relayer | -| `PLUGIN_POOL_MAX_QUEUE_SIZE` | 5000 | `MAX_CONCURRENCY ร— 2` | Max queued requests | -| `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` | 500 | Auto-scaled | Wait time when queue is full | +| `PLUGIN_POOL_MAX_QUEUE_SIZE` | 4096 | `MAX_CONCURRENCY ร— 2` | Max queued requests | +| `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` | 500 | Workload-based (500-1000ms) | Wait time when queue is full | | `PLUGIN_POOL_CONNECT_RETRIES` | 15 | - | Retry attempts when connecting | | `PLUGIN_POOL_REQUEST_TIMEOUT_SECS` | 30 | - | Timeout for pool requests | | `PLUGIN_SOCKET_IDLE_TIMEOUT_SECS` | 60 | - | Close idle connections after | | `PLUGIN_SOCKET_READ_TIMEOUT_SECS` | 30 | - | Read timeout per message | | `PLUGIN_POOL_WORKERS` | auto | CPU cores | Queue processing workers | +| `PLUGIN_POOL_SOCKET_BACKLOG` | 2048 | `MAX_CONCURRENCY` | Socket connection backlog | | **Node.js Side** |||| -| `PLUGIN_POOL_MAX_THREADS` | auto | `MAX_CONCURRENCY / 50` | Worker threads in pool (capped at 64) | -| `PLUGIN_POOL_CONCURRENT_TASKS` | auto | `MAX_CONCURRENCY / maxThreads` | Tasks per worker (10-50) | +| `PLUGIN_POOL_MIN_THREADS` | auto | `max(2, cpuCount/2)` | Minimum worker threads | +| `PLUGIN_POOL_MAX_THREADS` | auto | Memory-aware (capped at 32) | Worker threads in pool | +| `PLUGIN_POOL_CONCURRENT_TASKS` | auto | `(concurrency/threads) ร— 1.2` | Tasks per worker (max 250) | +| `PLUGIN_WORKER_HEAP_MB` | auto | `512 + (tasks ร— 5)` | Worker heap size (1024-2048MB) | | `PLUGIN_POOL_IDLE_TIMEOUT` | 60000 | - | Worker idle timeout (ms) | +#### Memory-Aware Thread Scaling + +The plugin system automatically scales worker threads based on **both concurrency requirements AND available system memory**. This prevents out-of-memory issues on systems with limited RAM. + +**How it works:** +1. **Memory budget**: Uses 50% of system RAM for worker threads +2. **Per-worker allocation**: ~1GB heap budget per worker thread +3. **Concurrency scaling**: `concurrency / 200` threads (each thread handles ~200 concurrent requests via async I/O) +4. **Final calculation**: `min(memory_based, concurrency_based)`, capped at 32 threads + +**Examples:** + +| System RAM | Max Concurrency | Memory-Based | Concurrency-Based | Final Threads | +|------------|-----------------|--------------|-------------------|---------------| +| 16GB | 1000 | 8 | 5 | 5 | +| 16GB | 5000 | 8 | 25 | 8 | +| 32GB | 5000 | 16 | 25 | 16 | +| 64GB | 10000 | 32 | 50 | 32 | + + +This prevents the previous issue where high concurrency (e.g., 5000 VUs) would spawn too many threads, causing excessive memory pressure and GC pauses. + + +#### Queue Timeout Auto-Scaling + +The queue send timeout (`PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS`) automatically scales based on workload per thread: + +| Workload per Thread | Timeout | +|---------------------|---------| +| > 100 items/thread | 1000ms (heavy load) | +| 50-100 items/thread | 750ms (medium load) | +| < 50 items/thread | 500ms (light load) | + +This ensures requests have sufficient time to queue during traffic spikes while maintaining responsiveness under normal load. + #### Timeout Alignment @@ -747,21 +786,18 @@ Controls automatic health monitoring and recovery. #### Low Load (< 100 concurrent requests) ```bash -export PLUGIN_USE_POOL=true -# Default settings are sufficient +# Default settings are sufficient - pool mode is enabled automatically ``` #### Medium Load (100-1000 concurrent requests) ```bash -export PLUGIN_USE_POOL=true export PLUGIN_MAX_CONCURRENCY=1000 ``` #### High Load (1000-5000 concurrent requests) ```bash -export PLUGIN_USE_POOL=true export PLUGIN_MAX_CONCURRENCY=3000 export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=60 ``` @@ -769,7 +805,6 @@ export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=60 #### Extreme Load (5000+ concurrent requests) ```bash -export PLUGIN_USE_POOL=true export PLUGIN_MAX_CONCURRENCY=8000 export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=120 export PLUGIN_POOL_CONNECT_RETRIES=20 @@ -797,6 +832,8 @@ sudo sysctl -w kern.maxfilesperproc=65536 | `Failed to connect to pool after N attempts` | Pool server overwhelmed | Increase `PLUGIN_POOL_CONNECT_RETRIES` and `PLUGIN_POOL_MAX_CONNECTIONS` | | `ScriptTimeout(N)` | Plugin execution exceeded timeout | Increase `timeout` in plugin config (config.json) | | `All connection permits exhausted` | Connection pool at capacity | Increase `PLUGIN_POOL_MAX_CONNECTIONS` | +| `FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory` | Worker heap too small | Increase `PLUGIN_WORKER_HEAP_MB` or reduce `PLUGIN_POOL_CONCURRENT_TASKS` | +| `Pool server crashed and restarting` | Memory pressure or GC issues | Check logs for heap usage; reduce `PLUGIN_MAX_CONCURRENCY` or increase system RAM | When increasing limits significantly, monitor your system's memory and CPU usage. Each connection consumes resources. diff --git a/plugins/lib/pool-server.ts b/plugins/lib/pool-server.ts index ceffda374..333e67b11 100644 --- a/plugins/lib/pool-server.ts +++ b/plugins/lib/pool-server.ts @@ -54,11 +54,15 @@ function debug(...args: any[]): void { * Memory Pressure Monitor - Pool Server Edition * Monitors main process heap and logs warnings when approaching limits. * Pool server manages workers, code cache, and socket communication. - * + * * SELF-HEALING FEATURES: * - Proactive GC triggering at 80% heap usage * - Cache eviction at 85% heap usage * - Emergency restart signal at 95% (tells Rust to restart) + * + * ASYNC SAFETY: + * - All callbacks are queued to event loop via setImmediate to avoid blocking the timer + * - Emergency shutdown is tracked to prevent duplicate invocations */ class PoolServerMemoryMonitor { private checkInterval: NodeJS.Timeout | null = null; @@ -71,6 +75,8 @@ class PoolServerMemoryMonitor { private consecutiveHighPressure = 0; private onCacheEvictionRequest: (() => void) | null = null; private onEmergencyRestart: (() => void) | null = null; + /** Tracks if emergency shutdown has already been triggered (prevents duplicate calls) */ + private emergencyTriggered = false; start(): void { if (this.checkInterval) return; @@ -111,9 +117,9 @@ class PoolServerMemoryMonitor { const usage = process.memoryUsage(); const heapStats = v8.getHeapStatistics(); const heapUsed = usage.heapUsed; - // Use heap_size_limit (the actual max heap) instead of heapTotal (current allocated) - // heapTotal grows dynamically and can be much smaller than the configured max, - // causing false positive pressure detection (e.g., 28MB/30MB = 93% when max is 26GB) + // Use heap_size_limit (V8's configured maximum heap) instead of heapTotal + // heapTotal is the currently allocated heap which grows dynamically, + // heap_size_limit is the actual maximum (e.g., from --max-old-space-size) const heapLimit = heapStats.heap_size_limit; const heapUsedRatio = heapUsed / heapLimit; @@ -137,6 +143,12 @@ class PoolServerMemoryMonitor { } private handleEmergency(heapUsed: number, heapLimit: number, external: number, rss: number): void { + // Prevent duplicate emergency shutdowns + if (this.emergencyTriggered) { + return; + } + this.emergencyTriggered = true; + const heapUsedMB = Math.round(heapUsed / 1024 / 1024); const heapLimitMB = Math.round(heapLimit / 1024 / 1024); const percent = Math.round((heapUsed / heapLimit) * 100); @@ -156,9 +168,13 @@ class PoolServerMemoryMonitor { } } - // Signal emergency to any registered handlers + // Queue emergency callback to event loop to avoid blocking the timer + // This ensures the setInterval can continue and the async shutdown + // is handled properly without blocking other operations if (this.onEmergencyRestart) { - this.onEmergencyRestart(); + setImmediate(() => { + this.onEmergencyRestart!(); + }); } // Reset counter after emergency signal @@ -175,16 +191,18 @@ class PoolServerMemoryMonitor { const externalMB = Math.round(external / 1024 / 1024); const rssMB = Math.round(rss / 1024 / 1024); const percent = Math.round((heapUsed / heapLimit) * 100); - + console.error( `[pool-server] CRITICAL: Heap at ${heapUsedMB}MB / ${heapLimitMB}MB limit (${percent}%). ` + `External: ${externalMB}MB, RSS: ${rssMB}MB. ` + `Requesting cache eviction and forcing GC.` ); - // Request cache eviction + // Request cache eviction - queue to event loop to avoid blocking timer if (this.onCacheEvictionRequest) { - this.onCacheEvictionRequest(); + setImmediate(() => { + this.onCacheEvictionRequest!(); + }); } // Force GC @@ -302,6 +320,9 @@ class PoolServer { private server: net.Server | null = null; private socketPath: string; private running: boolean = false; + private shuttingDown: boolean = false; + private activeRequests: number = 0; + private readonly shutdownTimeoutMs: number = 30000; // 30 seconds max drain time constructor(socketPath: string) { this.socketPath = socketPath; @@ -370,8 +391,6 @@ class PoolServer { this.handleConnection(socket); }); - // Don't set maxConnections at all - the default is unlimited - // Setting it to 0 might reject all connections! // Log any server-level errors this.server.on('error', (err) => { @@ -426,51 +445,70 @@ class PoolServer { socket.setNoDelay(true); // Disable Nagle's algorithm for lower latency let buffer = ''; - let processing = false; + let processingPromise: Promise | null = null; const pendingLines: string[] = []; - const processQueue = async () => { - if (processing) return; - processing = true; + // Max buffer size to prevent OOM from malicious clients (10MB) + const MAX_BUFFER_SIZE = 10 * 1024 * 1024; + + const processQueue = async (): Promise => { + // Wait for any in-progress processing to complete (proper mutual exclusion) + if (processingPromise) { + await processingPromise; + } - while (pendingLines.length > 0) { - const line = pendingLines.shift()!; - if (!line.trim()) continue; - - try { - const message = JSON.parse(line) as Message; - debug('Processing message type:', message.type); - const response = await this.handleMessage(message); - debug('Sending response for task:', response.taskId); - // Check if socket is still writable before writing - if (socket.writable) { - socket.write(JSON.stringify(response) + '\n'); - } else { - debug('Socket no longer writable, discarding response'); - } - } catch (err) { - const error = err as Error; - debug('Error handling message:', error); - const response: Response = { - taskId: 'unknown', - success: false, - error: { - message: error.message || 'Failed to parse message', - code: 'PARSE_ERROR', - }, - }; - if (socket.writable) { - socket.write(JSON.stringify(response) + '\n'); + if (pendingLines.length === 0) return; + + processingPromise = (async () => { + while (pendingLines.length > 0) { + const line = pendingLines.shift()!; + if (!line.trim()) continue; + + try { + const message = JSON.parse(line) as Message; + debug('Processing message type:', message.type); + const response = await this.handleMessage(message); + debug('Sending response for task:', response.taskId); + // Check if socket is still writable before writing + if (socket.writable) { + socket.write(JSON.stringify(response) + '\n'); + } else { + debug('Socket no longer writable, discarding response'); + } + } catch (err) { + const error = err as Error; + debug('Error handling message:', error); + const response: Response = { + taskId: 'unknown', + success: false, + error: { + message: error.message || 'Failed to parse message', + code: 'PARSE_ERROR', + }, + }; + if (socket.writable) { + socket.write(JSON.stringify(response) + '\n'); + } } } - } + })(); - processing = false; + await processingPromise; + processingPromise = null; }; - socket.on('data', (data) => { + // Define handlers for proper cleanup on close + const dataHandler = (data: Buffer): void => { buffer += data.toString(); debug(`[${clientId}] Received data: ${data.length} bytes, buffer: ${buffer.length}`); + + // Buffer overflow protection - disconnect malicious clients + if (buffer.length > MAX_BUFFER_SIZE) { + console.error(`[pool-server] [${clientId}] Buffer overflow (${buffer.length} bytes), disconnecting`); + socket.destroy(); + return; + } + debug(`[${clientId}] Buffer content: ${buffer.substring(0, 200)}...`); // Extract complete messages (newline-delimited) @@ -485,21 +523,37 @@ class PoolServer { // Process queue (async but don't await here) processQueue().catch((err) => { console.error(`[pool-server] [${clientId}] Error in processQueue:`, err); + // Send error response so client doesn't hang + const response: Response = { + taskId: 'unknown', + success: false, + error: { message: 'Internal queue processing error', code: 'QUEUE_ERROR' }, + }; + if (socket.writable) { + socket.write(JSON.stringify(response) + '\n'); + } }); - }); + }; - socket.on('error', (err) => { + const errorHandler = (err: Error): void => { // Connection resets are normal during shutdown, don't log as errors if ((err as any).code === 'ECONNRESET') { debug(`[${clientId}] Connection reset`); } else { - console.warn(`[pool-server] [${clientId}] Socket error:`, err.message); + console.error(`[pool-server] [${clientId}] Socket error:`, err.message); } - }); + }; - socket.on('close', () => { - debug(`[${clientId}] Client disconnected`); - }); + const closeHandler = (): void => { + // Explicit cleanup of listeners (good practice for long-running servers) + socket.removeListener('data', dataHandler); + socket.removeListener('error', errorHandler); + debug(`[${clientId}] Client disconnected, listeners cleaned up`); + }; + + socket.on('data', dataHandler); + socket.on('error', errorHandler); + socket.once('close', closeHandler); } /** @@ -508,29 +562,85 @@ class PoolServer { private async handleMessage(message: Message): Promise { const { taskId } = message; + // Allow shutdown and health messages during shutdown, reject others + if (this.shuttingDown && message.type !== 'shutdown' && message.type !== 'health') { + return { + taskId, + success: false, + error: { + message: 'Server is shutting down, not accepting new requests', + code: 'SHUTTING_DOWN', + }, + }; + } + + // Track active requests for graceful shutdown draining + // Work requests get try/finally to ensure counter accuracy + const isWorkRequest = message.type === 'execute' || message.type === 'precompile'; + + if (isWorkRequest) { + this.activeRequests++; + try { + return await this.handleWorkRequest(message); + } finally { + this.activeRequests--; + } + } + + // Non-work requests don't need tracking + return this.handleNonWorkRequest(message); + } + + /** + * Handle work requests (execute, precompile) - tracked for graceful shutdown + */ + private async handleWorkRequest(message: ExecuteMessage | PrecompileMessage): Promise { + const { taskId } = message; try { switch (message.type) { case 'execute': return await this.handleExecute(message); - case 'precompile': return await this.handlePrecompile(message); + default: + // TypeScript exhaustiveness check + const _exhaustive: never = message; + return { + taskId, + success: false, + error: { message: 'Unknown work request type', code: 'UNKNOWN_TYPE' }, + }; + } + } catch (err) { + const error = err as Error; + return { + taskId, + success: false, + error: { + message: error.message || String(err), + code: 'HANDLER_ERROR', + }, + }; + } + } + /** + * Handle non-work requests (cache, invalidate, stats, health, shutdown) + */ + private async handleNonWorkRequest(message: Message): Promise { + const { taskId } = message; + try { + switch (message.type) { case 'cache': - return this.handleCache(message); - + return this.handleCache(message as CacheMessage); case 'invalidate': - return this.handleInvalidate(message); - + return this.handleInvalidate(message as InvalidateMessage); case 'stats': - return this.handleStats(message); - + return this.handleStats(message as StatsMessage); case 'health': - return this.handleHealth(message); - + return this.handleHealth(message as HealthMessage); case 'shutdown': - return await this.handleShutdown(message); - + return await this.handleShutdown(message as ShutdownMessage); default: return { taskId, @@ -715,21 +825,77 @@ class PoolServer { } /** - * Shutdown the server + * Shutdown the server gracefully + * 1. Stop accepting new requests + * 2. Wait for in-flight requests to complete (with timeout) + * 3. Clean up resources and exit */ private async handleShutdown(message: ShutdownMessage): Promise { - // Send response first, then shutdown - setTimeout(async () => { - await this.stop(); - process.exit(0); - }, 100); + if (this.shuttingDown) { + return { + taskId: message.taskId, + success: true, + result: { status: 'already_shutting_down', activeRequests: this.activeRequests }, + }; + } + + console.error(`[pool-server] Graceful shutdown initiated, ${this.activeRequests} active requests`); + this.shuttingDown = true; + + // Wait for in-flight requests to drain, then shutdown + // This runs asynchronously - we send the response first + this.drainAndExit().catch((err) => { + console.error('[pool-server] Error during graceful shutdown:', err); + process.exit(1); + }); return { taskId: message.taskId, success: true, + result: { + status: 'draining', + activeRequests: this.activeRequests, + timeoutMs: this.shutdownTimeoutMs, + }, }; } + /** + * Wait for active requests to complete, then exit + */ + private async drainAndExit(): Promise { + const startTime = Date.now(); + const checkInterval = 100; // Check every 100ms + + // Wait for requests to drain + while (this.activeRequests > 0) { + const elapsed = Date.now() - startTime; + if (elapsed >= this.shutdownTimeoutMs) { + console.error( + `[pool-server] Shutdown timeout (${this.shutdownTimeoutMs}ms) reached, ` + + `${this.activeRequests} requests still active - forcing shutdown` + ); + break; + } + + // Log progress every 5 seconds + if (elapsed > 0 && elapsed % 5000 < checkInterval) { + console.error( + `[pool-server] Draining: ${this.activeRequests} requests remaining ` + + `(${Math.round(elapsed / 1000)}s / ${this.shutdownTimeoutMs / 1000}s)` + ); + } + + await new Promise((resolve) => setTimeout(resolve, checkInterval)); + } + + const drainTime = Date.now() - startTime; + console.error(`[pool-server] Drain complete in ${drainTime}ms, proceeding with shutdown`); + + await this.stop(); + process.exit(0); + } + /** * Evict code cache under memory pressure. * Called by memory monitor when heap usage is critical. @@ -743,6 +909,54 @@ class PoolServer { } } + /** + * Emergency shutdown due to memory pressure. + * Uses shorter timeout but same drain logic for consistency. + * Exit code 1 indicates abnormal termination (not 137 which is SIGKILL). + */ + async emergencyShutdown(): Promise { + if (this.shuttingDown) { + // Already shutting down, just wait + return; + } + + console.error(`[pool-server] Emergency shutdown initiated, ${this.activeRequests} active requests`); + this.shuttingDown = true; + + // Shorter timeout for emergency (10 seconds vs normal 30) + const emergencyTimeoutMs = 10000; + const startTime = Date.now(); + const checkInterval = 100; + + // Wait for requests to drain with shorter timeout + while (this.activeRequests > 0) { + const elapsed = Date.now() - startTime; + if (elapsed >= emergencyTimeoutMs) { + console.error( + `[pool-server] Emergency shutdown timeout (${emergencyTimeoutMs}ms) reached, ` + + `${this.activeRequests} requests still active - forcing exit` + ); + break; + } + + if (elapsed > 0 && elapsed % 2000 < checkInterval) { + console.error( + `[pool-server] Emergency draining: ${this.activeRequests} requests remaining` + ); + } + + await new Promise((resolve) => setTimeout(resolve, checkInterval)); + } + + const drainTime = Date.now() - startTime; + console.error(`[pool-server] Emergency drain complete in ${drainTime}ms`); + + await this.stop(); + // Exit code 1 = abnormal termination (OOM-like condition) + // Note: 137 is SIGKILL which is incorrect for voluntary exit + process.exit(1); + } + /** * Stop the server */ @@ -800,16 +1014,13 @@ async function main(): Promise { // Connect emergency handler - graceful shutdown to trigger Rust restart memoryMonitor.onEmergency(() => { console.error('[pool-server] Emergency memory pressure - initiating graceful shutdown for restart'); - // Don't exit immediately - let pending requests complete + // Reuse the same graceful shutdown logic as normal shutdown + // This ensures active requests are drained properly (with timeout) // Rust will detect the exit and restart the process - setTimeout(async () => { - try { - await server.stop(); - } catch (err) { - console.error('[pool-server] Error during emergency shutdown:', err); - } - process.exit(137); // Signal OOM-like exit to Rust - }, 1000); + server.emergencyShutdown().catch((err) => { + console.error('[pool-server] Error during emergency shutdown:', err); + process.exit(1); + }); }); memoryMonitor.start(); diff --git a/plugins/lib/worker-pool.ts b/plugins/lib/worker-pool.ts index 8b8b767e3..a3f79cbd2 100644 --- a/plugins/lib/worker-pool.ts +++ b/plugins/lib/worker-pool.ts @@ -202,8 +202,6 @@ class CompiledCodeCache { private totalCacheSize: number = 0; // Max cache size in bytes (100MB default - adjust under memory pressure) private maxCacheSize: number = 100 * 1024 * 1024; - // Track last LRU access for smarter eviction - private accessOrder: string[] = []; constructor(maxAgeMs: number = 3600000) { // 1 hour default @@ -297,9 +295,11 @@ class CompiledCodeCache { let evictedCount = 0; for (const [key, entry] of this.cache.entries()) { if (now - entry.timestamp > this.maxAge) { - this.totalCacheSize -= entry.size; - this.cache.delete(key); - evictedCount++; + // Check delete return value to prevent size drift + if (this.cache.delete(key)) { + this.totalCacheSize -= entry.size; + evictedCount++; + } } } if (evictedCount > 0) { @@ -319,9 +319,11 @@ class CompiledCodeCache { let evicted = 0; for (const [key, entry] of entries) { if (evicted >= count) break; - this.totalCacheSize -= entry.size; - this.cache.delete(key); - evicted++; + // Check delete return value to prevent size drift + if (this.cache.delete(key)) { + this.totalCacheSize -= entry.size; + evicted++; + } } if (evicted > 0) { @@ -335,12 +337,15 @@ class CompiledCodeCache { // Check if expired if (Date.now() - entry.timestamp > this.maxAge) { - this.totalCacheSize -= entry.size; - this.cache.delete(pluginPath); + if (this.cache.delete(pluginPath)) { + this.totalCacheSize -= entry.size; + } return undefined; } // Update timestamp for LRU tracking + // Note: Timestamp update is racy under concurrent access but acceptable + // for LRU approximation - lost updates only cause slightly suboptimal eviction entry.timestamp = Date.now(); return entry.code; @@ -426,6 +431,10 @@ export class WorkerPoolManager { private isTemporaryWorkerFile: boolean = false; private metrics: PluginMetrics; + // Event handlers stored as class properties for proper cleanup + private poolErrorHandler: ((err: Error) => void) | null = null; + private poolExitHandler: ((workerId: number, exitCode: number) => void) | null = null; + constructor(options: WorkerPoolOptions = {}) { this.options = { ...DEFAULT_OPTIONS, ...options }; this.compiledCache = new CompiledCodeCache(); @@ -436,23 +445,35 @@ export class WorkerPoolManager { } /** - * Register process handlers to clean up temp files on unexpected exit. + * Cleanup handler for process exit - stored as property for removal */ - private registerCleanupHandlers(): void { - const cleanup = () => { - if (this.isTemporaryWorkerFile && this.compiledWorkerPath) { - try { - fs.unlinkSync(this.compiledWorkerPath); - } catch { - // Ignore - best effort cleanup - } + private cleanupHandler = (): void => { + if (this.isTemporaryWorkerFile && this.compiledWorkerPath) { + try { + fs.unlinkSync(this.compiledWorkerPath); + } catch { + // Ignore - best effort cleanup } - }; + } + }; + /** + * Register process handlers to clean up temp files on unexpected exit. + */ + private registerCleanupHandlers(): void { // Handle various exit scenarios - process.once('beforeExit', cleanup); - process.once('SIGINT', cleanup); - process.once('SIGTERM', cleanup); + process.once('beforeExit', this.cleanupHandler); + process.once('SIGINT', this.cleanupHandler); + process.once('SIGTERM', this.cleanupHandler); + } + + /** + * Remove process cleanup handlers (called during shutdown) + */ + private removeCleanupHandlers(): void { + process.off('beforeExit', this.cleanupHandler); + process.off('SIGINT', this.cleanupHandler); + process.off('SIGTERM', this.cleanupHandler); } /** @@ -530,8 +551,8 @@ export class WorkerPoolManager { let lastCrashReset = Date.now(); const CRASH_WINDOW_MS = 60000; // 1 minute window for crash rate monitoring - // Listen to worker events for monitoring - this.pool.on('error', (err) => { + // Store event handlers as class properties for proper cleanup on shutdown + this.poolErrorHandler = (err: Error) => { console.error('[worker-pool] Worker error (will be replaced):', err.message); // Track errors that indicate memory issues const errMsg = err.message.toLowerCase(); @@ -539,9 +560,9 @@ export class WorkerPoolManager { console.error('[worker-pool] Memory-related worker error detected - consider increasing worker heap size'); } // Don't throw - Piscina handles recovery - }); + }; - this.pool.on('workerExit', (workerId: number, exitCode: number) => { + this.poolExitHandler = (workerId: number, exitCode: number) => { // Reset crash counter periodically const now = Date.now(); if (now - lastCrashReset > CRASH_WINDOW_MS) { @@ -574,7 +595,11 @@ export class WorkerPoolManager { this.compiledCache.clear(); } } - }); + }; + + // Listen to worker events for monitoring + this.pool.on('error', this.poolErrorHandler); + this.pool.on('workerExit', this.poolExitHandler); this.initialized = true; } @@ -680,6 +705,19 @@ export class WorkerPoolManager { await this.initialize(); } + // Verify pool exists after init (defensive - initialize() should throw on failure) + if (!this.pool) { + return { + success: false, + error: { + message: 'Worker pool failed to initialize', + code: 'POOL_INIT_FAILED', + status: 500, + }, + logs: [], + }; + } + const executionStartTime = Date.now(); let cacheHit = false; @@ -938,11 +976,24 @@ export class WorkerPoolManager { */ async shutdown(): Promise { if (this.pool) { + // Remove event listeners before destroying to prevent accumulation + if (this.poolErrorHandler) { + this.pool.off('error', this.poolErrorHandler); + this.poolErrorHandler = null; + } + if (this.poolExitHandler) { + this.pool.off('workerExit', this.poolExitHandler); + this.poolExitHandler = null; + } + await this.pool.destroy(); this.pool = null; this.initialized = false; } + // Remove process cleanup handlers to prevent accumulation + this.removeCleanupHandlers(); + // Clean up temporary compiled worker file to prevent disk space leak if (this.isTemporaryWorkerFile && this.compiledWorkerPath) { try { diff --git a/plugins/tests/lib/pool-server.test.ts b/plugins/tests/lib/pool-server.test.ts new file mode 100644 index 000000000..3bb6d2600 --- /dev/null +++ b/plugins/tests/lib/pool-server.test.ts @@ -0,0 +1,567 @@ +import * as net from 'node:net'; +import * as fs from 'node:fs'; +import * as v8 from 'node:v8'; + +// Mock dependencies before importing the module +jest.mock('../../lib/worker-pool', () => ({ + WorkerPoolManager: jest.fn().mockImplementation(() => ({ + initialize: jest.fn().mockResolvedValue(undefined), + runPlugin: jest.fn().mockResolvedValue({ + success: true, + result: { data: 'test' }, + logs: [], + }), + precompilePlugin: jest.fn().mockResolvedValue({ + code: 'compiled-code', + warnings: [], + }), + precompilePluginSource: jest.fn().mockResolvedValue({ + code: 'compiled-code', + warnings: [], + }), + cacheCompiledCode: jest.fn(), + invalidatePlugin: jest.fn(), + getStats: jest.fn().mockReturnValue({ + uptime: 1000, + pool: { completed: 10, queued: 0 }, + execution: { total: 10, successRate: 1.0 }, + }), + shutdown: jest.fn().mockResolvedValue(undefined), + clearCache: jest.fn(), + })), +})); + +jest.mock('node:fs', () => ({ + unlinkSync: jest.fn(), + statSync: jest.fn().mockReturnValue({ + mode: 0o755, + isSocket: () => true, + }), +})); + +// Import after mocks are set up +const { WorkerPoolManager } = jest.requireMock('../../lib/worker-pool') as any; + +describe('PoolServerMemoryMonitor logic', () => { + describe('Memory pressure detection', () => { + let originalMemoryUsage: typeof process.memoryUsage; + + beforeEach(() => { + originalMemoryUsage = process.memoryUsage; + }); + + afterEach(() => { + process.memoryUsage = originalMemoryUsage; + }); + + it('should detect warning threshold at 75% heap usage', () => { + const heapLimit = 1000 * 1024 * 1024; // 1000MB + const heapUsed = 750 * 1024 * 1024; // 750MB (75%) + + const ratio = heapUsed / heapLimit; + expect(ratio).toBeGreaterThanOrEqual(0.75); + expect(ratio).toBeLessThan(0.80); + }); + + it('should detect GC threshold at 80% heap usage', () => { + const heapLimit = 1000 * 1024 * 1024; + const heapUsed = 800 * 1024 * 1024; // 80% + + const ratio = heapUsed / heapLimit; + expect(ratio).toBeGreaterThanOrEqual(0.80); + expect(ratio).toBeLessThan(0.85); + }); + + it('should detect critical threshold at 85% heap usage', () => { + const heapLimit = 1000 * 1024 * 1024; + const heapUsed = 850 * 1024 * 1024; // 85% + + const ratio = heapUsed / heapLimit; + expect(ratio).toBeGreaterThanOrEqual(0.85); + expect(ratio).toBeLessThan(0.92); + }); + + it('should detect emergency threshold at 92% heap usage', () => { + const heapLimit = 1000 * 1024 * 1024; + const heapUsed = 920 * 1024 * 1024; // 92% + + const ratio = heapUsed / heapLimit; + expect(ratio).toBeGreaterThanOrEqual(0.92); + }); + }); +}); + +describe('PoolServer message handling', () => { + let mockSocket: Partial; + let dataCallback: ((data: Buffer) => void) | undefined; + let errorCallback: ((err: Error) => void) | undefined; + let closeCallback: (() => void) | undefined; + + beforeEach(() => { + jest.clearAllMocks(); + + // Reset WorkerPoolManager mock + (WorkerPoolManager as jest.Mock).mockImplementation(() => ({ + initialize: jest.fn().mockResolvedValue(undefined), + runPlugin: jest.fn().mockResolvedValue({ + success: true, + result: { data: 'test' }, + logs: [], + }), + precompilePlugin: jest.fn().mockResolvedValue({ + code: 'compiled-code', + warnings: [], + }), + precompilePluginSource: jest.fn().mockResolvedValue({ + code: 'compiled-code', + warnings: [], + }), + cacheCompiledCode: jest.fn(), + invalidatePlugin: jest.fn(), + getStats: jest.fn().mockReturnValue({ + uptime: 1000, + pool: { completed: 10, queued: 0 }, + execution: { total: 10, successRate: 1.0 }, + }), + shutdown: jest.fn().mockResolvedValue(undefined), + clearCache: jest.fn(), + })); + + mockSocket = { + setKeepAlive: jest.fn(), + setNoDelay: jest.fn(), + write: jest.fn(), + writable: true, + on: jest.fn().mockReturnThis(), + } as any; + }); + + describe('execute message', () => { + it('should handle valid execute message', async () => { + const message = { + type: 'execute', + taskId: 'task-1', + pluginId: 'plugin-1', + compiledCode: 'code', + params: { test: true }, + socketPath: '/tmp/test.sock', + timeout: 5000, + }; + + // Simulate the message flow + const pool = new WorkerPoolManager({} as any); + const result = await pool.runPlugin({ + pluginId: message.pluginId, + compiledCode: message.compiledCode, + params: message.params, + socketPath: message.socketPath, + timeout: message.timeout, + }); + + expect(result).toEqual({ + success: true, + result: { data: 'test' }, + logs: [], + }); + expect(pool.runPlugin).toHaveBeenCalledWith({ + pluginId: 'plugin-1', + compiledCode: 'code', + params: { test: true }, + socketPath: '/tmp/test.sock', + timeout: 5000, + }); + }); + + it('should handle execute message with error', async () => { + const pool = new WorkerPoolManager({} as any); + (pool.runPlugin as jest.Mock).mockResolvedValue({ + success: false, + error: { + message: 'Plugin error', + code: 'PLUGIN_ERROR', + status: 500, + }, + logs: [], + }); + + const result = await pool.runPlugin({ + pluginId: 'plugin-1', + compiledCode: 'code', + params: {}, + socketPath: '/tmp/test.sock', + timeout: 5000, + }); + + expect(result.success).toBe(false); + expect(result.error).toEqual({ + message: 'Plugin error', + code: 'PLUGIN_ERROR', + status: 500, + }); + }); + }); + + describe('precompile message', () => { + it('should handle precompile with source code', async () => { + const pool = new WorkerPoolManager({} as any); + const result = await pool.precompilePluginSource('plugin-1', 'source code'); + + expect(result).toEqual({ + code: 'compiled-code', + warnings: [], + }); + expect(pool.precompilePluginSource).toHaveBeenCalledWith('plugin-1', 'source code'); + }); + + it('should handle precompile with plugin path', async () => { + const pool = new WorkerPoolManager({} as any); + const result = await pool.precompilePlugin('/path/to/plugin.js'); + + expect(result).toEqual({ + code: 'compiled-code', + warnings: [], + }); + expect(pool.precompilePlugin).toHaveBeenCalledWith('/path/to/plugin.js'); + }); + }); + + describe('cache message', () => { + it('should cache compiled code', () => { + const pool = new WorkerPoolManager({} as any); + pool.cacheCompiledCode('plugin-1', 'compiled-code'); + + expect(pool.cacheCompiledCode).toHaveBeenCalledWith('plugin-1', 'compiled-code'); + }); + }); + + describe('invalidate message', () => { + it('should invalidate plugin cache', () => { + const pool = new WorkerPoolManager({} as any); + pool.invalidatePlugin('plugin-1'); + + expect(pool.invalidatePlugin).toHaveBeenCalledWith('plugin-1'); + }); + }); + + describe('stats message', () => { + it('should return pool statistics', () => { + const pool = new WorkerPoolManager({} as any); + const stats = pool.getStats(); + + expect(stats).toEqual({ + uptime: 1000, + pool: { completed: 10, queued: 0 }, + execution: { total: 10, successRate: 1.0 }, + }); + }); + }); + + describe('health message', () => { + it('should return health status with memory info', () => { + const pool = new WorkerPoolManager({} as any); + const stats = pool.getStats(); + + const health = { + status: 'healthy', + uptime: stats.uptime, + memory: { + heapUsed: process.memoryUsage().heapUsed, + heapTotal: process.memoryUsage().heapTotal, + rss: process.memoryUsage().rss, + }, + pool: { + completed: stats.pool.completed, + queued: stats.pool.queued, + }, + execution: stats.execution, + }; + + expect(health.status).toBe('healthy'); + expect(health.uptime).toBe(1000); + expect(health.memory).toBeDefined(); + expect(health.pool).toBeDefined(); + expect(health.execution).toBeDefined(); + }); + }); + + describe('shutdown message', () => { + it('should initiate graceful shutdown', () => { + const pool = new WorkerPoolManager({} as any); + + let shuttingDown = false; + const activeRequests = 0; + + const response = { + status: 'draining', + activeRequests, + timeoutMs: 30000, + }; + + expect(response.status).toBe('draining'); + expect(response.activeRequests).toBe(0); + expect(response.timeoutMs).toBe(30000); + }); + + it('should indicate already shutting down', () => { + let shuttingDown = true; + const activeRequests = 2; + + const response = { + status: 'already_shutting_down', + activeRequests, + }; + + expect(response.status).toBe('already_shutting_down'); + expect(response.activeRequests).toBe(2); + }); + }); + + describe('unknown message type', () => { + it('should handle unknown message type', () => { + const unknownType = 'invalid_type'; + const error = { + message: `Unknown message type: ${unknownType}`, + code: 'UNKNOWN_MESSAGE_TYPE', + }; + + expect(error.message).toContain('Unknown message type'); + expect(error.code).toBe('UNKNOWN_MESSAGE_TYPE'); + }); + }); +}); + +describe('PoolServer connection handling', () => { + it('should enable keep-alive and no-delay on socket', () => { + const mockSocket: any = { + setKeepAlive: jest.fn(), + setNoDelay: jest.fn(), + on: jest.fn(), + }; + + mockSocket.setKeepAlive(true, 30000); + mockSocket.setNoDelay(true); + + expect(mockSocket.setKeepAlive).toHaveBeenCalledWith(true, 30000); + expect(mockSocket.setNoDelay).toHaveBeenCalledWith(true); + }); + + it('should parse newline-delimited JSON messages', () => { + const buffer = '{"type":"execute","taskId":"1"}\n{"type":"stats","taskId":"2"}\n'; + const messages: any[] = []; + + let remaining = buffer; + let newlineIndex; + while ((newlineIndex = remaining.indexOf('\n')) !== -1) { + const line = remaining.slice(0, newlineIndex); + remaining = remaining.slice(newlineIndex + 1); + if (line.trim()) { + messages.push(JSON.parse(line)); + } + } + + expect(messages).toHaveLength(2); + expect(messages[0]).toEqual({ type: 'execute', taskId: '1' }); + expect(messages[1]).toEqual({ type: 'stats', taskId: '2' }); + }); + + it('should handle partial messages in buffer', () => { + let buffer = '{"type":"exe'; + const messages: any[] = []; + + // First chunk + let newlineIndex = buffer.indexOf('\n'); + expect(newlineIndex).toBe(-1); + + // Second chunk completes the message + buffer += 'cute","taskId":"1"}\n'; + newlineIndex = buffer.indexOf('\n'); + expect(newlineIndex).not.toBe(-1); + + const line = buffer.slice(0, newlineIndex); + messages.push(JSON.parse(line)); + + expect(messages).toHaveLength(1); + expect(messages[0]).toEqual({ type: 'execute', taskId: '1' }); + }); + + it('should handle socket errors gracefully', () => { + const mockSocket: any = { + on: jest.fn((event: string, callback: any) => { + if (event === 'error') { + // Simulate ECONNRESET error + callback({ code: 'ECONNRESET', message: 'Connection reset' }); + } + }), + }; + + let errorReceived = false; + mockSocket.on('error', (err: any) => { + errorReceived = true; + expect(err.code).toBe('ECONNRESET'); + }); + + expect(errorReceived).toBe(true); + }); +}); + +describe('PoolServer graceful shutdown', () => { + it('should wait for active requests to complete', async () => { + let activeRequests = 3; + const checkInterval = 10; + const timeoutMs = 1000; + + // Simulate draining + const drainPromise = new Promise((resolve) => { + const interval = setInterval(() => { + activeRequests--; + if (activeRequests === 0) { + clearInterval(interval); + resolve(); + } + }, checkInterval); + }); + + await drainPromise; + expect(activeRequests).toBe(0); + }); + + it('should force shutdown after timeout', async () => { + let activeRequests = 5; + const checkInterval = 10; + const timeoutMs = 50; + + const startTime = Date.now(); + let timedOut = false; + + const drainPromise = new Promise((resolve) => { + const interval = setInterval(() => { + const elapsed = Date.now() - startTime; + if (elapsed >= timeoutMs) { + timedOut = true; + clearInterval(interval); + resolve(); + } + }, checkInterval); + }); + + await drainPromise; + expect(timedOut).toBe(true); + expect(activeRequests).toBeGreaterThan(0); // Some requests still active + }); + + it('should track active requests properly', () => { + let activeRequests = 0; + + // Execute request + activeRequests++; + expect(activeRequests).toBe(1); + + // Complete request + activeRequests--; + expect(activeRequests).toBe(0); + + // Multiple requests + activeRequests += 3; + expect(activeRequests).toBe(3); + + activeRequests -= 2; + expect(activeRequests).toBe(1); + }); + + it('should reject new requests during shutdown', () => { + let shuttingDown = false; + let messageType: string = 'execute'; + + // Allow before shutdown + let shouldReject = shuttingDown && messageType !== 'shutdown' && messageType !== 'health'; + expect(shouldReject).toBe(false); + + // Reject during shutdown + shuttingDown = true; + shouldReject = shuttingDown && messageType !== 'shutdown' && messageType !== 'health'; + expect(shouldReject).toBe(true); + + // But still allow shutdown and health + messageType = 'shutdown'; + shouldReject = shuttingDown && messageType !== 'shutdown' && messageType !== 'health'; + expect(shouldReject).toBe(false); + + messageType = 'health'; + shouldReject = shuttingDown && messageType !== 'shutdown' && messageType !== 'health'; + expect(shouldReject).toBe(false); + }); +}); + +describe('PoolServer cache eviction', () => { + it('should evict cache on memory pressure', () => { + const pool = new WorkerPoolManager({} as any); + pool.clearCache(); + + expect(pool.clearCache).toHaveBeenCalled(); + }); + + it('should handle cache eviction errors gracefully', () => { + const pool = new WorkerPoolManager({} as any); + (pool.clearCache as jest.Mock).mockImplementation(() => { + throw new Error('Cache eviction failed'); + }); + + try { + pool.clearCache(); + } catch (err) { + expect((err as Error).message).toBe('Cache eviction failed'); + } + }); +}); + +describe('PoolServer configuration', () => { + const originalEnv = process.env; + + beforeEach(() => { + process.env = { ...originalEnv }; + }); + + afterEach(() => { + process.env = originalEnv; + }); + + it('should use environment variables for configuration', () => { + process.env.PLUGIN_MAX_CONCURRENCY = '4096'; + process.env.PLUGIN_POOL_MIN_THREADS = '4'; + process.env.PLUGIN_POOL_MAX_THREADS = '16'; + process.env.PLUGIN_POOL_CONCURRENT_TASKS = '8'; + process.env.PLUGIN_POOL_IDLE_TIMEOUT = '30000'; + + const config = { + maxConcurrency: parseInt(process.env.PLUGIN_MAX_CONCURRENCY, 10), + minThreads: parseInt(process.env.PLUGIN_POOL_MIN_THREADS, 10), + maxThreads: parseInt(process.env.PLUGIN_POOL_MAX_THREADS, 10), + concurrentTasks: parseInt(process.env.PLUGIN_POOL_CONCURRENT_TASKS, 10), + idleTimeout: parseInt(process.env.PLUGIN_POOL_IDLE_TIMEOUT, 10), + }; + + expect(config.maxConcurrency).toBe(4096); + expect(config.minThreads).toBe(4); + expect(config.maxThreads).toBe(16); + expect(config.concurrentTasks).toBe(8); + expect(config.idleTimeout).toBe(30000); + }); + + it('should fall back to defaults when env vars not set', () => { + delete process.env.PLUGIN_MAX_CONCURRENCY; + delete process.env.PLUGIN_POOL_MIN_THREADS; + + const maxConcurrency = parseInt(process.env.PLUGIN_MAX_CONCURRENCY || '2048', 10); + const minThreads = parseInt(process.env.PLUGIN_POOL_MIN_THREADS || '2', 10); + + expect(maxConcurrency).toBe(2048); + expect(minThreads).toBe(2); + }); + + it('should use socket backlog from environment', () => { + process.env.PLUGIN_POOL_SOCKET_BACKLOG = '2048'; + + const backlog = parseInt(process.env.PLUGIN_POOL_SOCKET_BACKLOG, 10); + expect(backlog).toBe(2048); + }); +}); diff --git a/plugins/tests/lib/sandbox-executor.test.ts b/plugins/tests/lib/sandbox-executor.test.ts new file mode 100644 index 000000000..f57a98729 --- /dev/null +++ b/plugins/tests/lib/sandbox-executor.test.ts @@ -0,0 +1,1014 @@ +import * as vm from 'node:vm'; +import * as v8 from 'node:v8'; +import * as net from 'node:net'; + +describe('ContextPool logic', () => { + class MockContextPool { + private available: any[] = []; + private readonly maxSize = 10; + + acquire(): any { + const ctx = this.available.pop(); + if (ctx) { + this.resetContext(ctx); + return ctx; + } + return this.createFreshContext(); + } + + release(ctx: any): void { + if (this.available.length < this.maxSize) { + this.available.push(ctx); + } + } + + private createFreshContext(): any { + return { _fresh: true }; + } + + private resetContext(ctx: any): void { + if (ctx.__pluginState) { + delete ctx.__pluginState; + } + } + + clear(): void { + this.available = []; + } + + size(): number { + return this.available.length; + } + } + + it('should create new context when pool is empty', () => { + const pool = new MockContextPool(); + const ctx = pool.acquire(); + + expect(ctx).toBeDefined(); + expect(ctx._fresh).toBe(true); + expect(pool.size()).toBe(0); + }); + + it('should reuse context from pool', () => { + const pool = new MockContextPool(); + const ctx1 = pool.acquire(); + pool.release(ctx1); + + expect(pool.size()).toBe(1); + + const ctx2 = pool.acquire(); + expect(ctx2).toBe(ctx1); // Same object + expect(pool.size()).toBe(0); + }); + + it('should not exceed max pool size', () => { + const pool = new MockContextPool(); + const contexts: any[] = []; + + // Create 15 contexts + for (let i = 0; i < 15; i++) { + const ctx = pool.acquire(); + ctx.id = i; + contexts.push(ctx); + } + + // Release them one by one + for (const ctx of contexts) { + pool.release(ctx); + } + + expect(pool.size()).toBe(10); // Should cap at maxSize + }); + + it('should reset context state before reuse', () => { + const pool = new MockContextPool(); + const ctx = pool.acquire(); + + // Simulate plugin pollution + (ctx as any).__pluginState = { dirty: true }; + pool.release(ctx); + + const reusedCtx = pool.acquire(); + expect((reusedCtx as any).__pluginState).toBeUndefined(); + }); + + it('should clear all contexts', () => { + const pool = new MockContextPool(); + const contexts: any[] = []; + + for (let i = 0; i < 5; i++) { + const ctx = pool.acquire(); + contexts.push(ctx); + } + + // Release them to the pool + for (const ctx of contexts) { + pool.release(ctx); + } + + expect(pool.size()).toBe(5); + pool.clear(); + expect(pool.size()).toBe(0); + }); +}); + +describe('ScriptCache logic', () => { + class MockScriptCache { + private cache = new Map(); + private readonly maxSize = 100; + + get(code: string): any | undefined { + const entry = this.cache.get(code); + if (entry) { + entry.timestamp = Date.now(); + return entry.script; + } + return undefined; + } + + set(code: string, script: any): void { + if (this.cache.size >= this.maxSize) { + this.evictOldest(1); + } + this.cache.set(code, { script, timestamp: Date.now() }); + } + + evictOldest(count: number): void { + const entries = [...this.cache.entries()].sort( + (a, b) => a[1].timestamp - b[1].timestamp + ); + + let evicted = 0; + for (const [key] of entries) { + if (evicted >= count) break; + this.cache.delete(key); + evicted++; + } + } + + clear(): void { + this.cache.clear(); + } + + size(): number { + return this.cache.size; + } + } + + it('should cache compiled scripts', () => { + const cache = new MockScriptCache(); + const code = 'console.log("test")'; + const script = { compiled: true }; + + cache.set(code, script); + const retrieved = cache.get(code); + + expect(retrieved).toBe(script); + }); + + it('should return undefined for cache miss', () => { + const cache = new MockScriptCache(); + const result = cache.get('nonexistent-code'); + + expect(result).toBeUndefined(); + }); + + it('should update timestamp on cache hit (LRU)', () => { + const cache = new MockScriptCache(); + const code = 'test'; + const script = { compiled: true }; + + cache.set(code, script); + const timestamp1 = (cache as any).cache.get(code).timestamp; + + // Wait a bit and access again + setTimeout(() => { + cache.get(code); + const timestamp2 = (cache as any).cache.get(code).timestamp; + expect(timestamp2).toBeGreaterThanOrEqual(timestamp1); + }, 10); + }); + + it('should evict oldest entry when at capacity', () => { + const cache = new MockScriptCache(); + + // Fill cache to capacity + for (let i = 0; i < 100; i++) { + cache.set(`code-${i}`, { id: i }); + } + + expect(cache.size()).toBe(100); + + // Add one more - should evict oldest + cache.set('code-101', { id: 101 }); + + expect(cache.size()).toBe(100); + expect(cache.get('code-0')).toBeUndefined(); // First one evicted + expect(cache.get('code-101')).toBeDefined(); // New one added + }); + + it('should evict multiple oldest entries', () => { + const cache = new MockScriptCache(); + + for (let i = 0; i < 10; i++) { + cache.set(`code-${i}`, { id: i }); + } + + cache.evictOldest(3); + + expect(cache.size()).toBe(7); + expect(cache.get('code-0')).toBeUndefined(); + expect(cache.get('code-1')).toBeUndefined(); + expect(cache.get('code-2')).toBeUndefined(); + expect(cache.get('code-3')).toBeDefined(); + }); + + it('should clear entire cache', () => { + const cache = new MockScriptCache(); + + for (let i = 0; i < 10; i++) { + cache.set(`code-${i}`, { id: i }); + } + + expect(cache.size()).toBe(10); + cache.clear(); + expect(cache.size()).toBe(0); + }); + + it('should handle memory pressure by evicting cache', () => { + const heapLimit = 1000 * 1024 * 1024; // 1000MB + const heapUsed = 700 * 1024 * 1024; // 700MB (70%) + + const heapUsedRatio = heapUsed / heapLimit; + + const cache = new MockScriptCache(); + for (let i = 0; i < 100; i++) { + cache.set(`code-${i}`, { id: i }); + } + + // Simulate eviction at 70% threshold + if (heapUsedRatio >= 0.70 && cache.size() > 0) { + const evictCount = Math.max(1, Math.ceil(cache.size() * 0.25)); + cache.evictOldest(evictCount); + } + + expect(cache.size()).toBeLessThan(100); + expect(cache.size()).toBeGreaterThanOrEqual(75); // 25% evicted + }); +}); + +describe('SocketPool logic', () => { + class MockSocketPool { + private available: any[] = []; + private readonly maxSize = 5; + + acquire(socketPath: string): any | null { + const socket = this.available.pop(); + if (socket && socket.writable && !socket.destroyed) { + return socket; + } + return null; + } + + release(socket: any): void { + if (socket.writable && !socket.destroyed && this.available.length < this.maxSize) { + this.available.push(socket); + } else if (socket.destroy) { + socket.destroy(); + } + } + + clear(): void { + for (const socket of this.available) { + if (socket.destroy) socket.destroy(); + } + this.available = []; + } + + size(): number { + return this.available.length; + } + } + + it('should return null when pool is empty', () => { + const pool = new MockSocketPool(); + const socket = pool.acquire('/tmp/test.sock'); + + expect(socket).toBeNull(); + }); + + it('should reuse healthy socket from pool', () => { + const pool = new MockSocketPool(); + const mockSocket = { + writable: true, + destroyed: false, + destroy: jest.fn(), + }; + + pool.release(mockSocket); + expect(pool.size()).toBe(1); + + const reused = pool.acquire('/tmp/test.sock'); + expect(reused).toBe(mockSocket); + expect(pool.size()).toBe(0); + }); + + it('should destroy unhealthy socket instead of pooling', () => { + const pool = new MockSocketPool(); + const mockSocket = { + writable: false, + destroyed: false, + destroy: jest.fn(), + }; + + pool.release(mockSocket); + + expect(mockSocket.destroy).toHaveBeenCalled(); + expect(pool.size()).toBe(0); + }); + + it('should not exceed max pool size', () => { + const pool = new MockSocketPool(); + + for (let i = 0; i < 10; i++) { + pool.release({ + writable: true, + destroyed: false, + destroy: jest.fn(), + }); + } + + expect(pool.size()).toBe(5); // Max size is 5 + }); + + it('should destroy all sockets on clear', () => { + const pool = new MockSocketPool(); + const sockets = []; + + for (let i = 0; i < 5; i++) { + const socket = { + writable: true, + destroyed: false, + destroy: jest.fn(), + }; + sockets.push(socket); + pool.release(socket); + } + + pool.clear(); + + expect(pool.size()).toBe(0); + for (const socket of sockets) { + expect(socket.destroy).toHaveBeenCalled(); + } + }); + + it('should skip destroyed sockets during reuse', () => { + const pool = new MockSocketPool(); + const mockSocket = { + writable: true, + destroyed: true, // Already destroyed + destroy: jest.fn(), + }; + + pool.release(mockSocket); + const reused = pool.acquire('/tmp/test.sock'); + + expect(reused).toBeNull(); // Should not return destroyed socket + }); +}); + +describe('SandboxPluginAPI socket handling', () => { + class MockSandboxPluginAPI { + private socket: any = null; + private pending = new Map(); + private connected = false; + private connectionPromise: Promise | null = null; + private socketPath: string; + private readonly maxPendingRequests = 100; + + constructor(socketPath: string) { + this.socketPath = socketPath; + } + + async ensureConnected(): Promise { + if (this.connected) return; + if (!this.connectionPromise) { + this.connectionPromise = this.connect(); + } + await this.connectionPromise; + } + + private async connect(): Promise { + // Simulate connection + this.socket = { writable: true, destroyed: false }; + this.connected = true; + } + + handleSocketError(error: Error): void { + this.connected = false; + this.connectionPromise = null; + this.socket = null; + this.rejectAllPending(error); + } + + handleSocketClose(): void { + this.connected = false; + this.connectionPromise = null; + this.socket = null; + this.rejectAllPending(new Error('Socket closed unexpectedly')); + } + + private rejectAllPending(error: Error): void { + for (const [requestId, resolver] of this.pending.entries()) { + resolver.reject(error); + this.pending.delete(requestId); + } + } + + async send(method: string, payload: any): Promise { + if (this.pending.size >= this.maxPendingRequests) { + throw new Error( + `Too many concurrent API requests (max ${this.maxPendingRequests})` + ); + } + + await this.ensureConnected(); + + return new Promise((resolve, reject) => { + const requestId = 'test-id'; + this.pending.set(requestId, { resolve, reject }); + + // Simulate response + setTimeout(() => { + const resolver = this.pending.get(requestId); + if (resolver) { + resolver.resolve({ success: true }); + this.pending.delete(requestId); + } + }, 10); + }); + } + + getPendingCount(): number { + return this.pending.size; + } + + isConnected(): boolean { + return this.connected; + } + } + + it('should establish connection on first request', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + + expect(api.isConnected()).toBe(false); + + await api.send('testMethod', {}); + + expect(api.isConnected()).toBe(true); + }); + + it('should reuse existing connection', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + + await api.send('method1', {}); + const wasConnected = api.isConnected(); + + await api.send('method2', {}); + expect(api.isConnected()).toBe(wasConnected); + }); + + it('should handle socket error and reject pending requests', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + + await api.send('method1', {}); + + const error = new Error('Socket error'); + api.handleSocketError(error); + + expect(api.isConnected()).toBe(false); + expect(api.getPendingCount()).toBe(0); + }); + + it('should handle socket close and reset connection', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + + await api.send('method1', {}); + expect(api.isConnected()).toBe(true); + + api.handleSocketClose(); + + expect(api.isConnected()).toBe(false); + expect(api.getPendingCount()).toBe(0); + }); + + it('should enforce max pending requests limit', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + + // Mock the pending count to be at limit + for (let i = 0; i < 100; i++) { + (api as any).pending.set(`request-${i}`, { resolve: jest.fn(), reject: jest.fn() }); + } + + await expect(api.send('method', {})).rejects.toThrow('Too many concurrent API requests'); + }); + + it('should reconnect after socket close', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + + await api.send('method1', {}); + api.handleSocketClose(); + + expect(api.isConnected()).toBe(false); + + // Should reconnect on next request + await api.send('method2', {}); + expect(api.isConnected()).toBe(true); + }); +}); + +describe('Sandbox console implementation', () => { + interface LogEntry { + level: 'error' | 'warn' | 'info' | 'log' | 'debug' | 'result'; + message: string; + } + + function createMockSandboxConsole(logs: LogEntry[]): Console { + const log = (level: LogEntry['level']) => (...args: any[]) => { + const message = args.map(arg => + typeof arg === 'object' ? JSON.stringify(arg) : String(arg) + ).join(' '); + logs.push({ level, message }); + }; + + return { + log: log('log'), + info: log('info'), + warn: log('warn'), + error: log('error'), + debug: log('debug'), + } as Console; + } + + it('should capture log messages', () => { + const logs: LogEntry[] = []; + const console = createMockSandboxConsole(logs); + + console.log('test message'); + + expect(logs).toHaveLength(1); + expect(logs[0]).toEqual({ level: 'log', message: 'test message' }); + }); + + it('should capture error messages', () => { + const logs: LogEntry[] = []; + const console = createMockSandboxConsole(logs); + + console.error('error occurred'); + + expect(logs).toHaveLength(1); + expect(logs[0]).toEqual({ level: 'error', message: 'error occurred' }); + }); + + it('should capture warn messages', () => { + const logs: LogEntry[] = []; + const console = createMockSandboxConsole(logs); + + console.warn('warning message'); + + expect(logs).toHaveLength(1); + expect(logs[0]).toEqual({ level: 'warn', message: 'warning message' }); + }); + + it('should stringify objects', () => { + const logs: LogEntry[] = []; + const console = createMockSandboxConsole(logs); + + console.log({ foo: 'bar', num: 42 }); + + expect(logs).toHaveLength(1); + expect(logs[0].message).toBe('{"foo":"bar","num":42}'); + }); + + it('should handle multiple arguments', () => { + const logs: LogEntry[] = []; + const console = createMockSandboxConsole(logs); + + console.log('Hello', 'world', 123); + + expect(logs).toHaveLength(1); + expect(logs[0].message).toBe('Hello world 123'); + }); + + it('should handle mixed types', () => { + const logs: LogEntry[] = []; + const console = createMockSandboxConsole(logs); + + console.log('Count:', 42, { status: 'ok' }); + + expect(logs).toHaveLength(1); + expect(logs[0].message).toBe('Count: 42 {"status":"ok"}'); + }); +}); + +describe('Sandbox require blocking', () => { + const BLOCKED_MODULES = new Set([ + 'fs', 'child_process', 'net', 'http', 'https', + 'cluster', 'process', 'vm', 'os', 'v8', + ]); + + function createSandboxRequire(blockedModules: Set) { + return (id: string): any => { + if (blockedModules.has(id)) { + throw new Error( + `Module '${id}' is blocked for security. ` + + `Use the PluginAPI for network operations.` + ); + } + // Allow other modules + return require(id); + }; + } + + it('should block dangerous built-in modules', () => { + const sandboxRequire = createSandboxRequire(BLOCKED_MODULES); + + expect(() => sandboxRequire('fs')).toThrow('Module \'fs\' is blocked for security'); + expect(() => sandboxRequire('child_process')).toThrow('blocked for security'); + expect(() => sandboxRequire('net')).toThrow('blocked for security'); + expect(() => sandboxRequire('http')).toThrow('blocked for security'); + }); + + it('should allow safe modules', () => { + const sandboxRequire = createSandboxRequire(BLOCKED_MODULES); + + // Should not throw + expect(() => sandboxRequire('uuid')).not.toThrow(); + }); + + it('should block with node: prefix', () => { + const extendedBlocked = new Set([ + 'fs', 'node:fs', + 'net', 'node:net', + ]); + const sandboxRequire = createSandboxRequire(extendedBlocked); + + expect(() => sandboxRequire('node:fs')).toThrow('blocked for security'); + expect(() => sandboxRequire('node:net')).toThrow('blocked for security'); + }); +}); + +describe('executeInSandbox function', () => { + interface SandboxTask { + taskId: string; + pluginId: string; + compiledCode: string; + params: any; + headers?: Record; + socketPath: string; + httpRequestId?: string; + timeout: number; + } + + interface SandboxResult { + taskId: string; + success: boolean; + result?: any; + error?: { + message: string; + code?: string; + status?: number; + details?: any; + }; + logs: any[]; + } + + async function mockExecuteInSandbox(task: SandboxTask): Promise { + const logs: any[] = []; + + try { + // Simulate plugin execution + if (task.compiledCode.includes('throw')) { + throw new Error('Plugin error'); + } + + if (task.compiledCode.includes('timeout')) { + await new Promise((resolve) => setTimeout(resolve, task.timeout + 100)); + } + + return { + taskId: task.taskId, + success: true, + result: { processed: task.params }, + logs, + }; + } catch (error: any) { + return { + taskId: task.taskId, + success: false, + error: { + message: error.message, + code: 'PLUGIN_ERROR', + status: 500, + }, + logs, + }; + } + } + + it('should execute plugin successfully', async () => { + const task: SandboxTask = { + taskId: 'task-1', + pluginId: 'plugin-1', + compiledCode: 'return params;', + params: { test: true }, + socketPath: '/tmp/test.sock', + timeout: 5000, + }; + + const result = await mockExecuteInSandbox(task); + + expect(result.success).toBe(true); + expect(result.taskId).toBe('task-1'); + expect(result.result).toEqual({ processed: { test: true } }); + }); + + it('should handle plugin errors', async () => { + const task: SandboxTask = { + taskId: 'task-2', + pluginId: 'plugin-2', + compiledCode: 'throw new Error("test error");', + params: {}, + socketPath: '/tmp/test.sock', + timeout: 5000, + }; + + const result = await mockExecuteInSandbox(task); + + expect(result.success).toBe(false); + expect(result.error).toBeDefined(); + expect(result.error?.message).toBe('Plugin error'); + expect(result.error?.code).toBe('PLUGIN_ERROR'); + }); + + it('should include headers in execution context', async () => { + const task: SandboxTask = { + taskId: 'task-3', + pluginId: 'plugin-3', + compiledCode: 'return headers;', + params: {}, + headers: { 'x-api-key': ['secret'] }, + socketPath: '/tmp/test.sock', + timeout: 5000, + }; + + const result = await mockExecuteInSandbox(task); + + expect(result.success).toBe(true); + }); + + it('should respect execution timeout', async () => { + const task: SandboxTask = { + taskId: 'task-4', + pluginId: 'plugin-4', + compiledCode: 'timeout', + params: {}, + socketPath: '/tmp/test.sock', + timeout: 100, + }; + + // This would timeout in real execution + const startTime = Date.now(); + await mockExecuteInSandbox(task); + const elapsed = Date.now() - startTime; + + expect(elapsed).toBeGreaterThan(100); + }); + + it('should provide httpRequestId for tracing', async () => { + const task: SandboxTask = { + taskId: 'task-5', + pluginId: 'plugin-5', + compiledCode: 'return httpRequestId;', + params: {}, + socketPath: '/tmp/test.sock', + httpRequestId: 'http-123', + timeout: 5000, + }; + + const result = await mockExecuteInSandbox(task); + expect(result.success).toBe(true); + }); +}); + +describe('Error handling in sandbox', () => { + it('should categorize SyntaxError', () => { + const error = new SyntaxError('Unexpected token'); + + const errorCode = error.name === 'SyntaxError' ? 'SYNTAX_ERROR' : 'PLUGIN_ERROR'; + + expect(errorCode).toBe('SYNTAX_ERROR'); + }); + + it('should categorize TypeError', () => { + const error = new TypeError('Cannot read property'); + + const errorCode = error.name === 'TypeError' ? 'TYPE_ERROR' : 'PLUGIN_ERROR'; + + expect(errorCode).toBe('TYPE_ERROR'); + }); + + it('should categorize ReferenceError', () => { + const error = new ReferenceError('x is not defined'); + + const errorCode = error.name === 'ReferenceError' ? 'REFERENCE_ERROR' : 'PLUGIN_ERROR'; + + expect(errorCode).toBe('REFERENCE_ERROR'); + }); + + it('should handle timeout errors', () => { + const error: any = new Error('Timeout'); + error.code = 'ERR_SCRIPT_EXECUTION_TIMEOUT'; + + const errorCode = error.code === 'ERR_SCRIPT_EXECUTION_TIMEOUT' ? 'TIMEOUT' : 'PLUGIN_ERROR'; + const errorStatus = errorCode === 'TIMEOUT' ? 504 : 500; + + expect(errorCode).toBe('TIMEOUT'); + expect(errorStatus).toBe(504); + }); + + it('should handle handler timeout errors', () => { + const error: any = new Error('Handler timeout'); + error.code = 'ERR_HANDLER_TIMEOUT'; + + const errorCode = error.code === 'ERR_HANDLER_TIMEOUT' ? 'TIMEOUT' : 'PLUGIN_ERROR'; + + expect(errorCode).toBe('TIMEOUT'); + }); + + it('should capture stack trace', () => { + const error = new Error('Test error'); + + const stack = error.stack?.split('\n').slice(0, 10).join('\n'); + + expect(stack).toBeDefined(); + expect(stack).toContain('Test error'); + }); + + it('should use custom status if provided', () => { + const error: any = new Error('Bad request'); + error.status = 400; + + const errorStatus = typeof error.status === 'number' ? error.status : 500; + + expect(errorStatus).toBe(400); + }); +}); + +describe('Safe stringify function', () => { + function safeStringify(value: unknown): string { + try { + return JSON.stringify(value, (_, v) => { + if (typeof v === 'bigint') { + return v.toString() + 'n'; + } + return v; + }); + } catch { + try { + return String(value); + } catch { + return '[Unstringifiable value]'; + } + } + } + + it('should stringify simple values', () => { + expect(safeStringify('hello')).toBe('"hello"'); + expect(safeStringify(42)).toBe('42'); + expect(safeStringify(true)).toBe('true'); + expect(safeStringify(null)).toBe('null'); + }); + + it('should stringify objects', () => { + const obj = { foo: 'bar', num: 42 }; + expect(safeStringify(obj)).toBe('{"foo":"bar","num":42}'); + }); + + it('should handle BigInt', () => { + const bigInt = BigInt(123456789); + const result = safeStringify(bigInt); + expect(result).toContain('123456789'); + }); + + it('should handle circular references', () => { + const obj: any = { name: 'test' }; + obj.self = obj; // Circular reference + + const result = safeStringify(obj); + // Will use String() fallback + expect(result).toBeTruthy(); + }); + + it('should handle undefined', () => { + const result = safeStringify(undefined); + // JSON.stringify returns undefined for undefined + expect(result === undefined || result === 'undefined').toBe(true); + }); +}); + +describe('Memory-aware script caching', () => { + it('should check memory periodically', () => { + const lastCheck = Date.now(); + const checkInterval = 5000; + + const shouldCheck = Date.now() - lastCheck >= checkInterval; + + // Initially should check (time has passed in test) + expect(typeof shouldCheck).toBe('boolean'); + }); + + it('should calculate heap usage ratio correctly', () => { + const heapLimit = 1000 * 1024 * 1024; // 1000MB + const heapUsed = 700 * 1024 * 1024; // 700MB + + const ratio = heapUsed / heapLimit; + + expect(ratio).toBe(0.7); + }); + + it('should evict 25% at 70% heap usage', () => { + const cacheSize = 100; + const heapRatio = 0.70; + + const evictCount = Math.max(1, Math.ceil(cacheSize * 0.25)); + + expect(evictCount).toBe(25); + }); + + it('should evict 50% at 85% heap usage', () => { + const cacheSize = 100; + const heapRatio = 0.85; + + const evictCount = Math.max(1, Math.ceil(cacheSize * 0.5)); + + expect(evictCount).toBe(50); + }); +}); + +describe('Context and cache lifecycle', () => { + it('should release context to pool after execution', () => { + const pool = { released: false }; + const context = { id: 'test-context' }; + + // Simulate execution complete + pool.released = true; + + expect(pool.released).toBe(true); + }); + + it('should close API socket after execution', () => { + const api = { + closed: false, + close() { + this.closed = true; + }, + }; + + api.close(); + + expect(api.closed).toBe(true); + }); + + it('should disconnect KV store after execution', async () => { + const kv = { + disconnected: false, + async disconnect() { + this.disconnected = true; + }, + }; + + await kv.disconnect(); + + expect(kv.disconnected).toBe(true); + }); + + it('should handle cleanup errors gracefully', () => { + const api = { + close() { + throw new Error('Close failed'); + }, + }; + + // Should not throw + expect(() => { + try { + api.close(); + } catch { + // Ignore cleanup errors + } + }).not.toThrow(); + }); +}); diff --git a/plugins/tests/lib/worker-pool.test.ts b/plugins/tests/lib/worker-pool.test.ts new file mode 100644 index 000000000..724f85b2a --- /dev/null +++ b/plugins/tests/lib/worker-pool.test.ts @@ -0,0 +1,454 @@ +import '@jest/globals'; + +// Since the classes are not exported, we'll test them via their behavior +// These tests validate the logic patterns used in worker-pool.ts + +describe('CompiledCodeCache logic', () => { + // Simulating the cache logic for testing + + interface CacheEntry { + code: string; + timestamp: number; + size: number; + } + + class MockCache { + private cache = new Map(); + private totalSize = 0; + private readonly maxSize: number; + private readonly ttlMs: number; + + constructor(maxSizeMB: number = 100, ttlMinutes: number = 60) { + this.maxSize = maxSizeMB * 1024 * 1024; + this.ttlMs = ttlMinutes * 60 * 1000; + } + + get(key: string): string | null { + const entry = this.cache.get(key); + if (!entry) return null; + + // Check expiration + if (Date.now() - entry.timestamp > this.ttlMs) { + this.delete(key); + return null; + } + + // Update timestamp for LRU + entry.timestamp = Date.now(); + return entry.code; + } + + set(key: string, code: string): void { + const size = Buffer.byteLength(code, 'utf8'); + + // Delete existing entry if present + if (this.cache.has(key)) { + this.delete(key); + } + + // Evict if over size limit + while (this.totalSize + size > this.maxSize && this.cache.size > 0) { + this.evictOldest(); + } + + this.cache.set(key, { code, timestamp: Date.now(), size }); + this.totalSize += size; + } + + delete(key: string): boolean { + const entry = this.cache.get(key); + if (entry) { + this.totalSize -= entry.size; + return this.cache.delete(key); + } + return false; + } + + clear(): void { + this.cache.clear(); + this.totalSize = 0; + } + + has(key: string): boolean { + return this.cache.has(key); + } + + get size(): number { + return this.cache.size; + } + + get currentSize(): number { + return this.totalSize; + } + + private evictOldest(): void { + let oldest: string | null = null; + let oldestTime = Infinity; + + for (const [key, entry] of this.cache) { + if (entry.timestamp < oldestTime) { + oldestTime = entry.timestamp; + oldest = key; + } + } + + if (oldest) { + this.delete(oldest); + } + } + + evictExpired(): number { + const now = Date.now(); + let evicted = 0; + + for (const [key, entry] of this.cache) { + if (now - entry.timestamp > this.ttlMs) { + this.delete(key); + evicted++; + } + } + + return evicted; + } + } + + let cache: MockCache; + + beforeEach(() => { + cache = new MockCache(1, 60); // 1MB max, 60 min TTL + }); + + describe('basic operations', () => { + it('should store and retrieve values', () => { + cache.set('plugin1', 'code1'); + expect(cache.get('plugin1')).toBe('code1'); + }); + + it('should return null for missing keys', () => { + expect(cache.get('nonexistent')).toBeNull(); + }); + + it('should delete entries', () => { + cache.set('plugin1', 'code1'); + expect(cache.delete('plugin1')).toBe(true); + expect(cache.get('plugin1')).toBeNull(); + }); + + it('should check if key exists', () => { + cache.set('plugin1', 'code1'); + expect(cache.has('plugin1')).toBe(true); + expect(cache.has('nonexistent')).toBe(false); + }); + + it('should clear all entries', () => { + cache.set('plugin1', 'code1'); + cache.set('plugin2', 'code2'); + cache.clear(); + expect(cache.size).toBe(0); + expect(cache.currentSize).toBe(0); + }); + }); + + describe('size tracking', () => { + it('should track total size', () => { + const code = 'a'.repeat(1000); // ~1KB + cache.set('plugin1', code); + expect(cache.currentSize).toBeGreaterThan(0); + }); + + it('should update size on delete', () => { + const code = 'a'.repeat(1000); + cache.set('plugin1', code); + const sizeAfterSet = cache.currentSize; + + cache.delete('plugin1'); + expect(cache.currentSize).toBe(sizeAfterSet - Buffer.byteLength(code, 'utf8')); + }); + }); + + describe('LRU eviction', () => { + it('should evict oldest entry when full', () => { + // Create a smaller cache for testing + const smallCache = new MockCache(0.001, 60); // ~1KB max + + smallCache.set('old', 'a'.repeat(400)); + // Wait a bit to ensure different timestamp + smallCache.set('new', 'b'.repeat(400)); + + // This should trigger eviction of 'old' + smallCache.set('newest', 'c'.repeat(400)); + + expect(smallCache.has('old')).toBe(false); + expect(smallCache.has('newest')).toBe(true); + }); + + it('should update timestamp on get for LRU', async () => { + // Use even smaller cache - 500 bytes max + const smallCache = new MockCache(0.0005, 60); + + smallCache.set('first', 'a'.repeat(200)); + + // Wait to ensure different timestamps + await new Promise((resolve) => setTimeout(resolve, 10)); + + smallCache.set('second', 'b'.repeat(200)); + + // Wait again + await new Promise((resolve) => setTimeout(resolve, 10)); + + // Access 'first' to update its timestamp (makes it newer than 'second') + smallCache.get('first'); + + // Wait again + await new Promise((resolve) => setTimeout(resolve, 10)); + + // Add new entry - should evict 'second' (oldest access time) + smallCache.set('third', 'c'.repeat(200)); + + // Verify 'first' was accessed more recently and survived + expect(smallCache.has('first')).toBe(true); + // 'second' was not accessed and should be evicted (oldest) + expect(smallCache.has('second')).toBe(false); + }); + }); + + describe('TTL expiration', () => { + it('should return null for expired entries', () => { + // Create cache with 1ms TTL for testing + const shortTTLCache = new MockCache(1, 0.00001); // ~0.6ms TTL + + shortTTLCache.set('plugin1', 'code1'); + + // Wait for expiration + return new Promise((resolve) => { + setTimeout(() => { + expect(shortTTLCache.get('plugin1')).toBeNull(); + resolve(); + }, 10); + }); + }); + }); +}); + +describe('MemoryMonitor logic', () => { + // Simulating memory monitor logic for testing + + interface HeapStats { + heapUsed: number; + heapLimit: number; + } + + class MockMemoryMonitor { + private readonly warningThreshold = 0.75; + private readonly gcThreshold = 0.80; + private readonly criticalThreshold = 0.85; + private readonly emergencyThreshold = 0.92; + private consecutiveHighPressure = 0; + private emergencyTriggered = false; + + private onWarning: (() => void) | null = null; + private onCritical: (() => void) | null = null; + private onEmergency: (() => void) | null = null; + + setCallbacks( + onWarning: () => void, + onCritical: () => void, + onEmergency: () => void + ): void { + this.onWarning = onWarning; + this.onCritical = onCritical; + this.onEmergency = onEmergency; + } + + check(stats: HeapStats): string | null { + const ratio = stats.heapUsed / stats.heapLimit; + + if (ratio >= this.emergencyThreshold) { + if (!this.emergencyTriggered) { + this.emergencyTriggered = true; + this.onEmergency?.(); + return 'emergency'; + } + return 'emergency-blocked'; + } + + if (ratio >= this.criticalThreshold) { + this.consecutiveHighPressure++; + this.onCritical?.(); + return 'critical'; + } + + if (ratio >= this.gcThreshold) { + return 'gc'; + } + + if (ratio >= this.warningThreshold) { + this.onWarning?.(); + return 'warning'; + } + + this.consecutiveHighPressure = 0; + return null; + } + + reset(): void { + this.emergencyTriggered = false; + this.consecutiveHighPressure = 0; + } + + get isEmergencyTriggered(): boolean { + return this.emergencyTriggered; + } + } + + let monitor: MockMemoryMonitor; + + beforeEach(() => { + monitor = new MockMemoryMonitor(); + }); + + describe('threshold detection', () => { + it('should return null for normal memory usage', () => { + const result = monitor.check({ heapUsed: 500, heapLimit: 1000 }); // 50% + expect(result).toBeNull(); + }); + + it('should detect warning threshold (75%)', () => { + const result = monitor.check({ heapUsed: 760, heapLimit: 1000 }); + expect(result).toBe('warning'); + }); + + it('should detect GC threshold (80%)', () => { + const result = monitor.check({ heapUsed: 810, heapLimit: 1000 }); + expect(result).toBe('gc'); + }); + + it('should detect critical threshold (85%)', () => { + const result = monitor.check({ heapUsed: 860, heapLimit: 1000 }); + expect(result).toBe('critical'); + }); + + it('should detect emergency threshold (92%)', () => { + const result = monitor.check({ heapUsed: 930, heapLimit: 1000 }); + expect(result).toBe('emergency'); + }); + }); + + describe('callback invocation', () => { + it('should call warning callback', () => { + const warningFn = jest.fn(); + monitor.setCallbacks(warningFn, jest.fn(), jest.fn()); + + monitor.check({ heapUsed: 760, heapLimit: 1000 }); + expect(warningFn).toHaveBeenCalled(); + }); + + it('should call critical callback', () => { + const criticalFn = jest.fn(); + monitor.setCallbacks(jest.fn(), criticalFn, jest.fn()); + + monitor.check({ heapUsed: 860, heapLimit: 1000 }); + expect(criticalFn).toHaveBeenCalled(); + }); + + it('should call emergency callback only once', () => { + const emergencyFn = jest.fn(); + monitor.setCallbacks(jest.fn(), jest.fn(), emergencyFn); + + monitor.check({ heapUsed: 930, heapLimit: 1000 }); + monitor.check({ heapUsed: 940, heapLimit: 1000 }); + monitor.check({ heapUsed: 950, heapLimit: 1000 }); + + expect(emergencyFn).toHaveBeenCalledTimes(1); + }); + }); + + describe('emergency prevention', () => { + it('should prevent duplicate emergency triggers', () => { + monitor.check({ heapUsed: 930, heapLimit: 1000 }); + expect(monitor.isEmergencyTriggered).toBe(true); + + const result = monitor.check({ heapUsed: 940, heapLimit: 1000 }); + expect(result).toBe('emergency-blocked'); + }); + + it('should allow emergency after reset', () => { + monitor.check({ heapUsed: 930, heapLimit: 1000 }); + monitor.reset(); + expect(monitor.isEmergencyTriggered).toBe(false); + + const result = monitor.check({ heapUsed: 930, heapLimit: 1000 }); + expect(result).toBe('emergency'); + }); + }); + + describe('pressure tracking', () => { + it('should reset consecutive pressure on normal usage', () => { + // First trigger critical + monitor.check({ heapUsed: 860, heapLimit: 1000 }); + // Then normal + monitor.check({ heapUsed: 500, heapLimit: 1000 }); + // The counter should reset (validated by no crash and normal return) + const result = monitor.check({ heapUsed: 500, heapLimit: 1000 }); + expect(result).toBeNull(); + }); + }); +}); + +describe('Metrics bounded map logic', () => { + // Testing the bounded map pattern used for metrics + + function incrementBoundedMap( + map: Map, + key: string, + maxSize: number + ): void { + map.set(key, (map.get(key) || 0) + 1); + + // Evict oldest entries if over limit + if (map.size > maxSize) { + const firstKey = map.keys().next().value; + if (firstKey !== undefined) { + map.delete(firstKey); + } + } + } + + it('should increment existing keys', () => { + const map = new Map(); + incrementBoundedMap(map, 'key1', 10); + incrementBoundedMap(map, 'key1', 10); + expect(map.get('key1')).toBe(2); + }); + + it('should initialize new keys to 1', () => { + const map = new Map(); + incrementBoundedMap(map, 'newKey', 10); + expect(map.get('newKey')).toBe(1); + }); + + it('should evict oldest when over limit', () => { + const map = new Map(); + const maxSize = 3; + + incrementBoundedMap(map, 'first', maxSize); + incrementBoundedMap(map, 'second', maxSize); + incrementBoundedMap(map, 'third', maxSize); + incrementBoundedMap(map, 'fourth', maxSize); + + expect(map.size).toBe(3); + expect(map.has('first')).toBe(false); + expect(map.has('fourth')).toBe(true); + }); + + it('should maintain max size with many entries', () => { + const map = new Map(); + const maxSize = 5; + + for (let i = 0; i < 100; i++) { + incrementBoundedMap(map, `key${i}`, maxSize); + } + + expect(map.size).toBeLessThanOrEqual(maxSize); + }); +}); diff --git a/src/main.rs b/src/main.rs index 7019669db..b7a82cb50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -99,10 +99,11 @@ async fn main() -> Result<()> { // Setup workers for processing jobs initialize_workers(app_state.clone()).await?; - // Initialize plugin worker pool if pool execution is enabled + // Initialize plugin worker pool (enabled by default for better performance) + // Set PLUGIN_USE_POOL=false to use legacy ts-node mode let pool_manager = if std::env::var("PLUGIN_USE_POOL") .map(|v| v.eq_ignore_ascii_case("true") || v == "1") - .unwrap_or(false) + .unwrap_or(true) { info!("Pool-based plugin execution enabled, initializing plugin pool"); match initialize_plugin_pool(app_state.plugin_repository.as_ref()).await { diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs index 16e3d695e..d787018c7 100644 --- a/src/services/plugins/config.rs +++ b/src/services/plugins/config.rs @@ -108,14 +108,20 @@ impl PluginConfig { let pool_max_queue_size = env_parse("PLUGIN_POOL_MAX_QUEUE_SIZE", max_concurrency * 2); // Calculate thread count early for queue timeout derivation + // NOTE: This must use the SAME formula as the actual thread calculation below let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) .unwrap_or(4); - let scaling_threads = max_concurrency / 50; - let estimated_max_threads = (cpu_count * 2) - .max(scaling_threads) + + // Memory-aware estimation (same logic as actual calculation below) + // Assume 16GB default for estimation since we detect actual memory later + let estimated_memory_budget = 16384_u64 / 2; // 8GB budget + let estimated_memory_threads = (estimated_memory_budget / 1024).max(4) as usize; + let estimated_concurrency_threads = (max_concurrency / 200).max(cpu_count); + let estimated_max_threads = estimated_memory_threads + .min(estimated_concurrency_threads) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(64); + .min(32); // Same cap as actual calculation // Queue timeout scales with concurrency AND thread count // Formula: base_timeout * (concurrency / threads) with caps @@ -167,38 +173,105 @@ impl PluginConfig { let derived_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); let nodejs_pool_min_threads = env_parse("PLUGIN_POOL_MIN_THREADS", derived_min_threads); - // maxThreads = min(max(cpuCount * 2, concurrency / 50), 64) - // Goal: Scale threads with concurrency, but cap at 64 for efficiency - // Thread scaling rationale: - // - 50 VUs per thread balances concurrency vs context switching - // - Cap at 64 threads prevents excessive resource usage - // - For low concurrency (<200), use cpu_count * 2 to maintain warm pool - // Examples: - // - 100 concurrency: max(cpu*2, 2) = ~8 threads (warm pool for responsiveness) - // - 1000 concurrency: max(cpu*2, 20) = ~20 threads - // - 3000 concurrency: max(cpu*2, 60) = ~60 threads - // - 6000+ concurrency: capped at 64 threads - let derived_max_threads = (cpu_count * 2) - .max(scaling_threads) - .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(64); // Final cap at 64 + // === Memory-aware thread scaling === + // The previous formula (concurrency / 50) was too aggressive and caused GC issues + // on systems with limited memory (e.g., laptops with 16-36GB RAM). + // + // New approach: Scale threads based on BOTH concurrency AND available memory + // + // Memory budget calculation: + // - Each worker thread needs ~1-2GB heap for high concurrent task loads + // - On a 16GB system, we shouldn't use more than ~8GB for workers (50%) + // - On a 32GB system, we can use ~16GB for workers + // + // Thread limits based on system memory: + // - 8GB RAM: max 4 threads (conservative) + // - 16GB RAM: max 8 threads + // - 32GB RAM: max 16 threads + // - 64GB+ RAM: max 32 threads (hard cap for efficiency) + // + // This prevents the previous issue where 5000 VU would spawn 64 threads + // requiring 128GB+ of potential heap allocation. + let total_memory_mb = { + #[cfg(target_os = "macos")] + { + // On macOS, use sysctl to get total memory + use std::process::Command; + Command::new("sysctl") + .args(["-n", "hw.memsize"]) + .output() + .ok() + .and_then(|o| String::from_utf8(o.stdout).ok()) + .and_then(|s| s.trim().parse::().ok()) + .map(|bytes| bytes / 1024 / 1024) + .unwrap_or(16384) // Default to 16GB if detection fails + } + #[cfg(target_os = "linux")] + { + // On Linux, read from /proc/meminfo + std::fs::read_to_string("/proc/meminfo") + .ok() + .and_then(|contents| { + contents + .lines() + .find(|l| l.starts_with("MemTotal:")) + .and_then(|l| { + l.split_whitespace() + .nth(1) + .and_then(|s| s.parse::().ok()) + }) + }) + .map(|kb| kb / 1024) + .unwrap_or(16384) // Default to 16GB + } + #[cfg(not(any(target_os = "macos", target_os = "linux")))] + { + 16384_u64 // Default to 16GB on other platforms + } + }; + + // Calculate memory-based thread limit + // Use ~50% of system memory for workers, with 1GB budget per worker + // (Workers with good GC pressure management don't actually use 2GB each) + let memory_budget_mb = total_memory_mb / 2; + let heap_per_worker_mb = 1024_u64; // ~1GB per worker (realistic with GC) + let memory_based_max_threads = (memory_budget_mb / heap_per_worker_mb).max(4) as usize; + + // Concurrency-based thread scaling (more conservative than before) + // Changed from /50 to /200 - each thread can handle ~200 VUs with async I/O + // Example: 10,000 VUs / 200 = 50 threads (capped by memory) + let concurrency_based_threads = (max_concurrency / 200).max(cpu_count); + + // Final thread count: minimum of memory-based and concurrency-based limits + // This ensures we don't exceed either memory or concurrency constraints + let derived_max_threads = memory_based_max_threads + .min(concurrency_based_threads) + .max(DEFAULT_POOL_MAX_THREADS_FLOOR) // At least the floor + .min(32); // Hard cap at 32 (reduced from 64) + + tracing::debug!( + total_memory_mb = total_memory_mb, + memory_based_max = memory_based_max_threads, + concurrency_based = concurrency_based_threads, + derived_max_threads = derived_max_threads, + "Thread scaling calculation" + ); + let nodejs_pool_max_threads = env_parse("PLUGIN_POOL_MAX_THREADS", derived_max_threads); // concurrentTasksPerWorker: Node.js async can handle many concurrent tasks - // Formula: (concurrency / max_threads) * 2.5 for headroom - // Note: Using max_threads is correct since pool will scale up under load. - // The 2.5x multiplier provides headroom for: + // Formula: (concurrency / max_threads) * 1.2 for some headroom + // The 1.2x multiplier provides headroom for: // - Queue buildup during traffic spikes // - Variable plugin execution latency - // - Async I/O overlap (Node.js handles this well) - // Examples: - // - 5000 VUs / 64 threads * 2.5 = ~195 tasks/worker - // - 3000 VUs / 60 threads * 2.5 = ~125 tasks/worker - // - 1000 VUs / 20 threads * 2.5 = ~125 tasks/worker + // Examples with new formula (on 16GB system with ~8 threads): + // - 10000 VUs / 16 threads * 1.2 = 750, capped at 250 + // - 5000 VUs / 8 threads * 1.2 = 750, capped at 250 + // - 1000 VUs / 8 threads * 1.2 = 150 let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); - let derived_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) + let derived_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) - .min(300); // High cap - Node.js handles async well + .min(250); // Cap at 250 (validated stable by testing) let nodejs_pool_concurrent_tasks = env_parse("PLUGIN_POOL_CONCURRENT_TASKS", derived_concurrent_tasks); @@ -206,17 +279,18 @@ impl PluginConfig { env_parse("PLUGIN_POOL_IDLE_TIMEOUT", DEFAULT_POOL_IDLE_TIMEOUT_MS); // Worker heap size calculation - // Each vm.createContext() uses ~4-8MB, and we need headroom for GC - // Formula: base_heap + (concurrent_tasks * 8MB) + // Each vm.createContext() uses ~4-6MB, and we need headroom for GC + // Formula: base_heap + (concurrent_tasks * 5MB) // This ensures workers can handle burst context creation without OOM // Examples: - // - 50 concurrent tasks: 512 + (50 * 8) = 912MB - // - 200 concurrent tasks: 512 + (200 * 8) = 2112MB - // - 300 concurrent tasks: 512 + (300 * 8) = 2912MB + // - 50 concurrent tasks: 512 + (50 * 5) = 762MB + // - 150 concurrent tasks: 512 + (150 * 5) = 1262MB + // - 250 concurrent tasks: 512 + (250 * 5) = 1762MB let base_worker_heap = 512_usize; - let heap_per_task = 8_usize; - let derived_worker_heap_mb = - base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task); + let heap_per_task = 5_usize; + let derived_worker_heap_mb = (base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task)) + .max(1024) // At least 1GB + .min(2048); // Cap at 2GB let nodejs_worker_heap_mb = env_parse("PLUGIN_WORKER_HEAP_MB", derived_worker_heap_mb); // Socket backlog calculation @@ -308,6 +382,7 @@ impl PluginConfig { let tasks_per_thread = self.max_concurrency / self.nodejs_pool_max_threads.max(1); let socket_ratio = self.socket_max_connections as f64 / self.max_concurrency as f64; let queue_ratio = self.pool_max_queue_size as f64 / self.max_concurrency as f64; + let total_worker_heap_mb = self.nodejs_pool_max_threads * self.nodejs_worker_heap_mb; tracing::info!( max_concurrency = self.max_concurrency, @@ -320,6 +395,7 @@ impl PluginConfig { nodejs_max_threads = self.nodejs_pool_max_threads, nodejs_concurrent_tasks = self.nodejs_pool_concurrent_tasks, nodejs_worker_heap_mb = self.nodejs_worker_heap_mb, + total_worker_heap_mb = total_worker_heap_mb, tasks_per_thread = tasks_per_thread, socket_multiplier = %format!("{:.2}x", socket_ratio), queue_multiplier = %format!("{:.2}x", queue_ratio), @@ -349,23 +425,32 @@ impl Default for PluginConfig { let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; let pool_max_queue_size = max_concurrency * 2; - let scaling_threads = max_concurrency / 50; - let nodejs_pool_max_threads = (cpu_count * 2) - .max(scaling_threads) + // Memory-aware thread scaling (same as from_env) + // Assume 16GB for default since we can't easily detect memory here + let assumed_memory_mb = 16384_u64; + let memory_budget_mb = assumed_memory_mb / 2; + let heap_per_worker_mb = 1024_u64; // ~1GB per worker + let memory_based_max_threads = (memory_budget_mb / heap_per_worker_mb).max(4) as usize; + let concurrency_based_threads = (max_concurrency / 200).max(cpu_count); + + let nodejs_pool_max_threads = memory_based_max_threads + .min(concurrency_based_threads) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(64); + .min(32); let nodejs_pool_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); - let nodejs_pool_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) + let nodejs_pool_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) - .min(300); + .min(250); - // Worker heap for Default impl + // Worker heap for Default impl (same formula as from_env) let base_worker_heap = 512_usize; - let heap_per_task = 8_usize; - let nodejs_worker_heap_mb = - base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task); + let heap_per_task = 5_usize; + let nodejs_worker_heap_mb = (base_worker_heap + + (nodejs_pool_concurrent_tasks * heap_per_task)) + .max(1024) + .min(2048); let default_backlog = DEFAULT_POOL_SOCKET_BACKLOG as usize; let pool_socket_backlog = max_concurrency.max(default_backlog); @@ -459,11 +544,14 @@ mod tests { let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; let pool_max_queue_size = max_concurrency * 2; - let scaling_threads = max_concurrency / 50; - let nodejs_pool_max_threads = (cpu_count * 2) - .max(scaling_threads) + // New memory-aware formula (assuming 16GB) + let memory_budget_mb = 16384 / 2; + let memory_based_max = (memory_budget_mb / 1024).max(4); + let concurrency_based = (max_concurrency / 200).max(cpu_count); + let nodejs_pool_max_threads = memory_based_max + .min(concurrency_based) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(64); + .min(32); assert_eq!(pool_max_connections, 10); assert_eq!(socket_max_connections, 15); // 1.5x @@ -475,8 +563,8 @@ mod tests { #[test] fn test_medium_concurrency() { - // Test edge case: medium concurrency (100) - let max_concurrency = 100; + // Test edge case: medium concurrency (1000) + let max_concurrency = 1000; let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) .unwrap_or(4); @@ -484,22 +572,28 @@ mod tests { let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; let pool_max_queue_size = max_concurrency * 2; - let scaling_threads = max_concurrency / 50; - let nodejs_pool_max_threads = (cpu_count * 2) - .max(scaling_threads) + // New memory-aware formula (assuming 16GB) + let memory_budget_mb = 16384 / 2; + let memory_based_max = (memory_budget_mb / 1024).max(4); + let concurrency_based = (max_concurrency / 200).max(cpu_count); + let nodejs_pool_max_threads = memory_based_max + .min(concurrency_based) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(64); + .min(32); - assert_eq!(socket_max_connections, 150); // 1.5x - assert_eq!(pool_max_queue_size, 200); // 2x + assert_eq!(socket_max_connections, 1500); // 1.5x + assert_eq!(pool_max_queue_size, 2000); // 2x - // Should use cpu_count * 2 for thread count (warm pool) - assert!(nodejs_pool_max_threads >= cpu_count * 2); + // With 16GB memory and 1000 concurrency: + // memory_based = 8, concurrency_based = max(5, cpu_count) + // Result should be reasonable (not 64!) + assert!(nodejs_pool_max_threads <= 16); } #[test] fn test_high_concurrency() { // Test edge case: high concurrency (10000) + // This simulates your load test scenario let max_concurrency = 10000; let socket_max_connections = (max_concurrency as f64 * 1.5) as usize; @@ -508,24 +602,30 @@ mod tests { let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) .unwrap_or(4); - let scaling_threads = max_concurrency / 50; - let nodejs_pool_max_threads = (cpu_count * 2) - .max(scaling_threads) + + // New memory-aware formula (assuming 16GB) + let memory_budget_mb = 16384 / 2; + let memory_based_max = (memory_budget_mb / 1024).max(4); + let concurrency_based = (max_concurrency / 200).max(cpu_count); + let nodejs_pool_max_threads = memory_based_max + .min(concurrency_based) .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(64); + .min(32); assert_eq!(socket_max_connections, 15000); // 1.5x assert_eq!(pool_max_queue_size, 20000); // 2x - // Should hit the 64 thread cap - assert_eq!(nodejs_pool_max_threads, 64); + // With 16GB: memory_based=8, concurrency_based=50 -> result = 8 + // Should NOT hit 64 threads anymore (memory-constrained) + assert!(nodejs_pool_max_threads <= 32); - // Should have high concurrent tasks per worker + // Concurrent tasks per worker let base_tasks = max_concurrency / nodejs_pool_max_threads; - let derived_concurrent_tasks = ((base_tasks as f64 * 2.5) as usize) + let derived_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) - .min(300); - assert!(derived_concurrent_tasks >= base_tasks); + .min(250); + // Should be capped at 250 + assert!(derived_concurrent_tasks <= 250); } #[test] diff --git a/src/services/plugins/connection.rs b/src/services/plugins/connection.rs new file mode 100644 index 000000000..26ca1ec39 --- /dev/null +++ b/src/services/plugins/connection.rs @@ -0,0 +1,333 @@ +//! Connection pool for Unix socket communication with the pool server. +//! +//! Provides efficient connection reuse with: +//! - Lock-free connection acquisition via crossbeam SegQueue +//! - Semaphore-based concurrency limiting +//! - RAII connection guards for automatic cleanup + +use crossbeam::queue::SegQueue; +use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; +use std::sync::Arc; +use std::time::Duration; +use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; +use tokio::net::UnixStream; +use tokio::sync::Semaphore; + +use super::config::get_config; +use super::protocol::{PoolRequest, PoolResponse}; +use super::PluginError; + +/// A single connection to the pool server +pub struct PoolConnection { + stream: UnixStream, + /// Connection ID for tracking + id: usize, + /// Health status of this connection + healthy: AtomicBool, +} + +impl PoolConnection { + pub async fn new(socket_path: &str, id: usize) -> Result { + let max_attempts = get_config().pool_connect_retries; + let mut attempts = 0; + let mut delay_ms = 10u64; + + tracing::debug!(connection_id = id, socket_path = %socket_path, "Connecting to pool server"); + + loop { + match UnixStream::connect(socket_path).await { + Ok(stream) => { + if attempts > 0 { + tracing::debug!( + connection_id = id, + attempts = attempts, + "Connected to pool server after retries" + ); + } + return Ok(Self { + stream, + id, + healthy: AtomicBool::new(true), + }); + } + Err(e) => { + attempts += 1; + + if attempts >= max_attempts { + return Err(PluginError::SocketError(format!( + "Failed to connect to pool after {max_attempts} attempts: {e}. \ + Consider increasing PLUGIN_POOL_CONNECT_RETRIES or PLUGIN_POOL_MAX_CONNECTIONS." + ))); + } + + if attempts <= 3 || attempts % 5 == 0 { + tracing::debug!( + connection_id = id, + attempt = attempts, + max_attempts = max_attempts, + delay_ms = delay_ms, + "Retrying connection to pool server" + ); + } + + tokio::time::sleep(Duration::from_millis(delay_ms)).await; + delay_ms = std::cmp::min(delay_ms * 2, 1000); + } + } + } + } + + pub async fn send_request( + &mut self, + request: &PoolRequest, + ) -> Result { + let json = serde_json::to_string(request) + .map_err(|e| PluginError::PluginError(format!("Failed to serialize request: {e}")))?; + + if let Err(e) = self.stream.write_all(format!("{json}\n").as_bytes()).await { + return Err(PluginError::SocketError(format!( + "Failed to send request: {e}" + ))); + } + + if let Err(e) = self.stream.flush().await { + return Err(PluginError::SocketError(format!( + "Failed to flush request: {e}" + ))); + } + + let mut reader = BufReader::new(&mut self.stream); + let mut line = String::new(); + + if let Err(e) = reader.read_line(&mut line).await { + return Err(PluginError::SocketError(format!( + "Failed to read response: {e}" + ))); + } + + tracing::debug!(response_len = line.len(), "Received response from pool"); + + serde_json::from_str(&line) + .map_err(|e| PluginError::PluginError(format!("Failed to parse response: {e}"))) + } + + pub async fn send_request_with_timeout( + &mut self, + request: &PoolRequest, + timeout_secs: u64, + ) -> Result { + tokio::time::timeout( + Duration::from_secs(timeout_secs), + self.send_request(request), + ) + .await + .map_err(|_| PluginError::SocketError("Request timed out".to_string()))? + } + + /// Get the connection ID + pub fn id(&self) -> usize { + self.id + } + + /// Check if connection is healthy + pub fn is_healthy(&self) -> bool { + self.healthy.load(Ordering::Relaxed) + } + + /// Mark connection as unhealthy + pub fn mark_unhealthy(&self) { + self.healthy.store(false, Ordering::Relaxed); + } +} + +/// Connection pool for reusing socket connections. +/// Uses lock-free SegQueue for O(1) connection acquisition and release. +pub struct ConnectionPool { + socket_path: String, + /// Available connections (lock-free stack) + available: Arc>, + /// Maximum number of connections + #[allow(dead_code)] + max_connections: usize, + /// Next connection ID (atomic for lock-free increment) + next_id: Arc, + /// Semaphore for limiting concurrent connections + pub semaphore: Arc, +} + +impl ConnectionPool { + pub fn new(socket_path: String, max_connections: usize) -> Self { + Self { + socket_path, + available: Arc::new(SegQueue::new()), + max_connections, + next_id: Arc::new(AtomicUsize::new(0)), + semaphore: Arc::new(Semaphore::new(max_connections)), + } + } + + /// Get a connection from the pool or create a new one. + /// Uses semaphore for proper concurrency limiting. + /// Accepts optional pre-acquired permit for fast path optimization. + pub async fn acquire_with_permit( + &self, + permit: Option, + ) -> Result, PluginError> { + let permit = match permit { + Some(p) => p, + None => { + let available_permits = self.semaphore.available_permits(); + if available_permits == 0 { + tracing::warn!( + max_connections = self.max_connections, + "All connection permits exhausted - waiting for connection" + ); + } + self.semaphore.clone().acquire_owned().await.map_err(|_| { + PluginError::PluginError("Connection semaphore closed".to_string()) + })? + } + }; + + // O(1) lock-free pop from available connections + loop { + match self.available.pop() { + Some(conn) => { + if conn.is_healthy() { + tracing::debug!(connection_id = conn.id(), "Reusing connection from pool"); + return Ok(PooledConnection { + conn: Some(conn), + pool: self, + _permit: permit, + }); + } + tracing::debug!(connection_id = conn.id(), "Dropping unhealthy connection"); + continue; + } + None => { + let id = self.next_id.fetch_add(1, Ordering::Relaxed); + tracing::debug!(connection_id = id, "Creating new pool connection"); + + let conn = PoolConnection::new(&self.socket_path, id).await?; + + return Ok(PooledConnection { + conn: Some(conn), + pool: self, + _permit: permit, + }); + } + } + } + } + + /// Convenience method for acquiring without pre-acquired permit + pub async fn acquire(&self) -> Result, PluginError> { + self.acquire_with_permit(None).await + } + + /// Return a connection to the pool + pub fn release(&self, conn: PoolConnection) { + let conn_id = conn.id(); + let is_healthy = conn.is_healthy(); + + if is_healthy { + self.available.push(conn); + tracing::debug!(connection_id = conn_id, "Connection returned to pool"); + } else { + tracing::debug!(connection_id = conn_id, "Connection dropped (unhealthy)"); + } + } + + /// Clear all connections + pub async fn clear(&self) { + while self.available.pop().is_some() {} + } +} + +/// RAII wrapper that returns connection to pool on drop +pub struct PooledConnection<'a> { + conn: Option, + pool: &'a ConnectionPool, + /// Semaphore permit - released when dropped + _permit: tokio::sync::OwnedSemaphorePermit, +} + +impl<'a> PooledConnection<'a> { + pub async fn send_request_with_timeout( + &mut self, + request: &PoolRequest, + timeout_secs: u64, + ) -> Result { + if let Some(ref mut conn) = self.conn { + match conn.send_request_with_timeout(request, timeout_secs).await { + Ok(response) => Ok(response), + Err(e) => { + if let Some(ref conn) = self.conn { + conn.mark_unhealthy(); + } + Err(e) + } + } + } else { + Err(PluginError::PluginError( + "Connection already released".to_string(), + )) + } + } + + /// Mark this connection as unhealthy (won't be returned to pool) + pub fn mark_unhealthy(&mut self) { + if let Some(ref conn) = self.conn { + conn.mark_unhealthy(); + } + } +} + +impl<'a> Drop for PooledConnection<'a> { + fn drop(&mut self) { + if let Some(conn) = self.conn.take() { + self.pool.release(conn); + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_connection_pool_creation() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); + assert!(pool.available.is_empty()); + } + + #[tokio::test] + async fn test_connection_pool_clear() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); + pool.clear().await; + assert!(pool.available.is_empty()); + } + + #[tokio::test] + async fn test_connection_pool_semaphore_limits() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 2); + + let permit1 = pool.semaphore.clone().try_acquire_owned(); + assert!(permit1.is_ok()); + + let permit2 = pool.semaphore.clone().try_acquire_owned(); + assert!(permit2.is_ok()); + + let permit3 = pool.semaphore.clone().try_acquire_owned(); + assert!(permit3.is_err()); + } + + #[test] + fn test_pool_connection_health_state() { + let health = std::sync::atomic::AtomicBool::new(true); + assert!(health.load(Ordering::Relaxed)); + + health.store(false, Ordering::Relaxed); + assert!(!health.load(Ordering::Relaxed)); + } +} diff --git a/src/services/plugins/health.rs b/src/services/plugins/health.rs new file mode 100644 index 000000000..5a98e318f --- /dev/null +++ b/src/services/plugins/health.rs @@ -0,0 +1,608 @@ +//! Health monitoring and circuit breaker for the plugin pool. +//! +//! This module provides: +//! - Circuit breaker pattern for automatic degradation under stress +//! - Health status reporting for monitoring +//! - Dead server detection for automatic recovery + +use std::sync::atomic::{AtomicU32, AtomicU64, AtomicU8, AtomicUsize, Ordering}; +use std::sync::Arc; + +/// Lock-free ring buffer for tracking recent results (sliding window) +pub struct ResultRingBuffer { + buffer: Vec, // 0 = empty, 1 = success, 2 = failure + index: AtomicUsize, + size: usize, +} + +impl ResultRingBuffer { + pub fn new(size: usize) -> Self { + assert!(size > 0, "ResultRingBuffer size must be greater than 0"); + let mut buffer = Vec::with_capacity(size); + for _ in 0..size { + buffer.push(AtomicU8::new(0)); + } + Self { + buffer, + index: AtomicUsize::new(0), + size, + } + } + + pub fn record(&self, success: bool) { + let idx = self.index.fetch_add(1, Ordering::Relaxed) % self.size; + self.buffer[idx].store(if success { 1 } else { 2 }, Ordering::Relaxed); + } + + pub fn failure_rate(&self) -> f32 { + let mut total = 0; + let mut failures = 0; + + for slot in &self.buffer { + match slot.load(Ordering::Relaxed) { + 0 => {} // Empty slot + 1 => total += 1, // Success + 2 => { + total += 1; + failures += 1; + } + _ => {} + } + } + + if total < 10 { + return 0.0; // Not enough data to make decision + } + + (failures as f32) / (total as f32) + } +} + +/// Circuit breaker state for automatic degradation under stress +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CircuitState { + /// Normal operation - all requests allowed + Closed, + /// Degraded - some requests rejected to reduce load + HalfOpen, + /// Fully open - most requests rejected, recovery in progress + Open, +} + +/// Indicators that the pool server is dead or unreachable. +/// Using an enum instead of string matching for type safety and documentation. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum DeadServerIndicator { + /// JSON parse error - connection closed mid-message + EofWhileParsing, + /// Write to closed socket + BrokenPipe, + /// Server not listening + ConnectionRefused, + /// Server forcefully closed connection + ConnectionReset, + /// Socket not connected + NotConnected, + /// Connection establishment failed + FailedToConnect, + /// Unix socket file deleted + SocketFileMissing, + /// Socket file doesn't exist + NoSuchFile, + /// Connection timeout (not execution timeout) + ConnectionTimedOut, +} + +impl DeadServerIndicator { + /// All patterns that indicate a dead server + const ALL: &'static [(&'static str, DeadServerIndicator)] = &[ + ("eof while parsing", DeadServerIndicator::EofWhileParsing), + ("broken pipe", DeadServerIndicator::BrokenPipe), + ("connection refused", DeadServerIndicator::ConnectionRefused), + ("connection reset", DeadServerIndicator::ConnectionReset), + ("not connected", DeadServerIndicator::NotConnected), + ("failed to connect", DeadServerIndicator::FailedToConnect), + ( + "socket file missing", + DeadServerIndicator::SocketFileMissing, + ), + ("no such file", DeadServerIndicator::NoSuchFile), + ( + "connection timed out", + DeadServerIndicator::ConnectionTimedOut, + ), + ("connect timed out", DeadServerIndicator::ConnectionTimedOut), + ]; + + /// Check if an error string matches any dead server indicator + pub fn from_error_str(error_str: &str) -> Option { + let lower = error_str.to_lowercase(); + Self::ALL + .iter() + .find(|(pattern, _)| lower.contains(pattern)) + .map(|(_, indicator)| *indicator) + } +} + +/// Process status for health check decisions +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ProcessStatus { + /// Process is running normally + Running, + /// Process has exited + Exited, + /// Could not determine status + Unknown, + /// No process handle exists + NoProcess, +} + +/// Circuit breaker for managing pool health and automatic recovery. +/// Tracks failure rates and response times to detect GC pressure. +pub struct CircuitBreaker { + /// Current circuit state (encoded as u8 for atomic access) + /// 0 = Closed, 1 = HalfOpen, 2 = Open + state: AtomicU32, + /// Time when circuit opened (for recovery timing) + opened_at_ms: AtomicU64, + /// Consecutive successful requests in half-open state + recovery_successes: AtomicU32, + /// Average response time in ms (exponential moving average) + avg_response_time_ms: AtomicU32, + /// Number of restart attempts + restart_attempts: AtomicU32, + /// Sliding window of recent results (100 most recent) + recent_results: Arc, +} + +impl Default for CircuitBreaker { + fn default() -> Self { + Self::new() + } +} + +impl CircuitBreaker { + pub fn new() -> Self { + Self { + state: AtomicU32::new(0), // Closed + opened_at_ms: AtomicU64::new(0), + recovery_successes: AtomicU32::new(0), + avg_response_time_ms: AtomicU32::new(0), + restart_attempts: AtomicU32::new(0), + recent_results: Arc::new(ResultRingBuffer::new(100)), + } + } + + pub fn state(&self) -> CircuitState { + match self.state.load(Ordering::Relaxed) { + 0 => CircuitState::Closed, + 1 => CircuitState::HalfOpen, + _ => CircuitState::Open, + } + } + + pub fn set_state(&self, state: CircuitState) { + let val = match state { + CircuitState::Closed => 0, + CircuitState::HalfOpen => 1, + CircuitState::Open => 2, + }; + self.state.store(val, Ordering::Relaxed); + } + + /// Record a successful request with response time + pub fn record_success(&self, response_time_ms: u32) { + self.recent_results.record(true); + + // Update exponential moving average (alpha = 0.1) + let current = self.avg_response_time_ms.load(Ordering::Relaxed); + let new_avg = if current == 0 { + response_time_ms + } else { + (current * 9 + response_time_ms) / 10 + }; + self.avg_response_time_ms.store(new_avg, Ordering::Relaxed); + + // Handle state transitions on success + match self.state() { + CircuitState::HalfOpen => { + let successes = self.recovery_successes.fetch_add(1, Ordering::Relaxed) + 1; + // Require 10 consecutive successes to close circuit + if successes >= 10 { + tracing::info!("Circuit breaker closing - recovery successful"); + self.set_state(CircuitState::Closed); + self.recovery_successes.store(0, Ordering::Relaxed); + self.restart_attempts.store(0, Ordering::Relaxed); + } + } + CircuitState::Open => { + // Check if enough time has passed to try half-open + self.maybe_transition_to_half_open(); + } + CircuitState::Closed => {} + } + } + + /// Record a failed request + pub fn record_failure(&self) { + self.recent_results.record(false); + self.recovery_successes.store(0, Ordering::Relaxed); + + let failure_rate = self.recent_results.failure_rate(); + + match self.state() { + CircuitState::Closed => { + // Open circuit if failure rate > 50% (ring buffer requires at least 10 samples) + if failure_rate > 0.5 { + tracing::warn!( + failure_rate = %format!("{:.1}%", failure_rate * 100.0), + "Circuit breaker opening - high failure rate" + ); + self.open_circuit(); + } + } + CircuitState::HalfOpen => { + // Any failure in half-open sends back to open + tracing::warn!("Circuit breaker reopening - failure during recovery"); + self.open_circuit(); + } + CircuitState::Open => { + // Already open, just check for transition + self.maybe_transition_to_half_open(); + } + } + } + + fn open_circuit(&self) { + self.set_state(CircuitState::Open); + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_millis() as u64; + self.opened_at_ms.store(now, Ordering::Relaxed); + self.recovery_successes.store(0, Ordering::Relaxed); + } + + fn maybe_transition_to_half_open(&self) { + let opened_at = self.opened_at_ms.load(Ordering::Relaxed); + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_millis() as u64; + + // Wait at least 5 seconds before trying recovery + // Exponential backoff: 5s, 10s, 20s, 40s, max 60s + let attempts = self.restart_attempts.load(Ordering::Relaxed); + let backoff_ms = (5000u64 * (1 << attempts.min(4))).min(60000); + + if now - opened_at >= backoff_ms { + tracing::info!( + backoff_ms = backoff_ms, + "Circuit breaker transitioning to half-open" + ); + self.set_state(CircuitState::HalfOpen); + self.restart_attempts.fetch_add(1, Ordering::Relaxed); + } + } + + /// Check if request should be allowed based on circuit state. + /// If recovery_allowance is provided, use it in HalfOpen state instead of default 10%. + pub fn should_allow_request(&self, recovery_allowance: Option) -> bool { + match self.state() { + CircuitState::Closed => true, + CircuitState::HalfOpen => { + // Use recovery allowance if provided, otherwise default to 10% + let allowance = recovery_allowance.unwrap_or(10); + (rand::random::() % 100) < allowance + } + CircuitState::Open => { + // Check if we should transition to half-open + self.maybe_transition_to_half_open(); + // Recheck state after potential transition + matches!(self.state(), CircuitState::HalfOpen) + } + } + } + + /// Get current response time average for monitoring + pub fn avg_response_time(&self) -> u32 { + self.avg_response_time_ms.load(Ordering::Relaxed) + } + + /// Force circuit to closed state (for manual recovery) + pub fn force_close(&self) { + self.set_state(CircuitState::Closed); + self.recovery_successes.store(0, Ordering::Relaxed); + self.restart_attempts.store(0, Ordering::Relaxed); + } + + /// Access recovery_successes for testing + #[cfg(test)] + pub fn recovery_successes(&self) -> &AtomicU32 { + &self.recovery_successes + } +} + +/// Health status information from the pool server +#[derive(Debug, Clone)] +pub struct HealthStatus { + pub healthy: bool, + pub status: String, + pub uptime_ms: Option, + pub memory: Option, + pub pool_completed: Option, + pub pool_queued: Option, + pub success_rate: Option, + /// Circuit breaker state (Closed/HalfOpen/Open) + pub circuit_state: Option, + /// Average response time in ms + pub avg_response_time_ms: Option, + /// Whether recovery mode is active + pub recovering: Option, + /// Current recovery allowance percentage + pub recovery_percent: Option, +} + +#[cfg(test)] +mod tests { + use super::*; + + // ========================================================================= + // DeadServerIndicator Tests + // ========================================================================= + + #[test] + fn test_dead_server_indicator_eof_while_parsing() { + let result = DeadServerIndicator::from_error_str("eof while parsing a value"); + assert_eq!(result, Some(DeadServerIndicator::EofWhileParsing)); + } + + #[test] + fn test_dead_server_indicator_broken_pipe() { + let result = DeadServerIndicator::from_error_str("write failed: Broken pipe"); + assert_eq!(result, Some(DeadServerIndicator::BrokenPipe)); + } + + #[test] + fn test_dead_server_indicator_connection_refused() { + let result = DeadServerIndicator::from_error_str("Connection refused (os error 61)"); + assert_eq!(result, Some(DeadServerIndicator::ConnectionRefused)); + } + + #[test] + fn test_dead_server_indicator_connection_reset() { + let result = DeadServerIndicator::from_error_str("Connection reset by peer"); + assert_eq!(result, Some(DeadServerIndicator::ConnectionReset)); + } + + #[test] + fn test_dead_server_indicator_not_connected() { + let result = DeadServerIndicator::from_error_str("Socket is not connected"); + assert_eq!(result, Some(DeadServerIndicator::NotConnected)); + } + + #[test] + fn test_dead_server_indicator_failed_to_connect() { + let result = DeadServerIndicator::from_error_str("Failed to connect to server"); + assert_eq!(result, Some(DeadServerIndicator::FailedToConnect)); + } + + #[test] + fn test_dead_server_indicator_socket_file_missing() { + let result = DeadServerIndicator::from_error_str("Socket file missing at /tmp/pool.sock"); + assert_eq!(result, Some(DeadServerIndicator::SocketFileMissing)); + } + + #[test] + fn test_dead_server_indicator_no_such_file() { + let result = DeadServerIndicator::from_error_str("No such file or directory"); + assert_eq!(result, Some(DeadServerIndicator::NoSuchFile)); + } + + #[test] + fn test_dead_server_indicator_connection_timed_out() { + let result = DeadServerIndicator::from_error_str("Connection timed out after 5s"); + assert_eq!(result, Some(DeadServerIndicator::ConnectionTimedOut)); + } + + #[test] + fn test_dead_server_indicator_connect_timed_out() { + let result = DeadServerIndicator::from_error_str("Connect timed out"); + assert_eq!(result, Some(DeadServerIndicator::ConnectionTimedOut)); + } + + #[test] + fn test_dead_server_indicator_case_insensitive() { + let result = DeadServerIndicator::from_error_str("BROKEN PIPE ERROR"); + assert_eq!(result, Some(DeadServerIndicator::BrokenPipe)); + + let result = DeadServerIndicator::from_error_str("EOF While Parsing"); + assert_eq!(result, Some(DeadServerIndicator::EofWhileParsing)); + } + + #[test] + fn test_dead_server_indicator_no_match() { + let result = DeadServerIndicator::from_error_str("Plugin execution failed"); + assert_eq!(result, None); + + let result = DeadServerIndicator::from_error_str("Timeout exceeded"); + assert_eq!(result, None); + + let result = DeadServerIndicator::from_error_str(""); + assert_eq!(result, None); + } + + // ========================================================================= + // ResultRingBuffer Tests + // ========================================================================= + + #[test] + fn test_result_ring_buffer_empty() { + let buffer = ResultRingBuffer::new(100); + assert_eq!(buffer.failure_rate(), 0.0); + } + + #[test] + fn test_result_ring_buffer_all_successes() { + let buffer = ResultRingBuffer::new(100); + for _ in 0..50 { + buffer.record(true); + } + assert_eq!(buffer.failure_rate(), 0.0); + } + + #[test] + fn test_result_ring_buffer_all_failures() { + let buffer = ResultRingBuffer::new(100); + for _ in 0..50 { + buffer.record(false); + } + assert_eq!(buffer.failure_rate(), 1.0); + } + + #[test] + fn test_result_ring_buffer_mixed_results() { + let buffer = ResultRingBuffer::new(100); + for _ in 0..25 { + buffer.record(true); + } + for _ in 0..25 { + buffer.record(false); + } + assert!((buffer.failure_rate() - 0.5).abs() < 0.01); + } + + #[test] + fn test_result_ring_buffer_wraps_around() { + let buffer = ResultRingBuffer::new(100); + for _ in 0..100 { + buffer.record(true); + } + for _ in 0..50 { + buffer.record(false); + } + assert!((buffer.failure_rate() - 0.5).abs() < 0.01); + } + + // ========================================================================= + // CircuitBreaker Tests + // ========================================================================= + + #[test] + fn test_circuit_breaker_initial_state() { + let cb = CircuitBreaker::new(); + assert_eq!(cb.state(), CircuitState::Closed); + assert!(cb.should_allow_request(None)); + } + + #[test] + fn test_circuit_breaker_stays_closed_on_successes() { + let cb = CircuitBreaker::new(); + for _ in 0..100 { + cb.record_success(50); + } + assert_eq!(cb.state(), CircuitState::Closed); + assert!(cb.should_allow_request(None)); + } + + #[test] + fn test_circuit_breaker_opens_on_high_failure_rate() { + let cb = CircuitBreaker::new(); + for _ in 0..100 { + cb.record_failure(); + } + assert_eq!(cb.state(), CircuitState::Open); + } + + #[test] + fn test_circuit_breaker_half_open_allows_some_requests() { + let cb = CircuitBreaker::new(); + cb.set_state(CircuitState::HalfOpen); + + let mut allowed = 0; + for _ in 0..100 { + if cb.should_allow_request(Some(10)) { + allowed += 1; + } + } + assert!(allowed > 0, "Half-open should allow some requests"); + assert!(allowed < 50, "Half-open should not allow too many requests"); + } + + #[test] + fn test_circuit_breaker_force_close() { + let cb = CircuitBreaker::new(); + cb.set_state(CircuitState::Open); + assert_eq!(cb.state(), CircuitState::Open); + + cb.force_close(); + assert_eq!(cb.state(), CircuitState::Closed); + } + + #[test] + fn test_circuit_breaker_half_open_to_closed_on_successes() { + let cb = CircuitBreaker::new(); + cb.set_state(CircuitState::HalfOpen); + cb.recovery_successes().store(0, Ordering::Relaxed); + + for _ in 0..10 { + cb.record_success(50); + } + + assert_eq!(cb.state(), CircuitState::Closed); + } + + #[test] + fn test_circuit_breaker_half_open_to_open_on_failure() { + let cb = CircuitBreaker::new(); + cb.set_state(CircuitState::HalfOpen); + cb.recovery_successes().store(5, Ordering::Relaxed); + + cb.record_failure(); + + assert_eq!(cb.state(), CircuitState::Open); + } + + #[test] + fn test_circuit_breaker_response_time_tracking() { + let cb = CircuitBreaker::new(); + + cb.record_success(100); + cb.record_success(200); + cb.record_success(150); + + let avg = cb.avg_response_time(); + assert!(avg > 0, "Average should be positive"); + assert!(avg < 300, "Average should be reasonable"); + } + + // ========================================================================= + // CircuitState Tests + // ========================================================================= + + #[test] + fn test_circuit_state_debug() { + assert_eq!(format!("{:?}", CircuitState::Closed), "Closed"); + assert_eq!(format!("{:?}", CircuitState::HalfOpen), "HalfOpen"); + assert_eq!(format!("{:?}", CircuitState::Open), "Open"); + } + + #[test] + fn test_circuit_state_equality() { + assert_eq!(CircuitState::Closed, CircuitState::Closed); + assert_ne!(CircuitState::Closed, CircuitState::Open); + assert_ne!(CircuitState::HalfOpen, CircuitState::Open); + } + + // ========================================================================= + // ProcessStatus Tests + // ========================================================================= + + #[test] + fn test_process_status_variants() { + assert_eq!(ProcessStatus::Running, ProcessStatus::Running); + assert_eq!(ProcessStatus::Exited, ProcessStatus::Exited); + assert_eq!(ProcessStatus::Unknown, ProcessStatus::Unknown); + assert_ne!(ProcessStatus::Running, ProcessStatus::Exited); + } +} diff --git a/src/services/plugins/mod.rs b/src/services/plugins/mod.rs index b97850fea..c98cdd93e 100644 --- a/src/services/plugins/mod.rs +++ b/src/services/plugins/mod.rs @@ -23,6 +23,15 @@ use uuid::Uuid; pub mod config; pub use config::*; +pub mod health; +pub use health::*; + +pub mod protocol; +pub use protocol::*; + +pub mod connection; +pub use connection::*; + pub mod runner; pub use runner::*; diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index d2b315c34..ccd165506 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -6,659 +6,23 @@ //! Communication with the Node.js pool server happens via Unix socket using //! a JSON-line protocol. -use crossbeam::queue::SegQueue; -use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::process::Stdio; -use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, AtomicU8, AtomicUsize, Ordering}; +use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, Ordering}; use std::sync::Arc; use std::time::{Duration, Instant}; -use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; -use tokio::net::UnixStream; +use tokio::io::{AsyncBufReadExt, BufReader}; use tokio::process::{Child, Command}; -use tokio::sync::{oneshot, RwLock, Semaphore}; +use tokio::sync::{oneshot, RwLock}; use uuid::Uuid; -use super::{ - config::get_config, LogEntry, LogLevel, PluginError, PluginHandlerPayload, ScriptResult, +use super::config::get_config; +use super::connection::{ConnectionPool, PoolConnection}; +use super::health::{ + CircuitBreaker, CircuitState, DeadServerIndicator, HealthStatus, ProcessStatus, }; - -/// Lock-free ring buffer for tracking recent results (sliding window) -struct ResultRingBuffer { - buffer: Vec, // 0 = empty, 1 = success, 2 = failure - index: AtomicUsize, - size: usize, -} - -impl ResultRingBuffer { - fn new(size: usize) -> Self { - let mut buffer = Vec::with_capacity(size); - for _ in 0..size { - buffer.push(AtomicU8::new(0)); - } - Self { - buffer, - index: AtomicUsize::new(0), - size, - } - } - - fn record(&self, success: bool) { - let idx = self.index.fetch_add(1, Ordering::Relaxed) % self.size; - self.buffer[idx].store(if success { 1 } else { 2 }, Ordering::Relaxed); - } - - fn failure_rate(&self) -> f32 { - let mut total = 0; - let mut failures = 0; - - for slot in &self.buffer { - match slot.load(Ordering::Relaxed) { - 0 => {} // Empty slot - 1 => total += 1, // Success - 2 => { - total += 1; - failures += 1; - } - _ => {} - } - } - - if total < 10 { - return 0.0; // Not enough data to make decision - } - - (failures as f32) / (total as f32) - } -} - -/// Circuit breaker state for automatic degradation under stress -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum CircuitState { - /// Normal operation - all requests allowed - Closed, - /// Degraded - some requests rejected to reduce load - HalfOpen, - /// Fully open - most requests rejected, recovery in progress - Open, -} - -/// Circuit breaker for managing pool health and automatic recovery -/// Tracks failure rates and response times to detect GC pressure -pub struct CircuitBreaker { - /// Current circuit state (encoded as u8 for atomic access) - /// 0 = Closed, 1 = HalfOpen, 2 = Open - state: AtomicU32, - /// Time when circuit opened (for recovery timing) - opened_at_ms: AtomicU64, - /// Consecutive successful requests in half-open state - recovery_successes: AtomicU32, - /// Average response time in ms (exponential moving average) - avg_response_time_ms: AtomicU32, - /// Number of restart attempts - restart_attempts: AtomicU32, - /// Sliding window of recent results (100 most recent) - recent_results: Arc, -} - -impl Default for CircuitBreaker { - fn default() -> Self { - Self::new() - } -} - -impl CircuitBreaker { - pub fn new() -> Self { - Self { - state: AtomicU32::new(0), // Closed - opened_at_ms: AtomicU64::new(0), - recovery_successes: AtomicU32::new(0), - avg_response_time_ms: AtomicU32::new(0), - restart_attempts: AtomicU32::new(0), - recent_results: Arc::new(ResultRingBuffer::new(100)), - } - } - - fn state(&self) -> CircuitState { - match self.state.load(Ordering::Relaxed) { - 0 => CircuitState::Closed, - 1 => CircuitState::HalfOpen, - _ => CircuitState::Open, - } - } - - fn set_state(&self, state: CircuitState) { - let val = match state { - CircuitState::Closed => 0, - CircuitState::HalfOpen => 1, - CircuitState::Open => 2, - }; - self.state.store(val, Ordering::Relaxed); - } - - /// Record a successful request with response time - pub fn record_success(&self, response_time_ms: u32) { - self.recent_results.record(true); - - // Update exponential moving average (alpha = 0.1) - let current = self.avg_response_time_ms.load(Ordering::Relaxed); - let new_avg = if current == 0 { - response_time_ms - } else { - (current * 9 + response_time_ms) / 10 - }; - self.avg_response_time_ms.store(new_avg, Ordering::Relaxed); - - // Handle state transitions on success - match self.state() { - CircuitState::HalfOpen => { - let successes = self.recovery_successes.fetch_add(1, Ordering::Relaxed) + 1; - // Require 10 consecutive successes to close circuit - if successes >= 10 { - tracing::info!("Circuit breaker closing - recovery successful"); - self.set_state(CircuitState::Closed); - self.recovery_successes.store(0, Ordering::Relaxed); - self.restart_attempts.store(0, Ordering::Relaxed); - } - } - CircuitState::Open => { - // Check if enough time has passed to try half-open - self.maybe_transition_to_half_open(); - } - CircuitState::Closed => {} - } - } - - /// Record a failed request - pub fn record_failure(&self) { - self.recent_results.record(false); - self.recovery_successes.store(0, Ordering::Relaxed); - - let failure_rate = self.recent_results.failure_rate(); - - match self.state() { - CircuitState::Closed => { - // Open circuit if failure rate > 50% (ring buffer requires at least 10 samples) - if failure_rate > 0.5 { - tracing::warn!( - failure_rate = %format!("{:.1}%", failure_rate * 100.0), - "Circuit breaker opening - high failure rate" - ); - self.open_circuit(); - } - } - CircuitState::HalfOpen => { - // Any failure in half-open sends back to open - tracing::warn!("Circuit breaker reopening - failure during recovery"); - self.open_circuit(); - } - CircuitState::Open => { - // Already open, just check for transition - self.maybe_transition_to_half_open(); - } - } - } - - fn open_circuit(&self) { - self.set_state(CircuitState::Open); - let now = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap_or_default() - .as_millis() as u64; - self.opened_at_ms.store(now, Ordering::Relaxed); - self.recovery_successes.store(0, Ordering::Relaxed); - } - - fn maybe_transition_to_half_open(&self) { - let opened_at = self.opened_at_ms.load(Ordering::Relaxed); - let now = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .unwrap_or_default() - .as_millis() as u64; - - // Wait at least 5 seconds before trying recovery - // Exponential backoff: 5s, 10s, 20s, 40s, max 60s - let attempts = self.restart_attempts.load(Ordering::Relaxed); - let backoff_ms = (5000u64 * (1 << attempts.min(4))).min(60000); - - if now - opened_at >= backoff_ms { - tracing::info!( - backoff_ms = backoff_ms, - "Circuit breaker transitioning to half-open" - ); - self.set_state(CircuitState::HalfOpen); - self.restart_attempts.fetch_add(1, Ordering::Relaxed); - } - } - - /// Check if request should be allowed based on circuit state - /// If recovery_allowance is provided, use it in HalfOpen state instead of default 10% - pub fn should_allow_request(&self, recovery_allowance: Option) -> bool { - match self.state() { - CircuitState::Closed => true, - CircuitState::HalfOpen => { - // Use recovery allowance if provided, otherwise default to 10% - let allowance = recovery_allowance.unwrap_or(10); - (rand::random::() % 100) < allowance - } - CircuitState::Open => { - // Check if we should transition to half-open - self.maybe_transition_to_half_open(); - // Recheck state after potential transition - matches!(self.state(), CircuitState::HalfOpen) - } - } - } - - /// Get current response time average for monitoring - pub fn avg_response_time(&self) -> u32 { - self.avg_response_time_ms.load(Ordering::Relaxed) - } - - /// Force circuit to closed state (for manual recovery) - pub fn force_close(&self) { - self.set_state(CircuitState::Closed); - self.recovery_successes.store(0, Ordering::Relaxed); - self.restart_attempts.store(0, Ordering::Relaxed); - // Note: Ring buffer will naturally overwrite old results, no need to clear - } -} - -/// Health status information from the pool server -#[derive(Debug, Clone)] -pub struct HealthStatus { - pub healthy: bool, - pub status: String, - pub uptime_ms: Option, - pub memory: Option, - pub pool_completed: Option, - pub pool_queued: Option, - pub success_rate: Option, - /// Circuit breaker state (Closed/HalfOpen/Open) - pub circuit_state: Option, - /// Average response time in ms - pub avg_response_time_ms: Option, - /// Whether recovery mode is active - pub recovering: Option, - /// Current recovery allowance percentage - pub recovery_percent: Option, -} - -/// Message types for pool communication -#[derive(Serialize, Debug)] -#[serde(tag = "type", rename_all = "lowercase")] -pub enum PoolRequest { - Execute { - #[serde(rename = "taskId")] - task_id: String, - #[serde(rename = "pluginId")] - plugin_id: String, - #[serde(rename = "compiledCode", skip_serializing_if = "Option::is_none")] - compiled_code: Option, - #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] - plugin_path: Option, - params: serde_json::Value, - #[serde(skip_serializing_if = "Option::is_none")] - headers: Option>>, - #[serde(rename = "socketPath")] - socket_path: String, - #[serde(rename = "httpRequestId", skip_serializing_if = "Option::is_none")] - http_request_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - timeout: Option, - }, - Precompile { - #[serde(rename = "taskId")] - task_id: String, - #[serde(rename = "pluginId")] - plugin_id: String, - #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] - plugin_path: Option, - #[serde(rename = "sourceCode", skip_serializing_if = "Option::is_none")] - source_code: Option, - }, - Cache { - #[serde(rename = "taskId")] - task_id: String, - #[serde(rename = "pluginId")] - plugin_id: String, - #[serde(rename = "compiledCode")] - compiled_code: String, - }, - Invalidate { - #[serde(rename = "taskId")] - task_id: String, - #[serde(rename = "pluginId")] - plugin_id: String, - }, - Stats { - #[serde(rename = "taskId")] - task_id: String, - }, - Health { - #[serde(rename = "taskId")] - task_id: String, - }, - Shutdown { - #[serde(rename = "taskId")] - task_id: String, - }, -} - -#[derive(Deserialize, Debug)] -pub struct PoolResponse { - #[serde(rename = "taskId")] - pub task_id: String, - pub success: bool, - pub result: Option, - pub error: Option, - pub logs: Option>, -} - -#[derive(Deserialize, Debug)] -pub struct PoolError { - pub message: String, - pub code: Option, - pub status: Option, - pub details: Option, -} - -#[derive(Deserialize, Debug)] -pub struct PoolLogEntry { - pub level: String, - pub message: String, -} - -impl From for LogEntry { - fn from(entry: PoolLogEntry) -> Self { - let level = match entry.level.as_str() { - "error" => LogLevel::Error, - "warn" => LogLevel::Warn, - "info" => LogLevel::Info, - "debug" => LogLevel::Debug, - "result" => LogLevel::Result, - _ => LogLevel::Log, - }; - LogEntry { - level, - message: entry.message, - } - } -} - -/// Pool connection state -struct PoolConnection { - stream: UnixStream, - /// Connection ID for tracking - id: usize, - /// Health status of this connection - healthy: AtomicBool, -} - -impl PoolConnection { - async fn new(socket_path: &str, id: usize) -> Result { - // Retry connection with exponential backoff - let max_attempts = get_config().pool_connect_retries; - let mut attempts = 0; - let mut delay_ms = 10u64; - - tracing::debug!(connection_id = id, socket_path = %socket_path, "Connecting to pool server"); - - loop { - match UnixStream::connect(socket_path).await { - Ok(stream) => { - if attempts > 0 { - tracing::debug!( - connection_id = id, - attempts = attempts, - "Connected to pool server after retries" - ); - } - return Ok(Self { - stream, - id, - healthy: AtomicBool::new(true), - }); - } - Err(e) => { - attempts += 1; - - if attempts >= max_attempts { - return Err(PluginError::SocketError(format!( - "Failed to connect to pool after {max_attempts} attempts: {e}. \ - Consider increasing PLUGIN_POOL_CONNECT_RETRIES or PLUGIN_POOL_MAX_CONNECTIONS." - ))); - } - - // Log selectively to reduce noise - if attempts <= 3 || attempts % 5 == 0 { - tracing::debug!( - connection_id = id, - attempt = attempts, - max_attempts = max_attempts, - delay_ms = delay_ms, - "Retrying connection to pool server" - ); - } - - tokio::time::sleep(Duration::from_millis(delay_ms)).await; - // Exponential backoff with cap at 1 second - delay_ms = std::cmp::min(delay_ms * 2, 1000); - } - } - } - } - - async fn send_request(&mut self, request: &PoolRequest) -> Result { - let json = serde_json::to_string(request) - .map_err(|e| PluginError::PluginError(format!("Failed to serialize request: {e}")))?; - - // Write request and flush - if let Err(e) = self.stream.write_all(format!("{json}\n").as_bytes()).await { - return Err(PluginError::SocketError(format!( - "Failed to send request: {e}" - ))); - } - - if let Err(e) = self.stream.flush().await { - return Err(PluginError::SocketError(format!( - "Failed to flush request: {e}" - ))); - } - - // Read response using BufReader on a reference to the stream - let mut reader = BufReader::new(&mut self.stream); - let mut line = String::new(); - - if let Err(e) = reader.read_line(&mut line).await { - return Err(PluginError::SocketError(format!( - "Failed to read response: {e}" - ))); - } - - tracing::debug!(response_len = line.len(), "Received response from pool"); - - serde_json::from_str(&line) - .map_err(|e| PluginError::PluginError(format!("Failed to parse response: {e}"))) - } - - /// Send request with timeout - async fn send_request_with_timeout( - &mut self, - request: &PoolRequest, - timeout_secs: u64, - ) -> Result { - tokio::time::timeout( - Duration::from_secs(timeout_secs), - self.send_request(request), - ) - .await - .map_err(|_| PluginError::SocketError("Request timed out".to_string()))? - } -} - -/// Connection pool for reusing socket connections -/// Uses lock-free SegQueue for O(1) connection acquisition and release -struct ConnectionPool { - socket_path: String, - /// Available connections (lock-free stack) - available: Arc>, - /// Maximum number of connections - max_connections: usize, - /// Next connection ID (atomic for lock-free increment) - next_id: Arc, - /// Semaphore for limiting concurrent connections - semaphore: Arc, -} - -impl ConnectionPool { - fn new(socket_path: String, max_connections: usize) -> Self { - Self { - socket_path, - available: Arc::new(SegQueue::new()), - max_connections, - next_id: Arc::new(AtomicUsize::new(0)), - semaphore: Arc::new(Semaphore::new(max_connections)), - } - } - - /// Get a connection from the pool or create a new one - /// Uses semaphore for proper concurrency limiting - /// Accepts optional pre-acquired permit for fast path optimization - async fn acquire_with_permit( - &self, - permit: Option, - ) -> Result, PluginError> { - // Acquire permit if not provided - let permit = match permit { - Some(p) => p, - None => { - let available_permits = self.semaphore.available_permits(); - if available_permits == 0 { - tracing::warn!( - max_connections = self.max_connections, - "All connection permits exhausted - waiting for connection" - ); - } - self.semaphore.clone().acquire_owned().await.map_err(|_| { - PluginError::PluginError("Connection semaphore closed".to_string()) - })? - } - }; - - // O(1) lock-free pop from available connections - loop { - match self.available.pop() { - Some(conn) => { - // Check if connection is healthy - if conn.healthy.load(Ordering::Relaxed) { - tracing::debug!(connection_id = conn.id, "Reusing connection from pool"); - return Ok(PooledConnection { - conn: Some(conn), - pool: self, - _permit: permit, - }); - } - // Connection unhealthy, drop it and try next - tracing::debug!(connection_id = conn.id, "Dropping unhealthy connection"); - continue; - } - None => { - // No available connection, create a new one - let id = self.next_id.fetch_add(1, Ordering::Relaxed); - tracing::debug!(connection_id = id, "Creating new pool connection"); - - let conn = PoolConnection::new(&self.socket_path, id).await?; - - return Ok(PooledConnection { - conn: Some(conn), - pool: self, - _permit: permit, - }); - } - } - } - } - - /// Convenience method for acquiring without pre-acquired permit - async fn acquire(&self) -> Result, PluginError> { - self.acquire_with_permit(None).await - } - - /// Return a connection to the pool - fn release(&self, conn: PoolConnection) { - let conn_id = conn.id; - let is_healthy = conn.healthy.load(Ordering::Relaxed); - - if is_healthy { - // O(1) lock-free push - self.available.push(conn); - tracing::debug!(connection_id = conn_id, "Connection returned to pool"); - } else { - tracing::debug!(connection_id = conn_id, "Connection dropped (unhealthy)"); - } - } - - /// Mark a connection as unhealthy (no-op with new design) - /// Health is now tracked in the connection itself - fn mark_unhealthy(&self, _conn_id: usize) { - // No longer needed - health is in PoolConnection.healthy - // Connection will be dropped on release if unhealthy - } - - /// Clear all connections - async fn clear(&self) { - // Drain the queue - while self.available.pop().is_some() {} - } -} - -/// RAII wrapper that returns connection to pool on drop -struct PooledConnection<'a> { - conn: Option, - pool: &'a ConnectionPool, - /// Semaphore permit - released when dropped - _permit: tokio::sync::OwnedSemaphorePermit, -} - -impl<'a> PooledConnection<'a> { - async fn send_request_with_timeout( - &mut self, - request: &PoolRequest, - timeout_secs: u64, - ) -> Result { - if let Some(ref mut conn) = self.conn { - match conn.send_request_with_timeout(request, timeout_secs).await { - Ok(response) => Ok(response), - Err(e) => { - if let Some(conn_id) = self.conn.as_ref().map(|c| c.id) { - self.pool.mark_unhealthy(conn_id); - } - Err(e) - } - } - } else { - Err(PluginError::PluginError( - "Connection already released".to_string(), - )) - } - } - - /// Mark this connection as unhealthy (won't be returned to pool) - fn mark_unhealthy(&mut self) { - if let Some(ref conn) = self.conn { - conn.healthy.store(false, Ordering::Relaxed); - } - } -} - -impl<'a> Drop for PooledConnection<'a> { - fn drop(&mut self) { - if let Some(conn) = self.conn.take() { - self.pool.release(conn); - } - } -} +use super::protocol::{PoolError, PoolRequest, PoolResponse}; +use super::{LogEntry, PluginError, PluginHandlerPayload, ScriptResult}; /// Request queue entry for throttling struct QueuedRequest { @@ -698,6 +62,8 @@ pub struct PoolManager { recovery_mode: Arc, /// Requests allowed during recovery (gradual increase) recovery_allowance: Arc, + /// Shutdown signal for background tasks (queue workers, health check, etc.) + shutdown_signal: Arc, } impl PoolManager { @@ -713,19 +79,23 @@ impl PoolManager { /// Common initialization logic fn init(socket_path: String) -> Self { - // Use centralized config with auto-derivation from PLUGIN_MAX_CONCURRENCY let config = get_config(); let max_connections = config.pool_max_connections; let max_queue_size = config.pool_max_queue_size; - // Use async-channel for multi-consumer queue (no mutex needed) let (tx, rx) = async_channel::bounded(max_queue_size); let connection_pool = Arc::new(ConnectionPool::new(socket_path.clone(), max_connections)); let connection_pool_clone = connection_pool.clone(); - // Spawn background workers to process queued requests - Self::spawn_queue_workers(rx, connection_pool_clone, config.pool_workers); + let shutdown_signal = Arc::new(tokio::sync::Notify::new()); + + Self::spawn_queue_workers( + rx, + connection_pool_clone, + config.pool_workers, + shutdown_signal.clone(), + ); let health_check_needed = Arc::new(AtomicBool::new(false)); let consecutive_failures = Arc::new(AtomicU32::new(0)); @@ -734,14 +104,17 @@ impl PoolManager { let recovery_mode = Arc::new(AtomicBool::new(false)); let recovery_allowance = Arc::new(AtomicU32::new(0)); - // Spawn background health check task to avoid atomic ops on hot path Self::spawn_health_check_task( health_check_needed.clone(), config.health_check_interval_secs, + shutdown_signal.clone(), ); - // Spawn background recovery ramp-up task - Self::spawn_recovery_task(recovery_mode.clone(), recovery_allowance.clone()); + Self::spawn_recovery_task( + recovery_mode.clone(), + recovery_allowance.clone(), + shutdown_signal.clone(), + ); Self { connection_pool, @@ -757,33 +130,44 @@ impl PoolManager { last_restart_time_ms, recovery_mode, recovery_allowance, + shutdown_signal, } } /// Spawn background task to gradually increase recovery allowance - fn spawn_recovery_task(recovery_mode: Arc, recovery_allowance: Arc) { + fn spawn_recovery_task( + recovery_mode: Arc, + recovery_allowance: Arc, + shutdown_signal: Arc, + ) { tokio::spawn(async move { let mut interval = tokio::time::interval(Duration::from_millis(500)); interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); loop { - interval.tick().await; - - if recovery_mode.load(Ordering::Relaxed) { - let current = recovery_allowance.load(Ordering::Relaxed); - // Gradually increase from 10% to 100% over ~15 seconds - // 10 -> 20 -> 30 -> ... -> 100 - if current < 100 { - let new_allowance = (current + 10).min(100); - recovery_allowance.store(new_allowance, Ordering::Relaxed); - tracing::debug!( - allowance = new_allowance, - "Recovery mode: increasing request allowance" - ); - } else { - // Recovery complete - recovery_mode.store(false, Ordering::Relaxed); - tracing::info!("Recovery mode complete - full capacity restored"); + tokio::select! { + biased; + + _ = shutdown_signal.notified() => { + tracing::debug!("Recovery task received shutdown signal"); + break; + } + + _ = interval.tick() => { + if recovery_mode.load(Ordering::Relaxed) { + let current = recovery_allowance.load(Ordering::Relaxed); + if current < 100 { + let new_allowance = (current + 10).min(100); + recovery_allowance.store(new_allowance, Ordering::Relaxed); + tracing::debug!( + allowance = new_allowance, + "Recovery mode: increasing request allowance" + ); + } else { + recovery_mode.store(false, Ordering::Relaxed); + tracing::info!("Recovery mode complete - full capacity restored"); + } + } } } } @@ -791,15 +175,28 @@ impl PoolManager { } /// Spawn background task to set health check flag periodically - /// This avoids atomic operations on the hot path - fn spawn_health_check_task(health_check_needed: Arc, interval_secs: u64) { + fn spawn_health_check_task( + health_check_needed: Arc, + interval_secs: u64, + shutdown_signal: Arc, + ) { tokio::spawn(async move { let mut interval = tokio::time::interval(Duration::from_secs(interval_secs)); interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); loop { - interval.tick().await; - health_check_needed.store(true, Ordering::Relaxed); + tokio::select! { + biased; + + _ = shutdown_signal.notified() => { + tracing::debug!("Health check task received shutdown signal"); + break; + } + + _ = interval.tick() => { + health_check_needed.store(true, Ordering::Relaxed); + } + } } }); } @@ -809,6 +206,7 @@ impl PoolManager { rx: async_channel::Receiver, connection_pool: Arc, configured_workers: usize, + shutdown_signal: Arc, ) { let num_workers = if configured_workers > 0 { configured_workers @@ -823,54 +221,70 @@ impl PoolManager { for worker_id in 0..num_workers { let rx_clone = rx.clone(); let pool_clone = connection_pool.clone(); + let shutdown = shutdown_signal.clone(); tokio::spawn(async move { - while let Ok(request) = rx_clone.recv().await { - let start = std::time::Instant::now(); - let plugin_id = request.plugin_id.clone(); - - let result = Self::execute_plugin_internal( - &pool_clone, - request.plugin_id, - request.compiled_code, - request.plugin_path, - request.params, - request.headers, - request.socket_path, - request.http_request_id, - request.timeout_secs, - ) - .await; - - let elapsed = start.elapsed(); - if let Err(ref e) = result { - // Don't warn about shutdown errors - these are expected during graceful shutdown - let error_str = format!("{:?}", e); - if error_str.contains("shutdown") || error_str.contains("Shutdown") { - tracing::debug!( - worker_id = worker_id, - plugin_id = %plugin_id, - "Plugin execution cancelled during shutdown" - ); - } else { - tracing::warn!( - worker_id = worker_id, - plugin_id = %plugin_id, - elapsed_ms = elapsed.as_millis() as u64, - error = ?e, - "Plugin execution failed" - ); + loop { + tokio::select! { + biased; + + _ = shutdown.notified() => { + tracing::debug!(worker_id = worker_id, "Request queue worker received shutdown signal"); + break; } - } else if elapsed.as_secs() > 1 { - tracing::debug!( - worker_id = worker_id, - plugin_id = %plugin_id, - elapsed_ms = elapsed.as_millis() as u64, - "Slow plugin execution" - ); - } - let _ = request.response_tx.send(result); + request_result = rx_clone.recv() => { + let request = match request_result { + Ok(r) => r, + Err(_) => break, + }; + + let start = std::time::Instant::now(); + let plugin_id = request.plugin_id.clone(); + + let result = Self::execute_plugin_internal( + &pool_clone, + request.plugin_id, + request.compiled_code, + request.plugin_path, + request.params, + request.headers, + request.socket_path, + request.http_request_id, + request.timeout_secs, + ) + .await; + + let elapsed = start.elapsed(); + if let Err(ref e) = result { + let error_str = format!("{:?}", e); + if error_str.contains("shutdown") || error_str.contains("Shutdown") { + tracing::debug!( + worker_id = worker_id, + plugin_id = %plugin_id, + "Plugin execution cancelled during shutdown" + ); + } else { + tracing::warn!( + worker_id = worker_id, + plugin_id = %plugin_id, + elapsed_ms = elapsed.as_millis() as u64, + error = ?e, + "Plugin execution failed" + ); + } + } else if elapsed.as_secs() > 1 { + tracing::debug!( + worker_id = worker_id, + plugin_id = %plugin_id, + elapsed_ms = elapsed.as_millis() as u64, + "Slow plugin execution" + ); + } + + let _ = request.response_tx.send(result); + } + } } tracing::debug!(worker_id = worker_id, "Request queue worker exited"); @@ -878,8 +292,56 @@ impl PoolManager { } } + /// Spawn a rate-limited stderr reader to prevent log flooding + fn spawn_rate_limited_stderr_reader(stderr: tokio::process::ChildStderr) { + tokio::spawn(async move { + let reader = BufReader::new(stderr); + let mut lines = reader.lines(); + + let mut last_log_time = std::time::Instant::now(); + let mut suppressed_count = 0u64; + let min_interval = Duration::from_millis(100); + + while let Ok(Some(line)) = lines.next_line().await { + let now = std::time::Instant::now(); + let elapsed = now.duration_since(last_log_time); + + if elapsed >= min_interval { + if suppressed_count > 0 { + tracing::warn!( + target: "pool_server", + suppressed = suppressed_count, + "... ({} lines suppressed due to rate limiting)", + suppressed_count + ); + suppressed_count = 0; + } + tracing::error!(target: "pool_server", "{}", line); + last_log_time = now; + } else { + suppressed_count += 1; + if suppressed_count % 100 == 0 { + tracing::warn!( + target: "pool_server", + suppressed = suppressed_count, + "Pool server producing excessive stderr output" + ); + } + } + } + + if suppressed_count > 0 { + tracing::warn!( + target: "pool_server", + suppressed = suppressed_count, + "Pool server stderr closed ({} final lines suppressed)", + suppressed_count + ); + } + }); + } + /// Execute plugin with optional pre-acquired permit (unified fast/slow path) - /// This eliminates code duplication between fast path and queued execution async fn execute_with_permit( connection_pool: &Arc, permit: Option, @@ -909,7 +371,6 @@ impl PoolManager { let timeout = timeout_secs.unwrap_or(get_config().pool_request_timeout_secs); let response = conn.send_request_with_timeout(&request, timeout).await?; - // Avoid allocating empty Vec - only allocate if logs exist let logs: Vec = response .logs .map(|logs| logs.into_iter().map(|l| l.into()).collect()) @@ -964,7 +425,6 @@ impl PoolManager { http_request_id: Option, timeout_secs: Option, ) -> Result { - // Delegate to unified execution method (no pre-acquired permit for queued requests) Self::execute_with_permit( connection_pool, None, @@ -981,22 +441,17 @@ impl PoolManager { } /// Start the pool server if not already running - /// Uses startup lock to prevent concurrent starts pub async fn ensure_started(&self) -> Result<(), PluginError> { - // Fast path: check if already initialized if *self.initialized.read().await { return Ok(()); } - // Acquire startup lock to prevent concurrent starts let _startup_guard = self.restart_lock.lock().await; - // Double-check after acquiring lock if *self.initialized.read().await { return Ok(()); } - // Slow path: acquire write lock and start let mut initialized = self.initialized.write().await; if *initialized { return Ok(()); @@ -1008,156 +463,120 @@ impl PoolManager { } /// Ensure pool is started and healthy, with auto-recovery on failure - /// Uses background task flag to avoid atomic operations on hot path async fn ensure_started_and_healthy(&self) -> Result<(), PluginError> { self.ensure_started().await?; - // Check if background task flagged that health check is needed - // This is a simple load, no compare_exchange - much faster! if !self.health_check_needed.load(Ordering::Relaxed) { - // No health check needed yet return Ok(()); } - // Try to clear the flag atomically (only one thread does the check) if !self .health_check_needed .compare_exchange(true, false, Ordering::Relaxed, Ordering::Relaxed) .is_ok() { - // Another thread is already doing the health check return Ok(()); } - // Check if the process is still running (and reap zombies) - let process_running = { + self.check_and_restart_if_needed().await + } + + /// Check process status and restart if needed + async fn check_and_restart_if_needed(&self) -> Result<(), PluginError> { + let _restart_guard = self.restart_lock.lock().await; + + let process_status = { let mut process_guard = self.process.lock().await; if let Some(child) = process_guard.as_mut() { - // Actually check if process is still alive using try_wait() - // This returns Ok(Some(exit_status)) if process has exited, - // Ok(None) if still running, or Err if check failed match child.try_wait() { Ok(Some(exit_status)) => { - // Process has exited - log, clean up, and mark as not running tracing::warn!( exit_status = ?exit_status, "Pool server process has exited" ); - // Drop the child handle to reap zombie process *process_guard = None; - false - } - Ok(None) => { - // Process is still running - true + ProcessStatus::Exited } + Ok(None) => ProcessStatus::Running, Err(e) => { - // Failed to check status - assume dead to be safe tracing::warn!( error = %e, "Failed to check pool server process status, assuming dead" ); - // Clean up handle *process_guard = None; - false + ProcessStatus::Unknown } } } else { - false + ProcessStatus::NoProcess } }; - if !process_running { - // Process definitely not running - try to restart - tracing::warn!("Pool server process not running, attempting restart"); - self.consecutive_failures.fetch_add(1, Ordering::Relaxed); - if let Err(e) = self.restart().await { - tracing::error!(error = %e, "Failed to restart pool server"); - return Err(PluginError::PluginExecutionError( - "Pool server not running and restart failed".to_string(), - )); + match process_status { + ProcessStatus::Running => { + let socket_exists = std::path::Path::new(&self.socket_path).exists(); + if !socket_exists { + tracing::warn!( + socket_path = %self.socket_path, + "Pool server socket file missing, restarting" + ); + self.consecutive_failures.fetch_add(1, Ordering::Relaxed); + self.restart_internal().await?; + self.consecutive_failures.store(0, Ordering::Relaxed); + } } - self.consecutive_failures.store(0, Ordering::Relaxed); - return Ok(()); - } - - // Process is running - do a lightweight socket check instead of full health check - // This avoids using connections from the pool under load - let socket_exists = std::path::Path::new(&self.socket_path).exists(); - - if !socket_exists { - // Socket file gone - server crashed or was killed - tracing::warn!( - socket_path = %self.socket_path, - "Pool server socket file missing, attempting restart" - ); - self.consecutive_failures.fetch_add(1, Ordering::Relaxed); - if let Err(e) = self.restart().await { - tracing::error!(error = %e, "Failed to restart pool server"); - return Err(PluginError::PluginExecutionError( - "Pool server socket missing and restart failed".to_string(), - )); + ProcessStatus::Exited | ProcessStatus::Unknown | ProcessStatus::NoProcess => { + tracing::warn!("Pool server not running, restarting"); + self.consecutive_failures.fetch_add(1, Ordering::Relaxed); + self.restart_internal().await?; + self.consecutive_failures.store(0, Ordering::Relaxed); } - self.consecutive_failures.store(0, Ordering::Relaxed); } Ok(()) } - async fn start_pool_server(&self) -> Result<(), PluginError> { - let mut process_guard = self.process.lock().await; - - if process_guard.is_some() { - return Ok(()); - } - - // Clean up socket file with retry logic to handle race conditions - // Multiple attempts may be needed if another process is cleaning up - let mut attempts = 0; + /// Clean up socket file with retry logic + async fn cleanup_socket_file(socket_path: &str) { let max_cleanup_attempts = 5; + let mut attempts = 0; + while attempts < max_cleanup_attempts { - match std::fs::remove_file(&self.socket_path) { + match std::fs::remove_file(socket_path) { Ok(_) => break, - Err(e) if e.kind() == std::io::ErrorKind::NotFound => { - // File doesn't exist, that's fine - break; - } + Err(e) if e.kind() == std::io::ErrorKind::NotFound => break, Err(e) => { attempts += 1; if attempts >= max_cleanup_attempts { tracing::warn!( - socket_path = %self.socket_path, + socket_path = %socket_path, error = %e, "Failed to remove socket file after {} attempts, proceeding anyway", max_cleanup_attempts ); break; } - // Wait a bit before retrying (exponential backoff) - let delay_ms = 10 * (1 << attempts.min(3)); // Max 80ms + let delay_ms = 10 * (1 << attempts.min(3)); tokio::time::sleep(Duration::from_millis(delay_ms)).await; } } } - // Wait a bit more to ensure socket is fully released by OS tokio::time::sleep(Duration::from_millis(50)).await; + } + /// Spawn the pool server process with proper configuration + async fn spawn_pool_server_process( + socket_path: &str, + context: &str, + ) -> Result { let pool_server_path = std::env::current_dir() .map(|cwd| cwd.join("plugins/lib/pool-server.ts").display().to_string()) .unwrap_or_else(|_| "plugins/lib/pool-server.ts".to_string()); - tracing::info!(socket_path = %self.socket_path, "Starting plugin pool server"); - - // Get config values to pass to Node.js pool server let config = get_config(); - // Calculate heap size for pool server based on concurrency - // Pool server needs heap for: worker management, code cache, message buffering - // Formula: 512MB base + 32MB per 10 concurrent workers let calculated_heap = 512 + ((config.max_concurrency / 10) * 32); - - // Cap at 8GB to prevent unreasonable allocations let pool_server_heap_mb = calculated_heap.min(8192); if calculated_heap > 8192 { @@ -1170,51 +589,62 @@ impl PoolManager { } tracing::info!( + socket_path = %socket_path, heap_mb = pool_server_heap_mb, max_concurrency = config.max_concurrency, - "Configuring pool server heap size" + context = context, + "Spawning plugin pool server" ); - // Node.js options: heap size and expose GC for emergency recovery let node_options = format!("--max-old-space-size={} --expose-gc", pool_server_heap_mb); let mut child = Command::new("ts-node") .arg("--transpile-only") .arg(&pool_server_path) - .arg(&self.socket_path) - // Pass Node.js flags via NODE_OPTIONS (ts-node doesn't accept them directly) + .arg(socket_path) .env("NODE_OPTIONS", node_options) - // Pass derived config to Node.js (single source of truth from Rust) .env("PLUGIN_MAX_CONCURRENCY", config.max_concurrency.to_string()) - .env("PLUGIN_POOL_MIN_THREADS", config.nodejs_pool_min_threads.to_string()) - .env("PLUGIN_POOL_MAX_THREADS", config.nodejs_pool_max_threads.to_string()) - .env("PLUGIN_POOL_CONCURRENT_TASKS", config.nodejs_pool_concurrent_tasks.to_string()) - .env("PLUGIN_POOL_IDLE_TIMEOUT", config.nodejs_pool_idle_timeout_ms.to_string()) - .env("PLUGIN_WORKER_HEAP_MB", config.nodejs_worker_heap_mb.to_string()) - .env("PLUGIN_POOL_SOCKET_BACKLOG", config.pool_socket_backlog.to_string()) + .env( + "PLUGIN_POOL_MIN_THREADS", + config.nodejs_pool_min_threads.to_string(), + ) + .env( + "PLUGIN_POOL_MAX_THREADS", + config.nodejs_pool_max_threads.to_string(), + ) + .env( + "PLUGIN_POOL_CONCURRENT_TASKS", + config.nodejs_pool_concurrent_tasks.to_string(), + ) + .env( + "PLUGIN_POOL_IDLE_TIMEOUT", + config.nodejs_pool_idle_timeout_ms.to_string(), + ) + .env( + "PLUGIN_WORKER_HEAP_MB", + config.nodejs_worker_heap_mb.to_string(), + ) + .env( + "PLUGIN_POOL_SOCKET_BACKLOG", + config.pool_socket_backlog.to_string(), + ) .stdin(Stdio::null()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) .spawn() .map_err(|e| { - PluginError::PluginExecutionError(format!("Failed to start pool server: {e}")) + PluginError::PluginExecutionError(format!("Failed to {} pool server: {e}", context)) })?; if let Some(stderr) = child.stderr.take() { - tokio::spawn(async move { - let reader = BufReader::new(stderr); - let mut lines = reader.lines(); - while let Ok(Some(line)) = lines.next_line().await { - tracing::error!(target: "pool_server", "{}", line); - } - }); + Self::spawn_rate_limited_stderr_reader(stderr); } if let Some(stdout) = child.stdout.take() { let reader = BufReader::new(stdout); let mut lines = reader.lines(); - let timeout = tokio::time::timeout(Duration::from_secs(10), async { + let timeout_result = tokio::time::timeout(Duration::from_secs(10), async { while let Ok(Some(line)) = lines.next_line().await { if line.contains("POOL_SERVER_READY") { return Ok(()); @@ -1226,26 +656,39 @@ impl PoolManager { }) .await; - match timeout { + match timeout_result { Ok(Ok(())) => { - tracing::info!("Plugin pool server ready"); + tracing::info!(context = context, "Plugin pool server ready"); } Ok(Err(e)) => return Err(e), Err(_) => { - return Err(PluginError::PluginExecutionError( - "Timeout waiting for pool server to start".to_string(), - )) + return Err(PluginError::PluginExecutionError(format!( + "Timeout waiting for pool server to {}", + context + ))) } } } + Ok(child) + } + + async fn start_pool_server(&self) -> Result<(), PluginError> { + let mut process_guard = self.process.lock().await; + + if process_guard.is_some() { + return Ok(()); + } + + Self::cleanup_socket_file(&self.socket_path).await; + + let child = Self::spawn_pool_server_process(&self.socket_path, "start").await?; + *process_guard = Some(child); Ok(()) } /// Execute a plugin via the pool - /// Uses semaphore-based concurrency limiting with queue fallback - /// Includes circuit breaker for automatic degradation under GC pressure pub async fn execute_plugin( &self, plugin_id: String, @@ -1257,14 +700,12 @@ impl PoolManager { http_request_id: Option, timeout_secs: Option, ) -> Result { - // Get recovery allowance if in recovery mode let recovery_allowance = if self.recovery_mode.load(Ordering::Relaxed) { Some(self.recovery_allowance.load(Ordering::Relaxed)) } else { None }; - // Single unified check - circuit breaker handles recovery mode if !self .circuit_breaker .should_allow_request(recovery_allowance) @@ -1284,16 +725,11 @@ impl PoolManager { let start_time = Instant::now(); - // Ensure pool is started and healthy self.ensure_started_and_healthy().await?; - // Try direct execution first (fast path with pre-acquired permit) - // If semaphore can't be acquired immediately, queue the request (slow path) let circuit_breaker = self.circuit_breaker.clone(); match self.connection_pool.semaphore.clone().try_acquire_owned() { Ok(permit) => { - // Fast path: execute directly with pre-acquired permit - // This avoids queueing overhead for normal load let result = Self::execute_with_permit( &self.connection_pool, Some(permit), @@ -1308,22 +744,17 @@ impl PoolManager { ) .await; - // Record result with circuit breaker let elapsed_ms = start_time.elapsed().as_millis() as u32; match &result { Ok(_) => circuit_breaker.record_success(elapsed_ms), Err(e) => { circuit_breaker.record_failure(); - // Check if this error indicates the pool server is dead - // (EOF while parsing, broken pipe, connection refused, etc.) if Self::is_dead_server_error(e) { tracing::warn!( error = %e, "Detected dead pool server error, triggering health check for restart" ); - // Set health check flag so next request triggers restart self.health_check_needed.store(true, Ordering::Relaxed); - // Also clear the connection pool since connections are dead let pool = self.connection_pool.clone(); tokio::spawn(async move { pool.clear().await; @@ -1335,8 +766,6 @@ impl PoolManager { result } Err(_) => { - // Semaphore full - queue the request for backpressure - // Use blocking send with timeout to handle bursts better let (response_tx, response_rx) = oneshot::channel(); let queued_request = QueuedRequest { @@ -1351,7 +780,6 @@ impl PoolManager { response_tx, }; - // Try non-blocking send first (fast path) let result = match self.request_tx.try_send(queued_request) { Ok(()) => { let queue_len = self.request_tx.len(); @@ -1369,13 +797,10 @@ impl PoolManager { })? } Err(async_channel::TrySendError::Full(req)) => { - // Queue is full - try blocking send with timeout - // This allows handling bursts without immediate rejection let queue_timeout_ms = get_config().pool_queue_send_timeout_ms; let queue_timeout = Duration::from_millis(queue_timeout_ms); match tokio::time::timeout(queue_timeout, self.request_tx.send(req)).await { Ok(Ok(())) => { - // Successfully queued after waiting let queue_len = self.request_tx.len(); tracing::debug!( queue_len = queue_len, @@ -1388,13 +813,11 @@ impl PoolManager { })? } Ok(Err(async_channel::SendError(_))) => { - // Channel closed Err(PluginError::PluginExecutionError( "Plugin execution queue is closed".to_string(), )) } Err(_) => { - // Timeout waiting for queue space let queue_len = self.request_tx.len(); tracing::error!( queue_len = queue_len, @@ -1417,21 +840,17 @@ impl PoolManager { } }; - // Record result with circuit breaker (for queued path) let elapsed_ms = start_time.elapsed().as_millis() as u32; match &result { Ok(_) => circuit_breaker.record_success(elapsed_ms), Err(e) => { circuit_breaker.record_failure(); - // Check if this error indicates the pool server is dead if Self::is_dead_server_error(e) { tracing::warn!( error = %e, "Detected dead pool server error (queued path), triggering health check for restart" ); - // Set health check flag so next request triggers restart self.health_check_needed.store(true, Ordering::Relaxed); - // Also clear the connection pool since connections are dead let pool = self.connection_pool.clone(); tokio::spawn(async move { pool.clear().await; @@ -1446,34 +865,17 @@ impl PoolManager { } /// Check if an error indicates the pool server is dead and needs restart - /// Excludes plugin execution timeouts which are user errors, not server failures - fn is_dead_server_error(err: &PluginError) -> bool { - let error_str = err.to_string().to_lowercase(); + pub fn is_dead_server_error(err: &PluginError) -> bool { + let error_str = err.to_string(); + let lower = error_str.to_lowercase(); - // Exclude plugin execution timeouts (not a server issue) - if error_str.contains("handler timed out") - || (error_str.contains("plugin") && error_str.contains("timed out")) + if lower.contains("handler timed out") + || (lower.contains("plugin") && lower.contains("timed out")) { return false; } - // Patterns that indicate the server process is dead or unreachable - let dead_server_patterns = [ - "eof while parsing", // JSON parse error - connection closed mid-message - "broken pipe", // Write to closed socket - "connection refused", // Server not listening - "connection reset", // Server forcefully closed - "not connected", // Socket not connected - "failed to connect", // Connection establishment failed - "socket file missing", // Unix socket file deleted - "no such file", // Socket file doesn't exist - "connection timed out", // Connection timeout (not execution timeout) - "connect timed out", // Connect operation timeout - ]; - - dead_server_patterns - .iter() - .any(|pattern| error_str.contains(pattern)) + DeadServerIndicator::from_error_str(&error_str).is_some() } /// Precompile a plugin @@ -1573,11 +975,7 @@ impl PoolManager { } /// Health check - verify the pool server is responding - /// Note: Under heavy load, this may return "healthy: false" due to connection pool exhaustion, - /// which is NOT the same as the server being down. Use ensure_started_and_healthy() for - /// automatic recovery which distinguishes between these cases. pub async fn health_check(&self) -> Result { - // Helper to get circuit breaker info for all responses let circuit_info = || { let state = match self.circuit_breaker.state() { CircuitState::Closed => "closed", @@ -1609,7 +1007,6 @@ impl PoolManager { }); } - // First, do a fast check - is the socket file present? if !std::path::Path::new(&self.socket_path).exists() { let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); return Ok(HealthStatus { @@ -1627,22 +1024,18 @@ impl PoolManager { }); } - // Try to acquire a connection with a short timeout - // Use try_acquire to not wait when pool is exhausted let mut conn = match tokio::time::timeout(Duration::from_millis(100), self.connection_pool.acquire()) .await { Ok(Ok(c)) => c, Ok(Err(e)) => { - // Connection error - but check if it's just pool exhaustion let err_str = e.to_string(); let is_pool_exhausted = err_str.contains("semaphore") || err_str.contains("Connection refused"); let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); return Ok(HealthStatus { - // Mark as "healthy" if just pool exhaustion - server is running, just busy healthy: is_pool_exhausted, status: if is_pool_exhausted { format!("pool_exhausted: {}", e) @@ -1661,10 +1054,9 @@ impl PoolManager { }); } Err(_) => { - // Timeout acquiring connection - pool is busy, server is likely healthy let (circuit_state, avg_rt, recovering, recovery_pct) = circuit_info(); return Ok(HealthStatus { - healthy: true, // Server running, just busy + healthy: true, status: "pool_busy".to_string(), uptime_ms: None, memory: None, @@ -1764,11 +1156,8 @@ impl PoolManager { return Ok(true); } - // Try to acquire restart lock - if another task is already restarting, wait for it - // Use try_lock first to avoid thundering herd match self.restart_lock.try_lock() { Ok(_guard) => { - // We got the lock - check health again in case another task just finished restart let health_recheck = self.health_check().await?; if health_recheck.healthy { return Ok(true); @@ -1778,10 +1167,8 @@ impl PoolManager { self.restart_internal().await?; } Err(_) => { - // Another task is restarting - wait for it to complete tracing::debug!("Waiting for another task to complete pool server restart"); let _guard = self.restart_lock.lock().await; - // Restart completed by other task, check health } } @@ -1805,147 +1192,23 @@ impl PoolManager { let mut process_guard = self.process.lock().await; if let Some(mut child) = process_guard.take() { let _ = child.kill().await; - // Wait a bit for process to fully terminate tokio::time::sleep(Duration::from_millis(100)).await; } } - // Clean up socket file with retry logic - let mut attempts = 0; - let max_cleanup_attempts = 5; - while attempts < max_cleanup_attempts { - match std::fs::remove_file(&self.socket_path) { - Ok(_) => break, - Err(e) if e.kind() == std::io::ErrorKind::NotFound => { - break; - } - Err(e) => { - attempts += 1; - if attempts >= max_cleanup_attempts { - tracing::warn!( - socket_path = %self.socket_path, - error = %e, - "Failed to remove socket file during restart after {} attempts", - max_cleanup_attempts - ); - break; - } - let delay_ms = 10 * (1 << attempts.min(3)); - tokio::time::sleep(Duration::from_millis(delay_ms)).await; - } - } - } - - // Wait for socket to be fully released - tokio::time::sleep(Duration::from_millis(100)).await; + Self::cleanup_socket_file(&self.socket_path).await; { let mut initialized = self.initialized.write().await; *initialized = false; } - // Start server (will acquire startup lock, but we already hold restart_lock) - // Since restart_lock is the same as startup lock, we need to call start_pool_server directly let mut process_guard = self.process.lock().await; if process_guard.is_some() { - // Already started by another call return Ok(()); } - let pool_server_path = std::env::current_dir() - .map(|cwd| cwd.join("plugins/lib/pool-server.ts").display().to_string()) - .unwrap_or_else(|_| "plugins/lib/pool-server.ts".to_string()); - - tracing::info!(socket_path = %self.socket_path, "Restarting plugin pool server"); - - // Get config values to pass to Node.js pool server - let config = get_config(); - - // Calculate heap size for pool server based on concurrency - let calculated_heap = 512 + ((config.max_concurrency / 10) * 32); - - // Cap at 8GB to prevent unreasonable allocations - let pool_server_heap_mb = calculated_heap.min(8192); - - if calculated_heap > 8192 { - tracing::warn!( - calculated_heap_mb = calculated_heap, - capped_heap_mb = pool_server_heap_mb, - max_concurrency = config.max_concurrency, - "Pool server heap calculation exceeded 8GB cap during restart" - ); - } - - tracing::info!( - heap_mb = pool_server_heap_mb, - max_concurrency = config.max_concurrency, - "Configuring pool server heap size for restart" - ); - - // Node.js options: heap size and expose GC for emergency recovery - let node_options = format!("--max-old-space-size={} --expose-gc", pool_server_heap_mb); - - let mut child = Command::new("ts-node") - .arg("--transpile-only") - .arg(&pool_server_path) - .arg(&self.socket_path) - // Pass Node.js flags via NODE_OPTIONS - .env("NODE_OPTIONS", node_options) - // Pass derived config to Node.js (single source of truth from Rust) - .env("PLUGIN_MAX_CONCURRENCY", config.max_concurrency.to_string()) - .env("PLUGIN_POOL_MIN_THREADS", config.nodejs_pool_min_threads.to_string()) - .env("PLUGIN_POOL_MAX_THREADS", config.nodejs_pool_max_threads.to_string()) - .env("PLUGIN_POOL_CONCURRENT_TASKS", config.nodejs_pool_concurrent_tasks.to_string()) - .env("PLUGIN_POOL_IDLE_TIMEOUT", config.nodejs_pool_idle_timeout_ms.to_string()) - .env("PLUGIN_WORKER_HEAP_MB", config.nodejs_worker_heap_mb.to_string()) - .env("PLUGIN_POOL_SOCKET_BACKLOG", config.pool_socket_backlog.to_string()) - .stdin(Stdio::null()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn() - .map_err(|e| { - PluginError::PluginExecutionError(format!("Failed to restart pool server: {e}")) - })?; - - if let Some(stderr) = child.stderr.take() { - tokio::spawn(async move { - let reader = BufReader::new(stderr); - let mut lines = reader.lines(); - while let Ok(Some(line)) = lines.next_line().await { - tracing::error!(target: "pool_server", "{}", line); - } - }); - } - - if let Some(stdout) = child.stdout.take() { - let reader = BufReader::new(stdout); - let mut lines = reader.lines(); - - let timeout = tokio::time::timeout(Duration::from_secs(10), async { - while let Ok(Some(line)) = lines.next_line().await { - if line.contains("POOL_SERVER_READY") { - return Ok(()); - } - } - Err(PluginError::PluginExecutionError( - "Pool server did not send ready signal".to_string(), - )) - }) - .await; - - match timeout { - Ok(Ok(())) => { - tracing::info!("Plugin pool server restarted successfully"); - } - Ok(Err(e)) => return Err(e), - Err(_) => { - return Err(PluginError::PluginExecutionError( - "Timeout waiting for pool server to restart".to_string(), - )) - } - } - } - + let child = Self::spawn_pool_server_process(&self.socket_path, "restart").await?; *process_guard = Some(child); { @@ -1953,14 +1216,11 @@ impl PoolManager { *initialized = true; } - // Enable recovery mode - gradually ramp up request allowance - self.recovery_allowance.store(10, Ordering::Relaxed); // Start at 10% + self.recovery_allowance.store(10, Ordering::Relaxed); self.recovery_mode.store(true, Ordering::Relaxed); - // Close the circuit breaker after successful restart self.circuit_breaker.force_close(); - // Record restart time for backoff calculation let now = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap_or_default() @@ -1992,34 +1252,101 @@ impl PoolManager { self.recovery_allowance.load(Ordering::Relaxed) } - /// Shutdown the pool server + /// Shutdown the pool server gracefully pub async fn shutdown(&self) -> Result<(), PluginError> { let mut initialized = self.initialized.write().await; if !*initialized { return Ok(()); } - tracing::info!("Shutting down plugin pool server"); + tracing::info!("Initiating graceful shutdown of plugin pool server"); + + self.shutdown_signal.notify_waiters(); self.connection_pool.clear().await; - if let Ok(mut conn) = PoolConnection::new(&self.socket_path, 999999).await { - let request = PoolRequest::Shutdown { - task_id: Uuid::new_v4().to_string(), - }; - let _ = conn.send_request(&request).await; + let shutdown_timeout = std::time::Duration::from_secs(35); + let shutdown_result = self.send_shutdown_request(shutdown_timeout).await; + + match &shutdown_result { + Ok(response) => { + tracing::info!( + response = ?response, + "Pool server acknowledged shutdown, waiting for graceful exit" + ); + } + Err(e) => { + tracing::warn!( + error = %e, + "Failed to send shutdown request, will force kill" + ); + } } let mut process_guard = self.process.lock().await; - if let Some(mut child) = process_guard.take() { - let _ = child.kill().await; + if let Some(ref mut child) = *process_guard { + let graceful_wait = std::time::Duration::from_secs(35); + let start = std::time::Instant::now(); + + loop { + match child.try_wait() { + Ok(Some(status)) => { + tracing::info!( + exit_status = ?status, + elapsed_ms = start.elapsed().as_millis(), + "Pool server exited gracefully" + ); + break; + } + Ok(None) => { + if start.elapsed() >= graceful_wait { + tracing::warn!( + "Pool server did not exit within graceful timeout, force killing" + ); + let _ = child.kill().await; + break; + } + tokio::time::sleep(std::time::Duration::from_millis(100)).await; + } + Err(e) => { + tracing::warn!(error = %e, "Error checking pool server status"); + let _ = child.kill().await; + break; + } + } + } } + *process_guard = None; let _ = std::fs::remove_file(&self.socket_path); *initialized = false; + tracing::info!("Plugin pool server shutdown complete"); Ok(()) } + + /// Send shutdown request to the pool server + async fn send_shutdown_request( + &self, + timeout: std::time::Duration, + ) -> Result { + let request = PoolRequest::Shutdown { + task_id: Uuid::new_v4().to_string(), + }; + + let mut conn = match PoolConnection::new(&self.socket_path, 999999).await { + Ok(c) => c, + Err(e) => { + return Err(PluginError::PluginExecutionError(format!( + "Failed to connect for shutdown: {}", + e + ))); + } + }; + + conn.send_request_with_timeout(&request, timeout.as_secs()) + .await + } } impl Drop for PoolManager { @@ -2043,34 +1370,30 @@ mod tests { use super::*; #[test] - fn test_pool_request_serialization() { - let request = PoolRequest::Execute { - task_id: "test-123".to_string(), - plugin_id: "my-plugin".to_string(), - compiled_code: Some("console.log('hello')".to_string()), - plugin_path: None, - params: serde_json::json!({"key": "value"}), - headers: None, - socket_path: "/tmp/test.sock".to_string(), - http_request_id: Some("req-456".to_string()), - timeout: Some(30000), - }; + fn test_is_dead_server_error_detects_dead_server() { + let err = PluginError::PluginExecutionError("Connection refused".to_string()); + assert!(PoolManager::is_dead_server_error(&err)); - let json = serde_json::to_string(&request).unwrap(); - assert!(json.contains("\"type\":\"execute\"")); - assert!(json.contains("\"taskId\":\"test-123\"")); - assert!(json.contains("\"pluginId\":\"my-plugin\"")); + let err = PluginError::PluginExecutionError("Broken pipe".to_string()); + assert!(PoolManager::is_dead_server_error(&err)); } #[test] - fn test_pool_log_entry_conversion() { - let pool_entry = PoolLogEntry { - level: "error".to_string(), - message: "test error".to_string(), - }; + fn test_is_dead_server_error_excludes_plugin_timeouts() { + let err = PluginError::PluginExecutionError("Plugin timed out after 30s".to_string()); + assert!(!PoolManager::is_dead_server_error(&err)); + + let err = PluginError::PluginExecutionError("Handler timed out".to_string()); + assert!(!PoolManager::is_dead_server_error(&err)); + } + + #[test] + fn test_is_dead_server_error_normal_errors() { + let err = + PluginError::PluginExecutionError("TypeError: undefined is not a function".to_string()); + assert!(!PoolManager::is_dead_server_error(&err)); - let log_entry: LogEntry = pool_entry.into(); - assert!(matches!(log_entry.level, LogLevel::Error)); - assert_eq!(log_entry.message, "test error"); + let err = PluginError::PluginExecutionError("Plugin returned invalid JSON".to_string()); + assert!(!PoolManager::is_dead_server_error(&err)); } } diff --git a/src/services/plugins/protocol.rs b/src/services/plugins/protocol.rs new file mode 100644 index 000000000..87b920ac9 --- /dev/null +++ b/src/services/plugins/protocol.rs @@ -0,0 +1,290 @@ +//! Protocol types for pool server communication. +//! +//! Defines the JSON-line protocol messages exchanged between +//! the Rust pool executor and Node.js pool server via Unix socket. + +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +use super::{LogEntry, LogLevel}; + +/// Request messages sent to the pool server +#[derive(Serialize, Debug)] +#[serde(tag = "type", rename_all = "lowercase")] +pub enum PoolRequest { + Execute { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + #[serde(rename = "compiledCode", skip_serializing_if = "Option::is_none")] + compiled_code: Option, + #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] + plugin_path: Option, + params: serde_json::Value, + #[serde(skip_serializing_if = "Option::is_none")] + headers: Option>>, + #[serde(rename = "socketPath")] + socket_path: String, + #[serde(rename = "httpRequestId", skip_serializing_if = "Option::is_none")] + http_request_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + timeout: Option, + }, + Precompile { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] + plugin_path: Option, + #[serde(rename = "sourceCode", skip_serializing_if = "Option::is_none")] + source_code: Option, + }, + Cache { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + #[serde(rename = "compiledCode")] + compiled_code: String, + }, + Invalidate { + #[serde(rename = "taskId")] + task_id: String, + #[serde(rename = "pluginId")] + plugin_id: String, + }, + Stats { + #[serde(rename = "taskId")] + task_id: String, + }, + Health { + #[serde(rename = "taskId")] + task_id: String, + }, + Shutdown { + #[serde(rename = "taskId")] + task_id: String, + }, +} + +/// Response from the pool server +#[derive(Deserialize, Debug)] +pub struct PoolResponse { + #[serde(rename = "taskId")] + pub task_id: String, + pub success: bool, + pub result: Option, + pub error: Option, + pub logs: Option>, +} + +/// Error details from the pool server +#[derive(Deserialize, Debug)] +pub struct PoolError { + pub message: String, + pub code: Option, + pub status: Option, + pub details: Option, +} + +/// Log entry from plugin execution +#[derive(Deserialize, Debug)] +pub struct PoolLogEntry { + pub level: String, + pub message: String, +} + +impl From for LogEntry { + fn from(entry: PoolLogEntry) -> Self { + let level = match entry.level.as_str() { + "error" => LogLevel::Error, + "warn" => LogLevel::Warn, + "info" => LogLevel::Info, + "debug" => LogLevel::Debug, + "result" => LogLevel::Result, + _ => LogLevel::Log, + }; + LogEntry { + level, + message: entry.message, + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_pool_request_execute_serialization() { + let request = PoolRequest::Execute { + task_id: "test-123".to_string(), + plugin_id: "my-plugin".to_string(), + compiled_code: Some("console.log('hello')".to_string()), + plugin_path: None, + params: serde_json::json!({"key": "value"}), + headers: None, + socket_path: "/tmp/test.sock".to_string(), + http_request_id: Some("req-456".to_string()), + timeout: Some(30000), + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"execute\"")); + assert!(json.contains("\"taskId\":\"test-123\"")); + assert!(json.contains("\"pluginId\":\"my-plugin\"")); + } + + #[test] + fn test_pool_request_precompile_serialization() { + let request = PoolRequest::Precompile { + task_id: "precompile-123".to_string(), + plugin_id: "test-plugin".to_string(), + plugin_path: Some("/plugins/test.ts".to_string()), + source_code: None, + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"precompile\"")); + assert!(json.contains("\"taskId\":\"precompile-123\"")); + assert!(json.contains("\"pluginPath\":\"/plugins/test.ts\"")); + } + + #[test] + fn test_pool_request_cache_serialization() { + let request = PoolRequest::Cache { + task_id: "cache-123".to_string(), + plugin_id: "test-plugin".to_string(), + compiled_code: "compiled code here".to_string(), + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"cache\"")); + assert!(json.contains("\"compiledCode\":\"compiled code here\"")); + } + + #[test] + fn test_pool_request_invalidate_serialization() { + let request = PoolRequest::Invalidate { + task_id: "inv-123".to_string(), + plugin_id: "test-plugin".to_string(), + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"invalidate\"")); + } + + #[test] + fn test_pool_request_stats_serialization() { + let request = PoolRequest::Stats { + task_id: "stats-123".to_string(), + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"stats\"")); + } + + #[test] + fn test_pool_request_health_serialization() { + let request = PoolRequest::Health { + task_id: "health-123".to_string(), + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"health\"")); + } + + #[test] + fn test_pool_request_shutdown_serialization() { + let request = PoolRequest::Shutdown { + task_id: "shutdown-123".to_string(), + }; + + let json = serde_json::to_string(&request).unwrap(); + assert!(json.contains("\"type\":\"shutdown\"")); + } + + #[test] + fn test_pool_response_success_deserialization() { + let json = r#"{ + "taskId": "test-123", + "success": true, + "result": {"data": "hello"}, + "logs": [{"level": "info", "message": "test log"}] + }"#; + + let response: PoolResponse = serde_json::from_str(json).unwrap(); + assert_eq!(response.task_id, "test-123"); + assert!(response.success); + assert!(response.error.is_none()); + assert!(response + .logs + .as_ref() + .map(|l| !l.is_empty()) + .unwrap_or(false)); + } + + #[test] + fn test_pool_response_error_deserialization() { + let json = r#"{ + "taskId": "test-123", + "success": false, + "error": { + "message": "Plugin failed", + "code": "EXEC_ERROR", + "status": 500 + }, + "logs": [] + }"#; + + let response: PoolResponse = serde_json::from_str(json).unwrap(); + assert_eq!(response.task_id, "test-123"); + assert!(!response.success); + assert!(response.error.is_some()); + let err = response.error.unwrap(); + assert_eq!(err.message, "Plugin failed"); + assert_eq!(err.code, Some("EXEC_ERROR".to_string())); + assert_eq!(err.status, Some(500)); + } + + #[test] + fn test_pool_log_entry_conversion() { + let pool_entry = PoolLogEntry { + level: "error".to_string(), + message: "test error".to_string(), + }; + + let log_entry: LogEntry = pool_entry.into(); + assert!(matches!(log_entry.level, LogLevel::Error)); + assert_eq!(log_entry.message, "test error"); + } + + #[test] + fn test_pool_log_entry_level_conversion() { + let levels = vec![ + ("log", LogLevel::Log), + ("info", LogLevel::Info), + ("warn", LogLevel::Warn), + ("error", LogLevel::Error), + ("debug", LogLevel::Debug), + ("unknown", LogLevel::Log), + ]; + + for (input, expected) in levels { + let pool_entry = PoolLogEntry { + level: input.to_string(), + message: "test".to_string(), + }; + let log_entry: LogEntry = pool_entry.into(); + assert!( + matches!(log_entry.level, ref e if std::mem::discriminant(e) == std::mem::discriminant(&expected)), + "Expected {:?} for input '{}', got {:?}", + expected, + input, + log_entry.level + ); + } + } +} diff --git a/src/services/plugins/runner.rs b/src/services/plugins/runner.rs index bde1095b1..c88b28338 100644 --- a/src/services/plugins/runner.rs +++ b/src/services/plugins/runner.rs @@ -7,10 +7,10 @@ //! //! ## Execution Modes //! -//! - **ts-node mode** (default): Spawns ts-node per request. Simple but slower. -//! Uses the shared socket for bidirectional communication. -//! - **Pool mode** (`PLUGIN_USE_POOL=true`): Uses persistent Piscina worker pool. +//! - **Pool mode** (default): Uses persistent Piscina worker pool. //! Faster execution with precompilation and worker reuse. +//! - **ts-node mode** (`PLUGIN_USE_POOL=false`): Spawns ts-node per request. +//! Simple but slower. Uses the shared socket for bidirectional communication. //! use std::{collections::HashMap, sync::Arc, time::Duration}; @@ -40,10 +40,11 @@ use uuid::Uuid; use mockall::automock; /// Check if pool-based execution is enabled via environment variable +/// Pool mode is enabled by default for better performance fn use_pool_executor() -> bool { std::env::var("PLUGIN_USE_POOL") .map(|v| v.eq_ignore_ascii_case("true") || v == "1") - .unwrap_or(false) + .unwrap_or(true) // Pool mode is now the default } /// Get trace timeout duration from centralized config @@ -376,6 +377,9 @@ mod tests { #[tokio::test] async fn test_run() { + // Use ts-node mode for this test since temp files are outside plugins directory + std::env::set_var("PLUGIN_USE_POOL", "false"); + let temp_dir = tempdir().unwrap(); let ts_config = temp_dir.path().join("tsconfig.json"); let script_path = temp_dir.path().join("test_run.ts"); @@ -410,6 +414,10 @@ mod tests { Arc::new(web::ThinData(state)), ) .await; + + // Cleanup env var + std::env::remove_var("PLUGIN_USE_POOL"); + if matches!( result, Err(PluginError::SocketError(ref msg)) if msg.contains("Operation not permitted") @@ -428,6 +436,9 @@ mod tests { #[tokio::test] async fn test_run_timeout() { + // Use ts-node mode for this test since temp files are outside plugins directory + std::env::set_var("PLUGIN_USE_POOL", "false"); + let temp_dir = tempdir().unwrap(); let ts_config = temp_dir.path().join("tsconfig.json"); let script_path = temp_dir.path().join("test_simple_timeout.ts"); @@ -471,6 +482,9 @@ mod tests { ) .await; + // Cleanup env var + std::env::remove_var("PLUGIN_USE_POOL"); + // Should timeout if matches!( result, diff --git a/src/services/plugins/script_executor.rs b/src/services/plugins/script_executor.rs index 3957b36bf..6ccd049f6 100644 --- a/src/services/plugins/script_executor.rs +++ b/src/services/plugins/script_executor.rs @@ -440,4 +440,467 @@ mod tests { ); assert_eq!(return_obj["params"], serde_json::json!({"foo": "bar"})); } + + #[tokio::test] + async fn test_execute_typescript_all_log_levels() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_all_log_levels.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_all_log_levels.sock"); + + let content = r#" + export async function handler(api: any, params: any) { + console.log('log message'); + console.info('info message'); + console.warn('warn message'); + console.error('error message'); + console.debug('debug message'); + return 'success'; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-log-levels".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + "{}".to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + assert_eq!(result.logs.len(), 5); + assert_eq!(result.logs[0].level, LogLevel::Log); + assert_eq!(result.logs[0].message, "log message"); + assert_eq!(result.logs[1].level, LogLevel::Info); + assert_eq!(result.logs[1].message, "info message"); + assert_eq!(result.logs[2].level, LogLevel::Warn); + assert_eq!(result.logs[2].message, "warn message"); + assert_eq!(result.logs[3].level, LogLevel::Error); + assert_eq!(result.logs[3].message, "error message"); + assert_eq!(result.logs[4].level, LogLevel::Debug); + assert_eq!(result.logs[4].message, "debug message"); + assert_eq!(result.return_value, "success"); + } + + #[tokio::test] + async fn test_execute_typescript_with_request_id() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_with_request_id.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_with_request_id.sock"); + + // Note: The request ID is passed to the executor but not directly accessible + // in the plugin handler. It's used for internal tracing/logging. + // This test verifies the parameter is accepted without errors. + let content = r#" + export async function handler(api: any, params: any) { + console.log('handler executed'); + return { status: 'ok' }; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-request-id".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + "{}".to_string(), + Some("req-12345-abcde".to_string()), + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + assert_eq!(result.logs[0].level, LogLevel::Log); + assert_eq!(result.logs[0].message, "handler executed"); + assert_eq!(result.return_value, "{\"status\":\"ok\"}"); + } + + #[tokio::test] + async fn test_execute_typescript_empty_return() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_empty_return.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_empty_return.sock"); + + let content = r#" + export async function handler(api: any, params: any) { + console.log('handler called'); + // Return undefined (no explicit return) + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-empty-return".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + "{}".to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + assert_eq!(result.logs[0].level, LogLevel::Log); + assert_eq!(result.logs[0].message, "handler called"); + // undefined becomes empty string or "undefined" depending on serialization + assert!(result.return_value.is_empty() || result.return_value == "undefined"); + } + + #[tokio::test] + async fn test_execute_typescript_null_return() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_null_return.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_null_return.sock"); + + let content = r#" + export async function handler(api: any, params: any) { + console.log('returning null'); + return null; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-null-return".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + "{}".to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + assert_eq!(result.return_value, "null"); + } + + #[tokio::test] + async fn test_execute_typescript_legacy_two_param_handler() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_legacy_handler.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_legacy_handler.sock"); + + // Explicitly test the legacy 2-parameter handler pattern + let content = r#" + export async function handler(api: any, params: any) { + console.log('legacy handler'); + return { + paramsReceived: params, + handlerType: 'legacy-2-param' + }; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-legacy".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + r#"{"key":"value"}"#.to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + assert_eq!(result.logs[0].level, LogLevel::Log); + assert_eq!(result.logs[0].message, "legacy handler"); + + let return_obj: serde_json::Value = + serde_json::from_str(&result.return_value).expect("Failed to parse return value"); + assert_eq!(return_obj["handlerType"], "legacy-2-param"); + assert_eq!( + return_obj["paramsReceived"], + serde_json::json!({"key": "value"}) + ); + } + + #[tokio::test] + async fn test_execute_typescript_context_single_param_handler() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_context_handler.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_context_handler.sock"); + + // Test the modern context-based single parameter handler + let content = r#" + export async function handler(context: any) { + const { api, params, kv, headers } = context; + console.log('modern context handler'); + return { + paramsReceived: params, + hasApi: !!api, + hasKv: !!kv, + hasHeaders: !!headers, + handlerType: 'modern-context' + }; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-context".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + r#"{"foo":"bar"}"#.to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + + let return_obj: serde_json::Value = + serde_json::from_str(&result.return_value).expect("Failed to parse return value"); + assert_eq!(return_obj["handlerType"], "modern-context"); + assert_eq!(return_obj["hasApi"], true); + assert_eq!(return_obj["hasKv"], true); + assert_eq!(return_obj["hasHeaders"], true); + assert_eq!( + return_obj["paramsReceived"], + serde_json::json!({"foo": "bar"}) + ); + } + + #[tokio::test] + async fn test_execute_typescript_complex_params() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_complex_params.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_complex_params.sock"); + + let content = r#" + export async function handler(api: any, params: any) { + console.log(`Received ${params.items.length} items`); + return { + processedItems: params.items.map((item: any) => ({ + ...item, + processed: true + })), + metadata: params.metadata, + totalCount: params.items.length + }; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let complex_params = r#"{ + "items": [ + {"id": 1, "name": "item1", "tags": ["a", "b"]}, + {"id": 2, "name": "item2", "tags": ["c", "d"]} + ], + "metadata": { + "source": "test", + "timestamp": 1234567890, + "nested": { + "deep": { + "value": true + } + } + } + }"#; + + let result = ScriptExecutor::execute_typescript( + "test-plugin-complex-params".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + complex_params.to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + assert_eq!(result.logs[0].level, LogLevel::Log); + assert!(result.logs[0].message.contains("Received 2 items")); + + let return_obj: serde_json::Value = + serde_json::from_str(&result.return_value).expect("Failed to parse return value"); + assert_eq!(return_obj["totalCount"], 2); + assert_eq!(return_obj["processedItems"][0]["processed"], true); + assert_eq!(return_obj["processedItems"][1]["processed"], true); + assert_eq!(return_obj["processedItems"][0]["name"], "item1"); + assert_eq!(return_obj["metadata"]["source"], "test"); + assert_eq!(return_obj["metadata"]["nested"]["deep"]["value"], true); + } + + #[tokio::test] + async fn test_execute_typescript_empty_params() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_empty_params.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_empty_params.sock"); + + let content = r#" + export async function handler(api: any, params: any) { + console.log(`Params is empty: ${Object.keys(params).length === 0}`); + return { receivedEmptyParams: Object.keys(params).length === 0 }; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-empty-params".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + "{}".to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + assert!(result.logs[0].message.contains("Params is empty: true")); + + let return_obj: serde_json::Value = + serde_json::from_str(&result.return_value).expect("Failed to parse return value"); + assert_eq!(return_obj["receivedEmptyParams"], true); + } + + #[tokio::test] + async fn test_execute_typescript_array_return() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_array_return.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_array_return.sock"); + + let content = r#" + export async function handler(api: any, params: any) { + console.log('returning array'); + return [1, 2, 3, { nested: 'value' }, 'string']; + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-array-return".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + "{}".to_string(), + None, + None, + ) + .await; + + assert!(result.is_ok()); + let result = result.unwrap(); + + let return_array: serde_json::Value = + serde_json::from_str(&result.return_value).expect("Failed to parse return value"); + assert!(return_array.is_array()); + assert_eq!(return_array[0], 1); + assert_eq!(return_array[1], 2); + assert_eq!(return_array[2], 3); + assert_eq!(return_array[3]["nested"], "value"); + assert_eq!(return_array[4], "string"); + } + + #[tokio::test] + async fn test_execute_typescript_multiple_errors() { + let temp_dir = tempdir().unwrap(); + let ts_config = temp_dir.path().join("tsconfig.json"); + let script_path = temp_dir + .path() + .join("test_execute_typescript_multiple_errors.ts"); + let socket_path = temp_dir + .path() + .join("test_execute_typescript_multiple_errors.sock"); + + let content = r#" + export async function handler(api: any, params: any) { + console.error('Error message 1'); + console.error('Error message 2'); + console.warn('Warning message'); + throw new Error('Handler failed'); + } + "#; + fs::write(script_path.clone(), content).unwrap(); + fs::write(ts_config.clone(), TS_CONFIG.as_bytes()).unwrap(); + + let result = ScriptExecutor::execute_typescript( + "test-plugin-multiple-errors".to_string(), + script_path.display().to_string(), + socket_path.display().to_string(), + "{}".to_string(), + None, + None, + ) + .await; + + assert!(result.is_err()); + if let Err(PluginError::HandlerError(ctx)) = result { + // Should capture logs even when handler fails + let logs = ctx.logs.expect("logs should be present"); + assert_eq!(logs.len(), 3); + assert_eq!(logs[0].level, LogLevel::Error); + assert_eq!(logs[0].message, "Error message 1"); + assert_eq!(logs[1].level, LogLevel::Error); + assert_eq!(logs[1].message, "Error message 2"); + assert_eq!(logs[2].level, LogLevel::Warn); + assert_eq!(logs[2].message, "Warning message"); + assert!(ctx.message.contains("Handler failed")); + } else { + panic!("Expected HandlerError"); + } + } } diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs index 0ea0fa670..fb7e15d2a 100644 --- a/src/services/plugins/shared_socket.rs +++ b/src/services/plugins/shared_socket.rs @@ -988,4 +988,572 @@ mod tests { service.shutdown().await; } + + #[tokio::test] + async fn test_execution_guard_auto_unregister() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_guard.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let execution_id = "test-exec-guard".to_string(); + + { + let _guard = service.register_execution(execution_id.clone()).await; + + // Verify execution is registered + let map = service.executions.read().await; + assert!(map.contains_key(&execution_id)); + } + // Guard dropped here + + // Give tokio task time to run + tokio::time::sleep(Duration::from_millis(50)).await; + + // Verify execution was auto-unregistered + let map = service.executions.read().await; + assert!(!map.contains_key(&execution_id)); + } + + #[tokio::test] + async fn test_api_request_without_register_rejected() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_no_register.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Send ApiRequest WITHOUT registering first (security violation) + let api_request = PluginMessage::ApiRequest { + request_id: "req-1".to_string(), + relayer_id: "relayer-1".to_string(), + method: crate::services::plugins::relayer_api::PluginMethod::GetRelayerStatus, + payload: serde_json::json!({}), + }; + let req_json = serde_json::to_string(&api_request).unwrap() + "\n"; + client.write_all(req_json.as_bytes()).await.unwrap(); + client.flush().await.unwrap(); + + // Connection should be closed by server + tokio::time::sleep(Duration::from_millis(100)).await; + + let (r, _w) = client.into_split(); + let mut reader = BufReader::new(r); + let mut line = String::new(); + let result = reader.read_line(&mut line).await; + + // Should get EOF (connection closed) + assert!(result.is_err() || result.unwrap() == 0); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_register_with_unknown_execution_id_rejected() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_unknown_exec.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Try to register with an execution_id that doesn't exist in registry + let register_msg = PluginMessage::Register { + execution_id: "unknown-exec-id".to_string(), + }; + let msg_json = serde_json::to_string(®ister_msg).unwrap() + "\n"; + client.write_all(msg_json.as_bytes()).await.unwrap(); + client.flush().await.unwrap(); + + // Connection should be closed + tokio::time::sleep(Duration::from_millis(100)).await; + + let (r, _w) = client.into_split(); + let mut reader = BufReader::new(r); + let mut line = String::new(); + let result = reader.read_line(&mut line).await; + + assert!(result.is_err() || result.unwrap() == 0); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_connection_limit_enforcement() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_connection_limit.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + tokio::time::sleep(Duration::from_millis(50)).await; + + // Check initial connection count + let initial_permits = service.connection_semaphore.available_permits(); + let max_connections = get_config().socket_max_connections; + assert_eq!(initial_permits, max_connections); + + // Create a connection (should reduce available permits) + let _client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + tokio::time::sleep(Duration::from_millis(50)).await; + + // Available permits should be reduced + let after_connect = service.connection_semaphore.available_permits(); + assert!(after_connect < initial_permits); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_idle_timeout() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_idle_timeout.sock"); + + // Create service with short idle timeout for testing + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-idle".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register + let register_msg = PluginMessage::Register { execution_id }; + client + .write_all((serde_json::to_string(®ister_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + client.flush().await.unwrap(); + + // Wait longer than idle timeout (configured in service) + // Note: idle_timeout is from config, but we can test that connection stays alive + // within a reasonable time + tokio::time::sleep(Duration::from_millis(100)).await; + + // Connection should still be alive if we're within timeout + // Send a Shutdown message to verify connection is still up + let shutdown_msg = PluginMessage::Shutdown; + let write_result = client + .write_all((serde_json::to_string(&shutdown_msg).unwrap() + "\n").as_bytes()) + .await; + + assert!(write_result.is_ok(), "Connection should still be alive"); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_read_timeout_handling() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_read_timeout.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-read-timeout".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register + let register_msg = PluginMessage::Register { execution_id }; + client + .write_all((serde_json::to_string(®ister_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + client.flush().await.unwrap(); + + // Don't send anything else - connection should be cleaned up after read timeout + // Read timeout is configured in service (from config) + + // Wait a bit (but not as long as full timeout) + tokio::time::sleep(Duration::from_millis(200)).await; + + // Connection should still be valid for a short time + drop(client); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_multiple_api_requests_same_connection() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_multiple_requests.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-multi".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register + let register_msg = PluginMessage::Register { + execution_id: execution_id.clone(), + }; + client + .write_all((serde_json::to_string(®ister_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + let (r, mut w) = client.into_split(); + let mut reader = BufReader::new(r); + + // Send multiple API requests + for i in 1..=3 { + let api_request = PluginMessage::ApiRequest { + request_id: format!("req-{}", i), + relayer_id: "relayer-1".to_string(), + method: crate::services::plugins::relayer_api::PluginMethod::GetRelayerStatus, + payload: serde_json::json!({}), + }; + w.write_all((serde_json::to_string(&api_request).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + w.flush().await.unwrap(); + + // Read response + let mut response_line = String::new(); + reader.read_line(&mut response_line).await.unwrap(); + + let response: PluginMessage = serde_json::from_str(&response_line).unwrap(); + match response { + PluginMessage::ApiResponse { request_id, .. } => { + assert_eq!(request_id, format!("req-{}", i)); + } + _ => panic!("Expected ApiResponse"), + } + } + + service.shutdown().await; + } + + #[tokio::test] + async fn test_shutdown_signal() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_shutdown_signal.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + tokio::time::sleep(Duration::from_millis(50)).await; + + // Verify socket file exists + assert!(std::path::Path::new(socket_path.to_str().unwrap()).exists()); + + // Shutdown the service + service.shutdown().await; + + // Give time for cleanup + tokio::time::sleep(Duration::from_millis(100)).await; + + // Socket file should be removed + assert!(!std::path::Path::new(socket_path.to_str().unwrap()).exists()); + } + + #[tokio::test] + async fn test_malformed_json_handling() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_malformed.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-malformed".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register first + let register_msg = PluginMessage::Register { + execution_id: execution_id.clone(), + }; + client + .write_all((serde_json::to_string(®ister_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + // Send malformed JSON + client + .write_all(b"{ this is not valid json }\n") + .await + .unwrap(); + client.flush().await.unwrap(); + + // Connection should remain open (malformed messages are logged and skipped) + tokio::time::sleep(Duration::from_millis(100)).await; + + // Send valid shutdown message to verify connection is still up + let shutdown_msg = PluginMessage::Shutdown; + let write_result = client + .write_all((serde_json::to_string(&shutdown_msg).unwrap() + "\n").as_bytes()) + .await; + + assert!( + write_result.is_ok(), + "Connection should still be alive after malformed JSON" + ); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_invalid_message_direction() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_invalid_direction.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-invalid-dir".to_string(); + let _guard = service.register_execution(execution_id.clone()).await; + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register + let register_msg = PluginMessage::Register { + execution_id: execution_id.clone(), + }; + client + .write_all((serde_json::to_string(®ister_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + // Plugin tries to send ApiResponse (invalid direction - only Host sends ApiResponse) + let invalid_msg = PluginMessage::ApiResponse { + request_id: "invalid".to_string(), + result: Some(serde_json::json!({})), + error: None, + }; + client + .write_all((serde_json::to_string(&invalid_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + client.flush().await.unwrap(); + + // Connection should remain open (invalid messages are logged and skipped) + tokio::time::sleep(Duration::from_millis(100)).await; + + // Verify connection is still alive + let shutdown_msg = PluginMessage::Shutdown; + let write_result = client + .write_all((serde_json::to_string(&shutdown_msg).unwrap() + "\n").as_bytes()) + .await; + + assert!(write_result.is_ok()); + + service.shutdown().await; + } + + #[tokio::test] + async fn test_stale_execution_cleanup() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_stale_cleanup.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + + // Register an execution manually with old timestamp + let execution_id = "stale-exec".to_string(); + let (tx, _rx) = mpsc::channel(1); + { + let mut map = service.executions.write().await; + map.insert( + execution_id.clone(), + ExecutionContext { + traces_tx: tx, + created_at: Instant::now() - Duration::from_secs(400), // 6+ minutes old + bound_execution_id: execution_id.clone(), + }, + ); + } + + // Verify it's registered + { + let map = service.executions.read().await; + assert!(map.contains_key(&execution_id)); + } + + // Wait for cleanup task to run (it runs every 60 seconds, but we can't wait that long) + // Instead, we verify the cleanup logic by checking the code in new() + // The actual cleanup test would require mocking time or waiting 60+ seconds + + // For this test, we just verify the logic exists and doesn't panic + drop(service); + } + + #[tokio::test] + async fn test_socket_path_getter() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_path.sock"); + + let service = SharedSocketService::new(socket_path.to_str().unwrap()).unwrap(); + + assert_eq!(service.socket_path(), socket_path.to_str().unwrap()); + } + + #[tokio::test] + async fn test_trace_send_timeout() { + let temp_dir = tempdir().unwrap(); + let socket_path = temp_dir.path().join("shared_trace_timeout.sock"); + + let service = Arc::new(SharedSocketService::new(socket_path.to_str().unwrap()).unwrap()); + let state = create_mock_app_state(None, None, None, None, None, None).await; + + service + .clone() + .start(Arc::new(web::ThinData(state))) + .await + .unwrap(); + + let execution_id = "test-exec-trace-timeout".to_string(); + let guard = service.register_execution(execution_id.clone()).await; + + // Don't consume the receiver - this will cause the channel to fill up + drop(guard); + + tokio::time::sleep(Duration::from_millis(50)).await; + + let mut client = UnixStream::connect(socket_path.to_str().unwrap()) + .await + .unwrap(); + + // Register + let register_msg = PluginMessage::Register { + execution_id: execution_id.clone(), + }; + client + .write_all((serde_json::to_string(®ister_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + // Send trace + let trace = PluginMessage::Trace { + trace: serde_json::json!({"event": "test"}), + }; + client + .write_all((serde_json::to_string(&trace).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + + // Shutdown + let shutdown_msg = PluginMessage::Shutdown; + client + .write_all((serde_json::to_string(&shutdown_msg).unwrap() + "\n").as_bytes()) + .await + .unwrap(); + client.flush().await.unwrap(); + + drop(client); + + // Wait for connection to close - should handle timeout gracefully + tokio::time::sleep(Duration::from_millis(200)).await; + + service.shutdown().await; + } + + #[tokio::test] + async fn test_get_shared_socket_service() { + // Test the global singleton + let service1 = get_shared_socket_service(); + assert!(service1.is_ok()); + + let service2 = get_shared_socket_service(); + assert!(service2.is_ok()); + + // Should return the same instance + let svc1 = service1.unwrap(); + let svc2 = service2.unwrap(); + let path1 = svc1.socket_path(); + let path2 = svc2.socket_path(); + assert_eq!(path1, path2); + } } From 02e596fb565b400f3e116bebe70555e30721e1a5 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Fri, 9 Jan 2026 14:51:47 +0100 Subject: [PATCH 08/42] chore: docs and logic improvements --- CLAUDE.md | 157 ++++++++++++++ docs/plugins/index.mdx | 24 ++ plugins/ARCHITECTURE.md | 289 +++++++++++++++++++++++++ plugins/examples/example-rpc.ts | 26 +-- plugins/lib/.build-cache-hash | 2 +- plugins/lib/sandbox-executor.js | 118 ++++++---- plugins/lib/sandbox-executor.js.sha256 | 2 +- plugins/lib/sandbox-executor.ts | 141 ++++++++---- src/services/plugins/health.rs | 35 +++ src/services/plugins/pool_executor.rs | 13 +- 10 files changed, 709 insertions(+), 98 deletions(-) create mode 100644 CLAUDE.md create mode 100644 plugins/ARCHITECTURE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..58b992911 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,157 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +OpenZeppelin Relayer is a multi-chain blockchain transaction relaying service. It enables interaction with EVM, Solana, and Stellar networks through HTTP endpoints, supporting transaction submission, signing, monitoring, and extensible plugins. + +**Tech Stack:** Rust 1.88 (Actix-web 4) + TypeScript/Node.js (plugin runtime) + Redis (job queues/caching) + +## Build & Development Commands + +```bash +# Core Rust commands +cargo build # Build the project +cargo run # Run locally (requires Redis + config) +cargo test # Run all unit tests +cargo test # Run a specific test +cargo test --features integration-tests --test integration # Integration tests + +# Plugin system (TypeScript) +cd plugins && pnpm install # Install plugin dependencies +pnpm run build # Build sandbox executor +pnpm test # Run plugin tests + +# Docker +cargo make docker-compose-up # Start with docker-compose +cargo make docker-compose-down # Stop services + +# Integration testing +cargo make integration-test-standalone # Full integration test (requires relayer running) +cargo make integration-test-local # Against local Anvil + +# Documentation +cargo make rust-docs # Generate Rust documentation +``` + +## Architecture + +### Layered Structure + +``` +src/ +โ”œโ”€โ”€ api/ # HTTP routes (Actix-web), OpenAPI specs, middleware +โ”œโ”€โ”€ bootstrap/ # Service initialization +โ”œโ”€โ”€ config/ # JSON/env configuration loading +โ”œโ”€โ”€ domain/ # Business logic (relayers, transactions, policies) +โ”œโ”€โ”€ jobs/ # Async job processing (Apalis + Redis) +โ”œโ”€โ”€ models/ # Data structures (Signer, Transaction, Network) +โ”œโ”€โ”€ repositories/ # Redis-backed storage (immutable at runtime) +โ”œโ”€โ”€ services/ # Core services +โ”‚ โ”œโ”€โ”€ plugins/ # Plugin execution system (Rust side) +โ”‚ โ”œโ”€โ”€ provider/ # Blockchain RPC providers (EVM, Solana, Stellar) +โ”‚ โ”œโ”€โ”€ signer/ # Transaction signing (KMS, Vault, local keystore) +โ”‚ โ”œโ”€โ”€ gas/ # Gas estimation +โ”‚ โ””โ”€โ”€ notification/ # Webhook notifications +โ””โ”€โ”€ utils/ # Helpers +``` + +### Plugin System (Rust โ†” Node.js) + +The plugin system uses a multi-process architecture: + +**Rust side** (`src/services/plugins/`): +- `runner.rs` โ†’ Entry point, routes to pool executor +- `pool_executor.rs` โ†’ Manages Node.js process lifecycle, circuit breaker +- `connection.rs` โ†’ Lock-free connection pool with semaphore concurrency +- `shared_socket.rs` โ†’ Per-request Unix socket for plugin API calls +- `health.rs` โ†’ Circuit breaker states, dead server detection + +**Node.js side** (`plugins/lib/`): +- `pool-server.ts` โ†’ Main server, memory pressure monitoring +- `worker-pool.ts` โ†’ Piscina wrapper with dynamic scaling +- `sandbox-executor.ts` โ†’ VM-based plugin execution with security + +**Communication:** Unix socket with newline-delimited JSON protocol + +### Key Abstractions + +- **Repository Pattern**: Redis-backed repositories for configs (RelayerRepository, SignerRepository) +- **Service Traits**: Async traits for dependency injection and testability +- **Job Processing**: Apalis-based async job queue + +## Configuration + +**Key Environment Variables:** +- `CONFIG_DIR`, `CONFIG_FILE_NAME` โ†’ Location of config.json +- `LOG_LEVEL` โ†’ trace/debug/info/warn/error +- `REDIS_URL` โ†’ Redis connection string +- `API_KEY` โ†’ Request authentication +- `PLUGIN_MAX_CONCURRENCY` โ†’ Main plugin scaling knob (default: 2048) + +**Config file** (`config/config.json`): Defines relayers, signers, networks, notifications, plugins + +## Code Standards + +- **Formatting**: rustfmt with max_width=100, edition 2021 +- **Naming**: snake_case functions/vars, PascalCase types, SCREAMING_SNAKE_CASE constants +- **Errors**: Avoid `unwrap()`, use Result with `?` operator, custom error types +- **Async**: Tokio runtime, await eagerly, avoid blocking in async +- **Params**: Prefer `&str` over `&String`, `&[T]` over `&Vec` +- **Logging**: Use `tracing` crate for structured logs +- **Testing**: Define traits for services to enable mocking with `mockall` +- Prefer **idiomatic Rust**. +- Follow `rustfmt` formatting and `clippy` best practices. +- Avoid unnecessary abstractions. +- Keep code readable over clever. +- Use `Option` and `Result` exhaustively. +- Avoid breaking changes unless explicitly requested. +- Document API endpoints with utoipa schemas and regenerate OpenAPI spec when needed with `cargo run --example generate_openapi` + +## Documentation +- Add Rust doc comments (`///`) for public items. +- Include examples in doc comments when useful. +- Keep comments concise and factual. + +## Testing + +```bash +# Run specific test file +cargo test --test + +# Run tests matching pattern +cargo test + +# Run with single thread (for tests with shared state) +RUST_TEST_THREADS=1 cargo test + +# Redis tests (require active Redis) +cargo test -- --ignored + +# Plugin-specific Rust tests +cargo test --package openzeppelin-relayer plugins +``` + +## Debugging Plugins + +```bash +# Enable debug logging for plugins +RUST_LOG=openzeppelin_relayer::services::plugins=debug cargo run + +# Check plugin health +curl -H "Authorization: Bearer $API_KEY" http://localhost:8080/api/v1/health/plugins +``` + +## Helper Binaries + +```bash +cargo run --example create_key # Generate signing keys +cargo run --example generate_uuid # Generate UUIDs for config +cargo run --example generate_encryption_key # Generate encryption keys +cargo run --example generate_openapi # Generate OpenAPI spec +``` + +## When Unsure +- Ask clarifying questions before making large changes. +- If multiple approaches exist, explain trade-offs briefly. diff --git a/docs/plugins/index.mdx b/docs/plugins/index.mdx index d203882db..156559362 100644 --- a/docs/plugins/index.mdx +++ b/docs/plugins/index.mdx @@ -838,3 +838,27 @@ sudo sysctl -w kern.maxfilesperproc=65536 When increasing limits significantly, monitor your system's memory and CPU usage. Each connection consumes resources. + +## Architecture & Internals + +For developers who want to understand or modify the plugin system internals, see the [Architecture Guide](https://github.com/OpenZeppelin/openzeppelin-relayer/blob/main/plugins/ARCHITECTURE.md). + +The architecture documentation covers: + +- **System Architecture**: High-level diagram showing Rust โ†” Node.js communication +- **Module Overview**: Purpose of each Rust and TypeScript module +- **Communication Protocols**: JSON-line protocol for pool and shared socket communication +- **Request Flow**: Step-by-step execution path for plugin requests +- **Health & Recovery**: Circuit breaker states, dead server detection, memory pressure handling +- **Module Dependencies**: How the codebase modules relate to each other + +### Key Source Files + +| Component | Location | Description | +|-----------|----------|-------------| +| **Rust Plugin Runner** | `src/services/plugins/runner.rs` | Entry point for plugin execution | +| **Pool Executor** | `src/services/plugins/pool_executor.rs` | Manages Node.js process and connections | +| **Configuration** | `src/services/plugins/config.rs` | Auto-derivation logic for all env vars | +| **Pool Server** | `plugins/lib/pool-server.ts` | Node.js server accepting plugin requests | +| **Sandbox Executor** | `plugins/lib/sandbox-executor.ts` | VM-based plugin execution with security | +| **Plugin SDK** | `plugins/lib/plugin.ts` | PluginContext and API for plugins | diff --git a/plugins/ARCHITECTURE.md b/plugins/ARCHITECTURE.md new file mode 100644 index 000000000..0a5b35179 --- /dev/null +++ b/plugins/ARCHITECTURE.md @@ -0,0 +1,289 @@ +# Plugin System Architecture + +Developer guide for understanding and modifying the plugin execution system. + +## High-Level Architecture + +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Rust Relayer โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ HTTP API โ”‚โ”€โ”€โ”€โ–ถโ”‚ PluginRunner โ”‚โ”€โ”€โ”€โ–ถโ”‚ PoolManager โ”‚ โ”‚ +โ”‚ โ”‚ /plugins/* โ”‚ โ”‚ โ”‚ โ”‚ - CircuitBreaker โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ - ConnectionPool โ”‚ โ”‚ +โ”‚ โ”‚ - RequestQueue โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ โ”‚ โ”‚ +โ”‚ Unix Socket (JSON-line protocol) โ”‚ +โ”‚ โ”‚ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + โ”‚ +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Node.js Pool Server โ”‚ โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ pool-server.ts โ”‚ โ”‚ +โ”‚ โ”‚ Piscina Worker Pool โ”‚โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚ - Request Router โ”‚ โ”‚ +โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ - Memory Pressure Mon โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Worker Thread 1 โ”‚ โ”‚ โ”‚ - Cache Management โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ (sandbox-exec) โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Worker Thread 2 โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ โ”‚ (sandbox-exec) โ”‚ โ”‚ โ”‚ SharedSocketService โ”‚ โ”‚ +โ”‚ โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ (Rust โ†” Plugin comms) โ”‚ โ”‚ +โ”‚ โ”‚ โ”‚ Worker Thread N โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +``` + +## Component Overview + +### Rust Side (`src/services/plugins/`) + +| Module | Purpose | +|--------|---------| +| `config.rs` | Centralized configuration with auto-derivation from `PLUGIN_MAX_CONCURRENCY` | +| `runner.rs` | Entry point - routes requests to pool executor, handles precompilation | +| `pool_executor.rs` | Manages Node.js process lifecycle, connection pooling, circuit breaker | +| `health.rs` | Circuit breaker, health status, dead server detection | +| `protocol.rs` | JSON-line message types (PoolRequest, PoolResponse) | +| `connection.rs` | Lock-free connection pool with semaphore-based concurrency | +| `shared_socket.rs` | Per-request Unix socket for plugin โ†” Rust API communication | +| `relayer_api.rs` | Plugin API implementation (sendTransaction, signMessage, etc.) | + +### Node.js Side (`plugins/lib/`) + +| Module | Purpose | +|--------|---------| +| `pool-server.ts` | Main server - accepts connections, routes to workers, manages memory | +| `worker-pool.ts` | Piscina wrapper with dynamic scaling and cache management | +| `sandbox-executor.ts` | VM-based plugin execution with security restrictions | +| `compiler.ts` | TypeScript/JavaScript compilation with esbuild | +| `plugin.ts` | Plugin SDK (PluginContext, PluginAPI) | +| `kv.ts` | Redis-backed key-value store for plugins | + +## Communication Protocol + +### Pool Protocol (Rust โ†” pool-server.ts) + +Unix socket at `/tmp/relayer-plugin-pool-{uuid}.sock` using newline-delimited JSON. + +**Request Types:** +```typescript +// Execute a plugin +{ type: "execute", taskId, pluginId, compiledCode?, pluginPath?, params, socketPath, timeout? } + +// Precompile TypeScript +{ type: "precompile", taskId, pluginId, pluginPath?, sourceCode? } + +// Cache compiled code +{ type: "cache", taskId, pluginId, compiledCode } + +// Invalidate cache +{ type: "invalidate", taskId, pluginId } + +// Health check +{ type: "health", taskId } + +// Graceful shutdown +{ type: "shutdown", taskId } +``` + +**Response:** +```typescript +{ taskId, success: boolean, result?, error?: { message, code?, status?, details? }, logs? } +``` + +### Shared Socket Protocol (Plugin โ†” Rust) + +Per-request socket at `/tmp/relayer-shared-{uuid}.sock` for plugin API calls. + +```typescript +// Plugin sends: +{ type: "sendTransaction", requestId, relayerId, transaction } +{ type: "getRelayerBalance", requestId, relayerId } +// ... other API methods + +// Rust responds: +{ requestId, success: boolean, data?, error? } +``` + +## Request Flow + +``` +1. HTTP POST /api/v1/plugins/{id}/call + โ”‚ +2. PluginRunner.run_plugin() + โ”‚ + โ”œโ”€ Check if compiled code cached + โ”‚ โ””โ”€ If not: precompile via pool + โ”‚ +3. PoolManager.execute_plugin() + โ”‚ + โ”œโ”€ Circuit breaker check (reject if open) + โ”‚ + โ”œโ”€ Try acquire connection permit (fast path) + โ”‚ โ””โ”€ If unavailable: queue request (slow path) + โ”‚ +4. Send Execute request to pool-server + โ”‚ +5. pool-server routes to Piscina worker + โ”‚ +6. sandbox-executor.ts runs plugin in VM + โ”‚ + โ”œโ”€ Plugin calls api.useRelayer().sendTransaction() + โ”‚ โ””โ”€ Communicates via shared socket to Rust + โ”‚ +7. Response flows back through chain + โ”‚ +8. HTTP 200 with { success, data, metadata } +``` + +## Environment Variables + +> **Source of truth**: `src/constants/plugins.rs` defines all default values. +> Auto-derivation logic is in `src/services/plugins/config.rs`. + +### Primary Scaling Knob + +| Variable | Default | Description | +|----------|---------|-------------| +| `PLUGIN_MAX_CONCURRENCY` | 2048 | **Main knob** - drives auto-derivation of all other values | + +### Auto-Derived (override only if needed) + +| Variable | Default Formula | Description | +|----------|-----------------|-------------| +| `PLUGIN_POOL_MAX_CONNECTIONS` | = max_concurrency | Rust connection pool size | +| `PLUGIN_POOL_MAX_QUEUE_SIZE` | = max_concurrency * 2 | Request queue capacity | +| `PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS` | = max_concurrency * 1.5 | Shared socket connections | +| `PLUGIN_POOL_MIN_THREADS` | max(2, cpu_count/2) | Node.js minimum workers | +| `PLUGIN_POOL_MAX_THREADS` | memory-aware, max 32 | Node.js maximum workers | +| `PLUGIN_POOL_CONCURRENT_TASKS` | (concurrency/threads)*1.2, max 250 | Tasks per worker | +| `PLUGIN_WORKER_HEAP_MB` | 512 + (concurrent_tasks * 5) | Per-worker heap size | + +### Fine-Tuning + +| Variable | Default | Description | +|----------|---------|-------------| +| `PLUGIN_POOL_WORKERS` | 0 (auto) | Rust queue worker threads | +| `PLUGIN_POOL_CONNECT_RETRIES` | 15 | Connection retry attempts | +| `PLUGIN_POOL_REQUEST_TIMEOUT_SECS` | 30 | Per-request timeout | +| `PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS` | 500 | Queue wait timeout (auto-scales to 1000) | +| `PLUGIN_POOL_IDLE_TIMEOUT` | 60000 | Worker idle timeout (ms) | +| `PLUGIN_POOL_SOCKET_BACKLOG` | max(concurrency, 2048) | Socket backlog size | +| `PLUGIN_POOL_HEALTH_CHECK_INTERVAL_SECS` | 5 | Health check frequency | +| `PLUGIN_SOCKET_IDLE_TIMEOUT_SECS` | 60 | Shared socket idle timeout | +| `PLUGIN_SOCKET_READ_TIMEOUT_SECS` | 30 | Shared socket read timeout | + +## Health & Recovery + +### Circuit Breaker States + +``` +CLOSED โ”€โ”€(>50% failure rate)โ”€โ”€โ–ถ OPEN + โ–ฒ โ”‚ + โ”‚ (5s backoff) + โ”‚ โ–ผ + โ””โ”€โ”€(10 consecutive OK)โ”€โ”€โ”€โ”€ HALF_OPEN +``` + +- **Closed**: All requests allowed +- **Open**: Most requests rejected, pool server restart triggered +- **Half-Open**: 10% of requests allowed to probe recovery + +### Dead Server Detection + +Errors that trigger automatic restart: +- `eof while parsing` - Connection closed mid-message +- `broken pipe` - Write to closed socket +- `connection refused` - Server not listening +- `connection reset` - Server forcefully closed +- `socket file missing` - Unix socket deleted + +### Memory Pressure Handling + +pool-server.ts monitors heap usage and triggers: +1. **75% heap**: Force GC, evict old cache entries +2. **85% heap**: Aggressive cache eviction, warning logs +3. **95% heap**: Emergency measures, reject new requests + +## Performance Tuning + +### Low Concurrency (<100 plugins/sec) +```bash +export PLUGIN_MAX_CONCURRENCY=100 +# Everything auto-derives appropriately +``` + +### Medium Concurrency (100-1000 plugins/sec) +```bash +export PLUGIN_MAX_CONCURRENCY=500 +# Consider increasing if seeing queue full errors: +# export PLUGIN_POOL_MAX_QUEUE_SIZE=2000 +``` + +### High Concurrency (1000+ plugins/sec) +```bash +export PLUGIN_MAX_CONCURRENCY=5000 +# On 32GB+ systems, can increase threads: +# export PLUGIN_POOL_MAX_THREADS=16 +# export PLUGIN_POOL_CONCURRENT_TASKS=200 +``` + +### Debugging + +Enable debug logging: +```bash +RUST_LOG=openzeppelin_relayer::services::plugins=debug cargo run +``` + +Check health endpoint: +```bash +curl http://localhost:8080/api/v1/health/plugins +``` + +## Module Dependency Graph + +``` +config.rs + โ”‚ + โ–ผ +health.rs โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” + โ”‚ โ”‚ + โ–ผ โ”‚ +protocol.rs โ”‚ + โ”‚ โ”‚ + โ–ผ โ”‚ +connection.rs โ”‚ + โ”‚ โ”‚ + โ–ผ โ”‚ +pool_executor.rs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + โ”‚ + โ–ผ +runner.rs โ—€โ”€โ”€โ”€โ”€ shared_socket.rs โ—€โ”€โ”€โ”€โ”€ relayer_api.rs +``` + +## Testing + +```bash +# Rust unit tests +cargo test --package openzeppelin-relayer plugins + +# TypeScript tests +cd plugins && pnpm test + +# Integration test with load +# (requires k6: https://k6.io) +k6 run tests/load/plugins.js +``` + +## Common Issues + +| Symptom | Likely Cause | Solution | +|---------|--------------|----------| +| "Queue full" errors | Max concurrency too low | Increase `PLUGIN_MAX_CONCURRENCY` | +| OOM in Node.js | Too many threads/tasks | Reduce `PLUGIN_POOL_MAX_THREADS` | +| Slow response times | GC pressure | Check health endpoint, reduce concurrent tasks | +| "Circuit breaker open" | Pool server crashed | Check logs, will auto-recover | +| Connection refused | Pool server not started | Check `ensure_started()` is called | diff --git a/plugins/examples/example-rpc.ts b/plugins/examples/example-rpc.ts index f73a85713..86ac7041b 100644 --- a/plugins/examples/example-rpc.ts +++ b/plugins/examples/example-rpc.ts @@ -8,7 +8,6 @@ type Params = {}; const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - /** * Plugin handler function - this is the entry point * Export it as 'handler' and the relayer will automatically call it @@ -20,21 +19,14 @@ export async function handler(api: PluginAPI, params: Params): Promise { - this.socket.on("connect", () => { + this.socket.once("connect", () => { this.connected = true; resolve2(); }); - this.socket.on("error", (error) => { - this.handleSocketError(error); - reject(error); - }); - this.socket.on("close", () => { - this.handleSocketClose(); - }); + this.socket.once("error", reject); }); - this.socket.on("data", (data) => this.handleSocketData(data)); } } await this.connectionPromise; @@ -31688,11 +31686,33 @@ var SandboxPluginAPI = class { /** * Set up error/close/data handlers for a socket (pooled or new). * This ensures sockets can trigger reconnection on failure. + * Stores references for proper cleanup to prevent listener accumulation. */ setupSocketHandlers(socket) { - socket.on("error", (error) => this.handleSocketError(error)); - socket.on("close", () => this.handleSocketClose()); - socket.on("data", (data) => this.handleSocketData(data)); + this.boundErrorHandler = (error) => this.handleSocketError(error); + this.boundCloseHandler = () => this.handleSocketClose(); + this.boundDataHandler = (data) => this.handleSocketData(data); + socket.on("error", this.boundErrorHandler); + socket.on("close", this.boundCloseHandler); + socket.on("data", this.boundDataHandler); + } + /** + * Remove socket handlers before returning to pool. + * Prevents listener accumulation (MaxListenersExceededWarning). + */ + removeSocketHandlers(socket) { + if (this.boundErrorHandler) { + socket.removeListener("error", this.boundErrorHandler); + this.boundErrorHandler = null; + } + if (this.boundCloseHandler) { + socket.removeListener("close", this.boundCloseHandler); + this.boundCloseHandler = null; + } + if (this.boundDataHandler) { + socket.removeListener("data", this.boundDataHandler); + this.boundDataHandler = null; + } } /** * Handle socket error - reject pending requests and reset connection state @@ -31782,6 +31802,14 @@ var SandboxPluginAPI = class { }); } async send(relayerId, method, payload) { + return this.sendWithRetry(relayerId, method, payload, false); + } + /** + * Send request with EPIPE retry logic. + * EPIPE occurs when the pooled socket was closed by the server but client doesn't know yet. + * On EPIPE, we destroy the stale socket and retry with a fresh connection. + */ + async sendWithRetry(relayerId, method, payload, isRetry) { const requestId = v4_default(); const msg = { requestId, relayerId, method, payload }; if (this.httpRequestId) { @@ -31794,33 +31822,49 @@ var SandboxPluginAPI = class { ); } await this.ensureConnected(); - return new Promise((resolve2, reject) => { - let timeoutId; - timeoutId = setTimeout(() => { - this.pending.delete(requestId); - reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); - }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); - this.pending.set(requestId, { - resolve: (value) => { - if (timeoutId) clearTimeout(timeoutId); - resolve2(value); - }, - reject: (reason) => { - if (timeoutId) clearTimeout(timeoutId); - reject(reason); - } - }); - this.socket.write(message, (error) => { - if (error) { - if (timeoutId) clearTimeout(timeoutId); + try { + return await new Promise((resolve2, reject) => { + let timeoutId; + timeoutId = setTimeout(() => { this.pending.delete(requestId); - reject(error); - } + reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); + }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); + this.pending.set(requestId, { + resolve: (value) => { + if (timeoutId) clearTimeout(timeoutId); + resolve2(value); + }, + reject: (reason) => { + if (timeoutId) clearTimeout(timeoutId); + reject(reason); + } + }); + this.socket.write(message, (error) => { + if (error) { + if (timeoutId) clearTimeout(timeoutId); + this.pending.delete(requestId); + reject(error); + } + }); }); - }); + } catch (error) { + if (!isRetry && (error.code === "EPIPE" || error.code === "ECONNRESET")) { + if (this.socket) { + this.removeSocketHandlers(this.socket); + this.socket.destroy(); + this.socket = null; + } + this.connected = false; + this.connectionPromise = null; + this.fromPool = false; + return this.sendWithRetry(relayerId, method, payload, true); + } + throw error; + } } close() { if (this.socket) { + this.removeSocketHandlers(this.socket); socketPool.release(this.socket); this.socket = null; } diff --git a/plugins/lib/sandbox-executor.js.sha256 b/plugins/lib/sandbox-executor.js.sha256 index 903192a70..712c93e2c 100644 --- a/plugins/lib/sandbox-executor.js.sha256 +++ b/plugins/lib/sandbox-executor.js.sha256 @@ -1 +1 @@ -df18c16db22475d7e06fe35422be6ec7059fcd61568494809893429679c8c432 sandbox-executor.js +a165a8c937e738fc9c88f973824e9a35b7a2802fd7810b55ff3bbfa73feb0866 sandbox-executor.js diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/sandbox-executor.ts index 4962b93b3..913386541 100644 --- a/plugins/lib/sandbox-executor.ts +++ b/plugins/lib/sandbox-executor.ts @@ -290,6 +290,11 @@ class SandboxPluginAPI implements PluginAPI { private readonly maxPendingRequests = 100; // Prevent memory leak from unbounded pending private fromPool: boolean = false; // Track if socket is from pool + // Store handler references for proper cleanup (prevents listener accumulation) + private boundErrorHandler: ((error: Error) => void) | null = null; + private boundCloseHandler: (() => void) | null = null; + private boundDataHandler: ((data: Buffer) => void) | null = null; + constructor(socketPath: string, httpRequestId?: string) { this.socketPath = socketPath; this.pending = new Map(); @@ -316,23 +321,19 @@ class SandboxPluginAPI implements PluginAPI { this.socket = net.createConnection(this.socketPath); this.fromPool = false; + // Set up tracked handlers (can be removed later) + this.setupSocketHandlers(this.socket); + this.connectionPromise = new Promise((resolve, reject) => { - this.socket!.on('connect', () => { + // 'connect' is one-time event, use once() so it auto-removes + this.socket!.once('connect', () => { this.connected = true; resolve(); }); - this.socket!.on('error', (error) => { - this.handleSocketError(error); - reject(error); - }); - - this.socket!.on('close', () => { - this.handleSocketClose(); - }); + // Additional one-time error handler for connection phase only + this.socket!.once('error', reject); }); - - this.socket.on('data', (data) => this.handleSocketData(data)); } } @@ -342,11 +343,36 @@ class SandboxPluginAPI implements PluginAPI { /** * Set up error/close/data handlers for a socket (pooled or new). * This ensures sockets can trigger reconnection on failure. + * Stores references for proper cleanup to prevent listener accumulation. */ private setupSocketHandlers(socket: net.Socket): void { - socket.on('error', (error) => this.handleSocketError(error)); - socket.on('close', () => this.handleSocketClose()); - socket.on('data', (data) => this.handleSocketData(data)); + // Create bound handlers so they can be removed later + this.boundErrorHandler = (error: Error) => this.handleSocketError(error); + this.boundCloseHandler = () => this.handleSocketClose(); + this.boundDataHandler = (data: Buffer) => this.handleSocketData(data); + + socket.on('error', this.boundErrorHandler); + socket.on('close', this.boundCloseHandler); + socket.on('data', this.boundDataHandler); + } + + /** + * Remove socket handlers before returning to pool. + * Prevents listener accumulation (MaxListenersExceededWarning). + */ + private removeSocketHandlers(socket: net.Socket): void { + if (this.boundErrorHandler) { + socket.removeListener('error', this.boundErrorHandler); + this.boundErrorHandler = null; + } + if (this.boundCloseHandler) { + socket.removeListener('close', this.boundCloseHandler); + this.boundCloseHandler = null; + } + if (this.boundDataHandler) { + socket.removeListener('data', this.boundDataHandler); + this.boundDataHandler = null; + } } /** @@ -469,6 +495,20 @@ class SandboxPluginAPI implements PluginAPI { } private async send(relayerId: string, method: string, payload: any): Promise { + return this.sendWithRetry(relayerId, method, payload, false); + } + + /** + * Send request with EPIPE retry logic. + * EPIPE occurs when the pooled socket was closed by the server but client doesn't know yet. + * On EPIPE, we destroy the stale socket and retry with a fresh connection. + */ + private async sendWithRetry( + relayerId: string, + method: string, + payload: any, + isRetry: boolean + ): Promise { const requestId = uuidv4(); const msg: any = { requestId, relayerId, method, payload }; if (this.httpRequestId) { @@ -487,40 +527,61 @@ class SandboxPluginAPI implements PluginAPI { // Ensure we're connected before sending await this.ensureConnected(); - return new Promise((resolve, reject) => { - let timeoutId: NodeJS.Timeout | undefined; - - // Set up timeout to prevent hanging forever - timeoutId = setTimeout(() => { - this.pending.delete(requestId); - reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); - }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); - - // Wrap resolvers to clear timeout on completion - this.pending.set(requestId, { - resolve: (value) => { - if (timeoutId) clearTimeout(timeoutId); - resolve(value); - }, - reject: (reason) => { - if (timeoutId) clearTimeout(timeoutId); - reject(reason); - }, - }); + try { + return await new Promise((resolve, reject) => { + let timeoutId: NodeJS.Timeout | undefined; - this.socket!.write(message, (error) => { - if (error) { - if (timeoutId) clearTimeout(timeoutId); + // Set up timeout to prevent hanging forever + timeoutId = setTimeout(() => { this.pending.delete(requestId); - reject(error); - } + reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); + }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); + + // Wrap resolvers to clear timeout on completion + this.pending.set(requestId, { + resolve: (value) => { + if (timeoutId) clearTimeout(timeoutId); + resolve(value); + }, + reject: (reason) => { + if (timeoutId) clearTimeout(timeoutId); + reject(reason); + }, + }); + + this.socket!.write(message, (error) => { + if (error) { + if (timeoutId) clearTimeout(timeoutId); + this.pending.delete(requestId); + reject(error); + } + }); }); - }); + } catch (error: any) { + // Handle EPIPE/ECONNRESET - stale socket from pool, retry with fresh connection + if (!isRetry && (error.code === 'EPIPE' || error.code === 'ECONNRESET')) { + // Destroy the stale socket (don't return to pool) + if (this.socket) { + this.removeSocketHandlers(this.socket); + this.socket.destroy(); + this.socket = null; + } + this.connected = false; + this.connectionPromise = null; + this.fromPool = false; + + // Retry with fresh connection (bypass pool by clearing state) + return this.sendWithRetry(relayerId, method, payload, true); + } + throw error; + } } close(): void { // Return socket to pool if healthy, otherwise destroy if (this.socket) { + // Remove handlers BEFORE returning to pool to prevent listener accumulation + this.removeSocketHandlers(this.socket); socketPool.release(this.socket); this.socket = null; } diff --git a/src/services/plugins/health.rs b/src/services/plugins/health.rs index 5a98e318f..2f24bcc68 100644 --- a/src/services/plugins/health.rs +++ b/src/services/plugins/health.rs @@ -145,6 +145,8 @@ pub struct CircuitBreaker { state: AtomicU32, /// Time when circuit opened (for recovery timing) opened_at_ms: AtomicU64, + /// Time of last activity (for idle auto-close) + last_activity_ms: AtomicU64, /// Consecutive successful requests in half-open state recovery_successes: AtomicU32, /// Average response time in ms (exponential moving average) @@ -162,10 +164,14 @@ impl Default for CircuitBreaker { } impl CircuitBreaker { + /// Idle timeout for auto-closing circuit (2 minutes of no activity) + const IDLE_AUTO_CLOSE_MS: u64 = 120_000; + pub fn new() -> Self { Self { state: AtomicU32::new(0), // Closed opened_at_ms: AtomicU64::new(0), + last_activity_ms: AtomicU64::new(0), recovery_successes: AtomicU32::new(0), avg_response_time_ms: AtomicU32::new(0), restart_attempts: AtomicU32::new(0), @@ -173,6 +179,18 @@ impl CircuitBreaker { } } + fn now_ms() -> u64 { + std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_millis() as u64 + } + + fn update_last_activity(&self) { + self.last_activity_ms + .store(Self::now_ms(), Ordering::Relaxed); + } + pub fn state(&self) -> CircuitState { match self.state.load(Ordering::Relaxed) { 0 => CircuitState::Closed, @@ -192,6 +210,7 @@ impl CircuitBreaker { /// Record a successful request with response time pub fn record_success(&self, response_time_ms: u32) { + self.update_last_activity(); self.recent_results.record(true); // Update exponential moving average (alpha = 0.1) @@ -225,6 +244,7 @@ impl CircuitBreaker { /// Record a failed request pub fn record_failure(&self) { + self.update_last_activity(); self.recent_results.record(false); self.recovery_successes.store(0, Ordering::Relaxed); @@ -287,7 +307,22 @@ impl CircuitBreaker { /// Check if request should be allowed based on circuit state. /// If recovery_allowance is provided, use it in HalfOpen state instead of default 10%. + /// Auto-closes circuit if idle for longer than IDLE_AUTO_CLOSE_MS. pub fn should_allow_request(&self, recovery_allowance: Option) -> bool { + // Auto-close if idle for too long (no failures means system likely recovered) + if !matches!(self.state(), CircuitState::Closed) { + let last_activity = self.last_activity_ms.load(Ordering::Relaxed); + let now = Self::now_ms(); + if last_activity > 0 && now - last_activity >= Self::IDLE_AUTO_CLOSE_MS { + tracing::info!( + idle_ms = now - last_activity, + "Circuit breaker auto-closing after idle period" + ); + self.force_close(); + return true; + } + } + match self.state() { CircuitState::Closed => true, CircuitState::HalfOpen => { diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index ccd165506..9ad7c768c 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -748,8 +748,10 @@ impl PoolManager { match &result { Ok(_) => circuit_breaker.record_success(elapsed_ms), Err(e) => { - circuit_breaker.record_failure(); + // Only count infrastructure errors for circuit breaker, not business errors + // Business errors (RPC failures, plugin logic errors) mean the pool is healthy if Self::is_dead_server_error(e) { + circuit_breaker.record_failure(); tracing::warn!( error = %e, "Detected dead pool server error, triggering health check for restart" @@ -759,6 +761,9 @@ impl PoolManager { tokio::spawn(async move { pool.clear().await; }); + } else { + // Plugin executed but returned error - infrastructure is healthy + circuit_breaker.record_success(elapsed_ms); } } } @@ -844,8 +849,9 @@ impl PoolManager { match &result { Ok(_) => circuit_breaker.record_success(elapsed_ms), Err(e) => { - circuit_breaker.record_failure(); + // Only count infrastructure errors for circuit breaker, not business errors if Self::is_dead_server_error(e) { + circuit_breaker.record_failure(); tracing::warn!( error = %e, "Detected dead pool server error (queued path), triggering health check for restart" @@ -855,6 +861,9 @@ impl PoolManager { tokio::spawn(async move { pool.clear().await; }); + } else { + // Plugin executed but returned error - infrastructure is healthy + circuit_breaker.record_success(elapsed_ms); } } } From 0fc35c07043aeefa810a6b314650c89d79ef1684 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 11 Jan 2026 23:16:08 +0100 Subject: [PATCH 09/42] chore: Improvements --- .../basic-example-plugin/docker-compose.yaml | 4 +- plugins/lib/.build-cache-hash | 2 +- plugins/lib/plugin.ts | 17 +- plugins/lib/sandbox-executor.js | 84 +++-- plugins/lib/sandbox-executor.js.sha256 | 2 +- plugins/lib/sandbox-executor.ts | 147 ++++++-- plugins/tests/lib/plugin.test.ts | 166 +++++++++- plugins/tests/lib/sandbox-executor.test.ts | 313 +++++++++++++++++- 8 files changed, 671 insertions(+), 64 deletions(-) diff --git a/examples/basic-example-plugin/docker-compose.yaml b/examples/basic-example-plugin/docker-compose.yaml index d36163fea..cdcca0657 100644 --- a/examples/basic-example-plugin/docker-compose.yaml +++ b/examples/basic-example-plugin/docker-compose.yaml @@ -12,11 +12,11 @@ services: - keystore_passphrase environment: REDIS_URL: redis://redis:6379 - RATE_LIMIT_REQUESTS_PER_SECOND: 10 - RATE_LIMIT_BURST: 50 WEBHOOK_SIGNING_KEY: ${WEBHOOK_SIGNING_KEY} API_KEY: ${API_KEY} KEYSTORE_PASSPHRASE: ${KEYSTORE_PASSPHRASE} + RATE_LIMIT_REQUESTS_PER_SECOND: 50000 + RATE_LIMIT_BURST_SIZE: 300 security_opt: - no-new-privileges networks: diff --git a/plugins/lib/.build-cache-hash b/plugins/lib/.build-cache-hash index 5d3853ecd..5f02b6f2d 100644 --- a/plugins/lib/.build-cache-hash +++ b/plugins/lib/.build-cache-hash @@ -1 +1 @@ -fd8810b80e13c25c273fca43752a2b1ff7166a75c9949f64139c7908470ac32b \ No newline at end of file +04a090243b2ce9eec5a83a91845c1815a188e6d94d78d0301a7f9ee70ed76c40 \ No newline at end of file diff --git a/plugins/lib/plugin.ts b/plugins/lib/plugin.ts index 521e94f67..417eee370 100644 --- a/plugins/lib/plugin.ts +++ b/plugins/lib/plugin.ts @@ -47,6 +47,20 @@ import { DEFAULT_SOCKET_REQUEST_TIMEOUT_MS } from './constants'; import net from 'node:net'; import { v4 as uuidv4 } from 'uuid'; +/** + * Custom error for socket closure - provides a recognizable error code + * for server-side connection termination (e.g., Rust's 60-second connection lifetime). + */ +class SocketClosedError extends Error { + code: string; + + constructor(message: string) { + super(message); + this.name = 'SocketClosedError'; + this.code = 'ESOCKETCLOSED'; + } +} + /** * Smart serialization for plugin return values * - Objects/Arrays: JSON.stringify (need serialization) @@ -401,7 +415,8 @@ export class DefaultPluginAPI implements PluginAPI { this.socket.on('close', () => { this._connected = false; - this._rejectAllPending(new Error('Socket closed unexpectedly')); + // Use SocketClosedError so callers can identify server-side closure + this._rejectAllPending(new SocketClosedError('Socket closed by server (connection lifetime exceeded)')); }); }); diff --git a/plugins/lib/sandbox-executor.js b/plugins/lib/sandbox-executor.js index e6e3ece12..9e64c1176 100644 --- a/plugins/lib/sandbox-executor.js +++ b/plugins/lib/sandbox-executor.js @@ -1,9 +1,9 @@ /** * Auto-generated by build-executor.ts - * Build time: 2026-01-08T23:43:55.773Z + * Build time: 2026-01-11T14:30:56.780Z * Node version: v25.2.1 * Source: sandbox-executor.ts - * Source hash: fd8810b80e13c25c + * Source hash: 04a090243b2ce9ee * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts */ "use strict"; @@ -31611,29 +31611,54 @@ var ScriptCache = class { return this.cache.size; } }; +var SocketClosedError = class extends Error { + constructor(message) { + super(message); + this.name = "SocketClosedError"; + this.code = "ESOCKETCLOSED"; + } +}; var SocketPool = class { constructor() { this.available = []; this.maxSize = 5; + // Max sockets to cache per worker + // Rust server connection lifetime is 60s. Discard sockets older than 50s. + this.maxSocketAgeMs = 5e4; } - // Max sockets to cache per worker - acquire(socketPath) { - const socket = this.available.pop(); - if (socket && socket.writable && !socket.destroyed) { - return socket; + acquire() { + const now = Date.now(); + while (this.available.length > 0) { + const pooled = this.available.pop(); + const age = now - pooled.createdAt; + if (age > this.maxSocketAgeMs) { + pooled.socket.destroy(); + continue; + } + if (pooled.socket.writable && !pooled.socket.destroyed) { + return { socket: pooled.socket, createdAt: pooled.createdAt }; + } + pooled.socket.destroy(); } return null; } - release(socket) { - if (socket.writable && !socket.destroyed && this.available.length < this.maxSize) { - this.available.push(socket); - } else { + /** + * Release a socket back to the pool. + * @param socket The socket to release + * @param createdAt When the socket was originally created (for age tracking) + */ + release(socket, createdAt) { + const now = Date.now(); + const age = now - createdAt; + if (age > this.maxSocketAgeMs || !socket.writable || socket.destroyed || this.available.length >= this.maxSize) { socket.destroy(); + return; } + this.available.push({ socket, createdAt }); } clear() { - for (const socket of this.available) { - socket.destroy(); + for (const pooled of this.available) { + pooled.socket.destroy(); } this.available = []; } @@ -31648,8 +31673,8 @@ var SandboxPluginAPI = class { this.connected = false; this.maxPendingRequests = 100; // Prevent memory leak from unbounded pending - this.fromPool = false; - // Track if socket is from pool + this.socketCreatedAt = 0; + // Track socket creation time for pool age-based eviction // Store handler references for proper cleanup (prevents listener accumulation) this.boundErrorHandler = null; this.boundCloseHandler = null; @@ -31661,16 +31686,16 @@ var SandboxPluginAPI = class { async ensureConnected() { if (this.connected) return; if (!this.connectionPromise) { - const pooledSocket = socketPool.acquire(this.socketPath); - if (pooledSocket) { - this.socket = pooledSocket; - this.fromPool = true; + const acquired = socketPool.acquire(); + if (acquired) { + this.socket = acquired.socket; + this.socketCreatedAt = acquired.createdAt; this.connected = true; this.connectionPromise = Promise.resolve(); this.setupSocketHandlers(this.socket); } else { this.socket = net.createConnection(this.socketPath); - this.fromPool = false; + this.socketCreatedAt = Date.now(); this.setupSocketHandlers(this.socket); this.connectionPromise = new Promise((resolve2, reject) => { this.socket.once("connect", () => { @@ -31724,11 +31749,12 @@ var SandboxPluginAPI = class { this.socket = null; } /** - * Handle socket close - reset connection state to enable reconnection + * Handle socket close - reset connection state to enable reconnection. + * Uses SocketClosedError to enable automatic retry in sendWithRetry(). */ handleSocketClose() { this.connected = false; - this.rejectAllPending(new Error("Socket closed unexpectedly")); + this.rejectAllPending(new SocketClosedError("Socket closed by server (connection lifetime exceeded)")); this.connectionPromise = null; this.socket = null; } @@ -31823,6 +31849,12 @@ var SandboxPluginAPI = class { } await this.ensureConnected(); try { + const socket = this.socket; + if (!socket) { + const staleError = new Error("Socket became unavailable after connection"); + staleError.code = "ECONNRESET"; + throw staleError; + } return await new Promise((resolve2, reject) => { let timeoutId; timeoutId = setTimeout(() => { @@ -31839,7 +31871,7 @@ var SandboxPluginAPI = class { reject(reason); } }); - this.socket.write(message, (error) => { + socket.write(message, (error) => { if (error) { if (timeoutId) clearTimeout(timeoutId); this.pending.delete(requestId); @@ -31848,7 +31880,8 @@ var SandboxPluginAPI = class { }); }); } catch (error) { - if (!isRetry && (error.code === "EPIPE" || error.code === "ECONNRESET")) { + const isRetryableError = error.code === "EPIPE" || error.code === "ECONNRESET" || error.code === "ESOCKETCLOSED"; + if (!isRetry && isRetryableError) { if (this.socket) { this.removeSocketHandlers(this.socket); this.socket.destroy(); @@ -31856,7 +31889,6 @@ var SandboxPluginAPI = class { } this.connected = false; this.connectionPromise = null; - this.fromPool = false; return this.sendWithRetry(relayerId, method, payload, true); } throw error; @@ -31865,7 +31897,7 @@ var SandboxPluginAPI = class { close() { if (this.socket) { this.removeSocketHandlers(this.socket); - socketPool.release(this.socket); + socketPool.release(this.socket, this.socketCreatedAt); this.socket = null; } this.connected = false; diff --git a/plugins/lib/sandbox-executor.js.sha256 b/plugins/lib/sandbox-executor.js.sha256 index 712c93e2c..806dfcaab 100644 --- a/plugins/lib/sandbox-executor.js.sha256 +++ b/plugins/lib/sandbox-executor.js.sha256 @@ -1 +1 @@ -a165a8c937e738fc9c88f973824e9a35b7a2802fd7810b55ff3bbfa73feb0866 sandbox-executor.js +e90ce68ad2d56cb845420856f472a754845ec3f024564cb49f19284e340fe9b1 sandbox-executor.js diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/sandbox-executor.ts index 913386541..90003181f 100644 --- a/plugins/lib/sandbox-executor.ts +++ b/plugins/lib/sandbox-executor.ts @@ -185,37 +185,104 @@ class ScriptCache { } } +/** + * Custom error for socket closure - enables retry logic to detect and handle + * server-side connection termination (e.g., Rust's 60-second connection lifetime). + */ +class SocketClosedError extends Error { + code: string; + + constructor(message: string) { + super(message); + this.name = 'SocketClosedError'; + this.code = 'ESOCKETCLOSED'; + } +} + +/** + * Pooled socket with creation timestamp for age-based eviction. + */ +interface PooledSocket { + socket: net.Socket; + createdAt: number; +} + +/** + * Result of acquiring a socket from the pool. + */ +interface AcquiredSocket { + socket: net.Socket; + createdAt: number; +} + /** * Socket Pool - Reuses socket connections across tasks in the same worker. * Creating a socket takes 0.1-1ms. Pooling reduces this overhead. + * + * CRITICAL: The Rust server has a 60-second TOTAL CONNECTION LIFETIME (not idle). + * This means sockets created at T=0 will be closed at T=60, regardless of activity. + * We track per-socket creation time and discard sockets older than 50 seconds. */ class SocketPool { - private available: net.Socket[] = []; + private available: PooledSocket[] = []; private readonly maxSize = 5; // Max sockets to cache per worker + // Rust server connection lifetime is 60s. Discard sockets older than 50s. + private readonly maxSocketAgeMs = 50_000; + + acquire(): AcquiredSocket | null { + const now = Date.now(); - acquire(socketPath: string): net.Socket | null { - // Try to reuse an available socket - const socket = this.available.pop(); - if (socket && socket.writable && !socket.destroyed) { - return socket; + // Pop sockets until we find a valid one or pool is empty + while (this.available.length > 0) { + const pooled = this.available.pop()!; + const age = now - pooled.createdAt; + + // Discard sockets older than max age (Rust will close them soon anyway) + if (age > this.maxSocketAgeMs) { + pooled.socket.destroy(); + continue; + } + + // Check socket health + if (pooled.socket.writable && !pooled.socket.destroyed) { + return { socket: pooled.socket, createdAt: pooled.createdAt }; + } + + // Socket unhealthy, destroy and try next + pooled.socket.destroy(); } - // Socket not reusable, let caller create new one + + // No valid socket found return null; } - release(socket: net.Socket): void { - // Only pool if socket is still healthy and not at capacity - if (socket.writable && !socket.destroyed && this.available.length < this.maxSize) { - this.available.push(socket); - } else { + /** + * Release a socket back to the pool. + * @param socket The socket to release + * @param createdAt When the socket was originally created (for age tracking) + */ + release(socket: net.Socket, createdAt: number): void { + const now = Date.now(); + const age = now - createdAt; + + // Don't pool sockets that are already old or unhealthy + if ( + age > this.maxSocketAgeMs || + !socket.writable || + socket.destroyed || + this.available.length >= this.maxSize + ) { socket.destroy(); + return; } + + this.available.push({ socket, createdAt }); } clear(): void { // Clean up all pooled sockets - for (const socket of this.available) { - socket.destroy(); + for (const pooled of this.available) { + pooled.socket.destroy(); } this.available = []; } @@ -288,7 +355,7 @@ class SandboxPluginAPI implements PluginAPI { private httpRequestId?: string; private socketPath: string; private readonly maxPendingRequests = 100; // Prevent memory leak from unbounded pending - private fromPool: boolean = false; // Track if socket is from pool + private socketCreatedAt: number = 0; // Track socket creation time for pool age-based eviction // Store handler references for proper cleanup (prevents listener accumulation) private boundErrorHandler: ((error: Error) => void) | null = null; @@ -306,20 +373,20 @@ class SandboxPluginAPI implements PluginAPI { if (!this.connectionPromise) { // Try to get socket from pool first - const pooledSocket = socketPool.acquire(this.socketPath); - - if (pooledSocket) { - this.socket = pooledSocket; - this.fromPool = true; + const acquired = socketPool.acquire(); + + if (acquired) { + this.socket = acquired.socket; + this.socketCreatedAt = acquired.createdAt; this.connected = true; this.connectionPromise = Promise.resolve(); - + // Set up error/close handlers for pooled socket to enable reconnection this.setupSocketHandlers(this.socket); } else { // Create new socket if pool is empty this.socket = net.createConnection(this.socketPath); - this.fromPool = false; + this.socketCreatedAt = Date.now(); // Set up tracked handlers (can be removed later) this.setupSocketHandlers(this.socket); @@ -387,11 +454,13 @@ class SandboxPluginAPI implements PluginAPI { } /** - * Handle socket close - reset connection state to enable reconnection + * Handle socket close - reset connection state to enable reconnection. + * Uses SocketClosedError to enable automatic retry in sendWithRetry(). */ private handleSocketClose(): void { this.connected = false; - this.rejectAllPending(new Error('Socket closed unexpectedly')); + // Use SocketClosedError so retry logic can detect and handle this + this.rejectAllPending(new SocketClosedError('Socket closed by server (connection lifetime exceeded)')); // Reset connection state to force reconnection on next call this.connectionPromise = null; this.socket = null; @@ -528,6 +597,19 @@ class SandboxPluginAPI implements PluginAPI { await this.ensureConnected(); try { + // Capture socket reference locally to guard against TOCTOU race condition. + // Socket can become null between ensureConnected() and write() if an error/close + // event fires asynchronously. This is especially likely after stress testing when + // pooled connections may be in a degraded state. + const socket = this.socket; + if (!socket) { + // Socket was nullified by error/close handler between ensureConnected and now. + // Treat as a stale connection error that can be retried. + const staleError = new Error('Socket became unavailable after connection') as NodeJS.ErrnoException; + staleError.code = 'ECONNRESET'; + throw staleError; + } + return await new Promise((resolve, reject) => { let timeoutId: NodeJS.Timeout | undefined; @@ -549,7 +631,7 @@ class SandboxPluginAPI implements PluginAPI { }, }); - this.socket!.write(message, (error) => { + socket.write(message, (error) => { if (error) { if (timeoutId) clearTimeout(timeoutId); this.pending.delete(requestId); @@ -558,8 +640,16 @@ class SandboxPluginAPI implements PluginAPI { }); }); } catch (error: any) { - // Handle EPIPE/ECONNRESET - stale socket from pool, retry with fresh connection - if (!isRetry && (error.code === 'EPIPE' || error.code === 'ECONNRESET')) { + // Handle connection errors - stale socket from pool or server-side closure + // EPIPE: write to closed socket (client doesn't know server closed) + // ECONNRESET: connection reset by peer (server forcefully closed) + // ESOCKETCLOSED: server closed connection (e.g., 60-second lifetime expired) + const isRetryableError = + error.code === 'EPIPE' || + error.code === 'ECONNRESET' || + error.code === 'ESOCKETCLOSED'; + + if (!isRetry && isRetryableError) { // Destroy the stale socket (don't return to pool) if (this.socket) { this.removeSocketHandlers(this.socket); @@ -568,7 +658,6 @@ class SandboxPluginAPI implements PluginAPI { } this.connected = false; this.connectionPromise = null; - this.fromPool = false; // Retry with fresh connection (bypass pool by clearing state) return this.sendWithRetry(relayerId, method, payload, true); @@ -582,7 +671,7 @@ class SandboxPluginAPI implements PluginAPI { if (this.socket) { // Remove handlers BEFORE returning to pool to prevent listener accumulation this.removeSocketHandlers(this.socket); - socketPool.release(this.socket); + socketPool.release(this.socket, this.socketCreatedAt); this.socket = null; } this.connected = false; diff --git a/plugins/tests/lib/plugin.test.ts b/plugins/tests/lib/plugin.test.ts index a67f9be36..b64901541 100644 --- a/plugins/tests/lib/plugin.test.ts +++ b/plugins/tests/lib/plugin.test.ts @@ -213,8 +213,14 @@ describe('PluginAPI', () => { expect(mockWrite).toHaveBeenCalled(); }); - it('should throw error if write fails', async () => { - mockWrite.mockReturnValue(false); + it('should throw error if write callback returns error', async () => { + // Simulate write error via callback (this is how Node.js socket.write reports errors) + const writeError = new Error('EPIPE: broken pipe'); + mockWrite.mockImplementation((data: string, callback: (error?: Error) => void) => { + // Call the callback with an error to simulate write failure + callback(writeError); + return true; + }); const payload: NetworkTransactionRequest = { to: '0x1234567890123456789012345678901234567890', @@ -225,7 +231,7 @@ describe('PluginAPI', () => { }; await expect(pluginAPI._send('test-relayer', 'sendTransaction', payload)) - .rejects.toThrow('Failed to send message to relayer'); + .rejects.toThrow('EPIPE: broken pipe'); }); }); @@ -278,6 +284,160 @@ describe('PluginAPI', () => { }); }); +describe('Socket error handling', () => { + let pluginAPI: DefaultPluginAPI; + let mockSocket: jest.Mocked; + let mockWrite: jest.Mock; + let mockEnd: jest.Mock; + let mockDestroy: jest.Mock; + let eventHandlers: Map; + + beforeEach(() => { + eventHandlers = new Map(); + mockWrite = jest.fn().mockReturnValue(true); + mockEnd = jest.fn(); + mockDestroy = jest.fn(); + + mockSocket = { + write: mockWrite, + end: mockEnd, + destroy: mockDestroy, + on: jest.fn((event: string, handler: Function) => { + eventHandlers.set(event, handler); + return mockSocket; + }), + } as any; + + jest.spyOn(net, 'createConnection').mockReturnValue(mockSocket); + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + it('should reject pending requests when socket closes', async () => { + pluginAPI = new DefaultPluginAPI('/tmp/test.sock'); + + // Simulate established connection by triggering connect event + const connectHandler = eventHandlers.get('connect'); + if (connectHandler) { + connectHandler(); + } + + const payload: NetworkTransactionRequest = { + to: '0x1234567890123456789012345678901234567890', + value: 1000000, + data: '0x', + gas_limit: 21000, + speed: Speed.FAST, + }; + + // Start the send (won't complete) + const sendPromise = pluginAPI._send('test-relayer', 'sendTransaction', payload); + + // Trigger socket close + const closeHandler = eventHandlers.get('close'); + if (closeHandler) { + closeHandler(); + } + + // Should reject with SocketClosedError + await expect(sendPromise).rejects.toThrow('Socket closed by server'); + }); + + it('should have ESOCKETCLOSED code on socket close error', async () => { + pluginAPI = new DefaultPluginAPI('/tmp/test.sock'); + + // Simulate established connection + const connectHandler = eventHandlers.get('connect'); + if (connectHandler) { + connectHandler(); + } + + const payload: NetworkTransactionRequest = { + to: '0x1234567890123456789012345678901234567890', + value: 1000000, + data: '0x', + gas_limit: 21000, + speed: Speed.FAST, + }; + + const sendPromise = pluginAPI._send('test-relayer', 'sendTransaction', payload); + + // Trigger socket close + const closeHandler = eventHandlers.get('close'); + if (closeHandler) { + closeHandler(); + } + + try { + await sendPromise; + fail('Should have thrown'); + } catch (error: any) { + expect(error.code).toBe('ESOCKETCLOSED'); + expect(error.name).toBe('SocketClosedError'); + } + }); + + it('should handle multiple pending requests on socket close', async () => { + pluginAPI = new DefaultPluginAPI('/tmp/test.sock'); + + // Simulate established connection + const connectHandler = eventHandlers.get('connect'); + if (connectHandler) { + connectHandler(); + } + + const payload: NetworkTransactionRequest = { + to: '0x1234567890123456789012345678901234567890', + value: 1000000, + data: '0x', + gas_limit: 21000, + speed: Speed.FAST, + }; + + // Start multiple sends + const promises = [ + pluginAPI._send('test-relayer', 'sendTransaction', payload), + pluginAPI._send('test-relayer', 'getRelayer', {}), + pluginAPI._send('test-relayer', 'getRelayerStatus', {}), + ]; + + expect(pluginAPI.pending.size).toBe(3); + + // Trigger socket close + const closeHandler = eventHandlers.get('close'); + if (closeHandler) { + closeHandler(); + } + + // All should reject + for (const promise of promises) { + await expect(promise).rejects.toThrow(); + } + + // Pending should be cleared + expect(pluginAPI.pending.size).toBe(0); + }); + + it('should reject connection promise on socket error during connect', async () => { + pluginAPI = new DefaultPluginAPI('/tmp/test.sock'); + + // Trigger error before connection is established + const errorHandler = eventHandlers.get('error'); + const socketError = new Error('ECONNREFUSED'); + + // The connection promise should reject + const connectionPromise = (pluginAPI as any)._connectionPromise; + + if (errorHandler) { + errorHandler(socketError); + } + + await expect(connectionPromise).rejects.toThrow('ECONNREFUSED'); + }); +}); + describe('PluginContext Headers', () => { it('should have correct PluginHeaders type structure', () => { // Test type structure: Record diff --git a/plugins/tests/lib/sandbox-executor.test.ts b/plugins/tests/lib/sandbox-executor.test.ts index f57a98729..505d18aa6 100644 --- a/plugins/tests/lib/sandbox-executor.test.ts +++ b/plugins/tests/lib/sandbox-executor.test.ts @@ -379,6 +379,271 @@ describe('SocketPool logic', () => { }); }); +describe('SocketClosedError', () => { + // Replicate the error class for testing + class SocketClosedError extends Error { + code: string; + constructor(message: string) { + super(message); + this.name = 'SocketClosedError'; + this.code = 'ESOCKETCLOSED'; + } + } + + it('should have correct name', () => { + const error = new SocketClosedError('test message'); + expect(error.name).toBe('SocketClosedError'); + }); + + it('should have ESOCKETCLOSED code', () => { + const error = new SocketClosedError('test message'); + expect(error.code).toBe('ESOCKETCLOSED'); + }); + + it('should preserve message', () => { + const error = new SocketClosedError('Connection lifetime exceeded'); + expect(error.message).toBe('Connection lifetime exceeded'); + }); + + it('should be instanceof Error', () => { + const error = new SocketClosedError('test'); + expect(error).toBeInstanceOf(Error); + }); + + it('should have stack trace', () => { + const error = new SocketClosedError('test'); + expect(error.stack).toBeDefined(); + expect(error.stack).toContain('SocketClosedError'); + }); +}); + +describe('Retry logic for connection errors', () => { + // Simulates the retry logic in sendWithRetry + function isRetryableError(error: any): boolean { + return ( + error.code === 'EPIPE' || + error.code === 'ECONNRESET' || + error.code === 'ESOCKETCLOSED' + ); + } + + it('should identify EPIPE as retryable', () => { + const error: any = new Error('broken pipe'); + error.code = 'EPIPE'; + expect(isRetryableError(error)).toBe(true); + }); + + it('should identify ECONNRESET as retryable', () => { + const error: any = new Error('connection reset'); + error.code = 'ECONNRESET'; + expect(isRetryableError(error)).toBe(true); + }); + + it('should identify ESOCKETCLOSED as retryable', () => { + const error: any = new Error('socket closed'); + error.code = 'ESOCKETCLOSED'; + expect(isRetryableError(error)).toBe(true); + }); + + it('should not retry generic errors', () => { + const error = new Error('generic error'); + expect(isRetryableError(error)).toBe(false); + }); + + it('should not retry timeout errors', () => { + const error: any = new Error('timeout'); + error.code = 'ETIMEDOUT'; + expect(isRetryableError(error)).toBe(false); + }); + + it('should not retry errors without code', () => { + const error = new Error('no code'); + expect(isRetryableError(error)).toBe(false); + }); +}); + +describe('Age-based socket eviction', () => { + const MAX_SOCKET_AGE_MS = 50_000; // 50 seconds, matching production code + + interface PooledSocket { + socket: { writable: boolean; destroyed: boolean; destroy: () => void }; + createdAt: number; + } + + function shouldEvictSocket(pooled: PooledSocket, now: number): boolean { + const age = now - pooled.createdAt; + return age > MAX_SOCKET_AGE_MS; + } + + it('should not evict fresh socket', () => { + const now = Date.now(); + const pooled: PooledSocket = { + socket: { writable: true, destroyed: false, destroy: jest.fn() }, + createdAt: now - 10_000, // 10 seconds old + }; + expect(shouldEvictSocket(pooled, now)).toBe(false); + }); + + it('should evict socket older than 50 seconds', () => { + const now = Date.now(); + const pooled: PooledSocket = { + socket: { writable: true, destroyed: false, destroy: jest.fn() }, + createdAt: now - 51_000, // 51 seconds old + }; + expect(shouldEvictSocket(pooled, now)).toBe(true); + }); + + it('should not evict socket exactly at 50 seconds', () => { + const now = Date.now(); + const pooled: PooledSocket = { + socket: { writable: true, destroyed: false, destroy: jest.fn() }, + createdAt: now - 50_000, // exactly 50 seconds + }; + expect(shouldEvictSocket(pooled, now)).toBe(false); + }); + + it('should evict socket at 55 seconds (within danger zone)', () => { + const now = Date.now(); + const pooled: PooledSocket = { + socket: { writable: true, destroyed: false, destroy: jest.fn() }, + createdAt: now - 55_000, // 55 seconds old + }; + expect(shouldEvictSocket(pooled, now)).toBe(true); + }); + + it('should provide 10 second safety margin before Rust 60s timeout', () => { + // Rust kills connections at 60s, we evict at 50s = 10s safety margin + const RUST_TIMEOUT = 60_000; + const SAFETY_MARGIN = RUST_TIMEOUT - MAX_SOCKET_AGE_MS; + expect(SAFETY_MARGIN).toBe(10_000); + }); +}); + +describe('Socket pool with age tracking', () => { + class MockSocketPoolWithAge { + private available: { socket: any; createdAt: number }[] = []; + private readonly maxSize = 5; + private readonly maxSocketAgeMs = 50_000; + + acquire(): { socket: any; createdAt: number } | null { + const now = Date.now(); + + while (this.available.length > 0) { + const pooled = this.available.pop()!; + const age = now - pooled.createdAt; + + // Discard old sockets + if (age > this.maxSocketAgeMs) { + pooled.socket.destroy(); + continue; + } + + if (pooled.socket.writable && !pooled.socket.destroyed) { + return pooled; + } + + pooled.socket.destroy(); + } + + return null; + } + + release(socket: any, createdAt: number): void { + const now = Date.now(); + const age = now - createdAt; + + if ( + age > this.maxSocketAgeMs || + !socket.writable || + socket.destroyed || + this.available.length >= this.maxSize + ) { + socket.destroy(); + return; + } + + this.available.push({ socket, createdAt }); + } + + size(): number { + return this.available.length; + } + } + + it('should reject old socket on acquire', () => { + const pool = new MockSocketPoolWithAge(); + const oldCreatedAt = Date.now() - 55_000; // 55 seconds ago + + const oldSocket = { + writable: true, + destroyed: false, + destroy: jest.fn(), + }; + + pool.release(oldSocket, oldCreatedAt); + + // Simulate time passing + jest.spyOn(Date, 'now').mockReturnValue(Date.now() + 1); + + const acquired = pool.acquire(); + expect(acquired).toBeNull(); + expect(oldSocket.destroy).toHaveBeenCalled(); + + jest.restoreAllMocks(); + }); + + it('should accept fresh socket on acquire', () => { + const pool = new MockSocketPoolWithAge(); + const freshCreatedAt = Date.now() - 10_000; // 10 seconds ago + + const freshSocket = { + writable: true, + destroyed: false, + destroy: jest.fn(), + }; + + pool.release(freshSocket, freshCreatedAt); + const acquired = pool.acquire(); + + expect(acquired).not.toBeNull(); + expect(acquired?.socket).toBe(freshSocket); + expect(acquired?.createdAt).toBe(freshCreatedAt); + }); + + it('should not pool socket that is too old on release', () => { + const pool = new MockSocketPoolWithAge(); + const oldCreatedAt = Date.now() - 55_000; + + const socket = { + writable: true, + destroyed: false, + destroy: jest.fn(), + }; + + pool.release(socket, oldCreatedAt); + + expect(pool.size()).toBe(0); + expect(socket.destroy).toHaveBeenCalled(); + }); + + it('should track createdAt through acquire/release cycle', () => { + const pool = new MockSocketPoolWithAge(); + const originalCreatedAt = Date.now() - 20_000; // 20 seconds ago + + const socket = { + writable: true, + destroyed: false, + destroy: jest.fn(), + }; + + pool.release(socket, originalCreatedAt); + const acquired = pool.acquire(); + + // createdAt should be preserved (not reset) + expect(acquired?.createdAt).toBe(originalCreatedAt); + }); +}); + describe('SandboxPluginAPI socket handling', () => { class MockSandboxPluginAPI { private socket: any = null; @@ -386,6 +651,7 @@ describe('SandboxPluginAPI socket handling', () => { private connected = false; private connectionPromise: Promise | null = null; private socketPath: string; + private socketCreatedAt: number = 0; private readonly maxPendingRequests = 100; constructor(socketPath: string) { @@ -403,6 +669,7 @@ describe('SandboxPluginAPI socket handling', () => { private async connect(): Promise { // Simulate connection this.socket = { writable: true, destroyed: false }; + this.socketCreatedAt = Date.now(); this.connected = true; } @@ -417,7 +684,11 @@ describe('SandboxPluginAPI socket handling', () => { this.connected = false; this.connectionPromise = null; this.socket = null; - this.rejectAllPending(new Error('Socket closed unexpectedly')); + // Use SocketClosedError-like error + const error: any = new Error('Socket closed by server (connection lifetime exceeded)'); + error.code = 'ESOCKETCLOSED'; + error.name = 'SocketClosedError'; + this.rejectAllPending(error); } private rejectAllPending(error: Error): void { @@ -458,6 +729,10 @@ describe('SandboxPluginAPI socket handling', () => { isConnected(): boolean { return this.connected; } + + getSocketCreatedAt(): number { + return this.socketCreatedAt; + } } it('should establish connection on first request', async () => { @@ -527,6 +802,42 @@ describe('SandboxPluginAPI socket handling', () => { await api.send('method2', {}); expect(api.isConnected()).toBe(true); }); + + it('should reject with ESOCKETCLOSED code on socket close', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + + await api.send('method1', {}); + + // Add a pending request + const pendingPromise = new Promise((resolve, reject) => { + (api as any).pending.set('test-pending', { resolve, reject }); + }); + + // Trigger socket close + api.handleSocketClose(); + + try { + await pendingPromise; + fail('Should have rejected'); + } catch (error: any) { + expect(error.code).toBe('ESOCKETCLOSED'); + expect(error.name).toBe('SocketClosedError'); + expect(error.message).toContain('connection lifetime exceeded'); + } + }); + + it('should track socket creation time', async () => { + const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const beforeConnect = Date.now(); + + await api.send('method1', {}); + + const afterConnect = Date.now(); + const socketCreatedAt = api.getSocketCreatedAt(); + + expect(socketCreatedAt).toBeGreaterThanOrEqual(beforeConnect); + expect(socketCreatedAt).toBeLessThanOrEqual(afterConnect); + }); }); describe('Sandbox console implementation', () => { From a397b2535183abdd5e507556f8777eff0bd5a52f Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 11 Jan 2026 23:32:54 +0100 Subject: [PATCH 10/42] chore: Fixes --- plugins/lib/.build-cache-hash | 1 - plugins/lib/sandbox-executor.js | 32274 ----------------------- plugins/lib/sandbox-executor.js.sha256 | 1 - 3 files changed, 32276 deletions(-) delete mode 100644 plugins/lib/.build-cache-hash delete mode 100644 plugins/lib/sandbox-executor.js delete mode 100644 plugins/lib/sandbox-executor.js.sha256 diff --git a/plugins/lib/.build-cache-hash b/plugins/lib/.build-cache-hash deleted file mode 100644 index 5f02b6f2d..000000000 --- a/plugins/lib/.build-cache-hash +++ /dev/null @@ -1 +0,0 @@ -04a090243b2ce9eec5a83a91845c1815a188e6d94d78d0301a7f9ee70ed76c40 \ No newline at end of file diff --git a/plugins/lib/sandbox-executor.js b/plugins/lib/sandbox-executor.js deleted file mode 100644 index 9e64c1176..000000000 --- a/plugins/lib/sandbox-executor.js +++ /dev/null @@ -1,32274 +0,0 @@ -/** - * Auto-generated by build-executor.ts - * Build time: 2026-01-11T14:30:56.780Z - * Node version: v25.2.1 - * Source: sandbox-executor.ts - * Source hash: 04a090243b2ce9ee - * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts - */ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json -var require_commands = __commonJS({ - "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json"(exports2, module2) { - module2.exports = { - acl: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - append: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - asking: { - arity: 1, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - auth: { - arity: -2, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bgrewriteaof: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bgsave: { - arity: -1, - flags: [ - "admin", - "noscript", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bitcount: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitfield: { - arity: -2, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitfield_ro: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitop: { - arity: -4, - flags: [ - "write", - "denyoom" - ], - keyStart: 2, - keyStop: -1, - step: 1 - }, - bitpos: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - blmove: { - arity: 6, - flags: [ - "write", - "denyoom", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - blmpop: { - arity: -5, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - blpop: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - brpop: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - brpoplpush: { - arity: 4, - flags: [ - "write", - "denyoom", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - bzmpop: { - arity: -5, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bzpopmax: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking", - "fast" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - bzpopmin: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking", - "fast" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - client: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - cluster: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - command: { - arity: -1, - flags: [ - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - config: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - copy: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - dbsize: { - arity: 1, - flags: [ - "readonly", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - debug: { - arity: -2, - flags: [ - "admin", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - decr: { - arity: 2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - decrby: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - del: { - arity: -2, - flags: [ - "write" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - discard: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - dump: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - echo: { - arity: 2, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - eval: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - eval_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - evalsha: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - evalsha_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - exec: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "skip_slowlog" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - exists: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - expire: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - expireat: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - expiretime: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - failover: { - arity: -1, - flags: [ - "admin", - "noscript", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - fcall: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - fcall_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - flushall: { - arity: -1, - flags: [ - "write" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - flushdb: { - arity: -1, - flags: [ - "write" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - function: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - geoadd: { - arity: -5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geodist: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geohash: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geopos: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadius: { - arity: -6, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadius_ro: { - arity: -6, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadiusbymember: { - arity: -5, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadiusbymember_ro: { - arity: -5, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geosearch: { - arity: -7, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geosearchstore: { - arity: -8, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - get: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getbit: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getdel: { - arity: 2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getex: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getrange: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getset: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hdel: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hello: { - arity: -1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - hexists: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hexpire: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hpexpire: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hget: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hgetall: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hincrby: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hincrbyfloat: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hkeys: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hmget: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hmset: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hrandfield: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hset: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hsetnx: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hstrlen: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hvals: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incr: { - arity: 2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incrby: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incrbyfloat: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - info: { - arity: -1, - flags: [ - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - keys: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lastsave: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - latency: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lcs: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - lindex: { - arity: 3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - linsert: { - arity: 5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - llen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lmove: { - arity: 5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - lmpop: { - arity: -4, - flags: [ - "write", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lolwut: { - arity: -1, - flags: [ - "readonly", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lpop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpos: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpush: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpushx: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lrange: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lrem: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lset: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - ltrim: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - memory: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - mget: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - migrate: { - arity: -6, - flags: [ - "write", - "movablekeys" - ], - keyStart: 3, - keyStop: 3, - step: 1 - }, - module: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - monitor: { - arity: 1, - flags: [ - "admin", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - move: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - mset: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 2 - }, - msetnx: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 2 - }, - multi: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - object: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - persist: { - arity: 2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpire: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpireat: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpiretime: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pfadd: { - arity: -2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pfcount: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - pfdebug: { - arity: 3, - flags: [ - "write", - "denyoom", - "admin" - ], - keyStart: 2, - keyStop: 2, - step: 1 - }, - pfmerge: { - arity: -2, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - pfselftest: { - arity: 1, - flags: [ - "admin" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - ping: { - arity: -1, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - psetex: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - psubscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - psync: { - arity: -3, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - pttl: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - publish: { - arity: 3, - flags: [ - "pubsub", - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - pubsub: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - punsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - quit: { - arity: -1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - randomkey: { - arity: 1, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - readonly: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - readwrite: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - rename: { - arity: 3, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - renamenx: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - replconf: { - arity: -1, - flags: [ - "admin", - "noscript", - "loading", - "stale", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - replicaof: { - arity: 3, - flags: [ - "admin", - "noscript", - "stale", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - reset: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - restore: { - arity: -4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - "restore-asking": { - arity: -4, - flags: [ - "write", - "denyoom", - "asking" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - role: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - rpop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - rpoplpush: { - arity: 3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - rpush: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - rpushx: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sadd: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - save: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - scan: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - scard: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - script: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sdiff: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sdiffstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - select: { - arity: 2, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - set: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setbit: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setex: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setnx: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setrange: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - shutdown: { - arity: -1, - flags: [ - "admin", - "noscript", - "loading", - "stale", - "no_multi", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sinter: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sintercard: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sinterstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sismember: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - slaveof: { - arity: 3, - flags: [ - "admin", - "noscript", - "stale", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - slowlog: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - smembers: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - smismember: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - smove: { - arity: 4, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - sort: { - arity: -2, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sort_ro: { - arity: -2, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - spop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - spublish: { - arity: 3, - flags: [ - "pubsub", - "loading", - "stale", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - srandmember: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - srem: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - ssubscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - strlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - subscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - substr: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sunion: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sunionstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sunsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - swapdb: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sync: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - time: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - touch: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - ttl: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - type: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - unlink: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - unsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - unwatch: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - wait: { - arity: 3, - flags: [ - "noscript" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - watch: { - arity: -2, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - xack: { - arity: -4, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xadd: { - arity: -5, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xautoclaim: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xclaim: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xdel: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xdelex: { - arity: -5, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xgroup: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xinfo: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xpending: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xread: { - arity: -4, - flags: [ - "readonly", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xreadgroup: { - arity: -7, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xrevrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xsetid: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xtrim: { - arity: -4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zadd: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zcard: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zcount: { - arity: 4, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zdiff: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zdiffstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zincrby: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zinter: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zintercard: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zinterstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zlexcount: { - arity: 4, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zmpop: { - arity: -4, - flags: [ - "write", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zmscore: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zpopmax: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zpopmin: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrandmember: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangebylex: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangebyscore: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangestore: { - arity: -5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - zrank: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrem: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebylex: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebyrank: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebyscore: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrangebylex: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrangebyscore: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrank: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zscore: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zunion: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zunionstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - } - }; - } -}); - -// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js -var require_built = __commonJS({ - "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js"(exports2) { - "use strict"; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getKeyIndexes = exports2.hasFlag = exports2.exists = exports2.list = void 0; - var commands_json_1 = __importDefault(require_commands()); - exports2.list = Object.keys(commands_json_1.default); - var flags = {}; - exports2.list.forEach((commandName) => { - flags[commandName] = commands_json_1.default[commandName].flags.reduce(function(flags2, flag) { - flags2[flag] = true; - return flags2; - }, {}); - }); - function exists(commandName) { - return Boolean(commands_json_1.default[commandName]); - } - exports2.exists = exists; - function hasFlag(commandName, flag) { - if (!flags[commandName]) { - throw new Error("Unknown command " + commandName); - } - return Boolean(flags[commandName][flag]); - } - exports2.hasFlag = hasFlag; - function getKeyIndexes(commandName, args, options) { - const command = commands_json_1.default[commandName]; - if (!command) { - throw new Error("Unknown command " + commandName); - } - if (!Array.isArray(args)) { - throw new Error("Expect args to be an array"); - } - const keys = []; - const parseExternalKey = Boolean(options && options.parseExternalKey); - const takeDynamicKeys = (args2, startIndex) => { - const keys2 = []; - const keyStop = Number(args2[startIndex]); - for (let i = 0; i < keyStop; i++) { - keys2.push(i + startIndex + 1); - } - return keys2; - }; - const takeKeyAfterToken = (args2, startIndex, token) => { - for (let i = startIndex; i < args2.length - 1; i += 1) { - if (String(args2[i]).toLowerCase() === token.toLowerCase()) { - return i + 1; - } - } - return null; - }; - switch (commandName) { - case "zunionstore": - case "zinterstore": - case "zdiffstore": - keys.push(0, ...takeDynamicKeys(args, 1)); - break; - case "eval": - case "evalsha": - case "eval_ro": - case "evalsha_ro": - case "fcall": - case "fcall_ro": - case "blmpop": - case "bzmpop": - keys.push(...takeDynamicKeys(args, 1)); - break; - case "sintercard": - case "lmpop": - case "zunion": - case "zinter": - case "zmpop": - case "zintercard": - case "zdiff": { - keys.push(...takeDynamicKeys(args, 0)); - break; - } - case "georadius": { - keys.push(0); - const storeKey = takeKeyAfterToken(args, 5, "STORE"); - if (storeKey) - keys.push(storeKey); - const distKey = takeKeyAfterToken(args, 5, "STOREDIST"); - if (distKey) - keys.push(distKey); - break; - } - case "georadiusbymember": { - keys.push(0); - const storeKey = takeKeyAfterToken(args, 4, "STORE"); - if (storeKey) - keys.push(storeKey); - const distKey = takeKeyAfterToken(args, 4, "STOREDIST"); - if (distKey) - keys.push(distKey); - break; - } - case "sort": - case "sort_ro": - keys.push(0); - for (let i = 1; i < args.length - 1; i++) { - let arg = args[i]; - if (typeof arg !== "string") { - continue; - } - const directive = arg.toUpperCase(); - if (directive === "GET") { - i += 1; - arg = args[i]; - if (arg !== "#") { - if (parseExternalKey) { - keys.push([i, getExternalKeyNameLength(arg)]); - } else { - keys.push(i); - } - } - } else if (directive === "BY") { - i += 1; - if (parseExternalKey) { - keys.push([i, getExternalKeyNameLength(args[i])]); - } else { - keys.push(i); - } - } else if (directive === "STORE") { - i += 1; - keys.push(i); - } - } - break; - case "migrate": - if (args[2] === "") { - for (let i = 5; i < args.length - 1; i++) { - const arg = args[i]; - if (typeof arg === "string" && arg.toUpperCase() === "KEYS") { - for (let j = i + 1; j < args.length; j++) { - keys.push(j); - } - break; - } - } - } else { - keys.push(2); - } - break; - case "xreadgroup": - case "xread": - for (let i = commandName === "xread" ? 0 : 3; i < args.length - 1; i++) { - if (String(args[i]).toUpperCase() === "STREAMS") { - for (let j = i + 1; j <= i + (args.length - 1 - i) / 2; j++) { - keys.push(j); - } - break; - } - } - break; - default: - if (command.step > 0) { - const keyStart = command.keyStart - 1; - const keyStop = command.keyStop > 0 ? command.keyStop : args.length + command.keyStop + 1; - for (let i = keyStart; i < keyStop; i += command.step) { - keys.push(i); - } - } - break; - } - return keys; - } - exports2.getKeyIndexes = getKeyIndexes; - function getExternalKeyNameLength(key) { - if (typeof key !== "string") { - key = String(key); - } - const hashPos = key.indexOf("->"); - return hashPos === -1 ? key.length : hashPos; - } - } -}); - -// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js -var require_utils = __commonJS({ - "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tryCatch = exports2.errorObj = void 0; - exports2.errorObj = { e: {} }; - var tryCatchTarget; - function tryCatcher(err, val) { - try { - const target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - exports2.errorObj.e = e; - return exports2.errorObj; - } - } - function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; - } - exports2.tryCatch = tryCatch; - } -}); - -// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js -var require_built2 = __commonJS({ - "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils(); - function throwLater(e) { - setTimeout(function() { - throw e; - }, 0); - } - function asCallback(promise, nodeback, options) { - if (typeof nodeback === "function") { - promise.then((val) => { - let ret; - if (options !== void 0 && Object(options).spread && Array.isArray(val)) { - ret = utils_1.tryCatch(nodeback).apply(void 0, [null].concat(val)); - } else { - ret = val === void 0 ? utils_1.tryCatch(nodeback)(null) : utils_1.tryCatch(nodeback)(null, val); - } - if (ret === utils_1.errorObj) { - throwLater(ret.e); - } - }, (cause) => { - if (!cause) { - const newReason = new Error(cause + ""); - Object.assign(newReason, { cause }); - cause = newReason; - } - const ret = utils_1.tryCatch(nodeback)(cause); - if (ret === utils_1.errorObj) { - throwLater(ret.e); - } - }); - } - return promise; - } - exports2.default = asCallback; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js -var require_old = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js"(exports2, module2) { - "use strict"; - var assert = require("assert"); - var util = require("util"); - function RedisError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(RedisError, Error); - Object.defineProperty(RedisError.prototype, "name", { - value: "RedisError", - configurable: true, - writable: true - }); - function ParserError(message, buffer, offset) { - assert(buffer); - assert.strictEqual(typeof offset, "number"); - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - Error.captureStackTrace(this, this.constructor); - Error.stackTraceLimit = tmp; - this.offset = offset; - this.buffer = buffer; - } - util.inherits(ParserError, RedisError); - Object.defineProperty(ParserError.prototype, "name", { - value: "ParserError", - configurable: true, - writable: true - }); - function ReplyError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - Error.captureStackTrace(this, this.constructor); - Error.stackTraceLimit = tmp; - } - util.inherits(ReplyError, RedisError); - Object.defineProperty(ReplyError.prototype, "name", { - value: "ReplyError", - configurable: true, - writable: true - }); - function AbortError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(AbortError, RedisError); - Object.defineProperty(AbortError.prototype, "name", { - value: "AbortError", - configurable: true, - writable: true - }); - function InterruptError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(InterruptError, AbortError); - Object.defineProperty(InterruptError.prototype, "name", { - value: "InterruptError", - configurable: true, - writable: true - }); - module2.exports = { - RedisError, - ParserError, - ReplyError, - AbortError, - InterruptError - }; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js -var require_modern = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js"(exports2, module2) { - "use strict"; - var assert = require("assert"); - var RedisError = class extends Error { - get name() { - return this.constructor.name; - } - }; - var ParserError = class extends RedisError { - constructor(message, buffer, offset) { - assert(buffer); - assert.strictEqual(typeof offset, "number"); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - super(message); - Error.stackTraceLimit = tmp; - this.offset = offset; - this.buffer = buffer; - } - get name() { - return this.constructor.name; - } - }; - var ReplyError = class extends RedisError { - constructor(message) { - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - super(message); - Error.stackTraceLimit = tmp; - } - get name() { - return this.constructor.name; - } - }; - var AbortError = class extends RedisError { - get name() { - return this.constructor.name; - } - }; - var InterruptError = class extends AbortError { - get name() { - return this.constructor.name; - } - }; - module2.exports = { - RedisError, - ParserError, - ReplyError, - AbortError, - InterruptError - }; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js -var require_redis_errors = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js"(exports2, module2) { - "use strict"; - var Errors = process.version.charCodeAt(1) < 55 && process.version.charCodeAt(2) === 46 ? require_old() : require_modern(); - module2.exports = Errors; - } -}); - -// node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js -var require_lib = __commonJS({ - "node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js"(exports2, module2) { - var lookup = [ - 0, - 4129, - 8258, - 12387, - 16516, - 20645, - 24774, - 28903, - 33032, - 37161, - 41290, - 45419, - 49548, - 53677, - 57806, - 61935, - 4657, - 528, - 12915, - 8786, - 21173, - 17044, - 29431, - 25302, - 37689, - 33560, - 45947, - 41818, - 54205, - 50076, - 62463, - 58334, - 9314, - 13379, - 1056, - 5121, - 25830, - 29895, - 17572, - 21637, - 42346, - 46411, - 34088, - 38153, - 58862, - 62927, - 50604, - 54669, - 13907, - 9842, - 5649, - 1584, - 30423, - 26358, - 22165, - 18100, - 46939, - 42874, - 38681, - 34616, - 63455, - 59390, - 55197, - 51132, - 18628, - 22757, - 26758, - 30887, - 2112, - 6241, - 10242, - 14371, - 51660, - 55789, - 59790, - 63919, - 35144, - 39273, - 43274, - 47403, - 23285, - 19156, - 31415, - 27286, - 6769, - 2640, - 14899, - 10770, - 56317, - 52188, - 64447, - 60318, - 39801, - 35672, - 47931, - 43802, - 27814, - 31879, - 19684, - 23749, - 11298, - 15363, - 3168, - 7233, - 60846, - 64911, - 52716, - 56781, - 44330, - 48395, - 36200, - 40265, - 32407, - 28342, - 24277, - 20212, - 15891, - 11826, - 7761, - 3696, - 65439, - 61374, - 57309, - 53244, - 48923, - 44858, - 40793, - 36728, - 37256, - 33193, - 45514, - 41451, - 53516, - 49453, - 61774, - 57711, - 4224, - 161, - 12482, - 8419, - 20484, - 16421, - 28742, - 24679, - 33721, - 37784, - 41979, - 46042, - 49981, - 54044, - 58239, - 62302, - 689, - 4752, - 8947, - 13010, - 16949, - 21012, - 25207, - 29270, - 46570, - 42443, - 38312, - 34185, - 62830, - 58703, - 54572, - 50445, - 13538, - 9411, - 5280, - 1153, - 29798, - 25671, - 21540, - 17413, - 42971, - 47098, - 34713, - 38840, - 59231, - 63358, - 50973, - 55100, - 9939, - 14066, - 1681, - 5808, - 26199, - 30326, - 17941, - 22068, - 55628, - 51565, - 63758, - 59695, - 39368, - 35305, - 47498, - 43435, - 22596, - 18533, - 30726, - 26663, - 6336, - 2273, - 14466, - 10403, - 52093, - 56156, - 60223, - 64286, - 35833, - 39896, - 43963, - 48026, - 19061, - 23124, - 27191, - 31254, - 2801, - 6864, - 10931, - 14994, - 64814, - 60687, - 56684, - 52557, - 48554, - 44427, - 40424, - 36297, - 31782, - 27655, - 23652, - 19525, - 15522, - 11395, - 7392, - 3265, - 61215, - 65342, - 53085, - 57212, - 44955, - 49082, - 36825, - 40952, - 28183, - 32310, - 20053, - 24180, - 11923, - 16050, - 3793, - 7920 - ]; - var toUTF8Array = function toUTF8Array2(str) { - var char; - var i = 0; - var p = 0; - var utf8 = []; - var len = str.length; - for (; i < len; i++) { - char = str.charCodeAt(i); - if (char < 128) { - utf8[p++] = char; - } else if (char < 2048) { - utf8[p++] = char >> 6 | 192; - utf8[p++] = char & 63 | 128; - } else if ((char & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) { - char = 65536 + ((char & 1023) << 10) + (str.charCodeAt(++i) & 1023); - utf8[p++] = char >> 18 | 240; - utf8[p++] = char >> 12 & 63 | 128; - utf8[p++] = char >> 6 & 63 | 128; - utf8[p++] = char & 63 | 128; - } else { - utf8[p++] = char >> 12 | 224; - utf8[p++] = char >> 6 & 63 | 128; - utf8[p++] = char & 63 | 128; - } - } - return utf8; - }; - var generate = module2.exports = function generate2(str) { - var char; - var i = 0; - var start = -1; - var result = 0; - var resultHash = 0; - var utf8 = typeof str === "string" ? toUTF8Array(str) : str; - var len = utf8.length; - while (i < len) { - char = utf8[i++]; - if (start === -1) { - if (char === 123) { - start = i; - } - } else if (char !== 125) { - resultHash = lookup[(char ^ resultHash >> 8) & 255] ^ resultHash << 8; - } else if (i - 1 !== start) { - return resultHash & 16383; - } - result = lookup[(char ^ result >> 8) & 255] ^ result << 8; - } - return result & 16383; - }; - module2.exports.generateMulti = function generateMulti(keys) { - var i = 1; - var len = keys.length; - var base = generate(keys[0]); - while (i < len) { - if (generate(keys[i++]) !== base) return -1; - } - return base; - }; - } -}); - -// node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js -var require_lodash = __commonJS({ - "node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - var argsTag = "[object Arguments]"; - var funcTag = "[object Function]"; - var genTag = "[object GeneratorFunction]"; - var reIsUint = /^(?:0|[1-9]\d*)$/; - function apply(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - function baseTimes(n, iteratee) { - var index = -1, result = Array(n); - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var objectToString = objectProto.toString; - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - var nativeMax = Math.max; - function arrayLikeKeys(value, inherited) { - var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; - var length = result.length, skipIndexes = !!length; - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { - result.push(key); - } - } - return result; - } - function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === void 0 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { - return srcValue; - } - return objValue; - } - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) { - object[key] = value; - } - } - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), result = []; - for (var key in object) { - if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - function baseRest(func, start) { - start = nativeMax(start === void 0 ? func.length - 1 : start, 0); - return function() { - var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; - } - function copyObject(source, props, object, customizer) { - object || (object = {}); - var index = -1, length = props.length; - while (++index < length) { - var key = props[index]; - var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; - assignValue(object, key, newValue === void 0 ? source[key] : newValue); - } - return object; - } - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0; - customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? void 0 : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); - } - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { - return eq(object[index], value); - } - return false; - } - function isPrototype(value) { - var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; - return value === proto; - } - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - function eq(value, other) { - return value === other || value !== value && other !== other; - } - function isArguments(value) { - return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); - } - var isArray = Array.isArray; - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - function isFunction(value) { - var tag = isObject(value) ? objectToString.call(value) : ""; - return tag == funcTag || tag == genTag; - } - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - function isObject(value) { - var type = typeof value; - return !!value && (type == "object" || type == "function"); - } - function isObjectLike(value) { - return !!value && typeof value == "object"; - } - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - var defaults = baseRest(function(args) { - args.push(void 0, assignInDefaults); - return apply(assignInWith, void 0, args); - }); - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - module2.exports = defaults; - } -}); - -// node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js -var require_lodash2 = __commonJS({ - "node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - var argsTag = "[object Arguments]"; - var funcTag = "[object Function]"; - var genTag = "[object GeneratorFunction]"; - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var objectToString = objectProto.toString; - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - function isArguments(value) { - return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); - } - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - function isFunction(value) { - var tag = isObject(value) ? objectToString.call(value) : ""; - return tag == funcTag || tag == genTag; - } - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - function isObject(value) { - var type = typeof value; - return !!value && (type == "object" || type == "function"); - } - function isObjectLike(value) { - return !!value && typeof value == "object"; - } - module2.exports = isArguments; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js -var require_lodash3 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isArguments = exports2.defaults = exports2.noop = void 0; - var defaults = require_lodash(); - exports2.defaults = defaults; - var isArguments = require_lodash2(); - exports2.isArguments = isArguments; - function noop() { - } - exports2.noop = noop; - } -}); - -// node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports2, module2) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self2 = debug; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns of split) { - if (ns[0] === "-") { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { - if (template[templateIndex] === "*") { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; - } - } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; - } - return templateIndex === template.length; - } - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - return false; - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports2, module2) { - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = /* @__PURE__ */ (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os2 = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.destroy = util.deprecate( - () => { - }, - "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." - ); - exports2.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports2.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports2.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} \x1B[0m`; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; - } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init(debug) { - debug.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports2, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js -var require_debug = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.genRedactedString = exports2.getStringValue = exports2.MAX_ARGUMENT_LENGTH = void 0; - var debug_1 = require_src(); - var MAX_ARGUMENT_LENGTH = 200; - exports2.MAX_ARGUMENT_LENGTH = MAX_ARGUMENT_LENGTH; - var NAMESPACE_PREFIX = "ioredis"; - function getStringValue(v) { - if (v === null) { - return; - } - switch (typeof v) { - case "boolean": - return; - case "number": - return; - case "object": - if (Buffer.isBuffer(v)) { - return v.toString("hex"); - } - if (Array.isArray(v)) { - return v.join(","); - } - try { - return JSON.stringify(v); - } catch (e) { - return; - } - case "string": - return v; - } - } - exports2.getStringValue = getStringValue; - function genRedactedString(str, maxLen) { - const { length } = str; - return length <= maxLen ? str : str.slice(0, maxLen) + ' ... '; - } - exports2.genRedactedString = genRedactedString; - function genDebugFunction(namespace) { - const fn = (0, debug_1.default)(`${NAMESPACE_PREFIX}:${namespace}`); - function wrappedDebug(...args) { - if (!fn.enabled) { - return; - } - for (let i = 1; i < args.length; i++) { - const str = getStringValue(args[i]); - if (typeof str === "string" && str.length > MAX_ARGUMENT_LENGTH) { - args[i] = genRedactedString(str, MAX_ARGUMENT_LENGTH); - } - } - return fn.apply(null, args); - } - Object.defineProperties(wrappedDebug, { - namespace: { - get() { - return fn.namespace; - } - }, - enabled: { - get() { - return fn.enabled; - } - }, - destroy: { - get() { - return fn.destroy; - } - }, - log: { - get() { - return fn.log; - }, - set(l) { - fn.log = l; - } - } - }); - return wrappedDebug; - } - exports2.default = genDebugFunction; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js -var require_TLSProfiles = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var RedisCloudCA = `-----BEGIN CERTIFICATE----- -MIIDTzCCAjegAwIBAgIJAKSVpiDswLcwMA0GCSqGSIb3DQEBBQUAMD4xFjAUBgNV -BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTAeFw0xMzEwMDExMjE0NTVaFw0yMzA5MjkxMjE0NTVaMD4xFjAUBgNV -BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALZqkh/DczWP -JnxnHLQ7QL0T4B4CDKWBKCcisriGbA6ZePWVNo4hfKQC6JrzfR+081NeD6VcWUiz -rmd+jtPhIY4c+WVQYm5PKaN6DT1imYdxQw7aqO5j2KUCEh/cznpLxeSHoTxlR34E -QwF28Wl3eg2vc5ct8LjU3eozWVk3gb7alx9mSA2SgmuX5lEQawl++rSjsBStemY2 -BDwOpAMXIrdEyP/cVn8mkvi/BDs5M5G+09j0gfhyCzRWMQ7Hn71u1eolRxwVxgi3 -TMn+/vTaFSqxKjgck6zuAYjBRPaHe7qLxHNr1So/Mc9nPy+3wHebFwbIcnUojwbp -4nctkWbjb2cCAwEAAaNQME4wHQYDVR0OBBYEFP1whtcrydmW3ZJeuSoKZIKjze3w -MB8GA1UdIwQYMBaAFP1whtcrydmW3ZJeuSoKZIKjze3wMAwGA1UdEwQFMAMBAf8w -DQYJKoZIhvcNAQEFBQADggEBAG2erXhwRAa7+ZOBs0B6X57Hwyd1R4kfmXcs0rta -lbPpvgULSiB+TCbf3EbhJnHGyvdCY1tvlffLjdA7HJ0PCOn+YYLBA0pTU/dyvrN6 -Su8NuS5yubnt9mb13nDGYo1rnt0YRfxN+8DM3fXIVr038A30UlPX2Ou1ExFJT0MZ -uFKY6ZvLdI6/1cbgmguMlAhM+DhKyV6Sr5699LM3zqeI816pZmlREETYkGr91q7k -BpXJu/dtHaGxg1ZGu6w/PCsYGUcECWENYD4VQPd8N32JjOfu6vEgoEAwfPP+3oGp -Z4m3ewACcWOAenqflb+cQYC4PsF7qbXDmRaWrbKntOlZ3n0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGMTCCBBmgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwajELMAkGA1UEBhMCVVMx -CzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJzMS0w -KwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN -MTgwMjI1MTUzNzM3WhcNMjgwMjIzMTUzNzM3WjBfMQswCQYDVQQGEwJVUzELMAkG -A1UECAwCQ0ExEjAQBgNVBAoMCVJlZGlzTGFiczEvMC0GA1UEAwwmUkNQIEludGVy -bWVkaWF0ZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDf9dqbxc8Bq7Ctq9rWcxrGNKKHivqLAFpPq02yLPx6fsOv -Tq7GsDChAYBBc4v7Y2Ap9RD5Vs3dIhEANcnolf27QwrG9RMnnvzk8pCvp1o6zSU4 -VuOE1W66/O1/7e2rVxyrnTcP7UgK43zNIXu7+tiAqWsO92uSnuMoGPGpeaUm1jym -hjWKtkAwDFSqvHY+XL5qDVBEjeUe+WHkYUg40cAXjusAqgm2hZt29c2wnVrxW25W -P0meNlzHGFdA2AC5z54iRiqj57dTfBTkHoBczQxcyw6hhzxZQ4e5I5zOKjXXEhZN -r0tA3YC14CTabKRus/JmZieyZzRgEy2oti64tmLYTqSlAD78pRL40VNoaSYetXLw -hhNsXCHgWaY6d5bLOc/aIQMAV5oLvZQKvuXAF1IDmhPA+bZbpWipp0zagf1P1H3s -UzsMdn2KM0ejzgotbtNlj5TcrVwpmvE3ktvUAuA+hi3FkVx1US+2Gsp5x4YOzJ7u -P1WPk6ShF0JgnJH2ILdj6kttTWwFzH17keSFICWDfH/+kM+k7Y1v3EXMQXE7y0T9 -MjvJskz6d/nv+sQhY04xt64xFMGTnZjlJMzfQNi7zWFLTZnDD0lPowq7l3YiPoTT -t5Xky83lu0KZsZBo0WlWaDG00gLVdtRgVbcuSWxpi5BdLb1kRab66JptWjxwXQID -AQABo4HrMIHoMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHBzOi8vcmwtY2Etc2VydmVy -LnJlZGlzbGFicy5jb20vdjEvY3JsMEYGCCsGAQUFBwEBBDowODA2BggrBgEFBQcw -AYYqaHR0cHM6Ly9ybC1jYS1zZXJ2ZXIucmVkaXNsYWJzLmNvbS92MS9vY3NwMB0G -A1UdDgQWBBQHar5OKvQUpP2qWt6mckzToeCOHDAfBgNVHSMEGDAWgBQi42wH6hM4 -L2sujEvLM0/u8lRXTzASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIB -hjANBgkqhkiG9w0BAQsFAAOCAgEAirEn/iTsAKyhd+pu2W3Z5NjCko4NPU0EYUbr -AP7+POK2rzjIrJO3nFYQ/LLuC7KCXG+2qwan2SAOGmqWst13Y+WHp44Kae0kaChW -vcYLXXSoGQGC8QuFSNUdaeg3RbMDYFT04dOkqufeWVccoHVxyTSg9eD8LZuHn5jw -7QDLiEECBmIJHk5Eeo2TAZrx4Yx6ufSUX5HeVjlAzqwtAqdt99uCJ/EL8bgpWbe+ -XoSpvUv0SEC1I1dCAhCKAvRlIOA6VBcmzg5Am12KzkqTul12/VEFIgzqu0Zy2Jbc -AUPrYVu/+tOGXQaijy7YgwH8P8n3s7ZeUa1VABJHcxrxYduDDJBLZi+MjheUDaZ1 -jQRHYevI2tlqeSBqdPKG4zBY5lS0GiAlmuze5oENt0P3XboHoZPHiqcK3VECgTVh -/BkJcuudETSJcZDmQ8YfoKfBzRQNg2sv/hwvUv73Ss51Sco8GEt2lD8uEdib1Q6z -zDT5lXJowSzOD5ZA9OGDjnSRL+2riNtKWKEqvtEG3VBJoBzu9GoxbAc7wIZLxmli -iF5a/Zf5X+UXD3s4TMmy6C4QZJpAA2egsSQCnraWO2ULhh7iXMysSkF/nzVfZn43 -iqpaB8++9a37hWq14ZmOv0TJIDz//b2+KC4VFXWQ5W5QC6whsjT+OlG4p5ZYG0jo -616pxqo= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJAJ1aTT1lu2ScMA0GCSqGSIb3DQEBCwUAMGoxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCQ0ExEjAQBgNVBAoMCVJlZGlz -TGFiczEtMCsGA1UEAwwkUmVkaXNMYWJzIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y -aXR5MB4XDTE4MDIyNTE1MjA0MloXDTM4MDIyMDE1MjA0MlowajELMAkGA1UEBhMC -VVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJz -MS0wKwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw -ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDLEjXy7YrbN5Waau5cd6g1 -G5C2tMmeTpZ0duFAPxNU4oE3RHS5gGiok346fUXuUxbZ6QkuzeN2/2Z+RmRcJhQY -Dm0ZgdG4x59An1TJfnzKKoWj8ISmoHS/TGNBdFzXV7FYNLBuqZouqePI6ReC6Qhl -pp45huV32Q3a6IDrrvx7Wo5ZczEQeFNbCeCOQYNDdTmCyEkHqc2AGo8eoIlSTutT -ULOC7R5gzJVTS0e1hesQ7jmqHjbO+VQS1NAL4/5K6cuTEqUl+XhVhPdLWBXJQ5ag -54qhX4v+ojLzeU1R/Vc6NjMvVtptWY6JihpgplprN0Yh2556ewcXMeturcKgXfGJ -xeYzsjzXerEjrVocX5V8BNrg64NlifzTMKNOOv4fVZszq1SIHR8F9ROrqiOdh8iC -JpUbLpXH9hWCSEO6VRMB2xJoKu3cgl63kF30s77x7wLFMEHiwsQRKxooE1UhgS9K -2sO4TlQ1eWUvFvHSTVDQDlGQ6zu4qjbOpb3Q8bQwoK+ai2alkXVR4Ltxe9QlgYK3 -StsnPhruzZGA0wbXdpw0bnM+YdlEm5ffSTpNIfgHeaa7Dtb801FtA71ZlH7A6TaI -SIQuUST9EKmv7xrJyx0W1pGoPOLw5T029aTjnICSLdtV9bLwysrLhIYG5bnPq78B -cS+jZHFGzD7PUVGQD01nOQIDAQABo2MwYTAdBgNVHQ4EFgQUIuNsB+oTOC9rLoxL -yzNP7vJUV08wHwYDVR0jBBgwFoAUIuNsB+oTOC9rLoxLyzNP7vJUV08wDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBAHfg -z5pMNUAKdMzK1aS1EDdK9yKz4qicILz5czSLj1mC7HKDRy8cVADUxEICis++CsCu -rYOvyCVergHQLREcxPq4rc5Nq1uj6J6649NEeh4WazOOjL4ZfQ1jVznMbGy+fJm3 -3Hoelv6jWRG9iqeJZja7/1s6YC6bWymI/OY1e4wUKeNHAo+Vger7MlHV+RuabaX+ -hSJ8bJAM59NCM7AgMTQpJCncrcdLeceYniGy5Q/qt2b5mJkQVkIdy4TPGGB+AXDJ -D0q3I/JDRkDUFNFdeW0js7fHdsvCR7O3tJy5zIgEV/o/BCkmJVtuwPYOrw/yOlKj -TY/U7ATAx9VFF6/vYEOMYSmrZlFX+98L6nJtwDqfLB5VTltqZ4H/KBxGE3IRSt9l -FXy40U+LnXzhhW+7VBAvyYX8GEXhHkKU8Gqk1xitrqfBXY74xKgyUSTolFSfFVgj -mcM/X4K45bka+qpkj7Kfv/8D4j6aZekwhN2ly6hhC1SmQ8qjMjpG/mrWOSSHZFmf -ybu9iD2AYHeIOkshIl6xYIa++Q/00/vs46IzAbQyriOi0XxlSMMVtPx0Q3isp+ji -n8Mq9eOuxYOEQ4of8twUkUDd528iwGtEdwf0Q01UyT84S62N8AySl1ZBKXJz6W4F -UhWfa/HQYOAPDdEjNgnVwLI23b8t0TozyCWw7q8h ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEjzCCA3egAwIBAgIQe55B/ALCKJDZtdNT8kD6hTANBgkqhkiG9w0BAQsFADBM -MSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xv -YmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0yMjAxMjYxMjAwMDBaFw0y -NTAxMjYwMDAwMDBaMFgxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWdu -IG52LXNhMS4wLAYDVQQDEyVHbG9iYWxTaWduIEF0bGFzIFIzIE9WIFRMUyBDQSAy -MDIyIFEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmGmg1LW9b7Lf -8zDD83yBDTEkt+FOxKJZqF4veWc5KZsQj9HfnUS2e5nj/E+JImlGPsQuoiosLuXD -BVBNAMcUFa11buFMGMeEMwiTmCXoXRrXQmH0qjpOfKgYc5gHG3BsRGaRrf7VR4eg -ofNMG9wUBw4/g/TT7+bQJdA4NfE7Y4d5gEryZiBGB/swaX6Jp/8MF4TgUmOWmalK -dZCKyb4sPGQFRTtElk67F7vU+wdGcrcOx1tDcIB0ncjLPMnaFicagl+daWGsKqTh -counQb6QJtYHa91KvCfKWocMxQ7OIbB5UARLPmC4CJ1/f8YFm35ebfzAeULYdGXu -jE9CLor0OwIDAQABo4IBXzCCAVswDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQG -CCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQW -BBSH5Zq7a7B/t95GfJWkDBpA8HHqdjAfBgNVHSMEGDAWgBSP8Et/qC5FJK5NUPpj -move4t0bvDB7BggrBgEFBQcBAQRvMG0wLgYIKwYBBQUHMAGGImh0dHA6Ly9vY3Nw -Mi5nbG9iYWxzaWduLmNvbS9yb290cjMwOwYIKwYBBQUHMAKGL2h0dHA6Ly9zZWN1 -cmUuZ2xvYmFsc2lnbi5jb20vY2FjZXJ0L3Jvb3QtcjMuY3J0MDYGA1UdHwQvMC0w -K6ApoCeGJWh0dHA6Ly9jcmwuZ2xvYmFsc2lnbi5jb20vcm9vdC1yMy5jcmwwIQYD -VR0gBBowGDAIBgZngQwBAgIwDAYKKwYBBAGgMgoBAjANBgkqhkiG9w0BAQsFAAOC -AQEAKRic9/f+nmhQU/wz04APZLjgG5OgsuUOyUEZjKVhNGDwxGTvKhyXGGAMW2B/ -3bRi+aElpXwoxu3pL6fkElbX3B0BeS5LoDtxkyiVEBMZ8m+sXbocwlPyxrPbX6mY -0rVIvnuUeBH8X0L5IwfpNVvKnBIilTbcebfHyXkPezGwz7E1yhUULjJFm2bt0SdX -y+4X/WeiiYIv+fTVgZZgl+/2MKIsu/qdBJc3f3TvJ8nz+Eax1zgZmww+RSQWeOj3 -15Iw6Z5FX+NwzY/Ab+9PosR5UosSeq+9HhtaxZttXG1nVh+avYPGYddWmiMT90J5 -ZgKnO/Fx2hBgTxhOTMYaD312kg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 -MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 -RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT -gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm -KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd -QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ -XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o -LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU -RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp -jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK -6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX -mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs -Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH -WD9f ------END CERTIFICATE-----`; - var TLSProfiles = { - RedisCloudFixed: { ca: RedisCloudCA }, - RedisCloudFlexible: { ca: RedisCloudCA } - }; - exports2.default = TLSProfiles; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js -var require_utils2 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.noop = exports2.defaults = exports2.Debug = exports2.getPackageMeta = exports2.zipMap = exports2.CONNECTION_CLOSED_ERROR_MSG = exports2.shuffle = exports2.sample = exports2.resolveTLSProfile = exports2.parseURL = exports2.optimizeErrorStack = exports2.toArg = exports2.convertMapToArray = exports2.convertObjectToArray = exports2.timeout = exports2.packObject = exports2.isInt = exports2.wrapMultiResult = exports2.convertBufferToString = void 0; - var fs_1 = require("fs"); - var path_1 = require("path"); - var url_1 = require("url"); - var lodash_1 = require_lodash3(); - Object.defineProperty(exports2, "defaults", { enumerable: true, get: function() { - return lodash_1.defaults; - } }); - Object.defineProperty(exports2, "noop", { enumerable: true, get: function() { - return lodash_1.noop; - } }); - var debug_1 = require_debug(); - exports2.Debug = debug_1.default; - var TLSProfiles_1 = require_TLSProfiles(); - function convertBufferToString(value, encoding) { - if (value instanceof Buffer) { - return value.toString(encoding); - } - if (Array.isArray(value)) { - const length = value.length; - const res = Array(length); - for (let i = 0; i < length; ++i) { - res[i] = value[i] instanceof Buffer && encoding === "utf8" ? value[i].toString() : convertBufferToString(value[i], encoding); - } - return res; - } - return value; - } - exports2.convertBufferToString = convertBufferToString; - function wrapMultiResult(arr) { - if (!arr) { - return null; - } - const result = []; - const length = arr.length; - for (let i = 0; i < length; ++i) { - const item = arr[i]; - if (item instanceof Error) { - result.push([item]); - } else { - result.push([null, item]); - } - } - return result; - } - exports2.wrapMultiResult = wrapMultiResult; - function isInt(value) { - const x = parseFloat(value); - return !isNaN(value) && (x | 0) === x; - } - exports2.isInt = isInt; - function packObject(array) { - const result = {}; - const length = array.length; - for (let i = 1; i < length; i += 2) { - result[array[i - 1]] = array[i]; - } - return result; - } - exports2.packObject = packObject; - function timeout(callback, timeout2) { - let timer = null; - const run = function() { - if (timer) { - clearTimeout(timer); - timer = null; - callback.apply(this, arguments); - } - }; - timer = setTimeout(run, timeout2, new Error("timeout")); - return run; - } - exports2.timeout = timeout; - function convertObjectToArray(obj) { - const result = []; - const keys = Object.keys(obj); - for (let i = 0, l = keys.length; i < l; i++) { - result.push(keys[i], obj[keys[i]]); - } - return result; - } - exports2.convertObjectToArray = convertObjectToArray; - function convertMapToArray(map) { - const result = []; - let pos = 0; - map.forEach(function(value, key) { - result[pos] = key; - result[pos + 1] = value; - pos += 2; - }); - return result; - } - exports2.convertMapToArray = convertMapToArray; - function toArg(arg) { - if (arg === null || typeof arg === "undefined") { - return ""; - } - return String(arg); - } - exports2.toArg = toArg; - function optimizeErrorStack(error, friendlyStack, filterPath) { - const stacks = friendlyStack.split("\n"); - let lines = ""; - let i; - for (i = 1; i < stacks.length; ++i) { - if (stacks[i].indexOf(filterPath) === -1) { - break; - } - } - for (let j = i; j < stacks.length; ++j) { - lines += "\n" + stacks[j]; - } - if (error.stack) { - const pos = error.stack.indexOf("\n"); - error.stack = error.stack.slice(0, pos) + lines; - } - return error; - } - exports2.optimizeErrorStack = optimizeErrorStack; - function parseURL(url) { - if (isInt(url)) { - return { port: url }; - } - let parsed = (0, url_1.parse)(url, true, true); - if (!parsed.slashes && url[0] !== "/") { - url = "//" + url; - parsed = (0, url_1.parse)(url, true, true); - } - const options = parsed.query || {}; - const result = {}; - if (parsed.auth) { - const index = parsed.auth.indexOf(":"); - result.username = index === -1 ? parsed.auth : parsed.auth.slice(0, index); - result.password = index === -1 ? "" : parsed.auth.slice(index + 1); - } - if (parsed.pathname) { - if (parsed.protocol === "redis:" || parsed.protocol === "rediss:") { - if (parsed.pathname.length > 1) { - result.db = parsed.pathname.slice(1); - } - } else { - result.path = parsed.pathname; - } - } - if (parsed.host) { - result.host = parsed.hostname; - } - if (parsed.port) { - result.port = parsed.port; - } - if (typeof options.family === "string") { - const intFamily = Number.parseInt(options.family, 10); - if (!Number.isNaN(intFamily)) { - result.family = intFamily; - } - } - (0, lodash_1.defaults)(result, options); - return result; - } - exports2.parseURL = parseURL; - function resolveTLSProfile(options) { - let tls = options === null || options === void 0 ? void 0 : options.tls; - if (typeof tls === "string") - tls = { profile: tls }; - const profile = TLSProfiles_1.default[tls === null || tls === void 0 ? void 0 : tls.profile]; - if (profile) { - tls = Object.assign({}, profile, tls); - delete tls.profile; - options = Object.assign({}, options, { tls }); - } - return options; - } - exports2.resolveTLSProfile = resolveTLSProfile; - function sample(array, from = 0) { - const length = array.length; - if (from >= length) { - return null; - } - return array[from + Math.floor(Math.random() * (length - from))]; - } - exports2.sample = sample; - function shuffle(array) { - let counter = array.length; - while (counter > 0) { - const index = Math.floor(Math.random() * counter); - counter--; - [array[counter], array[index]] = [array[index], array[counter]]; - } - return array; - } - exports2.shuffle = shuffle; - exports2.CONNECTION_CLOSED_ERROR_MSG = "Connection is closed."; - function zipMap(keys, values) { - const map = /* @__PURE__ */ new Map(); - keys.forEach((key, index) => { - map.set(key, values[index]); - }); - return map; - } - exports2.zipMap = zipMap; - var cachedPackageMeta = null; - async function getPackageMeta() { - if (cachedPackageMeta) { - return cachedPackageMeta; - } - try { - const filePath = (0, path_1.resolve)(__dirname, "..", "..", "package.json"); - const data = await fs_1.promises.readFile(filePath, "utf8"); - const parsed = JSON.parse(data); - cachedPackageMeta = { - version: parsed.version - }; - return cachedPackageMeta; - } catch (err) { - cachedPackageMeta = { - version: "error-fetching-version" - }; - return cachedPackageMeta; - } - } - exports2.getPackageMeta = getPackageMeta; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js -var require_Command = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var calculateSlot = require_lib(); - var standard_as_callback_1 = require_built2(); - var utils_1 = require_utils2(); - var Command = class _Command { - /** - * Creates an instance of Command. - * @param name Command name - * @param args An array of command arguments - * @param options - * @param callback The callback that handles the response. - * If omit, the response will be handled via Promise - */ - constructor(name, args = [], options = {}, callback) { - this.name = name; - this.inTransaction = false; - this.isResolved = false; - this.transformed = false; - this.replyEncoding = options.replyEncoding; - this.errorStack = options.errorStack; - this.args = args.flat(); - this.callback = callback; - this.initPromise(); - if (options.keyPrefix) { - const isBufferKeyPrefix = options.keyPrefix instanceof Buffer; - let keyPrefixBuffer = isBufferKeyPrefix ? options.keyPrefix : null; - this._iterateKeys((key) => { - if (key instanceof Buffer) { - if (keyPrefixBuffer === null) { - keyPrefixBuffer = Buffer.from(options.keyPrefix); - } - return Buffer.concat([keyPrefixBuffer, key]); - } else if (isBufferKeyPrefix) { - return Buffer.concat([options.keyPrefix, Buffer.from(String(key))]); - } - return options.keyPrefix + key; - }); - } - if (options.readOnly) { - this.isReadOnly = true; - } - } - /** - * Check whether the command has the flag - */ - static checkFlag(flagName, commandName) { - return !!this.getFlagMap()[flagName][commandName]; - } - static setArgumentTransformer(name, func) { - this._transformer.argument[name] = func; - } - static setReplyTransformer(name, func) { - this._transformer.reply[name] = func; - } - static getFlagMap() { - if (!this.flagMap) { - this.flagMap = Object.keys(_Command.FLAGS).reduce((map, flagName) => { - map[flagName] = {}; - _Command.FLAGS[flagName].forEach((commandName) => { - map[flagName][commandName] = true; - }); - return map; - }, {}); - } - return this.flagMap; - } - getSlot() { - if (typeof this.slot === "undefined") { - const key = this.getKeys()[0]; - this.slot = key == null ? null : calculateSlot(key); - } - return this.slot; - } - getKeys() { - return this._iterateKeys(); - } - /** - * Convert command to writable buffer or string - */ - toWritable(_socket) { - let result; - const commandStr = "*" + (this.args.length + 1) + "\r\n$" + Buffer.byteLength(this.name) + "\r\n" + this.name + "\r\n"; - if (this.bufferMode) { - const buffers = new MixedBuffers(); - buffers.push(commandStr); - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - if (arg instanceof Buffer) { - if (arg.length === 0) { - buffers.push("$0\r\n\r\n"); - } else { - buffers.push("$" + arg.length + "\r\n"); - buffers.push(arg); - buffers.push("\r\n"); - } - } else { - buffers.push("$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"); - } - } - result = buffers.toBuffer(); - } else { - result = commandStr; - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - result += "$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"; - } - } - return result; - } - stringifyArguments() { - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - if (typeof arg === "string") { - } else if (arg instanceof Buffer) { - this.bufferMode = true; - } else { - this.args[i] = (0, utils_1.toArg)(arg); - } - } - } - /** - * Convert buffer/buffer[] to string/string[], - * and apply reply transformer. - */ - transformReply(result) { - if (this.replyEncoding) { - result = (0, utils_1.convertBufferToString)(result, this.replyEncoding); - } - const transformer = _Command._transformer.reply[this.name]; - if (transformer) { - result = transformer(result); - } - return result; - } - /** - * Set the wait time before terminating the attempt to execute a command - * and generating an error. - */ - setTimeout(ms) { - if (!this._commandTimeoutTimer) { - this._commandTimeoutTimer = setTimeout(() => { - if (!this.isResolved) { - this.reject(new Error("Command timed out")); - } - }, ms); - } - } - initPromise() { - const promise = new Promise((resolve2, reject) => { - if (!this.transformed) { - this.transformed = true; - const transformer = _Command._transformer.argument[this.name]; - if (transformer) { - this.args = transformer(this.args); - } - this.stringifyArguments(); - } - this.resolve = this._convertValue(resolve2); - if (this.errorStack) { - this.reject = (err) => { - reject((0, utils_1.optimizeErrorStack)(err, this.errorStack.stack, __dirname)); - }; - } else { - this.reject = reject; - } - }); - this.promise = (0, standard_as_callback_1.default)(promise, this.callback); - } - /** - * Iterate through the command arguments that are considered keys. - */ - _iterateKeys(transform = (key) => key) { - if (typeof this.keys === "undefined") { - this.keys = []; - if ((0, commands_1.exists)(this.name)) { - const keyIndexes = (0, commands_1.getKeyIndexes)(this.name, this.args); - for (const index of keyIndexes) { - this.args[index] = transform(this.args[index]); - this.keys.push(this.args[index]); - } - } - } - return this.keys; - } - /** - * Convert the value from buffer to the target encoding. - */ - _convertValue(resolve2) { - return (value) => { - try { - const existingTimer = this._commandTimeoutTimer; - if (existingTimer) { - clearTimeout(existingTimer); - delete this._commandTimeoutTimer; - } - resolve2(this.transformReply(value)); - this.isResolved = true; - } catch (err) { - this.reject(err); - } - return this.promise; - }; - } - }; - exports2.default = Command; - Command.FLAGS = { - VALID_IN_SUBSCRIBER_MODE: [ - "subscribe", - "psubscribe", - "unsubscribe", - "punsubscribe", - "ssubscribe", - "sunsubscribe", - "ping", - "quit" - ], - VALID_IN_MONITOR_MODE: ["monitor", "auth"], - ENTER_SUBSCRIBER_MODE: ["subscribe", "psubscribe", "ssubscribe"], - EXIT_SUBSCRIBER_MODE: ["unsubscribe", "punsubscribe", "sunsubscribe"], - WILL_DISCONNECT: ["quit"], - HANDSHAKE_COMMANDS: ["auth", "select", "client", "readonly", "info"], - IGNORE_RECONNECT_ON_ERROR: ["client"] - }; - Command._transformer = { - argument: {}, - reply: {} - }; - var msetArgumentTransformer = function(args) { - if (args.length === 1) { - if (args[0] instanceof Map) { - return (0, utils_1.convertMapToArray)(args[0]); - } - if (typeof args[0] === "object" && args[0] !== null) { - return (0, utils_1.convertObjectToArray)(args[0]); - } - } - return args; - }; - var hsetArgumentTransformer = function(args) { - if (args.length === 2) { - if (args[1] instanceof Map) { - return [args[0]].concat((0, utils_1.convertMapToArray)(args[1])); - } - if (typeof args[1] === "object" && args[1] !== null) { - return [args[0]].concat((0, utils_1.convertObjectToArray)(args[1])); - } - } - return args; - }; - Command.setArgumentTransformer("mset", msetArgumentTransformer); - Command.setArgumentTransformer("msetnx", msetArgumentTransformer); - Command.setArgumentTransformer("hset", hsetArgumentTransformer); - Command.setArgumentTransformer("hmset", hsetArgumentTransformer); - Command.setReplyTransformer("hgetall", function(result) { - if (Array.isArray(result)) { - const obj = {}; - for (let i = 0; i < result.length; i += 2) { - const key = result[i]; - const value = result[i + 1]; - if (key in obj) { - Object.defineProperty(obj, key, { - value, - configurable: true, - enumerable: true, - writable: true - }); - } else { - obj[key] = value; - } - } - return obj; - } - return result; - }); - var MixedBuffers = class { - constructor() { - this.length = 0; - this.items = []; - } - push(x) { - this.length += Buffer.byteLength(x); - this.items.push(x); - } - toBuffer() { - const result = Buffer.allocUnsafe(this.length); - let offset = 0; - for (const item of this.items) { - const length = Buffer.byteLength(item); - Buffer.isBuffer(item) ? item.copy(result, offset) : result.write(item, offset, length); - offset += length; - } - return result; - } - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js -var require_ClusterAllFailedError = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var redis_errors_1 = require_redis_errors(); - var ClusterAllFailedError = class extends redis_errors_1.RedisError { - constructor(message, lastNodeError) { - super(message); - this.lastNodeError = lastNodeError; - Error.captureStackTrace(this, this.constructor); - } - get name() { - return this.constructor.name; - } - }; - exports2.default = ClusterAllFailedError; - ClusterAllFailedError.defaultMessage = "Failed to refresh slots cache."; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js -var require_ScanStream = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var stream_1 = require("stream"); - var ScanStream = class extends stream_1.Readable { - constructor(opt) { - super(opt); - this.opt = opt; - this._redisCursor = "0"; - this._redisDrained = false; - } - _read() { - if (this._redisDrained) { - this.push(null); - return; - } - const args = [this._redisCursor]; - if (this.opt.key) { - args.unshift(this.opt.key); - } - if (this.opt.match) { - args.push("MATCH", this.opt.match); - } - if (this.opt.type) { - args.push("TYPE", this.opt.type); - } - if (this.opt.count) { - args.push("COUNT", String(this.opt.count)); - } - if (this.opt.noValues) { - args.push("NOVALUES"); - } - this.opt.redis[this.opt.command](args, (err, res) => { - if (err) { - this.emit("error", err); - return; - } - this._redisCursor = res[0] instanceof Buffer ? res[0].toString() : res[0]; - if (this._redisCursor === "0") { - this._redisDrained = true; - } - this.push(res[1]); - }); - } - close() { - this._redisDrained = true; - } - }; - exports2.default = ScanStream; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js -var require_autoPipelining = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.executeWithAutoPipelining = exports2.getFirstValueInFlattenedArray = exports2.shouldUseAutoPipelining = exports2.notAllowedAutoPipelineCommands = exports2.kCallbacks = exports2.kExec = void 0; - var lodash_1 = require_lodash3(); - var calculateSlot = require_lib(); - var standard_as_callback_1 = require_built2(); - exports2.kExec = Symbol("exec"); - exports2.kCallbacks = Symbol("callbacks"); - exports2.notAllowedAutoPipelineCommands = [ - "auth", - "info", - "script", - "quit", - "cluster", - "pipeline", - "multi", - "subscribe", - "psubscribe", - "unsubscribe", - "unpsubscribe", - "select", - "client" - ]; - function executeAutoPipeline(client, slotKey) { - if (client._runningAutoPipelines.has(slotKey)) { - return; - } - if (!client._autoPipelines.has(slotKey)) { - return; - } - client._runningAutoPipelines.add(slotKey); - const pipeline = client._autoPipelines.get(slotKey); - client._autoPipelines.delete(slotKey); - const callbacks = pipeline[exports2.kCallbacks]; - pipeline[exports2.kCallbacks] = null; - pipeline.exec(function(err, results) { - client._runningAutoPipelines.delete(slotKey); - if (err) { - for (let i = 0; i < callbacks.length; i++) { - process.nextTick(callbacks[i], err); - } - } else { - for (let i = 0; i < callbacks.length; i++) { - process.nextTick(callbacks[i], ...results[i]); - } - } - if (client._autoPipelines.has(slotKey)) { - executeAutoPipeline(client, slotKey); - } - }); - } - function shouldUseAutoPipelining(client, functionName, commandName) { - return functionName && client.options.enableAutoPipelining && !client.isPipeline && !exports2.notAllowedAutoPipelineCommands.includes(commandName) && !client.options.autoPipeliningIgnoredCommands.includes(commandName); - } - exports2.shouldUseAutoPipelining = shouldUseAutoPipelining; - function getFirstValueInFlattenedArray(args) { - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - if (typeof arg === "string") { - return arg; - } else if (Array.isArray(arg) || (0, lodash_1.isArguments)(arg)) { - if (arg.length === 0) { - continue; - } - return arg[0]; - } - const flattened = [arg].flat(); - if (flattened.length > 0) { - return flattened[0]; - } - } - return void 0; - } - exports2.getFirstValueInFlattenedArray = getFirstValueInFlattenedArray; - function executeWithAutoPipelining(client, functionName, commandName, args, callback) { - if (client.isCluster && !client.slots.length) { - if (client.status === "wait") - client.connect().catch(lodash_1.noop); - return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { - client.delayUntilReady((err) => { - if (err) { - reject(err); - return; - } - executeWithAutoPipelining(client, functionName, commandName, args, null).then(resolve2, reject); - }); - }), callback); - } - const prefix = client.options.keyPrefix || ""; - const slotKey = client.isCluster ? client.slots[calculateSlot(`${prefix}${getFirstValueInFlattenedArray(args)}`)].join(",") : "main"; - if (!client._autoPipelines.has(slotKey)) { - const pipeline2 = client.pipeline(); - pipeline2[exports2.kExec] = false; - pipeline2[exports2.kCallbacks] = []; - client._autoPipelines.set(slotKey, pipeline2); - } - const pipeline = client._autoPipelines.get(slotKey); - if (!pipeline[exports2.kExec]) { - pipeline[exports2.kExec] = true; - setImmediate(executeAutoPipeline, client, slotKey); - } - const autoPipelinePromise = new Promise(function(resolve2, reject) { - pipeline[exports2.kCallbacks].push(function(err, value) { - if (err) { - reject(err); - return; - } - resolve2(value); - }); - if (functionName === "call") { - args.unshift(commandName); - } - pipeline[functionName](...args); - }); - return (0, standard_as_callback_1.default)(autoPipelinePromise, callback); - } - exports2.executeWithAutoPipelining = executeWithAutoPipelining; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js -var require_Script = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var crypto_1 = require("crypto"); - var Command_1 = require_Command(); - var standard_as_callback_1 = require_built2(); - var Script2 = class { - constructor(lua, numberOfKeys = null, keyPrefix = "", readOnly = false) { - this.lua = lua; - this.numberOfKeys = numberOfKeys; - this.keyPrefix = keyPrefix; - this.readOnly = readOnly; - this.sha = (0, crypto_1.createHash)("sha1").update(lua).digest("hex"); - const sha = this.sha; - const socketHasScriptLoaded = /* @__PURE__ */ new WeakSet(); - this.Command = class CustomScriptCommand extends Command_1.default { - toWritable(socket) { - const origReject = this.reject; - this.reject = (err) => { - if (err.message.indexOf("NOSCRIPT") !== -1) { - socketHasScriptLoaded.delete(socket); - } - origReject.call(this, err); - }; - if (!socketHasScriptLoaded.has(socket)) { - socketHasScriptLoaded.add(socket); - this.name = "eval"; - this.args[0] = lua; - } else if (this.name === "eval") { - this.name = "evalsha"; - this.args[0] = sha; - } - return super.toWritable(socket); - } - }; - } - execute(container, args, options, callback) { - if (typeof this.numberOfKeys === "number") { - args.unshift(this.numberOfKeys); - } - if (this.keyPrefix) { - options.keyPrefix = this.keyPrefix; - } - if (this.readOnly) { - options.readOnly = true; - } - const evalsha = new this.Command("evalsha", [this.sha, ...args], options); - evalsha.promise = evalsha.promise.catch((err) => { - if (err.message.indexOf("NOSCRIPT") === -1) { - throw err; - } - const resend = new this.Command("evalsha", [this.sha, ...args], options); - const client = container.isPipeline ? container.redis : container; - return client.sendCommand(resend); - }); - (0, standard_as_callback_1.default)(evalsha.promise, callback); - return container.sendCommand(evalsha); - } - }; - exports2.default = Script2; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js -var require_Commander = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var autoPipelining_1 = require_autoPipelining(); - var Command_1 = require_Command(); - var Script_1 = require_Script(); - var Commander = class { - constructor() { - this.options = {}; - this.scriptsSet = {}; - this.addedBuiltinSet = /* @__PURE__ */ new Set(); - } - /** - * Return supported builtin commands - */ - getBuiltinCommands() { - return commands.slice(0); - } - /** - * Create a builtin command - */ - createBuiltinCommand(commandName) { - return { - string: generateFunction(null, commandName, "utf8"), - buffer: generateFunction(null, commandName, null) - }; - } - /** - * Create add builtin command - */ - addBuiltinCommand(commandName) { - this.addedBuiltinSet.add(commandName); - this[commandName] = generateFunction(commandName, commandName, "utf8"); - this[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); - } - /** - * Define a custom command using lua script - */ - defineCommand(name, definition) { - const script = new Script_1.default(definition.lua, definition.numberOfKeys, this.options.keyPrefix, definition.readOnly); - this.scriptsSet[name] = script; - this[name] = generateScriptingFunction(name, name, script, "utf8"); - this[name + "Buffer"] = generateScriptingFunction(name + "Buffer", name, script, null); - } - /** - * @ignore - */ - sendCommand(command, stream, node) { - throw new Error('"sendCommand" is not implemented'); - } - }; - var commands = commands_1.list.filter((command) => command !== "monitor"); - commands.push("sentinel"); - commands.forEach(function(commandName) { - Commander.prototype[commandName] = generateFunction(commandName, commandName, "utf8"); - Commander.prototype[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); - }); - Commander.prototype.call = generateFunction("call", "utf8"); - Commander.prototype.callBuffer = generateFunction("callBuffer", null); - Commander.prototype.send_command = Commander.prototype.call; - function generateFunction(functionName, _commandName, _encoding) { - if (typeof _encoding === "undefined") { - _encoding = _commandName; - _commandName = null; - } - return function(...args) { - const commandName = _commandName || args.shift(); - let callback = args[args.length - 1]; - if (typeof callback === "function") { - args.pop(); - } else { - callback = void 0; - } - const options = { - errorStack: this.options.showFriendlyErrorStack ? new Error() : void 0, - keyPrefix: this.options.keyPrefix, - replyEncoding: _encoding - }; - if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { - return this.sendCommand( - // @ts-expect-error - new Command_1.default(commandName, args, options, callback) - ); - } - return (0, autoPipelining_1.executeWithAutoPipelining)( - this, - functionName, - commandName, - // @ts-expect-error - args, - callback - ); - }; - } - function generateScriptingFunction(functionName, commandName, script, encoding) { - return function(...args) { - const callback = typeof args[args.length - 1] === "function" ? args.pop() : void 0; - const options = { - replyEncoding: encoding - }; - if (this.options.showFriendlyErrorStack) { - options.errorStack = new Error(); - } - if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { - return script.execute(this, args, options, callback); - } - return (0, autoPipelining_1.executeWithAutoPipelining)(this, functionName, commandName, args, callback); - }; - } - exports2.default = Commander; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js -var require_Pipeline = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var calculateSlot = require_lib(); - var commands_1 = require_built(); - var standard_as_callback_1 = require_built2(); - var util_1 = require("util"); - var Command_1 = require_Command(); - var utils_1 = require_utils2(); - var Commander_1 = require_Commander(); - function generateMultiWithNodes(redis, keys) { - const slot = calculateSlot(keys[0]); - const target = redis._groupsBySlot[slot]; - for (let i = 1; i < keys.length; i++) { - if (redis._groupsBySlot[calculateSlot(keys[i])] !== target) { - return -1; - } - } - return slot; - } - var Pipeline = class extends Commander_1.default { - constructor(redis) { - super(); - this.redis = redis; - this.isPipeline = true; - this.replyPending = 0; - this._queue = []; - this._result = []; - this._transactions = 0; - this._shaToScript = {}; - this.isCluster = this.redis.constructor.name === "Cluster" || this.redis.isCluster; - this.options = redis.options; - Object.keys(redis.scriptsSet).forEach((name) => { - const script = redis.scriptsSet[name]; - this._shaToScript[script.sha] = script; - this[name] = redis[name]; - this[name + "Buffer"] = redis[name + "Buffer"]; - }); - redis.addedBuiltinSet.forEach((name) => { - this[name] = redis[name]; - this[name + "Buffer"] = redis[name + "Buffer"]; - }); - this.promise = new Promise((resolve2, reject) => { - this.resolve = resolve2; - this.reject = reject; - }); - const _this = this; - Object.defineProperty(this, "length", { - get: function() { - return _this._queue.length; - } - }); - } - fillResult(value, position) { - if (this._queue[position].name === "exec" && Array.isArray(value[1])) { - const execLength = value[1].length; - for (let i = 0; i < execLength; i++) { - if (value[1][i] instanceof Error) { - continue; - } - const cmd = this._queue[position - (execLength - i)]; - try { - value[1][i] = cmd.transformReply(value[1][i]); - } catch (err) { - value[1][i] = err; - } - } - } - this._result[position] = value; - if (--this.replyPending) { - return; - } - if (this.isCluster) { - let retriable = true; - let commonError; - for (let i = 0; i < this._result.length; ++i) { - const error = this._result[i][0]; - const command = this._queue[i]; - if (error) { - if (command.name === "exec" && error.message === "EXECABORT Transaction discarded because of previous errors.") { - continue; - } - if (!commonError) { - commonError = { - name: error.name, - message: error.message - }; - } else if (commonError.name !== error.name || commonError.message !== error.message) { - retriable = false; - break; - } - } else if (!command.inTransaction) { - const isReadOnly = (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); - if (!isReadOnly) { - retriable = false; - break; - } - } - } - if (commonError && retriable) { - const _this = this; - const errv = commonError.message.split(" "); - const queue = this._queue; - let inTransaction = false; - this._queue = []; - for (let i = 0; i < queue.length; ++i) { - if (errv[0] === "ASK" && !inTransaction && queue[i].name !== "asking" && (!queue[i - 1] || queue[i - 1].name !== "asking")) { - const asking = new Command_1.default("asking"); - asking.ignore = true; - this.sendCommand(asking); - } - queue[i].initPromise(); - this.sendCommand(queue[i]); - inTransaction = queue[i].inTransaction; - } - let matched = true; - if (typeof this.leftRedirections === "undefined") { - this.leftRedirections = {}; - } - const exec = function() { - _this.exec(); - }; - const cluster = this.redis; - cluster.handleError(commonError, this.leftRedirections, { - moved: function(_slot, key) { - _this.preferKey = key; - cluster.slots[errv[1]] = [key]; - cluster._groupsBySlot[errv[1]] = cluster._groupsIds[cluster.slots[errv[1]].join(";")]; - cluster.refreshSlotsCache(); - _this.exec(); - }, - ask: function(_slot, key) { - _this.preferKey = key; - _this.exec(); - }, - tryagain: exec, - clusterDown: exec, - connectionClosed: exec, - maxRedirections: () => { - matched = false; - }, - defaults: () => { - matched = false; - } - }); - if (matched) { - return; - } - } - } - let ignoredCount = 0; - for (let i = 0; i < this._queue.length - ignoredCount; ++i) { - if (this._queue[i + ignoredCount].ignore) { - ignoredCount += 1; - } - this._result[i] = this._result[i + ignoredCount]; - } - this.resolve(this._result.slice(0, this._result.length - ignoredCount)); - } - sendCommand(command) { - if (this._transactions > 0) { - command.inTransaction = true; - } - const position = this._queue.length; - command.pipelineIndex = position; - command.promise.then((result) => { - this.fillResult([null, result], position); - }).catch((error) => { - this.fillResult([error], position); - }); - this._queue.push(command); - return this; - } - addBatch(commands) { - let command, commandName, args; - for (let i = 0; i < commands.length; ++i) { - command = commands[i]; - commandName = command[0]; - args = command.slice(1); - this[commandName].apply(this, args); - } - return this; - } - }; - exports2.default = Pipeline; - var multi = Pipeline.prototype.multi; - Pipeline.prototype.multi = function() { - this._transactions += 1; - return multi.apply(this, arguments); - }; - var execBuffer = Pipeline.prototype.execBuffer; - Pipeline.prototype.execBuffer = (0, util_1.deprecate)(function() { - if (this._transactions > 0) { - this._transactions -= 1; - } - return execBuffer.apply(this, arguments); - }, "Pipeline#execBuffer: Use Pipeline#exec instead"); - Pipeline.prototype.exec = function(callback) { - if (this.isCluster && !this.redis.slots.length) { - if (this.redis.status === "wait") - this.redis.connect().catch(utils_1.noop); - if (callback && !this.nodeifiedPromise) { - this.nodeifiedPromise = true; - (0, standard_as_callback_1.default)(this.promise, callback); - } - this.redis.delayUntilReady((err) => { - if (err) { - this.reject(err); - return; - } - this.exec(callback); - }); - return this.promise; - } - if (this._transactions > 0) { - this._transactions -= 1; - return execBuffer.apply(this, arguments); - } - if (!this.nodeifiedPromise) { - this.nodeifiedPromise = true; - (0, standard_as_callback_1.default)(this.promise, callback); - } - if (!this._queue.length) { - this.resolve([]); - } - let pipelineSlot; - if (this.isCluster) { - const sampleKeys = []; - for (let i = 0; i < this._queue.length; i++) { - const keys = this._queue[i].getKeys(); - if (keys.length) { - sampleKeys.push(keys[0]); - } - if (keys.length && calculateSlot.generateMulti(keys) < 0) { - this.reject(new Error("All the keys in a pipeline command should belong to the same slot")); - return this.promise; - } - } - if (sampleKeys.length) { - pipelineSlot = generateMultiWithNodes(this.redis, sampleKeys); - if (pipelineSlot < 0) { - this.reject(new Error("All keys in the pipeline should belong to the same slots allocation group")); - return this.promise; - } - } else { - pipelineSlot = Math.random() * 16384 | 0; - } - } - const _this = this; - execPipeline(); - return this.promise; - function execPipeline() { - let writePending = _this.replyPending = _this._queue.length; - let node; - if (_this.isCluster) { - node = { - slot: pipelineSlot, - redis: _this.redis.connectionPool.nodes.all[_this.preferKey] - }; - } - let data = ""; - let buffers; - const stream = { - isPipeline: true, - destination: _this.isCluster ? node : { redis: _this.redis }, - write(writable) { - if (typeof writable !== "string") { - if (!buffers) { - buffers = []; - } - if (data) { - buffers.push(Buffer.from(data, "utf8")); - data = ""; - } - buffers.push(writable); - } else { - data += writable; - } - if (!--writePending) { - if (buffers) { - if (data) { - buffers.push(Buffer.from(data, "utf8")); - } - stream.destination.redis.stream.write(Buffer.concat(buffers)); - } else { - stream.destination.redis.stream.write(data); - } - writePending = _this._queue.length; - data = ""; - buffers = void 0; - } - } - }; - for (let i = 0; i < _this._queue.length; ++i) { - _this.redis.sendCommand(_this._queue[i], stream, node); - } - return _this.promise; - } - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js -var require_transaction = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.addTransactionSupport = void 0; - var utils_1 = require_utils2(); - var standard_as_callback_1 = require_built2(); - var Pipeline_1 = require_Pipeline(); - function addTransactionSupport(redis) { - redis.pipeline = function(commands) { - const pipeline = new Pipeline_1.default(this); - if (Array.isArray(commands)) { - pipeline.addBatch(commands); - } - return pipeline; - }; - const { multi } = redis; - redis.multi = function(commands, options) { - if (typeof options === "undefined" && !Array.isArray(commands)) { - options = commands; - commands = null; - } - if (options && options.pipeline === false) { - return multi.call(this); - } - const pipeline = new Pipeline_1.default(this); - pipeline.multi(); - if (Array.isArray(commands)) { - pipeline.addBatch(commands); - } - const exec2 = pipeline.exec; - pipeline.exec = function(callback) { - if (this.isCluster && !this.redis.slots.length) { - if (this.redis.status === "wait") - this.redis.connect().catch(utils_1.noop); - return (0, standard_as_callback_1.default)(new Promise((resolve2, reject) => { - this.redis.delayUntilReady((err) => { - if (err) { - reject(err); - return; - } - this.exec(pipeline).then(resolve2, reject); - }); - }), callback); - } - if (this._transactions > 0) { - exec2.call(pipeline); - } - if (this.nodeifiedPromise) { - return exec2.call(pipeline); - } - const promise = exec2.call(pipeline); - return (0, standard_as_callback_1.default)(promise.then(function(result) { - const execResult = result[result.length - 1]; - if (typeof execResult === "undefined") { - throw new Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it."); - } - if (execResult[0]) { - execResult[0].previousErrors = []; - for (let i = 0; i < result.length - 1; ++i) { - if (result[i][0]) { - execResult[0].previousErrors.push(result[i][0]); - } - } - throw execResult[0]; - } - return (0, utils_1.wrapMultiResult)(execResult[1]); - }), callback); - }; - const { execBuffer } = pipeline; - pipeline.execBuffer = function(callback) { - if (this._transactions > 0) { - execBuffer.call(pipeline); - } - return pipeline.exec(callback); - }; - return pipeline; - }; - const { exec } = redis; - redis.exec = function(callback) { - return (0, standard_as_callback_1.default)(exec.call(this).then(function(results) { - if (Array.isArray(results)) { - results = (0, utils_1.wrapMultiResult)(results); - } - return results; - }), callback); - }; - } - exports2.addTransactionSupport = addTransactionSupport; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js -var require_applyMixin = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function applyMixin(derivedConstructor, mixinConstructor) { - Object.getOwnPropertyNames(mixinConstructor.prototype).forEach((name) => { - Object.defineProperty(derivedConstructor.prototype, name, Object.getOwnPropertyDescriptor(mixinConstructor.prototype, name)); - }); - } - exports2.default = applyMixin; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js -var require_ClusterOptions = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_CLUSTER_OPTIONS = void 0; - var dns_1 = require("dns"); - exports2.DEFAULT_CLUSTER_OPTIONS = { - clusterRetryStrategy: (times) => Math.min(100 + times * 2, 2e3), - enableOfflineQueue: true, - enableReadyCheck: true, - scaleReads: "master", - maxRedirections: 16, - retryDelayOnMoved: 0, - retryDelayOnFailover: 100, - retryDelayOnClusterDown: 100, - retryDelayOnTryAgain: 100, - slotsRefreshTimeout: 1e3, - useSRVRecords: false, - resolveSrv: dns_1.resolveSrv, - dnsLookup: dns_1.lookup, - enableAutoPipelining: false, - autoPipeliningIgnoredCommands: [], - shardedSubscribers: false - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js -var require_util = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getConnectionName = exports2.weightSrvRecords = exports2.groupSrvRecords = exports2.getUniqueHostnamesFromOptions = exports2.normalizeNodeOptions = exports2.nodeKeyToRedisOptions = exports2.getNodeKey = void 0; - var utils_1 = require_utils2(); - var net_1 = require("net"); - function getNodeKey(node) { - node.port = node.port || 6379; - node.host = node.host || "127.0.0.1"; - return node.host + ":" + node.port; - } - exports2.getNodeKey = getNodeKey; - function nodeKeyToRedisOptions(nodeKey) { - const portIndex = nodeKey.lastIndexOf(":"); - if (portIndex === -1) { - throw new Error(`Invalid node key ${nodeKey}`); - } - return { - host: nodeKey.slice(0, portIndex), - port: Number(nodeKey.slice(portIndex + 1)) - }; - } - exports2.nodeKeyToRedisOptions = nodeKeyToRedisOptions; - function normalizeNodeOptions(nodes) { - return nodes.map((node) => { - const options = {}; - if (typeof node === "object") { - Object.assign(options, node); - } else if (typeof node === "string") { - Object.assign(options, (0, utils_1.parseURL)(node)); - } else if (typeof node === "number") { - options.port = node; - } else { - throw new Error("Invalid argument " + node); - } - if (typeof options.port === "string") { - options.port = parseInt(options.port, 10); - } - delete options.db; - if (!options.port) { - options.port = 6379; - } - if (!options.host) { - options.host = "127.0.0.1"; - } - return (0, utils_1.resolveTLSProfile)(options); - }); - } - exports2.normalizeNodeOptions = normalizeNodeOptions; - function getUniqueHostnamesFromOptions(nodes) { - const uniqueHostsMap = {}; - nodes.forEach((node) => { - uniqueHostsMap[node.host] = true; - }); - return Object.keys(uniqueHostsMap).filter((host) => !(0, net_1.isIP)(host)); - } - exports2.getUniqueHostnamesFromOptions = getUniqueHostnamesFromOptions; - function groupSrvRecords(records) { - const recordsByPriority = {}; - for (const record of records) { - if (!recordsByPriority.hasOwnProperty(record.priority)) { - recordsByPriority[record.priority] = { - totalWeight: record.weight, - records: [record] - }; - } else { - recordsByPriority[record.priority].totalWeight += record.weight; - recordsByPriority[record.priority].records.push(record); - } - } - return recordsByPriority; - } - exports2.groupSrvRecords = groupSrvRecords; - function weightSrvRecords(recordsGroup) { - if (recordsGroup.records.length === 1) { - recordsGroup.totalWeight = 0; - return recordsGroup.records.shift(); - } - const random = Math.floor(Math.random() * (recordsGroup.totalWeight + recordsGroup.records.length)); - let total = 0; - for (const [i, record] of recordsGroup.records.entries()) { - total += 1 + record.weight; - if (total > random) { - recordsGroup.totalWeight -= record.weight; - recordsGroup.records.splice(i, 1); - return record; - } - } - } - exports2.weightSrvRecords = weightSrvRecords; - function getConnectionName(component, nodeConnectionName) { - const prefix = `ioredis-cluster(${component})`; - return nodeConnectionName ? `${prefix}:${nodeConnectionName}` : prefix; - } - exports2.getConnectionName = getConnectionName; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js -var require_ClusterSubscriber = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var utils_1 = require_utils2(); - var Redis_1 = require_Redis(); - var debug = (0, utils_1.Debug)("cluster:subscriber"); - var ClusterSubscriber = class { - constructor(connectionPool, emitter, isSharded = false) { - this.connectionPool = connectionPool; - this.emitter = emitter; - this.isSharded = isSharded; - this.started = false; - this.subscriber = null; - this.slotRange = []; - this.onSubscriberEnd = () => { - if (!this.started) { - debug("subscriber has disconnected, but ClusterSubscriber is not started, so not reconnecting."); - return; - } - debug("subscriber has disconnected, selecting a new one..."); - this.selectSubscriber(); - }; - this.connectionPool.on("-node", (_, key) => { - if (!this.started || !this.subscriber) { - return; - } - if ((0, util_1.getNodeKey)(this.subscriber.options) === key) { - debug("subscriber has left, selecting a new one..."); - this.selectSubscriber(); - } - }); - this.connectionPool.on("+node", () => { - if (!this.started || this.subscriber) { - return; - } - debug("a new node is discovered and there is no subscriber, selecting a new one..."); - this.selectSubscriber(); - }); - } - getInstance() { - return this.subscriber; - } - /** - * Associate this subscriber to a specific slot range. - * - * Returns the range or an empty array if the slot range couldn't be associated. - * - * BTW: This is more for debugging and testing purposes. - * - * @param range - */ - associateSlotRange(range) { - if (this.isSharded) { - this.slotRange = range; - } - return this.slotRange; - } - start() { - this.started = true; - this.selectSubscriber(); - debug("started"); - } - stop() { - this.started = false; - if (this.subscriber) { - this.subscriber.disconnect(); - this.subscriber = null; - } - } - isStarted() { - return this.started; - } - selectSubscriber() { - const lastActiveSubscriber = this.lastActiveSubscriber; - if (lastActiveSubscriber) { - lastActiveSubscriber.off("end", this.onSubscriberEnd); - lastActiveSubscriber.disconnect(); - } - if (this.subscriber) { - this.subscriber.off("end", this.onSubscriberEnd); - this.subscriber.disconnect(); - } - const sampleNode = (0, utils_1.sample)(this.connectionPool.getNodes()); - if (!sampleNode) { - debug("selecting subscriber failed since there is no node discovered in the cluster yet"); - this.subscriber = null; - return; - } - const { options } = sampleNode; - debug("selected a subscriber %s:%s", options.host, options.port); - let connectionPrefix = "subscriber"; - if (this.isSharded) - connectionPrefix = "ssubscriber"; - this.subscriber = new Redis_1.default({ - port: options.port, - host: options.host, - username: options.username, - password: options.password, - enableReadyCheck: true, - connectionName: (0, util_1.getConnectionName)(connectionPrefix, options.connectionName), - lazyConnect: true, - tls: options.tls, - // Don't try to reconnect the subscriber connection. If the connection fails - // we will get an end event (handled below), at which point we'll pick a new - // node from the pool and try to connect to that as the subscriber connection. - retryStrategy: null - }); - this.subscriber.on("error", utils_1.noop); - this.subscriber.on("moved", () => { - this.emitter.emit("forceRefresh"); - }); - this.subscriber.once("end", this.onSubscriberEnd); - const previousChannels = { subscribe: [], psubscribe: [], ssubscribe: [] }; - if (lastActiveSubscriber) { - const condition = lastActiveSubscriber.condition || lastActiveSubscriber.prevCondition; - if (condition && condition.subscriber) { - previousChannels.subscribe = condition.subscriber.channels("subscribe"); - previousChannels.psubscribe = condition.subscriber.channels("psubscribe"); - previousChannels.ssubscribe = condition.subscriber.channels("ssubscribe"); - } - } - if (previousChannels.subscribe.length || previousChannels.psubscribe.length || previousChannels.ssubscribe.length) { - let pending = 0; - for (const type of ["subscribe", "psubscribe", "ssubscribe"]) { - const channels = previousChannels[type]; - if (channels.length == 0) { - continue; - } - debug("%s %d channels", type, channels.length); - if (type === "ssubscribe") { - for (const channel of channels) { - pending += 1; - this.subscriber[type](channel).then(() => { - if (!--pending) { - this.lastActiveSubscriber = this.subscriber; - } - }).catch(() => { - debug("failed to ssubscribe to channel: %s", channel); - }); - } - } else { - pending += 1; - this.subscriber[type](channels).then(() => { - if (!--pending) { - this.lastActiveSubscriber = this.subscriber; - } - }).catch(() => { - debug("failed to %s %d channels", type, channels.length); - }); - } - } - } else { - this.lastActiveSubscriber = this.subscriber; - } - for (const event of [ - "message", - "messageBuffer" - ]) { - this.subscriber.on(event, (arg1, arg2) => { - this.emitter.emit(event, arg1, arg2); - }); - } - for (const event of ["pmessage", "pmessageBuffer"]) { - this.subscriber.on(event, (arg1, arg2, arg3) => { - this.emitter.emit(event, arg1, arg2, arg3); - }); - } - if (this.isSharded == true) { - for (const event of [ - "smessage", - "smessageBuffer" - ]) { - this.subscriber.on(event, (arg1, arg2) => { - this.emitter.emit(event, arg1, arg2); - }); - } - } - } - }; - exports2.default = ClusterSubscriber; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js -var require_ConnectionPool = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var events_1 = require("events"); - var utils_1 = require_utils2(); - var util_1 = require_util(); - var Redis_1 = require_Redis(); - var debug = (0, utils_1.Debug)("cluster:connectionPool"); - var ConnectionPool = class extends events_1.EventEmitter { - constructor(redisOptions) { - super(); - this.redisOptions = redisOptions; - this.nodes = { - all: {}, - master: {}, - slave: {} - }; - this.specifiedOptions = {}; - } - getNodes(role = "all") { - const nodes = this.nodes[role]; - return Object.keys(nodes).map((key) => nodes[key]); - } - getInstanceByKey(key) { - return this.nodes.all[key]; - } - getSampleInstance(role) { - const keys = Object.keys(this.nodes[role]); - const sampleKey = (0, utils_1.sample)(keys); - return this.nodes[role][sampleKey]; - } - /** - * Add a master node to the pool - * @param node - */ - addMasterNode(node) { - const key = (0, util_1.getNodeKey)(node.options); - const redis = this.createRedisFromOptions(node, node.options.readOnly); - if (!node.options.readOnly) { - this.nodes.all[key] = redis; - this.nodes.master[key] = redis; - return true; - } - return false; - } - /** - * Creates a Redis connection instance from the node options - * @param node - * @param readOnly - */ - createRedisFromOptions(node, readOnly) { - const redis = new Redis_1.default((0, utils_1.defaults)({ - // Never try to reconnect when a node is lose, - // instead, waiting for a `MOVED` error and - // fetch the slots again. - retryStrategy: null, - // Offline queue should be enabled so that - // we don't need to wait for the `ready` event - // before sending commands to the node. - enableOfflineQueue: true, - readOnly - }, node, this.redisOptions, { lazyConnect: true })); - return redis; - } - /** - * Find or create a connection to the node - */ - findOrCreate(node, readOnly = false) { - const key = (0, util_1.getNodeKey)(node); - readOnly = Boolean(readOnly); - if (this.specifiedOptions[key]) { - Object.assign(node, this.specifiedOptions[key]); - } else { - this.specifiedOptions[key] = node; - } - let redis; - if (this.nodes.all[key]) { - redis = this.nodes.all[key]; - if (redis.options.readOnly !== readOnly) { - redis.options.readOnly = readOnly; - debug("Change role of %s to %s", key, readOnly ? "slave" : "master"); - redis[readOnly ? "readonly" : "readwrite"]().catch(utils_1.noop); - if (readOnly) { - delete this.nodes.master[key]; - this.nodes.slave[key] = redis; - } else { - delete this.nodes.slave[key]; - this.nodes.master[key] = redis; - } - } - } else { - debug("Connecting to %s as %s", key, readOnly ? "slave" : "master"); - redis = this.createRedisFromOptions(node, readOnly); - this.nodes.all[key] = redis; - this.nodes[readOnly ? "slave" : "master"][key] = redis; - redis.once("end", () => { - this.removeNode(key); - this.emit("-node", redis, key); - if (!Object.keys(this.nodes.all).length) { - this.emit("drain"); - } - }); - this.emit("+node", redis, key); - redis.on("error", function(error) { - this.emit("nodeError", error, key); - }); - } - return redis; - } - /** - * Reset the pool with a set of nodes. - * The old node will be removed. - */ - reset(nodes) { - debug("Reset with %O", nodes); - const newNodes = {}; - nodes.forEach((node) => { - const key = (0, util_1.getNodeKey)(node); - if (!(node.readOnly && newNodes[key])) { - newNodes[key] = node; - } - }); - Object.keys(this.nodes.all).forEach((key) => { - if (!newNodes[key]) { - debug("Disconnect %s because the node does not hold any slot", key); - this.nodes.all[key].disconnect(); - this.removeNode(key); - } - }); - Object.keys(newNodes).forEach((key) => { - const node = newNodes[key]; - this.findOrCreate(node, node.readOnly); - }); - } - /** - * Remove a node from the pool. - */ - removeNode(key) { - const { nodes } = this; - if (nodes.all[key]) { - debug("Remove %s from the pool", key); - delete nodes.all[key]; - } - delete nodes.master[key]; - delete nodes.slave[key]; - } - }; - exports2.default = ConnectionPool; - } -}); - -// node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js -var require_denque = __commonJS({ - "node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js"(exports2, module2) { - "use strict"; - function Denque(array, options) { - var options = options || {}; - this._capacity = options.capacity; - this._head = 0; - this._tail = 0; - if (Array.isArray(array)) { - this._fromArray(array); - } else { - this._capacityMask = 3; - this._list = new Array(4); - } - } - Denque.prototype.peekAt = function peekAt(index) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - var len = this.size(); - if (i >= len || i < -len) return void 0; - if (i < 0) i += len; - i = this._head + i & this._capacityMask; - return this._list[i]; - }; - Denque.prototype.get = function get(i) { - return this.peekAt(i); - }; - Denque.prototype.peek = function peek() { - if (this._head === this._tail) return void 0; - return this._list[this._head]; - }; - Denque.prototype.peekFront = function peekFront() { - return this.peek(); - }; - Denque.prototype.peekBack = function peekBack() { - return this.peekAt(-1); - }; - Object.defineProperty(Denque.prototype, "length", { - get: function length() { - return this.size(); - } - }); - Denque.prototype.size = function size() { - if (this._head === this._tail) return 0; - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.unshift = function unshift(item) { - if (arguments.length === 0) return this.size(); - var len = this._list.length; - this._head = this._head - 1 + len & this._capacityMask; - this._list[this._head] = item; - if (this._tail === this._head) this._growArray(); - if (this._capacity && this.size() > this._capacity) this.pop(); - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.shift = function shift() { - var head = this._head; - if (head === this._tail) return void 0; - var item = this._list[head]; - this._list[head] = void 0; - this._head = head + 1 & this._capacityMask; - if (head < 2 && this._tail > 1e4 && this._tail <= this._list.length >>> 2) this._shrinkArray(); - return item; - }; - Denque.prototype.push = function push(item) { - if (arguments.length === 0) return this.size(); - var tail = this._tail; - this._list[tail] = item; - this._tail = tail + 1 & this._capacityMask; - if (this._tail === this._head) { - this._growArray(); - } - if (this._capacity && this.size() > this._capacity) { - this.shift(); - } - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.pop = function pop() { - var tail = this._tail; - if (tail === this._head) return void 0; - var len = this._list.length; - this._tail = tail - 1 + len & this._capacityMask; - var item = this._list[this._tail]; - this._list[this._tail] = void 0; - if (this._head < 2 && tail > 1e4 && tail <= len >>> 2) this._shrinkArray(); - return item; - }; - Denque.prototype.removeOne = function removeOne(index) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size) return void 0; - if (i < 0) i += size; - i = this._head + i & this._capacityMask; - var item = this._list[i]; - var k; - if (index < size / 2) { - for (k = index; k > 0; k--) { - this._list[i] = this._list[i = i - 1 + len & this._capacityMask]; - } - this._list[i] = void 0; - this._head = this._head + 1 + len & this._capacityMask; - } else { - for (k = size - 1 - index; k > 0; k--) { - this._list[i] = this._list[i = i + 1 + len & this._capacityMask]; - } - this._list[i] = void 0; - this._tail = this._tail - 1 + len & this._capacityMask; - } - return item; - }; - Denque.prototype.remove = function remove(index, count) { - var i = index; - var removed; - var del_count = count; - if (i !== (i | 0)) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size || count < 1) return void 0; - if (i < 0) i += size; - if (count === 1 || !count) { - removed = new Array(1); - removed[0] = this.removeOne(i); - return removed; - } - if (i === 0 && i + count >= size) { - removed = this.toArray(); - this.clear(); - return removed; - } - if (i + count > size) count = size - i; - var k; - removed = new Array(count); - for (k = 0; k < count; k++) { - removed[k] = this._list[this._head + i + k & this._capacityMask]; - } - i = this._head + i & this._capacityMask; - if (index + count === size) { - this._tail = this._tail - count + len & this._capacityMask; - for (k = count; k > 0; k--) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - } - return removed; - } - if (index === 0) { - this._head = this._head + count + len & this._capacityMask; - for (k = count - 1; k > 0; k--) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - } - return removed; - } - if (i < size / 2) { - this._head = this._head + index + count + len & this._capacityMask; - for (k = index; k > 0; k--) { - this.unshift(this._list[i = i - 1 + len & this._capacityMask]); - } - i = this._head - 1 + len & this._capacityMask; - while (del_count > 0) { - this._list[i = i - 1 + len & this._capacityMask] = void 0; - del_count--; - } - if (index < 0) this._tail = i; - } else { - this._tail = i; - i = i + count + len & this._capacityMask; - for (k = size - (count + index); k > 0; k--) { - this.push(this._list[i++]); - } - i = this._tail; - while (del_count > 0) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - del_count--; - } - } - if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2) this._shrinkArray(); - return removed; - }; - Denque.prototype.splice = function splice(index, count) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - var size = this.size(); - if (i < 0) i += size; - if (i > size) return void 0; - if (arguments.length > 2) { - var k; - var temp; - var removed; - var arg_len = arguments.length; - var len = this._list.length; - var arguments_index = 2; - if (!size || i < size / 2) { - temp = new Array(i); - for (k = 0; k < i; k++) { - temp[k] = this._list[this._head + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i > 0) { - this._head = this._head + i + len & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._head = this._head + i + len & this._capacityMask; - } - while (arg_len > arguments_index) { - this.unshift(arguments[--arg_len]); - } - for (k = i; k > 0; k--) { - this.unshift(temp[k - 1]); - } - } else { - temp = new Array(size - (i + count)); - var leng = temp.length; - for (k = 0; k < leng; k++) { - temp[k] = this._list[this._head + i + count + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i != size) { - this._tail = this._head + i + len & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._tail = this._tail - leng + len & this._capacityMask; - } - while (arguments_index < arg_len) { - this.push(arguments[arguments_index++]); - } - for (k = 0; k < leng; k++) { - this.push(temp[k]); - } - } - return removed; - } else { - return this.remove(i, count); - } - }; - Denque.prototype.clear = function clear() { - this._list = new Array(this._list.length); - this._head = 0; - this._tail = 0; - }; - Denque.prototype.isEmpty = function isEmpty() { - return this._head === this._tail; - }; - Denque.prototype.toArray = function toArray() { - return this._copyArray(false); - }; - Denque.prototype._fromArray = function _fromArray(array) { - var length = array.length; - var capacity = this._nextPowerOf2(length); - this._list = new Array(capacity); - this._capacityMask = capacity - 1; - this._tail = length; - for (var i = 0; i < length; i++) this._list[i] = array[i]; - }; - Denque.prototype._copyArray = function _copyArray(fullCopy, size) { - var src = this._list; - var capacity = src.length; - var length = this.length; - size = size | length; - if (size == length && this._head < this._tail) { - return this._list.slice(this._head, this._tail); - } - var dest = new Array(size); - var k = 0; - var i; - if (fullCopy || this._head > this._tail) { - for (i = this._head; i < capacity; i++) dest[k++] = src[i]; - for (i = 0; i < this._tail; i++) dest[k++] = src[i]; - } else { - for (i = this._head; i < this._tail; i++) dest[k++] = src[i]; - } - return dest; - }; - Denque.prototype._growArray = function _growArray() { - if (this._head != 0) { - var newList = this._copyArray(true, this._list.length << 1); - this._tail = this._list.length; - this._head = 0; - this._list = newList; - } else { - this._tail = this._list.length; - this._list.length <<= 1; - } - this._capacityMask = this._capacityMask << 1 | 1; - }; - Denque.prototype._shrinkArray = function _shrinkArray() { - this._list.length >>>= 1; - this._capacityMask >>>= 1; - }; - Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) { - var log2 = Math.log(num) / Math.log(2); - var nextPow2 = 1 << log2 + 1; - return Math.max(nextPow2, 4); - }; - module2.exports = Denque; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js -var require_DelayQueue = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var Deque = require_denque(); - var debug = (0, utils_1.Debug)("delayqueue"); - var DelayQueue = class { - constructor() { - this.queues = {}; - this.timeouts = {}; - } - /** - * Add a new item to the queue - * - * @param bucket bucket name - * @param item function that will run later - * @param options - */ - push(bucket, item, options) { - const callback = options.callback || process.nextTick; - if (!this.queues[bucket]) { - this.queues[bucket] = new Deque(); - } - const queue = this.queues[bucket]; - queue.push(item); - if (!this.timeouts[bucket]) { - this.timeouts[bucket] = setTimeout(() => { - callback(() => { - this.timeouts[bucket] = null; - this.execute(bucket); - }); - }, options.timeout); - } - } - execute(bucket) { - const queue = this.queues[bucket]; - if (!queue) { - return; - } - const { length } = queue; - if (!length) { - return; - } - debug("send %d commands in %s queue", length, bucket); - this.queues[bucket] = null; - while (queue.length > 0) { - queue.shift()(); - } - } - }; - exports2.default = DelayQueue; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js -var require_ClusterSubscriberGroup = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var ClusterSubscriber_1 = require_ClusterSubscriber(); - var ConnectionPool_1 = require_ConnectionPool(); - var util_1 = require_util(); - var calculateSlot = require_lib(); - var debug = (0, utils_1.Debug)("cluster:subscriberGroup"); - var ClusterSubscriberGroup = class { - /** - * Register callbacks - * - * @param cluster - */ - constructor(cluster, refreshSlotsCacheCallback) { - this.cluster = cluster; - this.shardedSubscribers = /* @__PURE__ */ new Map(); - this.clusterSlots = []; - this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); - this.channels = /* @__PURE__ */ new Map(); - cluster.on("+node", (redis) => { - this._addSubscriber(redis); - }); - cluster.on("-node", (redis) => { - this._removeSubscriber(redis); - }); - cluster.on("refresh", () => { - this._refreshSlots(cluster); - }); - cluster.on("forceRefresh", () => { - refreshSlotsCacheCallback(); - }); - } - /** - * Get the responsible subscriber. - * - * Returns null if no subscriber was found - * - * @param slot - */ - getResponsibleSubscriber(slot) { - const nodeKey = this.clusterSlots[slot][0]; - return this.shardedSubscribers.get(nodeKey); - } - /** - * Adds a channel for which this subscriber group is responsible - * - * @param channels - */ - addChannels(channels) { - const slot = calculateSlot(channels[0]); - channels.forEach((c) => { - if (calculateSlot(c) != slot) - return -1; - }); - const currChannels = this.channels.get(slot); - if (!currChannels) { - this.channels.set(slot, channels); - } else { - this.channels.set(slot, currChannels.concat(channels)); - } - return [...this.channels.values()].flatMap((v) => v).length; - } - /** - * Removes channels for which the subscriber group is responsible by optionally unsubscribing - * @param channels - */ - removeChannels(channels) { - const slot = calculateSlot(channels[0]); - channels.forEach((c) => { - if (calculateSlot(c) != slot) - return -1; - }); - const slotChannels = this.channels.get(slot); - if (slotChannels) { - const updatedChannels = slotChannels.filter((c) => !channels.includes(c)); - this.channels.set(slot, updatedChannels); - } - return [...this.channels.values()].flatMap((v) => v).length; - } - /** - * Disconnect all subscribers - */ - stop() { - for (const s of this.shardedSubscribers.values()) { - s.stop(); - } - } - /** - * Start all not yet started subscribers - */ - start() { - for (const s of this.shardedSubscribers.values()) { - if (!s.isStarted()) { - s.start(); - } - } - } - /** - * Add a subscriber to the group of subscribers - * - * @param redis - */ - _addSubscriber(redis) { - const pool = new ConnectionPool_1.default(redis.options); - if (pool.addMasterNode(redis)) { - const sub = new ClusterSubscriber_1.default(pool, this.cluster, true); - const nodeKey = (0, util_1.getNodeKey)(redis.options); - this.shardedSubscribers.set(nodeKey, sub); - sub.start(); - this._resubscribe(); - this.cluster.emit("+subscriber"); - return sub; - } - return null; - } - /** - * Removes a subscriber from the group - * @param redis - */ - _removeSubscriber(redis) { - const nodeKey = (0, util_1.getNodeKey)(redis.options); - const sub = this.shardedSubscribers.get(nodeKey); - if (sub) { - sub.stop(); - this.shardedSubscribers.delete(nodeKey); - this._resubscribe(); - this.cluster.emit("-subscriber"); - } - return this.shardedSubscribers; - } - /** - * Refreshes the subscriber-related slot ranges - * - * Returns false if no refresh was needed - * - * @param cluster - */ - _refreshSlots(cluster) { - if (this._slotsAreEqual(cluster.slots)) { - debug("Nothing to refresh because the new cluster map is equal to the previous one."); - } else { - debug("Refreshing the slots of the subscriber group."); - this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); - for (let slot = 0; slot < cluster.slots.length; slot++) { - const node = cluster.slots[slot][0]; - if (!this.subscriberToSlotsIndex.has(node)) { - this.subscriberToSlotsIndex.set(node, []); - } - this.subscriberToSlotsIndex.get(node).push(Number(slot)); - } - this._resubscribe(); - this.clusterSlots = JSON.parse(JSON.stringify(cluster.slots)); - this.cluster.emit("subscribersReady"); - return true; - } - return false; - } - /** - * Resubscribes to the previous channels - * - * @private - */ - _resubscribe() { - if (this.shardedSubscribers) { - this.shardedSubscribers.forEach((s, nodeKey) => { - const subscriberSlots = this.subscriberToSlotsIndex.get(nodeKey); - if (subscriberSlots) { - s.associateSlotRange(subscriberSlots); - subscriberSlots.forEach((ss) => { - const redis = s.getInstance(); - const channels = this.channels.get(ss); - if (channels && channels.length > 0) { - if (redis) { - redis.ssubscribe(channels); - redis.on("ready", () => { - redis.ssubscribe(channels); - }); - } - } - }); - } - }); - } - } - /** - * Deep equality of the cluster slots objects - * - * @param other - * @private - */ - _slotsAreEqual(other) { - if (this.clusterSlots === void 0) - return false; - else - return JSON.stringify(this.clusterSlots) === JSON.stringify(other); - } - }; - exports2.default = ClusterSubscriberGroup; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js -var require_cluster = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var events_1 = require("events"); - var redis_errors_1 = require_redis_errors(); - var standard_as_callback_1 = require_built2(); - var Command_1 = require_Command(); - var ClusterAllFailedError_1 = require_ClusterAllFailedError(); - var Redis_1 = require_Redis(); - var ScanStream_1 = require_ScanStream(); - var transaction_1 = require_transaction(); - var utils_1 = require_utils2(); - var applyMixin_1 = require_applyMixin(); - var Commander_1 = require_Commander(); - var ClusterOptions_1 = require_ClusterOptions(); - var ClusterSubscriber_1 = require_ClusterSubscriber(); - var ConnectionPool_1 = require_ConnectionPool(); - var DelayQueue_1 = require_DelayQueue(); - var util_1 = require_util(); - var Deque = require_denque(); - var ClusterSubscriberGroup_1 = require_ClusterSubscriberGroup(); - var debug = (0, utils_1.Debug)("cluster"); - var REJECT_OVERWRITTEN_COMMANDS = /* @__PURE__ */ new WeakSet(); - var Cluster = class _Cluster extends Commander_1.default { - /** - * Creates an instance of Cluster. - */ - //TODO: Add an option that enables or disables sharded PubSub - constructor(startupNodes, options = {}) { - super(); - this.slots = []; - this._groupsIds = {}; - this._groupsBySlot = Array(16384); - this.isCluster = true; - this.retryAttempts = 0; - this.delayQueue = new DelayQueue_1.default(); - this.offlineQueue = new Deque(); - this.isRefreshing = false; - this._refreshSlotsCacheCallbacks = []; - this._autoPipelines = /* @__PURE__ */ new Map(); - this._runningAutoPipelines = /* @__PURE__ */ new Set(); - this._readyDelayedCallbacks = []; - this.connectionEpoch = 0; - events_1.EventEmitter.call(this); - this.startupNodes = startupNodes; - this.options = (0, utils_1.defaults)({}, options, ClusterOptions_1.DEFAULT_CLUSTER_OPTIONS, this.options); - if (this.options.shardedSubscribers == true) - this.shardedSubscribers = new ClusterSubscriberGroup_1.default(this, this.refreshSlotsCache.bind(this)); - if (this.options.redisOptions && this.options.redisOptions.keyPrefix && !this.options.keyPrefix) { - this.options.keyPrefix = this.options.redisOptions.keyPrefix; - } - if (typeof this.options.scaleReads !== "function" && ["all", "master", "slave"].indexOf(this.options.scaleReads) === -1) { - throw new Error('Invalid option scaleReads "' + this.options.scaleReads + '". Expected "all", "master", "slave" or a custom function'); - } - this.connectionPool = new ConnectionPool_1.default(this.options.redisOptions); - this.connectionPool.on("-node", (redis, key) => { - this.emit("-node", redis); - }); - this.connectionPool.on("+node", (redis) => { - this.emit("+node", redis); - }); - this.connectionPool.on("drain", () => { - this.setStatus("close"); - }); - this.connectionPool.on("nodeError", (error, key) => { - this.emit("node error", error, key); - }); - this.subscriber = new ClusterSubscriber_1.default(this.connectionPool, this); - if (this.options.scripts) { - Object.entries(this.options.scripts).forEach(([name, definition]) => { - this.defineCommand(name, definition); - }); - } - if (this.options.lazyConnect) { - this.setStatus("wait"); - } else { - this.connect().catch((err) => { - debug("connecting failed: %s", err); - }); - } - } - /** - * Connect to a cluster - */ - connect() { - return new Promise((resolve2, reject) => { - if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { - reject(new Error("Redis is already connecting/connected")); - return; - } - const epoch = ++this.connectionEpoch; - this.setStatus("connecting"); - this.resolveStartupNodeHostnames().then((nodes) => { - if (this.connectionEpoch !== epoch) { - debug("discard connecting after resolving startup nodes because epoch not match: %d != %d", epoch, this.connectionEpoch); - reject(new redis_errors_1.RedisError("Connection is discarded because a new connection is made")); - return; - } - if (this.status !== "connecting") { - debug("discard connecting after resolving startup nodes because the status changed to %s", this.status); - reject(new redis_errors_1.RedisError("Connection is aborted")); - return; - } - this.connectionPool.reset(nodes); - const readyHandler = () => { - this.setStatus("ready"); - this.retryAttempts = 0; - this.executeOfflineCommands(); - this.resetNodesRefreshInterval(); - resolve2(); - }; - let closeListener = void 0; - const refreshListener = () => { - this.invokeReadyDelayedCallbacks(void 0); - this.removeListener("close", closeListener); - this.manuallyClosing = false; - this.setStatus("connect"); - if (this.options.enableReadyCheck) { - this.readyCheck((err, fail) => { - if (err || fail) { - debug("Ready check failed (%s). Reconnecting...", err || fail); - if (this.status === "connect") { - this.disconnect(true); - } - } else { - readyHandler(); - } - }); - } else { - readyHandler(); - } - }; - closeListener = () => { - const error = new Error("None of startup nodes is available"); - this.removeListener("refresh", refreshListener); - this.invokeReadyDelayedCallbacks(error); - reject(error); - }; - this.once("refresh", refreshListener); - this.once("close", closeListener); - this.once("close", this.handleCloseEvent.bind(this)); - this.refreshSlotsCache((err) => { - if (err && err.message === ClusterAllFailedError_1.default.defaultMessage) { - Redis_1.default.prototype.silentEmit.call(this, "error", err); - this.connectionPool.reset([]); - } - }); - this.subscriber.start(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.start(); - } - }).catch((err) => { - this.setStatus("close"); - this.handleCloseEvent(err); - this.invokeReadyDelayedCallbacks(err); - reject(err); - }); - }); - } - /** - * Disconnect from every node in the cluster. - */ - disconnect(reconnect = false) { - const status = this.status; - this.setStatus("disconnecting"); - if (!reconnect) { - this.manuallyClosing = true; - } - if (this.reconnectTimeout && !reconnect) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - debug("Canceled reconnecting attempts"); - } - this.clearNodesRefreshInterval(); - this.subscriber.stop(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.stop(); - } - if (status === "wait") { - this.setStatus("close"); - this.handleCloseEvent(); - } else { - this.connectionPool.reset([]); - } - } - /** - * Quit the cluster gracefully. - */ - quit(callback) { - const status = this.status; - this.setStatus("disconnecting"); - this.manuallyClosing = true; - if (this.reconnectTimeout) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - } - this.clearNodesRefreshInterval(); - this.subscriber.stop(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.stop(); - } - if (status === "wait") { - const ret = (0, standard_as_callback_1.default)(Promise.resolve("OK"), callback); - setImmediate(function() { - this.setStatus("close"); - this.handleCloseEvent(); - }.bind(this)); - return ret; - } - return (0, standard_as_callback_1.default)(Promise.all(this.nodes().map((node) => node.quit().catch((err) => { - if (err.message === utils_1.CONNECTION_CLOSED_ERROR_MSG) { - return "OK"; - } - throw err; - }))).then(() => "OK"), callback); - } - /** - * Create a new instance with the same startup nodes and options as the current one. - * - * @example - * ```js - * var cluster = new Redis.Cluster([{ host: "127.0.0.1", port: "30001" }]); - * var anotherCluster = cluster.duplicate(); - * ``` - */ - duplicate(overrideStartupNodes = [], overrideOptions = {}) { - const startupNodes = overrideStartupNodes.length > 0 ? overrideStartupNodes : this.startupNodes.slice(0); - const options = Object.assign({}, this.options, overrideOptions); - return new _Cluster(startupNodes, options); - } - /** - * Get nodes with the specified role - */ - nodes(role = "all") { - if (role !== "all" && role !== "master" && role !== "slave") { - throw new Error('Invalid role "' + role + '". Expected "all", "master" or "slave"'); - } - return this.connectionPool.getNodes(role); - } - /** - * This is needed in order not to install a listener for each auto pipeline - * - * @ignore - */ - delayUntilReady(callback) { - this._readyDelayedCallbacks.push(callback); - } - /** - * Get the number of commands queued in automatic pipelines. - * - * This is not available (and returns 0) until the cluster is connected and slots information have been received. - */ - get autoPipelineQueueSize() { - let queued = 0; - for (const pipeline of this._autoPipelines.values()) { - queued += pipeline.length; - } - return queued; - } - /** - * Refresh the slot cache - * - * @ignore - */ - refreshSlotsCache(callback) { - if (callback) { - this._refreshSlotsCacheCallbacks.push(callback); - } - if (this.isRefreshing) { - return; - } - this.isRefreshing = true; - const _this = this; - const wrapper = (error) => { - this.isRefreshing = false; - for (const callback2 of this._refreshSlotsCacheCallbacks) { - callback2(error); - } - this._refreshSlotsCacheCallbacks = []; - }; - const nodes = (0, utils_1.shuffle)(this.connectionPool.getNodes()); - let lastNodeError = null; - function tryNode(index) { - if (index === nodes.length) { - const error = new ClusterAllFailedError_1.default(ClusterAllFailedError_1.default.defaultMessage, lastNodeError); - return wrapper(error); - } - const node = nodes[index]; - const key = `${node.options.host}:${node.options.port}`; - debug("getting slot cache from %s", key); - _this.getInfoFromNode(node, function(err) { - switch (_this.status) { - case "close": - case "end": - return wrapper(new Error("Cluster is disconnected.")); - case "disconnecting": - return wrapper(new Error("Cluster is disconnecting.")); - } - if (err) { - _this.emit("node error", err, key); - lastNodeError = err; - tryNode(index + 1); - } else { - _this.emit("refresh"); - wrapper(); - } - }); - } - tryNode(0); - } - /** - * @ignore - */ - sendCommand(command, stream, node) { - if (this.status === "wait") { - this.connect().catch(utils_1.noop); - } - if (this.status === "end") { - command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return command.promise; - } - let to = this.options.scaleReads; - if (to !== "master") { - const isCommandReadOnly = command.isReadOnly || (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); - if (!isCommandReadOnly) { - to = "master"; - } - } - let targetSlot = node ? node.slot : command.getSlot(); - const ttl = {}; - const _this = this; - if (!node && !REJECT_OVERWRITTEN_COMMANDS.has(command)) { - REJECT_OVERWRITTEN_COMMANDS.add(command); - const reject = command.reject; - command.reject = function(err) { - const partialTry = tryConnection.bind(null, true); - _this.handleError(err, ttl, { - moved: function(slot, key) { - debug("command %s is moved to %s", command.name, key); - targetSlot = Number(slot); - if (_this.slots[slot]) { - _this.slots[slot][0] = key; - } else { - _this.slots[slot] = [key]; - } - _this._groupsBySlot[slot] = _this._groupsIds[_this.slots[slot].join(";")]; - _this.connectionPool.findOrCreate(_this.natMapper(key)); - tryConnection(); - debug("refreshing slot caches... (triggered by MOVED error)"); - _this.refreshSlotsCache(); - }, - ask: function(slot, key) { - debug("command %s is required to ask %s:%s", command.name, key); - const mapped = _this.natMapper(key); - _this.connectionPool.findOrCreate(mapped); - tryConnection(false, `${mapped.host}:${mapped.port}`); - }, - tryagain: partialTry, - clusterDown: partialTry, - connectionClosed: partialTry, - maxRedirections: function(redirectionError) { - reject.call(command, redirectionError); - }, - defaults: function() { - reject.call(command, err); - } - }); - }; - } - tryConnection(); - function tryConnection(random, asking) { - if (_this.status === "end") { - command.reject(new redis_errors_1.AbortError("Cluster is ended.")); - return; - } - let redis; - if (_this.status === "ready" || command.name === "cluster") { - if (node && node.redis) { - redis = node.redis; - } else if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", command.name) || Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", command.name)) { - if (_this.options.shardedSubscribers == true && (command.name == "ssubscribe" || command.name == "sunsubscribe")) { - const sub = _this.shardedSubscribers.getResponsibleSubscriber(targetSlot); - let status = -1; - if (command.name == "ssubscribe") - status = _this.shardedSubscribers.addChannels(command.getKeys()); - if (command.name == "sunsubscribe") - status = _this.shardedSubscribers.removeChannels(command.getKeys()); - if (status !== -1) { - redis = sub.getInstance(); - } else { - command.reject(new redis_errors_1.AbortError("Can't add or remove the given channels. Are they in the same slot?")); - } - } else { - redis = _this.subscriber.getInstance(); - } - if (!redis) { - command.reject(new redis_errors_1.AbortError("No subscriber for the cluster")); - return; - } - } else { - if (!random) { - if (typeof targetSlot === "number" && _this.slots[targetSlot]) { - const nodeKeys = _this.slots[targetSlot]; - if (typeof to === "function") { - const nodes = nodeKeys.map(function(key) { - return _this.connectionPool.getInstanceByKey(key); - }); - redis = to(nodes, command); - if (Array.isArray(redis)) { - redis = (0, utils_1.sample)(redis); - } - if (!redis) { - redis = nodes[0]; - } - } else { - let key; - if (to === "all") { - key = (0, utils_1.sample)(nodeKeys); - } else if (to === "slave" && nodeKeys.length > 1) { - key = (0, utils_1.sample)(nodeKeys, 1); - } else { - key = nodeKeys[0]; - } - redis = _this.connectionPool.getInstanceByKey(key); - } - } - if (asking) { - redis = _this.connectionPool.getInstanceByKey(asking); - redis.asking(); - } - } - if (!redis) { - redis = (typeof to === "function" ? null : _this.connectionPool.getSampleInstance(to)) || _this.connectionPool.getSampleInstance("all"); - } - } - if (node && !node.redis) { - node.redis = redis; - } - } - if (redis) { - redis.sendCommand(command, stream); - } else if (_this.options.enableOfflineQueue) { - _this.offlineQueue.push({ - command, - stream, - node - }); - } else { - command.reject(new Error("Cluster isn't ready and enableOfflineQueue options is false")); - } - } - return command.promise; - } - sscanStream(key, options) { - return this.createScanStream("sscan", { key, options }); - } - sscanBufferStream(key, options) { - return this.createScanStream("sscanBuffer", { key, options }); - } - hscanStream(key, options) { - return this.createScanStream("hscan", { key, options }); - } - hscanBufferStream(key, options) { - return this.createScanStream("hscanBuffer", { key, options }); - } - zscanStream(key, options) { - return this.createScanStream("zscan", { key, options }); - } - zscanBufferStream(key, options) { - return this.createScanStream("zscanBuffer", { key, options }); - } - /** - * @ignore - */ - handleError(error, ttl, handlers) { - if (typeof ttl.value === "undefined") { - ttl.value = this.options.maxRedirections; - } else { - ttl.value -= 1; - } - if (ttl.value <= 0) { - handlers.maxRedirections(new Error("Too many Cluster redirections. Last error: " + error)); - return; - } - const errv = error.message.split(" "); - if (errv[0] === "MOVED") { - const timeout = this.options.retryDelayOnMoved; - if (timeout && typeof timeout === "number") { - this.delayQueue.push("moved", handlers.moved.bind(null, errv[1], errv[2]), { timeout }); - } else { - handlers.moved(errv[1], errv[2]); - } - } else if (errv[0] === "ASK") { - handlers.ask(errv[1], errv[2]); - } else if (errv[0] === "TRYAGAIN") { - this.delayQueue.push("tryagain", handlers.tryagain, { - timeout: this.options.retryDelayOnTryAgain - }); - } else if (errv[0] === "CLUSTERDOWN" && this.options.retryDelayOnClusterDown > 0) { - this.delayQueue.push("clusterdown", handlers.connectionClosed, { - timeout: this.options.retryDelayOnClusterDown, - callback: this.refreshSlotsCache.bind(this) - }); - } else if (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG && this.options.retryDelayOnFailover > 0 && this.status === "ready") { - this.delayQueue.push("failover", handlers.connectionClosed, { - timeout: this.options.retryDelayOnFailover, - callback: this.refreshSlotsCache.bind(this) - }); - } else { - handlers.defaults(); - } - } - resetOfflineQueue() { - this.offlineQueue = new Deque(); - } - clearNodesRefreshInterval() { - if (this.slotsTimer) { - clearTimeout(this.slotsTimer); - this.slotsTimer = null; - } - } - resetNodesRefreshInterval() { - if (this.slotsTimer || !this.options.slotsRefreshInterval) { - return; - } - const nextRound = () => { - this.slotsTimer = setTimeout(() => { - debug('refreshing slot caches... (triggered by "slotsRefreshInterval" option)'); - this.refreshSlotsCache(() => { - nextRound(); - }); - }, this.options.slotsRefreshInterval); - }; - nextRound(); - } - /** - * Change cluster instance's status - */ - setStatus(status) { - debug("status: %s -> %s", this.status || "[empty]", status); - this.status = status; - process.nextTick(() => { - this.emit(status); - }); - } - /** - * Called when closed to check whether a reconnection should be made - */ - handleCloseEvent(reason) { - if (reason) { - debug("closed because %s", reason); - } - let retryDelay; - if (!this.manuallyClosing && typeof this.options.clusterRetryStrategy === "function") { - retryDelay = this.options.clusterRetryStrategy.call(this, ++this.retryAttempts, reason); - } - if (typeof retryDelay === "number") { - this.setStatus("reconnecting"); - this.reconnectTimeout = setTimeout(() => { - this.reconnectTimeout = null; - debug("Cluster is disconnected. Retrying after %dms", retryDelay); - this.connect().catch(function(err) { - debug("Got error %s when reconnecting. Ignoring...", err); - }); - }, retryDelay); - } else { - this.setStatus("end"); - this.flushQueue(new Error("None of startup nodes is available")); - } - } - /** - * Flush offline queue with error. - */ - flushQueue(error) { - let item; - while (item = this.offlineQueue.shift()) { - item.command.reject(error); - } - } - executeOfflineCommands() { - if (this.offlineQueue.length) { - debug("send %d commands in offline queue", this.offlineQueue.length); - const offlineQueue = this.offlineQueue; - this.resetOfflineQueue(); - let item; - while (item = offlineQueue.shift()) { - this.sendCommand(item.command, item.stream, item.node); - } - } - } - natMapper(nodeKey) { - const key = typeof nodeKey === "string" ? nodeKey : `${nodeKey.host}:${nodeKey.port}`; - let mapped = null; - if (this.options.natMap && typeof this.options.natMap === "function") { - mapped = this.options.natMap(key); - } else if (this.options.natMap && typeof this.options.natMap === "object") { - mapped = this.options.natMap[key]; - } - if (mapped) { - debug("NAT mapping %s -> %O", key, mapped); - return Object.assign({}, mapped); - } - return typeof nodeKey === "string" ? (0, util_1.nodeKeyToRedisOptions)(nodeKey) : nodeKey; - } - getInfoFromNode(redis, callback) { - if (!redis) { - return callback(new Error("Node is disconnected")); - } - const duplicatedConnection = redis.duplicate({ - enableOfflineQueue: true, - enableReadyCheck: false, - retryStrategy: null, - connectionName: (0, util_1.getConnectionName)("refresher", this.options.redisOptions && this.options.redisOptions.connectionName) - }); - duplicatedConnection.on("error", utils_1.noop); - duplicatedConnection.cluster("SLOTS", (0, utils_1.timeout)((err, result) => { - duplicatedConnection.disconnect(); - if (err) { - debug("error encountered running CLUSTER.SLOTS: %s", err); - return callback(err); - } - if (this.status === "disconnecting" || this.status === "close" || this.status === "end") { - debug("ignore CLUSTER.SLOTS results (count: %d) since cluster status is %s", result.length, this.status); - callback(); - return; - } - const nodes = []; - debug("cluster slots result count: %d", result.length); - for (let i = 0; i < result.length; ++i) { - const items = result[i]; - const slotRangeStart = items[0]; - const slotRangeEnd = items[1]; - const keys = []; - for (let j2 = 2; j2 < items.length; j2++) { - if (!items[j2][0]) { - continue; - } - const node = this.natMapper({ - host: items[j2][0], - port: items[j2][1] - }); - node.readOnly = j2 !== 2; - nodes.push(node); - keys.push(node.host + ":" + node.port); - } - debug("cluster slots result [%d]: slots %d~%d served by %s", i, slotRangeStart, slotRangeEnd, keys); - for (let slot = slotRangeStart; slot <= slotRangeEnd; slot++) { - this.slots[slot] = keys; - } - } - this._groupsIds = /* @__PURE__ */ Object.create(null); - let j = 0; - for (let i = 0; i < 16384; i++) { - const target = (this.slots[i] || []).join(";"); - if (!target.length) { - this._groupsBySlot[i] = void 0; - continue; - } - if (!this._groupsIds[target]) { - this._groupsIds[target] = ++j; - } - this._groupsBySlot[i] = this._groupsIds[target]; - } - this.connectionPool.reset(nodes); - callback(); - }, this.options.slotsRefreshTimeout)); - } - invokeReadyDelayedCallbacks(err) { - for (const c of this._readyDelayedCallbacks) { - process.nextTick(c, err); - } - this._readyDelayedCallbacks = []; - } - /** - * Check whether Cluster is able to process commands - */ - readyCheck(callback) { - this.cluster("INFO", (err, res) => { - if (err) { - return callback(err); - } - if (typeof res !== "string") { - return callback(); - } - let state; - const lines = res.split("\r\n"); - for (let i = 0; i < lines.length; ++i) { - const parts = lines[i].split(":"); - if (parts[0] === "cluster_state") { - state = parts[1]; - break; - } - } - if (state === "fail") { - debug("cluster state not ok (%s)", state); - callback(null, state); - } else { - callback(); - } - }); - } - resolveSrv(hostname) { - return new Promise((resolve2, reject) => { - this.options.resolveSrv(hostname, (err, records) => { - if (err) { - return reject(err); - } - const self2 = this, groupedRecords = (0, util_1.groupSrvRecords)(records), sortedKeys = Object.keys(groupedRecords).sort((a, b) => parseInt(a) - parseInt(b)); - function tryFirstOne(err2) { - if (!sortedKeys.length) { - return reject(err2); - } - const key = sortedKeys[0], group = groupedRecords[key], record = (0, util_1.weightSrvRecords)(group); - if (!group.records.length) { - sortedKeys.shift(); - } - self2.dnsLookup(record.name).then((host) => resolve2({ - host, - port: record.port - }), tryFirstOne); - } - tryFirstOne(); - }); - }); - } - dnsLookup(hostname) { - return new Promise((resolve2, reject) => { - this.options.dnsLookup(hostname, (err, address) => { - if (err) { - debug("failed to resolve hostname %s to IP: %s", hostname, err.message); - reject(err); - } else { - debug("resolved hostname %s to IP %s", hostname, address); - resolve2(address); - } - }); - }); - } - /** - * Normalize startup nodes, and resolving hostnames to IPs. - * - * This process happens every time when #connect() is called since - * #startupNodes and DNS records may chanage. - */ - async resolveStartupNodeHostnames() { - if (!Array.isArray(this.startupNodes) || this.startupNodes.length === 0) { - throw new Error("`startupNodes` should contain at least one node."); - } - const startupNodes = (0, util_1.normalizeNodeOptions)(this.startupNodes); - const hostnames = (0, util_1.getUniqueHostnamesFromOptions)(startupNodes); - if (hostnames.length === 0) { - return startupNodes; - } - const configs = await Promise.all(hostnames.map((this.options.useSRVRecords ? this.resolveSrv : this.dnsLookup).bind(this))); - const hostnameToConfig = (0, utils_1.zipMap)(hostnames, configs); - return startupNodes.map((node) => { - const config = hostnameToConfig.get(node.host); - if (!config) { - return node; - } - if (this.options.useSRVRecords) { - return Object.assign({}, node, config); - } - return Object.assign({}, node, { host: config }); - }); - } - createScanStream(command, { key, options = {} }) { - return new ScanStream_1.default({ - objectMode: true, - key, - redis: this, - command, - ...options - }); - } - }; - (0, applyMixin_1.default)(Cluster, events_1.EventEmitter); - (0, transaction_1.addTransactionSupport)(Cluster.prototype); - exports2.default = Cluster; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js -var require_AbstractConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var debug = (0, utils_1.Debug)("AbstractConnector"); - var AbstractConnector = class { - constructor(disconnectTimeout) { - this.connecting = false; - this.disconnectTimeout = disconnectTimeout; - } - check(info) { - return true; - } - disconnect() { - this.connecting = false; - if (this.stream) { - const stream = this.stream; - const timeout = setTimeout(() => { - debug("stream %s:%s still open, destroying it", stream.remoteAddress, stream.remotePort); - stream.destroy(); - }, this.disconnectTimeout); - stream.on("close", () => clearTimeout(timeout)); - stream.end(); - } - } - }; - exports2.default = AbstractConnector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js -var require_StandaloneConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var net_1 = require("net"); - var tls_1 = require("tls"); - var utils_1 = require_utils2(); - var AbstractConnector_1 = require_AbstractConnector(); - var StandaloneConnector = class extends AbstractConnector_1.default { - constructor(options) { - super(options.disconnectTimeout); - this.options = options; - } - connect(_) { - const { options } = this; - this.connecting = true; - let connectionOptions; - if ("path" in options && options.path) { - connectionOptions = { - path: options.path - }; - } else { - connectionOptions = {}; - if ("port" in options && options.port != null) { - connectionOptions.port = options.port; - } - if ("host" in options && options.host != null) { - connectionOptions.host = options.host; - } - if ("family" in options && options.family != null) { - connectionOptions.family = options.family; - } - } - if (options.tls) { - Object.assign(connectionOptions, options.tls); - } - return new Promise((resolve2, reject) => { - process.nextTick(() => { - if (!this.connecting) { - reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return; - } - try { - if (options.tls) { - this.stream = (0, tls_1.connect)(connectionOptions); - } else { - this.stream = (0, net_1.createConnection)(connectionOptions); - } - } catch (err) { - reject(err); - return; - } - this.stream.once("error", (err) => { - this.firstError = err; - }); - resolve2(this.stream); - }); - }); - } - }; - exports2.default = StandaloneConnector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js -var require_SentinelIterator = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function isSentinelEql(a, b) { - return (a.host || "127.0.0.1") === (b.host || "127.0.0.1") && (a.port || 26379) === (b.port || 26379); - } - var SentinelIterator = class { - constructor(sentinels) { - this.cursor = 0; - this.sentinels = sentinels.slice(0); - } - next() { - const done = this.cursor >= this.sentinels.length; - return { done, value: done ? void 0 : this.sentinels[this.cursor++] }; - } - reset(moveCurrentEndpointToFirst) { - if (moveCurrentEndpointToFirst && this.sentinels.length > 1 && this.cursor !== 1) { - this.sentinels.unshift(...this.sentinels.splice(this.cursor - 1)); - } - this.cursor = 0; - } - add(sentinel) { - for (let i = 0; i < this.sentinels.length; i++) { - if (isSentinelEql(sentinel, this.sentinels[i])) { - return false; - } - } - this.sentinels.push(sentinel); - return true; - } - toString() { - return `${JSON.stringify(this.sentinels)} @${this.cursor}`; - } - }; - exports2.default = SentinelIterator; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js -var require_FailoverDetector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FailoverDetector = void 0; - var utils_1 = require_utils2(); - var debug = (0, utils_1.Debug)("FailoverDetector"); - var CHANNEL_NAME = "+switch-master"; - var FailoverDetector = class { - // sentinels can't be used for regular commands after this - constructor(connector, sentinels) { - this.isDisconnected = false; - this.connector = connector; - this.sentinels = sentinels; - } - cleanup() { - this.isDisconnected = true; - for (const sentinel of this.sentinels) { - sentinel.client.disconnect(); - } - } - async subscribe() { - debug("Starting FailoverDetector"); - const promises2 = []; - for (const sentinel of this.sentinels) { - const promise = sentinel.client.subscribe(CHANNEL_NAME).catch((err) => { - debug("Failed to subscribe to failover messages on sentinel %s:%s (%s)", sentinel.address.host || "127.0.0.1", sentinel.address.port || 26739, err.message); - }); - promises2.push(promise); - sentinel.client.on("message", (channel) => { - if (!this.isDisconnected && channel === CHANNEL_NAME) { - this.disconnect(); - } - }); - } - await Promise.all(promises2); - } - disconnect() { - this.isDisconnected = true; - debug("Failover detected, disconnecting"); - this.connector.disconnect(); - } - }; - exports2.FailoverDetector = FailoverDetector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js -var require_SentinelConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SentinelIterator = void 0; - var net_1 = require("net"); - var utils_1 = require_utils2(); - var tls_1 = require("tls"); - var SentinelIterator_1 = require_SentinelIterator(); - exports2.SentinelIterator = SentinelIterator_1.default; - var AbstractConnector_1 = require_AbstractConnector(); - var Redis_1 = require_Redis(); - var FailoverDetector_1 = require_FailoverDetector(); - var debug = (0, utils_1.Debug)("SentinelConnector"); - var SentinelConnector = class extends AbstractConnector_1.default { - constructor(options) { - super(options.disconnectTimeout); - this.options = options; - this.emitter = null; - this.failoverDetector = null; - if (!this.options.sentinels.length) { - throw new Error("Requires at least one sentinel to connect to."); - } - if (!this.options.name) { - throw new Error("Requires the name of master."); - } - this.sentinelIterator = new SentinelIterator_1.default(this.options.sentinels); - } - check(info) { - const roleMatches = !info.role || this.options.role === info.role; - if (!roleMatches) { - debug("role invalid, expected %s, but got %s", this.options.role, info.role); - this.sentinelIterator.next(); - this.sentinelIterator.next(); - this.sentinelIterator.reset(true); - } - return roleMatches; - } - disconnect() { - super.disconnect(); - if (this.failoverDetector) { - this.failoverDetector.cleanup(); - } - } - connect(eventEmitter) { - this.connecting = true; - this.retryAttempts = 0; - let lastError; - const connectToNext = async () => { - const endpoint = this.sentinelIterator.next(); - if (endpoint.done) { - this.sentinelIterator.reset(false); - const retryDelay = typeof this.options.sentinelRetryStrategy === "function" ? this.options.sentinelRetryStrategy(++this.retryAttempts) : null; - let errorMsg = typeof retryDelay !== "number" ? "All sentinels are unreachable and retry is disabled." : `All sentinels are unreachable. Retrying from scratch after ${retryDelay}ms.`; - if (lastError) { - errorMsg += ` Last error: ${lastError.message}`; - } - debug(errorMsg); - const error = new Error(errorMsg); - if (typeof retryDelay === "number") { - eventEmitter("error", error); - await new Promise((resolve2) => setTimeout(resolve2, retryDelay)); - return connectToNext(); - } else { - throw error; - } - } - let resolved = null; - let err = null; - try { - resolved = await this.resolve(endpoint.value); - } catch (error) { - err = error; - } - if (!this.connecting) { - throw new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG); - } - const endpointAddress = endpoint.value.host + ":" + endpoint.value.port; - if (resolved) { - debug("resolved: %s:%s from sentinel %s", resolved.host, resolved.port, endpointAddress); - if (this.options.enableTLSForSentinelMode && this.options.tls) { - Object.assign(resolved, this.options.tls); - this.stream = (0, tls_1.connect)(resolved); - this.stream.once("secureConnect", this.initFailoverDetector.bind(this)); - } else { - this.stream = (0, net_1.createConnection)(resolved); - this.stream.once("connect", this.initFailoverDetector.bind(this)); - } - this.stream.once("error", (err2) => { - this.firstError = err2; - }); - return this.stream; - } else { - const errorMsg = err ? "failed to connect to sentinel " + endpointAddress + " because " + err.message : "connected to sentinel " + endpointAddress + " successfully, but got an invalid reply: " + resolved; - debug(errorMsg); - eventEmitter("sentinelError", new Error(errorMsg)); - if (err) { - lastError = err; - } - return connectToNext(); - } - }; - return connectToNext(); - } - async updateSentinels(client) { - if (!this.options.updateSentinels) { - return; - } - const result = await client.sentinel("sentinels", this.options.name); - if (!Array.isArray(result)) { - return; - } - result.map(utils_1.packObject).forEach((sentinel) => { - const flags = sentinel.flags ? sentinel.flags.split(",") : []; - if (flags.indexOf("disconnected") === -1 && sentinel.ip && sentinel.port) { - const endpoint = this.sentinelNatResolve(addressResponseToAddress(sentinel)); - if (this.sentinelIterator.add(endpoint)) { - debug("adding sentinel %s:%s", endpoint.host, endpoint.port); - } - } - }); - debug("Updated internal sentinels: %s", this.sentinelIterator); - } - async resolveMaster(client) { - const result = await client.sentinel("get-master-addr-by-name", this.options.name); - await this.updateSentinels(client); - return this.sentinelNatResolve(Array.isArray(result) ? { host: result[0], port: Number(result[1]) } : null); - } - async resolveSlave(client) { - const result = await client.sentinel("slaves", this.options.name); - if (!Array.isArray(result)) { - return null; - } - const availableSlaves = result.map(utils_1.packObject).filter((slave) => slave.flags && !slave.flags.match(/(disconnected|s_down|o_down)/)); - return this.sentinelNatResolve(selectPreferredSentinel(availableSlaves, this.options.preferredSlaves)); - } - sentinelNatResolve(item) { - if (!item || !this.options.natMap) - return item; - const key = `${item.host}:${item.port}`; - let result = item; - if (typeof this.options.natMap === "function") { - result = this.options.natMap(key) || item; - } else if (typeof this.options.natMap === "object") { - result = this.options.natMap[key] || item; - } - return result; - } - connectToSentinel(endpoint, options) { - const redis = new Redis_1.default({ - port: endpoint.port || 26379, - host: endpoint.host, - username: this.options.sentinelUsername || null, - password: this.options.sentinelPassword || null, - family: endpoint.family || // @ts-expect-error - ("path" in this.options && this.options.path ? void 0 : ( - // @ts-expect-error - this.options.family - )), - tls: this.options.sentinelTLS, - retryStrategy: null, - enableReadyCheck: false, - connectTimeout: this.options.connectTimeout, - commandTimeout: this.options.sentinelCommandTimeout, - ...options - }); - return redis; - } - async resolve(endpoint) { - const client = this.connectToSentinel(endpoint); - client.on("error", noop); - try { - if (this.options.role === "slave") { - return await this.resolveSlave(client); - } else { - return await this.resolveMaster(client); - } - } finally { - client.disconnect(); - } - } - async initFailoverDetector() { - var _a; - if (!this.options.failoverDetector) { - return; - } - this.sentinelIterator.reset(true); - const sentinels = []; - while (sentinels.length < this.options.sentinelMaxConnections) { - const { done, value } = this.sentinelIterator.next(); - if (done) { - break; - } - const client = this.connectToSentinel(value, { - lazyConnect: true, - retryStrategy: this.options.sentinelReconnectStrategy - }); - client.on("reconnecting", () => { - var _a2; - (_a2 = this.emitter) === null || _a2 === void 0 ? void 0 : _a2.emit("sentinelReconnecting"); - }); - sentinels.push({ address: value, client }); - } - this.sentinelIterator.reset(false); - if (this.failoverDetector) { - this.failoverDetector.cleanup(); - } - this.failoverDetector = new FailoverDetector_1.FailoverDetector(this, sentinels); - await this.failoverDetector.subscribe(); - (_a = this.emitter) === null || _a === void 0 ? void 0 : _a.emit("failoverSubscribed"); - } - }; - exports2.default = SentinelConnector; - function selectPreferredSentinel(availableSlaves, preferredSlaves) { - if (availableSlaves.length === 0) { - return null; - } - let selectedSlave; - if (typeof preferredSlaves === "function") { - selectedSlave = preferredSlaves(availableSlaves); - } else if (preferredSlaves !== null && typeof preferredSlaves === "object") { - const preferredSlavesArray = Array.isArray(preferredSlaves) ? preferredSlaves : [preferredSlaves]; - preferredSlavesArray.sort((a, b) => { - if (!a.prio) { - a.prio = 1; - } - if (!b.prio) { - b.prio = 1; - } - if (a.prio < b.prio) { - return -1; - } - if (a.prio > b.prio) { - return 1; - } - return 0; - }); - for (let p = 0; p < preferredSlavesArray.length; p++) { - for (let a = 0; a < availableSlaves.length; a++) { - const slave = availableSlaves[a]; - if (slave.ip === preferredSlavesArray[p].ip) { - if (slave.port === preferredSlavesArray[p].port) { - selectedSlave = slave; - break; - } - } - } - if (selectedSlave) { - break; - } - } - } - if (!selectedSlave) { - selectedSlave = (0, utils_1.sample)(availableSlaves); - } - return addressResponseToAddress(selectedSlave); - } - function addressResponseToAddress(input) { - return { host: input.ip, port: Number(input.port) }; - } - function noop() { - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js -var require_connectors = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SentinelConnector = exports2.StandaloneConnector = void 0; - var StandaloneConnector_1 = require_StandaloneConnector(); - exports2.StandaloneConnector = StandaloneConnector_1.default; - var SentinelConnector_1 = require_SentinelConnector(); - exports2.SentinelConnector = SentinelConnector_1.default; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js -var require_MaxRetriesPerRequestError = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var redis_errors_1 = require_redis_errors(); - var MaxRetriesPerRequestError = class extends redis_errors_1.AbortError { - constructor(maxRetriesPerRequest) { - const message = `Reached the max retries per request limit (which is ${maxRetriesPerRequest}). Refer to "maxRetriesPerRequest" option for details.`; - super(message); - Error.captureStackTrace(this, this.constructor); - } - get name() { - return this.constructor.name; - } - }; - exports2.default = MaxRetriesPerRequestError; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js -var require_errors = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MaxRetriesPerRequestError = void 0; - var MaxRetriesPerRequestError_1 = require_MaxRetriesPerRequestError(); - exports2.MaxRetriesPerRequestError = MaxRetriesPerRequestError_1.default; - } -}); - -// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js -var require_parser = __commonJS({ - "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js"(exports2, module2) { - "use strict"; - var Buffer2 = require("buffer").Buffer; - var StringDecoder = require("string_decoder").StringDecoder; - var decoder = new StringDecoder(); - var errors = require_redis_errors(); - var ReplyError = errors.ReplyError; - var ParserError = errors.ParserError; - var bufferPool = Buffer2.allocUnsafe(32 * 1024); - var bufferOffset = 0; - var interval = null; - var counter = 0; - var notDecreased = 0; - function parseSimpleNumbers(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - var sign = 1; - if (parser.buffer[offset] === 45) { - sign = -1; - offset++; - } - while (offset < length) { - const c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - return sign * number; - } - number = number * 10 + (c1 - 48); - } - } - function parseStringNumbers(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - var res = ""; - if (parser.buffer[offset] === 45) { - res += "-"; - offset++; - } - while (offset < length) { - var c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - if (number !== 0) { - res += number; - } - return res; - } else if (number > 429496728) { - res += number * 10 + (c1 - 48); - number = 0; - } else if (c1 === 48 && number === 0) { - res += 0; - } else { - number = number * 10 + (c1 - 48); - } - } - } - function parseSimpleString(parser) { - const start = parser.offset; - const buffer = parser.buffer; - const length = buffer.length - 1; - var offset = start; - while (offset < length) { - if (buffer[offset++] === 13) { - parser.offset = offset + 1; - if (parser.optionReturnBuffers === true) { - return parser.buffer.slice(start, offset - 1); - } - return parser.buffer.toString("utf8", start, offset - 1); - } - } - } - function parseLength(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - while (offset < length) { - const c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - return number; - } - number = number * 10 + (c1 - 48); - } - } - function parseInteger(parser) { - if (parser.optionStringNumbers === true) { - return parseStringNumbers(parser); - } - return parseSimpleNumbers(parser); - } - function parseBulkString(parser) { - const length = parseLength(parser); - if (length === void 0) { - return; - } - if (length < 0) { - return null; - } - const offset = parser.offset + length; - if (offset + 2 > parser.buffer.length) { - parser.bigStrSize = offset + 2; - parser.totalChunkSize = parser.buffer.length; - parser.bufferCache.push(parser.buffer); - return; - } - const start = parser.offset; - parser.offset = offset + 2; - if (parser.optionReturnBuffers === true) { - return parser.buffer.slice(start, offset); - } - return parser.buffer.toString("utf8", start, offset); - } - function parseError(parser) { - var string = parseSimpleString(parser); - if (string !== void 0) { - if (parser.optionReturnBuffers === true) { - string = string.toString(); - } - return new ReplyError(string); - } - } - function handleError(parser, type) { - const err = new ParserError( - "Protocol error, got " + JSON.stringify(String.fromCharCode(type)) + " as reply type byte", - JSON.stringify(parser.buffer), - parser.offset - ); - parser.buffer = null; - parser.returnFatalError(err); - } - function parseArray(parser) { - const length = parseLength(parser); - if (length === void 0) { - return; - } - if (length < 0) { - return null; - } - const responses = new Array(length); - return parseArrayElements(parser, responses, 0); - } - function pushArrayCache(parser, array, pos) { - parser.arrayCache.push(array); - parser.arrayPos.push(pos); - } - function parseArrayChunks(parser) { - const tmp = parser.arrayCache.pop(); - var pos = parser.arrayPos.pop(); - if (parser.arrayCache.length) { - const res = parseArrayChunks(parser); - if (res === void 0) { - pushArrayCache(parser, tmp, pos); - return; - } - tmp[pos++] = res; - } - return parseArrayElements(parser, tmp, pos); - } - function parseArrayElements(parser, responses, i) { - const bufferLength = parser.buffer.length; - while (i < responses.length) { - const offset = parser.offset; - if (parser.offset >= bufferLength) { - pushArrayCache(parser, responses, i); - return; - } - const response = parseType(parser, parser.buffer[parser.offset++]); - if (response === void 0) { - if (!(parser.arrayCache.length || parser.bufferCache.length)) { - parser.offset = offset; - } - pushArrayCache(parser, responses, i); - return; - } - responses[i] = response; - i++; - } - return responses; - } - function parseType(parser, type) { - switch (type) { - case 36: - return parseBulkString(parser); - case 43: - return parseSimpleString(parser); - case 42: - return parseArray(parser); - case 58: - return parseInteger(parser); - case 45: - return parseError(parser); - default: - return handleError(parser, type); - } - } - function decreaseBufferPool() { - if (bufferPool.length > 50 * 1024) { - if (counter === 1 || notDecreased > counter * 2) { - const minSliceLen = Math.floor(bufferPool.length / 10); - const sliceLength = minSliceLen < bufferOffset ? bufferOffset : minSliceLen; - bufferOffset = 0; - bufferPool = bufferPool.slice(sliceLength, bufferPool.length); - } else { - notDecreased++; - counter--; - } - } else { - clearInterval(interval); - counter = 0; - notDecreased = 0; - interval = null; - } - } - function resizeBuffer(length) { - if (bufferPool.length < length + bufferOffset) { - const multiplier = length > 1024 * 1024 * 75 ? 2 : 3; - if (bufferOffset > 1024 * 1024 * 111) { - bufferOffset = 1024 * 1024 * 50; - } - bufferPool = Buffer2.allocUnsafe(length * multiplier + bufferOffset); - bufferOffset = 0; - counter++; - if (interval === null) { - interval = setInterval(decreaseBufferPool, 50); - } - } - } - function concatBulkString(parser) { - const list = parser.bufferCache; - const oldOffset = parser.offset; - var chunks = list.length; - var offset = parser.bigStrSize - parser.totalChunkSize; - parser.offset = offset; - if (offset <= 2) { - if (chunks === 2) { - return list[0].toString("utf8", oldOffset, list[0].length + offset - 2); - } - chunks--; - offset = list[list.length - 2].length + offset; - } - var res = decoder.write(list[0].slice(oldOffset)); - for (var i = 1; i < chunks - 1; i++) { - res += decoder.write(list[i]); - } - res += decoder.end(list[i].slice(0, offset - 2)); - return res; - } - function concatBulkBuffer(parser) { - const list = parser.bufferCache; - const oldOffset = parser.offset; - const length = parser.bigStrSize - oldOffset - 2; - var chunks = list.length; - var offset = parser.bigStrSize - parser.totalChunkSize; - parser.offset = offset; - if (offset <= 2) { - if (chunks === 2) { - return list[0].slice(oldOffset, list[0].length + offset - 2); - } - chunks--; - offset = list[list.length - 2].length + offset; - } - resizeBuffer(length); - const start = bufferOffset; - list[0].copy(bufferPool, start, oldOffset, list[0].length); - bufferOffset += list[0].length - oldOffset; - for (var i = 1; i < chunks - 1; i++) { - list[i].copy(bufferPool, bufferOffset); - bufferOffset += list[i].length; - } - list[i].copy(bufferPool, bufferOffset, 0, offset - 2); - bufferOffset += offset - 2; - return bufferPool.slice(start, bufferOffset); - } - var JavascriptRedisParser = class { - /** - * Javascript Redis Parser constructor - * @param {{returnError: Function, returnReply: Function, returnFatalError?: Function, returnBuffers: boolean, stringNumbers: boolean }} options - * @constructor - */ - constructor(options) { - if (!options) { - throw new TypeError("Options are mandatory."); - } - if (typeof options.returnError !== "function" || typeof options.returnReply !== "function") { - throw new TypeError("The returnReply and returnError options have to be functions."); - } - this.setReturnBuffers(!!options.returnBuffers); - this.setStringNumbers(!!options.stringNumbers); - this.returnError = options.returnError; - this.returnFatalError = options.returnFatalError || options.returnError; - this.returnReply = options.returnReply; - this.reset(); - } - /** - * Reset the parser values to the initial state - * - * @returns {undefined} - */ - reset() { - this.offset = 0; - this.buffer = null; - this.bigStrSize = 0; - this.totalChunkSize = 0; - this.bufferCache = []; - this.arrayCache = []; - this.arrayPos = []; - } - /** - * Set the returnBuffers option - * - * @param {boolean} returnBuffers - * @returns {undefined} - */ - setReturnBuffers(returnBuffers) { - if (typeof returnBuffers !== "boolean") { - throw new TypeError("The returnBuffers argument has to be a boolean"); - } - this.optionReturnBuffers = returnBuffers; - } - /** - * Set the stringNumbers option - * - * @param {boolean} stringNumbers - * @returns {undefined} - */ - setStringNumbers(stringNumbers) { - if (typeof stringNumbers !== "boolean") { - throw new TypeError("The stringNumbers argument has to be a boolean"); - } - this.optionStringNumbers = stringNumbers; - } - /** - * Parse the redis buffer - * @param {Buffer} buffer - * @returns {undefined} - */ - execute(buffer) { - if (this.buffer === null) { - this.buffer = buffer; - this.offset = 0; - } else if (this.bigStrSize === 0) { - const oldLength = this.buffer.length; - const remainingLength = oldLength - this.offset; - const newBuffer = Buffer2.allocUnsafe(remainingLength + buffer.length); - this.buffer.copy(newBuffer, 0, this.offset, oldLength); - buffer.copy(newBuffer, remainingLength, 0, buffer.length); - this.buffer = newBuffer; - this.offset = 0; - if (this.arrayCache.length) { - const arr = parseArrayChunks(this); - if (arr === void 0) { - return; - } - this.returnReply(arr); - } - } else if (this.totalChunkSize + buffer.length >= this.bigStrSize) { - this.bufferCache.push(buffer); - var tmp = this.optionReturnBuffers ? concatBulkBuffer(this) : concatBulkString(this); - this.bigStrSize = 0; - this.bufferCache = []; - this.buffer = buffer; - if (this.arrayCache.length) { - this.arrayCache[0][this.arrayPos[0]++] = tmp; - tmp = parseArrayChunks(this); - if (tmp === void 0) { - return; - } - } - this.returnReply(tmp); - } else { - this.bufferCache.push(buffer); - this.totalChunkSize += buffer.length; - return; - } - while (this.offset < this.buffer.length) { - const offset = this.offset; - const type = this.buffer[this.offset++]; - const response = parseType(this, type); - if (response === void 0) { - if (!(this.arrayCache.length || this.bufferCache.length)) { - this.offset = offset; - } - return; - } - if (type === 45) { - this.returnError(response); - } else { - this.returnReply(response); - } - } - this.buffer = null; - } - }; - module2.exports = JavascriptRedisParser; - } -}); - -// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js -var require_redis_parser = __commonJS({ - "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js"(exports2, module2) { - "use strict"; - module2.exports = require_parser(); - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js -var require_SubscriptionSet = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var SubscriptionSet = class { - constructor() { - this.set = { - subscribe: {}, - psubscribe: {}, - ssubscribe: {} - }; - } - add(set, channel) { - this.set[mapSet(set)][channel] = true; - } - del(set, channel) { - delete this.set[mapSet(set)][channel]; - } - channels(set) { - return Object.keys(this.set[mapSet(set)]); - } - isEmpty() { - return this.channels("subscribe").length === 0 && this.channels("psubscribe").length === 0 && this.channels("ssubscribe").length === 0; - } - }; - exports2.default = SubscriptionSet; - function mapSet(set) { - if (set === "unsubscribe") { - return "subscribe"; - } - if (set === "punsubscribe") { - return "psubscribe"; - } - if (set === "sunsubscribe") { - return "ssubscribe"; - } - return set; - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js -var require_DataHandler = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var Command_1 = require_Command(); - var utils_1 = require_utils2(); - var RedisParser = require_redis_parser(); - var SubscriptionSet_1 = require_SubscriptionSet(); - var debug = (0, utils_1.Debug)("dataHandler"); - var DataHandler = class { - constructor(redis, parserOptions) { - this.redis = redis; - const parser = new RedisParser({ - stringNumbers: parserOptions.stringNumbers, - returnBuffers: true, - returnError: (err) => { - this.returnError(err); - }, - returnFatalError: (err) => { - this.returnFatalError(err); - }, - returnReply: (reply) => { - this.returnReply(reply); - } - }); - redis.stream.prependListener("data", (data) => { - parser.execute(data); - }); - redis.stream.resume(); - } - returnFatalError(err) { - err.message += ". Please report this."; - this.redis.recoverFromFatalError(err, err, { offlineQueue: false }); - } - returnError(err) { - const item = this.shiftCommand(err); - if (!item) { - return; - } - err.command = { - name: item.command.name, - args: item.command.args - }; - if (item.command.name == "ssubscribe" && err.message.includes("MOVED")) { - this.redis.emit("moved"); - return; - } - this.redis.handleReconnection(err, item); - } - returnReply(reply) { - if (this.handleMonitorReply(reply)) { - return; - } - if (this.handleSubscriberReply(reply)) { - return; - } - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", item.command.name)) { - this.redis.condition.subscriber = new SubscriptionSet_1.default(); - this.redis.condition.subscriber.add(item.command.name, reply[1].toString()); - if (!fillSubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - } else if (Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", item.command.name)) { - if (!fillUnsubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - } else { - item.command.resolve(reply); - } - } - handleSubscriberReply(reply) { - if (!this.redis.condition.subscriber) { - return false; - } - const replyType = Array.isArray(reply) ? reply[0].toString() : null; - debug('receive reply "%s" in subscriber mode', replyType); - switch (replyType) { - case "message": - if (this.redis.listeners("message").length > 0) { - this.redis.emit("message", reply[1].toString(), reply[2] ? reply[2].toString() : ""); - } - this.redis.emit("messageBuffer", reply[1], reply[2]); - break; - case "pmessage": { - const pattern = reply[1].toString(); - if (this.redis.listeners("pmessage").length > 0) { - this.redis.emit("pmessage", pattern, reply[2].toString(), reply[3].toString()); - } - this.redis.emit("pmessageBuffer", pattern, reply[2], reply[3]); - break; - } - case "smessage": { - if (this.redis.listeners("smessage").length > 0) { - this.redis.emit("smessage", reply[1].toString(), reply[2] ? reply[2].toString() : ""); - } - this.redis.emit("smessageBuffer", reply[1], reply[2]); - break; - } - case "ssubscribe": - case "subscribe": - case "psubscribe": { - const channel = reply[1].toString(); - this.redis.condition.subscriber.add(replyType, channel); - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (!fillSubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - break; - } - case "sunsubscribe": - case "unsubscribe": - case "punsubscribe": { - const channel = reply[1] ? reply[1].toString() : null; - if (channel) { - this.redis.condition.subscriber.del(replyType, channel); - } - const count = reply[2]; - if (Number(count) === 0) { - this.redis.condition.subscriber = false; - } - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (!fillUnsubCommand(item.command, count)) { - this.redis.commandQueue.unshift(item); - } - break; - } - default: { - const item = this.shiftCommand(reply); - if (!item) { - return; - } - item.command.resolve(reply); - } - } - return true; - } - handleMonitorReply(reply) { - if (this.redis.status !== "monitoring") { - return false; - } - const replyStr = reply.toString(); - if (replyStr === "OK") { - return false; - } - const len = replyStr.indexOf(" "); - const timestamp = replyStr.slice(0, len); - const argIndex = replyStr.indexOf('"'); - const args = replyStr.slice(argIndex + 1, -1).split('" "').map((elem) => elem.replace(/\\"/g, '"')); - const dbAndSource = replyStr.slice(len + 2, argIndex - 2).split(" "); - this.redis.emit("monitor", timestamp, args, dbAndSource[1], dbAndSource[0]); - return true; - } - shiftCommand(reply) { - const item = this.redis.commandQueue.shift(); - if (!item) { - const message = "Command queue state error. If you can reproduce this, please report it."; - const error = new Error(message + (reply instanceof Error ? ` Last error: ${reply.message}` : ` Last reply: ${reply.toString()}`)); - this.redis.emit("error", error); - return null; - } - return item; - } - }; - exports2.default = DataHandler; - var remainingRepliesMap = /* @__PURE__ */ new WeakMap(); - function fillSubCommand(command, count) { - let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; - remainingReplies -= 1; - if (remainingReplies <= 0) { - command.resolve(count); - remainingRepliesMap.delete(command); - return true; - } - remainingRepliesMap.set(command, remainingReplies); - return false; - } - function fillUnsubCommand(command, count) { - let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; - if (remainingReplies === 0) { - if (Number(count) === 0) { - remainingRepliesMap.delete(command); - command.resolve(count); - return true; - } - return false; - } - remainingReplies -= 1; - if (remainingReplies <= 0) { - command.resolve(count); - return true; - } - remainingRepliesMap.set(command, remainingReplies); - return false; - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js -var require_event_handler = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.readyHandler = exports2.errorHandler = exports2.closeHandler = exports2.connectHandler = void 0; - var redis_errors_1 = require_redis_errors(); - var Command_1 = require_Command(); - var errors_1 = require_errors(); - var utils_1 = require_utils2(); - var DataHandler_1 = require_DataHandler(); - var debug = (0, utils_1.Debug)("connection"); - function connectHandler(self2) { - return function() { - var _a; - self2.setStatus("connect"); - self2.resetCommandQueue(); - let flushed = false; - const { connectionEpoch } = self2; - if (self2.condition.auth) { - self2.auth(self2.condition.auth, function(err) { - if (connectionEpoch !== self2.connectionEpoch) { - return; - } - if (err) { - if (err.message.indexOf("no password is set") !== -1) { - console.warn("[WARN] Redis server does not require a password, but a password was supplied."); - } else if (err.message.indexOf("without any password configured for the default user") !== -1) { - console.warn("[WARN] This Redis server's `default` user does not require a password, but a password was supplied"); - } else if (err.message.indexOf("wrong number of arguments for 'auth' command") !== -1) { - console.warn(`[ERROR] The server returned "wrong number of arguments for 'auth' command". You are probably passing both username and password to Redis version 5 or below. You should only pass the 'password' option for Redis version 5 and under.`); - } else { - flushed = true; - self2.recoverFromFatalError(err, err); - } - } - }); - } - if (self2.condition.select) { - self2.select(self2.condition.select).catch((err) => { - self2.silentEmit("error", err); - }); - } - new DataHandler_1.default(self2, { - stringNumbers: self2.options.stringNumbers - }); - const clientCommandPromises = []; - if (self2.options.connectionName) { - debug("set the connection name [%s]", self2.options.connectionName); - clientCommandPromises.push(self2.client("setname", self2.options.connectionName).catch(utils_1.noop)); - } - if (!self2.options.disableClientInfo) { - debug("set the client info"); - clientCommandPromises.push((0, utils_1.getPackageMeta)().then((packageMeta) => { - return self2.client("SETINFO", "LIB-VER", packageMeta.version).catch(utils_1.noop); - }).catch(utils_1.noop)); - clientCommandPromises.push(self2.client("SETINFO", "LIB-NAME", ((_a = self2.options) === null || _a === void 0 ? void 0 : _a.clientInfoTag) ? `ioredis(${self2.options.clientInfoTag})` : "ioredis").catch(utils_1.noop)); - } - Promise.all(clientCommandPromises).catch(utils_1.noop).finally(() => { - if (!self2.options.enableReadyCheck) { - exports2.readyHandler(self2)(); - } - if (self2.options.enableReadyCheck) { - self2._readyCheck(function(err, info) { - if (connectionEpoch !== self2.connectionEpoch) { - return; - } - if (err) { - if (!flushed) { - self2.recoverFromFatalError(new Error("Ready check failed: " + err.message), err); - } - } else { - if (self2.connector.check(info)) { - exports2.readyHandler(self2)(); - } else { - self2.disconnect(true); - } - } - }); - } - }); - }; - } - exports2.connectHandler = connectHandler; - function abortError(command) { - const err = new redis_errors_1.AbortError("Command aborted due to connection close"); - err.command = { - name: command.name, - args: command.args - }; - return err; - } - function abortIncompletePipelines(commandQueue) { - var _a; - let expectedIndex = 0; - for (let i = 0; i < commandQueue.length; ) { - const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; - const pipelineIndex = command.pipelineIndex; - if (pipelineIndex === void 0 || pipelineIndex === 0) { - expectedIndex = 0; - } - if (pipelineIndex !== void 0 && pipelineIndex !== expectedIndex++) { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - continue; - } - i++; - } - } - function abortTransactionFragments(commandQueue) { - var _a; - for (let i = 0; i < commandQueue.length; ) { - const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; - if (command.name === "multi") { - break; - } - if (command.name === "exec") { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - break; - } - if (command.inTransaction) { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - } else { - i++; - } - } - } - function closeHandler(self2) { - return function() { - const prevStatus = self2.status; - self2.setStatus("close"); - if (self2.commandQueue.length) { - abortIncompletePipelines(self2.commandQueue); - } - if (self2.offlineQueue.length) { - abortTransactionFragments(self2.offlineQueue); - } - if (prevStatus === "ready") { - if (!self2.prevCondition) { - self2.prevCondition = self2.condition; - } - if (self2.commandQueue.length) { - self2.prevCommandQueue = self2.commandQueue; - } - } - if (self2.manuallyClosing) { - self2.manuallyClosing = false; - debug("skip reconnecting since the connection is manually closed."); - return close(); - } - if (typeof self2.options.retryStrategy !== "function") { - debug("skip reconnecting because `retryStrategy` is not a function"); - return close(); - } - const retryDelay = self2.options.retryStrategy(++self2.retryAttempts); - if (typeof retryDelay !== "number") { - debug("skip reconnecting because `retryStrategy` doesn't return a number"); - return close(); - } - debug("reconnect in %sms", retryDelay); - self2.setStatus("reconnecting", retryDelay); - self2.reconnectTimeout = setTimeout(function() { - self2.reconnectTimeout = null; - self2.connect().catch(utils_1.noop); - }, retryDelay); - const { maxRetriesPerRequest } = self2.options; - if (typeof maxRetriesPerRequest === "number") { - if (maxRetriesPerRequest < 0) { - debug("maxRetriesPerRequest is negative, ignoring..."); - } else { - const remainder = self2.retryAttempts % (maxRetriesPerRequest + 1); - if (remainder === 0) { - debug("reach maxRetriesPerRequest limitation, flushing command queue..."); - self2.flushQueue(new errors_1.MaxRetriesPerRequestError(maxRetriesPerRequest)); - } - } - } - }; - function close() { - self2.setStatus("end"); - self2.flushQueue(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - } - } - exports2.closeHandler = closeHandler; - function errorHandler(self2) { - return function(error) { - debug("error: %s", error); - self2.silentEmit("error", error); - }; - } - exports2.errorHandler = errorHandler; - function readyHandler(self2) { - return function() { - self2.setStatus("ready"); - self2.retryAttempts = 0; - if (self2.options.monitor) { - self2.call("monitor").then(() => self2.setStatus("monitoring"), (error) => self2.emit("error", error)); - const { sendCommand } = self2; - self2.sendCommand = function(command) { - if (Command_1.default.checkFlag("VALID_IN_MONITOR_MODE", command.name)) { - return sendCommand.call(self2, command); - } - command.reject(new Error("Connection is in monitoring mode, can't process commands.")); - return command.promise; - }; - self2.once("close", function() { - delete self2.sendCommand; - }); - return; - } - const finalSelect = self2.prevCondition ? self2.prevCondition.select : self2.condition.select; - if (self2.options.readOnly) { - debug("set the connection to readonly mode"); - self2.readonly().catch(utils_1.noop); - } - if (self2.prevCondition) { - const condition = self2.prevCondition; - self2.prevCondition = null; - if (condition.subscriber && self2.options.autoResubscribe) { - if (self2.condition.select !== finalSelect) { - debug("connect to db [%d]", finalSelect); - self2.select(finalSelect); - } - const subscribeChannels = condition.subscriber.channels("subscribe"); - if (subscribeChannels.length) { - debug("subscribe %d channels", subscribeChannels.length); - self2.subscribe(subscribeChannels); - } - const psubscribeChannels = condition.subscriber.channels("psubscribe"); - if (psubscribeChannels.length) { - debug("psubscribe %d channels", psubscribeChannels.length); - self2.psubscribe(psubscribeChannels); - } - const ssubscribeChannels = condition.subscriber.channels("ssubscribe"); - if (ssubscribeChannels.length) { - debug("ssubscribe %s", ssubscribeChannels.length); - for (const channel of ssubscribeChannels) { - self2.ssubscribe(channel); - } - } - } - } - if (self2.prevCommandQueue) { - if (self2.options.autoResendUnfulfilledCommands) { - debug("resend %d unfulfilled commands", self2.prevCommandQueue.length); - while (self2.prevCommandQueue.length > 0) { - const item = self2.prevCommandQueue.shift(); - if (item.select !== self2.condition.select && item.command.name !== "select") { - self2.select(item.select); - } - self2.sendCommand(item.command, item.stream); - } - } else { - self2.prevCommandQueue = null; - } - } - if (self2.offlineQueue.length) { - debug("send %d commands in offline queue", self2.offlineQueue.length); - const offlineQueue = self2.offlineQueue; - self2.resetOfflineQueue(); - while (offlineQueue.length > 0) { - const item = offlineQueue.shift(); - if (item.select !== self2.condition.select && item.command.name !== "select") { - self2.select(item.select); - } - self2.sendCommand(item.command, item.stream); - } - } - if (self2.condition.select !== finalSelect) { - debug("connect to db [%d]", finalSelect); - self2.select(finalSelect); - } - }; - } - exports2.readyHandler = readyHandler; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js -var require_RedisOptions = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_REDIS_OPTIONS = void 0; - exports2.DEFAULT_REDIS_OPTIONS = { - // Connection - port: 6379, - host: "localhost", - family: 0, - connectTimeout: 1e4, - disconnectTimeout: 2e3, - retryStrategy: function(times) { - return Math.min(times * 50, 2e3); - }, - keepAlive: 0, - noDelay: true, - connectionName: null, - disableClientInfo: false, - clientInfoTag: void 0, - // Sentinel - sentinels: null, - name: null, - role: "master", - sentinelRetryStrategy: function(times) { - return Math.min(times * 10, 1e3); - }, - sentinelReconnectStrategy: function() { - return 6e4; - }, - natMap: null, - enableTLSForSentinelMode: false, - updateSentinels: true, - failoverDetector: false, - // Status - username: null, - password: null, - db: 0, - // Others - enableOfflineQueue: true, - enableReadyCheck: true, - autoResubscribe: true, - autoResendUnfulfilledCommands: true, - lazyConnect: false, - keyPrefix: "", - reconnectOnError: null, - readOnly: false, - stringNumbers: false, - maxRetriesPerRequest: 20, - maxLoadingRetryTime: 1e4, - enableAutoPipelining: false, - autoPipeliningIgnoredCommands: [], - sentinelMaxConnections: 10 - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js -var require_Redis = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var events_1 = require("events"); - var standard_as_callback_1 = require_built2(); - var cluster_1 = require_cluster(); - var Command_1 = require_Command(); - var connectors_1 = require_connectors(); - var SentinelConnector_1 = require_SentinelConnector(); - var eventHandler = require_event_handler(); - var RedisOptions_1 = require_RedisOptions(); - var ScanStream_1 = require_ScanStream(); - var transaction_1 = require_transaction(); - var utils_1 = require_utils2(); - var applyMixin_1 = require_applyMixin(); - var Commander_1 = require_Commander(); - var lodash_1 = require_lodash3(); - var Deque = require_denque(); - var debug = (0, utils_1.Debug)("redis"); - var Redis2 = class _Redis extends Commander_1.default { - constructor(arg1, arg2, arg3) { - super(); - this.status = "wait"; - this.isCluster = false; - this.reconnectTimeout = null; - this.connectionEpoch = 0; - this.retryAttempts = 0; - this.manuallyClosing = false; - this._autoPipelines = /* @__PURE__ */ new Map(); - this._runningAutoPipelines = /* @__PURE__ */ new Set(); - this.parseOptions(arg1, arg2, arg3); - events_1.EventEmitter.call(this); - this.resetCommandQueue(); - this.resetOfflineQueue(); - if (this.options.Connector) { - this.connector = new this.options.Connector(this.options); - } else if (this.options.sentinels) { - const sentinelConnector = new SentinelConnector_1.default(this.options); - sentinelConnector.emitter = this; - this.connector = sentinelConnector; - } else { - this.connector = new connectors_1.StandaloneConnector(this.options); - } - if (this.options.scripts) { - Object.entries(this.options.scripts).forEach(([name, definition]) => { - this.defineCommand(name, definition); - }); - } - if (this.options.lazyConnect) { - this.setStatus("wait"); - } else { - this.connect().catch(lodash_1.noop); - } - } - /** - * Create a Redis instance. - * This is the same as `new Redis()` but is included for compatibility with node-redis. - */ - static createClient(...args) { - return new _Redis(...args); - } - get autoPipelineQueueSize() { - let queued = 0; - for (const pipeline of this._autoPipelines.values()) { - queued += pipeline.length; - } - return queued; - } - /** - * Create a connection to Redis. - * This method will be invoked automatically when creating a new Redis instance - * unless `lazyConnect: true` is passed. - * - * When calling this method manually, a Promise is returned, which will - * be resolved when the connection status is ready. The promise can reject - * if the connection fails, times out, or if Redis is already connecting/connected. - */ - connect(callback) { - const promise = new Promise((resolve2, reject) => { - if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { - reject(new Error("Redis is already connecting/connected")); - return; - } - this.connectionEpoch += 1; - this.setStatus("connecting"); - const { options } = this; - this.condition = { - select: options.db, - auth: options.username ? [options.username, options.password] : options.password, - subscriber: false - }; - const _this = this; - (0, standard_as_callback_1.default)(this.connector.connect(function(type, err) { - _this.silentEmit(type, err); - }), function(err, stream) { - if (err) { - _this.flushQueue(err); - _this.silentEmit("error", err); - reject(err); - _this.setStatus("end"); - return; - } - let CONNECT_EVENT = options.tls ? "secureConnect" : "connect"; - if ("sentinels" in options && options.sentinels && !options.enableTLSForSentinelMode) { - CONNECT_EVENT = "connect"; - } - _this.stream = stream; - if (options.noDelay) { - stream.setNoDelay(true); - } - if (typeof options.keepAlive === "number") { - if (stream.connecting) { - stream.once(CONNECT_EVENT, () => { - stream.setKeepAlive(true, options.keepAlive); - }); - } else { - stream.setKeepAlive(true, options.keepAlive); - } - } - if (stream.connecting) { - stream.once(CONNECT_EVENT, eventHandler.connectHandler(_this)); - if (options.connectTimeout) { - let connectTimeoutCleared = false; - stream.setTimeout(options.connectTimeout, function() { - if (connectTimeoutCleared) { - return; - } - stream.setTimeout(0); - stream.destroy(); - const err2 = new Error("connect ETIMEDOUT"); - err2.errorno = "ETIMEDOUT"; - err2.code = "ETIMEDOUT"; - err2.syscall = "connect"; - eventHandler.errorHandler(_this)(err2); - }); - stream.once(CONNECT_EVENT, function() { - connectTimeoutCleared = true; - stream.setTimeout(0); - }); - } - } else if (stream.destroyed) { - const firstError = _this.connector.firstError; - if (firstError) { - process.nextTick(() => { - eventHandler.errorHandler(_this)(firstError); - }); - } - process.nextTick(eventHandler.closeHandler(_this)); - } else { - process.nextTick(eventHandler.connectHandler(_this)); - } - if (!stream.destroyed) { - stream.once("error", eventHandler.errorHandler(_this)); - stream.once("close", eventHandler.closeHandler(_this)); - } - const connectionReadyHandler = function() { - _this.removeListener("close", connectionCloseHandler); - resolve2(); - }; - var connectionCloseHandler = function() { - _this.removeListener("ready", connectionReadyHandler); - reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - }; - _this.once("ready", connectionReadyHandler); - _this.once("close", connectionCloseHandler); - }); - }); - return (0, standard_as_callback_1.default)(promise, callback); - } - /** - * Disconnect from Redis. - * - * This method closes the connection immediately, - * and may lose some pending replies that haven't written to client. - * If you want to wait for the pending replies, use Redis#quit instead. - */ - disconnect(reconnect = false) { - if (!reconnect) { - this.manuallyClosing = true; - } - if (this.reconnectTimeout && !reconnect) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - } - if (this.status === "wait") { - eventHandler.closeHandler(this)(); - } else { - this.connector.disconnect(); - } - } - /** - * Disconnect from Redis. - * - * @deprecated - */ - end() { - this.disconnect(); - } - /** - * Create a new instance with the same options as the current one. - * - * @example - * ```js - * var redis = new Redis(6380); - * var anotherRedis = redis.duplicate(); - * ``` - */ - duplicate(override) { - return new _Redis({ ...this.options, ...override }); - } - /** - * Mode of the connection. - * - * One of `"normal"`, `"subscriber"`, or `"monitor"`. When the connection is - * not in `"normal"` mode, certain commands are not allowed. - */ - get mode() { - var _a; - return this.options.monitor ? "monitor" : ((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) ? "subscriber" : "normal"; - } - /** - * Listen for all requests received by the server in real time. - * - * This command will create a new connection to Redis and send a - * MONITOR command via the new connection in order to avoid disturbing - * the current connection. - * - * @param callback The callback function. If omit, a promise will be returned. - * @example - * ```js - * var redis = new Redis(); - * redis.monitor(function (err, monitor) { - * // Entering monitoring mode. - * monitor.on('monitor', function (time, args, source, database) { - * console.log(time + ": " + util.inspect(args)); - * }); - * }); - * - * // supports promise as well as other commands - * redis.monitor().then(function (monitor) { - * monitor.on('monitor', function (time, args, source, database) { - * console.log(time + ": " + util.inspect(args)); - * }); - * }); - * ``` - */ - monitor(callback) { - const monitorInstance = this.duplicate({ - monitor: true, - lazyConnect: false - }); - return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { - monitorInstance.once("error", reject); - monitorInstance.once("monitoring", function() { - resolve2(monitorInstance); - }); - }), callback); - } - /** - * Send a command to Redis - * - * This method is used internally and in most cases you should not - * use it directly. If you need to send a command that is not supported - * by the library, you can use the `call` method: - * - * ```js - * const redis = new Redis(); - * - * redis.call('set', 'foo', 'bar'); - * // or - * redis.call(['set', 'foo', 'bar']); - * ``` - * - * @ignore - */ - sendCommand(command, stream) { - var _a, _b; - if (this.status === "wait") { - this.connect().catch(lodash_1.noop); - } - if (this.status === "end") { - command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return command.promise; - } - if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) && !Command_1.default.checkFlag("VALID_IN_SUBSCRIBER_MODE", command.name)) { - command.reject(new Error("Connection in subscriber mode, only subscriber commands may be used")); - return command.promise; - } - if (typeof this.options.commandTimeout === "number") { - command.setTimeout(this.options.commandTimeout); - } - let writable = this.status === "ready" || !stream && this.status === "connect" && (0, commands_1.exists)(command.name) && ((0, commands_1.hasFlag)(command.name, "loading") || Command_1.default.checkFlag("HANDSHAKE_COMMANDS", command.name)); - if (!this.stream) { - writable = false; - } else if (!this.stream.writable) { - writable = false; - } else if (this.stream._writableState && this.stream._writableState.ended) { - writable = false; - } - if (!writable) { - if (!this.options.enableOfflineQueue) { - command.reject(new Error("Stream isn't writeable and enableOfflineQueue options is false")); - return command.promise; - } - if (command.name === "quit" && this.offlineQueue.length === 0) { - this.disconnect(); - command.resolve(Buffer.from("OK")); - return command.promise; - } - if (debug.enabled) { - debug("queue command[%s]: %d -> %s(%o)", this._getDescription(), this.condition.select, command.name, command.args); - } - this.offlineQueue.push({ - command, - stream, - select: this.condition.select - }); - } else { - if (debug.enabled) { - debug("write command[%s]: %d -> %s(%o)", this._getDescription(), (_b = this.condition) === null || _b === void 0 ? void 0 : _b.select, command.name, command.args); - } - if (stream) { - if ("isPipeline" in stream && stream.isPipeline) { - stream.write(command.toWritable(stream.destination.redis.stream)); - } else { - stream.write(command.toWritable(stream)); - } - } else { - this.stream.write(command.toWritable(this.stream)); - } - this.commandQueue.push({ - command, - stream, - select: this.condition.select - }); - if (Command_1.default.checkFlag("WILL_DISCONNECT", command.name)) { - this.manuallyClosing = true; - } - if (this.options.socketTimeout !== void 0 && this.socketTimeoutTimer === void 0) { - this.setSocketTimeout(); - } - } - if (command.name === "select" && (0, utils_1.isInt)(command.args[0])) { - const db = parseInt(command.args[0], 10); - if (this.condition.select !== db) { - this.condition.select = db; - this.emit("select", db); - debug("switch to db [%d]", this.condition.select); - } - } - return command.promise; - } - setSocketTimeout() { - this.socketTimeoutTimer = setTimeout(() => { - this.stream.destroy(new Error(`Socket timeout. Expecting data, but didn't receive any in ${this.options.socketTimeout}ms.`)); - this.socketTimeoutTimer = void 0; - }, this.options.socketTimeout); - this.stream.once("data", () => { - clearTimeout(this.socketTimeoutTimer); - this.socketTimeoutTimer = void 0; - if (this.commandQueue.length === 0) - return; - this.setSocketTimeout(); - }); - } - scanStream(options) { - return this.createScanStream("scan", { options }); - } - scanBufferStream(options) { - return this.createScanStream("scanBuffer", { options }); - } - sscanStream(key, options) { - return this.createScanStream("sscan", { key, options }); - } - sscanBufferStream(key, options) { - return this.createScanStream("sscanBuffer", { key, options }); - } - hscanStream(key, options) { - return this.createScanStream("hscan", { key, options }); - } - hscanBufferStream(key, options) { - return this.createScanStream("hscanBuffer", { key, options }); - } - zscanStream(key, options) { - return this.createScanStream("zscan", { key, options }); - } - zscanBufferStream(key, options) { - return this.createScanStream("zscanBuffer", { key, options }); - } - /** - * Emit only when there's at least one listener. - * - * @ignore - */ - silentEmit(eventName, arg) { - let error; - if (eventName === "error") { - error = arg; - if (this.status === "end") { - return; - } - if (this.manuallyClosing) { - if (error instanceof Error && (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG || // @ts-expect-error - error.syscall === "connect" || // @ts-expect-error - error.syscall === "read")) { - return; - } - } - } - if (this.listeners(eventName).length > 0) { - return this.emit.apply(this, arguments); - } - if (error && error instanceof Error) { - console.error("[ioredis] Unhandled error event:", error.stack); - } - return false; - } - /** - * @ignore - */ - recoverFromFatalError(_commandError, err, options) { - this.flushQueue(err, options); - this.silentEmit("error", err); - this.disconnect(true); - } - /** - * @ignore - */ - handleReconnection(err, item) { - var _a; - let needReconnect = false; - if (this.options.reconnectOnError && !Command_1.default.checkFlag("IGNORE_RECONNECT_ON_ERROR", item.command.name)) { - needReconnect = this.options.reconnectOnError(err); - } - switch (needReconnect) { - case 1: - case true: - if (this.status !== "reconnecting") { - this.disconnect(true); - } - item.command.reject(err); - break; - case 2: - if (this.status !== "reconnecting") { - this.disconnect(true); - } - if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.select) !== item.select && item.command.name !== "select") { - this.select(item.select); - } - this.sendCommand(item.command); - break; - default: - item.command.reject(err); - } - } - /** - * Get description of the connection. Used for debugging. - */ - _getDescription() { - let description; - if ("path" in this.options && this.options.path) { - description = this.options.path; - } else if (this.stream && this.stream.remoteAddress && this.stream.remotePort) { - description = this.stream.remoteAddress + ":" + this.stream.remotePort; - } else if ("host" in this.options && this.options.host) { - description = this.options.host + ":" + this.options.port; - } else { - description = ""; - } - if (this.options.connectionName) { - description += ` (${this.options.connectionName})`; - } - return description; - } - resetCommandQueue() { - this.commandQueue = new Deque(); - } - resetOfflineQueue() { - this.offlineQueue = new Deque(); - } - parseOptions(...args) { - const options = {}; - let isTls = false; - for (let i = 0; i < args.length; ++i) { - const arg = args[i]; - if (arg === null || typeof arg === "undefined") { - continue; - } - if (typeof arg === "object") { - (0, lodash_1.defaults)(options, arg); - } else if (typeof arg === "string") { - (0, lodash_1.defaults)(options, (0, utils_1.parseURL)(arg)); - if (arg.startsWith("rediss://")) { - isTls = true; - } - } else if (typeof arg === "number") { - options.port = arg; - } else { - throw new Error("Invalid argument " + arg); - } - } - if (isTls) { - (0, lodash_1.defaults)(options, { tls: true }); - } - (0, lodash_1.defaults)(options, _Redis.defaultOptions); - if (typeof options.port === "string") { - options.port = parseInt(options.port, 10); - } - if (typeof options.db === "string") { - options.db = parseInt(options.db, 10); - } - this.options = (0, utils_1.resolveTLSProfile)(options); - } - /** - * Change instance's status - */ - setStatus(status, arg) { - if (debug.enabled) { - debug("status[%s]: %s -> %s", this._getDescription(), this.status || "[empty]", status); - } - this.status = status; - process.nextTick(this.emit.bind(this, status, arg)); - } - createScanStream(command, { key, options = {} }) { - return new ScanStream_1.default({ - objectMode: true, - key, - redis: this, - command, - ...options - }); - } - /** - * Flush offline queue and command queue with error. - * - * @param error The error object to send to the commands - * @param options options - */ - flushQueue(error, options) { - options = (0, lodash_1.defaults)({}, options, { - offlineQueue: true, - commandQueue: true - }); - let item; - if (options.offlineQueue) { - while (item = this.offlineQueue.shift()) { - item.command.reject(error); - } - } - if (options.commandQueue) { - if (this.commandQueue.length > 0) { - if (this.stream) { - this.stream.removeAllListeners("data"); - } - while (item = this.commandQueue.shift()) { - item.command.reject(error); - } - } - } - } - /** - * Check whether Redis has finished loading the persistent data and is able to - * process commands. - */ - _readyCheck(callback) { - const _this = this; - this.info(function(err, res) { - if (err) { - if (err.message && err.message.includes("NOPERM")) { - console.warn(`Skipping the ready check because INFO command fails: "${err.message}". You can disable ready check with "enableReadyCheck". More: https://github.com/luin/ioredis/wiki/Disable-ready-check.`); - return callback(null, {}); - } - return callback(err); - } - if (typeof res !== "string") { - return callback(null, res); - } - const info = {}; - const lines = res.split("\r\n"); - for (let i = 0; i < lines.length; ++i) { - const [fieldName, ...fieldValueParts] = lines[i].split(":"); - const fieldValue = fieldValueParts.join(":"); - if (fieldValue) { - info[fieldName] = fieldValue; - } - } - if (!info.loading || info.loading === "0") { - callback(null, info); - } else { - const loadingEtaMs = (info.loading_eta_seconds || 1) * 1e3; - const retryTime = _this.options.maxLoadingRetryTime && _this.options.maxLoadingRetryTime < loadingEtaMs ? _this.options.maxLoadingRetryTime : loadingEtaMs; - debug("Redis server still loading, trying again in " + retryTime + "ms"); - setTimeout(function() { - _this._readyCheck(callback); - }, retryTime); - } - }).catch(lodash_1.noop); - } - }; - Redis2.Cluster = cluster_1.default; - Redis2.Command = Command_1.default; - Redis2.defaultOptions = RedisOptions_1.DEFAULT_REDIS_OPTIONS; - (0, applyMixin_1.default)(Redis2, events_1.EventEmitter); - (0, transaction_1.addTransactionSupport)(Redis2.prototype); - exports2.default = Redis2; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js -var require_built3 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.print = exports2.ReplyError = exports2.SentinelIterator = exports2.SentinelConnector = exports2.AbstractConnector = exports2.Pipeline = exports2.ScanStream = exports2.Command = exports2.Cluster = exports2.Redis = exports2.default = void 0; - exports2 = module2.exports = require_Redis().default; - var Redis_1 = require_Redis(); - Object.defineProperty(exports2, "default", { enumerable: true, get: function() { - return Redis_1.default; - } }); - var Redis_2 = require_Redis(); - Object.defineProperty(exports2, "Redis", { enumerable: true, get: function() { - return Redis_2.default; - } }); - var cluster_1 = require_cluster(); - Object.defineProperty(exports2, "Cluster", { enumerable: true, get: function() { - return cluster_1.default; - } }); - var Command_1 = require_Command(); - Object.defineProperty(exports2, "Command", { enumerable: true, get: function() { - return Command_1.default; - } }); - var ScanStream_1 = require_ScanStream(); - Object.defineProperty(exports2, "ScanStream", { enumerable: true, get: function() { - return ScanStream_1.default; - } }); - var Pipeline_1 = require_Pipeline(); - Object.defineProperty(exports2, "Pipeline", { enumerable: true, get: function() { - return Pipeline_1.default; - } }); - var AbstractConnector_1 = require_AbstractConnector(); - Object.defineProperty(exports2, "AbstractConnector", { enumerable: true, get: function() { - return AbstractConnector_1.default; - } }); - var SentinelConnector_1 = require_SentinelConnector(); - Object.defineProperty(exports2, "SentinelConnector", { enumerable: true, get: function() { - return SentinelConnector_1.default; - } }); - Object.defineProperty(exports2, "SentinelIterator", { enumerable: true, get: function() { - return SentinelConnector_1.SentinelIterator; - } }); - exports2.ReplyError = require_redis_errors().ReplyError; - Object.defineProperty(exports2, "Promise", { - get() { - console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); - return Promise; - }, - set(_lib) { - console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); - } - }); - function print(err, reply) { - if (err) { - console.log("Error: " + err); - } else { - console.log("Reply: " + reply); - } - } - exports2.print = print; - } -}); - -// node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js -var require_main = __commonJS({ - "node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var node_exports = {}; - __export2(node_exports, { - analyzeMetafile: () => analyzeMetafile, - analyzeMetafileSync: () => analyzeMetafileSync, - build: () => build2, - buildSync: () => buildSync, - context: () => context, - default: () => node_default, - formatMessages: () => formatMessages, - formatMessagesSync: () => formatMessagesSync, - initialize: () => initialize, - stop: () => stop, - transform: () => transform, - transformSync: () => transformSync, - version: () => version - }); - module2.exports = __toCommonJS2(node_exports); - function encodePacket(packet) { - let visit = (value) => { - if (value === null) { - bb.write8(0); - } else if (typeof value === "boolean") { - bb.write8(1); - bb.write8(+value); - } else if (typeof value === "number") { - bb.write8(2); - bb.write32(value | 0); - } else if (typeof value === "string") { - bb.write8(3); - bb.write(encodeUTF8(value)); - } else if (value instanceof Uint8Array) { - bb.write8(4); - bb.write(value); - } else if (value instanceof Array) { - bb.write8(5); - bb.write32(value.length); - for (let item of value) { - visit(item); - } - } else { - let keys = Object.keys(value); - bb.write8(6); - bb.write32(keys.length); - for (let key of keys) { - bb.write(encodeUTF8(key)); - visit(value[key]); - } - } - }; - let bb = new ByteBuffer(); - bb.write32(0); - bb.write32(packet.id << 1 | +!packet.isRequest); - visit(packet.value); - writeUInt32LE(bb.buf, bb.len - 4, 0); - return bb.buf.subarray(0, bb.len); - } - function decodePacket(bytes) { - let visit = () => { - switch (bb.read8()) { - case 0: - return null; - case 1: - return !!bb.read8(); - case 2: - return bb.read32(); - case 3: - return decodeUTF8(bb.read()); - case 4: - return bb.read(); - case 5: { - let count = bb.read32(); - let value2 = []; - for (let i = 0; i < count; i++) { - value2.push(visit()); - } - return value2; - } - case 6: { - let count = bb.read32(); - let value2 = {}; - for (let i = 0; i < count; i++) { - value2[decodeUTF8(bb.read())] = visit(); - } - return value2; - } - default: - throw new Error("Invalid packet"); - } - }; - let bb = new ByteBuffer(bytes); - let id = bb.read32(); - let isRequest = (id & 1) === 0; - id >>>= 1; - let value = visit(); - if (bb.ptr !== bytes.length) { - throw new Error("Invalid packet"); - } - return { id, isRequest, value }; - } - var ByteBuffer = class { - constructor(buf = new Uint8Array(1024)) { - this.buf = buf; - this.len = 0; - this.ptr = 0; - } - _write(delta) { - if (this.len + delta > this.buf.length) { - let clone = new Uint8Array((this.len + delta) * 2); - clone.set(this.buf); - this.buf = clone; - } - this.len += delta; - return this.len - delta; - } - write8(value) { - let offset = this._write(1); - this.buf[offset] = value; - } - write32(value) { - let offset = this._write(4); - writeUInt32LE(this.buf, value, offset); - } - write(bytes) { - let offset = this._write(4 + bytes.length); - writeUInt32LE(this.buf, bytes.length, offset); - this.buf.set(bytes, offset + 4); - } - _read(delta) { - if (this.ptr + delta > this.buf.length) { - throw new Error("Invalid packet"); - } - this.ptr += delta; - return this.ptr - delta; - } - read8() { - return this.buf[this._read(1)]; - } - read32() { - return readUInt32LE(this.buf, this._read(4)); - } - read() { - let length = this.read32(); - let bytes = new Uint8Array(length); - let ptr = this._read(bytes.length); - bytes.set(this.buf.subarray(ptr, ptr + length)); - return bytes; - } - }; - var encodeUTF8; - var decodeUTF8; - var encodeInvariant; - if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { - let encoder = new TextEncoder(); - let decoder = new TextDecoder(); - encodeUTF8 = (text) => encoder.encode(text); - decodeUTF8 = (bytes) => decoder.decode(bytes); - encodeInvariant = 'new TextEncoder().encode("")'; - } else if (typeof Buffer !== "undefined") { - encodeUTF8 = (text) => Buffer.from(text); - decodeUTF8 = (bytes) => { - let { buffer, byteOffset, byteLength } = bytes; - return Buffer.from(buffer, byteOffset, byteLength).toString(); - }; - encodeInvariant = 'Buffer.from("")'; - } else { - throw new Error("No UTF-8 codec found"); - } - if (!(encodeUTF8("") instanceof Uint8Array)) - throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false - -This indicates that your JavaScript environment is broken. You cannot use -esbuild in this environment because esbuild relies on this invariant. This -is not a problem with esbuild. You need to fix your environment instead. -`); - function readUInt32LE(buffer, offset) { - return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; - } - function writeUInt32LE(buffer, value, offset) { - buffer[offset++] = value; - buffer[offset++] = value >> 8; - buffer[offset++] = value >> 16; - buffer[offset++] = value >> 24; - } - var quote = JSON.stringify; - var buildLogLevelDefault = "warning"; - var transformLogLevelDefault = "silent"; - function validateTarget(target) { - validateStringValue(target, "target"); - if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); - return target; - } - var canBeAnything = () => null; - var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; - var mustBeString = (value) => typeof value === "string" ? null : "a string"; - var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; - var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; - var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; - var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; - var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; - var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; - var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; - var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; - var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; - var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; - var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; - var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; - var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; - function getFlag(object, keys, key, mustBeFn) { - let value = object[key]; - keys[key + ""] = true; - if (value === void 0) return void 0; - let mustBe = mustBeFn(value); - if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); - return value; - } - function checkForInvalidFlags(object, keys, where) { - for (let key in object) { - if (!(key in keys)) { - throw new Error(`Invalid option ${where}: ${quote(key)}`); - } - } - } - function validateInitializeOptions(options) { - let keys = /* @__PURE__ */ Object.create(null); - let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); - let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); - let worker = getFlag(options, keys, "worker", mustBeBoolean); - checkForInvalidFlags(options, keys, "in initialize() call"); - return { - wasmURL, - wasmModule, - worker - }; - } - function validateMangleCache(mangleCache) { - let validated; - if (mangleCache !== void 0) { - validated = /* @__PURE__ */ Object.create(null); - for (let key in mangleCache) { - let value = mangleCache[key]; - if (typeof value === "string" || value === false) { - validated[key] = value; - } else { - throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); - } - } - } - return validated; - } - function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { - let color = getFlag(options, keys, "color", mustBeBoolean); - let logLevel = getFlag(options, keys, "logLevel", mustBeString); - let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); - if (color !== void 0) flags.push(`--color=${color}`); - else if (isTTY2) flags.push(`--color=true`); - flags.push(`--log-level=${logLevel || logLevelDefault}`); - flags.push(`--log-limit=${logLimit || 0}`); - } - function validateStringValue(value, what, key) { - if (typeof value !== "string") { - throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); - } - return value; - } - function pushCommonFlags(flags, options, keys) { - let legalComments = getFlag(options, keys, "legalComments", mustBeString); - let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); - let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); - let target = getFlag(options, keys, "target", mustBeStringOrArray); - let format = getFlag(options, keys, "format", mustBeString); - let globalName = getFlag(options, keys, "globalName", mustBeString); - let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); - let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); - let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); - let minify = getFlag(options, keys, "minify", mustBeBoolean); - let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); - let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); - let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); - let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); - let drop = getFlag(options, keys, "drop", mustBeArray); - let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); - let charset = getFlag(options, keys, "charset", mustBeString); - let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); - let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); - let jsx = getFlag(options, keys, "jsx", mustBeString); - let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); - let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); - let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); - let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); - let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); - let define = getFlag(options, keys, "define", mustBeObject); - let logOverride = getFlag(options, keys, "logOverride", mustBeObject); - let supported = getFlag(options, keys, "supported", mustBeObject); - let pure = getFlag(options, keys, "pure", mustBeArray); - let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); - let platform = getFlag(options, keys, "platform", mustBeString); - let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); - if (legalComments) flags.push(`--legal-comments=${legalComments}`); - if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); - if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); - if (target) { - if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); - else flags.push(`--target=${validateTarget(target)}`); - } - if (format) flags.push(`--format=${format}`); - if (globalName) flags.push(`--global-name=${globalName}`); - if (platform) flags.push(`--platform=${platform}`); - if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); - if (minify) flags.push("--minify"); - if (minifySyntax) flags.push("--minify-syntax"); - if (minifyWhitespace) flags.push("--minify-whitespace"); - if (minifyIdentifiers) flags.push("--minify-identifiers"); - if (lineLimit) flags.push(`--line-limit=${lineLimit}`); - if (charset) flags.push(`--charset=${charset}`); - if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); - if (ignoreAnnotations) flags.push(`--ignore-annotations`); - if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); - if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); - if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); - if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); - if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); - if (jsx) flags.push(`--jsx=${jsx}`); - if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); - if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); - if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); - if (jsxDev) flags.push(`--jsx-dev`); - if (jsxSideEffects) flags.push(`--jsx-side-effects`); - if (define) { - for (let key in define) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); - flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); - } - } - if (logOverride) { - for (let key in logOverride) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); - flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); - } - } - if (supported) { - for (let key in supported) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); - const value = supported[key]; - if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); - flags.push(`--supported:${key}=${value}`); - } - } - if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); - if (keepNames) flags.push(`--keep-names`); - } - function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { - var _a2; - let flags = []; - let entries = []; - let keys = /* @__PURE__ */ Object.create(null); - let stdinContents = null; - let stdinResolveDir = null; - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let bundle = getFlag(options, keys, "bundle", mustBeBoolean); - let splitting = getFlag(options, keys, "splitting", mustBeBoolean); - let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); - let metafile = getFlag(options, keys, "metafile", mustBeBoolean); - let outfile = getFlag(options, keys, "outfile", mustBeString); - let outdir = getFlag(options, keys, "outdir", mustBeString); - let outbase = getFlag(options, keys, "outbase", mustBeString); - let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); - let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); - let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); - let mainFields = getFlag(options, keys, "mainFields", mustBeArray); - let conditions = getFlag(options, keys, "conditions", mustBeArray); - let external = getFlag(options, keys, "external", mustBeArray); - let packages = getFlag(options, keys, "packages", mustBeString); - let alias = getFlag(options, keys, "alias", mustBeObject); - let loader = getFlag(options, keys, "loader", mustBeObject); - let outExtension = getFlag(options, keys, "outExtension", mustBeObject); - let publicPath = getFlag(options, keys, "publicPath", mustBeString); - let entryNames = getFlag(options, keys, "entryNames", mustBeString); - let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); - let assetNames = getFlag(options, keys, "assetNames", mustBeString); - let inject = getFlag(options, keys, "inject", mustBeArray); - let banner = getFlag(options, keys, "banner", mustBeObject); - let footer = getFlag(options, keys, "footer", mustBeObject); - let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); - let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); - let stdin = getFlag(options, keys, "stdin", mustBeObject); - let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; - let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - keys.plugins = true; - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); - if (bundle) flags.push("--bundle"); - if (allowOverwrite) flags.push("--allow-overwrite"); - if (splitting) flags.push("--splitting"); - if (preserveSymlinks) flags.push("--preserve-symlinks"); - if (metafile) flags.push(`--metafile`); - if (outfile) flags.push(`--outfile=${outfile}`); - if (outdir) flags.push(`--outdir=${outdir}`); - if (outbase) flags.push(`--outbase=${outbase}`); - if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); - if (packages) flags.push(`--packages=${packages}`); - if (resolveExtensions) { - let values = []; - for (let value of resolveExtensions) { - validateStringValue(value, "resolve extension"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); - values.push(value); - } - flags.push(`--resolve-extensions=${values.join(",")}`); - } - if (publicPath) flags.push(`--public-path=${publicPath}`); - if (entryNames) flags.push(`--entry-names=${entryNames}`); - if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); - if (assetNames) flags.push(`--asset-names=${assetNames}`); - if (mainFields) { - let values = []; - for (let value of mainFields) { - validateStringValue(value, "main field"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); - values.push(value); - } - flags.push(`--main-fields=${values.join(",")}`); - } - if (conditions) { - let values = []; - for (let value of conditions) { - validateStringValue(value, "condition"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); - values.push(value); - } - flags.push(`--conditions=${values.join(",")}`); - } - if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); - if (alias) { - for (let old in alias) { - if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); - flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); - } - } - if (banner) { - for (let type in banner) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); - flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); - } - } - if (footer) { - for (let type in footer) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); - flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); - } - } - if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); - if (loader) { - for (let ext in loader) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); - flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); - } - } - if (outExtension) { - for (let ext in outExtension) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); - flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); - } - } - if (entryPoints) { - if (Array.isArray(entryPoints)) { - for (let i = 0, n = entryPoints.length; i < n; i++) { - let entryPoint = entryPoints[i]; - if (typeof entryPoint === "object" && entryPoint !== null) { - let entryPointKeys = /* @__PURE__ */ Object.create(null); - let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); - let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); - checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); - if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); - if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); - entries.push([output, input]); - } else { - entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); - } - } - } else { - for (let key in entryPoints) { - entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); - } - } - } - if (stdin) { - let stdinKeys = /* @__PURE__ */ Object.create(null); - let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); - let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); - let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); - checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader2) flags.push(`--loader=${loader2}`); - if (resolveDir) stdinResolveDir = resolveDir; - if (typeof contents === "string") stdinContents = encodeUTF8(contents); - else if (contents instanceof Uint8Array) stdinContents = contents; - } - let nodePaths = []; - if (nodePathsInput) { - for (let value of nodePathsInput) { - value += ""; - nodePaths.push(value); - } - } - return { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache: validateMangleCache(mangleCache) - }; - } - function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { - let flags = []; - let keys = /* @__PURE__ */ Object.create(null); - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); - let loader = getFlag(options, keys, "loader", mustBeString); - let banner = getFlag(options, keys, "banner", mustBeString); - let footer = getFlag(options, keys, "footer", mustBeString); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader) flags.push(`--loader=${loader}`); - if (banner) flags.push(`--banner=${banner}`); - if (footer) flags.push(`--footer=${footer}`); - return { - flags, - mangleCache: validateMangleCache(mangleCache) - }; - } - function createChannel(streamIn) { - const requestCallbacksByKey = {}; - const closeData = { didClose: false, reason: "" }; - let responseCallbacks = {}; - let nextRequestID = 0; - let nextBuildKey = 0; - let stdout = new Uint8Array(16 * 1024); - let stdoutUsed = 0; - let readFromStdout = (chunk) => { - let limit = stdoutUsed + chunk.length; - if (limit > stdout.length) { - let swap = new Uint8Array(limit * 2); - swap.set(stdout); - stdout = swap; - } - stdout.set(chunk, stdoutUsed); - stdoutUsed += chunk.length; - let offset = 0; - while (offset + 4 <= stdoutUsed) { - let length = readUInt32LE(stdout, offset); - if (offset + 4 + length > stdoutUsed) { - break; - } - offset += 4; - handleIncomingPacket(stdout.subarray(offset, offset + length)); - offset += length; - } - if (offset > 0) { - stdout.copyWithin(0, offset, stdoutUsed); - stdoutUsed -= offset; - } - }; - let afterClose = (error) => { - closeData.didClose = true; - if (error) closeData.reason = ": " + (error.message || error); - const text = "The service was stopped" + closeData.reason; - for (let id in responseCallbacks) { - responseCallbacks[id](text, null); - } - responseCallbacks = {}; - }; - let sendRequest = (refs, value, callback) => { - if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); - let id = nextRequestID++; - responseCallbacks[id] = (error, response) => { - try { - callback(error, response); - } finally { - if (refs) refs.unref(); - } - }; - if (refs) refs.ref(); - streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); - }; - let sendResponse = (id, value) => { - if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); - streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); - }; - let handleRequest = async (id, request) => { - try { - if (request.command === "ping") { - sendResponse(id, {}); - return; - } - if (typeof request.key === "number") { - const requestCallbacks = requestCallbacksByKey[request.key]; - if (!requestCallbacks) { - return; - } - const callback = requestCallbacks[request.command]; - if (callback) { - await callback(id, request); - return; - } - } - throw new Error(`Invalid command: ` + request.command); - } catch (e) { - const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; - try { - sendResponse(id, { errors }); - } catch { - } - } - }; - let isFirstPacket = true; - let handleIncomingPacket = (bytes) => { - if (isFirstPacket) { - isFirstPacket = false; - let binaryVersion = String.fromCharCode(...bytes); - if (binaryVersion !== "0.24.2") { - throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`); - } - return; - } - let packet = decodePacket(bytes); - if (packet.isRequest) { - handleRequest(packet.id, packet.value); - } else { - let callback = responseCallbacks[packet.id]; - delete responseCallbacks[packet.id]; - if (packet.value.error) callback(packet.value.error, {}); - else callback(null, packet.value); - } - }; - let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { - let refCount = 0; - const buildKey = nextBuildKey++; - const requestCallbacks = {}; - const buildRefs = { - ref() { - if (++refCount === 1) { - if (refs) refs.ref(); - } - }, - unref() { - if (--refCount === 0) { - delete requestCallbacksByKey[buildKey]; - if (refs) refs.unref(); - } - } - }; - requestCallbacksByKey[buildKey] = requestCallbacks; - buildRefs.ref(); - buildOrContextImpl( - callName, - buildKey, - sendRequest, - sendResponse, - buildRefs, - streamIn, - requestCallbacks, - options, - isTTY2, - defaultWD2, - (err, res) => { - try { - callback(err, res); - } finally { - buildRefs.unref(); - } - } - ); - }; - let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { - const details = createObjectStash(); - let start = (inputPath) => { - try { - if (typeof input !== "string" && !(input instanceof Uint8Array)) - throw new Error('The input to "transform" must be a string or a Uint8Array'); - let { - flags, - mangleCache - } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); - let request = { - command: "transform", - flags, - inputFS: inputPath !== null, - input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input - }; - if (mangleCache) request.mangleCache = mangleCache; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - let errors = replaceDetailsInMessages(response.errors, details); - let warnings = replaceDetailsInMessages(response.warnings, details); - let outstanding = 1; - let next = () => { - if (--outstanding === 0) { - let result = { - warnings, - code: response.code, - map: response.map, - mangleCache: void 0, - legalComments: void 0 - }; - if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; - if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; - callback(null, result); - } - }; - if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); - if (response.codeFS) { - outstanding++; - fs3.readFile(response.code, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.code = contents; - next(); - } - }); - } - if (response.mapFS) { - outstanding++; - fs3.readFile(response.map, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.map = contents; - next(); - } - }); - } - next(); - }); - } catch (e) { - let flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); - } catch { - } - const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); - sendRequest(refs, { command: "error", flags, error }, () => { - error.detail = details.load(error.detail); - callback(failureErrorWithLog("Transform failed", [error], []), null); - }); - } - }; - if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { - let next = start; - start = () => fs3.writeFile(input, next); - } - start(null); - }; - let formatMessages2 = ({ callName, refs, messages, options, callback }) => { - if (!options) throw new Error(`Missing second argument in ${callName}() call`); - let keys = {}; - let kind = getFlag(options, keys, "kind", mustBeString); - let color = getFlag(options, keys, "color", mustBeBoolean); - let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); - if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); - let request = { - command: "format-msgs", - messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), - isWarning: kind === "warning" - }; - if (color !== void 0) request.color = color; - if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.messages); - }); - }; - let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { - if (options === void 0) options = {}; - let keys = {}; - let color = getFlag(options, keys, "color", mustBeBoolean); - let verbose = getFlag(options, keys, "verbose", mustBeBoolean); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - let request = { - command: "analyze-metafile", - metafile - }; - if (color !== void 0) request.color = color; - if (verbose !== void 0) request.verbose = verbose; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.result); - }); - }; - return { - readFromStdout, - afterClose, - service: { - buildOrContext, - transform: transform2, - formatMessages: formatMessages2, - analyzeMetafile: analyzeMetafile2 - } - }; - } - function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { - const details = createObjectStash(); - const isContext = callName === "context"; - const handleError = (e, pluginName) => { - const flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); - } catch { - } - const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); - sendRequest(refs, { command: "error", flags, error: message }, () => { - message.detail = details.load(message.detail); - callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); - }); - }; - let plugins; - if (typeof options === "object") { - const value = options.plugins; - if (value !== void 0) { - if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); - plugins = value; - } - } - if (plugins && plugins.length > 0) { - if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); - handlePlugins( - buildKey, - sendRequest, - sendResponse, - refs, - streamIn, - requestCallbacks, - options, - plugins, - details - ).then( - (result) => { - if (!result.ok) return handleError(result.error, result.pluginName); - try { - buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); - } catch (e) { - handleError(e, ""); - } - }, - (e) => handleError(e, "") - ); - return; - } - try { - buildOrContextContinue(null, (result, done) => done([], []), () => { - }); - } catch (e) { - handleError(e, ""); - } - function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { - const writeDefault = streamIn.hasFS; - const { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache - } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); - if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); - const request = { - command: "build", - key: buildKey, - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir: absWorkingDir || defaultWD2, - nodePaths, - context: isContext - }; - if (requestPlugins) request.plugins = requestPlugins; - if (mangleCache) request.mangleCache = mangleCache; - const buildResponseToResult = (response, callback2) => { - const result = { - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - outputFiles: void 0, - metafile: void 0, - mangleCache: void 0 - }; - const originalErrors = result.errors.slice(); - const originalWarnings = result.warnings.slice(); - if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); - if (response.metafile) result.metafile = JSON.parse(response.metafile); - if (response.mangleCache) result.mangleCache = response.mangleCache; - if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); - runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { - if (originalErrors.length > 0 || onEndErrors.length > 0) { - const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); - return callback2(error, null, onEndErrors, onEndWarnings); - } - callback2(null, result, onEndErrors, onEndWarnings); - }); - }; - let latestResultPromise; - let provideLatestResult; - if (isContext) - requestCallbacks["on-end"] = (id, request2) => new Promise((resolve2) => { - buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { - const response = { - errors: onEndErrors, - warnings: onEndWarnings - }; - if (provideLatestResult) provideLatestResult(err, result); - latestResultPromise = void 0; - provideLatestResult = void 0; - sendResponse(id, response); - resolve2(); - }); - }); - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - if (!isContext) { - return buildResponseToResult(response, (err, res) => { - scheduleOnDisposeCallbacks(); - return callback(err, res); - }); - } - if (response.errors.length > 0) { - return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); - } - let didDispose = false; - const result = { - rebuild: () => { - if (!latestResultPromise) latestResultPromise = new Promise((resolve2, reject) => { - let settlePromise; - provideLatestResult = (err, result2) => { - if (!settlePromise) settlePromise = () => err ? reject(err) : resolve2(result2); - }; - const triggerAnotherBuild = () => { - const request2 = { - command: "rebuild", - key: buildKey - }; - sendRequest(refs, request2, (error2, response2) => { - if (error2) { - reject(new Error(error2)); - } else if (settlePromise) { - settlePromise(); - } else { - triggerAnotherBuild(); - } - }); - }; - triggerAnotherBuild(); - }); - return latestResultPromise; - }, - watch: (options2 = {}) => new Promise((resolve2, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); - const keys = {}; - checkForInvalidFlags(options2, keys, `in watch() call`); - const request2 = { - command: "watch", - key: buildKey - }; - sendRequest(refs, request2, (error2) => { - if (error2) reject(new Error(error2)); - else resolve2(void 0); - }); - }), - serve: (options2 = {}) => new Promise((resolve2, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); - const keys = {}; - const port = getFlag(options2, keys, "port", mustBeInteger); - const host = getFlag(options2, keys, "host", mustBeString); - const servedir = getFlag(options2, keys, "servedir", mustBeString); - const keyfile = getFlag(options2, keys, "keyfile", mustBeString); - const certfile = getFlag(options2, keys, "certfile", mustBeString); - const fallback = getFlag(options2, keys, "fallback", mustBeString); - const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); - checkForInvalidFlags(options2, keys, `in serve() call`); - const request2 = { - command: "serve", - key: buildKey, - onRequest: !!onRequest - }; - if (port !== void 0) request2.port = port; - if (host !== void 0) request2.host = host; - if (servedir !== void 0) request2.servedir = servedir; - if (keyfile !== void 0) request2.keyfile = keyfile; - if (certfile !== void 0) request2.certfile = certfile; - if (fallback !== void 0) request2.fallback = fallback; - sendRequest(refs, request2, (error2, response2) => { - if (error2) return reject(new Error(error2)); - if (onRequest) { - requestCallbacks["serve-request"] = (id, request3) => { - onRequest(request3.args); - sendResponse(id, {}); - }; - } - resolve2(response2); - }); - }), - cancel: () => new Promise((resolve2) => { - if (didDispose) return resolve2(); - const request2 = { - command: "cancel", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve2(); - }); - }), - dispose: () => new Promise((resolve2) => { - if (didDispose) return resolve2(); - didDispose = true; - const request2 = { - command: "dispose", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve2(); - scheduleOnDisposeCallbacks(); - refs.unref(); - }); - }) - }; - refs.ref(); - callback(null, result); - }); - } - } - var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { - let onStartCallbacks = []; - let onEndCallbacks = []; - let onResolveCallbacks = {}; - let onLoadCallbacks = {}; - let onDisposeCallbacks = []; - let nextCallbackID = 0; - let i = 0; - let requestPlugins = []; - let isSetupDone = false; - plugins = [...plugins]; - for (let item of plugins) { - let keys = {}; - if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); - const name = getFlag(item, keys, "name", mustBeString); - if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); - try { - let setup = getFlag(item, keys, "setup", mustBeFunction); - if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); - checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); - let plugin = { - name, - onStart: false, - onEnd: false, - onResolve: [], - onLoad: [] - }; - i++; - let resolve2 = (path3, options = {}) => { - if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); - if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); - let keys2 = /* @__PURE__ */ Object.create(null); - let pluginName = getFlag(options, keys2, "pluginName", mustBeString); - let importer = getFlag(options, keys2, "importer", mustBeString); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); - let kind = getFlag(options, keys2, "kind", mustBeString); - let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); - let importAttributes = getFlag(options, keys2, "with", mustBeObject); - checkForInvalidFlags(options, keys2, "in resolve() call"); - return new Promise((resolve22, reject) => { - const request = { - command: "resolve", - path: path3, - key: buildKey, - pluginName: name - }; - if (pluginName != null) request.pluginName = pluginName; - if (importer != null) request.importer = importer; - if (namespace != null) request.namespace = namespace; - if (resolveDir != null) request.resolveDir = resolveDir; - if (kind != null) request.kind = kind; - else throw new Error(`Must specify "kind" when calling "resolve"`); - if (pluginData != null) request.pluginData = details.store(pluginData); - if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); - sendRequest(refs, request, (error, response) => { - if (error !== null) reject(new Error(error)); - else resolve22({ - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - path: response.path, - external: response.external, - sideEffects: response.sideEffects, - namespace: response.namespace, - suffix: response.suffix, - pluginData: details.load(response.pluginData) - }); - }); - }); - }; - let promise = setup({ - initialOptions, - resolve: resolve2, - onStart(callback) { - let registeredText = `This error came from the "onStart" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); - onStartCallbacks.push({ name, callback, note: registeredNote }); - plugin.onStart = true; - }, - onEnd(callback) { - let registeredText = `This error came from the "onEnd" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); - onEndCallbacks.push({ name, callback, note: registeredNote }); - plugin.onEnd = true; - }, - onResolve(options, callback) { - let registeredText = `This error came from the "onResolve" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onResolve() call is missing a filter`); - let id = nextCallbackID++; - onResolveCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onLoad(options, callback) { - let registeredText = `This error came from the "onLoad" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onLoad() call is missing a filter`); - let id = nextCallbackID++; - onLoadCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onDispose(callback) { - onDisposeCallbacks.push(callback); - }, - esbuild: streamIn.esbuild - }); - if (promise) await promise; - requestPlugins.push(plugin); - } catch (e) { - return { ok: false, error: e, pluginName: name }; - } - } - requestCallbacks["on-start"] = async (id, request) => { - details.clear(); - let response = { errors: [], warnings: [] }; - await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { - try { - let result = await callback(); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); - if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); - if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); - } - } catch (e) { - response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); - } - })); - sendResponse(id, response); - }; - requestCallbacks["on-resolve"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onResolveCallbacks[id2]); - let result = await callback({ - path: request.path, - importer: request.importer, - namespace: request.namespace, - resolveDir: request.resolveDir, - kind: request.kind, - pluginData: details.load(request.pluginData), - with: request.with - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let path3 = getFlag(result, keys, "path", mustBeString); - let namespace = getFlag(result, keys, "namespace", mustBeString); - let suffix = getFlag(result, keys, "suffix", mustBeString); - let external = getFlag(result, keys, "external", mustBeBoolean); - let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (path3 != null) response.path = path3; - if (namespace != null) response.namespace = namespace; - if (suffix != null) response.suffix = suffix; - if (external != null) response.external = external; - if (sideEffects != null) response.sideEffects = sideEffects; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - requestCallbacks["on-load"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onLoadCallbacks[id2]); - let result = await callback({ - path: request.path, - namespace: request.namespace, - suffix: request.suffix, - pluginData: details.load(request.pluginData), - with: request.with - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let loader = getFlag(result, keys, "loader", mustBeString); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (contents instanceof Uint8Array) response.contents = contents; - else if (contents != null) response.contents = encodeUTF8(contents); - if (resolveDir != null) response.resolveDir = resolveDir; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (loader != null) response.loader = loader; - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - let runOnEndCallbacks = (result, done) => done([], []); - if (onEndCallbacks.length > 0) { - runOnEndCallbacks = (result, done) => { - (async () => { - const onEndErrors = []; - const onEndWarnings = []; - for (const { name, callback, note } of onEndCallbacks) { - let newErrors; - let newWarnings; - try { - const value = await callback(result); - if (value != null) { - if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(value, keys, "errors", mustBeArray); - let warnings = getFlag(value, keys, "warnings", mustBeArray); - checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); - if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - } - } catch (e) { - newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; - } - if (newErrors) { - onEndErrors.push(...newErrors); - try { - result.errors.push(...newErrors); - } catch { - } - } - if (newWarnings) { - onEndWarnings.push(...newWarnings); - try { - result.warnings.push(...newWarnings); - } catch { - } - } - } - done(onEndErrors, onEndWarnings); - })(); - }; - } - let scheduleOnDisposeCallbacks = () => { - for (const cb of onDisposeCallbacks) { - setTimeout(() => cb(), 0); - } - }; - isSetupDone = true; - return { - ok: true, - requestPlugins, - runOnEndCallbacks, - scheduleOnDisposeCallbacks - }; - }; - function createObjectStash() { - const map = /* @__PURE__ */ new Map(); - let nextID = 0; - return { - clear() { - map.clear(); - }, - load(id) { - return map.get(id); - }, - store(value) { - if (value === void 0) return -1; - const id = nextID++; - map.set(id, value); - return id; - } - }; - } - function extractCallerV8(e, streamIn, ident) { - let note; - let tried = false; - return () => { - if (tried) return note; - tried = true; - try { - let lines = (e.stack + "").split("\n"); - lines.splice(1, 1); - let location = parseStackLinesV8(streamIn, lines, ident); - if (location) { - note = { text: e.message, location }; - return note; - } - } catch { - } - }; - } - function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { - let text = "Internal error"; - let location = null; - try { - text = (e && e.message || e) + ""; - } catch { - } - try { - location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); - } catch { - } - return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; - } - function parseStackLinesV8(streamIn, lines, ident) { - let at = " at "; - if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { - for (let i = 1; i < lines.length; i++) { - let line = lines[i]; - if (!line.startsWith(at)) continue; - line = line.slice(at.length); - while (true) { - let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^(\S+):(\d+):(\d+)$/.exec(line); - if (match) { - let contents; - try { - contents = streamIn.readFileSync(match[1], "utf8"); - } catch { - break; - } - let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; - let column = +match[3] - 1; - let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; - return { - file: match[1], - namespace: "file", - line: +match[2], - column: encodeUTF8(lineText.slice(0, column)).length, - length: encodeUTF8(lineText.slice(column, column + length)).length, - lineText: lineText + "\n" + lines.slice(1).join("\n"), - suggestion: "" - }; - } - break; - } - } - } - return null; - } - function failureErrorWithLog(text, errors, warnings) { - let limit = 5; - text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { - if (i === limit) return "\n..."; - if (!e.location) return ` -error: ${e.text}`; - let { file, line, column } = e.location; - let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; - return ` -${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; - }).join(""); - let error = new Error(text); - for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { - Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - get: () => value, - set: (value2) => Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - value: value2 - }) - }); - } - return error; - } - function replaceDetailsInMessages(messages, stash) { - for (const message of messages) { - message.detail = stash.load(message.detail); - } - return messages; - } - function sanitizeLocation(location, where, terminalWidth) { - if (location == null) return null; - let keys = {}; - let file = getFlag(location, keys, "file", mustBeString); - let namespace = getFlag(location, keys, "namespace", mustBeString); - let line = getFlag(location, keys, "line", mustBeInteger); - let column = getFlag(location, keys, "column", mustBeInteger); - let length = getFlag(location, keys, "length", mustBeInteger); - let lineText = getFlag(location, keys, "lineText", mustBeString); - let suggestion = getFlag(location, keys, "suggestion", mustBeString); - checkForInvalidFlags(location, keys, where); - if (lineText) { - const relevantASCII = lineText.slice( - 0, - (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) - ); - if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { - lineText = relevantASCII; - } - } - return { - file: file || "", - namespace: namespace || "", - line: line || 0, - column: column || 0, - length: length || 0, - lineText: lineText || "", - suggestion: suggestion || "" - }; - } - function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { - let messagesClone = []; - let index = 0; - for (const message of messages) { - let keys = {}; - let id = getFlag(message, keys, "id", mustBeString); - let pluginName = getFlag(message, keys, "pluginName", mustBeString); - let text = getFlag(message, keys, "text", mustBeString); - let location = getFlag(message, keys, "location", mustBeObjectOrNull); - let notes = getFlag(message, keys, "notes", mustBeArray); - let detail = getFlag(message, keys, "detail", canBeAnything); - let where = `in element ${index} of "${property}"`; - checkForInvalidFlags(message, keys, where); - let notesClone = []; - if (notes) { - for (const note of notes) { - let noteKeys = {}; - let noteText = getFlag(note, noteKeys, "text", mustBeString); - let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); - checkForInvalidFlags(note, noteKeys, where); - notesClone.push({ - text: noteText || "", - location: sanitizeLocation(noteLocation, where, terminalWidth) - }); - } - } - messagesClone.push({ - id: id || "", - pluginName: pluginName || fallbackPluginName, - text: text || "", - location: sanitizeLocation(location, where, terminalWidth), - notes: notesClone, - detail: stash ? stash.store(detail) : -1 - }); - index++; - } - return messagesClone; - } - function sanitizeStringArray(values, property) { - const result = []; - for (const value of values) { - if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); - result.push(value); - } - return result; - } - function sanitizeStringMap(map, property) { - const result = /* @__PURE__ */ Object.create(null); - for (const key in map) { - const value = map[key]; - if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); - result[key] = value; - } - return result; - } - function convertOutputFiles({ path: path3, contents, hash }) { - let text = null; - return { - path: path3, - contents, - hash, - get text() { - const binary = this.contents; - if (text === null || binary !== contents) { - contents = binary; - text = decodeUTF8(binary); - } - return text; - } - }; - } - var fs2 = require("fs"); - var os2 = require("os"); - var path2 = require("path"); - var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; - var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; - var packageDarwin_arm64 = "@esbuild/darwin-arm64"; - var packageDarwin_x64 = "@esbuild/darwin-x64"; - var knownWindowsPackages = { - "win32 arm64 LE": "@esbuild/win32-arm64", - "win32 ia32 LE": "@esbuild/win32-ia32", - "win32 x64 LE": "@esbuild/win32-x64" - }; - var knownUnixlikePackages = { - "aix ppc64 BE": "@esbuild/aix-ppc64", - "android arm64 LE": "@esbuild/android-arm64", - "darwin arm64 LE": "@esbuild/darwin-arm64", - "darwin x64 LE": "@esbuild/darwin-x64", - "freebsd arm64 LE": "@esbuild/freebsd-arm64", - "freebsd x64 LE": "@esbuild/freebsd-x64", - "linux arm LE": "@esbuild/linux-arm", - "linux arm64 LE": "@esbuild/linux-arm64", - "linux ia32 LE": "@esbuild/linux-ia32", - "linux mips64el LE": "@esbuild/linux-mips64el", - "linux ppc64 LE": "@esbuild/linux-ppc64", - "linux riscv64 LE": "@esbuild/linux-riscv64", - "linux s390x BE": "@esbuild/linux-s390x", - "linux x64 LE": "@esbuild/linux-x64", - "linux loong64 LE": "@esbuild/linux-loong64", - "netbsd arm64 LE": "@esbuild/netbsd-arm64", - "netbsd x64 LE": "@esbuild/netbsd-x64", - "openbsd arm64 LE": "@esbuild/openbsd-arm64", - "openbsd x64 LE": "@esbuild/openbsd-x64", - "sunos x64 LE": "@esbuild/sunos-x64" - }; - var knownWebAssemblyFallbackPackages = { - "android arm LE": "@esbuild/android-arm", - "android x64 LE": "@esbuild/android-x64" - }; - function pkgAndSubpathForCurrentPlatform() { - let pkg; - let subpath; - let isWASM = false; - let platformKey = `${process.platform} ${os2.arch()} ${os2.endianness()}`; - if (platformKey in knownWindowsPackages) { - pkg = knownWindowsPackages[platformKey]; - subpath = "esbuild.exe"; - } else if (platformKey in knownUnixlikePackages) { - pkg = knownUnixlikePackages[platformKey]; - subpath = "bin/esbuild"; - } else if (platformKey in knownWebAssemblyFallbackPackages) { - pkg = knownWebAssemblyFallbackPackages[platformKey]; - subpath = "bin/esbuild"; - isWASM = true; - } else { - throw new Error(`Unsupported platform: ${platformKey}`); - } - return { pkg, subpath, isWASM }; - } - function pkgForSomeOtherPlatform() { - const libMainJS = require.resolve("esbuild"); - const nodeModulesDirectory = path2.dirname(path2.dirname(path2.dirname(libMainJS))); - if (path2.basename(nodeModulesDirectory) === "node_modules") { - for (const unixKey in knownUnixlikePackages) { - try { - const pkg = knownUnixlikePackages[unixKey]; - if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - for (const windowsKey in knownWindowsPackages) { - try { - const pkg = knownWindowsPackages[windowsKey]; - if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - } - return null; - } - function downloadedBinPath(pkg, subpath) { - const esbuildLibDir = path2.dirname(require.resolve("esbuild")); - return path2.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path2.basename(subpath)}`); - } - function generateBinPath() { - if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { - if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { - console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); - } else { - return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; - } - } - const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); - let binPath; - try { - binPath = require.resolve(`${pkg}/${subpath}`); - } catch (e) { - binPath = downloadedBinPath(pkg, subpath); - if (!fs2.existsSync(binPath)) { - try { - require.resolve(pkg); - } catch { - const otherPkg = pkgForSomeOtherPlatform(); - if (otherPkg) { - let suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild on Windows or macOS and copying "node_modules" -into a Docker image that runs Linux, or by copying "node_modules" between -Windows and WSL environments. - -If you are installing with npm, you can try not copying the "node_modules" -directory when you copy the files over, and running "npm ci" or "npm install" -on the destination platform after the copy. Or you could consider using yarn -instead of npm which has built-in support for installing a package on multiple -platforms simultaneously. - -If you are installing with yarn, you can try listing both this platform and the -other platform in your ".yarnrc.yml" file using the "supportedArchitectures" -feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { - suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild with npm running inside of Rosetta 2 and then -trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta -2 is Apple's on-the-fly x86_64-to-arm64 translation service). - -If you are installing with npm, you can try ensuring that both npm and node are -not running under Rosetta 2 and then reinstalling esbuild. This likely involves -changing how you installed npm and/or node. For example, installing node with -the universal installer here should work: https://nodejs.org/en/download/. Or -you could consider using yarn instead of npm which has built-in support for -installing a package on multiple platforms simultaneously. - -If you are installing with yarn, you can try listing both "arm64" and "x64" -in your ".yarnrc.yml" file using the "supportedArchitectures" feature: -https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - } - throw new Error(` -You installed esbuild for another platform than the one you're currently using. -This won't work because esbuild is written with native code and needs to -install a platform-specific binary executable. -${suggestions} -Another alternative is to use the "esbuild-wasm" package instead, which works -the same way on all platforms. But it comes with a heavy performance cost and -can sometimes be 10x slower than the "esbuild" package, so you may also not -want to do that. -`); - } - throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. - -If you are installing esbuild with npm, make sure that you don't specify the -"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature -of "package.json" is used by esbuild to install the correct binary executable -for your current platform.`); - } - throw e; - } - } - if (/\.zip\//.test(binPath)) { - let pnpapi; - try { - pnpapi = require("pnpapi"); - } catch (e) { - } - if (pnpapi) { - const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; - const binTargetPath = path2.join( - root, - "node_modules", - ".cache", - "esbuild", - `pnpapi-${pkg.replace("/", "-")}-${"0.24.2"}-${path2.basename(subpath)}` - ); - if (!fs2.existsSync(binTargetPath)) { - fs2.mkdirSync(path2.dirname(binTargetPath), { recursive: true }); - fs2.copyFileSync(binPath, binTargetPath); - fs2.chmodSync(binTargetPath, 493); - } - return { binPath: binTargetPath, isWASM }; - } - } - return { binPath, isWASM }; - } - var child_process = require("child_process"); - var crypto = require("crypto"); - var path22 = require("path"); - var fs22 = require("fs"); - var os22 = require("os"); - var tty = require("tty"); - var worker_threads; - if (process.env.ESBUILD_WORKER_THREADS !== "0") { - try { - worker_threads = require("worker_threads"); - } catch { - } - let [major, minor] = process.versions.node.split("."); - if ( - // { - if ((!ESBUILD_BINARY_PATH || false) && (path22.basename(__filename) !== "main.js" || path22.basename(__dirname) !== "lib")) { - throw new Error( - `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. - -More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` - ); - } - if (false) { - return ["node", [path22.join(__dirname, "..", "bin", "esbuild")]]; - } else { - const { binPath, isWASM } = generateBinPath(); - if (isWASM) { - return ["node", [binPath]]; - } else { - return [binPath, []]; - } - } - }; - var isTTY = () => tty.isatty(2); - var fsSync = { - readFile(tempFile, callback) { - try { - let contents = fs22.readFileSync(tempFile, "utf8"); - try { - fs22.unlinkSync(tempFile); - } catch { - } - callback(null, contents); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs22.writeFileSync(tempFile, contents); - callback(tempFile); - } catch { - callback(null); - } - } - }; - var fsAsync = { - readFile(tempFile, callback) { - try { - fs22.readFile(tempFile, "utf8", (err, contents) => { - try { - fs22.unlink(tempFile, () => callback(err, contents)); - } catch { - callback(err, contents); - } - }); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs22.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); - } catch { - callback(null); - } - } - }; - var version = "0.24.2"; - var build2 = (options) => ensureServiceIsRunning().build(options); - var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); - var transform = (input, options) => ensureServiceIsRunning().transform(input, options); - var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); - var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); - var buildSync = (options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.buildSync(options); - } - let result; - runServiceSync((service) => service.buildOrContext({ - callName: "buildSync", - refs: null, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var transformSync = (input, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.transformSync(input, options); - } - let result; - runServiceSync((service) => service.transform({ - callName: "transformSync", - refs: null, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsSync, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var formatMessagesSync = (messages, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.formatMessagesSync(messages, options); - } - let result; - runServiceSync((service) => service.formatMessages({ - callName: "formatMessagesSync", - refs: null, - messages, - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var analyzeMetafileSync = (metafile, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.analyzeMetafileSync(metafile, options); - } - let result; - runServiceSync((service) => service.analyzeMetafile({ - callName: "analyzeMetafileSync", - refs: null, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var stop = () => { - if (stopService) stopService(); - if (workerThreadService) workerThreadService.stop(); - return Promise.resolve(); - }; - var initializeWasCalled = false; - var initialize = (options) => { - options = validateInitializeOptions(options || {}); - if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); - if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); - if (options.worker) throw new Error(`The "worker" option only works in the browser`); - if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); - ensureServiceIsRunning(); - initializeWasCalled = true; - return Promise.resolve(); - }; - var defaultWD = process.cwd(); - var longLivedService; - var stopService; - var ensureServiceIsRunning = () => { - if (longLivedService) return longLivedService; - let [command, args] = esbuildCommandAndArgs(); - let child = child_process.spawn(command, args.concat(`--service=${"0.24.2"}`, "--ping"), { - windowsHide: true, - stdio: ["pipe", "pipe", "inherit"], - cwd: defaultWD - }); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - child.stdin.write(bytes, (err) => { - if (err) afterClose(err); - }); - }, - readFileSync: fs22.readFileSync, - isSync: false, - hasFS: true, - esbuild: node_exports - }); - child.stdin.on("error", afterClose); - child.on("error", afterClose); - const stdin = child.stdin; - const stdout = child.stdout; - stdout.on("data", readFromStdout); - stdout.on("end", afterClose); - stopService = () => { - stdin.destroy(); - stdout.destroy(); - child.kill(); - initializeWasCalled = false; - longLivedService = void 0; - stopService = void 0; - }; - let refCount = 0; - child.unref(); - if (stdin.unref) { - stdin.unref(); - } - if (stdout.unref) { - stdout.unref(); - } - const refs = { - ref() { - if (++refCount === 1) child.ref(); - }, - unref() { - if (--refCount === 0) child.unref(); - } - }; - longLivedService = { - build: (options) => new Promise((resolve2, reject) => { - service.buildOrContext({ - callName: "build", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve2(res) - }); - }), - context: (options) => new Promise((resolve2, reject) => service.buildOrContext({ - callName: "context", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - transform: (input, options) => new Promise((resolve2, reject) => service.transform({ - callName: "transform", - refs, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsAsync, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - formatMessages: (messages, options) => new Promise((resolve2, reject) => service.formatMessages({ - callName: "formatMessages", - refs, - messages, - options, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - analyzeMetafile: (metafile, options) => new Promise((resolve2, reject) => service.analyzeMetafile({ - callName: "analyzeMetafile", - refs, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => err ? reject(err) : resolve2(res) - })) - }; - return longLivedService; - }; - var runServiceSync = (callback) => { - let [command, args] = esbuildCommandAndArgs(); - let stdin = new Uint8Array(); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - if (stdin.length !== 0) throw new Error("Must run at most one command"); - stdin = bytes; - }, - isSync: true, - hasFS: true, - esbuild: node_exports - }); - callback(service); - let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.2"}`), { - cwd: defaultWD, - windowsHide: true, - input: stdin, - // We don't know how large the output could be. If it's too large, the - // command will fail with ENOBUFS. Reserve 16mb for now since that feels - // like it should be enough. Also allow overriding this with an environment - // variable. - maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 - }); - readFromStdout(stdout); - afterClose(null); - }; - var randomFileName = () => { - return path22.join(os22.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); - }; - var workerThreadService = null; - var startWorkerThreadService = (worker_threads2) => { - let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); - let worker = new worker_threads2.Worker(__filename, { - workerData: { workerPort, defaultWD, esbuildVersion: "0.24.2" }, - transferList: [workerPort], - // From node's documentation: https://nodejs.org/api/worker_threads.html - // - // Take care when launching worker threads from preload scripts (scripts loaded - // and run using the `-r` command line flag). Unless the `execArgv` option is - // explicitly set, new Worker threads automatically inherit the command line flags - // from the running process and will preload the same preload scripts as the main - // thread. If the preload script unconditionally launches a worker thread, every - // thread spawned will spawn another until the application crashes. - // - execArgv: [] - }); - let nextID = 0; - let fakeBuildError = (text) => { - let error = new Error(`Build failed with 1 error: -error: ${text}`); - let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; - error.errors = errors; - error.warnings = []; - return error; - }; - let validateBuildSyncOptions = (options) => { - if (!options) return; - let plugins = options.plugins; - if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); - }; - let applyProperties = (object, properties) => { - for (let key in properties) { - object[key] = properties[key]; - } - }; - let runCallSync = (command, args) => { - let id = nextID++; - let sharedBuffer = new SharedArrayBuffer(8); - let sharedBufferView = new Int32Array(sharedBuffer); - let msg = { sharedBuffer, id, command, args }; - worker.postMessage(msg); - let status = Atomics.wait(sharedBufferView, 0, 0); - if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); - let { message: { id: id2, resolve: resolve2, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); - if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); - if (reject) { - applyProperties(reject, properties); - throw reject; - } - return resolve2; - }; - worker.unref(); - return { - buildSync(options) { - validateBuildSyncOptions(options); - return runCallSync("build", [options]); - }, - transformSync(input, options) { - return runCallSync("transform", [input, options]); - }, - formatMessagesSync(messages, options) { - return runCallSync("formatMessages", [messages, options]); - }, - analyzeMetafileSync(metafile, options) { - return runCallSync("analyzeMetafile", [metafile, options]); - }, - stop() { - worker.terminate(); - workerThreadService = null; - } - }; - }; - var startSyncServiceWorker = () => { - let workerPort = worker_threads.workerData.workerPort; - let parentPort = worker_threads.parentPort; - let extractProperties = (object) => { - let properties = {}; - if (object && typeof object === "object") { - for (let key in object) { - properties[key] = object[key]; - } - } - return properties; - }; - try { - let service = ensureServiceIsRunning(); - defaultWD = worker_threads.workerData.defaultWD; - parentPort.on("message", (msg) => { - (async () => { - let { sharedBuffer, id, command, args } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - try { - switch (command) { - case "build": - workerPort.postMessage({ id, resolve: await service.build(args[0]) }); - break; - case "transform": - workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); - break; - case "formatMessages": - workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); - break; - case "analyzeMetafile": - workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); - break; - default: - throw new Error(`Invalid command: ${command}`); - } - } catch (reject) { - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - } - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - })(); - }); - } catch (reject) { - parentPort.on("message", (msg) => { - let { sharedBuffer, id } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - }); - } - }; - if (isInternalWorkerThread) { - startSyncServiceWorker(); - } - var node_default = node_exports; - } -}); - -// node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js -var require_delayed_stream = __commonJS({ - "node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) { - var Stream = require("stream").Stream; - var util = require("util"); - module2.exports = DelayedStream; - function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; - } - util.inherits(DelayedStream, Stream); - DelayedStream.create = function(source, options) { - var delayedStream = new this(); - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - delayedStream.source = source; - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - source.on("error", function() { - }); - if (delayedStream.pauseStream) { - source.pause(); - } - return delayedStream; - }; - Object.defineProperty(DelayedStream.prototype, "readable", { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } - }); - DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); - }; - DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - this.source.resume(); - }; - DelayedStream.prototype.pause = function() { - this.source.pause(); - }; - DelayedStream.prototype.release = function() { - this._released = true; - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; - }; - DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; - }; - DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - if (args[0] === "data") { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - this._bufferedEvents.push(args); - }; - DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - if (this.dataSize <= this.maxDataSize) { - return; - } - this._maxDataSizeExceeded = true; - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this.emit("error", new Error(message)); - }; - } -}); - -// node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js -var require_combined_stream = __commonJS({ - "node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) { - var util = require("util"); - var Stream = require("stream").Stream; - var DelayedStream = require_delayed_stream(); - module2.exports = CombinedStream; - function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; - } - util.inherits(CombinedStream, Stream); - CombinedStream.create = function(options) { - var combinedStream = new this(); - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - return combinedStream; - }; - CombinedStream.isStreamLike = function(stream) { - return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); - }; - CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams - }); - stream.on("data", this._checkDataSize.bind(this)); - stream = newStream; - } - this._handleErrors(stream); - if (this.pauseStreams) { - stream.pause(); - } - } - this._streams.push(stream); - return this; - }; - CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; - }; - CombinedStream.prototype._getNext = function() { - this._currentStream = null; - if (this._insideLoop) { - this._pendingNext = true; - return; - } - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } - }; - CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - if (typeof stream == "undefined") { - this.end(); - return; - } - if (typeof stream !== "function") { - this._pipeNext(stream); - return; - } - var getStream = stream; - getStream(function(stream2) { - var isStreamLike = CombinedStream.isStreamLike(stream2); - if (isStreamLike) { - stream2.on("data", this._checkDataSize.bind(this)); - this._handleErrors(stream2); - } - this._pipeNext(stream2); - }.bind(this)); - }; - CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on("end", this._getNext.bind(this)); - stream.pipe(this, { end: false }); - return; - } - var value = stream; - this.write(value); - this._getNext(); - }; - CombinedStream.prototype._handleErrors = function(stream) { - var self2 = this; - stream.on("error", function(err) { - self2._emitError(err); - }); - }; - CombinedStream.prototype.write = function(data) { - this.emit("data", data); - }; - CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); - this.emit("pause"); - }; - CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); - this.emit("resume"); - }; - CombinedStream.prototype.end = function() { - this._reset(); - this.emit("end"); - }; - CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit("close"); - }; - CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; - }; - CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this._emitError(new Error(message)); - }; - CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - var self2 = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - self2.dataSize += stream.dataSize; - }); - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } - }; - CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit("error", err); - }; - } -}); - -// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json -var require_db = __commonJS({ - "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports2, module2) { - module2.exports = { - "application/1d-interleaved-parityfec": { - source: "iana" - }, - "application/3gpdash-qoe-report+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/3gpp-ims+xml": { - source: "iana", - compressible: true - }, - "application/3gpphal+json": { - source: "iana", - compressible: true - }, - "application/3gpphalforms+json": { - source: "iana", - compressible: true - }, - "application/a2l": { - source: "iana" - }, - "application/ace+cbor": { - source: "iana" - }, - "application/activemessage": { - source: "iana" - }, - "application/activity+json": { - source: "iana", - compressible: true - }, - "application/alto-costmap+json": { - source: "iana", - compressible: true - }, - "application/alto-costmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-directory+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcost+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcostparams+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointprop+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointpropparams+json": { - source: "iana", - compressible: true - }, - "application/alto-error+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmap+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamcontrol+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamparams+json": { - source: "iana", - compressible: true - }, - "application/aml": { - source: "iana" - }, - "application/andrew-inset": { - source: "iana", - extensions: ["ez"] - }, - "application/applefile": { - source: "iana" - }, - "application/applixware": { - source: "apache", - extensions: ["aw"] - }, - "application/at+jwt": { - source: "iana" - }, - "application/atf": { - source: "iana" - }, - "application/atfx": { - source: "iana" - }, - "application/atom+xml": { - source: "iana", - compressible: true, - extensions: ["atom"] - }, - "application/atomcat+xml": { - source: "iana", - compressible: true, - extensions: ["atomcat"] - }, - "application/atomdeleted+xml": { - source: "iana", - compressible: true, - extensions: ["atomdeleted"] - }, - "application/atomicmail": { - source: "iana" - }, - "application/atomsvc+xml": { - source: "iana", - compressible: true, - extensions: ["atomsvc"] - }, - "application/atsc-dwd+xml": { - source: "iana", - compressible: true, - extensions: ["dwd"] - }, - "application/atsc-dynamic-event-message": { - source: "iana" - }, - "application/atsc-held+xml": { - source: "iana", - compressible: true, - extensions: ["held"] - }, - "application/atsc-rdt+json": { - source: "iana", - compressible: true - }, - "application/atsc-rsat+xml": { - source: "iana", - compressible: true, - extensions: ["rsat"] - }, - "application/atxml": { - source: "iana" - }, - "application/auth-policy+xml": { - source: "iana", - compressible: true - }, - "application/bacnet-xdd+zip": { - source: "iana", - compressible: false - }, - "application/batch-smtp": { - source: "iana" - }, - "application/bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/beep+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/calendar+json": { - source: "iana", - compressible: true - }, - "application/calendar+xml": { - source: "iana", - compressible: true, - extensions: ["xcs"] - }, - "application/call-completion": { - source: "iana" - }, - "application/cals-1840": { - source: "iana" - }, - "application/captive+json": { - source: "iana", - compressible: true - }, - "application/cbor": { - source: "iana" - }, - "application/cbor-seq": { - source: "iana" - }, - "application/cccex": { - source: "iana" - }, - "application/ccmp+xml": { - source: "iana", - compressible: true - }, - "application/ccxml+xml": { - source: "iana", - compressible: true, - extensions: ["ccxml"] - }, - "application/cdfx+xml": { - source: "iana", - compressible: true, - extensions: ["cdfx"] - }, - "application/cdmi-capability": { - source: "iana", - extensions: ["cdmia"] - }, - "application/cdmi-container": { - source: "iana", - extensions: ["cdmic"] - }, - "application/cdmi-domain": { - source: "iana", - extensions: ["cdmid"] - }, - "application/cdmi-object": { - source: "iana", - extensions: ["cdmio"] - }, - "application/cdmi-queue": { - source: "iana", - extensions: ["cdmiq"] - }, - "application/cdni": { - source: "iana" - }, - "application/cea": { - source: "iana" - }, - "application/cea-2018+xml": { - source: "iana", - compressible: true - }, - "application/cellml+xml": { - source: "iana", - compressible: true - }, - "application/cfw": { - source: "iana" - }, - "application/city+json": { - source: "iana", - compressible: true - }, - "application/clr": { - source: "iana" - }, - "application/clue+xml": { - source: "iana", - compressible: true - }, - "application/clue_info+xml": { - source: "iana", - compressible: true - }, - "application/cms": { - source: "iana" - }, - "application/cnrp+xml": { - source: "iana", - compressible: true - }, - "application/coap-group+json": { - source: "iana", - compressible: true - }, - "application/coap-payload": { - source: "iana" - }, - "application/commonground": { - source: "iana" - }, - "application/conference-info+xml": { - source: "iana", - compressible: true - }, - "application/cose": { - source: "iana" - }, - "application/cose-key": { - source: "iana" - }, - "application/cose-key-set": { - source: "iana" - }, - "application/cpl+xml": { - source: "iana", - compressible: true, - extensions: ["cpl"] - }, - "application/csrattrs": { - source: "iana" - }, - "application/csta+xml": { - source: "iana", - compressible: true - }, - "application/cstadata+xml": { - source: "iana", - compressible: true - }, - "application/csvm+json": { - source: "iana", - compressible: true - }, - "application/cu-seeme": { - source: "apache", - extensions: ["cu"] - }, - "application/cwt": { - source: "iana" - }, - "application/cybercash": { - source: "iana" - }, - "application/dart": { - compressible: true - }, - "application/dash+xml": { - source: "iana", - compressible: true, - extensions: ["mpd"] - }, - "application/dash-patch+xml": { - source: "iana", - compressible: true, - extensions: ["mpp"] - }, - "application/dashdelta": { - source: "iana" - }, - "application/davmount+xml": { - source: "iana", - compressible: true, - extensions: ["davmount"] - }, - "application/dca-rft": { - source: "iana" - }, - "application/dcd": { - source: "iana" - }, - "application/dec-dx": { - source: "iana" - }, - "application/dialog-info+xml": { - source: "iana", - compressible: true - }, - "application/dicom": { - source: "iana" - }, - "application/dicom+json": { - source: "iana", - compressible: true - }, - "application/dicom+xml": { - source: "iana", - compressible: true - }, - "application/dii": { - source: "iana" - }, - "application/dit": { - source: "iana" - }, - "application/dns": { - source: "iana" - }, - "application/dns+json": { - source: "iana", - compressible: true - }, - "application/dns-message": { - source: "iana" - }, - "application/docbook+xml": { - source: "apache", - compressible: true, - extensions: ["dbk"] - }, - "application/dots+cbor": { - source: "iana" - }, - "application/dskpp+xml": { - source: "iana", - compressible: true - }, - "application/dssc+der": { - source: "iana", - extensions: ["dssc"] - }, - "application/dssc+xml": { - source: "iana", - compressible: true, - extensions: ["xdssc"] - }, - "application/dvcs": { - source: "iana" - }, - "application/ecmascript": { - source: "iana", - compressible: true, - extensions: ["es", "ecma"] - }, - "application/edi-consent": { - source: "iana" - }, - "application/edi-x12": { - source: "iana", - compressible: false - }, - "application/edifact": { - source: "iana", - compressible: false - }, - "application/efi": { - source: "iana" - }, - "application/elm+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/elm+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.cap+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/emergencycalldata.comment+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.control+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.deviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.ecall.msd": { - source: "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.serviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.subscriberinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.veds+xml": { - source: "iana", - compressible: true - }, - "application/emma+xml": { - source: "iana", - compressible: true, - extensions: ["emma"] - }, - "application/emotionml+xml": { - source: "iana", - compressible: true, - extensions: ["emotionml"] - }, - "application/encaprtp": { - source: "iana" - }, - "application/epp+xml": { - source: "iana", - compressible: true - }, - "application/epub+zip": { - source: "iana", - compressible: false, - extensions: ["epub"] - }, - "application/eshop": { - source: "iana" - }, - "application/exi": { - source: "iana", - extensions: ["exi"] - }, - "application/expect-ct-report+json": { - source: "iana", - compressible: true - }, - "application/express": { - source: "iana", - extensions: ["exp"] - }, - "application/fastinfoset": { - source: "iana" - }, - "application/fastsoap": { - source: "iana" - }, - "application/fdt+xml": { - source: "iana", - compressible: true, - extensions: ["fdt"] - }, - "application/fhir+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fhir+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fido.trusted-apps+json": { - compressible: true - }, - "application/fits": { - source: "iana" - }, - "application/flexfec": { - source: "iana" - }, - "application/font-sfnt": { - source: "iana" - }, - "application/font-tdpfr": { - source: "iana", - extensions: ["pfr"] - }, - "application/font-woff": { - source: "iana", - compressible: false - }, - "application/framework-attributes+xml": { - source: "iana", - compressible: true - }, - "application/geo+json": { - source: "iana", - compressible: true, - extensions: ["geojson"] - }, - "application/geo+json-seq": { - source: "iana" - }, - "application/geopackage+sqlite3": { - source: "iana" - }, - "application/geoxacml+xml": { - source: "iana", - compressible: true - }, - "application/gltf-buffer": { - source: "iana" - }, - "application/gml+xml": { - source: "iana", - compressible: true, - extensions: ["gml"] - }, - "application/gpx+xml": { - source: "apache", - compressible: true, - extensions: ["gpx"] - }, - "application/gxf": { - source: "apache", - extensions: ["gxf"] - }, - "application/gzip": { - source: "iana", - compressible: false, - extensions: ["gz"] - }, - "application/h224": { - source: "iana" - }, - "application/held+xml": { - source: "iana", - compressible: true - }, - "application/hjson": { - extensions: ["hjson"] - }, - "application/http": { - source: "iana" - }, - "application/hyperstudio": { - source: "iana", - extensions: ["stk"] - }, - "application/ibe-key-request+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pkg-reply+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pp-data": { - source: "iana" - }, - "application/iges": { - source: "iana" - }, - "application/im-iscomposing+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/index": { - source: "iana" - }, - "application/index.cmd": { - source: "iana" - }, - "application/index.obj": { - source: "iana" - }, - "application/index.response": { - source: "iana" - }, - "application/index.vnd": { - source: "iana" - }, - "application/inkml+xml": { - source: "iana", - compressible: true, - extensions: ["ink", "inkml"] - }, - "application/iotp": { - source: "iana" - }, - "application/ipfix": { - source: "iana", - extensions: ["ipfix"] - }, - "application/ipp": { - source: "iana" - }, - "application/isup": { - source: "iana" - }, - "application/its+xml": { - source: "iana", - compressible: true, - extensions: ["its"] - }, - "application/java-archive": { - source: "apache", - compressible: false, - extensions: ["jar", "war", "ear"] - }, - "application/java-serialized-object": { - source: "apache", - compressible: false, - extensions: ["ser"] - }, - "application/java-vm": { - source: "apache", - compressible: false, - extensions: ["class"] - }, - "application/javascript": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["js", "mjs"] - }, - "application/jf2feed+json": { - source: "iana", - compressible: true - }, - "application/jose": { - source: "iana" - }, - "application/jose+json": { - source: "iana", - compressible: true - }, - "application/jrd+json": { - source: "iana", - compressible: true - }, - "application/jscalendar+json": { - source: "iana", - compressible: true - }, - "application/json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["json", "map"] - }, - "application/json-patch+json": { - source: "iana", - compressible: true - }, - "application/json-seq": { - source: "iana" - }, - "application/json5": { - extensions: ["json5"] - }, - "application/jsonml+json": { - source: "apache", - compressible: true, - extensions: ["jsonml"] - }, - "application/jwk+json": { - source: "iana", - compressible: true - }, - "application/jwk-set+json": { - source: "iana", - compressible: true - }, - "application/jwt": { - source: "iana" - }, - "application/kpml-request+xml": { - source: "iana", - compressible: true - }, - "application/kpml-response+xml": { - source: "iana", - compressible: true - }, - "application/ld+json": { - source: "iana", - compressible: true, - extensions: ["jsonld"] - }, - "application/lgr+xml": { - source: "iana", - compressible: true, - extensions: ["lgr"] - }, - "application/link-format": { - source: "iana" - }, - "application/load-control+xml": { - source: "iana", - compressible: true - }, - "application/lost+xml": { - source: "iana", - compressible: true, - extensions: ["lostxml"] - }, - "application/lostsync+xml": { - source: "iana", - compressible: true - }, - "application/lpf+zip": { - source: "iana", - compressible: false - }, - "application/lxf": { - source: "iana" - }, - "application/mac-binhex40": { - source: "iana", - extensions: ["hqx"] - }, - "application/mac-compactpro": { - source: "apache", - extensions: ["cpt"] - }, - "application/macwriteii": { - source: "iana" - }, - "application/mads+xml": { - source: "iana", - compressible: true, - extensions: ["mads"] - }, - "application/manifest+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["webmanifest"] - }, - "application/marc": { - source: "iana", - extensions: ["mrc"] - }, - "application/marcxml+xml": { - source: "iana", - compressible: true, - extensions: ["mrcx"] - }, - "application/mathematica": { - source: "iana", - extensions: ["ma", "nb", "mb"] - }, - "application/mathml+xml": { - source: "iana", - compressible: true, - extensions: ["mathml"] - }, - "application/mathml-content+xml": { - source: "iana", - compressible: true - }, - "application/mathml-presentation+xml": { - source: "iana", - compressible: true - }, - "application/mbms-associated-procedure-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-deregister+xml": { - source: "iana", - compressible: true - }, - "application/mbms-envelope+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-protection-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-reception-report+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-schedule+xml": { - source: "iana", - compressible: true - }, - "application/mbms-user-service-description+xml": { - source: "iana", - compressible: true - }, - "application/mbox": { - source: "iana", - extensions: ["mbox"] - }, - "application/media-policy-dataset+xml": { - source: "iana", - compressible: true, - extensions: ["mpf"] - }, - "application/media_control+xml": { - source: "iana", - compressible: true - }, - "application/mediaservercontrol+xml": { - source: "iana", - compressible: true, - extensions: ["mscml"] - }, - "application/merge-patch+json": { - source: "iana", - compressible: true - }, - "application/metalink+xml": { - source: "apache", - compressible: true, - extensions: ["metalink"] - }, - "application/metalink4+xml": { - source: "iana", - compressible: true, - extensions: ["meta4"] - }, - "application/mets+xml": { - source: "iana", - compressible: true, - extensions: ["mets"] - }, - "application/mf4": { - source: "iana" - }, - "application/mikey": { - source: "iana" - }, - "application/mipc": { - source: "iana" - }, - "application/missing-blocks+cbor-seq": { - source: "iana" - }, - "application/mmt-aei+xml": { - source: "iana", - compressible: true, - extensions: ["maei"] - }, - "application/mmt-usd+xml": { - source: "iana", - compressible: true, - extensions: ["musd"] - }, - "application/mods+xml": { - source: "iana", - compressible: true, - extensions: ["mods"] - }, - "application/moss-keys": { - source: "iana" - }, - "application/moss-signature": { - source: "iana" - }, - "application/mosskey-data": { - source: "iana" - }, - "application/mosskey-request": { - source: "iana" - }, - "application/mp21": { - source: "iana", - extensions: ["m21", "mp21"] - }, - "application/mp4": { - source: "iana", - extensions: ["mp4s", "m4p"] - }, - "application/mpeg4-generic": { - source: "iana" - }, - "application/mpeg4-iod": { - source: "iana" - }, - "application/mpeg4-iod-xmt": { - source: "iana" - }, - "application/mrb-consumer+xml": { - source: "iana", - compressible: true - }, - "application/mrb-publish+xml": { - source: "iana", - compressible: true - }, - "application/msc-ivr+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msc-mixer+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msword": { - source: "iana", - compressible: false, - extensions: ["doc", "dot"] - }, - "application/mud+json": { - source: "iana", - compressible: true - }, - "application/multipart-core": { - source: "iana" - }, - "application/mxf": { - source: "iana", - extensions: ["mxf"] - }, - "application/n-quads": { - source: "iana", - extensions: ["nq"] - }, - "application/n-triples": { - source: "iana", - extensions: ["nt"] - }, - "application/nasdata": { - source: "iana" - }, - "application/news-checkgroups": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-groupinfo": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-transmission": { - source: "iana" - }, - "application/nlsml+xml": { - source: "iana", - compressible: true - }, - "application/node": { - source: "iana", - extensions: ["cjs"] - }, - "application/nss": { - source: "iana" - }, - "application/oauth-authz-req+jwt": { - source: "iana" - }, - "application/oblivious-dns-message": { - source: "iana" - }, - "application/ocsp-request": { - source: "iana" - }, - "application/ocsp-response": { - source: "iana" - }, - "application/octet-stream": { - source: "iana", - compressible: false, - extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] - }, - "application/oda": { - source: "iana", - extensions: ["oda"] - }, - "application/odm+xml": { - source: "iana", - compressible: true - }, - "application/odx": { - source: "iana" - }, - "application/oebps-package+xml": { - source: "iana", - compressible: true, - extensions: ["opf"] - }, - "application/ogg": { - source: "iana", - compressible: false, - extensions: ["ogx"] - }, - "application/omdoc+xml": { - source: "apache", - compressible: true, - extensions: ["omdoc"] - }, - "application/onenote": { - source: "apache", - extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] - }, - "application/opc-nodeset+xml": { - source: "iana", - compressible: true - }, - "application/oscore": { - source: "iana" - }, - "application/oxps": { - source: "iana", - extensions: ["oxps"] - }, - "application/p21": { - source: "iana" - }, - "application/p21+zip": { - source: "iana", - compressible: false - }, - "application/p2p-overlay+xml": { - source: "iana", - compressible: true, - extensions: ["relo"] - }, - "application/parityfec": { - source: "iana" - }, - "application/passport": { - source: "iana" - }, - "application/patch-ops-error+xml": { - source: "iana", - compressible: true, - extensions: ["xer"] - }, - "application/pdf": { - source: "iana", - compressible: false, - extensions: ["pdf"] - }, - "application/pdx": { - source: "iana" - }, - "application/pem-certificate-chain": { - source: "iana" - }, - "application/pgp-encrypted": { - source: "iana", - compressible: false, - extensions: ["pgp"] - }, - "application/pgp-keys": { - source: "iana", - extensions: ["asc"] - }, - "application/pgp-signature": { - source: "iana", - extensions: ["asc", "sig"] - }, - "application/pics-rules": { - source: "apache", - extensions: ["prf"] - }, - "application/pidf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pidf-diff+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pkcs10": { - source: "iana", - extensions: ["p10"] - }, - "application/pkcs12": { - source: "iana" - }, - "application/pkcs7-mime": { - source: "iana", - extensions: ["p7m", "p7c"] - }, - "application/pkcs7-signature": { - source: "iana", - extensions: ["p7s"] - }, - "application/pkcs8": { - source: "iana", - extensions: ["p8"] - }, - "application/pkcs8-encrypted": { - source: "iana" - }, - "application/pkix-attr-cert": { - source: "iana", - extensions: ["ac"] - }, - "application/pkix-cert": { - source: "iana", - extensions: ["cer"] - }, - "application/pkix-crl": { - source: "iana", - extensions: ["crl"] - }, - "application/pkix-pkipath": { - source: "iana", - extensions: ["pkipath"] - }, - "application/pkixcmp": { - source: "iana", - extensions: ["pki"] - }, - "application/pls+xml": { - source: "iana", - compressible: true, - extensions: ["pls"] - }, - "application/poc-settings+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/postscript": { - source: "iana", - compressible: true, - extensions: ["ai", "eps", "ps"] - }, - "application/ppsp-tracker+json": { - source: "iana", - compressible: true - }, - "application/problem+json": { - source: "iana", - compressible: true - }, - "application/problem+xml": { - source: "iana", - compressible: true - }, - "application/provenance+xml": { - source: "iana", - compressible: true, - extensions: ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - source: "iana" - }, - "application/prs.cww": { - source: "iana", - extensions: ["cww"] - }, - "application/prs.cyn": { - source: "iana", - charset: "7-BIT" - }, - "application/prs.hpub+zip": { - source: "iana", - compressible: false - }, - "application/prs.nprend": { - source: "iana" - }, - "application/prs.plucker": { - source: "iana" - }, - "application/prs.rdf-xml-crypt": { - source: "iana" - }, - "application/prs.xsf+xml": { - source: "iana", - compressible: true - }, - "application/pskc+xml": { - source: "iana", - compressible: true, - extensions: ["pskcxml"] - }, - "application/pvd+json": { - source: "iana", - compressible: true - }, - "application/qsig": { - source: "iana" - }, - "application/raml+yaml": { - compressible: true, - extensions: ["raml"] - }, - "application/raptorfec": { - source: "iana" - }, - "application/rdap+json": { - source: "iana", - compressible: true - }, - "application/rdf+xml": { - source: "iana", - compressible: true, - extensions: ["rdf", "owl"] - }, - "application/reginfo+xml": { - source: "iana", - compressible: true, - extensions: ["rif"] - }, - "application/relax-ng-compact-syntax": { - source: "iana", - extensions: ["rnc"] - }, - "application/remote-printing": { - source: "iana" - }, - "application/reputon+json": { - source: "iana", - compressible: true - }, - "application/resource-lists+xml": { - source: "iana", - compressible: true, - extensions: ["rl"] - }, - "application/resource-lists-diff+xml": { - source: "iana", - compressible: true, - extensions: ["rld"] - }, - "application/rfc+xml": { - source: "iana", - compressible: true - }, - "application/riscos": { - source: "iana" - }, - "application/rlmi+xml": { - source: "iana", - compressible: true - }, - "application/rls-services+xml": { - source: "iana", - compressible: true, - extensions: ["rs"] - }, - "application/route-apd+xml": { - source: "iana", - compressible: true, - extensions: ["rapd"] - }, - "application/route-s-tsid+xml": { - source: "iana", - compressible: true, - extensions: ["sls"] - }, - "application/route-usd+xml": { - source: "iana", - compressible: true, - extensions: ["rusd"] - }, - "application/rpki-ghostbusters": { - source: "iana", - extensions: ["gbr"] - }, - "application/rpki-manifest": { - source: "iana", - extensions: ["mft"] - }, - "application/rpki-publication": { - source: "iana" - }, - "application/rpki-roa": { - source: "iana", - extensions: ["roa"] - }, - "application/rpki-updown": { - source: "iana" - }, - "application/rsd+xml": { - source: "apache", - compressible: true, - extensions: ["rsd"] - }, - "application/rss+xml": { - source: "apache", - compressible: true, - extensions: ["rss"] - }, - "application/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "application/rtploopback": { - source: "iana" - }, - "application/rtx": { - source: "iana" - }, - "application/samlassertion+xml": { - source: "iana", - compressible: true - }, - "application/samlmetadata+xml": { - source: "iana", - compressible: true - }, - "application/sarif+json": { - source: "iana", - compressible: true - }, - "application/sarif-external-properties+json": { - source: "iana", - compressible: true - }, - "application/sbe": { - source: "iana" - }, - "application/sbml+xml": { - source: "iana", - compressible: true, - extensions: ["sbml"] - }, - "application/scaip+xml": { - source: "iana", - compressible: true - }, - "application/scim+json": { - source: "iana", - compressible: true - }, - "application/scvp-cv-request": { - source: "iana", - extensions: ["scq"] - }, - "application/scvp-cv-response": { - source: "iana", - extensions: ["scs"] - }, - "application/scvp-vp-request": { - source: "iana", - extensions: ["spq"] - }, - "application/scvp-vp-response": { - source: "iana", - extensions: ["spp"] - }, - "application/sdp": { - source: "iana", - extensions: ["sdp"] - }, - "application/secevent+jwt": { - source: "iana" - }, - "application/senml+cbor": { - source: "iana" - }, - "application/senml+json": { - source: "iana", - compressible: true - }, - "application/senml+xml": { - source: "iana", - compressible: true, - extensions: ["senmlx"] - }, - "application/senml-etch+cbor": { - source: "iana" - }, - "application/senml-etch+json": { - source: "iana", - compressible: true - }, - "application/senml-exi": { - source: "iana" - }, - "application/sensml+cbor": { - source: "iana" - }, - "application/sensml+json": { - source: "iana", - compressible: true - }, - "application/sensml+xml": { - source: "iana", - compressible: true, - extensions: ["sensmlx"] - }, - "application/sensml-exi": { - source: "iana" - }, - "application/sep+xml": { - source: "iana", - compressible: true - }, - "application/sep-exi": { - source: "iana" - }, - "application/session-info": { - source: "iana" - }, - "application/set-payment": { - source: "iana" - }, - "application/set-payment-initiation": { - source: "iana", - extensions: ["setpay"] - }, - "application/set-registration": { - source: "iana" - }, - "application/set-registration-initiation": { - source: "iana", - extensions: ["setreg"] - }, - "application/sgml": { - source: "iana" - }, - "application/sgml-open-catalog": { - source: "iana" - }, - "application/shf+xml": { - source: "iana", - compressible: true, - extensions: ["shf"] - }, - "application/sieve": { - source: "iana", - extensions: ["siv", "sieve"] - }, - "application/simple-filter+xml": { - source: "iana", - compressible: true - }, - "application/simple-message-summary": { - source: "iana" - }, - "application/simplesymbolcontainer": { - source: "iana" - }, - "application/sipc": { - source: "iana" - }, - "application/slate": { - source: "iana" - }, - "application/smil": { - source: "iana" - }, - "application/smil+xml": { - source: "iana", - compressible: true, - extensions: ["smi", "smil"] - }, - "application/smpte336m": { - source: "iana" - }, - "application/soap+fastinfoset": { - source: "iana" - }, - "application/soap+xml": { - source: "iana", - compressible: true - }, - "application/sparql-query": { - source: "iana", - extensions: ["rq"] - }, - "application/sparql-results+xml": { - source: "iana", - compressible: true, - extensions: ["srx"] - }, - "application/spdx+json": { - source: "iana", - compressible: true - }, - "application/spirits-event+xml": { - source: "iana", - compressible: true - }, - "application/sql": { - source: "iana" - }, - "application/srgs": { - source: "iana", - extensions: ["gram"] - }, - "application/srgs+xml": { - source: "iana", - compressible: true, - extensions: ["grxml"] - }, - "application/sru+xml": { - source: "iana", - compressible: true, - extensions: ["sru"] - }, - "application/ssdl+xml": { - source: "apache", - compressible: true, - extensions: ["ssdl"] - }, - "application/ssml+xml": { - source: "iana", - compressible: true, - extensions: ["ssml"] - }, - "application/stix+json": { - source: "iana", - compressible: true - }, - "application/swid+xml": { - source: "iana", - compressible: true, - extensions: ["swidtag"] - }, - "application/tamp-apex-update": { - source: "iana" - }, - "application/tamp-apex-update-confirm": { - source: "iana" - }, - "application/tamp-community-update": { - source: "iana" - }, - "application/tamp-community-update-confirm": { - source: "iana" - }, - "application/tamp-error": { - source: "iana" - }, - "application/tamp-sequence-adjust": { - source: "iana" - }, - "application/tamp-sequence-adjust-confirm": { - source: "iana" - }, - "application/tamp-status-query": { - source: "iana" - }, - "application/tamp-status-response": { - source: "iana" - }, - "application/tamp-update": { - source: "iana" - }, - "application/tamp-update-confirm": { - source: "iana" - }, - "application/tar": { - compressible: true - }, - "application/taxii+json": { - source: "iana", - compressible: true - }, - "application/td+json": { - source: "iana", - compressible: true - }, - "application/tei+xml": { - source: "iana", - compressible: true, - extensions: ["tei", "teicorpus"] - }, - "application/tetra_isi": { - source: "iana" - }, - "application/thraud+xml": { - source: "iana", - compressible: true, - extensions: ["tfi"] - }, - "application/timestamp-query": { - source: "iana" - }, - "application/timestamp-reply": { - source: "iana" - }, - "application/timestamped-data": { - source: "iana", - extensions: ["tsd"] - }, - "application/tlsrpt+gzip": { - source: "iana" - }, - "application/tlsrpt+json": { - source: "iana", - compressible: true - }, - "application/tnauthlist": { - source: "iana" - }, - "application/token-introspection+jwt": { - source: "iana" - }, - "application/toml": { - compressible: true, - extensions: ["toml"] - }, - "application/trickle-ice-sdpfrag": { - source: "iana" - }, - "application/trig": { - source: "iana", - extensions: ["trig"] - }, - "application/ttml+xml": { - source: "iana", - compressible: true, - extensions: ["ttml"] - }, - "application/tve-trigger": { - source: "iana" - }, - "application/tzif": { - source: "iana" - }, - "application/tzif-leap": { - source: "iana" - }, - "application/ubjson": { - compressible: false, - extensions: ["ubj"] - }, - "application/ulpfec": { - source: "iana" - }, - "application/urc-grpsheet+xml": { - source: "iana", - compressible: true - }, - "application/urc-ressheet+xml": { - source: "iana", - compressible: true, - extensions: ["rsheet"] - }, - "application/urc-targetdesc+xml": { - source: "iana", - compressible: true, - extensions: ["td"] - }, - "application/urc-uisocketdesc+xml": { - source: "iana", - compressible: true - }, - "application/vcard+json": { - source: "iana", - compressible: true - }, - "application/vcard+xml": { - source: "iana", - compressible: true - }, - "application/vemmi": { - source: "iana" - }, - "application/vividence.scriptfile": { - source: "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - source: "iana", - compressible: true, - extensions: ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-v2x-local-service-information": { - source: "iana" - }, - "application/vnd.3gpp.5gnas": { - source: "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.bsf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gmop+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gtpc": { - source: "iana" - }, - "application/vnd.3gpp.interworking-data": { - source: "iana" - }, - "application/vnd.3gpp.lpp": { - source: "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-payload": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-signalling": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mid-call+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ngap": { - source: "iana" - }, - "application/vnd.3gpp.pfcp": { - source: "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - source: "iana", - extensions: ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - source: "iana", - extensions: ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - source: "iana", - extensions: ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - source: "iana" - }, - "application/vnd.3gpp.sms": { - source: "iana" - }, - "application/vnd.3gpp.sms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ussd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.sms": { - source: "iana" - }, - "application/vnd.3gpp2.tcap": { - source: "iana", - extensions: ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - source: "iana" - }, - "application/vnd.3m.post-it-notes": { - source: "iana", - extensions: ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - source: "iana", - extensions: ["aso"] - }, - "application/vnd.accpac.simply.imp": { - source: "iana", - extensions: ["imp"] - }, - "application/vnd.acucobol": { - source: "iana", - extensions: ["acu"] - }, - "application/vnd.acucorp": { - source: "iana", - extensions: ["atc", "acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - source: "apache", - compressible: false, - extensions: ["air"] - }, - "application/vnd.adobe.flash.movie": { - source: "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - source: "iana", - extensions: ["fcdt"] - }, - "application/vnd.adobe.fxp": { - source: "iana", - extensions: ["fxp", "fxpl"] - }, - "application/vnd.adobe.partial-upload": { - source: "iana" - }, - "application/vnd.adobe.xdp+xml": { - source: "iana", - compressible: true, - extensions: ["xdp"] - }, - "application/vnd.adobe.xfdf": { - source: "iana", - extensions: ["xfdf"] - }, - "application/vnd.aether.imp": { - source: "iana" - }, - "application/vnd.afpc.afplinedata": { - source: "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - source: "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - source: "iana" - }, - "application/vnd.afpc.foca-charset": { - source: "iana" - }, - "application/vnd.afpc.foca-codedfont": { - source: "iana" - }, - "application/vnd.afpc.foca-codepage": { - source: "iana" - }, - "application/vnd.afpc.modca": { - source: "iana" - }, - "application/vnd.afpc.modca-cmtable": { - source: "iana" - }, - "application/vnd.afpc.modca-formdef": { - source: "iana" - }, - "application/vnd.afpc.modca-mediummap": { - source: "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - source: "iana" - }, - "application/vnd.afpc.modca-overlay": { - source: "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - source: "iana" - }, - "application/vnd.age": { - source: "iana", - extensions: ["age"] - }, - "application/vnd.ah-barcode": { - source: "iana" - }, - "application/vnd.ahead.space": { - source: "iana", - extensions: ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - source: "iana", - extensions: ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - source: "iana", - extensions: ["azs"] - }, - "application/vnd.amadeus+json": { - source: "iana", - compressible: true - }, - "application/vnd.amazon.ebook": { - source: "apache", - extensions: ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - source: "iana" - }, - "application/vnd.americandynamics.acc": { - source: "iana", - extensions: ["acc"] - }, - "application/vnd.amiga.ami": { - source: "iana", - extensions: ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - source: "iana", - compressible: true - }, - "application/vnd.android.ota": { - source: "iana" - }, - "application/vnd.android.package-archive": { - source: "apache", - compressible: false, - extensions: ["apk"] - }, - "application/vnd.anki": { - source: "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - source: "iana", - extensions: ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - source: "apache", - extensions: ["fti"] - }, - "application/vnd.antix.game-component": { - source: "iana", - extensions: ["atx"] - }, - "application/vnd.apache.arrow.file": { - source: "iana" - }, - "application/vnd.apache.arrow.stream": { - source: "iana" - }, - "application/vnd.apache.thrift.binary": { - source: "iana" - }, - "application/vnd.apache.thrift.compact": { - source: "iana" - }, - "application/vnd.apache.thrift.json": { - source: "iana" - }, - "application/vnd.api+json": { - source: "iana", - compressible: true - }, - "application/vnd.aplextor.warrp+json": { - source: "iana", - compressible: true - }, - "application/vnd.apothekende.reservation+json": { - source: "iana", - compressible: true - }, - "application/vnd.apple.installer+xml": { - source: "iana", - compressible: true, - extensions: ["mpkg"] - }, - "application/vnd.apple.keynote": { - source: "iana", - extensions: ["key"] - }, - "application/vnd.apple.mpegurl": { - source: "iana", - extensions: ["m3u8"] - }, - "application/vnd.apple.numbers": { - source: "iana", - extensions: ["numbers"] - }, - "application/vnd.apple.pages": { - source: "iana", - extensions: ["pages"] - }, - "application/vnd.apple.pkpass": { - compressible: false, - extensions: ["pkpass"] - }, - "application/vnd.arastra.swi": { - source: "iana" - }, - "application/vnd.aristanetworks.swi": { - source: "iana", - extensions: ["swi"] - }, - "application/vnd.artisan+json": { - source: "iana", - compressible: true - }, - "application/vnd.artsquare": { - source: "iana" - }, - "application/vnd.astraea-software.iota": { - source: "iana", - extensions: ["iota"] - }, - "application/vnd.audiograph": { - source: "iana", - extensions: ["aep"] - }, - "application/vnd.autopackage": { - source: "iana" - }, - "application/vnd.avalon+json": { - source: "iana", - compressible: true - }, - "application/vnd.avistar+xml": { - source: "iana", - compressible: true - }, - "application/vnd.balsamiq.bmml+xml": { - source: "iana", - compressible: true, - extensions: ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - source: "iana" - }, - "application/vnd.banana-accounting": { - source: "iana" - }, - "application/vnd.bbf.usp.error": { - source: "iana" - }, - "application/vnd.bbf.usp.msg": { - source: "iana" - }, - "application/vnd.bbf.usp.msg+json": { - source: "iana", - compressible: true - }, - "application/vnd.bekitzur-stech+json": { - source: "iana", - compressible: true - }, - "application/vnd.bint.med-content": { - source: "iana" - }, - "application/vnd.biopax.rdf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.blink-idb-value-wrapper": { - source: "iana" - }, - "application/vnd.blueice.multipass": { - source: "iana", - extensions: ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - source: "iana" - }, - "application/vnd.bluetooth.le.oob": { - source: "iana" - }, - "application/vnd.bmi": { - source: "iana", - extensions: ["bmi"] - }, - "application/vnd.bpf": { - source: "iana" - }, - "application/vnd.bpf3": { - source: "iana" - }, - "application/vnd.businessobjects": { - source: "iana", - extensions: ["rep"] - }, - "application/vnd.byu.uapi+json": { - source: "iana", - compressible: true - }, - "application/vnd.cab-jscript": { - source: "iana" - }, - "application/vnd.canon-cpdl": { - source: "iana" - }, - "application/vnd.canon-lips": { - source: "iana" - }, - "application/vnd.capasystems-pg+json": { - source: "iana", - compressible: true - }, - "application/vnd.cendio.thinlinc.clientconf": { - source: "iana" - }, - "application/vnd.century-systems.tcp_stream": { - source: "iana" - }, - "application/vnd.chemdraw+xml": { - source: "iana", - compressible: true, - extensions: ["cdxml"] - }, - "application/vnd.chess-pgn": { - source: "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - source: "iana", - extensions: ["mmd"] - }, - "application/vnd.ciedi": { - source: "iana" - }, - "application/vnd.cinderella": { - source: "iana", - extensions: ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - source: "iana" - }, - "application/vnd.citationstyles.style+xml": { - source: "iana", - compressible: true, - extensions: ["csl"] - }, - "application/vnd.claymore": { - source: "iana", - extensions: ["cla"] - }, - "application/vnd.cloanto.rp9": { - source: "iana", - extensions: ["rp9"] - }, - "application/vnd.clonk.c4group": { - source: "iana", - extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - source: "iana", - extensions: ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - source: "iana", - extensions: ["c11amz"] - }, - "application/vnd.coffeescript": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - source: "iana" - }, - "application/vnd.collection+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.doc+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.next+json": { - source: "iana", - compressible: true - }, - "application/vnd.comicbook+zip": { - source: "iana", - compressible: false - }, - "application/vnd.comicbook-rar": { - source: "iana" - }, - "application/vnd.commerce-battelle": { - source: "iana" - }, - "application/vnd.commonspace": { - source: "iana", - extensions: ["csp"] - }, - "application/vnd.contact.cmsg": { - source: "iana", - extensions: ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - source: "iana", - compressible: true - }, - "application/vnd.cosmocaller": { - source: "iana", - extensions: ["cmc"] - }, - "application/vnd.crick.clicker": { - source: "iana", - extensions: ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - source: "iana", - extensions: ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - source: "iana", - extensions: ["clkp"] - }, - "application/vnd.crick.clicker.template": { - source: "iana", - extensions: ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - source: "iana", - extensions: ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - source: "iana", - compressible: true, - extensions: ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - source: "iana", - compressible: true - }, - "application/vnd.crypto-shade-file": { - source: "iana" - }, - "application/vnd.cryptomator.encrypted": { - source: "iana" - }, - "application/vnd.cryptomator.vault": { - source: "iana" - }, - "application/vnd.ctc-posml": { - source: "iana", - extensions: ["pml"] - }, - "application/vnd.ctct.ws+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cups-pdf": { - source: "iana" - }, - "application/vnd.cups-postscript": { - source: "iana" - }, - "application/vnd.cups-ppd": { - source: "iana", - extensions: ["ppd"] - }, - "application/vnd.cups-raster": { - source: "iana" - }, - "application/vnd.cups-raw": { - source: "iana" - }, - "application/vnd.curl": { - source: "iana" - }, - "application/vnd.curl.car": { - source: "apache", - extensions: ["car"] - }, - "application/vnd.curl.pcurl": { - source: "apache", - extensions: ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cybank": { - source: "iana" - }, - "application/vnd.cyclonedx+json": { - source: "iana", - compressible: true - }, - "application/vnd.cyclonedx+xml": { - source: "iana", - compressible: true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - source: "iana", - compressible: false - }, - "application/vnd.d3m-dataset": { - source: "iana" - }, - "application/vnd.d3m-problem": { - source: "iana" - }, - "application/vnd.dart": { - source: "iana", - compressible: true, - extensions: ["dart"] - }, - "application/vnd.data-vision.rdz": { - source: "iana", - extensions: ["rdz"] - }, - "application/vnd.datapackage+json": { - source: "iana", - compressible: true - }, - "application/vnd.dataresource+json": { - source: "iana", - compressible: true - }, - "application/vnd.dbf": { - source: "iana", - extensions: ["dbf"] - }, - "application/vnd.debian.binary-package": { - source: "iana" - }, - "application/vnd.dece.data": { - source: "iana", - extensions: ["uvf", "uvvf", "uvd", "uvvd"] - }, - "application/vnd.dece.ttml+xml": { - source: "iana", - compressible: true, - extensions: ["uvt", "uvvt"] - }, - "application/vnd.dece.unspecified": { - source: "iana", - extensions: ["uvx", "uvvx"] - }, - "application/vnd.dece.zip": { - source: "iana", - extensions: ["uvz", "uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - source: "iana", - extensions: ["fe_launch"] - }, - "application/vnd.desmume.movie": { - source: "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - source: "iana" - }, - "application/vnd.dm.delegation+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dna": { - source: "iana", - extensions: ["dna"] - }, - "application/vnd.document+json": { - source: "iana", - compressible: true - }, - "application/vnd.dolby.mlp": { - source: "apache", - extensions: ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - source: "iana" - }, - "application/vnd.dolby.mobile.2": { - source: "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - source: "iana" - }, - "application/vnd.dpgraph": { - source: "iana", - extensions: ["dpg"] - }, - "application/vnd.dreamfactory": { - source: "iana", - extensions: ["dfac"] - }, - "application/vnd.drive+json": { - source: "iana", - compressible: true - }, - "application/vnd.ds-keypoint": { - source: "apache", - extensions: ["kpxx"] - }, - "application/vnd.dtg.local": { - source: "iana" - }, - "application/vnd.dtg.local.flash": { - source: "iana" - }, - "application/vnd.dtg.local.html": { - source: "iana" - }, - "application/vnd.dvb.ait": { - source: "iana", - extensions: ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.dvbj": { - source: "iana" - }, - "application/vnd.dvb.esgcontainer": { - source: "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - source: "iana" - }, - "application/vnd.dvb.ipdcroaming": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - source: "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-container+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-generic+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-init+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.pfr": { - source: "iana" - }, - "application/vnd.dvb.service": { - source: "iana", - extensions: ["svc"] - }, - "application/vnd.dxr": { - source: "iana" - }, - "application/vnd.dynageo": { - source: "iana", - extensions: ["geo"] - }, - "application/vnd.dzr": { - source: "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - source: "iana" - }, - "application/vnd.ecdis-update": { - source: "iana" - }, - "application/vnd.ecip.rlp": { - source: "iana" - }, - "application/vnd.eclipse.ditto+json": { - source: "iana", - compressible: true - }, - "application/vnd.ecowin.chart": { - source: "iana", - extensions: ["mag"] - }, - "application/vnd.ecowin.filerequest": { - source: "iana" - }, - "application/vnd.ecowin.fileupdate": { - source: "iana" - }, - "application/vnd.ecowin.series": { - source: "iana" - }, - "application/vnd.ecowin.seriesrequest": { - source: "iana" - }, - "application/vnd.ecowin.seriesupdate": { - source: "iana" - }, - "application/vnd.efi.img": { - source: "iana" - }, - "application/vnd.efi.iso": { - source: "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - source: "iana", - compressible: true - }, - "application/vnd.enliven": { - source: "iana", - extensions: ["nml"] - }, - "application/vnd.enphase.envoy": { - source: "iana" - }, - "application/vnd.eprints.data+xml": { - source: "iana", - compressible: true - }, - "application/vnd.epson.esf": { - source: "iana", - extensions: ["esf"] - }, - "application/vnd.epson.msf": { - source: "iana", - extensions: ["msf"] - }, - "application/vnd.epson.quickanime": { - source: "iana", - extensions: ["qam"] - }, - "application/vnd.epson.salt": { - source: "iana", - extensions: ["slt"] - }, - "application/vnd.epson.ssf": { - source: "iana", - extensions: ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - source: "iana" - }, - "application/vnd.espass-espass+zip": { - source: "iana", - compressible: false - }, - "application/vnd.eszigno3+xml": { - source: "iana", - compressible: true, - extensions: ["es3", "et3"] - }, - "application/vnd.etsi.aoc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.asic-e+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.asic-s+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.cug+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvcommand+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvservice+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsync+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mcid+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mheg5": { - source: "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.pstn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.sci+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.simservs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.timestamp-token": { - source: "iana" - }, - "application/vnd.etsi.tsl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.tsl.der": { - source: "iana" - }, - "application/vnd.eu.kasparian.car+json": { - source: "iana", - compressible: true - }, - "application/vnd.eudora.data": { - source: "iana" - }, - "application/vnd.evolv.ecig.profile": { - source: "iana" - }, - "application/vnd.evolv.ecig.settings": { - source: "iana" - }, - "application/vnd.evolv.ecig.theme": { - source: "iana" - }, - "application/vnd.exstream-empower+zip": { - source: "iana", - compressible: false - }, - "application/vnd.exstream-package": { - source: "iana" - }, - "application/vnd.ezpix-album": { - source: "iana", - extensions: ["ez2"] - }, - "application/vnd.ezpix-package": { - source: "iana", - extensions: ["ez3"] - }, - "application/vnd.f-secure.mobile": { - source: "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - source: "iana", - compressible: false - }, - "application/vnd.fastcopy-disk-image": { - source: "iana" - }, - "application/vnd.fdf": { - source: "iana", - extensions: ["fdf"] - }, - "application/vnd.fdsn.mseed": { - source: "iana", - extensions: ["mseed"] - }, - "application/vnd.fdsn.seed": { - source: "iana", - extensions: ["seed", "dataless"] - }, - "application/vnd.ffsns": { - source: "iana" - }, - "application/vnd.ficlab.flb+zip": { - source: "iana", - compressible: false - }, - "application/vnd.filmit.zfc": { - source: "iana" - }, - "application/vnd.fints": { - source: "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - source: "iana" - }, - "application/vnd.flographit": { - source: "iana", - extensions: ["gph"] - }, - "application/vnd.fluxtime.clip": { - source: "iana", - extensions: ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - source: "iana" - }, - "application/vnd.framemaker": { - source: "iana", - extensions: ["fm", "frame", "maker", "book"] - }, - "application/vnd.frogans.fnc": { - source: "iana", - extensions: ["fnc"] - }, - "application/vnd.frogans.ltf": { - source: "iana", - extensions: ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - source: "iana", - extensions: ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - source: "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.fujitsu.oasys": { - source: "iana", - extensions: ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - source: "iana", - extensions: ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - source: "iana", - extensions: ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - source: "iana", - extensions: ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - source: "iana", - extensions: ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - source: "iana" - }, - "application/vnd.fujixerox.art4": { - source: "iana" - }, - "application/vnd.fujixerox.ddd": { - source: "iana", - extensions: ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - source: "iana", - extensions: ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - source: "iana", - extensions: ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - source: "iana" - }, - "application/vnd.fujixerox.hbpl": { - source: "iana" - }, - "application/vnd.fut-misnet": { - source: "iana" - }, - "application/vnd.futoin+cbor": { - source: "iana" - }, - "application/vnd.futoin+json": { - source: "iana", - compressible: true - }, - "application/vnd.fuzzysheet": { - source: "iana", - extensions: ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - source: "iana", - extensions: ["txd"] - }, - "application/vnd.gentics.grd+json": { - source: "iana", - compressible: true - }, - "application/vnd.geo+json": { - source: "iana", - compressible: true - }, - "application/vnd.geocube+xml": { - source: "iana", - compressible: true - }, - "application/vnd.geogebra.file": { - source: "iana", - extensions: ["ggb"] - }, - "application/vnd.geogebra.slides": { - source: "iana" - }, - "application/vnd.geogebra.tool": { - source: "iana", - extensions: ["ggt"] - }, - "application/vnd.geometry-explorer": { - source: "iana", - extensions: ["gex", "gre"] - }, - "application/vnd.geonext": { - source: "iana", - extensions: ["gxt"] - }, - "application/vnd.geoplan": { - source: "iana", - extensions: ["g2w"] - }, - "application/vnd.geospace": { - source: "iana", - extensions: ["g3w"] - }, - "application/vnd.gerber": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - source: "iana" - }, - "application/vnd.gmx": { - source: "iana", - extensions: ["gmx"] - }, - "application/vnd.google-apps.document": { - compressible: false, - extensions: ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - compressible: false, - extensions: ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - compressible: false, - extensions: ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - source: "iana", - compressible: true, - extensions: ["kml"] - }, - "application/vnd.google-earth.kmz": { - source: "iana", - compressible: false, - extensions: ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - source: "iana", - compressible: true - }, - "application/vnd.gov.sk.e-form+zip": { - source: "iana", - compressible: false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.grafeq": { - source: "iana", - extensions: ["gqf", "gqs"] - }, - "application/vnd.gridmp": { - source: "iana" - }, - "application/vnd.groove-account": { - source: "iana", - extensions: ["gac"] - }, - "application/vnd.groove-help": { - source: "iana", - extensions: ["ghf"] - }, - "application/vnd.groove-identity-message": { - source: "iana", - extensions: ["gim"] - }, - "application/vnd.groove-injector": { - source: "iana", - extensions: ["grv"] - }, - "application/vnd.groove-tool-message": { - source: "iana", - extensions: ["gtm"] - }, - "application/vnd.groove-tool-template": { - source: "iana", - extensions: ["tpl"] - }, - "application/vnd.groove-vcard": { - source: "iana", - extensions: ["vcg"] - }, - "application/vnd.hal+json": { - source: "iana", - compressible: true - }, - "application/vnd.hal+xml": { - source: "iana", - compressible: true, - extensions: ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - source: "iana", - compressible: true, - extensions: ["zmm"] - }, - "application/vnd.hbci": { - source: "iana", - extensions: ["hbci"] - }, - "application/vnd.hc+json": { - source: "iana", - compressible: true - }, - "application/vnd.hcl-bireports": { - source: "iana" - }, - "application/vnd.hdt": { - source: "iana" - }, - "application/vnd.heroku+json": { - source: "iana", - compressible: true - }, - "application/vnd.hhe.lesson-player": { - source: "iana", - extensions: ["les"] - }, - "application/vnd.hl7cda+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hl7v2+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hp-hpgl": { - source: "iana", - extensions: ["hpgl"] - }, - "application/vnd.hp-hpid": { - source: "iana", - extensions: ["hpid"] - }, - "application/vnd.hp-hps": { - source: "iana", - extensions: ["hps"] - }, - "application/vnd.hp-jlyt": { - source: "iana", - extensions: ["jlt"] - }, - "application/vnd.hp-pcl": { - source: "iana", - extensions: ["pcl"] - }, - "application/vnd.hp-pclxl": { - source: "iana", - extensions: ["pclxl"] - }, - "application/vnd.httphone": { - source: "iana" - }, - "application/vnd.hydrostatix.sof-data": { - source: "iana", - extensions: ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyper-item+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyperdrive+json": { - source: "iana", - compressible: true - }, - "application/vnd.hzn-3d-crossword": { - source: "iana" - }, - "application/vnd.ibm.afplinedata": { - source: "iana" - }, - "application/vnd.ibm.electronic-media": { - source: "iana" - }, - "application/vnd.ibm.minipay": { - source: "iana", - extensions: ["mpy"] - }, - "application/vnd.ibm.modcap": { - source: "iana", - extensions: ["afp", "listafp", "list3820"] - }, - "application/vnd.ibm.rights-management": { - source: "iana", - extensions: ["irm"] - }, - "application/vnd.ibm.secure-container": { - source: "iana", - extensions: ["sc"] - }, - "application/vnd.iccprofile": { - source: "iana", - extensions: ["icc", "icm"] - }, - "application/vnd.ieee.1905": { - source: "iana" - }, - "application/vnd.igloader": { - source: "iana", - extensions: ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - source: "iana", - compressible: false - }, - "application/vnd.imagemeter.image+zip": { - source: "iana", - compressible: false - }, - "application/vnd.immervision-ivp": { - source: "iana", - extensions: ["ivp"] - }, - "application/vnd.immervision-ivu": { - source: "iana", - extensions: ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - source: "iana" - }, - "application/vnd.ims.imsccv1p2": { - source: "iana" - }, - "application/vnd.ims.imsccv1p3": { - source: "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - source: "iana", - compressible: true - }, - "application/vnd.informedcontrol.rms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.informix-visionary": { - source: "iana" - }, - "application/vnd.infotech.project": { - source: "iana" - }, - "application/vnd.infotech.project+xml": { - source: "iana", - compressible: true - }, - "application/vnd.innopath.wamp.notification": { - source: "iana" - }, - "application/vnd.insors.igm": { - source: "iana", - extensions: ["igm"] - }, - "application/vnd.intercon.formnet": { - source: "iana", - extensions: ["xpw", "xpx"] - }, - "application/vnd.intergeo": { - source: "iana", - extensions: ["i2g"] - }, - "application/vnd.intertrust.digibox": { - source: "iana" - }, - "application/vnd.intertrust.nncp": { - source: "iana" - }, - "application/vnd.intu.qbo": { - source: "iana", - extensions: ["qbo"] - }, - "application/vnd.intu.qfx": { - source: "iana", - extensions: ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.packageitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.planningitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ipunplugged.rcprofile": { - source: "iana", - extensions: ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - source: "iana", - compressible: true, - extensions: ["irp"] - }, - "application/vnd.is-xpr": { - source: "iana", - extensions: ["xpr"] - }, - "application/vnd.isac.fcs": { - source: "iana", - extensions: ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - source: "iana", - compressible: false - }, - "application/vnd.jam": { - source: "iana", - extensions: ["jam"] - }, - "application/vnd.japannet-directory-service": { - source: "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-payment-wakeup": { - source: "iana" - }, - "application/vnd.japannet-registration": { - source: "iana" - }, - "application/vnd.japannet-registration-wakeup": { - source: "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-verification": { - source: "iana" - }, - "application/vnd.japannet-verification-wakeup": { - source: "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - source: "iana", - extensions: ["rms"] - }, - "application/vnd.jisp": { - source: "iana", - extensions: ["jisp"] - }, - "application/vnd.joost.joda-archive": { - source: "iana", - extensions: ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - source: "iana" - }, - "application/vnd.kahootz": { - source: "iana", - extensions: ["ktz", "ktr"] - }, - "application/vnd.kde.karbon": { - source: "iana", - extensions: ["karbon"] - }, - "application/vnd.kde.kchart": { - source: "iana", - extensions: ["chrt"] - }, - "application/vnd.kde.kformula": { - source: "iana", - extensions: ["kfo"] - }, - "application/vnd.kde.kivio": { - source: "iana", - extensions: ["flw"] - }, - "application/vnd.kde.kontour": { - source: "iana", - extensions: ["kon"] - }, - "application/vnd.kde.kpresenter": { - source: "iana", - extensions: ["kpr", "kpt"] - }, - "application/vnd.kde.kspread": { - source: "iana", - extensions: ["ksp"] - }, - "application/vnd.kde.kword": { - source: "iana", - extensions: ["kwd", "kwt"] - }, - "application/vnd.kenameaapp": { - source: "iana", - extensions: ["htke"] - }, - "application/vnd.kidspiration": { - source: "iana", - extensions: ["kia"] - }, - "application/vnd.kinar": { - source: "iana", - extensions: ["kne", "knp"] - }, - "application/vnd.koan": { - source: "iana", - extensions: ["skp", "skd", "skt", "skm"] - }, - "application/vnd.kodak-descriptor": { - source: "iana", - extensions: ["sse"] - }, - "application/vnd.las": { - source: "iana" - }, - "application/vnd.las.las+json": { - source: "iana", - compressible: true - }, - "application/vnd.las.las+xml": { - source: "iana", - compressible: true, - extensions: ["lasxml"] - }, - "application/vnd.laszip": { - source: "iana" - }, - "application/vnd.leap+json": { - source: "iana", - compressible: true - }, - "application/vnd.liberty-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - source: "iana", - extensions: ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - source: "iana", - compressible: true, - extensions: ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - source: "iana", - compressible: false - }, - "application/vnd.loom": { - source: "iana" - }, - "application/vnd.lotus-1-2-3": { - source: "iana", - extensions: ["123"] - }, - "application/vnd.lotus-approach": { - source: "iana", - extensions: ["apr"] - }, - "application/vnd.lotus-freelance": { - source: "iana", - extensions: ["pre"] - }, - "application/vnd.lotus-notes": { - source: "iana", - extensions: ["nsf"] - }, - "application/vnd.lotus-organizer": { - source: "iana", - extensions: ["org"] - }, - "application/vnd.lotus-screencam": { - source: "iana", - extensions: ["scm"] - }, - "application/vnd.lotus-wordpro": { - source: "iana", - extensions: ["lwp"] - }, - "application/vnd.macports.portpkg": { - source: "iana", - extensions: ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - source: "iana", - extensions: ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.conftoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.license+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.mdcf": { - source: "iana" - }, - "application/vnd.mason+json": { - source: "iana", - compressible: true - }, - "application/vnd.maxar.archive.3tz+zip": { - source: "iana", - compressible: false - }, - "application/vnd.maxmind.maxmind-db": { - source: "iana" - }, - "application/vnd.mcd": { - source: "iana", - extensions: ["mcd"] - }, - "application/vnd.medcalcdata": { - source: "iana", - extensions: ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - source: "iana", - extensions: ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - source: "iana" - }, - "application/vnd.mfer": { - source: "iana", - extensions: ["mwf"] - }, - "application/vnd.mfmp": { - source: "iana", - extensions: ["mfm"] - }, - "application/vnd.micro+json": { - source: "iana", - compressible: true - }, - "application/vnd.micrografx.flo": { - source: "iana", - extensions: ["flo"] - }, - "application/vnd.micrografx.igx": { - source: "iana", - extensions: ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - source: "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - source: "iana" - }, - "application/vnd.miele+json": { - source: "iana", - compressible: true - }, - "application/vnd.mif": { - source: "iana", - extensions: ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - source: "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - source: "iana" - }, - "application/vnd.mobius.daf": { - source: "iana", - extensions: ["daf"] - }, - "application/vnd.mobius.dis": { - source: "iana", - extensions: ["dis"] - }, - "application/vnd.mobius.mbk": { - source: "iana", - extensions: ["mbk"] - }, - "application/vnd.mobius.mqy": { - source: "iana", - extensions: ["mqy"] - }, - "application/vnd.mobius.msl": { - source: "iana", - extensions: ["msl"] - }, - "application/vnd.mobius.plc": { - source: "iana", - extensions: ["plc"] - }, - "application/vnd.mobius.txf": { - source: "iana", - extensions: ["txf"] - }, - "application/vnd.mophun.application": { - source: "iana", - extensions: ["mpn"] - }, - "application/vnd.mophun.certificate": { - source: "iana", - extensions: ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - source: "iana" - }, - "application/vnd.motorola.iprm": { - source: "iana" - }, - "application/vnd.mozilla.xul+xml": { - source: "iana", - compressible: true, - extensions: ["xul"] - }, - "application/vnd.ms-3mfdocument": { - source: "iana" - }, - "application/vnd.ms-artgalry": { - source: "iana", - extensions: ["cil"] - }, - "application/vnd.ms-asf": { - source: "iana" - }, - "application/vnd.ms-cab-compressed": { - source: "iana", - extensions: ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - source: "apache" - }, - "application/vnd.ms-excel": { - source: "iana", - compressible: false, - extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - source: "iana", - extensions: ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - source: "iana", - extensions: ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - source: "iana", - extensions: ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - source: "iana", - extensions: ["xltm"] - }, - "application/vnd.ms-fontobject": { - source: "iana", - compressible: true, - extensions: ["eot"] - }, - "application/vnd.ms-htmlhelp": { - source: "iana", - extensions: ["chm"] - }, - "application/vnd.ms-ims": { - source: "iana", - extensions: ["ims"] - }, - "application/vnd.ms-lrm": { - source: "iana", - extensions: ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-officetheme": { - source: "iana", - extensions: ["thmx"] - }, - "application/vnd.ms-opentype": { - source: "apache", - compressible: true - }, - "application/vnd.ms-outlook": { - compressible: false, - extensions: ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - source: "apache" - }, - "application/vnd.ms-pki.seccat": { - source: "apache", - extensions: ["cat"] - }, - "application/vnd.ms-pki.stl": { - source: "apache", - extensions: ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-powerpoint": { - source: "iana", - compressible: false, - extensions: ["ppt", "pps", "pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - source: "iana", - extensions: ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - source: "iana", - extensions: ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - source: "iana", - extensions: ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - source: "iana", - extensions: ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - source: "iana", - extensions: ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-printing.printticket+xml": { - source: "apache", - compressible: true - }, - "application/vnd.ms-printschematicket+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-project": { - source: "iana", - extensions: ["mpp", "mpt"] - }, - "application/vnd.ms-tnef": { - source: "iana" - }, - "application/vnd.ms-windows.devicepairing": { - source: "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - source: "iana" - }, - "application/vnd.ms-windows.printerpairing": { - source: "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - source: "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - source: "iana", - extensions: ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - source: "iana", - extensions: ["dotm"] - }, - "application/vnd.ms-works": { - source: "iana", - extensions: ["wps", "wks", "wcm", "wdb"] - }, - "application/vnd.ms-wpl": { - source: "iana", - extensions: ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - source: "iana", - compressible: false, - extensions: ["xps"] - }, - "application/vnd.msa-disk-image": { - source: "iana" - }, - "application/vnd.mseq": { - source: "iana", - extensions: ["mseq"] - }, - "application/vnd.msign": { - source: "iana" - }, - "application/vnd.multiad.creator": { - source: "iana" - }, - "application/vnd.multiad.creator.cif": { - source: "iana" - }, - "application/vnd.music-niff": { - source: "iana" - }, - "application/vnd.musician": { - source: "iana", - extensions: ["mus"] - }, - "application/vnd.muvee.style": { - source: "iana", - extensions: ["msty"] - }, - "application/vnd.mynfc": { - source: "iana", - extensions: ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - source: "iana", - compressible: true - }, - "application/vnd.ncd.control": { - source: "iana" - }, - "application/vnd.ncd.reference": { - source: "iana" - }, - "application/vnd.nearst.inv+json": { - source: "iana", - compressible: true - }, - "application/vnd.nebumind.line": { - source: "iana" - }, - "application/vnd.nervana": { - source: "iana" - }, - "application/vnd.netfpx": { - source: "iana" - }, - "application/vnd.neurolanguage.nlu": { - source: "iana", - extensions: ["nlu"] - }, - "application/vnd.nimn": { - source: "iana" - }, - "application/vnd.nintendo.nitro.rom": { - source: "iana" - }, - "application/vnd.nintendo.snes.rom": { - source: "iana" - }, - "application/vnd.nitf": { - source: "iana", - extensions: ["ntf", "nitf"] - }, - "application/vnd.noblenet-directory": { - source: "iana", - extensions: ["nnd"] - }, - "application/vnd.noblenet-sealer": { - source: "iana", - extensions: ["nns"] - }, - "application/vnd.noblenet-web": { - source: "iana", - extensions: ["nnw"] - }, - "application/vnd.nokia.catalogs": { - source: "iana" - }, - "application/vnd.nokia.conml+wbxml": { - source: "iana" - }, - "application/vnd.nokia.conml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.iptv.config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.isds-radio-presets": { - source: "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - source: "iana" - }, - "application/vnd.nokia.landmark+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.landmarkcollection+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.n-gage.ac+xml": { - source: "iana", - compressible: true, - extensions: ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - source: "iana", - extensions: ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - source: "iana", - extensions: ["n-gage"] - }, - "application/vnd.nokia.ncd": { - source: "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - source: "iana" - }, - "application/vnd.nokia.pcd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.radio-preset": { - source: "iana", - extensions: ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - source: "iana", - extensions: ["rpss"] - }, - "application/vnd.novadigm.edm": { - source: "iana", - extensions: ["edm"] - }, - "application/vnd.novadigm.edx": { - source: "iana", - extensions: ["edx"] - }, - "application/vnd.novadigm.ext": { - source: "iana", - extensions: ["ext"] - }, - "application/vnd.ntt-local.content-share": { - source: "iana" - }, - "application/vnd.ntt-local.file-transfer": { - source: "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - source: "iana" - }, - "application/vnd.oasis.opendocument.chart": { - source: "iana", - extensions: ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - source: "iana", - extensions: ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - source: "iana", - extensions: ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - source: "iana", - extensions: ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - source: "iana", - extensions: ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - source: "iana", - compressible: false, - extensions: ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - source: "iana", - extensions: ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - source: "iana", - extensions: ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - source: "iana", - extensions: ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - source: "iana", - compressible: false, - extensions: ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - source: "iana", - extensions: ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - source: "iana", - compressible: false, - extensions: ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - source: "iana", - extensions: ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - source: "iana", - compressible: false, - extensions: ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - source: "iana", - extensions: ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - source: "iana", - extensions: ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - source: "iana", - extensions: ["oth"] - }, - "application/vnd.obn": { - source: "iana" - }, - "application/vnd.ocf+cbor": { - source: "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - source: "iana", - compressible: true - }, - "application/vnd.oftn.l10n+json": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.cspg-hexbinary": { - source: "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.dae.xhtml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.pae.gem": { - source: "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.spdlist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.ueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.userprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.olpc-sugar": { - source: "iana", - extensions: ["xo"] - }, - "application/vnd.oma-scws-config": { - source: "iana" - }, - "application/vnd.oma-scws-http-request": { - source: "iana" - }, - "application/vnd.oma-scws-http-response": { - source: "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.imd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.ltkm": { - source: "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - source: "iana" - }, - "application/vnd.oma.bcast.sgboot": { - source: "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sgdu": { - source: "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - source: "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sprov+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.stkm": { - source: "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-feature-handler+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-pcc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-subs-invite+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-user-prefs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.dcd": { - source: "iana" - }, - "application/vnd.oma.dcdc": { - source: "iana" - }, - "application/vnd.oma.dd2+xml": { - source: "iana", - compressible: true, - extensions: ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.group-usage-list+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+cbor": { - source: "iana" - }, - "application/vnd.oma.lwm2m+json": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+tlv": { - source: "iana" - }, - "application/vnd.oma.pal+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.final-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.groups+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.push": { - source: "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.xcap-directory+xml": { - source: "iana", - compressible: true - }, - "application/vnd.omads-email+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-file+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-folder+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omaloc-supl-init": { - source: "iana" - }, - "application/vnd.onepager": { - source: "iana" - }, - "application/vnd.onepagertamp": { - source: "iana" - }, - "application/vnd.onepagertamx": { - source: "iana" - }, - "application/vnd.onepagertat": { - source: "iana" - }, - "application/vnd.onepagertatp": { - source: "iana" - }, - "application/vnd.onepagertatx": { - source: "iana" - }, - "application/vnd.openblox.game+xml": { - source: "iana", - compressible: true, - extensions: ["obgx"] - }, - "application/vnd.openblox.game-binary": { - source: "iana" - }, - "application/vnd.openeye.oeb": { - source: "iana" - }, - "application/vnd.openofficeorg.extension": { - source: "apache", - extensions: ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - source: "iana", - compressible: true, - extensions: ["osm"] - }, - "application/vnd.opentimestamps.ots": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - source: "iana", - compressible: false, - extensions: ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - source: "iana", - extensions: ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - source: "iana", - extensions: ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - source: "iana", - extensions: ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - source: "iana", - compressible: false, - extensions: ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - source: "iana", - extensions: ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - source: "iana", - compressible: false, - extensions: ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - source: "iana", - extensions: ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oracle.resource+json": { - source: "iana", - compressible: true - }, - "application/vnd.orange.indata": { - source: "iana" - }, - "application/vnd.osa.netdeploy": { - source: "iana" - }, - "application/vnd.osgeo.mapguide.package": { - source: "iana", - extensions: ["mgp"] - }, - "application/vnd.osgi.bundle": { - source: "iana" - }, - "application/vnd.osgi.dp": { - source: "iana", - extensions: ["dp"] - }, - "application/vnd.osgi.subsystem": { - source: "iana", - extensions: ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oxli.countgraph": { - source: "iana" - }, - "application/vnd.pagerduty+json": { - source: "iana", - compressible: true - }, - "application/vnd.palm": { - source: "iana", - extensions: ["pdb", "pqa", "oprc"] - }, - "application/vnd.panoply": { - source: "iana" - }, - "application/vnd.paos.xml": { - source: "iana" - }, - "application/vnd.patentdive": { - source: "iana" - }, - "application/vnd.patientecommsdoc": { - source: "iana" - }, - "application/vnd.pawaafile": { - source: "iana", - extensions: ["paw"] - }, - "application/vnd.pcos": { - source: "iana" - }, - "application/vnd.pg.format": { - source: "iana", - extensions: ["str"] - }, - "application/vnd.pg.osasli": { - source: "iana", - extensions: ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - source: "iana" - }, - "application/vnd.picsel": { - source: "iana", - extensions: ["efif"] - }, - "application/vnd.pmi.widget": { - source: "iana", - extensions: ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - source: "iana", - compressible: true - }, - "application/vnd.pocketlearn": { - source: "iana", - extensions: ["plf"] - }, - "application/vnd.powerbuilder6": { - source: "iana", - extensions: ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - source: "iana" - }, - "application/vnd.powerbuilder7": { - source: "iana" - }, - "application/vnd.powerbuilder7-s": { - source: "iana" - }, - "application/vnd.powerbuilder75": { - source: "iana" - }, - "application/vnd.powerbuilder75-s": { - source: "iana" - }, - "application/vnd.preminet": { - source: "iana" - }, - "application/vnd.previewsystems.box": { - source: "iana", - extensions: ["box"] - }, - "application/vnd.proteus.magazine": { - source: "iana", - extensions: ["mgz"] - }, - "application/vnd.psfs": { - source: "iana" - }, - "application/vnd.publishare-delta-tree": { - source: "iana", - extensions: ["qps"] - }, - "application/vnd.pvi.ptid1": { - source: "iana", - extensions: ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - source: "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - source: "iana", - compressible: true - }, - "application/vnd.qualcomm.brew-app-res": { - source: "iana" - }, - "application/vnd.quarantainenet": { - source: "iana" - }, - "application/vnd.quark.quarkxpress": { - source: "iana", - extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] - }, - "application/vnd.quobject-quoxdocument": { - source: "iana" - }, - "application/vnd.radisys.moml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - source: "iana", - compressible: true - }, - "application/vnd.rainstor.data": { - source: "iana" - }, - "application/vnd.rapid": { - source: "iana" - }, - "application/vnd.rar": { - source: "iana", - extensions: ["rar"] - }, - "application/vnd.realvnc.bed": { - source: "iana", - extensions: ["bed"] - }, - "application/vnd.recordare.musicxml": { - source: "iana", - extensions: ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - source: "iana", - compressible: true, - extensions: ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - source: "iana" - }, - "application/vnd.resilient.logic": { - source: "iana" - }, - "application/vnd.restful+json": { - source: "iana", - compressible: true - }, - "application/vnd.rig.cryptonote": { - source: "iana", - extensions: ["cryptonote"] - }, - "application/vnd.rim.cod": { - source: "apache", - extensions: ["cod"] - }, - "application/vnd.rn-realmedia": { - source: "apache", - extensions: ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - source: "apache", - extensions: ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - source: "iana", - compressible: true, - extensions: ["link66"] - }, - "application/vnd.rs-274x": { - source: "iana" - }, - "application/vnd.ruckus.download": { - source: "iana" - }, - "application/vnd.s3sms": { - source: "iana" - }, - "application/vnd.sailingtracker.track": { - source: "iana", - extensions: ["st"] - }, - "application/vnd.sar": { - source: "iana" - }, - "application/vnd.sbm.cid": { - source: "iana" - }, - "application/vnd.sbm.mid2": { - source: "iana" - }, - "application/vnd.scribus": { - source: "iana" - }, - "application/vnd.sealed.3df": { - source: "iana" - }, - "application/vnd.sealed.csf": { - source: "iana" - }, - "application/vnd.sealed.doc": { - source: "iana" - }, - "application/vnd.sealed.eml": { - source: "iana" - }, - "application/vnd.sealed.mht": { - source: "iana" - }, - "application/vnd.sealed.net": { - source: "iana" - }, - "application/vnd.sealed.ppt": { - source: "iana" - }, - "application/vnd.sealed.tiff": { - source: "iana" - }, - "application/vnd.sealed.xls": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - source: "iana" - }, - "application/vnd.seemail": { - source: "iana", - extensions: ["see"] - }, - "application/vnd.seis+json": { - source: "iana", - compressible: true - }, - "application/vnd.sema": { - source: "iana", - extensions: ["sema"] - }, - "application/vnd.semd": { - source: "iana", - extensions: ["semd"] - }, - "application/vnd.semf": { - source: "iana", - extensions: ["semf"] - }, - "application/vnd.shade-save-file": { - source: "iana" - }, - "application/vnd.shana.informed.formdata": { - source: "iana", - extensions: ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - source: "iana", - extensions: ["itp"] - }, - "application/vnd.shana.informed.interchange": { - source: "iana", - extensions: ["iif"] - }, - "application/vnd.shana.informed.package": { - source: "iana", - extensions: ["ipk"] - }, - "application/vnd.shootproof+json": { - source: "iana", - compressible: true - }, - "application/vnd.shopkick+json": { - source: "iana", - compressible: true - }, - "application/vnd.shp": { - source: "iana" - }, - "application/vnd.shx": { - source: "iana" - }, - "application/vnd.sigrok.session": { - source: "iana" - }, - "application/vnd.simtech-mindmapper": { - source: "iana", - extensions: ["twd", "twds"] - }, - "application/vnd.siren+json": { - source: "iana", - compressible: true - }, - "application/vnd.smaf": { - source: "iana", - extensions: ["mmf"] - }, - "application/vnd.smart.notebook": { - source: "iana" - }, - "application/vnd.smart.teacher": { - source: "iana", - extensions: ["teacher"] - }, - "application/vnd.snesdev-page-table": { - source: "iana" - }, - "application/vnd.software602.filler.form+xml": { - source: "iana", - compressible: true, - extensions: ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - source: "iana" - }, - "application/vnd.solent.sdkm+xml": { - source: "iana", - compressible: true, - extensions: ["sdkm", "sdkd"] - }, - "application/vnd.spotfire.dxp": { - source: "iana", - extensions: ["dxp"] - }, - "application/vnd.spotfire.sfs": { - source: "iana", - extensions: ["sfs"] - }, - "application/vnd.sqlite3": { - source: "iana" - }, - "application/vnd.sss-cod": { - source: "iana" - }, - "application/vnd.sss-dtf": { - source: "iana" - }, - "application/vnd.sss-ntf": { - source: "iana" - }, - "application/vnd.stardivision.calc": { - source: "apache", - extensions: ["sdc"] - }, - "application/vnd.stardivision.draw": { - source: "apache", - extensions: ["sda"] - }, - "application/vnd.stardivision.impress": { - source: "apache", - extensions: ["sdd"] - }, - "application/vnd.stardivision.math": { - source: "apache", - extensions: ["smf"] - }, - "application/vnd.stardivision.writer": { - source: "apache", - extensions: ["sdw", "vor"] - }, - "application/vnd.stardivision.writer-global": { - source: "apache", - extensions: ["sgl"] - }, - "application/vnd.stepmania.package": { - source: "iana", - extensions: ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - source: "iana", - extensions: ["sm"] - }, - "application/vnd.street-stream": { - source: "iana" - }, - "application/vnd.sun.wadl+xml": { - source: "iana", - compressible: true, - extensions: ["wadl"] - }, - "application/vnd.sun.xml.calc": { - source: "apache", - extensions: ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - source: "apache", - extensions: ["stc"] - }, - "application/vnd.sun.xml.draw": { - source: "apache", - extensions: ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - source: "apache", - extensions: ["std"] - }, - "application/vnd.sun.xml.impress": { - source: "apache", - extensions: ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - source: "apache", - extensions: ["sti"] - }, - "application/vnd.sun.xml.math": { - source: "apache", - extensions: ["sxm"] - }, - "application/vnd.sun.xml.writer": { - source: "apache", - extensions: ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - source: "apache", - extensions: ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - source: "apache", - extensions: ["stw"] - }, - "application/vnd.sus-calendar": { - source: "iana", - extensions: ["sus", "susp"] - }, - "application/vnd.svd": { - source: "iana", - extensions: ["svd"] - }, - "application/vnd.swiftview-ics": { - source: "iana" - }, - "application/vnd.sycle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.syft+json": { - source: "iana", - compressible: true - }, - "application/vnd.symbian.install": { - source: "apache", - extensions: ["sis", "sisx"] - }, - "application/vnd.syncml+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - source: "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmddf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.syncml.ds.notification": { - source: "iana" - }, - "application/vnd.tableschema+json": { - source: "iana", - compressible: true - }, - "application/vnd.tao.intent-module-archive": { - source: "iana", - extensions: ["tao"] - }, - "application/vnd.tcpdump.pcap": { - source: "iana", - extensions: ["pcap", "cap", "dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - source: "iana", - compressible: true - }, - "application/vnd.tmd.mediaflex.api+xml": { - source: "iana", - compressible: true - }, - "application/vnd.tml": { - source: "iana" - }, - "application/vnd.tmobile-livetv": { - source: "iana", - extensions: ["tmo"] - }, - "application/vnd.tri.onesource": { - source: "iana" - }, - "application/vnd.trid.tpt": { - source: "iana", - extensions: ["tpt"] - }, - "application/vnd.triscape.mxs": { - source: "iana", - extensions: ["mxs"] - }, - "application/vnd.trueapp": { - source: "iana", - extensions: ["tra"] - }, - "application/vnd.truedoc": { - source: "iana" - }, - "application/vnd.ubisoft.webplayer": { - source: "iana" - }, - "application/vnd.ufdl": { - source: "iana", - extensions: ["ufd", "ufdl"] - }, - "application/vnd.uiq.theme": { - source: "iana", - extensions: ["utz"] - }, - "application/vnd.umajin": { - source: "iana", - extensions: ["umj"] - }, - "application/vnd.unity": { - source: "iana", - extensions: ["unityweb"] - }, - "application/vnd.uoml+xml": { - source: "iana", - compressible: true, - extensions: ["uoml"] - }, - "application/vnd.uplanet.alert": { - source: "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.cacheop": { - source: "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.channel": { - source: "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.list": { - source: "iana" - }, - "application/vnd.uplanet.list-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.listcmd": { - source: "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.signal": { - source: "iana" - }, - "application/vnd.uri-map": { - source: "iana" - }, - "application/vnd.valve.source.material": { - source: "iana" - }, - "application/vnd.vcx": { - source: "iana", - extensions: ["vcx"] - }, - "application/vnd.vd-study": { - source: "iana" - }, - "application/vnd.vectorworks": { - source: "iana" - }, - "application/vnd.vel+json": { - source: "iana", - compressible: true - }, - "application/vnd.verimatrix.vcas": { - source: "iana" - }, - "application/vnd.veritone.aion+json": { - source: "iana", - compressible: true - }, - "application/vnd.veryant.thin": { - source: "iana" - }, - "application/vnd.ves.encrypted": { - source: "iana" - }, - "application/vnd.vidsoft.vidconference": { - source: "iana" - }, - "application/vnd.visio": { - source: "iana", - extensions: ["vsd", "vst", "vss", "vsw"] - }, - "application/vnd.visionary": { - source: "iana", - extensions: ["vis"] - }, - "application/vnd.vividence.scriptfile": { - source: "iana" - }, - "application/vnd.vsf": { - source: "iana", - extensions: ["vsf"] - }, - "application/vnd.wap.sic": { - source: "iana" - }, - "application/vnd.wap.slc": { - source: "iana" - }, - "application/vnd.wap.wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["wbxml"] - }, - "application/vnd.wap.wmlc": { - source: "iana", - extensions: ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - source: "iana", - extensions: ["wmlsc"] - }, - "application/vnd.webturbo": { - source: "iana", - extensions: ["wtb"] - }, - "application/vnd.wfa.dpp": { - source: "iana" - }, - "application/vnd.wfa.p2p": { - source: "iana" - }, - "application/vnd.wfa.wsc": { - source: "iana" - }, - "application/vnd.windows.devicepairing": { - source: "iana" - }, - "application/vnd.wmc": { - source: "iana" - }, - "application/vnd.wmf.bootstrap": { - source: "iana" - }, - "application/vnd.wolfram.mathematica": { - source: "iana" - }, - "application/vnd.wolfram.mathematica.package": { - source: "iana" - }, - "application/vnd.wolfram.player": { - source: "iana", - extensions: ["nbp"] - }, - "application/vnd.wordperfect": { - source: "iana", - extensions: ["wpd"] - }, - "application/vnd.wqd": { - source: "iana", - extensions: ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - source: "iana" - }, - "application/vnd.wt.stf": { - source: "iana", - extensions: ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - source: "iana" - }, - "application/vnd.wv.csp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.wv.ssp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xacml+json": { - source: "iana", - compressible: true - }, - "application/vnd.xara": { - source: "iana", - extensions: ["xar"] - }, - "application/vnd.xfdl": { - source: "iana", - extensions: ["xfdl"] - }, - "application/vnd.xfdl.webform": { - source: "iana" - }, - "application/vnd.xmi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xmpie.cpkg": { - source: "iana" - }, - "application/vnd.xmpie.dpkg": { - source: "iana" - }, - "application/vnd.xmpie.plan": { - source: "iana" - }, - "application/vnd.xmpie.ppkg": { - source: "iana" - }, - "application/vnd.xmpie.xlim": { - source: "iana" - }, - "application/vnd.yamaha.hv-dic": { - source: "iana", - extensions: ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - source: "iana", - extensions: ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - source: "iana", - extensions: ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - source: "iana", - extensions: ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - source: "iana", - compressible: true, - extensions: ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - source: "iana" - }, - "application/vnd.yamaha.smaf-audio": { - source: "iana", - extensions: ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - source: "iana", - extensions: ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - source: "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - source: "iana" - }, - "application/vnd.yaoweme": { - source: "iana" - }, - "application/vnd.yellowriver-custom-menu": { - source: "iana", - extensions: ["cmp"] - }, - "application/vnd.youtube.yt": { - source: "iana" - }, - "application/vnd.zul": { - source: "iana", - extensions: ["zir", "zirz"] - }, - "application/vnd.zzazz.deck+xml": { - source: "iana", - compressible: true, - extensions: ["zaz"] - }, - "application/voicexml+xml": { - source: "iana", - compressible: true, - extensions: ["vxml"] - }, - "application/voucher-cms+json": { - source: "iana", - compressible: true - }, - "application/vq-rtcpxr": { - source: "iana" - }, - "application/wasm": { - source: "iana", - compressible: true, - extensions: ["wasm"] - }, - "application/watcherinfo+xml": { - source: "iana", - compressible: true, - extensions: ["wif"] - }, - "application/webpush-options+json": { - source: "iana", - compressible: true - }, - "application/whoispp-query": { - source: "iana" - }, - "application/whoispp-response": { - source: "iana" - }, - "application/widget": { - source: "iana", - extensions: ["wgt"] - }, - "application/winhlp": { - source: "apache", - extensions: ["hlp"] - }, - "application/wita": { - source: "iana" - }, - "application/wordperfect5.1": { - source: "iana" - }, - "application/wsdl+xml": { - source: "iana", - compressible: true, - extensions: ["wsdl"] - }, - "application/wspolicy+xml": { - source: "iana", - compressible: true, - extensions: ["wspolicy"] - }, - "application/x-7z-compressed": { - source: "apache", - compressible: false, - extensions: ["7z"] - }, - "application/x-abiword": { - source: "apache", - extensions: ["abw"] - }, - "application/x-ace-compressed": { - source: "apache", - extensions: ["ace"] - }, - "application/x-amf": { - source: "apache" - }, - "application/x-apple-diskimage": { - source: "apache", - extensions: ["dmg"] - }, - "application/x-arj": { - compressible: false, - extensions: ["arj"] - }, - "application/x-authorware-bin": { - source: "apache", - extensions: ["aab", "x32", "u32", "vox"] - }, - "application/x-authorware-map": { - source: "apache", - extensions: ["aam"] - }, - "application/x-authorware-seg": { - source: "apache", - extensions: ["aas"] - }, - "application/x-bcpio": { - source: "apache", - extensions: ["bcpio"] - }, - "application/x-bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/x-bittorrent": { - source: "apache", - extensions: ["torrent"] - }, - "application/x-blorb": { - source: "apache", - extensions: ["blb", "blorb"] - }, - "application/x-bzip": { - source: "apache", - compressible: false, - extensions: ["bz"] - }, - "application/x-bzip2": { - source: "apache", - compressible: false, - extensions: ["bz2", "boz"] - }, - "application/x-cbr": { - source: "apache", - extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] - }, - "application/x-cdlink": { - source: "apache", - extensions: ["vcd"] - }, - "application/x-cfs-compressed": { - source: "apache", - extensions: ["cfs"] - }, - "application/x-chat": { - source: "apache", - extensions: ["chat"] - }, - "application/x-chess-pgn": { - source: "apache", - extensions: ["pgn"] - }, - "application/x-chrome-extension": { - extensions: ["crx"] - }, - "application/x-cocoa": { - source: "nginx", - extensions: ["cco"] - }, - "application/x-compress": { - source: "apache" - }, - "application/x-conference": { - source: "apache", - extensions: ["nsc"] - }, - "application/x-cpio": { - source: "apache", - extensions: ["cpio"] - }, - "application/x-csh": { - source: "apache", - extensions: ["csh"] - }, - "application/x-deb": { - compressible: false - }, - "application/x-debian-package": { - source: "apache", - extensions: ["deb", "udeb"] - }, - "application/x-dgc-compressed": { - source: "apache", - extensions: ["dgc"] - }, - "application/x-director": { - source: "apache", - extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] - }, - "application/x-doom": { - source: "apache", - extensions: ["wad"] - }, - "application/x-dtbncx+xml": { - source: "apache", - compressible: true, - extensions: ["ncx"] - }, - "application/x-dtbook+xml": { - source: "apache", - compressible: true, - extensions: ["dtb"] - }, - "application/x-dtbresource+xml": { - source: "apache", - compressible: true, - extensions: ["res"] - }, - "application/x-dvi": { - source: "apache", - compressible: false, - extensions: ["dvi"] - }, - "application/x-envoy": { - source: "apache", - extensions: ["evy"] - }, - "application/x-eva": { - source: "apache", - extensions: ["eva"] - }, - "application/x-font-bdf": { - source: "apache", - extensions: ["bdf"] - }, - "application/x-font-dos": { - source: "apache" - }, - "application/x-font-framemaker": { - source: "apache" - }, - "application/x-font-ghostscript": { - source: "apache", - extensions: ["gsf"] - }, - "application/x-font-libgrx": { - source: "apache" - }, - "application/x-font-linux-psf": { - source: "apache", - extensions: ["psf"] - }, - "application/x-font-pcf": { - source: "apache", - extensions: ["pcf"] - }, - "application/x-font-snf": { - source: "apache", - extensions: ["snf"] - }, - "application/x-font-speedo": { - source: "apache" - }, - "application/x-font-sunos-news": { - source: "apache" - }, - "application/x-font-type1": { - source: "apache", - extensions: ["pfa", "pfb", "pfm", "afm"] - }, - "application/x-font-vfont": { - source: "apache" - }, - "application/x-freearc": { - source: "apache", - extensions: ["arc"] - }, - "application/x-futuresplash": { - source: "apache", - extensions: ["spl"] - }, - "application/x-gca-compressed": { - source: "apache", - extensions: ["gca"] - }, - "application/x-glulx": { - source: "apache", - extensions: ["ulx"] - }, - "application/x-gnumeric": { - source: "apache", - extensions: ["gnumeric"] - }, - "application/x-gramps-xml": { - source: "apache", - extensions: ["gramps"] - }, - "application/x-gtar": { - source: "apache", - extensions: ["gtar"] - }, - "application/x-gzip": { - source: "apache" - }, - "application/x-hdf": { - source: "apache", - extensions: ["hdf"] - }, - "application/x-httpd-php": { - compressible: true, - extensions: ["php"] - }, - "application/x-install-instructions": { - source: "apache", - extensions: ["install"] - }, - "application/x-iso9660-image": { - source: "apache", - extensions: ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - extensions: ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - extensions: ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - extensions: ["pages"] - }, - "application/x-java-archive-diff": { - source: "nginx", - extensions: ["jardiff"] - }, - "application/x-java-jnlp-file": { - source: "apache", - compressible: false, - extensions: ["jnlp"] - }, - "application/x-javascript": { - compressible: true - }, - "application/x-keepass2": { - extensions: ["kdbx"] - }, - "application/x-latex": { - source: "apache", - compressible: false, - extensions: ["latex"] - }, - "application/x-lua-bytecode": { - extensions: ["luac"] - }, - "application/x-lzh-compressed": { - source: "apache", - extensions: ["lzh", "lha"] - }, - "application/x-makeself": { - source: "nginx", - extensions: ["run"] - }, - "application/x-mie": { - source: "apache", - extensions: ["mie"] - }, - "application/x-mobipocket-ebook": { - source: "apache", - extensions: ["prc", "mobi"] - }, - "application/x-mpegurl": { - compressible: false - }, - "application/x-ms-application": { - source: "apache", - extensions: ["application"] - }, - "application/x-ms-shortcut": { - source: "apache", - extensions: ["lnk"] - }, - "application/x-ms-wmd": { - source: "apache", - extensions: ["wmd"] - }, - "application/x-ms-wmz": { - source: "apache", - extensions: ["wmz"] - }, - "application/x-ms-xbap": { - source: "apache", - extensions: ["xbap"] - }, - "application/x-msaccess": { - source: "apache", - extensions: ["mdb"] - }, - "application/x-msbinder": { - source: "apache", - extensions: ["obd"] - }, - "application/x-mscardfile": { - source: "apache", - extensions: ["crd"] - }, - "application/x-msclip": { - source: "apache", - extensions: ["clp"] - }, - "application/x-msdos-program": { - extensions: ["exe"] - }, - "application/x-msdownload": { - source: "apache", - extensions: ["exe", "dll", "com", "bat", "msi"] - }, - "application/x-msmediaview": { - source: "apache", - extensions: ["mvb", "m13", "m14"] - }, - "application/x-msmetafile": { - source: "apache", - extensions: ["wmf", "wmz", "emf", "emz"] - }, - "application/x-msmoney": { - source: "apache", - extensions: ["mny"] - }, - "application/x-mspublisher": { - source: "apache", - extensions: ["pub"] - }, - "application/x-msschedule": { - source: "apache", - extensions: ["scd"] - }, - "application/x-msterminal": { - source: "apache", - extensions: ["trm"] - }, - "application/x-mswrite": { - source: "apache", - extensions: ["wri"] - }, - "application/x-netcdf": { - source: "apache", - extensions: ["nc", "cdf"] - }, - "application/x-ns-proxy-autoconfig": { - compressible: true, - extensions: ["pac"] - }, - "application/x-nzb": { - source: "apache", - extensions: ["nzb"] - }, - "application/x-perl": { - source: "nginx", - extensions: ["pl", "pm"] - }, - "application/x-pilot": { - source: "nginx", - extensions: ["prc", "pdb"] - }, - "application/x-pkcs12": { - source: "apache", - compressible: false, - extensions: ["p12", "pfx"] - }, - "application/x-pkcs7-certificates": { - source: "apache", - extensions: ["p7b", "spc"] - }, - "application/x-pkcs7-certreqresp": { - source: "apache", - extensions: ["p7r"] - }, - "application/x-pki-message": { - source: "iana" - }, - "application/x-rar-compressed": { - source: "apache", - compressible: false, - extensions: ["rar"] - }, - "application/x-redhat-package-manager": { - source: "nginx", - extensions: ["rpm"] - }, - "application/x-research-info-systems": { - source: "apache", - extensions: ["ris"] - }, - "application/x-sea": { - source: "nginx", - extensions: ["sea"] - }, - "application/x-sh": { - source: "apache", - compressible: true, - extensions: ["sh"] - }, - "application/x-shar": { - source: "apache", - extensions: ["shar"] - }, - "application/x-shockwave-flash": { - source: "apache", - compressible: false, - extensions: ["swf"] - }, - "application/x-silverlight-app": { - source: "apache", - extensions: ["xap"] - }, - "application/x-sql": { - source: "apache", - extensions: ["sql"] - }, - "application/x-stuffit": { - source: "apache", - compressible: false, - extensions: ["sit"] - }, - "application/x-stuffitx": { - source: "apache", - extensions: ["sitx"] - }, - "application/x-subrip": { - source: "apache", - extensions: ["srt"] - }, - "application/x-sv4cpio": { - source: "apache", - extensions: ["sv4cpio"] - }, - "application/x-sv4crc": { - source: "apache", - extensions: ["sv4crc"] - }, - "application/x-t3vm-image": { - source: "apache", - extensions: ["t3"] - }, - "application/x-tads": { - source: "apache", - extensions: ["gam"] - }, - "application/x-tar": { - source: "apache", - compressible: true, - extensions: ["tar"] - }, - "application/x-tcl": { - source: "apache", - extensions: ["tcl", "tk"] - }, - "application/x-tex": { - source: "apache", - extensions: ["tex"] - }, - "application/x-tex-tfm": { - source: "apache", - extensions: ["tfm"] - }, - "application/x-texinfo": { - source: "apache", - extensions: ["texinfo", "texi"] - }, - "application/x-tgif": { - source: "apache", - extensions: ["obj"] - }, - "application/x-ustar": { - source: "apache", - extensions: ["ustar"] - }, - "application/x-virtualbox-hdd": { - compressible: true, - extensions: ["hdd"] - }, - "application/x-virtualbox-ova": { - compressible: true, - extensions: ["ova"] - }, - "application/x-virtualbox-ovf": { - compressible: true, - extensions: ["ovf"] - }, - "application/x-virtualbox-vbox": { - compressible: true, - extensions: ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - compressible: false, - extensions: ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - compressible: true, - extensions: ["vdi"] - }, - "application/x-virtualbox-vhd": { - compressible: true, - extensions: ["vhd"] - }, - "application/x-virtualbox-vmdk": { - compressible: true, - extensions: ["vmdk"] - }, - "application/x-wais-source": { - source: "apache", - extensions: ["src"] - }, - "application/x-web-app-manifest+json": { - compressible: true, - extensions: ["webapp"] - }, - "application/x-www-form-urlencoded": { - source: "iana", - compressible: true - }, - "application/x-x509-ca-cert": { - source: "iana", - extensions: ["der", "crt", "pem"] - }, - "application/x-x509-ca-ra-cert": { - source: "iana" - }, - "application/x-x509-next-ca-cert": { - source: "iana" - }, - "application/x-xfig": { - source: "apache", - extensions: ["fig"] - }, - "application/x-xliff+xml": { - source: "apache", - compressible: true, - extensions: ["xlf"] - }, - "application/x-xpinstall": { - source: "apache", - compressible: false, - extensions: ["xpi"] - }, - "application/x-xz": { - source: "apache", - extensions: ["xz"] - }, - "application/x-zmachine": { - source: "apache", - extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] - }, - "application/x400-bp": { - source: "iana" - }, - "application/xacml+xml": { - source: "iana", - compressible: true - }, - "application/xaml+xml": { - source: "apache", - compressible: true, - extensions: ["xaml"] - }, - "application/xcap-att+xml": { - source: "iana", - compressible: true, - extensions: ["xav"] - }, - "application/xcap-caps+xml": { - source: "iana", - compressible: true, - extensions: ["xca"] - }, - "application/xcap-diff+xml": { - source: "iana", - compressible: true, - extensions: ["xdf"] - }, - "application/xcap-el+xml": { - source: "iana", - compressible: true, - extensions: ["xel"] - }, - "application/xcap-error+xml": { - source: "iana", - compressible: true - }, - "application/xcap-ns+xml": { - source: "iana", - compressible: true, - extensions: ["xns"] - }, - "application/xcon-conference-info+xml": { - source: "iana", - compressible: true - }, - "application/xcon-conference-info-diff+xml": { - source: "iana", - compressible: true - }, - "application/xenc+xml": { - source: "iana", - compressible: true, - extensions: ["xenc"] - }, - "application/xhtml+xml": { - source: "iana", - compressible: true, - extensions: ["xhtml", "xht"] - }, - "application/xhtml-voice+xml": { - source: "apache", - compressible: true - }, - "application/xliff+xml": { - source: "iana", - compressible: true, - extensions: ["xlf"] - }, - "application/xml": { - source: "iana", - compressible: true, - extensions: ["xml", "xsl", "xsd", "rng"] - }, - "application/xml-dtd": { - source: "iana", - compressible: true, - extensions: ["dtd"] - }, - "application/xml-external-parsed-entity": { - source: "iana" - }, - "application/xml-patch+xml": { - source: "iana", - compressible: true - }, - "application/xmpp+xml": { - source: "iana", - compressible: true - }, - "application/xop+xml": { - source: "iana", - compressible: true, - extensions: ["xop"] - }, - "application/xproc+xml": { - source: "apache", - compressible: true, - extensions: ["xpl"] - }, - "application/xslt+xml": { - source: "iana", - compressible: true, - extensions: ["xsl", "xslt"] - }, - "application/xspf+xml": { - source: "apache", - compressible: true, - extensions: ["xspf"] - }, - "application/xv+xml": { - source: "iana", - compressible: true, - extensions: ["mxml", "xhvml", "xvml", "xvm"] - }, - "application/yang": { - source: "iana", - extensions: ["yang"] - }, - "application/yang-data+json": { - source: "iana", - compressible: true - }, - "application/yang-data+xml": { - source: "iana", - compressible: true - }, - "application/yang-patch+json": { - source: "iana", - compressible: true - }, - "application/yang-patch+xml": { - source: "iana", - compressible: true - }, - "application/yin+xml": { - source: "iana", - compressible: true, - extensions: ["yin"] - }, - "application/zip": { - source: "iana", - compressible: false, - extensions: ["zip"] - }, - "application/zlib": { - source: "iana" - }, - "application/zstd": { - source: "iana" - }, - "audio/1d-interleaved-parityfec": { - source: "iana" - }, - "audio/32kadpcm": { - source: "iana" - }, - "audio/3gpp": { - source: "iana", - compressible: false, - extensions: ["3gpp"] - }, - "audio/3gpp2": { - source: "iana" - }, - "audio/aac": { - source: "iana" - }, - "audio/ac3": { - source: "iana" - }, - "audio/adpcm": { - source: "apache", - extensions: ["adp"] - }, - "audio/amr": { - source: "iana", - extensions: ["amr"] - }, - "audio/amr-wb": { - source: "iana" - }, - "audio/amr-wb+": { - source: "iana" - }, - "audio/aptx": { - source: "iana" - }, - "audio/asc": { - source: "iana" - }, - "audio/atrac-advanced-lossless": { - source: "iana" - }, - "audio/atrac-x": { - source: "iana" - }, - "audio/atrac3": { - source: "iana" - }, - "audio/basic": { - source: "iana", - compressible: false, - extensions: ["au", "snd"] - }, - "audio/bv16": { - source: "iana" - }, - "audio/bv32": { - source: "iana" - }, - "audio/clearmode": { - source: "iana" - }, - "audio/cn": { - source: "iana" - }, - "audio/dat12": { - source: "iana" - }, - "audio/dls": { - source: "iana" - }, - "audio/dsr-es201108": { - source: "iana" - }, - "audio/dsr-es202050": { - source: "iana" - }, - "audio/dsr-es202211": { - source: "iana" - }, - "audio/dsr-es202212": { - source: "iana" - }, - "audio/dv": { - source: "iana" - }, - "audio/dvi4": { - source: "iana" - }, - "audio/eac3": { - source: "iana" - }, - "audio/encaprtp": { - source: "iana" - }, - "audio/evrc": { - source: "iana" - }, - "audio/evrc-qcp": { - source: "iana" - }, - "audio/evrc0": { - source: "iana" - }, - "audio/evrc1": { - source: "iana" - }, - "audio/evrcb": { - source: "iana" - }, - "audio/evrcb0": { - source: "iana" - }, - "audio/evrcb1": { - source: "iana" - }, - "audio/evrcnw": { - source: "iana" - }, - "audio/evrcnw0": { - source: "iana" - }, - "audio/evrcnw1": { - source: "iana" - }, - "audio/evrcwb": { - source: "iana" - }, - "audio/evrcwb0": { - source: "iana" - }, - "audio/evrcwb1": { - source: "iana" - }, - "audio/evs": { - source: "iana" - }, - "audio/flexfec": { - source: "iana" - }, - "audio/fwdred": { - source: "iana" - }, - "audio/g711-0": { - source: "iana" - }, - "audio/g719": { - source: "iana" - }, - "audio/g722": { - source: "iana" - }, - "audio/g7221": { - source: "iana" - }, - "audio/g723": { - source: "iana" - }, - "audio/g726-16": { - source: "iana" - }, - "audio/g726-24": { - source: "iana" - }, - "audio/g726-32": { - source: "iana" - }, - "audio/g726-40": { - source: "iana" - }, - "audio/g728": { - source: "iana" - }, - "audio/g729": { - source: "iana" - }, - "audio/g7291": { - source: "iana" - }, - "audio/g729d": { - source: "iana" - }, - "audio/g729e": { - source: "iana" - }, - "audio/gsm": { - source: "iana" - }, - "audio/gsm-efr": { - source: "iana" - }, - "audio/gsm-hr-08": { - source: "iana" - }, - "audio/ilbc": { - source: "iana" - }, - "audio/ip-mr_v2.5": { - source: "iana" - }, - "audio/isac": { - source: "apache" - }, - "audio/l16": { - source: "iana" - }, - "audio/l20": { - source: "iana" - }, - "audio/l24": { - source: "iana", - compressible: false - }, - "audio/l8": { - source: "iana" - }, - "audio/lpc": { - source: "iana" - }, - "audio/melp": { - source: "iana" - }, - "audio/melp1200": { - source: "iana" - }, - "audio/melp2400": { - source: "iana" - }, - "audio/melp600": { - source: "iana" - }, - "audio/mhas": { - source: "iana" - }, - "audio/midi": { - source: "apache", - extensions: ["mid", "midi", "kar", "rmi"] - }, - "audio/mobile-xmf": { - source: "iana", - extensions: ["mxmf"] - }, - "audio/mp3": { - compressible: false, - extensions: ["mp3"] - }, - "audio/mp4": { - source: "iana", - compressible: false, - extensions: ["m4a", "mp4a"] - }, - "audio/mp4a-latm": { - source: "iana" - }, - "audio/mpa": { - source: "iana" - }, - "audio/mpa-robust": { - source: "iana" - }, - "audio/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] - }, - "audio/mpeg4-generic": { - source: "iana" - }, - "audio/musepack": { - source: "apache" - }, - "audio/ogg": { - source: "iana", - compressible: false, - extensions: ["oga", "ogg", "spx", "opus"] - }, - "audio/opus": { - source: "iana" - }, - "audio/parityfec": { - source: "iana" - }, - "audio/pcma": { - source: "iana" - }, - "audio/pcma-wb": { - source: "iana" - }, - "audio/pcmu": { - source: "iana" - }, - "audio/pcmu-wb": { - source: "iana" - }, - "audio/prs.sid": { - source: "iana" - }, - "audio/qcelp": { - source: "iana" - }, - "audio/raptorfec": { - source: "iana" - }, - "audio/red": { - source: "iana" - }, - "audio/rtp-enc-aescm128": { - source: "iana" - }, - "audio/rtp-midi": { - source: "iana" - }, - "audio/rtploopback": { - source: "iana" - }, - "audio/rtx": { - source: "iana" - }, - "audio/s3m": { - source: "apache", - extensions: ["s3m"] - }, - "audio/scip": { - source: "iana" - }, - "audio/silk": { - source: "apache", - extensions: ["sil"] - }, - "audio/smv": { - source: "iana" - }, - "audio/smv-qcp": { - source: "iana" - }, - "audio/smv0": { - source: "iana" - }, - "audio/sofa": { - source: "iana" - }, - "audio/sp-midi": { - source: "iana" - }, - "audio/speex": { - source: "iana" - }, - "audio/t140c": { - source: "iana" - }, - "audio/t38": { - source: "iana" - }, - "audio/telephone-event": { - source: "iana" - }, - "audio/tetra_acelp": { - source: "iana" - }, - "audio/tetra_acelp_bb": { - source: "iana" - }, - "audio/tone": { - source: "iana" - }, - "audio/tsvcis": { - source: "iana" - }, - "audio/uemclip": { - source: "iana" - }, - "audio/ulpfec": { - source: "iana" - }, - "audio/usac": { - source: "iana" - }, - "audio/vdvi": { - source: "iana" - }, - "audio/vmr-wb": { - source: "iana" - }, - "audio/vnd.3gpp.iufp": { - source: "iana" - }, - "audio/vnd.4sb": { - source: "iana" - }, - "audio/vnd.audiokoz": { - source: "iana" - }, - "audio/vnd.celp": { - source: "iana" - }, - "audio/vnd.cisco.nse": { - source: "iana" - }, - "audio/vnd.cmles.radio-events": { - source: "iana" - }, - "audio/vnd.cns.anp1": { - source: "iana" - }, - "audio/vnd.cns.inf1": { - source: "iana" - }, - "audio/vnd.dece.audio": { - source: "iana", - extensions: ["uva", "uvva"] - }, - "audio/vnd.digital-winds": { - source: "iana", - extensions: ["eol"] - }, - "audio/vnd.dlna.adts": { - source: "iana" - }, - "audio/vnd.dolby.heaac.1": { - source: "iana" - }, - "audio/vnd.dolby.heaac.2": { - source: "iana" - }, - "audio/vnd.dolby.mlp": { - source: "iana" - }, - "audio/vnd.dolby.mps": { - source: "iana" - }, - "audio/vnd.dolby.pl2": { - source: "iana" - }, - "audio/vnd.dolby.pl2x": { - source: "iana" - }, - "audio/vnd.dolby.pl2z": { - source: "iana" - }, - "audio/vnd.dolby.pulse.1": { - source: "iana" - }, - "audio/vnd.dra": { - source: "iana", - extensions: ["dra"] - }, - "audio/vnd.dts": { - source: "iana", - extensions: ["dts"] - }, - "audio/vnd.dts.hd": { - source: "iana", - extensions: ["dtshd"] - }, - "audio/vnd.dts.uhd": { - source: "iana" - }, - "audio/vnd.dvb.file": { - source: "iana" - }, - "audio/vnd.everad.plj": { - source: "iana" - }, - "audio/vnd.hns.audio": { - source: "iana" - }, - "audio/vnd.lucent.voice": { - source: "iana", - extensions: ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - source: "iana", - extensions: ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - source: "iana" - }, - "audio/vnd.nortel.vbk": { - source: "iana" - }, - "audio/vnd.nuera.ecelp4800": { - source: "iana", - extensions: ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - source: "iana", - extensions: ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - source: "iana", - extensions: ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - source: "iana" - }, - "audio/vnd.presonus.multitrack": { - source: "iana" - }, - "audio/vnd.qcelp": { - source: "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - source: "iana" - }, - "audio/vnd.rip": { - source: "iana", - extensions: ["rip"] - }, - "audio/vnd.rn-realaudio": { - compressible: false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - source: "iana" - }, - "audio/vnd.vmx.cvsd": { - source: "iana" - }, - "audio/vnd.wave": { - compressible: false - }, - "audio/vorbis": { - source: "iana", - compressible: false - }, - "audio/vorbis-config": { - source: "iana" - }, - "audio/wav": { - compressible: false, - extensions: ["wav"] - }, - "audio/wave": { - compressible: false, - extensions: ["wav"] - }, - "audio/webm": { - source: "apache", - compressible: false, - extensions: ["weba"] - }, - "audio/x-aac": { - source: "apache", - compressible: false, - extensions: ["aac"] - }, - "audio/x-aiff": { - source: "apache", - extensions: ["aif", "aiff", "aifc"] - }, - "audio/x-caf": { - source: "apache", - compressible: false, - extensions: ["caf"] - }, - "audio/x-flac": { - source: "apache", - extensions: ["flac"] - }, - "audio/x-m4a": { - source: "nginx", - extensions: ["m4a"] - }, - "audio/x-matroska": { - source: "apache", - extensions: ["mka"] - }, - "audio/x-mpegurl": { - source: "apache", - extensions: ["m3u"] - }, - "audio/x-ms-wax": { - source: "apache", - extensions: ["wax"] - }, - "audio/x-ms-wma": { - source: "apache", - extensions: ["wma"] - }, - "audio/x-pn-realaudio": { - source: "apache", - extensions: ["ram", "ra"] - }, - "audio/x-pn-realaudio-plugin": { - source: "apache", - extensions: ["rmp"] - }, - "audio/x-realaudio": { - source: "nginx", - extensions: ["ra"] - }, - "audio/x-tta": { - source: "apache" - }, - "audio/x-wav": { - source: "apache", - extensions: ["wav"] - }, - "audio/xm": { - source: "apache", - extensions: ["xm"] - }, - "chemical/x-cdx": { - source: "apache", - extensions: ["cdx"] - }, - "chemical/x-cif": { - source: "apache", - extensions: ["cif"] - }, - "chemical/x-cmdf": { - source: "apache", - extensions: ["cmdf"] - }, - "chemical/x-cml": { - source: "apache", - extensions: ["cml"] - }, - "chemical/x-csml": { - source: "apache", - extensions: ["csml"] - }, - "chemical/x-pdb": { - source: "apache" - }, - "chemical/x-xyz": { - source: "apache", - extensions: ["xyz"] - }, - "font/collection": { - source: "iana", - extensions: ["ttc"] - }, - "font/otf": { - source: "iana", - compressible: true, - extensions: ["otf"] - }, - "font/sfnt": { - source: "iana" - }, - "font/ttf": { - source: "iana", - compressible: true, - extensions: ["ttf"] - }, - "font/woff": { - source: "iana", - extensions: ["woff"] - }, - "font/woff2": { - source: "iana", - extensions: ["woff2"] - }, - "image/aces": { - source: "iana", - extensions: ["exr"] - }, - "image/apng": { - compressible: false, - extensions: ["apng"] - }, - "image/avci": { - source: "iana", - extensions: ["avci"] - }, - "image/avcs": { - source: "iana", - extensions: ["avcs"] - }, - "image/avif": { - source: "iana", - compressible: false, - extensions: ["avif"] - }, - "image/bmp": { - source: "iana", - compressible: true, - extensions: ["bmp"] - }, - "image/cgm": { - source: "iana", - extensions: ["cgm"] - }, - "image/dicom-rle": { - source: "iana", - extensions: ["drle"] - }, - "image/emf": { - source: "iana", - extensions: ["emf"] - }, - "image/fits": { - source: "iana", - extensions: ["fits"] - }, - "image/g3fax": { - source: "iana", - extensions: ["g3"] - }, - "image/gif": { - source: "iana", - compressible: false, - extensions: ["gif"] - }, - "image/heic": { - source: "iana", - extensions: ["heic"] - }, - "image/heic-sequence": { - source: "iana", - extensions: ["heics"] - }, - "image/heif": { - source: "iana", - extensions: ["heif"] - }, - "image/heif-sequence": { - source: "iana", - extensions: ["heifs"] - }, - "image/hej2k": { - source: "iana", - extensions: ["hej2"] - }, - "image/hsj2": { - source: "iana", - extensions: ["hsj2"] - }, - "image/ief": { - source: "iana", - extensions: ["ief"] - }, - "image/jls": { - source: "iana", - extensions: ["jls"] - }, - "image/jp2": { - source: "iana", - compressible: false, - extensions: ["jp2", "jpg2"] - }, - "image/jpeg": { - source: "iana", - compressible: false, - extensions: ["jpeg", "jpg", "jpe"] - }, - "image/jph": { - source: "iana", - extensions: ["jph"] - }, - "image/jphc": { - source: "iana", - extensions: ["jhc"] - }, - "image/jpm": { - source: "iana", - compressible: false, - extensions: ["jpm"] - }, - "image/jpx": { - source: "iana", - compressible: false, - extensions: ["jpx", "jpf"] - }, - "image/jxr": { - source: "iana", - extensions: ["jxr"] - }, - "image/jxra": { - source: "iana", - extensions: ["jxra"] - }, - "image/jxrs": { - source: "iana", - extensions: ["jxrs"] - }, - "image/jxs": { - source: "iana", - extensions: ["jxs"] - }, - "image/jxsc": { - source: "iana", - extensions: ["jxsc"] - }, - "image/jxsi": { - source: "iana", - extensions: ["jxsi"] - }, - "image/jxss": { - source: "iana", - extensions: ["jxss"] - }, - "image/ktx": { - source: "iana", - extensions: ["ktx"] - }, - "image/ktx2": { - source: "iana", - extensions: ["ktx2"] - }, - "image/naplps": { - source: "iana" - }, - "image/pjpeg": { - compressible: false - }, - "image/png": { - source: "iana", - compressible: false, - extensions: ["png"] - }, - "image/prs.btif": { - source: "iana", - extensions: ["btif"] - }, - "image/prs.pti": { - source: "iana", - extensions: ["pti"] - }, - "image/pwg-raster": { - source: "iana" - }, - "image/sgi": { - source: "apache", - extensions: ["sgi"] - }, - "image/svg+xml": { - source: "iana", - compressible: true, - extensions: ["svg", "svgz"] - }, - "image/t38": { - source: "iana", - extensions: ["t38"] - }, - "image/tiff": { - source: "iana", - compressible: false, - extensions: ["tif", "tiff"] - }, - "image/tiff-fx": { - source: "iana", - extensions: ["tfx"] - }, - "image/vnd.adobe.photoshop": { - source: "iana", - compressible: true, - extensions: ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - source: "iana", - extensions: ["azv"] - }, - "image/vnd.cns.inf2": { - source: "iana" - }, - "image/vnd.dece.graphic": { - source: "iana", - extensions: ["uvi", "uvvi", "uvg", "uvvg"] - }, - "image/vnd.djvu": { - source: "iana", - extensions: ["djvu", "djv"] - }, - "image/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "image/vnd.dwg": { - source: "iana", - extensions: ["dwg"] - }, - "image/vnd.dxf": { - source: "iana", - extensions: ["dxf"] - }, - "image/vnd.fastbidsheet": { - source: "iana", - extensions: ["fbs"] - }, - "image/vnd.fpx": { - source: "iana", - extensions: ["fpx"] - }, - "image/vnd.fst": { - source: "iana", - extensions: ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - source: "iana", - extensions: ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - source: "iana", - extensions: ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - source: "iana" - }, - "image/vnd.microsoft.icon": { - source: "iana", - compressible: true, - extensions: ["ico"] - }, - "image/vnd.mix": { - source: "iana" - }, - "image/vnd.mozilla.apng": { - source: "iana" - }, - "image/vnd.ms-dds": { - compressible: true, - extensions: ["dds"] - }, - "image/vnd.ms-modi": { - source: "iana", - extensions: ["mdi"] - }, - "image/vnd.ms-photo": { - source: "apache", - extensions: ["wdp"] - }, - "image/vnd.net-fpx": { - source: "iana", - extensions: ["npx"] - }, - "image/vnd.pco.b16": { - source: "iana", - extensions: ["b16"] - }, - "image/vnd.radiance": { - source: "iana" - }, - "image/vnd.sealed.png": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - source: "iana" - }, - "image/vnd.svf": { - source: "iana" - }, - "image/vnd.tencent.tap": { - source: "iana", - extensions: ["tap"] - }, - "image/vnd.valve.source.texture": { - source: "iana", - extensions: ["vtf"] - }, - "image/vnd.wap.wbmp": { - source: "iana", - extensions: ["wbmp"] - }, - "image/vnd.xiff": { - source: "iana", - extensions: ["xif"] - }, - "image/vnd.zbrush.pcx": { - source: "iana", - extensions: ["pcx"] - }, - "image/webp": { - source: "apache", - extensions: ["webp"] - }, - "image/wmf": { - source: "iana", - extensions: ["wmf"] - }, - "image/x-3ds": { - source: "apache", - extensions: ["3ds"] - }, - "image/x-cmu-raster": { - source: "apache", - extensions: ["ras"] - }, - "image/x-cmx": { - source: "apache", - extensions: ["cmx"] - }, - "image/x-freehand": { - source: "apache", - extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] - }, - "image/x-icon": { - source: "apache", - compressible: true, - extensions: ["ico"] - }, - "image/x-jng": { - source: "nginx", - extensions: ["jng"] - }, - "image/x-mrsid-image": { - source: "apache", - extensions: ["sid"] - }, - "image/x-ms-bmp": { - source: "nginx", - compressible: true, - extensions: ["bmp"] - }, - "image/x-pcx": { - source: "apache", - extensions: ["pcx"] - }, - "image/x-pict": { - source: "apache", - extensions: ["pic", "pct"] - }, - "image/x-portable-anymap": { - source: "apache", - extensions: ["pnm"] - }, - "image/x-portable-bitmap": { - source: "apache", - extensions: ["pbm"] - }, - "image/x-portable-graymap": { - source: "apache", - extensions: ["pgm"] - }, - "image/x-portable-pixmap": { - source: "apache", - extensions: ["ppm"] - }, - "image/x-rgb": { - source: "apache", - extensions: ["rgb"] - }, - "image/x-tga": { - source: "apache", - extensions: ["tga"] - }, - "image/x-xbitmap": { - source: "apache", - extensions: ["xbm"] - }, - "image/x-xcf": { - compressible: false - }, - "image/x-xpixmap": { - source: "apache", - extensions: ["xpm"] - }, - "image/x-xwindowdump": { - source: "apache", - extensions: ["xwd"] - }, - "message/cpim": { - source: "iana" - }, - "message/delivery-status": { - source: "iana" - }, - "message/disposition-notification": { - source: "iana", - extensions: [ - "disposition-notification" - ] - }, - "message/external-body": { - source: "iana" - }, - "message/feedback-report": { - source: "iana" - }, - "message/global": { - source: "iana", - extensions: ["u8msg"] - }, - "message/global-delivery-status": { - source: "iana", - extensions: ["u8dsn"] - }, - "message/global-disposition-notification": { - source: "iana", - extensions: ["u8mdn"] - }, - "message/global-headers": { - source: "iana", - extensions: ["u8hdr"] - }, - "message/http": { - source: "iana", - compressible: false - }, - "message/imdn+xml": { - source: "iana", - compressible: true - }, - "message/news": { - source: "iana" - }, - "message/partial": { - source: "iana", - compressible: false - }, - "message/rfc822": { - source: "iana", - compressible: true, - extensions: ["eml", "mime"] - }, - "message/s-http": { - source: "iana" - }, - "message/sip": { - source: "iana" - }, - "message/sipfrag": { - source: "iana" - }, - "message/tracking-status": { - source: "iana" - }, - "message/vnd.si.simp": { - source: "iana" - }, - "message/vnd.wfa.wsc": { - source: "iana", - extensions: ["wsc"] - }, - "model/3mf": { - source: "iana", - extensions: ["3mf"] - }, - "model/e57": { - source: "iana" - }, - "model/gltf+json": { - source: "iana", - compressible: true, - extensions: ["gltf"] - }, - "model/gltf-binary": { - source: "iana", - compressible: true, - extensions: ["glb"] - }, - "model/iges": { - source: "iana", - compressible: false, - extensions: ["igs", "iges"] - }, - "model/mesh": { - source: "iana", - compressible: false, - extensions: ["msh", "mesh", "silo"] - }, - "model/mtl": { - source: "iana", - extensions: ["mtl"] - }, - "model/obj": { - source: "iana", - extensions: ["obj"] - }, - "model/step": { - source: "iana" - }, - "model/step+xml": { - source: "iana", - compressible: true, - extensions: ["stpx"] - }, - "model/step+zip": { - source: "iana", - compressible: false, - extensions: ["stpz"] - }, - "model/step-xml+zip": { - source: "iana", - compressible: false, - extensions: ["stpxz"] - }, - "model/stl": { - source: "iana", - extensions: ["stl"] - }, - "model/vnd.collada+xml": { - source: "iana", - compressible: true, - extensions: ["dae"] - }, - "model/vnd.dwf": { - source: "iana", - extensions: ["dwf"] - }, - "model/vnd.flatland.3dml": { - source: "iana" - }, - "model/vnd.gdl": { - source: "iana", - extensions: ["gdl"] - }, - "model/vnd.gs-gdl": { - source: "apache" - }, - "model/vnd.gs.gdl": { - source: "iana" - }, - "model/vnd.gtw": { - source: "iana", - extensions: ["gtw"] - }, - "model/vnd.moml+xml": { - source: "iana", - compressible: true - }, - "model/vnd.mts": { - source: "iana", - extensions: ["mts"] - }, - "model/vnd.opengex": { - source: "iana", - extensions: ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - source: "iana", - extensions: ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - source: "iana", - extensions: ["x_t"] - }, - "model/vnd.pytha.pyox": { - source: "iana" - }, - "model/vnd.rosette.annotated-data-model": { - source: "iana" - }, - "model/vnd.sap.vds": { - source: "iana", - extensions: ["vds"] - }, - "model/vnd.usdz+zip": { - source: "iana", - compressible: false, - extensions: ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - source: "iana", - extensions: ["bsp"] - }, - "model/vnd.vtu": { - source: "iana", - extensions: ["vtu"] - }, - "model/vrml": { - source: "iana", - compressible: false, - extensions: ["wrl", "vrml"] - }, - "model/x3d+binary": { - source: "apache", - compressible: false, - extensions: ["x3db", "x3dbz"] - }, - "model/x3d+fastinfoset": { - source: "iana", - extensions: ["x3db"] - }, - "model/x3d+vrml": { - source: "apache", - compressible: false, - extensions: ["x3dv", "x3dvz"] - }, - "model/x3d+xml": { - source: "iana", - compressible: true, - extensions: ["x3d", "x3dz"] - }, - "model/x3d-vrml": { - source: "iana", - extensions: ["x3dv"] - }, - "multipart/alternative": { - source: "iana", - compressible: false - }, - "multipart/appledouble": { - source: "iana" - }, - "multipart/byteranges": { - source: "iana" - }, - "multipart/digest": { - source: "iana" - }, - "multipart/encrypted": { - source: "iana", - compressible: false - }, - "multipart/form-data": { - source: "iana", - compressible: false - }, - "multipart/header-set": { - source: "iana" - }, - "multipart/mixed": { - source: "iana" - }, - "multipart/multilingual": { - source: "iana" - }, - "multipart/parallel": { - source: "iana" - }, - "multipart/related": { - source: "iana", - compressible: false - }, - "multipart/report": { - source: "iana" - }, - "multipart/signed": { - source: "iana", - compressible: false - }, - "multipart/vnd.bint.med-plus": { - source: "iana" - }, - "multipart/voice-message": { - source: "iana" - }, - "multipart/x-mixed-replace": { - source: "iana" - }, - "text/1d-interleaved-parityfec": { - source: "iana" - }, - "text/cache-manifest": { - source: "iana", - compressible: true, - extensions: ["appcache", "manifest"] - }, - "text/calendar": { - source: "iana", - extensions: ["ics", "ifb"] - }, - "text/calender": { - compressible: true - }, - "text/cmd": { - compressible: true - }, - "text/coffeescript": { - extensions: ["coffee", "litcoffee"] - }, - "text/cql": { - source: "iana" - }, - "text/cql-expression": { - source: "iana" - }, - "text/cql-identifier": { - source: "iana" - }, - "text/css": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["css"] - }, - "text/csv": { - source: "iana", - compressible: true, - extensions: ["csv"] - }, - "text/csv-schema": { - source: "iana" - }, - "text/directory": { - source: "iana" - }, - "text/dns": { - source: "iana" - }, - "text/ecmascript": { - source: "iana" - }, - "text/encaprtp": { - source: "iana" - }, - "text/enriched": { - source: "iana" - }, - "text/fhirpath": { - source: "iana" - }, - "text/flexfec": { - source: "iana" - }, - "text/fwdred": { - source: "iana" - }, - "text/gff3": { - source: "iana" - }, - "text/grammar-ref-list": { - source: "iana" - }, - "text/html": { - source: "iana", - compressible: true, - extensions: ["html", "htm", "shtml"] - }, - "text/jade": { - extensions: ["jade"] - }, - "text/javascript": { - source: "iana", - compressible: true - }, - "text/jcr-cnd": { - source: "iana" - }, - "text/jsx": { - compressible: true, - extensions: ["jsx"] - }, - "text/less": { - compressible: true, - extensions: ["less"] - }, - "text/markdown": { - source: "iana", - compressible: true, - extensions: ["markdown", "md"] - }, - "text/mathml": { - source: "nginx", - extensions: ["mml"] - }, - "text/mdx": { - compressible: true, - extensions: ["mdx"] - }, - "text/mizar": { - source: "iana" - }, - "text/n3": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["n3"] - }, - "text/parameters": { - source: "iana", - charset: "UTF-8" - }, - "text/parityfec": { - source: "iana" - }, - "text/plain": { - source: "iana", - compressible: true, - extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] - }, - "text/provenance-notation": { - source: "iana", - charset: "UTF-8" - }, - "text/prs.fallenstein.rst": { - source: "iana" - }, - "text/prs.lines.tag": { - source: "iana", - extensions: ["dsc"] - }, - "text/prs.prop.logic": { - source: "iana" - }, - "text/raptorfec": { - source: "iana" - }, - "text/red": { - source: "iana" - }, - "text/rfc822-headers": { - source: "iana" - }, - "text/richtext": { - source: "iana", - compressible: true, - extensions: ["rtx"] - }, - "text/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "text/rtp-enc-aescm128": { - source: "iana" - }, - "text/rtploopback": { - source: "iana" - }, - "text/rtx": { - source: "iana" - }, - "text/sgml": { - source: "iana", - extensions: ["sgml", "sgm"] - }, - "text/shaclc": { - source: "iana" - }, - "text/shex": { - source: "iana", - extensions: ["shex"] - }, - "text/slim": { - extensions: ["slim", "slm"] - }, - "text/spdx": { - source: "iana", - extensions: ["spdx"] - }, - "text/strings": { - source: "iana" - }, - "text/stylus": { - extensions: ["stylus", "styl"] - }, - "text/t140": { - source: "iana" - }, - "text/tab-separated-values": { - source: "iana", - compressible: true, - extensions: ["tsv"] - }, - "text/troff": { - source: "iana", - extensions: ["t", "tr", "roff", "man", "me", "ms"] - }, - "text/turtle": { - source: "iana", - charset: "UTF-8", - extensions: ["ttl"] - }, - "text/ulpfec": { - source: "iana" - }, - "text/uri-list": { - source: "iana", - compressible: true, - extensions: ["uri", "uris", "urls"] - }, - "text/vcard": { - source: "iana", - compressible: true, - extensions: ["vcard"] - }, - "text/vnd.a": { - source: "iana" - }, - "text/vnd.abc": { - source: "iana" - }, - "text/vnd.ascii-art": { - source: "iana" - }, - "text/vnd.curl": { - source: "iana", - extensions: ["curl"] - }, - "text/vnd.curl.dcurl": { - source: "apache", - extensions: ["dcurl"] - }, - "text/vnd.curl.mcurl": { - source: "apache", - extensions: ["mcurl"] - }, - "text/vnd.curl.scurl": { - source: "apache", - extensions: ["scurl"] - }, - "text/vnd.debian.copyright": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.dmclientscript": { - source: "iana" - }, - "text/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - source: "iana", - extensions: ["ged"] - }, - "text/vnd.ficlab.flt": { - source: "iana" - }, - "text/vnd.fly": { - source: "iana", - extensions: ["fly"] - }, - "text/vnd.fmi.flexstor": { - source: "iana", - extensions: ["flx"] - }, - "text/vnd.gml": { - source: "iana" - }, - "text/vnd.graphviz": { - source: "iana", - extensions: ["gv"] - }, - "text/vnd.hans": { - source: "iana" - }, - "text/vnd.hgl": { - source: "iana" - }, - "text/vnd.in3d.3dml": { - source: "iana", - extensions: ["3dml"] - }, - "text/vnd.in3d.spot": { - source: "iana", - extensions: ["spot"] - }, - "text/vnd.iptc.newsml": { - source: "iana" - }, - "text/vnd.iptc.nitf": { - source: "iana" - }, - "text/vnd.latex-z": { - source: "iana" - }, - "text/vnd.motorola.reflex": { - source: "iana" - }, - "text/vnd.ms-mediapackage": { - source: "iana" - }, - "text/vnd.net2phone.commcenter.command": { - source: "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - source: "iana" - }, - "text/vnd.senx.warpscript": { - source: "iana" - }, - "text/vnd.si.uricatalogue": { - source: "iana" - }, - "text/vnd.sosi": { - source: "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - source: "iana", - charset: "UTF-8", - extensions: ["jad"] - }, - "text/vnd.trolltech.linguist": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.wap.si": { - source: "iana" - }, - "text/vnd.wap.sl": { - source: "iana" - }, - "text/vnd.wap.wml": { - source: "iana", - extensions: ["wml"] - }, - "text/vnd.wap.wmlscript": { - source: "iana", - extensions: ["wmls"] - }, - "text/vtt": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["vtt"] - }, - "text/x-asm": { - source: "apache", - extensions: ["s", "asm"] - }, - "text/x-c": { - source: "apache", - extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] - }, - "text/x-component": { - source: "nginx", - extensions: ["htc"] - }, - "text/x-fortran": { - source: "apache", - extensions: ["f", "for", "f77", "f90"] - }, - "text/x-gwt-rpc": { - compressible: true - }, - "text/x-handlebars-template": { - extensions: ["hbs"] - }, - "text/x-java-source": { - source: "apache", - extensions: ["java"] - }, - "text/x-jquery-tmpl": { - compressible: true - }, - "text/x-lua": { - extensions: ["lua"] - }, - "text/x-markdown": { - compressible: true, - extensions: ["mkd"] - }, - "text/x-nfo": { - source: "apache", - extensions: ["nfo"] - }, - "text/x-opml": { - source: "apache", - extensions: ["opml"] - }, - "text/x-org": { - compressible: true, - extensions: ["org"] - }, - "text/x-pascal": { - source: "apache", - extensions: ["p", "pas"] - }, - "text/x-processing": { - compressible: true, - extensions: ["pde"] - }, - "text/x-sass": { - extensions: ["sass"] - }, - "text/x-scss": { - extensions: ["scss"] - }, - "text/x-setext": { - source: "apache", - extensions: ["etx"] - }, - "text/x-sfv": { - source: "apache", - extensions: ["sfv"] - }, - "text/x-suse-ymp": { - compressible: true, - extensions: ["ymp"] - }, - "text/x-uuencode": { - source: "apache", - extensions: ["uu"] - }, - "text/x-vcalendar": { - source: "apache", - extensions: ["vcs"] - }, - "text/x-vcard": { - source: "apache", - extensions: ["vcf"] - }, - "text/xml": { - source: "iana", - compressible: true, - extensions: ["xml"] - }, - "text/xml-external-parsed-entity": { - source: "iana" - }, - "text/yaml": { - compressible: true, - extensions: ["yaml", "yml"] - }, - "video/1d-interleaved-parityfec": { - source: "iana" - }, - "video/3gpp": { - source: "iana", - extensions: ["3gp", "3gpp"] - }, - "video/3gpp-tt": { - source: "iana" - }, - "video/3gpp2": { - source: "iana", - extensions: ["3g2"] - }, - "video/av1": { - source: "iana" - }, - "video/bmpeg": { - source: "iana" - }, - "video/bt656": { - source: "iana" - }, - "video/celb": { - source: "iana" - }, - "video/dv": { - source: "iana" - }, - "video/encaprtp": { - source: "iana" - }, - "video/ffv1": { - source: "iana" - }, - "video/flexfec": { - source: "iana" - }, - "video/h261": { - source: "iana", - extensions: ["h261"] - }, - "video/h263": { - source: "iana", - extensions: ["h263"] - }, - "video/h263-1998": { - source: "iana" - }, - "video/h263-2000": { - source: "iana" - }, - "video/h264": { - source: "iana", - extensions: ["h264"] - }, - "video/h264-rcdo": { - source: "iana" - }, - "video/h264-svc": { - source: "iana" - }, - "video/h265": { - source: "iana" - }, - "video/iso.segment": { - source: "iana", - extensions: ["m4s"] - }, - "video/jpeg": { - source: "iana", - extensions: ["jpgv"] - }, - "video/jpeg2000": { - source: "iana" - }, - "video/jpm": { - source: "apache", - extensions: ["jpm", "jpgm"] - }, - "video/jxsv": { - source: "iana" - }, - "video/mj2": { - source: "iana", - extensions: ["mj2", "mjp2"] - }, - "video/mp1s": { - source: "iana" - }, - "video/mp2p": { - source: "iana" - }, - "video/mp2t": { - source: "iana", - extensions: ["ts"] - }, - "video/mp4": { - source: "iana", - compressible: false, - extensions: ["mp4", "mp4v", "mpg4"] - }, - "video/mp4v-es": { - source: "iana" - }, - "video/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] - }, - "video/mpeg4-generic": { - source: "iana" - }, - "video/mpv": { - source: "iana" - }, - "video/nv": { - source: "iana" - }, - "video/ogg": { - source: "iana", - compressible: false, - extensions: ["ogv"] - }, - "video/parityfec": { - source: "iana" - }, - "video/pointer": { - source: "iana" - }, - "video/quicktime": { - source: "iana", - compressible: false, - extensions: ["qt", "mov"] - }, - "video/raptorfec": { - source: "iana" - }, - "video/raw": { - source: "iana" - }, - "video/rtp-enc-aescm128": { - source: "iana" - }, - "video/rtploopback": { - source: "iana" - }, - "video/rtx": { - source: "iana" - }, - "video/scip": { - source: "iana" - }, - "video/smpte291": { - source: "iana" - }, - "video/smpte292m": { - source: "iana" - }, - "video/ulpfec": { - source: "iana" - }, - "video/vc1": { - source: "iana" - }, - "video/vc2": { - source: "iana" - }, - "video/vnd.cctv": { - source: "iana" - }, - "video/vnd.dece.hd": { - source: "iana", - extensions: ["uvh", "uvvh"] - }, - "video/vnd.dece.mobile": { - source: "iana", - extensions: ["uvm", "uvvm"] - }, - "video/vnd.dece.mp4": { - source: "iana" - }, - "video/vnd.dece.pd": { - source: "iana", - extensions: ["uvp", "uvvp"] - }, - "video/vnd.dece.sd": { - source: "iana", - extensions: ["uvs", "uvvs"] - }, - "video/vnd.dece.video": { - source: "iana", - extensions: ["uvv", "uvvv"] - }, - "video/vnd.directv.mpeg": { - source: "iana" - }, - "video/vnd.directv.mpeg-tts": { - source: "iana" - }, - "video/vnd.dlna.mpeg-tts": { - source: "iana" - }, - "video/vnd.dvb.file": { - source: "iana", - extensions: ["dvb"] - }, - "video/vnd.fvt": { - source: "iana", - extensions: ["fvt"] - }, - "video/vnd.hns.video": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.ttsavc": { - source: "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - source: "iana" - }, - "video/vnd.motorola.video": { - source: "iana" - }, - "video/vnd.motorola.videop": { - source: "iana" - }, - "video/vnd.mpegurl": { - source: "iana", - extensions: ["mxu", "m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - source: "iana", - extensions: ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - source: "iana" - }, - "video/vnd.nokia.mp4vr": { - source: "iana" - }, - "video/vnd.nokia.videovoip": { - source: "iana" - }, - "video/vnd.objectvideo": { - source: "iana" - }, - "video/vnd.radgamettools.bink": { - source: "iana" - }, - "video/vnd.radgamettools.smacker": { - source: "iana" - }, - "video/vnd.sealed.mpeg1": { - source: "iana" - }, - "video/vnd.sealed.mpeg4": { - source: "iana" - }, - "video/vnd.sealed.swf": { - source: "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - source: "iana" - }, - "video/vnd.uvvu.mp4": { - source: "iana", - extensions: ["uvu", "uvvu"] - }, - "video/vnd.vivo": { - source: "iana", - extensions: ["viv"] - }, - "video/vnd.youtube.yt": { - source: "iana" - }, - "video/vp8": { - source: "iana" - }, - "video/vp9": { - source: "iana" - }, - "video/webm": { - source: "apache", - compressible: false, - extensions: ["webm"] - }, - "video/x-f4v": { - source: "apache", - extensions: ["f4v"] - }, - "video/x-fli": { - source: "apache", - extensions: ["fli"] - }, - "video/x-flv": { - source: "apache", - compressible: false, - extensions: ["flv"] - }, - "video/x-m4v": { - source: "apache", - extensions: ["m4v"] - }, - "video/x-matroska": { - source: "apache", - compressible: false, - extensions: ["mkv", "mk3d", "mks"] - }, - "video/x-mng": { - source: "apache", - extensions: ["mng"] - }, - "video/x-ms-asf": { - source: "apache", - extensions: ["asf", "asx"] - }, - "video/x-ms-vob": { - source: "apache", - extensions: ["vob"] - }, - "video/x-ms-wm": { - source: "apache", - extensions: ["wm"] - }, - "video/x-ms-wmv": { - source: "apache", - compressible: false, - extensions: ["wmv"] - }, - "video/x-ms-wmx": { - source: "apache", - extensions: ["wmx"] - }, - "video/x-ms-wvx": { - source: "apache", - extensions: ["wvx"] - }, - "video/x-msvideo": { - source: "apache", - extensions: ["avi"] - }, - "video/x-sgi-movie": { - source: "apache", - extensions: ["movie"] - }, - "video/x-smv": { - source: "apache", - extensions: ["smv"] - }, - "x-conference/x-cooltalk": { - source: "apache", - extensions: ["ice"] - }, - "x-shader/x-fragment": { - compressible: true - }, - "x-shader/x-vertex": { - compressible: true - } - }; - } -}); - -// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js -var require_mime_db = __commonJS({ - "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports2, module2) { - module2.exports = require_db(); - } -}); - -// node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js -var require_mime_types = __commonJS({ - "node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports2) { - "use strict"; - var db = require_mime_db(); - var extname = require("path").extname; - var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; - var TEXT_TYPE_REGEXP = /^text\//i; - exports2.charset = charset; - exports2.charsets = { lookup: charset }; - exports2.contentType = contentType; - exports2.extension = extension; - exports2.extensions = /* @__PURE__ */ Object.create(null); - exports2.lookup = lookup; - exports2.types = /* @__PURE__ */ Object.create(null); - populateMaps(exports2.extensions, exports2.types); - function charset(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var mime = match && db[match[1].toLowerCase()]; - if (mime && mime.charset) { - return mime.charset; - } - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return "UTF-8"; - } - return false; - } - function contentType(str) { - if (!str || typeof str !== "string") { - return false; - } - var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str; - if (!mime) { - return false; - } - if (mime.indexOf("charset") === -1) { - var charset2 = exports2.charset(mime); - if (charset2) mime += "; charset=" + charset2.toLowerCase(); - } - return mime; - } - function extension(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var exts = match && exports2.extensions[match[1].toLowerCase()]; - if (!exts || !exts.length) { - return false; - } - return exts[0]; - } - function lookup(path2) { - if (!path2 || typeof path2 !== "string") { - return false; - } - var extension2 = extname("x." + path2).toLowerCase().substr(1); - if (!extension2) { - return false; - } - return exports2.types[extension2] || false; - } - function populateMaps(extensions, types) { - var preference = ["nginx", "apache", void 0, "iana"]; - Object.keys(db).forEach(function forEachMimeType(type) { - var mime = db[type]; - var exts = mime.extensions; - if (!exts || !exts.length) { - return; - } - extensions[type] = exts; - for (var i = 0; i < exts.length; i++) { - var extension2 = exts[i]; - if (types[extension2]) { - var from = preference.indexOf(db[types[extension2]].source); - var to = preference.indexOf(mime.source); - if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) { - continue; - } - } - types[extension2] = type; - } - }); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js -var require_defer = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js"(exports2, module2) { - module2.exports = defer; - function defer(fn) { - var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; - if (nextTick) { - nextTick(fn); - } else { - setTimeout(fn, 0); - } - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js -var require_async = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js"(exports2, module2) { - var defer = require_defer(); - module2.exports = async; - function async(callback) { - var isAsync = false; - defer(function() { - isAsync = true; - }); - return function async_callback(err, result) { - if (isAsync) { - callback(err, result); - } else { - defer(function nextTick_callback() { - callback(err, result); - }); - } - }; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js -var require_abort = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js"(exports2, module2) { - module2.exports = abort; - function abort(state) { - Object.keys(state.jobs).forEach(clean.bind(state)); - state.jobs = {}; - } - function clean(key) { - if (typeof this.jobs[key] == "function") { - this.jobs[key](); - } - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js -var require_iterate = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js"(exports2, module2) { - var async = require_async(); - var abort = require_abort(); - module2.exports = iterate; - function iterate(list, iterator, state, callback) { - var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { - if (!(key in state.jobs)) { - return; - } - delete state.jobs[key]; - if (error) { - abort(state); - } else { - state.results[key] = output; - } - callback(error, state.results); - }); - } - function runJob(iterator, key, item, callback) { - var aborter; - if (iterator.length == 2) { - aborter = iterator(item, async(callback)); - } else { - aborter = iterator(item, key, async(callback)); - } - return aborter; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js -var require_state = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js"(exports2, module2) { - module2.exports = state; - function state(list, sortMethod) { - var isNamedList = !Array.isArray(list), initState = { - index: 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs: {}, - results: isNamedList ? {} : [], - size: isNamedList ? Object.keys(list).length : list.length - }; - if (sortMethod) { - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { - return sortMethod(list[a], list[b]); - }); - } - return initState; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js -var require_terminator = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js"(exports2, module2) { - var abort = require_abort(); - var async = require_async(); - module2.exports = terminator; - function terminator(callback) { - if (!Object.keys(this.jobs).length) { - return; - } - this.index = this.size; - abort(this); - async(callback)(null, this.results); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js -var require_parallel = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = parallel; - function parallel(list, iterator, callback) { - var state = initState(list); - while (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, function(error, result) { - if (error) { - callback(error, result); - return; - } - if (Object.keys(state.jobs).length === 0) { - callback(null, state.results); - return; - } - }); - state.index++; - } - return terminator.bind(state, callback); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js -var require_serialOrdered = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = serialOrdered; - module2.exports.ascending = ascending; - module2.exports.descending = descending; - function serialOrdered(list, iterator, sortMethod, callback) { - var state = initState(list, sortMethod); - iterate(list, iterator, state, function iteratorHandler(error, result) { - if (error) { - callback(error, result); - return; - } - state.index++; - if (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, iteratorHandler); - return; - } - callback(null, state.results); - }); - return terminator.bind(state, callback); - } - function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : 0; - } - function descending(a, b) { - return -1 * ascending(a, b); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js -var require_serial = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js"(exports2, module2) { - var serialOrdered = require_serialOrdered(); - module2.exports = serial; - function serial(list, iterator, callback) { - return serialOrdered(list, iterator, null, callback); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js -var require_asynckit = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js"(exports2, module2) { - module2.exports = { - parallel: require_parallel(), - serial: require_serial(), - serialOrdered: require_serialOrdered() - }; - } -}); - -// node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js -var require_es_object_atoms = __commonJS({ - "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports2, module2) { - "use strict"; - module2.exports = Object; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js -var require_es_errors = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports2, module2) { - "use strict"; - module2.exports = Error; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js -var require_eval = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports2, module2) { - "use strict"; - module2.exports = EvalError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js -var require_range = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports2, module2) { - "use strict"; - module2.exports = RangeError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js -var require_ref = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports2, module2) { - "use strict"; - module2.exports = ReferenceError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js -var require_syntax = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports2, module2) { - "use strict"; - module2.exports = SyntaxError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js -var require_type = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports2, module2) { - "use strict"; - module2.exports = TypeError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js -var require_uri = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports2, module2) { - "use strict"; - module2.exports = URIError; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js -var require_abs = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports2, module2) { - "use strict"; - module2.exports = Math.abs; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js -var require_floor = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports2, module2) { - "use strict"; - module2.exports = Math.floor; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js -var require_max = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports2, module2) { - "use strict"; - module2.exports = Math.max; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js -var require_min = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports2, module2) { - "use strict"; - module2.exports = Math.min; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js -var require_pow = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports2, module2) { - "use strict"; - module2.exports = Math.pow; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js -var require_round = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports2, module2) { - "use strict"; - module2.exports = Math.round; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js -var require_isNaN = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports2, module2) { - "use strict"; - module2.exports = Number.isNaN || function isNaN2(a) { - return a !== a; - }; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js -var require_sign = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports2, module2) { - "use strict"; - var $isNaN = require_isNaN(); - module2.exports = function sign(number) { - if ($isNaN(number) || number === 0) { - return number; - } - return number < 0 ? -1 : 1; - }; - } -}); - -// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js -var require_gOPD = __commonJS({ - "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports2, module2) { - "use strict"; - module2.exports = Object.getOwnPropertyDescriptor; - } -}); - -// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js -var require_gopd = __commonJS({ - "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports2, module2) { - "use strict"; - var $gOPD = require_gOPD(); - if ($gOPD) { - try { - $gOPD([], "length"); - } catch (e) { - $gOPD = null; - } - } - module2.exports = $gOPD; - } -}); - -// node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js -var require_es_define_property = __commonJS({ - "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports2, module2) { - "use strict"; - var $defineProperty = Object.defineProperty || false; - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = false; - } - } - module2.exports = $defineProperty; - } -}); - -// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js -var require_shams = __commonJS({ - "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports2, module2) { - "use strict"; - module2.exports = function hasSymbols() { - if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { - return false; - } - if (typeof Symbol.iterator === "symbol") { - return true; - } - var obj = {}; - var sym = Symbol("test"); - var symObj = Object(sym); - if (typeof sym === "string") { - return false; - } - if (Object.prototype.toString.call(sym) !== "[object Symbol]") { - return false; - } - if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { - return false; - } - var symVal = 42; - obj[sym] = symVal; - for (var _ in obj) { - return false; - } - if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { - return false; - } - if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { - return false; - } - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { - return false; - } - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { - return false; - } - if (typeof Object.getOwnPropertyDescriptor === "function") { - var descriptor = ( - /** @type {PropertyDescriptor} */ - Object.getOwnPropertyDescriptor(obj, sym) - ); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { - return false; - } - } - return true; - }; - } -}); - -// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js -var require_has_symbols = __commonJS({ - "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports2, module2) { - "use strict"; - var origSymbol = typeof Symbol !== "undefined" && Symbol; - var hasSymbolSham = require_shams(); - module2.exports = function hasNativeSymbols() { - if (typeof origSymbol !== "function") { - return false; - } - if (typeof Symbol !== "function") { - return false; - } - if (typeof origSymbol("foo") !== "symbol") { - return false; - } - if (typeof Symbol("bar") !== "symbol") { - return false; - } - return hasSymbolSham(); - }; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js -var require_Reflect_getPrototypeOf = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js -var require_Object_getPrototypeOf = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports2, module2) { - "use strict"; - var $Object = require_es_object_atoms(); - module2.exports = $Object.getPrototypeOf || null; - } -}); - -// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js -var require_implementation = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module2) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var toStr = Object.prototype.toString; - var max = Math.max; - var funcType = "[object Function]"; - var concatty = function concatty2(a, b) { - var arr = []; - for (var i = 0; i < a.length; i += 1) { - arr[i] = a[i]; - } - for (var j = 0; j < b.length; j += 1) { - arr[j + a.length] = b[j]; - } - return arr; - }; - var slicy = function slicy2(arrLike, offset) { - var arr = []; - for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { - arr[j] = arrLike[i]; - } - return arr; - }; - var joiny = function(arr, joiner) { - var str = ""; - for (var i = 0; i < arr.length; i += 1) { - str += arr[i]; - if (i + 1 < arr.length) { - str += joiner; - } - } - return str; - }; - module2.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); - var bound; - var binder = function() { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) - ); - }; - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = "$" + i; - } - bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); - if (target.prototype) { - var Empty = function Empty2() { - }; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - } -}); - -// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js -var require_function_bind = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module2) { - "use strict"; - var implementation = require_implementation(); - module2.exports = Function.prototype.bind || implementation; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js -var require_functionCall = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.call; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js -var require_functionApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.apply; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js -var require_reflectApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js -var require_actualApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports2, module2) { - "use strict"; - var bind = require_function_bind(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var $reflectApply = require_reflectApply(); - module2.exports = $reflectApply || bind.call($call, $apply); - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js -var require_call_bind_apply_helpers = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports2, module2) { - "use strict"; - var bind = require_function_bind(); - var $TypeError = require_type(); - var $call = require_functionCall(); - var $actualApply = require_actualApply(); - module2.exports = function callBindBasic(args) { - if (args.length < 1 || typeof args[0] !== "function") { - throw new $TypeError("a function is required"); - } - return $actualApply(bind, $call, args); - }; - } -}); - -// node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js -var require_get = __commonJS({ - "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports2, module2) { - "use strict"; - var callBind = require_call_bind_apply_helpers(); - var gOPD = require_gopd(); - var hasProtoAccessor; - try { - hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ - [].__proto__ === Array.prototype; - } catch (e) { - if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") { - throw e; - } - } - var desc = !!hasProtoAccessor && gOPD && gOPD( - Object.prototype, - /** @type {keyof typeof Object.prototype} */ - "__proto__" - ); - var $Object = Object; - var $getPrototypeOf = $Object.getPrototypeOf; - module2.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? ( - /** @type {import('./get')} */ - function getDunder(value) { - return $getPrototypeOf(value == null ? value : $Object(value)); - } - ) : false; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js -var require_get_proto = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports2, module2) { - "use strict"; - var reflectGetProto = require_Reflect_getPrototypeOf(); - var originalGetProto = require_Object_getPrototypeOf(); - var getDunderProto = require_get(); - module2.exports = reflectGetProto ? function getProto(O) { - return reflectGetProto(O); - } : originalGetProto ? function getProto(O) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new TypeError("getProto: not an object"); - } - return originalGetProto(O); - } : getDunderProto ? function getProto(O) { - return getDunderProto(O); - } : null; - } -}); - -// node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js -var require_hasown = __commonJS({ - "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports2, module2) { - "use strict"; - var call = Function.prototype.call; - var $hasOwn = Object.prototype.hasOwnProperty; - var bind = require_function_bind(); - module2.exports = bind.call(call, $hasOwn); - } -}); - -// node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js -var require_get_intrinsic = __commonJS({ - "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(exports2, module2) { - "use strict"; - var undefined2; - var $Object = require_es_object_atoms(); - var $Error = require_es_errors(); - var $EvalError = require_eval(); - var $RangeError = require_range(); - var $ReferenceError = require_ref(); - var $SyntaxError = require_syntax(); - var $TypeError = require_type(); - var $URIError = require_uri(); - var abs = require_abs(); - var floor = require_floor(); - var max = require_max(); - var min = require_min(); - var pow = require_pow(); - var round = require_round(); - var sign = require_sign(); - var $Function = Function; - var getEvalledConstructor = function(expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) { - } - }; - var $gOPD = require_gopd(); - var $defineProperty = require_es_define_property(); - var throwTypeError = function() { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD ? function() { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }() : throwTypeError; - var hasSymbols = require_has_symbols()(); - var getProto = require_get_proto(); - var $ObjectGPO = require_Object_getPrototypeOf(); - var $ReflectGPO = require_Reflect_getPrototypeOf(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - __proto__: null, - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": $Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": $EvalError, - "%Float16Array%": typeof Float16Array === "undefined" ? undefined2 : Float16Array, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": $Object, - "%Object.getOwnPropertyDescriptor%": $gOPD, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": $RangeError, - "%ReferenceError%": $ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": $URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, - "%Function.prototype.call%": $call, - "%Function.prototype.apply%": $apply, - "%Object.defineProperty%": $defineProperty, - "%Object.getPrototypeOf%": $ObjectGPO, - "%Math.abs%": abs, - "%Math.floor%": floor, - "%Math.max%": max, - "%Math.min%": min, - "%Math.pow%": pow, - "%Math.round%": round, - "%Math.sign%": sign, - "%Reflect.getPrototypeOf%": $ReflectGPO - }; - if (getProto) { - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen && getProto) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - __proto__: null, - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"] - }; - var bind = require_function_bind(); - var hasOwn = require_hasown(); - var $concat = bind.call($call, Array.prototype.concat); - var $spliceApply = bind.call($apply, Array.prototype.splice); - var $replace = bind.call($call, String.prototype.replace); - var $strSlice = bind.call($call, String.prototype.slice); - var $exec = bind.call($call, RegExp.prototype.exec); - var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === "%" && last !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last === "%" && first !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function(match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module2.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void 0; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - } -}); - -// node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js -var require_shams2 = __commonJS({ - "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports2, module2) { - "use strict"; - var hasSymbols = require_shams(); - module2.exports = function hasToStringTagShams() { - return hasSymbols() && !!Symbol.toStringTag; - }; - } -}); - -// node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js -var require_es_set_tostringtag = __commonJS({ - "node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js"(exports2, module2) { - "use strict"; - var GetIntrinsic = require_get_intrinsic(); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); - var hasToStringTag = require_shams2()(); - var hasOwn = require_hasown(); - var $TypeError = require_type(); - var toStringTag = hasToStringTag ? Symbol.toStringTag : null; - module2.exports = function setToStringTag(object, value) { - var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; - var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; - if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") { - throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans"); - } - if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { - if ($defineProperty) { - $defineProperty(object, toStringTag, { - configurable: !nonConfigurable, - enumerable: false, - value, - writable: false - }); - } else { - object[toStringTag] = value; - } - } - }; - } -}); - -// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js -var require_populate = __commonJS({ - "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js"(exports2, module2) { - "use strict"; - module2.exports = function(dst, src) { - Object.keys(src).forEach(function(prop) { - dst[prop] = dst[prop] || src[prop]; - }); - return dst; - }; - } -}); - -// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js -var require_form_data = __commonJS({ - "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js"(exports2, module2) { - "use strict"; - var CombinedStream = require_combined_stream(); - var util = require("util"); - var path2 = require("path"); - var http = require("http"); - var https = require("https"); - var parseUrl = require("url").parse; - var fs2 = require("fs"); - var Stream = require("stream").Stream; - var crypto = require("crypto"); - var mime = require_mime_types(); - var asynckit = require_asynckit(); - var setToStringTag = require_es_set_tostringtag(); - var hasOwn = require_hasown(); - var populate = require_populate(); - function FormData2(options) { - if (!(this instanceof FormData2)) { - return new FormData2(options); - } - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; - CombinedStream.call(this); - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } - } - util.inherits(FormData2, CombinedStream); - FormData2.LINE_BREAK = "\r\n"; - FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; - FormData2.prototype.append = function(field, value, options) { - options = options || {}; - if (typeof options === "string") { - options = { filename: options }; - } - var append = CombinedStream.prototype.append.bind(this); - if (typeof value === "number" || value == null) { - value = String(value); - } - if (Array.isArray(value)) { - this._error(new Error("Arrays are not supported.")); - return; - } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); - append(header); - append(value); - append(footer); - this._trackLength(header, value, options); - }; - FormData2.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - if (options.knownLength != null) { - valueLength += Number(options.knownLength); - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === "string") { - valueLength = Buffer.byteLength(value); - } - this._valueLength += valueLength; - this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; - if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) { - return; - } - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } - }; - FormData2.prototype._lengthRetriever = function(value, callback) { - if (hasOwn(value, "fd")) { - if (value.end != void 0 && value.end != Infinity && value.start != void 0) { - callback(null, value.end + 1 - (value.start ? value.start : 0)); - } else { - fs2.stat(value.path, function(err, stat) { - if (err) { - callback(err); - return; - } - var fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - } else if (hasOwn(value, "httpVersion")) { - callback(null, Number(value.headers["content-length"])); - } else if (hasOwn(value, "httpModule")) { - value.on("response", function(response) { - value.pause(); - callback(null, Number(response.headers["content-length"])); - }); - value.resume(); - } else { - callback("Unknown stream"); - } - }; - FormData2.prototype._multiPartHeader = function(field, value, options) { - if (typeof options.header === "string") { - return options.header; - } - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); - var contents = ""; - var headers = { - // add custom disposition as third element or keep it two elements if not - "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - "Content-Type": [].concat(contentType || []) - }; - if (typeof options.header === "object") { - populate(headers, options.header); - } - var header; - for (var prop in headers) { - if (hasOwn(headers, prop)) { - header = headers[prop]; - if (header == null) { - continue; - } - if (!Array.isArray(header)) { - header = [header]; - } - if (header.length) { - contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK; - } - } - } - return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; - }; - FormData2.prototype._getContentDisposition = function(value, options) { - var filename; - if (typeof options.filepath === "string") { - filename = path2.normalize(options.filepath).replace(/\\/g, "/"); - } else if (options.filename || value && (value.name || value.path)) { - filename = path2.basename(options.filename || value && (value.name || value.path)); - } else if (value && value.readable && hasOwn(value, "httpVersion")) { - filename = path2.basename(value.client._httpMessage.path || ""); - } - if (filename) { - return 'filename="' + filename + '"'; - } - }; - FormData2.prototype._getContentType = function(value, options) { - var contentType = options.contentType; - if (!contentType && value && value.name) { - contentType = mime.lookup(value.name); - } - if (!contentType && value && value.path) { - contentType = mime.lookup(value.path); - } - if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) { - contentType = value.headers["content-type"]; - } - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } - if (!contentType && value && typeof value === "object") { - contentType = FormData2.DEFAULT_CONTENT_TYPE; - } - return contentType; - }; - FormData2.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData2.LINE_BREAK; - var lastPart = this._streams.length === 0; - if (lastPart) { - footer += this._lastBoundary(); - } - next(footer); - }.bind(this); - }; - FormData2.prototype._lastBoundary = function() { - return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK; - }; - FormData2.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - "content-type": "multipart/form-data; boundary=" + this.getBoundary() - }; - for (header in userHeaders) { - if (hasOwn(userHeaders, header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } - return formHeaders; - }; - FormData2.prototype.setBoundary = function(boundary) { - if (typeof boundary !== "string") { - throw new TypeError("FormData boundary must be a string"); - } - this._boundary = boundary; - }; - FormData2.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - return this._boundary; - }; - FormData2.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc(0); - var boundary = this.getBoundary(); - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== "function") { - if (Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); - } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); - } - if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]); - } - } - } - return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); - }; - FormData2.prototype._generateBoundary = function() { - this._boundary = "--------------------------" + crypto.randomBytes(12).toString("hex"); - }; - FormData2.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this.hasKnownLength()) { - this._error(new Error("Cannot calculate proper length in synchronous way.")); - } - return knownLength; - }; - FormData2.prototype.hasKnownLength = function() { - var hasKnownLength = true; - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } - return hasKnownLength; - }; - FormData2.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; - } - values.forEach(function(length) { - knownLength += length; - }); - cb(null, knownLength); - }); - }; - FormData2.prototype.submit = function(params, cb) { - var request; - var options; - var defaults = { method: "post" }; - if (typeof params === "string") { - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); - } else { - options = populate(params, defaults); - if (!options.port) { - options.port = options.protocol === "https:" ? 443 : 80; - } - } - options.headers = this.getHeaders(params.headers); - if (options.protocol === "https:") { - request = https.request(options); - } else { - request = http.request(options); - } - this.getLength(function(err, length) { - if (err && err !== "Unknown stream") { - this._error(err); - return; - } - if (length) { - request.setHeader("Content-Length", length); - } - this.pipe(request); - if (cb) { - var onResponse; - var callback = function(error, responce) { - request.removeListener("error", callback); - request.removeListener("response", onResponse); - return cb.call(this, error, responce); - }; - onResponse = callback.bind(this, null); - request.on("error", callback); - request.on("response", onResponse); - } - }.bind(this)); - return request; - }; - FormData2.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit("error", err); - } - }; - FormData2.prototype.toString = function() { - return "[object FormData]"; - }; - setToStringTag(FormData2, "FormData"); - module2.exports = FormData2; - } -}); - -// node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js -var require_proxy_from_env = __commonJS({ - "node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"(exports2) { - "use strict"; - var parseUrl = require("url").parse; - var DEFAULT_PORTS = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var stringEndsWith = String.prototype.endsWith || function(s) { - return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; - }; - function getProxyForUrl(url) { - var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { - return ""; - } - proto = proto.split(":", 1)[0]; - hostname = hostname.replace(/:\d*$/, ""); - port = parseInt(port) || DEFAULT_PORTS[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ""; - } - var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); - if (proxy && proxy.indexOf("://") === -1) { - proxy = proto + "://" + proxy; - } - return proxy; - } - function shouldProxy(hostname, port) { - var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); - if (!NO_PROXY) { - return true; - } - if (NO_PROXY === "*") { - return false; - } - return NO_PROXY.split(/[,\s]/).every(function(proxy) { - if (!proxy) { - return true; - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; - } - if (!/^[.*]/.test(parsedProxyHostname)) { - return hostname !== parsedProxyHostname; - } - if (parsedProxyHostname.charAt(0) === "*") { - parsedProxyHostname = parsedProxyHostname.slice(1); - } - return !stringEndsWith.call(hostname, parsedProxyHostname); - }); - } - function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; - } - exports2.getProxyForUrl = getProxyForUrl; - } -}); - -// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ - "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug; - module2.exports = function() { - if (!debug) { - try { - debug = require_src()("follow-redirects"); - } catch (error) { - } - if (typeof debug !== "function") { - debug = function() { - }; - } - } - debug.apply(null, arguments); - }; - } -}); - -// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js"(exports2, module2) { - var url = require("url"); - var URL2 = url.URL; - var http = require("http"); - var https = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug = require_debug2(); - (function detectUnsupportedEnvironment() { - var looksLikeNode = typeof process !== "undefined"; - var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; - var looksLikeV8 = isFunction(Error.captureStackTrace); - if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { - console.warn("The follow-redirects package should be excluded from browser builds."); - } - })(); - var useNativeURL = false; - try { - assert(new URL2("")); - } catch (error) { - useNativeURL = error.code === "ERR_INVALID_URL"; - } - var preservedUrlFields = [ - "auth", - "host", - "hostname", - "href", - "path", - "pathname", - "port", - "protocol", - "query", - "search", - "hash" - ]; - var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; - var eventHandlers = /* @__PURE__ */ Object.create(null); - events.forEach(function(event) { - eventHandlers[event] = function(arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; - }); - var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError - ); - var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" - ); - var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded", - RedirectionError - ); - var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" - ); - var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" - ); - var destroy = Writable.prototype.destroy || noop; - function RedirectableRequest(options, responseCallback) { - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - if (responseCallback) { - this.on("response", responseCallback); - } - var self2 = this; - this._onNativeResponse = function(response) { - try { - self2._processResponse(response); - } catch (cause) { - self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); - } - }; - this._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); - }; - RedirectableRequest.prototype.destroy = function(error) { - destroyRequest(this._currentRequest, error); - destroy.call(this, error); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data, encoding }); - this._currentRequest.write(data, encoding, callback); - } else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } - }; - RedirectableRequest.prototype.end = function(data, encoding, callback) { - if (isFunction(data)) { - callback = data; - data = encoding = null; - } else if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } else { - var self2 = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function() { - self2._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } - }; - RedirectableRequest.prototype.setHeader = function(name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); - }; - RedirectableRequest.prototype.removeHeader = function(name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); - }; - RedirectableRequest.prototype.setTimeout = function(msecs, callback) { - var self2 = this; - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - function startTimer(socket) { - if (self2._timeout) { - clearTimeout(self2._timeout); - } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; - } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); - } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); - } - } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); - } - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - this.on("close", clearTimer); - return this; - }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); - }; - }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - throw new TypeError("Unsupported protocol " + protocol); - } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : ( - // When making a request to a proxy, [โ€ฆ] - // a client MUST send the target URI in absolute-form [โ€ฆ]. - this._options.path - ); - if (this._isRedirect) { - var i = 0; - var self2 = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - if (request === self2._currentRequest) { - if (error) { - self2.emit("error", error); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request.end(); - } - } - })(); - } - }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode - }); - } - var location = response.headers.location; - if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - this._requestBodyBuffers = []; - return; - } - destroyRequest(this._currentRequest); - response.destroy(); - if (++this._redirectCount > this._options.maxRedirects) { - throw new TooManyRedirectsError(); - } - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host") - }, this._options.headers); - } - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231ยง6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource [โ€ฆ] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) [โ€ฆ] - statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = parseUrl(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl = resolveUrl(location, currentUrl); - debug("redirecting to", redirectUrl.href); - this._isRedirect = true; - spreadUrlObject(redirectUrl, this._options); - if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); - } - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode - }; - var requestDetails = { - url: currentUrl, - method, - headers: requestHeaders - }; - beforeRedirect(this._options, responseDetails, requestDetails); - this._sanitizeOptions(this._options); - } - this._performRequest(); - }; - function wrap(protocols) { - var exports3 = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024 - }; - var nativeProtocols = {}; - Object.keys(protocols).forEach(function(scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); - function request(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString(input)) { - input = spreadUrlObject(parseUrl(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; - } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); - }); - return exports3; - } - function noop() { - } - function parseUrl(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); - } else { - parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; - } - function resolveUrl(relative, base) { - return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); - } - function validateUrl(input) { - if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { - throw new InvalidUrlError({ input: input.href || input }); - } - if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { - throw new InvalidUrlError({ input: input.href || input }); - } - return input; - } - function spreadUrlObject(urlObject, target) { - var spread = target || {}; - for (var key of preservedUrlFields) { - spread[key] = urlObject[key]; - } - if (spread.hostname.startsWith("[")) { - spread.hostname = spread.hostname.slice(1, -1); - } - if (spread.port !== "") { - spread.port = Number(spread.port); - } - spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; - return spread; - } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); - } - function createErrorType(code, message, baseClass) { - function CustomError(properties) { - if (isFunction(Error.captureStackTrace)) { - Error.captureStackTrace(this, this.constructor); - } - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - CustomError.prototype = new (baseClass || Error)(); - Object.defineProperties(CustomError.prototype, { - constructor: { - value: CustomError, - enumerable: false - }, - name: { - value: "Error [" + code + "]", - enumerable: false - } - }); - return CustomError; - } - function destroyRequest(request, error) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.destroy(error); - } - function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isString(value) { - return typeof value === "string" || value instanceof String; - } - function isFunction(value) { - return typeof value === "function"; - } - function isBuffer(value) { - return typeof value === "object" && "length" in value; - } - function isURL(value) { - return URL2 && value instanceof URL2; - } - module2.exports = wrap({ http, https }); - module2.exports.wrap = wrap; - } -}); - -// node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs -var require_axios = __commonJS({ - "node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs"(exports2, module2) { - "use strict"; - var FormData$1 = require_form_data(); - var crypto = require("crypto"); - var url = require("url"); - var http2 = require("http2"); - var proxyFromEnv = require_proxy_from_env(); - var http = require("http"); - var https = require("https"); - var util = require("util"); - var followRedirects = require_follow_redirects(); - var zlib = require("zlib"); - var stream = require("stream"); - var events = require("events"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1); - var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto); - var url__default = /* @__PURE__ */ _interopDefaultLegacy(url); - var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv); - var http__default = /* @__PURE__ */ _interopDefaultLegacy(http); - var https__default = /* @__PURE__ */ _interopDefaultLegacy(https); - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects); - var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib); - var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream); - function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; - } - var { toString } = Object.prototype; - var { getPrototypeOf } = Object; - var { iterator, toStringTag } = Symbol; - var kindOf = /* @__PURE__ */ ((cache) => (thing) => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); - })(/* @__PURE__ */ Object.create(null)); - var kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type; - }; - var typeOfTest = (type) => (thing) => typeof thing === type; - var { isArray } = Array; - var isUndefined = typeOfTest("undefined"); - function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); - } - var isArrayBuffer = kindOfTest("ArrayBuffer"); - function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; - } - var isString = typeOfTest("string"); - var isFunction$1 = typeOfTest("function"); - var isNumber = typeOfTest("number"); - var isObject = (thing) => thing !== null && typeof thing === "object"; - var isBoolean = (thing) => thing === true || thing === false; - var isPlainObject = (val) => { - if (kindOf(val) !== "object") { - return false; - } - const prototype2 = getPrototypeOf(val); - return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val); - }; - var isEmptyObject = (val) => { - if (!isObject(val) || isBuffer(val)) { - return false; - } - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - return false; - } - }; - var isDate = kindOfTest("Date"); - var isFile = kindOfTest("File"); - var isBlob = kindOfTest("Blob"); - var isFileList = kindOfTest("FileList"); - var isStream = (val) => isObject(val) && isFunction$1(val.pipe); - var isFormData = (thing) => { - let kind; - return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance - kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); - }; - var isURLSearchParams = kindOfTest("URLSearchParams"); - var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); - var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); - function forEach(obj, fn, { allOwnKeys = false } = {}) { - if (obj === null || typeof obj === "undefined") { - return; - } - let i; - let l; - if (typeof obj !== "object") { - obj = [obj]; - } - if (isArray(obj)) { - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - if (isBuffer(obj)) { - return; - } - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } - } - function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; - } - var _global = (() => { - if (typeof globalThis !== "undefined") return globalThis; - return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; - })(); - var isContextDefined = (context) => !isUndefined(context) && context !== _global; - function merge() { - const { caseless, skipUndefined } = isContextDefined(this) && this || {}; - const result = {}; - const assignValue = (val, key) => { - const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) { - result[targetKey] = merge(result[targetKey], val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - for (let i = 0, l = arguments.length; i < l; i++) { - arguments[i] && forEach(arguments[i], assignValue); - } - return result; - } - var extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach(b, (val, key) => { - if (thisArg && isFunction$1(val)) { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }, { allOwnKeys }); - return a; - }; - var stripBOM = (content) => { - if (content.charCodeAt(0) === 65279) { - content = content.slice(1); - } - return content; - }; - var inherits = (constructor, superConstructor, props, descriptors2) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors2); - constructor.prototype.constructor = constructor; - Object.defineProperty(constructor, "super", { - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); - }; - var toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - destObj = destObj || {}; - if (sourceObj == null) return destObj; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; - }; - var endsWith = (str, searchString, position) => { - str = String(str); - if (position === void 0 || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - var toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; - }; - var isTypedArray = /* @__PURE__ */ ((TypedArray) => { - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; - })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); - var forEachEntry = (obj, fn) => { - const generator = obj && obj[iterator]; - const _iterator = generator.call(obj); - let result; - while ((result = _iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } - }; - var matchAll = (regExp, str) => { - let matches; - const arr = []; - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - return arr; - }; - var isHTMLForm = kindOfTest("HTMLFormElement"); - var toCamelCase = (str) => { - return str.toLowerCase().replace( - /[-_\s]([a-z\d])(\w*)/g, - function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - } - ); - }; - var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); - var isRegExp = kindOfTest("RegExp"); - var reduceDescriptors = (obj, reducer) => { - const descriptors2 = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - forEach(descriptors2, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - Object.defineProperties(obj, reducedDescriptors); - }; - var freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { - return false; - } - const value = obj[name]; - if (!isFunction$1(value)) return; - descriptor.enumerable = false; - if ("writable" in descriptor) { - descriptor.writable = false; - return; - } - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); - }; - var toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - const define = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - return obj; - }; - var noop = () => { - }; - var toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; - }; - function isSpecCompliantForm(thing) { - return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); - } - var toJSONObject = (obj) => { - const stack = new Array(10); - const visit = (source, i) => { - if (isObject(source)) { - if (stack.indexOf(source) >= 0) { - return; - } - if (isBuffer(source)) { - return source; - } - if (!("toJSON" in source)) { - stack[i] = source; - const target = isArray(source) ? [] : {}; - forEach(source, (value, key) => { - const reducedValue = visit(value, i + 1); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - stack[i] = void 0; - return target; - } - } - return source; - }; - return visit(obj, 0); - }; - var isAsyncFn = kindOfTest("AsyncFunction"); - var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); - var _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener("message", ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, "*"); - }; - })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); - })( - typeof setImmediate === "function", - isFunction$1(_global.postMessage) - ); - var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; - var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); - var utils$1 = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isBlob, - isRegExp, - isFunction: isFunction$1, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, - // an alias to avoid ESLint no-prototype-builtins detection - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable - }; - function AxiosError(message, code, config, request, response) { - Error.call(this); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = new Error().stack; - } - this.message = message; - this.name = "AxiosError"; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status ? response.status : null; - } - } - utils$1.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: utils$1.toJSONObject(this.config), - code: this.code, - status: this.status - }; - } - }); - var prototype$1 = AxiosError.prototype; - var descriptors = {}; - [ - "ERR_BAD_OPTION_VALUE", - "ERR_BAD_OPTION", - "ECONNABORTED", - "ETIMEDOUT", - "ERR_NETWORK", - "ERR_FR_TOO_MANY_REDIRECTS", - "ERR_DEPRECATED", - "ERR_BAD_RESPONSE", - "ERR_BAD_REQUEST", - "ERR_CANCELED", - "ERR_NOT_SUPPORT", - "ERR_INVALID_URL" - // eslint-disable-next-line func-names - ].forEach((code) => { - descriptors[code] = { value: code }; - }); - Object.defineProperties(AxiosError, descriptors); - Object.defineProperty(prototype$1, "isAxiosError", { value: true }); - AxiosError.from = (error, code, config, request, response, customProps) => { - const axiosError = Object.create(prototype$1); - utils$1.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }, (prop) => { - return prop !== "isAxiosError"; - }); - const msg = error && error.message ? error.message : "Error"; - const errCode = code == null && error ? error.code : code; - AxiosError.call(axiosError, msg, errCode, config, request, response); - if (error && axiosError.cause == null) { - Object.defineProperty(axiosError, "cause", { value: error, configurable: true }); - } - axiosError.name = error && error.name || "Error"; - customProps && Object.assign(axiosError, customProps); - return axiosError; - }; - function isVisitable(thing) { - return utils$1.isPlainObject(thing) || utils$1.isArray(thing); - } - function removeBrackets(key) { - return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key; - } - function renderKey(path2, key, dots) { - if (!path2) return key; - return path2.concat(key).map(function each(token, i) { - token = removeBrackets(token); - return !dots && i ? "[" + token + "]" : token; - }).join(dots ? "." : ""); - } - function isFlatArray(arr) { - return utils$1.isArray(arr) && !arr.some(isVisitable); - } - var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); - }); - function toFormData(obj, formData, options) { - if (!utils$1.isObject(obj)) { - throw new TypeError("target must be an object"); - } - formData = formData || new (FormData__default["default"] || FormData)(); - options = utils$1.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - return !utils$1.isUndefined(source[option]); - }); - const metaTokens = options.metaTokens; - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; - const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); - if (!utils$1.isFunction(visitor)) { - throw new TypeError("visitor must be a function"); - } - function convertValue(value) { - if (value === null) return ""; - if (utils$1.isDate(value)) { - return value.toISOString(); - } - if (utils$1.isBoolean(value)) { - return value.toString(); - } - if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError("Blob is not supported. Use a Buffer instead."); - } - if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); - } - return value; - } - function defaultVisitor(value, key, path2) { - let arr = value; - if (value && !path2 && typeof value === "object") { - if (utils$1.endsWith(key, "{}")) { - key = metaTokens ? key : key.slice(0, -2); - value = JSON.stringify(value); - } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) { - key = removeBrackets(key); - arr.forEach(function each(el, index) { - !(utils$1.isUndefined(el) || el === null) && formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", - convertValue(el) - ); - }); - return false; - } - } - if (isVisitable(value)) { - return true; - } - formData.append(renderKey(path2, key, dots), convertValue(value)); - return false; - } - const stack = []; - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable - }); - function build2(value, path2) { - if (utils$1.isUndefined(value)) return; - if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path2.join(".")); - } - stack.push(value); - utils$1.forEach(value, function each(el, key) { - const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( - formData, - el, - utils$1.isString(key) ? key.trim() : key, - path2, - exposedHelpers - ); - if (result === true) { - build2(el, path2 ? path2.concat(key) : [key]); - } - }); - stack.pop(); - } - if (!utils$1.isObject(obj)) { - throw new TypeError("data must be an object"); - } - build2(obj); - return formData; - } - function encode$1(str) { - const charMap = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - "%00": "\0" - }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { - return charMap[match]; - }); - } - function AxiosURLSearchParams(params, options) { - this._pairs = []; - params && toFormData(params, this, options); - } - var prototype = AxiosURLSearchParams.prototype; - prototype.append = function append(name, value) { - this._pairs.push([name, value]); - }; - prototype.toString = function toString2(encoder) { - const _encode = encoder ? function(value) { - return encoder.call(this, value, encode$1); - } : encode$1; - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + "=" + _encode(pair[1]); - }, "").join("&"); - }; - function encode(val) { - return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); - } - function buildURL(url2, params, options) { - if (!params) { - return url2; - } - const _encode = options && options.encode || encode; - if (utils$1.isFunction(options)) { - options = { - serialize: options - }; - } - const serializeFn = options && options.serialize; - let serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, options); - } else { - serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode); - } - if (serializedParams) { - const hashmarkIndex = url2.indexOf("#"); - if (hashmarkIndex !== -1) { - url2 = url2.slice(0, hashmarkIndex); - } - url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams; - } - return url2; - } - var InterceptorManager = class { - constructor() { - this.handlers = []; - } - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } - }; - var InterceptorManager$1 = InterceptorManager; - var transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }; - var URLSearchParams2 = url__default["default"].URLSearchParams; - var ALPHA = "abcdefghijklmnopqrstuvwxyz"; - var DIGIT = "0123456789"; - var ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT - }; - var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { - let str = ""; - const { length } = alphabet; - const randomValues = new Uint32Array(size); - crypto__default["default"].randomFillSync(randomValues); - for (let i = 0; i < size; i++) { - str += alphabet[randomValues[i] % length]; - } - return str; - }; - var platform$1 = { - isNode: true, - classes: { - URLSearchParams: URLSearchParams2, - FormData: FormData__default["default"], - Blob: typeof Blob !== "undefined" && Blob || null - }, - ALPHABET, - generateString, - protocols: ["http", "https", "file", "data"] - }; - var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; - var _navigator = typeof navigator === "object" && navigator || void 0; - var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); - var hasStandardBrowserWebWorkerEnv = (() => { - return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; - })(); - var origin = hasBrowserEnv && window.location.href || "http://localhost"; - var utils = /* @__PURE__ */ Object.freeze({ - __proto__: null, - hasBrowserEnv, - hasStandardBrowserWebWorkerEnv, - hasStandardBrowserEnv, - navigator: _navigator, - origin - }); - var platform = { - ...utils, - ...platform$1 - }; - function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), { - visitor: function(value, key, path2, helpers) { - if (platform.isNode && utils$1.isBuffer(value)) { - this.append(key, value.toString("base64")); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - }, - ...options - }); - } - function parsePropPath(name) { - return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { - return match[0] === "[]" ? "" : match[1] || match[0]; - }); - } - function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; - } - function formDataToJSON(formData) { - function buildPath(path2, value, target, index) { - let name = path2[index++]; - if (name === "__proto__") return true; - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path2.length; - name = !name && utils$1.isArray(target) ? target.length : name; - if (isLast) { - if (utils$1.hasOwnProp(target, name)) { - target[name] = [target[name], value]; - } else { - target[name] = value; - } - return !isNumericKey; - } - if (!target[name] || !utils$1.isObject(target[name])) { - target[name] = []; - } - const result = buildPath(path2, value, target[name], index); - if (result && utils$1.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - return !isNumericKey; - } - if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { - const obj = {}; - utils$1.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; - } - function stringifySafely(rawValue, parser, encoder) { - if (utils$1.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$1.trim(rawValue); - } catch (e) { - if (e.name !== "SyntaxError") { - throw e; - } - } - } - return (encoder || JSON.stringify)(rawValue); - } - var defaults = { - transitional: transitionalDefaults, - adapter: ["xhr", "http", "fetch"], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ""; - const hasJSONContentType = contentType.indexOf("application/json") > -1; - const isObjectPayload = utils$1.isObject(data); - if (isObjectPayload && utils$1.isHTMLForm(data)) { - data = new FormData(data); - } - const isFormData2 = utils$1.isFormData(data); - if (isFormData2) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { - return data; - } - if (utils$1.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$1.isURLSearchParams(data)) { - headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); - return data.toString(); - } - let isFileList2; - if (isObjectPayload) { - if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { - return toURLEncodedForm(data, this.formSerializer).toString(); - } - if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { - const _FormData = this.env && this.env.FormData; - return toFormData( - isFileList2 ? { "files[]": data } : data, - _FormData && new _FormData(), - this.formSerializer - ); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType("application/json", false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - const transitional = this.transitional || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const JSONRequested = this.responseType === "json"; - if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { - return data; - } - if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data, this.parseReviver); - } catch (e) { - if (strictJSONParsing) { - if (e.name === "SyntaxError") { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: "XSRF-TOKEN", - xsrfHeaderName: "X-XSRF-TOKEN", - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - headers: { - common: { - "Accept": "application/json, text/plain, */*", - "Content-Type": void 0 - } - } - }; - utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { - defaults.headers[method] = {}; - }); - var defaults$1 = defaults; - var ignoreDuplicateOf = utils$1.toObjectSet([ - "age", - "authorization", - "content-length", - "content-type", - "etag", - "expires", - "from", - "host", - "if-modified-since", - "if-unmodified-since", - "last-modified", - "location", - "max-forwards", - "proxy-authorization", - "referer", - "retry-after", - "user-agent" - ]); - var parseHeaders = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i = line.indexOf(":"); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) { - return; - } - if (key === "set-cookie") { - if (parsed[key]) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; - } - }); - return parsed; - }; - var $internals = Symbol("internals"); - function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); - } - function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); - } - function parseTokens(str) { - const tokens = /* @__PURE__ */ Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; - } - var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils$1.isString(value)) return; - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } - } - function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); - } - function buildAccessors(obj, header) { - const accessorName = utils$1.toCamelCase(" " + header); - ["get", "set", "has"].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); - } - var AxiosHeaders = class { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self2 = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - throw new Error("header name must be a non-empty string"); - } - const key = utils$1.findKey(self2, lHeader); - if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { - self2[key || _header] = normalizeValue(_value); - } - } - const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { - let obj = {}, dest, key; - for (const entry of header) { - if (!utils$1.isArray(entry)) { - throw TypeError("Object iterator must return a key-value pair"); - } - obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; - } - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - if (key) { - const value = this[key]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - delete(header, matcher) { - const self2 = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key = utils$1.findKey(self2, _header); - if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { - delete self2[key]; - deleted = true; - } - } - } - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - return deleted; - } - normalize(format) { - const self2 = this; - const headers = {}; - utils$1.forEach(this, (value, header) => { - const key = utils$1.findKey(headers, header); - if (key) { - self2[key] = normalizeValue(value); - delete self2[header]; - return; - } - const normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self2[header]; - } - self2[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - toJSON(asStrings) { - const obj = /* @__PURE__ */ Object.create(null); - utils$1.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); - }); - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); - } - getSetCookie() { - return this.get("set-cookie") || []; - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach((target) => computed.set(target)); - return computed; - } - static accessor(header) { - const internals = this[$internals] = this[$internals] = { - accessors: {} - }; - const accessors = internals.accessors; - const prototype2 = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype2, _header); - accessors[lHeader] = true; - } - } - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } - }; - AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); - utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - }; - }); - utils$1.freezeMethods(AxiosHeaders); - var AxiosHeaders$1 = AxiosHeaders; - function transformData(fns, response) { - const config = this || defaults$1; - const context = response || config; - const headers = AxiosHeaders$1.from(context.headers); - let data = context.data; - utils$1.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); - }); - headers.normalize(); - return data; - } - function isCancel(value) { - return !!(value && value.__CANCEL__); - } - function CanceledError(message, config, request) { - AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request); - this.name = "CanceledError"; - } - utils$1.inherits(CanceledError, AxiosError, { - __CANCEL__: true - }); - function settle(resolve2, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve2(response); - } else { - reject(new AxiosError( - "Request failed with status code " + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } - } - function isAbsoluteURL(url2) { - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2); - } - function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; - } - function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; - } - var VERSION = "1.13.1"; - function parseProtocol(url2) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2); - return match && match[1] || ""; - } - var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; - function fromDataURI(uri, asBlob, options) { - const _Blob = options && options.Blob || platform.classes.Blob; - const protocol = parseProtocol(uri); - if (asBlob === void 0 && _Blob) { - asBlob = true; - } - if (protocol === "data") { - uri = protocol.length ? uri.slice(protocol.length + 1) : uri; - const match = DATA_URL_PATTERN.exec(uri); - if (!match) { - throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL); - } - const mime = match[1]; - const isBase64 = match[2]; - const body = match[3]; - const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8"); - if (asBlob) { - if (!_Blob) { - throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT); - } - return new _Blob([buffer], { type: mime }); - } - return buffer; - } - throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT); - } - var kInternals = Symbol("internals"); - var AxiosTransformStream = class extends stream__default["default"].Transform { - constructor(options) { - options = utils$1.toFlatObject(options, { - maxRate: 0, - chunkSize: 64 * 1024, - minChunkSize: 100, - timeWindow: 500, - ticksRate: 2, - samplesCount: 15 - }, null, (prop, source) => { - return !utils$1.isUndefined(source[prop]); - }); - super({ - readableHighWaterMark: options.chunkSize - }); - const internals = this[kInternals] = { - timeWindow: options.timeWindow, - chunkSize: options.chunkSize, - maxRate: options.maxRate, - minChunkSize: options.minChunkSize, - bytesSeen: 0, - isCaptured: false, - notifiedBytesLoaded: 0, - ts: Date.now(), - bytes: 0, - onReadCallback: null - }; - this.on("newListener", (event) => { - if (event === "progress") { - if (!internals.isCaptured) { - internals.isCaptured = true; - } - } - }); - } - _read(size) { - const internals = this[kInternals]; - if (internals.onReadCallback) { - internals.onReadCallback(); - } - return super._read(size); - } - _transform(chunk, encoding, callback) { - const internals = this[kInternals]; - const maxRate = internals.maxRate; - const readableHighWaterMark = this.readableHighWaterMark; - const timeWindow = internals.timeWindow; - const divider = 1e3 / timeWindow; - const bytesThreshold = maxRate / divider; - const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; - const pushChunk = (_chunk, _callback) => { - const bytes = Buffer.byteLength(_chunk); - internals.bytesSeen += bytes; - internals.bytes += bytes; - internals.isCaptured && this.emit("progress", internals.bytesSeen); - if (this.push(_chunk)) { - process.nextTick(_callback); - } else { - internals.onReadCallback = () => { - internals.onReadCallback = null; - process.nextTick(_callback); - }; - } - }; - const transformChunk = (_chunk, _callback) => { - const chunkSize = Buffer.byteLength(_chunk); - let chunkRemainder = null; - let maxChunkSize = readableHighWaterMark; - let bytesLeft; - let passed = 0; - if (maxRate) { - const now = Date.now(); - if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { - internals.ts = now; - bytesLeft = bytesThreshold - internals.bytes; - internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; - passed = 0; - } - bytesLeft = bytesThreshold - internals.bytes; - } - if (maxRate) { - if (bytesLeft <= 0) { - return setTimeout(() => { - _callback(null, _chunk); - }, timeWindow - passed); - } - if (bytesLeft < maxChunkSize) { - maxChunkSize = bytesLeft; - } - } - if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { - chunkRemainder = _chunk.subarray(maxChunkSize); - _chunk = _chunk.subarray(0, maxChunkSize); - } - pushChunk(_chunk, chunkRemainder ? () => { - process.nextTick(_callback, null, chunkRemainder); - } : _callback); - }; - transformChunk(chunk, function transformNextChunk(err, _chunk) { - if (err) { - return callback(err); - } - if (_chunk) { - transformChunk(_chunk, transformNextChunk); - } else { - callback(null); - } - }); - } - }; - var AxiosTransformStream$1 = AxiosTransformStream; - var { asyncIterator } = Symbol; - var readBlob = async function* (blob) { - if (blob.stream) { - yield* blob.stream(); - } else if (blob.arrayBuffer) { - yield await blob.arrayBuffer(); - } else if (blob[asyncIterator]) { - yield* blob[asyncIterator](); - } else { - yield blob; - } - }; - var readBlob$1 = readBlob; - var BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + "-_"; - var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder(); - var CRLF = "\r\n"; - var CRLF_BYTES = textEncoder.encode(CRLF); - var CRLF_BYTES_COUNT = 2; - var FormDataPart = class { - constructor(name, value) { - const { escapeName } = this.constructor; - const isStringValue = utils$1.isString(value); - let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`; - if (isStringValue) { - value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); - } else { - headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; - } - this.headers = textEncoder.encode(headers + CRLF); - this.contentLength = isStringValue ? value.byteLength : value.size; - this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; - this.name = name; - this.value = value; - } - async *encode() { - yield this.headers; - const { value } = this; - if (utils$1.isTypedArray(value)) { - yield value; - } else { - yield* readBlob$1(value); - } - yield CRLF_BYTES; - } - static escapeName(name) { - return String(name).replace(/[\r\n"]/g, (match) => ({ - "\r": "%0D", - "\n": "%0A", - '"': "%22" - })[match]); - } - }; - var formDataToStream = (form, headersHandler, options) => { - const { - tag = "form-data-boundary", - size = 25, - boundary = tag + "-" + platform.generateString(size, BOUNDARY_ALPHABET) - } = options || {}; - if (!utils$1.isFormData(form)) { - throw TypeError("FormData instance required"); - } - if (boundary.length < 1 || boundary.length > 70) { - throw Error("boundary must be 10-70 characters long"); - } - const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); - const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF); - let contentLength = footerBytes.byteLength; - const parts = Array.from(form.entries()).map(([name, value]) => { - const part = new FormDataPart(name, value); - contentLength += part.size; - return part; - }); - contentLength += boundaryBytes.byteLength * parts.length; - contentLength = utils$1.toFiniteNumber(contentLength); - const computedHeaders = { - "Content-Type": `multipart/form-data; boundary=${boundary}` - }; - if (Number.isFinite(contentLength)) { - computedHeaders["Content-Length"] = contentLength; - } - headersHandler && headersHandler(computedHeaders); - return stream.Readable.from(async function* () { - for (const part of parts) { - yield boundaryBytes; - yield* part.encode(); - } - yield footerBytes; - }()); - }; - var formDataToStream$1 = formDataToStream; - var ZlibHeaderTransformStream = class extends stream__default["default"].Transform { - __transform(chunk, encoding, callback) { - this.push(chunk); - callback(); - } - _transform(chunk, encoding, callback) { - if (chunk.length !== 0) { - this._transform = this.__transform; - if (chunk[0] !== 120) { - const header = Buffer.alloc(2); - header[0] = 120; - header[1] = 156; - this.push(header, encoding); - } - } - this.__transform(chunk, encoding, callback); - } - }; - var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream; - var callbackify = (fn, reducer) => { - return utils$1.isAsyncFn(fn) ? function(...args) { - const cb = args.pop(); - fn.apply(this, args).then((value) => { - try { - reducer ? cb(null, ...reducer(value)) : cb(null, value); - } catch (err) { - cb(err); - } - }, cb); - } : fn; - }; - var callbackify$1 = callbackify; - function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - min = min !== void 0 ? min : 1e3; - return function push(chunkLength) { - const now = Date.now(); - const startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes[head] = chunkLength; - timestamps[head] = now; - let i = tail; - let bytesCount = 0; - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - const passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; - }; - } - function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1e3 / freq; - let lastArgs; - let timer; - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn(...args); - }; - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; - } - var progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - return throttle((e) => { - const loaded = e.loaded; - const total = e.lengthComputable ? e.total : void 0; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; - const data = { - loaded, - total, - progress: total ? loaded / total : void 0, - bytes: progressBytes, - rate: rate ? rate : void 0, - estimated: rate && total && inRange ? (total - loaded) / rate : void 0, - event: e, - lengthComputable: total != null, - [isDownloadStream ? "download" : "upload"]: true - }; - listener(data); - }, freq); - }; - var progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - return [(loaded) => throttled[0]({ - lengthComputable, - total, - loaded - }), throttled[1]]; - }; - var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); - function estimateDataURLDecodedBytes(url2) { - if (!url2 || typeof url2 !== "string") return 0; - if (!url2.startsWith("data:")) return 0; - const comma = url2.indexOf(","); - if (comma < 0) return 0; - const meta = url2.slice(5, comma); - const body = url2.slice(comma + 1); - const isBase64 = /;base64/i.test(meta); - if (isBase64) { - let effectiveLen = body.length; - const len = body.length; - for (let i = 0; i < len; i++) { - if (body.charCodeAt(i) === 37 && i + 2 < len) { - const a = body.charCodeAt(i + 1); - const b = body.charCodeAt(i + 2); - const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102); - if (isHex) { - effectiveLen -= 2; - i += 2; - } - } - } - let pad = 0; - let idx = len - 1; - const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%' - body.charCodeAt(j - 1) === 51 && // '3' - (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); - if (idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - idx--; - } else if (tailIsPct3D(idx)) { - pad++; - idx -= 3; - } - } - if (pad === 1 && idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - } else if (tailIsPct3D(idx)) { - pad++; - } - } - const groups = Math.floor(effectiveLen / 4); - const bytes = groups * 3 - (pad || 0); - return bytes > 0 ? bytes : 0; - } - return Buffer.byteLength(body, "utf8"); - } - var zlibOptions = { - flush: zlib__default["default"].constants.Z_SYNC_FLUSH, - finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH - }; - var brotliOptions = { - flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH, - finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH - }; - var { - HTTP2_HEADER_SCHEME, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_STATUS - } = http2.constants; - var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress); - var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"]; - var isHttps = /https:?/; - var supportedProtocols = platform.protocols.map((protocol) => { - return protocol + ":"; - }); - var flushOnFinish = (stream2, [throttled, flush]) => { - stream2.on("end", flush).on("error", flush); - return throttled; - }; - var Http2Sessions = class { - constructor() { - this.sessions = /* @__PURE__ */ Object.create(null); - } - getSession(authority, options) { - options = Object.assign({ - sessionTimeout: 1e3 - }, options); - let authoritySessions; - if (authoritySessions = this.sessions[authority]) { - let len = authoritySessions.length; - for (let i = 0; i < len; i++) { - const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) { - return sessionHandle; - } - } - } - const session = http2.connect(authority, options); - let removed; - const removeSession = () => { - if (removed) { - return; - } - removed = true; - let entries2 = authoritySessions, len = entries2.length, i = len; - while (i--) { - if (entries2[i][0] === session) { - entries2.splice(i, 1); - if (len === 1) { - delete this.sessions[authority]; - return; - } - } - } - }; - const originalRequestFn = session.request; - const { sessionTimeout } = options; - if (sessionTimeout != null) { - let timer; - let streamsCount = 0; - session.request = function() { - const stream2 = originalRequestFn.apply(this, arguments); - streamsCount++; - if (timer) { - clearTimeout(timer); - timer = null; - } - stream2.once("close", () => { - if (!--streamsCount) { - timer = setTimeout(() => { - timer = null; - removeSession(); - }, sessionTimeout); - } - }); - return stream2; - }; - } - session.once("close", removeSession); - let entries = this.sessions[authority], entry = [ - session, - options - ]; - entries ? this.sessions[authority].push(entry) : authoritySessions = this.sessions[authority] = [entry]; - return session; - } - }; - var http2Sessions = new Http2Sessions(); - function dispatchBeforeRedirect(options, responseDetails) { - if (options.beforeRedirects.proxy) { - options.beforeRedirects.proxy(options); - } - if (options.beforeRedirects.config) { - options.beforeRedirects.config(options, responseDetails); - } - } - function setProxy(options, configProxy, location) { - let proxy = configProxy; - if (!proxy && proxy !== false) { - const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location); - if (proxyUrl) { - proxy = new URL(proxyUrl); - } - } - if (proxy) { - if (proxy.username) { - proxy.auth = (proxy.username || "") + ":" + (proxy.password || ""); - } - if (proxy.auth) { - if (proxy.auth.username || proxy.auth.password) { - proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || ""); - } - const base64 = Buffer.from(proxy.auth, "utf8").toString("base64"); - options.headers["Proxy-Authorization"] = "Basic " + base64; - } - options.headers.host = options.hostname + (options.port ? ":" + options.port : ""); - const proxyHost = proxy.hostname || proxy.host; - options.hostname = proxyHost; - options.host = proxyHost; - options.port = proxy.port; - options.path = location; - if (proxy.protocol) { - options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`; - } - } - options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - setProxy(redirectOptions, configProxy, redirectOptions.href); - }; - } - var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process"; - var wrapAsync = (asyncExecutor) => { - return new Promise((resolve2, reject) => { - let onDone; - let isDone; - const done = (value, isRejected) => { - if (isDone) return; - isDone = true; - onDone && onDone(value, isRejected); - }; - const _resolve = (value) => { - done(value); - resolve2(value); - }; - const _reject = (reason) => { - done(reason, true); - reject(reason); - }; - asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject); - }); - }; - var resolveFamily = ({ address, family }) => { - if (!utils$1.isString(address)) { - throw TypeError("address must be a string"); - } - return { - address, - family: family || (address.indexOf(".") < 0 ? 6 : 4) - }; - }; - var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family }); - var http2Transport = { - request(options, cb) { - const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80); - const { http2Options, headers } = options; - const session = http2Sessions.getSession(authority, http2Options); - const http2Headers = { - [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""), - [HTTP2_HEADER_METHOD]: options.method, - [HTTP2_HEADER_PATH]: options.path - }; - utils$1.forEach(headers, (header, name) => { - name.charAt(0) !== ":" && (http2Headers[name] = header); - }); - const req = session.request(http2Headers); - req.once("response", (responseHeaders) => { - const response = req; - responseHeaders = Object.assign({}, responseHeaders); - const status = responseHeaders[HTTP2_HEADER_STATUS]; - delete responseHeaders[HTTP2_HEADER_STATUS]; - response.headers = responseHeaders; - response.statusCode = +status; - cb(response); - }); - return req; - } - }; - var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) { - return wrapAsync(async function dispatchHttpRequest(resolve2, reject, onDone) { - let { data, lookup, family, httpVersion = 1, http2Options } = config; - const { responseType, responseEncoding } = config; - const method = config.method.toUpperCase(); - let isDone; - let rejected = false; - let req; - httpVersion = +httpVersion; - if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); - } - if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); - } - const isHttp2 = httpVersion === 2; - if (lookup) { - const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - }; - } - const abortEmitter = new events.EventEmitter(); - function abort(reason) { - try { - abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason); - } catch (err) { - console.warn("emit error", err); - } - } - abortEmitter.once("abort", reject); - const onFinished = () => { - if (config.cancelToken) { - config.cancelToken.unsubscribe(abort); - } - if (config.signal) { - config.signal.removeEventListener("abort", abort); - } - abortEmitter.removeAllListeners(); - }; - if (config.cancelToken || config.signal) { - config.cancelToken && config.cancelToken.subscribe(abort); - if (config.signal) { - config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort); - } - } - onDone((response, isRejected) => { - isDone = true; - if (isRejected) { - rejected = true; - onFinished(); - return; - } - const { data: data2 } = response; - if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) { - const offListeners = stream__default["default"].finished(data2, () => { - offListeners(); - onFinished(); - }); - } else { - onFinished(); - } - }); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0); - const protocol = parsed.protocol || supportedProtocols[0]; - if (protocol === "data:") { - if (config.maxContentLength > -1) { - const dataUrl = String(config.url || fullPath || ""); - const estimated = estimateDataURLDecodedBytes(dataUrl); - if (estimated > config.maxContentLength) { - return reject(new AxiosError( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError.ERR_BAD_RESPONSE, - config - )); - } - } - let convertedData; - if (method !== "GET") { - return settle(resolve2, reject, { - status: 405, - statusText: "method not allowed", - headers: {}, - config - }); - } - try { - convertedData = fromDataURI(config.url, responseType === "blob", { - Blob: config.env && config.env.Blob - }); - } catch (err) { - throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); - } - if (responseType === "text") { - convertedData = convertedData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - convertedData = utils$1.stripBOM(convertedData); - } - } else if (responseType === "stream") { - convertedData = stream__default["default"].Readable.from(convertedData); - } - return settle(resolve2, reject, { - data: convertedData, - status: 200, - statusText: "OK", - headers: new AxiosHeaders$1(), - config - }); - } - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError( - "Unsupported protocol " + protocol, - AxiosError.ERR_BAD_REQUEST, - config - )); - } - const headers = AxiosHeaders$1.from(config.headers).normalize(); - headers.set("User-Agent", "axios/" + VERSION, false); - const { onUploadProgress, onDownloadProgress } = config; - const maxRate = config.maxRate; - let maxUploadRate = void 0; - let maxDownloadRate = void 0; - if (utils$1.isSpecCompliantForm(data)) { - const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - data = formDataToStream$1(data, (formHeaders) => { - headers.set(formHeaders); - }, { - tag: `axios-${VERSION}-boundary`, - boundary: userBoundary && userBoundary[1] || void 0 - }); - } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) { - headers.set(data.getHeaders()); - if (!headers.hasContentLength()) { - try { - const knownLength = await util__default["default"].promisify(data.getLength).call(data); - Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); - } catch (e) { - } - } - } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { - data.size && headers.setContentType(data.type || "application/octet-stream"); - headers.setContentLength(data.size || 0); - data = stream__default["default"].Readable.from(readBlob$1(data)); - } else if (data && !utils$1.isStream(data)) { - if (Buffer.isBuffer(data)) ; - else if (utils$1.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils$1.isString(data)) { - data = Buffer.from(data, "utf-8"); - } else { - return reject(new AxiosError( - "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", - AxiosError.ERR_BAD_REQUEST, - config - )); - } - headers.setContentLength(data.length, false); - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError( - "Request body larger than maxBodyLength limit", - AxiosError.ERR_BAD_REQUEST, - config - )); - } - } - const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); - if (utils$1.isArray(maxRate)) { - maxUploadRate = maxRate[0]; - maxDownloadRate = maxRate[1]; - } else { - maxUploadRate = maxDownloadRate = maxRate; - } - if (data && (onUploadProgress || maxUploadRate)) { - if (!utils$1.isStream(data)) { - data = stream__default["default"].Readable.from(data, { objectMode: false }); - } - data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({ - maxRate: utils$1.toFiniteNumber(maxUploadRate) - })], utils$1.noop); - onUploadProgress && data.on("progress", flushOnFinish( - data, - progressEventDecorator( - contentLength, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) - ) - )); - } - let auth = void 0; - if (config.auth) { - const username = config.auth.username || ""; - const password = config.auth.password || ""; - auth = username + ":" + password; - } - if (!auth && parsed.username) { - const urlUsername = parsed.username; - const urlPassword = parsed.password; - auth = urlUsername + ":" + urlPassword; - } - auth && headers.delete("authorization"); - let path2; - try { - path2 = buildURL( - parsed.pathname + parsed.search, - config.params, - config.paramsSerializer - ).replace(/^\?/, ""); - } catch (err) { - const customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - return reject(customErr); - } - headers.set( - "Accept-Encoding", - "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), - false - ); - const options = { - path: path2, - method, - headers: headers.toJSON(), - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth, - protocol, - family, - beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: {}, - http2Options - }; - !utils$1.isUndefined(lookup) && (options.lookup = lookup); - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; - options.port = parsed.port; - setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path); - } - let transport; - const isHttpsRequest = isHttps.test(options.protocol); - options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - if (isHttp2) { - transport = http2Transport; - } else { - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsRequest ? https__default["default"] : http__default["default"]; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirects.config = config.beforeRedirect; - } - transport = isHttpsRequest ? httpsFollow : httpFollow; - } - } - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } else { - options.maxBodyLength = Infinity; - } - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } - req = transport.request(options, function handleResponse(res) { - if (req.destroyed) return; - const streams = [res]; - const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]); - if (onDownloadProgress || maxDownloadRate) { - const transformStream = new AxiosTransformStream$1({ - maxRate: utils$1.toFiniteNumber(maxDownloadRate) - }); - onDownloadProgress && transformStream.on("progress", flushOnFinish( - transformStream, - progressEventDecorator( - responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) - ) - )); - streams.push(transformStream); - } - let responseStream = res; - const lastRequest = res.req || req; - if (config.decompress !== false && res.headers["content-encoding"]) { - if (method === "HEAD" || res.statusCode === 204) { - delete res.headers["content-encoding"]; - } - switch ((res.headers["content-encoding"] || "").toLowerCase()) { - /*eslint default-case:0*/ - case "gzip": - case "x-gzip": - case "compress": - case "x-compress": - streams.push(zlib__default["default"].createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "deflate": - streams.push(new ZlibHeaderTransformStream$1()); - streams.push(zlib__default["default"].createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "br": - if (isBrotliSupported) { - streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions)); - delete res.headers["content-encoding"]; - } - } - } - responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0]; - const response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: new AxiosHeaders$1(res.headers), - config, - request: lastRequest - }; - if (responseType === "stream") { - response.data = responseStream; - settle(resolve2, reject, response); - } else { - const responseBuffer = []; - let totalResponseBytes = 0; - responseStream.on("data", function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - rejected = true; - responseStream.destroy(); - abort(new AxiosError( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - )); - } - }); - responseStream.on("aborted", function handlerStreamAborted() { - if (rejected) { - return; - } - const err = new AxiosError( - "stream has been aborted", - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - ); - responseStream.destroy(err); - reject(err); - }); - responseStream.on("error", function handleStreamError(err) { - if (req.destroyed) return; - reject(AxiosError.from(err, null, config, lastRequest)); - }); - responseStream.on("end", function handleStreamEnd() { - try { - let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (responseType !== "arraybuffer") { - responseData = responseData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - responseData = utils$1.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - return reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve2, reject, response); - }); - } - abortEmitter.once("abort", (err) => { - if (!responseStream.destroyed) { - responseStream.emit("error", err); - responseStream.destroy(); - } - }); - }); - abortEmitter.once("abort", (err) => { - if (req.close) { - req.close(); - } else { - req.destroy(err); - } - }); - req.on("error", function handleRequestError(err) { - reject(AxiosError.from(err, null, config, req)); - }); - req.on("socket", function handleRequestSocket(socket) { - socket.setKeepAlive(true, 1e3 * 60); - }); - if (config.timeout) { - const timeout = parseInt(config.timeout, 10); - if (Number.isNaN(timeout)) { - abort(new AxiosError( - "error trying to parse `config.timeout` to int", - AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - )); - return; - } - req.setTimeout(timeout, function handleRequestTimeout() { - if (isDone) return; - let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - abort(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - req - )); - }); - } - if (utils$1.isStream(data)) { - let ended = false; - let errored = false; - data.on("end", () => { - ended = true; - }); - data.once("error", (err) => { - errored = true; - req.destroy(err); - }); - data.on("close", () => { - if (!ended && !errored) { - abort(new CanceledError("Request stream has been aborted", config, req)); - } - }); - data.pipe(req); - } else { - data && req.write(data); - req.end(); - } - }); - }; - var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => { - url2 = new URL(url2, platform.origin); - return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port); - })( - new URL(platform.origin), - platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) - ) : () => true; - var cookies = platform.hasStandardBrowserEnv ? ( - // Standard browser envs support document.cookie - { - write(name, value, expires, path2, domain, secure, sameSite) { - if (typeof document === "undefined") return; - const cookie = [`${name}=${encodeURIComponent(value)}`]; - if (utils$1.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils$1.isString(path2)) { - cookie.push(`path=${path2}`); - } - if (utils$1.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push("secure"); - } - if (utils$1.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - document.cookie = cookie.join("; "); - }, - read(name) { - if (typeof document === "undefined") return null; - const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); - return match ? decodeURIComponent(match[1]) : null; - }, - remove(name) { - this.write(name, "", Date.now() - 864e5, "/"); - } - } - ) : ( - // Non-standard browser env (web workers, react-native) lack needed support. - { - write() { - }, - read() { - return null; - }, - remove() { - } - } - ); - var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; - function mergeConfig(config1, config2) { - config2 = config2 || {}; - const config = {}; - function getMergedValue(target, source, prop, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ caseless }, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(void 0, a, prop, caseless); - } - } - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(void 0, b); - } - } - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(void 0, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(void 0, a); - } - } - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(void 0, a); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) - }; - utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { - const merge2 = mergeMap[prop] || mergeDeepProperties; - const configValue = merge2(config1[prop], config2[prop], prop); - utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); - }); - return config; - } - var resolveConfig = (config) => { - const newConfig = mergeConfig({}, config); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; - newConfig.headers = headers = AxiosHeaders$1.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); - if (auth) { - headers.set( - "Authorization", - "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) - ); - } - if (utils$1.isFormData(data)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { - headers.setContentType(void 0); - } else if (utils$1.isFunction(data.getHeaders)) { - const formHeaders = data.getHeaders(); - const allowedHeaders = ["content-type", "content-length"]; - Object.entries(formHeaders).forEach(([key, val]) => { - if (allowedHeaders.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); - } - } - if (platform.hasStandardBrowserEnv) { - withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; - }; - var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; - var xhrAdapter = isXHRAdapterSupported && function(config) { - return new Promise(function dispatchXhrRequest(resolve2, reject) { - const _config = resolveConfig(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - function done() { - flushUpload && flushUpload(); - flushDownload && flushDownload(); - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener("abort", onCanceled); - } - let request = new XMLHttpRequest(); - request.open(_config.method.toUpperCase(), _config.url, true); - request.timeout = _config.timeout; - function onloadend() { - if (!request) { - return; - } - const responseHeaders = AxiosHeaders$1.from( - "getAllResponseHeaders" in request && request.getAllResponseHeaders() - ); - const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; - settle(function _resolve(value) { - resolve2(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - request = null; - } - if ("onloadend" in request) { - request.onloadend = onloadend; - } else { - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { - return; - } - setTimeout(onloadend); - }; - } - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); - request = null; - }; - request.onerror = function handleError(event) { - const msg = event && event.message ? event.message : "Network Error"; - const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); - err.event = event || null; - reject(err); - request = null; - }; - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - request - )); - request = null; - }; - requestData === void 0 && requestHeaders.setContentType(null); - if ("setRequestHeader" in request) { - utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - if (!utils$1.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - if (responseType && responseType !== "json") { - request.responseType = _config.responseType; - } - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener("progress", downloadThrottled); - } - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - request.upload.addEventListener("progress", uploadThrottled); - request.upload.addEventListener("loadend", flushUpload); - } - if (_config.cancelToken || _config.signal) { - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); - request.abort(); - request = null; - }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); - } - } - const protocol = parseProtocol(_config.url); - if (protocol && platform.protocols.indexOf(protocol) === -1) { - reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config)); - return; - } - request.send(requestData || null); - }); - }; - var composeSignals = (signals, timeout) => { - const { length } = signals = signals ? signals.filter(Boolean) : []; - if (timeout || length) { - let controller = new AbortController(); - let aborted; - const onabort = function(reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); - } - }; - let timer = timeout && setTimeout(() => { - timer = null; - onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (signals) { - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal2) => { - signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); - }); - signals = null; - } - }; - signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); - const { signal } = controller; - signal.unsubscribe = () => utils$1.asap(unsubscribe); - return signal; - } - }; - var composeSignals$1 = composeSignals; - var streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - if (!chunkSize || len < chunkSize) { - yield chunk; - return; - } - let pos = 0; - let end; - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } - }; - var readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } - }; - var readStream = async function* (stream2) { - if (stream2[Symbol.asyncIterator]) { - yield* stream2; - return; - } - const reader = stream2.getReader(); - try { - for (; ; ) { - const { done, value } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } - }; - var trackStream = (stream2, chunkSize, onProgress, onFinish) => { - const iterator2 = readBytes(stream2, chunkSize); - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - return new ReadableStream({ - async pull(controller) { - try { - const { done: done2, value } = await iterator2.next(); - if (done2) { - _onFinish(); - controller.close(); - return; - } - let len = value.byteLength; - if (onProgress) { - let loadedBytes = bytes += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator2.return(); - } - }, { - highWaterMark: 2 - }); - }; - var DEFAULT_CHUNK_SIZE = 64 * 1024; - var { isFunction } = utils$1; - var globalFetchAPI = (({ Request, Response }) => ({ - Request, - Response - }))(utils$1.global); - var { - ReadableStream: ReadableStream$1, - TextEncoder: TextEncoder$1 - } = utils$1.global; - var test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } - }; - var factory = (env) => { - env = utils$1.merge.call({ - skipUndefined: true - }, globalFetchAPI, env); - const { fetch: envFetch, Request, Response } = env; - const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; - const isRequestSupported = isFunction(Request); - const isResponseSupported = isFunction(Response); - if (!isFetchSupported) { - return false; - } - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); - const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); - const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { - let duplexAccessed = false; - const hasContentType = new Request(platform.origin, { - body: new ReadableStream$1(), - method: "POST", - get duplex() { - duplexAccessed = true; - return "half"; - } - }).headers.has("Content-Type"); - return duplexAccessed && !hasContentType; - }); - const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body)); - const resolvers = { - stream: supportsResponseStream && ((res) => res.body) - }; - isFetchSupported && (() => { - ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { - !resolvers[type] && (resolvers[type] = (res, config) => { - let method = res && res[type]; - if (method) { - return method.call(res); - } - throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); - }); - }); - })(); - const getBodyLength = async (body) => { - if (body == null) { - return 0; - } - if (utils$1.isBlob(body)) { - return body.size; - } - if (utils$1.isSpecCompliantForm(body)) { - const _request = new Request(platform.origin, { - method: "POST", - body - }); - return (await _request.arrayBuffer()).byteLength; - } - if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { - return body.byteLength; - } - if (utils$1.isURLSearchParams(body)) { - body = body + ""; - } - if (utils$1.isString(body)) { - return (await encodeText(body)).byteLength; - } - }; - const resolveBodyLength = async (headers, body) => { - const length = utils$1.toFiniteNumber(headers.getContentLength()); - return length == null ? getBodyLength(body) : length; - }; - return async (config) => { - let { - url: url2, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = "same-origin", - fetchOptions - } = resolveConfig(config); - let _fetch = envFetch || fetch; - responseType = responseType ? (responseType + "").toLowerCase() : "text"; - let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); - let request = null; - const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { - composedSignal.unsubscribe(); - }); - let requestContentLength; - try { - if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { - let _request = new Request(url2, { - method: "POST", - body: data, - duplex: "half" - }); - let contentTypeHeader; - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - const [onProgress, flush] = progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - ); - data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); - } - } - if (!utils$1.isString(withCredentials)) { - withCredentials = withCredentials ? "include" : "omit"; - } - const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; - const resolvedOptions = { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: headers.normalize().toJSON(), - body: data, - duplex: "half", - credentials: isCredentialsSupported ? withCredentials : void 0 - }; - request = isRequestSupported && new Request(url2, resolvedOptions); - let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions)); - const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { - const options = {}; - ["status", "statusText", "headers"].forEach((prop) => { - options[prop] = response[prop]; - }); - const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length")); - const [onProgress, flush] = onDownloadProgress && progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - ) || []; - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); - } - responseType = responseType || "text"; - let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config); - !isStreamResponse && unsubscribe && unsubscribe(); - return await new Promise((resolve2, reject) => { - settle(resolve2, reject, { - data: responseData, - headers: AxiosHeaders$1.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { - throw Object.assign( - new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request), - { - cause: err.cause || err - } - ); - } - throw AxiosError.from(err, err && err.code, config, request); - } - }; - }; - var seedCache = /* @__PURE__ */ new Map(); - var getFetch = (config) => { - let env = config && config.env || {}; - const { fetch: fetch2, Request, Response } = env; - const seeds = [ - Request, - Response, - fetch2 - ]; - let len = seeds.length, i = len, seed, target, map = seedCache; - while (i--) { - seed = seeds[i]; - target = map.get(seed); - target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); - map = target; - } - return target; - }; - getFetch(); - var knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: getFetch - } - }; - utils$1.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - Object.defineProperty(fn, "name", { value }); - } catch (e) { - } - Object.defineProperty(fn, "adapterName", { value }); - } - }); - var renderReason = (reason) => `- ${reason}`; - var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; - function getAdapter(adapters2, config) { - adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2]; - const { length } = adapters2; - let nameOrAdapter; - let adapter; - const rejectedReasons = {}; - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters2[i]; - let id; - adapter = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - if (adapter === void 0) { - throw new AxiosError(`Unknown adapter '${id}'`); - } - } - if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - rejectedReasons[id || "#" + i] = adapter; - } - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") - ); - let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; - throw new AxiosError( - `There is no suitable adapter to dispatch the request ` + s, - "ERR_NOT_SUPPORT" - ); - } - return adapter; - } - var adapters = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter, - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters - }; - function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); - } - } - function dispatchRequest(config) { - throwIfCancellationRequested(config); - config.headers = AxiosHeaders$1.from(config.headers); - config.data = transformData.call( - config, - config.transformRequest - ); - if (["post", "put", "patch"].indexOf(config.method) !== -1) { - config.headers.setContentType("application/x-www-form-urlencoded", false); - } - const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - response.data = transformData.call( - config, - config.transformResponse, - response - ); - response.headers = AxiosHeaders$1.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - reason.response.headers = AxiosHeaders$1.from(reason.response.headers); - } - } - return Promise.reject(reason); - }); - } - var validators$1 = {}; - ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => { - validators$1[type] = function validator2(thing) { - return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; - }; - }); - var deprecatedWarnings = {}; - validators$1.transitional = function transitional(validator2, version, message) { - function formatMessage(opt, desc) { - return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); - } - return (value, opt, opts) => { - if (validator2 === false) { - throw new AxiosError( - formatMessage(opt, " has been removed" + (version ? " in " + version : "")), - AxiosError.ERR_DEPRECATED - ); - } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - console.warn( - formatMessage( - opt, - " has been deprecated since v" + version + " and will be removed in the near future" - ) - ); - } - return validator2 ? validator2(value, opt, opts) : true; - }; - }; - validators$1.spelling = function spelling(correctSpelling) { - return (value, opt) => { - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; - }; - function assertOptions(options, schema, allowUnknown) { - if (typeof options !== "object") { - throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - const validator2 = schema[opt]; - if (validator2) { - const value = options[opt]; - const result = value === void 0 || validator2(value, opt, options); - if (result !== true) { - throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); - } - } - } - var validator = { - assertOptions, - validators: validators$1 - }; - var validators = validator.validators; - var Axios = class { - constructor(instanceConfig) { - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager$1(), - response: new InterceptorManager$1() - }; - } - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; - try { - if (!err.stack) { - err.stack = stack; - } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { - err.stack += "\n" + stack; - } - } catch (e) { - } - } - throw err; - } - } - _request(configOrUrl, config) { - if (typeof configOrUrl === "string") { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - config = mergeConfig(this.defaults, config); - const { transitional, paramsSerializer, headers } = config; - if (transitional !== void 0) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) - }, false); - } - if (paramsSerializer != null) { - if (utils$1.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer - }; - } else { - validator.assertOptions(paramsSerializer, { - encode: validators.function, - serialize: validators.function - }, true); - } - } - if (config.allowAbsoluteUrls !== void 0) ; - else if (this.defaults.allowAbsoluteUrls !== void 0) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - validator.assertOptions(config, { - baseUrl: validators.spelling("baseURL"), - withXsrfToken: validators.spelling("withXSRFToken") - }, true); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); - let contextHeaders = headers && utils$1.merge( - headers.common, - headers[config.method] - ); - headers && utils$1.forEach( - ["delete", "get", "head", "post", "put", "patch", "common"], - (method) => { - delete headers[method]; - } - ); - config.headers = AxiosHeaders$1.concat(contextHeaders, headers); - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - let promise; - let i = 0; - let len; - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), void 0]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config); - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - return promise; - } - len = requestInterceptorChain.length; - let newConfig = config; - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected.call(this, error); - break; - } - } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - return Promise.reject(error); - } - i = 0; - len = responseInterceptorChain.length; - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - return promise; - } - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - return buildURL(fullPath, config.params, config.paramsSerializer); - } - }; - utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { - Axios.prototype[method] = function(url2, config) { - return this.request(mergeConfig(config || {}, { - method, - url: url2, - data: (config || {}).data - })); - }; - }); - utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url2, data, config) { - return this.request(mergeConfig(config || {}, { - method, - headers: isForm ? { - "Content-Type": "multipart/form-data" - } : {}, - url: url2, - data - })); - }; - } - Axios.prototype[method] = generateHTTPMethod(); - Axios.prototype[method + "Form"] = generateHTTPMethod(true); - }); - var Axios$1 = Axios; - var CancelToken = class _CancelToken { - constructor(executor) { - if (typeof executor !== "function") { - throw new TypeError("executor must be a function."); - } - let resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve2) { - resolvePromise = resolve2; - }); - const token = this; - this.promise.then((cancel) => { - if (!token._listeners) return; - let i = token._listeners.length; - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - this.promise.then = (onfulfilled) => { - let _resolve; - const promise = new Promise((resolve2) => { - token.subscribe(resolve2); - _resolve = resolve2; - }).then(onfulfilled); - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - return promise; - }; - executor(function cancel(message, config, request) { - if (token.reason) { - return; - } - token.reason = new CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - /** - * Subscribe to the cancel signal - */ - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - /** - * Unsubscribe from the cancel signal - */ - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - toAbortSignal() { - const controller = new AbortController(); - const abort = (err) => { - controller.abort(err); - }; - this.subscribe(abort); - controller.signal.unsubscribe = () => this.unsubscribe(abort); - return controller.signal; - } - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new _CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel - }; - } - }; - var CancelToken$1 = CancelToken; - function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; - } - function isAxiosError(payload) { - return utils$1.isObject(payload) && payload.isAxiosError === true; - } - var HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526 - }; - Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; - }); - var HttpStatusCode$1 = HttpStatusCode; - function createInstance(defaultConfig) { - const context = new Axios$1(defaultConfig); - const instance = bind(Axios$1.prototype.request, context); - utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true }); - utils$1.extend(instance, context, null, { allOwnKeys: true }); - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance; - } - var axios = createInstance(defaults$1); - axios.Axios = Axios$1; - axios.CanceledError = CanceledError; - axios.CancelToken = CancelToken$1; - axios.isCancel = isCancel; - axios.VERSION = VERSION; - axios.toFormData = toFormData; - axios.AxiosError = AxiosError; - axios.Cancel = axios.CanceledError; - axios.all = function all(promises2) { - return Promise.all(promises2); - }; - axios.spread = spread; - axios.isAxiosError = isAxiosError; - axios.mergeConfig = mergeConfig; - axios.AxiosHeaders = AxiosHeaders$1; - axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); - axios.getAdapter = adapters.getAdapter; - axios.HttpStatusCode = HttpStatusCode$1; - axios.default = axios; - module2.exports = axios; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js -var require_base = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.operationServerMap = exports2.RequiredError = exports2.BaseAPI = exports2.COLLECTION_FORMATS = exports2.BASE_PATH = void 0; - var axios_1 = require_axios(); - exports2.BASE_PATH = "http://localhost".replace(/\/+$/, ""); - exports2.COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: " ", - pipes: "|" - }; - var BaseAPI = class { - constructor(configuration, basePath = exports2.BASE_PATH, axios = axios_1.default) { - var _a; - this.basePath = basePath; - this.axios = axios; - if (configuration) { - this.configuration = configuration; - this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath; - } - } - }; - exports2.BaseAPI = BaseAPI; - var RequiredError = class extends Error { - constructor(field, msg) { - super(msg); - this.field = field; - this.name = "RequiredError"; - } - }; - exports2.RequiredError = RequiredError; - exports2.operationServerMap = {}; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js -var require_common2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createRequestFunction = exports2.toPathString = exports2.serializeDataIfNeeded = exports2.setSearchParams = exports2.setOAuthToObject = exports2.setBearerAuthToObject = exports2.setBasicAuthToObject = exports2.setApiKeyToObject = exports2.assertParamExists = exports2.DUMMY_BASE_URL = void 0; - var base_1 = require_base(); - exports2.DUMMY_BASE_URL = "https://example.com"; - var assertParamExists = function(functionName, paramName, paramValue) { - if (paramValue === null || paramValue === void 0) { - throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } - }; - exports2.assertParamExists = assertParamExists; - var setApiKeyToObject = function(object, keyParamName, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === "function" ? yield configuration.apiKey(keyParamName) : yield configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } - }); - }; - exports2.setApiKeyToObject = setApiKeyToObject; - var setBasicAuthToObject = function(object, configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } - }; - exports2.setBasicAuthToObject = setBasicAuthToObject; - var setBearerAuthToObject = function(object, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === "function" ? yield configuration.accessToken() : yield configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } - }); - }; - exports2.setBearerAuthToObject = setBearerAuthToObject; - var setOAuthToObject = function(object, name, scopes, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === "function" ? yield configuration.accessToken(name, scopes) : yield configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - }); - }; - exports2.setOAuthToObject = setOAuthToObject; - function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { - if (parameter == null) - return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key)); - } else { - Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)); - } - } else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } else { - urlSearchParams.set(key, parameter); - } - } - } - var setSearchParams = function(url, ...objects) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); - }; - exports2.setSearchParams = setSearchParams; - var serializeDataIfNeeded = function(value, requestOptions, configuration) { - const nonString = typeof value !== "string"; - const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString; - return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}) : value || ""; - }; - exports2.serializeDataIfNeeded = serializeDataIfNeeded; - var toPathString = function(url) { - return url.pathname + url.search + url.hash; - }; - exports2.toPathString = toPathString; - var createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) { - return (axios = globalAxios, basePath = BASE_PATH) => { - var _a; - const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? "" : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url }); - return axios.request(axiosRequestArgs); - }; - }; - exports2.createRequestFunction = createRequestFunction; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js -var require_health_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HealthApi = exports2.HealthApiFactory = exports2.HealthApiFp = exports2.HealthApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var HealthApiAxiosParamCreator = function(configuration) { - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/v1/health`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator; - var HealthApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.HealthApiAxiosParamCreator)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.health(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["HealthApi.health"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.HealthApiFp = HealthApiFp; - var HealthApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.HealthApiFp)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health(options) { - return localVarFp.health(options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.HealthApiFactory = HealthApiFactory; - var HealthApi = class extends base_1.BaseAPI { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof HealthApi - */ - health(options) { - return (0, exports2.HealthApiFp)(this.configuration).health(options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.HealthApi = HealthApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js -var require_metrics_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MetricsApi = exports2.MetricsApiFactory = exports2.MetricsApiFp = exports2.MetricsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var MetricsApiAxiosParamCreator = function(configuration) { - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/metrics`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail: (metricName_1, ...args_1) => __awaiter(this, [metricName_1, ...args_1], void 0, function* (metricName, options = {}) { - (0, common_1.assertParamExists)("metricDetail", "metricName", metricName); - const localVarPath = `/metrics/{metric_name}`.replace(`{${"metric_name"}}`, encodeURIComponent(String(metricName))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/debug/metrics/scrape`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.MetricsApiAxiosParamCreator = MetricsApiAxiosParamCreator; - var MetricsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.MetricsApiAxiosParamCreator)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listMetrics(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.listMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail(metricName, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.metricDetail(metricName, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.metricDetail"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.scrapeMetrics(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.scrapeMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.MetricsApiFp = MetricsApiFp; - var MetricsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.MetricsApiFp)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics(options) { - return localVarFp.listMetrics(options).then((request) => request(axios, basePath)); - }, - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail(metricName, options) { - return localVarFp.metricDetail(metricName, options).then((request) => request(axios, basePath)); - }, - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics(options) { - return localVarFp.scrapeMetrics(options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.MetricsApiFactory = MetricsApiFactory; - var MetricsApi = class extends base_1.BaseAPI { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - listMetrics(options) { - return (0, exports2.MetricsApiFp)(this.configuration).listMetrics(options).then((request) => request(this.axios, this.basePath)); - } - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - metricDetail(metricName, options) { - return (0, exports2.MetricsApiFp)(this.configuration).metricDetail(metricName, options).then((request) => request(this.axios, this.basePath)); - } - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - scrapeMetrics(options) { - return (0, exports2.MetricsApiFp)(this.configuration).scrapeMetrics(options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.MetricsApi = MetricsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js -var require_notifications_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.NotificationsApi = exports2.NotificationsApiFactory = exports2.NotificationsApiFp = exports2.NotificationsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var NotificationsApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification: (notificationCreateRequest_1, ...args_1) => __awaiter(this, [notificationCreateRequest_1, ...args_1], void 0, function* (notificationCreateRequest, options = {}) { - (0, common_1.assertParamExists)("createNotification", "notificationCreateRequest", notificationCreateRequest); - const localVarPath = `/api/v1/notifications`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationCreateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { - (0, common_1.assertParamExists)("deleteNotification", "notificationId", notificationId); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { - (0, common_1.assertParamExists)("getNotification", "notificationId", notificationId); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/notifications`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification: (notificationId_1, notificationUpdateRequest_1, ...args_1) => __awaiter(this, [notificationId_1, notificationUpdateRequest_1, ...args_1], void 0, function* (notificationId, notificationUpdateRequest, options = {}) { - (0, common_1.assertParamExists)("updateNotification", "notificationId", notificationId); - (0, common_1.assertParamExists)("updateNotification", "notificationUpdateRequest", notificationUpdateRequest); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationUpdateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.NotificationsApiAxiosParamCreator = NotificationsApiAxiosParamCreator; - var NotificationsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.NotificationsApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification(notificationCreateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createNotification(notificationCreateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.createNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification(notificationId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteNotification(notificationId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.deleteNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification(notificationId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getNotification(notificationId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.getNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listNotifications(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.listNotifications"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateNotification(notificationId, notificationUpdateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.updateNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.NotificationsApiFp = NotificationsApiFp; - var NotificationsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.NotificationsApiFp)(configuration); - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification(notificationCreateRequest, options) { - return localVarFp.createNotification(notificationCreateRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification(notificationId, options) { - return localVarFp.deleteNotification(notificationId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification(notificationId, options) { - return localVarFp.getNotification(notificationId, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications(page, perPage, options) { - return localVarFp.listNotifications(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return localVarFp.updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.NotificationsApiFactory = NotificationsApiFactory; - var NotificationsApi = class extends base_1.BaseAPI { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - createNotification(notificationCreateRequest, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).createNotification(notificationCreateRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - deleteNotification(notificationId, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).deleteNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - getNotification(notificationId, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).getNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - listNotifications(page, perPage, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).listNotifications(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.NotificationsApi = NotificationsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js -var require_plugins_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PluginsApi = exports2.PluginsApiFactory = exports2.PluginsApiFp = exports2.PluginsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var PluginsApiAxiosParamCreator = function(configuration) { - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin: (pluginId_1, pluginCallRequest_1, ...args_1) => __awaiter(this, [pluginId_1, pluginCallRequest_1, ...args_1], void 0, function* (pluginId, pluginCallRequest, options = {}) { - (0, common_1.assertParamExists)("callPlugin", "pluginId", pluginId); - (0, common_1.assertParamExists)("callPlugin", "pluginCallRequest", pluginCallRequest); - const localVarPath = `/api/v1/plugins/{plugin_id}/call`.replace(`{${"plugin_id"}}`, encodeURIComponent(String(pluginId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(pluginCallRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.PluginsApiAxiosParamCreator = PluginsApiAxiosParamCreator; - var PluginsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.PluginsApiAxiosParamCreator)(configuration); - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin(pluginId, pluginCallRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.callPlugin(pluginId, pluginCallRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["PluginsApi.callPlugin"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.PluginsApiFp = PluginsApiFp; - var PluginsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.PluginsApiFp)(configuration); - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin(pluginId, pluginCallRequest, options) { - return localVarFp.callPlugin(pluginId, pluginCallRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.PluginsApiFactory = PluginsApiFactory; - var PluginsApi = class extends base_1.BaseAPI { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PluginsApi - */ - callPlugin(pluginId, pluginCallRequest, options) { - return (0, exports2.PluginsApiFp)(this.configuration).callPlugin(pluginId, pluginCallRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.PluginsApi = PluginsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js -var require_relayers_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RelayersApi = exports2.RelayersApiFactory = exports2.RelayersApiFp = exports2.RelayersApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var RelayersApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { - (0, common_1.assertParamExists)("cancelTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("cancelTransaction", "transactionId", transactionId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer: (createRelayerRequest_1, ...args_1) => __awaiter(this, [createRelayerRequest_1, ...args_1], void 0, function* (createRelayerRequest, options = {}) { - (0, common_1.assertParamExists)("createRelayer", "createRelayerRequest", createRelayerRequest); - const localVarPath = `/api/v1/relayers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createRelayerRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("deletePendingTransactions", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/pending`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("deleteRelayer", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayer", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayerBalance", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/balance`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayerStatus", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/status`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { - (0, common_1.assertParamExists)("getTransactionById", "relayerId", relayerId); - (0, common_1.assertParamExists)("getTransactionById", "transactionId", transactionId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce: (relayerId_1, nonce_1, ...args_1) => __awaiter(this, [relayerId_1, nonce_1, ...args_1], void 0, function* (relayerId, nonce, options = {}) { - (0, common_1.assertParamExists)("getTransactionByNonce", "relayerId", relayerId); - (0, common_1.assertParamExists)("getTransactionByNonce", "nonce", nonce); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/by-nonce/{nonce}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"nonce"}}`, encodeURIComponent(String(nonce))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/relayers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions: (relayerId_1, page_1, perPage_1, ...args_1) => __awaiter(this, [relayerId_1, page_1, perPage_1, ...args_1], void 0, function* (relayerId, page, perPage, options = {}) { - (0, common_1.assertParamExists)("listTransactions", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction: (relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, transactionId, networkTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("replaceTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("replaceTransaction", "transactionId", transactionId); - (0, common_1.assertParamExists)("replaceTransaction", "networkTransactionRequest", networkTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PUT" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc: (relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1) => __awaiter(this, [relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1], void 0, function* (relayerId, jsonRpcRequestNetworkRpcRequest, options = {}) { - (0, common_1.assertParamExists)("rpc", "relayerId", relayerId); - (0, common_1.assertParamExists)("rpc", "jsonRpcRequestNetworkRpcRequest", jsonRpcRequestNetworkRpcRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/rpc`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(jsonRpcRequestNetworkRpcRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction: (relayerId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, networkTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("sendTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("sendTransaction", "networkTransactionRequest", networkTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign: (relayerId_1, signDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signDataRequest_1, ...args_1], void 0, function* (relayerId, signDataRequest, options = {}) { - (0, common_1.assertParamExists)("sign", "relayerId", relayerId); - (0, common_1.assertParamExists)("sign", "signDataRequest", signDataRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signDataRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction: (relayerId_1, signTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTransactionRequest_1, ...args_1], void 0, function* (relayerId, signTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("signTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("signTransaction", "signTransactionRequest", signTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign-transaction`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData: (relayerId_1, signTypedDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTypedDataRequest_1, ...args_1], void 0, function* (relayerId, signTypedDataRequest, options = {}) { - (0, common_1.assertParamExists)("signTypedData", "relayerId", relayerId); - (0, common_1.assertParamExists)("signTypedData", "signTypedDataRequest", signTypedDataRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign-typed-data`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTypedDataRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer: (relayerId_1, updateRelayerRequest_1, ...args_1) => __awaiter(this, [relayerId_1, updateRelayerRequest_1, ...args_1], void 0, function* (relayerId, updateRelayerRequest, options = {}) { - (0, common_1.assertParamExists)("updateRelayer", "relayerId", relayerId); - (0, common_1.assertParamExists)("updateRelayer", "updateRelayerRequest", updateRelayerRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateRelayerRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.RelayersApiAxiosParamCreator = RelayersApiAxiosParamCreator; - var RelayersApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.RelayersApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction(relayerId, transactionId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelTransaction(relayerId, transactionId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.cancelTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer(createRelayerRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createRelayer(createRelayerRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.createRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePendingTransactions(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deletePendingTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteRelayer(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deleteRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayer(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerBalance(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerBalance"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerStatus(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerStatus"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById(relayerId, transactionId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionById(relayerId, transactionId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionById"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce(relayerId, nonce, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionByNonce(relayerId, nonce, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionByNonce"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listRelayers(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listRelayers"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions(relayerId, page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listTransactions(relayerId, page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.replaceTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.rpc"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.sendTransaction(relayerId, networkTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sendTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign(relayerId, signDataRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.sign(relayerId, signDataRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sign"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction(relayerId, signTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.signTransaction(relayerId, signTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.signTypedData(relayerId, signTypedDataRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTypedData"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateRelayer(relayerId, updateRelayerRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.updateRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.RelayersApiFp = RelayersApiFp; - var RelayersApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.RelayersApiFp)(configuration); - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction(relayerId, transactionId, options) { - return localVarFp.cancelTransaction(relayerId, transactionId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer(createRelayerRequest, options) { - return localVarFp.createRelayer(createRelayerRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions(relayerId, options) { - return localVarFp.deletePendingTransactions(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer(relayerId, options) { - return localVarFp.deleteRelayer(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer(relayerId, options) { - return localVarFp.getRelayer(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance(relayerId, options) { - return localVarFp.getRelayerBalance(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus(relayerId, options) { - return localVarFp.getRelayerStatus(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById(relayerId, transactionId, options) { - return localVarFp.getTransactionById(relayerId, transactionId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce(relayerId, nonce, options) { - return localVarFp.getTransactionByNonce(relayerId, nonce, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers(page, perPage, options) { - return localVarFp.listRelayers(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions(relayerId, page, perPage, options) { - return localVarFp.listTransactions(relayerId, page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return localVarFp.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return localVarFp.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return localVarFp.sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign(relayerId, signDataRequest, options) { - return localVarFp.sign(relayerId, signDataRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction(relayerId, signTransactionRequest, options) { - return localVarFp.signTransaction(relayerId, signTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return localVarFp.signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return localVarFp.updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.RelayersApiFactory = RelayersApiFactory; - var RelayersApi = class extends base_1.BaseAPI { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - cancelTransaction(relayerId, transactionId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).cancelTransaction(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - createRelayer(createRelayerRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).createRelayer(createRelayerRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - deletePendingTransactions(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).deletePendingTransactions(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - deleteRelayer(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).deleteRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayer(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayerBalance(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayerBalance(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayerStatus(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayerStatus(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getTransactionById(relayerId, transactionId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getTransactionById(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getTransactionByNonce(relayerId, nonce, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getTransactionByNonce(relayerId, nonce, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - listRelayers(page, perPage, options) { - return (0, exports2.RelayersApiFp)(this.configuration).listRelayers(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - listTransactions(relayerId, page, perPage, options) { - return (0, exports2.RelayersApiFp)(this.configuration).listTransactions(relayerId, page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - sign(relayerId, signDataRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).sign(relayerId, signDataRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - signTransaction(relayerId, signTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).signTransaction(relayerId, signTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.RelayersApi = RelayersApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js -var require_signers_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignersApi = exports2.SignersApiFactory = exports2.SignersApiFp = exports2.SignersApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var SignersApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner: (signerCreateRequest_1, ...args_1) => __awaiter(this, [signerCreateRequest_1, ...args_1], void 0, function* (signerCreateRequest, options = {}) { - (0, common_1.assertParamExists)("createSigner", "signerCreateRequest", signerCreateRequest); - const localVarPath = `/api/v1/signers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signerCreateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { - (0, common_1.assertParamExists)("deleteSigner", "signerId", signerId); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { - (0, common_1.assertParamExists)("getSigner", "signerId", signerId); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/signers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner: (signerId_1, requestBody_1, ...args_1) => __awaiter(this, [signerId_1, requestBody_1, ...args_1], void 0, function* (signerId, requestBody, options = {}) { - (0, common_1.assertParamExists)("updateSigner", "signerId", signerId); - (0, common_1.assertParamExists)("updateSigner", "requestBody", requestBody); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(requestBody, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.SignersApiAxiosParamCreator = SignersApiAxiosParamCreator; - var SignersApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.SignersApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner(signerCreateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createSigner(signerCreateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.createSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner(signerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteSigner(signerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.deleteSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner(signerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getSigner(signerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.getSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listSigners(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.listSigners"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner(signerId, requestBody, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateSigner(signerId, requestBody, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.updateSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.SignersApiFp = SignersApiFp; - var SignersApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.SignersApiFp)(configuration); - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner(signerCreateRequest, options) { - return localVarFp.createSigner(signerCreateRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner(signerId, options) { - return localVarFp.deleteSigner(signerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner(signerId, options) { - return localVarFp.getSigner(signerId, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners(page, perPage, options) { - return localVarFp.listSigners(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner(signerId, requestBody, options) { - return localVarFp.updateSigner(signerId, requestBody, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.SignersApiFactory = SignersApiFactory; - var SignersApi = class extends base_1.BaseAPI { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - createSigner(signerCreateRequest, options) { - return (0, exports2.SignersApiFp)(this.configuration).createSigner(signerCreateRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - deleteSigner(signerId, options) { - return (0, exports2.SignersApiFp)(this.configuration).deleteSigner(signerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - getSigner(signerId, options) { - return (0, exports2.SignersApiFp)(this.configuration).getSigner(signerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - listSigners(page, perPage, options) { - return (0, exports2.SignersApiFp)(this.configuration).listSigners(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - updateSigner(signerId, requestBody, options) { - return (0, exports2.SignersApiFp)(this.configuration).updateSigner(signerId, requestBody, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.SignersApi = SignersApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js -var require_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_health_api(), exports2); - __exportStar(require_metrics_api(), exports2); - __exportStar(require_notifications_api(), exports2); - __exportStar(require_plugins_api(), exports2); - __exportStar(require_relayers_api(), exports2); - __exportStar(require_signers_api(), exports2); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js -var require_configuration = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Configuration = void 0; - var Configuration = class { - constructor(param = {}) { - var _a; - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) }); - this.formDataCtor = param.formDataCtor; - } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - isJsonMime(mime) { - const jsonMime = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i"); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === "application/json-patch+json"); - } - }; - exports2.Configuration = Configuration; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js -var require_api_response_balance_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js -var require_api_response_balance_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js -var require_api_response_delete_pending_transactions_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js -var require_api_response_delete_pending_transactions_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js -var require_api_response_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js -var require_api_response_notification_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js -var require_api_response_plugin_handler_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js -var require_api_response_plugin_handler_error_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js -var require_api_response_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js -var require_api_response_relayer_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js -var require_api_response_relayer_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js -var require_api_response_relayer_status_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js -var require_api_response_relayer_status_data_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOfNetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2["EVM"] = "evm"; - })(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js -var require_api_response_relayer_status_data_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2["STELLAR"] = "stellar"; - })(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js -var require_api_response_relayer_status_data_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2["SOLANA"] = "solana"; - })(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js -var require_api_response_sign_data_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js -var require_api_response_sign_data_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js -var require_api_response_sign_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js -var require_api_response_sign_transaction_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js -var require_api_response_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js -var require_api_response_signer_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js -var require_api_response_string = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js -var require_api_response_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js -var require_api_response_transaction_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js -var require_api_response_value = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js -var require_api_response_vec_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js -var require_api_response_vec_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js -var require_api_response_vec_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js -var require_api_response_vec_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js -var require_asset_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js -var require_asset_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOfTypeEnum = void 0; - var AssetSpecOneOfTypeEnum; - (function(AssetSpecOneOfTypeEnum2) { - AssetSpecOneOfTypeEnum2["NATIVE"] = "native"; - })(AssetSpecOneOfTypeEnum || (exports2.AssetSpecOneOfTypeEnum = AssetSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js -var require_asset_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOf1TypeEnum = void 0; - var AssetSpecOneOf1TypeEnum; - (function(AssetSpecOneOf1TypeEnum2) { - AssetSpecOneOf1TypeEnum2["CREDIT4"] = "credit4"; - })(AssetSpecOneOf1TypeEnum || (exports2.AssetSpecOneOf1TypeEnum = AssetSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js -var require_asset_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOf2TypeEnum = void 0; - var AssetSpecOneOf2TypeEnum; - (function(AssetSpecOneOf2TypeEnum2) { - AssetSpecOneOf2TypeEnum2["CREDIT12"] = "credit12"; - })(AssetSpecOneOf2TypeEnum || (exports2.AssetSpecOneOf2TypeEnum = AssetSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js -var require_auth_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js -var require_auth_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOfTypeEnum = void 0; - var AuthSpecOneOfTypeEnum; - (function(AuthSpecOneOfTypeEnum2) { - AuthSpecOneOfTypeEnum2["NONE"] = "none"; - })(AuthSpecOneOfTypeEnum || (exports2.AuthSpecOneOfTypeEnum = AuthSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js -var require_auth_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf1TypeEnum = void 0; - var AuthSpecOneOf1TypeEnum; - (function(AuthSpecOneOf1TypeEnum2) { - AuthSpecOneOf1TypeEnum2["SOURCE_ACCOUNT"] = "source_account"; - })(AuthSpecOneOf1TypeEnum || (exports2.AuthSpecOneOf1TypeEnum = AuthSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js -var require_auth_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf2TypeEnum = void 0; - var AuthSpecOneOf2TypeEnum; - (function(AuthSpecOneOf2TypeEnum2) { - AuthSpecOneOf2TypeEnum2["ADDRESSES"] = "addresses"; - })(AuthSpecOneOf2TypeEnum || (exports2.AuthSpecOneOf2TypeEnum = AuthSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js -var require_auth_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf3TypeEnum = void 0; - var AuthSpecOneOf3TypeEnum; - (function(AuthSpecOneOf3TypeEnum2) { - AuthSpecOneOf3TypeEnum2["XDR"] = "xdr"; - })(AuthSpecOneOf3TypeEnum || (exports2.AuthSpecOneOf3TypeEnum = AuthSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js -var require_aws_kms_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js -var require_balance_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js -var require_cdp_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js -var require_contract_source = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js -var require_contract_source_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContractSourceOneOfFromEnum = void 0; - var ContractSourceOneOfFromEnum; - (function(ContractSourceOneOfFromEnum2) { - ContractSourceOneOfFromEnum2["ADDRESS"] = "address"; - })(ContractSourceOneOfFromEnum || (exports2.ContractSourceOneOfFromEnum = ContractSourceOneOfFromEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js -var require_contract_source_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContractSourceOneOf1FromEnum = void 0; - var ContractSourceOneOf1FromEnum; - (function(ContractSourceOneOf1FromEnum2) { - ContractSourceOneOf1FromEnum2["CONTRACT"] = "contract"; - })(ContractSourceOneOf1FromEnum || (exports2.ContractSourceOneOf1FromEnum = ContractSourceOneOf1FromEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js -var require_create_relayer_policy_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js -var require_create_relayer_policy_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js -var require_create_relayer_policy_request_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js -var require_create_relayer_policy_request_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js -var require_create_relayer_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js -var require_delete_pending_transactions_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js -var require_disabled_reason = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js -var require_disabled_reason_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOfTypeEnum = void 0; - var DisabledReasonOneOfTypeEnum; - (function(DisabledReasonOneOfTypeEnum2) { - DisabledReasonOneOfTypeEnum2["NONCE_SYNC_FAILED"] = "NonceSyncFailed"; - })(DisabledReasonOneOfTypeEnum || (exports2.DisabledReasonOneOfTypeEnum = DisabledReasonOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js -var require_disabled_reason_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf1TypeEnum = void 0; - var DisabledReasonOneOf1TypeEnum; - (function(DisabledReasonOneOf1TypeEnum2) { - DisabledReasonOneOf1TypeEnum2["RPC_VALIDATION_FAILED"] = "RpcValidationFailed"; - })(DisabledReasonOneOf1TypeEnum || (exports2.DisabledReasonOneOf1TypeEnum = DisabledReasonOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js -var require_disabled_reason_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf2TypeEnum = void 0; - var DisabledReasonOneOf2TypeEnum; - (function(DisabledReasonOneOf2TypeEnum2) { - DisabledReasonOneOf2TypeEnum2["BALANCE_CHECK_FAILED"] = "BalanceCheckFailed"; - })(DisabledReasonOneOf2TypeEnum || (exports2.DisabledReasonOneOf2TypeEnum = DisabledReasonOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js -var require_disabled_reason_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf3TypeEnum = void 0; - var DisabledReasonOneOf3TypeEnum; - (function(DisabledReasonOneOf3TypeEnum2) { - DisabledReasonOneOf3TypeEnum2["SEQUENCE_SYNC_FAILED"] = "SequenceSyncFailed"; - })(DisabledReasonOneOf3TypeEnum || (exports2.DisabledReasonOneOf3TypeEnum = DisabledReasonOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js -var require_disabled_reason_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf4TypeEnum = void 0; - var DisabledReasonOneOf4TypeEnum; - (function(DisabledReasonOneOf4TypeEnum2) { - DisabledReasonOneOf4TypeEnum2["MULTIPLE"] = "Multiple"; - })(DisabledReasonOneOf4TypeEnum || (exports2.DisabledReasonOneOf4TypeEnum = DisabledReasonOneOf4TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js -var require_evm_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js -var require_evm_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js -var require_evm_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js -var require_evm_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js -var require_evm_transaction_data_signature = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js -var require_evm_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js -var require_evm_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js -var require_fee_estimate_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js -var require_fee_estimate_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js -var require_get_features_enabled_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js -var require_get_supported_tokens_item = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js -var require_get_supported_tokens_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js -var require_google_cloud_kms_signer_key_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js -var require_google_cloud_kms_signer_key_response_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js -var require_google_cloud_kms_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js -var require_google_cloud_kms_signer_service_account_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js -var require_google_cloud_kms_signer_service_account_response_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js -var require_json_rpc_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js -var require_json_rpc_id = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js -var require_json_rpc_request_network_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js -var require_json_rpc_response_network_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js -var require_json_rpc_response_network_rpc_result_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js -var require_jupiter_swap_options = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js -var require_local_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js -var require_log_entry = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js -var require_log_level = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LogLevel = void 0; - var LogLevel; - (function(LogLevel2) { - LogLevel2["LOG"] = "log"; - LogLevel2["INFO"] = "info"; - LogLevel2["ERROR"] = "error"; - LogLevel2["WARN"] = "warn"; - LogLevel2["DEBUG"] = "debug"; - LogLevel2["RESULT"] = "result"; - })(LogLevel || (exports2.LogLevel = LogLevel = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js -var require_memo_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js -var require_memo_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOfTypeEnum = void 0; - var MemoSpecOneOfTypeEnum; - (function(MemoSpecOneOfTypeEnum2) { - MemoSpecOneOfTypeEnum2["NONE"] = "none"; - })(MemoSpecOneOfTypeEnum || (exports2.MemoSpecOneOfTypeEnum = MemoSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js -var require_memo_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf1TypeEnum = void 0; - var MemoSpecOneOf1TypeEnum; - (function(MemoSpecOneOf1TypeEnum2) { - MemoSpecOneOf1TypeEnum2["TEXT"] = "text"; - })(MemoSpecOneOf1TypeEnum || (exports2.MemoSpecOneOf1TypeEnum = MemoSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js -var require_memo_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf2TypeEnum = void 0; - var MemoSpecOneOf2TypeEnum; - (function(MemoSpecOneOf2TypeEnum2) { - MemoSpecOneOf2TypeEnum2["ID"] = "id"; - })(MemoSpecOneOf2TypeEnum || (exports2.MemoSpecOneOf2TypeEnum = MemoSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js -var require_memo_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf3TypeEnum = void 0; - var MemoSpecOneOf3TypeEnum; - (function(MemoSpecOneOf3TypeEnum2) { - MemoSpecOneOf3TypeEnum2["HASH"] = "hash"; - })(MemoSpecOneOf3TypeEnum || (exports2.MemoSpecOneOf3TypeEnum = MemoSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js -var require_memo_spec_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf4TypeEnum = void 0; - var MemoSpecOneOf4TypeEnum; - (function(MemoSpecOneOf4TypeEnum2) { - MemoSpecOneOf4TypeEnum2["RETURN"] = "return"; - })(MemoSpecOneOf4TypeEnum || (exports2.MemoSpecOneOf4TypeEnum = MemoSpecOneOf4TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js -var require_network_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js -var require_network_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js -var require_network_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js -var require_network_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js -var require_notification_create_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js -var require_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js -var require_notification_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.NotificationType = void 0; - var NotificationType; - (function(NotificationType2) { - NotificationType2["WEBHOOK"] = "webhook"; - })(NotificationType || (exports2.NotificationType = NotificationType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js -var require_notification_update_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js -var require_operation_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js -var require_operation_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOfTypeEnum = void 0; - var OperationSpecOneOfTypeEnum; - (function(OperationSpecOneOfTypeEnum2) { - OperationSpecOneOfTypeEnum2["PAYMENT"] = "payment"; - })(OperationSpecOneOfTypeEnum || (exports2.OperationSpecOneOfTypeEnum = OperationSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js -var require_operation_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf1TypeEnum = void 0; - var OperationSpecOneOf1TypeEnum; - (function(OperationSpecOneOf1TypeEnum2) { - OperationSpecOneOf1TypeEnum2["INVOKE_CONTRACT"] = "invoke_contract"; - })(OperationSpecOneOf1TypeEnum || (exports2.OperationSpecOneOf1TypeEnum = OperationSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js -var require_operation_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf2TypeEnum = void 0; - var OperationSpecOneOf2TypeEnum; - (function(OperationSpecOneOf2TypeEnum2) { - OperationSpecOneOf2TypeEnum2["CREATE_CONTRACT"] = "create_contract"; - })(OperationSpecOneOf2TypeEnum || (exports2.OperationSpecOneOf2TypeEnum = OperationSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js -var require_operation_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf3TypeEnum = void 0; - var OperationSpecOneOf3TypeEnum; - (function(OperationSpecOneOf3TypeEnum2) { - OperationSpecOneOf3TypeEnum2["UPLOAD_WASM"] = "upload_wasm"; - })(OperationSpecOneOf3TypeEnum || (exports2.OperationSpecOneOf3TypeEnum = OperationSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js -var require_pagination_meta = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js -var require_plugin_call_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js -var require_plugin_handler_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js -var require_plugin_metadata = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js -var require_prepare_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js -var require_prepare_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js -var require_relayer_evm_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js -var require_relayer_network_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js -var require_relayer_network_policy_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js -var require_relayer_network_policy_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js -var require_relayer_network_policy_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js -var require_relayer_network_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js -var require_relayer_network_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RelayerNetworkType = void 0; - var RelayerNetworkType; - (function(RelayerNetworkType2) { - RelayerNetworkType2["EVM"] = "evm"; - RelayerNetworkType2["SOLANA"] = "solana"; - RelayerNetworkType2["STELLAR"] = "stellar"; - })(RelayerNetworkType || (exports2.RelayerNetworkType = RelayerNetworkType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js -var require_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js -var require_relayer_solana_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js -var require_relayer_solana_swap_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js -var require_relayer_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js -var require_relayer_stellar_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js -var require_rpc_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js -var require_sign_and_send_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js -var require_sign_and_send_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js -var require_sign_data_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js -var require_sign_data_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js -var require_sign_data_response_evm = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js -var require_sign_data_response_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js -var require_sign_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js -var require_sign_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js -var require_sign_transaction_request_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js -var require_sign_transaction_request_stellar = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js -var require_sign_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js -var require_sign_transaction_response_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js -var require_sign_transaction_response_stellar = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js -var require_sign_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js -var require_sign_typed_data_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js -var require_signer_config_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js -var require_signer_config_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js -var require_signer_config_response_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js -var require_signer_config_response_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js -var require_signer_config_response_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js -var require_signer_config_response_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js -var require_signer_config_response_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js -var require_signer_config_response_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js -var require_signer_create_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js -var require_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js -var require_signer_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignerType = void 0; - var SignerType; - (function(SignerType2) { - SignerType2["LOCAL"] = "local"; - SignerType2["AWS_KMS"] = "aws_kms"; - SignerType2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; - SignerType2["VAULT"] = "vault"; - SignerType2["VAULT_TRANSIT"] = "vault_transit"; - SignerType2["TURNKEY"] = "turnkey"; - SignerType2["CDP"] = "cdp"; - })(SignerType || (exports2.SignerType = SignerType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js -var require_signer_type_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignerTypeRequest = void 0; - var SignerTypeRequest; - (function(SignerTypeRequest2) { - SignerTypeRequest2["PLAIN"] = "plain"; - SignerTypeRequest2["AWS_KMS"] = "aws_kms"; - SignerTypeRequest2["VAULT"] = "vault"; - SignerTypeRequest2["VAULT_TRANSIT"] = "vault_transit"; - SignerTypeRequest2["TURNKEY"] = "turnkey"; - SignerTypeRequest2["CDP"] = "cdp"; - SignerTypeRequest2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; - })(SignerTypeRequest || (exports2.SignerTypeRequest = SignerTypeRequest = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js -var require_solana_account_meta = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js -var require_solana_allowed_tokens_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js -var require_solana_allowed_tokens_swap_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js -var require_solana_fee_payment_strategy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaFeePaymentStrategy = void 0; - var SolanaFeePaymentStrategy; - (function(SolanaFeePaymentStrategy2) { - SolanaFeePaymentStrategy2["USER"] = "user"; - SolanaFeePaymentStrategy2["RELAYER"] = "relayer"; - })(SolanaFeePaymentStrategy || (exports2.SolanaFeePaymentStrategy = SolanaFeePaymentStrategy = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js -var require_solana_instruction_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js -var require_solana_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js -var require_solana_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js -var require_solana_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOfMethodEnum = void 0; - var SolanaRpcRequestOneOfMethodEnum; - (function(SolanaRpcRequestOneOfMethodEnum2) { - SolanaRpcRequestOneOfMethodEnum2["FEE_ESTIMATE"] = "feeEstimate"; - })(SolanaRpcRequestOneOfMethodEnum || (exports2.SolanaRpcRequestOneOfMethodEnum = SolanaRpcRequestOneOfMethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js -var require_solana_rpc_request_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf1MethodEnum = void 0; - var SolanaRpcRequestOneOf1MethodEnum; - (function(SolanaRpcRequestOneOf1MethodEnum2) { - SolanaRpcRequestOneOf1MethodEnum2["TRANSFER_TRANSACTION"] = "transferTransaction"; - })(SolanaRpcRequestOneOf1MethodEnum || (exports2.SolanaRpcRequestOneOf1MethodEnum = SolanaRpcRequestOneOf1MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js -var require_solana_rpc_request_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf2MethodEnum = void 0; - var SolanaRpcRequestOneOf2MethodEnum; - (function(SolanaRpcRequestOneOf2MethodEnum2) { - SolanaRpcRequestOneOf2MethodEnum2["PREPARE_TRANSACTION"] = "prepareTransaction"; - })(SolanaRpcRequestOneOf2MethodEnum || (exports2.SolanaRpcRequestOneOf2MethodEnum = SolanaRpcRequestOneOf2MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js -var require_solana_rpc_request_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf3MethodEnum = void 0; - var SolanaRpcRequestOneOf3MethodEnum; - (function(SolanaRpcRequestOneOf3MethodEnum2) { - SolanaRpcRequestOneOf3MethodEnum2["SIGN_TRANSACTION"] = "signTransaction"; - })(SolanaRpcRequestOneOf3MethodEnum || (exports2.SolanaRpcRequestOneOf3MethodEnum = SolanaRpcRequestOneOf3MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js -var require_solana_rpc_request_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf4MethodEnum = void 0; - var SolanaRpcRequestOneOf4MethodEnum; - (function(SolanaRpcRequestOneOf4MethodEnum2) { - SolanaRpcRequestOneOf4MethodEnum2["SIGN_AND_SEND_TRANSACTION"] = "signAndSendTransaction"; - })(SolanaRpcRequestOneOf4MethodEnum || (exports2.SolanaRpcRequestOneOf4MethodEnum = SolanaRpcRequestOneOf4MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js -var require_solana_rpc_request_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf5MethodEnum = void 0; - var SolanaRpcRequestOneOf5MethodEnum; - (function(SolanaRpcRequestOneOf5MethodEnum2) { - SolanaRpcRequestOneOf5MethodEnum2["GET_SUPPORTED_TOKENS"] = "getSupportedTokens"; - })(SolanaRpcRequestOneOf5MethodEnum || (exports2.SolanaRpcRequestOneOf5MethodEnum = SolanaRpcRequestOneOf5MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js -var require_solana_rpc_request_one_of6 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf6MethodEnum = void 0; - var SolanaRpcRequestOneOf6MethodEnum; - (function(SolanaRpcRequestOneOf6MethodEnum2) { - SolanaRpcRequestOneOf6MethodEnum2["GET_FEATURES_ENABLED"] = "getFeaturesEnabled"; - })(SolanaRpcRequestOneOf6MethodEnum || (exports2.SolanaRpcRequestOneOf6MethodEnum = SolanaRpcRequestOneOf6MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js -var require_solana_rpc_request_one_of7 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf7MethodEnum = void 0; - var SolanaRpcRequestOneOf7MethodEnum; - (function(SolanaRpcRequestOneOf7MethodEnum2) { - SolanaRpcRequestOneOf7MethodEnum2["RAW_RPC_REQUEST"] = "rawRpcRequest"; - })(SolanaRpcRequestOneOf7MethodEnum || (exports2.SolanaRpcRequestOneOf7MethodEnum = SolanaRpcRequestOneOf7MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js -var require_solana_rpc_request_one_of7_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js -var require_solana_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js -var require_solana_rpc_result_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js -var require_solana_rpc_result_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js -var require_solana_rpc_result_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js -var require_solana_rpc_result_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js -var require_solana_rpc_result_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js -var require_solana_rpc_result_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js -var require_solana_rpc_result_one_of6 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js -var require_solana_rpc_result_one_of7 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcResultOneOf7MethodEnum = void 0; - var SolanaRpcResultOneOf7MethodEnum; - (function(SolanaRpcResultOneOf7MethodEnum2) { - SolanaRpcResultOneOf7MethodEnum2["RAW_RPC"] = "rawRpc"; - })(SolanaRpcResultOneOf7MethodEnum || (exports2.SolanaRpcResultOneOf7MethodEnum = SolanaRpcResultOneOf7MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js -var require_solana_swap_strategy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaSwapStrategy = void 0; - var SolanaSwapStrategy; - (function(SolanaSwapStrategy2) { - SolanaSwapStrategy2["JUPITER_SWAP"] = "jupiter-swap"; - SolanaSwapStrategy2["JUPITER_ULTRA"] = "jupiter-ultra"; - SolanaSwapStrategy2["NOOP"] = "noop"; - })(SolanaSwapStrategy || (exports2.SolanaSwapStrategy = SolanaSwapStrategy = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js -var require_solana_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js -var require_solana_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js -var require_speed = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Speed = void 0; - var Speed; - (function(Speed2) { - Speed2["FASTEST"] = "fastest"; - Speed2["FAST"] = "fast"; - Speed2["AVERAGE"] = "average"; - Speed2["SAFE_LOW"] = "safeLow"; - })(Speed || (exports2.Speed = Speed = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js -var require_stellar_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js -var require_stellar_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js -var require_stellar_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js -var require_stellar_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js -var require_stellar_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js -var require_stellar_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js -var require_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js -var require_transaction_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TransactionStatus = void 0; - var TransactionStatus2; - (function(TransactionStatus3) { - TransactionStatus3["CANCELED"] = "canceled"; - TransactionStatus3["PENDING"] = "pending"; - TransactionStatus3["SENT"] = "sent"; - TransactionStatus3["SUBMITTED"] = "submitted"; - TransactionStatus3["MINED"] = "mined"; - TransactionStatus3["CONFIRMED"] = "confirmed"; - TransactionStatus3["FAILED"] = "failed"; - TransactionStatus3["EXPIRED"] = "expired"; - })(TransactionStatus2 || (exports2.TransactionStatus = TransactionStatus2 = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js -var require_transfer_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js -var require_transfer_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js -var require_turnkey_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js -var require_update_relayer_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js -var require_vault_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js -var require_vault_transit_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js -var require_wasm_source = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js -var require_wasm_source_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js -var require_wasm_source_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js -var require_plugin_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PluginError = void 0; - exports2.pluginError = pluginError2; - var PluginError = class extends Error { - constructor(message, opts) { - super(message); - this.name = "PluginError"; - this.code = opts === null || opts === void 0 ? void 0 : opts.code; - this.status = opts === null || opts === void 0 ? void 0 : opts.status; - this.details = opts === null || opts === void 0 ? void 0 : opts.details; - } - }; - exports2.PluginError = PluginError; - function pluginError2(message, opts) { - return new PluginError(message, opts); - } - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js -var require_models = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_api_response_balance_response(), exports2); - __exportStar(require_api_response_balance_response_data(), exports2); - __exportStar(require_api_response_delete_pending_transactions_response(), exports2); - __exportStar(require_api_response_delete_pending_transactions_response_data(), exports2); - __exportStar(require_api_response_notification_response(), exports2); - __exportStar(require_api_response_notification_response_data(), exports2); - __exportStar(require_api_response_plugin_handler_error(), exports2); - __exportStar(require_api_response_plugin_handler_error_data(), exports2); - __exportStar(require_api_response_relayer_response(), exports2); - __exportStar(require_api_response_relayer_response_data(), exports2); - __exportStar(require_api_response_relayer_status(), exports2); - __exportStar(require_api_response_relayer_status_data(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of1(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of2(), exports2); - __exportStar(require_api_response_sign_data_response(), exports2); - __exportStar(require_api_response_sign_data_response_data(), exports2); - __exportStar(require_api_response_sign_transaction_response(), exports2); - __exportStar(require_api_response_sign_transaction_response_data(), exports2); - __exportStar(require_api_response_signer_response(), exports2); - __exportStar(require_api_response_signer_response_data(), exports2); - __exportStar(require_api_response_string(), exports2); - __exportStar(require_api_response_transaction_response(), exports2); - __exportStar(require_api_response_transaction_response_data(), exports2); - __exportStar(require_api_response_value(), exports2); - __exportStar(require_api_response_vec_notification_response(), exports2); - __exportStar(require_api_response_vec_relayer_response(), exports2); - __exportStar(require_api_response_vec_signer_response(), exports2); - __exportStar(require_api_response_vec_transaction_response(), exports2); - __exportStar(require_asset_spec(), exports2); - __exportStar(require_asset_spec_one_of(), exports2); - __exportStar(require_asset_spec_one_of1(), exports2); - __exportStar(require_asset_spec_one_of2(), exports2); - __exportStar(require_auth_spec(), exports2); - __exportStar(require_auth_spec_one_of(), exports2); - __exportStar(require_auth_spec_one_of1(), exports2); - __exportStar(require_auth_spec_one_of2(), exports2); - __exportStar(require_auth_spec_one_of3(), exports2); - __exportStar(require_aws_kms_signer_request_config(), exports2); - __exportStar(require_balance_response(), exports2); - __exportStar(require_cdp_signer_request_config(), exports2); - __exportStar(require_contract_source(), exports2); - __exportStar(require_contract_source_one_of(), exports2); - __exportStar(require_contract_source_one_of1(), exports2); - __exportStar(require_create_relayer_policy_request(), exports2); - __exportStar(require_create_relayer_policy_request_one_of(), exports2); - __exportStar(require_create_relayer_policy_request_one_of1(), exports2); - __exportStar(require_create_relayer_policy_request_one_of2(), exports2); - __exportStar(require_create_relayer_request(), exports2); - __exportStar(require_delete_pending_transactions_response(), exports2); - __exportStar(require_disabled_reason(), exports2); - __exportStar(require_disabled_reason_one_of(), exports2); - __exportStar(require_disabled_reason_one_of1(), exports2); - __exportStar(require_disabled_reason_one_of2(), exports2); - __exportStar(require_disabled_reason_one_of3(), exports2); - __exportStar(require_disabled_reason_one_of4(), exports2); - __exportStar(require_evm_policy_response(), exports2); - __exportStar(require_evm_rpc_request(), exports2); - __exportStar(require_evm_rpc_request_one_of(), exports2); - __exportStar(require_evm_rpc_result(), exports2); - __exportStar(require_evm_transaction_data_signature(), exports2); - __exportStar(require_evm_transaction_request(), exports2); - __exportStar(require_evm_transaction_response(), exports2); - __exportStar(require_fee_estimate_request_params(), exports2); - __exportStar(require_fee_estimate_result(), exports2); - __exportStar(require_get_features_enabled_result(), exports2); - __exportStar(require_get_supported_tokens_item(), exports2); - __exportStar(require_get_supported_tokens_result(), exports2); - __exportStar(require_google_cloud_kms_signer_key_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_key_response_config(), exports2); - __exportStar(require_google_cloud_kms_signer_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_service_account_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_service_account_response_config(), exports2); - __exportStar(require_json_rpc_error(), exports2); - __exportStar(require_json_rpc_id(), exports2); - __exportStar(require_json_rpc_request_network_rpc_request(), exports2); - __exportStar(require_json_rpc_response_network_rpc_result(), exports2); - __exportStar(require_json_rpc_response_network_rpc_result_result(), exports2); - __exportStar(require_jupiter_swap_options(), exports2); - __exportStar(require_local_signer_request_config(), exports2); - __exportStar(require_log_entry(), exports2); - __exportStar(require_log_level(), exports2); - __exportStar(require_memo_spec(), exports2); - __exportStar(require_memo_spec_one_of(), exports2); - __exportStar(require_memo_spec_one_of1(), exports2); - __exportStar(require_memo_spec_one_of2(), exports2); - __exportStar(require_memo_spec_one_of3(), exports2); - __exportStar(require_memo_spec_one_of4(), exports2); - __exportStar(require_network_policy_response(), exports2); - __exportStar(require_network_rpc_request(), exports2); - __exportStar(require_network_rpc_result(), exports2); - __exportStar(require_network_transaction_request(), exports2); - __exportStar(require_notification_create_request(), exports2); - __exportStar(require_notification_response(), exports2); - __exportStar(require_notification_type(), exports2); - __exportStar(require_notification_update_request(), exports2); - __exportStar(require_operation_spec(), exports2); - __exportStar(require_operation_spec_one_of(), exports2); - __exportStar(require_operation_spec_one_of1(), exports2); - __exportStar(require_operation_spec_one_of2(), exports2); - __exportStar(require_operation_spec_one_of3(), exports2); - __exportStar(require_pagination_meta(), exports2); - __exportStar(require_plugin_call_request(), exports2); - __exportStar(require_plugin_handler_error(), exports2); - __exportStar(require_plugin_metadata(), exports2); - __exportStar(require_prepare_transaction_request_params(), exports2); - __exportStar(require_prepare_transaction_result(), exports2); - __exportStar(require_relayer_evm_policy(), exports2); - __exportStar(require_relayer_network_policy(), exports2); - __exportStar(require_relayer_network_policy_one_of(), exports2); - __exportStar(require_relayer_network_policy_one_of1(), exports2); - __exportStar(require_relayer_network_policy_one_of2(), exports2); - __exportStar(require_relayer_network_policy_response(), exports2); - __exportStar(require_relayer_network_type(), exports2); - __exportStar(require_relayer_response(), exports2); - __exportStar(require_relayer_solana_policy(), exports2); - __exportStar(require_relayer_solana_swap_config(), exports2); - __exportStar(require_relayer_status(), exports2); - __exportStar(require_relayer_stellar_policy(), exports2); - __exportStar(require_rpc_config(), exports2); - __exportStar(require_sign_and_send_transaction_request_params(), exports2); - __exportStar(require_sign_and_send_transaction_result(), exports2); - __exportStar(require_sign_data_request(), exports2); - __exportStar(require_sign_data_response(), exports2); - __exportStar(require_sign_data_response_evm(), exports2); - __exportStar(require_sign_data_response_solana(), exports2); - __exportStar(require_sign_transaction_request(), exports2); - __exportStar(require_sign_transaction_request_params(), exports2); - __exportStar(require_sign_transaction_request_solana(), exports2); - __exportStar(require_sign_transaction_request_stellar(), exports2); - __exportStar(require_sign_transaction_response(), exports2); - __exportStar(require_sign_transaction_response_solana(), exports2); - __exportStar(require_sign_transaction_response_stellar(), exports2); - __exportStar(require_sign_transaction_result(), exports2); - __exportStar(require_sign_typed_data_request(), exports2); - __exportStar(require_signer_config_request(), exports2); - __exportStar(require_signer_config_response(), exports2); - __exportStar(require_signer_config_response_one_of(), exports2); - __exportStar(require_signer_config_response_one_of1(), exports2); - __exportStar(require_signer_config_response_one_of2(), exports2); - __exportStar(require_signer_config_response_one_of3(), exports2); - __exportStar(require_signer_config_response_one_of4(), exports2); - __exportStar(require_signer_config_response_one_of5(), exports2); - __exportStar(require_signer_create_request(), exports2); - __exportStar(require_signer_response(), exports2); - __exportStar(require_signer_type(), exports2); - __exportStar(require_signer_type_request(), exports2); - __exportStar(require_solana_account_meta(), exports2); - __exportStar(require_solana_allowed_tokens_policy(), exports2); - __exportStar(require_solana_allowed_tokens_swap_config(), exports2); - __exportStar(require_solana_fee_payment_strategy(), exports2); - __exportStar(require_solana_instruction_spec(), exports2); - __exportStar(require_solana_policy_response(), exports2); - __exportStar(require_solana_rpc_request(), exports2); - __exportStar(require_solana_rpc_request_one_of(), exports2); - __exportStar(require_solana_rpc_request_one_of1(), exports2); - __exportStar(require_solana_rpc_request_one_of2(), exports2); - __exportStar(require_solana_rpc_request_one_of3(), exports2); - __exportStar(require_solana_rpc_request_one_of4(), exports2); - __exportStar(require_solana_rpc_request_one_of5(), exports2); - __exportStar(require_solana_rpc_request_one_of6(), exports2); - __exportStar(require_solana_rpc_request_one_of7(), exports2); - __exportStar(require_solana_rpc_request_one_of7_params(), exports2); - __exportStar(require_solana_rpc_result(), exports2); - __exportStar(require_solana_rpc_result_one_of(), exports2); - __exportStar(require_solana_rpc_result_one_of1(), exports2); - __exportStar(require_solana_rpc_result_one_of2(), exports2); - __exportStar(require_solana_rpc_result_one_of3(), exports2); - __exportStar(require_solana_rpc_result_one_of4(), exports2); - __exportStar(require_solana_rpc_result_one_of5(), exports2); - __exportStar(require_solana_rpc_result_one_of6(), exports2); - __exportStar(require_solana_rpc_result_one_of7(), exports2); - __exportStar(require_solana_swap_strategy(), exports2); - __exportStar(require_solana_transaction_request(), exports2); - __exportStar(require_solana_transaction_response(), exports2); - __exportStar(require_speed(), exports2); - __exportStar(require_stellar_policy_response(), exports2); - __exportStar(require_stellar_rpc_request(), exports2); - __exportStar(require_stellar_rpc_request_one_of(), exports2); - __exportStar(require_stellar_rpc_result(), exports2); - __exportStar(require_stellar_transaction_request(), exports2); - __exportStar(require_stellar_transaction_response(), exports2); - __exportStar(require_transaction_response(), exports2); - __exportStar(require_transaction_status(), exports2); - __exportStar(require_transfer_transaction_request_params(), exports2); - __exportStar(require_transfer_transaction_result(), exports2); - __exportStar(require_turnkey_signer_request_config(), exports2); - __exportStar(require_update_relayer_request(), exports2); - __exportStar(require_vault_signer_request_config(), exports2); - __exportStar(require_vault_transit_signer_request_config(), exports2); - __exportStar(require_wasm_source(), exports2); - __exportStar(require_wasm_source_one_of(), exports2); - __exportStar(require_wasm_source_one_of1(), exports2); - __exportStar(require_plugin_api(), exports2); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js -var require_dist = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_api(), exports2); - __exportStar(require_configuration(), exports2); - __exportStar(require_models(), exports2); - } -}); - -// lib/sandbox-executor.ts -var sandbox_executor_exports = {}; -__export(sandbox_executor_exports, { - default: () => executeInSandbox -}); -module.exports = __toCommonJS(sandbox_executor_exports); -var vm = __toESM(require("node:vm")); -var v8 = __toESM(require("node:v8")); -var net = __toESM(require("node:net")); - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/stringify.js -var byteToHex = []; -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); -} -function unsafeStringify(arr, offset = 0) { - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/rng.js -var import_crypto = require("crypto"); -var rnds8Pool = new Uint8Array(256); -var poolPtr = rnds8Pool.length; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - (0, import_crypto.randomFillSync)(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/native.js -var import_crypto2 = require("crypto"); -var native_default = { randomUUID: import_crypto2.randomUUID }; - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/v4.js -function v4(options, buf, offset) { - if (native_default.randomUUID && !buf && !options) { - return native_default.randomUUID(); - } - options = options || {}; - const rnds = options.random ?? options.rng?.() ?? rng(); - if (rnds.length < 16) { - throw new Error("Random bytes length must be >= 16"); - } - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - if (offset < 0 || offset + 16 > buf.length) { - throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); - } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); -} -var v4_default = v4; - -// lib/kv.ts -var import_ioredis = __toESM(require_built3()); -var import_crypto3 = require("crypto"); -var DefaultPluginKVStore = class { - /** - * Create a store bound to a plugin namespace. - * - pluginId: used for the namespace and Redis connection name. - * Curly braces are stripped to avoid nested hash-tags. - * - Uses REDIS_URL if provided; enables lazyConnect and auto pipelining. - */ - constructor(pluginId) { - this.KEY_REGEX = /^[A-Za-z0-9:_-]{1,512}$/; - this.UNLOCK_SCRIPT = 'if redis.call("GET", KEYS[1]) == ARGV[1] then return redis.call("UNLINK", KEYS[1]) else return 0 end'; - const url = process.env.REDIS_URL ?? "redis://localhost:6379"; - this.client = new import_ioredis.default(url, { - connectionName: `plugin_kv:${pluginId}`, - lazyConnect: true, - enableOfflineQueue: true, - enableAutoPipelining: true, - maxRetriesPerRequest: 1, - retryStrategy: (n) => Math.min(n * 50, 1e3) - }); - const pid = pluginId.replace(/[{}]/g, ""); - this.ns = `plugin_kv:{${pid}}`; - } - /** - * Build a namespaced Redis key for the given segment and user key. - * Validates the user-provided key and throws on invalid input. - * @param seg - The key segment: 'data' or 'lock'. - * @param key - The user-provided key to namespace. - * @returns The fully-qualified Redis key. - * @throws Error if the key does not match the allowed pattern. - */ - key(seg, key) { - if (!this.KEY_REGEX.test(key)) throw new Error("invalid key"); - return `${this.ns}:${seg}:${key}`; - } - /** - * Retrieve and JSON-parse the value for a key. - * Returns null if the key is not present. - * @typeParam T - Expected value type after JSON parse. - * @param key - The key to retrieve. - * @returns Resolves to the parsed value, or null if missing. - */ - async get(key) { - const v = await this.client.get(this.key("data", key)); - if (v == null) return null; - return JSON.parse(v); - } - /** - * Store a JSON-encoded value under the key. - * - If opts.ttlSec > 0, sets an expiry in seconds; otherwise no expiry. - * - Throws if value is undefined. - * Returns true on success. - * @param key - The key to set. - * @param value - Serializable value; must not be undefined. - * @param opts - Optional settings. - * @param opts.ttlSec - Time-to-live in seconds; if > 0, sets expiry. - * @returns True on success. - * @throws Error if `value` is undefined or the key is invalid. - */ - async set(key, value, opts) { - if (value === void 0) throw new Error("value must not be undefined"); - const payload = JSON.stringify(value); - const k = this.key("data", key); - const ex = Math.max(0, Math.floor(opts?.ttlSec ?? 0)); - const res = ex > 0 ? await this.client.set(k, payload, "EX", ex) : await this.client.set(k, payload); - return res === "OK"; - } - /** - * Remove the key. - * @param key - The key to remove. - * @returns True if exactly one key was unlinked. - */ - async del(key) { - const k = this.key("data", key); - const n = await this.client.unlink(k); - return n === 1; - } - /** - * Check whether a key exists. - * @param key - The key to check. - * @returns True if the key exists. - */ - async exists(key) { - return await this.client.exists(this.key("data", key)) === 1; - } - /** - * List keys in this store matching `pattern` (glob-like, default '*'). - * Returns bare keys (without namespace). Uses SCAN with COUNT=`batch`. - * @param pattern - Glob-like match pattern (default '*'). - * @param batch - SCAN COUNT per iteration (default 500). - * @returns Array of bare keys (without the namespace prefix). - */ - async listKeys(pattern = "*", batch = 500) { - const out = []; - let cursor = "0"; - const prefix = `${this.ns}:data:`; - do { - const [next, keys] = await this.client.scan(cursor, "MATCH", `${prefix}${pattern}`, "COUNT", batch); - cursor = next; - for (const k of keys) out.push(k.slice(prefix.length)); - } while (cursor !== "0"); - return out; - } - /** - * Delete all keys in this plugin namespace. - * Returns the number of keys removed. - * @returns The number of keys deleted. - */ - async clear() { - let cursor = "0"; - let deleted = 0; - do { - const [next, keys] = await this.client.scan(cursor, "MATCH", `${this.ns}:*`, "COUNT", 1e3); - cursor = next; - if (keys.length) { - const chunkSize = 512; - for (let i = 0; i < keys.length; i += chunkSize) { - const chunk = keys.slice(i, i + chunkSize); - const pipeline = this.client.pipeline(); - chunk.forEach((k) => pipeline.unlink(k)); - const results = await pipeline.exec(); - if (results) { - for (const [, res] of results) { - if (typeof res === "number") deleted += res; - } - } - } - } - } while (cursor !== "0"); - return deleted; - } - /** - * Run `fn` while holding a distributed lock for `key`. - * The lock is acquired with SET NX PX and released via a token-checked - * Lua script to avoid unlocking another client's lock. - * - opts.ttlSec: lock expiry in seconds (default 30) - * - opts.onBusy: 'throw' (default) or 'skip' to return null when busy - * @typeParam T - The return type of `fn`. - * @param key - The lock key. - * @param fn - Async function to execute while holding the lock. - * @param opts - Lock options. - * @param opts.ttlSec - Lock expiry in seconds (default 30). - * @param opts.onBusy - Behavior when the lock is busy: 'throw' or 'skip'. - * @returns The result of `fn`, or null when skipped due to a busy lock. - * @throws Error if the lock is busy and `onBusy` is 'throw'. - */ - async withLock(key, fn, opts) { - const ttlSec = opts?.ttlSec ?? 30; - const onBusy = opts?.onBusy ?? "throw"; - const lockKey = this.key("lock", key); - const token = (0, import_crypto3.randomUUID)(); - const ok = await this.client.set(lockKey, token, "PX", ttlSec * 1e3, "NX"); - if (ok !== "OK") { - if (onBusy === "skip") return null; - throw new Error("lock busy"); - } - try { - return await fn(); - } finally { - await this.client.eval(this.UNLOCK_SCRIPT, 1, lockKey, token); - } - } - /** - * Explicitly connect to Redis. - * Normally not needed since lazyConnect will connect on first command. - */ - async connect() { - await this.client.connect(); - } - /** - * Disconnect from Redis. - * Call this when the store is no longer needed. - */ - async disconnect() { - await this.client.disconnect(); - } -}; - -// lib/compiler.ts -var esbuild = __toESM(require_main()); -var fs = __toESM(require("node:fs")); -var path = __toESM(require("node:path")); -var os = __toESM(require("node:os")); -var MAX_SOURCE_SIZE = 5 * 1024 * 1024; -var MAX_COMPILED_SIZE = 10 * 1024 * 1024; -var DEFAULT_PLUGIN_BASE_DIR = path.resolve(process.cwd(), "plugins"); -function wrapForVm(compiledCode) { - if (typeof compiledCode !== "string") { - throw new Error("wrapForVm: compiledCode must be a string"); - } - if (compiledCode.length === 0) { - throw new Error("wrapForVm: compiledCode cannot be empty"); - } - if (compiledCode.length > MAX_COMPILED_SIZE) { - throw new Error( - `wrapForVm: code exceeds size limit (${(compiledCode.length / 1024 / 1024).toFixed(1)}MB)` - ); - } - return ` -(function(exports, require, module, __filename, __dirname) { -${compiledCode} -}); -`; -} - -// lib/sandbox-executor.ts -var import_relayer_sdk = __toESM(require_dist()); - -// lib/constants.ts -var DEFAULT_SOCKET_REQUEST_TIMEOUT_MS = 3e4; - -// lib/sandbox-executor.ts -var ContextPool = class { - constructor() { - this.available = []; - this.maxSize = 10; - } - // Max contexts to cache per worker - acquire() { - const ctx = this.available.pop(); - if (ctx) { - this.resetContext(ctx); - return ctx; - } - return this.createFreshContext(); - } - release(ctx) { - if (this.available.length < this.maxSize) { - this.available.push(ctx); - } - } - createFreshContext() { - return vm.createContext({}); - } - resetContext(ctx) { - try { - vm.runInContext(` - // Clear any plugin-added globals - if (typeof globalThis.__pluginState !== 'undefined') { - delete globalThis.__pluginState; - } - `, ctx, { timeout: 100 }); - } catch { - } - } - clear() { - this.available = []; - } -}; -var ScriptCache = class { - constructor() { - this.cache = /* @__PURE__ */ new Map(); - this.maxSize = 100; - // Max scripts to cache per worker - this.lastMemoryCheck = 0; - this.memoryCheckInterval = 5e3; - } - // Check every 5s - get(code) { - this.maybeCheckMemory(); - const entry = this.cache.get(code); - if (entry) { - entry.timestamp = Date.now(); - return entry.script; - } - return void 0; - } - set(code, script) { - this.maybeCheckMemory(); - if (this.cache.size >= this.maxSize) { - this.evictOldest(1); - } - this.cache.set(code, { script, timestamp: Date.now() }); - } - /** - * Periodic memory check - evict cache if heap is under pressure. - */ - maybeCheckMemory() { - const now = Date.now(); - if (now - this.lastMemoryCheck < this.memoryCheckInterval) { - return; - } - this.lastMemoryCheck = now; - const usage = process.memoryUsage(); - const heapStats = v8.getHeapStatistics(); - const heapUsedRatio = usage.heapUsed / heapStats.heap_size_limit; - if (heapUsedRatio >= 0.7 && this.cache.size > 0) { - const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); - console.warn( - `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` - ); - this.evictOldest(evictCount); - } - if (heapUsedRatio >= 0.85 && this.cache.size > 0) { - const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.5)); - console.warn( - `[worker-cache] HIGH memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` - ); - this.evictOldest(evictCount); - } - } - evictOldest(count) { - const entries = [...this.cache.entries()].sort( - (a, b) => a[1].timestamp - b[1].timestamp - ); - let evicted = 0; - for (const [key] of entries) { - if (evicted >= count) break; - this.cache.delete(key); - evicted++; - } - if (evicted > 0) { - console.log(`[worker-cache] Evicted ${evicted} oldest scripts`); - } - } - clear() { - const size = this.cache.size; - this.cache.clear(); - if (size > 0) { - console.log(`[worker-cache] Emergency eviction: cleared ${size} cached scripts`); - } - } - size() { - return this.cache.size; - } -}; -var SocketClosedError = class extends Error { - constructor(message) { - super(message); - this.name = "SocketClosedError"; - this.code = "ESOCKETCLOSED"; - } -}; -var SocketPool = class { - constructor() { - this.available = []; - this.maxSize = 5; - // Max sockets to cache per worker - // Rust server connection lifetime is 60s. Discard sockets older than 50s. - this.maxSocketAgeMs = 5e4; - } - acquire() { - const now = Date.now(); - while (this.available.length > 0) { - const pooled = this.available.pop(); - const age = now - pooled.createdAt; - if (age > this.maxSocketAgeMs) { - pooled.socket.destroy(); - continue; - } - if (pooled.socket.writable && !pooled.socket.destroyed) { - return { socket: pooled.socket, createdAt: pooled.createdAt }; - } - pooled.socket.destroy(); - } - return null; - } - /** - * Release a socket back to the pool. - * @param socket The socket to release - * @param createdAt When the socket was originally created (for age tracking) - */ - release(socket, createdAt) { - const now = Date.now(); - const age = now - createdAt; - if (age > this.maxSocketAgeMs || !socket.writable || socket.destroyed || this.available.length >= this.maxSize) { - socket.destroy(); - return; - } - this.available.push({ socket, createdAt }); - } - clear() { - for (const pooled of this.available) { - pooled.socket.destroy(); - } - this.available = []; - } -}; -var contextPool = new ContextPool(); -var scriptCache = new ScriptCache(); -var socketPool = new SocketPool(); -var SandboxPluginAPI = class { - constructor(socketPath, httpRequestId) { - this.socket = null; - this.connectionPromise = null; - this.connected = false; - this.maxPendingRequests = 100; - // Prevent memory leak from unbounded pending - this.socketCreatedAt = 0; - // Track socket creation time for pool age-based eviction - // Store handler references for proper cleanup (prevents listener accumulation) - this.boundErrorHandler = null; - this.boundCloseHandler = null; - this.boundDataHandler = null; - this.socketPath = socketPath; - this.pending = /* @__PURE__ */ new Map(); - this.httpRequestId = httpRequestId; - } - async ensureConnected() { - if (this.connected) return; - if (!this.connectionPromise) { - const acquired = socketPool.acquire(); - if (acquired) { - this.socket = acquired.socket; - this.socketCreatedAt = acquired.createdAt; - this.connected = true; - this.connectionPromise = Promise.resolve(); - this.setupSocketHandlers(this.socket); - } else { - this.socket = net.createConnection(this.socketPath); - this.socketCreatedAt = Date.now(); - this.setupSocketHandlers(this.socket); - this.connectionPromise = new Promise((resolve2, reject) => { - this.socket.once("connect", () => { - this.connected = true; - resolve2(); - }); - this.socket.once("error", reject); - }); - } - } - await this.connectionPromise; - } - /** - * Set up error/close/data handlers for a socket (pooled or new). - * This ensures sockets can trigger reconnection on failure. - * Stores references for proper cleanup to prevent listener accumulation. - */ - setupSocketHandlers(socket) { - this.boundErrorHandler = (error) => this.handleSocketError(error); - this.boundCloseHandler = () => this.handleSocketClose(); - this.boundDataHandler = (data) => this.handleSocketData(data); - socket.on("error", this.boundErrorHandler); - socket.on("close", this.boundCloseHandler); - socket.on("data", this.boundDataHandler); - } - /** - * Remove socket handlers before returning to pool. - * Prevents listener accumulation (MaxListenersExceededWarning). - */ - removeSocketHandlers(socket) { - if (this.boundErrorHandler) { - socket.removeListener("error", this.boundErrorHandler); - this.boundErrorHandler = null; - } - if (this.boundCloseHandler) { - socket.removeListener("close", this.boundCloseHandler); - this.boundCloseHandler = null; - } - if (this.boundDataHandler) { - socket.removeListener("data", this.boundDataHandler); - this.boundDataHandler = null; - } - } - /** - * Handle socket error - reject pending requests and reset connection state - */ - handleSocketError(error) { - this.rejectAllPending(error); - this.connected = false; - this.connectionPromise = null; - this.socket = null; - } - /** - * Handle socket close - reset connection state to enable reconnection. - * Uses SocketClosedError to enable automatic retry in sendWithRetry(). - */ - handleSocketClose() { - this.connected = false; - this.rejectAllPending(new SocketClosedError("Socket closed by server (connection lifetime exceeded)")); - this.connectionPromise = null; - this.socket = null; - } - /** - * Handle incoming data from socket - */ - handleSocketData(data) { - data.toString().split("\n").filter(Boolean).forEach((msg) => { - try { - const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); - } - } catch { - } - }); - } - /** - * Reject all pending requests with the given error. - * Called on socket error or close to prevent hanging promises. - */ - rejectAllPending(error) { - for (const [requestId, resolver] of this.pending.entries()) { - resolver.reject(error); - this.pending.delete(requestId); - } - } - useRelayer(relayerId) { - return { - sendTransaction: async (payload) => { - const result = await this.send(relayerId, "sendTransaction", payload); - return { - ...result, - wait: (options) => this.transactionWait(result, options) - }; - }, - getTransaction: (payload) => this.send(relayerId, "getTransaction", payload), - getRelayerStatus: () => this.send(relayerId, "getRelayerStatus", {}), - signTransaction: (payload) => this.send(relayerId, "signTransaction", payload), - getRelayer: () => this.send(relayerId, "getRelayer", {}), - rpc: (payload) => this.send(relayerId, "rpc", payload) - }; - } - async transactionWait(transaction, options) { - const interval = options?.interval ?? 5e3; - const timeout = options?.timeout ?? 6e4; - const relayer = this.useRelayer(transaction.relayer_id); - let shouldContinue = true; - const poll = async () => { - let tx = await relayer.getTransaction({ transactionId: transaction.id }); - while (shouldContinue && tx.status !== import_relayer_sdk.TransactionStatus.MINED && tx.status !== import_relayer_sdk.TransactionStatus.CONFIRMED && tx.status !== import_relayer_sdk.TransactionStatus.CANCELED && tx.status !== import_relayer_sdk.TransactionStatus.EXPIRED && tx.status !== import_relayer_sdk.TransactionStatus.FAILED) { - await new Promise((resolve2) => setTimeout(resolve2, interval)); - if (!shouldContinue) break; - tx = await relayer.getTransaction({ transactionId: transaction.id }); - } - return tx; - }; - let timeoutId; - const timeoutPromise = new Promise((_, reject) => { - timeoutId = setTimeout(() => { - shouldContinue = false; - reject((0, import_relayer_sdk.pluginError)(`Transaction ${transaction.id} timed out after ${timeout}ms`, { status: 504 })); - }, timeout); - }); - return Promise.race([poll(), timeoutPromise]).finally(() => { - shouldContinue = false; - if (timeoutId) clearTimeout(timeoutId); - }); - } - async send(relayerId, method, payload) { - return this.sendWithRetry(relayerId, method, payload, false); - } - /** - * Send request with EPIPE retry logic. - * EPIPE occurs when the pooled socket was closed by the server but client doesn't know yet. - * On EPIPE, we destroy the stale socket and retry with a fresh connection. - */ - async sendWithRetry(relayerId, method, payload, isRetry) { - const requestId = v4_default(); - const msg = { requestId, relayerId, method, payload }; - if (this.httpRequestId) { - msg.httpRequestId = this.httpRequestId; - } - const message = JSON.stringify(msg) + "\n"; - if (this.pending.size >= this.maxPendingRequests) { - throw new Error( - `Too many concurrent API requests (max ${this.maxPendingRequests}). Await previous requests before making new ones.` - ); - } - await this.ensureConnected(); - try { - const socket = this.socket; - if (!socket) { - const staleError = new Error("Socket became unavailable after connection"); - staleError.code = "ECONNRESET"; - throw staleError; - } - return await new Promise((resolve2, reject) => { - let timeoutId; - timeoutId = setTimeout(() => { - this.pending.delete(requestId); - reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); - }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); - this.pending.set(requestId, { - resolve: (value) => { - if (timeoutId) clearTimeout(timeoutId); - resolve2(value); - }, - reject: (reason) => { - if (timeoutId) clearTimeout(timeoutId); - reject(reason); - } - }); - socket.write(message, (error) => { - if (error) { - if (timeoutId) clearTimeout(timeoutId); - this.pending.delete(requestId); - reject(error); - } - }); - }); - } catch (error) { - const isRetryableError = error.code === "EPIPE" || error.code === "ECONNRESET" || error.code === "ESOCKETCLOSED"; - if (!isRetry && isRetryableError) { - if (this.socket) { - this.removeSocketHandlers(this.socket); - this.socket.destroy(); - this.socket = null; - } - this.connected = false; - this.connectionPromise = null; - return this.sendWithRetry(relayerId, method, payload, true); - } - throw error; - } - } - close() { - if (this.socket) { - this.removeSocketHandlers(this.socket); - socketPool.release(this.socket, this.socketCreatedAt); - this.socket = null; - } - this.connected = false; - } -}; -function safeStringify(value) { - try { - return JSON.stringify(value, (_, v) => { - if (typeof v === "bigint") { - return v.toString() + "n"; - } - return v; - }); - } catch { - try { - return String(value); - } catch { - return "[Unstringifiable value]"; - } - } -} -function createSandboxConsole(logs) { - const log = (level) => (...args) => { - const entry = { - level, - _args: args, - // Store raw args - _stringified: false, - _message: "" - }; - Object.defineProperty(entry, "message", { - get() { - if (!this._stringified) { - this._message = this._args.map( - (arg) => typeof arg === "object" ? safeStringify(arg) : String(arg) - ).join(" "); - this._stringified = true; - delete this._args; - } - return this._message; - }, - enumerable: true, - configurable: true - }); - logs.push(entry); - }; - return { - log: log("log"), - info: log("info"), - warn: log("warn"), - error: log("error"), - debug: log("debug"), - trace: log("debug"), - // Required console methods (no-ops for unused ones) - assert: () => { - }, - clear: () => { - }, - count: () => { - }, - countReset: () => { - }, - dir: () => { - }, - dirxml: () => { - }, - group: () => { - }, - groupCollapsed: () => { - }, - groupEnd: () => { - }, - table: () => { - }, - time: () => { - }, - timeEnd: () => { - }, - timeLog: () => { - }, - timeStamp: () => { - }, - profile: () => { - }, - profileEnd: () => { - }, - Console: console.Console - }; -} -async function executeInSandbox(task) { - const logs = []; - const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); - const kv = new DefaultPluginKVStore(task.pluginId); - const context = contextPool.acquire(); - try { - const sandboxConsole = createSandboxConsole(logs); - const wrappedCode = wrapForVm(task.compiledCode); - let script = scriptCache.get(task.compiledCode); - if (!script) { - script = new vm.Script(wrappedCode, { - filename: `plugin-${task.pluginId}.js` - }); - scriptCache.set(task.compiledCode, script); - } - const moduleExports = {}; - const moduleObject = { exports: moduleExports }; - const safeCrypto = { - randomUUID: () => require("crypto").randomUUID(), - getRandomValues: (arr) => require("crypto").getRandomValues(arr) - }; - const BLOCKED_MODULES = /* @__PURE__ */ new Set([ - // Filesystem access - "fs", - "fs/promises", - "node:fs", - "node:fs/promises", - // Process/system control - "child_process", - "node:child_process", - "cluster", - "node:cluster", - "worker_threads", - "node:worker_threads", - "process", - "node:process", - // Low-level system - "os", - "node:os", - "v8", - "node:v8", - "vm", - "node:vm", - // Direct network (use PluginAPI instead) - "net", - "node:net", - "dgram", - "node:dgram", - "tls", - "node:tls", - "http", - "node:http", - "https", - "node:https", - "http2", - "node:http2", - // Dangerous utilities - "repl", - "node:repl", - "inspector", - "node:inspector", - "perf_hooks", - "node:perf_hooks", - "async_hooks", - "node:async_hooks", - "trace_events", - "node:trace_events", - // Native modules (potential escape) - "module", - "node:module" - ]); - const sandboxRequire = (id) => { - if (BLOCKED_MODULES.has(id)) { - throw new Error( - `Module '${id}' is blocked for security. Use the PluginAPI for network operations.` - ); - } - try { - return require(id); - } catch (err) { - throw new Error( - `Module '${id}' not found. Ensure it's installed in plugins/node_modules.` - ); - } - }; - Object.assign(context, { - // === Console for logging === - console: sandboxConsole, - // === CommonJS module system === - exports: moduleExports, - require: sandboxRequire, - module: moduleObject, - __filename: `plugin-${task.pluginId}.js`, - __dirname: "/plugins", - // === Async primitives === - setTimeout, - setInterval, - setImmediate, - clearTimeout, - clearInterval, - clearImmediate, - Promise, - queueMicrotask, - // === Core JS types (often needed explicitly) === - Object, - Array, - String, - Number, - Boolean, - Symbol, - BigInt, - Map, - Set, - WeakMap, - WeakSet, - Date, - RegExp, - Math, - JSON, - // === Error types === - Error, - TypeError, - RangeError, - SyntaxError, - ReferenceError, - URIError, - EvalError, - // === Number utilities === - parseInt, - parseFloat, - isNaN, - isFinite, - Infinity: Infinity, - NaN: NaN, - // === String/URL encoding === - encodeURI, - decodeURI, - encodeURIComponent, - decodeURIComponent, - atob, - btoa, - URL, - URLSearchParams, - // === Binary data === - Buffer, - ArrayBuffer, - SharedArrayBuffer, - Uint8Array, - Uint16Array, - Uint32Array, - Int8Array, - Int16Array, - Int32Array, - Float32Array, - Float64Array, - BigInt64Array, - BigUint64Array, - DataView, - TextEncoder, - TextDecoder, - // === Cancellation (modern async patterns) === - AbortController, - AbortSignal, - // === Safe crypto subset (no signing/hashing secrets) === - crypto: safeCrypto, - // === Reflection (needed by some libraries) === - Reflect, - Proxy - }); - const factory = script.runInContext(context, { timeout: task.timeout }); - factory(moduleExports, sandboxRequire, moduleObject, `plugin-${task.pluginId}.js`, "/plugins"); - const handler = moduleObject.exports.handler || moduleExports.handler; - if (!handler || typeof handler !== "function") { - throw new Error("Plugin must export a handler function"); - } - let result; - const handlerPromise = (async () => { - if (handler.length === 1) { - const pluginContext = { - api, - params: task.params, - kv, - headers: task.headers ?? {} - }; - return await handler(pluginContext); - } else { - return await handler(api, task.params); - } - })(); - const timeoutPromise = new Promise((_, reject) => { - setTimeout(() => { - const error = new Error(`Plugin handler timed out after ${task.timeout}ms`); - error.code = "ERR_HANDLER_TIMEOUT"; - reject(error); - }, task.timeout); - }); - result = await Promise.race([handlerPromise, timeoutPromise]); - return { - taskId: task.taskId, - success: true, - result, - logs - }; - } catch (error) { - const err = error; - let errorCode = "PLUGIN_ERROR"; - let errorMessage = String(error); - let errorStack; - let errorDetails = void 0; - let errorStatus = 500; - if (err && typeof err === "object") { - errorMessage = err.message || String(error); - if (err.name === "SyntaxError") { - errorCode = "SYNTAX_ERROR"; - } else if (err.name === "TypeError") { - errorCode = "TYPE_ERROR"; - } else if (err.name === "ReferenceError") { - errorCode = "REFERENCE_ERROR"; - } else if (err.code === "ERR_SCRIPT_EXECUTION_TIMEOUT") { - errorCode = "TIMEOUT"; - errorStatus = 504; - errorMessage = `Plugin module compilation timed out after ${task.timeout}ms`; - } else if (err.code === "ERR_HANDLER_TIMEOUT") { - errorCode = "TIMEOUT"; - errorStatus = 504; - } else if (err.code) { - errorCode = err.code; - } - if (err.stack) { - errorStack = err.stack.split("\n").slice(0, 10).join("\n"); - } - if (err.details) { - errorDetails = err.details; - } - if (typeof err.status === "number") { - errorStatus = err.status; - } - } - return { - taskId: task.taskId, - success: false, - error: { - message: errorMessage, - code: errorCode, - status: errorStatus, - details: errorDetails ? { - ...errorDetails, - stack: errorStack - } : errorStack ? { stack: errorStack } : void 0 - }, - logs - }; - } finally { - contextPool.release(context); - try { - api.close(); - } catch (err) { - } - try { - await kv.disconnect(); - } catch { - } - } -} -/*! Bundled license information: - -mime-db/index.js: - (*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - *) - -mime-types/index.js: - (*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - *) - -axios/dist/node/axios.cjs: - (*! Axios v1.13.1 Copyright (c) 2025 Matt Zabriskie and contributors *) -*/ diff --git a/plugins/lib/sandbox-executor.js.sha256 b/plugins/lib/sandbox-executor.js.sha256 deleted file mode 100644 index 806dfcaab..000000000 --- a/plugins/lib/sandbox-executor.js.sha256 +++ /dev/null @@ -1 +0,0 @@ -e90ce68ad2d56cb845420856f472a754845ec3f024564cb49f19284e340fe9b1 sandbox-executor.js From ad46e72a91235665398da2952291a0a55529a8a9 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 11 Jan 2026 23:34:09 +0100 Subject: [PATCH 11/42] chore: Fixes --- CLAUDE.md | 35 ----- .../basic-example-plugin/config/config.json | 10 ++ .../config/keys/local-signer.json | 1 - .../basic-example-plugin/docker-compose.yaml | 4 +- .../basic-example-plugin/test-plugin/index.ts | 132 +++++++++--------- plugins/examples/example-rpc.ts | 2 - 6 files changed, 77 insertions(+), 107 deletions(-) delete mode 100644 examples/basic-example-plugin/config/keys/local-signer.json diff --git a/CLAUDE.md b/CLAUDE.md index 58b992911..edb2e9b6c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,12 +27,6 @@ pnpm test # Run plugin tests cargo make docker-compose-up # Start with docker-compose cargo make docker-compose-down # Stop services -# Integration testing -cargo make integration-test-standalone # Full integration test (requires relayer running) -cargo make integration-test-local # Against local Anvil - -# Documentation -cargo make rust-docs # Generate Rust documentation ``` ## Architecture @@ -57,41 +51,12 @@ src/ โ””โ”€โ”€ utils/ # Helpers ``` -### Plugin System (Rust โ†” Node.js) - -The plugin system uses a multi-process architecture: - -**Rust side** (`src/services/plugins/`): -- `runner.rs` โ†’ Entry point, routes to pool executor -- `pool_executor.rs` โ†’ Manages Node.js process lifecycle, circuit breaker -- `connection.rs` โ†’ Lock-free connection pool with semaphore concurrency -- `shared_socket.rs` โ†’ Per-request Unix socket for plugin API calls -- `health.rs` โ†’ Circuit breaker states, dead server detection - -**Node.js side** (`plugins/lib/`): -- `pool-server.ts` โ†’ Main server, memory pressure monitoring -- `worker-pool.ts` โ†’ Piscina wrapper with dynamic scaling -- `sandbox-executor.ts` โ†’ VM-based plugin execution with security - -**Communication:** Unix socket with newline-delimited JSON protocol - ### Key Abstractions - **Repository Pattern**: Redis-backed repositories for configs (RelayerRepository, SignerRepository) - **Service Traits**: Async traits for dependency injection and testability - **Job Processing**: Apalis-based async job queue -## Configuration - -**Key Environment Variables:** -- `CONFIG_DIR`, `CONFIG_FILE_NAME` โ†’ Location of config.json -- `LOG_LEVEL` โ†’ trace/debug/info/warn/error -- `REDIS_URL` โ†’ Redis connection string -- `API_KEY` โ†’ Request authentication -- `PLUGIN_MAX_CONCURRENCY` โ†’ Main plugin scaling knob (default: 2048) - -**Config file** (`config/config.json`): Defines relayers, signers, networks, notifications, plugins - ## Code Standards - **Formatting**: rustfmt with max_width=100, edition 2021 diff --git a/examples/basic-example-plugin/config/config.json b/examples/basic-example-plugin/config/config.json index c8771b3c9..ad2a28e9e 100644 --- a/examples/basic-example-plugin/config/config.json +++ b/examples/basic-example-plugin/config/config.json @@ -5,6 +5,7 @@ "name": "Sepolia Example", "network": "sepolia", "paused": false, + "notification_id": "notification-example", "signer_id": "local-signer", "network_type": "evm", "policies": { @@ -13,6 +14,15 @@ } ], "notifications": [ + { + "id": "notification-example", + "type": "webhook", + "url": "", + "signing_key": { + "type": "env", + "value": "WEBHOOK_SIGNING_KEY" + } + } ], "signers": [ { diff --git a/examples/basic-example-plugin/config/keys/local-signer.json b/examples/basic-example-plugin/config/keys/local-signer.json deleted file mode 100644 index 0d51269f7..000000000 --- a/examples/basic-example-plugin/config/keys/local-signer.json +++ /dev/null @@ -1 +0,0 @@ -{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"f9ed974ef6977bf5f041adffa71d3b49"},"ciphertext":"7fb2ad7f0d02382aee811830ce508bef33d3e02e1bb31f9d36c52d67c8b1e1fd","kdf":"scrypt","kdfparams":{"dklen":32,"n":8192,"p":1,"r":8,"salt":"d4c4748993daf7c573df81897d68f678da578c40b53d2695ce53420056f3d7bf"},"mac":"61b0d494fb002923c6f64989d39099f84cc995f9ec4b6ef808e92a525db3798a"},"id":"0a9c551f-4194-4e5f-9561-6ffa77939d3e","version":3} \ No newline at end of file diff --git a/examples/basic-example-plugin/docker-compose.yaml b/examples/basic-example-plugin/docker-compose.yaml index cdcca0657..d36163fea 100644 --- a/examples/basic-example-plugin/docker-compose.yaml +++ b/examples/basic-example-plugin/docker-compose.yaml @@ -12,11 +12,11 @@ services: - keystore_passphrase environment: REDIS_URL: redis://redis:6379 + RATE_LIMIT_REQUESTS_PER_SECOND: 10 + RATE_LIMIT_BURST: 50 WEBHOOK_SIGNING_KEY: ${WEBHOOK_SIGNING_KEY} API_KEY: ${API_KEY} KEYSTORE_PASSPHRASE: ${KEYSTORE_PASSPHRASE} - RATE_LIMIT_REQUESTS_PER_SECOND: 50000 - RATE_LIMIT_BURST_SIZE: 300 security_opt: - no-new-privileges networks: diff --git a/examples/basic-example-plugin/test-plugin/index.ts b/examples/basic-example-plugin/test-plugin/index.ts index 8fe29b8f9..278fad04e 100644 --- a/examples/basic-example-plugin/test-plugin/index.ts +++ b/examples/basic-example-plugin/test-plugin/index.ts @@ -45,74 +45,72 @@ type HandlerResult = { * @param params - Plugin parameters from the API call * @returns Promise with the plugin result */ -export async function handler(api: PluginAPI, params: HandlerParams): Promise { +export async function handler(api: PluginAPI, params: HandlerParams): Promise { console.info("๐Ÿš€ Starting example handler plugin..."); console.info(`๐Ÿ“‹ Parameters:`, JSON.stringify(params, null, 2)); - return new Date().toISOString(); - - // try { - // // Validate required parameters - // if (!params.destinationAddress) { - // throw new Error("destinationAddress is required"); - // } - - // // Default values - // const relayerId = params.relayerId || "sepolia-example"; - // const amount = params.amount || 1; - // const message = params.message || "Hello from OpenZeppelin Relayer Plugin!"; - - // console.info(`๐Ÿ’ฐ Sending ${amount} wei to ${params.destinationAddress}`); - // console.info(`๐Ÿ“ Message: ${message}`); - // console.info(`๐Ÿ”— Using relayer: ${relayerId}`); - - // // Get the relayer instance - // const relayer = api.useRelayer(relayerId); - - // // Send the transaction - // console.info("๐Ÿ“ค Submitting transaction..."); - // const result = await relayer.sendTransaction({ - // to: params.destinationAddress, - // value: amount, - // data: "0x", // Empty data for simple ETH transfer - // gas_limit: 21000, - // speed: Speed.FAST, - // }); - - // console.info(`โœ… Transaction submitted!`); - // console.info(`๐Ÿ“‹ Transaction ID: ${result.id}`); - // console.info(`โณ Status: ${result.status}`); - - // // Wait for the transaction to be mined - // console.info("โณ Waiting for transaction confirmation..."); - // const confirmation = await result.wait({ - // interval: 5000, // Check every 5 seconds - // timeout: 120000 // Timeout after 2 minutes - // }); - - // console.info(`๐ŸŽ‰ Transaction confirmed!`); - // console.info(`๐Ÿ“‹ Final status: ${confirmation.status}`); - // console.info(`๐Ÿ”— Transaction hash: ${confirmation.hash || 'pending'}`); - - // // Return success result - // return { - // success: true, - // transactionId: result.id, - // transactionHash: confirmation.hash || null, - // message: `Successfully sent ${amount} wei to ${params.destinationAddress}. ${message}`, - // timestamp: new Date().toISOString() - // }; - - // } catch (error) { - // console.error("โŒ Plugin execution failed:", error); - - // // Return error result - // return { - // success: false, - // transactionId: "", - // transactionHash: null, - // message: `Plugin failed: ${(error as Error).message}`, - // timestamp: new Date().toISOString() - // }; - // } + try { + // Validate required parameters + if (!params.destinationAddress) { + throw new Error("destinationAddress is required"); + } + + // Default values + const relayerId = params.relayerId || "sepolia-example"; + const amount = params.amount || 1; + const message = params.message || "Hello from OpenZeppelin Relayer Plugin!"; + + console.info(`๐Ÿ’ฐ Sending ${amount} wei to ${params.destinationAddress}`); + console.info(`๐Ÿ“ Message: ${message}`); + console.info(`๐Ÿ”— Using relayer: ${relayerId}`); + + // Get the relayer instance + const relayer = api.useRelayer(relayerId); + + // Send the transaction + console.info("๐Ÿ“ค Submitting transaction..."); + const result = await relayer.sendTransaction({ + to: params.destinationAddress, + value: amount, + data: "0x", // Empty data for simple ETH transfer + gas_limit: 21000, + speed: Speed.FAST, + }); + + console.info(`โœ… Transaction submitted!`); + console.info(`๐Ÿ“‹ Transaction ID: ${result.id}`); + console.info(`โณ Status: ${result.status}`); + + // Wait for the transaction to be mined + console.info("โณ Waiting for transaction confirmation..."); + const confirmation = await result.wait({ + interval: 5000, // Check every 5 seconds + timeout: 120000 // Timeout after 2 minutes + }); + + console.info(`๐ŸŽ‰ Transaction confirmed!`); + console.info(`๐Ÿ“‹ Final status: ${confirmation.status}`); + console.info(`๐Ÿ”— Transaction hash: ${confirmation.hash || 'pending'}`); + + // Return success result + return { + success: true, + transactionId: result.id, + transactionHash: confirmation.hash || null, + message: `Successfully sent ${amount} wei to ${params.destinationAddress}. ${message}`, + timestamp: new Date().toISOString() + }; + + } catch (error) { + console.error("โŒ Plugin execution failed:", error); + + // Return error result + return { + success: false, + transactionId: "", + transactionHash: null, + message: `Plugin failed: ${(error as Error).message}`, + timestamp: new Date().toISOString() + }; + } } diff --git a/plugins/examples/example-rpc.ts b/plugins/examples/example-rpc.ts index 86ac7041b..44b12327c 100644 --- a/plugins/examples/example-rpc.ts +++ b/plugins/examples/example-rpc.ts @@ -6,8 +6,6 @@ import { JsonRpcResponseNetworkRpcResult, PluginAPI } from "@openzeppelin/relaye type Params = {}; -const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - /** * Plugin handler function - this is the entry point * Export it as 'handler' and the relayer will automatically call it From c08bb41336900dc62e25cb3ffd42f454fc6fe51d Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 12 Jan 2026 12:46:51 +0100 Subject: [PATCH 12/42] chore: Plugin api improvements --- build.rs | 8 +- openapi.json | 408 ++++++++++++++++++++ src/api/controllers/plugin.rs | 377 +++++++++++++++++- src/api/routes/docs/plugin_docs.rs | 195 +++++++++- src/api/routes/plugin.rs | 354 ++++++++++++++++- src/models/plugin.rs | 196 ++++++++++ src/openapi.rs | 3 + src/repositories/plugin/mod.rs | 9 + src/repositories/plugin/plugin_in_memory.rs | 12 + src/repositories/plugin/plugin_redis.rs | 37 ++ src/services/plugins/mod.rs | 20 +- src/services/plugins/pool_executor.rs | 28 +- src/services/plugins/protocol.rs | 4 + src/services/plugins/shared_socket.rs | 7 +- 14 files changed, 1622 insertions(+), 36 deletions(-) diff --git a/build.rs b/build.rs index d06d05e02..1439e86fd 100644 --- a/build.rs +++ b/build.rs @@ -39,11 +39,11 @@ fn main() { } Ok(output) => { let stderr = String::from_utf8_lossy(&output.stderr); - println!("cargo:warning=pnpm install failed: {}", stderr); + println!("cargo:warning=pnpm install failed: {stderr}"); return; } Err(e) => { - println!("cargo:warning=Failed to execute pnpm install: {}", e); + println!("cargo:warning=Failed to execute pnpm install: {e}"); return; } } @@ -77,10 +77,10 @@ fn main() { } Ok(output) => { let stderr = String::from_utf8_lossy(&output.stderr); - println!("cargo:warning=sandbox-executor build failed: {}", stderr); + println!("cargo:warning=sandbox-executor build failed: {stderr}"); } Err(e) => { - println!("cargo:warning=Failed to build sandbox-executor: {}", e); + println!("cargo:warning=Failed to build sandbox-executor: {e}"); } } } diff --git a/openapi.json b/openapi.json index bc49d1645..ae1270a5f 100644 --- a/openapi.json +++ b/openapi.json @@ -924,6 +924,269 @@ ] } }, + "/api/v1/plugins/{plugin_id}": { + "get": { + "tags": [ + "Plugins" + ], + "summary": "Get plugin by ID", + "operationId": "getPlugin", + "parameters": [ + { + "name": "plugin_id", + "in": "path", + "description": "The unique identifier of the plugin", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Plugin retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_PluginModel" + }, + "example": { + "data": { + "allow_get_invocation": false, + "config": { + "featureFlag": true + }, + "emit_logs": false, + "emit_traces": false, + "forward_logs": false, + "id": "my-plugin", + "path": "plugins/my-plugin.ts", + "raw_response": false, + "timeout": 30 + }, + "error": null, + "success": true + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Unauthorized", + "success": false + } + } + } + }, + "404": { + "description": "Plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Plugin with id my-plugin not found", + "success": false + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Too Many Requests", + "success": false + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Internal Server Error", + "success": false + } + } + } + } + }, + "security": [ + { + "bearer_auth": [] + } + ] + }, + "patch": { + "tags": [ + "Plugins" + ], + "summary": "Update plugin configuration", + "description": "Updates mutable plugin fields such as timeout, emit_logs, emit_traces,\nraw_response, allow_get_invocation, config, and forward_logs.\nThe plugin id and path cannot be changed after creation.\n\nAll fields are optional - only the provided fields will be updated.\nTo clear the `config` field, pass `\"config\": null`.", + "operationId": "updatePlugin", + "parameters": [ + { + "name": "plugin_id", + "in": "path", + "description": "The unique identifier of the plugin", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "Plugin configuration update. All fields are optional.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdatePluginRequest" + }, + "example": { + "config": { + "apiKey": "xyz123", + "featureFlag": true + }, + "emit_logs": true, + "forward_logs": true, + "timeout": 60 + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Plugin updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_PluginModel" + }, + "example": { + "data": { + "allow_get_invocation": false, + "config": { + "apiKey": "xyz123", + "featureFlag": true + }, + "emit_logs": true, + "emit_traces": false, + "forward_logs": true, + "id": "my-plugin", + "path": "plugins/my-plugin.ts", + "raw_response": false, + "timeout": 60 + }, + "error": null, + "success": true + } + } + } + }, + "400": { + "description": "Bad Request (invalid timeout or other validation error)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Timeout must be greater than 0", + "success": false + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Unauthorized", + "success": false + } + } + } + }, + "404": { + "description": "Plugin not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Plugin with id my-plugin not found", + "success": false + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Too Many Requests", + "success": false + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse_String" + }, + "example": { + "data": null, + "error": "Internal Server Error", + "success": false + } + } + } + } + }, + "security": [ + { + "bearer_auth": [] + } + ] + } + }, "/api/v1/plugins/{plugin_id}/call{route}": { "get": { "tags": [ @@ -4499,6 +4762,10 @@ "type": "boolean", "description": "Whether to include traces in the HTTP response" }, + "forward_logs": { + "type": "boolean", + "description": "Whether to forward plugin logs into the relayer's tracing output" + }, "id": { "type": "string", "description": "Plugin ID" @@ -4583,6 +4850,81 @@ } } }, + "ApiResponse_PluginModel": { + "type": "object", + "required": [ + "success" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "id", + "path", + "timeout" + ], + "properties": { + "allow_get_invocation": { + "type": "boolean", + "description": "Whether to allow GET requests to invoke plugin logic" + }, + "config": { + "type": [ + "object", + "null" + ], + "description": "User-defined configuration accessible to the plugin (must be a JSON object)", + "additionalProperties": {}, + "propertyNames": { + "type": "string" + } + }, + "emit_logs": { + "type": "boolean", + "description": "Whether to include logs in the HTTP response" + }, + "emit_traces": { + "type": "boolean", + "description": "Whether to include traces in the HTTP response" + }, + "forward_logs": { + "type": "boolean", + "description": "Whether to forward plugin logs into the relayer's tracing output" + }, + "id": { + "type": "string", + "description": "Plugin ID" + }, + "path": { + "type": "string", + "description": "Plugin path" + }, + "raw_response": { + "type": "boolean", + "description": "Whether to return raw plugin response without ApiResponse wrapper" + }, + "timeout": { + "type": "integer", + "format": "int64", + "description": "Plugin timeout", + "minimum": 0 + } + } + }, + "error": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/PluginMetadata" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationMeta" + }, + "success": { + "type": "boolean" + } + } + }, "ApiResponse_RelayerResponse": { "type": "object", "required": [ @@ -6986,6 +7328,10 @@ "type": "boolean", "description": "Whether to include traces in the HTTP response" }, + "forward_logs": { + "type": "boolean", + "description": "Whether to forward plugin logs into the relayer's tracing output" + }, "id": { "type": "string", "description": "Plugin ID" @@ -9355,6 +9701,68 @@ }, "additionalProperties": false }, + "UpdatePluginRequest": { + "type": "object", + "description": "Request model for updating an existing plugin.\nAll fields are optional to allow partial updates.\nNote: `id` and `path` are not updateable after creation.", + "properties": { + "allow_get_invocation": { + "type": [ + "boolean", + "null" + ], + "description": "Whether to allow GET requests to invoke plugin logic" + }, + "config": { + "type": [ + "object", + "null" + ], + "description": "User-defined configuration accessible to the plugin (must be a JSON object)\nUse `null` to clear the config", + "additionalProperties": {}, + "propertyNames": { + "type": "string" + } + }, + "emit_logs": { + "type": [ + "boolean", + "null" + ], + "description": "Whether to include logs in the HTTP response" + }, + "emit_traces": { + "type": [ + "boolean", + "null" + ], + "description": "Whether to include traces in the HTTP response" + }, + "forward_logs": { + "type": [ + "boolean", + "null" + ], + "description": "Whether to forward plugin logs into the relayer's tracing output" + }, + "raw_response": { + "type": [ + "boolean", + "null" + ], + "description": "Whether to return raw plugin response without ApiResponse wrapper" + }, + "timeout": { + "type": [ + "integer", + "null" + ], + "format": "int64", + "description": "Plugin timeout in seconds", + "minimum": 0 + } + }, + "additionalProperties": false + }, "UpdateRelayerRequest": { "type": "object", "properties": { diff --git a/src/api/controllers/plugin.rs b/src/api/controllers/plugin.rs index 5fe12937c..8271ff802 100644 --- a/src/api/controllers/plugin.rs +++ b/src/api/controllers/plugin.rs @@ -2,12 +2,14 @@ //! //! Handles HTTP endpoints for plugin operations including: //! - Calling plugins +//! - Listing plugins +//! - Updating plugin configuration use crate::{ jobs::JobProducerTrait, models::{ ApiError, ApiResponse, NetworkRepoModel, NotificationRepoModel, PaginationMeta, - PaginationQuery, PluginCallRequest, PluginModel, RelayerRepoModel, SignerRepoModel, - ThinDataAppState, TransactionRepoModel, + PaginationQuery, PluginCallRequest, PluginModel, PluginValidationError, RelayerRepoModel, + SignerRepoModel, ThinDataAppState, TransactionRepoModel, UpdatePluginRequest, }, repositories::{ ApiKeyRepositoryTrait, NetworkRepository, PluginRepositoryTrait, RelayerRepository, @@ -166,6 +168,91 @@ where ))) } +/// Get plugin by ID +/// +/// # Arguments +/// +/// * `plugin_id` - The ID of the plugin to retrieve. +/// * `state` - The application state containing the plugin repository. +/// +/// # Returns +/// +/// The plugin model if found. +pub async fn get_plugin( + plugin_id: String, + state: ThinDataAppState, +) -> Result +where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + Repository + Send + Sync + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, +{ + let plugin = state + .plugin_repository + .get_by_id(&plugin_id) + .await? + .ok_or_else(|| ApiError::NotFound(format!("Plugin with id {plugin_id} not found")))?; + + Ok(HttpResponse::Ok().json(ApiResponse::success(plugin))) +} + +/// Update plugin configuration +/// +/// Updates mutable plugin fields such as timeout, emit_logs, emit_traces, +/// raw_response, allow_get_invocation, config, and forward_logs. +/// The plugin id and path cannot be changed after creation. +/// +/// # Arguments +/// +/// * `plugin_id` - The ID of the plugin to update. +/// * `update_request` - The update request containing the fields to update. +/// * `state` - The application state containing the plugin repository. +/// +/// # Returns +/// +/// The updated plugin model. +pub async fn update_plugin( + plugin_id: String, + update_request: UpdatePluginRequest, + state: ThinDataAppState, +) -> Result +where + J: JobProducerTrait + Send + Sync + 'static, + RR: RelayerRepository + Repository + Send + Sync + 'static, + TR: TransactionRepository + Repository + Send + Sync + 'static, + NR: NetworkRepository + Repository + Send + Sync + 'static, + NFR: Repository + Send + Sync + 'static, + SR: Repository + Send + Sync + 'static, + TCR: TransactionCounterTrait + Send + Sync + 'static, + PR: PluginRepositoryTrait + Send + Sync + 'static, + AKR: ApiKeyRepositoryTrait + Send + Sync + 'static, +{ + // Get existing plugin + let plugin = state + .plugin_repository + .get_by_id(&plugin_id) + .await? + .ok_or_else(|| ApiError::NotFound(format!("Plugin with id {plugin_id} not found")))?; + + // Apply updates + let updated_plugin = plugin.apply_update(update_request).map_err(|e| match e { + PluginValidationError::InvalidTimeout(msg) => ApiError::BadRequest(msg), + })?; + + // Save the updated plugin + let saved_plugin = state.plugin_repository.update(updated_plugin).await?; + + tracing::info!(plugin_id = %plugin_id, "Plugin configuration updated"); + + Ok(HttpResponse::Ok().json(ApiResponse::success(saved_plugin))) +} + #[cfg(test)] mod tests { use std::time::Duration; @@ -324,6 +411,42 @@ mod tests { assert_eq!(http_response.status(), StatusCode::OK); } + #[actix_web::test] + async fn test_get_plugin_success() { + // Tests getting a plugin by ID + let plugin = PluginModel { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), + emit_logs: true, + emit_traces: false, + raw_response: false, + allow_get_invocation: true, + config: None, + forward_logs: true, + }; + let app_state = + create_mock_app_state(None, None, None, None, Some(vec![plugin]), None).await; + + let response = get_plugin("test-plugin".to_string(), web::ThinData(app_state)).await; + assert!(response.is_ok()); + let http_response = response.unwrap(); + assert_eq!(http_response.status(), StatusCode::OK); + } + + #[actix_web::test] + async fn test_get_plugin_not_found() { + // Tests getting a non-existent plugin + let app_state = create_mock_app_state(None, None, None, None, None, None).await; + + let response = get_plugin("non-existent".to_string(), web::ThinData(app_state)).await; + assert!(response.is_err()); + match response.unwrap_err() { + ApiError::NotFound(msg) => assert!(msg.contains("non-existent")), + _ => panic!("Expected NotFound error"), + } + } + #[actix_web::test] async fn test_call_plugin_with_raw_response() { // Tests that raw_response flag returns plugin result directly @@ -567,4 +690,254 @@ mod tests { assert!(response.metadata.is_none()); assert!(response.error.is_none()); } + + // ============================================================================ + // UPDATE PLUGIN CONTROLLER TESTS + // ============================================================================ + + #[actix_web::test] + async fn test_update_plugin_success() { + // Tests successful plugin update + let plugin = PluginModel { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Duration::from_secs(30), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + }; + let app_state = + create_mock_app_state(None, None, None, None, Some(vec![plugin]), None).await; + + let update_request = UpdatePluginRequest { + timeout: Some(60), + emit_logs: Some(true), + forward_logs: Some(true), + ..Default::default() + }; + + let response = update_plugin( + "test-plugin".to_string(), + update_request, + web::ThinData(app_state), + ) + .await; + + assert!(response.is_ok()); + let http_response = response.unwrap(); + assert_eq!(http_response.status(), StatusCode::OK); + } + + #[actix_web::test] + async fn test_update_plugin_not_found() { + // Tests update on non-existent plugin + let app_state = create_mock_app_state(None, None, None, None, None, None).await; + + let update_request = UpdatePluginRequest { + timeout: Some(60), + ..Default::default() + }; + + let response = update_plugin( + "non-existent".to_string(), + update_request, + web::ThinData(app_state), + ) + .await; + + assert!(response.is_err()); + match response.unwrap_err() { + ApiError::NotFound(msg) => assert!(msg.contains("non-existent")), + _ => panic!("Expected NotFound error"), + } + } + + #[actix_web::test] + async fn test_update_plugin_invalid_timeout() { + // Tests that timeout=0 returns BadRequest + let plugin = PluginModel { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Duration::from_secs(30), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + }; + let app_state = + create_mock_app_state(None, None, None, None, Some(vec![plugin]), None).await; + + let update_request = UpdatePluginRequest { + timeout: Some(0), // Invalid: timeout must be > 0 + ..Default::default() + }; + + let response = update_plugin( + "test-plugin".to_string(), + update_request, + web::ThinData(app_state), + ) + .await; + + assert!(response.is_err()); + match response.unwrap_err() { + ApiError::BadRequest(msg) => assert!(msg.contains("Timeout")), + _ => panic!("Expected BadRequest error"), + } + } + + #[actix_web::test] + async fn test_update_plugin_with_config() { + // Tests updating plugin config + let plugin = PluginModel { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Duration::from_secs(30), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + }; + let app_state = + create_mock_app_state(None, None, None, None, Some(vec![plugin]), None).await; + + let mut config_map = serde_json::Map::new(); + config_map.insert("feature_flag".to_string(), serde_json::json!(true)); + config_map.insert("api_key".to_string(), serde_json::json!("secret123")); + + let update_request = UpdatePluginRequest { + config: Some(Some(config_map)), + ..Default::default() + }; + + let response = update_plugin( + "test-plugin".to_string(), + update_request, + web::ThinData(app_state), + ) + .await; + + assert!(response.is_ok()); + let http_response = response.unwrap(); + assert_eq!(http_response.status(), StatusCode::OK); + } + + #[actix_web::test] + async fn test_update_plugin_clear_config() { + // Tests clearing plugin config by setting it to null + let mut initial_config = serde_json::Map::new(); + initial_config.insert("existing".to_string(), serde_json::json!("value")); + + let plugin = PluginModel { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Duration::from_secs(30), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: Some(initial_config), + forward_logs: false, + }; + let app_state = + create_mock_app_state(None, None, None, None, Some(vec![plugin]), None).await; + + // Setting config to Some(None) should clear it + let update_request = UpdatePluginRequest { + config: Some(None), + ..Default::default() + }; + + let response = update_plugin( + "test-plugin".to_string(), + update_request, + web::ThinData(app_state), + ) + .await; + + assert!(response.is_ok()); + let http_response = response.unwrap(); + assert_eq!(http_response.status(), StatusCode::OK); + } + + #[actix_web::test] + async fn test_update_plugin_all_fields() { + // Tests updating all mutable fields at once + let plugin = PluginModel { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Duration::from_secs(30), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + }; + let app_state = + create_mock_app_state(None, None, None, None, Some(vec![plugin]), None).await; + + let mut config_map = serde_json::Map::new(); + config_map.insert("key".to_string(), serde_json::json!("value")); + + let update_request = UpdatePluginRequest { + timeout: Some(120), + emit_logs: Some(true), + emit_traces: Some(true), + raw_response: Some(true), + allow_get_invocation: Some(true), + config: Some(Some(config_map)), + forward_logs: Some(true), + }; + + let response = update_plugin( + "test-plugin".to_string(), + update_request, + web::ThinData(app_state), + ) + .await; + + assert!(response.is_ok()); + let http_response = response.unwrap(); + assert_eq!(http_response.status(), StatusCode::OK); + } + + #[actix_web::test] + async fn test_update_plugin_empty_request() { + // Tests that an empty update request doesn't change anything (no-op) + let plugin = PluginModel { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Duration::from_secs(30), + emit_logs: true, + emit_traces: true, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: true, + }; + let app_state = + create_mock_app_state(None, None, None, None, Some(vec![plugin]), None).await; + + // Empty update request - all fields are None + let update_request = UpdatePluginRequest::default(); + + let response = update_plugin( + "test-plugin".to_string(), + update_request, + web::ThinData(app_state), + ) + .await; + + assert!(response.is_ok()); + let http_response = response.unwrap(); + assert_eq!(http_response.status(), StatusCode::OK); + } } diff --git a/src/api/routes/docs/plugin_docs.rs b/src/api/routes/docs/plugin_docs.rs index 922d8bdc2..58d177b06 100644 --- a/src/api/routes/docs/plugin_docs.rs +++ b/src/api/routes/docs/plugin_docs.rs @@ -1,5 +1,5 @@ use crate::{ - models::{ApiResponse, PluginCallRequest, PluginModel}, + models::{ApiResponse, PluginCallRequest, PluginModel, UpdatePluginRequest}, repositories::PaginatedResult, services::plugins::PluginHandlerError, }; @@ -286,3 +286,196 @@ fn doc_call_plugin_get() {} )] #[allow(dead_code)] fn doc_list_plugins() {} + +/// Get plugin by ID. +#[utoipa::path( + get, + path = "/api/v1/plugins/{plugin_id}", + tag = "Plugins", + operation_id = "getPlugin", + summary = "Get plugin by ID", + security( + ("bearer_auth" = []) + ), + params( + ("plugin_id" = String, Path, description = "The unique identifier of the plugin") + ), + responses( + ( + status = 200, + description = "Plugin retrieved successfully", + body = ApiResponse, + example = json!({ + "success": true, + "data": { + "id": "my-plugin", + "path": "plugins/my-plugin.ts", + "timeout": 30, + "emit_logs": false, + "emit_traces": false, + "raw_response": false, + "allow_get_invocation": false, + "config": { + "featureFlag": true + }, + "forward_logs": false + }, + "error": null + }) + ), + ( + status = 401, + description = "Unauthorized", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Unauthorized", + "data": null + }) + ), + ( + status = 404, + description = "Plugin not found", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Plugin with id my-plugin not found", + "data": null + }) + ), + ( + status = 429, + description = "Too Many Requests", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Too Many Requests", + "data": null + }) + ), + ( + status = 500, + description = "Internal server error", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Internal Server Error", + "data": null + }) + ) + ) +)] +#[allow(dead_code)] +fn doc_get_plugin() {} + +/// Update plugin configuration. +/// +/// Updates mutable plugin fields such as timeout, emit_logs, emit_traces, +/// raw_response, allow_get_invocation, config, and forward_logs. +/// The plugin id and path cannot be changed after creation. +/// +/// All fields are optional - only the provided fields will be updated. +/// To clear the `config` field, pass `"config": null`. +#[utoipa::path( + patch, + path = "/api/v1/plugins/{plugin_id}", + tag = "Plugins", + operation_id = "updatePlugin", + summary = "Update plugin configuration", + security( + ("bearer_auth" = []) + ), + params( + ("plugin_id" = String, Path, description = "The unique identifier of the plugin") + ), + request_body( + content = UpdatePluginRequest, + description = "Plugin configuration update. All fields are optional.", + example = json!({ + "timeout": 60, + "emit_logs": true, + "forward_logs": true, + "config": { + "featureFlag": true, + "apiKey": "xyz123" + } + }) + ), + responses( + ( + status = 200, + description = "Plugin updated successfully", + body = ApiResponse, + example = json!({ + "success": true, + "data": { + "id": "my-plugin", + "path": "plugins/my-plugin.ts", + "timeout": 60, + "emit_logs": true, + "emit_traces": false, + "raw_response": false, + "allow_get_invocation": false, + "config": { + "featureFlag": true, + "apiKey": "xyz123" + }, + "forward_logs": true + }, + "error": null + }) + ), + ( + status = 400, + description = "Bad Request (invalid timeout or other validation error)", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Timeout must be greater than 0", + "data": null + }) + ), + ( + status = 401, + description = "Unauthorized", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Unauthorized", + "data": null + }) + ), + ( + status = 404, + description = "Plugin not found", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Plugin with id my-plugin not found", + "data": null + }) + ), + ( + status = 429, + description = "Too Many Requests", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Too Many Requests", + "data": null + }) + ), + ( + status = 500, + description = "Internal server error", + body = ApiResponse, + example = json!({ + "success": false, + "error": "Internal Server Error", + "data": null + }) + ) + ) +)] +#[allow(dead_code)] +fn doc_update_plugin() {} diff --git a/src/api/routes/plugin.rs b/src/api/routes/plugin.rs index 69f5d7b43..cddf8efdb 100644 --- a/src/api/routes/plugin.rs +++ b/src/api/routes/plugin.rs @@ -5,10 +5,13 @@ use std::collections::HashMap; use crate::{ api::controllers::plugin, - models::{ApiError, ApiResponse, DefaultAppState, PaginationQuery, PluginCallRequest}, + models::{ + ApiError, ApiResponse, DefaultAppState, PaginationQuery, PluginCallRequest, + UpdatePluginRequest, + }, repositories::PluginRepositoryTrait, }; -use actix_web::{get, post, web, HttpRequest, HttpResponse, Responder}; +use actix_web::{get, patch, post, web, HttpRequest, HttpResponse, Responder}; use url::form_urlencoded; /// List plugins @@ -157,12 +160,35 @@ async fn plugin_call_get( plugin::call_plugin(plugin_id, plugin_call_request, data).await } +/// Get plugin by ID +#[get("/plugins/{plugin_id}")] +async fn get_plugin( + path: web::Path, + data: web::ThinData, +) -> impl Responder { + let plugin_id = path.into_inner(); + plugin::get_plugin(plugin_id, data).await +} + +/// Update plugin configuration +#[patch("/plugins/{plugin_id}")] +async fn update_plugin( + path: web::Path, + body: web::Json, + data: web::ThinData, +) -> impl Responder { + let plugin_id = path.into_inner(); + plugin::update_plugin(plugin_id, body.into_inner(), data).await +} + /// Initializes the routes for the plugins module. pub fn init(cfg: &mut web::ServiceConfig) { // Register routes with literal segments before routes with path parameters cfg.service(plugin_call); // POST /plugins/{plugin_id}/call cfg.service(plugin_call_get); // GET /plugins/{plugin_id}/call - cfg.service(list_plugins); // /plugins + cfg.service(get_plugin); // GET /plugins/{plugin_id} + cfg.service(update_plugin); // PATCH /plugins/{plugin_id} + cfg.service(list_plugins); // GET /plugins } #[cfg(test)] @@ -1677,4 +1703,326 @@ mod tests { resp.status() ); } + + // ============================================================================ + // GET PLUGIN ROUTE TESTS + // ============================================================================ + + /// Mock handler for get plugin that returns a plugin by ID + async fn mock_get_plugin(path: web::Path) -> impl Responder { + let plugin_id = path.into_inner(); + + if plugin_id == "not-found" { + return HttpResponse::NotFound().json(ApiResponse::<()>::error(format!( + "Plugin with id {} not found", + plugin_id + ))); + } + + let plugin = PluginModel { + id: plugin_id, + path: "test-path.ts".to_string(), + timeout: Duration::from_secs(30), + emit_logs: true, + emit_traces: false, + raw_response: false, + allow_get_invocation: true, + config: None, + forward_logs: true, + }; + + HttpResponse::Ok().json(ApiResponse::success(plugin)) + } + + #[actix_web::test] + async fn test_get_plugin_route_success() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}").route(web::get().to(mock_get_plugin)), + ) + .configure(init), + ) + .await; + + let req = test::TestRequest::get() + .uri("/plugins/my-plugin") + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_success()); + + let body = test::read_body(resp).await; + let response: ApiResponse = serde_json::from_slice(&body).unwrap(); + assert!(response.success); + assert_eq!(response.data.as_ref().unwrap().id, "my-plugin"); + assert!(response.data.as_ref().unwrap().emit_logs); + assert!(response.data.as_ref().unwrap().forward_logs); + } + + #[actix_web::test] + async fn test_get_plugin_route_not_found() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}").route(web::get().to(mock_get_plugin)), + ) + .configure(init), + ) + .await; + + let req = test::TestRequest::get() + .uri("/plugins/not-found") + .to_request(); + + let resp = test::call_service(&app, req).await; + assert_eq!(resp.status(), actix_web::http::StatusCode::NOT_FOUND); + } + + // ============================================================================ + // UPDATE PLUGIN ROUTE TESTS + // ============================================================================ + + /// Mock handler for update plugin that returns the updated plugin + async fn mock_update_plugin( + path: web::Path, + body: web::Json, + ) -> impl Responder { + let plugin_id = path.into_inner(); + let update = body.into_inner(); + + // Simulate successful update + let updated_plugin = PluginModel { + id: plugin_id, + path: "test-path".to_string(), + timeout: Duration::from_secs(update.timeout.unwrap_or(30)), + emit_logs: update.emit_logs.unwrap_or(false), + emit_traces: update.emit_traces.unwrap_or(false), + raw_response: update.raw_response.unwrap_or(false), + allow_get_invocation: update.allow_get_invocation.unwrap_or(false), + config: update.config.flatten(), + forward_logs: update.forward_logs.unwrap_or(false), + }; + + HttpResponse::Ok().json(ApiResponse::success(updated_plugin)) + } + + #[actix_web::test] + async fn test_update_plugin_route_success() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}") + .route(web::patch().to(mock_update_plugin)), + ) + .configure(init), + ) + .await; + + let req = test::TestRequest::patch() + .uri("/plugins/test-plugin") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({ + "timeout": 60, + "emit_logs": true, + "forward_logs": true + })) + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_success()); + + let body = test::read_body(resp).await; + let response: ApiResponse = serde_json::from_slice(&body).unwrap(); + assert!(response.success); + assert_eq!(response.data.as_ref().unwrap().id, "test-plugin"); + assert_eq!( + response.data.as_ref().unwrap().timeout, + Duration::from_secs(60) + ); + assert!(response.data.as_ref().unwrap().emit_logs); + assert!(response.data.as_ref().unwrap().forward_logs); + } + + #[actix_web::test] + async fn test_update_plugin_route_with_config() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}") + .route(web::patch().to(mock_update_plugin)), + ) + .configure(init), + ) + .await; + + let req = test::TestRequest::patch() + .uri("/plugins/my-plugin") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({ + "config": { + "feature_enabled": true, + "api_key": "secret123" + } + })) + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_success()); + + let body = test::read_body(resp).await; + let response: ApiResponse = serde_json::from_slice(&body).unwrap(); + assert!(response.success); + assert!(response.data.as_ref().unwrap().config.is_some()); + let config = response.data.as_ref().unwrap().config.as_ref().unwrap(); + assert_eq!( + config.get("feature_enabled"), + Some(&serde_json::json!(true)) + ); + assert_eq!(config.get("api_key"), Some(&serde_json::json!("secret123"))); + } + + #[actix_web::test] + async fn test_update_plugin_route_clear_config() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}") + .route(web::patch().to(mock_update_plugin)), + ) + .configure(init), + ) + .await; + + let req = test::TestRequest::patch() + .uri("/plugins/test-plugin") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({ + "config": null + })) + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_success()); + + let body = test::read_body(resp).await; + let response: ApiResponse = serde_json::from_slice(&body).unwrap(); + assert!(response.success); + assert!(response.data.as_ref().unwrap().config.is_none()); + } + + #[actix_web::test] + async fn test_update_plugin_route_empty_body() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}") + .route(web::patch().to(mock_update_plugin)), + ) + .configure(init), + ) + .await; + + // Empty JSON object - no fields to update + let req = test::TestRequest::patch() + .uri("/plugins/test-plugin") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({})) + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_success()); + } + + #[actix_web::test] + async fn test_update_plugin_route_all_fields() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}") + .route(web::patch().to(mock_update_plugin)), + ) + .configure(init), + ) + .await; + + let req = test::TestRequest::patch() + .uri("/plugins/full-update-plugin") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({ + "timeout": 120, + "emit_logs": true, + "emit_traces": true, + "raw_response": true, + "allow_get_invocation": true, + "forward_logs": true, + "config": { + "key": "value" + } + })) + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_success()); + + let body = test::read_body(resp).await; + let response: ApiResponse = serde_json::from_slice(&body).unwrap(); + let plugin = response.data.unwrap(); + + assert_eq!(plugin.timeout, Duration::from_secs(120)); + assert!(plugin.emit_logs); + assert!(plugin.emit_traces); + assert!(plugin.raw_response); + assert!(plugin.allow_get_invocation); + assert!(plugin.forward_logs); + assert!(plugin.config.is_some()); + } + + #[actix_web::test] + async fn test_update_plugin_route_invalid_json() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}") + .route(web::patch().to(mock_update_plugin)), + ) + .configure(init), + ) + .await; + + let req = test::TestRequest::patch() + .uri("/plugins/test-plugin") + .insert_header(("Content-Type", "application/json")) + .set_payload("{ invalid json }") + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_client_error()); + } + + #[actix_web::test] + async fn test_update_plugin_route_unknown_field_rejected() { + let app = test::init_service( + App::new() + .service( + web::resource("/plugins/{plugin_id}") + .route(web::patch().to(mock_update_plugin)), + ) + .configure(init), + ) + .await; + + // UpdatePluginRequest has deny_unknown_fields, so this should fail + let req = test::TestRequest::patch() + .uri("/plugins/test-plugin") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({ + "timeout": 60, + "unknown_field": "should_fail" + })) + .to_request(); + + let resp = test::call_service(&app, req).await; + assert!(resp.status().is_client_error()); + } } diff --git a/src/models/plugin.rs b/src/models/plugin.rs index 7ea1d9ca7..7edda0c7f 100644 --- a/src/models/plugin.rs +++ b/src/models/plugin.rs @@ -4,6 +4,8 @@ use serde::{Deserialize, Serialize}; use serde_json::Map; use utoipa::ToSchema; +use crate::constants::DEFAULT_PLUGIN_TIMEOUT_SECONDS; + #[derive(Debug, Clone, Serialize, Deserialize, ToSchema)] pub struct PluginModel { /// Plugin ID @@ -51,3 +53,197 @@ pub struct PluginCallRequest { #[serde(default, skip_deserializing)] pub query: Option>>, } + +/// Request model for updating an existing plugin. +/// All fields are optional to allow partial updates. +/// Note: `id` and `path` are not updateable after creation. +#[derive(Debug, Clone, Serialize, Deserialize, Default, ToSchema)] +#[serde(deny_unknown_fields)] +pub struct UpdatePluginRequest { + /// Plugin timeout in seconds + #[schema(value_type = Option)] + pub timeout: Option, + /// Whether to include logs in the HTTP response + pub emit_logs: Option, + /// Whether to include traces in the HTTP response + pub emit_traces: Option, + /// Whether to return raw plugin response without ApiResponse wrapper + pub raw_response: Option, + /// Whether to allow GET requests to invoke plugin logic + pub allow_get_invocation: Option, + /// User-defined configuration accessible to the plugin (must be a JSON object) + /// Use `null` to clear the config + #[serde(default, skip_serializing_if = "Option::is_none")] + pub config: Option>>, + /// Whether to forward plugin logs into the relayer's tracing output + pub forward_logs: Option, +} + +/// Validation errors for plugin updates +#[derive(Debug, thiserror::Error)] +pub enum PluginValidationError { + #[error("Invalid timeout: {0}")] + InvalidTimeout(String), +} + +impl PluginModel { + /// Apply an update request to this plugin model. + /// Returns the updated plugin model or a validation error. + pub fn apply_update(&self, update: UpdatePluginRequest) -> Result { + let mut updated = self.clone(); + + if let Some(timeout_secs) = update.timeout { + if timeout_secs == 0 { + return Err(PluginValidationError::InvalidTimeout( + "Timeout must be greater than 0".to_string(), + )); + } + updated.timeout = Duration::from_secs(timeout_secs); + } + + if let Some(emit_logs) = update.emit_logs { + updated.emit_logs = emit_logs; + } + + if let Some(emit_traces) = update.emit_traces { + updated.emit_traces = emit_traces; + } + + if let Some(raw_response) = update.raw_response { + updated.raw_response = raw_response; + } + + if let Some(allow_get_invocation) = update.allow_get_invocation { + updated.allow_get_invocation = allow_get_invocation; + } + + // config uses Option> to distinguish between: + // - None: field not provided, don't change + // - Some(None): explicitly set to null, clear the config + // - Some(Some(value)): update to new value + if let Some(config) = update.config { + updated.config = config; + } + + if let Some(forward_logs) = update.forward_logs { + updated.forward_logs = forward_logs; + } + + Ok(updated) + } +} + +impl Default for PluginModel { + fn default() -> Self { + Self { + id: String::new(), + path: String::new(), + timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn create_test_plugin() -> PluginModel { + PluginModel { + id: "test-plugin".to_string(), + path: "plugins/test.ts".to_string(), + timeout: Duration::from_secs(30), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + } + } + + #[test] + fn test_apply_update_timeout() { + let plugin = create_test_plugin(); + let update = UpdatePluginRequest { + timeout: Some(60), + ..Default::default() + }; + + let updated = plugin.apply_update(update).unwrap(); + assert_eq!(updated.timeout, Duration::from_secs(60)); + // Other fields unchanged + assert_eq!(updated.emit_logs, false); + } + + #[test] + fn test_apply_update_timeout_zero_fails() { + let plugin = create_test_plugin(); + let update = UpdatePluginRequest { + timeout: Some(0), + ..Default::default() + }; + + let result = plugin.apply_update(update); + assert!(result.is_err()); + } + + #[test] + fn test_apply_update_all_fields() { + let plugin = create_test_plugin(); + let mut config_map = Map::new(); + config_map.insert("key".to_string(), serde_json::json!("value")); + + let update = UpdatePluginRequest { + timeout: Some(120), + emit_logs: Some(true), + emit_traces: Some(true), + raw_response: Some(true), + allow_get_invocation: Some(true), + config: Some(Some(config_map.clone())), + forward_logs: Some(true), + }; + + let updated = plugin.apply_update(update).unwrap(); + assert_eq!(updated.timeout, Duration::from_secs(120)); + assert!(updated.emit_logs); + assert!(updated.emit_traces); + assert!(updated.raw_response); + assert!(updated.allow_get_invocation); + assert_eq!(updated.config, Some(config_map)); + assert!(updated.forward_logs); + } + + #[test] + fn test_apply_update_clear_config() { + let mut plugin = create_test_plugin(); + let mut config_map = Map::new(); + config_map.insert("key".to_string(), serde_json::json!("value")); + plugin.config = Some(config_map); + + // Clear config by setting to null + let update = UpdatePluginRequest { + config: Some(None), + ..Default::default() + }; + + let updated = plugin.apply_update(update).unwrap(); + assert!(updated.config.is_none()); + } + + #[test] + fn test_apply_update_no_changes() { + let plugin = create_test_plugin(); + let update = UpdatePluginRequest::default(); + + let updated = plugin.apply_update(update).unwrap(); + assert_eq!(updated.id, plugin.id); + assert_eq!(updated.path, plugin.path); + assert_eq!(updated.timeout, plugin.timeout); + } +} diff --git a/src/openapi.rs b/src/openapi.rs index 4dfae6bce..4a2a09e1d 100644 --- a/src/openapi.rs +++ b/src/openapi.rs @@ -85,6 +85,8 @@ impl Modify for SecurityAddon { plugin_docs::doc_call_plugin, plugin_docs::doc_call_plugin_get, plugin_docs::doc_list_plugins, + plugin_docs::doc_get_plugin, + plugin_docs::doc_update_plugin, notification_docs::doc_list_notifications, notification_docs::doc_get_notification, notification_docs::doc_create_notification, @@ -116,6 +118,7 @@ impl Modify for SecurityAddon { domain::SignTransactionExternalResponse, models::PluginCallRequest, models::PluginMetadata, + models::UpdatePluginRequest, plugins::PluginHandlerError, plugins::LogEntry, plugins::LogLevel diff --git a/src/repositories/plugin/mod.rs b/src/repositories/plugin/mod.rs index ac56f9592..3072e994e 100644 --- a/src/repositories/plugin/mod.rs +++ b/src/repositories/plugin/mod.rs @@ -50,6 +50,8 @@ pub trait PluginRepositoryTrait { // Plugin CRUD operations async fn get_by_id(&self, id: &str) -> Result, RepositoryError>; async fn add(&self, plugin: PluginModel) -> Result<(), RepositoryError>; + /// Update an existing plugin. Returns the updated plugin if found. + async fn update(&self, plugin: PluginModel) -> Result; async fn list_paginated( &self, query: PaginationQuery, @@ -115,6 +117,13 @@ impl PluginRepositoryTrait for PluginRepositoryStorage { } } + async fn update(&self, plugin: PluginModel) -> Result { + match self { + PluginRepositoryStorage::InMemory(repo) => repo.update(plugin).await, + PluginRepositoryStorage::Redis(repo) => repo.update(plugin).await, + } + } + async fn list_paginated( &self, query: PaginationQuery, diff --git a/src/repositories/plugin/plugin_in_memory.rs b/src/repositories/plugin/plugin_in_memory.rs index dc466ba9f..ec3fcf10b 100644 --- a/src/repositories/plugin/plugin_in_memory.rs +++ b/src/repositories/plugin/plugin_in_memory.rs @@ -84,6 +84,18 @@ impl PluginRepositoryTrait for InMemoryPluginRepository { Ok(()) } + async fn update(&self, plugin: PluginModel) -> Result { + let mut store = Self::acquire_lock(&self.store).await?; + if !store.contains_key(&plugin.id) { + return Err(RepositoryError::NotFound(format!( + "Plugin with id {} not found", + plugin.id + ))); + } + store.insert(plugin.id.clone(), plugin.clone()); + Ok(plugin) + } + async fn list_paginated( &self, query: PaginationQuery, diff --git a/src/repositories/plugin/plugin_redis.rs b/src/repositories/plugin/plugin_redis.rs index 7d6c34534..12984956f 100644 --- a/src/repositories/plugin/plugin_redis.rs +++ b/src/repositories/plugin/plugin_redis.rs @@ -216,6 +216,43 @@ impl PluginRepositoryTrait for RedisPluginRepository { Ok(()) } + async fn update(&self, plugin: PluginModel) -> Result { + if plugin.id.is_empty() { + return Err(RepositoryError::InvalidData( + "Plugin ID cannot be empty".to_string(), + )); + } + + let mut conn = self.client.as_ref().clone(); + let key = self.plugin_key(&plugin.id); + + debug!(plugin_id = %plugin.id, "updating plugin"); + + // Check if plugin exists + let exists: bool = conn + .exists(&key) + .await + .map_err(|e| self.map_redis_error(e, &format!("check_plugin_exists_{}", plugin.id)))?; + + if !exists { + return Err(RepositoryError::NotFound(format!( + "Plugin with ID {} not found", + plugin.id + ))); + } + + // Serialize plugin + let json = self.serialize_entity(&plugin, |p| &p.id, "plugin")?; + + // Update the plugin data + conn.set::<_, _, ()>(&key, &json) + .await + .map_err(|e| self.map_redis_error(e, &format!("update_plugin_{}", plugin.id)))?; + + debug!(plugin_id = %plugin.id, "successfully updated plugin"); + Ok(plugin) + } + async fn list_paginated( &self, query: PaginationQuery, diff --git a/src/services/plugins/mod.rs b/src/services/plugins/mod.rs index 61129479b..e09e05e4e 100644 --- a/src/services/plugins/mod.rs +++ b/src/services/plugins/mod.rs @@ -477,7 +477,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![LogEntry { level: LogLevel::Log, @@ -783,7 +783,7 @@ mod tests { plugin_runner .expect_run::() - .returning(move |_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(move |_, _, _, _, _, _, _, _, _, _, _, _, _| { Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { status: 400, message: "Plugin handler error".to_string(), @@ -845,7 +845,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _| { Err(PluginError::PluginExecutionError("Fatal error".to_string())) }); @@ -892,7 +892,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![LogEntry { level: LogLevel::Log, @@ -989,7 +989,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![ LogEntry { @@ -1075,7 +1075,7 @@ mod tests { let mut plugin_runner = MockPluginRunnerTrait::default(); plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![LogEntry { level: LogLevel::Warn, @@ -1136,7 +1136,7 @@ mod tests { let mut plugin_runner = MockPluginRunnerTrait::default(); plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _| { Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { status: 400, message: "handler failed".to_string(), @@ -1191,7 +1191,7 @@ mod tests { plugin_runner .expect_run::() - .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _, _| { + .returning(|_, _, _, _, _, _, _, _, _, _, _, _, _| { Ok(ScriptResult { logs: vec![], error: "".to_string(), @@ -1252,7 +1252,7 @@ mod tests { plugin_runner .expect_run::() - .returning(move |_, _, _, _, _, _, headers_json, _, _, _, _, _, _, _| { + .returning(move |_, _, _, _, _, _, headers_json, _, _, _, _, _, _| { // Capture the headers_json parameter *captured_headers_clone.lock().unwrap() = headers_json; Ok(ScriptResult { @@ -1335,7 +1335,7 @@ mod tests { plugin_runner .expect_run::() - .returning(move |_, _, _, _, _, _, headers_json, _, _, _, _, _, _, _| { + .returning(move |_, _, _, _, _, _, headers_json, _, _, _, _, _, _| { *captured_headers_clone.lock().unwrap() = headers_json; Ok(ScriptResult { logs: vec![], diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index 058a54696..c5944265f 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -70,6 +70,12 @@ pub struct PoolManager { shutdown_signal: Arc, } +impl Default for PoolManager { + fn default() -> Self { + Self::new() + } +} + impl PoolManager { /// Create a new PoolManager with default socket path pub fn new() -> Self { @@ -265,7 +271,7 @@ impl PoolManager { let elapsed = start.elapsed(); if let Err(ref e) = result { - let error_str = format!("{:?}", e); + let error_str = format!("{e:?}"); if error_str.contains("shutdown") || error_str.contains("Shutdown") { tracing::debug!( worker_id = worker_id, @@ -496,10 +502,10 @@ impl PoolManager { return Ok(()); } - if !self + if self .health_check_needed .compare_exchange(true, false, Ordering::Relaxed, Ordering::Relaxed) - .is_ok() + .is_err() { return Ok(()); } @@ -622,7 +628,7 @@ impl PoolManager { "Spawning plugin pool server" ); - let node_options = format!("--max-old-space-size={} --expose-gc", pool_server_heap_mb); + let node_options = format!("--max-old-space-size={pool_server_heap_mb} --expose-gc"); let mut child = Command::new("ts-node") .arg("--transpile-only") @@ -659,7 +665,7 @@ impl PoolManager { .stderr(Stdio::piped()) .spawn() .map_err(|e| { - PluginError::PluginExecutionError(format!("Failed to {} pool server: {e}", context)) + PluginError::PluginExecutionError(format!("Failed to {context} pool server: {e}")) })?; if let Some(stderr) = child.stderr.take() { @@ -689,8 +695,7 @@ impl PoolManager { Ok(Err(e)) => return Err(e), Err(_) => { return Err(PluginError::PluginExecutionError(format!( - "Timeout waiting for pool server to {}", - context + "Timeout waiting for pool server to {context}" ))) } } @@ -1086,9 +1091,9 @@ impl PoolManager { return Ok(HealthStatus { healthy: is_pool_exhausted, status: if is_pool_exhausted { - format!("pool_exhausted: {}", e) + format!("pool_exhausted: {e}") } else { - format!("connection_failed: {}", e) + format!("connection_failed: {e}") }, uptime_ms: None, memory: None, @@ -1181,7 +1186,7 @@ impl PoolManager { conn.mark_unhealthy(); Ok(HealthStatus { healthy: false, - status: format!("request_failed: {}", e), + status: format!("request_failed: {e}"), uptime_ms: None, memory: None, pool_completed: None, @@ -1386,8 +1391,7 @@ impl PoolManager { Ok(c) => c, Err(e) => { return Err(PluginError::PluginExecutionError(format!( - "Failed to connect for shutdown: {}", - e + "Failed to connect for shutdown: {e}" ))); } }; diff --git a/src/services/plugins/protocol.rs b/src/services/plugins/protocol.rs index 59937b6b3..5d660fd70 100644 --- a/src/services/plugins/protocol.rs +++ b/src/services/plugins/protocol.rs @@ -137,6 +137,10 @@ mod tests { socket_path: "/tmp/test.sock".to_string(), http_request_id: Some("req-456".to_string()), timeout: Some(30000), + route: None, + config: None, + method: None, + query: None, }; let json = serde_json::to_string(&request).unwrap(); diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs index fb7e15d2a..5fb669975 100644 --- a/src/services/plugins/shared_socket.rs +++ b/src/services/plugins/shared_socket.rs @@ -115,7 +115,7 @@ //! // (handled automatically by the background listener) //! //! // Collect traces when done -//! let traces_rx = guard.into_receiver(); +//! let mut traces_rx = guard.into_receiver(); //! let traces = traces_rx.recv().await; //! # Ok(()) //! # } @@ -349,7 +349,7 @@ impl SharedSocketService { // Create the listener and move it into the task let listener = UnixListener::bind(&self.socket_path) - .map_err(|e| PluginError::SocketError(format!("Failed to bind listener: {}", e)))?; + .map_err(|e| PluginError::SocketError(format!("Failed to bind listener: {e}")))?; let executions = self.executions.clone(); let relayer_api = Arc::new(RelayerApi); let socket_path = self.socket_path.clone(); @@ -714,8 +714,7 @@ pub fn get_shared_socket_service() -> Result, PluginErr match result { Ok(service) => Ok(service.clone()), Err(e) => Err(PluginError::SocketError(format!( - "Failed to create shared socket service: {}", - e + "Failed to create shared socket service: {e}" ))), } } From 748275ab0f58a1f22abcc79c346ed835edbde4e3 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 12 Jan 2026 13:28:41 +0100 Subject: [PATCH 13/42] chore: Improvements --- openapi.json | 24 +- plugins/lib/sandbox-executor.js | 32278 --------------------------- src/api/routes/docs/plugin_docs.rs | 25 +- src/api/routes/plugin.rs | 92 +- 4 files changed, 107 insertions(+), 32312 deletions(-) delete mode 100644 plugins/lib/sandbox-executor.js diff --git a/openapi.json b/openapi.json index ae1270a5f..4c5048ab5 100644 --- a/openapi.json +++ b/openapi.json @@ -1187,13 +1187,13 @@ ] } }, - "/api/v1/plugins/{plugin_id}/call{route}": { + "/api/v1/plugins/{plugin_id}/call": { "get": { "tags": [ "Plugins" ], "summary": "Execute a plugin via GET (must be enabled per plugin)", - "description": "This endpoint is disabled by default. To enable it for a given plugin, set\n`allow_get_invocation: true` in the plugin configuration.\n\nWhen invoked via GET:\n- `params` is an empty object (`{}`)\n- query parameters are passed to the plugin handler via `context.query`\n- wildcard route routing is supported the same way as POST (see `doc_call_plugin`)", + "description": "This endpoint is disabled by default. To enable it for a given plugin, set\n`allow_get_invocation: true` in the plugin configuration.\n\nWhen invoked via GET:\n- `params` is an empty object (`{}`)\n- query parameters are passed to the plugin handler via `context.query`\n- wildcard route routing is supported the same way as POST (see `doc_call_plugin`)\n- Use the `route` query parameter or append the route to the URL path", "operationId": "callPluginGet", "parameters": [ { @@ -1207,13 +1207,12 @@ }, { "name": "route", - "in": "path", - "description": "Optional route suffix captured by the server. Use an empty string for the default route, or include a leading slash (e.g. '/supported'). May include additional slashes for nested routes.", - "required": true, + "in": "query", + "description": "Optional route suffix for custom routing (e.g., '/verify'). Alternative to appending the route to the URL path.", + "required": false, "schema": { "type": "string" - }, - "example": "/supported" + } } ], "responses": { @@ -1314,7 +1313,7 @@ "Plugins" ], "summary": "Execute a plugin with optional wildcard route routing", - "description": "Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`.\nPlugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived\nmessage so downstream clients receive a stable shape regardless of how the handler threw.\n\nThe endpoint supports wildcard route routing, allowing plugins to implement custom routing logic:\n- `/api/v1/plugins/{plugin_id}/call` - Default endpoint (route = \"\")\n- `/api/v1/plugins/{plugin_id}/call/verify` - Custom route (route = \"/verify\")\n- `/api/v1/plugins/{plugin_id}/call/settle` - Custom route (route = \"/settle\")\n- `/api/v1/plugins/{plugin_id}/call/api/v1/action` - Nested route (route = \"/api/v1/action\")\n\nThe route is passed to the plugin handler via the `context.route` field.", + "description": "Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`.\nPlugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived\nmessage so downstream clients receive a stable shape regardless of how the handler threw.\n\nThe endpoint supports wildcard route routing, allowing plugins to implement custom routing logic:\n- `/api/v1/plugins/{plugin_id}/call` - Default endpoint (route = \"\")\n- `/api/v1/plugins/{plugin_id}/call?route=/verify` - Custom route via query parameter\n- `/api/v1/plugins/{plugin_id}/call/verify` - Custom route via URL path (route = \"/verify\")\n\nThe route is passed to the plugin handler via the `context.route` field.\nYou can specify a custom route either by appending it to the URL path or by using the `route` query parameter.", "operationId": "callPlugin", "parameters": [ { @@ -1328,13 +1327,12 @@ }, { "name": "route", - "in": "path", - "description": "Optional route suffix captured by the server. Use an empty string for the default route, or include a leading slash (e.g. '/verify'). May include additional slashes for nested routes (e.g. '/api/v1/action').", - "required": true, + "in": "query", + "description": "Optional route suffix for custom routing (e.g., '/verify'). Alternative to appending the route to the URL path.", + "required": false, "schema": { "type": "string" - }, - "example": "/verify" + } } ], "requestBody": { diff --git a/plugins/lib/sandbox-executor.js b/plugins/lib/sandbox-executor.js deleted file mode 100644 index 055e4c1c2..000000000 --- a/plugins/lib/sandbox-executor.js +++ /dev/null @@ -1,32278 +0,0 @@ -/** - * Auto-generated by build-executor.ts - * Build time: 2026-01-12T10:33:25.629Z - * Node version: v25.2.1 - * Source: sandbox-executor.ts - * Source hash: 05ea2a406d1db670 - * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts - */ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json -var require_commands = __commonJS({ - "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json"(exports2, module2) { - module2.exports = { - acl: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - append: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - asking: { - arity: 1, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - auth: { - arity: -2, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bgrewriteaof: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bgsave: { - arity: -1, - flags: [ - "admin", - "noscript", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bitcount: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitfield: { - arity: -2, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitfield_ro: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitop: { - arity: -4, - flags: [ - "write", - "denyoom" - ], - keyStart: 2, - keyStop: -1, - step: 1 - }, - bitpos: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - blmove: { - arity: 6, - flags: [ - "write", - "denyoom", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - blmpop: { - arity: -5, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - blpop: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - brpop: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - brpoplpush: { - arity: 4, - flags: [ - "write", - "denyoom", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - bzmpop: { - arity: -5, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bzpopmax: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking", - "fast" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - bzpopmin: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking", - "fast" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - client: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - cluster: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - command: { - arity: -1, - flags: [ - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - config: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - copy: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - dbsize: { - arity: 1, - flags: [ - "readonly", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - debug: { - arity: -2, - flags: [ - "admin", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - decr: { - arity: 2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - decrby: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - del: { - arity: -2, - flags: [ - "write" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - discard: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - dump: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - echo: { - arity: 2, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - eval: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - eval_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - evalsha: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - evalsha_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - exec: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "skip_slowlog" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - exists: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - expire: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - expireat: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - expiretime: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - failover: { - arity: -1, - flags: [ - "admin", - "noscript", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - fcall: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - fcall_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - flushall: { - arity: -1, - flags: [ - "write" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - flushdb: { - arity: -1, - flags: [ - "write" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - function: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - geoadd: { - arity: -5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geodist: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geohash: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geopos: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadius: { - arity: -6, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadius_ro: { - arity: -6, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadiusbymember: { - arity: -5, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadiusbymember_ro: { - arity: -5, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geosearch: { - arity: -7, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geosearchstore: { - arity: -8, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - get: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getbit: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getdel: { - arity: 2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getex: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getrange: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getset: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hdel: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hello: { - arity: -1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - hexists: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hexpire: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hpexpire: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hget: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hgetall: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hincrby: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hincrbyfloat: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hkeys: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hmget: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hmset: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hrandfield: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hset: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hsetnx: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hstrlen: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hvals: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incr: { - arity: 2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incrby: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incrbyfloat: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - info: { - arity: -1, - flags: [ - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - keys: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lastsave: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - latency: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lcs: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - lindex: { - arity: 3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - linsert: { - arity: 5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - llen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lmove: { - arity: 5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - lmpop: { - arity: -4, - flags: [ - "write", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lolwut: { - arity: -1, - flags: [ - "readonly", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lpop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpos: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpush: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpushx: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lrange: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lrem: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lset: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - ltrim: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - memory: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - mget: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - migrate: { - arity: -6, - flags: [ - "write", - "movablekeys" - ], - keyStart: 3, - keyStop: 3, - step: 1 - }, - module: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - monitor: { - arity: 1, - flags: [ - "admin", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - move: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - mset: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 2 - }, - msetnx: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 2 - }, - multi: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - object: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - persist: { - arity: 2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpire: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpireat: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpiretime: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pfadd: { - arity: -2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pfcount: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - pfdebug: { - arity: 3, - flags: [ - "write", - "denyoom", - "admin" - ], - keyStart: 2, - keyStop: 2, - step: 1 - }, - pfmerge: { - arity: -2, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - pfselftest: { - arity: 1, - flags: [ - "admin" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - ping: { - arity: -1, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - psetex: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - psubscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - psync: { - arity: -3, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - pttl: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - publish: { - arity: 3, - flags: [ - "pubsub", - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - pubsub: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - punsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - quit: { - arity: -1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - randomkey: { - arity: 1, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - readonly: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - readwrite: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - rename: { - arity: 3, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - renamenx: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - replconf: { - arity: -1, - flags: [ - "admin", - "noscript", - "loading", - "stale", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - replicaof: { - arity: 3, - flags: [ - "admin", - "noscript", - "stale", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - reset: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - restore: { - arity: -4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - "restore-asking": { - arity: -4, - flags: [ - "write", - "denyoom", - "asking" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - role: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - rpop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - rpoplpush: { - arity: 3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - rpush: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - rpushx: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sadd: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - save: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - scan: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - scard: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - script: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sdiff: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sdiffstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - select: { - arity: 2, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - set: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setbit: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setex: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setnx: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setrange: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - shutdown: { - arity: -1, - flags: [ - "admin", - "noscript", - "loading", - "stale", - "no_multi", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sinter: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sintercard: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sinterstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sismember: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - slaveof: { - arity: 3, - flags: [ - "admin", - "noscript", - "stale", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - slowlog: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - smembers: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - smismember: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - smove: { - arity: 4, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - sort: { - arity: -2, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sort_ro: { - arity: -2, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - spop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - spublish: { - arity: 3, - flags: [ - "pubsub", - "loading", - "stale", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - srandmember: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - srem: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - ssubscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - strlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - subscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - substr: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sunion: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sunionstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sunsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - swapdb: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sync: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - time: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - touch: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - ttl: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - type: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - unlink: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - unsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - unwatch: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - wait: { - arity: 3, - flags: [ - "noscript" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - watch: { - arity: -2, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - xack: { - arity: -4, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xadd: { - arity: -5, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xautoclaim: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xclaim: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xdel: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xdelex: { - arity: -5, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xgroup: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xinfo: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xpending: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xread: { - arity: -4, - flags: [ - "readonly", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xreadgroup: { - arity: -7, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xrevrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xsetid: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xtrim: { - arity: -4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zadd: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zcard: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zcount: { - arity: 4, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zdiff: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zdiffstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zincrby: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zinter: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zintercard: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zinterstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zlexcount: { - arity: 4, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zmpop: { - arity: -4, - flags: [ - "write", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zmscore: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zpopmax: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zpopmin: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrandmember: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangebylex: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangebyscore: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangestore: { - arity: -5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - zrank: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrem: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebylex: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebyrank: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebyscore: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrangebylex: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrangebyscore: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrank: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zscore: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zunion: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zunionstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - } - }; - } -}); - -// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js -var require_built = __commonJS({ - "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js"(exports2) { - "use strict"; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getKeyIndexes = exports2.hasFlag = exports2.exists = exports2.list = void 0; - var commands_json_1 = __importDefault(require_commands()); - exports2.list = Object.keys(commands_json_1.default); - var flags = {}; - exports2.list.forEach((commandName) => { - flags[commandName] = commands_json_1.default[commandName].flags.reduce(function(flags2, flag) { - flags2[flag] = true; - return flags2; - }, {}); - }); - function exists(commandName) { - return Boolean(commands_json_1.default[commandName]); - } - exports2.exists = exists; - function hasFlag(commandName, flag) { - if (!flags[commandName]) { - throw new Error("Unknown command " + commandName); - } - return Boolean(flags[commandName][flag]); - } - exports2.hasFlag = hasFlag; - function getKeyIndexes(commandName, args, options) { - const command = commands_json_1.default[commandName]; - if (!command) { - throw new Error("Unknown command " + commandName); - } - if (!Array.isArray(args)) { - throw new Error("Expect args to be an array"); - } - const keys = []; - const parseExternalKey = Boolean(options && options.parseExternalKey); - const takeDynamicKeys = (args2, startIndex) => { - const keys2 = []; - const keyStop = Number(args2[startIndex]); - for (let i = 0; i < keyStop; i++) { - keys2.push(i + startIndex + 1); - } - return keys2; - }; - const takeKeyAfterToken = (args2, startIndex, token) => { - for (let i = startIndex; i < args2.length - 1; i += 1) { - if (String(args2[i]).toLowerCase() === token.toLowerCase()) { - return i + 1; - } - } - return null; - }; - switch (commandName) { - case "zunionstore": - case "zinterstore": - case "zdiffstore": - keys.push(0, ...takeDynamicKeys(args, 1)); - break; - case "eval": - case "evalsha": - case "eval_ro": - case "evalsha_ro": - case "fcall": - case "fcall_ro": - case "blmpop": - case "bzmpop": - keys.push(...takeDynamicKeys(args, 1)); - break; - case "sintercard": - case "lmpop": - case "zunion": - case "zinter": - case "zmpop": - case "zintercard": - case "zdiff": { - keys.push(...takeDynamicKeys(args, 0)); - break; - } - case "georadius": { - keys.push(0); - const storeKey = takeKeyAfterToken(args, 5, "STORE"); - if (storeKey) - keys.push(storeKey); - const distKey = takeKeyAfterToken(args, 5, "STOREDIST"); - if (distKey) - keys.push(distKey); - break; - } - case "georadiusbymember": { - keys.push(0); - const storeKey = takeKeyAfterToken(args, 4, "STORE"); - if (storeKey) - keys.push(storeKey); - const distKey = takeKeyAfterToken(args, 4, "STOREDIST"); - if (distKey) - keys.push(distKey); - break; - } - case "sort": - case "sort_ro": - keys.push(0); - for (let i = 1; i < args.length - 1; i++) { - let arg = args[i]; - if (typeof arg !== "string") { - continue; - } - const directive = arg.toUpperCase(); - if (directive === "GET") { - i += 1; - arg = args[i]; - if (arg !== "#") { - if (parseExternalKey) { - keys.push([i, getExternalKeyNameLength(arg)]); - } else { - keys.push(i); - } - } - } else if (directive === "BY") { - i += 1; - if (parseExternalKey) { - keys.push([i, getExternalKeyNameLength(args[i])]); - } else { - keys.push(i); - } - } else if (directive === "STORE") { - i += 1; - keys.push(i); - } - } - break; - case "migrate": - if (args[2] === "") { - for (let i = 5; i < args.length - 1; i++) { - const arg = args[i]; - if (typeof arg === "string" && arg.toUpperCase() === "KEYS") { - for (let j = i + 1; j < args.length; j++) { - keys.push(j); - } - break; - } - } - } else { - keys.push(2); - } - break; - case "xreadgroup": - case "xread": - for (let i = commandName === "xread" ? 0 : 3; i < args.length - 1; i++) { - if (String(args[i]).toUpperCase() === "STREAMS") { - for (let j = i + 1; j <= i + (args.length - 1 - i) / 2; j++) { - keys.push(j); - } - break; - } - } - break; - default: - if (command.step > 0) { - const keyStart = command.keyStart - 1; - const keyStop = command.keyStop > 0 ? command.keyStop : args.length + command.keyStop + 1; - for (let i = keyStart; i < keyStop; i += command.step) { - keys.push(i); - } - } - break; - } - return keys; - } - exports2.getKeyIndexes = getKeyIndexes; - function getExternalKeyNameLength(key) { - if (typeof key !== "string") { - key = String(key); - } - const hashPos = key.indexOf("->"); - return hashPos === -1 ? key.length : hashPos; - } - } -}); - -// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js -var require_utils = __commonJS({ - "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tryCatch = exports2.errorObj = void 0; - exports2.errorObj = { e: {} }; - var tryCatchTarget; - function tryCatcher(err, val) { - try { - const target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - exports2.errorObj.e = e; - return exports2.errorObj; - } - } - function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; - } - exports2.tryCatch = tryCatch; - } -}); - -// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js -var require_built2 = __commonJS({ - "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils(); - function throwLater(e) { - setTimeout(function() { - throw e; - }, 0); - } - function asCallback(promise, nodeback, options) { - if (typeof nodeback === "function") { - promise.then((val) => { - let ret; - if (options !== void 0 && Object(options).spread && Array.isArray(val)) { - ret = utils_1.tryCatch(nodeback).apply(void 0, [null].concat(val)); - } else { - ret = val === void 0 ? utils_1.tryCatch(nodeback)(null) : utils_1.tryCatch(nodeback)(null, val); - } - if (ret === utils_1.errorObj) { - throwLater(ret.e); - } - }, (cause) => { - if (!cause) { - const newReason = new Error(cause + ""); - Object.assign(newReason, { cause }); - cause = newReason; - } - const ret = utils_1.tryCatch(nodeback)(cause); - if (ret === utils_1.errorObj) { - throwLater(ret.e); - } - }); - } - return promise; - } - exports2.default = asCallback; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js -var require_old = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js"(exports2, module2) { - "use strict"; - var assert = require("assert"); - var util = require("util"); - function RedisError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(RedisError, Error); - Object.defineProperty(RedisError.prototype, "name", { - value: "RedisError", - configurable: true, - writable: true - }); - function ParserError(message, buffer, offset) { - assert(buffer); - assert.strictEqual(typeof offset, "number"); - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - Error.captureStackTrace(this, this.constructor); - Error.stackTraceLimit = tmp; - this.offset = offset; - this.buffer = buffer; - } - util.inherits(ParserError, RedisError); - Object.defineProperty(ParserError.prototype, "name", { - value: "ParserError", - configurable: true, - writable: true - }); - function ReplyError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - Error.captureStackTrace(this, this.constructor); - Error.stackTraceLimit = tmp; - } - util.inherits(ReplyError, RedisError); - Object.defineProperty(ReplyError.prototype, "name", { - value: "ReplyError", - configurable: true, - writable: true - }); - function AbortError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(AbortError, RedisError); - Object.defineProperty(AbortError.prototype, "name", { - value: "AbortError", - configurable: true, - writable: true - }); - function InterruptError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(InterruptError, AbortError); - Object.defineProperty(InterruptError.prototype, "name", { - value: "InterruptError", - configurable: true, - writable: true - }); - module2.exports = { - RedisError, - ParserError, - ReplyError, - AbortError, - InterruptError - }; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js -var require_modern = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js"(exports2, module2) { - "use strict"; - var assert = require("assert"); - var RedisError = class extends Error { - get name() { - return this.constructor.name; - } - }; - var ParserError = class extends RedisError { - constructor(message, buffer, offset) { - assert(buffer); - assert.strictEqual(typeof offset, "number"); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - super(message); - Error.stackTraceLimit = tmp; - this.offset = offset; - this.buffer = buffer; - } - get name() { - return this.constructor.name; - } - }; - var ReplyError = class extends RedisError { - constructor(message) { - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - super(message); - Error.stackTraceLimit = tmp; - } - get name() { - return this.constructor.name; - } - }; - var AbortError = class extends RedisError { - get name() { - return this.constructor.name; - } - }; - var InterruptError = class extends AbortError { - get name() { - return this.constructor.name; - } - }; - module2.exports = { - RedisError, - ParserError, - ReplyError, - AbortError, - InterruptError - }; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js -var require_redis_errors = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js"(exports2, module2) { - "use strict"; - var Errors = process.version.charCodeAt(1) < 55 && process.version.charCodeAt(2) === 46 ? require_old() : require_modern(); - module2.exports = Errors; - } -}); - -// node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js -var require_lib = __commonJS({ - "node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js"(exports2, module2) { - var lookup = [ - 0, - 4129, - 8258, - 12387, - 16516, - 20645, - 24774, - 28903, - 33032, - 37161, - 41290, - 45419, - 49548, - 53677, - 57806, - 61935, - 4657, - 528, - 12915, - 8786, - 21173, - 17044, - 29431, - 25302, - 37689, - 33560, - 45947, - 41818, - 54205, - 50076, - 62463, - 58334, - 9314, - 13379, - 1056, - 5121, - 25830, - 29895, - 17572, - 21637, - 42346, - 46411, - 34088, - 38153, - 58862, - 62927, - 50604, - 54669, - 13907, - 9842, - 5649, - 1584, - 30423, - 26358, - 22165, - 18100, - 46939, - 42874, - 38681, - 34616, - 63455, - 59390, - 55197, - 51132, - 18628, - 22757, - 26758, - 30887, - 2112, - 6241, - 10242, - 14371, - 51660, - 55789, - 59790, - 63919, - 35144, - 39273, - 43274, - 47403, - 23285, - 19156, - 31415, - 27286, - 6769, - 2640, - 14899, - 10770, - 56317, - 52188, - 64447, - 60318, - 39801, - 35672, - 47931, - 43802, - 27814, - 31879, - 19684, - 23749, - 11298, - 15363, - 3168, - 7233, - 60846, - 64911, - 52716, - 56781, - 44330, - 48395, - 36200, - 40265, - 32407, - 28342, - 24277, - 20212, - 15891, - 11826, - 7761, - 3696, - 65439, - 61374, - 57309, - 53244, - 48923, - 44858, - 40793, - 36728, - 37256, - 33193, - 45514, - 41451, - 53516, - 49453, - 61774, - 57711, - 4224, - 161, - 12482, - 8419, - 20484, - 16421, - 28742, - 24679, - 33721, - 37784, - 41979, - 46042, - 49981, - 54044, - 58239, - 62302, - 689, - 4752, - 8947, - 13010, - 16949, - 21012, - 25207, - 29270, - 46570, - 42443, - 38312, - 34185, - 62830, - 58703, - 54572, - 50445, - 13538, - 9411, - 5280, - 1153, - 29798, - 25671, - 21540, - 17413, - 42971, - 47098, - 34713, - 38840, - 59231, - 63358, - 50973, - 55100, - 9939, - 14066, - 1681, - 5808, - 26199, - 30326, - 17941, - 22068, - 55628, - 51565, - 63758, - 59695, - 39368, - 35305, - 47498, - 43435, - 22596, - 18533, - 30726, - 26663, - 6336, - 2273, - 14466, - 10403, - 52093, - 56156, - 60223, - 64286, - 35833, - 39896, - 43963, - 48026, - 19061, - 23124, - 27191, - 31254, - 2801, - 6864, - 10931, - 14994, - 64814, - 60687, - 56684, - 52557, - 48554, - 44427, - 40424, - 36297, - 31782, - 27655, - 23652, - 19525, - 15522, - 11395, - 7392, - 3265, - 61215, - 65342, - 53085, - 57212, - 44955, - 49082, - 36825, - 40952, - 28183, - 32310, - 20053, - 24180, - 11923, - 16050, - 3793, - 7920 - ]; - var toUTF8Array = function toUTF8Array2(str) { - var char; - var i = 0; - var p = 0; - var utf8 = []; - var len = str.length; - for (; i < len; i++) { - char = str.charCodeAt(i); - if (char < 128) { - utf8[p++] = char; - } else if (char < 2048) { - utf8[p++] = char >> 6 | 192; - utf8[p++] = char & 63 | 128; - } else if ((char & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) { - char = 65536 + ((char & 1023) << 10) + (str.charCodeAt(++i) & 1023); - utf8[p++] = char >> 18 | 240; - utf8[p++] = char >> 12 & 63 | 128; - utf8[p++] = char >> 6 & 63 | 128; - utf8[p++] = char & 63 | 128; - } else { - utf8[p++] = char >> 12 | 224; - utf8[p++] = char >> 6 & 63 | 128; - utf8[p++] = char & 63 | 128; - } - } - return utf8; - }; - var generate = module2.exports = function generate2(str) { - var char; - var i = 0; - var start = -1; - var result = 0; - var resultHash = 0; - var utf8 = typeof str === "string" ? toUTF8Array(str) : str; - var len = utf8.length; - while (i < len) { - char = utf8[i++]; - if (start === -1) { - if (char === 123) { - start = i; - } - } else if (char !== 125) { - resultHash = lookup[(char ^ resultHash >> 8) & 255] ^ resultHash << 8; - } else if (i - 1 !== start) { - return resultHash & 16383; - } - result = lookup[(char ^ result >> 8) & 255] ^ result << 8; - } - return result & 16383; - }; - module2.exports.generateMulti = function generateMulti(keys) { - var i = 1; - var len = keys.length; - var base = generate(keys[0]); - while (i < len) { - if (generate(keys[i++]) !== base) return -1; - } - return base; - }; - } -}); - -// node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js -var require_lodash = __commonJS({ - "node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - var argsTag = "[object Arguments]"; - var funcTag = "[object Function]"; - var genTag = "[object GeneratorFunction]"; - var reIsUint = /^(?:0|[1-9]\d*)$/; - function apply(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - function baseTimes(n, iteratee) { - var index = -1, result = Array(n); - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var objectToString = objectProto.toString; - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - var nativeMax = Math.max; - function arrayLikeKeys(value, inherited) { - var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; - var length = result.length, skipIndexes = !!length; - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { - result.push(key); - } - } - return result; - } - function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === void 0 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { - return srcValue; - } - return objValue; - } - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) { - object[key] = value; - } - } - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), result = []; - for (var key in object) { - if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - function baseRest(func, start) { - start = nativeMax(start === void 0 ? func.length - 1 : start, 0); - return function() { - var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; - } - function copyObject(source, props, object, customizer) { - object || (object = {}); - var index = -1, length = props.length; - while (++index < length) { - var key = props[index]; - var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; - assignValue(object, key, newValue === void 0 ? source[key] : newValue); - } - return object; - } - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0; - customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? void 0 : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); - } - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { - return eq(object[index], value); - } - return false; - } - function isPrototype(value) { - var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; - return value === proto; - } - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - function eq(value, other) { - return value === other || value !== value && other !== other; - } - function isArguments(value) { - return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); - } - var isArray = Array.isArray; - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - function isFunction(value) { - var tag = isObject(value) ? objectToString.call(value) : ""; - return tag == funcTag || tag == genTag; - } - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - function isObject(value) { - var type = typeof value; - return !!value && (type == "object" || type == "function"); - } - function isObjectLike(value) { - return !!value && typeof value == "object"; - } - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - var defaults = baseRest(function(args) { - args.push(void 0, assignInDefaults); - return apply(assignInWith, void 0, args); - }); - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - module2.exports = defaults; - } -}); - -// node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js -var require_lodash2 = __commonJS({ - "node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - var argsTag = "[object Arguments]"; - var funcTag = "[object Function]"; - var genTag = "[object GeneratorFunction]"; - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var objectToString = objectProto.toString; - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - function isArguments(value) { - return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); - } - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - function isFunction(value) { - var tag = isObject(value) ? objectToString.call(value) : ""; - return tag == funcTag || tag == genTag; - } - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - function isObject(value) { - var type = typeof value; - return !!value && (type == "object" || type == "function"); - } - function isObjectLike(value) { - return !!value && typeof value == "object"; - } - module2.exports = isArguments; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js -var require_lodash3 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isArguments = exports2.defaults = exports2.noop = void 0; - var defaults = require_lodash(); - exports2.defaults = defaults; - var isArguments = require_lodash2(); - exports2.isArguments = isArguments; - function noop() { - } - exports2.noop = noop; - } -}); - -// node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports2, module2) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self2 = debug; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns of split) { - if (ns[0] === "-") { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { - if (template[templateIndex] === "*") { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; - } - } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; - } - return templateIndex === template.length; - } - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - return false; - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports2, module2) { - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = /* @__PURE__ */ (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os2 = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.destroy = util.deprecate( - () => { - }, - "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." - ); - exports2.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports2.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports2.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} \x1B[0m`; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; - } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init(debug) { - debug.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports2, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js -var require_debug = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.genRedactedString = exports2.getStringValue = exports2.MAX_ARGUMENT_LENGTH = void 0; - var debug_1 = require_src(); - var MAX_ARGUMENT_LENGTH = 200; - exports2.MAX_ARGUMENT_LENGTH = MAX_ARGUMENT_LENGTH; - var NAMESPACE_PREFIX = "ioredis"; - function getStringValue(v) { - if (v === null) { - return; - } - switch (typeof v) { - case "boolean": - return; - case "number": - return; - case "object": - if (Buffer.isBuffer(v)) { - return v.toString("hex"); - } - if (Array.isArray(v)) { - return v.join(","); - } - try { - return JSON.stringify(v); - } catch (e) { - return; - } - case "string": - return v; - } - } - exports2.getStringValue = getStringValue; - function genRedactedString(str, maxLen) { - const { length } = str; - return length <= maxLen ? str : str.slice(0, maxLen) + ' ... '; - } - exports2.genRedactedString = genRedactedString; - function genDebugFunction(namespace) { - const fn = (0, debug_1.default)(`${NAMESPACE_PREFIX}:${namespace}`); - function wrappedDebug(...args) { - if (!fn.enabled) { - return; - } - for (let i = 1; i < args.length; i++) { - const str = getStringValue(args[i]); - if (typeof str === "string" && str.length > MAX_ARGUMENT_LENGTH) { - args[i] = genRedactedString(str, MAX_ARGUMENT_LENGTH); - } - } - return fn.apply(null, args); - } - Object.defineProperties(wrappedDebug, { - namespace: { - get() { - return fn.namespace; - } - }, - enabled: { - get() { - return fn.enabled; - } - }, - destroy: { - get() { - return fn.destroy; - } - }, - log: { - get() { - return fn.log; - }, - set(l) { - fn.log = l; - } - } - }); - return wrappedDebug; - } - exports2.default = genDebugFunction; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js -var require_TLSProfiles = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var RedisCloudCA = `-----BEGIN CERTIFICATE----- -MIIDTzCCAjegAwIBAgIJAKSVpiDswLcwMA0GCSqGSIb3DQEBBQUAMD4xFjAUBgNV -BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTAeFw0xMzEwMDExMjE0NTVaFw0yMzA5MjkxMjE0NTVaMD4xFjAUBgNV -BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALZqkh/DczWP -JnxnHLQ7QL0T4B4CDKWBKCcisriGbA6ZePWVNo4hfKQC6JrzfR+081NeD6VcWUiz -rmd+jtPhIY4c+WVQYm5PKaN6DT1imYdxQw7aqO5j2KUCEh/cznpLxeSHoTxlR34E -QwF28Wl3eg2vc5ct8LjU3eozWVk3gb7alx9mSA2SgmuX5lEQawl++rSjsBStemY2 -BDwOpAMXIrdEyP/cVn8mkvi/BDs5M5G+09j0gfhyCzRWMQ7Hn71u1eolRxwVxgi3 -TMn+/vTaFSqxKjgck6zuAYjBRPaHe7qLxHNr1So/Mc9nPy+3wHebFwbIcnUojwbp -4nctkWbjb2cCAwEAAaNQME4wHQYDVR0OBBYEFP1whtcrydmW3ZJeuSoKZIKjze3w -MB8GA1UdIwQYMBaAFP1whtcrydmW3ZJeuSoKZIKjze3wMAwGA1UdEwQFMAMBAf8w -DQYJKoZIhvcNAQEFBQADggEBAG2erXhwRAa7+ZOBs0B6X57Hwyd1R4kfmXcs0rta -lbPpvgULSiB+TCbf3EbhJnHGyvdCY1tvlffLjdA7HJ0PCOn+YYLBA0pTU/dyvrN6 -Su8NuS5yubnt9mb13nDGYo1rnt0YRfxN+8DM3fXIVr038A30UlPX2Ou1ExFJT0MZ -uFKY6ZvLdI6/1cbgmguMlAhM+DhKyV6Sr5699LM3zqeI816pZmlREETYkGr91q7k -BpXJu/dtHaGxg1ZGu6w/PCsYGUcECWENYD4VQPd8N32JjOfu6vEgoEAwfPP+3oGp -Z4m3ewACcWOAenqflb+cQYC4PsF7qbXDmRaWrbKntOlZ3n0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGMTCCBBmgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwajELMAkGA1UEBhMCVVMx -CzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJzMS0w -KwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN -MTgwMjI1MTUzNzM3WhcNMjgwMjIzMTUzNzM3WjBfMQswCQYDVQQGEwJVUzELMAkG -A1UECAwCQ0ExEjAQBgNVBAoMCVJlZGlzTGFiczEvMC0GA1UEAwwmUkNQIEludGVy -bWVkaWF0ZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDf9dqbxc8Bq7Ctq9rWcxrGNKKHivqLAFpPq02yLPx6fsOv -Tq7GsDChAYBBc4v7Y2Ap9RD5Vs3dIhEANcnolf27QwrG9RMnnvzk8pCvp1o6zSU4 -VuOE1W66/O1/7e2rVxyrnTcP7UgK43zNIXu7+tiAqWsO92uSnuMoGPGpeaUm1jym -hjWKtkAwDFSqvHY+XL5qDVBEjeUe+WHkYUg40cAXjusAqgm2hZt29c2wnVrxW25W -P0meNlzHGFdA2AC5z54iRiqj57dTfBTkHoBczQxcyw6hhzxZQ4e5I5zOKjXXEhZN -r0tA3YC14CTabKRus/JmZieyZzRgEy2oti64tmLYTqSlAD78pRL40VNoaSYetXLw -hhNsXCHgWaY6d5bLOc/aIQMAV5oLvZQKvuXAF1IDmhPA+bZbpWipp0zagf1P1H3s -UzsMdn2KM0ejzgotbtNlj5TcrVwpmvE3ktvUAuA+hi3FkVx1US+2Gsp5x4YOzJ7u -P1WPk6ShF0JgnJH2ILdj6kttTWwFzH17keSFICWDfH/+kM+k7Y1v3EXMQXE7y0T9 -MjvJskz6d/nv+sQhY04xt64xFMGTnZjlJMzfQNi7zWFLTZnDD0lPowq7l3YiPoTT -t5Xky83lu0KZsZBo0WlWaDG00gLVdtRgVbcuSWxpi5BdLb1kRab66JptWjxwXQID -AQABo4HrMIHoMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHBzOi8vcmwtY2Etc2VydmVy -LnJlZGlzbGFicy5jb20vdjEvY3JsMEYGCCsGAQUFBwEBBDowODA2BggrBgEFBQcw -AYYqaHR0cHM6Ly9ybC1jYS1zZXJ2ZXIucmVkaXNsYWJzLmNvbS92MS9vY3NwMB0G -A1UdDgQWBBQHar5OKvQUpP2qWt6mckzToeCOHDAfBgNVHSMEGDAWgBQi42wH6hM4 -L2sujEvLM0/u8lRXTzASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIB -hjANBgkqhkiG9w0BAQsFAAOCAgEAirEn/iTsAKyhd+pu2W3Z5NjCko4NPU0EYUbr -AP7+POK2rzjIrJO3nFYQ/LLuC7KCXG+2qwan2SAOGmqWst13Y+WHp44Kae0kaChW -vcYLXXSoGQGC8QuFSNUdaeg3RbMDYFT04dOkqufeWVccoHVxyTSg9eD8LZuHn5jw -7QDLiEECBmIJHk5Eeo2TAZrx4Yx6ufSUX5HeVjlAzqwtAqdt99uCJ/EL8bgpWbe+ -XoSpvUv0SEC1I1dCAhCKAvRlIOA6VBcmzg5Am12KzkqTul12/VEFIgzqu0Zy2Jbc -AUPrYVu/+tOGXQaijy7YgwH8P8n3s7ZeUa1VABJHcxrxYduDDJBLZi+MjheUDaZ1 -jQRHYevI2tlqeSBqdPKG4zBY5lS0GiAlmuze5oENt0P3XboHoZPHiqcK3VECgTVh -/BkJcuudETSJcZDmQ8YfoKfBzRQNg2sv/hwvUv73Ss51Sco8GEt2lD8uEdib1Q6z -zDT5lXJowSzOD5ZA9OGDjnSRL+2riNtKWKEqvtEG3VBJoBzu9GoxbAc7wIZLxmli -iF5a/Zf5X+UXD3s4TMmy6C4QZJpAA2egsSQCnraWO2ULhh7iXMysSkF/nzVfZn43 -iqpaB8++9a37hWq14ZmOv0TJIDz//b2+KC4VFXWQ5W5QC6whsjT+OlG4p5ZYG0jo -616pxqo= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJAJ1aTT1lu2ScMA0GCSqGSIb3DQEBCwUAMGoxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCQ0ExEjAQBgNVBAoMCVJlZGlz -TGFiczEtMCsGA1UEAwwkUmVkaXNMYWJzIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y -aXR5MB4XDTE4MDIyNTE1MjA0MloXDTM4MDIyMDE1MjA0MlowajELMAkGA1UEBhMC -VVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJz -MS0wKwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw -ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDLEjXy7YrbN5Waau5cd6g1 -G5C2tMmeTpZ0duFAPxNU4oE3RHS5gGiok346fUXuUxbZ6QkuzeN2/2Z+RmRcJhQY -Dm0ZgdG4x59An1TJfnzKKoWj8ISmoHS/TGNBdFzXV7FYNLBuqZouqePI6ReC6Qhl -pp45huV32Q3a6IDrrvx7Wo5ZczEQeFNbCeCOQYNDdTmCyEkHqc2AGo8eoIlSTutT -ULOC7R5gzJVTS0e1hesQ7jmqHjbO+VQS1NAL4/5K6cuTEqUl+XhVhPdLWBXJQ5ag -54qhX4v+ojLzeU1R/Vc6NjMvVtptWY6JihpgplprN0Yh2556ewcXMeturcKgXfGJ -xeYzsjzXerEjrVocX5V8BNrg64NlifzTMKNOOv4fVZszq1SIHR8F9ROrqiOdh8iC -JpUbLpXH9hWCSEO6VRMB2xJoKu3cgl63kF30s77x7wLFMEHiwsQRKxooE1UhgS9K -2sO4TlQ1eWUvFvHSTVDQDlGQ6zu4qjbOpb3Q8bQwoK+ai2alkXVR4Ltxe9QlgYK3 -StsnPhruzZGA0wbXdpw0bnM+YdlEm5ffSTpNIfgHeaa7Dtb801FtA71ZlH7A6TaI -SIQuUST9EKmv7xrJyx0W1pGoPOLw5T029aTjnICSLdtV9bLwysrLhIYG5bnPq78B -cS+jZHFGzD7PUVGQD01nOQIDAQABo2MwYTAdBgNVHQ4EFgQUIuNsB+oTOC9rLoxL -yzNP7vJUV08wHwYDVR0jBBgwFoAUIuNsB+oTOC9rLoxLyzNP7vJUV08wDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBAHfg -z5pMNUAKdMzK1aS1EDdK9yKz4qicILz5czSLj1mC7HKDRy8cVADUxEICis++CsCu -rYOvyCVergHQLREcxPq4rc5Nq1uj6J6649NEeh4WazOOjL4ZfQ1jVznMbGy+fJm3 -3Hoelv6jWRG9iqeJZja7/1s6YC6bWymI/OY1e4wUKeNHAo+Vger7MlHV+RuabaX+ -hSJ8bJAM59NCM7AgMTQpJCncrcdLeceYniGy5Q/qt2b5mJkQVkIdy4TPGGB+AXDJ -D0q3I/JDRkDUFNFdeW0js7fHdsvCR7O3tJy5zIgEV/o/BCkmJVtuwPYOrw/yOlKj -TY/U7ATAx9VFF6/vYEOMYSmrZlFX+98L6nJtwDqfLB5VTltqZ4H/KBxGE3IRSt9l -FXy40U+LnXzhhW+7VBAvyYX8GEXhHkKU8Gqk1xitrqfBXY74xKgyUSTolFSfFVgj -mcM/X4K45bka+qpkj7Kfv/8D4j6aZekwhN2ly6hhC1SmQ8qjMjpG/mrWOSSHZFmf -ybu9iD2AYHeIOkshIl6xYIa++Q/00/vs46IzAbQyriOi0XxlSMMVtPx0Q3isp+ji -n8Mq9eOuxYOEQ4of8twUkUDd528iwGtEdwf0Q01UyT84S62N8AySl1ZBKXJz6W4F -UhWfa/HQYOAPDdEjNgnVwLI23b8t0TozyCWw7q8h ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEjzCCA3egAwIBAgIQe55B/ALCKJDZtdNT8kD6hTANBgkqhkiG9w0BAQsFADBM -MSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xv -YmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0yMjAxMjYxMjAwMDBaFw0y -NTAxMjYwMDAwMDBaMFgxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWdu -IG52LXNhMS4wLAYDVQQDEyVHbG9iYWxTaWduIEF0bGFzIFIzIE9WIFRMUyBDQSAy -MDIyIFEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmGmg1LW9b7Lf -8zDD83yBDTEkt+FOxKJZqF4veWc5KZsQj9HfnUS2e5nj/E+JImlGPsQuoiosLuXD -BVBNAMcUFa11buFMGMeEMwiTmCXoXRrXQmH0qjpOfKgYc5gHG3BsRGaRrf7VR4eg -ofNMG9wUBw4/g/TT7+bQJdA4NfE7Y4d5gEryZiBGB/swaX6Jp/8MF4TgUmOWmalK -dZCKyb4sPGQFRTtElk67F7vU+wdGcrcOx1tDcIB0ncjLPMnaFicagl+daWGsKqTh -counQb6QJtYHa91KvCfKWocMxQ7OIbB5UARLPmC4CJ1/f8YFm35ebfzAeULYdGXu -jE9CLor0OwIDAQABo4IBXzCCAVswDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQG -CCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQW -BBSH5Zq7a7B/t95GfJWkDBpA8HHqdjAfBgNVHSMEGDAWgBSP8Et/qC5FJK5NUPpj -move4t0bvDB7BggrBgEFBQcBAQRvMG0wLgYIKwYBBQUHMAGGImh0dHA6Ly9vY3Nw -Mi5nbG9iYWxzaWduLmNvbS9yb290cjMwOwYIKwYBBQUHMAKGL2h0dHA6Ly9zZWN1 -cmUuZ2xvYmFsc2lnbi5jb20vY2FjZXJ0L3Jvb3QtcjMuY3J0MDYGA1UdHwQvMC0w -K6ApoCeGJWh0dHA6Ly9jcmwuZ2xvYmFsc2lnbi5jb20vcm9vdC1yMy5jcmwwIQYD -VR0gBBowGDAIBgZngQwBAgIwDAYKKwYBBAGgMgoBAjANBgkqhkiG9w0BAQsFAAOC -AQEAKRic9/f+nmhQU/wz04APZLjgG5OgsuUOyUEZjKVhNGDwxGTvKhyXGGAMW2B/ -3bRi+aElpXwoxu3pL6fkElbX3B0BeS5LoDtxkyiVEBMZ8m+sXbocwlPyxrPbX6mY -0rVIvnuUeBH8X0L5IwfpNVvKnBIilTbcebfHyXkPezGwz7E1yhUULjJFm2bt0SdX -y+4X/WeiiYIv+fTVgZZgl+/2MKIsu/qdBJc3f3TvJ8nz+Eax1zgZmww+RSQWeOj3 -15Iw6Z5FX+NwzY/Ab+9PosR5UosSeq+9HhtaxZttXG1nVh+avYPGYddWmiMT90J5 -ZgKnO/Fx2hBgTxhOTMYaD312kg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 -MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 -RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT -gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm -KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd -QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ -XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o -LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU -RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp -jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK -6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX -mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs -Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH -WD9f ------END CERTIFICATE-----`; - var TLSProfiles = { - RedisCloudFixed: { ca: RedisCloudCA }, - RedisCloudFlexible: { ca: RedisCloudCA } - }; - exports2.default = TLSProfiles; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js -var require_utils2 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.noop = exports2.defaults = exports2.Debug = exports2.getPackageMeta = exports2.zipMap = exports2.CONNECTION_CLOSED_ERROR_MSG = exports2.shuffle = exports2.sample = exports2.resolveTLSProfile = exports2.parseURL = exports2.optimizeErrorStack = exports2.toArg = exports2.convertMapToArray = exports2.convertObjectToArray = exports2.timeout = exports2.packObject = exports2.isInt = exports2.wrapMultiResult = exports2.convertBufferToString = void 0; - var fs_1 = require("fs"); - var path_1 = require("path"); - var url_1 = require("url"); - var lodash_1 = require_lodash3(); - Object.defineProperty(exports2, "defaults", { enumerable: true, get: function() { - return lodash_1.defaults; - } }); - Object.defineProperty(exports2, "noop", { enumerable: true, get: function() { - return lodash_1.noop; - } }); - var debug_1 = require_debug(); - exports2.Debug = debug_1.default; - var TLSProfiles_1 = require_TLSProfiles(); - function convertBufferToString(value, encoding) { - if (value instanceof Buffer) { - return value.toString(encoding); - } - if (Array.isArray(value)) { - const length = value.length; - const res = Array(length); - for (let i = 0; i < length; ++i) { - res[i] = value[i] instanceof Buffer && encoding === "utf8" ? value[i].toString() : convertBufferToString(value[i], encoding); - } - return res; - } - return value; - } - exports2.convertBufferToString = convertBufferToString; - function wrapMultiResult(arr) { - if (!arr) { - return null; - } - const result = []; - const length = arr.length; - for (let i = 0; i < length; ++i) { - const item = arr[i]; - if (item instanceof Error) { - result.push([item]); - } else { - result.push([null, item]); - } - } - return result; - } - exports2.wrapMultiResult = wrapMultiResult; - function isInt(value) { - const x = parseFloat(value); - return !isNaN(value) && (x | 0) === x; - } - exports2.isInt = isInt; - function packObject(array) { - const result = {}; - const length = array.length; - for (let i = 1; i < length; i += 2) { - result[array[i - 1]] = array[i]; - } - return result; - } - exports2.packObject = packObject; - function timeout(callback, timeout2) { - let timer = null; - const run = function() { - if (timer) { - clearTimeout(timer); - timer = null; - callback.apply(this, arguments); - } - }; - timer = setTimeout(run, timeout2, new Error("timeout")); - return run; - } - exports2.timeout = timeout; - function convertObjectToArray(obj) { - const result = []; - const keys = Object.keys(obj); - for (let i = 0, l = keys.length; i < l; i++) { - result.push(keys[i], obj[keys[i]]); - } - return result; - } - exports2.convertObjectToArray = convertObjectToArray; - function convertMapToArray(map) { - const result = []; - let pos = 0; - map.forEach(function(value, key) { - result[pos] = key; - result[pos + 1] = value; - pos += 2; - }); - return result; - } - exports2.convertMapToArray = convertMapToArray; - function toArg(arg) { - if (arg === null || typeof arg === "undefined") { - return ""; - } - return String(arg); - } - exports2.toArg = toArg; - function optimizeErrorStack(error, friendlyStack, filterPath) { - const stacks = friendlyStack.split("\n"); - let lines = ""; - let i; - for (i = 1; i < stacks.length; ++i) { - if (stacks[i].indexOf(filterPath) === -1) { - break; - } - } - for (let j = i; j < stacks.length; ++j) { - lines += "\n" + stacks[j]; - } - if (error.stack) { - const pos = error.stack.indexOf("\n"); - error.stack = error.stack.slice(0, pos) + lines; - } - return error; - } - exports2.optimizeErrorStack = optimizeErrorStack; - function parseURL(url) { - if (isInt(url)) { - return { port: url }; - } - let parsed = (0, url_1.parse)(url, true, true); - if (!parsed.slashes && url[0] !== "/") { - url = "//" + url; - parsed = (0, url_1.parse)(url, true, true); - } - const options = parsed.query || {}; - const result = {}; - if (parsed.auth) { - const index = parsed.auth.indexOf(":"); - result.username = index === -1 ? parsed.auth : parsed.auth.slice(0, index); - result.password = index === -1 ? "" : parsed.auth.slice(index + 1); - } - if (parsed.pathname) { - if (parsed.protocol === "redis:" || parsed.protocol === "rediss:") { - if (parsed.pathname.length > 1) { - result.db = parsed.pathname.slice(1); - } - } else { - result.path = parsed.pathname; - } - } - if (parsed.host) { - result.host = parsed.hostname; - } - if (parsed.port) { - result.port = parsed.port; - } - if (typeof options.family === "string") { - const intFamily = Number.parseInt(options.family, 10); - if (!Number.isNaN(intFamily)) { - result.family = intFamily; - } - } - (0, lodash_1.defaults)(result, options); - return result; - } - exports2.parseURL = parseURL; - function resolveTLSProfile(options) { - let tls = options === null || options === void 0 ? void 0 : options.tls; - if (typeof tls === "string") - tls = { profile: tls }; - const profile = TLSProfiles_1.default[tls === null || tls === void 0 ? void 0 : tls.profile]; - if (profile) { - tls = Object.assign({}, profile, tls); - delete tls.profile; - options = Object.assign({}, options, { tls }); - } - return options; - } - exports2.resolveTLSProfile = resolveTLSProfile; - function sample(array, from = 0) { - const length = array.length; - if (from >= length) { - return null; - } - return array[from + Math.floor(Math.random() * (length - from))]; - } - exports2.sample = sample; - function shuffle(array) { - let counter = array.length; - while (counter > 0) { - const index = Math.floor(Math.random() * counter); - counter--; - [array[counter], array[index]] = [array[index], array[counter]]; - } - return array; - } - exports2.shuffle = shuffle; - exports2.CONNECTION_CLOSED_ERROR_MSG = "Connection is closed."; - function zipMap(keys, values) { - const map = /* @__PURE__ */ new Map(); - keys.forEach((key, index) => { - map.set(key, values[index]); - }); - return map; - } - exports2.zipMap = zipMap; - var cachedPackageMeta = null; - async function getPackageMeta() { - if (cachedPackageMeta) { - return cachedPackageMeta; - } - try { - const filePath = (0, path_1.resolve)(__dirname, "..", "..", "package.json"); - const data = await fs_1.promises.readFile(filePath, "utf8"); - const parsed = JSON.parse(data); - cachedPackageMeta = { - version: parsed.version - }; - return cachedPackageMeta; - } catch (err) { - cachedPackageMeta = { - version: "error-fetching-version" - }; - return cachedPackageMeta; - } - } - exports2.getPackageMeta = getPackageMeta; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js -var require_Command = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var calculateSlot = require_lib(); - var standard_as_callback_1 = require_built2(); - var utils_1 = require_utils2(); - var Command = class _Command { - /** - * Creates an instance of Command. - * @param name Command name - * @param args An array of command arguments - * @param options - * @param callback The callback that handles the response. - * If omit, the response will be handled via Promise - */ - constructor(name, args = [], options = {}, callback) { - this.name = name; - this.inTransaction = false; - this.isResolved = false; - this.transformed = false; - this.replyEncoding = options.replyEncoding; - this.errorStack = options.errorStack; - this.args = args.flat(); - this.callback = callback; - this.initPromise(); - if (options.keyPrefix) { - const isBufferKeyPrefix = options.keyPrefix instanceof Buffer; - let keyPrefixBuffer = isBufferKeyPrefix ? options.keyPrefix : null; - this._iterateKeys((key) => { - if (key instanceof Buffer) { - if (keyPrefixBuffer === null) { - keyPrefixBuffer = Buffer.from(options.keyPrefix); - } - return Buffer.concat([keyPrefixBuffer, key]); - } else if (isBufferKeyPrefix) { - return Buffer.concat([options.keyPrefix, Buffer.from(String(key))]); - } - return options.keyPrefix + key; - }); - } - if (options.readOnly) { - this.isReadOnly = true; - } - } - /** - * Check whether the command has the flag - */ - static checkFlag(flagName, commandName) { - return !!this.getFlagMap()[flagName][commandName]; - } - static setArgumentTransformer(name, func) { - this._transformer.argument[name] = func; - } - static setReplyTransformer(name, func) { - this._transformer.reply[name] = func; - } - static getFlagMap() { - if (!this.flagMap) { - this.flagMap = Object.keys(_Command.FLAGS).reduce((map, flagName) => { - map[flagName] = {}; - _Command.FLAGS[flagName].forEach((commandName) => { - map[flagName][commandName] = true; - }); - return map; - }, {}); - } - return this.flagMap; - } - getSlot() { - if (typeof this.slot === "undefined") { - const key = this.getKeys()[0]; - this.slot = key == null ? null : calculateSlot(key); - } - return this.slot; - } - getKeys() { - return this._iterateKeys(); - } - /** - * Convert command to writable buffer or string - */ - toWritable(_socket) { - let result; - const commandStr = "*" + (this.args.length + 1) + "\r\n$" + Buffer.byteLength(this.name) + "\r\n" + this.name + "\r\n"; - if (this.bufferMode) { - const buffers = new MixedBuffers(); - buffers.push(commandStr); - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - if (arg instanceof Buffer) { - if (arg.length === 0) { - buffers.push("$0\r\n\r\n"); - } else { - buffers.push("$" + arg.length + "\r\n"); - buffers.push(arg); - buffers.push("\r\n"); - } - } else { - buffers.push("$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"); - } - } - result = buffers.toBuffer(); - } else { - result = commandStr; - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - result += "$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"; - } - } - return result; - } - stringifyArguments() { - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - if (typeof arg === "string") { - } else if (arg instanceof Buffer) { - this.bufferMode = true; - } else { - this.args[i] = (0, utils_1.toArg)(arg); - } - } - } - /** - * Convert buffer/buffer[] to string/string[], - * and apply reply transformer. - */ - transformReply(result) { - if (this.replyEncoding) { - result = (0, utils_1.convertBufferToString)(result, this.replyEncoding); - } - const transformer = _Command._transformer.reply[this.name]; - if (transformer) { - result = transformer(result); - } - return result; - } - /** - * Set the wait time before terminating the attempt to execute a command - * and generating an error. - */ - setTimeout(ms) { - if (!this._commandTimeoutTimer) { - this._commandTimeoutTimer = setTimeout(() => { - if (!this.isResolved) { - this.reject(new Error("Command timed out")); - } - }, ms); - } - } - initPromise() { - const promise = new Promise((resolve2, reject) => { - if (!this.transformed) { - this.transformed = true; - const transformer = _Command._transformer.argument[this.name]; - if (transformer) { - this.args = transformer(this.args); - } - this.stringifyArguments(); - } - this.resolve = this._convertValue(resolve2); - if (this.errorStack) { - this.reject = (err) => { - reject((0, utils_1.optimizeErrorStack)(err, this.errorStack.stack, __dirname)); - }; - } else { - this.reject = reject; - } - }); - this.promise = (0, standard_as_callback_1.default)(promise, this.callback); - } - /** - * Iterate through the command arguments that are considered keys. - */ - _iterateKeys(transform = (key) => key) { - if (typeof this.keys === "undefined") { - this.keys = []; - if ((0, commands_1.exists)(this.name)) { - const keyIndexes = (0, commands_1.getKeyIndexes)(this.name, this.args); - for (const index of keyIndexes) { - this.args[index] = transform(this.args[index]); - this.keys.push(this.args[index]); - } - } - } - return this.keys; - } - /** - * Convert the value from buffer to the target encoding. - */ - _convertValue(resolve2) { - return (value) => { - try { - const existingTimer = this._commandTimeoutTimer; - if (existingTimer) { - clearTimeout(existingTimer); - delete this._commandTimeoutTimer; - } - resolve2(this.transformReply(value)); - this.isResolved = true; - } catch (err) { - this.reject(err); - } - return this.promise; - }; - } - }; - exports2.default = Command; - Command.FLAGS = { - VALID_IN_SUBSCRIBER_MODE: [ - "subscribe", - "psubscribe", - "unsubscribe", - "punsubscribe", - "ssubscribe", - "sunsubscribe", - "ping", - "quit" - ], - VALID_IN_MONITOR_MODE: ["monitor", "auth"], - ENTER_SUBSCRIBER_MODE: ["subscribe", "psubscribe", "ssubscribe"], - EXIT_SUBSCRIBER_MODE: ["unsubscribe", "punsubscribe", "sunsubscribe"], - WILL_DISCONNECT: ["quit"], - HANDSHAKE_COMMANDS: ["auth", "select", "client", "readonly", "info"], - IGNORE_RECONNECT_ON_ERROR: ["client"] - }; - Command._transformer = { - argument: {}, - reply: {} - }; - var msetArgumentTransformer = function(args) { - if (args.length === 1) { - if (args[0] instanceof Map) { - return (0, utils_1.convertMapToArray)(args[0]); - } - if (typeof args[0] === "object" && args[0] !== null) { - return (0, utils_1.convertObjectToArray)(args[0]); - } - } - return args; - }; - var hsetArgumentTransformer = function(args) { - if (args.length === 2) { - if (args[1] instanceof Map) { - return [args[0]].concat((0, utils_1.convertMapToArray)(args[1])); - } - if (typeof args[1] === "object" && args[1] !== null) { - return [args[0]].concat((0, utils_1.convertObjectToArray)(args[1])); - } - } - return args; - }; - Command.setArgumentTransformer("mset", msetArgumentTransformer); - Command.setArgumentTransformer("msetnx", msetArgumentTransformer); - Command.setArgumentTransformer("hset", hsetArgumentTransformer); - Command.setArgumentTransformer("hmset", hsetArgumentTransformer); - Command.setReplyTransformer("hgetall", function(result) { - if (Array.isArray(result)) { - const obj = {}; - for (let i = 0; i < result.length; i += 2) { - const key = result[i]; - const value = result[i + 1]; - if (key in obj) { - Object.defineProperty(obj, key, { - value, - configurable: true, - enumerable: true, - writable: true - }); - } else { - obj[key] = value; - } - } - return obj; - } - return result; - }); - var MixedBuffers = class { - constructor() { - this.length = 0; - this.items = []; - } - push(x) { - this.length += Buffer.byteLength(x); - this.items.push(x); - } - toBuffer() { - const result = Buffer.allocUnsafe(this.length); - let offset = 0; - for (const item of this.items) { - const length = Buffer.byteLength(item); - Buffer.isBuffer(item) ? item.copy(result, offset) : result.write(item, offset, length); - offset += length; - } - return result; - } - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js -var require_ClusterAllFailedError = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var redis_errors_1 = require_redis_errors(); - var ClusterAllFailedError = class extends redis_errors_1.RedisError { - constructor(message, lastNodeError) { - super(message); - this.lastNodeError = lastNodeError; - Error.captureStackTrace(this, this.constructor); - } - get name() { - return this.constructor.name; - } - }; - exports2.default = ClusterAllFailedError; - ClusterAllFailedError.defaultMessage = "Failed to refresh slots cache."; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js -var require_ScanStream = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var stream_1 = require("stream"); - var ScanStream = class extends stream_1.Readable { - constructor(opt) { - super(opt); - this.opt = opt; - this._redisCursor = "0"; - this._redisDrained = false; - } - _read() { - if (this._redisDrained) { - this.push(null); - return; - } - const args = [this._redisCursor]; - if (this.opt.key) { - args.unshift(this.opt.key); - } - if (this.opt.match) { - args.push("MATCH", this.opt.match); - } - if (this.opt.type) { - args.push("TYPE", this.opt.type); - } - if (this.opt.count) { - args.push("COUNT", String(this.opt.count)); - } - if (this.opt.noValues) { - args.push("NOVALUES"); - } - this.opt.redis[this.opt.command](args, (err, res) => { - if (err) { - this.emit("error", err); - return; - } - this._redisCursor = res[0] instanceof Buffer ? res[0].toString() : res[0]; - if (this._redisCursor === "0") { - this._redisDrained = true; - } - this.push(res[1]); - }); - } - close() { - this._redisDrained = true; - } - }; - exports2.default = ScanStream; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js -var require_autoPipelining = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.executeWithAutoPipelining = exports2.getFirstValueInFlattenedArray = exports2.shouldUseAutoPipelining = exports2.notAllowedAutoPipelineCommands = exports2.kCallbacks = exports2.kExec = void 0; - var lodash_1 = require_lodash3(); - var calculateSlot = require_lib(); - var standard_as_callback_1 = require_built2(); - exports2.kExec = Symbol("exec"); - exports2.kCallbacks = Symbol("callbacks"); - exports2.notAllowedAutoPipelineCommands = [ - "auth", - "info", - "script", - "quit", - "cluster", - "pipeline", - "multi", - "subscribe", - "psubscribe", - "unsubscribe", - "unpsubscribe", - "select", - "client" - ]; - function executeAutoPipeline(client, slotKey) { - if (client._runningAutoPipelines.has(slotKey)) { - return; - } - if (!client._autoPipelines.has(slotKey)) { - return; - } - client._runningAutoPipelines.add(slotKey); - const pipeline = client._autoPipelines.get(slotKey); - client._autoPipelines.delete(slotKey); - const callbacks = pipeline[exports2.kCallbacks]; - pipeline[exports2.kCallbacks] = null; - pipeline.exec(function(err, results) { - client._runningAutoPipelines.delete(slotKey); - if (err) { - for (let i = 0; i < callbacks.length; i++) { - process.nextTick(callbacks[i], err); - } - } else { - for (let i = 0; i < callbacks.length; i++) { - process.nextTick(callbacks[i], ...results[i]); - } - } - if (client._autoPipelines.has(slotKey)) { - executeAutoPipeline(client, slotKey); - } - }); - } - function shouldUseAutoPipelining(client, functionName, commandName) { - return functionName && client.options.enableAutoPipelining && !client.isPipeline && !exports2.notAllowedAutoPipelineCommands.includes(commandName) && !client.options.autoPipeliningIgnoredCommands.includes(commandName); - } - exports2.shouldUseAutoPipelining = shouldUseAutoPipelining; - function getFirstValueInFlattenedArray(args) { - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - if (typeof arg === "string") { - return arg; - } else if (Array.isArray(arg) || (0, lodash_1.isArguments)(arg)) { - if (arg.length === 0) { - continue; - } - return arg[0]; - } - const flattened = [arg].flat(); - if (flattened.length > 0) { - return flattened[0]; - } - } - return void 0; - } - exports2.getFirstValueInFlattenedArray = getFirstValueInFlattenedArray; - function executeWithAutoPipelining(client, functionName, commandName, args, callback) { - if (client.isCluster && !client.slots.length) { - if (client.status === "wait") - client.connect().catch(lodash_1.noop); - return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { - client.delayUntilReady((err) => { - if (err) { - reject(err); - return; - } - executeWithAutoPipelining(client, functionName, commandName, args, null).then(resolve2, reject); - }); - }), callback); - } - const prefix = client.options.keyPrefix || ""; - const slotKey = client.isCluster ? client.slots[calculateSlot(`${prefix}${getFirstValueInFlattenedArray(args)}`)].join(",") : "main"; - if (!client._autoPipelines.has(slotKey)) { - const pipeline2 = client.pipeline(); - pipeline2[exports2.kExec] = false; - pipeline2[exports2.kCallbacks] = []; - client._autoPipelines.set(slotKey, pipeline2); - } - const pipeline = client._autoPipelines.get(slotKey); - if (!pipeline[exports2.kExec]) { - pipeline[exports2.kExec] = true; - setImmediate(executeAutoPipeline, client, slotKey); - } - const autoPipelinePromise = new Promise(function(resolve2, reject) { - pipeline[exports2.kCallbacks].push(function(err, value) { - if (err) { - reject(err); - return; - } - resolve2(value); - }); - if (functionName === "call") { - args.unshift(commandName); - } - pipeline[functionName](...args); - }); - return (0, standard_as_callback_1.default)(autoPipelinePromise, callback); - } - exports2.executeWithAutoPipelining = executeWithAutoPipelining; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js -var require_Script = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var crypto_1 = require("crypto"); - var Command_1 = require_Command(); - var standard_as_callback_1 = require_built2(); - var Script2 = class { - constructor(lua, numberOfKeys = null, keyPrefix = "", readOnly = false) { - this.lua = lua; - this.numberOfKeys = numberOfKeys; - this.keyPrefix = keyPrefix; - this.readOnly = readOnly; - this.sha = (0, crypto_1.createHash)("sha1").update(lua).digest("hex"); - const sha = this.sha; - const socketHasScriptLoaded = /* @__PURE__ */ new WeakSet(); - this.Command = class CustomScriptCommand extends Command_1.default { - toWritable(socket) { - const origReject = this.reject; - this.reject = (err) => { - if (err.message.indexOf("NOSCRIPT") !== -1) { - socketHasScriptLoaded.delete(socket); - } - origReject.call(this, err); - }; - if (!socketHasScriptLoaded.has(socket)) { - socketHasScriptLoaded.add(socket); - this.name = "eval"; - this.args[0] = lua; - } else if (this.name === "eval") { - this.name = "evalsha"; - this.args[0] = sha; - } - return super.toWritable(socket); - } - }; - } - execute(container, args, options, callback) { - if (typeof this.numberOfKeys === "number") { - args.unshift(this.numberOfKeys); - } - if (this.keyPrefix) { - options.keyPrefix = this.keyPrefix; - } - if (this.readOnly) { - options.readOnly = true; - } - const evalsha = new this.Command("evalsha", [this.sha, ...args], options); - evalsha.promise = evalsha.promise.catch((err) => { - if (err.message.indexOf("NOSCRIPT") === -1) { - throw err; - } - const resend = new this.Command("evalsha", [this.sha, ...args], options); - const client = container.isPipeline ? container.redis : container; - return client.sendCommand(resend); - }); - (0, standard_as_callback_1.default)(evalsha.promise, callback); - return container.sendCommand(evalsha); - } - }; - exports2.default = Script2; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js -var require_Commander = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var autoPipelining_1 = require_autoPipelining(); - var Command_1 = require_Command(); - var Script_1 = require_Script(); - var Commander = class { - constructor() { - this.options = {}; - this.scriptsSet = {}; - this.addedBuiltinSet = /* @__PURE__ */ new Set(); - } - /** - * Return supported builtin commands - */ - getBuiltinCommands() { - return commands.slice(0); - } - /** - * Create a builtin command - */ - createBuiltinCommand(commandName) { - return { - string: generateFunction(null, commandName, "utf8"), - buffer: generateFunction(null, commandName, null) - }; - } - /** - * Create add builtin command - */ - addBuiltinCommand(commandName) { - this.addedBuiltinSet.add(commandName); - this[commandName] = generateFunction(commandName, commandName, "utf8"); - this[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); - } - /** - * Define a custom command using lua script - */ - defineCommand(name, definition) { - const script = new Script_1.default(definition.lua, definition.numberOfKeys, this.options.keyPrefix, definition.readOnly); - this.scriptsSet[name] = script; - this[name] = generateScriptingFunction(name, name, script, "utf8"); - this[name + "Buffer"] = generateScriptingFunction(name + "Buffer", name, script, null); - } - /** - * @ignore - */ - sendCommand(command, stream, node) { - throw new Error('"sendCommand" is not implemented'); - } - }; - var commands = commands_1.list.filter((command) => command !== "monitor"); - commands.push("sentinel"); - commands.forEach(function(commandName) { - Commander.prototype[commandName] = generateFunction(commandName, commandName, "utf8"); - Commander.prototype[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); - }); - Commander.prototype.call = generateFunction("call", "utf8"); - Commander.prototype.callBuffer = generateFunction("callBuffer", null); - Commander.prototype.send_command = Commander.prototype.call; - function generateFunction(functionName, _commandName, _encoding) { - if (typeof _encoding === "undefined") { - _encoding = _commandName; - _commandName = null; - } - return function(...args) { - const commandName = _commandName || args.shift(); - let callback = args[args.length - 1]; - if (typeof callback === "function") { - args.pop(); - } else { - callback = void 0; - } - const options = { - errorStack: this.options.showFriendlyErrorStack ? new Error() : void 0, - keyPrefix: this.options.keyPrefix, - replyEncoding: _encoding - }; - if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { - return this.sendCommand( - // @ts-expect-error - new Command_1.default(commandName, args, options, callback) - ); - } - return (0, autoPipelining_1.executeWithAutoPipelining)( - this, - functionName, - commandName, - // @ts-expect-error - args, - callback - ); - }; - } - function generateScriptingFunction(functionName, commandName, script, encoding) { - return function(...args) { - const callback = typeof args[args.length - 1] === "function" ? args.pop() : void 0; - const options = { - replyEncoding: encoding - }; - if (this.options.showFriendlyErrorStack) { - options.errorStack = new Error(); - } - if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { - return script.execute(this, args, options, callback); - } - return (0, autoPipelining_1.executeWithAutoPipelining)(this, functionName, commandName, args, callback); - }; - } - exports2.default = Commander; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js -var require_Pipeline = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var calculateSlot = require_lib(); - var commands_1 = require_built(); - var standard_as_callback_1 = require_built2(); - var util_1 = require("util"); - var Command_1 = require_Command(); - var utils_1 = require_utils2(); - var Commander_1 = require_Commander(); - function generateMultiWithNodes(redis, keys) { - const slot = calculateSlot(keys[0]); - const target = redis._groupsBySlot[slot]; - for (let i = 1; i < keys.length; i++) { - if (redis._groupsBySlot[calculateSlot(keys[i])] !== target) { - return -1; - } - } - return slot; - } - var Pipeline = class extends Commander_1.default { - constructor(redis) { - super(); - this.redis = redis; - this.isPipeline = true; - this.replyPending = 0; - this._queue = []; - this._result = []; - this._transactions = 0; - this._shaToScript = {}; - this.isCluster = this.redis.constructor.name === "Cluster" || this.redis.isCluster; - this.options = redis.options; - Object.keys(redis.scriptsSet).forEach((name) => { - const script = redis.scriptsSet[name]; - this._shaToScript[script.sha] = script; - this[name] = redis[name]; - this[name + "Buffer"] = redis[name + "Buffer"]; - }); - redis.addedBuiltinSet.forEach((name) => { - this[name] = redis[name]; - this[name + "Buffer"] = redis[name + "Buffer"]; - }); - this.promise = new Promise((resolve2, reject) => { - this.resolve = resolve2; - this.reject = reject; - }); - const _this = this; - Object.defineProperty(this, "length", { - get: function() { - return _this._queue.length; - } - }); - } - fillResult(value, position) { - if (this._queue[position].name === "exec" && Array.isArray(value[1])) { - const execLength = value[1].length; - for (let i = 0; i < execLength; i++) { - if (value[1][i] instanceof Error) { - continue; - } - const cmd = this._queue[position - (execLength - i)]; - try { - value[1][i] = cmd.transformReply(value[1][i]); - } catch (err) { - value[1][i] = err; - } - } - } - this._result[position] = value; - if (--this.replyPending) { - return; - } - if (this.isCluster) { - let retriable = true; - let commonError; - for (let i = 0; i < this._result.length; ++i) { - const error = this._result[i][0]; - const command = this._queue[i]; - if (error) { - if (command.name === "exec" && error.message === "EXECABORT Transaction discarded because of previous errors.") { - continue; - } - if (!commonError) { - commonError = { - name: error.name, - message: error.message - }; - } else if (commonError.name !== error.name || commonError.message !== error.message) { - retriable = false; - break; - } - } else if (!command.inTransaction) { - const isReadOnly = (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); - if (!isReadOnly) { - retriable = false; - break; - } - } - } - if (commonError && retriable) { - const _this = this; - const errv = commonError.message.split(" "); - const queue = this._queue; - let inTransaction = false; - this._queue = []; - for (let i = 0; i < queue.length; ++i) { - if (errv[0] === "ASK" && !inTransaction && queue[i].name !== "asking" && (!queue[i - 1] || queue[i - 1].name !== "asking")) { - const asking = new Command_1.default("asking"); - asking.ignore = true; - this.sendCommand(asking); - } - queue[i].initPromise(); - this.sendCommand(queue[i]); - inTransaction = queue[i].inTransaction; - } - let matched = true; - if (typeof this.leftRedirections === "undefined") { - this.leftRedirections = {}; - } - const exec = function() { - _this.exec(); - }; - const cluster = this.redis; - cluster.handleError(commonError, this.leftRedirections, { - moved: function(_slot, key) { - _this.preferKey = key; - cluster.slots[errv[1]] = [key]; - cluster._groupsBySlot[errv[1]] = cluster._groupsIds[cluster.slots[errv[1]].join(";")]; - cluster.refreshSlotsCache(); - _this.exec(); - }, - ask: function(_slot, key) { - _this.preferKey = key; - _this.exec(); - }, - tryagain: exec, - clusterDown: exec, - connectionClosed: exec, - maxRedirections: () => { - matched = false; - }, - defaults: () => { - matched = false; - } - }); - if (matched) { - return; - } - } - } - let ignoredCount = 0; - for (let i = 0; i < this._queue.length - ignoredCount; ++i) { - if (this._queue[i + ignoredCount].ignore) { - ignoredCount += 1; - } - this._result[i] = this._result[i + ignoredCount]; - } - this.resolve(this._result.slice(0, this._result.length - ignoredCount)); - } - sendCommand(command) { - if (this._transactions > 0) { - command.inTransaction = true; - } - const position = this._queue.length; - command.pipelineIndex = position; - command.promise.then((result) => { - this.fillResult([null, result], position); - }).catch((error) => { - this.fillResult([error], position); - }); - this._queue.push(command); - return this; - } - addBatch(commands) { - let command, commandName, args; - for (let i = 0; i < commands.length; ++i) { - command = commands[i]; - commandName = command[0]; - args = command.slice(1); - this[commandName].apply(this, args); - } - return this; - } - }; - exports2.default = Pipeline; - var multi = Pipeline.prototype.multi; - Pipeline.prototype.multi = function() { - this._transactions += 1; - return multi.apply(this, arguments); - }; - var execBuffer = Pipeline.prototype.execBuffer; - Pipeline.prototype.execBuffer = (0, util_1.deprecate)(function() { - if (this._transactions > 0) { - this._transactions -= 1; - } - return execBuffer.apply(this, arguments); - }, "Pipeline#execBuffer: Use Pipeline#exec instead"); - Pipeline.prototype.exec = function(callback) { - if (this.isCluster && !this.redis.slots.length) { - if (this.redis.status === "wait") - this.redis.connect().catch(utils_1.noop); - if (callback && !this.nodeifiedPromise) { - this.nodeifiedPromise = true; - (0, standard_as_callback_1.default)(this.promise, callback); - } - this.redis.delayUntilReady((err) => { - if (err) { - this.reject(err); - return; - } - this.exec(callback); - }); - return this.promise; - } - if (this._transactions > 0) { - this._transactions -= 1; - return execBuffer.apply(this, arguments); - } - if (!this.nodeifiedPromise) { - this.nodeifiedPromise = true; - (0, standard_as_callback_1.default)(this.promise, callback); - } - if (!this._queue.length) { - this.resolve([]); - } - let pipelineSlot; - if (this.isCluster) { - const sampleKeys = []; - for (let i = 0; i < this._queue.length; i++) { - const keys = this._queue[i].getKeys(); - if (keys.length) { - sampleKeys.push(keys[0]); - } - if (keys.length && calculateSlot.generateMulti(keys) < 0) { - this.reject(new Error("All the keys in a pipeline command should belong to the same slot")); - return this.promise; - } - } - if (sampleKeys.length) { - pipelineSlot = generateMultiWithNodes(this.redis, sampleKeys); - if (pipelineSlot < 0) { - this.reject(new Error("All keys in the pipeline should belong to the same slots allocation group")); - return this.promise; - } - } else { - pipelineSlot = Math.random() * 16384 | 0; - } - } - const _this = this; - execPipeline(); - return this.promise; - function execPipeline() { - let writePending = _this.replyPending = _this._queue.length; - let node; - if (_this.isCluster) { - node = { - slot: pipelineSlot, - redis: _this.redis.connectionPool.nodes.all[_this.preferKey] - }; - } - let data = ""; - let buffers; - const stream = { - isPipeline: true, - destination: _this.isCluster ? node : { redis: _this.redis }, - write(writable) { - if (typeof writable !== "string") { - if (!buffers) { - buffers = []; - } - if (data) { - buffers.push(Buffer.from(data, "utf8")); - data = ""; - } - buffers.push(writable); - } else { - data += writable; - } - if (!--writePending) { - if (buffers) { - if (data) { - buffers.push(Buffer.from(data, "utf8")); - } - stream.destination.redis.stream.write(Buffer.concat(buffers)); - } else { - stream.destination.redis.stream.write(data); - } - writePending = _this._queue.length; - data = ""; - buffers = void 0; - } - } - }; - for (let i = 0; i < _this._queue.length; ++i) { - _this.redis.sendCommand(_this._queue[i], stream, node); - } - return _this.promise; - } - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js -var require_transaction = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.addTransactionSupport = void 0; - var utils_1 = require_utils2(); - var standard_as_callback_1 = require_built2(); - var Pipeline_1 = require_Pipeline(); - function addTransactionSupport(redis) { - redis.pipeline = function(commands) { - const pipeline = new Pipeline_1.default(this); - if (Array.isArray(commands)) { - pipeline.addBatch(commands); - } - return pipeline; - }; - const { multi } = redis; - redis.multi = function(commands, options) { - if (typeof options === "undefined" && !Array.isArray(commands)) { - options = commands; - commands = null; - } - if (options && options.pipeline === false) { - return multi.call(this); - } - const pipeline = new Pipeline_1.default(this); - pipeline.multi(); - if (Array.isArray(commands)) { - pipeline.addBatch(commands); - } - const exec2 = pipeline.exec; - pipeline.exec = function(callback) { - if (this.isCluster && !this.redis.slots.length) { - if (this.redis.status === "wait") - this.redis.connect().catch(utils_1.noop); - return (0, standard_as_callback_1.default)(new Promise((resolve2, reject) => { - this.redis.delayUntilReady((err) => { - if (err) { - reject(err); - return; - } - this.exec(pipeline).then(resolve2, reject); - }); - }), callback); - } - if (this._transactions > 0) { - exec2.call(pipeline); - } - if (this.nodeifiedPromise) { - return exec2.call(pipeline); - } - const promise = exec2.call(pipeline); - return (0, standard_as_callback_1.default)(promise.then(function(result) { - const execResult = result[result.length - 1]; - if (typeof execResult === "undefined") { - throw new Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it."); - } - if (execResult[0]) { - execResult[0].previousErrors = []; - for (let i = 0; i < result.length - 1; ++i) { - if (result[i][0]) { - execResult[0].previousErrors.push(result[i][0]); - } - } - throw execResult[0]; - } - return (0, utils_1.wrapMultiResult)(execResult[1]); - }), callback); - }; - const { execBuffer } = pipeline; - pipeline.execBuffer = function(callback) { - if (this._transactions > 0) { - execBuffer.call(pipeline); - } - return pipeline.exec(callback); - }; - return pipeline; - }; - const { exec } = redis; - redis.exec = function(callback) { - return (0, standard_as_callback_1.default)(exec.call(this).then(function(results) { - if (Array.isArray(results)) { - results = (0, utils_1.wrapMultiResult)(results); - } - return results; - }), callback); - }; - } - exports2.addTransactionSupport = addTransactionSupport; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js -var require_applyMixin = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function applyMixin(derivedConstructor, mixinConstructor) { - Object.getOwnPropertyNames(mixinConstructor.prototype).forEach((name) => { - Object.defineProperty(derivedConstructor.prototype, name, Object.getOwnPropertyDescriptor(mixinConstructor.prototype, name)); - }); - } - exports2.default = applyMixin; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js -var require_ClusterOptions = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_CLUSTER_OPTIONS = void 0; - var dns_1 = require("dns"); - exports2.DEFAULT_CLUSTER_OPTIONS = { - clusterRetryStrategy: (times) => Math.min(100 + times * 2, 2e3), - enableOfflineQueue: true, - enableReadyCheck: true, - scaleReads: "master", - maxRedirections: 16, - retryDelayOnMoved: 0, - retryDelayOnFailover: 100, - retryDelayOnClusterDown: 100, - retryDelayOnTryAgain: 100, - slotsRefreshTimeout: 1e3, - useSRVRecords: false, - resolveSrv: dns_1.resolveSrv, - dnsLookup: dns_1.lookup, - enableAutoPipelining: false, - autoPipeliningIgnoredCommands: [], - shardedSubscribers: false - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js -var require_util = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getConnectionName = exports2.weightSrvRecords = exports2.groupSrvRecords = exports2.getUniqueHostnamesFromOptions = exports2.normalizeNodeOptions = exports2.nodeKeyToRedisOptions = exports2.getNodeKey = void 0; - var utils_1 = require_utils2(); - var net_1 = require("net"); - function getNodeKey(node) { - node.port = node.port || 6379; - node.host = node.host || "127.0.0.1"; - return node.host + ":" + node.port; - } - exports2.getNodeKey = getNodeKey; - function nodeKeyToRedisOptions(nodeKey) { - const portIndex = nodeKey.lastIndexOf(":"); - if (portIndex === -1) { - throw new Error(`Invalid node key ${nodeKey}`); - } - return { - host: nodeKey.slice(0, portIndex), - port: Number(nodeKey.slice(portIndex + 1)) - }; - } - exports2.nodeKeyToRedisOptions = nodeKeyToRedisOptions; - function normalizeNodeOptions(nodes) { - return nodes.map((node) => { - const options = {}; - if (typeof node === "object") { - Object.assign(options, node); - } else if (typeof node === "string") { - Object.assign(options, (0, utils_1.parseURL)(node)); - } else if (typeof node === "number") { - options.port = node; - } else { - throw new Error("Invalid argument " + node); - } - if (typeof options.port === "string") { - options.port = parseInt(options.port, 10); - } - delete options.db; - if (!options.port) { - options.port = 6379; - } - if (!options.host) { - options.host = "127.0.0.1"; - } - return (0, utils_1.resolveTLSProfile)(options); - }); - } - exports2.normalizeNodeOptions = normalizeNodeOptions; - function getUniqueHostnamesFromOptions(nodes) { - const uniqueHostsMap = {}; - nodes.forEach((node) => { - uniqueHostsMap[node.host] = true; - }); - return Object.keys(uniqueHostsMap).filter((host) => !(0, net_1.isIP)(host)); - } - exports2.getUniqueHostnamesFromOptions = getUniqueHostnamesFromOptions; - function groupSrvRecords(records) { - const recordsByPriority = {}; - for (const record of records) { - if (!recordsByPriority.hasOwnProperty(record.priority)) { - recordsByPriority[record.priority] = { - totalWeight: record.weight, - records: [record] - }; - } else { - recordsByPriority[record.priority].totalWeight += record.weight; - recordsByPriority[record.priority].records.push(record); - } - } - return recordsByPriority; - } - exports2.groupSrvRecords = groupSrvRecords; - function weightSrvRecords(recordsGroup) { - if (recordsGroup.records.length === 1) { - recordsGroup.totalWeight = 0; - return recordsGroup.records.shift(); - } - const random = Math.floor(Math.random() * (recordsGroup.totalWeight + recordsGroup.records.length)); - let total = 0; - for (const [i, record] of recordsGroup.records.entries()) { - total += 1 + record.weight; - if (total > random) { - recordsGroup.totalWeight -= record.weight; - recordsGroup.records.splice(i, 1); - return record; - } - } - } - exports2.weightSrvRecords = weightSrvRecords; - function getConnectionName(component, nodeConnectionName) { - const prefix = `ioredis-cluster(${component})`; - return nodeConnectionName ? `${prefix}:${nodeConnectionName}` : prefix; - } - exports2.getConnectionName = getConnectionName; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js -var require_ClusterSubscriber = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var utils_1 = require_utils2(); - var Redis_1 = require_Redis(); - var debug = (0, utils_1.Debug)("cluster:subscriber"); - var ClusterSubscriber = class { - constructor(connectionPool, emitter, isSharded = false) { - this.connectionPool = connectionPool; - this.emitter = emitter; - this.isSharded = isSharded; - this.started = false; - this.subscriber = null; - this.slotRange = []; - this.onSubscriberEnd = () => { - if (!this.started) { - debug("subscriber has disconnected, but ClusterSubscriber is not started, so not reconnecting."); - return; - } - debug("subscriber has disconnected, selecting a new one..."); - this.selectSubscriber(); - }; - this.connectionPool.on("-node", (_, key) => { - if (!this.started || !this.subscriber) { - return; - } - if ((0, util_1.getNodeKey)(this.subscriber.options) === key) { - debug("subscriber has left, selecting a new one..."); - this.selectSubscriber(); - } - }); - this.connectionPool.on("+node", () => { - if (!this.started || this.subscriber) { - return; - } - debug("a new node is discovered and there is no subscriber, selecting a new one..."); - this.selectSubscriber(); - }); - } - getInstance() { - return this.subscriber; - } - /** - * Associate this subscriber to a specific slot range. - * - * Returns the range or an empty array if the slot range couldn't be associated. - * - * BTW: This is more for debugging and testing purposes. - * - * @param range - */ - associateSlotRange(range) { - if (this.isSharded) { - this.slotRange = range; - } - return this.slotRange; - } - start() { - this.started = true; - this.selectSubscriber(); - debug("started"); - } - stop() { - this.started = false; - if (this.subscriber) { - this.subscriber.disconnect(); - this.subscriber = null; - } - } - isStarted() { - return this.started; - } - selectSubscriber() { - const lastActiveSubscriber = this.lastActiveSubscriber; - if (lastActiveSubscriber) { - lastActiveSubscriber.off("end", this.onSubscriberEnd); - lastActiveSubscriber.disconnect(); - } - if (this.subscriber) { - this.subscriber.off("end", this.onSubscriberEnd); - this.subscriber.disconnect(); - } - const sampleNode = (0, utils_1.sample)(this.connectionPool.getNodes()); - if (!sampleNode) { - debug("selecting subscriber failed since there is no node discovered in the cluster yet"); - this.subscriber = null; - return; - } - const { options } = sampleNode; - debug("selected a subscriber %s:%s", options.host, options.port); - let connectionPrefix = "subscriber"; - if (this.isSharded) - connectionPrefix = "ssubscriber"; - this.subscriber = new Redis_1.default({ - port: options.port, - host: options.host, - username: options.username, - password: options.password, - enableReadyCheck: true, - connectionName: (0, util_1.getConnectionName)(connectionPrefix, options.connectionName), - lazyConnect: true, - tls: options.tls, - // Don't try to reconnect the subscriber connection. If the connection fails - // we will get an end event (handled below), at which point we'll pick a new - // node from the pool and try to connect to that as the subscriber connection. - retryStrategy: null - }); - this.subscriber.on("error", utils_1.noop); - this.subscriber.on("moved", () => { - this.emitter.emit("forceRefresh"); - }); - this.subscriber.once("end", this.onSubscriberEnd); - const previousChannels = { subscribe: [], psubscribe: [], ssubscribe: [] }; - if (lastActiveSubscriber) { - const condition = lastActiveSubscriber.condition || lastActiveSubscriber.prevCondition; - if (condition && condition.subscriber) { - previousChannels.subscribe = condition.subscriber.channels("subscribe"); - previousChannels.psubscribe = condition.subscriber.channels("psubscribe"); - previousChannels.ssubscribe = condition.subscriber.channels("ssubscribe"); - } - } - if (previousChannels.subscribe.length || previousChannels.psubscribe.length || previousChannels.ssubscribe.length) { - let pending = 0; - for (const type of ["subscribe", "psubscribe", "ssubscribe"]) { - const channels = previousChannels[type]; - if (channels.length == 0) { - continue; - } - debug("%s %d channels", type, channels.length); - if (type === "ssubscribe") { - for (const channel of channels) { - pending += 1; - this.subscriber[type](channel).then(() => { - if (!--pending) { - this.lastActiveSubscriber = this.subscriber; - } - }).catch(() => { - debug("failed to ssubscribe to channel: %s", channel); - }); - } - } else { - pending += 1; - this.subscriber[type](channels).then(() => { - if (!--pending) { - this.lastActiveSubscriber = this.subscriber; - } - }).catch(() => { - debug("failed to %s %d channels", type, channels.length); - }); - } - } - } else { - this.lastActiveSubscriber = this.subscriber; - } - for (const event of [ - "message", - "messageBuffer" - ]) { - this.subscriber.on(event, (arg1, arg2) => { - this.emitter.emit(event, arg1, arg2); - }); - } - for (const event of ["pmessage", "pmessageBuffer"]) { - this.subscriber.on(event, (arg1, arg2, arg3) => { - this.emitter.emit(event, arg1, arg2, arg3); - }); - } - if (this.isSharded == true) { - for (const event of [ - "smessage", - "smessageBuffer" - ]) { - this.subscriber.on(event, (arg1, arg2) => { - this.emitter.emit(event, arg1, arg2); - }); - } - } - } - }; - exports2.default = ClusterSubscriber; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js -var require_ConnectionPool = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var events_1 = require("events"); - var utils_1 = require_utils2(); - var util_1 = require_util(); - var Redis_1 = require_Redis(); - var debug = (0, utils_1.Debug)("cluster:connectionPool"); - var ConnectionPool = class extends events_1.EventEmitter { - constructor(redisOptions) { - super(); - this.redisOptions = redisOptions; - this.nodes = { - all: {}, - master: {}, - slave: {} - }; - this.specifiedOptions = {}; - } - getNodes(role = "all") { - const nodes = this.nodes[role]; - return Object.keys(nodes).map((key) => nodes[key]); - } - getInstanceByKey(key) { - return this.nodes.all[key]; - } - getSampleInstance(role) { - const keys = Object.keys(this.nodes[role]); - const sampleKey = (0, utils_1.sample)(keys); - return this.nodes[role][sampleKey]; - } - /** - * Add a master node to the pool - * @param node - */ - addMasterNode(node) { - const key = (0, util_1.getNodeKey)(node.options); - const redis = this.createRedisFromOptions(node, node.options.readOnly); - if (!node.options.readOnly) { - this.nodes.all[key] = redis; - this.nodes.master[key] = redis; - return true; - } - return false; - } - /** - * Creates a Redis connection instance from the node options - * @param node - * @param readOnly - */ - createRedisFromOptions(node, readOnly) { - const redis = new Redis_1.default((0, utils_1.defaults)({ - // Never try to reconnect when a node is lose, - // instead, waiting for a `MOVED` error and - // fetch the slots again. - retryStrategy: null, - // Offline queue should be enabled so that - // we don't need to wait for the `ready` event - // before sending commands to the node. - enableOfflineQueue: true, - readOnly - }, node, this.redisOptions, { lazyConnect: true })); - return redis; - } - /** - * Find or create a connection to the node - */ - findOrCreate(node, readOnly = false) { - const key = (0, util_1.getNodeKey)(node); - readOnly = Boolean(readOnly); - if (this.specifiedOptions[key]) { - Object.assign(node, this.specifiedOptions[key]); - } else { - this.specifiedOptions[key] = node; - } - let redis; - if (this.nodes.all[key]) { - redis = this.nodes.all[key]; - if (redis.options.readOnly !== readOnly) { - redis.options.readOnly = readOnly; - debug("Change role of %s to %s", key, readOnly ? "slave" : "master"); - redis[readOnly ? "readonly" : "readwrite"]().catch(utils_1.noop); - if (readOnly) { - delete this.nodes.master[key]; - this.nodes.slave[key] = redis; - } else { - delete this.nodes.slave[key]; - this.nodes.master[key] = redis; - } - } - } else { - debug("Connecting to %s as %s", key, readOnly ? "slave" : "master"); - redis = this.createRedisFromOptions(node, readOnly); - this.nodes.all[key] = redis; - this.nodes[readOnly ? "slave" : "master"][key] = redis; - redis.once("end", () => { - this.removeNode(key); - this.emit("-node", redis, key); - if (!Object.keys(this.nodes.all).length) { - this.emit("drain"); - } - }); - this.emit("+node", redis, key); - redis.on("error", function(error) { - this.emit("nodeError", error, key); - }); - } - return redis; - } - /** - * Reset the pool with a set of nodes. - * The old node will be removed. - */ - reset(nodes) { - debug("Reset with %O", nodes); - const newNodes = {}; - nodes.forEach((node) => { - const key = (0, util_1.getNodeKey)(node); - if (!(node.readOnly && newNodes[key])) { - newNodes[key] = node; - } - }); - Object.keys(this.nodes.all).forEach((key) => { - if (!newNodes[key]) { - debug("Disconnect %s because the node does not hold any slot", key); - this.nodes.all[key].disconnect(); - this.removeNode(key); - } - }); - Object.keys(newNodes).forEach((key) => { - const node = newNodes[key]; - this.findOrCreate(node, node.readOnly); - }); - } - /** - * Remove a node from the pool. - */ - removeNode(key) { - const { nodes } = this; - if (nodes.all[key]) { - debug("Remove %s from the pool", key); - delete nodes.all[key]; - } - delete nodes.master[key]; - delete nodes.slave[key]; - } - }; - exports2.default = ConnectionPool; - } -}); - -// node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js -var require_denque = __commonJS({ - "node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js"(exports2, module2) { - "use strict"; - function Denque(array, options) { - var options = options || {}; - this._capacity = options.capacity; - this._head = 0; - this._tail = 0; - if (Array.isArray(array)) { - this._fromArray(array); - } else { - this._capacityMask = 3; - this._list = new Array(4); - } - } - Denque.prototype.peekAt = function peekAt(index) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - var len = this.size(); - if (i >= len || i < -len) return void 0; - if (i < 0) i += len; - i = this._head + i & this._capacityMask; - return this._list[i]; - }; - Denque.prototype.get = function get(i) { - return this.peekAt(i); - }; - Denque.prototype.peek = function peek() { - if (this._head === this._tail) return void 0; - return this._list[this._head]; - }; - Denque.prototype.peekFront = function peekFront() { - return this.peek(); - }; - Denque.prototype.peekBack = function peekBack() { - return this.peekAt(-1); - }; - Object.defineProperty(Denque.prototype, "length", { - get: function length() { - return this.size(); - } - }); - Denque.prototype.size = function size() { - if (this._head === this._tail) return 0; - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.unshift = function unshift(item) { - if (arguments.length === 0) return this.size(); - var len = this._list.length; - this._head = this._head - 1 + len & this._capacityMask; - this._list[this._head] = item; - if (this._tail === this._head) this._growArray(); - if (this._capacity && this.size() > this._capacity) this.pop(); - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.shift = function shift() { - var head = this._head; - if (head === this._tail) return void 0; - var item = this._list[head]; - this._list[head] = void 0; - this._head = head + 1 & this._capacityMask; - if (head < 2 && this._tail > 1e4 && this._tail <= this._list.length >>> 2) this._shrinkArray(); - return item; - }; - Denque.prototype.push = function push(item) { - if (arguments.length === 0) return this.size(); - var tail = this._tail; - this._list[tail] = item; - this._tail = tail + 1 & this._capacityMask; - if (this._tail === this._head) { - this._growArray(); - } - if (this._capacity && this.size() > this._capacity) { - this.shift(); - } - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.pop = function pop() { - var tail = this._tail; - if (tail === this._head) return void 0; - var len = this._list.length; - this._tail = tail - 1 + len & this._capacityMask; - var item = this._list[this._tail]; - this._list[this._tail] = void 0; - if (this._head < 2 && tail > 1e4 && tail <= len >>> 2) this._shrinkArray(); - return item; - }; - Denque.prototype.removeOne = function removeOne(index) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size) return void 0; - if (i < 0) i += size; - i = this._head + i & this._capacityMask; - var item = this._list[i]; - var k; - if (index < size / 2) { - for (k = index; k > 0; k--) { - this._list[i] = this._list[i = i - 1 + len & this._capacityMask]; - } - this._list[i] = void 0; - this._head = this._head + 1 + len & this._capacityMask; - } else { - for (k = size - 1 - index; k > 0; k--) { - this._list[i] = this._list[i = i + 1 + len & this._capacityMask]; - } - this._list[i] = void 0; - this._tail = this._tail - 1 + len & this._capacityMask; - } - return item; - }; - Denque.prototype.remove = function remove(index, count) { - var i = index; - var removed; - var del_count = count; - if (i !== (i | 0)) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size || count < 1) return void 0; - if (i < 0) i += size; - if (count === 1 || !count) { - removed = new Array(1); - removed[0] = this.removeOne(i); - return removed; - } - if (i === 0 && i + count >= size) { - removed = this.toArray(); - this.clear(); - return removed; - } - if (i + count > size) count = size - i; - var k; - removed = new Array(count); - for (k = 0; k < count; k++) { - removed[k] = this._list[this._head + i + k & this._capacityMask]; - } - i = this._head + i & this._capacityMask; - if (index + count === size) { - this._tail = this._tail - count + len & this._capacityMask; - for (k = count; k > 0; k--) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - } - return removed; - } - if (index === 0) { - this._head = this._head + count + len & this._capacityMask; - for (k = count - 1; k > 0; k--) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - } - return removed; - } - if (i < size / 2) { - this._head = this._head + index + count + len & this._capacityMask; - for (k = index; k > 0; k--) { - this.unshift(this._list[i = i - 1 + len & this._capacityMask]); - } - i = this._head - 1 + len & this._capacityMask; - while (del_count > 0) { - this._list[i = i - 1 + len & this._capacityMask] = void 0; - del_count--; - } - if (index < 0) this._tail = i; - } else { - this._tail = i; - i = i + count + len & this._capacityMask; - for (k = size - (count + index); k > 0; k--) { - this.push(this._list[i++]); - } - i = this._tail; - while (del_count > 0) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - del_count--; - } - } - if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2) this._shrinkArray(); - return removed; - }; - Denque.prototype.splice = function splice(index, count) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - var size = this.size(); - if (i < 0) i += size; - if (i > size) return void 0; - if (arguments.length > 2) { - var k; - var temp; - var removed; - var arg_len = arguments.length; - var len = this._list.length; - var arguments_index = 2; - if (!size || i < size / 2) { - temp = new Array(i); - for (k = 0; k < i; k++) { - temp[k] = this._list[this._head + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i > 0) { - this._head = this._head + i + len & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._head = this._head + i + len & this._capacityMask; - } - while (arg_len > arguments_index) { - this.unshift(arguments[--arg_len]); - } - for (k = i; k > 0; k--) { - this.unshift(temp[k - 1]); - } - } else { - temp = new Array(size - (i + count)); - var leng = temp.length; - for (k = 0; k < leng; k++) { - temp[k] = this._list[this._head + i + count + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i != size) { - this._tail = this._head + i + len & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._tail = this._tail - leng + len & this._capacityMask; - } - while (arguments_index < arg_len) { - this.push(arguments[arguments_index++]); - } - for (k = 0; k < leng; k++) { - this.push(temp[k]); - } - } - return removed; - } else { - return this.remove(i, count); - } - }; - Denque.prototype.clear = function clear() { - this._list = new Array(this._list.length); - this._head = 0; - this._tail = 0; - }; - Denque.prototype.isEmpty = function isEmpty() { - return this._head === this._tail; - }; - Denque.prototype.toArray = function toArray() { - return this._copyArray(false); - }; - Denque.prototype._fromArray = function _fromArray(array) { - var length = array.length; - var capacity = this._nextPowerOf2(length); - this._list = new Array(capacity); - this._capacityMask = capacity - 1; - this._tail = length; - for (var i = 0; i < length; i++) this._list[i] = array[i]; - }; - Denque.prototype._copyArray = function _copyArray(fullCopy, size) { - var src = this._list; - var capacity = src.length; - var length = this.length; - size = size | length; - if (size == length && this._head < this._tail) { - return this._list.slice(this._head, this._tail); - } - var dest = new Array(size); - var k = 0; - var i; - if (fullCopy || this._head > this._tail) { - for (i = this._head; i < capacity; i++) dest[k++] = src[i]; - for (i = 0; i < this._tail; i++) dest[k++] = src[i]; - } else { - for (i = this._head; i < this._tail; i++) dest[k++] = src[i]; - } - return dest; - }; - Denque.prototype._growArray = function _growArray() { - if (this._head != 0) { - var newList = this._copyArray(true, this._list.length << 1); - this._tail = this._list.length; - this._head = 0; - this._list = newList; - } else { - this._tail = this._list.length; - this._list.length <<= 1; - } - this._capacityMask = this._capacityMask << 1 | 1; - }; - Denque.prototype._shrinkArray = function _shrinkArray() { - this._list.length >>>= 1; - this._capacityMask >>>= 1; - }; - Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) { - var log2 = Math.log(num) / Math.log(2); - var nextPow2 = 1 << log2 + 1; - return Math.max(nextPow2, 4); - }; - module2.exports = Denque; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js -var require_DelayQueue = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var Deque = require_denque(); - var debug = (0, utils_1.Debug)("delayqueue"); - var DelayQueue = class { - constructor() { - this.queues = {}; - this.timeouts = {}; - } - /** - * Add a new item to the queue - * - * @param bucket bucket name - * @param item function that will run later - * @param options - */ - push(bucket, item, options) { - const callback = options.callback || process.nextTick; - if (!this.queues[bucket]) { - this.queues[bucket] = new Deque(); - } - const queue = this.queues[bucket]; - queue.push(item); - if (!this.timeouts[bucket]) { - this.timeouts[bucket] = setTimeout(() => { - callback(() => { - this.timeouts[bucket] = null; - this.execute(bucket); - }); - }, options.timeout); - } - } - execute(bucket) { - const queue = this.queues[bucket]; - if (!queue) { - return; - } - const { length } = queue; - if (!length) { - return; - } - debug("send %d commands in %s queue", length, bucket); - this.queues[bucket] = null; - while (queue.length > 0) { - queue.shift()(); - } - } - }; - exports2.default = DelayQueue; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js -var require_ClusterSubscriberGroup = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var ClusterSubscriber_1 = require_ClusterSubscriber(); - var ConnectionPool_1 = require_ConnectionPool(); - var util_1 = require_util(); - var calculateSlot = require_lib(); - var debug = (0, utils_1.Debug)("cluster:subscriberGroup"); - var ClusterSubscriberGroup = class { - /** - * Register callbacks - * - * @param cluster - */ - constructor(cluster, refreshSlotsCacheCallback) { - this.cluster = cluster; - this.shardedSubscribers = /* @__PURE__ */ new Map(); - this.clusterSlots = []; - this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); - this.channels = /* @__PURE__ */ new Map(); - cluster.on("+node", (redis) => { - this._addSubscriber(redis); - }); - cluster.on("-node", (redis) => { - this._removeSubscriber(redis); - }); - cluster.on("refresh", () => { - this._refreshSlots(cluster); - }); - cluster.on("forceRefresh", () => { - refreshSlotsCacheCallback(); - }); - } - /** - * Get the responsible subscriber. - * - * Returns null if no subscriber was found - * - * @param slot - */ - getResponsibleSubscriber(slot) { - const nodeKey = this.clusterSlots[slot][0]; - return this.shardedSubscribers.get(nodeKey); - } - /** - * Adds a channel for which this subscriber group is responsible - * - * @param channels - */ - addChannels(channels) { - const slot = calculateSlot(channels[0]); - channels.forEach((c) => { - if (calculateSlot(c) != slot) - return -1; - }); - const currChannels = this.channels.get(slot); - if (!currChannels) { - this.channels.set(slot, channels); - } else { - this.channels.set(slot, currChannels.concat(channels)); - } - return [...this.channels.values()].flatMap((v) => v).length; - } - /** - * Removes channels for which the subscriber group is responsible by optionally unsubscribing - * @param channels - */ - removeChannels(channels) { - const slot = calculateSlot(channels[0]); - channels.forEach((c) => { - if (calculateSlot(c) != slot) - return -1; - }); - const slotChannels = this.channels.get(slot); - if (slotChannels) { - const updatedChannels = slotChannels.filter((c) => !channels.includes(c)); - this.channels.set(slot, updatedChannels); - } - return [...this.channels.values()].flatMap((v) => v).length; - } - /** - * Disconnect all subscribers - */ - stop() { - for (const s of this.shardedSubscribers.values()) { - s.stop(); - } - } - /** - * Start all not yet started subscribers - */ - start() { - for (const s of this.shardedSubscribers.values()) { - if (!s.isStarted()) { - s.start(); - } - } - } - /** - * Add a subscriber to the group of subscribers - * - * @param redis - */ - _addSubscriber(redis) { - const pool = new ConnectionPool_1.default(redis.options); - if (pool.addMasterNode(redis)) { - const sub = new ClusterSubscriber_1.default(pool, this.cluster, true); - const nodeKey = (0, util_1.getNodeKey)(redis.options); - this.shardedSubscribers.set(nodeKey, sub); - sub.start(); - this._resubscribe(); - this.cluster.emit("+subscriber"); - return sub; - } - return null; - } - /** - * Removes a subscriber from the group - * @param redis - */ - _removeSubscriber(redis) { - const nodeKey = (0, util_1.getNodeKey)(redis.options); - const sub = this.shardedSubscribers.get(nodeKey); - if (sub) { - sub.stop(); - this.shardedSubscribers.delete(nodeKey); - this._resubscribe(); - this.cluster.emit("-subscriber"); - } - return this.shardedSubscribers; - } - /** - * Refreshes the subscriber-related slot ranges - * - * Returns false if no refresh was needed - * - * @param cluster - */ - _refreshSlots(cluster) { - if (this._slotsAreEqual(cluster.slots)) { - debug("Nothing to refresh because the new cluster map is equal to the previous one."); - } else { - debug("Refreshing the slots of the subscriber group."); - this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); - for (let slot = 0; slot < cluster.slots.length; slot++) { - const node = cluster.slots[slot][0]; - if (!this.subscriberToSlotsIndex.has(node)) { - this.subscriberToSlotsIndex.set(node, []); - } - this.subscriberToSlotsIndex.get(node).push(Number(slot)); - } - this._resubscribe(); - this.clusterSlots = JSON.parse(JSON.stringify(cluster.slots)); - this.cluster.emit("subscribersReady"); - return true; - } - return false; - } - /** - * Resubscribes to the previous channels - * - * @private - */ - _resubscribe() { - if (this.shardedSubscribers) { - this.shardedSubscribers.forEach((s, nodeKey) => { - const subscriberSlots = this.subscriberToSlotsIndex.get(nodeKey); - if (subscriberSlots) { - s.associateSlotRange(subscriberSlots); - subscriberSlots.forEach((ss) => { - const redis = s.getInstance(); - const channels = this.channels.get(ss); - if (channels && channels.length > 0) { - if (redis) { - redis.ssubscribe(channels); - redis.on("ready", () => { - redis.ssubscribe(channels); - }); - } - } - }); - } - }); - } - } - /** - * Deep equality of the cluster slots objects - * - * @param other - * @private - */ - _slotsAreEqual(other) { - if (this.clusterSlots === void 0) - return false; - else - return JSON.stringify(this.clusterSlots) === JSON.stringify(other); - } - }; - exports2.default = ClusterSubscriberGroup; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js -var require_cluster = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var events_1 = require("events"); - var redis_errors_1 = require_redis_errors(); - var standard_as_callback_1 = require_built2(); - var Command_1 = require_Command(); - var ClusterAllFailedError_1 = require_ClusterAllFailedError(); - var Redis_1 = require_Redis(); - var ScanStream_1 = require_ScanStream(); - var transaction_1 = require_transaction(); - var utils_1 = require_utils2(); - var applyMixin_1 = require_applyMixin(); - var Commander_1 = require_Commander(); - var ClusterOptions_1 = require_ClusterOptions(); - var ClusterSubscriber_1 = require_ClusterSubscriber(); - var ConnectionPool_1 = require_ConnectionPool(); - var DelayQueue_1 = require_DelayQueue(); - var util_1 = require_util(); - var Deque = require_denque(); - var ClusterSubscriberGroup_1 = require_ClusterSubscriberGroup(); - var debug = (0, utils_1.Debug)("cluster"); - var REJECT_OVERWRITTEN_COMMANDS = /* @__PURE__ */ new WeakSet(); - var Cluster = class _Cluster extends Commander_1.default { - /** - * Creates an instance of Cluster. - */ - //TODO: Add an option that enables or disables sharded PubSub - constructor(startupNodes, options = {}) { - super(); - this.slots = []; - this._groupsIds = {}; - this._groupsBySlot = Array(16384); - this.isCluster = true; - this.retryAttempts = 0; - this.delayQueue = new DelayQueue_1.default(); - this.offlineQueue = new Deque(); - this.isRefreshing = false; - this._refreshSlotsCacheCallbacks = []; - this._autoPipelines = /* @__PURE__ */ new Map(); - this._runningAutoPipelines = /* @__PURE__ */ new Set(); - this._readyDelayedCallbacks = []; - this.connectionEpoch = 0; - events_1.EventEmitter.call(this); - this.startupNodes = startupNodes; - this.options = (0, utils_1.defaults)({}, options, ClusterOptions_1.DEFAULT_CLUSTER_OPTIONS, this.options); - if (this.options.shardedSubscribers == true) - this.shardedSubscribers = new ClusterSubscriberGroup_1.default(this, this.refreshSlotsCache.bind(this)); - if (this.options.redisOptions && this.options.redisOptions.keyPrefix && !this.options.keyPrefix) { - this.options.keyPrefix = this.options.redisOptions.keyPrefix; - } - if (typeof this.options.scaleReads !== "function" && ["all", "master", "slave"].indexOf(this.options.scaleReads) === -1) { - throw new Error('Invalid option scaleReads "' + this.options.scaleReads + '". Expected "all", "master", "slave" or a custom function'); - } - this.connectionPool = new ConnectionPool_1.default(this.options.redisOptions); - this.connectionPool.on("-node", (redis, key) => { - this.emit("-node", redis); - }); - this.connectionPool.on("+node", (redis) => { - this.emit("+node", redis); - }); - this.connectionPool.on("drain", () => { - this.setStatus("close"); - }); - this.connectionPool.on("nodeError", (error, key) => { - this.emit("node error", error, key); - }); - this.subscriber = new ClusterSubscriber_1.default(this.connectionPool, this); - if (this.options.scripts) { - Object.entries(this.options.scripts).forEach(([name, definition]) => { - this.defineCommand(name, definition); - }); - } - if (this.options.lazyConnect) { - this.setStatus("wait"); - } else { - this.connect().catch((err) => { - debug("connecting failed: %s", err); - }); - } - } - /** - * Connect to a cluster - */ - connect() { - return new Promise((resolve2, reject) => { - if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { - reject(new Error("Redis is already connecting/connected")); - return; - } - const epoch = ++this.connectionEpoch; - this.setStatus("connecting"); - this.resolveStartupNodeHostnames().then((nodes) => { - if (this.connectionEpoch !== epoch) { - debug("discard connecting after resolving startup nodes because epoch not match: %d != %d", epoch, this.connectionEpoch); - reject(new redis_errors_1.RedisError("Connection is discarded because a new connection is made")); - return; - } - if (this.status !== "connecting") { - debug("discard connecting after resolving startup nodes because the status changed to %s", this.status); - reject(new redis_errors_1.RedisError("Connection is aborted")); - return; - } - this.connectionPool.reset(nodes); - const readyHandler = () => { - this.setStatus("ready"); - this.retryAttempts = 0; - this.executeOfflineCommands(); - this.resetNodesRefreshInterval(); - resolve2(); - }; - let closeListener = void 0; - const refreshListener = () => { - this.invokeReadyDelayedCallbacks(void 0); - this.removeListener("close", closeListener); - this.manuallyClosing = false; - this.setStatus("connect"); - if (this.options.enableReadyCheck) { - this.readyCheck((err, fail) => { - if (err || fail) { - debug("Ready check failed (%s). Reconnecting...", err || fail); - if (this.status === "connect") { - this.disconnect(true); - } - } else { - readyHandler(); - } - }); - } else { - readyHandler(); - } - }; - closeListener = () => { - const error = new Error("None of startup nodes is available"); - this.removeListener("refresh", refreshListener); - this.invokeReadyDelayedCallbacks(error); - reject(error); - }; - this.once("refresh", refreshListener); - this.once("close", closeListener); - this.once("close", this.handleCloseEvent.bind(this)); - this.refreshSlotsCache((err) => { - if (err && err.message === ClusterAllFailedError_1.default.defaultMessage) { - Redis_1.default.prototype.silentEmit.call(this, "error", err); - this.connectionPool.reset([]); - } - }); - this.subscriber.start(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.start(); - } - }).catch((err) => { - this.setStatus("close"); - this.handleCloseEvent(err); - this.invokeReadyDelayedCallbacks(err); - reject(err); - }); - }); - } - /** - * Disconnect from every node in the cluster. - */ - disconnect(reconnect = false) { - const status = this.status; - this.setStatus("disconnecting"); - if (!reconnect) { - this.manuallyClosing = true; - } - if (this.reconnectTimeout && !reconnect) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - debug("Canceled reconnecting attempts"); - } - this.clearNodesRefreshInterval(); - this.subscriber.stop(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.stop(); - } - if (status === "wait") { - this.setStatus("close"); - this.handleCloseEvent(); - } else { - this.connectionPool.reset([]); - } - } - /** - * Quit the cluster gracefully. - */ - quit(callback) { - const status = this.status; - this.setStatus("disconnecting"); - this.manuallyClosing = true; - if (this.reconnectTimeout) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - } - this.clearNodesRefreshInterval(); - this.subscriber.stop(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.stop(); - } - if (status === "wait") { - const ret = (0, standard_as_callback_1.default)(Promise.resolve("OK"), callback); - setImmediate(function() { - this.setStatus("close"); - this.handleCloseEvent(); - }.bind(this)); - return ret; - } - return (0, standard_as_callback_1.default)(Promise.all(this.nodes().map((node) => node.quit().catch((err) => { - if (err.message === utils_1.CONNECTION_CLOSED_ERROR_MSG) { - return "OK"; - } - throw err; - }))).then(() => "OK"), callback); - } - /** - * Create a new instance with the same startup nodes and options as the current one. - * - * @example - * ```js - * var cluster = new Redis.Cluster([{ host: "127.0.0.1", port: "30001" }]); - * var anotherCluster = cluster.duplicate(); - * ``` - */ - duplicate(overrideStartupNodes = [], overrideOptions = {}) { - const startupNodes = overrideStartupNodes.length > 0 ? overrideStartupNodes : this.startupNodes.slice(0); - const options = Object.assign({}, this.options, overrideOptions); - return new _Cluster(startupNodes, options); - } - /** - * Get nodes with the specified role - */ - nodes(role = "all") { - if (role !== "all" && role !== "master" && role !== "slave") { - throw new Error('Invalid role "' + role + '". Expected "all", "master" or "slave"'); - } - return this.connectionPool.getNodes(role); - } - /** - * This is needed in order not to install a listener for each auto pipeline - * - * @ignore - */ - delayUntilReady(callback) { - this._readyDelayedCallbacks.push(callback); - } - /** - * Get the number of commands queued in automatic pipelines. - * - * This is not available (and returns 0) until the cluster is connected and slots information have been received. - */ - get autoPipelineQueueSize() { - let queued = 0; - for (const pipeline of this._autoPipelines.values()) { - queued += pipeline.length; - } - return queued; - } - /** - * Refresh the slot cache - * - * @ignore - */ - refreshSlotsCache(callback) { - if (callback) { - this._refreshSlotsCacheCallbacks.push(callback); - } - if (this.isRefreshing) { - return; - } - this.isRefreshing = true; - const _this = this; - const wrapper = (error) => { - this.isRefreshing = false; - for (const callback2 of this._refreshSlotsCacheCallbacks) { - callback2(error); - } - this._refreshSlotsCacheCallbacks = []; - }; - const nodes = (0, utils_1.shuffle)(this.connectionPool.getNodes()); - let lastNodeError = null; - function tryNode(index) { - if (index === nodes.length) { - const error = new ClusterAllFailedError_1.default(ClusterAllFailedError_1.default.defaultMessage, lastNodeError); - return wrapper(error); - } - const node = nodes[index]; - const key = `${node.options.host}:${node.options.port}`; - debug("getting slot cache from %s", key); - _this.getInfoFromNode(node, function(err) { - switch (_this.status) { - case "close": - case "end": - return wrapper(new Error("Cluster is disconnected.")); - case "disconnecting": - return wrapper(new Error("Cluster is disconnecting.")); - } - if (err) { - _this.emit("node error", err, key); - lastNodeError = err; - tryNode(index + 1); - } else { - _this.emit("refresh"); - wrapper(); - } - }); - } - tryNode(0); - } - /** - * @ignore - */ - sendCommand(command, stream, node) { - if (this.status === "wait") { - this.connect().catch(utils_1.noop); - } - if (this.status === "end") { - command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return command.promise; - } - let to = this.options.scaleReads; - if (to !== "master") { - const isCommandReadOnly = command.isReadOnly || (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); - if (!isCommandReadOnly) { - to = "master"; - } - } - let targetSlot = node ? node.slot : command.getSlot(); - const ttl = {}; - const _this = this; - if (!node && !REJECT_OVERWRITTEN_COMMANDS.has(command)) { - REJECT_OVERWRITTEN_COMMANDS.add(command); - const reject = command.reject; - command.reject = function(err) { - const partialTry = tryConnection.bind(null, true); - _this.handleError(err, ttl, { - moved: function(slot, key) { - debug("command %s is moved to %s", command.name, key); - targetSlot = Number(slot); - if (_this.slots[slot]) { - _this.slots[slot][0] = key; - } else { - _this.slots[slot] = [key]; - } - _this._groupsBySlot[slot] = _this._groupsIds[_this.slots[slot].join(";")]; - _this.connectionPool.findOrCreate(_this.natMapper(key)); - tryConnection(); - debug("refreshing slot caches... (triggered by MOVED error)"); - _this.refreshSlotsCache(); - }, - ask: function(slot, key) { - debug("command %s is required to ask %s:%s", command.name, key); - const mapped = _this.natMapper(key); - _this.connectionPool.findOrCreate(mapped); - tryConnection(false, `${mapped.host}:${mapped.port}`); - }, - tryagain: partialTry, - clusterDown: partialTry, - connectionClosed: partialTry, - maxRedirections: function(redirectionError) { - reject.call(command, redirectionError); - }, - defaults: function() { - reject.call(command, err); - } - }); - }; - } - tryConnection(); - function tryConnection(random, asking) { - if (_this.status === "end") { - command.reject(new redis_errors_1.AbortError("Cluster is ended.")); - return; - } - let redis; - if (_this.status === "ready" || command.name === "cluster") { - if (node && node.redis) { - redis = node.redis; - } else if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", command.name) || Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", command.name)) { - if (_this.options.shardedSubscribers == true && (command.name == "ssubscribe" || command.name == "sunsubscribe")) { - const sub = _this.shardedSubscribers.getResponsibleSubscriber(targetSlot); - let status = -1; - if (command.name == "ssubscribe") - status = _this.shardedSubscribers.addChannels(command.getKeys()); - if (command.name == "sunsubscribe") - status = _this.shardedSubscribers.removeChannels(command.getKeys()); - if (status !== -1) { - redis = sub.getInstance(); - } else { - command.reject(new redis_errors_1.AbortError("Can't add or remove the given channels. Are they in the same slot?")); - } - } else { - redis = _this.subscriber.getInstance(); - } - if (!redis) { - command.reject(new redis_errors_1.AbortError("No subscriber for the cluster")); - return; - } - } else { - if (!random) { - if (typeof targetSlot === "number" && _this.slots[targetSlot]) { - const nodeKeys = _this.slots[targetSlot]; - if (typeof to === "function") { - const nodes = nodeKeys.map(function(key) { - return _this.connectionPool.getInstanceByKey(key); - }); - redis = to(nodes, command); - if (Array.isArray(redis)) { - redis = (0, utils_1.sample)(redis); - } - if (!redis) { - redis = nodes[0]; - } - } else { - let key; - if (to === "all") { - key = (0, utils_1.sample)(nodeKeys); - } else if (to === "slave" && nodeKeys.length > 1) { - key = (0, utils_1.sample)(nodeKeys, 1); - } else { - key = nodeKeys[0]; - } - redis = _this.connectionPool.getInstanceByKey(key); - } - } - if (asking) { - redis = _this.connectionPool.getInstanceByKey(asking); - redis.asking(); - } - } - if (!redis) { - redis = (typeof to === "function" ? null : _this.connectionPool.getSampleInstance(to)) || _this.connectionPool.getSampleInstance("all"); - } - } - if (node && !node.redis) { - node.redis = redis; - } - } - if (redis) { - redis.sendCommand(command, stream); - } else if (_this.options.enableOfflineQueue) { - _this.offlineQueue.push({ - command, - stream, - node - }); - } else { - command.reject(new Error("Cluster isn't ready and enableOfflineQueue options is false")); - } - } - return command.promise; - } - sscanStream(key, options) { - return this.createScanStream("sscan", { key, options }); - } - sscanBufferStream(key, options) { - return this.createScanStream("sscanBuffer", { key, options }); - } - hscanStream(key, options) { - return this.createScanStream("hscan", { key, options }); - } - hscanBufferStream(key, options) { - return this.createScanStream("hscanBuffer", { key, options }); - } - zscanStream(key, options) { - return this.createScanStream("zscan", { key, options }); - } - zscanBufferStream(key, options) { - return this.createScanStream("zscanBuffer", { key, options }); - } - /** - * @ignore - */ - handleError(error, ttl, handlers) { - if (typeof ttl.value === "undefined") { - ttl.value = this.options.maxRedirections; - } else { - ttl.value -= 1; - } - if (ttl.value <= 0) { - handlers.maxRedirections(new Error("Too many Cluster redirections. Last error: " + error)); - return; - } - const errv = error.message.split(" "); - if (errv[0] === "MOVED") { - const timeout = this.options.retryDelayOnMoved; - if (timeout && typeof timeout === "number") { - this.delayQueue.push("moved", handlers.moved.bind(null, errv[1], errv[2]), { timeout }); - } else { - handlers.moved(errv[1], errv[2]); - } - } else if (errv[0] === "ASK") { - handlers.ask(errv[1], errv[2]); - } else if (errv[0] === "TRYAGAIN") { - this.delayQueue.push("tryagain", handlers.tryagain, { - timeout: this.options.retryDelayOnTryAgain - }); - } else if (errv[0] === "CLUSTERDOWN" && this.options.retryDelayOnClusterDown > 0) { - this.delayQueue.push("clusterdown", handlers.connectionClosed, { - timeout: this.options.retryDelayOnClusterDown, - callback: this.refreshSlotsCache.bind(this) - }); - } else if (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG && this.options.retryDelayOnFailover > 0 && this.status === "ready") { - this.delayQueue.push("failover", handlers.connectionClosed, { - timeout: this.options.retryDelayOnFailover, - callback: this.refreshSlotsCache.bind(this) - }); - } else { - handlers.defaults(); - } - } - resetOfflineQueue() { - this.offlineQueue = new Deque(); - } - clearNodesRefreshInterval() { - if (this.slotsTimer) { - clearTimeout(this.slotsTimer); - this.slotsTimer = null; - } - } - resetNodesRefreshInterval() { - if (this.slotsTimer || !this.options.slotsRefreshInterval) { - return; - } - const nextRound = () => { - this.slotsTimer = setTimeout(() => { - debug('refreshing slot caches... (triggered by "slotsRefreshInterval" option)'); - this.refreshSlotsCache(() => { - nextRound(); - }); - }, this.options.slotsRefreshInterval); - }; - nextRound(); - } - /** - * Change cluster instance's status - */ - setStatus(status) { - debug("status: %s -> %s", this.status || "[empty]", status); - this.status = status; - process.nextTick(() => { - this.emit(status); - }); - } - /** - * Called when closed to check whether a reconnection should be made - */ - handleCloseEvent(reason) { - if (reason) { - debug("closed because %s", reason); - } - let retryDelay; - if (!this.manuallyClosing && typeof this.options.clusterRetryStrategy === "function") { - retryDelay = this.options.clusterRetryStrategy.call(this, ++this.retryAttempts, reason); - } - if (typeof retryDelay === "number") { - this.setStatus("reconnecting"); - this.reconnectTimeout = setTimeout(() => { - this.reconnectTimeout = null; - debug("Cluster is disconnected. Retrying after %dms", retryDelay); - this.connect().catch(function(err) { - debug("Got error %s when reconnecting. Ignoring...", err); - }); - }, retryDelay); - } else { - this.setStatus("end"); - this.flushQueue(new Error("None of startup nodes is available")); - } - } - /** - * Flush offline queue with error. - */ - flushQueue(error) { - let item; - while (item = this.offlineQueue.shift()) { - item.command.reject(error); - } - } - executeOfflineCommands() { - if (this.offlineQueue.length) { - debug("send %d commands in offline queue", this.offlineQueue.length); - const offlineQueue = this.offlineQueue; - this.resetOfflineQueue(); - let item; - while (item = offlineQueue.shift()) { - this.sendCommand(item.command, item.stream, item.node); - } - } - } - natMapper(nodeKey) { - const key = typeof nodeKey === "string" ? nodeKey : `${nodeKey.host}:${nodeKey.port}`; - let mapped = null; - if (this.options.natMap && typeof this.options.natMap === "function") { - mapped = this.options.natMap(key); - } else if (this.options.natMap && typeof this.options.natMap === "object") { - mapped = this.options.natMap[key]; - } - if (mapped) { - debug("NAT mapping %s -> %O", key, mapped); - return Object.assign({}, mapped); - } - return typeof nodeKey === "string" ? (0, util_1.nodeKeyToRedisOptions)(nodeKey) : nodeKey; - } - getInfoFromNode(redis, callback) { - if (!redis) { - return callback(new Error("Node is disconnected")); - } - const duplicatedConnection = redis.duplicate({ - enableOfflineQueue: true, - enableReadyCheck: false, - retryStrategy: null, - connectionName: (0, util_1.getConnectionName)("refresher", this.options.redisOptions && this.options.redisOptions.connectionName) - }); - duplicatedConnection.on("error", utils_1.noop); - duplicatedConnection.cluster("SLOTS", (0, utils_1.timeout)((err, result) => { - duplicatedConnection.disconnect(); - if (err) { - debug("error encountered running CLUSTER.SLOTS: %s", err); - return callback(err); - } - if (this.status === "disconnecting" || this.status === "close" || this.status === "end") { - debug("ignore CLUSTER.SLOTS results (count: %d) since cluster status is %s", result.length, this.status); - callback(); - return; - } - const nodes = []; - debug("cluster slots result count: %d", result.length); - for (let i = 0; i < result.length; ++i) { - const items = result[i]; - const slotRangeStart = items[0]; - const slotRangeEnd = items[1]; - const keys = []; - for (let j2 = 2; j2 < items.length; j2++) { - if (!items[j2][0]) { - continue; - } - const node = this.natMapper({ - host: items[j2][0], - port: items[j2][1] - }); - node.readOnly = j2 !== 2; - nodes.push(node); - keys.push(node.host + ":" + node.port); - } - debug("cluster slots result [%d]: slots %d~%d served by %s", i, slotRangeStart, slotRangeEnd, keys); - for (let slot = slotRangeStart; slot <= slotRangeEnd; slot++) { - this.slots[slot] = keys; - } - } - this._groupsIds = /* @__PURE__ */ Object.create(null); - let j = 0; - for (let i = 0; i < 16384; i++) { - const target = (this.slots[i] || []).join(";"); - if (!target.length) { - this._groupsBySlot[i] = void 0; - continue; - } - if (!this._groupsIds[target]) { - this._groupsIds[target] = ++j; - } - this._groupsBySlot[i] = this._groupsIds[target]; - } - this.connectionPool.reset(nodes); - callback(); - }, this.options.slotsRefreshTimeout)); - } - invokeReadyDelayedCallbacks(err) { - for (const c of this._readyDelayedCallbacks) { - process.nextTick(c, err); - } - this._readyDelayedCallbacks = []; - } - /** - * Check whether Cluster is able to process commands - */ - readyCheck(callback) { - this.cluster("INFO", (err, res) => { - if (err) { - return callback(err); - } - if (typeof res !== "string") { - return callback(); - } - let state; - const lines = res.split("\r\n"); - for (let i = 0; i < lines.length; ++i) { - const parts = lines[i].split(":"); - if (parts[0] === "cluster_state") { - state = parts[1]; - break; - } - } - if (state === "fail") { - debug("cluster state not ok (%s)", state); - callback(null, state); - } else { - callback(); - } - }); - } - resolveSrv(hostname) { - return new Promise((resolve2, reject) => { - this.options.resolveSrv(hostname, (err, records) => { - if (err) { - return reject(err); - } - const self2 = this, groupedRecords = (0, util_1.groupSrvRecords)(records), sortedKeys = Object.keys(groupedRecords).sort((a, b) => parseInt(a) - parseInt(b)); - function tryFirstOne(err2) { - if (!sortedKeys.length) { - return reject(err2); - } - const key = sortedKeys[0], group = groupedRecords[key], record = (0, util_1.weightSrvRecords)(group); - if (!group.records.length) { - sortedKeys.shift(); - } - self2.dnsLookup(record.name).then((host) => resolve2({ - host, - port: record.port - }), tryFirstOne); - } - tryFirstOne(); - }); - }); - } - dnsLookup(hostname) { - return new Promise((resolve2, reject) => { - this.options.dnsLookup(hostname, (err, address) => { - if (err) { - debug("failed to resolve hostname %s to IP: %s", hostname, err.message); - reject(err); - } else { - debug("resolved hostname %s to IP %s", hostname, address); - resolve2(address); - } - }); - }); - } - /** - * Normalize startup nodes, and resolving hostnames to IPs. - * - * This process happens every time when #connect() is called since - * #startupNodes and DNS records may chanage. - */ - async resolveStartupNodeHostnames() { - if (!Array.isArray(this.startupNodes) || this.startupNodes.length === 0) { - throw new Error("`startupNodes` should contain at least one node."); - } - const startupNodes = (0, util_1.normalizeNodeOptions)(this.startupNodes); - const hostnames = (0, util_1.getUniqueHostnamesFromOptions)(startupNodes); - if (hostnames.length === 0) { - return startupNodes; - } - const configs = await Promise.all(hostnames.map((this.options.useSRVRecords ? this.resolveSrv : this.dnsLookup).bind(this))); - const hostnameToConfig = (0, utils_1.zipMap)(hostnames, configs); - return startupNodes.map((node) => { - const config = hostnameToConfig.get(node.host); - if (!config) { - return node; - } - if (this.options.useSRVRecords) { - return Object.assign({}, node, config); - } - return Object.assign({}, node, { host: config }); - }); - } - createScanStream(command, { key, options = {} }) { - return new ScanStream_1.default({ - objectMode: true, - key, - redis: this, - command, - ...options - }); - } - }; - (0, applyMixin_1.default)(Cluster, events_1.EventEmitter); - (0, transaction_1.addTransactionSupport)(Cluster.prototype); - exports2.default = Cluster; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js -var require_AbstractConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var debug = (0, utils_1.Debug)("AbstractConnector"); - var AbstractConnector = class { - constructor(disconnectTimeout) { - this.connecting = false; - this.disconnectTimeout = disconnectTimeout; - } - check(info) { - return true; - } - disconnect() { - this.connecting = false; - if (this.stream) { - const stream = this.stream; - const timeout = setTimeout(() => { - debug("stream %s:%s still open, destroying it", stream.remoteAddress, stream.remotePort); - stream.destroy(); - }, this.disconnectTimeout); - stream.on("close", () => clearTimeout(timeout)); - stream.end(); - } - } - }; - exports2.default = AbstractConnector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js -var require_StandaloneConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var net_1 = require("net"); - var tls_1 = require("tls"); - var utils_1 = require_utils2(); - var AbstractConnector_1 = require_AbstractConnector(); - var StandaloneConnector = class extends AbstractConnector_1.default { - constructor(options) { - super(options.disconnectTimeout); - this.options = options; - } - connect(_) { - const { options } = this; - this.connecting = true; - let connectionOptions; - if ("path" in options && options.path) { - connectionOptions = { - path: options.path - }; - } else { - connectionOptions = {}; - if ("port" in options && options.port != null) { - connectionOptions.port = options.port; - } - if ("host" in options && options.host != null) { - connectionOptions.host = options.host; - } - if ("family" in options && options.family != null) { - connectionOptions.family = options.family; - } - } - if (options.tls) { - Object.assign(connectionOptions, options.tls); - } - return new Promise((resolve2, reject) => { - process.nextTick(() => { - if (!this.connecting) { - reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return; - } - try { - if (options.tls) { - this.stream = (0, tls_1.connect)(connectionOptions); - } else { - this.stream = (0, net_1.createConnection)(connectionOptions); - } - } catch (err) { - reject(err); - return; - } - this.stream.once("error", (err) => { - this.firstError = err; - }); - resolve2(this.stream); - }); - }); - } - }; - exports2.default = StandaloneConnector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js -var require_SentinelIterator = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function isSentinelEql(a, b) { - return (a.host || "127.0.0.1") === (b.host || "127.0.0.1") && (a.port || 26379) === (b.port || 26379); - } - var SentinelIterator = class { - constructor(sentinels) { - this.cursor = 0; - this.sentinels = sentinels.slice(0); - } - next() { - const done = this.cursor >= this.sentinels.length; - return { done, value: done ? void 0 : this.sentinels[this.cursor++] }; - } - reset(moveCurrentEndpointToFirst) { - if (moveCurrentEndpointToFirst && this.sentinels.length > 1 && this.cursor !== 1) { - this.sentinels.unshift(...this.sentinels.splice(this.cursor - 1)); - } - this.cursor = 0; - } - add(sentinel) { - for (let i = 0; i < this.sentinels.length; i++) { - if (isSentinelEql(sentinel, this.sentinels[i])) { - return false; - } - } - this.sentinels.push(sentinel); - return true; - } - toString() { - return `${JSON.stringify(this.sentinels)} @${this.cursor}`; - } - }; - exports2.default = SentinelIterator; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js -var require_FailoverDetector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FailoverDetector = void 0; - var utils_1 = require_utils2(); - var debug = (0, utils_1.Debug)("FailoverDetector"); - var CHANNEL_NAME = "+switch-master"; - var FailoverDetector = class { - // sentinels can't be used for regular commands after this - constructor(connector, sentinels) { - this.isDisconnected = false; - this.connector = connector; - this.sentinels = sentinels; - } - cleanup() { - this.isDisconnected = true; - for (const sentinel of this.sentinels) { - sentinel.client.disconnect(); - } - } - async subscribe() { - debug("Starting FailoverDetector"); - const promises2 = []; - for (const sentinel of this.sentinels) { - const promise = sentinel.client.subscribe(CHANNEL_NAME).catch((err) => { - debug("Failed to subscribe to failover messages on sentinel %s:%s (%s)", sentinel.address.host || "127.0.0.1", sentinel.address.port || 26739, err.message); - }); - promises2.push(promise); - sentinel.client.on("message", (channel) => { - if (!this.isDisconnected && channel === CHANNEL_NAME) { - this.disconnect(); - } - }); - } - await Promise.all(promises2); - } - disconnect() { - this.isDisconnected = true; - debug("Failover detected, disconnecting"); - this.connector.disconnect(); - } - }; - exports2.FailoverDetector = FailoverDetector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js -var require_SentinelConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SentinelIterator = void 0; - var net_1 = require("net"); - var utils_1 = require_utils2(); - var tls_1 = require("tls"); - var SentinelIterator_1 = require_SentinelIterator(); - exports2.SentinelIterator = SentinelIterator_1.default; - var AbstractConnector_1 = require_AbstractConnector(); - var Redis_1 = require_Redis(); - var FailoverDetector_1 = require_FailoverDetector(); - var debug = (0, utils_1.Debug)("SentinelConnector"); - var SentinelConnector = class extends AbstractConnector_1.default { - constructor(options) { - super(options.disconnectTimeout); - this.options = options; - this.emitter = null; - this.failoverDetector = null; - if (!this.options.sentinels.length) { - throw new Error("Requires at least one sentinel to connect to."); - } - if (!this.options.name) { - throw new Error("Requires the name of master."); - } - this.sentinelIterator = new SentinelIterator_1.default(this.options.sentinels); - } - check(info) { - const roleMatches = !info.role || this.options.role === info.role; - if (!roleMatches) { - debug("role invalid, expected %s, but got %s", this.options.role, info.role); - this.sentinelIterator.next(); - this.sentinelIterator.next(); - this.sentinelIterator.reset(true); - } - return roleMatches; - } - disconnect() { - super.disconnect(); - if (this.failoverDetector) { - this.failoverDetector.cleanup(); - } - } - connect(eventEmitter) { - this.connecting = true; - this.retryAttempts = 0; - let lastError; - const connectToNext = async () => { - const endpoint = this.sentinelIterator.next(); - if (endpoint.done) { - this.sentinelIterator.reset(false); - const retryDelay = typeof this.options.sentinelRetryStrategy === "function" ? this.options.sentinelRetryStrategy(++this.retryAttempts) : null; - let errorMsg = typeof retryDelay !== "number" ? "All sentinels are unreachable and retry is disabled." : `All sentinels are unreachable. Retrying from scratch after ${retryDelay}ms.`; - if (lastError) { - errorMsg += ` Last error: ${lastError.message}`; - } - debug(errorMsg); - const error = new Error(errorMsg); - if (typeof retryDelay === "number") { - eventEmitter("error", error); - await new Promise((resolve2) => setTimeout(resolve2, retryDelay)); - return connectToNext(); - } else { - throw error; - } - } - let resolved = null; - let err = null; - try { - resolved = await this.resolve(endpoint.value); - } catch (error) { - err = error; - } - if (!this.connecting) { - throw new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG); - } - const endpointAddress = endpoint.value.host + ":" + endpoint.value.port; - if (resolved) { - debug("resolved: %s:%s from sentinel %s", resolved.host, resolved.port, endpointAddress); - if (this.options.enableTLSForSentinelMode && this.options.tls) { - Object.assign(resolved, this.options.tls); - this.stream = (0, tls_1.connect)(resolved); - this.stream.once("secureConnect", this.initFailoverDetector.bind(this)); - } else { - this.stream = (0, net_1.createConnection)(resolved); - this.stream.once("connect", this.initFailoverDetector.bind(this)); - } - this.stream.once("error", (err2) => { - this.firstError = err2; - }); - return this.stream; - } else { - const errorMsg = err ? "failed to connect to sentinel " + endpointAddress + " because " + err.message : "connected to sentinel " + endpointAddress + " successfully, but got an invalid reply: " + resolved; - debug(errorMsg); - eventEmitter("sentinelError", new Error(errorMsg)); - if (err) { - lastError = err; - } - return connectToNext(); - } - }; - return connectToNext(); - } - async updateSentinels(client) { - if (!this.options.updateSentinels) { - return; - } - const result = await client.sentinel("sentinels", this.options.name); - if (!Array.isArray(result)) { - return; - } - result.map(utils_1.packObject).forEach((sentinel) => { - const flags = sentinel.flags ? sentinel.flags.split(",") : []; - if (flags.indexOf("disconnected") === -1 && sentinel.ip && sentinel.port) { - const endpoint = this.sentinelNatResolve(addressResponseToAddress(sentinel)); - if (this.sentinelIterator.add(endpoint)) { - debug("adding sentinel %s:%s", endpoint.host, endpoint.port); - } - } - }); - debug("Updated internal sentinels: %s", this.sentinelIterator); - } - async resolveMaster(client) { - const result = await client.sentinel("get-master-addr-by-name", this.options.name); - await this.updateSentinels(client); - return this.sentinelNatResolve(Array.isArray(result) ? { host: result[0], port: Number(result[1]) } : null); - } - async resolveSlave(client) { - const result = await client.sentinel("slaves", this.options.name); - if (!Array.isArray(result)) { - return null; - } - const availableSlaves = result.map(utils_1.packObject).filter((slave) => slave.flags && !slave.flags.match(/(disconnected|s_down|o_down)/)); - return this.sentinelNatResolve(selectPreferredSentinel(availableSlaves, this.options.preferredSlaves)); - } - sentinelNatResolve(item) { - if (!item || !this.options.natMap) - return item; - const key = `${item.host}:${item.port}`; - let result = item; - if (typeof this.options.natMap === "function") { - result = this.options.natMap(key) || item; - } else if (typeof this.options.natMap === "object") { - result = this.options.natMap[key] || item; - } - return result; - } - connectToSentinel(endpoint, options) { - const redis = new Redis_1.default({ - port: endpoint.port || 26379, - host: endpoint.host, - username: this.options.sentinelUsername || null, - password: this.options.sentinelPassword || null, - family: endpoint.family || // @ts-expect-error - ("path" in this.options && this.options.path ? void 0 : ( - // @ts-expect-error - this.options.family - )), - tls: this.options.sentinelTLS, - retryStrategy: null, - enableReadyCheck: false, - connectTimeout: this.options.connectTimeout, - commandTimeout: this.options.sentinelCommandTimeout, - ...options - }); - return redis; - } - async resolve(endpoint) { - const client = this.connectToSentinel(endpoint); - client.on("error", noop); - try { - if (this.options.role === "slave") { - return await this.resolveSlave(client); - } else { - return await this.resolveMaster(client); - } - } finally { - client.disconnect(); - } - } - async initFailoverDetector() { - var _a; - if (!this.options.failoverDetector) { - return; - } - this.sentinelIterator.reset(true); - const sentinels = []; - while (sentinels.length < this.options.sentinelMaxConnections) { - const { done, value } = this.sentinelIterator.next(); - if (done) { - break; - } - const client = this.connectToSentinel(value, { - lazyConnect: true, - retryStrategy: this.options.sentinelReconnectStrategy - }); - client.on("reconnecting", () => { - var _a2; - (_a2 = this.emitter) === null || _a2 === void 0 ? void 0 : _a2.emit("sentinelReconnecting"); - }); - sentinels.push({ address: value, client }); - } - this.sentinelIterator.reset(false); - if (this.failoverDetector) { - this.failoverDetector.cleanup(); - } - this.failoverDetector = new FailoverDetector_1.FailoverDetector(this, sentinels); - await this.failoverDetector.subscribe(); - (_a = this.emitter) === null || _a === void 0 ? void 0 : _a.emit("failoverSubscribed"); - } - }; - exports2.default = SentinelConnector; - function selectPreferredSentinel(availableSlaves, preferredSlaves) { - if (availableSlaves.length === 0) { - return null; - } - let selectedSlave; - if (typeof preferredSlaves === "function") { - selectedSlave = preferredSlaves(availableSlaves); - } else if (preferredSlaves !== null && typeof preferredSlaves === "object") { - const preferredSlavesArray = Array.isArray(preferredSlaves) ? preferredSlaves : [preferredSlaves]; - preferredSlavesArray.sort((a, b) => { - if (!a.prio) { - a.prio = 1; - } - if (!b.prio) { - b.prio = 1; - } - if (a.prio < b.prio) { - return -1; - } - if (a.prio > b.prio) { - return 1; - } - return 0; - }); - for (let p = 0; p < preferredSlavesArray.length; p++) { - for (let a = 0; a < availableSlaves.length; a++) { - const slave = availableSlaves[a]; - if (slave.ip === preferredSlavesArray[p].ip) { - if (slave.port === preferredSlavesArray[p].port) { - selectedSlave = slave; - break; - } - } - } - if (selectedSlave) { - break; - } - } - } - if (!selectedSlave) { - selectedSlave = (0, utils_1.sample)(availableSlaves); - } - return addressResponseToAddress(selectedSlave); - } - function addressResponseToAddress(input) { - return { host: input.ip, port: Number(input.port) }; - } - function noop() { - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js -var require_connectors = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SentinelConnector = exports2.StandaloneConnector = void 0; - var StandaloneConnector_1 = require_StandaloneConnector(); - exports2.StandaloneConnector = StandaloneConnector_1.default; - var SentinelConnector_1 = require_SentinelConnector(); - exports2.SentinelConnector = SentinelConnector_1.default; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js -var require_MaxRetriesPerRequestError = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var redis_errors_1 = require_redis_errors(); - var MaxRetriesPerRequestError = class extends redis_errors_1.AbortError { - constructor(maxRetriesPerRequest) { - const message = `Reached the max retries per request limit (which is ${maxRetriesPerRequest}). Refer to "maxRetriesPerRequest" option for details.`; - super(message); - Error.captureStackTrace(this, this.constructor); - } - get name() { - return this.constructor.name; - } - }; - exports2.default = MaxRetriesPerRequestError; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js -var require_errors = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MaxRetriesPerRequestError = void 0; - var MaxRetriesPerRequestError_1 = require_MaxRetriesPerRequestError(); - exports2.MaxRetriesPerRequestError = MaxRetriesPerRequestError_1.default; - } -}); - -// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js -var require_parser = __commonJS({ - "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js"(exports2, module2) { - "use strict"; - var Buffer2 = require("buffer").Buffer; - var StringDecoder = require("string_decoder").StringDecoder; - var decoder = new StringDecoder(); - var errors = require_redis_errors(); - var ReplyError = errors.ReplyError; - var ParserError = errors.ParserError; - var bufferPool = Buffer2.allocUnsafe(32 * 1024); - var bufferOffset = 0; - var interval = null; - var counter = 0; - var notDecreased = 0; - function parseSimpleNumbers(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - var sign = 1; - if (parser.buffer[offset] === 45) { - sign = -1; - offset++; - } - while (offset < length) { - const c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - return sign * number; - } - number = number * 10 + (c1 - 48); - } - } - function parseStringNumbers(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - var res = ""; - if (parser.buffer[offset] === 45) { - res += "-"; - offset++; - } - while (offset < length) { - var c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - if (number !== 0) { - res += number; - } - return res; - } else if (number > 429496728) { - res += number * 10 + (c1 - 48); - number = 0; - } else if (c1 === 48 && number === 0) { - res += 0; - } else { - number = number * 10 + (c1 - 48); - } - } - } - function parseSimpleString(parser) { - const start = parser.offset; - const buffer = parser.buffer; - const length = buffer.length - 1; - var offset = start; - while (offset < length) { - if (buffer[offset++] === 13) { - parser.offset = offset + 1; - if (parser.optionReturnBuffers === true) { - return parser.buffer.slice(start, offset - 1); - } - return parser.buffer.toString("utf8", start, offset - 1); - } - } - } - function parseLength(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - while (offset < length) { - const c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - return number; - } - number = number * 10 + (c1 - 48); - } - } - function parseInteger(parser) { - if (parser.optionStringNumbers === true) { - return parseStringNumbers(parser); - } - return parseSimpleNumbers(parser); - } - function parseBulkString(parser) { - const length = parseLength(parser); - if (length === void 0) { - return; - } - if (length < 0) { - return null; - } - const offset = parser.offset + length; - if (offset + 2 > parser.buffer.length) { - parser.bigStrSize = offset + 2; - parser.totalChunkSize = parser.buffer.length; - parser.bufferCache.push(parser.buffer); - return; - } - const start = parser.offset; - parser.offset = offset + 2; - if (parser.optionReturnBuffers === true) { - return parser.buffer.slice(start, offset); - } - return parser.buffer.toString("utf8", start, offset); - } - function parseError(parser) { - var string = parseSimpleString(parser); - if (string !== void 0) { - if (parser.optionReturnBuffers === true) { - string = string.toString(); - } - return new ReplyError(string); - } - } - function handleError(parser, type) { - const err = new ParserError( - "Protocol error, got " + JSON.stringify(String.fromCharCode(type)) + " as reply type byte", - JSON.stringify(parser.buffer), - parser.offset - ); - parser.buffer = null; - parser.returnFatalError(err); - } - function parseArray(parser) { - const length = parseLength(parser); - if (length === void 0) { - return; - } - if (length < 0) { - return null; - } - const responses = new Array(length); - return parseArrayElements(parser, responses, 0); - } - function pushArrayCache(parser, array, pos) { - parser.arrayCache.push(array); - parser.arrayPos.push(pos); - } - function parseArrayChunks(parser) { - const tmp = parser.arrayCache.pop(); - var pos = parser.arrayPos.pop(); - if (parser.arrayCache.length) { - const res = parseArrayChunks(parser); - if (res === void 0) { - pushArrayCache(parser, tmp, pos); - return; - } - tmp[pos++] = res; - } - return parseArrayElements(parser, tmp, pos); - } - function parseArrayElements(parser, responses, i) { - const bufferLength = parser.buffer.length; - while (i < responses.length) { - const offset = parser.offset; - if (parser.offset >= bufferLength) { - pushArrayCache(parser, responses, i); - return; - } - const response = parseType(parser, parser.buffer[parser.offset++]); - if (response === void 0) { - if (!(parser.arrayCache.length || parser.bufferCache.length)) { - parser.offset = offset; - } - pushArrayCache(parser, responses, i); - return; - } - responses[i] = response; - i++; - } - return responses; - } - function parseType(parser, type) { - switch (type) { - case 36: - return parseBulkString(parser); - case 43: - return parseSimpleString(parser); - case 42: - return parseArray(parser); - case 58: - return parseInteger(parser); - case 45: - return parseError(parser); - default: - return handleError(parser, type); - } - } - function decreaseBufferPool() { - if (bufferPool.length > 50 * 1024) { - if (counter === 1 || notDecreased > counter * 2) { - const minSliceLen = Math.floor(bufferPool.length / 10); - const sliceLength = minSliceLen < bufferOffset ? bufferOffset : minSliceLen; - bufferOffset = 0; - bufferPool = bufferPool.slice(sliceLength, bufferPool.length); - } else { - notDecreased++; - counter--; - } - } else { - clearInterval(interval); - counter = 0; - notDecreased = 0; - interval = null; - } - } - function resizeBuffer(length) { - if (bufferPool.length < length + bufferOffset) { - const multiplier = length > 1024 * 1024 * 75 ? 2 : 3; - if (bufferOffset > 1024 * 1024 * 111) { - bufferOffset = 1024 * 1024 * 50; - } - bufferPool = Buffer2.allocUnsafe(length * multiplier + bufferOffset); - bufferOffset = 0; - counter++; - if (interval === null) { - interval = setInterval(decreaseBufferPool, 50); - } - } - } - function concatBulkString(parser) { - const list = parser.bufferCache; - const oldOffset = parser.offset; - var chunks = list.length; - var offset = parser.bigStrSize - parser.totalChunkSize; - parser.offset = offset; - if (offset <= 2) { - if (chunks === 2) { - return list[0].toString("utf8", oldOffset, list[0].length + offset - 2); - } - chunks--; - offset = list[list.length - 2].length + offset; - } - var res = decoder.write(list[0].slice(oldOffset)); - for (var i = 1; i < chunks - 1; i++) { - res += decoder.write(list[i]); - } - res += decoder.end(list[i].slice(0, offset - 2)); - return res; - } - function concatBulkBuffer(parser) { - const list = parser.bufferCache; - const oldOffset = parser.offset; - const length = parser.bigStrSize - oldOffset - 2; - var chunks = list.length; - var offset = parser.bigStrSize - parser.totalChunkSize; - parser.offset = offset; - if (offset <= 2) { - if (chunks === 2) { - return list[0].slice(oldOffset, list[0].length + offset - 2); - } - chunks--; - offset = list[list.length - 2].length + offset; - } - resizeBuffer(length); - const start = bufferOffset; - list[0].copy(bufferPool, start, oldOffset, list[0].length); - bufferOffset += list[0].length - oldOffset; - for (var i = 1; i < chunks - 1; i++) { - list[i].copy(bufferPool, bufferOffset); - bufferOffset += list[i].length; - } - list[i].copy(bufferPool, bufferOffset, 0, offset - 2); - bufferOffset += offset - 2; - return bufferPool.slice(start, bufferOffset); - } - var JavascriptRedisParser = class { - /** - * Javascript Redis Parser constructor - * @param {{returnError: Function, returnReply: Function, returnFatalError?: Function, returnBuffers: boolean, stringNumbers: boolean }} options - * @constructor - */ - constructor(options) { - if (!options) { - throw new TypeError("Options are mandatory."); - } - if (typeof options.returnError !== "function" || typeof options.returnReply !== "function") { - throw new TypeError("The returnReply and returnError options have to be functions."); - } - this.setReturnBuffers(!!options.returnBuffers); - this.setStringNumbers(!!options.stringNumbers); - this.returnError = options.returnError; - this.returnFatalError = options.returnFatalError || options.returnError; - this.returnReply = options.returnReply; - this.reset(); - } - /** - * Reset the parser values to the initial state - * - * @returns {undefined} - */ - reset() { - this.offset = 0; - this.buffer = null; - this.bigStrSize = 0; - this.totalChunkSize = 0; - this.bufferCache = []; - this.arrayCache = []; - this.arrayPos = []; - } - /** - * Set the returnBuffers option - * - * @param {boolean} returnBuffers - * @returns {undefined} - */ - setReturnBuffers(returnBuffers) { - if (typeof returnBuffers !== "boolean") { - throw new TypeError("The returnBuffers argument has to be a boolean"); - } - this.optionReturnBuffers = returnBuffers; - } - /** - * Set the stringNumbers option - * - * @param {boolean} stringNumbers - * @returns {undefined} - */ - setStringNumbers(stringNumbers) { - if (typeof stringNumbers !== "boolean") { - throw new TypeError("The stringNumbers argument has to be a boolean"); - } - this.optionStringNumbers = stringNumbers; - } - /** - * Parse the redis buffer - * @param {Buffer} buffer - * @returns {undefined} - */ - execute(buffer) { - if (this.buffer === null) { - this.buffer = buffer; - this.offset = 0; - } else if (this.bigStrSize === 0) { - const oldLength = this.buffer.length; - const remainingLength = oldLength - this.offset; - const newBuffer = Buffer2.allocUnsafe(remainingLength + buffer.length); - this.buffer.copy(newBuffer, 0, this.offset, oldLength); - buffer.copy(newBuffer, remainingLength, 0, buffer.length); - this.buffer = newBuffer; - this.offset = 0; - if (this.arrayCache.length) { - const arr = parseArrayChunks(this); - if (arr === void 0) { - return; - } - this.returnReply(arr); - } - } else if (this.totalChunkSize + buffer.length >= this.bigStrSize) { - this.bufferCache.push(buffer); - var tmp = this.optionReturnBuffers ? concatBulkBuffer(this) : concatBulkString(this); - this.bigStrSize = 0; - this.bufferCache = []; - this.buffer = buffer; - if (this.arrayCache.length) { - this.arrayCache[0][this.arrayPos[0]++] = tmp; - tmp = parseArrayChunks(this); - if (tmp === void 0) { - return; - } - } - this.returnReply(tmp); - } else { - this.bufferCache.push(buffer); - this.totalChunkSize += buffer.length; - return; - } - while (this.offset < this.buffer.length) { - const offset = this.offset; - const type = this.buffer[this.offset++]; - const response = parseType(this, type); - if (response === void 0) { - if (!(this.arrayCache.length || this.bufferCache.length)) { - this.offset = offset; - } - return; - } - if (type === 45) { - this.returnError(response); - } else { - this.returnReply(response); - } - } - this.buffer = null; - } - }; - module2.exports = JavascriptRedisParser; - } -}); - -// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js -var require_redis_parser = __commonJS({ - "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js"(exports2, module2) { - "use strict"; - module2.exports = require_parser(); - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js -var require_SubscriptionSet = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var SubscriptionSet = class { - constructor() { - this.set = { - subscribe: {}, - psubscribe: {}, - ssubscribe: {} - }; - } - add(set, channel) { - this.set[mapSet(set)][channel] = true; - } - del(set, channel) { - delete this.set[mapSet(set)][channel]; - } - channels(set) { - return Object.keys(this.set[mapSet(set)]); - } - isEmpty() { - return this.channels("subscribe").length === 0 && this.channels("psubscribe").length === 0 && this.channels("ssubscribe").length === 0; - } - }; - exports2.default = SubscriptionSet; - function mapSet(set) { - if (set === "unsubscribe") { - return "subscribe"; - } - if (set === "punsubscribe") { - return "psubscribe"; - } - if (set === "sunsubscribe") { - return "ssubscribe"; - } - return set; - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js -var require_DataHandler = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var Command_1 = require_Command(); - var utils_1 = require_utils2(); - var RedisParser = require_redis_parser(); - var SubscriptionSet_1 = require_SubscriptionSet(); - var debug = (0, utils_1.Debug)("dataHandler"); - var DataHandler = class { - constructor(redis, parserOptions) { - this.redis = redis; - const parser = new RedisParser({ - stringNumbers: parserOptions.stringNumbers, - returnBuffers: true, - returnError: (err) => { - this.returnError(err); - }, - returnFatalError: (err) => { - this.returnFatalError(err); - }, - returnReply: (reply) => { - this.returnReply(reply); - } - }); - redis.stream.prependListener("data", (data) => { - parser.execute(data); - }); - redis.stream.resume(); - } - returnFatalError(err) { - err.message += ". Please report this."; - this.redis.recoverFromFatalError(err, err, { offlineQueue: false }); - } - returnError(err) { - const item = this.shiftCommand(err); - if (!item) { - return; - } - err.command = { - name: item.command.name, - args: item.command.args - }; - if (item.command.name == "ssubscribe" && err.message.includes("MOVED")) { - this.redis.emit("moved"); - return; - } - this.redis.handleReconnection(err, item); - } - returnReply(reply) { - if (this.handleMonitorReply(reply)) { - return; - } - if (this.handleSubscriberReply(reply)) { - return; - } - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", item.command.name)) { - this.redis.condition.subscriber = new SubscriptionSet_1.default(); - this.redis.condition.subscriber.add(item.command.name, reply[1].toString()); - if (!fillSubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - } else if (Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", item.command.name)) { - if (!fillUnsubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - } else { - item.command.resolve(reply); - } - } - handleSubscriberReply(reply) { - if (!this.redis.condition.subscriber) { - return false; - } - const replyType = Array.isArray(reply) ? reply[0].toString() : null; - debug('receive reply "%s" in subscriber mode', replyType); - switch (replyType) { - case "message": - if (this.redis.listeners("message").length > 0) { - this.redis.emit("message", reply[1].toString(), reply[2] ? reply[2].toString() : ""); - } - this.redis.emit("messageBuffer", reply[1], reply[2]); - break; - case "pmessage": { - const pattern = reply[1].toString(); - if (this.redis.listeners("pmessage").length > 0) { - this.redis.emit("pmessage", pattern, reply[2].toString(), reply[3].toString()); - } - this.redis.emit("pmessageBuffer", pattern, reply[2], reply[3]); - break; - } - case "smessage": { - if (this.redis.listeners("smessage").length > 0) { - this.redis.emit("smessage", reply[1].toString(), reply[2] ? reply[2].toString() : ""); - } - this.redis.emit("smessageBuffer", reply[1], reply[2]); - break; - } - case "ssubscribe": - case "subscribe": - case "psubscribe": { - const channel = reply[1].toString(); - this.redis.condition.subscriber.add(replyType, channel); - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (!fillSubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - break; - } - case "sunsubscribe": - case "unsubscribe": - case "punsubscribe": { - const channel = reply[1] ? reply[1].toString() : null; - if (channel) { - this.redis.condition.subscriber.del(replyType, channel); - } - const count = reply[2]; - if (Number(count) === 0) { - this.redis.condition.subscriber = false; - } - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (!fillUnsubCommand(item.command, count)) { - this.redis.commandQueue.unshift(item); - } - break; - } - default: { - const item = this.shiftCommand(reply); - if (!item) { - return; - } - item.command.resolve(reply); - } - } - return true; - } - handleMonitorReply(reply) { - if (this.redis.status !== "monitoring") { - return false; - } - const replyStr = reply.toString(); - if (replyStr === "OK") { - return false; - } - const len = replyStr.indexOf(" "); - const timestamp = replyStr.slice(0, len); - const argIndex = replyStr.indexOf('"'); - const args = replyStr.slice(argIndex + 1, -1).split('" "').map((elem) => elem.replace(/\\"/g, '"')); - const dbAndSource = replyStr.slice(len + 2, argIndex - 2).split(" "); - this.redis.emit("monitor", timestamp, args, dbAndSource[1], dbAndSource[0]); - return true; - } - shiftCommand(reply) { - const item = this.redis.commandQueue.shift(); - if (!item) { - const message = "Command queue state error. If you can reproduce this, please report it."; - const error = new Error(message + (reply instanceof Error ? ` Last error: ${reply.message}` : ` Last reply: ${reply.toString()}`)); - this.redis.emit("error", error); - return null; - } - return item; - } - }; - exports2.default = DataHandler; - var remainingRepliesMap = /* @__PURE__ */ new WeakMap(); - function fillSubCommand(command, count) { - let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; - remainingReplies -= 1; - if (remainingReplies <= 0) { - command.resolve(count); - remainingRepliesMap.delete(command); - return true; - } - remainingRepliesMap.set(command, remainingReplies); - return false; - } - function fillUnsubCommand(command, count) { - let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; - if (remainingReplies === 0) { - if (Number(count) === 0) { - remainingRepliesMap.delete(command); - command.resolve(count); - return true; - } - return false; - } - remainingReplies -= 1; - if (remainingReplies <= 0) { - command.resolve(count); - return true; - } - remainingRepliesMap.set(command, remainingReplies); - return false; - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js -var require_event_handler = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.readyHandler = exports2.errorHandler = exports2.closeHandler = exports2.connectHandler = void 0; - var redis_errors_1 = require_redis_errors(); - var Command_1 = require_Command(); - var errors_1 = require_errors(); - var utils_1 = require_utils2(); - var DataHandler_1 = require_DataHandler(); - var debug = (0, utils_1.Debug)("connection"); - function connectHandler(self2) { - return function() { - var _a; - self2.setStatus("connect"); - self2.resetCommandQueue(); - let flushed = false; - const { connectionEpoch } = self2; - if (self2.condition.auth) { - self2.auth(self2.condition.auth, function(err) { - if (connectionEpoch !== self2.connectionEpoch) { - return; - } - if (err) { - if (err.message.indexOf("no password is set") !== -1) { - console.warn("[WARN] Redis server does not require a password, but a password was supplied."); - } else if (err.message.indexOf("without any password configured for the default user") !== -1) { - console.warn("[WARN] This Redis server's `default` user does not require a password, but a password was supplied"); - } else if (err.message.indexOf("wrong number of arguments for 'auth' command") !== -1) { - console.warn(`[ERROR] The server returned "wrong number of arguments for 'auth' command". You are probably passing both username and password to Redis version 5 or below. You should only pass the 'password' option for Redis version 5 and under.`); - } else { - flushed = true; - self2.recoverFromFatalError(err, err); - } - } - }); - } - if (self2.condition.select) { - self2.select(self2.condition.select).catch((err) => { - self2.silentEmit("error", err); - }); - } - new DataHandler_1.default(self2, { - stringNumbers: self2.options.stringNumbers - }); - const clientCommandPromises = []; - if (self2.options.connectionName) { - debug("set the connection name [%s]", self2.options.connectionName); - clientCommandPromises.push(self2.client("setname", self2.options.connectionName).catch(utils_1.noop)); - } - if (!self2.options.disableClientInfo) { - debug("set the client info"); - clientCommandPromises.push((0, utils_1.getPackageMeta)().then((packageMeta) => { - return self2.client("SETINFO", "LIB-VER", packageMeta.version).catch(utils_1.noop); - }).catch(utils_1.noop)); - clientCommandPromises.push(self2.client("SETINFO", "LIB-NAME", ((_a = self2.options) === null || _a === void 0 ? void 0 : _a.clientInfoTag) ? `ioredis(${self2.options.clientInfoTag})` : "ioredis").catch(utils_1.noop)); - } - Promise.all(clientCommandPromises).catch(utils_1.noop).finally(() => { - if (!self2.options.enableReadyCheck) { - exports2.readyHandler(self2)(); - } - if (self2.options.enableReadyCheck) { - self2._readyCheck(function(err, info) { - if (connectionEpoch !== self2.connectionEpoch) { - return; - } - if (err) { - if (!flushed) { - self2.recoverFromFatalError(new Error("Ready check failed: " + err.message), err); - } - } else { - if (self2.connector.check(info)) { - exports2.readyHandler(self2)(); - } else { - self2.disconnect(true); - } - } - }); - } - }); - }; - } - exports2.connectHandler = connectHandler; - function abortError(command) { - const err = new redis_errors_1.AbortError("Command aborted due to connection close"); - err.command = { - name: command.name, - args: command.args - }; - return err; - } - function abortIncompletePipelines(commandQueue) { - var _a; - let expectedIndex = 0; - for (let i = 0; i < commandQueue.length; ) { - const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; - const pipelineIndex = command.pipelineIndex; - if (pipelineIndex === void 0 || pipelineIndex === 0) { - expectedIndex = 0; - } - if (pipelineIndex !== void 0 && pipelineIndex !== expectedIndex++) { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - continue; - } - i++; - } - } - function abortTransactionFragments(commandQueue) { - var _a; - for (let i = 0; i < commandQueue.length; ) { - const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; - if (command.name === "multi") { - break; - } - if (command.name === "exec") { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - break; - } - if (command.inTransaction) { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - } else { - i++; - } - } - } - function closeHandler(self2) { - return function() { - const prevStatus = self2.status; - self2.setStatus("close"); - if (self2.commandQueue.length) { - abortIncompletePipelines(self2.commandQueue); - } - if (self2.offlineQueue.length) { - abortTransactionFragments(self2.offlineQueue); - } - if (prevStatus === "ready") { - if (!self2.prevCondition) { - self2.prevCondition = self2.condition; - } - if (self2.commandQueue.length) { - self2.prevCommandQueue = self2.commandQueue; - } - } - if (self2.manuallyClosing) { - self2.manuallyClosing = false; - debug("skip reconnecting since the connection is manually closed."); - return close(); - } - if (typeof self2.options.retryStrategy !== "function") { - debug("skip reconnecting because `retryStrategy` is not a function"); - return close(); - } - const retryDelay = self2.options.retryStrategy(++self2.retryAttempts); - if (typeof retryDelay !== "number") { - debug("skip reconnecting because `retryStrategy` doesn't return a number"); - return close(); - } - debug("reconnect in %sms", retryDelay); - self2.setStatus("reconnecting", retryDelay); - self2.reconnectTimeout = setTimeout(function() { - self2.reconnectTimeout = null; - self2.connect().catch(utils_1.noop); - }, retryDelay); - const { maxRetriesPerRequest } = self2.options; - if (typeof maxRetriesPerRequest === "number") { - if (maxRetriesPerRequest < 0) { - debug("maxRetriesPerRequest is negative, ignoring..."); - } else { - const remainder = self2.retryAttempts % (maxRetriesPerRequest + 1); - if (remainder === 0) { - debug("reach maxRetriesPerRequest limitation, flushing command queue..."); - self2.flushQueue(new errors_1.MaxRetriesPerRequestError(maxRetriesPerRequest)); - } - } - } - }; - function close() { - self2.setStatus("end"); - self2.flushQueue(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - } - } - exports2.closeHandler = closeHandler; - function errorHandler(self2) { - return function(error) { - debug("error: %s", error); - self2.silentEmit("error", error); - }; - } - exports2.errorHandler = errorHandler; - function readyHandler(self2) { - return function() { - self2.setStatus("ready"); - self2.retryAttempts = 0; - if (self2.options.monitor) { - self2.call("monitor").then(() => self2.setStatus("monitoring"), (error) => self2.emit("error", error)); - const { sendCommand } = self2; - self2.sendCommand = function(command) { - if (Command_1.default.checkFlag("VALID_IN_MONITOR_MODE", command.name)) { - return sendCommand.call(self2, command); - } - command.reject(new Error("Connection is in monitoring mode, can't process commands.")); - return command.promise; - }; - self2.once("close", function() { - delete self2.sendCommand; - }); - return; - } - const finalSelect = self2.prevCondition ? self2.prevCondition.select : self2.condition.select; - if (self2.options.readOnly) { - debug("set the connection to readonly mode"); - self2.readonly().catch(utils_1.noop); - } - if (self2.prevCondition) { - const condition = self2.prevCondition; - self2.prevCondition = null; - if (condition.subscriber && self2.options.autoResubscribe) { - if (self2.condition.select !== finalSelect) { - debug("connect to db [%d]", finalSelect); - self2.select(finalSelect); - } - const subscribeChannels = condition.subscriber.channels("subscribe"); - if (subscribeChannels.length) { - debug("subscribe %d channels", subscribeChannels.length); - self2.subscribe(subscribeChannels); - } - const psubscribeChannels = condition.subscriber.channels("psubscribe"); - if (psubscribeChannels.length) { - debug("psubscribe %d channels", psubscribeChannels.length); - self2.psubscribe(psubscribeChannels); - } - const ssubscribeChannels = condition.subscriber.channels("ssubscribe"); - if (ssubscribeChannels.length) { - debug("ssubscribe %s", ssubscribeChannels.length); - for (const channel of ssubscribeChannels) { - self2.ssubscribe(channel); - } - } - } - } - if (self2.prevCommandQueue) { - if (self2.options.autoResendUnfulfilledCommands) { - debug("resend %d unfulfilled commands", self2.prevCommandQueue.length); - while (self2.prevCommandQueue.length > 0) { - const item = self2.prevCommandQueue.shift(); - if (item.select !== self2.condition.select && item.command.name !== "select") { - self2.select(item.select); - } - self2.sendCommand(item.command, item.stream); - } - } else { - self2.prevCommandQueue = null; - } - } - if (self2.offlineQueue.length) { - debug("send %d commands in offline queue", self2.offlineQueue.length); - const offlineQueue = self2.offlineQueue; - self2.resetOfflineQueue(); - while (offlineQueue.length > 0) { - const item = offlineQueue.shift(); - if (item.select !== self2.condition.select && item.command.name !== "select") { - self2.select(item.select); - } - self2.sendCommand(item.command, item.stream); - } - } - if (self2.condition.select !== finalSelect) { - debug("connect to db [%d]", finalSelect); - self2.select(finalSelect); - } - }; - } - exports2.readyHandler = readyHandler; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js -var require_RedisOptions = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_REDIS_OPTIONS = void 0; - exports2.DEFAULT_REDIS_OPTIONS = { - // Connection - port: 6379, - host: "localhost", - family: 0, - connectTimeout: 1e4, - disconnectTimeout: 2e3, - retryStrategy: function(times) { - return Math.min(times * 50, 2e3); - }, - keepAlive: 0, - noDelay: true, - connectionName: null, - disableClientInfo: false, - clientInfoTag: void 0, - // Sentinel - sentinels: null, - name: null, - role: "master", - sentinelRetryStrategy: function(times) { - return Math.min(times * 10, 1e3); - }, - sentinelReconnectStrategy: function() { - return 6e4; - }, - natMap: null, - enableTLSForSentinelMode: false, - updateSentinels: true, - failoverDetector: false, - // Status - username: null, - password: null, - db: 0, - // Others - enableOfflineQueue: true, - enableReadyCheck: true, - autoResubscribe: true, - autoResendUnfulfilledCommands: true, - lazyConnect: false, - keyPrefix: "", - reconnectOnError: null, - readOnly: false, - stringNumbers: false, - maxRetriesPerRequest: 20, - maxLoadingRetryTime: 1e4, - enableAutoPipelining: false, - autoPipeliningIgnoredCommands: [], - sentinelMaxConnections: 10 - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js -var require_Redis = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var events_1 = require("events"); - var standard_as_callback_1 = require_built2(); - var cluster_1 = require_cluster(); - var Command_1 = require_Command(); - var connectors_1 = require_connectors(); - var SentinelConnector_1 = require_SentinelConnector(); - var eventHandler = require_event_handler(); - var RedisOptions_1 = require_RedisOptions(); - var ScanStream_1 = require_ScanStream(); - var transaction_1 = require_transaction(); - var utils_1 = require_utils2(); - var applyMixin_1 = require_applyMixin(); - var Commander_1 = require_Commander(); - var lodash_1 = require_lodash3(); - var Deque = require_denque(); - var debug = (0, utils_1.Debug)("redis"); - var Redis2 = class _Redis extends Commander_1.default { - constructor(arg1, arg2, arg3) { - super(); - this.status = "wait"; - this.isCluster = false; - this.reconnectTimeout = null; - this.connectionEpoch = 0; - this.retryAttempts = 0; - this.manuallyClosing = false; - this._autoPipelines = /* @__PURE__ */ new Map(); - this._runningAutoPipelines = /* @__PURE__ */ new Set(); - this.parseOptions(arg1, arg2, arg3); - events_1.EventEmitter.call(this); - this.resetCommandQueue(); - this.resetOfflineQueue(); - if (this.options.Connector) { - this.connector = new this.options.Connector(this.options); - } else if (this.options.sentinels) { - const sentinelConnector = new SentinelConnector_1.default(this.options); - sentinelConnector.emitter = this; - this.connector = sentinelConnector; - } else { - this.connector = new connectors_1.StandaloneConnector(this.options); - } - if (this.options.scripts) { - Object.entries(this.options.scripts).forEach(([name, definition]) => { - this.defineCommand(name, definition); - }); - } - if (this.options.lazyConnect) { - this.setStatus("wait"); - } else { - this.connect().catch(lodash_1.noop); - } - } - /** - * Create a Redis instance. - * This is the same as `new Redis()` but is included for compatibility with node-redis. - */ - static createClient(...args) { - return new _Redis(...args); - } - get autoPipelineQueueSize() { - let queued = 0; - for (const pipeline of this._autoPipelines.values()) { - queued += pipeline.length; - } - return queued; - } - /** - * Create a connection to Redis. - * This method will be invoked automatically when creating a new Redis instance - * unless `lazyConnect: true` is passed. - * - * When calling this method manually, a Promise is returned, which will - * be resolved when the connection status is ready. The promise can reject - * if the connection fails, times out, or if Redis is already connecting/connected. - */ - connect(callback) { - const promise = new Promise((resolve2, reject) => { - if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { - reject(new Error("Redis is already connecting/connected")); - return; - } - this.connectionEpoch += 1; - this.setStatus("connecting"); - const { options } = this; - this.condition = { - select: options.db, - auth: options.username ? [options.username, options.password] : options.password, - subscriber: false - }; - const _this = this; - (0, standard_as_callback_1.default)(this.connector.connect(function(type, err) { - _this.silentEmit(type, err); - }), function(err, stream) { - if (err) { - _this.flushQueue(err); - _this.silentEmit("error", err); - reject(err); - _this.setStatus("end"); - return; - } - let CONNECT_EVENT = options.tls ? "secureConnect" : "connect"; - if ("sentinels" in options && options.sentinels && !options.enableTLSForSentinelMode) { - CONNECT_EVENT = "connect"; - } - _this.stream = stream; - if (options.noDelay) { - stream.setNoDelay(true); - } - if (typeof options.keepAlive === "number") { - if (stream.connecting) { - stream.once(CONNECT_EVENT, () => { - stream.setKeepAlive(true, options.keepAlive); - }); - } else { - stream.setKeepAlive(true, options.keepAlive); - } - } - if (stream.connecting) { - stream.once(CONNECT_EVENT, eventHandler.connectHandler(_this)); - if (options.connectTimeout) { - let connectTimeoutCleared = false; - stream.setTimeout(options.connectTimeout, function() { - if (connectTimeoutCleared) { - return; - } - stream.setTimeout(0); - stream.destroy(); - const err2 = new Error("connect ETIMEDOUT"); - err2.errorno = "ETIMEDOUT"; - err2.code = "ETIMEDOUT"; - err2.syscall = "connect"; - eventHandler.errorHandler(_this)(err2); - }); - stream.once(CONNECT_EVENT, function() { - connectTimeoutCleared = true; - stream.setTimeout(0); - }); - } - } else if (stream.destroyed) { - const firstError = _this.connector.firstError; - if (firstError) { - process.nextTick(() => { - eventHandler.errorHandler(_this)(firstError); - }); - } - process.nextTick(eventHandler.closeHandler(_this)); - } else { - process.nextTick(eventHandler.connectHandler(_this)); - } - if (!stream.destroyed) { - stream.once("error", eventHandler.errorHandler(_this)); - stream.once("close", eventHandler.closeHandler(_this)); - } - const connectionReadyHandler = function() { - _this.removeListener("close", connectionCloseHandler); - resolve2(); - }; - var connectionCloseHandler = function() { - _this.removeListener("ready", connectionReadyHandler); - reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - }; - _this.once("ready", connectionReadyHandler); - _this.once("close", connectionCloseHandler); - }); - }); - return (0, standard_as_callback_1.default)(promise, callback); - } - /** - * Disconnect from Redis. - * - * This method closes the connection immediately, - * and may lose some pending replies that haven't written to client. - * If you want to wait for the pending replies, use Redis#quit instead. - */ - disconnect(reconnect = false) { - if (!reconnect) { - this.manuallyClosing = true; - } - if (this.reconnectTimeout && !reconnect) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - } - if (this.status === "wait") { - eventHandler.closeHandler(this)(); - } else { - this.connector.disconnect(); - } - } - /** - * Disconnect from Redis. - * - * @deprecated - */ - end() { - this.disconnect(); - } - /** - * Create a new instance with the same options as the current one. - * - * @example - * ```js - * var redis = new Redis(6380); - * var anotherRedis = redis.duplicate(); - * ``` - */ - duplicate(override) { - return new _Redis({ ...this.options, ...override }); - } - /** - * Mode of the connection. - * - * One of `"normal"`, `"subscriber"`, or `"monitor"`. When the connection is - * not in `"normal"` mode, certain commands are not allowed. - */ - get mode() { - var _a; - return this.options.monitor ? "monitor" : ((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) ? "subscriber" : "normal"; - } - /** - * Listen for all requests received by the server in real time. - * - * This command will create a new connection to Redis and send a - * MONITOR command via the new connection in order to avoid disturbing - * the current connection. - * - * @param callback The callback function. If omit, a promise will be returned. - * @example - * ```js - * var redis = new Redis(); - * redis.monitor(function (err, monitor) { - * // Entering monitoring mode. - * monitor.on('monitor', function (time, args, source, database) { - * console.log(time + ": " + util.inspect(args)); - * }); - * }); - * - * // supports promise as well as other commands - * redis.monitor().then(function (monitor) { - * monitor.on('monitor', function (time, args, source, database) { - * console.log(time + ": " + util.inspect(args)); - * }); - * }); - * ``` - */ - monitor(callback) { - const monitorInstance = this.duplicate({ - monitor: true, - lazyConnect: false - }); - return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { - monitorInstance.once("error", reject); - monitorInstance.once("monitoring", function() { - resolve2(monitorInstance); - }); - }), callback); - } - /** - * Send a command to Redis - * - * This method is used internally and in most cases you should not - * use it directly. If you need to send a command that is not supported - * by the library, you can use the `call` method: - * - * ```js - * const redis = new Redis(); - * - * redis.call('set', 'foo', 'bar'); - * // or - * redis.call(['set', 'foo', 'bar']); - * ``` - * - * @ignore - */ - sendCommand(command, stream) { - var _a, _b; - if (this.status === "wait") { - this.connect().catch(lodash_1.noop); - } - if (this.status === "end") { - command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return command.promise; - } - if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) && !Command_1.default.checkFlag("VALID_IN_SUBSCRIBER_MODE", command.name)) { - command.reject(new Error("Connection in subscriber mode, only subscriber commands may be used")); - return command.promise; - } - if (typeof this.options.commandTimeout === "number") { - command.setTimeout(this.options.commandTimeout); - } - let writable = this.status === "ready" || !stream && this.status === "connect" && (0, commands_1.exists)(command.name) && ((0, commands_1.hasFlag)(command.name, "loading") || Command_1.default.checkFlag("HANDSHAKE_COMMANDS", command.name)); - if (!this.stream) { - writable = false; - } else if (!this.stream.writable) { - writable = false; - } else if (this.stream._writableState && this.stream._writableState.ended) { - writable = false; - } - if (!writable) { - if (!this.options.enableOfflineQueue) { - command.reject(new Error("Stream isn't writeable and enableOfflineQueue options is false")); - return command.promise; - } - if (command.name === "quit" && this.offlineQueue.length === 0) { - this.disconnect(); - command.resolve(Buffer.from("OK")); - return command.promise; - } - if (debug.enabled) { - debug("queue command[%s]: %d -> %s(%o)", this._getDescription(), this.condition.select, command.name, command.args); - } - this.offlineQueue.push({ - command, - stream, - select: this.condition.select - }); - } else { - if (debug.enabled) { - debug("write command[%s]: %d -> %s(%o)", this._getDescription(), (_b = this.condition) === null || _b === void 0 ? void 0 : _b.select, command.name, command.args); - } - if (stream) { - if ("isPipeline" in stream && stream.isPipeline) { - stream.write(command.toWritable(stream.destination.redis.stream)); - } else { - stream.write(command.toWritable(stream)); - } - } else { - this.stream.write(command.toWritable(this.stream)); - } - this.commandQueue.push({ - command, - stream, - select: this.condition.select - }); - if (Command_1.default.checkFlag("WILL_DISCONNECT", command.name)) { - this.manuallyClosing = true; - } - if (this.options.socketTimeout !== void 0 && this.socketTimeoutTimer === void 0) { - this.setSocketTimeout(); - } - } - if (command.name === "select" && (0, utils_1.isInt)(command.args[0])) { - const db = parseInt(command.args[0], 10); - if (this.condition.select !== db) { - this.condition.select = db; - this.emit("select", db); - debug("switch to db [%d]", this.condition.select); - } - } - return command.promise; - } - setSocketTimeout() { - this.socketTimeoutTimer = setTimeout(() => { - this.stream.destroy(new Error(`Socket timeout. Expecting data, but didn't receive any in ${this.options.socketTimeout}ms.`)); - this.socketTimeoutTimer = void 0; - }, this.options.socketTimeout); - this.stream.once("data", () => { - clearTimeout(this.socketTimeoutTimer); - this.socketTimeoutTimer = void 0; - if (this.commandQueue.length === 0) - return; - this.setSocketTimeout(); - }); - } - scanStream(options) { - return this.createScanStream("scan", { options }); - } - scanBufferStream(options) { - return this.createScanStream("scanBuffer", { options }); - } - sscanStream(key, options) { - return this.createScanStream("sscan", { key, options }); - } - sscanBufferStream(key, options) { - return this.createScanStream("sscanBuffer", { key, options }); - } - hscanStream(key, options) { - return this.createScanStream("hscan", { key, options }); - } - hscanBufferStream(key, options) { - return this.createScanStream("hscanBuffer", { key, options }); - } - zscanStream(key, options) { - return this.createScanStream("zscan", { key, options }); - } - zscanBufferStream(key, options) { - return this.createScanStream("zscanBuffer", { key, options }); - } - /** - * Emit only when there's at least one listener. - * - * @ignore - */ - silentEmit(eventName, arg) { - let error; - if (eventName === "error") { - error = arg; - if (this.status === "end") { - return; - } - if (this.manuallyClosing) { - if (error instanceof Error && (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG || // @ts-expect-error - error.syscall === "connect" || // @ts-expect-error - error.syscall === "read")) { - return; - } - } - } - if (this.listeners(eventName).length > 0) { - return this.emit.apply(this, arguments); - } - if (error && error instanceof Error) { - console.error("[ioredis] Unhandled error event:", error.stack); - } - return false; - } - /** - * @ignore - */ - recoverFromFatalError(_commandError, err, options) { - this.flushQueue(err, options); - this.silentEmit("error", err); - this.disconnect(true); - } - /** - * @ignore - */ - handleReconnection(err, item) { - var _a; - let needReconnect = false; - if (this.options.reconnectOnError && !Command_1.default.checkFlag("IGNORE_RECONNECT_ON_ERROR", item.command.name)) { - needReconnect = this.options.reconnectOnError(err); - } - switch (needReconnect) { - case 1: - case true: - if (this.status !== "reconnecting") { - this.disconnect(true); - } - item.command.reject(err); - break; - case 2: - if (this.status !== "reconnecting") { - this.disconnect(true); - } - if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.select) !== item.select && item.command.name !== "select") { - this.select(item.select); - } - this.sendCommand(item.command); - break; - default: - item.command.reject(err); - } - } - /** - * Get description of the connection. Used for debugging. - */ - _getDescription() { - let description; - if ("path" in this.options && this.options.path) { - description = this.options.path; - } else if (this.stream && this.stream.remoteAddress && this.stream.remotePort) { - description = this.stream.remoteAddress + ":" + this.stream.remotePort; - } else if ("host" in this.options && this.options.host) { - description = this.options.host + ":" + this.options.port; - } else { - description = ""; - } - if (this.options.connectionName) { - description += ` (${this.options.connectionName})`; - } - return description; - } - resetCommandQueue() { - this.commandQueue = new Deque(); - } - resetOfflineQueue() { - this.offlineQueue = new Deque(); - } - parseOptions(...args) { - const options = {}; - let isTls = false; - for (let i = 0; i < args.length; ++i) { - const arg = args[i]; - if (arg === null || typeof arg === "undefined") { - continue; - } - if (typeof arg === "object") { - (0, lodash_1.defaults)(options, arg); - } else if (typeof arg === "string") { - (0, lodash_1.defaults)(options, (0, utils_1.parseURL)(arg)); - if (arg.startsWith("rediss://")) { - isTls = true; - } - } else if (typeof arg === "number") { - options.port = arg; - } else { - throw new Error("Invalid argument " + arg); - } - } - if (isTls) { - (0, lodash_1.defaults)(options, { tls: true }); - } - (0, lodash_1.defaults)(options, _Redis.defaultOptions); - if (typeof options.port === "string") { - options.port = parseInt(options.port, 10); - } - if (typeof options.db === "string") { - options.db = parseInt(options.db, 10); - } - this.options = (0, utils_1.resolveTLSProfile)(options); - } - /** - * Change instance's status - */ - setStatus(status, arg) { - if (debug.enabled) { - debug("status[%s]: %s -> %s", this._getDescription(), this.status || "[empty]", status); - } - this.status = status; - process.nextTick(this.emit.bind(this, status, arg)); - } - createScanStream(command, { key, options = {} }) { - return new ScanStream_1.default({ - objectMode: true, - key, - redis: this, - command, - ...options - }); - } - /** - * Flush offline queue and command queue with error. - * - * @param error The error object to send to the commands - * @param options options - */ - flushQueue(error, options) { - options = (0, lodash_1.defaults)({}, options, { - offlineQueue: true, - commandQueue: true - }); - let item; - if (options.offlineQueue) { - while (item = this.offlineQueue.shift()) { - item.command.reject(error); - } - } - if (options.commandQueue) { - if (this.commandQueue.length > 0) { - if (this.stream) { - this.stream.removeAllListeners("data"); - } - while (item = this.commandQueue.shift()) { - item.command.reject(error); - } - } - } - } - /** - * Check whether Redis has finished loading the persistent data and is able to - * process commands. - */ - _readyCheck(callback) { - const _this = this; - this.info(function(err, res) { - if (err) { - if (err.message && err.message.includes("NOPERM")) { - console.warn(`Skipping the ready check because INFO command fails: "${err.message}". You can disable ready check with "enableReadyCheck". More: https://github.com/luin/ioredis/wiki/Disable-ready-check.`); - return callback(null, {}); - } - return callback(err); - } - if (typeof res !== "string") { - return callback(null, res); - } - const info = {}; - const lines = res.split("\r\n"); - for (let i = 0; i < lines.length; ++i) { - const [fieldName, ...fieldValueParts] = lines[i].split(":"); - const fieldValue = fieldValueParts.join(":"); - if (fieldValue) { - info[fieldName] = fieldValue; - } - } - if (!info.loading || info.loading === "0") { - callback(null, info); - } else { - const loadingEtaMs = (info.loading_eta_seconds || 1) * 1e3; - const retryTime = _this.options.maxLoadingRetryTime && _this.options.maxLoadingRetryTime < loadingEtaMs ? _this.options.maxLoadingRetryTime : loadingEtaMs; - debug("Redis server still loading, trying again in " + retryTime + "ms"); - setTimeout(function() { - _this._readyCheck(callback); - }, retryTime); - } - }).catch(lodash_1.noop); - } - }; - Redis2.Cluster = cluster_1.default; - Redis2.Command = Command_1.default; - Redis2.defaultOptions = RedisOptions_1.DEFAULT_REDIS_OPTIONS; - (0, applyMixin_1.default)(Redis2, events_1.EventEmitter); - (0, transaction_1.addTransactionSupport)(Redis2.prototype); - exports2.default = Redis2; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js -var require_built3 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.print = exports2.ReplyError = exports2.SentinelIterator = exports2.SentinelConnector = exports2.AbstractConnector = exports2.Pipeline = exports2.ScanStream = exports2.Command = exports2.Cluster = exports2.Redis = exports2.default = void 0; - exports2 = module2.exports = require_Redis().default; - var Redis_1 = require_Redis(); - Object.defineProperty(exports2, "default", { enumerable: true, get: function() { - return Redis_1.default; - } }); - var Redis_2 = require_Redis(); - Object.defineProperty(exports2, "Redis", { enumerable: true, get: function() { - return Redis_2.default; - } }); - var cluster_1 = require_cluster(); - Object.defineProperty(exports2, "Cluster", { enumerable: true, get: function() { - return cluster_1.default; - } }); - var Command_1 = require_Command(); - Object.defineProperty(exports2, "Command", { enumerable: true, get: function() { - return Command_1.default; - } }); - var ScanStream_1 = require_ScanStream(); - Object.defineProperty(exports2, "ScanStream", { enumerable: true, get: function() { - return ScanStream_1.default; - } }); - var Pipeline_1 = require_Pipeline(); - Object.defineProperty(exports2, "Pipeline", { enumerable: true, get: function() { - return Pipeline_1.default; - } }); - var AbstractConnector_1 = require_AbstractConnector(); - Object.defineProperty(exports2, "AbstractConnector", { enumerable: true, get: function() { - return AbstractConnector_1.default; - } }); - var SentinelConnector_1 = require_SentinelConnector(); - Object.defineProperty(exports2, "SentinelConnector", { enumerable: true, get: function() { - return SentinelConnector_1.default; - } }); - Object.defineProperty(exports2, "SentinelIterator", { enumerable: true, get: function() { - return SentinelConnector_1.SentinelIterator; - } }); - exports2.ReplyError = require_redis_errors().ReplyError; - Object.defineProperty(exports2, "Promise", { - get() { - console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); - return Promise; - }, - set(_lib) { - console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); - } - }); - function print(err, reply) { - if (err) { - console.log("Error: " + err); - } else { - console.log("Reply: " + reply); - } - } - exports2.print = print; - } -}); - -// node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js -var require_main = __commonJS({ - "node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var node_exports = {}; - __export2(node_exports, { - analyzeMetafile: () => analyzeMetafile, - analyzeMetafileSync: () => analyzeMetafileSync, - build: () => build2, - buildSync: () => buildSync, - context: () => context, - default: () => node_default, - formatMessages: () => formatMessages, - formatMessagesSync: () => formatMessagesSync, - initialize: () => initialize, - stop: () => stop, - transform: () => transform, - transformSync: () => transformSync, - version: () => version - }); - module2.exports = __toCommonJS2(node_exports); - function encodePacket(packet) { - let visit = (value) => { - if (value === null) { - bb.write8(0); - } else if (typeof value === "boolean") { - bb.write8(1); - bb.write8(+value); - } else if (typeof value === "number") { - bb.write8(2); - bb.write32(value | 0); - } else if (typeof value === "string") { - bb.write8(3); - bb.write(encodeUTF8(value)); - } else if (value instanceof Uint8Array) { - bb.write8(4); - bb.write(value); - } else if (value instanceof Array) { - bb.write8(5); - bb.write32(value.length); - for (let item of value) { - visit(item); - } - } else { - let keys = Object.keys(value); - bb.write8(6); - bb.write32(keys.length); - for (let key of keys) { - bb.write(encodeUTF8(key)); - visit(value[key]); - } - } - }; - let bb = new ByteBuffer(); - bb.write32(0); - bb.write32(packet.id << 1 | +!packet.isRequest); - visit(packet.value); - writeUInt32LE(bb.buf, bb.len - 4, 0); - return bb.buf.subarray(0, bb.len); - } - function decodePacket(bytes) { - let visit = () => { - switch (bb.read8()) { - case 0: - return null; - case 1: - return !!bb.read8(); - case 2: - return bb.read32(); - case 3: - return decodeUTF8(bb.read()); - case 4: - return bb.read(); - case 5: { - let count = bb.read32(); - let value2 = []; - for (let i = 0; i < count; i++) { - value2.push(visit()); - } - return value2; - } - case 6: { - let count = bb.read32(); - let value2 = {}; - for (let i = 0; i < count; i++) { - value2[decodeUTF8(bb.read())] = visit(); - } - return value2; - } - default: - throw new Error("Invalid packet"); - } - }; - let bb = new ByteBuffer(bytes); - let id = bb.read32(); - let isRequest = (id & 1) === 0; - id >>>= 1; - let value = visit(); - if (bb.ptr !== bytes.length) { - throw new Error("Invalid packet"); - } - return { id, isRequest, value }; - } - var ByteBuffer = class { - constructor(buf = new Uint8Array(1024)) { - this.buf = buf; - this.len = 0; - this.ptr = 0; - } - _write(delta) { - if (this.len + delta > this.buf.length) { - let clone = new Uint8Array((this.len + delta) * 2); - clone.set(this.buf); - this.buf = clone; - } - this.len += delta; - return this.len - delta; - } - write8(value) { - let offset = this._write(1); - this.buf[offset] = value; - } - write32(value) { - let offset = this._write(4); - writeUInt32LE(this.buf, value, offset); - } - write(bytes) { - let offset = this._write(4 + bytes.length); - writeUInt32LE(this.buf, bytes.length, offset); - this.buf.set(bytes, offset + 4); - } - _read(delta) { - if (this.ptr + delta > this.buf.length) { - throw new Error("Invalid packet"); - } - this.ptr += delta; - return this.ptr - delta; - } - read8() { - return this.buf[this._read(1)]; - } - read32() { - return readUInt32LE(this.buf, this._read(4)); - } - read() { - let length = this.read32(); - let bytes = new Uint8Array(length); - let ptr = this._read(bytes.length); - bytes.set(this.buf.subarray(ptr, ptr + length)); - return bytes; - } - }; - var encodeUTF8; - var decodeUTF8; - var encodeInvariant; - if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { - let encoder = new TextEncoder(); - let decoder = new TextDecoder(); - encodeUTF8 = (text) => encoder.encode(text); - decodeUTF8 = (bytes) => decoder.decode(bytes); - encodeInvariant = 'new TextEncoder().encode("")'; - } else if (typeof Buffer !== "undefined") { - encodeUTF8 = (text) => Buffer.from(text); - decodeUTF8 = (bytes) => { - let { buffer, byteOffset, byteLength } = bytes; - return Buffer.from(buffer, byteOffset, byteLength).toString(); - }; - encodeInvariant = 'Buffer.from("")'; - } else { - throw new Error("No UTF-8 codec found"); - } - if (!(encodeUTF8("") instanceof Uint8Array)) - throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false - -This indicates that your JavaScript environment is broken. You cannot use -esbuild in this environment because esbuild relies on this invariant. This -is not a problem with esbuild. You need to fix your environment instead. -`); - function readUInt32LE(buffer, offset) { - return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; - } - function writeUInt32LE(buffer, value, offset) { - buffer[offset++] = value; - buffer[offset++] = value >> 8; - buffer[offset++] = value >> 16; - buffer[offset++] = value >> 24; - } - var quote = JSON.stringify; - var buildLogLevelDefault = "warning"; - var transformLogLevelDefault = "silent"; - function validateTarget(target) { - validateStringValue(target, "target"); - if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); - return target; - } - var canBeAnything = () => null; - var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; - var mustBeString = (value) => typeof value === "string" ? null : "a string"; - var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; - var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; - var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; - var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; - var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; - var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; - var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; - var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; - var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; - var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; - var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; - var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; - var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; - function getFlag(object, keys, key, mustBeFn) { - let value = object[key]; - keys[key + ""] = true; - if (value === void 0) return void 0; - let mustBe = mustBeFn(value); - if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); - return value; - } - function checkForInvalidFlags(object, keys, where) { - for (let key in object) { - if (!(key in keys)) { - throw new Error(`Invalid option ${where}: ${quote(key)}`); - } - } - } - function validateInitializeOptions(options) { - let keys = /* @__PURE__ */ Object.create(null); - let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); - let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); - let worker = getFlag(options, keys, "worker", mustBeBoolean); - checkForInvalidFlags(options, keys, "in initialize() call"); - return { - wasmURL, - wasmModule, - worker - }; - } - function validateMangleCache(mangleCache) { - let validated; - if (mangleCache !== void 0) { - validated = /* @__PURE__ */ Object.create(null); - for (let key in mangleCache) { - let value = mangleCache[key]; - if (typeof value === "string" || value === false) { - validated[key] = value; - } else { - throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); - } - } - } - return validated; - } - function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { - let color = getFlag(options, keys, "color", mustBeBoolean); - let logLevel = getFlag(options, keys, "logLevel", mustBeString); - let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); - if (color !== void 0) flags.push(`--color=${color}`); - else if (isTTY2) flags.push(`--color=true`); - flags.push(`--log-level=${logLevel || logLevelDefault}`); - flags.push(`--log-limit=${logLimit || 0}`); - } - function validateStringValue(value, what, key) { - if (typeof value !== "string") { - throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); - } - return value; - } - function pushCommonFlags(flags, options, keys) { - let legalComments = getFlag(options, keys, "legalComments", mustBeString); - let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); - let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); - let target = getFlag(options, keys, "target", mustBeStringOrArray); - let format = getFlag(options, keys, "format", mustBeString); - let globalName = getFlag(options, keys, "globalName", mustBeString); - let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); - let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); - let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); - let minify = getFlag(options, keys, "minify", mustBeBoolean); - let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); - let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); - let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); - let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); - let drop = getFlag(options, keys, "drop", mustBeArray); - let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); - let charset = getFlag(options, keys, "charset", mustBeString); - let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); - let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); - let jsx = getFlag(options, keys, "jsx", mustBeString); - let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); - let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); - let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); - let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); - let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); - let define = getFlag(options, keys, "define", mustBeObject); - let logOverride = getFlag(options, keys, "logOverride", mustBeObject); - let supported = getFlag(options, keys, "supported", mustBeObject); - let pure = getFlag(options, keys, "pure", mustBeArray); - let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); - let platform = getFlag(options, keys, "platform", mustBeString); - let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); - if (legalComments) flags.push(`--legal-comments=${legalComments}`); - if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); - if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); - if (target) { - if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); - else flags.push(`--target=${validateTarget(target)}`); - } - if (format) flags.push(`--format=${format}`); - if (globalName) flags.push(`--global-name=${globalName}`); - if (platform) flags.push(`--platform=${platform}`); - if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); - if (minify) flags.push("--minify"); - if (minifySyntax) flags.push("--minify-syntax"); - if (minifyWhitespace) flags.push("--minify-whitespace"); - if (minifyIdentifiers) flags.push("--minify-identifiers"); - if (lineLimit) flags.push(`--line-limit=${lineLimit}`); - if (charset) flags.push(`--charset=${charset}`); - if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); - if (ignoreAnnotations) flags.push(`--ignore-annotations`); - if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); - if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); - if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); - if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); - if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); - if (jsx) flags.push(`--jsx=${jsx}`); - if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); - if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); - if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); - if (jsxDev) flags.push(`--jsx-dev`); - if (jsxSideEffects) flags.push(`--jsx-side-effects`); - if (define) { - for (let key in define) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); - flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); - } - } - if (logOverride) { - for (let key in logOverride) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); - flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); - } - } - if (supported) { - for (let key in supported) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); - const value = supported[key]; - if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); - flags.push(`--supported:${key}=${value}`); - } - } - if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); - if (keepNames) flags.push(`--keep-names`); - } - function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { - var _a2; - let flags = []; - let entries = []; - let keys = /* @__PURE__ */ Object.create(null); - let stdinContents = null; - let stdinResolveDir = null; - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let bundle = getFlag(options, keys, "bundle", mustBeBoolean); - let splitting = getFlag(options, keys, "splitting", mustBeBoolean); - let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); - let metafile = getFlag(options, keys, "metafile", mustBeBoolean); - let outfile = getFlag(options, keys, "outfile", mustBeString); - let outdir = getFlag(options, keys, "outdir", mustBeString); - let outbase = getFlag(options, keys, "outbase", mustBeString); - let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); - let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); - let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); - let mainFields = getFlag(options, keys, "mainFields", mustBeArray); - let conditions = getFlag(options, keys, "conditions", mustBeArray); - let external = getFlag(options, keys, "external", mustBeArray); - let packages = getFlag(options, keys, "packages", mustBeString); - let alias = getFlag(options, keys, "alias", mustBeObject); - let loader = getFlag(options, keys, "loader", mustBeObject); - let outExtension = getFlag(options, keys, "outExtension", mustBeObject); - let publicPath = getFlag(options, keys, "publicPath", mustBeString); - let entryNames = getFlag(options, keys, "entryNames", mustBeString); - let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); - let assetNames = getFlag(options, keys, "assetNames", mustBeString); - let inject = getFlag(options, keys, "inject", mustBeArray); - let banner = getFlag(options, keys, "banner", mustBeObject); - let footer = getFlag(options, keys, "footer", mustBeObject); - let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); - let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); - let stdin = getFlag(options, keys, "stdin", mustBeObject); - let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; - let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - keys.plugins = true; - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); - if (bundle) flags.push("--bundle"); - if (allowOverwrite) flags.push("--allow-overwrite"); - if (splitting) flags.push("--splitting"); - if (preserveSymlinks) flags.push("--preserve-symlinks"); - if (metafile) flags.push(`--metafile`); - if (outfile) flags.push(`--outfile=${outfile}`); - if (outdir) flags.push(`--outdir=${outdir}`); - if (outbase) flags.push(`--outbase=${outbase}`); - if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); - if (packages) flags.push(`--packages=${packages}`); - if (resolveExtensions) { - let values = []; - for (let value of resolveExtensions) { - validateStringValue(value, "resolve extension"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); - values.push(value); - } - flags.push(`--resolve-extensions=${values.join(",")}`); - } - if (publicPath) flags.push(`--public-path=${publicPath}`); - if (entryNames) flags.push(`--entry-names=${entryNames}`); - if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); - if (assetNames) flags.push(`--asset-names=${assetNames}`); - if (mainFields) { - let values = []; - for (let value of mainFields) { - validateStringValue(value, "main field"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); - values.push(value); - } - flags.push(`--main-fields=${values.join(",")}`); - } - if (conditions) { - let values = []; - for (let value of conditions) { - validateStringValue(value, "condition"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); - values.push(value); - } - flags.push(`--conditions=${values.join(",")}`); - } - if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); - if (alias) { - for (let old in alias) { - if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); - flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); - } - } - if (banner) { - for (let type in banner) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); - flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); - } - } - if (footer) { - for (let type in footer) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); - flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); - } - } - if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); - if (loader) { - for (let ext in loader) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); - flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); - } - } - if (outExtension) { - for (let ext in outExtension) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); - flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); - } - } - if (entryPoints) { - if (Array.isArray(entryPoints)) { - for (let i = 0, n = entryPoints.length; i < n; i++) { - let entryPoint = entryPoints[i]; - if (typeof entryPoint === "object" && entryPoint !== null) { - let entryPointKeys = /* @__PURE__ */ Object.create(null); - let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); - let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); - checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); - if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); - if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); - entries.push([output, input]); - } else { - entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); - } - } - } else { - for (let key in entryPoints) { - entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); - } - } - } - if (stdin) { - let stdinKeys = /* @__PURE__ */ Object.create(null); - let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); - let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); - let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); - checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader2) flags.push(`--loader=${loader2}`); - if (resolveDir) stdinResolveDir = resolveDir; - if (typeof contents === "string") stdinContents = encodeUTF8(contents); - else if (contents instanceof Uint8Array) stdinContents = contents; - } - let nodePaths = []; - if (nodePathsInput) { - for (let value of nodePathsInput) { - value += ""; - nodePaths.push(value); - } - } - return { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache: validateMangleCache(mangleCache) - }; - } - function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { - let flags = []; - let keys = /* @__PURE__ */ Object.create(null); - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); - let loader = getFlag(options, keys, "loader", mustBeString); - let banner = getFlag(options, keys, "banner", mustBeString); - let footer = getFlag(options, keys, "footer", mustBeString); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader) flags.push(`--loader=${loader}`); - if (banner) flags.push(`--banner=${banner}`); - if (footer) flags.push(`--footer=${footer}`); - return { - flags, - mangleCache: validateMangleCache(mangleCache) - }; - } - function createChannel(streamIn) { - const requestCallbacksByKey = {}; - const closeData = { didClose: false, reason: "" }; - let responseCallbacks = {}; - let nextRequestID = 0; - let nextBuildKey = 0; - let stdout = new Uint8Array(16 * 1024); - let stdoutUsed = 0; - let readFromStdout = (chunk) => { - let limit = stdoutUsed + chunk.length; - if (limit > stdout.length) { - let swap = new Uint8Array(limit * 2); - swap.set(stdout); - stdout = swap; - } - stdout.set(chunk, stdoutUsed); - stdoutUsed += chunk.length; - let offset = 0; - while (offset + 4 <= stdoutUsed) { - let length = readUInt32LE(stdout, offset); - if (offset + 4 + length > stdoutUsed) { - break; - } - offset += 4; - handleIncomingPacket(stdout.subarray(offset, offset + length)); - offset += length; - } - if (offset > 0) { - stdout.copyWithin(0, offset, stdoutUsed); - stdoutUsed -= offset; - } - }; - let afterClose = (error) => { - closeData.didClose = true; - if (error) closeData.reason = ": " + (error.message || error); - const text = "The service was stopped" + closeData.reason; - for (let id in responseCallbacks) { - responseCallbacks[id](text, null); - } - responseCallbacks = {}; - }; - let sendRequest = (refs, value, callback) => { - if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); - let id = nextRequestID++; - responseCallbacks[id] = (error, response) => { - try { - callback(error, response); - } finally { - if (refs) refs.unref(); - } - }; - if (refs) refs.ref(); - streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); - }; - let sendResponse = (id, value) => { - if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); - streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); - }; - let handleRequest = async (id, request) => { - try { - if (request.command === "ping") { - sendResponse(id, {}); - return; - } - if (typeof request.key === "number") { - const requestCallbacks = requestCallbacksByKey[request.key]; - if (!requestCallbacks) { - return; - } - const callback = requestCallbacks[request.command]; - if (callback) { - await callback(id, request); - return; - } - } - throw new Error(`Invalid command: ` + request.command); - } catch (e) { - const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; - try { - sendResponse(id, { errors }); - } catch { - } - } - }; - let isFirstPacket = true; - let handleIncomingPacket = (bytes) => { - if (isFirstPacket) { - isFirstPacket = false; - let binaryVersion = String.fromCharCode(...bytes); - if (binaryVersion !== "0.24.2") { - throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`); - } - return; - } - let packet = decodePacket(bytes); - if (packet.isRequest) { - handleRequest(packet.id, packet.value); - } else { - let callback = responseCallbacks[packet.id]; - delete responseCallbacks[packet.id]; - if (packet.value.error) callback(packet.value.error, {}); - else callback(null, packet.value); - } - }; - let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { - let refCount = 0; - const buildKey = nextBuildKey++; - const requestCallbacks = {}; - const buildRefs = { - ref() { - if (++refCount === 1) { - if (refs) refs.ref(); - } - }, - unref() { - if (--refCount === 0) { - delete requestCallbacksByKey[buildKey]; - if (refs) refs.unref(); - } - } - }; - requestCallbacksByKey[buildKey] = requestCallbacks; - buildRefs.ref(); - buildOrContextImpl( - callName, - buildKey, - sendRequest, - sendResponse, - buildRefs, - streamIn, - requestCallbacks, - options, - isTTY2, - defaultWD2, - (err, res) => { - try { - callback(err, res); - } finally { - buildRefs.unref(); - } - } - ); - }; - let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { - const details = createObjectStash(); - let start = (inputPath) => { - try { - if (typeof input !== "string" && !(input instanceof Uint8Array)) - throw new Error('The input to "transform" must be a string or a Uint8Array'); - let { - flags, - mangleCache - } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); - let request = { - command: "transform", - flags, - inputFS: inputPath !== null, - input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input - }; - if (mangleCache) request.mangleCache = mangleCache; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - let errors = replaceDetailsInMessages(response.errors, details); - let warnings = replaceDetailsInMessages(response.warnings, details); - let outstanding = 1; - let next = () => { - if (--outstanding === 0) { - let result = { - warnings, - code: response.code, - map: response.map, - mangleCache: void 0, - legalComments: void 0 - }; - if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; - if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; - callback(null, result); - } - }; - if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); - if (response.codeFS) { - outstanding++; - fs3.readFile(response.code, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.code = contents; - next(); - } - }); - } - if (response.mapFS) { - outstanding++; - fs3.readFile(response.map, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.map = contents; - next(); - } - }); - } - next(); - }); - } catch (e) { - let flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); - } catch { - } - const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); - sendRequest(refs, { command: "error", flags, error }, () => { - error.detail = details.load(error.detail); - callback(failureErrorWithLog("Transform failed", [error], []), null); - }); - } - }; - if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { - let next = start; - start = () => fs3.writeFile(input, next); - } - start(null); - }; - let formatMessages2 = ({ callName, refs, messages, options, callback }) => { - if (!options) throw new Error(`Missing second argument in ${callName}() call`); - let keys = {}; - let kind = getFlag(options, keys, "kind", mustBeString); - let color = getFlag(options, keys, "color", mustBeBoolean); - let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); - if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); - let request = { - command: "format-msgs", - messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), - isWarning: kind === "warning" - }; - if (color !== void 0) request.color = color; - if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.messages); - }); - }; - let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { - if (options === void 0) options = {}; - let keys = {}; - let color = getFlag(options, keys, "color", mustBeBoolean); - let verbose = getFlag(options, keys, "verbose", mustBeBoolean); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - let request = { - command: "analyze-metafile", - metafile - }; - if (color !== void 0) request.color = color; - if (verbose !== void 0) request.verbose = verbose; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.result); - }); - }; - return { - readFromStdout, - afterClose, - service: { - buildOrContext, - transform: transform2, - formatMessages: formatMessages2, - analyzeMetafile: analyzeMetafile2 - } - }; - } - function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { - const details = createObjectStash(); - const isContext = callName === "context"; - const handleError = (e, pluginName) => { - const flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); - } catch { - } - const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); - sendRequest(refs, { command: "error", flags, error: message }, () => { - message.detail = details.load(message.detail); - callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); - }); - }; - let plugins; - if (typeof options === "object") { - const value = options.plugins; - if (value !== void 0) { - if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); - plugins = value; - } - } - if (plugins && plugins.length > 0) { - if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); - handlePlugins( - buildKey, - sendRequest, - sendResponse, - refs, - streamIn, - requestCallbacks, - options, - plugins, - details - ).then( - (result) => { - if (!result.ok) return handleError(result.error, result.pluginName); - try { - buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); - } catch (e) { - handleError(e, ""); - } - }, - (e) => handleError(e, "") - ); - return; - } - try { - buildOrContextContinue(null, (result, done) => done([], []), () => { - }); - } catch (e) { - handleError(e, ""); - } - function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { - const writeDefault = streamIn.hasFS; - const { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache - } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); - if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); - const request = { - command: "build", - key: buildKey, - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir: absWorkingDir || defaultWD2, - nodePaths, - context: isContext - }; - if (requestPlugins) request.plugins = requestPlugins; - if (mangleCache) request.mangleCache = mangleCache; - const buildResponseToResult = (response, callback2) => { - const result = { - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - outputFiles: void 0, - metafile: void 0, - mangleCache: void 0 - }; - const originalErrors = result.errors.slice(); - const originalWarnings = result.warnings.slice(); - if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); - if (response.metafile) result.metafile = JSON.parse(response.metafile); - if (response.mangleCache) result.mangleCache = response.mangleCache; - if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); - runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { - if (originalErrors.length > 0 || onEndErrors.length > 0) { - const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); - return callback2(error, null, onEndErrors, onEndWarnings); - } - callback2(null, result, onEndErrors, onEndWarnings); - }); - }; - let latestResultPromise; - let provideLatestResult; - if (isContext) - requestCallbacks["on-end"] = (id, request2) => new Promise((resolve2) => { - buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { - const response = { - errors: onEndErrors, - warnings: onEndWarnings - }; - if (provideLatestResult) provideLatestResult(err, result); - latestResultPromise = void 0; - provideLatestResult = void 0; - sendResponse(id, response); - resolve2(); - }); - }); - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - if (!isContext) { - return buildResponseToResult(response, (err, res) => { - scheduleOnDisposeCallbacks(); - return callback(err, res); - }); - } - if (response.errors.length > 0) { - return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); - } - let didDispose = false; - const result = { - rebuild: () => { - if (!latestResultPromise) latestResultPromise = new Promise((resolve2, reject) => { - let settlePromise; - provideLatestResult = (err, result2) => { - if (!settlePromise) settlePromise = () => err ? reject(err) : resolve2(result2); - }; - const triggerAnotherBuild = () => { - const request2 = { - command: "rebuild", - key: buildKey - }; - sendRequest(refs, request2, (error2, response2) => { - if (error2) { - reject(new Error(error2)); - } else if (settlePromise) { - settlePromise(); - } else { - triggerAnotherBuild(); - } - }); - }; - triggerAnotherBuild(); - }); - return latestResultPromise; - }, - watch: (options2 = {}) => new Promise((resolve2, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); - const keys = {}; - checkForInvalidFlags(options2, keys, `in watch() call`); - const request2 = { - command: "watch", - key: buildKey - }; - sendRequest(refs, request2, (error2) => { - if (error2) reject(new Error(error2)); - else resolve2(void 0); - }); - }), - serve: (options2 = {}) => new Promise((resolve2, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); - const keys = {}; - const port = getFlag(options2, keys, "port", mustBeInteger); - const host = getFlag(options2, keys, "host", mustBeString); - const servedir = getFlag(options2, keys, "servedir", mustBeString); - const keyfile = getFlag(options2, keys, "keyfile", mustBeString); - const certfile = getFlag(options2, keys, "certfile", mustBeString); - const fallback = getFlag(options2, keys, "fallback", mustBeString); - const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); - checkForInvalidFlags(options2, keys, `in serve() call`); - const request2 = { - command: "serve", - key: buildKey, - onRequest: !!onRequest - }; - if (port !== void 0) request2.port = port; - if (host !== void 0) request2.host = host; - if (servedir !== void 0) request2.servedir = servedir; - if (keyfile !== void 0) request2.keyfile = keyfile; - if (certfile !== void 0) request2.certfile = certfile; - if (fallback !== void 0) request2.fallback = fallback; - sendRequest(refs, request2, (error2, response2) => { - if (error2) return reject(new Error(error2)); - if (onRequest) { - requestCallbacks["serve-request"] = (id, request3) => { - onRequest(request3.args); - sendResponse(id, {}); - }; - } - resolve2(response2); - }); - }), - cancel: () => new Promise((resolve2) => { - if (didDispose) return resolve2(); - const request2 = { - command: "cancel", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve2(); - }); - }), - dispose: () => new Promise((resolve2) => { - if (didDispose) return resolve2(); - didDispose = true; - const request2 = { - command: "dispose", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve2(); - scheduleOnDisposeCallbacks(); - refs.unref(); - }); - }) - }; - refs.ref(); - callback(null, result); - }); - } - } - var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { - let onStartCallbacks = []; - let onEndCallbacks = []; - let onResolveCallbacks = {}; - let onLoadCallbacks = {}; - let onDisposeCallbacks = []; - let nextCallbackID = 0; - let i = 0; - let requestPlugins = []; - let isSetupDone = false; - plugins = [...plugins]; - for (let item of plugins) { - let keys = {}; - if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); - const name = getFlag(item, keys, "name", mustBeString); - if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); - try { - let setup = getFlag(item, keys, "setup", mustBeFunction); - if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); - checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); - let plugin = { - name, - onStart: false, - onEnd: false, - onResolve: [], - onLoad: [] - }; - i++; - let resolve2 = (path3, options = {}) => { - if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); - if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); - let keys2 = /* @__PURE__ */ Object.create(null); - let pluginName = getFlag(options, keys2, "pluginName", mustBeString); - let importer = getFlag(options, keys2, "importer", mustBeString); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); - let kind = getFlag(options, keys2, "kind", mustBeString); - let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); - let importAttributes = getFlag(options, keys2, "with", mustBeObject); - checkForInvalidFlags(options, keys2, "in resolve() call"); - return new Promise((resolve22, reject) => { - const request = { - command: "resolve", - path: path3, - key: buildKey, - pluginName: name - }; - if (pluginName != null) request.pluginName = pluginName; - if (importer != null) request.importer = importer; - if (namespace != null) request.namespace = namespace; - if (resolveDir != null) request.resolveDir = resolveDir; - if (kind != null) request.kind = kind; - else throw new Error(`Must specify "kind" when calling "resolve"`); - if (pluginData != null) request.pluginData = details.store(pluginData); - if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); - sendRequest(refs, request, (error, response) => { - if (error !== null) reject(new Error(error)); - else resolve22({ - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - path: response.path, - external: response.external, - sideEffects: response.sideEffects, - namespace: response.namespace, - suffix: response.suffix, - pluginData: details.load(response.pluginData) - }); - }); - }); - }; - let promise = setup({ - initialOptions, - resolve: resolve2, - onStart(callback) { - let registeredText = `This error came from the "onStart" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); - onStartCallbacks.push({ name, callback, note: registeredNote }); - plugin.onStart = true; - }, - onEnd(callback) { - let registeredText = `This error came from the "onEnd" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); - onEndCallbacks.push({ name, callback, note: registeredNote }); - plugin.onEnd = true; - }, - onResolve(options, callback) { - let registeredText = `This error came from the "onResolve" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onResolve() call is missing a filter`); - let id = nextCallbackID++; - onResolveCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onLoad(options, callback) { - let registeredText = `This error came from the "onLoad" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onLoad() call is missing a filter`); - let id = nextCallbackID++; - onLoadCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onDispose(callback) { - onDisposeCallbacks.push(callback); - }, - esbuild: streamIn.esbuild - }); - if (promise) await promise; - requestPlugins.push(plugin); - } catch (e) { - return { ok: false, error: e, pluginName: name }; - } - } - requestCallbacks["on-start"] = async (id, request) => { - details.clear(); - let response = { errors: [], warnings: [] }; - await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { - try { - let result = await callback(); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); - if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); - if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); - } - } catch (e) { - response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); - } - })); - sendResponse(id, response); - }; - requestCallbacks["on-resolve"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onResolveCallbacks[id2]); - let result = await callback({ - path: request.path, - importer: request.importer, - namespace: request.namespace, - resolveDir: request.resolveDir, - kind: request.kind, - pluginData: details.load(request.pluginData), - with: request.with - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let path3 = getFlag(result, keys, "path", mustBeString); - let namespace = getFlag(result, keys, "namespace", mustBeString); - let suffix = getFlag(result, keys, "suffix", mustBeString); - let external = getFlag(result, keys, "external", mustBeBoolean); - let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (path3 != null) response.path = path3; - if (namespace != null) response.namespace = namespace; - if (suffix != null) response.suffix = suffix; - if (external != null) response.external = external; - if (sideEffects != null) response.sideEffects = sideEffects; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - requestCallbacks["on-load"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onLoadCallbacks[id2]); - let result = await callback({ - path: request.path, - namespace: request.namespace, - suffix: request.suffix, - pluginData: details.load(request.pluginData), - with: request.with - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let loader = getFlag(result, keys, "loader", mustBeString); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (contents instanceof Uint8Array) response.contents = contents; - else if (contents != null) response.contents = encodeUTF8(contents); - if (resolveDir != null) response.resolveDir = resolveDir; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (loader != null) response.loader = loader; - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - let runOnEndCallbacks = (result, done) => done([], []); - if (onEndCallbacks.length > 0) { - runOnEndCallbacks = (result, done) => { - (async () => { - const onEndErrors = []; - const onEndWarnings = []; - for (const { name, callback, note } of onEndCallbacks) { - let newErrors; - let newWarnings; - try { - const value = await callback(result); - if (value != null) { - if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(value, keys, "errors", mustBeArray); - let warnings = getFlag(value, keys, "warnings", mustBeArray); - checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); - if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - } - } catch (e) { - newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; - } - if (newErrors) { - onEndErrors.push(...newErrors); - try { - result.errors.push(...newErrors); - } catch { - } - } - if (newWarnings) { - onEndWarnings.push(...newWarnings); - try { - result.warnings.push(...newWarnings); - } catch { - } - } - } - done(onEndErrors, onEndWarnings); - })(); - }; - } - let scheduleOnDisposeCallbacks = () => { - for (const cb of onDisposeCallbacks) { - setTimeout(() => cb(), 0); - } - }; - isSetupDone = true; - return { - ok: true, - requestPlugins, - runOnEndCallbacks, - scheduleOnDisposeCallbacks - }; - }; - function createObjectStash() { - const map = /* @__PURE__ */ new Map(); - let nextID = 0; - return { - clear() { - map.clear(); - }, - load(id) { - return map.get(id); - }, - store(value) { - if (value === void 0) return -1; - const id = nextID++; - map.set(id, value); - return id; - } - }; - } - function extractCallerV8(e, streamIn, ident) { - let note; - let tried = false; - return () => { - if (tried) return note; - tried = true; - try { - let lines = (e.stack + "").split("\n"); - lines.splice(1, 1); - let location = parseStackLinesV8(streamIn, lines, ident); - if (location) { - note = { text: e.message, location }; - return note; - } - } catch { - } - }; - } - function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { - let text = "Internal error"; - let location = null; - try { - text = (e && e.message || e) + ""; - } catch { - } - try { - location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); - } catch { - } - return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; - } - function parseStackLinesV8(streamIn, lines, ident) { - let at = " at "; - if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { - for (let i = 1; i < lines.length; i++) { - let line = lines[i]; - if (!line.startsWith(at)) continue; - line = line.slice(at.length); - while (true) { - let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^(\S+):(\d+):(\d+)$/.exec(line); - if (match) { - let contents; - try { - contents = streamIn.readFileSync(match[1], "utf8"); - } catch { - break; - } - let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; - let column = +match[3] - 1; - let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; - return { - file: match[1], - namespace: "file", - line: +match[2], - column: encodeUTF8(lineText.slice(0, column)).length, - length: encodeUTF8(lineText.slice(column, column + length)).length, - lineText: lineText + "\n" + lines.slice(1).join("\n"), - suggestion: "" - }; - } - break; - } - } - } - return null; - } - function failureErrorWithLog(text, errors, warnings) { - let limit = 5; - text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { - if (i === limit) return "\n..."; - if (!e.location) return ` -error: ${e.text}`; - let { file, line, column } = e.location; - let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; - return ` -${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; - }).join(""); - let error = new Error(text); - for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { - Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - get: () => value, - set: (value2) => Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - value: value2 - }) - }); - } - return error; - } - function replaceDetailsInMessages(messages, stash) { - for (const message of messages) { - message.detail = stash.load(message.detail); - } - return messages; - } - function sanitizeLocation(location, where, terminalWidth) { - if (location == null) return null; - let keys = {}; - let file = getFlag(location, keys, "file", mustBeString); - let namespace = getFlag(location, keys, "namespace", mustBeString); - let line = getFlag(location, keys, "line", mustBeInteger); - let column = getFlag(location, keys, "column", mustBeInteger); - let length = getFlag(location, keys, "length", mustBeInteger); - let lineText = getFlag(location, keys, "lineText", mustBeString); - let suggestion = getFlag(location, keys, "suggestion", mustBeString); - checkForInvalidFlags(location, keys, where); - if (lineText) { - const relevantASCII = lineText.slice( - 0, - (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) - ); - if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { - lineText = relevantASCII; - } - } - return { - file: file || "", - namespace: namespace || "", - line: line || 0, - column: column || 0, - length: length || 0, - lineText: lineText || "", - suggestion: suggestion || "" - }; - } - function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { - let messagesClone = []; - let index = 0; - for (const message of messages) { - let keys = {}; - let id = getFlag(message, keys, "id", mustBeString); - let pluginName = getFlag(message, keys, "pluginName", mustBeString); - let text = getFlag(message, keys, "text", mustBeString); - let location = getFlag(message, keys, "location", mustBeObjectOrNull); - let notes = getFlag(message, keys, "notes", mustBeArray); - let detail = getFlag(message, keys, "detail", canBeAnything); - let where = `in element ${index} of "${property}"`; - checkForInvalidFlags(message, keys, where); - let notesClone = []; - if (notes) { - for (const note of notes) { - let noteKeys = {}; - let noteText = getFlag(note, noteKeys, "text", mustBeString); - let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); - checkForInvalidFlags(note, noteKeys, where); - notesClone.push({ - text: noteText || "", - location: sanitizeLocation(noteLocation, where, terminalWidth) - }); - } - } - messagesClone.push({ - id: id || "", - pluginName: pluginName || fallbackPluginName, - text: text || "", - location: sanitizeLocation(location, where, terminalWidth), - notes: notesClone, - detail: stash ? stash.store(detail) : -1 - }); - index++; - } - return messagesClone; - } - function sanitizeStringArray(values, property) { - const result = []; - for (const value of values) { - if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); - result.push(value); - } - return result; - } - function sanitizeStringMap(map, property) { - const result = /* @__PURE__ */ Object.create(null); - for (const key in map) { - const value = map[key]; - if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); - result[key] = value; - } - return result; - } - function convertOutputFiles({ path: path3, contents, hash }) { - let text = null; - return { - path: path3, - contents, - hash, - get text() { - const binary = this.contents; - if (text === null || binary !== contents) { - contents = binary; - text = decodeUTF8(binary); - } - return text; - } - }; - } - var fs2 = require("fs"); - var os2 = require("os"); - var path2 = require("path"); - var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; - var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; - var packageDarwin_arm64 = "@esbuild/darwin-arm64"; - var packageDarwin_x64 = "@esbuild/darwin-x64"; - var knownWindowsPackages = { - "win32 arm64 LE": "@esbuild/win32-arm64", - "win32 ia32 LE": "@esbuild/win32-ia32", - "win32 x64 LE": "@esbuild/win32-x64" - }; - var knownUnixlikePackages = { - "aix ppc64 BE": "@esbuild/aix-ppc64", - "android arm64 LE": "@esbuild/android-arm64", - "darwin arm64 LE": "@esbuild/darwin-arm64", - "darwin x64 LE": "@esbuild/darwin-x64", - "freebsd arm64 LE": "@esbuild/freebsd-arm64", - "freebsd x64 LE": "@esbuild/freebsd-x64", - "linux arm LE": "@esbuild/linux-arm", - "linux arm64 LE": "@esbuild/linux-arm64", - "linux ia32 LE": "@esbuild/linux-ia32", - "linux mips64el LE": "@esbuild/linux-mips64el", - "linux ppc64 LE": "@esbuild/linux-ppc64", - "linux riscv64 LE": "@esbuild/linux-riscv64", - "linux s390x BE": "@esbuild/linux-s390x", - "linux x64 LE": "@esbuild/linux-x64", - "linux loong64 LE": "@esbuild/linux-loong64", - "netbsd arm64 LE": "@esbuild/netbsd-arm64", - "netbsd x64 LE": "@esbuild/netbsd-x64", - "openbsd arm64 LE": "@esbuild/openbsd-arm64", - "openbsd x64 LE": "@esbuild/openbsd-x64", - "sunos x64 LE": "@esbuild/sunos-x64" - }; - var knownWebAssemblyFallbackPackages = { - "android arm LE": "@esbuild/android-arm", - "android x64 LE": "@esbuild/android-x64" - }; - function pkgAndSubpathForCurrentPlatform() { - let pkg; - let subpath; - let isWASM = false; - let platformKey = `${process.platform} ${os2.arch()} ${os2.endianness()}`; - if (platformKey in knownWindowsPackages) { - pkg = knownWindowsPackages[platformKey]; - subpath = "esbuild.exe"; - } else if (platformKey in knownUnixlikePackages) { - pkg = knownUnixlikePackages[platformKey]; - subpath = "bin/esbuild"; - } else if (platformKey in knownWebAssemblyFallbackPackages) { - pkg = knownWebAssemblyFallbackPackages[platformKey]; - subpath = "bin/esbuild"; - isWASM = true; - } else { - throw new Error(`Unsupported platform: ${platformKey}`); - } - return { pkg, subpath, isWASM }; - } - function pkgForSomeOtherPlatform() { - const libMainJS = require.resolve("esbuild"); - const nodeModulesDirectory = path2.dirname(path2.dirname(path2.dirname(libMainJS))); - if (path2.basename(nodeModulesDirectory) === "node_modules") { - for (const unixKey in knownUnixlikePackages) { - try { - const pkg = knownUnixlikePackages[unixKey]; - if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - for (const windowsKey in knownWindowsPackages) { - try { - const pkg = knownWindowsPackages[windowsKey]; - if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - } - return null; - } - function downloadedBinPath(pkg, subpath) { - const esbuildLibDir = path2.dirname(require.resolve("esbuild")); - return path2.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path2.basename(subpath)}`); - } - function generateBinPath() { - if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { - if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { - console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); - } else { - return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; - } - } - const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); - let binPath; - try { - binPath = require.resolve(`${pkg}/${subpath}`); - } catch (e) { - binPath = downloadedBinPath(pkg, subpath); - if (!fs2.existsSync(binPath)) { - try { - require.resolve(pkg); - } catch { - const otherPkg = pkgForSomeOtherPlatform(); - if (otherPkg) { - let suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild on Windows or macOS and copying "node_modules" -into a Docker image that runs Linux, or by copying "node_modules" between -Windows and WSL environments. - -If you are installing with npm, you can try not copying the "node_modules" -directory when you copy the files over, and running "npm ci" or "npm install" -on the destination platform after the copy. Or you could consider using yarn -instead of npm which has built-in support for installing a package on multiple -platforms simultaneously. - -If you are installing with yarn, you can try listing both this platform and the -other platform in your ".yarnrc.yml" file using the "supportedArchitectures" -feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { - suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild with npm running inside of Rosetta 2 and then -trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta -2 is Apple's on-the-fly x86_64-to-arm64 translation service). - -If you are installing with npm, you can try ensuring that both npm and node are -not running under Rosetta 2 and then reinstalling esbuild. This likely involves -changing how you installed npm and/or node. For example, installing node with -the universal installer here should work: https://nodejs.org/en/download/. Or -you could consider using yarn instead of npm which has built-in support for -installing a package on multiple platforms simultaneously. - -If you are installing with yarn, you can try listing both "arm64" and "x64" -in your ".yarnrc.yml" file using the "supportedArchitectures" feature: -https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - } - throw new Error(` -You installed esbuild for another platform than the one you're currently using. -This won't work because esbuild is written with native code and needs to -install a platform-specific binary executable. -${suggestions} -Another alternative is to use the "esbuild-wasm" package instead, which works -the same way on all platforms. But it comes with a heavy performance cost and -can sometimes be 10x slower than the "esbuild" package, so you may also not -want to do that. -`); - } - throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. - -If you are installing esbuild with npm, make sure that you don't specify the -"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature -of "package.json" is used by esbuild to install the correct binary executable -for your current platform.`); - } - throw e; - } - } - if (/\.zip\//.test(binPath)) { - let pnpapi; - try { - pnpapi = require("pnpapi"); - } catch (e) { - } - if (pnpapi) { - const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; - const binTargetPath = path2.join( - root, - "node_modules", - ".cache", - "esbuild", - `pnpapi-${pkg.replace("/", "-")}-${"0.24.2"}-${path2.basename(subpath)}` - ); - if (!fs2.existsSync(binTargetPath)) { - fs2.mkdirSync(path2.dirname(binTargetPath), { recursive: true }); - fs2.copyFileSync(binPath, binTargetPath); - fs2.chmodSync(binTargetPath, 493); - } - return { binPath: binTargetPath, isWASM }; - } - } - return { binPath, isWASM }; - } - var child_process = require("child_process"); - var crypto = require("crypto"); - var path22 = require("path"); - var fs22 = require("fs"); - var os22 = require("os"); - var tty = require("tty"); - var worker_threads; - if (process.env.ESBUILD_WORKER_THREADS !== "0") { - try { - worker_threads = require("worker_threads"); - } catch { - } - let [major, minor] = process.versions.node.split("."); - if ( - // { - if ((!ESBUILD_BINARY_PATH || false) && (path22.basename(__filename) !== "main.js" || path22.basename(__dirname) !== "lib")) { - throw new Error( - `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. - -More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` - ); - } - if (false) { - return ["node", [path22.join(__dirname, "..", "bin", "esbuild")]]; - } else { - const { binPath, isWASM } = generateBinPath(); - if (isWASM) { - return ["node", [binPath]]; - } else { - return [binPath, []]; - } - } - }; - var isTTY = () => tty.isatty(2); - var fsSync = { - readFile(tempFile, callback) { - try { - let contents = fs22.readFileSync(tempFile, "utf8"); - try { - fs22.unlinkSync(tempFile); - } catch { - } - callback(null, contents); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs22.writeFileSync(tempFile, contents); - callback(tempFile); - } catch { - callback(null); - } - } - }; - var fsAsync = { - readFile(tempFile, callback) { - try { - fs22.readFile(tempFile, "utf8", (err, contents) => { - try { - fs22.unlink(tempFile, () => callback(err, contents)); - } catch { - callback(err, contents); - } - }); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs22.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); - } catch { - callback(null); - } - } - }; - var version = "0.24.2"; - var build2 = (options) => ensureServiceIsRunning().build(options); - var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); - var transform = (input, options) => ensureServiceIsRunning().transform(input, options); - var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); - var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); - var buildSync = (options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.buildSync(options); - } - let result; - runServiceSync((service) => service.buildOrContext({ - callName: "buildSync", - refs: null, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var transformSync = (input, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.transformSync(input, options); - } - let result; - runServiceSync((service) => service.transform({ - callName: "transformSync", - refs: null, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsSync, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var formatMessagesSync = (messages, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.formatMessagesSync(messages, options); - } - let result; - runServiceSync((service) => service.formatMessages({ - callName: "formatMessagesSync", - refs: null, - messages, - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var analyzeMetafileSync = (metafile, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.analyzeMetafileSync(metafile, options); - } - let result; - runServiceSync((service) => service.analyzeMetafile({ - callName: "analyzeMetafileSync", - refs: null, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var stop = () => { - if (stopService) stopService(); - if (workerThreadService) workerThreadService.stop(); - return Promise.resolve(); - }; - var initializeWasCalled = false; - var initialize = (options) => { - options = validateInitializeOptions(options || {}); - if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); - if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); - if (options.worker) throw new Error(`The "worker" option only works in the browser`); - if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); - ensureServiceIsRunning(); - initializeWasCalled = true; - return Promise.resolve(); - }; - var defaultWD = process.cwd(); - var longLivedService; - var stopService; - var ensureServiceIsRunning = () => { - if (longLivedService) return longLivedService; - let [command, args] = esbuildCommandAndArgs(); - let child = child_process.spawn(command, args.concat(`--service=${"0.24.2"}`, "--ping"), { - windowsHide: true, - stdio: ["pipe", "pipe", "inherit"], - cwd: defaultWD - }); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - child.stdin.write(bytes, (err) => { - if (err) afterClose(err); - }); - }, - readFileSync: fs22.readFileSync, - isSync: false, - hasFS: true, - esbuild: node_exports - }); - child.stdin.on("error", afterClose); - child.on("error", afterClose); - const stdin = child.stdin; - const stdout = child.stdout; - stdout.on("data", readFromStdout); - stdout.on("end", afterClose); - stopService = () => { - stdin.destroy(); - stdout.destroy(); - child.kill(); - initializeWasCalled = false; - longLivedService = void 0; - stopService = void 0; - }; - let refCount = 0; - child.unref(); - if (stdin.unref) { - stdin.unref(); - } - if (stdout.unref) { - stdout.unref(); - } - const refs = { - ref() { - if (++refCount === 1) child.ref(); - }, - unref() { - if (--refCount === 0) child.unref(); - } - }; - longLivedService = { - build: (options) => new Promise((resolve2, reject) => { - service.buildOrContext({ - callName: "build", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve2(res) - }); - }), - context: (options) => new Promise((resolve2, reject) => service.buildOrContext({ - callName: "context", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - transform: (input, options) => new Promise((resolve2, reject) => service.transform({ - callName: "transform", - refs, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsAsync, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - formatMessages: (messages, options) => new Promise((resolve2, reject) => service.formatMessages({ - callName: "formatMessages", - refs, - messages, - options, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - analyzeMetafile: (metafile, options) => new Promise((resolve2, reject) => service.analyzeMetafile({ - callName: "analyzeMetafile", - refs, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => err ? reject(err) : resolve2(res) - })) - }; - return longLivedService; - }; - var runServiceSync = (callback) => { - let [command, args] = esbuildCommandAndArgs(); - let stdin = new Uint8Array(); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - if (stdin.length !== 0) throw new Error("Must run at most one command"); - stdin = bytes; - }, - isSync: true, - hasFS: true, - esbuild: node_exports - }); - callback(service); - let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.2"}`), { - cwd: defaultWD, - windowsHide: true, - input: stdin, - // We don't know how large the output could be. If it's too large, the - // command will fail with ENOBUFS. Reserve 16mb for now since that feels - // like it should be enough. Also allow overriding this with an environment - // variable. - maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 - }); - readFromStdout(stdout); - afterClose(null); - }; - var randomFileName = () => { - return path22.join(os22.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); - }; - var workerThreadService = null; - var startWorkerThreadService = (worker_threads2) => { - let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); - let worker = new worker_threads2.Worker(__filename, { - workerData: { workerPort, defaultWD, esbuildVersion: "0.24.2" }, - transferList: [workerPort], - // From node's documentation: https://nodejs.org/api/worker_threads.html - // - // Take care when launching worker threads from preload scripts (scripts loaded - // and run using the `-r` command line flag). Unless the `execArgv` option is - // explicitly set, new Worker threads automatically inherit the command line flags - // from the running process and will preload the same preload scripts as the main - // thread. If the preload script unconditionally launches a worker thread, every - // thread spawned will spawn another until the application crashes. - // - execArgv: [] - }); - let nextID = 0; - let fakeBuildError = (text) => { - let error = new Error(`Build failed with 1 error: -error: ${text}`); - let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; - error.errors = errors; - error.warnings = []; - return error; - }; - let validateBuildSyncOptions = (options) => { - if (!options) return; - let plugins = options.plugins; - if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); - }; - let applyProperties = (object, properties) => { - for (let key in properties) { - object[key] = properties[key]; - } - }; - let runCallSync = (command, args) => { - let id = nextID++; - let sharedBuffer = new SharedArrayBuffer(8); - let sharedBufferView = new Int32Array(sharedBuffer); - let msg = { sharedBuffer, id, command, args }; - worker.postMessage(msg); - let status = Atomics.wait(sharedBufferView, 0, 0); - if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); - let { message: { id: id2, resolve: resolve2, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); - if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); - if (reject) { - applyProperties(reject, properties); - throw reject; - } - return resolve2; - }; - worker.unref(); - return { - buildSync(options) { - validateBuildSyncOptions(options); - return runCallSync("build", [options]); - }, - transformSync(input, options) { - return runCallSync("transform", [input, options]); - }, - formatMessagesSync(messages, options) { - return runCallSync("formatMessages", [messages, options]); - }, - analyzeMetafileSync(metafile, options) { - return runCallSync("analyzeMetafile", [metafile, options]); - }, - stop() { - worker.terminate(); - workerThreadService = null; - } - }; - }; - var startSyncServiceWorker = () => { - let workerPort = worker_threads.workerData.workerPort; - let parentPort = worker_threads.parentPort; - let extractProperties = (object) => { - let properties = {}; - if (object && typeof object === "object") { - for (let key in object) { - properties[key] = object[key]; - } - } - return properties; - }; - try { - let service = ensureServiceIsRunning(); - defaultWD = worker_threads.workerData.defaultWD; - parentPort.on("message", (msg) => { - (async () => { - let { sharedBuffer, id, command, args } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - try { - switch (command) { - case "build": - workerPort.postMessage({ id, resolve: await service.build(args[0]) }); - break; - case "transform": - workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); - break; - case "formatMessages": - workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); - break; - case "analyzeMetafile": - workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); - break; - default: - throw new Error(`Invalid command: ${command}`); - } - } catch (reject) { - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - } - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - })(); - }); - } catch (reject) { - parentPort.on("message", (msg) => { - let { sharedBuffer, id } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - }); - } - }; - if (isInternalWorkerThread) { - startSyncServiceWorker(); - } - var node_default = node_exports; - } -}); - -// node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js -var require_delayed_stream = __commonJS({ - "node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) { - var Stream = require("stream").Stream; - var util = require("util"); - module2.exports = DelayedStream; - function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; - } - util.inherits(DelayedStream, Stream); - DelayedStream.create = function(source, options) { - var delayedStream = new this(); - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - delayedStream.source = source; - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - source.on("error", function() { - }); - if (delayedStream.pauseStream) { - source.pause(); - } - return delayedStream; - }; - Object.defineProperty(DelayedStream.prototype, "readable", { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } - }); - DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); - }; - DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - this.source.resume(); - }; - DelayedStream.prototype.pause = function() { - this.source.pause(); - }; - DelayedStream.prototype.release = function() { - this._released = true; - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; - }; - DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; - }; - DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - if (args[0] === "data") { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - this._bufferedEvents.push(args); - }; - DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - if (this.dataSize <= this.maxDataSize) { - return; - } - this._maxDataSizeExceeded = true; - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this.emit("error", new Error(message)); - }; - } -}); - -// node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js -var require_combined_stream = __commonJS({ - "node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) { - var util = require("util"); - var Stream = require("stream").Stream; - var DelayedStream = require_delayed_stream(); - module2.exports = CombinedStream; - function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; - } - util.inherits(CombinedStream, Stream); - CombinedStream.create = function(options) { - var combinedStream = new this(); - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - return combinedStream; - }; - CombinedStream.isStreamLike = function(stream) { - return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); - }; - CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams - }); - stream.on("data", this._checkDataSize.bind(this)); - stream = newStream; - } - this._handleErrors(stream); - if (this.pauseStreams) { - stream.pause(); - } - } - this._streams.push(stream); - return this; - }; - CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; - }; - CombinedStream.prototype._getNext = function() { - this._currentStream = null; - if (this._insideLoop) { - this._pendingNext = true; - return; - } - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } - }; - CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - if (typeof stream == "undefined") { - this.end(); - return; - } - if (typeof stream !== "function") { - this._pipeNext(stream); - return; - } - var getStream = stream; - getStream(function(stream2) { - var isStreamLike = CombinedStream.isStreamLike(stream2); - if (isStreamLike) { - stream2.on("data", this._checkDataSize.bind(this)); - this._handleErrors(stream2); - } - this._pipeNext(stream2); - }.bind(this)); - }; - CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on("end", this._getNext.bind(this)); - stream.pipe(this, { end: false }); - return; - } - var value = stream; - this.write(value); - this._getNext(); - }; - CombinedStream.prototype._handleErrors = function(stream) { - var self2 = this; - stream.on("error", function(err) { - self2._emitError(err); - }); - }; - CombinedStream.prototype.write = function(data) { - this.emit("data", data); - }; - CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); - this.emit("pause"); - }; - CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); - this.emit("resume"); - }; - CombinedStream.prototype.end = function() { - this._reset(); - this.emit("end"); - }; - CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit("close"); - }; - CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; - }; - CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this._emitError(new Error(message)); - }; - CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - var self2 = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - self2.dataSize += stream.dataSize; - }); - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } - }; - CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit("error", err); - }; - } -}); - -// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json -var require_db = __commonJS({ - "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports2, module2) { - module2.exports = { - "application/1d-interleaved-parityfec": { - source: "iana" - }, - "application/3gpdash-qoe-report+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/3gpp-ims+xml": { - source: "iana", - compressible: true - }, - "application/3gpphal+json": { - source: "iana", - compressible: true - }, - "application/3gpphalforms+json": { - source: "iana", - compressible: true - }, - "application/a2l": { - source: "iana" - }, - "application/ace+cbor": { - source: "iana" - }, - "application/activemessage": { - source: "iana" - }, - "application/activity+json": { - source: "iana", - compressible: true - }, - "application/alto-costmap+json": { - source: "iana", - compressible: true - }, - "application/alto-costmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-directory+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcost+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcostparams+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointprop+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointpropparams+json": { - source: "iana", - compressible: true - }, - "application/alto-error+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmap+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamcontrol+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamparams+json": { - source: "iana", - compressible: true - }, - "application/aml": { - source: "iana" - }, - "application/andrew-inset": { - source: "iana", - extensions: ["ez"] - }, - "application/applefile": { - source: "iana" - }, - "application/applixware": { - source: "apache", - extensions: ["aw"] - }, - "application/at+jwt": { - source: "iana" - }, - "application/atf": { - source: "iana" - }, - "application/atfx": { - source: "iana" - }, - "application/atom+xml": { - source: "iana", - compressible: true, - extensions: ["atom"] - }, - "application/atomcat+xml": { - source: "iana", - compressible: true, - extensions: ["atomcat"] - }, - "application/atomdeleted+xml": { - source: "iana", - compressible: true, - extensions: ["atomdeleted"] - }, - "application/atomicmail": { - source: "iana" - }, - "application/atomsvc+xml": { - source: "iana", - compressible: true, - extensions: ["atomsvc"] - }, - "application/atsc-dwd+xml": { - source: "iana", - compressible: true, - extensions: ["dwd"] - }, - "application/atsc-dynamic-event-message": { - source: "iana" - }, - "application/atsc-held+xml": { - source: "iana", - compressible: true, - extensions: ["held"] - }, - "application/atsc-rdt+json": { - source: "iana", - compressible: true - }, - "application/atsc-rsat+xml": { - source: "iana", - compressible: true, - extensions: ["rsat"] - }, - "application/atxml": { - source: "iana" - }, - "application/auth-policy+xml": { - source: "iana", - compressible: true - }, - "application/bacnet-xdd+zip": { - source: "iana", - compressible: false - }, - "application/batch-smtp": { - source: "iana" - }, - "application/bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/beep+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/calendar+json": { - source: "iana", - compressible: true - }, - "application/calendar+xml": { - source: "iana", - compressible: true, - extensions: ["xcs"] - }, - "application/call-completion": { - source: "iana" - }, - "application/cals-1840": { - source: "iana" - }, - "application/captive+json": { - source: "iana", - compressible: true - }, - "application/cbor": { - source: "iana" - }, - "application/cbor-seq": { - source: "iana" - }, - "application/cccex": { - source: "iana" - }, - "application/ccmp+xml": { - source: "iana", - compressible: true - }, - "application/ccxml+xml": { - source: "iana", - compressible: true, - extensions: ["ccxml"] - }, - "application/cdfx+xml": { - source: "iana", - compressible: true, - extensions: ["cdfx"] - }, - "application/cdmi-capability": { - source: "iana", - extensions: ["cdmia"] - }, - "application/cdmi-container": { - source: "iana", - extensions: ["cdmic"] - }, - "application/cdmi-domain": { - source: "iana", - extensions: ["cdmid"] - }, - "application/cdmi-object": { - source: "iana", - extensions: ["cdmio"] - }, - "application/cdmi-queue": { - source: "iana", - extensions: ["cdmiq"] - }, - "application/cdni": { - source: "iana" - }, - "application/cea": { - source: "iana" - }, - "application/cea-2018+xml": { - source: "iana", - compressible: true - }, - "application/cellml+xml": { - source: "iana", - compressible: true - }, - "application/cfw": { - source: "iana" - }, - "application/city+json": { - source: "iana", - compressible: true - }, - "application/clr": { - source: "iana" - }, - "application/clue+xml": { - source: "iana", - compressible: true - }, - "application/clue_info+xml": { - source: "iana", - compressible: true - }, - "application/cms": { - source: "iana" - }, - "application/cnrp+xml": { - source: "iana", - compressible: true - }, - "application/coap-group+json": { - source: "iana", - compressible: true - }, - "application/coap-payload": { - source: "iana" - }, - "application/commonground": { - source: "iana" - }, - "application/conference-info+xml": { - source: "iana", - compressible: true - }, - "application/cose": { - source: "iana" - }, - "application/cose-key": { - source: "iana" - }, - "application/cose-key-set": { - source: "iana" - }, - "application/cpl+xml": { - source: "iana", - compressible: true, - extensions: ["cpl"] - }, - "application/csrattrs": { - source: "iana" - }, - "application/csta+xml": { - source: "iana", - compressible: true - }, - "application/cstadata+xml": { - source: "iana", - compressible: true - }, - "application/csvm+json": { - source: "iana", - compressible: true - }, - "application/cu-seeme": { - source: "apache", - extensions: ["cu"] - }, - "application/cwt": { - source: "iana" - }, - "application/cybercash": { - source: "iana" - }, - "application/dart": { - compressible: true - }, - "application/dash+xml": { - source: "iana", - compressible: true, - extensions: ["mpd"] - }, - "application/dash-patch+xml": { - source: "iana", - compressible: true, - extensions: ["mpp"] - }, - "application/dashdelta": { - source: "iana" - }, - "application/davmount+xml": { - source: "iana", - compressible: true, - extensions: ["davmount"] - }, - "application/dca-rft": { - source: "iana" - }, - "application/dcd": { - source: "iana" - }, - "application/dec-dx": { - source: "iana" - }, - "application/dialog-info+xml": { - source: "iana", - compressible: true - }, - "application/dicom": { - source: "iana" - }, - "application/dicom+json": { - source: "iana", - compressible: true - }, - "application/dicom+xml": { - source: "iana", - compressible: true - }, - "application/dii": { - source: "iana" - }, - "application/dit": { - source: "iana" - }, - "application/dns": { - source: "iana" - }, - "application/dns+json": { - source: "iana", - compressible: true - }, - "application/dns-message": { - source: "iana" - }, - "application/docbook+xml": { - source: "apache", - compressible: true, - extensions: ["dbk"] - }, - "application/dots+cbor": { - source: "iana" - }, - "application/dskpp+xml": { - source: "iana", - compressible: true - }, - "application/dssc+der": { - source: "iana", - extensions: ["dssc"] - }, - "application/dssc+xml": { - source: "iana", - compressible: true, - extensions: ["xdssc"] - }, - "application/dvcs": { - source: "iana" - }, - "application/ecmascript": { - source: "iana", - compressible: true, - extensions: ["es", "ecma"] - }, - "application/edi-consent": { - source: "iana" - }, - "application/edi-x12": { - source: "iana", - compressible: false - }, - "application/edifact": { - source: "iana", - compressible: false - }, - "application/efi": { - source: "iana" - }, - "application/elm+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/elm+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.cap+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/emergencycalldata.comment+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.control+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.deviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.ecall.msd": { - source: "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.serviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.subscriberinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.veds+xml": { - source: "iana", - compressible: true - }, - "application/emma+xml": { - source: "iana", - compressible: true, - extensions: ["emma"] - }, - "application/emotionml+xml": { - source: "iana", - compressible: true, - extensions: ["emotionml"] - }, - "application/encaprtp": { - source: "iana" - }, - "application/epp+xml": { - source: "iana", - compressible: true - }, - "application/epub+zip": { - source: "iana", - compressible: false, - extensions: ["epub"] - }, - "application/eshop": { - source: "iana" - }, - "application/exi": { - source: "iana", - extensions: ["exi"] - }, - "application/expect-ct-report+json": { - source: "iana", - compressible: true - }, - "application/express": { - source: "iana", - extensions: ["exp"] - }, - "application/fastinfoset": { - source: "iana" - }, - "application/fastsoap": { - source: "iana" - }, - "application/fdt+xml": { - source: "iana", - compressible: true, - extensions: ["fdt"] - }, - "application/fhir+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fhir+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fido.trusted-apps+json": { - compressible: true - }, - "application/fits": { - source: "iana" - }, - "application/flexfec": { - source: "iana" - }, - "application/font-sfnt": { - source: "iana" - }, - "application/font-tdpfr": { - source: "iana", - extensions: ["pfr"] - }, - "application/font-woff": { - source: "iana", - compressible: false - }, - "application/framework-attributes+xml": { - source: "iana", - compressible: true - }, - "application/geo+json": { - source: "iana", - compressible: true, - extensions: ["geojson"] - }, - "application/geo+json-seq": { - source: "iana" - }, - "application/geopackage+sqlite3": { - source: "iana" - }, - "application/geoxacml+xml": { - source: "iana", - compressible: true - }, - "application/gltf-buffer": { - source: "iana" - }, - "application/gml+xml": { - source: "iana", - compressible: true, - extensions: ["gml"] - }, - "application/gpx+xml": { - source: "apache", - compressible: true, - extensions: ["gpx"] - }, - "application/gxf": { - source: "apache", - extensions: ["gxf"] - }, - "application/gzip": { - source: "iana", - compressible: false, - extensions: ["gz"] - }, - "application/h224": { - source: "iana" - }, - "application/held+xml": { - source: "iana", - compressible: true - }, - "application/hjson": { - extensions: ["hjson"] - }, - "application/http": { - source: "iana" - }, - "application/hyperstudio": { - source: "iana", - extensions: ["stk"] - }, - "application/ibe-key-request+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pkg-reply+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pp-data": { - source: "iana" - }, - "application/iges": { - source: "iana" - }, - "application/im-iscomposing+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/index": { - source: "iana" - }, - "application/index.cmd": { - source: "iana" - }, - "application/index.obj": { - source: "iana" - }, - "application/index.response": { - source: "iana" - }, - "application/index.vnd": { - source: "iana" - }, - "application/inkml+xml": { - source: "iana", - compressible: true, - extensions: ["ink", "inkml"] - }, - "application/iotp": { - source: "iana" - }, - "application/ipfix": { - source: "iana", - extensions: ["ipfix"] - }, - "application/ipp": { - source: "iana" - }, - "application/isup": { - source: "iana" - }, - "application/its+xml": { - source: "iana", - compressible: true, - extensions: ["its"] - }, - "application/java-archive": { - source: "apache", - compressible: false, - extensions: ["jar", "war", "ear"] - }, - "application/java-serialized-object": { - source: "apache", - compressible: false, - extensions: ["ser"] - }, - "application/java-vm": { - source: "apache", - compressible: false, - extensions: ["class"] - }, - "application/javascript": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["js", "mjs"] - }, - "application/jf2feed+json": { - source: "iana", - compressible: true - }, - "application/jose": { - source: "iana" - }, - "application/jose+json": { - source: "iana", - compressible: true - }, - "application/jrd+json": { - source: "iana", - compressible: true - }, - "application/jscalendar+json": { - source: "iana", - compressible: true - }, - "application/json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["json", "map"] - }, - "application/json-patch+json": { - source: "iana", - compressible: true - }, - "application/json-seq": { - source: "iana" - }, - "application/json5": { - extensions: ["json5"] - }, - "application/jsonml+json": { - source: "apache", - compressible: true, - extensions: ["jsonml"] - }, - "application/jwk+json": { - source: "iana", - compressible: true - }, - "application/jwk-set+json": { - source: "iana", - compressible: true - }, - "application/jwt": { - source: "iana" - }, - "application/kpml-request+xml": { - source: "iana", - compressible: true - }, - "application/kpml-response+xml": { - source: "iana", - compressible: true - }, - "application/ld+json": { - source: "iana", - compressible: true, - extensions: ["jsonld"] - }, - "application/lgr+xml": { - source: "iana", - compressible: true, - extensions: ["lgr"] - }, - "application/link-format": { - source: "iana" - }, - "application/load-control+xml": { - source: "iana", - compressible: true - }, - "application/lost+xml": { - source: "iana", - compressible: true, - extensions: ["lostxml"] - }, - "application/lostsync+xml": { - source: "iana", - compressible: true - }, - "application/lpf+zip": { - source: "iana", - compressible: false - }, - "application/lxf": { - source: "iana" - }, - "application/mac-binhex40": { - source: "iana", - extensions: ["hqx"] - }, - "application/mac-compactpro": { - source: "apache", - extensions: ["cpt"] - }, - "application/macwriteii": { - source: "iana" - }, - "application/mads+xml": { - source: "iana", - compressible: true, - extensions: ["mads"] - }, - "application/manifest+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["webmanifest"] - }, - "application/marc": { - source: "iana", - extensions: ["mrc"] - }, - "application/marcxml+xml": { - source: "iana", - compressible: true, - extensions: ["mrcx"] - }, - "application/mathematica": { - source: "iana", - extensions: ["ma", "nb", "mb"] - }, - "application/mathml+xml": { - source: "iana", - compressible: true, - extensions: ["mathml"] - }, - "application/mathml-content+xml": { - source: "iana", - compressible: true - }, - "application/mathml-presentation+xml": { - source: "iana", - compressible: true - }, - "application/mbms-associated-procedure-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-deregister+xml": { - source: "iana", - compressible: true - }, - "application/mbms-envelope+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-protection-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-reception-report+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-schedule+xml": { - source: "iana", - compressible: true - }, - "application/mbms-user-service-description+xml": { - source: "iana", - compressible: true - }, - "application/mbox": { - source: "iana", - extensions: ["mbox"] - }, - "application/media-policy-dataset+xml": { - source: "iana", - compressible: true, - extensions: ["mpf"] - }, - "application/media_control+xml": { - source: "iana", - compressible: true - }, - "application/mediaservercontrol+xml": { - source: "iana", - compressible: true, - extensions: ["mscml"] - }, - "application/merge-patch+json": { - source: "iana", - compressible: true - }, - "application/metalink+xml": { - source: "apache", - compressible: true, - extensions: ["metalink"] - }, - "application/metalink4+xml": { - source: "iana", - compressible: true, - extensions: ["meta4"] - }, - "application/mets+xml": { - source: "iana", - compressible: true, - extensions: ["mets"] - }, - "application/mf4": { - source: "iana" - }, - "application/mikey": { - source: "iana" - }, - "application/mipc": { - source: "iana" - }, - "application/missing-blocks+cbor-seq": { - source: "iana" - }, - "application/mmt-aei+xml": { - source: "iana", - compressible: true, - extensions: ["maei"] - }, - "application/mmt-usd+xml": { - source: "iana", - compressible: true, - extensions: ["musd"] - }, - "application/mods+xml": { - source: "iana", - compressible: true, - extensions: ["mods"] - }, - "application/moss-keys": { - source: "iana" - }, - "application/moss-signature": { - source: "iana" - }, - "application/mosskey-data": { - source: "iana" - }, - "application/mosskey-request": { - source: "iana" - }, - "application/mp21": { - source: "iana", - extensions: ["m21", "mp21"] - }, - "application/mp4": { - source: "iana", - extensions: ["mp4s", "m4p"] - }, - "application/mpeg4-generic": { - source: "iana" - }, - "application/mpeg4-iod": { - source: "iana" - }, - "application/mpeg4-iod-xmt": { - source: "iana" - }, - "application/mrb-consumer+xml": { - source: "iana", - compressible: true - }, - "application/mrb-publish+xml": { - source: "iana", - compressible: true - }, - "application/msc-ivr+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msc-mixer+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msword": { - source: "iana", - compressible: false, - extensions: ["doc", "dot"] - }, - "application/mud+json": { - source: "iana", - compressible: true - }, - "application/multipart-core": { - source: "iana" - }, - "application/mxf": { - source: "iana", - extensions: ["mxf"] - }, - "application/n-quads": { - source: "iana", - extensions: ["nq"] - }, - "application/n-triples": { - source: "iana", - extensions: ["nt"] - }, - "application/nasdata": { - source: "iana" - }, - "application/news-checkgroups": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-groupinfo": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-transmission": { - source: "iana" - }, - "application/nlsml+xml": { - source: "iana", - compressible: true - }, - "application/node": { - source: "iana", - extensions: ["cjs"] - }, - "application/nss": { - source: "iana" - }, - "application/oauth-authz-req+jwt": { - source: "iana" - }, - "application/oblivious-dns-message": { - source: "iana" - }, - "application/ocsp-request": { - source: "iana" - }, - "application/ocsp-response": { - source: "iana" - }, - "application/octet-stream": { - source: "iana", - compressible: false, - extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] - }, - "application/oda": { - source: "iana", - extensions: ["oda"] - }, - "application/odm+xml": { - source: "iana", - compressible: true - }, - "application/odx": { - source: "iana" - }, - "application/oebps-package+xml": { - source: "iana", - compressible: true, - extensions: ["opf"] - }, - "application/ogg": { - source: "iana", - compressible: false, - extensions: ["ogx"] - }, - "application/omdoc+xml": { - source: "apache", - compressible: true, - extensions: ["omdoc"] - }, - "application/onenote": { - source: "apache", - extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] - }, - "application/opc-nodeset+xml": { - source: "iana", - compressible: true - }, - "application/oscore": { - source: "iana" - }, - "application/oxps": { - source: "iana", - extensions: ["oxps"] - }, - "application/p21": { - source: "iana" - }, - "application/p21+zip": { - source: "iana", - compressible: false - }, - "application/p2p-overlay+xml": { - source: "iana", - compressible: true, - extensions: ["relo"] - }, - "application/parityfec": { - source: "iana" - }, - "application/passport": { - source: "iana" - }, - "application/patch-ops-error+xml": { - source: "iana", - compressible: true, - extensions: ["xer"] - }, - "application/pdf": { - source: "iana", - compressible: false, - extensions: ["pdf"] - }, - "application/pdx": { - source: "iana" - }, - "application/pem-certificate-chain": { - source: "iana" - }, - "application/pgp-encrypted": { - source: "iana", - compressible: false, - extensions: ["pgp"] - }, - "application/pgp-keys": { - source: "iana", - extensions: ["asc"] - }, - "application/pgp-signature": { - source: "iana", - extensions: ["asc", "sig"] - }, - "application/pics-rules": { - source: "apache", - extensions: ["prf"] - }, - "application/pidf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pidf-diff+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pkcs10": { - source: "iana", - extensions: ["p10"] - }, - "application/pkcs12": { - source: "iana" - }, - "application/pkcs7-mime": { - source: "iana", - extensions: ["p7m", "p7c"] - }, - "application/pkcs7-signature": { - source: "iana", - extensions: ["p7s"] - }, - "application/pkcs8": { - source: "iana", - extensions: ["p8"] - }, - "application/pkcs8-encrypted": { - source: "iana" - }, - "application/pkix-attr-cert": { - source: "iana", - extensions: ["ac"] - }, - "application/pkix-cert": { - source: "iana", - extensions: ["cer"] - }, - "application/pkix-crl": { - source: "iana", - extensions: ["crl"] - }, - "application/pkix-pkipath": { - source: "iana", - extensions: ["pkipath"] - }, - "application/pkixcmp": { - source: "iana", - extensions: ["pki"] - }, - "application/pls+xml": { - source: "iana", - compressible: true, - extensions: ["pls"] - }, - "application/poc-settings+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/postscript": { - source: "iana", - compressible: true, - extensions: ["ai", "eps", "ps"] - }, - "application/ppsp-tracker+json": { - source: "iana", - compressible: true - }, - "application/problem+json": { - source: "iana", - compressible: true - }, - "application/problem+xml": { - source: "iana", - compressible: true - }, - "application/provenance+xml": { - source: "iana", - compressible: true, - extensions: ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - source: "iana" - }, - "application/prs.cww": { - source: "iana", - extensions: ["cww"] - }, - "application/prs.cyn": { - source: "iana", - charset: "7-BIT" - }, - "application/prs.hpub+zip": { - source: "iana", - compressible: false - }, - "application/prs.nprend": { - source: "iana" - }, - "application/prs.plucker": { - source: "iana" - }, - "application/prs.rdf-xml-crypt": { - source: "iana" - }, - "application/prs.xsf+xml": { - source: "iana", - compressible: true - }, - "application/pskc+xml": { - source: "iana", - compressible: true, - extensions: ["pskcxml"] - }, - "application/pvd+json": { - source: "iana", - compressible: true - }, - "application/qsig": { - source: "iana" - }, - "application/raml+yaml": { - compressible: true, - extensions: ["raml"] - }, - "application/raptorfec": { - source: "iana" - }, - "application/rdap+json": { - source: "iana", - compressible: true - }, - "application/rdf+xml": { - source: "iana", - compressible: true, - extensions: ["rdf", "owl"] - }, - "application/reginfo+xml": { - source: "iana", - compressible: true, - extensions: ["rif"] - }, - "application/relax-ng-compact-syntax": { - source: "iana", - extensions: ["rnc"] - }, - "application/remote-printing": { - source: "iana" - }, - "application/reputon+json": { - source: "iana", - compressible: true - }, - "application/resource-lists+xml": { - source: "iana", - compressible: true, - extensions: ["rl"] - }, - "application/resource-lists-diff+xml": { - source: "iana", - compressible: true, - extensions: ["rld"] - }, - "application/rfc+xml": { - source: "iana", - compressible: true - }, - "application/riscos": { - source: "iana" - }, - "application/rlmi+xml": { - source: "iana", - compressible: true - }, - "application/rls-services+xml": { - source: "iana", - compressible: true, - extensions: ["rs"] - }, - "application/route-apd+xml": { - source: "iana", - compressible: true, - extensions: ["rapd"] - }, - "application/route-s-tsid+xml": { - source: "iana", - compressible: true, - extensions: ["sls"] - }, - "application/route-usd+xml": { - source: "iana", - compressible: true, - extensions: ["rusd"] - }, - "application/rpki-ghostbusters": { - source: "iana", - extensions: ["gbr"] - }, - "application/rpki-manifest": { - source: "iana", - extensions: ["mft"] - }, - "application/rpki-publication": { - source: "iana" - }, - "application/rpki-roa": { - source: "iana", - extensions: ["roa"] - }, - "application/rpki-updown": { - source: "iana" - }, - "application/rsd+xml": { - source: "apache", - compressible: true, - extensions: ["rsd"] - }, - "application/rss+xml": { - source: "apache", - compressible: true, - extensions: ["rss"] - }, - "application/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "application/rtploopback": { - source: "iana" - }, - "application/rtx": { - source: "iana" - }, - "application/samlassertion+xml": { - source: "iana", - compressible: true - }, - "application/samlmetadata+xml": { - source: "iana", - compressible: true - }, - "application/sarif+json": { - source: "iana", - compressible: true - }, - "application/sarif-external-properties+json": { - source: "iana", - compressible: true - }, - "application/sbe": { - source: "iana" - }, - "application/sbml+xml": { - source: "iana", - compressible: true, - extensions: ["sbml"] - }, - "application/scaip+xml": { - source: "iana", - compressible: true - }, - "application/scim+json": { - source: "iana", - compressible: true - }, - "application/scvp-cv-request": { - source: "iana", - extensions: ["scq"] - }, - "application/scvp-cv-response": { - source: "iana", - extensions: ["scs"] - }, - "application/scvp-vp-request": { - source: "iana", - extensions: ["spq"] - }, - "application/scvp-vp-response": { - source: "iana", - extensions: ["spp"] - }, - "application/sdp": { - source: "iana", - extensions: ["sdp"] - }, - "application/secevent+jwt": { - source: "iana" - }, - "application/senml+cbor": { - source: "iana" - }, - "application/senml+json": { - source: "iana", - compressible: true - }, - "application/senml+xml": { - source: "iana", - compressible: true, - extensions: ["senmlx"] - }, - "application/senml-etch+cbor": { - source: "iana" - }, - "application/senml-etch+json": { - source: "iana", - compressible: true - }, - "application/senml-exi": { - source: "iana" - }, - "application/sensml+cbor": { - source: "iana" - }, - "application/sensml+json": { - source: "iana", - compressible: true - }, - "application/sensml+xml": { - source: "iana", - compressible: true, - extensions: ["sensmlx"] - }, - "application/sensml-exi": { - source: "iana" - }, - "application/sep+xml": { - source: "iana", - compressible: true - }, - "application/sep-exi": { - source: "iana" - }, - "application/session-info": { - source: "iana" - }, - "application/set-payment": { - source: "iana" - }, - "application/set-payment-initiation": { - source: "iana", - extensions: ["setpay"] - }, - "application/set-registration": { - source: "iana" - }, - "application/set-registration-initiation": { - source: "iana", - extensions: ["setreg"] - }, - "application/sgml": { - source: "iana" - }, - "application/sgml-open-catalog": { - source: "iana" - }, - "application/shf+xml": { - source: "iana", - compressible: true, - extensions: ["shf"] - }, - "application/sieve": { - source: "iana", - extensions: ["siv", "sieve"] - }, - "application/simple-filter+xml": { - source: "iana", - compressible: true - }, - "application/simple-message-summary": { - source: "iana" - }, - "application/simplesymbolcontainer": { - source: "iana" - }, - "application/sipc": { - source: "iana" - }, - "application/slate": { - source: "iana" - }, - "application/smil": { - source: "iana" - }, - "application/smil+xml": { - source: "iana", - compressible: true, - extensions: ["smi", "smil"] - }, - "application/smpte336m": { - source: "iana" - }, - "application/soap+fastinfoset": { - source: "iana" - }, - "application/soap+xml": { - source: "iana", - compressible: true - }, - "application/sparql-query": { - source: "iana", - extensions: ["rq"] - }, - "application/sparql-results+xml": { - source: "iana", - compressible: true, - extensions: ["srx"] - }, - "application/spdx+json": { - source: "iana", - compressible: true - }, - "application/spirits-event+xml": { - source: "iana", - compressible: true - }, - "application/sql": { - source: "iana" - }, - "application/srgs": { - source: "iana", - extensions: ["gram"] - }, - "application/srgs+xml": { - source: "iana", - compressible: true, - extensions: ["grxml"] - }, - "application/sru+xml": { - source: "iana", - compressible: true, - extensions: ["sru"] - }, - "application/ssdl+xml": { - source: "apache", - compressible: true, - extensions: ["ssdl"] - }, - "application/ssml+xml": { - source: "iana", - compressible: true, - extensions: ["ssml"] - }, - "application/stix+json": { - source: "iana", - compressible: true - }, - "application/swid+xml": { - source: "iana", - compressible: true, - extensions: ["swidtag"] - }, - "application/tamp-apex-update": { - source: "iana" - }, - "application/tamp-apex-update-confirm": { - source: "iana" - }, - "application/tamp-community-update": { - source: "iana" - }, - "application/tamp-community-update-confirm": { - source: "iana" - }, - "application/tamp-error": { - source: "iana" - }, - "application/tamp-sequence-adjust": { - source: "iana" - }, - "application/tamp-sequence-adjust-confirm": { - source: "iana" - }, - "application/tamp-status-query": { - source: "iana" - }, - "application/tamp-status-response": { - source: "iana" - }, - "application/tamp-update": { - source: "iana" - }, - "application/tamp-update-confirm": { - source: "iana" - }, - "application/tar": { - compressible: true - }, - "application/taxii+json": { - source: "iana", - compressible: true - }, - "application/td+json": { - source: "iana", - compressible: true - }, - "application/tei+xml": { - source: "iana", - compressible: true, - extensions: ["tei", "teicorpus"] - }, - "application/tetra_isi": { - source: "iana" - }, - "application/thraud+xml": { - source: "iana", - compressible: true, - extensions: ["tfi"] - }, - "application/timestamp-query": { - source: "iana" - }, - "application/timestamp-reply": { - source: "iana" - }, - "application/timestamped-data": { - source: "iana", - extensions: ["tsd"] - }, - "application/tlsrpt+gzip": { - source: "iana" - }, - "application/tlsrpt+json": { - source: "iana", - compressible: true - }, - "application/tnauthlist": { - source: "iana" - }, - "application/token-introspection+jwt": { - source: "iana" - }, - "application/toml": { - compressible: true, - extensions: ["toml"] - }, - "application/trickle-ice-sdpfrag": { - source: "iana" - }, - "application/trig": { - source: "iana", - extensions: ["trig"] - }, - "application/ttml+xml": { - source: "iana", - compressible: true, - extensions: ["ttml"] - }, - "application/tve-trigger": { - source: "iana" - }, - "application/tzif": { - source: "iana" - }, - "application/tzif-leap": { - source: "iana" - }, - "application/ubjson": { - compressible: false, - extensions: ["ubj"] - }, - "application/ulpfec": { - source: "iana" - }, - "application/urc-grpsheet+xml": { - source: "iana", - compressible: true - }, - "application/urc-ressheet+xml": { - source: "iana", - compressible: true, - extensions: ["rsheet"] - }, - "application/urc-targetdesc+xml": { - source: "iana", - compressible: true, - extensions: ["td"] - }, - "application/urc-uisocketdesc+xml": { - source: "iana", - compressible: true - }, - "application/vcard+json": { - source: "iana", - compressible: true - }, - "application/vcard+xml": { - source: "iana", - compressible: true - }, - "application/vemmi": { - source: "iana" - }, - "application/vividence.scriptfile": { - source: "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - source: "iana", - compressible: true, - extensions: ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-v2x-local-service-information": { - source: "iana" - }, - "application/vnd.3gpp.5gnas": { - source: "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.bsf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gmop+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gtpc": { - source: "iana" - }, - "application/vnd.3gpp.interworking-data": { - source: "iana" - }, - "application/vnd.3gpp.lpp": { - source: "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-payload": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-signalling": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mid-call+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ngap": { - source: "iana" - }, - "application/vnd.3gpp.pfcp": { - source: "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - source: "iana", - extensions: ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - source: "iana", - extensions: ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - source: "iana", - extensions: ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - source: "iana" - }, - "application/vnd.3gpp.sms": { - source: "iana" - }, - "application/vnd.3gpp.sms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ussd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.sms": { - source: "iana" - }, - "application/vnd.3gpp2.tcap": { - source: "iana", - extensions: ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - source: "iana" - }, - "application/vnd.3m.post-it-notes": { - source: "iana", - extensions: ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - source: "iana", - extensions: ["aso"] - }, - "application/vnd.accpac.simply.imp": { - source: "iana", - extensions: ["imp"] - }, - "application/vnd.acucobol": { - source: "iana", - extensions: ["acu"] - }, - "application/vnd.acucorp": { - source: "iana", - extensions: ["atc", "acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - source: "apache", - compressible: false, - extensions: ["air"] - }, - "application/vnd.adobe.flash.movie": { - source: "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - source: "iana", - extensions: ["fcdt"] - }, - "application/vnd.adobe.fxp": { - source: "iana", - extensions: ["fxp", "fxpl"] - }, - "application/vnd.adobe.partial-upload": { - source: "iana" - }, - "application/vnd.adobe.xdp+xml": { - source: "iana", - compressible: true, - extensions: ["xdp"] - }, - "application/vnd.adobe.xfdf": { - source: "iana", - extensions: ["xfdf"] - }, - "application/vnd.aether.imp": { - source: "iana" - }, - "application/vnd.afpc.afplinedata": { - source: "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - source: "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - source: "iana" - }, - "application/vnd.afpc.foca-charset": { - source: "iana" - }, - "application/vnd.afpc.foca-codedfont": { - source: "iana" - }, - "application/vnd.afpc.foca-codepage": { - source: "iana" - }, - "application/vnd.afpc.modca": { - source: "iana" - }, - "application/vnd.afpc.modca-cmtable": { - source: "iana" - }, - "application/vnd.afpc.modca-formdef": { - source: "iana" - }, - "application/vnd.afpc.modca-mediummap": { - source: "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - source: "iana" - }, - "application/vnd.afpc.modca-overlay": { - source: "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - source: "iana" - }, - "application/vnd.age": { - source: "iana", - extensions: ["age"] - }, - "application/vnd.ah-barcode": { - source: "iana" - }, - "application/vnd.ahead.space": { - source: "iana", - extensions: ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - source: "iana", - extensions: ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - source: "iana", - extensions: ["azs"] - }, - "application/vnd.amadeus+json": { - source: "iana", - compressible: true - }, - "application/vnd.amazon.ebook": { - source: "apache", - extensions: ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - source: "iana" - }, - "application/vnd.americandynamics.acc": { - source: "iana", - extensions: ["acc"] - }, - "application/vnd.amiga.ami": { - source: "iana", - extensions: ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - source: "iana", - compressible: true - }, - "application/vnd.android.ota": { - source: "iana" - }, - "application/vnd.android.package-archive": { - source: "apache", - compressible: false, - extensions: ["apk"] - }, - "application/vnd.anki": { - source: "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - source: "iana", - extensions: ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - source: "apache", - extensions: ["fti"] - }, - "application/vnd.antix.game-component": { - source: "iana", - extensions: ["atx"] - }, - "application/vnd.apache.arrow.file": { - source: "iana" - }, - "application/vnd.apache.arrow.stream": { - source: "iana" - }, - "application/vnd.apache.thrift.binary": { - source: "iana" - }, - "application/vnd.apache.thrift.compact": { - source: "iana" - }, - "application/vnd.apache.thrift.json": { - source: "iana" - }, - "application/vnd.api+json": { - source: "iana", - compressible: true - }, - "application/vnd.aplextor.warrp+json": { - source: "iana", - compressible: true - }, - "application/vnd.apothekende.reservation+json": { - source: "iana", - compressible: true - }, - "application/vnd.apple.installer+xml": { - source: "iana", - compressible: true, - extensions: ["mpkg"] - }, - "application/vnd.apple.keynote": { - source: "iana", - extensions: ["key"] - }, - "application/vnd.apple.mpegurl": { - source: "iana", - extensions: ["m3u8"] - }, - "application/vnd.apple.numbers": { - source: "iana", - extensions: ["numbers"] - }, - "application/vnd.apple.pages": { - source: "iana", - extensions: ["pages"] - }, - "application/vnd.apple.pkpass": { - compressible: false, - extensions: ["pkpass"] - }, - "application/vnd.arastra.swi": { - source: "iana" - }, - "application/vnd.aristanetworks.swi": { - source: "iana", - extensions: ["swi"] - }, - "application/vnd.artisan+json": { - source: "iana", - compressible: true - }, - "application/vnd.artsquare": { - source: "iana" - }, - "application/vnd.astraea-software.iota": { - source: "iana", - extensions: ["iota"] - }, - "application/vnd.audiograph": { - source: "iana", - extensions: ["aep"] - }, - "application/vnd.autopackage": { - source: "iana" - }, - "application/vnd.avalon+json": { - source: "iana", - compressible: true - }, - "application/vnd.avistar+xml": { - source: "iana", - compressible: true - }, - "application/vnd.balsamiq.bmml+xml": { - source: "iana", - compressible: true, - extensions: ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - source: "iana" - }, - "application/vnd.banana-accounting": { - source: "iana" - }, - "application/vnd.bbf.usp.error": { - source: "iana" - }, - "application/vnd.bbf.usp.msg": { - source: "iana" - }, - "application/vnd.bbf.usp.msg+json": { - source: "iana", - compressible: true - }, - "application/vnd.bekitzur-stech+json": { - source: "iana", - compressible: true - }, - "application/vnd.bint.med-content": { - source: "iana" - }, - "application/vnd.biopax.rdf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.blink-idb-value-wrapper": { - source: "iana" - }, - "application/vnd.blueice.multipass": { - source: "iana", - extensions: ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - source: "iana" - }, - "application/vnd.bluetooth.le.oob": { - source: "iana" - }, - "application/vnd.bmi": { - source: "iana", - extensions: ["bmi"] - }, - "application/vnd.bpf": { - source: "iana" - }, - "application/vnd.bpf3": { - source: "iana" - }, - "application/vnd.businessobjects": { - source: "iana", - extensions: ["rep"] - }, - "application/vnd.byu.uapi+json": { - source: "iana", - compressible: true - }, - "application/vnd.cab-jscript": { - source: "iana" - }, - "application/vnd.canon-cpdl": { - source: "iana" - }, - "application/vnd.canon-lips": { - source: "iana" - }, - "application/vnd.capasystems-pg+json": { - source: "iana", - compressible: true - }, - "application/vnd.cendio.thinlinc.clientconf": { - source: "iana" - }, - "application/vnd.century-systems.tcp_stream": { - source: "iana" - }, - "application/vnd.chemdraw+xml": { - source: "iana", - compressible: true, - extensions: ["cdxml"] - }, - "application/vnd.chess-pgn": { - source: "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - source: "iana", - extensions: ["mmd"] - }, - "application/vnd.ciedi": { - source: "iana" - }, - "application/vnd.cinderella": { - source: "iana", - extensions: ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - source: "iana" - }, - "application/vnd.citationstyles.style+xml": { - source: "iana", - compressible: true, - extensions: ["csl"] - }, - "application/vnd.claymore": { - source: "iana", - extensions: ["cla"] - }, - "application/vnd.cloanto.rp9": { - source: "iana", - extensions: ["rp9"] - }, - "application/vnd.clonk.c4group": { - source: "iana", - extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - source: "iana", - extensions: ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - source: "iana", - extensions: ["c11amz"] - }, - "application/vnd.coffeescript": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - source: "iana" - }, - "application/vnd.collection+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.doc+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.next+json": { - source: "iana", - compressible: true - }, - "application/vnd.comicbook+zip": { - source: "iana", - compressible: false - }, - "application/vnd.comicbook-rar": { - source: "iana" - }, - "application/vnd.commerce-battelle": { - source: "iana" - }, - "application/vnd.commonspace": { - source: "iana", - extensions: ["csp"] - }, - "application/vnd.contact.cmsg": { - source: "iana", - extensions: ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - source: "iana", - compressible: true - }, - "application/vnd.cosmocaller": { - source: "iana", - extensions: ["cmc"] - }, - "application/vnd.crick.clicker": { - source: "iana", - extensions: ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - source: "iana", - extensions: ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - source: "iana", - extensions: ["clkp"] - }, - "application/vnd.crick.clicker.template": { - source: "iana", - extensions: ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - source: "iana", - extensions: ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - source: "iana", - compressible: true, - extensions: ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - source: "iana", - compressible: true - }, - "application/vnd.crypto-shade-file": { - source: "iana" - }, - "application/vnd.cryptomator.encrypted": { - source: "iana" - }, - "application/vnd.cryptomator.vault": { - source: "iana" - }, - "application/vnd.ctc-posml": { - source: "iana", - extensions: ["pml"] - }, - "application/vnd.ctct.ws+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cups-pdf": { - source: "iana" - }, - "application/vnd.cups-postscript": { - source: "iana" - }, - "application/vnd.cups-ppd": { - source: "iana", - extensions: ["ppd"] - }, - "application/vnd.cups-raster": { - source: "iana" - }, - "application/vnd.cups-raw": { - source: "iana" - }, - "application/vnd.curl": { - source: "iana" - }, - "application/vnd.curl.car": { - source: "apache", - extensions: ["car"] - }, - "application/vnd.curl.pcurl": { - source: "apache", - extensions: ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cybank": { - source: "iana" - }, - "application/vnd.cyclonedx+json": { - source: "iana", - compressible: true - }, - "application/vnd.cyclonedx+xml": { - source: "iana", - compressible: true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - source: "iana", - compressible: false - }, - "application/vnd.d3m-dataset": { - source: "iana" - }, - "application/vnd.d3m-problem": { - source: "iana" - }, - "application/vnd.dart": { - source: "iana", - compressible: true, - extensions: ["dart"] - }, - "application/vnd.data-vision.rdz": { - source: "iana", - extensions: ["rdz"] - }, - "application/vnd.datapackage+json": { - source: "iana", - compressible: true - }, - "application/vnd.dataresource+json": { - source: "iana", - compressible: true - }, - "application/vnd.dbf": { - source: "iana", - extensions: ["dbf"] - }, - "application/vnd.debian.binary-package": { - source: "iana" - }, - "application/vnd.dece.data": { - source: "iana", - extensions: ["uvf", "uvvf", "uvd", "uvvd"] - }, - "application/vnd.dece.ttml+xml": { - source: "iana", - compressible: true, - extensions: ["uvt", "uvvt"] - }, - "application/vnd.dece.unspecified": { - source: "iana", - extensions: ["uvx", "uvvx"] - }, - "application/vnd.dece.zip": { - source: "iana", - extensions: ["uvz", "uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - source: "iana", - extensions: ["fe_launch"] - }, - "application/vnd.desmume.movie": { - source: "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - source: "iana" - }, - "application/vnd.dm.delegation+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dna": { - source: "iana", - extensions: ["dna"] - }, - "application/vnd.document+json": { - source: "iana", - compressible: true - }, - "application/vnd.dolby.mlp": { - source: "apache", - extensions: ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - source: "iana" - }, - "application/vnd.dolby.mobile.2": { - source: "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - source: "iana" - }, - "application/vnd.dpgraph": { - source: "iana", - extensions: ["dpg"] - }, - "application/vnd.dreamfactory": { - source: "iana", - extensions: ["dfac"] - }, - "application/vnd.drive+json": { - source: "iana", - compressible: true - }, - "application/vnd.ds-keypoint": { - source: "apache", - extensions: ["kpxx"] - }, - "application/vnd.dtg.local": { - source: "iana" - }, - "application/vnd.dtg.local.flash": { - source: "iana" - }, - "application/vnd.dtg.local.html": { - source: "iana" - }, - "application/vnd.dvb.ait": { - source: "iana", - extensions: ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.dvbj": { - source: "iana" - }, - "application/vnd.dvb.esgcontainer": { - source: "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - source: "iana" - }, - "application/vnd.dvb.ipdcroaming": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - source: "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-container+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-generic+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-init+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.pfr": { - source: "iana" - }, - "application/vnd.dvb.service": { - source: "iana", - extensions: ["svc"] - }, - "application/vnd.dxr": { - source: "iana" - }, - "application/vnd.dynageo": { - source: "iana", - extensions: ["geo"] - }, - "application/vnd.dzr": { - source: "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - source: "iana" - }, - "application/vnd.ecdis-update": { - source: "iana" - }, - "application/vnd.ecip.rlp": { - source: "iana" - }, - "application/vnd.eclipse.ditto+json": { - source: "iana", - compressible: true - }, - "application/vnd.ecowin.chart": { - source: "iana", - extensions: ["mag"] - }, - "application/vnd.ecowin.filerequest": { - source: "iana" - }, - "application/vnd.ecowin.fileupdate": { - source: "iana" - }, - "application/vnd.ecowin.series": { - source: "iana" - }, - "application/vnd.ecowin.seriesrequest": { - source: "iana" - }, - "application/vnd.ecowin.seriesupdate": { - source: "iana" - }, - "application/vnd.efi.img": { - source: "iana" - }, - "application/vnd.efi.iso": { - source: "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - source: "iana", - compressible: true - }, - "application/vnd.enliven": { - source: "iana", - extensions: ["nml"] - }, - "application/vnd.enphase.envoy": { - source: "iana" - }, - "application/vnd.eprints.data+xml": { - source: "iana", - compressible: true - }, - "application/vnd.epson.esf": { - source: "iana", - extensions: ["esf"] - }, - "application/vnd.epson.msf": { - source: "iana", - extensions: ["msf"] - }, - "application/vnd.epson.quickanime": { - source: "iana", - extensions: ["qam"] - }, - "application/vnd.epson.salt": { - source: "iana", - extensions: ["slt"] - }, - "application/vnd.epson.ssf": { - source: "iana", - extensions: ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - source: "iana" - }, - "application/vnd.espass-espass+zip": { - source: "iana", - compressible: false - }, - "application/vnd.eszigno3+xml": { - source: "iana", - compressible: true, - extensions: ["es3", "et3"] - }, - "application/vnd.etsi.aoc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.asic-e+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.asic-s+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.cug+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvcommand+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvservice+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsync+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mcid+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mheg5": { - source: "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.pstn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.sci+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.simservs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.timestamp-token": { - source: "iana" - }, - "application/vnd.etsi.tsl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.tsl.der": { - source: "iana" - }, - "application/vnd.eu.kasparian.car+json": { - source: "iana", - compressible: true - }, - "application/vnd.eudora.data": { - source: "iana" - }, - "application/vnd.evolv.ecig.profile": { - source: "iana" - }, - "application/vnd.evolv.ecig.settings": { - source: "iana" - }, - "application/vnd.evolv.ecig.theme": { - source: "iana" - }, - "application/vnd.exstream-empower+zip": { - source: "iana", - compressible: false - }, - "application/vnd.exstream-package": { - source: "iana" - }, - "application/vnd.ezpix-album": { - source: "iana", - extensions: ["ez2"] - }, - "application/vnd.ezpix-package": { - source: "iana", - extensions: ["ez3"] - }, - "application/vnd.f-secure.mobile": { - source: "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - source: "iana", - compressible: false - }, - "application/vnd.fastcopy-disk-image": { - source: "iana" - }, - "application/vnd.fdf": { - source: "iana", - extensions: ["fdf"] - }, - "application/vnd.fdsn.mseed": { - source: "iana", - extensions: ["mseed"] - }, - "application/vnd.fdsn.seed": { - source: "iana", - extensions: ["seed", "dataless"] - }, - "application/vnd.ffsns": { - source: "iana" - }, - "application/vnd.ficlab.flb+zip": { - source: "iana", - compressible: false - }, - "application/vnd.filmit.zfc": { - source: "iana" - }, - "application/vnd.fints": { - source: "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - source: "iana" - }, - "application/vnd.flographit": { - source: "iana", - extensions: ["gph"] - }, - "application/vnd.fluxtime.clip": { - source: "iana", - extensions: ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - source: "iana" - }, - "application/vnd.framemaker": { - source: "iana", - extensions: ["fm", "frame", "maker", "book"] - }, - "application/vnd.frogans.fnc": { - source: "iana", - extensions: ["fnc"] - }, - "application/vnd.frogans.ltf": { - source: "iana", - extensions: ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - source: "iana", - extensions: ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - source: "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.fujitsu.oasys": { - source: "iana", - extensions: ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - source: "iana", - extensions: ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - source: "iana", - extensions: ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - source: "iana", - extensions: ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - source: "iana", - extensions: ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - source: "iana" - }, - "application/vnd.fujixerox.art4": { - source: "iana" - }, - "application/vnd.fujixerox.ddd": { - source: "iana", - extensions: ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - source: "iana", - extensions: ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - source: "iana", - extensions: ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - source: "iana" - }, - "application/vnd.fujixerox.hbpl": { - source: "iana" - }, - "application/vnd.fut-misnet": { - source: "iana" - }, - "application/vnd.futoin+cbor": { - source: "iana" - }, - "application/vnd.futoin+json": { - source: "iana", - compressible: true - }, - "application/vnd.fuzzysheet": { - source: "iana", - extensions: ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - source: "iana", - extensions: ["txd"] - }, - "application/vnd.gentics.grd+json": { - source: "iana", - compressible: true - }, - "application/vnd.geo+json": { - source: "iana", - compressible: true - }, - "application/vnd.geocube+xml": { - source: "iana", - compressible: true - }, - "application/vnd.geogebra.file": { - source: "iana", - extensions: ["ggb"] - }, - "application/vnd.geogebra.slides": { - source: "iana" - }, - "application/vnd.geogebra.tool": { - source: "iana", - extensions: ["ggt"] - }, - "application/vnd.geometry-explorer": { - source: "iana", - extensions: ["gex", "gre"] - }, - "application/vnd.geonext": { - source: "iana", - extensions: ["gxt"] - }, - "application/vnd.geoplan": { - source: "iana", - extensions: ["g2w"] - }, - "application/vnd.geospace": { - source: "iana", - extensions: ["g3w"] - }, - "application/vnd.gerber": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - source: "iana" - }, - "application/vnd.gmx": { - source: "iana", - extensions: ["gmx"] - }, - "application/vnd.google-apps.document": { - compressible: false, - extensions: ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - compressible: false, - extensions: ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - compressible: false, - extensions: ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - source: "iana", - compressible: true, - extensions: ["kml"] - }, - "application/vnd.google-earth.kmz": { - source: "iana", - compressible: false, - extensions: ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - source: "iana", - compressible: true - }, - "application/vnd.gov.sk.e-form+zip": { - source: "iana", - compressible: false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.grafeq": { - source: "iana", - extensions: ["gqf", "gqs"] - }, - "application/vnd.gridmp": { - source: "iana" - }, - "application/vnd.groove-account": { - source: "iana", - extensions: ["gac"] - }, - "application/vnd.groove-help": { - source: "iana", - extensions: ["ghf"] - }, - "application/vnd.groove-identity-message": { - source: "iana", - extensions: ["gim"] - }, - "application/vnd.groove-injector": { - source: "iana", - extensions: ["grv"] - }, - "application/vnd.groove-tool-message": { - source: "iana", - extensions: ["gtm"] - }, - "application/vnd.groove-tool-template": { - source: "iana", - extensions: ["tpl"] - }, - "application/vnd.groove-vcard": { - source: "iana", - extensions: ["vcg"] - }, - "application/vnd.hal+json": { - source: "iana", - compressible: true - }, - "application/vnd.hal+xml": { - source: "iana", - compressible: true, - extensions: ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - source: "iana", - compressible: true, - extensions: ["zmm"] - }, - "application/vnd.hbci": { - source: "iana", - extensions: ["hbci"] - }, - "application/vnd.hc+json": { - source: "iana", - compressible: true - }, - "application/vnd.hcl-bireports": { - source: "iana" - }, - "application/vnd.hdt": { - source: "iana" - }, - "application/vnd.heroku+json": { - source: "iana", - compressible: true - }, - "application/vnd.hhe.lesson-player": { - source: "iana", - extensions: ["les"] - }, - "application/vnd.hl7cda+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hl7v2+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hp-hpgl": { - source: "iana", - extensions: ["hpgl"] - }, - "application/vnd.hp-hpid": { - source: "iana", - extensions: ["hpid"] - }, - "application/vnd.hp-hps": { - source: "iana", - extensions: ["hps"] - }, - "application/vnd.hp-jlyt": { - source: "iana", - extensions: ["jlt"] - }, - "application/vnd.hp-pcl": { - source: "iana", - extensions: ["pcl"] - }, - "application/vnd.hp-pclxl": { - source: "iana", - extensions: ["pclxl"] - }, - "application/vnd.httphone": { - source: "iana" - }, - "application/vnd.hydrostatix.sof-data": { - source: "iana", - extensions: ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyper-item+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyperdrive+json": { - source: "iana", - compressible: true - }, - "application/vnd.hzn-3d-crossword": { - source: "iana" - }, - "application/vnd.ibm.afplinedata": { - source: "iana" - }, - "application/vnd.ibm.electronic-media": { - source: "iana" - }, - "application/vnd.ibm.minipay": { - source: "iana", - extensions: ["mpy"] - }, - "application/vnd.ibm.modcap": { - source: "iana", - extensions: ["afp", "listafp", "list3820"] - }, - "application/vnd.ibm.rights-management": { - source: "iana", - extensions: ["irm"] - }, - "application/vnd.ibm.secure-container": { - source: "iana", - extensions: ["sc"] - }, - "application/vnd.iccprofile": { - source: "iana", - extensions: ["icc", "icm"] - }, - "application/vnd.ieee.1905": { - source: "iana" - }, - "application/vnd.igloader": { - source: "iana", - extensions: ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - source: "iana", - compressible: false - }, - "application/vnd.imagemeter.image+zip": { - source: "iana", - compressible: false - }, - "application/vnd.immervision-ivp": { - source: "iana", - extensions: ["ivp"] - }, - "application/vnd.immervision-ivu": { - source: "iana", - extensions: ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - source: "iana" - }, - "application/vnd.ims.imsccv1p2": { - source: "iana" - }, - "application/vnd.ims.imsccv1p3": { - source: "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - source: "iana", - compressible: true - }, - "application/vnd.informedcontrol.rms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.informix-visionary": { - source: "iana" - }, - "application/vnd.infotech.project": { - source: "iana" - }, - "application/vnd.infotech.project+xml": { - source: "iana", - compressible: true - }, - "application/vnd.innopath.wamp.notification": { - source: "iana" - }, - "application/vnd.insors.igm": { - source: "iana", - extensions: ["igm"] - }, - "application/vnd.intercon.formnet": { - source: "iana", - extensions: ["xpw", "xpx"] - }, - "application/vnd.intergeo": { - source: "iana", - extensions: ["i2g"] - }, - "application/vnd.intertrust.digibox": { - source: "iana" - }, - "application/vnd.intertrust.nncp": { - source: "iana" - }, - "application/vnd.intu.qbo": { - source: "iana", - extensions: ["qbo"] - }, - "application/vnd.intu.qfx": { - source: "iana", - extensions: ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.packageitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.planningitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ipunplugged.rcprofile": { - source: "iana", - extensions: ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - source: "iana", - compressible: true, - extensions: ["irp"] - }, - "application/vnd.is-xpr": { - source: "iana", - extensions: ["xpr"] - }, - "application/vnd.isac.fcs": { - source: "iana", - extensions: ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - source: "iana", - compressible: false - }, - "application/vnd.jam": { - source: "iana", - extensions: ["jam"] - }, - "application/vnd.japannet-directory-service": { - source: "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-payment-wakeup": { - source: "iana" - }, - "application/vnd.japannet-registration": { - source: "iana" - }, - "application/vnd.japannet-registration-wakeup": { - source: "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-verification": { - source: "iana" - }, - "application/vnd.japannet-verification-wakeup": { - source: "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - source: "iana", - extensions: ["rms"] - }, - "application/vnd.jisp": { - source: "iana", - extensions: ["jisp"] - }, - "application/vnd.joost.joda-archive": { - source: "iana", - extensions: ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - source: "iana" - }, - "application/vnd.kahootz": { - source: "iana", - extensions: ["ktz", "ktr"] - }, - "application/vnd.kde.karbon": { - source: "iana", - extensions: ["karbon"] - }, - "application/vnd.kde.kchart": { - source: "iana", - extensions: ["chrt"] - }, - "application/vnd.kde.kformula": { - source: "iana", - extensions: ["kfo"] - }, - "application/vnd.kde.kivio": { - source: "iana", - extensions: ["flw"] - }, - "application/vnd.kde.kontour": { - source: "iana", - extensions: ["kon"] - }, - "application/vnd.kde.kpresenter": { - source: "iana", - extensions: ["kpr", "kpt"] - }, - "application/vnd.kde.kspread": { - source: "iana", - extensions: ["ksp"] - }, - "application/vnd.kde.kword": { - source: "iana", - extensions: ["kwd", "kwt"] - }, - "application/vnd.kenameaapp": { - source: "iana", - extensions: ["htke"] - }, - "application/vnd.kidspiration": { - source: "iana", - extensions: ["kia"] - }, - "application/vnd.kinar": { - source: "iana", - extensions: ["kne", "knp"] - }, - "application/vnd.koan": { - source: "iana", - extensions: ["skp", "skd", "skt", "skm"] - }, - "application/vnd.kodak-descriptor": { - source: "iana", - extensions: ["sse"] - }, - "application/vnd.las": { - source: "iana" - }, - "application/vnd.las.las+json": { - source: "iana", - compressible: true - }, - "application/vnd.las.las+xml": { - source: "iana", - compressible: true, - extensions: ["lasxml"] - }, - "application/vnd.laszip": { - source: "iana" - }, - "application/vnd.leap+json": { - source: "iana", - compressible: true - }, - "application/vnd.liberty-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - source: "iana", - extensions: ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - source: "iana", - compressible: true, - extensions: ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - source: "iana", - compressible: false - }, - "application/vnd.loom": { - source: "iana" - }, - "application/vnd.lotus-1-2-3": { - source: "iana", - extensions: ["123"] - }, - "application/vnd.lotus-approach": { - source: "iana", - extensions: ["apr"] - }, - "application/vnd.lotus-freelance": { - source: "iana", - extensions: ["pre"] - }, - "application/vnd.lotus-notes": { - source: "iana", - extensions: ["nsf"] - }, - "application/vnd.lotus-organizer": { - source: "iana", - extensions: ["org"] - }, - "application/vnd.lotus-screencam": { - source: "iana", - extensions: ["scm"] - }, - "application/vnd.lotus-wordpro": { - source: "iana", - extensions: ["lwp"] - }, - "application/vnd.macports.portpkg": { - source: "iana", - extensions: ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - source: "iana", - extensions: ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.conftoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.license+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.mdcf": { - source: "iana" - }, - "application/vnd.mason+json": { - source: "iana", - compressible: true - }, - "application/vnd.maxar.archive.3tz+zip": { - source: "iana", - compressible: false - }, - "application/vnd.maxmind.maxmind-db": { - source: "iana" - }, - "application/vnd.mcd": { - source: "iana", - extensions: ["mcd"] - }, - "application/vnd.medcalcdata": { - source: "iana", - extensions: ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - source: "iana", - extensions: ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - source: "iana" - }, - "application/vnd.mfer": { - source: "iana", - extensions: ["mwf"] - }, - "application/vnd.mfmp": { - source: "iana", - extensions: ["mfm"] - }, - "application/vnd.micro+json": { - source: "iana", - compressible: true - }, - "application/vnd.micrografx.flo": { - source: "iana", - extensions: ["flo"] - }, - "application/vnd.micrografx.igx": { - source: "iana", - extensions: ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - source: "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - source: "iana" - }, - "application/vnd.miele+json": { - source: "iana", - compressible: true - }, - "application/vnd.mif": { - source: "iana", - extensions: ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - source: "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - source: "iana" - }, - "application/vnd.mobius.daf": { - source: "iana", - extensions: ["daf"] - }, - "application/vnd.mobius.dis": { - source: "iana", - extensions: ["dis"] - }, - "application/vnd.mobius.mbk": { - source: "iana", - extensions: ["mbk"] - }, - "application/vnd.mobius.mqy": { - source: "iana", - extensions: ["mqy"] - }, - "application/vnd.mobius.msl": { - source: "iana", - extensions: ["msl"] - }, - "application/vnd.mobius.plc": { - source: "iana", - extensions: ["plc"] - }, - "application/vnd.mobius.txf": { - source: "iana", - extensions: ["txf"] - }, - "application/vnd.mophun.application": { - source: "iana", - extensions: ["mpn"] - }, - "application/vnd.mophun.certificate": { - source: "iana", - extensions: ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - source: "iana" - }, - "application/vnd.motorola.iprm": { - source: "iana" - }, - "application/vnd.mozilla.xul+xml": { - source: "iana", - compressible: true, - extensions: ["xul"] - }, - "application/vnd.ms-3mfdocument": { - source: "iana" - }, - "application/vnd.ms-artgalry": { - source: "iana", - extensions: ["cil"] - }, - "application/vnd.ms-asf": { - source: "iana" - }, - "application/vnd.ms-cab-compressed": { - source: "iana", - extensions: ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - source: "apache" - }, - "application/vnd.ms-excel": { - source: "iana", - compressible: false, - extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - source: "iana", - extensions: ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - source: "iana", - extensions: ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - source: "iana", - extensions: ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - source: "iana", - extensions: ["xltm"] - }, - "application/vnd.ms-fontobject": { - source: "iana", - compressible: true, - extensions: ["eot"] - }, - "application/vnd.ms-htmlhelp": { - source: "iana", - extensions: ["chm"] - }, - "application/vnd.ms-ims": { - source: "iana", - extensions: ["ims"] - }, - "application/vnd.ms-lrm": { - source: "iana", - extensions: ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-officetheme": { - source: "iana", - extensions: ["thmx"] - }, - "application/vnd.ms-opentype": { - source: "apache", - compressible: true - }, - "application/vnd.ms-outlook": { - compressible: false, - extensions: ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - source: "apache" - }, - "application/vnd.ms-pki.seccat": { - source: "apache", - extensions: ["cat"] - }, - "application/vnd.ms-pki.stl": { - source: "apache", - extensions: ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-powerpoint": { - source: "iana", - compressible: false, - extensions: ["ppt", "pps", "pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - source: "iana", - extensions: ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - source: "iana", - extensions: ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - source: "iana", - extensions: ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - source: "iana", - extensions: ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - source: "iana", - extensions: ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-printing.printticket+xml": { - source: "apache", - compressible: true - }, - "application/vnd.ms-printschematicket+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-project": { - source: "iana", - extensions: ["mpp", "mpt"] - }, - "application/vnd.ms-tnef": { - source: "iana" - }, - "application/vnd.ms-windows.devicepairing": { - source: "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - source: "iana" - }, - "application/vnd.ms-windows.printerpairing": { - source: "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - source: "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - source: "iana", - extensions: ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - source: "iana", - extensions: ["dotm"] - }, - "application/vnd.ms-works": { - source: "iana", - extensions: ["wps", "wks", "wcm", "wdb"] - }, - "application/vnd.ms-wpl": { - source: "iana", - extensions: ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - source: "iana", - compressible: false, - extensions: ["xps"] - }, - "application/vnd.msa-disk-image": { - source: "iana" - }, - "application/vnd.mseq": { - source: "iana", - extensions: ["mseq"] - }, - "application/vnd.msign": { - source: "iana" - }, - "application/vnd.multiad.creator": { - source: "iana" - }, - "application/vnd.multiad.creator.cif": { - source: "iana" - }, - "application/vnd.music-niff": { - source: "iana" - }, - "application/vnd.musician": { - source: "iana", - extensions: ["mus"] - }, - "application/vnd.muvee.style": { - source: "iana", - extensions: ["msty"] - }, - "application/vnd.mynfc": { - source: "iana", - extensions: ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - source: "iana", - compressible: true - }, - "application/vnd.ncd.control": { - source: "iana" - }, - "application/vnd.ncd.reference": { - source: "iana" - }, - "application/vnd.nearst.inv+json": { - source: "iana", - compressible: true - }, - "application/vnd.nebumind.line": { - source: "iana" - }, - "application/vnd.nervana": { - source: "iana" - }, - "application/vnd.netfpx": { - source: "iana" - }, - "application/vnd.neurolanguage.nlu": { - source: "iana", - extensions: ["nlu"] - }, - "application/vnd.nimn": { - source: "iana" - }, - "application/vnd.nintendo.nitro.rom": { - source: "iana" - }, - "application/vnd.nintendo.snes.rom": { - source: "iana" - }, - "application/vnd.nitf": { - source: "iana", - extensions: ["ntf", "nitf"] - }, - "application/vnd.noblenet-directory": { - source: "iana", - extensions: ["nnd"] - }, - "application/vnd.noblenet-sealer": { - source: "iana", - extensions: ["nns"] - }, - "application/vnd.noblenet-web": { - source: "iana", - extensions: ["nnw"] - }, - "application/vnd.nokia.catalogs": { - source: "iana" - }, - "application/vnd.nokia.conml+wbxml": { - source: "iana" - }, - "application/vnd.nokia.conml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.iptv.config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.isds-radio-presets": { - source: "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - source: "iana" - }, - "application/vnd.nokia.landmark+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.landmarkcollection+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.n-gage.ac+xml": { - source: "iana", - compressible: true, - extensions: ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - source: "iana", - extensions: ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - source: "iana", - extensions: ["n-gage"] - }, - "application/vnd.nokia.ncd": { - source: "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - source: "iana" - }, - "application/vnd.nokia.pcd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.radio-preset": { - source: "iana", - extensions: ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - source: "iana", - extensions: ["rpss"] - }, - "application/vnd.novadigm.edm": { - source: "iana", - extensions: ["edm"] - }, - "application/vnd.novadigm.edx": { - source: "iana", - extensions: ["edx"] - }, - "application/vnd.novadigm.ext": { - source: "iana", - extensions: ["ext"] - }, - "application/vnd.ntt-local.content-share": { - source: "iana" - }, - "application/vnd.ntt-local.file-transfer": { - source: "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - source: "iana" - }, - "application/vnd.oasis.opendocument.chart": { - source: "iana", - extensions: ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - source: "iana", - extensions: ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - source: "iana", - extensions: ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - source: "iana", - extensions: ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - source: "iana", - extensions: ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - source: "iana", - compressible: false, - extensions: ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - source: "iana", - extensions: ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - source: "iana", - extensions: ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - source: "iana", - extensions: ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - source: "iana", - compressible: false, - extensions: ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - source: "iana", - extensions: ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - source: "iana", - compressible: false, - extensions: ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - source: "iana", - extensions: ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - source: "iana", - compressible: false, - extensions: ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - source: "iana", - extensions: ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - source: "iana", - extensions: ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - source: "iana", - extensions: ["oth"] - }, - "application/vnd.obn": { - source: "iana" - }, - "application/vnd.ocf+cbor": { - source: "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - source: "iana", - compressible: true - }, - "application/vnd.oftn.l10n+json": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.cspg-hexbinary": { - source: "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.dae.xhtml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.pae.gem": { - source: "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.spdlist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.ueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.userprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.olpc-sugar": { - source: "iana", - extensions: ["xo"] - }, - "application/vnd.oma-scws-config": { - source: "iana" - }, - "application/vnd.oma-scws-http-request": { - source: "iana" - }, - "application/vnd.oma-scws-http-response": { - source: "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.imd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.ltkm": { - source: "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - source: "iana" - }, - "application/vnd.oma.bcast.sgboot": { - source: "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sgdu": { - source: "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - source: "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sprov+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.stkm": { - source: "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-feature-handler+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-pcc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-subs-invite+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-user-prefs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.dcd": { - source: "iana" - }, - "application/vnd.oma.dcdc": { - source: "iana" - }, - "application/vnd.oma.dd2+xml": { - source: "iana", - compressible: true, - extensions: ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.group-usage-list+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+cbor": { - source: "iana" - }, - "application/vnd.oma.lwm2m+json": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+tlv": { - source: "iana" - }, - "application/vnd.oma.pal+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.final-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.groups+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.push": { - source: "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.xcap-directory+xml": { - source: "iana", - compressible: true - }, - "application/vnd.omads-email+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-file+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-folder+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omaloc-supl-init": { - source: "iana" - }, - "application/vnd.onepager": { - source: "iana" - }, - "application/vnd.onepagertamp": { - source: "iana" - }, - "application/vnd.onepagertamx": { - source: "iana" - }, - "application/vnd.onepagertat": { - source: "iana" - }, - "application/vnd.onepagertatp": { - source: "iana" - }, - "application/vnd.onepagertatx": { - source: "iana" - }, - "application/vnd.openblox.game+xml": { - source: "iana", - compressible: true, - extensions: ["obgx"] - }, - "application/vnd.openblox.game-binary": { - source: "iana" - }, - "application/vnd.openeye.oeb": { - source: "iana" - }, - "application/vnd.openofficeorg.extension": { - source: "apache", - extensions: ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - source: "iana", - compressible: true, - extensions: ["osm"] - }, - "application/vnd.opentimestamps.ots": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - source: "iana", - compressible: false, - extensions: ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - source: "iana", - extensions: ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - source: "iana", - extensions: ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - source: "iana", - extensions: ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - source: "iana", - compressible: false, - extensions: ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - source: "iana", - extensions: ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - source: "iana", - compressible: false, - extensions: ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - source: "iana", - extensions: ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oracle.resource+json": { - source: "iana", - compressible: true - }, - "application/vnd.orange.indata": { - source: "iana" - }, - "application/vnd.osa.netdeploy": { - source: "iana" - }, - "application/vnd.osgeo.mapguide.package": { - source: "iana", - extensions: ["mgp"] - }, - "application/vnd.osgi.bundle": { - source: "iana" - }, - "application/vnd.osgi.dp": { - source: "iana", - extensions: ["dp"] - }, - "application/vnd.osgi.subsystem": { - source: "iana", - extensions: ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oxli.countgraph": { - source: "iana" - }, - "application/vnd.pagerduty+json": { - source: "iana", - compressible: true - }, - "application/vnd.palm": { - source: "iana", - extensions: ["pdb", "pqa", "oprc"] - }, - "application/vnd.panoply": { - source: "iana" - }, - "application/vnd.paos.xml": { - source: "iana" - }, - "application/vnd.patentdive": { - source: "iana" - }, - "application/vnd.patientecommsdoc": { - source: "iana" - }, - "application/vnd.pawaafile": { - source: "iana", - extensions: ["paw"] - }, - "application/vnd.pcos": { - source: "iana" - }, - "application/vnd.pg.format": { - source: "iana", - extensions: ["str"] - }, - "application/vnd.pg.osasli": { - source: "iana", - extensions: ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - source: "iana" - }, - "application/vnd.picsel": { - source: "iana", - extensions: ["efif"] - }, - "application/vnd.pmi.widget": { - source: "iana", - extensions: ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - source: "iana", - compressible: true - }, - "application/vnd.pocketlearn": { - source: "iana", - extensions: ["plf"] - }, - "application/vnd.powerbuilder6": { - source: "iana", - extensions: ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - source: "iana" - }, - "application/vnd.powerbuilder7": { - source: "iana" - }, - "application/vnd.powerbuilder7-s": { - source: "iana" - }, - "application/vnd.powerbuilder75": { - source: "iana" - }, - "application/vnd.powerbuilder75-s": { - source: "iana" - }, - "application/vnd.preminet": { - source: "iana" - }, - "application/vnd.previewsystems.box": { - source: "iana", - extensions: ["box"] - }, - "application/vnd.proteus.magazine": { - source: "iana", - extensions: ["mgz"] - }, - "application/vnd.psfs": { - source: "iana" - }, - "application/vnd.publishare-delta-tree": { - source: "iana", - extensions: ["qps"] - }, - "application/vnd.pvi.ptid1": { - source: "iana", - extensions: ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - source: "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - source: "iana", - compressible: true - }, - "application/vnd.qualcomm.brew-app-res": { - source: "iana" - }, - "application/vnd.quarantainenet": { - source: "iana" - }, - "application/vnd.quark.quarkxpress": { - source: "iana", - extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] - }, - "application/vnd.quobject-quoxdocument": { - source: "iana" - }, - "application/vnd.radisys.moml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - source: "iana", - compressible: true - }, - "application/vnd.rainstor.data": { - source: "iana" - }, - "application/vnd.rapid": { - source: "iana" - }, - "application/vnd.rar": { - source: "iana", - extensions: ["rar"] - }, - "application/vnd.realvnc.bed": { - source: "iana", - extensions: ["bed"] - }, - "application/vnd.recordare.musicxml": { - source: "iana", - extensions: ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - source: "iana", - compressible: true, - extensions: ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - source: "iana" - }, - "application/vnd.resilient.logic": { - source: "iana" - }, - "application/vnd.restful+json": { - source: "iana", - compressible: true - }, - "application/vnd.rig.cryptonote": { - source: "iana", - extensions: ["cryptonote"] - }, - "application/vnd.rim.cod": { - source: "apache", - extensions: ["cod"] - }, - "application/vnd.rn-realmedia": { - source: "apache", - extensions: ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - source: "apache", - extensions: ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - source: "iana", - compressible: true, - extensions: ["link66"] - }, - "application/vnd.rs-274x": { - source: "iana" - }, - "application/vnd.ruckus.download": { - source: "iana" - }, - "application/vnd.s3sms": { - source: "iana" - }, - "application/vnd.sailingtracker.track": { - source: "iana", - extensions: ["st"] - }, - "application/vnd.sar": { - source: "iana" - }, - "application/vnd.sbm.cid": { - source: "iana" - }, - "application/vnd.sbm.mid2": { - source: "iana" - }, - "application/vnd.scribus": { - source: "iana" - }, - "application/vnd.sealed.3df": { - source: "iana" - }, - "application/vnd.sealed.csf": { - source: "iana" - }, - "application/vnd.sealed.doc": { - source: "iana" - }, - "application/vnd.sealed.eml": { - source: "iana" - }, - "application/vnd.sealed.mht": { - source: "iana" - }, - "application/vnd.sealed.net": { - source: "iana" - }, - "application/vnd.sealed.ppt": { - source: "iana" - }, - "application/vnd.sealed.tiff": { - source: "iana" - }, - "application/vnd.sealed.xls": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - source: "iana" - }, - "application/vnd.seemail": { - source: "iana", - extensions: ["see"] - }, - "application/vnd.seis+json": { - source: "iana", - compressible: true - }, - "application/vnd.sema": { - source: "iana", - extensions: ["sema"] - }, - "application/vnd.semd": { - source: "iana", - extensions: ["semd"] - }, - "application/vnd.semf": { - source: "iana", - extensions: ["semf"] - }, - "application/vnd.shade-save-file": { - source: "iana" - }, - "application/vnd.shana.informed.formdata": { - source: "iana", - extensions: ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - source: "iana", - extensions: ["itp"] - }, - "application/vnd.shana.informed.interchange": { - source: "iana", - extensions: ["iif"] - }, - "application/vnd.shana.informed.package": { - source: "iana", - extensions: ["ipk"] - }, - "application/vnd.shootproof+json": { - source: "iana", - compressible: true - }, - "application/vnd.shopkick+json": { - source: "iana", - compressible: true - }, - "application/vnd.shp": { - source: "iana" - }, - "application/vnd.shx": { - source: "iana" - }, - "application/vnd.sigrok.session": { - source: "iana" - }, - "application/vnd.simtech-mindmapper": { - source: "iana", - extensions: ["twd", "twds"] - }, - "application/vnd.siren+json": { - source: "iana", - compressible: true - }, - "application/vnd.smaf": { - source: "iana", - extensions: ["mmf"] - }, - "application/vnd.smart.notebook": { - source: "iana" - }, - "application/vnd.smart.teacher": { - source: "iana", - extensions: ["teacher"] - }, - "application/vnd.snesdev-page-table": { - source: "iana" - }, - "application/vnd.software602.filler.form+xml": { - source: "iana", - compressible: true, - extensions: ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - source: "iana" - }, - "application/vnd.solent.sdkm+xml": { - source: "iana", - compressible: true, - extensions: ["sdkm", "sdkd"] - }, - "application/vnd.spotfire.dxp": { - source: "iana", - extensions: ["dxp"] - }, - "application/vnd.spotfire.sfs": { - source: "iana", - extensions: ["sfs"] - }, - "application/vnd.sqlite3": { - source: "iana" - }, - "application/vnd.sss-cod": { - source: "iana" - }, - "application/vnd.sss-dtf": { - source: "iana" - }, - "application/vnd.sss-ntf": { - source: "iana" - }, - "application/vnd.stardivision.calc": { - source: "apache", - extensions: ["sdc"] - }, - "application/vnd.stardivision.draw": { - source: "apache", - extensions: ["sda"] - }, - "application/vnd.stardivision.impress": { - source: "apache", - extensions: ["sdd"] - }, - "application/vnd.stardivision.math": { - source: "apache", - extensions: ["smf"] - }, - "application/vnd.stardivision.writer": { - source: "apache", - extensions: ["sdw", "vor"] - }, - "application/vnd.stardivision.writer-global": { - source: "apache", - extensions: ["sgl"] - }, - "application/vnd.stepmania.package": { - source: "iana", - extensions: ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - source: "iana", - extensions: ["sm"] - }, - "application/vnd.street-stream": { - source: "iana" - }, - "application/vnd.sun.wadl+xml": { - source: "iana", - compressible: true, - extensions: ["wadl"] - }, - "application/vnd.sun.xml.calc": { - source: "apache", - extensions: ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - source: "apache", - extensions: ["stc"] - }, - "application/vnd.sun.xml.draw": { - source: "apache", - extensions: ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - source: "apache", - extensions: ["std"] - }, - "application/vnd.sun.xml.impress": { - source: "apache", - extensions: ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - source: "apache", - extensions: ["sti"] - }, - "application/vnd.sun.xml.math": { - source: "apache", - extensions: ["sxm"] - }, - "application/vnd.sun.xml.writer": { - source: "apache", - extensions: ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - source: "apache", - extensions: ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - source: "apache", - extensions: ["stw"] - }, - "application/vnd.sus-calendar": { - source: "iana", - extensions: ["sus", "susp"] - }, - "application/vnd.svd": { - source: "iana", - extensions: ["svd"] - }, - "application/vnd.swiftview-ics": { - source: "iana" - }, - "application/vnd.sycle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.syft+json": { - source: "iana", - compressible: true - }, - "application/vnd.symbian.install": { - source: "apache", - extensions: ["sis", "sisx"] - }, - "application/vnd.syncml+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - source: "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmddf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.syncml.ds.notification": { - source: "iana" - }, - "application/vnd.tableschema+json": { - source: "iana", - compressible: true - }, - "application/vnd.tao.intent-module-archive": { - source: "iana", - extensions: ["tao"] - }, - "application/vnd.tcpdump.pcap": { - source: "iana", - extensions: ["pcap", "cap", "dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - source: "iana", - compressible: true - }, - "application/vnd.tmd.mediaflex.api+xml": { - source: "iana", - compressible: true - }, - "application/vnd.tml": { - source: "iana" - }, - "application/vnd.tmobile-livetv": { - source: "iana", - extensions: ["tmo"] - }, - "application/vnd.tri.onesource": { - source: "iana" - }, - "application/vnd.trid.tpt": { - source: "iana", - extensions: ["tpt"] - }, - "application/vnd.triscape.mxs": { - source: "iana", - extensions: ["mxs"] - }, - "application/vnd.trueapp": { - source: "iana", - extensions: ["tra"] - }, - "application/vnd.truedoc": { - source: "iana" - }, - "application/vnd.ubisoft.webplayer": { - source: "iana" - }, - "application/vnd.ufdl": { - source: "iana", - extensions: ["ufd", "ufdl"] - }, - "application/vnd.uiq.theme": { - source: "iana", - extensions: ["utz"] - }, - "application/vnd.umajin": { - source: "iana", - extensions: ["umj"] - }, - "application/vnd.unity": { - source: "iana", - extensions: ["unityweb"] - }, - "application/vnd.uoml+xml": { - source: "iana", - compressible: true, - extensions: ["uoml"] - }, - "application/vnd.uplanet.alert": { - source: "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.cacheop": { - source: "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.channel": { - source: "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.list": { - source: "iana" - }, - "application/vnd.uplanet.list-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.listcmd": { - source: "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.signal": { - source: "iana" - }, - "application/vnd.uri-map": { - source: "iana" - }, - "application/vnd.valve.source.material": { - source: "iana" - }, - "application/vnd.vcx": { - source: "iana", - extensions: ["vcx"] - }, - "application/vnd.vd-study": { - source: "iana" - }, - "application/vnd.vectorworks": { - source: "iana" - }, - "application/vnd.vel+json": { - source: "iana", - compressible: true - }, - "application/vnd.verimatrix.vcas": { - source: "iana" - }, - "application/vnd.veritone.aion+json": { - source: "iana", - compressible: true - }, - "application/vnd.veryant.thin": { - source: "iana" - }, - "application/vnd.ves.encrypted": { - source: "iana" - }, - "application/vnd.vidsoft.vidconference": { - source: "iana" - }, - "application/vnd.visio": { - source: "iana", - extensions: ["vsd", "vst", "vss", "vsw"] - }, - "application/vnd.visionary": { - source: "iana", - extensions: ["vis"] - }, - "application/vnd.vividence.scriptfile": { - source: "iana" - }, - "application/vnd.vsf": { - source: "iana", - extensions: ["vsf"] - }, - "application/vnd.wap.sic": { - source: "iana" - }, - "application/vnd.wap.slc": { - source: "iana" - }, - "application/vnd.wap.wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["wbxml"] - }, - "application/vnd.wap.wmlc": { - source: "iana", - extensions: ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - source: "iana", - extensions: ["wmlsc"] - }, - "application/vnd.webturbo": { - source: "iana", - extensions: ["wtb"] - }, - "application/vnd.wfa.dpp": { - source: "iana" - }, - "application/vnd.wfa.p2p": { - source: "iana" - }, - "application/vnd.wfa.wsc": { - source: "iana" - }, - "application/vnd.windows.devicepairing": { - source: "iana" - }, - "application/vnd.wmc": { - source: "iana" - }, - "application/vnd.wmf.bootstrap": { - source: "iana" - }, - "application/vnd.wolfram.mathematica": { - source: "iana" - }, - "application/vnd.wolfram.mathematica.package": { - source: "iana" - }, - "application/vnd.wolfram.player": { - source: "iana", - extensions: ["nbp"] - }, - "application/vnd.wordperfect": { - source: "iana", - extensions: ["wpd"] - }, - "application/vnd.wqd": { - source: "iana", - extensions: ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - source: "iana" - }, - "application/vnd.wt.stf": { - source: "iana", - extensions: ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - source: "iana" - }, - "application/vnd.wv.csp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.wv.ssp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xacml+json": { - source: "iana", - compressible: true - }, - "application/vnd.xara": { - source: "iana", - extensions: ["xar"] - }, - "application/vnd.xfdl": { - source: "iana", - extensions: ["xfdl"] - }, - "application/vnd.xfdl.webform": { - source: "iana" - }, - "application/vnd.xmi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xmpie.cpkg": { - source: "iana" - }, - "application/vnd.xmpie.dpkg": { - source: "iana" - }, - "application/vnd.xmpie.plan": { - source: "iana" - }, - "application/vnd.xmpie.ppkg": { - source: "iana" - }, - "application/vnd.xmpie.xlim": { - source: "iana" - }, - "application/vnd.yamaha.hv-dic": { - source: "iana", - extensions: ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - source: "iana", - extensions: ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - source: "iana", - extensions: ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - source: "iana", - extensions: ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - source: "iana", - compressible: true, - extensions: ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - source: "iana" - }, - "application/vnd.yamaha.smaf-audio": { - source: "iana", - extensions: ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - source: "iana", - extensions: ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - source: "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - source: "iana" - }, - "application/vnd.yaoweme": { - source: "iana" - }, - "application/vnd.yellowriver-custom-menu": { - source: "iana", - extensions: ["cmp"] - }, - "application/vnd.youtube.yt": { - source: "iana" - }, - "application/vnd.zul": { - source: "iana", - extensions: ["zir", "zirz"] - }, - "application/vnd.zzazz.deck+xml": { - source: "iana", - compressible: true, - extensions: ["zaz"] - }, - "application/voicexml+xml": { - source: "iana", - compressible: true, - extensions: ["vxml"] - }, - "application/voucher-cms+json": { - source: "iana", - compressible: true - }, - "application/vq-rtcpxr": { - source: "iana" - }, - "application/wasm": { - source: "iana", - compressible: true, - extensions: ["wasm"] - }, - "application/watcherinfo+xml": { - source: "iana", - compressible: true, - extensions: ["wif"] - }, - "application/webpush-options+json": { - source: "iana", - compressible: true - }, - "application/whoispp-query": { - source: "iana" - }, - "application/whoispp-response": { - source: "iana" - }, - "application/widget": { - source: "iana", - extensions: ["wgt"] - }, - "application/winhlp": { - source: "apache", - extensions: ["hlp"] - }, - "application/wita": { - source: "iana" - }, - "application/wordperfect5.1": { - source: "iana" - }, - "application/wsdl+xml": { - source: "iana", - compressible: true, - extensions: ["wsdl"] - }, - "application/wspolicy+xml": { - source: "iana", - compressible: true, - extensions: ["wspolicy"] - }, - "application/x-7z-compressed": { - source: "apache", - compressible: false, - extensions: ["7z"] - }, - "application/x-abiword": { - source: "apache", - extensions: ["abw"] - }, - "application/x-ace-compressed": { - source: "apache", - extensions: ["ace"] - }, - "application/x-amf": { - source: "apache" - }, - "application/x-apple-diskimage": { - source: "apache", - extensions: ["dmg"] - }, - "application/x-arj": { - compressible: false, - extensions: ["arj"] - }, - "application/x-authorware-bin": { - source: "apache", - extensions: ["aab", "x32", "u32", "vox"] - }, - "application/x-authorware-map": { - source: "apache", - extensions: ["aam"] - }, - "application/x-authorware-seg": { - source: "apache", - extensions: ["aas"] - }, - "application/x-bcpio": { - source: "apache", - extensions: ["bcpio"] - }, - "application/x-bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/x-bittorrent": { - source: "apache", - extensions: ["torrent"] - }, - "application/x-blorb": { - source: "apache", - extensions: ["blb", "blorb"] - }, - "application/x-bzip": { - source: "apache", - compressible: false, - extensions: ["bz"] - }, - "application/x-bzip2": { - source: "apache", - compressible: false, - extensions: ["bz2", "boz"] - }, - "application/x-cbr": { - source: "apache", - extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] - }, - "application/x-cdlink": { - source: "apache", - extensions: ["vcd"] - }, - "application/x-cfs-compressed": { - source: "apache", - extensions: ["cfs"] - }, - "application/x-chat": { - source: "apache", - extensions: ["chat"] - }, - "application/x-chess-pgn": { - source: "apache", - extensions: ["pgn"] - }, - "application/x-chrome-extension": { - extensions: ["crx"] - }, - "application/x-cocoa": { - source: "nginx", - extensions: ["cco"] - }, - "application/x-compress": { - source: "apache" - }, - "application/x-conference": { - source: "apache", - extensions: ["nsc"] - }, - "application/x-cpio": { - source: "apache", - extensions: ["cpio"] - }, - "application/x-csh": { - source: "apache", - extensions: ["csh"] - }, - "application/x-deb": { - compressible: false - }, - "application/x-debian-package": { - source: "apache", - extensions: ["deb", "udeb"] - }, - "application/x-dgc-compressed": { - source: "apache", - extensions: ["dgc"] - }, - "application/x-director": { - source: "apache", - extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] - }, - "application/x-doom": { - source: "apache", - extensions: ["wad"] - }, - "application/x-dtbncx+xml": { - source: "apache", - compressible: true, - extensions: ["ncx"] - }, - "application/x-dtbook+xml": { - source: "apache", - compressible: true, - extensions: ["dtb"] - }, - "application/x-dtbresource+xml": { - source: "apache", - compressible: true, - extensions: ["res"] - }, - "application/x-dvi": { - source: "apache", - compressible: false, - extensions: ["dvi"] - }, - "application/x-envoy": { - source: "apache", - extensions: ["evy"] - }, - "application/x-eva": { - source: "apache", - extensions: ["eva"] - }, - "application/x-font-bdf": { - source: "apache", - extensions: ["bdf"] - }, - "application/x-font-dos": { - source: "apache" - }, - "application/x-font-framemaker": { - source: "apache" - }, - "application/x-font-ghostscript": { - source: "apache", - extensions: ["gsf"] - }, - "application/x-font-libgrx": { - source: "apache" - }, - "application/x-font-linux-psf": { - source: "apache", - extensions: ["psf"] - }, - "application/x-font-pcf": { - source: "apache", - extensions: ["pcf"] - }, - "application/x-font-snf": { - source: "apache", - extensions: ["snf"] - }, - "application/x-font-speedo": { - source: "apache" - }, - "application/x-font-sunos-news": { - source: "apache" - }, - "application/x-font-type1": { - source: "apache", - extensions: ["pfa", "pfb", "pfm", "afm"] - }, - "application/x-font-vfont": { - source: "apache" - }, - "application/x-freearc": { - source: "apache", - extensions: ["arc"] - }, - "application/x-futuresplash": { - source: "apache", - extensions: ["spl"] - }, - "application/x-gca-compressed": { - source: "apache", - extensions: ["gca"] - }, - "application/x-glulx": { - source: "apache", - extensions: ["ulx"] - }, - "application/x-gnumeric": { - source: "apache", - extensions: ["gnumeric"] - }, - "application/x-gramps-xml": { - source: "apache", - extensions: ["gramps"] - }, - "application/x-gtar": { - source: "apache", - extensions: ["gtar"] - }, - "application/x-gzip": { - source: "apache" - }, - "application/x-hdf": { - source: "apache", - extensions: ["hdf"] - }, - "application/x-httpd-php": { - compressible: true, - extensions: ["php"] - }, - "application/x-install-instructions": { - source: "apache", - extensions: ["install"] - }, - "application/x-iso9660-image": { - source: "apache", - extensions: ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - extensions: ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - extensions: ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - extensions: ["pages"] - }, - "application/x-java-archive-diff": { - source: "nginx", - extensions: ["jardiff"] - }, - "application/x-java-jnlp-file": { - source: "apache", - compressible: false, - extensions: ["jnlp"] - }, - "application/x-javascript": { - compressible: true - }, - "application/x-keepass2": { - extensions: ["kdbx"] - }, - "application/x-latex": { - source: "apache", - compressible: false, - extensions: ["latex"] - }, - "application/x-lua-bytecode": { - extensions: ["luac"] - }, - "application/x-lzh-compressed": { - source: "apache", - extensions: ["lzh", "lha"] - }, - "application/x-makeself": { - source: "nginx", - extensions: ["run"] - }, - "application/x-mie": { - source: "apache", - extensions: ["mie"] - }, - "application/x-mobipocket-ebook": { - source: "apache", - extensions: ["prc", "mobi"] - }, - "application/x-mpegurl": { - compressible: false - }, - "application/x-ms-application": { - source: "apache", - extensions: ["application"] - }, - "application/x-ms-shortcut": { - source: "apache", - extensions: ["lnk"] - }, - "application/x-ms-wmd": { - source: "apache", - extensions: ["wmd"] - }, - "application/x-ms-wmz": { - source: "apache", - extensions: ["wmz"] - }, - "application/x-ms-xbap": { - source: "apache", - extensions: ["xbap"] - }, - "application/x-msaccess": { - source: "apache", - extensions: ["mdb"] - }, - "application/x-msbinder": { - source: "apache", - extensions: ["obd"] - }, - "application/x-mscardfile": { - source: "apache", - extensions: ["crd"] - }, - "application/x-msclip": { - source: "apache", - extensions: ["clp"] - }, - "application/x-msdos-program": { - extensions: ["exe"] - }, - "application/x-msdownload": { - source: "apache", - extensions: ["exe", "dll", "com", "bat", "msi"] - }, - "application/x-msmediaview": { - source: "apache", - extensions: ["mvb", "m13", "m14"] - }, - "application/x-msmetafile": { - source: "apache", - extensions: ["wmf", "wmz", "emf", "emz"] - }, - "application/x-msmoney": { - source: "apache", - extensions: ["mny"] - }, - "application/x-mspublisher": { - source: "apache", - extensions: ["pub"] - }, - "application/x-msschedule": { - source: "apache", - extensions: ["scd"] - }, - "application/x-msterminal": { - source: "apache", - extensions: ["trm"] - }, - "application/x-mswrite": { - source: "apache", - extensions: ["wri"] - }, - "application/x-netcdf": { - source: "apache", - extensions: ["nc", "cdf"] - }, - "application/x-ns-proxy-autoconfig": { - compressible: true, - extensions: ["pac"] - }, - "application/x-nzb": { - source: "apache", - extensions: ["nzb"] - }, - "application/x-perl": { - source: "nginx", - extensions: ["pl", "pm"] - }, - "application/x-pilot": { - source: "nginx", - extensions: ["prc", "pdb"] - }, - "application/x-pkcs12": { - source: "apache", - compressible: false, - extensions: ["p12", "pfx"] - }, - "application/x-pkcs7-certificates": { - source: "apache", - extensions: ["p7b", "spc"] - }, - "application/x-pkcs7-certreqresp": { - source: "apache", - extensions: ["p7r"] - }, - "application/x-pki-message": { - source: "iana" - }, - "application/x-rar-compressed": { - source: "apache", - compressible: false, - extensions: ["rar"] - }, - "application/x-redhat-package-manager": { - source: "nginx", - extensions: ["rpm"] - }, - "application/x-research-info-systems": { - source: "apache", - extensions: ["ris"] - }, - "application/x-sea": { - source: "nginx", - extensions: ["sea"] - }, - "application/x-sh": { - source: "apache", - compressible: true, - extensions: ["sh"] - }, - "application/x-shar": { - source: "apache", - extensions: ["shar"] - }, - "application/x-shockwave-flash": { - source: "apache", - compressible: false, - extensions: ["swf"] - }, - "application/x-silverlight-app": { - source: "apache", - extensions: ["xap"] - }, - "application/x-sql": { - source: "apache", - extensions: ["sql"] - }, - "application/x-stuffit": { - source: "apache", - compressible: false, - extensions: ["sit"] - }, - "application/x-stuffitx": { - source: "apache", - extensions: ["sitx"] - }, - "application/x-subrip": { - source: "apache", - extensions: ["srt"] - }, - "application/x-sv4cpio": { - source: "apache", - extensions: ["sv4cpio"] - }, - "application/x-sv4crc": { - source: "apache", - extensions: ["sv4crc"] - }, - "application/x-t3vm-image": { - source: "apache", - extensions: ["t3"] - }, - "application/x-tads": { - source: "apache", - extensions: ["gam"] - }, - "application/x-tar": { - source: "apache", - compressible: true, - extensions: ["tar"] - }, - "application/x-tcl": { - source: "apache", - extensions: ["tcl", "tk"] - }, - "application/x-tex": { - source: "apache", - extensions: ["tex"] - }, - "application/x-tex-tfm": { - source: "apache", - extensions: ["tfm"] - }, - "application/x-texinfo": { - source: "apache", - extensions: ["texinfo", "texi"] - }, - "application/x-tgif": { - source: "apache", - extensions: ["obj"] - }, - "application/x-ustar": { - source: "apache", - extensions: ["ustar"] - }, - "application/x-virtualbox-hdd": { - compressible: true, - extensions: ["hdd"] - }, - "application/x-virtualbox-ova": { - compressible: true, - extensions: ["ova"] - }, - "application/x-virtualbox-ovf": { - compressible: true, - extensions: ["ovf"] - }, - "application/x-virtualbox-vbox": { - compressible: true, - extensions: ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - compressible: false, - extensions: ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - compressible: true, - extensions: ["vdi"] - }, - "application/x-virtualbox-vhd": { - compressible: true, - extensions: ["vhd"] - }, - "application/x-virtualbox-vmdk": { - compressible: true, - extensions: ["vmdk"] - }, - "application/x-wais-source": { - source: "apache", - extensions: ["src"] - }, - "application/x-web-app-manifest+json": { - compressible: true, - extensions: ["webapp"] - }, - "application/x-www-form-urlencoded": { - source: "iana", - compressible: true - }, - "application/x-x509-ca-cert": { - source: "iana", - extensions: ["der", "crt", "pem"] - }, - "application/x-x509-ca-ra-cert": { - source: "iana" - }, - "application/x-x509-next-ca-cert": { - source: "iana" - }, - "application/x-xfig": { - source: "apache", - extensions: ["fig"] - }, - "application/x-xliff+xml": { - source: "apache", - compressible: true, - extensions: ["xlf"] - }, - "application/x-xpinstall": { - source: "apache", - compressible: false, - extensions: ["xpi"] - }, - "application/x-xz": { - source: "apache", - extensions: ["xz"] - }, - "application/x-zmachine": { - source: "apache", - extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] - }, - "application/x400-bp": { - source: "iana" - }, - "application/xacml+xml": { - source: "iana", - compressible: true - }, - "application/xaml+xml": { - source: "apache", - compressible: true, - extensions: ["xaml"] - }, - "application/xcap-att+xml": { - source: "iana", - compressible: true, - extensions: ["xav"] - }, - "application/xcap-caps+xml": { - source: "iana", - compressible: true, - extensions: ["xca"] - }, - "application/xcap-diff+xml": { - source: "iana", - compressible: true, - extensions: ["xdf"] - }, - "application/xcap-el+xml": { - source: "iana", - compressible: true, - extensions: ["xel"] - }, - "application/xcap-error+xml": { - source: "iana", - compressible: true - }, - "application/xcap-ns+xml": { - source: "iana", - compressible: true, - extensions: ["xns"] - }, - "application/xcon-conference-info+xml": { - source: "iana", - compressible: true - }, - "application/xcon-conference-info-diff+xml": { - source: "iana", - compressible: true - }, - "application/xenc+xml": { - source: "iana", - compressible: true, - extensions: ["xenc"] - }, - "application/xhtml+xml": { - source: "iana", - compressible: true, - extensions: ["xhtml", "xht"] - }, - "application/xhtml-voice+xml": { - source: "apache", - compressible: true - }, - "application/xliff+xml": { - source: "iana", - compressible: true, - extensions: ["xlf"] - }, - "application/xml": { - source: "iana", - compressible: true, - extensions: ["xml", "xsl", "xsd", "rng"] - }, - "application/xml-dtd": { - source: "iana", - compressible: true, - extensions: ["dtd"] - }, - "application/xml-external-parsed-entity": { - source: "iana" - }, - "application/xml-patch+xml": { - source: "iana", - compressible: true - }, - "application/xmpp+xml": { - source: "iana", - compressible: true - }, - "application/xop+xml": { - source: "iana", - compressible: true, - extensions: ["xop"] - }, - "application/xproc+xml": { - source: "apache", - compressible: true, - extensions: ["xpl"] - }, - "application/xslt+xml": { - source: "iana", - compressible: true, - extensions: ["xsl", "xslt"] - }, - "application/xspf+xml": { - source: "apache", - compressible: true, - extensions: ["xspf"] - }, - "application/xv+xml": { - source: "iana", - compressible: true, - extensions: ["mxml", "xhvml", "xvml", "xvm"] - }, - "application/yang": { - source: "iana", - extensions: ["yang"] - }, - "application/yang-data+json": { - source: "iana", - compressible: true - }, - "application/yang-data+xml": { - source: "iana", - compressible: true - }, - "application/yang-patch+json": { - source: "iana", - compressible: true - }, - "application/yang-patch+xml": { - source: "iana", - compressible: true - }, - "application/yin+xml": { - source: "iana", - compressible: true, - extensions: ["yin"] - }, - "application/zip": { - source: "iana", - compressible: false, - extensions: ["zip"] - }, - "application/zlib": { - source: "iana" - }, - "application/zstd": { - source: "iana" - }, - "audio/1d-interleaved-parityfec": { - source: "iana" - }, - "audio/32kadpcm": { - source: "iana" - }, - "audio/3gpp": { - source: "iana", - compressible: false, - extensions: ["3gpp"] - }, - "audio/3gpp2": { - source: "iana" - }, - "audio/aac": { - source: "iana" - }, - "audio/ac3": { - source: "iana" - }, - "audio/adpcm": { - source: "apache", - extensions: ["adp"] - }, - "audio/amr": { - source: "iana", - extensions: ["amr"] - }, - "audio/amr-wb": { - source: "iana" - }, - "audio/amr-wb+": { - source: "iana" - }, - "audio/aptx": { - source: "iana" - }, - "audio/asc": { - source: "iana" - }, - "audio/atrac-advanced-lossless": { - source: "iana" - }, - "audio/atrac-x": { - source: "iana" - }, - "audio/atrac3": { - source: "iana" - }, - "audio/basic": { - source: "iana", - compressible: false, - extensions: ["au", "snd"] - }, - "audio/bv16": { - source: "iana" - }, - "audio/bv32": { - source: "iana" - }, - "audio/clearmode": { - source: "iana" - }, - "audio/cn": { - source: "iana" - }, - "audio/dat12": { - source: "iana" - }, - "audio/dls": { - source: "iana" - }, - "audio/dsr-es201108": { - source: "iana" - }, - "audio/dsr-es202050": { - source: "iana" - }, - "audio/dsr-es202211": { - source: "iana" - }, - "audio/dsr-es202212": { - source: "iana" - }, - "audio/dv": { - source: "iana" - }, - "audio/dvi4": { - source: "iana" - }, - "audio/eac3": { - source: "iana" - }, - "audio/encaprtp": { - source: "iana" - }, - "audio/evrc": { - source: "iana" - }, - "audio/evrc-qcp": { - source: "iana" - }, - "audio/evrc0": { - source: "iana" - }, - "audio/evrc1": { - source: "iana" - }, - "audio/evrcb": { - source: "iana" - }, - "audio/evrcb0": { - source: "iana" - }, - "audio/evrcb1": { - source: "iana" - }, - "audio/evrcnw": { - source: "iana" - }, - "audio/evrcnw0": { - source: "iana" - }, - "audio/evrcnw1": { - source: "iana" - }, - "audio/evrcwb": { - source: "iana" - }, - "audio/evrcwb0": { - source: "iana" - }, - "audio/evrcwb1": { - source: "iana" - }, - "audio/evs": { - source: "iana" - }, - "audio/flexfec": { - source: "iana" - }, - "audio/fwdred": { - source: "iana" - }, - "audio/g711-0": { - source: "iana" - }, - "audio/g719": { - source: "iana" - }, - "audio/g722": { - source: "iana" - }, - "audio/g7221": { - source: "iana" - }, - "audio/g723": { - source: "iana" - }, - "audio/g726-16": { - source: "iana" - }, - "audio/g726-24": { - source: "iana" - }, - "audio/g726-32": { - source: "iana" - }, - "audio/g726-40": { - source: "iana" - }, - "audio/g728": { - source: "iana" - }, - "audio/g729": { - source: "iana" - }, - "audio/g7291": { - source: "iana" - }, - "audio/g729d": { - source: "iana" - }, - "audio/g729e": { - source: "iana" - }, - "audio/gsm": { - source: "iana" - }, - "audio/gsm-efr": { - source: "iana" - }, - "audio/gsm-hr-08": { - source: "iana" - }, - "audio/ilbc": { - source: "iana" - }, - "audio/ip-mr_v2.5": { - source: "iana" - }, - "audio/isac": { - source: "apache" - }, - "audio/l16": { - source: "iana" - }, - "audio/l20": { - source: "iana" - }, - "audio/l24": { - source: "iana", - compressible: false - }, - "audio/l8": { - source: "iana" - }, - "audio/lpc": { - source: "iana" - }, - "audio/melp": { - source: "iana" - }, - "audio/melp1200": { - source: "iana" - }, - "audio/melp2400": { - source: "iana" - }, - "audio/melp600": { - source: "iana" - }, - "audio/mhas": { - source: "iana" - }, - "audio/midi": { - source: "apache", - extensions: ["mid", "midi", "kar", "rmi"] - }, - "audio/mobile-xmf": { - source: "iana", - extensions: ["mxmf"] - }, - "audio/mp3": { - compressible: false, - extensions: ["mp3"] - }, - "audio/mp4": { - source: "iana", - compressible: false, - extensions: ["m4a", "mp4a"] - }, - "audio/mp4a-latm": { - source: "iana" - }, - "audio/mpa": { - source: "iana" - }, - "audio/mpa-robust": { - source: "iana" - }, - "audio/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] - }, - "audio/mpeg4-generic": { - source: "iana" - }, - "audio/musepack": { - source: "apache" - }, - "audio/ogg": { - source: "iana", - compressible: false, - extensions: ["oga", "ogg", "spx", "opus"] - }, - "audio/opus": { - source: "iana" - }, - "audio/parityfec": { - source: "iana" - }, - "audio/pcma": { - source: "iana" - }, - "audio/pcma-wb": { - source: "iana" - }, - "audio/pcmu": { - source: "iana" - }, - "audio/pcmu-wb": { - source: "iana" - }, - "audio/prs.sid": { - source: "iana" - }, - "audio/qcelp": { - source: "iana" - }, - "audio/raptorfec": { - source: "iana" - }, - "audio/red": { - source: "iana" - }, - "audio/rtp-enc-aescm128": { - source: "iana" - }, - "audio/rtp-midi": { - source: "iana" - }, - "audio/rtploopback": { - source: "iana" - }, - "audio/rtx": { - source: "iana" - }, - "audio/s3m": { - source: "apache", - extensions: ["s3m"] - }, - "audio/scip": { - source: "iana" - }, - "audio/silk": { - source: "apache", - extensions: ["sil"] - }, - "audio/smv": { - source: "iana" - }, - "audio/smv-qcp": { - source: "iana" - }, - "audio/smv0": { - source: "iana" - }, - "audio/sofa": { - source: "iana" - }, - "audio/sp-midi": { - source: "iana" - }, - "audio/speex": { - source: "iana" - }, - "audio/t140c": { - source: "iana" - }, - "audio/t38": { - source: "iana" - }, - "audio/telephone-event": { - source: "iana" - }, - "audio/tetra_acelp": { - source: "iana" - }, - "audio/tetra_acelp_bb": { - source: "iana" - }, - "audio/tone": { - source: "iana" - }, - "audio/tsvcis": { - source: "iana" - }, - "audio/uemclip": { - source: "iana" - }, - "audio/ulpfec": { - source: "iana" - }, - "audio/usac": { - source: "iana" - }, - "audio/vdvi": { - source: "iana" - }, - "audio/vmr-wb": { - source: "iana" - }, - "audio/vnd.3gpp.iufp": { - source: "iana" - }, - "audio/vnd.4sb": { - source: "iana" - }, - "audio/vnd.audiokoz": { - source: "iana" - }, - "audio/vnd.celp": { - source: "iana" - }, - "audio/vnd.cisco.nse": { - source: "iana" - }, - "audio/vnd.cmles.radio-events": { - source: "iana" - }, - "audio/vnd.cns.anp1": { - source: "iana" - }, - "audio/vnd.cns.inf1": { - source: "iana" - }, - "audio/vnd.dece.audio": { - source: "iana", - extensions: ["uva", "uvva"] - }, - "audio/vnd.digital-winds": { - source: "iana", - extensions: ["eol"] - }, - "audio/vnd.dlna.adts": { - source: "iana" - }, - "audio/vnd.dolby.heaac.1": { - source: "iana" - }, - "audio/vnd.dolby.heaac.2": { - source: "iana" - }, - "audio/vnd.dolby.mlp": { - source: "iana" - }, - "audio/vnd.dolby.mps": { - source: "iana" - }, - "audio/vnd.dolby.pl2": { - source: "iana" - }, - "audio/vnd.dolby.pl2x": { - source: "iana" - }, - "audio/vnd.dolby.pl2z": { - source: "iana" - }, - "audio/vnd.dolby.pulse.1": { - source: "iana" - }, - "audio/vnd.dra": { - source: "iana", - extensions: ["dra"] - }, - "audio/vnd.dts": { - source: "iana", - extensions: ["dts"] - }, - "audio/vnd.dts.hd": { - source: "iana", - extensions: ["dtshd"] - }, - "audio/vnd.dts.uhd": { - source: "iana" - }, - "audio/vnd.dvb.file": { - source: "iana" - }, - "audio/vnd.everad.plj": { - source: "iana" - }, - "audio/vnd.hns.audio": { - source: "iana" - }, - "audio/vnd.lucent.voice": { - source: "iana", - extensions: ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - source: "iana", - extensions: ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - source: "iana" - }, - "audio/vnd.nortel.vbk": { - source: "iana" - }, - "audio/vnd.nuera.ecelp4800": { - source: "iana", - extensions: ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - source: "iana", - extensions: ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - source: "iana", - extensions: ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - source: "iana" - }, - "audio/vnd.presonus.multitrack": { - source: "iana" - }, - "audio/vnd.qcelp": { - source: "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - source: "iana" - }, - "audio/vnd.rip": { - source: "iana", - extensions: ["rip"] - }, - "audio/vnd.rn-realaudio": { - compressible: false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - source: "iana" - }, - "audio/vnd.vmx.cvsd": { - source: "iana" - }, - "audio/vnd.wave": { - compressible: false - }, - "audio/vorbis": { - source: "iana", - compressible: false - }, - "audio/vorbis-config": { - source: "iana" - }, - "audio/wav": { - compressible: false, - extensions: ["wav"] - }, - "audio/wave": { - compressible: false, - extensions: ["wav"] - }, - "audio/webm": { - source: "apache", - compressible: false, - extensions: ["weba"] - }, - "audio/x-aac": { - source: "apache", - compressible: false, - extensions: ["aac"] - }, - "audio/x-aiff": { - source: "apache", - extensions: ["aif", "aiff", "aifc"] - }, - "audio/x-caf": { - source: "apache", - compressible: false, - extensions: ["caf"] - }, - "audio/x-flac": { - source: "apache", - extensions: ["flac"] - }, - "audio/x-m4a": { - source: "nginx", - extensions: ["m4a"] - }, - "audio/x-matroska": { - source: "apache", - extensions: ["mka"] - }, - "audio/x-mpegurl": { - source: "apache", - extensions: ["m3u"] - }, - "audio/x-ms-wax": { - source: "apache", - extensions: ["wax"] - }, - "audio/x-ms-wma": { - source: "apache", - extensions: ["wma"] - }, - "audio/x-pn-realaudio": { - source: "apache", - extensions: ["ram", "ra"] - }, - "audio/x-pn-realaudio-plugin": { - source: "apache", - extensions: ["rmp"] - }, - "audio/x-realaudio": { - source: "nginx", - extensions: ["ra"] - }, - "audio/x-tta": { - source: "apache" - }, - "audio/x-wav": { - source: "apache", - extensions: ["wav"] - }, - "audio/xm": { - source: "apache", - extensions: ["xm"] - }, - "chemical/x-cdx": { - source: "apache", - extensions: ["cdx"] - }, - "chemical/x-cif": { - source: "apache", - extensions: ["cif"] - }, - "chemical/x-cmdf": { - source: "apache", - extensions: ["cmdf"] - }, - "chemical/x-cml": { - source: "apache", - extensions: ["cml"] - }, - "chemical/x-csml": { - source: "apache", - extensions: ["csml"] - }, - "chemical/x-pdb": { - source: "apache" - }, - "chemical/x-xyz": { - source: "apache", - extensions: ["xyz"] - }, - "font/collection": { - source: "iana", - extensions: ["ttc"] - }, - "font/otf": { - source: "iana", - compressible: true, - extensions: ["otf"] - }, - "font/sfnt": { - source: "iana" - }, - "font/ttf": { - source: "iana", - compressible: true, - extensions: ["ttf"] - }, - "font/woff": { - source: "iana", - extensions: ["woff"] - }, - "font/woff2": { - source: "iana", - extensions: ["woff2"] - }, - "image/aces": { - source: "iana", - extensions: ["exr"] - }, - "image/apng": { - compressible: false, - extensions: ["apng"] - }, - "image/avci": { - source: "iana", - extensions: ["avci"] - }, - "image/avcs": { - source: "iana", - extensions: ["avcs"] - }, - "image/avif": { - source: "iana", - compressible: false, - extensions: ["avif"] - }, - "image/bmp": { - source: "iana", - compressible: true, - extensions: ["bmp"] - }, - "image/cgm": { - source: "iana", - extensions: ["cgm"] - }, - "image/dicom-rle": { - source: "iana", - extensions: ["drle"] - }, - "image/emf": { - source: "iana", - extensions: ["emf"] - }, - "image/fits": { - source: "iana", - extensions: ["fits"] - }, - "image/g3fax": { - source: "iana", - extensions: ["g3"] - }, - "image/gif": { - source: "iana", - compressible: false, - extensions: ["gif"] - }, - "image/heic": { - source: "iana", - extensions: ["heic"] - }, - "image/heic-sequence": { - source: "iana", - extensions: ["heics"] - }, - "image/heif": { - source: "iana", - extensions: ["heif"] - }, - "image/heif-sequence": { - source: "iana", - extensions: ["heifs"] - }, - "image/hej2k": { - source: "iana", - extensions: ["hej2"] - }, - "image/hsj2": { - source: "iana", - extensions: ["hsj2"] - }, - "image/ief": { - source: "iana", - extensions: ["ief"] - }, - "image/jls": { - source: "iana", - extensions: ["jls"] - }, - "image/jp2": { - source: "iana", - compressible: false, - extensions: ["jp2", "jpg2"] - }, - "image/jpeg": { - source: "iana", - compressible: false, - extensions: ["jpeg", "jpg", "jpe"] - }, - "image/jph": { - source: "iana", - extensions: ["jph"] - }, - "image/jphc": { - source: "iana", - extensions: ["jhc"] - }, - "image/jpm": { - source: "iana", - compressible: false, - extensions: ["jpm"] - }, - "image/jpx": { - source: "iana", - compressible: false, - extensions: ["jpx", "jpf"] - }, - "image/jxr": { - source: "iana", - extensions: ["jxr"] - }, - "image/jxra": { - source: "iana", - extensions: ["jxra"] - }, - "image/jxrs": { - source: "iana", - extensions: ["jxrs"] - }, - "image/jxs": { - source: "iana", - extensions: ["jxs"] - }, - "image/jxsc": { - source: "iana", - extensions: ["jxsc"] - }, - "image/jxsi": { - source: "iana", - extensions: ["jxsi"] - }, - "image/jxss": { - source: "iana", - extensions: ["jxss"] - }, - "image/ktx": { - source: "iana", - extensions: ["ktx"] - }, - "image/ktx2": { - source: "iana", - extensions: ["ktx2"] - }, - "image/naplps": { - source: "iana" - }, - "image/pjpeg": { - compressible: false - }, - "image/png": { - source: "iana", - compressible: false, - extensions: ["png"] - }, - "image/prs.btif": { - source: "iana", - extensions: ["btif"] - }, - "image/prs.pti": { - source: "iana", - extensions: ["pti"] - }, - "image/pwg-raster": { - source: "iana" - }, - "image/sgi": { - source: "apache", - extensions: ["sgi"] - }, - "image/svg+xml": { - source: "iana", - compressible: true, - extensions: ["svg", "svgz"] - }, - "image/t38": { - source: "iana", - extensions: ["t38"] - }, - "image/tiff": { - source: "iana", - compressible: false, - extensions: ["tif", "tiff"] - }, - "image/tiff-fx": { - source: "iana", - extensions: ["tfx"] - }, - "image/vnd.adobe.photoshop": { - source: "iana", - compressible: true, - extensions: ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - source: "iana", - extensions: ["azv"] - }, - "image/vnd.cns.inf2": { - source: "iana" - }, - "image/vnd.dece.graphic": { - source: "iana", - extensions: ["uvi", "uvvi", "uvg", "uvvg"] - }, - "image/vnd.djvu": { - source: "iana", - extensions: ["djvu", "djv"] - }, - "image/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "image/vnd.dwg": { - source: "iana", - extensions: ["dwg"] - }, - "image/vnd.dxf": { - source: "iana", - extensions: ["dxf"] - }, - "image/vnd.fastbidsheet": { - source: "iana", - extensions: ["fbs"] - }, - "image/vnd.fpx": { - source: "iana", - extensions: ["fpx"] - }, - "image/vnd.fst": { - source: "iana", - extensions: ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - source: "iana", - extensions: ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - source: "iana", - extensions: ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - source: "iana" - }, - "image/vnd.microsoft.icon": { - source: "iana", - compressible: true, - extensions: ["ico"] - }, - "image/vnd.mix": { - source: "iana" - }, - "image/vnd.mozilla.apng": { - source: "iana" - }, - "image/vnd.ms-dds": { - compressible: true, - extensions: ["dds"] - }, - "image/vnd.ms-modi": { - source: "iana", - extensions: ["mdi"] - }, - "image/vnd.ms-photo": { - source: "apache", - extensions: ["wdp"] - }, - "image/vnd.net-fpx": { - source: "iana", - extensions: ["npx"] - }, - "image/vnd.pco.b16": { - source: "iana", - extensions: ["b16"] - }, - "image/vnd.radiance": { - source: "iana" - }, - "image/vnd.sealed.png": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - source: "iana" - }, - "image/vnd.svf": { - source: "iana" - }, - "image/vnd.tencent.tap": { - source: "iana", - extensions: ["tap"] - }, - "image/vnd.valve.source.texture": { - source: "iana", - extensions: ["vtf"] - }, - "image/vnd.wap.wbmp": { - source: "iana", - extensions: ["wbmp"] - }, - "image/vnd.xiff": { - source: "iana", - extensions: ["xif"] - }, - "image/vnd.zbrush.pcx": { - source: "iana", - extensions: ["pcx"] - }, - "image/webp": { - source: "apache", - extensions: ["webp"] - }, - "image/wmf": { - source: "iana", - extensions: ["wmf"] - }, - "image/x-3ds": { - source: "apache", - extensions: ["3ds"] - }, - "image/x-cmu-raster": { - source: "apache", - extensions: ["ras"] - }, - "image/x-cmx": { - source: "apache", - extensions: ["cmx"] - }, - "image/x-freehand": { - source: "apache", - extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] - }, - "image/x-icon": { - source: "apache", - compressible: true, - extensions: ["ico"] - }, - "image/x-jng": { - source: "nginx", - extensions: ["jng"] - }, - "image/x-mrsid-image": { - source: "apache", - extensions: ["sid"] - }, - "image/x-ms-bmp": { - source: "nginx", - compressible: true, - extensions: ["bmp"] - }, - "image/x-pcx": { - source: "apache", - extensions: ["pcx"] - }, - "image/x-pict": { - source: "apache", - extensions: ["pic", "pct"] - }, - "image/x-portable-anymap": { - source: "apache", - extensions: ["pnm"] - }, - "image/x-portable-bitmap": { - source: "apache", - extensions: ["pbm"] - }, - "image/x-portable-graymap": { - source: "apache", - extensions: ["pgm"] - }, - "image/x-portable-pixmap": { - source: "apache", - extensions: ["ppm"] - }, - "image/x-rgb": { - source: "apache", - extensions: ["rgb"] - }, - "image/x-tga": { - source: "apache", - extensions: ["tga"] - }, - "image/x-xbitmap": { - source: "apache", - extensions: ["xbm"] - }, - "image/x-xcf": { - compressible: false - }, - "image/x-xpixmap": { - source: "apache", - extensions: ["xpm"] - }, - "image/x-xwindowdump": { - source: "apache", - extensions: ["xwd"] - }, - "message/cpim": { - source: "iana" - }, - "message/delivery-status": { - source: "iana" - }, - "message/disposition-notification": { - source: "iana", - extensions: [ - "disposition-notification" - ] - }, - "message/external-body": { - source: "iana" - }, - "message/feedback-report": { - source: "iana" - }, - "message/global": { - source: "iana", - extensions: ["u8msg"] - }, - "message/global-delivery-status": { - source: "iana", - extensions: ["u8dsn"] - }, - "message/global-disposition-notification": { - source: "iana", - extensions: ["u8mdn"] - }, - "message/global-headers": { - source: "iana", - extensions: ["u8hdr"] - }, - "message/http": { - source: "iana", - compressible: false - }, - "message/imdn+xml": { - source: "iana", - compressible: true - }, - "message/news": { - source: "iana" - }, - "message/partial": { - source: "iana", - compressible: false - }, - "message/rfc822": { - source: "iana", - compressible: true, - extensions: ["eml", "mime"] - }, - "message/s-http": { - source: "iana" - }, - "message/sip": { - source: "iana" - }, - "message/sipfrag": { - source: "iana" - }, - "message/tracking-status": { - source: "iana" - }, - "message/vnd.si.simp": { - source: "iana" - }, - "message/vnd.wfa.wsc": { - source: "iana", - extensions: ["wsc"] - }, - "model/3mf": { - source: "iana", - extensions: ["3mf"] - }, - "model/e57": { - source: "iana" - }, - "model/gltf+json": { - source: "iana", - compressible: true, - extensions: ["gltf"] - }, - "model/gltf-binary": { - source: "iana", - compressible: true, - extensions: ["glb"] - }, - "model/iges": { - source: "iana", - compressible: false, - extensions: ["igs", "iges"] - }, - "model/mesh": { - source: "iana", - compressible: false, - extensions: ["msh", "mesh", "silo"] - }, - "model/mtl": { - source: "iana", - extensions: ["mtl"] - }, - "model/obj": { - source: "iana", - extensions: ["obj"] - }, - "model/step": { - source: "iana" - }, - "model/step+xml": { - source: "iana", - compressible: true, - extensions: ["stpx"] - }, - "model/step+zip": { - source: "iana", - compressible: false, - extensions: ["stpz"] - }, - "model/step-xml+zip": { - source: "iana", - compressible: false, - extensions: ["stpxz"] - }, - "model/stl": { - source: "iana", - extensions: ["stl"] - }, - "model/vnd.collada+xml": { - source: "iana", - compressible: true, - extensions: ["dae"] - }, - "model/vnd.dwf": { - source: "iana", - extensions: ["dwf"] - }, - "model/vnd.flatland.3dml": { - source: "iana" - }, - "model/vnd.gdl": { - source: "iana", - extensions: ["gdl"] - }, - "model/vnd.gs-gdl": { - source: "apache" - }, - "model/vnd.gs.gdl": { - source: "iana" - }, - "model/vnd.gtw": { - source: "iana", - extensions: ["gtw"] - }, - "model/vnd.moml+xml": { - source: "iana", - compressible: true - }, - "model/vnd.mts": { - source: "iana", - extensions: ["mts"] - }, - "model/vnd.opengex": { - source: "iana", - extensions: ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - source: "iana", - extensions: ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - source: "iana", - extensions: ["x_t"] - }, - "model/vnd.pytha.pyox": { - source: "iana" - }, - "model/vnd.rosette.annotated-data-model": { - source: "iana" - }, - "model/vnd.sap.vds": { - source: "iana", - extensions: ["vds"] - }, - "model/vnd.usdz+zip": { - source: "iana", - compressible: false, - extensions: ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - source: "iana", - extensions: ["bsp"] - }, - "model/vnd.vtu": { - source: "iana", - extensions: ["vtu"] - }, - "model/vrml": { - source: "iana", - compressible: false, - extensions: ["wrl", "vrml"] - }, - "model/x3d+binary": { - source: "apache", - compressible: false, - extensions: ["x3db", "x3dbz"] - }, - "model/x3d+fastinfoset": { - source: "iana", - extensions: ["x3db"] - }, - "model/x3d+vrml": { - source: "apache", - compressible: false, - extensions: ["x3dv", "x3dvz"] - }, - "model/x3d+xml": { - source: "iana", - compressible: true, - extensions: ["x3d", "x3dz"] - }, - "model/x3d-vrml": { - source: "iana", - extensions: ["x3dv"] - }, - "multipart/alternative": { - source: "iana", - compressible: false - }, - "multipart/appledouble": { - source: "iana" - }, - "multipart/byteranges": { - source: "iana" - }, - "multipart/digest": { - source: "iana" - }, - "multipart/encrypted": { - source: "iana", - compressible: false - }, - "multipart/form-data": { - source: "iana", - compressible: false - }, - "multipart/header-set": { - source: "iana" - }, - "multipart/mixed": { - source: "iana" - }, - "multipart/multilingual": { - source: "iana" - }, - "multipart/parallel": { - source: "iana" - }, - "multipart/related": { - source: "iana", - compressible: false - }, - "multipart/report": { - source: "iana" - }, - "multipart/signed": { - source: "iana", - compressible: false - }, - "multipart/vnd.bint.med-plus": { - source: "iana" - }, - "multipart/voice-message": { - source: "iana" - }, - "multipart/x-mixed-replace": { - source: "iana" - }, - "text/1d-interleaved-parityfec": { - source: "iana" - }, - "text/cache-manifest": { - source: "iana", - compressible: true, - extensions: ["appcache", "manifest"] - }, - "text/calendar": { - source: "iana", - extensions: ["ics", "ifb"] - }, - "text/calender": { - compressible: true - }, - "text/cmd": { - compressible: true - }, - "text/coffeescript": { - extensions: ["coffee", "litcoffee"] - }, - "text/cql": { - source: "iana" - }, - "text/cql-expression": { - source: "iana" - }, - "text/cql-identifier": { - source: "iana" - }, - "text/css": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["css"] - }, - "text/csv": { - source: "iana", - compressible: true, - extensions: ["csv"] - }, - "text/csv-schema": { - source: "iana" - }, - "text/directory": { - source: "iana" - }, - "text/dns": { - source: "iana" - }, - "text/ecmascript": { - source: "iana" - }, - "text/encaprtp": { - source: "iana" - }, - "text/enriched": { - source: "iana" - }, - "text/fhirpath": { - source: "iana" - }, - "text/flexfec": { - source: "iana" - }, - "text/fwdred": { - source: "iana" - }, - "text/gff3": { - source: "iana" - }, - "text/grammar-ref-list": { - source: "iana" - }, - "text/html": { - source: "iana", - compressible: true, - extensions: ["html", "htm", "shtml"] - }, - "text/jade": { - extensions: ["jade"] - }, - "text/javascript": { - source: "iana", - compressible: true - }, - "text/jcr-cnd": { - source: "iana" - }, - "text/jsx": { - compressible: true, - extensions: ["jsx"] - }, - "text/less": { - compressible: true, - extensions: ["less"] - }, - "text/markdown": { - source: "iana", - compressible: true, - extensions: ["markdown", "md"] - }, - "text/mathml": { - source: "nginx", - extensions: ["mml"] - }, - "text/mdx": { - compressible: true, - extensions: ["mdx"] - }, - "text/mizar": { - source: "iana" - }, - "text/n3": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["n3"] - }, - "text/parameters": { - source: "iana", - charset: "UTF-8" - }, - "text/parityfec": { - source: "iana" - }, - "text/plain": { - source: "iana", - compressible: true, - extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] - }, - "text/provenance-notation": { - source: "iana", - charset: "UTF-8" - }, - "text/prs.fallenstein.rst": { - source: "iana" - }, - "text/prs.lines.tag": { - source: "iana", - extensions: ["dsc"] - }, - "text/prs.prop.logic": { - source: "iana" - }, - "text/raptorfec": { - source: "iana" - }, - "text/red": { - source: "iana" - }, - "text/rfc822-headers": { - source: "iana" - }, - "text/richtext": { - source: "iana", - compressible: true, - extensions: ["rtx"] - }, - "text/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "text/rtp-enc-aescm128": { - source: "iana" - }, - "text/rtploopback": { - source: "iana" - }, - "text/rtx": { - source: "iana" - }, - "text/sgml": { - source: "iana", - extensions: ["sgml", "sgm"] - }, - "text/shaclc": { - source: "iana" - }, - "text/shex": { - source: "iana", - extensions: ["shex"] - }, - "text/slim": { - extensions: ["slim", "slm"] - }, - "text/spdx": { - source: "iana", - extensions: ["spdx"] - }, - "text/strings": { - source: "iana" - }, - "text/stylus": { - extensions: ["stylus", "styl"] - }, - "text/t140": { - source: "iana" - }, - "text/tab-separated-values": { - source: "iana", - compressible: true, - extensions: ["tsv"] - }, - "text/troff": { - source: "iana", - extensions: ["t", "tr", "roff", "man", "me", "ms"] - }, - "text/turtle": { - source: "iana", - charset: "UTF-8", - extensions: ["ttl"] - }, - "text/ulpfec": { - source: "iana" - }, - "text/uri-list": { - source: "iana", - compressible: true, - extensions: ["uri", "uris", "urls"] - }, - "text/vcard": { - source: "iana", - compressible: true, - extensions: ["vcard"] - }, - "text/vnd.a": { - source: "iana" - }, - "text/vnd.abc": { - source: "iana" - }, - "text/vnd.ascii-art": { - source: "iana" - }, - "text/vnd.curl": { - source: "iana", - extensions: ["curl"] - }, - "text/vnd.curl.dcurl": { - source: "apache", - extensions: ["dcurl"] - }, - "text/vnd.curl.mcurl": { - source: "apache", - extensions: ["mcurl"] - }, - "text/vnd.curl.scurl": { - source: "apache", - extensions: ["scurl"] - }, - "text/vnd.debian.copyright": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.dmclientscript": { - source: "iana" - }, - "text/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - source: "iana", - extensions: ["ged"] - }, - "text/vnd.ficlab.flt": { - source: "iana" - }, - "text/vnd.fly": { - source: "iana", - extensions: ["fly"] - }, - "text/vnd.fmi.flexstor": { - source: "iana", - extensions: ["flx"] - }, - "text/vnd.gml": { - source: "iana" - }, - "text/vnd.graphviz": { - source: "iana", - extensions: ["gv"] - }, - "text/vnd.hans": { - source: "iana" - }, - "text/vnd.hgl": { - source: "iana" - }, - "text/vnd.in3d.3dml": { - source: "iana", - extensions: ["3dml"] - }, - "text/vnd.in3d.spot": { - source: "iana", - extensions: ["spot"] - }, - "text/vnd.iptc.newsml": { - source: "iana" - }, - "text/vnd.iptc.nitf": { - source: "iana" - }, - "text/vnd.latex-z": { - source: "iana" - }, - "text/vnd.motorola.reflex": { - source: "iana" - }, - "text/vnd.ms-mediapackage": { - source: "iana" - }, - "text/vnd.net2phone.commcenter.command": { - source: "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - source: "iana" - }, - "text/vnd.senx.warpscript": { - source: "iana" - }, - "text/vnd.si.uricatalogue": { - source: "iana" - }, - "text/vnd.sosi": { - source: "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - source: "iana", - charset: "UTF-8", - extensions: ["jad"] - }, - "text/vnd.trolltech.linguist": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.wap.si": { - source: "iana" - }, - "text/vnd.wap.sl": { - source: "iana" - }, - "text/vnd.wap.wml": { - source: "iana", - extensions: ["wml"] - }, - "text/vnd.wap.wmlscript": { - source: "iana", - extensions: ["wmls"] - }, - "text/vtt": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["vtt"] - }, - "text/x-asm": { - source: "apache", - extensions: ["s", "asm"] - }, - "text/x-c": { - source: "apache", - extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] - }, - "text/x-component": { - source: "nginx", - extensions: ["htc"] - }, - "text/x-fortran": { - source: "apache", - extensions: ["f", "for", "f77", "f90"] - }, - "text/x-gwt-rpc": { - compressible: true - }, - "text/x-handlebars-template": { - extensions: ["hbs"] - }, - "text/x-java-source": { - source: "apache", - extensions: ["java"] - }, - "text/x-jquery-tmpl": { - compressible: true - }, - "text/x-lua": { - extensions: ["lua"] - }, - "text/x-markdown": { - compressible: true, - extensions: ["mkd"] - }, - "text/x-nfo": { - source: "apache", - extensions: ["nfo"] - }, - "text/x-opml": { - source: "apache", - extensions: ["opml"] - }, - "text/x-org": { - compressible: true, - extensions: ["org"] - }, - "text/x-pascal": { - source: "apache", - extensions: ["p", "pas"] - }, - "text/x-processing": { - compressible: true, - extensions: ["pde"] - }, - "text/x-sass": { - extensions: ["sass"] - }, - "text/x-scss": { - extensions: ["scss"] - }, - "text/x-setext": { - source: "apache", - extensions: ["etx"] - }, - "text/x-sfv": { - source: "apache", - extensions: ["sfv"] - }, - "text/x-suse-ymp": { - compressible: true, - extensions: ["ymp"] - }, - "text/x-uuencode": { - source: "apache", - extensions: ["uu"] - }, - "text/x-vcalendar": { - source: "apache", - extensions: ["vcs"] - }, - "text/x-vcard": { - source: "apache", - extensions: ["vcf"] - }, - "text/xml": { - source: "iana", - compressible: true, - extensions: ["xml"] - }, - "text/xml-external-parsed-entity": { - source: "iana" - }, - "text/yaml": { - compressible: true, - extensions: ["yaml", "yml"] - }, - "video/1d-interleaved-parityfec": { - source: "iana" - }, - "video/3gpp": { - source: "iana", - extensions: ["3gp", "3gpp"] - }, - "video/3gpp-tt": { - source: "iana" - }, - "video/3gpp2": { - source: "iana", - extensions: ["3g2"] - }, - "video/av1": { - source: "iana" - }, - "video/bmpeg": { - source: "iana" - }, - "video/bt656": { - source: "iana" - }, - "video/celb": { - source: "iana" - }, - "video/dv": { - source: "iana" - }, - "video/encaprtp": { - source: "iana" - }, - "video/ffv1": { - source: "iana" - }, - "video/flexfec": { - source: "iana" - }, - "video/h261": { - source: "iana", - extensions: ["h261"] - }, - "video/h263": { - source: "iana", - extensions: ["h263"] - }, - "video/h263-1998": { - source: "iana" - }, - "video/h263-2000": { - source: "iana" - }, - "video/h264": { - source: "iana", - extensions: ["h264"] - }, - "video/h264-rcdo": { - source: "iana" - }, - "video/h264-svc": { - source: "iana" - }, - "video/h265": { - source: "iana" - }, - "video/iso.segment": { - source: "iana", - extensions: ["m4s"] - }, - "video/jpeg": { - source: "iana", - extensions: ["jpgv"] - }, - "video/jpeg2000": { - source: "iana" - }, - "video/jpm": { - source: "apache", - extensions: ["jpm", "jpgm"] - }, - "video/jxsv": { - source: "iana" - }, - "video/mj2": { - source: "iana", - extensions: ["mj2", "mjp2"] - }, - "video/mp1s": { - source: "iana" - }, - "video/mp2p": { - source: "iana" - }, - "video/mp2t": { - source: "iana", - extensions: ["ts"] - }, - "video/mp4": { - source: "iana", - compressible: false, - extensions: ["mp4", "mp4v", "mpg4"] - }, - "video/mp4v-es": { - source: "iana" - }, - "video/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] - }, - "video/mpeg4-generic": { - source: "iana" - }, - "video/mpv": { - source: "iana" - }, - "video/nv": { - source: "iana" - }, - "video/ogg": { - source: "iana", - compressible: false, - extensions: ["ogv"] - }, - "video/parityfec": { - source: "iana" - }, - "video/pointer": { - source: "iana" - }, - "video/quicktime": { - source: "iana", - compressible: false, - extensions: ["qt", "mov"] - }, - "video/raptorfec": { - source: "iana" - }, - "video/raw": { - source: "iana" - }, - "video/rtp-enc-aescm128": { - source: "iana" - }, - "video/rtploopback": { - source: "iana" - }, - "video/rtx": { - source: "iana" - }, - "video/scip": { - source: "iana" - }, - "video/smpte291": { - source: "iana" - }, - "video/smpte292m": { - source: "iana" - }, - "video/ulpfec": { - source: "iana" - }, - "video/vc1": { - source: "iana" - }, - "video/vc2": { - source: "iana" - }, - "video/vnd.cctv": { - source: "iana" - }, - "video/vnd.dece.hd": { - source: "iana", - extensions: ["uvh", "uvvh"] - }, - "video/vnd.dece.mobile": { - source: "iana", - extensions: ["uvm", "uvvm"] - }, - "video/vnd.dece.mp4": { - source: "iana" - }, - "video/vnd.dece.pd": { - source: "iana", - extensions: ["uvp", "uvvp"] - }, - "video/vnd.dece.sd": { - source: "iana", - extensions: ["uvs", "uvvs"] - }, - "video/vnd.dece.video": { - source: "iana", - extensions: ["uvv", "uvvv"] - }, - "video/vnd.directv.mpeg": { - source: "iana" - }, - "video/vnd.directv.mpeg-tts": { - source: "iana" - }, - "video/vnd.dlna.mpeg-tts": { - source: "iana" - }, - "video/vnd.dvb.file": { - source: "iana", - extensions: ["dvb"] - }, - "video/vnd.fvt": { - source: "iana", - extensions: ["fvt"] - }, - "video/vnd.hns.video": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.ttsavc": { - source: "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - source: "iana" - }, - "video/vnd.motorola.video": { - source: "iana" - }, - "video/vnd.motorola.videop": { - source: "iana" - }, - "video/vnd.mpegurl": { - source: "iana", - extensions: ["mxu", "m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - source: "iana", - extensions: ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - source: "iana" - }, - "video/vnd.nokia.mp4vr": { - source: "iana" - }, - "video/vnd.nokia.videovoip": { - source: "iana" - }, - "video/vnd.objectvideo": { - source: "iana" - }, - "video/vnd.radgamettools.bink": { - source: "iana" - }, - "video/vnd.radgamettools.smacker": { - source: "iana" - }, - "video/vnd.sealed.mpeg1": { - source: "iana" - }, - "video/vnd.sealed.mpeg4": { - source: "iana" - }, - "video/vnd.sealed.swf": { - source: "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - source: "iana" - }, - "video/vnd.uvvu.mp4": { - source: "iana", - extensions: ["uvu", "uvvu"] - }, - "video/vnd.vivo": { - source: "iana", - extensions: ["viv"] - }, - "video/vnd.youtube.yt": { - source: "iana" - }, - "video/vp8": { - source: "iana" - }, - "video/vp9": { - source: "iana" - }, - "video/webm": { - source: "apache", - compressible: false, - extensions: ["webm"] - }, - "video/x-f4v": { - source: "apache", - extensions: ["f4v"] - }, - "video/x-fli": { - source: "apache", - extensions: ["fli"] - }, - "video/x-flv": { - source: "apache", - compressible: false, - extensions: ["flv"] - }, - "video/x-m4v": { - source: "apache", - extensions: ["m4v"] - }, - "video/x-matroska": { - source: "apache", - compressible: false, - extensions: ["mkv", "mk3d", "mks"] - }, - "video/x-mng": { - source: "apache", - extensions: ["mng"] - }, - "video/x-ms-asf": { - source: "apache", - extensions: ["asf", "asx"] - }, - "video/x-ms-vob": { - source: "apache", - extensions: ["vob"] - }, - "video/x-ms-wm": { - source: "apache", - extensions: ["wm"] - }, - "video/x-ms-wmv": { - source: "apache", - compressible: false, - extensions: ["wmv"] - }, - "video/x-ms-wmx": { - source: "apache", - extensions: ["wmx"] - }, - "video/x-ms-wvx": { - source: "apache", - extensions: ["wvx"] - }, - "video/x-msvideo": { - source: "apache", - extensions: ["avi"] - }, - "video/x-sgi-movie": { - source: "apache", - extensions: ["movie"] - }, - "video/x-smv": { - source: "apache", - extensions: ["smv"] - }, - "x-conference/x-cooltalk": { - source: "apache", - extensions: ["ice"] - }, - "x-shader/x-fragment": { - compressible: true - }, - "x-shader/x-vertex": { - compressible: true - } - }; - } -}); - -// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js -var require_mime_db = __commonJS({ - "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports2, module2) { - module2.exports = require_db(); - } -}); - -// node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js -var require_mime_types = __commonJS({ - "node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports2) { - "use strict"; - var db = require_mime_db(); - var extname = require("path").extname; - var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; - var TEXT_TYPE_REGEXP = /^text\//i; - exports2.charset = charset; - exports2.charsets = { lookup: charset }; - exports2.contentType = contentType; - exports2.extension = extension; - exports2.extensions = /* @__PURE__ */ Object.create(null); - exports2.lookup = lookup; - exports2.types = /* @__PURE__ */ Object.create(null); - populateMaps(exports2.extensions, exports2.types); - function charset(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var mime = match && db[match[1].toLowerCase()]; - if (mime && mime.charset) { - return mime.charset; - } - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return "UTF-8"; - } - return false; - } - function contentType(str) { - if (!str || typeof str !== "string") { - return false; - } - var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str; - if (!mime) { - return false; - } - if (mime.indexOf("charset") === -1) { - var charset2 = exports2.charset(mime); - if (charset2) mime += "; charset=" + charset2.toLowerCase(); - } - return mime; - } - function extension(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var exts = match && exports2.extensions[match[1].toLowerCase()]; - if (!exts || !exts.length) { - return false; - } - return exts[0]; - } - function lookup(path2) { - if (!path2 || typeof path2 !== "string") { - return false; - } - var extension2 = extname("x." + path2).toLowerCase().substr(1); - if (!extension2) { - return false; - } - return exports2.types[extension2] || false; - } - function populateMaps(extensions, types) { - var preference = ["nginx", "apache", void 0, "iana"]; - Object.keys(db).forEach(function forEachMimeType(type) { - var mime = db[type]; - var exts = mime.extensions; - if (!exts || !exts.length) { - return; - } - extensions[type] = exts; - for (var i = 0; i < exts.length; i++) { - var extension2 = exts[i]; - if (types[extension2]) { - var from = preference.indexOf(db[types[extension2]].source); - var to = preference.indexOf(mime.source); - if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) { - continue; - } - } - types[extension2] = type; - } - }); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js -var require_defer = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js"(exports2, module2) { - module2.exports = defer; - function defer(fn) { - var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; - if (nextTick) { - nextTick(fn); - } else { - setTimeout(fn, 0); - } - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js -var require_async = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js"(exports2, module2) { - var defer = require_defer(); - module2.exports = async; - function async(callback) { - var isAsync = false; - defer(function() { - isAsync = true; - }); - return function async_callback(err, result) { - if (isAsync) { - callback(err, result); - } else { - defer(function nextTick_callback() { - callback(err, result); - }); - } - }; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js -var require_abort = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js"(exports2, module2) { - module2.exports = abort; - function abort(state) { - Object.keys(state.jobs).forEach(clean.bind(state)); - state.jobs = {}; - } - function clean(key) { - if (typeof this.jobs[key] == "function") { - this.jobs[key](); - } - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js -var require_iterate = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js"(exports2, module2) { - var async = require_async(); - var abort = require_abort(); - module2.exports = iterate; - function iterate(list, iterator, state, callback) { - var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { - if (!(key in state.jobs)) { - return; - } - delete state.jobs[key]; - if (error) { - abort(state); - } else { - state.results[key] = output; - } - callback(error, state.results); - }); - } - function runJob(iterator, key, item, callback) { - var aborter; - if (iterator.length == 2) { - aborter = iterator(item, async(callback)); - } else { - aborter = iterator(item, key, async(callback)); - } - return aborter; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js -var require_state = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js"(exports2, module2) { - module2.exports = state; - function state(list, sortMethod) { - var isNamedList = !Array.isArray(list), initState = { - index: 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs: {}, - results: isNamedList ? {} : [], - size: isNamedList ? Object.keys(list).length : list.length - }; - if (sortMethod) { - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { - return sortMethod(list[a], list[b]); - }); - } - return initState; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js -var require_terminator = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js"(exports2, module2) { - var abort = require_abort(); - var async = require_async(); - module2.exports = terminator; - function terminator(callback) { - if (!Object.keys(this.jobs).length) { - return; - } - this.index = this.size; - abort(this); - async(callback)(null, this.results); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js -var require_parallel = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = parallel; - function parallel(list, iterator, callback) { - var state = initState(list); - while (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, function(error, result) { - if (error) { - callback(error, result); - return; - } - if (Object.keys(state.jobs).length === 0) { - callback(null, state.results); - return; - } - }); - state.index++; - } - return terminator.bind(state, callback); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js -var require_serialOrdered = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = serialOrdered; - module2.exports.ascending = ascending; - module2.exports.descending = descending; - function serialOrdered(list, iterator, sortMethod, callback) { - var state = initState(list, sortMethod); - iterate(list, iterator, state, function iteratorHandler(error, result) { - if (error) { - callback(error, result); - return; - } - state.index++; - if (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, iteratorHandler); - return; - } - callback(null, state.results); - }); - return terminator.bind(state, callback); - } - function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : 0; - } - function descending(a, b) { - return -1 * ascending(a, b); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js -var require_serial = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js"(exports2, module2) { - var serialOrdered = require_serialOrdered(); - module2.exports = serial; - function serial(list, iterator, callback) { - return serialOrdered(list, iterator, null, callback); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js -var require_asynckit = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js"(exports2, module2) { - module2.exports = { - parallel: require_parallel(), - serial: require_serial(), - serialOrdered: require_serialOrdered() - }; - } -}); - -// node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js -var require_es_object_atoms = __commonJS({ - "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports2, module2) { - "use strict"; - module2.exports = Object; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js -var require_es_errors = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports2, module2) { - "use strict"; - module2.exports = Error; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js -var require_eval = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports2, module2) { - "use strict"; - module2.exports = EvalError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js -var require_range = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports2, module2) { - "use strict"; - module2.exports = RangeError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js -var require_ref = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports2, module2) { - "use strict"; - module2.exports = ReferenceError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js -var require_syntax = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports2, module2) { - "use strict"; - module2.exports = SyntaxError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js -var require_type = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports2, module2) { - "use strict"; - module2.exports = TypeError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js -var require_uri = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports2, module2) { - "use strict"; - module2.exports = URIError; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js -var require_abs = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports2, module2) { - "use strict"; - module2.exports = Math.abs; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js -var require_floor = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports2, module2) { - "use strict"; - module2.exports = Math.floor; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js -var require_max = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports2, module2) { - "use strict"; - module2.exports = Math.max; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js -var require_min = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports2, module2) { - "use strict"; - module2.exports = Math.min; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js -var require_pow = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports2, module2) { - "use strict"; - module2.exports = Math.pow; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js -var require_round = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports2, module2) { - "use strict"; - module2.exports = Math.round; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js -var require_isNaN = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports2, module2) { - "use strict"; - module2.exports = Number.isNaN || function isNaN2(a) { - return a !== a; - }; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js -var require_sign = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports2, module2) { - "use strict"; - var $isNaN = require_isNaN(); - module2.exports = function sign(number) { - if ($isNaN(number) || number === 0) { - return number; - } - return number < 0 ? -1 : 1; - }; - } -}); - -// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js -var require_gOPD = __commonJS({ - "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports2, module2) { - "use strict"; - module2.exports = Object.getOwnPropertyDescriptor; - } -}); - -// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js -var require_gopd = __commonJS({ - "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports2, module2) { - "use strict"; - var $gOPD = require_gOPD(); - if ($gOPD) { - try { - $gOPD([], "length"); - } catch (e) { - $gOPD = null; - } - } - module2.exports = $gOPD; - } -}); - -// node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js -var require_es_define_property = __commonJS({ - "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports2, module2) { - "use strict"; - var $defineProperty = Object.defineProperty || false; - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = false; - } - } - module2.exports = $defineProperty; - } -}); - -// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js -var require_shams = __commonJS({ - "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports2, module2) { - "use strict"; - module2.exports = function hasSymbols() { - if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { - return false; - } - if (typeof Symbol.iterator === "symbol") { - return true; - } - var obj = {}; - var sym = Symbol("test"); - var symObj = Object(sym); - if (typeof sym === "string") { - return false; - } - if (Object.prototype.toString.call(sym) !== "[object Symbol]") { - return false; - } - if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { - return false; - } - var symVal = 42; - obj[sym] = symVal; - for (var _ in obj) { - return false; - } - if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { - return false; - } - if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { - return false; - } - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { - return false; - } - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { - return false; - } - if (typeof Object.getOwnPropertyDescriptor === "function") { - var descriptor = ( - /** @type {PropertyDescriptor} */ - Object.getOwnPropertyDescriptor(obj, sym) - ); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { - return false; - } - } - return true; - }; - } -}); - -// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js -var require_has_symbols = __commonJS({ - "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports2, module2) { - "use strict"; - var origSymbol = typeof Symbol !== "undefined" && Symbol; - var hasSymbolSham = require_shams(); - module2.exports = function hasNativeSymbols() { - if (typeof origSymbol !== "function") { - return false; - } - if (typeof Symbol !== "function") { - return false; - } - if (typeof origSymbol("foo") !== "symbol") { - return false; - } - if (typeof Symbol("bar") !== "symbol") { - return false; - } - return hasSymbolSham(); - }; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js -var require_Reflect_getPrototypeOf = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js -var require_Object_getPrototypeOf = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports2, module2) { - "use strict"; - var $Object = require_es_object_atoms(); - module2.exports = $Object.getPrototypeOf || null; - } -}); - -// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js -var require_implementation = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module2) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var toStr = Object.prototype.toString; - var max = Math.max; - var funcType = "[object Function]"; - var concatty = function concatty2(a, b) { - var arr = []; - for (var i = 0; i < a.length; i += 1) { - arr[i] = a[i]; - } - for (var j = 0; j < b.length; j += 1) { - arr[j + a.length] = b[j]; - } - return arr; - }; - var slicy = function slicy2(arrLike, offset) { - var arr = []; - for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { - arr[j] = arrLike[i]; - } - return arr; - }; - var joiny = function(arr, joiner) { - var str = ""; - for (var i = 0; i < arr.length; i += 1) { - str += arr[i]; - if (i + 1 < arr.length) { - str += joiner; - } - } - return str; - }; - module2.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); - var bound; - var binder = function() { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) - ); - }; - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = "$" + i; - } - bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); - if (target.prototype) { - var Empty = function Empty2() { - }; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - } -}); - -// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js -var require_function_bind = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module2) { - "use strict"; - var implementation = require_implementation(); - module2.exports = Function.prototype.bind || implementation; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js -var require_functionCall = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.call; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js -var require_functionApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.apply; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js -var require_reflectApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js -var require_actualApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports2, module2) { - "use strict"; - var bind = require_function_bind(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var $reflectApply = require_reflectApply(); - module2.exports = $reflectApply || bind.call($call, $apply); - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js -var require_call_bind_apply_helpers = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports2, module2) { - "use strict"; - var bind = require_function_bind(); - var $TypeError = require_type(); - var $call = require_functionCall(); - var $actualApply = require_actualApply(); - module2.exports = function callBindBasic(args) { - if (args.length < 1 || typeof args[0] !== "function") { - throw new $TypeError("a function is required"); - } - return $actualApply(bind, $call, args); - }; - } -}); - -// node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js -var require_get = __commonJS({ - "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports2, module2) { - "use strict"; - var callBind = require_call_bind_apply_helpers(); - var gOPD = require_gopd(); - var hasProtoAccessor; - try { - hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ - [].__proto__ === Array.prototype; - } catch (e) { - if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") { - throw e; - } - } - var desc = !!hasProtoAccessor && gOPD && gOPD( - Object.prototype, - /** @type {keyof typeof Object.prototype} */ - "__proto__" - ); - var $Object = Object; - var $getPrototypeOf = $Object.getPrototypeOf; - module2.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? ( - /** @type {import('./get')} */ - function getDunder(value) { - return $getPrototypeOf(value == null ? value : $Object(value)); - } - ) : false; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js -var require_get_proto = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports2, module2) { - "use strict"; - var reflectGetProto = require_Reflect_getPrototypeOf(); - var originalGetProto = require_Object_getPrototypeOf(); - var getDunderProto = require_get(); - module2.exports = reflectGetProto ? function getProto(O) { - return reflectGetProto(O); - } : originalGetProto ? function getProto(O) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new TypeError("getProto: not an object"); - } - return originalGetProto(O); - } : getDunderProto ? function getProto(O) { - return getDunderProto(O); - } : null; - } -}); - -// node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js -var require_hasown = __commonJS({ - "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports2, module2) { - "use strict"; - var call = Function.prototype.call; - var $hasOwn = Object.prototype.hasOwnProperty; - var bind = require_function_bind(); - module2.exports = bind.call(call, $hasOwn); - } -}); - -// node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js -var require_get_intrinsic = __commonJS({ - "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(exports2, module2) { - "use strict"; - var undefined2; - var $Object = require_es_object_atoms(); - var $Error = require_es_errors(); - var $EvalError = require_eval(); - var $RangeError = require_range(); - var $ReferenceError = require_ref(); - var $SyntaxError = require_syntax(); - var $TypeError = require_type(); - var $URIError = require_uri(); - var abs = require_abs(); - var floor = require_floor(); - var max = require_max(); - var min = require_min(); - var pow = require_pow(); - var round = require_round(); - var sign = require_sign(); - var $Function = Function; - var getEvalledConstructor = function(expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) { - } - }; - var $gOPD = require_gopd(); - var $defineProperty = require_es_define_property(); - var throwTypeError = function() { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD ? function() { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }() : throwTypeError; - var hasSymbols = require_has_symbols()(); - var getProto = require_get_proto(); - var $ObjectGPO = require_Object_getPrototypeOf(); - var $ReflectGPO = require_Reflect_getPrototypeOf(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - __proto__: null, - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": $Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": $EvalError, - "%Float16Array%": typeof Float16Array === "undefined" ? undefined2 : Float16Array, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": $Object, - "%Object.getOwnPropertyDescriptor%": $gOPD, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": $RangeError, - "%ReferenceError%": $ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": $URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, - "%Function.prototype.call%": $call, - "%Function.prototype.apply%": $apply, - "%Object.defineProperty%": $defineProperty, - "%Object.getPrototypeOf%": $ObjectGPO, - "%Math.abs%": abs, - "%Math.floor%": floor, - "%Math.max%": max, - "%Math.min%": min, - "%Math.pow%": pow, - "%Math.round%": round, - "%Math.sign%": sign, - "%Reflect.getPrototypeOf%": $ReflectGPO - }; - if (getProto) { - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen && getProto) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - __proto__: null, - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"] - }; - var bind = require_function_bind(); - var hasOwn = require_hasown(); - var $concat = bind.call($call, Array.prototype.concat); - var $spliceApply = bind.call($apply, Array.prototype.splice); - var $replace = bind.call($call, String.prototype.replace); - var $strSlice = bind.call($call, String.prototype.slice); - var $exec = bind.call($call, RegExp.prototype.exec); - var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === "%" && last !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last === "%" && first !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function(match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module2.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void 0; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - } -}); - -// node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js -var require_shams2 = __commonJS({ - "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports2, module2) { - "use strict"; - var hasSymbols = require_shams(); - module2.exports = function hasToStringTagShams() { - return hasSymbols() && !!Symbol.toStringTag; - }; - } -}); - -// node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js -var require_es_set_tostringtag = __commonJS({ - "node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js"(exports2, module2) { - "use strict"; - var GetIntrinsic = require_get_intrinsic(); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); - var hasToStringTag = require_shams2()(); - var hasOwn = require_hasown(); - var $TypeError = require_type(); - var toStringTag = hasToStringTag ? Symbol.toStringTag : null; - module2.exports = function setToStringTag(object, value) { - var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; - var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; - if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") { - throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans"); - } - if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { - if ($defineProperty) { - $defineProperty(object, toStringTag, { - configurable: !nonConfigurable, - enumerable: false, - value, - writable: false - }); - } else { - object[toStringTag] = value; - } - } - }; - } -}); - -// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js -var require_populate = __commonJS({ - "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js"(exports2, module2) { - "use strict"; - module2.exports = function(dst, src) { - Object.keys(src).forEach(function(prop) { - dst[prop] = dst[prop] || src[prop]; - }); - return dst; - }; - } -}); - -// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js -var require_form_data = __commonJS({ - "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js"(exports2, module2) { - "use strict"; - var CombinedStream = require_combined_stream(); - var util = require("util"); - var path2 = require("path"); - var http = require("http"); - var https = require("https"); - var parseUrl = require("url").parse; - var fs2 = require("fs"); - var Stream = require("stream").Stream; - var crypto = require("crypto"); - var mime = require_mime_types(); - var asynckit = require_asynckit(); - var setToStringTag = require_es_set_tostringtag(); - var hasOwn = require_hasown(); - var populate = require_populate(); - function FormData2(options) { - if (!(this instanceof FormData2)) { - return new FormData2(options); - } - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; - CombinedStream.call(this); - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } - } - util.inherits(FormData2, CombinedStream); - FormData2.LINE_BREAK = "\r\n"; - FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; - FormData2.prototype.append = function(field, value, options) { - options = options || {}; - if (typeof options === "string") { - options = { filename: options }; - } - var append = CombinedStream.prototype.append.bind(this); - if (typeof value === "number" || value == null) { - value = String(value); - } - if (Array.isArray(value)) { - this._error(new Error("Arrays are not supported.")); - return; - } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); - append(header); - append(value); - append(footer); - this._trackLength(header, value, options); - }; - FormData2.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - if (options.knownLength != null) { - valueLength += Number(options.knownLength); - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === "string") { - valueLength = Buffer.byteLength(value); - } - this._valueLength += valueLength; - this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; - if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) { - return; - } - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } - }; - FormData2.prototype._lengthRetriever = function(value, callback) { - if (hasOwn(value, "fd")) { - if (value.end != void 0 && value.end != Infinity && value.start != void 0) { - callback(null, value.end + 1 - (value.start ? value.start : 0)); - } else { - fs2.stat(value.path, function(err, stat) { - if (err) { - callback(err); - return; - } - var fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - } else if (hasOwn(value, "httpVersion")) { - callback(null, Number(value.headers["content-length"])); - } else if (hasOwn(value, "httpModule")) { - value.on("response", function(response) { - value.pause(); - callback(null, Number(response.headers["content-length"])); - }); - value.resume(); - } else { - callback("Unknown stream"); - } - }; - FormData2.prototype._multiPartHeader = function(field, value, options) { - if (typeof options.header === "string") { - return options.header; - } - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); - var contents = ""; - var headers = { - // add custom disposition as third element or keep it two elements if not - "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - "Content-Type": [].concat(contentType || []) - }; - if (typeof options.header === "object") { - populate(headers, options.header); - } - var header; - for (var prop in headers) { - if (hasOwn(headers, prop)) { - header = headers[prop]; - if (header == null) { - continue; - } - if (!Array.isArray(header)) { - header = [header]; - } - if (header.length) { - contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK; - } - } - } - return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; - }; - FormData2.prototype._getContentDisposition = function(value, options) { - var filename; - if (typeof options.filepath === "string") { - filename = path2.normalize(options.filepath).replace(/\\/g, "/"); - } else if (options.filename || value && (value.name || value.path)) { - filename = path2.basename(options.filename || value && (value.name || value.path)); - } else if (value && value.readable && hasOwn(value, "httpVersion")) { - filename = path2.basename(value.client._httpMessage.path || ""); - } - if (filename) { - return 'filename="' + filename + '"'; - } - }; - FormData2.prototype._getContentType = function(value, options) { - var contentType = options.contentType; - if (!contentType && value && value.name) { - contentType = mime.lookup(value.name); - } - if (!contentType && value && value.path) { - contentType = mime.lookup(value.path); - } - if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) { - contentType = value.headers["content-type"]; - } - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } - if (!contentType && value && typeof value === "object") { - contentType = FormData2.DEFAULT_CONTENT_TYPE; - } - return contentType; - }; - FormData2.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData2.LINE_BREAK; - var lastPart = this._streams.length === 0; - if (lastPart) { - footer += this._lastBoundary(); - } - next(footer); - }.bind(this); - }; - FormData2.prototype._lastBoundary = function() { - return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK; - }; - FormData2.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - "content-type": "multipart/form-data; boundary=" + this.getBoundary() - }; - for (header in userHeaders) { - if (hasOwn(userHeaders, header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } - return formHeaders; - }; - FormData2.prototype.setBoundary = function(boundary) { - if (typeof boundary !== "string") { - throw new TypeError("FormData boundary must be a string"); - } - this._boundary = boundary; - }; - FormData2.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - return this._boundary; - }; - FormData2.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc(0); - var boundary = this.getBoundary(); - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== "function") { - if (Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); - } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); - } - if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]); - } - } - } - return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); - }; - FormData2.prototype._generateBoundary = function() { - this._boundary = "--------------------------" + crypto.randomBytes(12).toString("hex"); - }; - FormData2.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this.hasKnownLength()) { - this._error(new Error("Cannot calculate proper length in synchronous way.")); - } - return knownLength; - }; - FormData2.prototype.hasKnownLength = function() { - var hasKnownLength = true; - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } - return hasKnownLength; - }; - FormData2.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; - } - values.forEach(function(length) { - knownLength += length; - }); - cb(null, knownLength); - }); - }; - FormData2.prototype.submit = function(params, cb) { - var request; - var options; - var defaults = { method: "post" }; - if (typeof params === "string") { - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); - } else { - options = populate(params, defaults); - if (!options.port) { - options.port = options.protocol === "https:" ? 443 : 80; - } - } - options.headers = this.getHeaders(params.headers); - if (options.protocol === "https:") { - request = https.request(options); - } else { - request = http.request(options); - } - this.getLength(function(err, length) { - if (err && err !== "Unknown stream") { - this._error(err); - return; - } - if (length) { - request.setHeader("Content-Length", length); - } - this.pipe(request); - if (cb) { - var onResponse; - var callback = function(error, responce) { - request.removeListener("error", callback); - request.removeListener("response", onResponse); - return cb.call(this, error, responce); - }; - onResponse = callback.bind(this, null); - request.on("error", callback); - request.on("response", onResponse); - } - }.bind(this)); - return request; - }; - FormData2.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit("error", err); - } - }; - FormData2.prototype.toString = function() { - return "[object FormData]"; - }; - setToStringTag(FormData2, "FormData"); - module2.exports = FormData2; - } -}); - -// node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js -var require_proxy_from_env = __commonJS({ - "node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"(exports2) { - "use strict"; - var parseUrl = require("url").parse; - var DEFAULT_PORTS = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var stringEndsWith = String.prototype.endsWith || function(s) { - return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; - }; - function getProxyForUrl(url) { - var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { - return ""; - } - proto = proto.split(":", 1)[0]; - hostname = hostname.replace(/:\d*$/, ""); - port = parseInt(port) || DEFAULT_PORTS[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ""; - } - var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); - if (proxy && proxy.indexOf("://") === -1) { - proxy = proto + "://" + proxy; - } - return proxy; - } - function shouldProxy(hostname, port) { - var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); - if (!NO_PROXY) { - return true; - } - if (NO_PROXY === "*") { - return false; - } - return NO_PROXY.split(/[,\s]/).every(function(proxy) { - if (!proxy) { - return true; - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; - } - if (!/^[.*]/.test(parsedProxyHostname)) { - return hostname !== parsedProxyHostname; - } - if (parsedProxyHostname.charAt(0) === "*") { - parsedProxyHostname = parsedProxyHostname.slice(1); - } - return !stringEndsWith.call(hostname, parsedProxyHostname); - }); - } - function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; - } - exports2.getProxyForUrl = getProxyForUrl; - } -}); - -// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ - "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug; - module2.exports = function() { - if (!debug) { - try { - debug = require_src()("follow-redirects"); - } catch (error) { - } - if (typeof debug !== "function") { - debug = function() { - }; - } - } - debug.apply(null, arguments); - }; - } -}); - -// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js"(exports2, module2) { - var url = require("url"); - var URL2 = url.URL; - var http = require("http"); - var https = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug = require_debug2(); - (function detectUnsupportedEnvironment() { - var looksLikeNode = typeof process !== "undefined"; - var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; - var looksLikeV8 = isFunction(Error.captureStackTrace); - if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { - console.warn("The follow-redirects package should be excluded from browser builds."); - } - })(); - var useNativeURL = false; - try { - assert(new URL2("")); - } catch (error) { - useNativeURL = error.code === "ERR_INVALID_URL"; - } - var preservedUrlFields = [ - "auth", - "host", - "hostname", - "href", - "path", - "pathname", - "port", - "protocol", - "query", - "search", - "hash" - ]; - var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; - var eventHandlers = /* @__PURE__ */ Object.create(null); - events.forEach(function(event) { - eventHandlers[event] = function(arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; - }); - var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError - ); - var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" - ); - var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded", - RedirectionError - ); - var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" - ); - var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" - ); - var destroy = Writable.prototype.destroy || noop; - function RedirectableRequest(options, responseCallback) { - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - if (responseCallback) { - this.on("response", responseCallback); - } - var self2 = this; - this._onNativeResponse = function(response) { - try { - self2._processResponse(response); - } catch (cause) { - self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); - } - }; - this._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); - }; - RedirectableRequest.prototype.destroy = function(error) { - destroyRequest(this._currentRequest, error); - destroy.call(this, error); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data, encoding }); - this._currentRequest.write(data, encoding, callback); - } else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } - }; - RedirectableRequest.prototype.end = function(data, encoding, callback) { - if (isFunction(data)) { - callback = data; - data = encoding = null; - } else if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } else { - var self2 = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function() { - self2._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } - }; - RedirectableRequest.prototype.setHeader = function(name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); - }; - RedirectableRequest.prototype.removeHeader = function(name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); - }; - RedirectableRequest.prototype.setTimeout = function(msecs, callback) { - var self2 = this; - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - function startTimer(socket) { - if (self2._timeout) { - clearTimeout(self2._timeout); - } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; - } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); - } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); - } - } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); - } - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - this.on("close", clearTimer); - return this; - }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); - }; - }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - throw new TypeError("Unsupported protocol " + protocol); - } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : ( - // When making a request to a proxy, [โ€ฆ] - // a client MUST send the target URI in absolute-form [โ€ฆ]. - this._options.path - ); - if (this._isRedirect) { - var i = 0; - var self2 = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - if (request === self2._currentRequest) { - if (error) { - self2.emit("error", error); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request.end(); - } - } - })(); - } - }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode - }); - } - var location = response.headers.location; - if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - this._requestBodyBuffers = []; - return; - } - destroyRequest(this._currentRequest); - response.destroy(); - if (++this._redirectCount > this._options.maxRedirects) { - throw new TooManyRedirectsError(); - } - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host") - }, this._options.headers); - } - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231ยง6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource [โ€ฆ] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) [โ€ฆ] - statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = parseUrl(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl = resolveUrl(location, currentUrl); - debug("redirecting to", redirectUrl.href); - this._isRedirect = true; - spreadUrlObject(redirectUrl, this._options); - if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); - } - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode - }; - var requestDetails = { - url: currentUrl, - method, - headers: requestHeaders - }; - beforeRedirect(this._options, responseDetails, requestDetails); - this._sanitizeOptions(this._options); - } - this._performRequest(); - }; - function wrap(protocols) { - var exports3 = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024 - }; - var nativeProtocols = {}; - Object.keys(protocols).forEach(function(scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); - function request(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString(input)) { - input = spreadUrlObject(parseUrl(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; - } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); - }); - return exports3; - } - function noop() { - } - function parseUrl(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); - } else { - parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; - } - function resolveUrl(relative, base) { - return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); - } - function validateUrl(input) { - if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { - throw new InvalidUrlError({ input: input.href || input }); - } - if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { - throw new InvalidUrlError({ input: input.href || input }); - } - return input; - } - function spreadUrlObject(urlObject, target) { - var spread = target || {}; - for (var key of preservedUrlFields) { - spread[key] = urlObject[key]; - } - if (spread.hostname.startsWith("[")) { - spread.hostname = spread.hostname.slice(1, -1); - } - if (spread.port !== "") { - spread.port = Number(spread.port); - } - spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; - return spread; - } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); - } - function createErrorType(code, message, baseClass) { - function CustomError(properties) { - if (isFunction(Error.captureStackTrace)) { - Error.captureStackTrace(this, this.constructor); - } - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - CustomError.prototype = new (baseClass || Error)(); - Object.defineProperties(CustomError.prototype, { - constructor: { - value: CustomError, - enumerable: false - }, - name: { - value: "Error [" + code + "]", - enumerable: false - } - }); - return CustomError; - } - function destroyRequest(request, error) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.destroy(error); - } - function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isString(value) { - return typeof value === "string" || value instanceof String; - } - function isFunction(value) { - return typeof value === "function"; - } - function isBuffer(value) { - return typeof value === "object" && "length" in value; - } - function isURL(value) { - return URL2 && value instanceof URL2; - } - module2.exports = wrap({ http, https }); - module2.exports.wrap = wrap; - } -}); - -// node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs -var require_axios = __commonJS({ - "node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs"(exports2, module2) { - "use strict"; - var FormData$1 = require_form_data(); - var crypto = require("crypto"); - var url = require("url"); - var http2 = require("http2"); - var proxyFromEnv = require_proxy_from_env(); - var http = require("http"); - var https = require("https"); - var util = require("util"); - var followRedirects = require_follow_redirects(); - var zlib = require("zlib"); - var stream = require("stream"); - var events = require("events"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1); - var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto); - var url__default = /* @__PURE__ */ _interopDefaultLegacy(url); - var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv); - var http__default = /* @__PURE__ */ _interopDefaultLegacy(http); - var https__default = /* @__PURE__ */ _interopDefaultLegacy(https); - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects); - var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib); - var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream); - function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; - } - var { toString } = Object.prototype; - var { getPrototypeOf } = Object; - var { iterator, toStringTag } = Symbol; - var kindOf = /* @__PURE__ */ ((cache) => (thing) => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); - })(/* @__PURE__ */ Object.create(null)); - var kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type; - }; - var typeOfTest = (type) => (thing) => typeof thing === type; - var { isArray } = Array; - var isUndefined = typeOfTest("undefined"); - function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); - } - var isArrayBuffer = kindOfTest("ArrayBuffer"); - function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; - } - var isString = typeOfTest("string"); - var isFunction$1 = typeOfTest("function"); - var isNumber = typeOfTest("number"); - var isObject = (thing) => thing !== null && typeof thing === "object"; - var isBoolean = (thing) => thing === true || thing === false; - var isPlainObject = (val) => { - if (kindOf(val) !== "object") { - return false; - } - const prototype2 = getPrototypeOf(val); - return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val); - }; - var isEmptyObject = (val) => { - if (!isObject(val) || isBuffer(val)) { - return false; - } - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - return false; - } - }; - var isDate = kindOfTest("Date"); - var isFile = kindOfTest("File"); - var isBlob = kindOfTest("Blob"); - var isFileList = kindOfTest("FileList"); - var isStream = (val) => isObject(val) && isFunction$1(val.pipe); - var isFormData = (thing) => { - let kind; - return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance - kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); - }; - var isURLSearchParams = kindOfTest("URLSearchParams"); - var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); - var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); - function forEach(obj, fn, { allOwnKeys = false } = {}) { - if (obj === null || typeof obj === "undefined") { - return; - } - let i; - let l; - if (typeof obj !== "object") { - obj = [obj]; - } - if (isArray(obj)) { - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - if (isBuffer(obj)) { - return; - } - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } - } - function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; - } - var _global = (() => { - if (typeof globalThis !== "undefined") return globalThis; - return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; - })(); - var isContextDefined = (context) => !isUndefined(context) && context !== _global; - function merge() { - const { caseless, skipUndefined } = isContextDefined(this) && this || {}; - const result = {}; - const assignValue = (val, key) => { - const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) { - result[targetKey] = merge(result[targetKey], val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - for (let i = 0, l = arguments.length; i < l; i++) { - arguments[i] && forEach(arguments[i], assignValue); - } - return result; - } - var extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach(b, (val, key) => { - if (thisArg && isFunction$1(val)) { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }, { allOwnKeys }); - return a; - }; - var stripBOM = (content) => { - if (content.charCodeAt(0) === 65279) { - content = content.slice(1); - } - return content; - }; - var inherits = (constructor, superConstructor, props, descriptors2) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors2); - constructor.prototype.constructor = constructor; - Object.defineProperty(constructor, "super", { - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); - }; - var toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - destObj = destObj || {}; - if (sourceObj == null) return destObj; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; - }; - var endsWith = (str, searchString, position) => { - str = String(str); - if (position === void 0 || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - var toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; - }; - var isTypedArray = /* @__PURE__ */ ((TypedArray) => { - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; - })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); - var forEachEntry = (obj, fn) => { - const generator = obj && obj[iterator]; - const _iterator = generator.call(obj); - let result; - while ((result = _iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } - }; - var matchAll = (regExp, str) => { - let matches; - const arr = []; - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - return arr; - }; - var isHTMLForm = kindOfTest("HTMLFormElement"); - var toCamelCase = (str) => { - return str.toLowerCase().replace( - /[-_\s]([a-z\d])(\w*)/g, - function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - } - ); - }; - var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); - var isRegExp = kindOfTest("RegExp"); - var reduceDescriptors = (obj, reducer) => { - const descriptors2 = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - forEach(descriptors2, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - Object.defineProperties(obj, reducedDescriptors); - }; - var freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { - return false; - } - const value = obj[name]; - if (!isFunction$1(value)) return; - descriptor.enumerable = false; - if ("writable" in descriptor) { - descriptor.writable = false; - return; - } - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); - }; - var toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - const define = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - return obj; - }; - var noop = () => { - }; - var toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; - }; - function isSpecCompliantForm(thing) { - return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); - } - var toJSONObject = (obj) => { - const stack = new Array(10); - const visit = (source, i) => { - if (isObject(source)) { - if (stack.indexOf(source) >= 0) { - return; - } - if (isBuffer(source)) { - return source; - } - if (!("toJSON" in source)) { - stack[i] = source; - const target = isArray(source) ? [] : {}; - forEach(source, (value, key) => { - const reducedValue = visit(value, i + 1); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - stack[i] = void 0; - return target; - } - } - return source; - }; - return visit(obj, 0); - }; - var isAsyncFn = kindOfTest("AsyncFunction"); - var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); - var _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener("message", ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, "*"); - }; - })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); - })( - typeof setImmediate === "function", - isFunction$1(_global.postMessage) - ); - var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; - var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); - var utils$1 = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isBlob, - isRegExp, - isFunction: isFunction$1, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, - // an alias to avoid ESLint no-prototype-builtins detection - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable - }; - function AxiosError(message, code, config, request, response) { - Error.call(this); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = new Error().stack; - } - this.message = message; - this.name = "AxiosError"; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status ? response.status : null; - } - } - utils$1.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: utils$1.toJSONObject(this.config), - code: this.code, - status: this.status - }; - } - }); - var prototype$1 = AxiosError.prototype; - var descriptors = {}; - [ - "ERR_BAD_OPTION_VALUE", - "ERR_BAD_OPTION", - "ECONNABORTED", - "ETIMEDOUT", - "ERR_NETWORK", - "ERR_FR_TOO_MANY_REDIRECTS", - "ERR_DEPRECATED", - "ERR_BAD_RESPONSE", - "ERR_BAD_REQUEST", - "ERR_CANCELED", - "ERR_NOT_SUPPORT", - "ERR_INVALID_URL" - // eslint-disable-next-line func-names - ].forEach((code) => { - descriptors[code] = { value: code }; - }); - Object.defineProperties(AxiosError, descriptors); - Object.defineProperty(prototype$1, "isAxiosError", { value: true }); - AxiosError.from = (error, code, config, request, response, customProps) => { - const axiosError = Object.create(prototype$1); - utils$1.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }, (prop) => { - return prop !== "isAxiosError"; - }); - const msg = error && error.message ? error.message : "Error"; - const errCode = code == null && error ? error.code : code; - AxiosError.call(axiosError, msg, errCode, config, request, response); - if (error && axiosError.cause == null) { - Object.defineProperty(axiosError, "cause", { value: error, configurable: true }); - } - axiosError.name = error && error.name || "Error"; - customProps && Object.assign(axiosError, customProps); - return axiosError; - }; - function isVisitable(thing) { - return utils$1.isPlainObject(thing) || utils$1.isArray(thing); - } - function removeBrackets(key) { - return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key; - } - function renderKey(path2, key, dots) { - if (!path2) return key; - return path2.concat(key).map(function each(token, i) { - token = removeBrackets(token); - return !dots && i ? "[" + token + "]" : token; - }).join(dots ? "." : ""); - } - function isFlatArray(arr) { - return utils$1.isArray(arr) && !arr.some(isVisitable); - } - var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); - }); - function toFormData(obj, formData, options) { - if (!utils$1.isObject(obj)) { - throw new TypeError("target must be an object"); - } - formData = formData || new (FormData__default["default"] || FormData)(); - options = utils$1.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - return !utils$1.isUndefined(source[option]); - }); - const metaTokens = options.metaTokens; - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; - const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); - if (!utils$1.isFunction(visitor)) { - throw new TypeError("visitor must be a function"); - } - function convertValue(value) { - if (value === null) return ""; - if (utils$1.isDate(value)) { - return value.toISOString(); - } - if (utils$1.isBoolean(value)) { - return value.toString(); - } - if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError("Blob is not supported. Use a Buffer instead."); - } - if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); - } - return value; - } - function defaultVisitor(value, key, path2) { - let arr = value; - if (value && !path2 && typeof value === "object") { - if (utils$1.endsWith(key, "{}")) { - key = metaTokens ? key : key.slice(0, -2); - value = JSON.stringify(value); - } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) { - key = removeBrackets(key); - arr.forEach(function each(el, index) { - !(utils$1.isUndefined(el) || el === null) && formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", - convertValue(el) - ); - }); - return false; - } - } - if (isVisitable(value)) { - return true; - } - formData.append(renderKey(path2, key, dots), convertValue(value)); - return false; - } - const stack = []; - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable - }); - function build2(value, path2) { - if (utils$1.isUndefined(value)) return; - if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path2.join(".")); - } - stack.push(value); - utils$1.forEach(value, function each(el, key) { - const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( - formData, - el, - utils$1.isString(key) ? key.trim() : key, - path2, - exposedHelpers - ); - if (result === true) { - build2(el, path2 ? path2.concat(key) : [key]); - } - }); - stack.pop(); - } - if (!utils$1.isObject(obj)) { - throw new TypeError("data must be an object"); - } - build2(obj); - return formData; - } - function encode$1(str) { - const charMap = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - "%00": "\0" - }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { - return charMap[match]; - }); - } - function AxiosURLSearchParams(params, options) { - this._pairs = []; - params && toFormData(params, this, options); - } - var prototype = AxiosURLSearchParams.prototype; - prototype.append = function append(name, value) { - this._pairs.push([name, value]); - }; - prototype.toString = function toString2(encoder) { - const _encode = encoder ? function(value) { - return encoder.call(this, value, encode$1); - } : encode$1; - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + "=" + _encode(pair[1]); - }, "").join("&"); - }; - function encode(val) { - return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); - } - function buildURL(url2, params, options) { - if (!params) { - return url2; - } - const _encode = options && options.encode || encode; - if (utils$1.isFunction(options)) { - options = { - serialize: options - }; - } - const serializeFn = options && options.serialize; - let serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, options); - } else { - serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode); - } - if (serializedParams) { - const hashmarkIndex = url2.indexOf("#"); - if (hashmarkIndex !== -1) { - url2 = url2.slice(0, hashmarkIndex); - } - url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams; - } - return url2; - } - var InterceptorManager = class { - constructor() { - this.handlers = []; - } - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } - }; - var InterceptorManager$1 = InterceptorManager; - var transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }; - var URLSearchParams2 = url__default["default"].URLSearchParams; - var ALPHA = "abcdefghijklmnopqrstuvwxyz"; - var DIGIT = "0123456789"; - var ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT - }; - var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { - let str = ""; - const { length } = alphabet; - const randomValues = new Uint32Array(size); - crypto__default["default"].randomFillSync(randomValues); - for (let i = 0; i < size; i++) { - str += alphabet[randomValues[i] % length]; - } - return str; - }; - var platform$1 = { - isNode: true, - classes: { - URLSearchParams: URLSearchParams2, - FormData: FormData__default["default"], - Blob: typeof Blob !== "undefined" && Blob || null - }, - ALPHABET, - generateString, - protocols: ["http", "https", "file", "data"] - }; - var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; - var _navigator = typeof navigator === "object" && navigator || void 0; - var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); - var hasStandardBrowserWebWorkerEnv = (() => { - return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; - })(); - var origin = hasBrowserEnv && window.location.href || "http://localhost"; - var utils = /* @__PURE__ */ Object.freeze({ - __proto__: null, - hasBrowserEnv, - hasStandardBrowserWebWorkerEnv, - hasStandardBrowserEnv, - navigator: _navigator, - origin - }); - var platform = { - ...utils, - ...platform$1 - }; - function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), { - visitor: function(value, key, path2, helpers) { - if (platform.isNode && utils$1.isBuffer(value)) { - this.append(key, value.toString("base64")); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - }, - ...options - }); - } - function parsePropPath(name) { - return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { - return match[0] === "[]" ? "" : match[1] || match[0]; - }); - } - function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; - } - function formDataToJSON(formData) { - function buildPath(path2, value, target, index) { - let name = path2[index++]; - if (name === "__proto__") return true; - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path2.length; - name = !name && utils$1.isArray(target) ? target.length : name; - if (isLast) { - if (utils$1.hasOwnProp(target, name)) { - target[name] = [target[name], value]; - } else { - target[name] = value; - } - return !isNumericKey; - } - if (!target[name] || !utils$1.isObject(target[name])) { - target[name] = []; - } - const result = buildPath(path2, value, target[name], index); - if (result && utils$1.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - return !isNumericKey; - } - if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { - const obj = {}; - utils$1.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; - } - function stringifySafely(rawValue, parser, encoder) { - if (utils$1.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$1.trim(rawValue); - } catch (e) { - if (e.name !== "SyntaxError") { - throw e; - } - } - } - return (encoder || JSON.stringify)(rawValue); - } - var defaults = { - transitional: transitionalDefaults, - adapter: ["xhr", "http", "fetch"], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ""; - const hasJSONContentType = contentType.indexOf("application/json") > -1; - const isObjectPayload = utils$1.isObject(data); - if (isObjectPayload && utils$1.isHTMLForm(data)) { - data = new FormData(data); - } - const isFormData2 = utils$1.isFormData(data); - if (isFormData2) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { - return data; - } - if (utils$1.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$1.isURLSearchParams(data)) { - headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); - return data.toString(); - } - let isFileList2; - if (isObjectPayload) { - if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { - return toURLEncodedForm(data, this.formSerializer).toString(); - } - if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { - const _FormData = this.env && this.env.FormData; - return toFormData( - isFileList2 ? { "files[]": data } : data, - _FormData && new _FormData(), - this.formSerializer - ); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType("application/json", false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - const transitional = this.transitional || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const JSONRequested = this.responseType === "json"; - if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { - return data; - } - if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data, this.parseReviver); - } catch (e) { - if (strictJSONParsing) { - if (e.name === "SyntaxError") { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: "XSRF-TOKEN", - xsrfHeaderName: "X-XSRF-TOKEN", - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - headers: { - common: { - "Accept": "application/json, text/plain, */*", - "Content-Type": void 0 - } - } - }; - utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { - defaults.headers[method] = {}; - }); - var defaults$1 = defaults; - var ignoreDuplicateOf = utils$1.toObjectSet([ - "age", - "authorization", - "content-length", - "content-type", - "etag", - "expires", - "from", - "host", - "if-modified-since", - "if-unmodified-since", - "last-modified", - "location", - "max-forwards", - "proxy-authorization", - "referer", - "retry-after", - "user-agent" - ]); - var parseHeaders = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i = line.indexOf(":"); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) { - return; - } - if (key === "set-cookie") { - if (parsed[key]) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; - } - }); - return parsed; - }; - var $internals = Symbol("internals"); - function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); - } - function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); - } - function parseTokens(str) { - const tokens = /* @__PURE__ */ Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; - } - var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils$1.isString(value)) return; - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } - } - function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); - } - function buildAccessors(obj, header) { - const accessorName = utils$1.toCamelCase(" " + header); - ["get", "set", "has"].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); - } - var AxiosHeaders = class { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self2 = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - throw new Error("header name must be a non-empty string"); - } - const key = utils$1.findKey(self2, lHeader); - if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { - self2[key || _header] = normalizeValue(_value); - } - } - const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { - let obj = {}, dest, key; - for (const entry of header) { - if (!utils$1.isArray(entry)) { - throw TypeError("Object iterator must return a key-value pair"); - } - obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; - } - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - if (key) { - const value = this[key]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - delete(header, matcher) { - const self2 = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key = utils$1.findKey(self2, _header); - if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { - delete self2[key]; - deleted = true; - } - } - } - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - return deleted; - } - normalize(format) { - const self2 = this; - const headers = {}; - utils$1.forEach(this, (value, header) => { - const key = utils$1.findKey(headers, header); - if (key) { - self2[key] = normalizeValue(value); - delete self2[header]; - return; - } - const normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self2[header]; - } - self2[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - toJSON(asStrings) { - const obj = /* @__PURE__ */ Object.create(null); - utils$1.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); - }); - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); - } - getSetCookie() { - return this.get("set-cookie") || []; - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach((target) => computed.set(target)); - return computed; - } - static accessor(header) { - const internals = this[$internals] = this[$internals] = { - accessors: {} - }; - const accessors = internals.accessors; - const prototype2 = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype2, _header); - accessors[lHeader] = true; - } - } - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } - }; - AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); - utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - }; - }); - utils$1.freezeMethods(AxiosHeaders); - var AxiosHeaders$1 = AxiosHeaders; - function transformData(fns, response) { - const config = this || defaults$1; - const context = response || config; - const headers = AxiosHeaders$1.from(context.headers); - let data = context.data; - utils$1.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); - }); - headers.normalize(); - return data; - } - function isCancel(value) { - return !!(value && value.__CANCEL__); - } - function CanceledError(message, config, request) { - AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request); - this.name = "CanceledError"; - } - utils$1.inherits(CanceledError, AxiosError, { - __CANCEL__: true - }); - function settle(resolve2, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve2(response); - } else { - reject(new AxiosError( - "Request failed with status code " + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } - } - function isAbsoluteURL(url2) { - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2); - } - function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; - } - function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; - } - var VERSION = "1.13.1"; - function parseProtocol(url2) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2); - return match && match[1] || ""; - } - var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; - function fromDataURI(uri, asBlob, options) { - const _Blob = options && options.Blob || platform.classes.Blob; - const protocol = parseProtocol(uri); - if (asBlob === void 0 && _Blob) { - asBlob = true; - } - if (protocol === "data") { - uri = protocol.length ? uri.slice(protocol.length + 1) : uri; - const match = DATA_URL_PATTERN.exec(uri); - if (!match) { - throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL); - } - const mime = match[1]; - const isBase64 = match[2]; - const body = match[3]; - const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8"); - if (asBlob) { - if (!_Blob) { - throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT); - } - return new _Blob([buffer], { type: mime }); - } - return buffer; - } - throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT); - } - var kInternals = Symbol("internals"); - var AxiosTransformStream = class extends stream__default["default"].Transform { - constructor(options) { - options = utils$1.toFlatObject(options, { - maxRate: 0, - chunkSize: 64 * 1024, - minChunkSize: 100, - timeWindow: 500, - ticksRate: 2, - samplesCount: 15 - }, null, (prop, source) => { - return !utils$1.isUndefined(source[prop]); - }); - super({ - readableHighWaterMark: options.chunkSize - }); - const internals = this[kInternals] = { - timeWindow: options.timeWindow, - chunkSize: options.chunkSize, - maxRate: options.maxRate, - minChunkSize: options.minChunkSize, - bytesSeen: 0, - isCaptured: false, - notifiedBytesLoaded: 0, - ts: Date.now(), - bytes: 0, - onReadCallback: null - }; - this.on("newListener", (event) => { - if (event === "progress") { - if (!internals.isCaptured) { - internals.isCaptured = true; - } - } - }); - } - _read(size) { - const internals = this[kInternals]; - if (internals.onReadCallback) { - internals.onReadCallback(); - } - return super._read(size); - } - _transform(chunk, encoding, callback) { - const internals = this[kInternals]; - const maxRate = internals.maxRate; - const readableHighWaterMark = this.readableHighWaterMark; - const timeWindow = internals.timeWindow; - const divider = 1e3 / timeWindow; - const bytesThreshold = maxRate / divider; - const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; - const pushChunk = (_chunk, _callback) => { - const bytes = Buffer.byteLength(_chunk); - internals.bytesSeen += bytes; - internals.bytes += bytes; - internals.isCaptured && this.emit("progress", internals.bytesSeen); - if (this.push(_chunk)) { - process.nextTick(_callback); - } else { - internals.onReadCallback = () => { - internals.onReadCallback = null; - process.nextTick(_callback); - }; - } - }; - const transformChunk = (_chunk, _callback) => { - const chunkSize = Buffer.byteLength(_chunk); - let chunkRemainder = null; - let maxChunkSize = readableHighWaterMark; - let bytesLeft; - let passed = 0; - if (maxRate) { - const now = Date.now(); - if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { - internals.ts = now; - bytesLeft = bytesThreshold - internals.bytes; - internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; - passed = 0; - } - bytesLeft = bytesThreshold - internals.bytes; - } - if (maxRate) { - if (bytesLeft <= 0) { - return setTimeout(() => { - _callback(null, _chunk); - }, timeWindow - passed); - } - if (bytesLeft < maxChunkSize) { - maxChunkSize = bytesLeft; - } - } - if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { - chunkRemainder = _chunk.subarray(maxChunkSize); - _chunk = _chunk.subarray(0, maxChunkSize); - } - pushChunk(_chunk, chunkRemainder ? () => { - process.nextTick(_callback, null, chunkRemainder); - } : _callback); - }; - transformChunk(chunk, function transformNextChunk(err, _chunk) { - if (err) { - return callback(err); - } - if (_chunk) { - transformChunk(_chunk, transformNextChunk); - } else { - callback(null); - } - }); - } - }; - var AxiosTransformStream$1 = AxiosTransformStream; - var { asyncIterator } = Symbol; - var readBlob = async function* (blob) { - if (blob.stream) { - yield* blob.stream(); - } else if (blob.arrayBuffer) { - yield await blob.arrayBuffer(); - } else if (blob[asyncIterator]) { - yield* blob[asyncIterator](); - } else { - yield blob; - } - }; - var readBlob$1 = readBlob; - var BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + "-_"; - var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder(); - var CRLF = "\r\n"; - var CRLF_BYTES = textEncoder.encode(CRLF); - var CRLF_BYTES_COUNT = 2; - var FormDataPart = class { - constructor(name, value) { - const { escapeName } = this.constructor; - const isStringValue = utils$1.isString(value); - let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`; - if (isStringValue) { - value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); - } else { - headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; - } - this.headers = textEncoder.encode(headers + CRLF); - this.contentLength = isStringValue ? value.byteLength : value.size; - this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; - this.name = name; - this.value = value; - } - async *encode() { - yield this.headers; - const { value } = this; - if (utils$1.isTypedArray(value)) { - yield value; - } else { - yield* readBlob$1(value); - } - yield CRLF_BYTES; - } - static escapeName(name) { - return String(name).replace(/[\r\n"]/g, (match) => ({ - "\r": "%0D", - "\n": "%0A", - '"': "%22" - })[match]); - } - }; - var formDataToStream = (form, headersHandler, options) => { - const { - tag = "form-data-boundary", - size = 25, - boundary = tag + "-" + platform.generateString(size, BOUNDARY_ALPHABET) - } = options || {}; - if (!utils$1.isFormData(form)) { - throw TypeError("FormData instance required"); - } - if (boundary.length < 1 || boundary.length > 70) { - throw Error("boundary must be 10-70 characters long"); - } - const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); - const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF); - let contentLength = footerBytes.byteLength; - const parts = Array.from(form.entries()).map(([name, value]) => { - const part = new FormDataPart(name, value); - contentLength += part.size; - return part; - }); - contentLength += boundaryBytes.byteLength * parts.length; - contentLength = utils$1.toFiniteNumber(contentLength); - const computedHeaders = { - "Content-Type": `multipart/form-data; boundary=${boundary}` - }; - if (Number.isFinite(contentLength)) { - computedHeaders["Content-Length"] = contentLength; - } - headersHandler && headersHandler(computedHeaders); - return stream.Readable.from(async function* () { - for (const part of parts) { - yield boundaryBytes; - yield* part.encode(); - } - yield footerBytes; - }()); - }; - var formDataToStream$1 = formDataToStream; - var ZlibHeaderTransformStream = class extends stream__default["default"].Transform { - __transform(chunk, encoding, callback) { - this.push(chunk); - callback(); - } - _transform(chunk, encoding, callback) { - if (chunk.length !== 0) { - this._transform = this.__transform; - if (chunk[0] !== 120) { - const header = Buffer.alloc(2); - header[0] = 120; - header[1] = 156; - this.push(header, encoding); - } - } - this.__transform(chunk, encoding, callback); - } - }; - var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream; - var callbackify = (fn, reducer) => { - return utils$1.isAsyncFn(fn) ? function(...args) { - const cb = args.pop(); - fn.apply(this, args).then((value) => { - try { - reducer ? cb(null, ...reducer(value)) : cb(null, value); - } catch (err) { - cb(err); - } - }, cb); - } : fn; - }; - var callbackify$1 = callbackify; - function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - min = min !== void 0 ? min : 1e3; - return function push(chunkLength) { - const now = Date.now(); - const startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes[head] = chunkLength; - timestamps[head] = now; - let i = tail; - let bytesCount = 0; - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - const passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; - }; - } - function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1e3 / freq; - let lastArgs; - let timer; - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn(...args); - }; - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; - } - var progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - return throttle((e) => { - const loaded = e.loaded; - const total = e.lengthComputable ? e.total : void 0; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; - const data = { - loaded, - total, - progress: total ? loaded / total : void 0, - bytes: progressBytes, - rate: rate ? rate : void 0, - estimated: rate && total && inRange ? (total - loaded) / rate : void 0, - event: e, - lengthComputable: total != null, - [isDownloadStream ? "download" : "upload"]: true - }; - listener(data); - }, freq); - }; - var progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - return [(loaded) => throttled[0]({ - lengthComputable, - total, - loaded - }), throttled[1]]; - }; - var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); - function estimateDataURLDecodedBytes(url2) { - if (!url2 || typeof url2 !== "string") return 0; - if (!url2.startsWith("data:")) return 0; - const comma = url2.indexOf(","); - if (comma < 0) return 0; - const meta = url2.slice(5, comma); - const body = url2.slice(comma + 1); - const isBase64 = /;base64/i.test(meta); - if (isBase64) { - let effectiveLen = body.length; - const len = body.length; - for (let i = 0; i < len; i++) { - if (body.charCodeAt(i) === 37 && i + 2 < len) { - const a = body.charCodeAt(i + 1); - const b = body.charCodeAt(i + 2); - const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102); - if (isHex) { - effectiveLen -= 2; - i += 2; - } - } - } - let pad = 0; - let idx = len - 1; - const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%' - body.charCodeAt(j - 1) === 51 && // '3' - (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); - if (idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - idx--; - } else if (tailIsPct3D(idx)) { - pad++; - idx -= 3; - } - } - if (pad === 1 && idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - } else if (tailIsPct3D(idx)) { - pad++; - } - } - const groups = Math.floor(effectiveLen / 4); - const bytes = groups * 3 - (pad || 0); - return bytes > 0 ? bytes : 0; - } - return Buffer.byteLength(body, "utf8"); - } - var zlibOptions = { - flush: zlib__default["default"].constants.Z_SYNC_FLUSH, - finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH - }; - var brotliOptions = { - flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH, - finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH - }; - var { - HTTP2_HEADER_SCHEME, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_STATUS - } = http2.constants; - var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress); - var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"]; - var isHttps = /https:?/; - var supportedProtocols = platform.protocols.map((protocol) => { - return protocol + ":"; - }); - var flushOnFinish = (stream2, [throttled, flush]) => { - stream2.on("end", flush).on("error", flush); - return throttled; - }; - var Http2Sessions = class { - constructor() { - this.sessions = /* @__PURE__ */ Object.create(null); - } - getSession(authority, options) { - options = Object.assign({ - sessionTimeout: 1e3 - }, options); - let authoritySessions; - if (authoritySessions = this.sessions[authority]) { - let len = authoritySessions.length; - for (let i = 0; i < len; i++) { - const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) { - return sessionHandle; - } - } - } - const session = http2.connect(authority, options); - let removed; - const removeSession = () => { - if (removed) { - return; - } - removed = true; - let entries2 = authoritySessions, len = entries2.length, i = len; - while (i--) { - if (entries2[i][0] === session) { - entries2.splice(i, 1); - if (len === 1) { - delete this.sessions[authority]; - return; - } - } - } - }; - const originalRequestFn = session.request; - const { sessionTimeout } = options; - if (sessionTimeout != null) { - let timer; - let streamsCount = 0; - session.request = function() { - const stream2 = originalRequestFn.apply(this, arguments); - streamsCount++; - if (timer) { - clearTimeout(timer); - timer = null; - } - stream2.once("close", () => { - if (!--streamsCount) { - timer = setTimeout(() => { - timer = null; - removeSession(); - }, sessionTimeout); - } - }); - return stream2; - }; - } - session.once("close", removeSession); - let entries = this.sessions[authority], entry = [ - session, - options - ]; - entries ? this.sessions[authority].push(entry) : authoritySessions = this.sessions[authority] = [entry]; - return session; - } - }; - var http2Sessions = new Http2Sessions(); - function dispatchBeforeRedirect(options, responseDetails) { - if (options.beforeRedirects.proxy) { - options.beforeRedirects.proxy(options); - } - if (options.beforeRedirects.config) { - options.beforeRedirects.config(options, responseDetails); - } - } - function setProxy(options, configProxy, location) { - let proxy = configProxy; - if (!proxy && proxy !== false) { - const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location); - if (proxyUrl) { - proxy = new URL(proxyUrl); - } - } - if (proxy) { - if (proxy.username) { - proxy.auth = (proxy.username || "") + ":" + (proxy.password || ""); - } - if (proxy.auth) { - if (proxy.auth.username || proxy.auth.password) { - proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || ""); - } - const base64 = Buffer.from(proxy.auth, "utf8").toString("base64"); - options.headers["Proxy-Authorization"] = "Basic " + base64; - } - options.headers.host = options.hostname + (options.port ? ":" + options.port : ""); - const proxyHost = proxy.hostname || proxy.host; - options.hostname = proxyHost; - options.host = proxyHost; - options.port = proxy.port; - options.path = location; - if (proxy.protocol) { - options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`; - } - } - options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - setProxy(redirectOptions, configProxy, redirectOptions.href); - }; - } - var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process"; - var wrapAsync = (asyncExecutor) => { - return new Promise((resolve2, reject) => { - let onDone; - let isDone; - const done = (value, isRejected) => { - if (isDone) return; - isDone = true; - onDone && onDone(value, isRejected); - }; - const _resolve = (value) => { - done(value); - resolve2(value); - }; - const _reject = (reason) => { - done(reason, true); - reject(reason); - }; - asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject); - }); - }; - var resolveFamily = ({ address, family }) => { - if (!utils$1.isString(address)) { - throw TypeError("address must be a string"); - } - return { - address, - family: family || (address.indexOf(".") < 0 ? 6 : 4) - }; - }; - var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family }); - var http2Transport = { - request(options, cb) { - const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80); - const { http2Options, headers } = options; - const session = http2Sessions.getSession(authority, http2Options); - const http2Headers = { - [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""), - [HTTP2_HEADER_METHOD]: options.method, - [HTTP2_HEADER_PATH]: options.path - }; - utils$1.forEach(headers, (header, name) => { - name.charAt(0) !== ":" && (http2Headers[name] = header); - }); - const req = session.request(http2Headers); - req.once("response", (responseHeaders) => { - const response = req; - responseHeaders = Object.assign({}, responseHeaders); - const status = responseHeaders[HTTP2_HEADER_STATUS]; - delete responseHeaders[HTTP2_HEADER_STATUS]; - response.headers = responseHeaders; - response.statusCode = +status; - cb(response); - }); - return req; - } - }; - var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) { - return wrapAsync(async function dispatchHttpRequest(resolve2, reject, onDone) { - let { data, lookup, family, httpVersion = 1, http2Options } = config; - const { responseType, responseEncoding } = config; - const method = config.method.toUpperCase(); - let isDone; - let rejected = false; - let req; - httpVersion = +httpVersion; - if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); - } - if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); - } - const isHttp2 = httpVersion === 2; - if (lookup) { - const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - }; - } - const abortEmitter = new events.EventEmitter(); - function abort(reason) { - try { - abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason); - } catch (err) { - console.warn("emit error", err); - } - } - abortEmitter.once("abort", reject); - const onFinished = () => { - if (config.cancelToken) { - config.cancelToken.unsubscribe(abort); - } - if (config.signal) { - config.signal.removeEventListener("abort", abort); - } - abortEmitter.removeAllListeners(); - }; - if (config.cancelToken || config.signal) { - config.cancelToken && config.cancelToken.subscribe(abort); - if (config.signal) { - config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort); - } - } - onDone((response, isRejected) => { - isDone = true; - if (isRejected) { - rejected = true; - onFinished(); - return; - } - const { data: data2 } = response; - if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) { - const offListeners = stream__default["default"].finished(data2, () => { - offListeners(); - onFinished(); - }); - } else { - onFinished(); - } - }); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0); - const protocol = parsed.protocol || supportedProtocols[0]; - if (protocol === "data:") { - if (config.maxContentLength > -1) { - const dataUrl = String(config.url || fullPath || ""); - const estimated = estimateDataURLDecodedBytes(dataUrl); - if (estimated > config.maxContentLength) { - return reject(new AxiosError( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError.ERR_BAD_RESPONSE, - config - )); - } - } - let convertedData; - if (method !== "GET") { - return settle(resolve2, reject, { - status: 405, - statusText: "method not allowed", - headers: {}, - config - }); - } - try { - convertedData = fromDataURI(config.url, responseType === "blob", { - Blob: config.env && config.env.Blob - }); - } catch (err) { - throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); - } - if (responseType === "text") { - convertedData = convertedData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - convertedData = utils$1.stripBOM(convertedData); - } - } else if (responseType === "stream") { - convertedData = stream__default["default"].Readable.from(convertedData); - } - return settle(resolve2, reject, { - data: convertedData, - status: 200, - statusText: "OK", - headers: new AxiosHeaders$1(), - config - }); - } - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError( - "Unsupported protocol " + protocol, - AxiosError.ERR_BAD_REQUEST, - config - )); - } - const headers = AxiosHeaders$1.from(config.headers).normalize(); - headers.set("User-Agent", "axios/" + VERSION, false); - const { onUploadProgress, onDownloadProgress } = config; - const maxRate = config.maxRate; - let maxUploadRate = void 0; - let maxDownloadRate = void 0; - if (utils$1.isSpecCompliantForm(data)) { - const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - data = formDataToStream$1(data, (formHeaders) => { - headers.set(formHeaders); - }, { - tag: `axios-${VERSION}-boundary`, - boundary: userBoundary && userBoundary[1] || void 0 - }); - } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) { - headers.set(data.getHeaders()); - if (!headers.hasContentLength()) { - try { - const knownLength = await util__default["default"].promisify(data.getLength).call(data); - Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); - } catch (e) { - } - } - } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { - data.size && headers.setContentType(data.type || "application/octet-stream"); - headers.setContentLength(data.size || 0); - data = stream__default["default"].Readable.from(readBlob$1(data)); - } else if (data && !utils$1.isStream(data)) { - if (Buffer.isBuffer(data)) ; - else if (utils$1.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils$1.isString(data)) { - data = Buffer.from(data, "utf-8"); - } else { - return reject(new AxiosError( - "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", - AxiosError.ERR_BAD_REQUEST, - config - )); - } - headers.setContentLength(data.length, false); - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError( - "Request body larger than maxBodyLength limit", - AxiosError.ERR_BAD_REQUEST, - config - )); - } - } - const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); - if (utils$1.isArray(maxRate)) { - maxUploadRate = maxRate[0]; - maxDownloadRate = maxRate[1]; - } else { - maxUploadRate = maxDownloadRate = maxRate; - } - if (data && (onUploadProgress || maxUploadRate)) { - if (!utils$1.isStream(data)) { - data = stream__default["default"].Readable.from(data, { objectMode: false }); - } - data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({ - maxRate: utils$1.toFiniteNumber(maxUploadRate) - })], utils$1.noop); - onUploadProgress && data.on("progress", flushOnFinish( - data, - progressEventDecorator( - contentLength, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) - ) - )); - } - let auth = void 0; - if (config.auth) { - const username = config.auth.username || ""; - const password = config.auth.password || ""; - auth = username + ":" + password; - } - if (!auth && parsed.username) { - const urlUsername = parsed.username; - const urlPassword = parsed.password; - auth = urlUsername + ":" + urlPassword; - } - auth && headers.delete("authorization"); - let path2; - try { - path2 = buildURL( - parsed.pathname + parsed.search, - config.params, - config.paramsSerializer - ).replace(/^\?/, ""); - } catch (err) { - const customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - return reject(customErr); - } - headers.set( - "Accept-Encoding", - "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), - false - ); - const options = { - path: path2, - method, - headers: headers.toJSON(), - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth, - protocol, - family, - beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: {}, - http2Options - }; - !utils$1.isUndefined(lookup) && (options.lookup = lookup); - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; - options.port = parsed.port; - setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path); - } - let transport; - const isHttpsRequest = isHttps.test(options.protocol); - options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - if (isHttp2) { - transport = http2Transport; - } else { - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsRequest ? https__default["default"] : http__default["default"]; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirects.config = config.beforeRedirect; - } - transport = isHttpsRequest ? httpsFollow : httpFollow; - } - } - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } else { - options.maxBodyLength = Infinity; - } - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } - req = transport.request(options, function handleResponse(res) { - if (req.destroyed) return; - const streams = [res]; - const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]); - if (onDownloadProgress || maxDownloadRate) { - const transformStream = new AxiosTransformStream$1({ - maxRate: utils$1.toFiniteNumber(maxDownloadRate) - }); - onDownloadProgress && transformStream.on("progress", flushOnFinish( - transformStream, - progressEventDecorator( - responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) - ) - )); - streams.push(transformStream); - } - let responseStream = res; - const lastRequest = res.req || req; - if (config.decompress !== false && res.headers["content-encoding"]) { - if (method === "HEAD" || res.statusCode === 204) { - delete res.headers["content-encoding"]; - } - switch ((res.headers["content-encoding"] || "").toLowerCase()) { - /*eslint default-case:0*/ - case "gzip": - case "x-gzip": - case "compress": - case "x-compress": - streams.push(zlib__default["default"].createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "deflate": - streams.push(new ZlibHeaderTransformStream$1()); - streams.push(zlib__default["default"].createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "br": - if (isBrotliSupported) { - streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions)); - delete res.headers["content-encoding"]; - } - } - } - responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0]; - const response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: new AxiosHeaders$1(res.headers), - config, - request: lastRequest - }; - if (responseType === "stream") { - response.data = responseStream; - settle(resolve2, reject, response); - } else { - const responseBuffer = []; - let totalResponseBytes = 0; - responseStream.on("data", function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - rejected = true; - responseStream.destroy(); - abort(new AxiosError( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - )); - } - }); - responseStream.on("aborted", function handlerStreamAborted() { - if (rejected) { - return; - } - const err = new AxiosError( - "stream has been aborted", - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - ); - responseStream.destroy(err); - reject(err); - }); - responseStream.on("error", function handleStreamError(err) { - if (req.destroyed) return; - reject(AxiosError.from(err, null, config, lastRequest)); - }); - responseStream.on("end", function handleStreamEnd() { - try { - let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (responseType !== "arraybuffer") { - responseData = responseData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - responseData = utils$1.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - return reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve2, reject, response); - }); - } - abortEmitter.once("abort", (err) => { - if (!responseStream.destroyed) { - responseStream.emit("error", err); - responseStream.destroy(); - } - }); - }); - abortEmitter.once("abort", (err) => { - if (req.close) { - req.close(); - } else { - req.destroy(err); - } - }); - req.on("error", function handleRequestError(err) { - reject(AxiosError.from(err, null, config, req)); - }); - req.on("socket", function handleRequestSocket(socket) { - socket.setKeepAlive(true, 1e3 * 60); - }); - if (config.timeout) { - const timeout = parseInt(config.timeout, 10); - if (Number.isNaN(timeout)) { - abort(new AxiosError( - "error trying to parse `config.timeout` to int", - AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - )); - return; - } - req.setTimeout(timeout, function handleRequestTimeout() { - if (isDone) return; - let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - abort(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - req - )); - }); - } - if (utils$1.isStream(data)) { - let ended = false; - let errored = false; - data.on("end", () => { - ended = true; - }); - data.once("error", (err) => { - errored = true; - req.destroy(err); - }); - data.on("close", () => { - if (!ended && !errored) { - abort(new CanceledError("Request stream has been aborted", config, req)); - } - }); - data.pipe(req); - } else { - data && req.write(data); - req.end(); - } - }); - }; - var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => { - url2 = new URL(url2, platform.origin); - return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port); - })( - new URL(platform.origin), - platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) - ) : () => true; - var cookies = platform.hasStandardBrowserEnv ? ( - // Standard browser envs support document.cookie - { - write(name, value, expires, path2, domain, secure, sameSite) { - if (typeof document === "undefined") return; - const cookie = [`${name}=${encodeURIComponent(value)}`]; - if (utils$1.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils$1.isString(path2)) { - cookie.push(`path=${path2}`); - } - if (utils$1.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push("secure"); - } - if (utils$1.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - document.cookie = cookie.join("; "); - }, - read(name) { - if (typeof document === "undefined") return null; - const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); - return match ? decodeURIComponent(match[1]) : null; - }, - remove(name) { - this.write(name, "", Date.now() - 864e5, "/"); - } - } - ) : ( - // Non-standard browser env (web workers, react-native) lack needed support. - { - write() { - }, - read() { - return null; - }, - remove() { - } - } - ); - var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; - function mergeConfig(config1, config2) { - config2 = config2 || {}; - const config = {}; - function getMergedValue(target, source, prop, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ caseless }, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(void 0, a, prop, caseless); - } - } - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(void 0, b); - } - } - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(void 0, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(void 0, a); - } - } - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(void 0, a); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) - }; - utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { - const merge2 = mergeMap[prop] || mergeDeepProperties; - const configValue = merge2(config1[prop], config2[prop], prop); - utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); - }); - return config; - } - var resolveConfig = (config) => { - const newConfig = mergeConfig({}, config); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; - newConfig.headers = headers = AxiosHeaders$1.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); - if (auth) { - headers.set( - "Authorization", - "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) - ); - } - if (utils$1.isFormData(data)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { - headers.setContentType(void 0); - } else if (utils$1.isFunction(data.getHeaders)) { - const formHeaders = data.getHeaders(); - const allowedHeaders = ["content-type", "content-length"]; - Object.entries(formHeaders).forEach(([key, val]) => { - if (allowedHeaders.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); - } - } - if (platform.hasStandardBrowserEnv) { - withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; - }; - var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; - var xhrAdapter = isXHRAdapterSupported && function(config) { - return new Promise(function dispatchXhrRequest(resolve2, reject) { - const _config = resolveConfig(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - function done() { - flushUpload && flushUpload(); - flushDownload && flushDownload(); - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener("abort", onCanceled); - } - let request = new XMLHttpRequest(); - request.open(_config.method.toUpperCase(), _config.url, true); - request.timeout = _config.timeout; - function onloadend() { - if (!request) { - return; - } - const responseHeaders = AxiosHeaders$1.from( - "getAllResponseHeaders" in request && request.getAllResponseHeaders() - ); - const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; - settle(function _resolve(value) { - resolve2(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - request = null; - } - if ("onloadend" in request) { - request.onloadend = onloadend; - } else { - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { - return; - } - setTimeout(onloadend); - }; - } - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); - request = null; - }; - request.onerror = function handleError(event) { - const msg = event && event.message ? event.message : "Network Error"; - const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); - err.event = event || null; - reject(err); - request = null; - }; - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - request - )); - request = null; - }; - requestData === void 0 && requestHeaders.setContentType(null); - if ("setRequestHeader" in request) { - utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - if (!utils$1.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - if (responseType && responseType !== "json") { - request.responseType = _config.responseType; - } - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener("progress", downloadThrottled); - } - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - request.upload.addEventListener("progress", uploadThrottled); - request.upload.addEventListener("loadend", flushUpload); - } - if (_config.cancelToken || _config.signal) { - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); - request.abort(); - request = null; - }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); - } - } - const protocol = parseProtocol(_config.url); - if (protocol && platform.protocols.indexOf(protocol) === -1) { - reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config)); - return; - } - request.send(requestData || null); - }); - }; - var composeSignals = (signals, timeout) => { - const { length } = signals = signals ? signals.filter(Boolean) : []; - if (timeout || length) { - let controller = new AbortController(); - let aborted; - const onabort = function(reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); - } - }; - let timer = timeout && setTimeout(() => { - timer = null; - onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (signals) { - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal2) => { - signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); - }); - signals = null; - } - }; - signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); - const { signal } = controller; - signal.unsubscribe = () => utils$1.asap(unsubscribe); - return signal; - } - }; - var composeSignals$1 = composeSignals; - var streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - if (!chunkSize || len < chunkSize) { - yield chunk; - return; - } - let pos = 0; - let end; - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } - }; - var readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } - }; - var readStream = async function* (stream2) { - if (stream2[Symbol.asyncIterator]) { - yield* stream2; - return; - } - const reader = stream2.getReader(); - try { - for (; ; ) { - const { done, value } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } - }; - var trackStream = (stream2, chunkSize, onProgress, onFinish) => { - const iterator2 = readBytes(stream2, chunkSize); - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - return new ReadableStream({ - async pull(controller) { - try { - const { done: done2, value } = await iterator2.next(); - if (done2) { - _onFinish(); - controller.close(); - return; - } - let len = value.byteLength; - if (onProgress) { - let loadedBytes = bytes += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator2.return(); - } - }, { - highWaterMark: 2 - }); - }; - var DEFAULT_CHUNK_SIZE = 64 * 1024; - var { isFunction } = utils$1; - var globalFetchAPI = (({ Request, Response }) => ({ - Request, - Response - }))(utils$1.global); - var { - ReadableStream: ReadableStream$1, - TextEncoder: TextEncoder$1 - } = utils$1.global; - var test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } - }; - var factory = (env) => { - env = utils$1.merge.call({ - skipUndefined: true - }, globalFetchAPI, env); - const { fetch: envFetch, Request, Response } = env; - const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; - const isRequestSupported = isFunction(Request); - const isResponseSupported = isFunction(Response); - if (!isFetchSupported) { - return false; - } - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); - const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); - const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { - let duplexAccessed = false; - const hasContentType = new Request(platform.origin, { - body: new ReadableStream$1(), - method: "POST", - get duplex() { - duplexAccessed = true; - return "half"; - } - }).headers.has("Content-Type"); - return duplexAccessed && !hasContentType; - }); - const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body)); - const resolvers = { - stream: supportsResponseStream && ((res) => res.body) - }; - isFetchSupported && (() => { - ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { - !resolvers[type] && (resolvers[type] = (res, config) => { - let method = res && res[type]; - if (method) { - return method.call(res); - } - throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); - }); - }); - })(); - const getBodyLength = async (body) => { - if (body == null) { - return 0; - } - if (utils$1.isBlob(body)) { - return body.size; - } - if (utils$1.isSpecCompliantForm(body)) { - const _request = new Request(platform.origin, { - method: "POST", - body - }); - return (await _request.arrayBuffer()).byteLength; - } - if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { - return body.byteLength; - } - if (utils$1.isURLSearchParams(body)) { - body = body + ""; - } - if (utils$1.isString(body)) { - return (await encodeText(body)).byteLength; - } - }; - const resolveBodyLength = async (headers, body) => { - const length = utils$1.toFiniteNumber(headers.getContentLength()); - return length == null ? getBodyLength(body) : length; - }; - return async (config) => { - let { - url: url2, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = "same-origin", - fetchOptions - } = resolveConfig(config); - let _fetch = envFetch || fetch; - responseType = responseType ? (responseType + "").toLowerCase() : "text"; - let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); - let request = null; - const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { - composedSignal.unsubscribe(); - }); - let requestContentLength; - try { - if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { - let _request = new Request(url2, { - method: "POST", - body: data, - duplex: "half" - }); - let contentTypeHeader; - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - const [onProgress, flush] = progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - ); - data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); - } - } - if (!utils$1.isString(withCredentials)) { - withCredentials = withCredentials ? "include" : "omit"; - } - const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; - const resolvedOptions = { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: headers.normalize().toJSON(), - body: data, - duplex: "half", - credentials: isCredentialsSupported ? withCredentials : void 0 - }; - request = isRequestSupported && new Request(url2, resolvedOptions); - let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions)); - const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { - const options = {}; - ["status", "statusText", "headers"].forEach((prop) => { - options[prop] = response[prop]; - }); - const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length")); - const [onProgress, flush] = onDownloadProgress && progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - ) || []; - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); - } - responseType = responseType || "text"; - let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config); - !isStreamResponse && unsubscribe && unsubscribe(); - return await new Promise((resolve2, reject) => { - settle(resolve2, reject, { - data: responseData, - headers: AxiosHeaders$1.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { - throw Object.assign( - new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request), - { - cause: err.cause || err - } - ); - } - throw AxiosError.from(err, err && err.code, config, request); - } - }; - }; - var seedCache = /* @__PURE__ */ new Map(); - var getFetch = (config) => { - let env = config && config.env || {}; - const { fetch: fetch2, Request, Response } = env; - const seeds = [ - Request, - Response, - fetch2 - ]; - let len = seeds.length, i = len, seed, target, map = seedCache; - while (i--) { - seed = seeds[i]; - target = map.get(seed); - target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); - map = target; - } - return target; - }; - getFetch(); - var knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: getFetch - } - }; - utils$1.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - Object.defineProperty(fn, "name", { value }); - } catch (e) { - } - Object.defineProperty(fn, "adapterName", { value }); - } - }); - var renderReason = (reason) => `- ${reason}`; - var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; - function getAdapter(adapters2, config) { - adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2]; - const { length } = adapters2; - let nameOrAdapter; - let adapter; - const rejectedReasons = {}; - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters2[i]; - let id; - adapter = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - if (adapter === void 0) { - throw new AxiosError(`Unknown adapter '${id}'`); - } - } - if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - rejectedReasons[id || "#" + i] = adapter; - } - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") - ); - let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; - throw new AxiosError( - `There is no suitable adapter to dispatch the request ` + s, - "ERR_NOT_SUPPORT" - ); - } - return adapter; - } - var adapters = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter, - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters - }; - function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); - } - } - function dispatchRequest(config) { - throwIfCancellationRequested(config); - config.headers = AxiosHeaders$1.from(config.headers); - config.data = transformData.call( - config, - config.transformRequest - ); - if (["post", "put", "patch"].indexOf(config.method) !== -1) { - config.headers.setContentType("application/x-www-form-urlencoded", false); - } - const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - response.data = transformData.call( - config, - config.transformResponse, - response - ); - response.headers = AxiosHeaders$1.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - reason.response.headers = AxiosHeaders$1.from(reason.response.headers); - } - } - return Promise.reject(reason); - }); - } - var validators$1 = {}; - ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => { - validators$1[type] = function validator2(thing) { - return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; - }; - }); - var deprecatedWarnings = {}; - validators$1.transitional = function transitional(validator2, version, message) { - function formatMessage(opt, desc) { - return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); - } - return (value, opt, opts) => { - if (validator2 === false) { - throw new AxiosError( - formatMessage(opt, " has been removed" + (version ? " in " + version : "")), - AxiosError.ERR_DEPRECATED - ); - } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - console.warn( - formatMessage( - opt, - " has been deprecated since v" + version + " and will be removed in the near future" - ) - ); - } - return validator2 ? validator2(value, opt, opts) : true; - }; - }; - validators$1.spelling = function spelling(correctSpelling) { - return (value, opt) => { - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; - }; - function assertOptions(options, schema, allowUnknown) { - if (typeof options !== "object") { - throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - const validator2 = schema[opt]; - if (validator2) { - const value = options[opt]; - const result = value === void 0 || validator2(value, opt, options); - if (result !== true) { - throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); - } - } - } - var validator = { - assertOptions, - validators: validators$1 - }; - var validators = validator.validators; - var Axios = class { - constructor(instanceConfig) { - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager$1(), - response: new InterceptorManager$1() - }; - } - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; - try { - if (!err.stack) { - err.stack = stack; - } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { - err.stack += "\n" + stack; - } - } catch (e) { - } - } - throw err; - } - } - _request(configOrUrl, config) { - if (typeof configOrUrl === "string") { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - config = mergeConfig(this.defaults, config); - const { transitional, paramsSerializer, headers } = config; - if (transitional !== void 0) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) - }, false); - } - if (paramsSerializer != null) { - if (utils$1.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer - }; - } else { - validator.assertOptions(paramsSerializer, { - encode: validators.function, - serialize: validators.function - }, true); - } - } - if (config.allowAbsoluteUrls !== void 0) ; - else if (this.defaults.allowAbsoluteUrls !== void 0) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - validator.assertOptions(config, { - baseUrl: validators.spelling("baseURL"), - withXsrfToken: validators.spelling("withXSRFToken") - }, true); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); - let contextHeaders = headers && utils$1.merge( - headers.common, - headers[config.method] - ); - headers && utils$1.forEach( - ["delete", "get", "head", "post", "put", "patch", "common"], - (method) => { - delete headers[method]; - } - ); - config.headers = AxiosHeaders$1.concat(contextHeaders, headers); - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - let promise; - let i = 0; - let len; - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), void 0]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config); - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - return promise; - } - len = requestInterceptorChain.length; - let newConfig = config; - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected.call(this, error); - break; - } - } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - return Promise.reject(error); - } - i = 0; - len = responseInterceptorChain.length; - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - return promise; - } - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - return buildURL(fullPath, config.params, config.paramsSerializer); - } - }; - utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { - Axios.prototype[method] = function(url2, config) { - return this.request(mergeConfig(config || {}, { - method, - url: url2, - data: (config || {}).data - })); - }; - }); - utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url2, data, config) { - return this.request(mergeConfig(config || {}, { - method, - headers: isForm ? { - "Content-Type": "multipart/form-data" - } : {}, - url: url2, - data - })); - }; - } - Axios.prototype[method] = generateHTTPMethod(); - Axios.prototype[method + "Form"] = generateHTTPMethod(true); - }); - var Axios$1 = Axios; - var CancelToken = class _CancelToken { - constructor(executor) { - if (typeof executor !== "function") { - throw new TypeError("executor must be a function."); - } - let resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve2) { - resolvePromise = resolve2; - }); - const token = this; - this.promise.then((cancel) => { - if (!token._listeners) return; - let i = token._listeners.length; - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - this.promise.then = (onfulfilled) => { - let _resolve; - const promise = new Promise((resolve2) => { - token.subscribe(resolve2); - _resolve = resolve2; - }).then(onfulfilled); - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - return promise; - }; - executor(function cancel(message, config, request) { - if (token.reason) { - return; - } - token.reason = new CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - /** - * Subscribe to the cancel signal - */ - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - /** - * Unsubscribe from the cancel signal - */ - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - toAbortSignal() { - const controller = new AbortController(); - const abort = (err) => { - controller.abort(err); - }; - this.subscribe(abort); - controller.signal.unsubscribe = () => this.unsubscribe(abort); - return controller.signal; - } - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new _CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel - }; - } - }; - var CancelToken$1 = CancelToken; - function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; - } - function isAxiosError(payload) { - return utils$1.isObject(payload) && payload.isAxiosError === true; - } - var HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526 - }; - Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; - }); - var HttpStatusCode$1 = HttpStatusCode; - function createInstance(defaultConfig) { - const context = new Axios$1(defaultConfig); - const instance = bind(Axios$1.prototype.request, context); - utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true }); - utils$1.extend(instance, context, null, { allOwnKeys: true }); - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance; - } - var axios = createInstance(defaults$1); - axios.Axios = Axios$1; - axios.CanceledError = CanceledError; - axios.CancelToken = CancelToken$1; - axios.isCancel = isCancel; - axios.VERSION = VERSION; - axios.toFormData = toFormData; - axios.AxiosError = AxiosError; - axios.Cancel = axios.CanceledError; - axios.all = function all(promises2) { - return Promise.all(promises2); - }; - axios.spread = spread; - axios.isAxiosError = isAxiosError; - axios.mergeConfig = mergeConfig; - axios.AxiosHeaders = AxiosHeaders$1; - axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); - axios.getAdapter = adapters.getAdapter; - axios.HttpStatusCode = HttpStatusCode$1; - axios.default = axios; - module2.exports = axios; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js -var require_base = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.operationServerMap = exports2.RequiredError = exports2.BaseAPI = exports2.COLLECTION_FORMATS = exports2.BASE_PATH = void 0; - var axios_1 = require_axios(); - exports2.BASE_PATH = "http://localhost".replace(/\/+$/, ""); - exports2.COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: " ", - pipes: "|" - }; - var BaseAPI = class { - constructor(configuration, basePath = exports2.BASE_PATH, axios = axios_1.default) { - var _a; - this.basePath = basePath; - this.axios = axios; - if (configuration) { - this.configuration = configuration; - this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath; - } - } - }; - exports2.BaseAPI = BaseAPI; - var RequiredError = class extends Error { - constructor(field, msg) { - super(msg); - this.field = field; - this.name = "RequiredError"; - } - }; - exports2.RequiredError = RequiredError; - exports2.operationServerMap = {}; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js -var require_common2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createRequestFunction = exports2.toPathString = exports2.serializeDataIfNeeded = exports2.setSearchParams = exports2.setOAuthToObject = exports2.setBearerAuthToObject = exports2.setBasicAuthToObject = exports2.setApiKeyToObject = exports2.assertParamExists = exports2.DUMMY_BASE_URL = void 0; - var base_1 = require_base(); - exports2.DUMMY_BASE_URL = "https://example.com"; - var assertParamExists = function(functionName, paramName, paramValue) { - if (paramValue === null || paramValue === void 0) { - throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } - }; - exports2.assertParamExists = assertParamExists; - var setApiKeyToObject = function(object, keyParamName, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === "function" ? yield configuration.apiKey(keyParamName) : yield configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } - }); - }; - exports2.setApiKeyToObject = setApiKeyToObject; - var setBasicAuthToObject = function(object, configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } - }; - exports2.setBasicAuthToObject = setBasicAuthToObject; - var setBearerAuthToObject = function(object, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === "function" ? yield configuration.accessToken() : yield configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } - }); - }; - exports2.setBearerAuthToObject = setBearerAuthToObject; - var setOAuthToObject = function(object, name, scopes, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === "function" ? yield configuration.accessToken(name, scopes) : yield configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - }); - }; - exports2.setOAuthToObject = setOAuthToObject; - function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { - if (parameter == null) - return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key)); - } else { - Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)); - } - } else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } else { - urlSearchParams.set(key, parameter); - } - } - } - var setSearchParams = function(url, ...objects) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); - }; - exports2.setSearchParams = setSearchParams; - var serializeDataIfNeeded = function(value, requestOptions, configuration) { - const nonString = typeof value !== "string"; - const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString; - return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}) : value || ""; - }; - exports2.serializeDataIfNeeded = serializeDataIfNeeded; - var toPathString = function(url) { - return url.pathname + url.search + url.hash; - }; - exports2.toPathString = toPathString; - var createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) { - return (axios = globalAxios, basePath = BASE_PATH) => { - var _a; - const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? "" : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url }); - return axios.request(axiosRequestArgs); - }; - }; - exports2.createRequestFunction = createRequestFunction; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js -var require_health_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HealthApi = exports2.HealthApiFactory = exports2.HealthApiFp = exports2.HealthApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var HealthApiAxiosParamCreator = function(configuration) { - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/v1/health`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator; - var HealthApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.HealthApiAxiosParamCreator)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.health(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["HealthApi.health"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.HealthApiFp = HealthApiFp; - var HealthApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.HealthApiFp)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health(options) { - return localVarFp.health(options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.HealthApiFactory = HealthApiFactory; - var HealthApi = class extends base_1.BaseAPI { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof HealthApi - */ - health(options) { - return (0, exports2.HealthApiFp)(this.configuration).health(options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.HealthApi = HealthApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js -var require_metrics_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MetricsApi = exports2.MetricsApiFactory = exports2.MetricsApiFp = exports2.MetricsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var MetricsApiAxiosParamCreator = function(configuration) { - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/metrics`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail: (metricName_1, ...args_1) => __awaiter(this, [metricName_1, ...args_1], void 0, function* (metricName, options = {}) { - (0, common_1.assertParamExists)("metricDetail", "metricName", metricName); - const localVarPath = `/metrics/{metric_name}`.replace(`{${"metric_name"}}`, encodeURIComponent(String(metricName))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/debug/metrics/scrape`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.MetricsApiAxiosParamCreator = MetricsApiAxiosParamCreator; - var MetricsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.MetricsApiAxiosParamCreator)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listMetrics(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.listMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail(metricName, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.metricDetail(metricName, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.metricDetail"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.scrapeMetrics(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.scrapeMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.MetricsApiFp = MetricsApiFp; - var MetricsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.MetricsApiFp)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics(options) { - return localVarFp.listMetrics(options).then((request) => request(axios, basePath)); - }, - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail(metricName, options) { - return localVarFp.metricDetail(metricName, options).then((request) => request(axios, basePath)); - }, - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics(options) { - return localVarFp.scrapeMetrics(options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.MetricsApiFactory = MetricsApiFactory; - var MetricsApi = class extends base_1.BaseAPI { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - listMetrics(options) { - return (0, exports2.MetricsApiFp)(this.configuration).listMetrics(options).then((request) => request(this.axios, this.basePath)); - } - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - metricDetail(metricName, options) { - return (0, exports2.MetricsApiFp)(this.configuration).metricDetail(metricName, options).then((request) => request(this.axios, this.basePath)); - } - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - scrapeMetrics(options) { - return (0, exports2.MetricsApiFp)(this.configuration).scrapeMetrics(options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.MetricsApi = MetricsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js -var require_notifications_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.NotificationsApi = exports2.NotificationsApiFactory = exports2.NotificationsApiFp = exports2.NotificationsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var NotificationsApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification: (notificationCreateRequest_1, ...args_1) => __awaiter(this, [notificationCreateRequest_1, ...args_1], void 0, function* (notificationCreateRequest, options = {}) { - (0, common_1.assertParamExists)("createNotification", "notificationCreateRequest", notificationCreateRequest); - const localVarPath = `/api/v1/notifications`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationCreateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { - (0, common_1.assertParamExists)("deleteNotification", "notificationId", notificationId); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { - (0, common_1.assertParamExists)("getNotification", "notificationId", notificationId); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/notifications`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification: (notificationId_1, notificationUpdateRequest_1, ...args_1) => __awaiter(this, [notificationId_1, notificationUpdateRequest_1, ...args_1], void 0, function* (notificationId, notificationUpdateRequest, options = {}) { - (0, common_1.assertParamExists)("updateNotification", "notificationId", notificationId); - (0, common_1.assertParamExists)("updateNotification", "notificationUpdateRequest", notificationUpdateRequest); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationUpdateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.NotificationsApiAxiosParamCreator = NotificationsApiAxiosParamCreator; - var NotificationsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.NotificationsApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification(notificationCreateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createNotification(notificationCreateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.createNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification(notificationId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteNotification(notificationId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.deleteNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification(notificationId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getNotification(notificationId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.getNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listNotifications(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.listNotifications"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateNotification(notificationId, notificationUpdateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.updateNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.NotificationsApiFp = NotificationsApiFp; - var NotificationsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.NotificationsApiFp)(configuration); - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification(notificationCreateRequest, options) { - return localVarFp.createNotification(notificationCreateRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification(notificationId, options) { - return localVarFp.deleteNotification(notificationId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification(notificationId, options) { - return localVarFp.getNotification(notificationId, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications(page, perPage, options) { - return localVarFp.listNotifications(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return localVarFp.updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.NotificationsApiFactory = NotificationsApiFactory; - var NotificationsApi = class extends base_1.BaseAPI { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - createNotification(notificationCreateRequest, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).createNotification(notificationCreateRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - deleteNotification(notificationId, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).deleteNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - getNotification(notificationId, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).getNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - listNotifications(page, perPage, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).listNotifications(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.NotificationsApi = NotificationsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js -var require_plugins_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PluginsApi = exports2.PluginsApiFactory = exports2.PluginsApiFp = exports2.PluginsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var PluginsApiAxiosParamCreator = function(configuration) { - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin: (pluginId_1, pluginCallRequest_1, ...args_1) => __awaiter(this, [pluginId_1, pluginCallRequest_1, ...args_1], void 0, function* (pluginId, pluginCallRequest, options = {}) { - (0, common_1.assertParamExists)("callPlugin", "pluginId", pluginId); - (0, common_1.assertParamExists)("callPlugin", "pluginCallRequest", pluginCallRequest); - const localVarPath = `/api/v1/plugins/{plugin_id}/call`.replace(`{${"plugin_id"}}`, encodeURIComponent(String(pluginId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(pluginCallRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.PluginsApiAxiosParamCreator = PluginsApiAxiosParamCreator; - var PluginsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.PluginsApiAxiosParamCreator)(configuration); - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin(pluginId, pluginCallRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.callPlugin(pluginId, pluginCallRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["PluginsApi.callPlugin"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.PluginsApiFp = PluginsApiFp; - var PluginsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.PluginsApiFp)(configuration); - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin(pluginId, pluginCallRequest, options) { - return localVarFp.callPlugin(pluginId, pluginCallRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.PluginsApiFactory = PluginsApiFactory; - var PluginsApi = class extends base_1.BaseAPI { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PluginsApi - */ - callPlugin(pluginId, pluginCallRequest, options) { - return (0, exports2.PluginsApiFp)(this.configuration).callPlugin(pluginId, pluginCallRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.PluginsApi = PluginsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js -var require_relayers_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RelayersApi = exports2.RelayersApiFactory = exports2.RelayersApiFp = exports2.RelayersApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var RelayersApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { - (0, common_1.assertParamExists)("cancelTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("cancelTransaction", "transactionId", transactionId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer: (createRelayerRequest_1, ...args_1) => __awaiter(this, [createRelayerRequest_1, ...args_1], void 0, function* (createRelayerRequest, options = {}) { - (0, common_1.assertParamExists)("createRelayer", "createRelayerRequest", createRelayerRequest); - const localVarPath = `/api/v1/relayers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createRelayerRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("deletePendingTransactions", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/pending`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("deleteRelayer", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayer", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayerBalance", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/balance`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayerStatus", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/status`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { - (0, common_1.assertParamExists)("getTransactionById", "relayerId", relayerId); - (0, common_1.assertParamExists)("getTransactionById", "transactionId", transactionId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce: (relayerId_1, nonce_1, ...args_1) => __awaiter(this, [relayerId_1, nonce_1, ...args_1], void 0, function* (relayerId, nonce, options = {}) { - (0, common_1.assertParamExists)("getTransactionByNonce", "relayerId", relayerId); - (0, common_1.assertParamExists)("getTransactionByNonce", "nonce", nonce); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/by-nonce/{nonce}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"nonce"}}`, encodeURIComponent(String(nonce))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/relayers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions: (relayerId_1, page_1, perPage_1, ...args_1) => __awaiter(this, [relayerId_1, page_1, perPage_1, ...args_1], void 0, function* (relayerId, page, perPage, options = {}) { - (0, common_1.assertParamExists)("listTransactions", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction: (relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, transactionId, networkTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("replaceTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("replaceTransaction", "transactionId", transactionId); - (0, common_1.assertParamExists)("replaceTransaction", "networkTransactionRequest", networkTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PUT" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc: (relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1) => __awaiter(this, [relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1], void 0, function* (relayerId, jsonRpcRequestNetworkRpcRequest, options = {}) { - (0, common_1.assertParamExists)("rpc", "relayerId", relayerId); - (0, common_1.assertParamExists)("rpc", "jsonRpcRequestNetworkRpcRequest", jsonRpcRequestNetworkRpcRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/rpc`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(jsonRpcRequestNetworkRpcRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction: (relayerId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, networkTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("sendTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("sendTransaction", "networkTransactionRequest", networkTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign: (relayerId_1, signDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signDataRequest_1, ...args_1], void 0, function* (relayerId, signDataRequest, options = {}) { - (0, common_1.assertParamExists)("sign", "relayerId", relayerId); - (0, common_1.assertParamExists)("sign", "signDataRequest", signDataRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signDataRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction: (relayerId_1, signTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTransactionRequest_1, ...args_1], void 0, function* (relayerId, signTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("signTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("signTransaction", "signTransactionRequest", signTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign-transaction`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData: (relayerId_1, signTypedDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTypedDataRequest_1, ...args_1], void 0, function* (relayerId, signTypedDataRequest, options = {}) { - (0, common_1.assertParamExists)("signTypedData", "relayerId", relayerId); - (0, common_1.assertParamExists)("signTypedData", "signTypedDataRequest", signTypedDataRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign-typed-data`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTypedDataRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer: (relayerId_1, updateRelayerRequest_1, ...args_1) => __awaiter(this, [relayerId_1, updateRelayerRequest_1, ...args_1], void 0, function* (relayerId, updateRelayerRequest, options = {}) { - (0, common_1.assertParamExists)("updateRelayer", "relayerId", relayerId); - (0, common_1.assertParamExists)("updateRelayer", "updateRelayerRequest", updateRelayerRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateRelayerRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.RelayersApiAxiosParamCreator = RelayersApiAxiosParamCreator; - var RelayersApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.RelayersApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction(relayerId, transactionId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelTransaction(relayerId, transactionId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.cancelTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer(createRelayerRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createRelayer(createRelayerRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.createRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePendingTransactions(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deletePendingTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteRelayer(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deleteRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayer(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerBalance(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerBalance"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerStatus(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerStatus"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById(relayerId, transactionId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionById(relayerId, transactionId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionById"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce(relayerId, nonce, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionByNonce(relayerId, nonce, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionByNonce"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listRelayers(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listRelayers"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions(relayerId, page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listTransactions(relayerId, page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.replaceTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.rpc"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.sendTransaction(relayerId, networkTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sendTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign(relayerId, signDataRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.sign(relayerId, signDataRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sign"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction(relayerId, signTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.signTransaction(relayerId, signTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.signTypedData(relayerId, signTypedDataRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTypedData"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateRelayer(relayerId, updateRelayerRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.updateRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.RelayersApiFp = RelayersApiFp; - var RelayersApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.RelayersApiFp)(configuration); - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction(relayerId, transactionId, options) { - return localVarFp.cancelTransaction(relayerId, transactionId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer(createRelayerRequest, options) { - return localVarFp.createRelayer(createRelayerRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions(relayerId, options) { - return localVarFp.deletePendingTransactions(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer(relayerId, options) { - return localVarFp.deleteRelayer(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer(relayerId, options) { - return localVarFp.getRelayer(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance(relayerId, options) { - return localVarFp.getRelayerBalance(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus(relayerId, options) { - return localVarFp.getRelayerStatus(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById(relayerId, transactionId, options) { - return localVarFp.getTransactionById(relayerId, transactionId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce(relayerId, nonce, options) { - return localVarFp.getTransactionByNonce(relayerId, nonce, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers(page, perPage, options) { - return localVarFp.listRelayers(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions(relayerId, page, perPage, options) { - return localVarFp.listTransactions(relayerId, page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return localVarFp.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return localVarFp.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return localVarFp.sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign(relayerId, signDataRequest, options) { - return localVarFp.sign(relayerId, signDataRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction(relayerId, signTransactionRequest, options) { - return localVarFp.signTransaction(relayerId, signTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return localVarFp.signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return localVarFp.updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.RelayersApiFactory = RelayersApiFactory; - var RelayersApi = class extends base_1.BaseAPI { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - cancelTransaction(relayerId, transactionId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).cancelTransaction(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - createRelayer(createRelayerRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).createRelayer(createRelayerRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - deletePendingTransactions(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).deletePendingTransactions(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - deleteRelayer(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).deleteRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayer(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayerBalance(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayerBalance(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayerStatus(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayerStatus(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getTransactionById(relayerId, transactionId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getTransactionById(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getTransactionByNonce(relayerId, nonce, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getTransactionByNonce(relayerId, nonce, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - listRelayers(page, perPage, options) { - return (0, exports2.RelayersApiFp)(this.configuration).listRelayers(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - listTransactions(relayerId, page, perPage, options) { - return (0, exports2.RelayersApiFp)(this.configuration).listTransactions(relayerId, page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - sign(relayerId, signDataRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).sign(relayerId, signDataRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - signTransaction(relayerId, signTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).signTransaction(relayerId, signTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.RelayersApi = RelayersApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js -var require_signers_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignersApi = exports2.SignersApiFactory = exports2.SignersApiFp = exports2.SignersApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var SignersApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner: (signerCreateRequest_1, ...args_1) => __awaiter(this, [signerCreateRequest_1, ...args_1], void 0, function* (signerCreateRequest, options = {}) { - (0, common_1.assertParamExists)("createSigner", "signerCreateRequest", signerCreateRequest); - const localVarPath = `/api/v1/signers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signerCreateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { - (0, common_1.assertParamExists)("deleteSigner", "signerId", signerId); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { - (0, common_1.assertParamExists)("getSigner", "signerId", signerId); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/signers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner: (signerId_1, requestBody_1, ...args_1) => __awaiter(this, [signerId_1, requestBody_1, ...args_1], void 0, function* (signerId, requestBody, options = {}) { - (0, common_1.assertParamExists)("updateSigner", "signerId", signerId); - (0, common_1.assertParamExists)("updateSigner", "requestBody", requestBody); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(requestBody, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.SignersApiAxiosParamCreator = SignersApiAxiosParamCreator; - var SignersApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.SignersApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner(signerCreateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createSigner(signerCreateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.createSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner(signerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteSigner(signerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.deleteSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner(signerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getSigner(signerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.getSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listSigners(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.listSigners"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner(signerId, requestBody, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateSigner(signerId, requestBody, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.updateSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.SignersApiFp = SignersApiFp; - var SignersApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.SignersApiFp)(configuration); - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner(signerCreateRequest, options) { - return localVarFp.createSigner(signerCreateRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner(signerId, options) { - return localVarFp.deleteSigner(signerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner(signerId, options) { - return localVarFp.getSigner(signerId, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners(page, perPage, options) { - return localVarFp.listSigners(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner(signerId, requestBody, options) { - return localVarFp.updateSigner(signerId, requestBody, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.SignersApiFactory = SignersApiFactory; - var SignersApi = class extends base_1.BaseAPI { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - createSigner(signerCreateRequest, options) { - return (0, exports2.SignersApiFp)(this.configuration).createSigner(signerCreateRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - deleteSigner(signerId, options) { - return (0, exports2.SignersApiFp)(this.configuration).deleteSigner(signerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - getSigner(signerId, options) { - return (0, exports2.SignersApiFp)(this.configuration).getSigner(signerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - listSigners(page, perPage, options) { - return (0, exports2.SignersApiFp)(this.configuration).listSigners(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - updateSigner(signerId, requestBody, options) { - return (0, exports2.SignersApiFp)(this.configuration).updateSigner(signerId, requestBody, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.SignersApi = SignersApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js -var require_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_health_api(), exports2); - __exportStar(require_metrics_api(), exports2); - __exportStar(require_notifications_api(), exports2); - __exportStar(require_plugins_api(), exports2); - __exportStar(require_relayers_api(), exports2); - __exportStar(require_signers_api(), exports2); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js -var require_configuration = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Configuration = void 0; - var Configuration = class { - constructor(param = {}) { - var _a; - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) }); - this.formDataCtor = param.formDataCtor; - } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - isJsonMime(mime) { - const jsonMime = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i"); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === "application/json-patch+json"); - } - }; - exports2.Configuration = Configuration; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js -var require_api_response_balance_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js -var require_api_response_balance_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js -var require_api_response_delete_pending_transactions_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js -var require_api_response_delete_pending_transactions_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js -var require_api_response_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js -var require_api_response_notification_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js -var require_api_response_plugin_handler_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js -var require_api_response_plugin_handler_error_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js -var require_api_response_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js -var require_api_response_relayer_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js -var require_api_response_relayer_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js -var require_api_response_relayer_status_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js -var require_api_response_relayer_status_data_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOfNetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2["EVM"] = "evm"; - })(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js -var require_api_response_relayer_status_data_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2["STELLAR"] = "stellar"; - })(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js -var require_api_response_relayer_status_data_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2["SOLANA"] = "solana"; - })(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js -var require_api_response_sign_data_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js -var require_api_response_sign_data_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js -var require_api_response_sign_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js -var require_api_response_sign_transaction_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js -var require_api_response_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js -var require_api_response_signer_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js -var require_api_response_string = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js -var require_api_response_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js -var require_api_response_transaction_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js -var require_api_response_value = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js -var require_api_response_vec_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js -var require_api_response_vec_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js -var require_api_response_vec_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js -var require_api_response_vec_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js -var require_asset_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js -var require_asset_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOfTypeEnum = void 0; - var AssetSpecOneOfTypeEnum; - (function(AssetSpecOneOfTypeEnum2) { - AssetSpecOneOfTypeEnum2["NATIVE"] = "native"; - })(AssetSpecOneOfTypeEnum || (exports2.AssetSpecOneOfTypeEnum = AssetSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js -var require_asset_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOf1TypeEnum = void 0; - var AssetSpecOneOf1TypeEnum; - (function(AssetSpecOneOf1TypeEnum2) { - AssetSpecOneOf1TypeEnum2["CREDIT4"] = "credit4"; - })(AssetSpecOneOf1TypeEnum || (exports2.AssetSpecOneOf1TypeEnum = AssetSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js -var require_asset_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOf2TypeEnum = void 0; - var AssetSpecOneOf2TypeEnum; - (function(AssetSpecOneOf2TypeEnum2) { - AssetSpecOneOf2TypeEnum2["CREDIT12"] = "credit12"; - })(AssetSpecOneOf2TypeEnum || (exports2.AssetSpecOneOf2TypeEnum = AssetSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js -var require_auth_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js -var require_auth_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOfTypeEnum = void 0; - var AuthSpecOneOfTypeEnum; - (function(AuthSpecOneOfTypeEnum2) { - AuthSpecOneOfTypeEnum2["NONE"] = "none"; - })(AuthSpecOneOfTypeEnum || (exports2.AuthSpecOneOfTypeEnum = AuthSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js -var require_auth_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf1TypeEnum = void 0; - var AuthSpecOneOf1TypeEnum; - (function(AuthSpecOneOf1TypeEnum2) { - AuthSpecOneOf1TypeEnum2["SOURCE_ACCOUNT"] = "source_account"; - })(AuthSpecOneOf1TypeEnum || (exports2.AuthSpecOneOf1TypeEnum = AuthSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js -var require_auth_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf2TypeEnum = void 0; - var AuthSpecOneOf2TypeEnum; - (function(AuthSpecOneOf2TypeEnum2) { - AuthSpecOneOf2TypeEnum2["ADDRESSES"] = "addresses"; - })(AuthSpecOneOf2TypeEnum || (exports2.AuthSpecOneOf2TypeEnum = AuthSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js -var require_auth_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf3TypeEnum = void 0; - var AuthSpecOneOf3TypeEnum; - (function(AuthSpecOneOf3TypeEnum2) { - AuthSpecOneOf3TypeEnum2["XDR"] = "xdr"; - })(AuthSpecOneOf3TypeEnum || (exports2.AuthSpecOneOf3TypeEnum = AuthSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js -var require_aws_kms_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js -var require_balance_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js -var require_cdp_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js -var require_contract_source = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js -var require_contract_source_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContractSourceOneOfFromEnum = void 0; - var ContractSourceOneOfFromEnum; - (function(ContractSourceOneOfFromEnum2) { - ContractSourceOneOfFromEnum2["ADDRESS"] = "address"; - })(ContractSourceOneOfFromEnum || (exports2.ContractSourceOneOfFromEnum = ContractSourceOneOfFromEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js -var require_contract_source_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContractSourceOneOf1FromEnum = void 0; - var ContractSourceOneOf1FromEnum; - (function(ContractSourceOneOf1FromEnum2) { - ContractSourceOneOf1FromEnum2["CONTRACT"] = "contract"; - })(ContractSourceOneOf1FromEnum || (exports2.ContractSourceOneOf1FromEnum = ContractSourceOneOf1FromEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js -var require_create_relayer_policy_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js -var require_create_relayer_policy_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js -var require_create_relayer_policy_request_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js -var require_create_relayer_policy_request_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js -var require_create_relayer_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js -var require_delete_pending_transactions_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js -var require_disabled_reason = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js -var require_disabled_reason_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOfTypeEnum = void 0; - var DisabledReasonOneOfTypeEnum; - (function(DisabledReasonOneOfTypeEnum2) { - DisabledReasonOneOfTypeEnum2["NONCE_SYNC_FAILED"] = "NonceSyncFailed"; - })(DisabledReasonOneOfTypeEnum || (exports2.DisabledReasonOneOfTypeEnum = DisabledReasonOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js -var require_disabled_reason_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf1TypeEnum = void 0; - var DisabledReasonOneOf1TypeEnum; - (function(DisabledReasonOneOf1TypeEnum2) { - DisabledReasonOneOf1TypeEnum2["RPC_VALIDATION_FAILED"] = "RpcValidationFailed"; - })(DisabledReasonOneOf1TypeEnum || (exports2.DisabledReasonOneOf1TypeEnum = DisabledReasonOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js -var require_disabled_reason_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf2TypeEnum = void 0; - var DisabledReasonOneOf2TypeEnum; - (function(DisabledReasonOneOf2TypeEnum2) { - DisabledReasonOneOf2TypeEnum2["BALANCE_CHECK_FAILED"] = "BalanceCheckFailed"; - })(DisabledReasonOneOf2TypeEnum || (exports2.DisabledReasonOneOf2TypeEnum = DisabledReasonOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js -var require_disabled_reason_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf3TypeEnum = void 0; - var DisabledReasonOneOf3TypeEnum; - (function(DisabledReasonOneOf3TypeEnum2) { - DisabledReasonOneOf3TypeEnum2["SEQUENCE_SYNC_FAILED"] = "SequenceSyncFailed"; - })(DisabledReasonOneOf3TypeEnum || (exports2.DisabledReasonOneOf3TypeEnum = DisabledReasonOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js -var require_disabled_reason_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf4TypeEnum = void 0; - var DisabledReasonOneOf4TypeEnum; - (function(DisabledReasonOneOf4TypeEnum2) { - DisabledReasonOneOf4TypeEnum2["MULTIPLE"] = "Multiple"; - })(DisabledReasonOneOf4TypeEnum || (exports2.DisabledReasonOneOf4TypeEnum = DisabledReasonOneOf4TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js -var require_evm_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js -var require_evm_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js -var require_evm_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js -var require_evm_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js -var require_evm_transaction_data_signature = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js -var require_evm_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js -var require_evm_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js -var require_fee_estimate_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js -var require_fee_estimate_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js -var require_get_features_enabled_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js -var require_get_supported_tokens_item = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js -var require_get_supported_tokens_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js -var require_google_cloud_kms_signer_key_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js -var require_google_cloud_kms_signer_key_response_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js -var require_google_cloud_kms_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js -var require_google_cloud_kms_signer_service_account_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js -var require_google_cloud_kms_signer_service_account_response_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js -var require_json_rpc_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js -var require_json_rpc_id = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js -var require_json_rpc_request_network_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js -var require_json_rpc_response_network_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js -var require_json_rpc_response_network_rpc_result_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js -var require_jupiter_swap_options = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js -var require_local_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js -var require_log_entry = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js -var require_log_level = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LogLevel = void 0; - var LogLevel; - (function(LogLevel2) { - LogLevel2["LOG"] = "log"; - LogLevel2["INFO"] = "info"; - LogLevel2["ERROR"] = "error"; - LogLevel2["WARN"] = "warn"; - LogLevel2["DEBUG"] = "debug"; - LogLevel2["RESULT"] = "result"; - })(LogLevel || (exports2.LogLevel = LogLevel = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js -var require_memo_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js -var require_memo_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOfTypeEnum = void 0; - var MemoSpecOneOfTypeEnum; - (function(MemoSpecOneOfTypeEnum2) { - MemoSpecOneOfTypeEnum2["NONE"] = "none"; - })(MemoSpecOneOfTypeEnum || (exports2.MemoSpecOneOfTypeEnum = MemoSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js -var require_memo_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf1TypeEnum = void 0; - var MemoSpecOneOf1TypeEnum; - (function(MemoSpecOneOf1TypeEnum2) { - MemoSpecOneOf1TypeEnum2["TEXT"] = "text"; - })(MemoSpecOneOf1TypeEnum || (exports2.MemoSpecOneOf1TypeEnum = MemoSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js -var require_memo_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf2TypeEnum = void 0; - var MemoSpecOneOf2TypeEnum; - (function(MemoSpecOneOf2TypeEnum2) { - MemoSpecOneOf2TypeEnum2["ID"] = "id"; - })(MemoSpecOneOf2TypeEnum || (exports2.MemoSpecOneOf2TypeEnum = MemoSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js -var require_memo_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf3TypeEnum = void 0; - var MemoSpecOneOf3TypeEnum; - (function(MemoSpecOneOf3TypeEnum2) { - MemoSpecOneOf3TypeEnum2["HASH"] = "hash"; - })(MemoSpecOneOf3TypeEnum || (exports2.MemoSpecOneOf3TypeEnum = MemoSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js -var require_memo_spec_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf4TypeEnum = void 0; - var MemoSpecOneOf4TypeEnum; - (function(MemoSpecOneOf4TypeEnum2) { - MemoSpecOneOf4TypeEnum2["RETURN"] = "return"; - })(MemoSpecOneOf4TypeEnum || (exports2.MemoSpecOneOf4TypeEnum = MemoSpecOneOf4TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js -var require_network_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js -var require_network_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js -var require_network_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js -var require_network_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js -var require_notification_create_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js -var require_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js -var require_notification_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.NotificationType = void 0; - var NotificationType; - (function(NotificationType2) { - NotificationType2["WEBHOOK"] = "webhook"; - })(NotificationType || (exports2.NotificationType = NotificationType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js -var require_notification_update_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js -var require_operation_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js -var require_operation_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOfTypeEnum = void 0; - var OperationSpecOneOfTypeEnum; - (function(OperationSpecOneOfTypeEnum2) { - OperationSpecOneOfTypeEnum2["PAYMENT"] = "payment"; - })(OperationSpecOneOfTypeEnum || (exports2.OperationSpecOneOfTypeEnum = OperationSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js -var require_operation_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf1TypeEnum = void 0; - var OperationSpecOneOf1TypeEnum; - (function(OperationSpecOneOf1TypeEnum2) { - OperationSpecOneOf1TypeEnum2["INVOKE_CONTRACT"] = "invoke_contract"; - })(OperationSpecOneOf1TypeEnum || (exports2.OperationSpecOneOf1TypeEnum = OperationSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js -var require_operation_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf2TypeEnum = void 0; - var OperationSpecOneOf2TypeEnum; - (function(OperationSpecOneOf2TypeEnum2) { - OperationSpecOneOf2TypeEnum2["CREATE_CONTRACT"] = "create_contract"; - })(OperationSpecOneOf2TypeEnum || (exports2.OperationSpecOneOf2TypeEnum = OperationSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js -var require_operation_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf3TypeEnum = void 0; - var OperationSpecOneOf3TypeEnum; - (function(OperationSpecOneOf3TypeEnum2) { - OperationSpecOneOf3TypeEnum2["UPLOAD_WASM"] = "upload_wasm"; - })(OperationSpecOneOf3TypeEnum || (exports2.OperationSpecOneOf3TypeEnum = OperationSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js -var require_pagination_meta = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js -var require_plugin_call_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js -var require_plugin_handler_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js -var require_plugin_metadata = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js -var require_prepare_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js -var require_prepare_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js -var require_relayer_evm_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js -var require_relayer_network_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js -var require_relayer_network_policy_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js -var require_relayer_network_policy_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js -var require_relayer_network_policy_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js -var require_relayer_network_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js -var require_relayer_network_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RelayerNetworkType = void 0; - var RelayerNetworkType; - (function(RelayerNetworkType2) { - RelayerNetworkType2["EVM"] = "evm"; - RelayerNetworkType2["SOLANA"] = "solana"; - RelayerNetworkType2["STELLAR"] = "stellar"; - })(RelayerNetworkType || (exports2.RelayerNetworkType = RelayerNetworkType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js -var require_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js -var require_relayer_solana_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js -var require_relayer_solana_swap_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js -var require_relayer_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js -var require_relayer_stellar_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js -var require_rpc_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js -var require_sign_and_send_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js -var require_sign_and_send_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js -var require_sign_data_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js -var require_sign_data_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js -var require_sign_data_response_evm = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js -var require_sign_data_response_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js -var require_sign_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js -var require_sign_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js -var require_sign_transaction_request_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js -var require_sign_transaction_request_stellar = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js -var require_sign_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js -var require_sign_transaction_response_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js -var require_sign_transaction_response_stellar = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js -var require_sign_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js -var require_sign_typed_data_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js -var require_signer_config_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js -var require_signer_config_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js -var require_signer_config_response_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js -var require_signer_config_response_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js -var require_signer_config_response_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js -var require_signer_config_response_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js -var require_signer_config_response_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js -var require_signer_config_response_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js -var require_signer_create_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js -var require_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js -var require_signer_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignerType = void 0; - var SignerType; - (function(SignerType2) { - SignerType2["LOCAL"] = "local"; - SignerType2["AWS_KMS"] = "aws_kms"; - SignerType2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; - SignerType2["VAULT"] = "vault"; - SignerType2["VAULT_TRANSIT"] = "vault_transit"; - SignerType2["TURNKEY"] = "turnkey"; - SignerType2["CDP"] = "cdp"; - })(SignerType || (exports2.SignerType = SignerType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js -var require_signer_type_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignerTypeRequest = void 0; - var SignerTypeRequest; - (function(SignerTypeRequest2) { - SignerTypeRequest2["PLAIN"] = "plain"; - SignerTypeRequest2["AWS_KMS"] = "aws_kms"; - SignerTypeRequest2["VAULT"] = "vault"; - SignerTypeRequest2["VAULT_TRANSIT"] = "vault_transit"; - SignerTypeRequest2["TURNKEY"] = "turnkey"; - SignerTypeRequest2["CDP"] = "cdp"; - SignerTypeRequest2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; - })(SignerTypeRequest || (exports2.SignerTypeRequest = SignerTypeRequest = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js -var require_solana_account_meta = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js -var require_solana_allowed_tokens_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js -var require_solana_allowed_tokens_swap_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js -var require_solana_fee_payment_strategy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaFeePaymentStrategy = void 0; - var SolanaFeePaymentStrategy; - (function(SolanaFeePaymentStrategy2) { - SolanaFeePaymentStrategy2["USER"] = "user"; - SolanaFeePaymentStrategy2["RELAYER"] = "relayer"; - })(SolanaFeePaymentStrategy || (exports2.SolanaFeePaymentStrategy = SolanaFeePaymentStrategy = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js -var require_solana_instruction_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js -var require_solana_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js -var require_solana_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js -var require_solana_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOfMethodEnum = void 0; - var SolanaRpcRequestOneOfMethodEnum; - (function(SolanaRpcRequestOneOfMethodEnum2) { - SolanaRpcRequestOneOfMethodEnum2["FEE_ESTIMATE"] = "feeEstimate"; - })(SolanaRpcRequestOneOfMethodEnum || (exports2.SolanaRpcRequestOneOfMethodEnum = SolanaRpcRequestOneOfMethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js -var require_solana_rpc_request_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf1MethodEnum = void 0; - var SolanaRpcRequestOneOf1MethodEnum; - (function(SolanaRpcRequestOneOf1MethodEnum2) { - SolanaRpcRequestOneOf1MethodEnum2["TRANSFER_TRANSACTION"] = "transferTransaction"; - })(SolanaRpcRequestOneOf1MethodEnum || (exports2.SolanaRpcRequestOneOf1MethodEnum = SolanaRpcRequestOneOf1MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js -var require_solana_rpc_request_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf2MethodEnum = void 0; - var SolanaRpcRequestOneOf2MethodEnum; - (function(SolanaRpcRequestOneOf2MethodEnum2) { - SolanaRpcRequestOneOf2MethodEnum2["PREPARE_TRANSACTION"] = "prepareTransaction"; - })(SolanaRpcRequestOneOf2MethodEnum || (exports2.SolanaRpcRequestOneOf2MethodEnum = SolanaRpcRequestOneOf2MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js -var require_solana_rpc_request_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf3MethodEnum = void 0; - var SolanaRpcRequestOneOf3MethodEnum; - (function(SolanaRpcRequestOneOf3MethodEnum2) { - SolanaRpcRequestOneOf3MethodEnum2["SIGN_TRANSACTION"] = "signTransaction"; - })(SolanaRpcRequestOneOf3MethodEnum || (exports2.SolanaRpcRequestOneOf3MethodEnum = SolanaRpcRequestOneOf3MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js -var require_solana_rpc_request_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf4MethodEnum = void 0; - var SolanaRpcRequestOneOf4MethodEnum; - (function(SolanaRpcRequestOneOf4MethodEnum2) { - SolanaRpcRequestOneOf4MethodEnum2["SIGN_AND_SEND_TRANSACTION"] = "signAndSendTransaction"; - })(SolanaRpcRequestOneOf4MethodEnum || (exports2.SolanaRpcRequestOneOf4MethodEnum = SolanaRpcRequestOneOf4MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js -var require_solana_rpc_request_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf5MethodEnum = void 0; - var SolanaRpcRequestOneOf5MethodEnum; - (function(SolanaRpcRequestOneOf5MethodEnum2) { - SolanaRpcRequestOneOf5MethodEnum2["GET_SUPPORTED_TOKENS"] = "getSupportedTokens"; - })(SolanaRpcRequestOneOf5MethodEnum || (exports2.SolanaRpcRequestOneOf5MethodEnum = SolanaRpcRequestOneOf5MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js -var require_solana_rpc_request_one_of6 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf6MethodEnum = void 0; - var SolanaRpcRequestOneOf6MethodEnum; - (function(SolanaRpcRequestOneOf6MethodEnum2) { - SolanaRpcRequestOneOf6MethodEnum2["GET_FEATURES_ENABLED"] = "getFeaturesEnabled"; - })(SolanaRpcRequestOneOf6MethodEnum || (exports2.SolanaRpcRequestOneOf6MethodEnum = SolanaRpcRequestOneOf6MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js -var require_solana_rpc_request_one_of7 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf7MethodEnum = void 0; - var SolanaRpcRequestOneOf7MethodEnum; - (function(SolanaRpcRequestOneOf7MethodEnum2) { - SolanaRpcRequestOneOf7MethodEnum2["RAW_RPC_REQUEST"] = "rawRpcRequest"; - })(SolanaRpcRequestOneOf7MethodEnum || (exports2.SolanaRpcRequestOneOf7MethodEnum = SolanaRpcRequestOneOf7MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js -var require_solana_rpc_request_one_of7_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js -var require_solana_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js -var require_solana_rpc_result_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js -var require_solana_rpc_result_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js -var require_solana_rpc_result_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js -var require_solana_rpc_result_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js -var require_solana_rpc_result_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js -var require_solana_rpc_result_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js -var require_solana_rpc_result_one_of6 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js -var require_solana_rpc_result_one_of7 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcResultOneOf7MethodEnum = void 0; - var SolanaRpcResultOneOf7MethodEnum; - (function(SolanaRpcResultOneOf7MethodEnum2) { - SolanaRpcResultOneOf7MethodEnum2["RAW_RPC"] = "rawRpc"; - })(SolanaRpcResultOneOf7MethodEnum || (exports2.SolanaRpcResultOneOf7MethodEnum = SolanaRpcResultOneOf7MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js -var require_solana_swap_strategy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaSwapStrategy = void 0; - var SolanaSwapStrategy; - (function(SolanaSwapStrategy2) { - SolanaSwapStrategy2["JUPITER_SWAP"] = "jupiter-swap"; - SolanaSwapStrategy2["JUPITER_ULTRA"] = "jupiter-ultra"; - SolanaSwapStrategy2["NOOP"] = "noop"; - })(SolanaSwapStrategy || (exports2.SolanaSwapStrategy = SolanaSwapStrategy = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js -var require_solana_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js -var require_solana_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js -var require_speed = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Speed = void 0; - var Speed; - (function(Speed2) { - Speed2["FASTEST"] = "fastest"; - Speed2["FAST"] = "fast"; - Speed2["AVERAGE"] = "average"; - Speed2["SAFE_LOW"] = "safeLow"; - })(Speed || (exports2.Speed = Speed = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js -var require_stellar_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js -var require_stellar_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js -var require_stellar_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js -var require_stellar_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js -var require_stellar_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js -var require_stellar_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js -var require_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js -var require_transaction_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TransactionStatus = void 0; - var TransactionStatus2; - (function(TransactionStatus3) { - TransactionStatus3["CANCELED"] = "canceled"; - TransactionStatus3["PENDING"] = "pending"; - TransactionStatus3["SENT"] = "sent"; - TransactionStatus3["SUBMITTED"] = "submitted"; - TransactionStatus3["MINED"] = "mined"; - TransactionStatus3["CONFIRMED"] = "confirmed"; - TransactionStatus3["FAILED"] = "failed"; - TransactionStatus3["EXPIRED"] = "expired"; - })(TransactionStatus2 || (exports2.TransactionStatus = TransactionStatus2 = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js -var require_transfer_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js -var require_transfer_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js -var require_turnkey_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js -var require_update_relayer_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js -var require_vault_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js -var require_vault_transit_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js -var require_wasm_source = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js -var require_wasm_source_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js -var require_wasm_source_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js -var require_plugin_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PluginError = void 0; - exports2.pluginError = pluginError2; - var PluginError = class extends Error { - constructor(message, opts) { - super(message); - this.name = "PluginError"; - this.code = opts === null || opts === void 0 ? void 0 : opts.code; - this.status = opts === null || opts === void 0 ? void 0 : opts.status; - this.details = opts === null || opts === void 0 ? void 0 : opts.details; - } - }; - exports2.PluginError = PluginError; - function pluginError2(message, opts) { - return new PluginError(message, opts); - } - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js -var require_models = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_api_response_balance_response(), exports2); - __exportStar(require_api_response_balance_response_data(), exports2); - __exportStar(require_api_response_delete_pending_transactions_response(), exports2); - __exportStar(require_api_response_delete_pending_transactions_response_data(), exports2); - __exportStar(require_api_response_notification_response(), exports2); - __exportStar(require_api_response_notification_response_data(), exports2); - __exportStar(require_api_response_plugin_handler_error(), exports2); - __exportStar(require_api_response_plugin_handler_error_data(), exports2); - __exportStar(require_api_response_relayer_response(), exports2); - __exportStar(require_api_response_relayer_response_data(), exports2); - __exportStar(require_api_response_relayer_status(), exports2); - __exportStar(require_api_response_relayer_status_data(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of1(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of2(), exports2); - __exportStar(require_api_response_sign_data_response(), exports2); - __exportStar(require_api_response_sign_data_response_data(), exports2); - __exportStar(require_api_response_sign_transaction_response(), exports2); - __exportStar(require_api_response_sign_transaction_response_data(), exports2); - __exportStar(require_api_response_signer_response(), exports2); - __exportStar(require_api_response_signer_response_data(), exports2); - __exportStar(require_api_response_string(), exports2); - __exportStar(require_api_response_transaction_response(), exports2); - __exportStar(require_api_response_transaction_response_data(), exports2); - __exportStar(require_api_response_value(), exports2); - __exportStar(require_api_response_vec_notification_response(), exports2); - __exportStar(require_api_response_vec_relayer_response(), exports2); - __exportStar(require_api_response_vec_signer_response(), exports2); - __exportStar(require_api_response_vec_transaction_response(), exports2); - __exportStar(require_asset_spec(), exports2); - __exportStar(require_asset_spec_one_of(), exports2); - __exportStar(require_asset_spec_one_of1(), exports2); - __exportStar(require_asset_spec_one_of2(), exports2); - __exportStar(require_auth_spec(), exports2); - __exportStar(require_auth_spec_one_of(), exports2); - __exportStar(require_auth_spec_one_of1(), exports2); - __exportStar(require_auth_spec_one_of2(), exports2); - __exportStar(require_auth_spec_one_of3(), exports2); - __exportStar(require_aws_kms_signer_request_config(), exports2); - __exportStar(require_balance_response(), exports2); - __exportStar(require_cdp_signer_request_config(), exports2); - __exportStar(require_contract_source(), exports2); - __exportStar(require_contract_source_one_of(), exports2); - __exportStar(require_contract_source_one_of1(), exports2); - __exportStar(require_create_relayer_policy_request(), exports2); - __exportStar(require_create_relayer_policy_request_one_of(), exports2); - __exportStar(require_create_relayer_policy_request_one_of1(), exports2); - __exportStar(require_create_relayer_policy_request_one_of2(), exports2); - __exportStar(require_create_relayer_request(), exports2); - __exportStar(require_delete_pending_transactions_response(), exports2); - __exportStar(require_disabled_reason(), exports2); - __exportStar(require_disabled_reason_one_of(), exports2); - __exportStar(require_disabled_reason_one_of1(), exports2); - __exportStar(require_disabled_reason_one_of2(), exports2); - __exportStar(require_disabled_reason_one_of3(), exports2); - __exportStar(require_disabled_reason_one_of4(), exports2); - __exportStar(require_evm_policy_response(), exports2); - __exportStar(require_evm_rpc_request(), exports2); - __exportStar(require_evm_rpc_request_one_of(), exports2); - __exportStar(require_evm_rpc_result(), exports2); - __exportStar(require_evm_transaction_data_signature(), exports2); - __exportStar(require_evm_transaction_request(), exports2); - __exportStar(require_evm_transaction_response(), exports2); - __exportStar(require_fee_estimate_request_params(), exports2); - __exportStar(require_fee_estimate_result(), exports2); - __exportStar(require_get_features_enabled_result(), exports2); - __exportStar(require_get_supported_tokens_item(), exports2); - __exportStar(require_get_supported_tokens_result(), exports2); - __exportStar(require_google_cloud_kms_signer_key_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_key_response_config(), exports2); - __exportStar(require_google_cloud_kms_signer_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_service_account_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_service_account_response_config(), exports2); - __exportStar(require_json_rpc_error(), exports2); - __exportStar(require_json_rpc_id(), exports2); - __exportStar(require_json_rpc_request_network_rpc_request(), exports2); - __exportStar(require_json_rpc_response_network_rpc_result(), exports2); - __exportStar(require_json_rpc_response_network_rpc_result_result(), exports2); - __exportStar(require_jupiter_swap_options(), exports2); - __exportStar(require_local_signer_request_config(), exports2); - __exportStar(require_log_entry(), exports2); - __exportStar(require_log_level(), exports2); - __exportStar(require_memo_spec(), exports2); - __exportStar(require_memo_spec_one_of(), exports2); - __exportStar(require_memo_spec_one_of1(), exports2); - __exportStar(require_memo_spec_one_of2(), exports2); - __exportStar(require_memo_spec_one_of3(), exports2); - __exportStar(require_memo_spec_one_of4(), exports2); - __exportStar(require_network_policy_response(), exports2); - __exportStar(require_network_rpc_request(), exports2); - __exportStar(require_network_rpc_result(), exports2); - __exportStar(require_network_transaction_request(), exports2); - __exportStar(require_notification_create_request(), exports2); - __exportStar(require_notification_response(), exports2); - __exportStar(require_notification_type(), exports2); - __exportStar(require_notification_update_request(), exports2); - __exportStar(require_operation_spec(), exports2); - __exportStar(require_operation_spec_one_of(), exports2); - __exportStar(require_operation_spec_one_of1(), exports2); - __exportStar(require_operation_spec_one_of2(), exports2); - __exportStar(require_operation_spec_one_of3(), exports2); - __exportStar(require_pagination_meta(), exports2); - __exportStar(require_plugin_call_request(), exports2); - __exportStar(require_plugin_handler_error(), exports2); - __exportStar(require_plugin_metadata(), exports2); - __exportStar(require_prepare_transaction_request_params(), exports2); - __exportStar(require_prepare_transaction_result(), exports2); - __exportStar(require_relayer_evm_policy(), exports2); - __exportStar(require_relayer_network_policy(), exports2); - __exportStar(require_relayer_network_policy_one_of(), exports2); - __exportStar(require_relayer_network_policy_one_of1(), exports2); - __exportStar(require_relayer_network_policy_one_of2(), exports2); - __exportStar(require_relayer_network_policy_response(), exports2); - __exportStar(require_relayer_network_type(), exports2); - __exportStar(require_relayer_response(), exports2); - __exportStar(require_relayer_solana_policy(), exports2); - __exportStar(require_relayer_solana_swap_config(), exports2); - __exportStar(require_relayer_status(), exports2); - __exportStar(require_relayer_stellar_policy(), exports2); - __exportStar(require_rpc_config(), exports2); - __exportStar(require_sign_and_send_transaction_request_params(), exports2); - __exportStar(require_sign_and_send_transaction_result(), exports2); - __exportStar(require_sign_data_request(), exports2); - __exportStar(require_sign_data_response(), exports2); - __exportStar(require_sign_data_response_evm(), exports2); - __exportStar(require_sign_data_response_solana(), exports2); - __exportStar(require_sign_transaction_request(), exports2); - __exportStar(require_sign_transaction_request_params(), exports2); - __exportStar(require_sign_transaction_request_solana(), exports2); - __exportStar(require_sign_transaction_request_stellar(), exports2); - __exportStar(require_sign_transaction_response(), exports2); - __exportStar(require_sign_transaction_response_solana(), exports2); - __exportStar(require_sign_transaction_response_stellar(), exports2); - __exportStar(require_sign_transaction_result(), exports2); - __exportStar(require_sign_typed_data_request(), exports2); - __exportStar(require_signer_config_request(), exports2); - __exportStar(require_signer_config_response(), exports2); - __exportStar(require_signer_config_response_one_of(), exports2); - __exportStar(require_signer_config_response_one_of1(), exports2); - __exportStar(require_signer_config_response_one_of2(), exports2); - __exportStar(require_signer_config_response_one_of3(), exports2); - __exportStar(require_signer_config_response_one_of4(), exports2); - __exportStar(require_signer_config_response_one_of5(), exports2); - __exportStar(require_signer_create_request(), exports2); - __exportStar(require_signer_response(), exports2); - __exportStar(require_signer_type(), exports2); - __exportStar(require_signer_type_request(), exports2); - __exportStar(require_solana_account_meta(), exports2); - __exportStar(require_solana_allowed_tokens_policy(), exports2); - __exportStar(require_solana_allowed_tokens_swap_config(), exports2); - __exportStar(require_solana_fee_payment_strategy(), exports2); - __exportStar(require_solana_instruction_spec(), exports2); - __exportStar(require_solana_policy_response(), exports2); - __exportStar(require_solana_rpc_request(), exports2); - __exportStar(require_solana_rpc_request_one_of(), exports2); - __exportStar(require_solana_rpc_request_one_of1(), exports2); - __exportStar(require_solana_rpc_request_one_of2(), exports2); - __exportStar(require_solana_rpc_request_one_of3(), exports2); - __exportStar(require_solana_rpc_request_one_of4(), exports2); - __exportStar(require_solana_rpc_request_one_of5(), exports2); - __exportStar(require_solana_rpc_request_one_of6(), exports2); - __exportStar(require_solana_rpc_request_one_of7(), exports2); - __exportStar(require_solana_rpc_request_one_of7_params(), exports2); - __exportStar(require_solana_rpc_result(), exports2); - __exportStar(require_solana_rpc_result_one_of(), exports2); - __exportStar(require_solana_rpc_result_one_of1(), exports2); - __exportStar(require_solana_rpc_result_one_of2(), exports2); - __exportStar(require_solana_rpc_result_one_of3(), exports2); - __exportStar(require_solana_rpc_result_one_of4(), exports2); - __exportStar(require_solana_rpc_result_one_of5(), exports2); - __exportStar(require_solana_rpc_result_one_of6(), exports2); - __exportStar(require_solana_rpc_result_one_of7(), exports2); - __exportStar(require_solana_swap_strategy(), exports2); - __exportStar(require_solana_transaction_request(), exports2); - __exportStar(require_solana_transaction_response(), exports2); - __exportStar(require_speed(), exports2); - __exportStar(require_stellar_policy_response(), exports2); - __exportStar(require_stellar_rpc_request(), exports2); - __exportStar(require_stellar_rpc_request_one_of(), exports2); - __exportStar(require_stellar_rpc_result(), exports2); - __exportStar(require_stellar_transaction_request(), exports2); - __exportStar(require_stellar_transaction_response(), exports2); - __exportStar(require_transaction_response(), exports2); - __exportStar(require_transaction_status(), exports2); - __exportStar(require_transfer_transaction_request_params(), exports2); - __exportStar(require_transfer_transaction_result(), exports2); - __exportStar(require_turnkey_signer_request_config(), exports2); - __exportStar(require_update_relayer_request(), exports2); - __exportStar(require_vault_signer_request_config(), exports2); - __exportStar(require_vault_transit_signer_request_config(), exports2); - __exportStar(require_wasm_source(), exports2); - __exportStar(require_wasm_source_one_of(), exports2); - __exportStar(require_wasm_source_one_of1(), exports2); - __exportStar(require_plugin_api(), exports2); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js -var require_dist = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_api(), exports2); - __exportStar(require_configuration(), exports2); - __exportStar(require_models(), exports2); - } -}); - -// lib/sandbox-executor.ts -var sandbox_executor_exports = {}; -__export(sandbox_executor_exports, { - default: () => executeInSandbox -}); -module.exports = __toCommonJS(sandbox_executor_exports); -var vm = __toESM(require("node:vm")); -var v8 = __toESM(require("node:v8")); -var net = __toESM(require("node:net")); - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/stringify.js -var byteToHex = []; -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); -} -function unsafeStringify(arr, offset = 0) { - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/rng.js -var import_crypto = require("crypto"); -var rnds8Pool = new Uint8Array(256); -var poolPtr = rnds8Pool.length; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - (0, import_crypto.randomFillSync)(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/native.js -var import_crypto2 = require("crypto"); -var native_default = { randomUUID: import_crypto2.randomUUID }; - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/v4.js -function v4(options, buf, offset) { - if (native_default.randomUUID && !buf && !options) { - return native_default.randomUUID(); - } - options = options || {}; - const rnds = options.random ?? options.rng?.() ?? rng(); - if (rnds.length < 16) { - throw new Error("Random bytes length must be >= 16"); - } - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - if (offset < 0 || offset + 16 > buf.length) { - throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); - } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); -} -var v4_default = v4; - -// lib/kv.ts -var import_ioredis = __toESM(require_built3()); -var import_crypto3 = require("crypto"); -var DefaultPluginKVStore = class { - /** - * Create a store bound to a plugin namespace. - * - pluginId: used for the namespace and Redis connection name. - * Curly braces are stripped to avoid nested hash-tags. - * - Uses REDIS_URL if provided; enables lazyConnect and auto pipelining. - */ - constructor(pluginId) { - this.KEY_REGEX = /^[A-Za-z0-9:_-]{1,512}$/; - this.UNLOCK_SCRIPT = 'if redis.call("GET", KEYS[1]) == ARGV[1] then return redis.call("UNLINK", KEYS[1]) else return 0 end'; - const url = process.env.REDIS_URL ?? "redis://localhost:6379"; - this.client = new import_ioredis.default(url, { - connectionName: `plugin_kv:${pluginId}`, - lazyConnect: true, - enableOfflineQueue: true, - enableAutoPipelining: true, - maxRetriesPerRequest: 1, - retryStrategy: (n) => Math.min(n * 50, 1e3) - }); - const pid = pluginId.replace(/[{}]/g, ""); - this.ns = `plugin_kv:{${pid}}`; - } - /** - * Build a namespaced Redis key for the given segment and user key. - * Validates the user-provided key and throws on invalid input. - * @param seg - The key segment: 'data' or 'lock'. - * @param key - The user-provided key to namespace. - * @returns The fully-qualified Redis key. - * @throws Error if the key does not match the allowed pattern. - */ - key(seg, key) { - if (!this.KEY_REGEX.test(key)) throw new Error("invalid key"); - return `${this.ns}:${seg}:${key}`; - } - /** - * Retrieve and JSON-parse the value for a key. - * Returns null if the key is not present. - * @typeParam T - Expected value type after JSON parse. - * @param key - The key to retrieve. - * @returns Resolves to the parsed value, or null if missing. - */ - async get(key) { - const v = await this.client.get(this.key("data", key)); - if (v == null) return null; - return JSON.parse(v); - } - /** - * Store a JSON-encoded value under the key. - * - If opts.ttlSec > 0, sets an expiry in seconds; otherwise no expiry. - * - Throws if value is undefined. - * Returns true on success. - * @param key - The key to set. - * @param value - Serializable value; must not be undefined. - * @param opts - Optional settings. - * @param opts.ttlSec - Time-to-live in seconds; if > 0, sets expiry. - * @returns True on success. - * @throws Error if `value` is undefined or the key is invalid. - */ - async set(key, value, opts) { - if (value === void 0) throw new Error("value must not be undefined"); - const payload = JSON.stringify(value); - const k = this.key("data", key); - const ex = Math.max(0, Math.floor(opts?.ttlSec ?? 0)); - const res = ex > 0 ? await this.client.set(k, payload, "EX", ex) : await this.client.set(k, payload); - return res === "OK"; - } - /** - * Remove the key. - * @param key - The key to remove. - * @returns True if exactly one key was unlinked. - */ - async del(key) { - const k = this.key("data", key); - const n = await this.client.unlink(k); - return n === 1; - } - /** - * Check whether a key exists. - * @param key - The key to check. - * @returns True if the key exists. - */ - async exists(key) { - return await this.client.exists(this.key("data", key)) === 1; - } - /** - * List keys in this store matching `pattern` (glob-like, default '*'). - * Returns bare keys (without namespace). Uses SCAN with COUNT=`batch`. - * @param pattern - Glob-like match pattern (default '*'). - * @param batch - SCAN COUNT per iteration (default 500). - * @returns Array of bare keys (without the namespace prefix). - */ - async listKeys(pattern = "*", batch = 500) { - const out = []; - let cursor = "0"; - const prefix = `${this.ns}:data:`; - do { - const [next, keys] = await this.client.scan(cursor, "MATCH", `${prefix}${pattern}`, "COUNT", batch); - cursor = next; - for (const k of keys) out.push(k.slice(prefix.length)); - } while (cursor !== "0"); - return out; - } - /** - * Delete all keys in this plugin namespace. - * Returns the number of keys removed. - * @returns The number of keys deleted. - */ - async clear() { - let cursor = "0"; - let deleted = 0; - do { - const [next, keys] = await this.client.scan(cursor, "MATCH", `${this.ns}:*`, "COUNT", 1e3); - cursor = next; - if (keys.length) { - const chunkSize = 512; - for (let i = 0; i < keys.length; i += chunkSize) { - const chunk = keys.slice(i, i + chunkSize); - const pipeline = this.client.pipeline(); - chunk.forEach((k) => pipeline.unlink(k)); - const results = await pipeline.exec(); - if (results) { - for (const [, res] of results) { - if (typeof res === "number") deleted += res; - } - } - } - } - } while (cursor !== "0"); - return deleted; - } - /** - * Run `fn` while holding a distributed lock for `key`. - * The lock is acquired with SET NX PX and released via a token-checked - * Lua script to avoid unlocking another client's lock. - * - opts.ttlSec: lock expiry in seconds (default 30) - * - opts.onBusy: 'throw' (default) or 'skip' to return null when busy - * @typeParam T - The return type of `fn`. - * @param key - The lock key. - * @param fn - Async function to execute while holding the lock. - * @param opts - Lock options. - * @param opts.ttlSec - Lock expiry in seconds (default 30). - * @param opts.onBusy - Behavior when the lock is busy: 'throw' or 'skip'. - * @returns The result of `fn`, or null when skipped due to a busy lock. - * @throws Error if the lock is busy and `onBusy` is 'throw'. - */ - async withLock(key, fn, opts) { - const ttlSec = opts?.ttlSec ?? 30; - const onBusy = opts?.onBusy ?? "throw"; - const lockKey = this.key("lock", key); - const token = (0, import_crypto3.randomUUID)(); - const ok = await this.client.set(lockKey, token, "PX", ttlSec * 1e3, "NX"); - if (ok !== "OK") { - if (onBusy === "skip") return null; - throw new Error("lock busy"); - } - try { - return await fn(); - } finally { - await this.client.eval(this.UNLOCK_SCRIPT, 1, lockKey, token); - } - } - /** - * Explicitly connect to Redis. - * Normally not needed since lazyConnect will connect on first command. - */ - async connect() { - await this.client.connect(); - } - /** - * Disconnect from Redis. - * Call this when the store is no longer needed. - */ - async disconnect() { - await this.client.disconnect(); - } -}; - -// lib/compiler.ts -var esbuild = __toESM(require_main()); -var fs = __toESM(require("node:fs")); -var path = __toESM(require("node:path")); -var os = __toESM(require("node:os")); -var MAX_SOURCE_SIZE = 5 * 1024 * 1024; -var MAX_COMPILED_SIZE = 10 * 1024 * 1024; -var DEFAULT_PLUGIN_BASE_DIR = path.resolve(process.cwd(), "plugins"); -function wrapForVm(compiledCode) { - if (typeof compiledCode !== "string") { - throw new Error("wrapForVm: compiledCode must be a string"); - } - if (compiledCode.length === 0) { - throw new Error("wrapForVm: compiledCode cannot be empty"); - } - if (compiledCode.length > MAX_COMPILED_SIZE) { - throw new Error( - `wrapForVm: code exceeds size limit (${(compiledCode.length / 1024 / 1024).toFixed(1)}MB)` - ); - } - return ` -(function(exports, require, module, __filename, __dirname) { -${compiledCode} -}); -`; -} - -// lib/sandbox-executor.ts -var import_relayer_sdk = __toESM(require_dist()); - -// lib/constants.ts -var DEFAULT_SOCKET_REQUEST_TIMEOUT_MS = 3e4; - -// lib/sandbox-executor.ts -var ContextPool = class { - constructor() { - this.available = []; - this.maxSize = 10; - } - // Max contexts to cache per worker - acquire() { - const ctx = this.available.pop(); - if (ctx) { - this.resetContext(ctx); - return ctx; - } - return this.createFreshContext(); - } - release(ctx) { - if (this.available.length < this.maxSize) { - this.available.push(ctx); - } - } - createFreshContext() { - return vm.createContext({}); - } - resetContext(ctx) { - try { - vm.runInContext(` - // Clear any plugin-added globals - if (typeof globalThis.__pluginState !== 'undefined') { - delete globalThis.__pluginState; - } - `, ctx, { timeout: 100 }); - } catch { - } - } - clear() { - this.available = []; - } -}; -var ScriptCache = class { - constructor() { - this.cache = /* @__PURE__ */ new Map(); - this.maxSize = 100; - // Max scripts to cache per worker - this.lastMemoryCheck = 0; - this.memoryCheckInterval = 5e3; - } - // Check every 5s - get(code) { - this.maybeCheckMemory(); - const entry = this.cache.get(code); - if (entry) { - entry.timestamp = Date.now(); - return entry.script; - } - return void 0; - } - set(code, script) { - this.maybeCheckMemory(); - if (this.cache.size >= this.maxSize) { - this.evictOldest(1); - } - this.cache.set(code, { script, timestamp: Date.now() }); - } - /** - * Periodic memory check - evict cache if heap is under pressure. - */ - maybeCheckMemory() { - const now = Date.now(); - if (now - this.lastMemoryCheck < this.memoryCheckInterval) { - return; - } - this.lastMemoryCheck = now; - const usage = process.memoryUsage(); - const heapStats = v8.getHeapStatistics(); - const heapUsedRatio = usage.heapUsed / heapStats.heap_size_limit; - if (heapUsedRatio >= 0.7 && this.cache.size > 0) { - const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); - console.warn( - `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` - ); - this.evictOldest(evictCount); - } - if (heapUsedRatio >= 0.85 && this.cache.size > 0) { - const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.5)); - console.warn( - `[worker-cache] HIGH memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` - ); - this.evictOldest(evictCount); - } - } - evictOldest(count) { - const entries = [...this.cache.entries()].sort( - (a, b) => a[1].timestamp - b[1].timestamp - ); - let evicted = 0; - for (const [key] of entries) { - if (evicted >= count) break; - this.cache.delete(key); - evicted++; - } - if (evicted > 0) { - console.log(`[worker-cache] Evicted ${evicted} oldest scripts`); - } - } - clear() { - const size = this.cache.size; - this.cache.clear(); - if (size > 0) { - console.log(`[worker-cache] Emergency eviction: cleared ${size} cached scripts`); - } - } - size() { - return this.cache.size; - } -}; -var SocketClosedError = class extends Error { - constructor(message) { - super(message); - this.name = "SocketClosedError"; - this.code = "ESOCKETCLOSED"; - } -}; -var SocketPool = class { - constructor() { - this.available = []; - this.maxSize = 5; - // Max sockets to cache per worker - // Rust server connection lifetime is 60s. Discard sockets older than 50s. - this.maxSocketAgeMs = 5e4; - } - acquire() { - const now = Date.now(); - while (this.available.length > 0) { - const pooled = this.available.pop(); - const age = now - pooled.createdAt; - if (age > this.maxSocketAgeMs) { - pooled.socket.destroy(); - continue; - } - if (pooled.socket.writable && !pooled.socket.destroyed) { - return { socket: pooled.socket, createdAt: pooled.createdAt }; - } - pooled.socket.destroy(); - } - return null; - } - /** - * Release a socket back to the pool. - * @param socket The socket to release - * @param createdAt When the socket was originally created (for age tracking) - */ - release(socket, createdAt) { - const now = Date.now(); - const age = now - createdAt; - if (age > this.maxSocketAgeMs || !socket.writable || socket.destroyed || this.available.length >= this.maxSize) { - socket.destroy(); - return; - } - this.available.push({ socket, createdAt }); - } - clear() { - for (const pooled of this.available) { - pooled.socket.destroy(); - } - this.available = []; - } -}; -var contextPool = new ContextPool(); -var scriptCache = new ScriptCache(); -var socketPool = new SocketPool(); -var SandboxPluginAPI = class { - constructor(socketPath, httpRequestId) { - this.socket = null; - this.connectionPromise = null; - this.connected = false; - this.maxPendingRequests = 100; - // Prevent memory leak from unbounded pending - this.socketCreatedAt = 0; - // Track socket creation time for pool age-based eviction - // Store handler references for proper cleanup (prevents listener accumulation) - this.boundErrorHandler = null; - this.boundCloseHandler = null; - this.boundDataHandler = null; - this.socketPath = socketPath; - this.pending = /* @__PURE__ */ new Map(); - this.httpRequestId = httpRequestId; - } - async ensureConnected() { - if (this.connected) return; - if (!this.connectionPromise) { - const acquired = socketPool.acquire(); - if (acquired) { - this.socket = acquired.socket; - this.socketCreatedAt = acquired.createdAt; - this.connected = true; - this.connectionPromise = Promise.resolve(); - this.setupSocketHandlers(this.socket); - } else { - this.socket = net.createConnection(this.socketPath); - this.socketCreatedAt = Date.now(); - this.setupSocketHandlers(this.socket); - this.connectionPromise = new Promise((resolve2, reject) => { - this.socket.once("connect", () => { - this.connected = true; - resolve2(); - }); - this.socket.once("error", reject); - }); - } - } - await this.connectionPromise; - } - /** - * Set up error/close/data handlers for a socket (pooled or new). - * This ensures sockets can trigger reconnection on failure. - * Stores references for proper cleanup to prevent listener accumulation. - */ - setupSocketHandlers(socket) { - this.boundErrorHandler = (error) => this.handleSocketError(error); - this.boundCloseHandler = () => this.handleSocketClose(); - this.boundDataHandler = (data) => this.handleSocketData(data); - socket.on("error", this.boundErrorHandler); - socket.on("close", this.boundCloseHandler); - socket.on("data", this.boundDataHandler); - } - /** - * Remove socket handlers before returning to pool. - * Prevents listener accumulation (MaxListenersExceededWarning). - */ - removeSocketHandlers(socket) { - if (this.boundErrorHandler) { - socket.removeListener("error", this.boundErrorHandler); - this.boundErrorHandler = null; - } - if (this.boundCloseHandler) { - socket.removeListener("close", this.boundCloseHandler); - this.boundCloseHandler = null; - } - if (this.boundDataHandler) { - socket.removeListener("data", this.boundDataHandler); - this.boundDataHandler = null; - } - } - /** - * Handle socket error - reject pending requests and reset connection state - */ - handleSocketError(error) { - this.rejectAllPending(error); - this.connected = false; - this.connectionPromise = null; - this.socket = null; - } - /** - * Handle socket close - reset connection state to enable reconnection. - * Uses SocketClosedError to enable automatic retry in sendWithRetry(). - */ - handleSocketClose() { - this.connected = false; - this.rejectAllPending(new SocketClosedError("Socket closed by server (connection lifetime exceeded)")); - this.connectionPromise = null; - this.socket = null; - } - /** - * Handle incoming data from socket - */ - handleSocketData(data) { - data.toString().split("\n").filter(Boolean).forEach((msg) => { - try { - const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); - } - } catch { - } - }); - } - /** - * Reject all pending requests with the given error. - * Called on socket error or close to prevent hanging promises. - */ - rejectAllPending(error) { - for (const [requestId, resolver] of this.pending.entries()) { - resolver.reject(error); - this.pending.delete(requestId); - } - } - useRelayer(relayerId) { - return { - sendTransaction: async (payload) => { - const result = await this.send(relayerId, "sendTransaction", payload); - return { - ...result, - wait: (options) => this.transactionWait(result, options) - }; - }, - getTransaction: (payload) => this.send(relayerId, "getTransaction", payload), - getRelayerStatus: () => this.send(relayerId, "getRelayerStatus", {}), - signTransaction: (payload) => this.send(relayerId, "signTransaction", payload), - getRelayer: () => this.send(relayerId, "getRelayer", {}), - rpc: (payload) => this.send(relayerId, "rpc", payload) - }; - } - async transactionWait(transaction, options) { - const interval = options?.interval ?? 5e3; - const timeout = options?.timeout ?? 6e4; - const relayer = this.useRelayer(transaction.relayer_id); - let shouldContinue = true; - const poll = async () => { - let tx = await relayer.getTransaction({ transactionId: transaction.id }); - while (shouldContinue && tx.status !== import_relayer_sdk.TransactionStatus.MINED && tx.status !== import_relayer_sdk.TransactionStatus.CONFIRMED && tx.status !== import_relayer_sdk.TransactionStatus.CANCELED && tx.status !== import_relayer_sdk.TransactionStatus.EXPIRED && tx.status !== import_relayer_sdk.TransactionStatus.FAILED) { - await new Promise((resolve2) => setTimeout(resolve2, interval)); - if (!shouldContinue) break; - tx = await relayer.getTransaction({ transactionId: transaction.id }); - } - return tx; - }; - let timeoutId; - const timeoutPromise = new Promise((_, reject) => { - timeoutId = setTimeout(() => { - shouldContinue = false; - reject((0, import_relayer_sdk.pluginError)(`Transaction ${transaction.id} timed out after ${timeout}ms`, { status: 504 })); - }, timeout); - }); - return Promise.race([poll(), timeoutPromise]).finally(() => { - shouldContinue = false; - if (timeoutId) clearTimeout(timeoutId); - }); - } - async send(relayerId, method, payload) { - return this.sendWithRetry(relayerId, method, payload, false); - } - /** - * Send request with EPIPE retry logic. - * EPIPE occurs when the pooled socket was closed by the server but client doesn't know yet. - * On EPIPE, we destroy the stale socket and retry with a fresh connection. - */ - async sendWithRetry(relayerId, method, payload, isRetry) { - const requestId = v4_default(); - const msg = { requestId, relayerId, method, payload }; - if (this.httpRequestId) { - msg.httpRequestId = this.httpRequestId; - } - const message = JSON.stringify(msg) + "\n"; - if (this.pending.size >= this.maxPendingRequests) { - throw new Error( - `Too many concurrent API requests (max ${this.maxPendingRequests}). Await previous requests before making new ones.` - ); - } - await this.ensureConnected(); - try { - const socket = this.socket; - if (!socket) { - const staleError = new Error("Socket became unavailable after connection"); - staleError.code = "ECONNRESET"; - throw staleError; - } - return await new Promise((resolve2, reject) => { - let timeoutId; - timeoutId = setTimeout(() => { - this.pending.delete(requestId); - reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); - }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); - this.pending.set(requestId, { - resolve: (value) => { - if (timeoutId) clearTimeout(timeoutId); - resolve2(value); - }, - reject: (reason) => { - if (timeoutId) clearTimeout(timeoutId); - reject(reason); - } - }); - socket.write(message, (error) => { - if (error) { - if (timeoutId) clearTimeout(timeoutId); - this.pending.delete(requestId); - reject(error); - } - }); - }); - } catch (error) { - const isRetryableError = error.code === "EPIPE" || error.code === "ECONNRESET" || error.code === "ESOCKETCLOSED"; - if (!isRetry && isRetryableError) { - if (this.socket) { - this.removeSocketHandlers(this.socket); - this.socket.destroy(); - this.socket = null; - } - this.connected = false; - this.connectionPromise = null; - return this.sendWithRetry(relayerId, method, payload, true); - } - throw error; - } - } - close() { - if (this.socket) { - this.removeSocketHandlers(this.socket); - socketPool.release(this.socket, this.socketCreatedAt); - this.socket = null; - } - this.connected = false; - } -}; -function safeStringify(value) { - try { - return JSON.stringify(value, (_, v) => { - if (typeof v === "bigint") { - return v.toString() + "n"; - } - return v; - }); - } catch { - try { - return String(value); - } catch { - return "[Unstringifiable value]"; - } - } -} -function createSandboxConsole(logs) { - const log = (level) => (...args) => { - const entry = { - level, - _args: args, - // Store raw args - _stringified: false, - _message: "" - }; - Object.defineProperty(entry, "message", { - get() { - if (!this._stringified) { - this._message = this._args.map( - (arg) => typeof arg === "object" ? safeStringify(arg) : String(arg) - ).join(" "); - this._stringified = true; - delete this._args; - } - return this._message; - }, - enumerable: true, - configurable: true - }); - logs.push(entry); - }; - return { - log: log("log"), - info: log("info"), - warn: log("warn"), - error: log("error"), - debug: log("debug"), - trace: log("debug"), - // Required console methods (no-ops for unused ones) - assert: () => { - }, - clear: () => { - }, - count: () => { - }, - countReset: () => { - }, - dir: () => { - }, - dirxml: () => { - }, - group: () => { - }, - groupCollapsed: () => { - }, - groupEnd: () => { - }, - table: () => { - }, - time: () => { - }, - timeEnd: () => { - }, - timeLog: () => { - }, - timeStamp: () => { - }, - profile: () => { - }, - profileEnd: () => { - }, - Console: console.Console - }; -} -async function executeInSandbox(task) { - const logs = []; - const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); - const kv = new DefaultPluginKVStore(task.pluginId); - const context = contextPool.acquire(); - try { - const sandboxConsole = createSandboxConsole(logs); - const wrappedCode = wrapForVm(task.compiledCode); - let script = scriptCache.get(task.compiledCode); - if (!script) { - script = new vm.Script(wrappedCode, { - filename: `plugin-${task.pluginId}.js` - }); - scriptCache.set(task.compiledCode, script); - } - const moduleExports = {}; - const moduleObject = { exports: moduleExports }; - const safeCrypto = { - randomUUID: () => require("crypto").randomUUID(), - getRandomValues: (arr) => require("crypto").getRandomValues(arr) - }; - const BLOCKED_MODULES = /* @__PURE__ */ new Set([ - // Filesystem access - "fs", - "fs/promises", - "node:fs", - "node:fs/promises", - // Process/system control - "child_process", - "node:child_process", - "cluster", - "node:cluster", - "worker_threads", - "node:worker_threads", - "process", - "node:process", - // Low-level system - "os", - "node:os", - "v8", - "node:v8", - "vm", - "node:vm", - // Direct network (use PluginAPI instead) - "net", - "node:net", - "dgram", - "node:dgram", - "tls", - "node:tls", - "http", - "node:http", - "https", - "node:https", - "http2", - "node:http2", - // Dangerous utilities - "repl", - "node:repl", - "inspector", - "node:inspector", - "perf_hooks", - "node:perf_hooks", - "async_hooks", - "node:async_hooks", - "trace_events", - "node:trace_events", - // Native modules (potential escape) - "module", - "node:module" - ]); - const sandboxRequire = (id) => { - if (BLOCKED_MODULES.has(id)) { - throw new Error( - `Module '${id}' is blocked for security. Use the PluginAPI for network operations.` - ); - } - try { - return require(id); - } catch (err) { - throw new Error( - `Module '${id}' not found. Ensure it's installed in plugins/node_modules.` - ); - } - }; - Object.assign(context, { - // === Console for logging === - console: sandboxConsole, - // === CommonJS module system === - exports: moduleExports, - require: sandboxRequire, - module: moduleObject, - __filename: `plugin-${task.pluginId}.js`, - __dirname: "/plugins", - // === Async primitives === - setTimeout, - setInterval, - setImmediate, - clearTimeout, - clearInterval, - clearImmediate, - Promise, - queueMicrotask, - // === Core JS types (often needed explicitly) === - Object, - Array, - String, - Number, - Boolean, - Symbol, - BigInt, - Map, - Set, - WeakMap, - WeakSet, - Date, - RegExp, - Math, - JSON, - // === Error types === - Error, - TypeError, - RangeError, - SyntaxError, - ReferenceError, - URIError, - EvalError, - // === Number utilities === - parseInt, - parseFloat, - isNaN, - isFinite, - Infinity: Infinity, - NaN: NaN, - // === String/URL encoding === - encodeURI, - decodeURI, - encodeURIComponent, - decodeURIComponent, - atob, - btoa, - URL, - URLSearchParams, - // === Binary data === - Buffer, - ArrayBuffer, - SharedArrayBuffer, - Uint8Array, - Uint16Array, - Uint32Array, - Int8Array, - Int16Array, - Int32Array, - Float32Array, - Float64Array, - BigInt64Array, - BigUint64Array, - DataView, - TextEncoder, - TextDecoder, - // === Cancellation (modern async patterns) === - AbortController, - AbortSignal, - // === Safe crypto subset (no signing/hashing secrets) === - crypto: safeCrypto, - // === Reflection (needed by some libraries) === - Reflect, - Proxy - }); - const factory = script.runInContext(context, { timeout: task.timeout }); - factory(moduleExports, sandboxRequire, moduleObject, `plugin-${task.pluginId}.js`, "/plugins"); - const handler = moduleObject.exports.handler || moduleExports.handler; - if (!handler || typeof handler !== "function") { - throw new Error("Plugin must export a handler function"); - } - let result; - const handlerPromise = (async () => { - if (handler.length === 1) { - const pluginContext = { - api, - params: task.params, - kv, - headers: task.headers ?? {}, - route: task.route ?? "", - config: task.config, - method: task.method ?? "POST", - query: task.query ?? {} - }; - return await handler(pluginContext); - } else { - return await handler(api, task.params); - } - })(); - const timeoutPromise = new Promise((_, reject) => { - setTimeout(() => { - const error = new Error(`Plugin handler timed out after ${task.timeout}ms`); - error.code = "ERR_HANDLER_TIMEOUT"; - reject(error); - }, task.timeout); - }); - result = await Promise.race([handlerPromise, timeoutPromise]); - return { - taskId: task.taskId, - success: true, - result, - logs - }; - } catch (error) { - const err = error; - let errorCode = "PLUGIN_ERROR"; - let errorMessage = String(error); - let errorStack; - let errorDetails = void 0; - let errorStatus = 500; - if (err && typeof err === "object") { - errorMessage = err.message || String(error); - if (err.name === "SyntaxError") { - errorCode = "SYNTAX_ERROR"; - } else if (err.name === "TypeError") { - errorCode = "TYPE_ERROR"; - } else if (err.name === "ReferenceError") { - errorCode = "REFERENCE_ERROR"; - } else if (err.code === "ERR_SCRIPT_EXECUTION_TIMEOUT") { - errorCode = "TIMEOUT"; - errorStatus = 504; - errorMessage = `Plugin module compilation timed out after ${task.timeout}ms`; - } else if (err.code === "ERR_HANDLER_TIMEOUT") { - errorCode = "TIMEOUT"; - errorStatus = 504; - } else if (err.code) { - errorCode = err.code; - } - if (err.stack) { - errorStack = err.stack.split("\n").slice(0, 10).join("\n"); - } - if (err.details) { - errorDetails = err.details; - } - if (typeof err.status === "number") { - errorStatus = err.status; - } - } - return { - taskId: task.taskId, - success: false, - error: { - message: errorMessage, - code: errorCode, - status: errorStatus, - details: errorDetails ? { - ...errorDetails, - stack: errorStack - } : errorStack ? { stack: errorStack } : void 0 - }, - logs - }; - } finally { - contextPool.release(context); - try { - api.close(); - } catch (err) { - } - try { - await kv.disconnect(); - } catch { - } - } -} -/*! Bundled license information: - -mime-db/index.js: - (*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - *) - -mime-types/index.js: - (*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - *) - -axios/dist/node/axios.cjs: - (*! Axios v1.13.1 Copyright (c) 2025 Matt Zabriskie and contributors *) -*/ diff --git a/src/api/routes/docs/plugin_docs.rs b/src/api/routes/docs/plugin_docs.rs index 58d177b06..8b2db35ce 100644 --- a/src/api/routes/docs/plugin_docs.rs +++ b/src/api/routes/docs/plugin_docs.rs @@ -12,14 +12,14 @@ use crate::{ /// /// The endpoint supports wildcard route routing, allowing plugins to implement custom routing logic: /// - `/api/v1/plugins/{plugin_id}/call` - Default endpoint (route = "") -/// - `/api/v1/plugins/{plugin_id}/call/verify` - Custom route (route = "/verify") -/// - `/api/v1/plugins/{plugin_id}/call/settle` - Custom route (route = "/settle") -/// - `/api/v1/plugins/{plugin_id}/call/api/v1/action` - Nested route (route = "/api/v1/action") +/// - `/api/v1/plugins/{plugin_id}/call?route=/verify` - Custom route via query parameter +/// - `/api/v1/plugins/{plugin_id}/call/verify` - Custom route via URL path (route = "/verify") /// /// The route is passed to the plugin handler via the `context.route` field. +/// You can specify a custom route either by appending it to the URL path or by using the `route` query parameter. #[utoipa::path( post, - path = "/api/v1/plugins/{plugin_id}/call{route}", + path = "/api/v1/plugins/{plugin_id}/call", tag = "Plugins", operation_id = "callPlugin", summary = "Execute a plugin with optional wildcard route routing", @@ -28,12 +28,7 @@ use crate::{ ), params( ("plugin_id" = String, Path, description = "The unique identifier of the plugin"), - ( - "route" = String, - Path, - description = "Optional route suffix captured by the server. Use an empty string for the default route, or include a leading slash (e.g. '/verify'). May include additional slashes for nested routes (e.g. '/api/v1/action').", - example = "/verify" - ) + ("route" = Option, Query, description = "Optional route suffix for custom routing (e.g., '/verify'). Alternative to appending the route to the URL path.") ), request_body = PluginCallRequest, responses( @@ -134,9 +129,10 @@ fn doc_call_plugin() {} /// - `params` is an empty object (`{}`) /// - query parameters are passed to the plugin handler via `context.query` /// - wildcard route routing is supported the same way as POST (see `doc_call_plugin`) +/// - Use the `route` query parameter or append the route to the URL path #[utoipa::path( get, - path = "/api/v1/plugins/{plugin_id}/call{route}", + path = "/api/v1/plugins/{plugin_id}/call", tag = "Plugins", operation_id = "callPluginGet", summary = "Execute a plugin via GET (must be enabled per plugin)", @@ -145,12 +141,7 @@ fn doc_call_plugin() {} ), params( ("plugin_id" = String, Path, description = "The unique identifier of the plugin"), - ( - "route" = String, - Path, - description = "Optional route suffix captured by the server. Use an empty string for the default route, or include a leading slash (e.g. '/supported'). May include additional slashes for nested routes.", - example = "/supported" - ) + ("route" = Option, Query, description = "Optional route suffix for custom routing (e.g., '/verify'). Alternative to appending the route to the URL path.") ), responses( ( diff --git a/src/api/routes/plugin.rs b/src/api/routes/plugin.rs index cddf8efdb..3562fccc5 100644 --- a/src/api/routes/plugin.rs +++ b/src/api/routes/plugin.rs @@ -60,6 +60,22 @@ fn extract_query_params(http_req: &HttpRequest) -> HashMap> query_params } +/// Resolves the effective route from path and query parameters. +/// Path route takes precedence; if empty, falls back to `route` query parameter. +fn resolve_route(path_route: &str, http_req: &HttpRequest) -> String { + if !path_route.is_empty() { + return path_route.to_string(); + } + + // Check for route in query parameters + let query_params = extract_query_params(http_req); + query_params + .get("route") + .and_then(|values| values.first()) + .cloned() + .unwrap_or_default() +} + fn build_plugin_call_request_from_post_body( route: &str, http_req: &HttpRequest, @@ -113,7 +129,8 @@ async fn plugin_call( body: web::Bytes, data: web::ThinData, ) -> Result { - let (plugin_id, route) = params.into_inner(); + let (plugin_id, path_route) = params.into_inner(); + let route = resolve_route(&path_route, &http_req); let mut plugin_call_request = match build_plugin_call_request_from_post_body(&route, &http_req, body.as_ref()) { @@ -133,7 +150,8 @@ async fn plugin_call_get( http_req: HttpRequest, data: web::ThinData, ) -> Result { - let (plugin_id, route) = params.into_inner(); + let (plugin_id, path_route) = params.into_inner(); + let route = resolve_route(&path_route, &http_req); // Check if GET requests are allowed for this plugin let plugin = data @@ -230,7 +248,8 @@ mod tests { body: web::Bytes, captured: web::Data, ) -> impl Responder { - let (_plugin_id, route) = params.into_inner(); + let (_plugin_id, path_route) = params.into_inner(); + let route = resolve_route(&path_route, &http_req); match build_plugin_call_request_from_post_body(&route, &http_req, body.as_ref()) { Ok(mut req) => { req.method = Some("POST".to_string()); @@ -252,7 +271,8 @@ mod tests { http_req: HttpRequest, captured: web::Data, ) -> impl Responder { - let (_plugin_id, route) = params.into_inner(); + let (_plugin_id, path_route) = params.into_inner(); + let route = resolve_route(&path_route, &http_req); // Simulate what plugin_call_get does for GET requests let plugin_call_request = PluginCallRequest { params: serde_json::json!({}), @@ -934,6 +954,70 @@ mod tests { } } + /// Verifies that route can be specified via query parameter when path route is empty + #[actix_web::test] + async fn test_route_from_query_parameter() { + let captured = web::Data::new(CapturedRequest::default()); + let app = test::init_service( + App::new() + .app_data(captured.clone()) + .service( + web::resource("/plugins/{plugin_id}/call{route:.*}") + .route(web::post().to(capturing_plugin_call_handler)), + ) + .configure(init), + ) + .await; + + // Test route from query parameter + let req = test::TestRequest::post() + .uri("/plugins/test/call?route=/verify") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({})) + .to_request(); + + test::call_service(&app, req).await; + + let captured_req = captured.get().expect("Request should have been captured"); + assert_eq!( + captured_req.route, + Some("/verify".to_string()), + "Route should be extracted from query parameter" + ); + } + + /// Verifies that path route takes precedence over query parameter + #[actix_web::test] + async fn test_path_route_takes_precedence_over_query() { + let captured = web::Data::new(CapturedRequest::default()); + let app = test::init_service( + App::new() + .app_data(captured.clone()) + .service( + web::resource("/plugins/{plugin_id}/call{route:.*}") + .route(web::post().to(capturing_plugin_call_handler)), + ) + .configure(init), + ) + .await; + + // Test that path route takes precedence over query param + let req = test::TestRequest::post() + .uri("/plugins/test/call/settle?route=/verify") + .insert_header(("Content-Type", "application/json")) + .set_json(serde_json::json!({})) + .to_request(); + + test::call_service(&app, req).await; + + let captured_req = captured.get().expect("Request should have been captured"); + assert_eq!( + captured_req.route, + Some("/settle".to_string()), + "Path route should take precedence over query parameter" + ); + } + /// Verifies that query parameters are correctly extracted and passed #[actix_web::test] async fn test_query_params_extracted_and_passed() { From fabb7d879d88275f422b0799abdbcfe45dc05c9e Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 12 Jan 2026 13:38:34 +0100 Subject: [PATCH 14/42] chore: Clippy improvements --- src/services/plugins/config.rs | 26 ++++------- src/services/plugins/pool_executor.rs | 6 +-- src/services/plugins/protocol.rs | 62 ++++++++++++++------------- src/services/plugins/runner.rs | 4 +- src/services/plugins/shared_socket.rs | 4 ++ 5 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs index d787018c7..8a8121e5d 100644 --- a/src/services/plugins/config.rs +++ b/src/services/plugins/config.rs @@ -120,8 +120,7 @@ impl PluginConfig { let estimated_concurrency_threads = (max_concurrency / 200).max(cpu_count); let estimated_max_threads = estimated_memory_threads .min(estimated_concurrency_threads) - .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(32); // Same cap as actual calculation + .clamp(DEFAULT_POOL_MAX_THREADS_FLOOR, 32); // Same cap as actual calculation // Queue timeout scales with concurrency AND thread count // Formula: base_timeout * (concurrency / threads) with caps @@ -246,8 +245,7 @@ impl PluginConfig { // This ensures we don't exceed either memory or concurrency constraints let derived_max_threads = memory_based_max_threads .min(concurrency_based_threads) - .max(DEFAULT_POOL_MAX_THREADS_FLOOR) // At least the floor - .min(32); // Hard cap at 32 (reduced from 64) + .clamp(DEFAULT_POOL_MAX_THREADS_FLOOR, 32); // At least the floor, hard cap at 32 tracing::debug!( total_memory_mb = total_memory_mb, @@ -270,8 +268,7 @@ impl PluginConfig { // - 1000 VUs / 8 threads * 1.2 = 150 let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); let derived_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) - .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) - .min(250); // Cap at 250 (validated stable by testing) + .clamp(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, 250); // Cap at 250 (validated stable by testing) let nodejs_pool_concurrent_tasks = env_parse("PLUGIN_POOL_CONCURRENT_TASKS", derived_concurrent_tasks); @@ -288,9 +285,8 @@ impl PluginConfig { // - 250 concurrent tasks: 512 + (250 * 5) = 1762MB let base_worker_heap = 512_usize; let heap_per_task = 5_usize; - let derived_worker_heap_mb = (base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task)) - .max(1024) // At least 1GB - .min(2048); // Cap at 2GB + let derived_worker_heap_mb = + (base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task)).clamp(1024, 2048); // At least 1GB, cap at 2GB let nodejs_worker_heap_mb = env_parse("PLUGIN_WORKER_HEAP_MB", derived_worker_heap_mb); // Socket backlog calculation @@ -435,22 +431,18 @@ impl Default for PluginConfig { let nodejs_pool_max_threads = memory_based_max_threads .min(concurrency_based_threads) - .max(DEFAULT_POOL_MAX_THREADS_FLOOR) - .min(32); + .clamp(DEFAULT_POOL_MAX_THREADS_FLOOR, 32); let nodejs_pool_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); let nodejs_pool_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) - .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) - .min(250); + .clamp(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, 250); // Worker heap for Default impl (same formula as from_env) let base_worker_heap = 512_usize; let heap_per_task = 5_usize; - let nodejs_worker_heap_mb = (base_worker_heap - + (nodejs_pool_concurrent_tasks * heap_per_task)) - .max(1024) - .min(2048); + let nodejs_worker_heap_mb = + (base_worker_heap + (nodejs_pool_concurrent_tasks * heap_per_task)).clamp(1024, 2048); let default_backlog = DEFAULT_POOL_SOCKET_BACKLOG as usize; let pool_socket_backlog = max_concurrency.max(default_backlog); diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index c5944265f..4d5c5c001 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -222,7 +222,7 @@ impl PoolManager { configured_workers } else { std::thread::available_parallelism() - .map(|n| n.get().max(4).min(32)) + .map(|n| n.get().clamp(4, 32)) .unwrap_or(8) }; @@ -375,7 +375,7 @@ impl PoolManager { ) -> Result { let mut conn = connection_pool.acquire_with_permit(permit).await?; - let request = PoolRequest::Execute { + let request = PoolRequest::Execute(Box::new(super::protocol::ExecuteRequest { task_id: Uuid::new_v4().to_string(), plugin_id: plugin_id.clone(), compiled_code, @@ -389,7 +389,7 @@ impl PoolManager { config, method, query, - }; + })); let timeout = timeout_secs.unwrap_or(get_config().pool_request_timeout_secs); let response = conn.send_request_with_timeout(&request, timeout).await?; diff --git a/src/services/plugins/protocol.rs b/src/services/plugins/protocol.rs index 5d660fd70..525c2831e 100644 --- a/src/services/plugins/protocol.rs +++ b/src/services/plugins/protocol.rs @@ -8,37 +8,41 @@ use std::collections::HashMap; use super::{LogEntry, LogLevel}; +/// Execute request payload (boxed to reduce enum size) +#[derive(Serialize, Debug)] +pub struct ExecuteRequest { + #[serde(rename = "taskId")] + pub task_id: String, + #[serde(rename = "pluginId")] + pub plugin_id: String, + #[serde(rename = "compiledCode", skip_serializing_if = "Option::is_none")] + pub compiled_code: Option, + #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] + pub plugin_path: Option, + pub params: serde_json::Value, + #[serde(skip_serializing_if = "Option::is_none")] + pub headers: Option>>, + #[serde(rename = "socketPath")] + pub socket_path: String, + #[serde(rename = "httpRequestId", skip_serializing_if = "Option::is_none")] + pub http_request_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub route: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub config: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub query: Option, +} + /// Request messages sent to the pool server #[derive(Serialize, Debug)] #[serde(tag = "type", rename_all = "lowercase")] pub enum PoolRequest { - Execute { - #[serde(rename = "taskId")] - task_id: String, - #[serde(rename = "pluginId")] - plugin_id: String, - #[serde(rename = "compiledCode", skip_serializing_if = "Option::is_none")] - compiled_code: Option, - #[serde(rename = "pluginPath", skip_serializing_if = "Option::is_none")] - plugin_path: Option, - params: serde_json::Value, - #[serde(skip_serializing_if = "Option::is_none")] - headers: Option>>, - #[serde(rename = "socketPath")] - socket_path: String, - #[serde(rename = "httpRequestId", skip_serializing_if = "Option::is_none")] - http_request_id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - timeout: Option, - #[serde(skip_serializing_if = "Option::is_none")] - route: Option, - #[serde(skip_serializing_if = "Option::is_none")] - config: Option, - #[serde(skip_serializing_if = "Option::is_none")] - method: Option, - #[serde(skip_serializing_if = "Option::is_none")] - query: Option, - }, + Execute(Box), Precompile { #[serde(rename = "taskId")] task_id: String, @@ -127,7 +131,7 @@ mod tests { #[test] fn test_pool_request_execute_serialization() { - let request = PoolRequest::Execute { + let request = PoolRequest::Execute(Box::new(ExecuteRequest { task_id: "test-123".to_string(), plugin_id: "my-plugin".to_string(), compiled_code: Some("console.log('hello')".to_string()), @@ -141,7 +145,7 @@ mod tests { config: None, method: None, query: None, - }; + })); let json = serde_json::to_string(&request).unwrap(); assert!(json.contains("\"type\":\"execute\"")); diff --git a/src/services/plugins/runner.rs b/src/services/plugins/runner.rs index 26cbda0d8..15339a380 100644 --- a/src/services/plugins/runner.rs +++ b/src/services/plugins/runner.rs @@ -167,7 +167,7 @@ impl PluginRunnerTrait for PluginRunner { impl PluginRunner { /// Execute plugin using ts-node with shared socket - #[allow(clippy::too_many_arguments)] + #[allow(clippy::too_many_arguments, clippy::type_complexity)] async fn run_with_tsnode( &self, plugin_id: String, @@ -260,7 +260,7 @@ impl PluginRunner { /// Execute plugin using worker pool (new high-performance mode) /// Uses shared socket service for better scalability - #[allow(clippy::too_many_arguments)] + #[allow(clippy::too_many_arguments, clippy::type_complexity)] async fn run_with_pool( &self, plugin_id: String, diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs index 5fb669975..42bf031c9 100644 --- a/src/services/plugins/shared_socket.rs +++ b/src/services/plugins/shared_socket.rs @@ -323,6 +323,7 @@ impl SharedSocketService { /// Start the shared socket service /// This spawns a background task that listens for connections /// Safe to call multiple times - will only start once per instance + #[allow(clippy::type_complexity)] pub async fn start( self: Arc, state: Arc>, @@ -433,6 +434,7 @@ impl SharedSocketService { } /// Handle connection with overall idle timeout + #[allow(clippy::type_complexity)] async fn handle_connection_with_timeout( stream: UnixStream, relayer_api: Arc, @@ -476,6 +478,7 @@ impl SharedSocketService { /// Security: The first message must be a Register message. Once registered, /// the connection is "tagged" with that execution_id and cannot be changed. /// This prevents Plugin A from spoofing Plugin B's execution_id. + #[allow(clippy::type_complexity)] async fn handle_connection( stream: UnixStream, relayer_api: Arc, @@ -720,6 +723,7 @@ pub fn get_shared_socket_service() -> Result, PluginErr } /// Ensure the shared socket service is started +#[allow(clippy::type_complexity)] pub async fn ensure_shared_socket_started( state: Arc>, ) -> Result<(), PluginError> From b11caaf378652affec30da5c50482c6b542ceb8d Mon Sep 17 00:00:00 2001 From: Zeljko Date: Tue, 13 Jan 2026 10:37:02 +0100 Subject: [PATCH 15/42] chore: Improvements --- docs/plugins/index.mdx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/docs/plugins/index.mdx b/docs/plugins/index.mdx index d9c1e22fb..2876cb1b1 100644 --- a/docs/plugins/index.mdx +++ b/docs/plugins/index.mdx @@ -882,19 +882,6 @@ export PLUGIN_POOL_REQUEST_TIMEOUT_SECS=120 export PLUGIN_POOL_CONNECT_RETRIES=20 ``` -### System Limits - -For high concurrency, you may need to increase OS-level limits: - -```bash -# Increase file descriptor limit (Linux/macOS) -ulimit -n 65536 - -# For macOS, also run: -sudo sysctl -w kern.maxfiles=65536 -sudo sysctl -w kern.maxfilesperproc=65536 -``` - ### Troubleshooting Common Errors | Error | Cause | Solution | From 7bb2c46193c3fd342c496641a70434d872e70195 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 15 Jan 2026 14:09:43 +0100 Subject: [PATCH 16/42] chore: Remove compiled file --- .gitignore | 2 - plugins/lib/sandbox-executor.js | 32278 ------------------------------ 2 files changed, 32280 deletions(-) delete mode 100644 plugins/lib/sandbox-executor.js diff --git a/.gitignore b/.gitignore index 597dfde86..392c3e705 100644 --- a/.gitignore +++ b/.gitignore @@ -81,8 +81,6 @@ plugins/lib/sandbox-executor.js.sha256 plugins/**/*.js plugins/**/*.js.map plugins/**/*.d.ts -# Exception: keep pre-compiled sandbox executor -!plugins/lib/sandbox-executor.js profraw/ coverage/ diff --git a/plugins/lib/sandbox-executor.js b/plugins/lib/sandbox-executor.js deleted file mode 100644 index 6f014945d..000000000 --- a/plugins/lib/sandbox-executor.js +++ /dev/null @@ -1,32278 +0,0 @@ -/** - * Auto-generated by build-executor.ts - * Build time: 2026-01-15T13:02:17.812Z - * Node version: v25.2.1 - * Source: sandbox-executor.ts - * Source hash: 05ea2a406d1db670 - * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts - */ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json -var require_commands = __commonJS({ - "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/commands.json"(exports2, module2) { - module2.exports = { - acl: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - append: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - asking: { - arity: 1, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - auth: { - arity: -2, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bgrewriteaof: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bgsave: { - arity: -1, - flags: [ - "admin", - "noscript", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bitcount: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitfield: { - arity: -2, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitfield_ro: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - bitop: { - arity: -4, - flags: [ - "write", - "denyoom" - ], - keyStart: 2, - keyStop: -1, - step: 1 - }, - bitpos: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - blmove: { - arity: 6, - flags: [ - "write", - "denyoom", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - blmpop: { - arity: -5, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - blpop: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - brpop: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - brpoplpush: { - arity: 4, - flags: [ - "write", - "denyoom", - "noscript", - "blocking" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - bzmpop: { - arity: -5, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - bzpopmax: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking", - "fast" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - bzpopmin: { - arity: -3, - flags: [ - "write", - "noscript", - "blocking", - "fast" - ], - keyStart: 1, - keyStop: -2, - step: 1 - }, - client: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - cluster: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - command: { - arity: -1, - flags: [ - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - config: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - copy: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - dbsize: { - arity: 1, - flags: [ - "readonly", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - debug: { - arity: -2, - flags: [ - "admin", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - decr: { - arity: 2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - decrby: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - del: { - arity: -2, - flags: [ - "write" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - discard: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - dump: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - echo: { - arity: 2, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - eval: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - eval_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - evalsha: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - evalsha_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - exec: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "skip_slowlog" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - exists: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - expire: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - expireat: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - expiretime: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - failover: { - arity: -1, - flags: [ - "admin", - "noscript", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - fcall: { - arity: -3, - flags: [ - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - fcall_ro: { - arity: -3, - flags: [ - "readonly", - "noscript", - "stale", - "skip_monitor", - "no_mandatory_keys", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - flushall: { - arity: -1, - flags: [ - "write" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - flushdb: { - arity: -1, - flags: [ - "write" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - function: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - geoadd: { - arity: -5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geodist: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geohash: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geopos: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadius: { - arity: -6, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadius_ro: { - arity: -6, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadiusbymember: { - arity: -5, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - georadiusbymember_ro: { - arity: -5, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geosearch: { - arity: -7, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - geosearchstore: { - arity: -8, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - get: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getbit: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getdel: { - arity: 2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getex: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getrange: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - getset: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hdel: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hello: { - arity: -1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - hexists: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hexpire: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hpexpire: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hget: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hgetall: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hincrby: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hincrbyfloat: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hkeys: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hmget: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hmset: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hrandfield: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hset: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hsetnx: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hstrlen: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - hvals: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incr: { - arity: 2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incrby: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - incrbyfloat: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - info: { - arity: -1, - flags: [ - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - keys: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lastsave: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - latency: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lcs: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - lindex: { - arity: 3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - linsert: { - arity: 5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - llen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lmove: { - arity: 5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - lmpop: { - arity: -4, - flags: [ - "write", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lolwut: { - arity: -1, - flags: [ - "readonly", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - lpop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpos: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpush: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lpushx: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lrange: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lrem: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - lset: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - ltrim: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - memory: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - mget: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - migrate: { - arity: -6, - flags: [ - "write", - "movablekeys" - ], - keyStart: 3, - keyStop: 3, - step: 1 - }, - module: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - monitor: { - arity: 1, - flags: [ - "admin", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - move: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - mset: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 2 - }, - msetnx: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 2 - }, - multi: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - object: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - persist: { - arity: 2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpire: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpireat: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pexpiretime: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pfadd: { - arity: -2, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - pfcount: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - pfdebug: { - arity: 3, - flags: [ - "write", - "denyoom", - "admin" - ], - keyStart: 2, - keyStop: 2, - step: 1 - }, - pfmerge: { - arity: -2, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - pfselftest: { - arity: 1, - flags: [ - "admin" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - ping: { - arity: -1, - flags: [ - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - psetex: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - psubscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - psync: { - arity: -3, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - pttl: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - publish: { - arity: 3, - flags: [ - "pubsub", - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - pubsub: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - punsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - quit: { - arity: -1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - randomkey: { - arity: 1, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - readonly: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - readwrite: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - rename: { - arity: 3, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - renamenx: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - replconf: { - arity: -1, - flags: [ - "admin", - "noscript", - "loading", - "stale", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - replicaof: { - arity: 3, - flags: [ - "admin", - "noscript", - "stale", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - reset: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "no_auth", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - restore: { - arity: -4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - "restore-asking": { - arity: -4, - flags: [ - "write", - "denyoom", - "asking" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - role: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - rpop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - rpoplpush: { - arity: 3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - rpush: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - rpushx: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sadd: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - save: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - scan: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - scard: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - script: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sdiff: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sdiffstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - select: { - arity: 2, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - set: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setbit: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setex: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setnx: { - arity: 3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - setrange: { - arity: 4, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - shutdown: { - arity: -1, - flags: [ - "admin", - "noscript", - "loading", - "stale", - "no_multi", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sinter: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sintercard: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sinterstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sismember: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - slaveof: { - arity: 3, - flags: [ - "admin", - "noscript", - "stale", - "no_async_loading" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - slowlog: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - smembers: { - arity: 2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - smismember: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - move: { - arity: 4, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - sort: { - arity: -2, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sort_ro: { - arity: -2, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - spop: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - spublish: { - arity: 3, - flags: [ - "pubsub", - "loading", - "stale", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - srandmember: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - srem: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - ssubscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - strlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - subscribe: { - arity: -2, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - substr: { - arity: 4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - sunion: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sunionstore: { - arity: -3, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - sunsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - swapdb: { - arity: 3, - flags: [ - "write", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - sync: { - arity: 1, - flags: [ - "admin", - "noscript", - "no_async_loading", - "no_multi" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - time: { - arity: 1, - flags: [ - "loading", - "stale", - "fast" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - touch: { - arity: -2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - ttl: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - type: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - unlink: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - unsubscribe: { - arity: -1, - flags: [ - "pubsub", - "noscript", - "loading", - "stale" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - unwatch: { - arity: 1, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - wait: { - arity: 3, - flags: [ - "noscript" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - watch: { - arity: -2, - flags: [ - "noscript", - "loading", - "stale", - "fast", - "allow_busy" - ], - keyStart: 1, - keyStop: -1, - step: 1 - }, - xack: { - arity: -4, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xadd: { - arity: -5, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xautoclaim: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xclaim: { - arity: -6, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xdel: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xdelex: { - arity: -5, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xgroup: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xinfo: { - arity: -2, - flags: [], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xlen: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xpending: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xread: { - arity: -4, - flags: [ - "readonly", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xreadgroup: { - arity: -7, - flags: [ - "write", - "blocking", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - xrevrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xsetid: { - arity: -3, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - xtrim: { - arity: -4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zadd: { - arity: -4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zcard: { - arity: 2, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zcount: { - arity: 4, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zdiff: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zdiffstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zincrby: { - arity: 4, - flags: [ - "write", - "denyoom", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zinter: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zintercard: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zinterstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zlexcount: { - arity: 4, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zmpop: { - arity: -4, - flags: [ - "write", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zmscore: { - arity: -3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zpopmax: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zpopmin: { - arity: -2, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrandmember: { - arity: -2, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangebylex: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangebyscore: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrangestore: { - arity: -5, - flags: [ - "write", - "denyoom" - ], - keyStart: 1, - keyStop: 2, - step: 1 - }, - zrank: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrem: { - arity: -3, - flags: [ - "write", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebylex: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebyrank: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zremrangebyscore: { - arity: 4, - flags: [ - "write" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrange: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrangebylex: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrangebyscore: { - arity: -4, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zrevrank: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zscan: { - arity: -3, - flags: [ - "readonly" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zscore: { - arity: 3, - flags: [ - "readonly", - "fast" - ], - keyStart: 1, - keyStop: 1, - step: 1 - }, - zunion: { - arity: -3, - flags: [ - "readonly", - "movablekeys" - ], - keyStart: 0, - keyStop: 0, - step: 0 - }, - zunionstore: { - arity: -4, - flags: [ - "write", - "denyoom", - "movablekeys" - ], - keyStart: 1, - keyStop: 1, - step: 1 - } - }; - } -}); - -// node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js -var require_built = __commonJS({ - "node_modules/.pnpm/@ioredis+commands@1.4.0/node_modules/@ioredis/commands/built/index.js"(exports2) { - "use strict"; - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getKeyIndexes = exports2.hasFlag = exports2.exists = exports2.list = void 0; - var commands_json_1 = __importDefault(require_commands()); - exports2.list = Object.keys(commands_json_1.default); - var flags = {}; - exports2.list.forEach((commandName) => { - flags[commandName] = commands_json_1.default[commandName].flags.reduce(function(flags2, flag) { - flags2[flag] = true; - return flags2; - }, {}); - }); - function exists(commandName) { - return Boolean(commands_json_1.default[commandName]); - } - exports2.exists = exists; - function hasFlag(commandName, flag) { - if (!flags[commandName]) { - throw new Error("Unknown command " + commandName); - } - return Boolean(flags[commandName][flag]); - } - exports2.hasFlag = hasFlag; - function getKeyIndexes(commandName, args, options) { - const command = commands_json_1.default[commandName]; - if (!command) { - throw new Error("Unknown command " + commandName); - } - if (!Array.isArray(args)) { - throw new Error("Expect args to be an array"); - } - const keys = []; - const parseExternalKey = Boolean(options && options.parseExternalKey); - const takeDynamicKeys = (args2, startIndex) => { - const keys2 = []; - const keyStop = Number(args2[startIndex]); - for (let i = 0; i < keyStop; i++) { - keys2.push(i + startIndex + 1); - } - return keys2; - }; - const takeKeyAfterToken = (args2, startIndex, token) => { - for (let i = startIndex; i < args2.length - 1; i += 1) { - if (String(args2[i]).toLowerCase() === token.toLowerCase()) { - return i + 1; - } - } - return null; - }; - switch (commandName) { - case "zunionstore": - case "zinterstore": - case "zdiffstore": - keys.push(0, ...takeDynamicKeys(args, 1)); - break; - case "eval": - case "evalsha": - case "eval_ro": - case "evalsha_ro": - case "fcall": - case "fcall_ro": - case "blmpop": - case "bzmpop": - keys.push(...takeDynamicKeys(args, 1)); - break; - case "sintercard": - case "lmpop": - case "zunion": - case "zinter": - case "zmpop": - case "zintercard": - case "zdiff": { - keys.push(...takeDynamicKeys(args, 0)); - break; - } - case "georadius": { - keys.push(0); - const storeKey = takeKeyAfterToken(args, 5, "STORE"); - if (storeKey) - keys.push(storeKey); - const distKey = takeKeyAfterToken(args, 5, "STOREDIST"); - if (distKey) - keys.push(distKey); - break; - } - case "georadiusbymember": { - keys.push(0); - const storeKey = takeKeyAfterToken(args, 4, "STORE"); - if (storeKey) - keys.push(storeKey); - const distKey = takeKeyAfterToken(args, 4, "STOREDIST"); - if (distKey) - keys.push(distKey); - break; - } - case "sort": - case "sort_ro": - keys.push(0); - for (let i = 1; i < args.length - 1; i++) { - let arg = args[i]; - if (typeof arg !== "string") { - continue; - } - const directive = arg.toUpperCase(); - if (directive === "GET") { - i += 1; - arg = args[i]; - if (arg !== "#") { - if (parseExternalKey) { - keys.push([i, getExternalKeyNameLength(arg)]); - } else { - keys.push(i); - } - } - } else if (directive === "BY") { - i += 1; - if (parseExternalKey) { - keys.push([i, getExternalKeyNameLength(args[i])]); - } else { - keys.push(i); - } - } else if (directive === "STORE") { - i += 1; - keys.push(i); - } - } - break; - case "migrate": - if (args[2] === "") { - for (let i = 5; i < args.length - 1; i++) { - const arg = args[i]; - if (typeof arg === "string" && arg.toUpperCase() === "KEYS") { - for (let j = i + 1; j < args.length; j++) { - keys.push(j); - } - break; - } - } - } else { - keys.push(2); - } - break; - case "xreadgroup": - case "xread": - for (let i = commandName === "xread" ? 0 : 3; i < args.length - 1; i++) { - if (String(args[i]).toUpperCase() === "STREAMS") { - for (let j = i + 1; j <= i + (args.length - 1 - i) / 2; j++) { - keys.push(j); - } - break; - } - } - break; - default: - if (command.step > 0) { - const keyStart = command.keyStart - 1; - const keyStop = command.keyStop > 0 ? command.keyStop : args.length + command.keyStop + 1; - for (let i = keyStart; i < keyStop; i += command.step) { - keys.push(i); - } - } - break; - } - return keys; - } - exports2.getKeyIndexes = getKeyIndexes; - function getExternalKeyNameLength(key) { - if (typeof key !== "string") { - key = String(key); - } - const hashPos = key.indexOf("->"); - return hashPos === -1 ? key.length : hashPos; - } - } -}); - -// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js -var require_utils = __commonJS({ - "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tryCatch = exports2.errorObj = void 0; - exports2.errorObj = { e: {} }; - var tryCatchTarget; - function tryCatcher(err, val) { - try { - const target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - exports2.errorObj.e = e; - return exports2.errorObj; - } - } - function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; - } - exports2.tryCatch = tryCatch; - } -}); - -// node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js -var require_built2 = __commonJS({ - "node_modules/.pnpm/standard-as-callback@2.1.0/node_modules/standard-as-callback/built/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils(); - function throwLater(e) { - setTimeout(function() { - throw e; - }, 0); - } - function asCallback(promise, nodeback, options) { - if (typeof nodeback === "function") { - promise.then((val) => { - let ret; - if (options !== void 0 && Object(options).spread && Array.isArray(val)) { - ret = utils_1.tryCatch(nodeback).apply(void 0, [null].concat(val)); - } else { - ret = val === void 0 ? utils_1.tryCatch(nodeback)(null) : utils_1.tryCatch(nodeback)(null, val); - } - if (ret === utils_1.errorObj) { - throwLater(ret.e); - } - }, (cause) => { - if (!cause) { - const newReason = new Error(cause + ""); - Object.assign(newReason, { cause }); - cause = newReason; - } - const ret = utils_1.tryCatch(nodeback)(cause); - if (ret === utils_1.errorObj) { - throwLater(ret.e); - } - }); - } - return promise; - } - exports2.default = asCallback; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js -var require_old = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/old.js"(exports2, module2) { - "use strict"; - var assert = require("assert"); - var util = require("util"); - function RedisError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(RedisError, Error); - Object.defineProperty(RedisError.prototype, "name", { - value: "RedisError", - configurable: true, - writable: true - }); - function ParserError(message, buffer, offset) { - assert(buffer); - assert.strictEqual(typeof offset, "number"); - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - Error.captureStackTrace(this, this.constructor); - Error.stackTraceLimit = tmp; - this.offset = offset; - this.buffer = buffer; - } - util.inherits(ParserError, RedisError); - Object.defineProperty(ParserError.prototype, "name", { - value: "ParserError", - configurable: true, - writable: true - }); - function ReplyError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - Error.captureStackTrace(this, this.constructor); - Error.stackTraceLimit = tmp; - } - util.inherits(ReplyError, RedisError); - Object.defineProperty(ReplyError.prototype, "name", { - value: "ReplyError", - configurable: true, - writable: true - }); - function AbortError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(AbortError, RedisError); - Object.defineProperty(AbortError.prototype, "name", { - value: "AbortError", - configurable: true, - writable: true - }); - function InterruptError(message) { - Object.defineProperty(this, "message", { - value: message || "", - configurable: true, - writable: true - }); - Error.captureStackTrace(this, this.constructor); - } - util.inherits(InterruptError, AbortError); - Object.defineProperty(InterruptError.prototype, "name", { - value: "InterruptError", - configurable: true, - writable: true - }); - module2.exports = { - RedisError, - ParserError, - ReplyError, - AbortError, - InterruptError - }; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js -var require_modern = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/lib/modern.js"(exports2, module2) { - "use strict"; - var assert = require("assert"); - var RedisError = class extends Error { - get name() { - return this.constructor.name; - } - }; - var ParserError = class extends RedisError { - constructor(message, buffer, offset) { - assert(buffer); - assert.strictEqual(typeof offset, "number"); - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - super(message); - Error.stackTraceLimit = tmp; - this.offset = offset; - this.buffer = buffer; - } - get name() { - return this.constructor.name; - } - }; - var ReplyError = class extends RedisError { - constructor(message) { - const tmp = Error.stackTraceLimit; - Error.stackTraceLimit = 2; - super(message); - Error.stackTraceLimit = tmp; - } - get name() { - return this.constructor.name; - } - }; - var AbortError = class extends RedisError { - get name() { - return this.constructor.name; - } - }; - var InterruptError = class extends AbortError { - get name() { - return this.constructor.name; - } - }; - module2.exports = { - RedisError, - ParserError, - ReplyError, - AbortError, - InterruptError - }; - } -}); - -// node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js -var require_redis_errors = __commonJS({ - "node_modules/.pnpm/redis-errors@1.2.0/node_modules/redis-errors/index.js"(exports2, module2) { - "use strict"; - var Errors = process.version.charCodeAt(1) < 55 && process.version.charCodeAt(2) === 46 ? require_old() : require_modern(); - module2.exports = Errors; - } -}); - -// node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js -var require_lib = __commonJS({ - "node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js"(exports2, module2) { - var lookup = [ - 0, - 4129, - 8258, - 12387, - 16516, - 20645, - 24774, - 28903, - 33032, - 37161, - 41290, - 45419, - 49548, - 53677, - 57806, - 61935, - 4657, - 528, - 12915, - 8786, - 21173, - 17044, - 29431, - 25302, - 37689, - 33560, - 45947, - 41818, - 54205, - 50076, - 62463, - 58334, - 9314, - 13379, - 1056, - 5121, - 25830, - 29895, - 17572, - 21637, - 42346, - 46411, - 34088, - 38153, - 58862, - 62927, - 50604, - 54669, - 13907, - 9842, - 5649, - 1584, - 30423, - 26358, - 22165, - 18100, - 46939, - 42874, - 38681, - 34616, - 63455, - 59390, - 55197, - 51132, - 18628, - 22757, - 26758, - 30887, - 2112, - 6241, - 10242, - 14371, - 51660, - 55789, - 59790, - 63919, - 35144, - 39273, - 43274, - 47403, - 23285, - 19156, - 31415, - 27286, - 6769, - 2640, - 14899, - 10770, - 56317, - 52188, - 64447, - 60318, - 39801, - 35672, - 47931, - 43802, - 27814, - 31879, - 19684, - 23749, - 11298, - 15363, - 3168, - 7233, - 60846, - 64911, - 52716, - 56781, - 44330, - 48395, - 36200, - 40265, - 32407, - 28342, - 24277, - 20212, - 15891, - 11826, - 7761, - 3696, - 65439, - 61374, - 57309, - 53244, - 48923, - 44858, - 40793, - 36728, - 37256, - 33193, - 45514, - 41451, - 53516, - 49453, - 61774, - 57711, - 4224, - 161, - 12482, - 8419, - 20484, - 16421, - 28742, - 24679, - 33721, - 37784, - 41979, - 46042, - 49981, - 54044, - 58239, - 62302, - 689, - 4752, - 8947, - 13010, - 16949, - 21012, - 25207, - 29270, - 46570, - 42443, - 38312, - 34185, - 62830, - 58703, - 54572, - 50445, - 13538, - 9411, - 5280, - 1153, - 29798, - 25671, - 21540, - 17413, - 42971, - 47098, - 34713, - 38840, - 59231, - 63358, - 50973, - 55100, - 9939, - 14066, - 1681, - 5808, - 26199, - 30326, - 17941, - 22068, - 55628, - 51565, - 63758, - 59695, - 39368, - 35305, - 47498, - 43435, - 22596, - 18533, - 30726, - 26663, - 6336, - 2273, - 14466, - 10403, - 52093, - 56156, - 60223, - 64286, - 35833, - 39896, - 43963, - 48026, - 19061, - 23124, - 27191, - 31254, - 2801, - 6864, - 10931, - 14994, - 64814, - 60687, - 56684, - 52557, - 48554, - 44427, - 40424, - 36297, - 31782, - 27655, - 23652, - 19525, - 15522, - 11395, - 7392, - 3265, - 61215, - 65342, - 53085, - 57212, - 44955, - 49082, - 36825, - 40952, - 28183, - 32310, - 20053, - 24180, - 11923, - 16050, - 3793, - 7920 - ]; - var toUTF8Array = function toUTF8Array2(str) { - var char; - var i = 0; - var p = 0; - var utf8 = []; - var len = str.length; - for (; i < len; i++) { - char = str.charCodeAt(i); - if (char < 128) { - utf8[p++] = char; - } else if (char < 2048) { - utf8[p++] = char >> 6 | 192; - utf8[p++] = char & 63 | 128; - } else if ((char & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) { - char = 65536 + ((char & 1023) << 10) + (str.charCodeAt(++i) & 1023); - utf8[p++] = char >> 18 | 240; - utf8[p++] = char >> 12 & 63 | 128; - utf8[p++] = char >> 6 & 63 | 128; - utf8[p++] = char & 63 | 128; - } else { - utf8[p++] = char >> 12 | 224; - utf8[p++] = char >> 6 & 63 | 128; - utf8[p++] = char & 63 | 128; - } - } - return utf8; - }; - var generate = module2.exports = function generate2(str) { - var char; - var i = 0; - var start = -1; - var result = 0; - var resultHash = 0; - var utf8 = typeof str === "string" ? toUTF8Array(str) : str; - var len = utf8.length; - while (i < len) { - char = utf8[i++]; - if (start === -1) { - if (char === 123) { - start = i; - } - } else if (char !== 125) { - resultHash = lookup[(char ^ resultHash >> 8) & 255] ^ resultHash << 8; - } else if (i - 1 !== start) { - return resultHash & 16383; - } - result = lookup[(char ^ result >> 8) & 255] ^ result << 8; - } - return result & 16383; - }; - module2.exports.generateMulti = function generateMulti(keys) { - var i = 1; - var len = keys.length; - var base = generate(keys[0]); - while (i < len) { - if (generate(keys[i++]) !== base) return -1; - } - return base; - }; - } -}); - -// node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js -var require_lodash = __commonJS({ - "node_modules/.pnpm/lodash.defaults@4.2.0/node_modules/lodash.defaults/index.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - var argsTag = "[object Arguments]"; - var funcTag = "[object Function]"; - var genTag = "[object GeneratorFunction]"; - var reIsUint = /^(?:0|[1-9]\d*)$/; - function apply(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - function baseTimes(n, iteratee) { - var index = -1, result = Array(n); - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var objectToString = objectProto.toString; - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - var nativeMax = Math.max; - function arrayLikeKeys(value, inherited) { - var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; - var length = result.length, skipIndexes = !!length; - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { - result.push(key); - } - } - return result; - } - function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === void 0 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { - return srcValue; - } - return objValue; - } - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) { - object[key] = value; - } - } - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), result = []; - for (var key in object) { - if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - function baseRest(func, start) { - start = nativeMax(start === void 0 ? func.length - 1 : start, 0); - return function() { - var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; - } - function copyObject(source, props, object, customizer) { - object || (object = {}); - var index = -1, length = props.length; - while (++index < length) { - var key = props[index]; - var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; - assignValue(object, key, newValue === void 0 ? source[key] : newValue); - } - return object; - } - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0; - customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? void 0 : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); - } - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { - return eq(object[index], value); - } - return false; - } - function isPrototype(value) { - var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; - return value === proto; - } - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - function eq(value, other) { - return value === other || value !== value && other !== other; - } - function isArguments(value) { - return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); - } - var isArray = Array.isArray; - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - function isFunction(value) { - var tag = isObject(value) ? objectToString.call(value) : ""; - return tag == funcTag || tag == genTag; - } - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - function isObject(value) { - var type = typeof value; - return !!value && (type == "object" || type == "function"); - } - function isObjectLike(value) { - return !!value && typeof value == "object"; - } - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - var defaults = baseRest(function(args) { - args.push(void 0, assignInDefaults); - return apply(assignInWith, void 0, args); - }); - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - module2.exports = defaults; - } -}); - -// node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js -var require_lodash2 = __commonJS({ - "node_modules/.pnpm/lodash.isarguments@3.1.0/node_modules/lodash.isarguments/index.js"(exports2, module2) { - var MAX_SAFE_INTEGER = 9007199254740991; - var argsTag = "[object Arguments]"; - var funcTag = "[object Function]"; - var genTag = "[object GeneratorFunction]"; - var objectProto = Object.prototype; - var hasOwnProperty = objectProto.hasOwnProperty; - var objectToString = objectProto.toString; - var propertyIsEnumerable = objectProto.propertyIsEnumerable; - function isArguments(value) { - return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); - } - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - function isFunction(value) { - var tag = isObject(value) ? objectToString.call(value) : ""; - return tag == funcTag || tag == genTag; - } - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - function isObject(value) { - var type = typeof value; - return !!value && (type == "object" || type == "function"); - } - function isObjectLike(value) { - return !!value && typeof value == "object"; - } - module2.exports = isArguments; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js -var require_lodash3 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/lodash.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isArguments = exports2.defaults = exports2.noop = void 0; - var defaults = require_lodash(); - exports2.defaults = defaults; - var isArguments = require_lodash2(); - exports2.isArguments = isArguments; - function noop() { - } - exports2.noop = noop; - } -}); - -// node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) { - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js -var require_common = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports2, module2) { - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key) => { - createDebug[key] = env[key]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug(...args) { - if (!debug.enabled) { - return; - } - const self2 = debug; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index]; - match = formatter.call(self2, val); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; - Object.defineProperty(debug, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug); - } - return debug; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); - for (const ns of split) { - if (ns[0] === "-") { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { - if (template[templateIndex] === "*") { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; - } - } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; - } - return templateIndex === template.length; - } - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - return false; - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports2, module2) { - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = /* @__PURE__ */ (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - let m; - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os2 = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.destroy = util.deprecate( - () => { - }, - "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." - ); - exports2.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports2.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports2.inspectOpts = Object.keys(process.env).filter((key) => { - return /^debug_/i.test(key); - }).reduce((obj, key) => { - const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} \x1B[0m`; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; - } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init(debug) { - debug.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports2, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js -var require_debug = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/debug.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.genRedactedString = exports2.getStringValue = exports2.MAX_ARGUMENT_LENGTH = void 0; - var debug_1 = require_src(); - var MAX_ARGUMENT_LENGTH = 200; - exports2.MAX_ARGUMENT_LENGTH = MAX_ARGUMENT_LENGTH; - var NAMESPACE_PREFIX = "ioredis"; - function getStringValue(v) { - if (v === null) { - return; - } - switch (typeof v) { - case "boolean": - return; - case "number": - return; - case "object": - if (Buffer.isBuffer(v)) { - return v.toString("hex"); - } - if (Array.isArray(v)) { - return v.join(","); - } - try { - return JSON.stringify(v); - } catch (e) { - return; - } - case "string": - return v; - } - } - exports2.getStringValue = getStringValue; - function genRedactedString(str, maxLen) { - const { length } = str; - return length <= maxLen ? str : str.slice(0, maxLen) + ' ... '; - } - exports2.genRedactedString = genRedactedString; - function genDebugFunction(namespace) { - const fn = (0, debug_1.default)(`${NAMESPACE_PREFIX}:${namespace}`); - function wrappedDebug(...args) { - if (!fn.enabled) { - return; - } - for (let i = 1; i < args.length; i++) { - const str = getStringValue(args[i]); - if (typeof str === "string" && str.length > MAX_ARGUMENT_LENGTH) { - args[i] = genRedactedString(str, MAX_ARGUMENT_LENGTH); - } - } - return fn.apply(null, args); - } - Object.defineProperties(wrappedDebug, { - namespace: { - get() { - return fn.namespace; - } - }, - enabled: { - get() { - return fn.enabled; - } - }, - destroy: { - get() { - return fn.destroy; - } - }, - log: { - get() { - return fn.log; - }, - set(l) { - fn.log = l; - } - } - }); - return wrappedDebug; - } - exports2.default = genDebugFunction; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js -var require_TLSProfiles = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/constants/TLSProfiles.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var RedisCloudCA = `-----BEGIN CERTIFICATE----- -MIIDTzCCAjegAwIBAgIJAKSVpiDswLcwMA0GCSqGSIb3DQEBBQUAMD4xFjAUBgNV -BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTAeFw0xMzEwMDExMjE0NTVaFw0yMzA5MjkxMjE0NTVaMD4xFjAUBgNV -BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALZqkh/DczWP -JnxnHLQ7QL0T4B4CDKWBKCcisriGbA6ZePWVNo4hfKQC6JrzfR+081NeD6VcWUiz -rmd+jtPhIY4c+WVQYm5PKaN6DT1imYdxQw7aqO5j2KUCEh/cznpLxeSHoTxlR34E -QwF28Wl3eg2vc5ct8LjU3eozWVk3gb7alx9mSA2SgmuX5lEQawl++rSjsBStemY2 -BDwOpAMXIrdEyP/cVn8mkvi/BDs5M5G+09j0gfhyCzRWMQ7Hn71u1eolRxwVxgi3 -TMn+/vTaFSqxKjgck6zuAYjBRPaHe7qLxHNr1So/Mc9nPy+3wHebFwbIcnUojwbp -4nctkWbjb2cCAwEAAaNQME4wHQYDVR0OBBYEFP1whtcrydmW3ZJeuSoKZIKjze3w -MB8GA1UdIwQYMBaAFP1whtcrydmW3ZJeuSoKZIKjze3wMAwGA1UdEwQFMAMBAf8w -DQYJKoZIhvcNAQEFBQADggEBAG2erXhwRAa7+ZOBs0B6X57Hwyd1R4kfmXcs0rta -lbPpvgULSiB+TCbf3EbhJnHGyvdCY1tvlffLjdA7HJ0PCOn+YYLBA0pTU/dyvrN6 -Su8NuS5yubnt9mb13nDGYo1rnt0YRfxN+8DM3fXIVr038A30UlPX2Ou1ExFJT0MZ -uFKY6ZvLdI6/1cbgmguMlAhM+DhKyV6Sr5699LM3zqeI816pZmlREETYkGr91q7k -BpXJu/dtHaGxg1ZGu6w/PCsYGUcECWENYD4VQPd8N32JjOfu6vEgoEAwfPP+3oGp -Z4m3ewACcWOAenqflb+cQYC4PsF7qbXDmRaWrbKntOlZ3n0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIGMTCCBBmgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwajELMAkGA1UEBhMCVVMx -CzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJzMS0w -KwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN -MTgwMjI1MTUzNzM3WhcNMjgwMjIzMTUzNzM3WjBfMQswCQYDVQQGEwJVUzELMAkG -A1UECAwCQ0ExEjAQBgNVBAoMCVJlZGlzTGFiczEvMC0GA1UEAwwmUkNQIEludGVy -bWVkaWF0ZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQDf9dqbxc8Bq7Ctq9rWcxrGNKKHivqLAFpPq02yLPx6fsOv -Tq7GsDChAYBBc4v7Y2Ap9RD5Vs3dIhEANcnolf27QwrG9RMnnvzk8pCvp1o6zSU4 -VuOE1W66/O1/7e2rVxyrnTcP7UgK43zNIXu7+tiAqWsO92uSnuMoGPGpeaUm1jym -hjWKtkAwDFSqvHY+XL5qDVBEjeUe+WHkYUg40cAXjusAqgm2hZt29c2wnVrxW25W -P0meNlzHGFdA2AC5z54iRiqj57dTfBTkHoBczQxcyw6hhzxZQ4e5I5zOKjXXEhZN -r0tA3YC14CTabKRus/JmZieyZzRgEy2oti64tmLYTqSlAD78pRL40VNoaSYetXLw -hhNsXCHgWaY6d5bLOc/aIQMAV5oLvZQKvuXAF1IDmhPA+bZbpWipp0zagf1P1H3s -UzsMdn2KM0ejzgotbtNlj5TcrVwpmvE3ktvUAuA+hi3FkVx1US+2Gsp5x4YOzJ7u -P1WPk6ShF0JgnJH2ILdj6kttTWwFzH17keSFICWDfH/+kM+k7Y1v3EXMQXE7y0T9 -MjvJskz6d/nv+sQhY04xt64xFMGTnZjlJMzfQNi7zWFLTZnDD0lPowq7l3YiPoTT -t5Xky83lu0KZsZBo0WlWaDG00gLVdtRgVbcuSWxpi5BdLb1kRab66JptWjxwXQID -AQABo4HrMIHoMDoGA1UdHwQzMDEwL6AtoCuGKWh0dHBzOi8vcmwtY2Etc2VydmVy -LnJlZGlzbGFicy5jb20vdjEvY3JsMEYGCCsGAQUFBwEBBDowODA2BggrBgEFBQcw -AYYqaHR0cHM6Ly9ybC1jYS1zZXJ2ZXIucmVkaXNsYWJzLmNvbS92MS9vY3NwMB0G -A1UdDgQWBBQHar5OKvQUpP2qWt6mckzToeCOHDAfBgNVHSMEGDAWgBQi42wH6hM4 -L2sujEvLM0/u8lRXTzASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIB -hjANBgkqhkiG9w0BAQsFAAOCAgEAirEn/iTsAKyhd+pu2W3Z5NjCko4NPU0EYUbr -AP7+POK2rzjIrJO3nFYQ/LLuC7KCXG+2qwan2SAOGmqWst13Y+WHp44Kae0kaChW -vcYLXXSoGQGC8QuFSNUdaeg3RbMDYFT04dOkqufeWVccoHVxyTSg9eD8LZuHn5jw -7QDLiEECBmIJHk5Eeo2TAZrx4Yx6ufSUX5HeVjlAzqwtAqdt99uCJ/EL8bgpWbe+ -XoSpvUv0SEC1I1dCAhCKAvRlIOA6VBcmzg5Am12KzkqTul12/VEFIgzqu0Zy2Jbc -AUPrYVu/+tOGXQaijy7YgwH8P8n3s7ZeUa1VABJHcxrxYduDDJBLZi+MjheUDaZ1 -jQRHYevI2tlqeSBqdPKG4zBY5lS0GiAlmuze5oENt0P3XboHoZPHiqcK3VECgTVh -/BkJcuudETSJcZDmQ8YfoKfBzRQNg2sv/hwvUv73Ss51Sco8GEt2lD8uEdib1Q6z -zDT5lXJowSzOD5ZA9OGDjnSRL+2riNtKWKEqvtEG3VBJoBzu9GoxbAc7wIZLxmli -iF5a/Zf5X+UXD3s4TMmy6C4QZJpAA2egsSQCnraWO2ULhh7iXMysSkF/nzVfZn43 -iqpaB8++9a37hWq14ZmOv0TJIDz//b2+KC4VFXWQ5W5QC6whsjT+OlG4p5ZYG0jo -616pxqo= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJAJ1aTT1lu2ScMA0GCSqGSIb3DQEBCwUAMGoxCzAJBgNV -BAYTAlVTMQswCQYDVQQIDAJDQTELMAkGA1UEBwwCQ0ExEjAQBgNVBAoMCVJlZGlz -TGFiczEtMCsGA1UEAwwkUmVkaXNMYWJzIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y -aXR5MB4XDTE4MDItNTE1MjA0MloXDTM4MDItMDE1MjA0MlowajELMAkGA1UEBhMC -VVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJDQTESMBAGA1UECgwJUmVkaXNMYWJz -MS0wKwYDVQQDDCRSZWRpc0xhYnMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw -ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDLEjXy7YrbN5Waau5cd6g1 -G5C2tMmeTpZ0duFAPxNU4oE3RHS5gGiok346fUXuUxbZ6QkuzeN2/2Z+RmRcJhQY -Dm0ZgdG4x59An1TJfnzKKoWj8ISmoHS/TGNBdFzXV7FYNLBuqZouqePI6ReC6Qhl -pp45huV32Q3a6IDrrvx7Wo5ZczEQeFNbCeCOQYNDdTmCyEkHqc2AGo8eoIlSTutT -ULOC7R5gzJVTS0e1hesQ7jmqHjbO+VQS1NAL4/5K6cuTEqUl+XhVhPdLWBXJQ5ag -54qhX4v+ojLzeU1R/Vc6NjMvVtptWY6JihpgplprN0Yh2556ewcXMeturcKgXfGJ -xeYzsjzXerEjrVocX5V8BNrg64NlifzTMKNOOv4fVZszq1SIHR8F9ROrqiOdh8iC -JpUbLpXH9hWCSEO6VRMB2xJoKu3cgl63kF30s77x7wLFMEHiwsQRKxooE1UhgS9K -2sO4TlQ1eWUvFvHSTVDQDlGQ6zu4qjbOpb3Q8bQwoK+ai2alkXVR4Ltxe9QlgYK3 -StsnPhruzZGA0wbXdpw0bnM+YdlEm5ffSTpNIfgHeaa7Dtb801FtA71ZlH7A6TaI -SIQuUST9EKmv7xrJyx0W1pGoPOLw5T029aTjnICSLdtV9bLwysrLhIYG5bnPq78B -cS+jZHFGzD7PUVGQD01nOQIDAQABo2MwYTAdBgNVHQ4EFgQUIuNsB+oTOC9rLoxL -yzNP7vJUV08wHwYDVR0jBBgwFoAUIuNsB+oTOC9rLoxLyzNP7vJUV08wDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBAHfg -z5pMNUAKdMzK1aS1EDdK9yKz4qicILz5czSLj1mC7HKDRy8cVADUxEICis++CsCu -rYOvyCVergHQLREcxPq4rc5Nq1uj6J6649NEeh4WazOOjL4ZfQ1jVznMbGy+fJm3 -3Hoelv6jWRG9iqeJZja7/1s6YC6bWymI/OY1e4wUKeNHAo+Vger7MlHV+RuabaX+ -hSJ8bJAM59NCM7AgMTQpJCncrcdLeceYniGy5Q/qt2b5mJkQVkIdy4TPGGB+AXDJ -D0q3I/JDRkDUFNFdeW0js7fHdsvCR7O3tJy5zIgEV/o/BCkmJVtuwPYOrw/yOlKj -TY/U7ATAx9VFF6/vYEOMYSmrZlFX+98L6nJtwDqfLB5VTltqZ4H/KBxGE3IRSt9l -FXy40U+LnXzhhW+7VBAvyYX8GEXhHkKU8Gqk1xitrqfBXY74xKgyUSTolFSfFVgj -mcM/X4K45bka+qpkj7Kfv/8D4j6aZekwhN2ly6hhC1SmQ8qjMjpG/mrWOSSHZFmf -ybu9iD2AYHeIOkshIl6xYIa++Q/00/vs46IzAbQyriOi0XxlSMMVtPx0Q3isp+ji -n8Mq9eOuxYOEQ4of8twUkUDd528iwGtEdwf0Q01UyT84S62N8AySl1ZBKXJz6W4F -UhWfa/HQYOAPDdEjNgnVwLI23b8t0TozyCWw7q8h ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIEjzCCA3egAwIBAgIQe55B/ALCKJDZtdNT8kD6hTANBgkqhkiG9w0BAQsFADBM -MSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xv -YmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0yMjAxMjYxMjAwMDBaFw0y -NTAxMjYwMDAwMDBaMFgxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWdu -IG52LXNhMS4wLAYDVQQDEyVHbG9iYWxTaWduIEF0bGFzIFIzIE9WIFRMUyBDQSAy -MDItIFEyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmGmg1LW9b7Lf -8zDD83yBDTEkt+FOxKJZqF4veWc5KZsQj9HfnUS2e5nj/E+JImlGPsQuoiosLuXD -BVBNAMcUFa11buFMGMeEMwiTmCXoXRrXQmH0qjpOfKgYc5gHG3BsRGaRrf7VR4eg -ofNMG9wUBw4/g/TT7+bQJdA4NfE7Y4d5gEryZiBGB/swaX6Jp/8MF4TgUmOWmalK -dZCKyb4sPGQFRTtElk67F7vU+wdGcrcOx1tDcIB0ncjLPMnaFicagl+daWGsKqTh -counQb6QJtYHa91KvCfKWocMxQ7OIbB5UARLPmC4CJ1/f8YFm35ebfzAeULYdGXu -jE9CLor0OwIDAQABo4IBXzCCAVswDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQG -CCsGAQUFBwMBBggrBgEFBQcDAjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQW -BBSH5Zq7a7B/t95GfJWkDBpA8HHqdjAfBgNVHSMEGDAWgBSP8Et/qC5FJK5NUPpj -move4t0bvDB7BggrBgEFBQcBAQRvMG0wLgYIKwYBBQUHMAGGImh0dHA6Ly9vY3Nw -Mi5nbG9iYWxzaWduLmNvbS9yb290cjMwOwYIKwYBBQUHMAKGL2h0dHA6Ly9zZWN1 -cmUuZ2xvYmFsc2lnbi5jb20vY2FjZXJ0L3Jvb3QtcjMuY3J0MDYGA1UdHwQvMC0w -K6ApoCeGJWh0dHA6Ly9jcmwuZ2xvYmFsc2lnbi5jb20vcm9vdC1yMy5jcmwwIQYD -VR0gBBowGDAIBgZngQwBAgIwDAYKKwYBBAGgMgoBAjANBgkqhkiG9w0BAQsFAAOC -AQEAKRic9/f+nmhQU/wz04APZLjgG5OgsuUOyUEZjKVhNGDwxGTvKhyXGGAMW2B/ -3bRi+aElpXwoxu3pL6fkElbX3B0BeS5LoDtxkyiVEBMZ8m+sXbocwlPyxrPbX6mY -0rVIvnuUeBH8X0L5IwfpNVvKnBIilTbcebfHyXkPezGwz7E1yhUULjJFm2bt0SdX -y+4X/WeiiYIv+fTVgZZgl+/2MKIsu/qdBJc3f3TvJ8nz+Eax1zgZmww+RSQWeOj3 -15Iw6Z5FX+NwzY/Ab+9PosR5UosSeq+9HhtaxZttXG1nVh+avYPGYddWmiMT90J5 -ZgKnO/Fx2hBgTxhOTMYaD312kg== ------END CERTIFICATE----- - ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G -A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp -Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 -MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG -A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 -RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT -gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm -KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd -QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ -XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw -DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o -LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU -RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp -jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK -6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX -mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs -Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH -WD9f ------END CERTIFICATE-----`; - var TLSProfiles = { - RedisCloudFixed: { ca: RedisCloudCA }, - RedisCloudFlexible: { ca: RedisCloudCA } - }; - exports2.default = TLSProfiles; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js -var require_utils2 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.noop = exports2.defaults = exports2.Debug = exports2.getPackageMeta = exports2.zipMap = exports2.CONNECTION_CLOSED_ERROR_MSG = exports2.shuffle = exports2.sample = exports2.resolveTLSProfile = exports2.parseURL = exports2.optimizeErrorStack = exports2.toArg = exports2.convertMapToArray = exports2.convertObjectToArray = exports2.timeout = exports2.packObject = exports2.isInt = exports2.wrapMultiResult = exports2.convertBufferToString = void 0; - var fs_1 = require("fs"); - var path_1 = require("path"); - var url_1 = require("url"); - var lodash_1 = require_lodash3(); - Object.defineProperty(exports2, "defaults", { enumerable: true, get: function() { - return lodash_1.defaults; - } }); - Object.defineProperty(exports2, "noop", { enumerable: true, get: function() { - return lodash_1.noop; - } }); - var debug_1 = require_debug(); - exports2.Debug = debug_1.default; - var TLSProfiles_1 = require_TLSProfiles(); - function convertBufferToString(value, encoding) { - if (value instanceof Buffer) { - return value.toString(encoding); - } - if (Array.isArray(value)) { - const length = value.length; - const res = Array(length); - for (let i = 0; i < length; ++i) { - res[i] = value[i] instanceof Buffer && encoding === "utf8" ? value[i].toString() : convertBufferToString(value[i], encoding); - } - return res; - } - return value; - } - exports2.convertBufferToString = convertBufferToString; - function wrapMultiResult(arr) { - if (!arr) { - return null; - } - const result = []; - const length = arr.length; - for (let i = 0; i < length; ++i) { - const item = arr[i]; - if (item instanceof Error) { - result.push([item]); - } else { - result.push([null, item]); - } - } - return result; - } - exports2.wrapMultiResult = wrapMultiResult; - function isInt(value) { - const x = parseFloat(value); - return !isNaN(value) && (x | 0) === x; - } - exports2.isInt = isInt; - function packObject(array) { - const result = {}; - const length = array.length; - for (let i = 1; i < length; i += 2) { - result[array[i - 1]] = array[i]; - } - return result; - } - exports2.packObject = packObject; - function timeout(callback, timeout2) { - let timer = null; - const run = function() { - if (timer) { - clearTimeout(timer); - timer = null; - callback.apply(this, arguments); - } - }; - timer = setTimeout(run, timeout2, new Error("timeout")); - return run; - } - exports2.timeout = timeout; - function convertObjectToArray(obj) { - const result = []; - const keys = Object.keys(obj); - for (let i = 0, l = keys.length; i < l; i++) { - result.push(keys[i], obj[keys[i]]); - } - return result; - } - exports2.convertObjectToArray = convertObjectToArray; - function convertMapToArray(map) { - const result = []; - let pos = 0; - map.forEach(function(value, key) { - result[pos] = key; - result[pos + 1] = value; - pos += 2; - }); - return result; - } - exports2.convertMapToArray = convertMapToArray; - function toArg(arg) { - if (arg === null || typeof arg === "undefined") { - return ""; - } - return String(arg); - } - exports2.toArg = toArg; - function optimizeErrorStack(error, friendlyStack, filterPath) { - const stacks = friendlyStack.split("\n"); - let lines = ""; - let i; - for (i = 1; i < stacks.length; ++i) { - if (stacks[i].indexOf(filterPath) === -1) { - break; - } - } - for (let j = i; j < stacks.length; ++j) { - lines += "\n" + stacks[j]; - } - if (error.stack) { - const pos = error.stack.indexOf("\n"); - error.stack = error.stack.slice(0, pos) + lines; - } - return error; - } - exports2.optimizeErrorStack = optimizeErrorStack; - function parseURL(url) { - if (isInt(url)) { - return { port: url }; - } - let parsed = (0, url_1.parse)(url, true, true); - if (!parsed.slashes && url[0] !== "/") { - url = "//" + url; - parsed = (0, url_1.parse)(url, true, true); - } - const options = parsed.query || {}; - const result = {}; - if (parsed.auth) { - const index = parsed.auth.indexOf(":"); - result.username = index === -1 ? parsed.auth : parsed.auth.slice(0, index); - result.password = index === -1 ? "" : parsed.auth.slice(index + 1); - } - if (parsed.pathname) { - if (parsed.protocol === "redis:" || parsed.protocol === "rediss:") { - if (parsed.pathname.length > 1) { - result.db = parsed.pathname.slice(1); - } - } else { - result.path = parsed.pathname; - } - } - if (parsed.host) { - result.host = parsed.hostname; - } - if (parsed.port) { - result.port = parsed.port; - } - if (typeof options.family === "string") { - const intFamily = Number.parseInt(options.family, 10); - if (!Number.isNaN(intFamily)) { - result.family = intFamily; - } - } - (0, lodash_1.defaults)(result, options); - return result; - } - exports2.parseURL = parseURL; - function resolveTLSProfile(options) { - let tls = options === null || options === void 0 ? void 0 : options.tls; - if (typeof tls === "string") - tls = { profile: tls }; - const profile = TLSProfiles_1.default[tls === null || tls === void 0 ? void 0 : tls.profile]; - if (profile) { - tls = Object.assign({}, profile, tls); - delete tls.profile; - options = Object.assign({}, options, { tls }); - } - return options; - } - exports2.resolveTLSProfile = resolveTLSProfile; - function sample(array, from = 0) { - const length = array.length; - if (from >= length) { - return null; - } - return array[from + Math.floor(Math.random() * (length - from))]; - } - exports2.sample = sample; - function shuffle(array) { - let counter = array.length; - while (counter > 0) { - const index = Math.floor(Math.random() * counter); - counter--; - [array[counter], array[index]] = [array[index], array[counter]]; - } - return array; - } - exports2.shuffle = shuffle; - exports2.CONNECTION_CLOSED_ERROR_MSG = "Connection is closed."; - function zipMap(keys, values) { - const map = /* @__PURE__ */ new Map(); - keys.forEach((key, index) => { - map.set(key, values[index]); - }); - return map; - } - exports2.zipMap = zipMap; - var cachedPackageMeta = null; - async function getPackageMeta() { - if (cachedPackageMeta) { - return cachedPackageMeta; - } - try { - const filePath = (0, path_1.resolve)(__dirname, "..", "..", "package.json"); - const data = await fs_1.promises.readFile(filePath, "utf8"); - const parsed = JSON.parse(data); - cachedPackageMeta = { - version: parsed.version - }; - return cachedPackageMeta; - } catch (err) { - cachedPackageMeta = { - version: "error-fetching-version" - }; - return cachedPackageMeta; - } - } - exports2.getPackageMeta = getPackageMeta; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js -var require_Command = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Command.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var calculateSlot = require_lib(); - var standard_as_callback_1 = require_built2(); - var utils_1 = require_utils2(); - var Command = class _Command { - /** - * Creates an instance of Command. - * @param name Command name - * @param args An array of command arguments - * @param options - * @param callback The callback that handles the response. - * If omit, the response will be handled via Promise - */ - constructor(name, args = [], options = {}, callback) { - this.name = name; - this.inTransaction = false; - this.isResolved = false; - this.transformed = false; - this.replyEncoding = options.replyEncoding; - this.errorStack = options.errorStack; - this.args = args.flat(); - this.callback = callback; - this.initPromise(); - if (options.keyPrefix) { - const isBufferKeyPrefix = options.keyPrefix instanceof Buffer; - let keyPrefixBuffer = isBufferKeyPrefix ? options.keyPrefix : null; - this._iterateKeys((key) => { - if (key instanceof Buffer) { - if (keyPrefixBuffer === null) { - keyPrefixBuffer = Buffer.from(options.keyPrefix); - } - return Buffer.concat([keyPrefixBuffer, key]); - } else if (isBufferKeyPrefix) { - return Buffer.concat([options.keyPrefix, Buffer.from(String(key))]); - } - return options.keyPrefix + key; - }); - } - if (options.readOnly) { - this.isReadOnly = true; - } - } - /** - * Check whether the command has the flag - */ - static checkFlag(flagName, commandName) { - return !!this.getFlagMap()[flagName][commandName]; - } - static setArgumentTransformer(name, func) { - this._transformer.argument[name] = func; - } - static setReplyTransformer(name, func) { - this._transformer.reply[name] = func; - } - static getFlagMap() { - if (!this.flagMap) { - this.flagMap = Object.keys(_Command.FLAGS).reduce((map, flagName) => { - map[flagName] = {}; - _Command.FLAGS[flagName].forEach((commandName) => { - map[flagName][commandName] = true; - }); - return map; - }, {}); - } - return this.flagMap; - } - getSlot() { - if (typeof this.slot === "undefined") { - const key = this.getKeys()[0]; - this.slot = key == null ? null : calculateSlot(key); - } - return this.slot; - } - getKeys() { - return this._iterateKeys(); - } - /** - * Convert command to writable buffer or string - */ - toWritable(_socket) { - let result; - const commandStr = "*" + (this.args.length + 1) + "\r\n$" + Buffer.byteLength(this.name) + "\r\n" + this.name + "\r\n"; - if (this.bufferMode) { - const buffers = new MixedBuffers(); - buffers.push(commandStr); - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - if (arg instanceof Buffer) { - if (arg.length === 0) { - buffers.push("$0\r\n\r\n"); - } else { - buffers.push("$" + arg.length + "\r\n"); - buffers.push(arg); - buffers.push("\r\n"); - } - } else { - buffers.push("$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"); - } - } - result = buffers.toBuffer(); - } else { - result = commandStr; - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - result += "$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"; - } - } - return result; - } - stringifyArguments() { - for (let i = 0; i < this.args.length; ++i) { - const arg = this.args[i]; - if (typeof arg === "string") { - } else if (arg instanceof Buffer) { - this.bufferMode = true; - } else { - this.args[i] = (0, utils_1.toArg)(arg); - } - } - } - /** - * Convert buffer/buffer[] to string/string[], - * and apply reply transformer. - */ - transformReply(result) { - if (this.replyEncoding) { - result = (0, utils_1.convertBufferToString)(result, this.replyEncoding); - } - const transformer = _Command._transformer.reply[this.name]; - if (transformer) { - result = transformer(result); - } - return result; - } - /** - * Set the wait time before terminating the attempt to execute a command - * and generating an error. - */ - setTimeout(ms) { - if (!this._commandTimeoutTimer) { - this._commandTimeoutTimer = setTimeout(() => { - if (!this.isResolved) { - this.reject(new Error("Command timed out")); - } - }, ms); - } - } - initPromise() { - const promise = new Promise((resolve2, reject) => { - if (!this.transformed) { - this.transformed = true; - const transformer = _Command._transformer.argument[this.name]; - if (transformer) { - this.args = transformer(this.args); - } - this.stringifyArguments(); - } - this.resolve = this._convertValue(resolve2); - if (this.errorStack) { - this.reject = (err) => { - reject((0, utils_1.optimizeErrorStack)(err, this.errorStack.stack, __dirname)); - }; - } else { - this.reject = reject; - } - }); - this.promise = (0, standard_as_callback_1.default)(promise, this.callback); - } - /** - * Iterate through the command arguments that are considered keys. - */ - _iterateKeys(transform = (key) => key) { - if (typeof this.keys === "undefined") { - this.keys = []; - if ((0, commands_1.exists)(this.name)) { - const keyIndexes = (0, commands_1.getKeyIndexes)(this.name, this.args); - for (const index of keyIndexes) { - this.args[index] = transform(this.args[index]); - this.keys.push(this.args[index]); - } - } - } - return this.keys; - } - /** - * Convert the value from buffer to the target encoding. - */ - _convertValue(resolve2) { - return (value) => { - try { - const existingTimer = this._commandTimeoutTimer; - if (existingTimer) { - clearTimeout(existingTimer); - delete this._commandTimeoutTimer; - } - resolve2(this.transformReply(value)); - this.isResolved = true; - } catch (err) { - this.reject(err); - } - return this.promise; - }; - } - }; - exports2.default = Command; - Command.FLAGS = { - VALID_IN_SUBSCRIBER_MODE: [ - "subscribe", - "psubscribe", - "unsubscribe", - "punsubscribe", - "ssubscribe", - "sunsubscribe", - "ping", - "quit" - ], - VALID_IN_MONITOR_MODE: ["monitor", "auth"], - ENTER_SUBSCRIBER_MODE: ["subscribe", "psubscribe", "ssubscribe"], - EXIT_SUBSCRIBER_MODE: ["unsubscribe", "punsubscribe", "sunsubscribe"], - WILL_DISCONNECT: ["quit"], - HANDSHAKE_COMMANDS: ["auth", "select", "client", "readonly", "info"], - IGNORE_RECONNECT_ON_ERROR: ["client"] - }; - Command._transformer = { - argument: {}, - reply: {} - }; - var msetArgumentTransformer = function(args) { - if (args.length === 1) { - if (args[0] instanceof Map) { - return (0, utils_1.convertMapToArray)(args[0]); - } - if (typeof args[0] === "object" && args[0] !== null) { - return (0, utils_1.convertObjectToArray)(args[0]); - } - } - return args; - }; - var hsetArgumentTransformer = function(args) { - if (args.length === 2) { - if (args[1] instanceof Map) { - return [args[0]].concat((0, utils_1.convertMapToArray)(args[1])); - } - if (typeof args[1] === "object" && args[1] !== null) { - return [args[0]].concat((0, utils_1.convertObjectToArray)(args[1])); - } - } - return args; - }; - Command.setArgumentTransformer("mset", msetArgumentTransformer); - Command.setArgumentTransformer("msetnx", msetArgumentTransformer); - Command.setArgumentTransformer("hset", hsetArgumentTransformer); - Command.setArgumentTransformer("hmset", hsetArgumentTransformer); - Command.setReplyTransformer("hgetall", function(result) { - if (Array.isArray(result)) { - const obj = {}; - for (let i = 0; i < result.length; i += 2) { - const key = result[i]; - const value = result[i + 1]; - if (key in obj) { - Object.defineProperty(obj, key, { - value, - configurable: true, - enumerable: true, - writable: true - }); - } else { - obj[key] = value; - } - } - return obj; - } - return result; - }); - var MixedBuffers = class { - constructor() { - this.length = 0; - this.items = []; - } - push(x) { - this.length += Buffer.byteLength(x); - this.items.push(x); - } - toBuffer() { - const result = Buffer.allocUnsafe(this.length); - let offset = 0; - for (const item of this.items) { - const length = Buffer.byteLength(item); - Buffer.isBuffer(item) ? item.copy(result, offset) : result.write(item, offset, length); - offset += length; - } - return result; - } - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js -var require_ClusterAllFailedError = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/ClusterAllFailedError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var redis_errors_1 = require_redis_errors(); - var ClusterAllFailedError = class extends redis_errors_1.RedisError { - constructor(message, lastNodeError) { - super(message); - this.lastNodeError = lastNodeError; - Error.captureStackTrace(this, this.constructor); - } - get name() { - return this.constructor.name; - } - }; - exports2.default = ClusterAllFailedError; - ClusterAllFailedError.defaultMessage = "Failed to refresh slots cache."; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js -var require_ScanStream = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/ScanStream.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var stream_1 = require("stream"); - var ScanStream = class extends stream_1.Readable { - constructor(opt) { - super(opt); - this.opt = opt; - this._redisCursor = "0"; - this._redisDrained = false; - } - _read() { - if (this._redisDrained) { - this.push(null); - return; - } - const args = [this._redisCursor]; - if (this.opt.key) { - args.unshift(this.opt.key); - } - if (this.opt.match) { - args.push("MATCH", this.opt.match); - } - if (this.opt.type) { - args.push("TYPE", this.opt.type); - } - if (this.opt.count) { - args.push("COUNT", String(this.opt.count)); - } - if (this.opt.noValues) { - args.push("NOVALUES"); - } - this.opt.redis[this.opt.command](args, (err, res) => { - if (err) { - this.emit("error", err); - return; - } - this._redisCursor = res[0] instanceof Buffer ? res[0].toString() : res[0]; - if (this._redisCursor === "0") { - this._redisDrained = true; - } - this.push(res[1]); - }); - } - close() { - this._redisDrained = true; - } - }; - exports2.default = ScanStream; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js -var require_autoPipelining = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/autoPipelining.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.executeWithAutoPipelining = exports2.getFirstValueInFlattenedArray = exports2.shouldUseAutoPipelining = exports2.notAllowedAutoPipelineCommands = exports2.kCallbacks = exports2.kExec = void 0; - var lodash_1 = require_lodash3(); - var calculateSlot = require_lib(); - var standard_as_callback_1 = require_built2(); - exports2.kExec = Symbol("exec"); - exports2.kCallbacks = Symbol("callbacks"); - exports2.notAllowedAutoPipelineCommands = [ - "auth", - "info", - "script", - "quit", - "cluster", - "pipeline", - "multi", - "subscribe", - "psubscribe", - "unsubscribe", - "unpsubscribe", - "select", - "client" - ]; - function executeAutoPipeline(client, slotKey) { - if (client._runningAutoPipelines.has(slotKey)) { - return; - } - if (!client._autoPipelines.has(slotKey)) { - return; - } - client._runningAutoPipelines.add(slotKey); - const pipeline = client._autoPipelines.get(slotKey); - client._autoPipelines.delete(slotKey); - const callbacks = pipeline[exports2.kCallbacks]; - pipeline[exports2.kCallbacks] = null; - pipeline.exec(function(err, results) { - client._runningAutoPipelines.delete(slotKey); - if (err) { - for (let i = 0; i < callbacks.length; i++) { - process.nextTick(callbacks[i], err); - } - } else { - for (let i = 0; i < callbacks.length; i++) { - process.nextTick(callbacks[i], ...results[i]); - } - } - if (client._autoPipelines.has(slotKey)) { - executeAutoPipeline(client, slotKey); - } - }); - } - function shouldUseAutoPipelining(client, functionName, commandName) { - return functionName && client.options.enableAutoPipelining && !client.isPipeline && !exports2.notAllowedAutoPipelineCommands.includes(commandName) && !client.options.autoPipeliningIgnoredCommands.includes(commandName); - } - exports2.shouldUseAutoPipelining = shouldUseAutoPipelining; - function getFirstValueInFlattenedArray(args) { - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - if (typeof arg === "string") { - return arg; - } else if (Array.isArray(arg) || (0, lodash_1.isArguments)(arg)) { - if (arg.length === 0) { - continue; - } - return arg[0]; - } - const flattened = [arg].flat(); - if (flattened.length > 0) { - return flattened[0]; - } - } - return void 0; - } - exports2.getFirstValueInFlattenedArray = getFirstValueInFlattenedArray; - function executeWithAutoPipelining(client, functionName, commandName, args, callback) { - if (client.isCluster && !client.slots.length) { - if (client.status === "wait") - client.connect().catch(lodash_1.noop); - return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { - client.delayUntilReady((err) => { - if (err) { - reject(err); - return; - } - executeWithAutoPipelining(client, functionName, commandName, args, null).then(resolve2, reject); - }); - }), callback); - } - const prefix = client.options.keyPrefix || ""; - const slotKey = client.isCluster ? client.slots[calculateSlot(`${prefix}${getFirstValueInFlattenedArray(args)}`)].join(",") : "main"; - if (!client._autoPipelines.has(slotKey)) { - const pipeline2 = client.pipeline(); - pipeline2[exports2.kExec] = false; - pipeline2[exports2.kCallbacks] = []; - client._autoPipelines.set(slotKey, pipeline2); - } - const pipeline = client._autoPipelines.get(slotKey); - if (!pipeline[exports2.kExec]) { - pipeline[exports2.kExec] = true; - setImmediate(executeAutoPipeline, client, slotKey); - } - const autoPipelinePromise = new Promise(function(resolve2, reject) { - pipeline[exports2.kCallbacks].push(function(err, value) { - if (err) { - reject(err); - return; - } - resolve2(value); - }); - if (functionName === "call") { - args.unshift(commandName); - } - pipeline[functionName](...args); - }); - return (0, standard_as_callback_1.default)(autoPipelinePromise, callback); - } - exports2.executeWithAutoPipelining = executeWithAutoPipelining; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js -var require_Script = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Script.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var crypto_1 = require("crypto"); - var Command_1 = require_Command(); - var standard_as_callback_1 = require_built2(); - var Script2 = class { - constructor(lua, numberOfKeys = null, keyPrefix = "", readOnly = false) { - this.lua = lua; - this.numberOfKeys = numberOfKeys; - this.keyPrefix = keyPrefix; - this.readOnly = readOnly; - this.sha = (0, crypto_1.createHash)("sha1").update(lua).digest("hex"); - const sha = this.sha; - const socketHasScriptLoaded = /* @__PURE__ */ new WeakSet(); - this.Command = class CustomScriptCommand extends Command_1.default { - toWritable(socket) { - const origReject = this.reject; - this.reject = (err) => { - if (err.message.indexOf("NOSCRIPT") !== -1) { - socketHasScriptLoaded.delete(socket); - } - origReject.call(this, err); - }; - if (!socketHasScriptLoaded.has(socket)) { - socketHasScriptLoaded.add(socket); - this.name = "eval"; - this.args[0] = lua; - } else if (this.name === "eval") { - this.name = "evalsha"; - this.args[0] = sha; - } - return super.toWritable(socket); - } - }; - } - execute(container, args, options, callback) { - if (typeof this.numberOfKeys === "number") { - args.unshift(this.numberOfKeys); - } - if (this.keyPrefix) { - options.keyPrefix = this.keyPrefix; - } - if (this.readOnly) { - options.readOnly = true; - } - const evalsha = new this.Command("evalsha", [this.sha, ...args], options); - evalsha.promise = evalsha.promise.catch((err) => { - if (err.message.indexOf("NOSCRIPT") === -1) { - throw err; - } - const resend = new this.Command("evalsha", [this.sha, ...args], options); - const client = container.isPipeline ? container.redis : container; - return client.sendCommand(resend); - }); - (0, standard_as_callback_1.default)(evalsha.promise, callback); - return container.sendCommand(evalsha); - } - }; - exports2.default = Script2; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js -var require_Commander = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/Commander.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var autoPipelining_1 = require_autoPipelining(); - var Command_1 = require_Command(); - var Script_1 = require_Script(); - var Commander = class { - constructor() { - this.options = {}; - this.scriptsSet = {}; - this.addedBuiltinSet = /* @__PURE__ */ new Set(); - } - /** - * Return supported builtin commands - */ - getBuiltinCommands() { - return commands.slice(0); - } - /** - * Create a builtin command - */ - createBuiltinCommand(commandName) { - return { - string: generateFunction(null, commandName, "utf8"), - buffer: generateFunction(null, commandName, null) - }; - } - /** - * Create add builtin command - */ - addBuiltinCommand(commandName) { - this.addedBuiltinSet.add(commandName); - this[commandName] = generateFunction(commandName, commandName, "utf8"); - this[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); - } - /** - * Define a custom command using lua script - */ - defineCommand(name, definition) { - const script = new Script_1.default(definition.lua, definition.numberOfKeys, this.options.keyPrefix, definition.readOnly); - this.scriptsSet[name] = script; - this[name] = generateScriptingFunction(name, name, script, "utf8"); - this[name + "Buffer"] = generateScriptingFunction(name + "Buffer", name, script, null); - } - /** - * @ignore - */ - sendCommand(command, stream, node) { - throw new Error('"sendCommand" is not implemented'); - } - }; - var commands = commands_1.list.filter((command) => command !== "monitor"); - commands.push("sentinel"); - commands.forEach(function(commandName) { - Commander.prototype[commandName] = generateFunction(commandName, commandName, "utf8"); - Commander.prototype[commandName + "Buffer"] = generateFunction(commandName + "Buffer", commandName, null); - }); - Commander.prototype.call = generateFunction("call", "utf8"); - Commander.prototype.callBuffer = generateFunction("callBuffer", null); - Commander.prototype.send_command = Commander.prototype.call; - function generateFunction(functionName, _commandName, _encoding) { - if (typeof _encoding === "undefined") { - _encoding = _commandName; - _commandName = null; - } - return function(...args) { - const commandName = _commandName || args.shift(); - let callback = args[args.length - 1]; - if (typeof callback === "function") { - args.pop(); - } else { - callback = void 0; - } - const options = { - errorStack: this.options.showFriendlyErrorStack ? new Error() : void 0, - keyPrefix: this.options.keyPrefix, - replyEncoding: _encoding - }; - if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { - return this.sendCommand( - // @ts-expect-error - new Command_1.default(commandName, args, options, callback) - ); - } - return (0, autoPipelining_1.executeWithAutoPipelining)( - this, - functionName, - commandName, - // @ts-expect-error - args, - callback - ); - }; - } - function generateScriptingFunction(functionName, commandName, script, encoding) { - return function(...args) { - const callback = typeof args[args.length - 1] === "function" ? args.pop() : void 0; - const options = { - replyEncoding: encoding - }; - if (this.options.showFriendlyErrorStack) { - options.errorStack = new Error(); - } - if (!(0, autoPipelining_1.shouldUseAutoPipelining)(this, functionName, commandName)) { - return script.execute(this, args, options, callback); - } - return (0, autoPipelining_1.executeWithAutoPipelining)(this, functionName, commandName, args, callback); - }; - } - exports2.default = Commander; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js -var require_Pipeline = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var calculateSlot = require_lib(); - var commands_1 = require_built(); - var standard_as_callback_1 = require_built2(); - var util_1 = require("util"); - var Command_1 = require_Command(); - var utils_1 = require_utils2(); - var Commander_1 = require_Commander(); - function generateMultiWithNodes(redis, keys) { - const slot = calculateSlot(keys[0]); - const target = redis._groupsBySlot[slot]; - for (let i = 1; i < keys.length; i++) { - if (redis._groupsBySlot[calculateSlot(keys[i])] !== target) { - return -1; - } - } - return slot; - } - var Pipeline = class extends Commander_1.default { - constructor(redis) { - super(); - this.redis = redis; - this.isPipeline = true; - this.replyPending = 0; - this._queue = []; - this._result = []; - this._transactions = 0; - this._shaToScript = {}; - this.isCluster = this.redis.constructor.name === "Cluster" || this.redis.isCluster; - this.options = redis.options; - Object.keys(redis.scriptsSet).forEach((name) => { - const script = redis.scriptsSet[name]; - this._shaToScript[script.sha] = script; - this[name] = redis[name]; - this[name + "Buffer"] = redis[name + "Buffer"]; - }); - redis.addedBuiltinSet.forEach((name) => { - this[name] = redis[name]; - this[name + "Buffer"] = redis[name + "Buffer"]; - }); - this.promise = new Promise((resolve2, reject) => { - this.resolve = resolve2; - this.reject = reject; - }); - const _this = this; - Object.defineProperty(this, "length", { - get: function() { - return _this._queue.length; - } - }); - } - fillResult(value, position) { - if (this._queue[position].name === "exec" && Array.isArray(value[1])) { - const execLength = value[1].length; - for (let i = 0; i < execLength; i++) { - if (value[1][i] instanceof Error) { - continue; - } - const cmd = this._queue[position - (execLength - i)]; - try { - value[1][i] = cmd.transformReply(value[1][i]); - } catch (err) { - value[1][i] = err; - } - } - } - this._result[position] = value; - if (--this.replyPending) { - return; - } - if (this.isCluster) { - let retriable = true; - let commonError; - for (let i = 0; i < this._result.length; ++i) { - const error = this._result[i][0]; - const command = this._queue[i]; - if (error) { - if (command.name === "exec" && error.message === "EXECABORT Transaction discarded because of previous errors.") { - continue; - } - if (!commonError) { - commonError = { - name: error.name, - message: error.message - }; - } else if (commonError.name !== error.name || commonError.message !== error.message) { - retriable = false; - break; - } - } else if (!command.inTransaction) { - const isReadOnly = (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); - if (!isReadOnly) { - retriable = false; - break; - } - } - } - if (commonError && retriable) { - const _this = this; - const errv = commonError.message.split(" "); - const queue = this._queue; - let inTransaction = false; - this._queue = []; - for (let i = 0; i < queue.length; ++i) { - if (errv[0] === "ASK" && !inTransaction && queue[i].name !== "asking" && (!queue[i - 1] || queue[i - 1].name !== "asking")) { - const asking = new Command_1.default("asking"); - asking.ignore = true; - this.sendCommand(asking); - } - queue[i].initPromise(); - this.sendCommand(queue[i]); - inTransaction = queue[i].inTransaction; - } - let matched = true; - if (typeof this.leftRedirections === "undefined") { - this.leftRedirections = {}; - } - const exec = function() { - _this.exec(); - }; - const cluster = this.redis; - cluster.handleError(commonError, this.leftRedirections, { - moved: function(_slot, key) { - _this.preferKey = key; - cluster.slots[errv[1]] = [key]; - cluster._groupsBySlot[errv[1]] = cluster._groupsIds[cluster.slots[errv[1]].join(";")]; - cluster.refreshSlotsCache(); - _this.exec(); - }, - ask: function(_slot, key) { - _this.preferKey = key; - _this.exec(); - }, - tryagain: exec, - clusterDown: exec, - connectionClosed: exec, - maxRedirections: () => { - matched = false; - }, - defaults: () => { - matched = false; - } - }); - if (matched) { - return; - } - } - } - let ignoredCount = 0; - for (let i = 0; i < this._queue.length - ignoredCount; ++i) { - if (this._queue[i + ignoredCount].ignore) { - ignoredCount += 1; - } - this._result[i] = this._result[i + ignoredCount]; - } - this.resolve(this._result.slice(0, this._result.length - ignoredCount)); - } - sendCommand(command) { - if (this._transactions > 0) { - command.inTransaction = true; - } - const position = this._queue.length; - command.pipelineIndex = position; - command.promise.then((result) => { - this.fillResult([null, result], position); - }).catch((error) => { - this.fillResult([error], position); - }); - this._queue.push(command); - return this; - } - addBatch(commands) { - let command, commandName, args; - for (let i = 0; i < commands.length; ++i) { - command = commands[i]; - commandName = command[0]; - args = command.slice(1); - this[commandName].apply(this, args); - } - return this; - } - }; - exports2.default = Pipeline; - var multi = Pipeline.prototype.multi; - Pipeline.prototype.multi = function() { - this._transactions += 1; - return multi.apply(this, arguments); - }; - var execBuffer = Pipeline.prototype.execBuffer; - Pipeline.prototype.execBuffer = (0, util_1.deprecate)(function() { - if (this._transactions > 0) { - this._transactions -= 1; - } - return execBuffer.apply(this, arguments); - }, "Pipeline#execBuffer: Use Pipeline#exec instead"); - Pipeline.prototype.exec = function(callback) { - if (this.isCluster && !this.redis.slots.length) { - if (this.redis.status === "wait") - this.redis.connect().catch(utils_1.noop); - if (callback && !this.nodeifiedPromise) { - this.nodeifiedPromise = true; - (0, standard_as_callback_1.default)(this.promise, callback); - } - this.redis.delayUntilReady((err) => { - if (err) { - this.reject(err); - return; - } - this.exec(callback); - }); - return this.promise; - } - if (this._transactions > 0) { - this._transactions -= 1; - return execBuffer.apply(this, arguments); - } - if (!this.nodeifiedPromise) { - this.nodeifiedPromise = true; - (0, standard_as_callback_1.default)(this.promise, callback); - } - if (!this._queue.length) { - this.resolve([]); - } - let pipelineSlot; - if (this.isCluster) { - const sampleKeys = []; - for (let i = 0; i < this._queue.length; i++) { - const keys = this._queue[i].getKeys(); - if (keys.length) { - sampleKeys.push(keys[0]); - } - if (keys.length && calculateSlot.generateMulti(keys) < 0) { - this.reject(new Error("All the keys in a pipeline command should belong to the same slot")); - return this.promise; - } - } - if (sampleKeys.length) { - pipelineSlot = generateMultiWithNodes(this.redis, sampleKeys); - if (pipelineSlot < 0) { - this.reject(new Error("All keys in the pipeline should belong to the same slots allocation group")); - return this.promise; - } - } else { - pipelineSlot = Math.random() * 16384 | 0; - } - } - const _this = this; - execPipeline(); - return this.promise; - function execPipeline() { - let writePending = _this.replyPending = _this._queue.length; - let node; - if (_this.isCluster) { - node = { - slot: pipelineSlot, - redis: _this.redis.connectionPool.nodes.all[_this.preferKey] - }; - } - let data = ""; - let buffers; - const stream = { - isPipeline: true, - destination: _this.isCluster ? node : { redis: _this.redis }, - write(writable) { - if (typeof writable !== "string") { - if (!buffers) { - buffers = []; - } - if (data) { - buffers.push(Buffer.from(data, "utf8")); - data = ""; - } - buffers.push(writable); - } else { - data += writable; - } - if (!--writePending) { - if (buffers) { - if (data) { - buffers.push(Buffer.from(data, "utf8")); - } - stream.destination.redis.stream.write(Buffer.concat(buffers)); - } else { - stream.destination.redis.stream.write(data); - } - writePending = _this._queue.length; - data = ""; - buffers = void 0; - } - } - }; - for (let i = 0; i < _this._queue.length; ++i) { - _this.redis.sendCommand(_this._queue[i], stream, node); - } - return _this.promise; - } - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js -var require_transaction = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/transaction.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.addTransactionSupport = void 0; - var utils_1 = require_utils2(); - var standard_as_callback_1 = require_built2(); - var Pipeline_1 = require_Pipeline(); - function addTransactionSupport(redis) { - redis.pipeline = function(commands) { - const pipeline = new Pipeline_1.default(this); - if (Array.isArray(commands)) { - pipeline.addBatch(commands); - } - return pipeline; - }; - const { multi } = redis; - redis.multi = function(commands, options) { - if (typeof options === "undefined" && !Array.isArray(commands)) { - options = commands; - commands = null; - } - if (options && options.pipeline === false) { - return multi.call(this); - } - const pipeline = new Pipeline_1.default(this); - pipeline.multi(); - if (Array.isArray(commands)) { - pipeline.addBatch(commands); - } - const exec2 = pipeline.exec; - pipeline.exec = function(callback) { - if (this.isCluster && !this.redis.slots.length) { - if (this.redis.status === "wait") - this.redis.connect().catch(utils_1.noop); - return (0, standard_as_callback_1.default)(new Promise((resolve2, reject) => { - this.redis.delayUntilReady((err) => { - if (err) { - reject(err); - return; - } - this.exec(pipeline).then(resolve2, reject); - }); - }), callback); - } - if (this._transactions > 0) { - exec2.call(pipeline); - } - if (this.nodeifiedPromise) { - return exec2.call(pipeline); - } - const promise = exec2.call(pipeline); - return (0, standard_as_callback_1.default)(promise.then(function(result) { - const execResult = result[result.length - 1]; - if (typeof execResult === "undefined") { - throw new Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it."); - } - if (execResult[0]) { - execResult[0].previousErrors = []; - for (let i = 0; i < result.length - 1; ++i) { - if (result[i][0]) { - execResult[0].previousErrors.push(result[i][0]); - } - } - throw execResult[0]; - } - return (0, utils_1.wrapMultiResult)(execResult[1]); - }), callback); - }; - const { execBuffer } = pipeline; - pipeline.execBuffer = function(callback) { - if (this._transactions > 0) { - execBuffer.call(pipeline); - } - return pipeline.exec(callback); - }; - return pipeline; - }; - const { exec } = redis; - redis.exec = function(callback) { - return (0, standard_as_callback_1.default)(exec.call(this).then(function(results) { - if (Array.isArray(results)) { - results = (0, utils_1.wrapMultiResult)(results); - } - return results; - }), callback); - }; - } - exports2.addTransactionSupport = addTransactionSupport; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js -var require_applyMixin = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/utils/applyMixin.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function applyMixin(derivedConstructor, mixinConstructor) { - Object.getOwnPropertyNames(mixinConstructor.prototype).forEach((name) => { - Object.defineProperty(derivedConstructor.prototype, name, Object.getOwnPropertyDescriptor(mixinConstructor.prototype, name)); - }); - } - exports2.default = applyMixin; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js -var require_ClusterOptions = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_CLUSTER_OPTIONS = void 0; - var dns_1 = require("dns"); - exports2.DEFAULT_CLUSTER_OPTIONS = { - clusterRetryStrategy: (times) => Math.min(100 + times * 2, 2e3), - enableOfflineQueue: true, - enableReadyCheck: true, - scaleReads: "master", - maxRedirections: 16, - retryDelayOnMoved: 0, - retryDelayOnFailover: 100, - retryDelayOnClusterDown: 100, - retryDelayOnTryAgain: 100, - slotsRefreshTimeout: 1e3, - useSRVRecords: false, - resolveSrv: dns_1.resolveSrv, - dnsLookup: dns_1.lookup, - enableAutoPipelining: false, - autoPipeliningIgnoredCommands: [], - shardedSubscribers: false - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js -var require_util = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/util.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getConnectionName = exports2.weightSrvRecords = exports2.groupSrvRecords = exports2.getUniqueHostnamesFromOptions = exports2.normalizeNodeOptions = exports2.nodeKeyToRedisOptions = exports2.getNodeKey = void 0; - var utils_1 = require_utils2(); - var net_1 = require("net"); - function getNodeKey(node) { - node.port = node.port || 6379; - node.host = node.host || "127.0.0.1"; - return node.host + ":" + node.port; - } - exports2.getNodeKey = getNodeKey; - function nodeKeyToRedisOptions(nodeKey) { - const portIndex = nodeKey.lastIndexOf(":"); - if (portIndex === -1) { - throw new Error(`Invalid node key ${nodeKey}`); - } - return { - host: nodeKey.slice(0, portIndex), - port: Number(nodeKey.slice(portIndex + 1)) - }; - } - exports2.nodeKeyToRedisOptions = nodeKeyToRedisOptions; - function normalizeNodeOptions(nodes) { - return nodes.map((node) => { - const options = {}; - if (typeof node === "object") { - Object.assign(options, node); - } else if (typeof node === "string") { - Object.assign(options, (0, utils_1.parseURL)(node)); - } else if (typeof node === "number") { - options.port = node; - } else { - throw new Error("Invalid argument " + node); - } - if (typeof options.port === "string") { - options.port = parseInt(options.port, 10); - } - delete options.db; - if (!options.port) { - options.port = 6379; - } - if (!options.host) { - options.host = "127.0.0.1"; - } - return (0, utils_1.resolveTLSProfile)(options); - }); - } - exports2.normalizeNodeOptions = normalizeNodeOptions; - function getUniqueHostnamesFromOptions(nodes) { - const uniqueHostsMap = {}; - nodes.forEach((node) => { - uniqueHostsMap[node.host] = true; - }); - return Object.keys(uniqueHostsMap).filter((host) => !(0, net_1.isIP)(host)); - } - exports2.getUniqueHostnamesFromOptions = getUniqueHostnamesFromOptions; - function groupSrvRecords(records) { - const recordsByPriority = {}; - for (const record of records) { - if (!recordsByPriority.hasOwnProperty(record.priority)) { - recordsByPriority[record.priority] = { - totalWeight: record.weight, - records: [record] - }; - } else { - recordsByPriority[record.priority].totalWeight += record.weight; - recordsByPriority[record.priority].records.push(record); - } - } - return recordsByPriority; - } - exports2.groupSrvRecords = groupSrvRecords; - function weightSrvRecords(recordsGroup) { - if (recordsGroup.records.length === 1) { - recordsGroup.totalWeight = 0; - return recordsGroup.records.shift(); - } - const random = Math.floor(Math.random() * (recordsGroup.totalWeight + recordsGroup.records.length)); - let total = 0; - for (const [i, record] of recordsGroup.records.entries()) { - total += 1 + record.weight; - if (total > random) { - recordsGroup.totalWeight -= record.weight; - recordsGroup.records.splice(i, 1); - return record; - } - } - } - exports2.weightSrvRecords = weightSrvRecords; - function getConnectionName(component, nodeConnectionName) { - const prefix = `ioredis-cluster(${component})`; - return nodeConnectionName ? `${prefix}:${nodeConnectionName}` : prefix; - } - exports2.getConnectionName = getConnectionName; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js -var require_ClusterSubscriber = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriber.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var utils_1 = require_utils2(); - var Redis_1 = require_Redis(); - var debug = (0, utils_1.Debug)("cluster:subscriber"); - var ClusterSubscriber = class { - constructor(connectionPool, emitter, isSharded = false) { - this.connectionPool = connectionPool; - this.emitter = emitter; - this.isSharded = isSharded; - this.started = false; - this.subscriber = null; - this.slotRange = []; - this.onSubscriberEnd = () => { - if (!this.started) { - debug("subscriber has disconnected, but ClusterSubscriber is not started, so not reconnecting."); - return; - } - debug("subscriber has disconnected, selecting a new one..."); - this.selectSubscriber(); - }; - this.connectionPool.on("-node", (_, key) => { - if (!this.started || !this.subscriber) { - return; - } - if ((0, util_1.getNodeKey)(this.subscriber.options) === key) { - debug("subscriber has left, selecting a new one..."); - this.selectSubscriber(); - } - }); - this.connectionPool.on("+node", () => { - if (!this.started || this.subscriber) { - return; - } - debug("a new node is discovered and there is no subscriber, selecting a new one..."); - this.selectSubscriber(); - }); - } - getInstance() { - return this.subscriber; - } - /** - * Associate this subscriber to a specific slot range. - * - * Returns the range or an empty array if the slot range couldn't be associated. - * - * BTW: This is more for debugging and testing purposes. - * - * @param range - */ - associateSlotRange(range) { - if (this.isSharded) { - this.slotRange = range; - } - return this.slotRange; - } - start() { - this.started = true; - this.selectSubscriber(); - debug("started"); - } - stop() { - this.started = false; - if (this.subscriber) { - this.subscriber.disconnect(); - this.subscriber = null; - } - } - isStarted() { - return this.started; - } - selectSubscriber() { - const lastActiveSubscriber = this.lastActiveSubscriber; - if (lastActiveSubscriber) { - lastActiveSubscriber.off("end", this.onSubscriberEnd); - lastActiveSubscriber.disconnect(); - } - if (this.subscriber) { - this.subscriber.off("end", this.onSubscriberEnd); - this.subscriber.disconnect(); - } - const sampleNode = (0, utils_1.sample)(this.connectionPool.getNodes()); - if (!sampleNode) { - debug("selecting subscriber failed since there is no node discovered in the cluster yet"); - this.subscriber = null; - return; - } - const { options } = sampleNode; - debug("selected a subscriber %s:%s", options.host, options.port); - let connectionPrefix = "subscriber"; - if (this.isSharded) - connectionPrefix = "ssubscriber"; - this.subscriber = new Redis_1.default({ - port: options.port, - host: options.host, - username: options.username, - password: options.password, - enableReadyCheck: true, - connectionName: (0, util_1.getConnectionName)(connectionPrefix, options.connectionName), - lazyConnect: true, - tls: options.tls, - // Don't try to reconnect the subscriber connection. If the connection fails - // we will get an end event (handled below), at which point we'll pick a new - // node from the pool and try to connect to that as the subscriber connection. - retryStrategy: null - }); - this.subscriber.on("error", utils_1.noop); - this.subscriber.on("moved", () => { - this.emitter.emit("forceRefresh"); - }); - this.subscriber.once("end", this.onSubscriberEnd); - const previousChannels = { subscribe: [], psubscribe: [], ssubscribe: [] }; - if (lastActiveSubscriber) { - const condition = lastActiveSubscriber.condition || lastActiveSubscriber.prevCondition; - if (condition && condition.subscriber) { - previousChannels.subscribe = condition.subscriber.channels("subscribe"); - previousChannels.psubscribe = condition.subscriber.channels("psubscribe"); - previousChannels.ssubscribe = condition.subscriber.channels("ssubscribe"); - } - } - if (previousChannels.subscribe.length || previousChannels.psubscribe.length || previousChannels.ssubscribe.length) { - let pending = 0; - for (const type of ["subscribe", "psubscribe", "ssubscribe"]) { - const channels = previousChannels[type]; - if (channels.length == 0) { - continue; - } - debug("%s %d channels", type, channels.length); - if (type === "ssubscribe") { - for (const channel of channels) { - pending += 1; - this.subscriber[type](channel).then(() => { - if (!--pending) { - this.lastActiveSubscriber = this.subscriber; - } - }).catch(() => { - debug("failed to ssubscribe to channel: %s", channel); - }); - } - } else { - pending += 1; - this.subscriber[type](channels).then(() => { - if (!--pending) { - this.lastActiveSubscriber = this.subscriber; - } - }).catch(() => { - debug("failed to %s %d channels", type, channels.length); - }); - } - } - } else { - this.lastActiveSubscriber = this.subscriber; - } - for (const event of [ - "message", - "messageBuffer" - ]) { - this.subscriber.on(event, (arg1, arg2) => { - this.emitter.emit(event, arg1, arg2); - }); - } - for (const event of ["pmessage", "pmessageBuffer"]) { - this.subscriber.on(event, (arg1, arg2, arg3) => { - this.emitter.emit(event, arg1, arg2, arg3); - }); - } - if (this.isSharded == true) { - for (const event of [ - "smessage", - "smessageBuffer" - ]) { - this.subscriber.on(event, (arg1, arg2) => { - this.emitter.emit(event, arg1, arg2); - }); - } - } - } - }; - exports2.default = ClusterSubscriber; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js -var require_ConnectionPool = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ConnectionPool.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var events_1 = require("events"); - var utils_1 = require_utils2(); - var util_1 = require_util(); - var Redis_1 = require_Redis(); - var debug = (0, utils_1.Debug)("cluster:connectionPool"); - var ConnectionPool = class extends events_1.EventEmitter { - constructor(redisOptions) { - super(); - this.redisOptions = redisOptions; - this.nodes = { - all: {}, - master: {}, - slave: {} - }; - this.specifiedOptions = {}; - } - getNodes(role = "all") { - const nodes = this.nodes[role]; - return Object.keys(nodes).map((key) => nodes[key]); - } - getInstanceByKey(key) { - return this.nodes.all[key]; - } - getSampleInstance(role) { - const keys = Object.keys(this.nodes[role]); - const sampleKey = (0, utils_1.sample)(keys); - return this.nodes[role][sampleKey]; - } - /** - * Add a master node to the pool - * @param node - */ - addMasterNode(node) { - const key = (0, util_1.getNodeKey)(node.options); - const redis = this.createRedisFromOptions(node, node.options.readOnly); - if (!node.options.readOnly) { - this.nodes.all[key] = redis; - this.nodes.master[key] = redis; - return true; - } - return false; - } - /** - * Creates a Redis connection instance from the node options - * @param node - * @param readOnly - */ - createRedisFromOptions(node, readOnly) { - const redis = new Redis_1.default((0, utils_1.defaults)({ - // Never try to reconnect when a node is lose, - // instead, waiting for a `MOVED` error and - // fetch the slots again. - retryStrategy: null, - // Offline queue should be enabled so that - // we don't need to wait for the `ready` event - // before sending commands to the node. - enableOfflineQueue: true, - readOnly - }, node, this.redisOptions, { lazyConnect: true })); - return redis; - } - /** - * Find or create a connection to the node - */ - findOrCreate(node, readOnly = false) { - const key = (0, util_1.getNodeKey)(node); - readOnly = Boolean(readOnly); - if (this.specifiedOptions[key]) { - Object.assign(node, this.specifiedOptions[key]); - } else { - this.specifiedOptions[key] = node; - } - let redis; - if (this.nodes.all[key]) { - redis = this.nodes.all[key]; - if (redis.options.readOnly !== readOnly) { - redis.options.readOnly = readOnly; - debug("Change role of %s to %s", key, readOnly ? "slave" : "master"); - redis[readOnly ? "readonly" : "readwrite"]().catch(utils_1.noop); - if (readOnly) { - delete this.nodes.master[key]; - this.nodes.slave[key] = redis; - } else { - delete this.nodes.slave[key]; - this.nodes.master[key] = redis; - } - } - } else { - debug("Connecting to %s as %s", key, readOnly ? "slave" : "master"); - redis = this.createRedisFromOptions(node, readOnly); - this.nodes.all[key] = redis; - this.nodes[readOnly ? "slave" : "master"][key] = redis; - redis.once("end", () => { - this.removeNode(key); - this.emit("-node", redis, key); - if (!Object.keys(this.nodes.all).length) { - this.emit("drain"); - } - }); - this.emit("+node", redis, key); - redis.on("error", function(error) { - this.emit("nodeError", error, key); - }); - } - return redis; - } - /** - * Reset the pool with a set of nodes. - * The old node will be removed. - */ - reset(nodes) { - debug("Reset with %O", nodes); - const newNodes = {}; - nodes.forEach((node) => { - const key = (0, util_1.getNodeKey)(node); - if (!(node.readOnly && newNodes[key])) { - newNodes[key] = node; - } - }); - Object.keys(this.nodes.all).forEach((key) => { - if (!newNodes[key]) { - debug("Disconnect %s because the node does not hold any slot", key); - this.nodes.all[key].disconnect(); - this.removeNode(key); - } - }); - Object.keys(newNodes).forEach((key) => { - const node = newNodes[key]; - this.findOrCreate(node, node.readOnly); - }); - } - /** - * Remove a node from the pool. - */ - removeNode(key) { - const { nodes } = this; - if (nodes.all[key]) { - debug("Remove %s from the pool", key); - delete nodes.all[key]; - } - delete nodes.master[key]; - delete nodes.slave[key]; - } - }; - exports2.default = ConnectionPool; - } -}); - -// node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js -var require_denque = __commonJS({ - "node_modules/.pnpm/denque@2.1.0/node_modules/denque/index.js"(exports2, module2) { - "use strict"; - function Denque(array, options) { - var options = options || {}; - this._capacity = options.capacity; - this._head = 0; - this._tail = 0; - if (Array.isArray(array)) { - this._fromArray(array); - } else { - this._capacityMask = 3; - this._list = new Array(4); - } - } - Denque.prototype.peekAt = function peekAt(index) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - var len = this.size(); - if (i >= len || i < -len) return void 0; - if (i < 0) i += len; - i = this._head + i & this._capacityMask; - return this._list[i]; - }; - Denque.prototype.get = function get(i) { - return this.peekAt(i); - }; - Denque.prototype.peek = function peek() { - if (this._head === this._tail) return void 0; - return this._list[this._head]; - }; - Denque.prototype.peekFront = function peekFront() { - return this.peek(); - }; - Denque.prototype.peekBack = function peekBack() { - return this.peekAt(-1); - }; - Object.defineProperty(Denque.prototype, "length", { - get: function length() { - return this.size(); - } - }); - Denque.prototype.size = function size() { - if (this._head === this._tail) return 0; - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.unshift = function unshift(item) { - if (arguments.length === 0) return this.size(); - var len = this._list.length; - this._head = this._head - 1 + len & this._capacityMask; - this._list[this._head] = item; - if (this._tail === this._head) this._growArray(); - if (this._capacity && this.size() > this._capacity) this.pop(); - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.shift = function shift() { - var head = this._head; - if (head === this._tail) return void 0; - var item = this._list[head]; - this._list[head] = void 0; - this._head = head + 1 & this._capacityMask; - if (head < 2 && this._tail > 1e4 && this._tail <= this._list.length >>> 2) this._shrinkArray(); - return item; - }; - Denque.prototype.push = function push(item) { - if (arguments.length === 0) return this.size(); - var tail = this._tail; - this._list[tail] = item; - this._tail = tail + 1 & this._capacityMask; - if (this._tail === this._head) { - this._growArray(); - } - if (this._capacity && this.size() > this._capacity) { - this.shift(); - } - if (this._head < this._tail) return this._tail - this._head; - else return this._capacityMask + 1 - (this._head - this._tail); - }; - Denque.prototype.pop = function pop() { - var tail = this._tail; - if (tail === this._head) return void 0; - var len = this._list.length; - this._tail = tail - 1 + len & this._capacityMask; - var item = this._list[this._tail]; - this._list[this._tail] = void 0; - if (this._head < 2 && tail > 1e4 && tail <= len >>> 2) this._shrinkArray(); - return item; - }; - Denque.prototype.removeOne = function removeOne(index) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size) return void 0; - if (i < 0) i += size; - i = this._head + i & this._capacityMask; - var item = this._list[i]; - var k; - if (index < size / 2) { - for (k = index; k > 0; k--) { - this._list[i] = this._list[i = i - 1 + len & this._capacityMask]; - } - this._list[i] = void 0; - this._head = this._head + 1 + len & this._capacityMask; - } else { - for (k = size - 1 - index; k > 0; k--) { - this._list[i] = this._list[i = i + 1 + len & this._capacityMask]; - } - this._list[i] = void 0; - this._tail = this._tail - 1 + len & this._capacityMask; - } - return item; - }; - Denque.prototype.remove = function remove(index, count) { - var i = index; - var removed; - var del_count = count; - if (i !== (i | 0)) { - return void 0; - } - if (this._head === this._tail) return void 0; - var size = this.size(); - var len = this._list.length; - if (i >= size || i < -size || count < 1) return void 0; - if (i < 0) i += size; - if (count === 1 || !count) { - removed = new Array(1); - removed[0] = this.removeOne(i); - return removed; - } - if (i === 0 && i + count >= size) { - removed = this.toArray(); - this.clear(); - return removed; - } - if (i + count > size) count = size - i; - var k; - removed = new Array(count); - for (k = 0; k < count; k++) { - removed[k] = this._list[this._head + i + k & this._capacityMask]; - } - i = this._head + i & this._capacityMask; - if (index + count === size) { - this._tail = this._tail - count + len & this._capacityMask; - for (k = count; k > 0; k--) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - } - return removed; - } - if (index === 0) { - this._head = this._head + count + len & this._capacityMask; - for (k = count - 1; k > 0; k--) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - } - return removed; - } - if (i < size / 2) { - this._head = this._head + index + count + len & this._capacityMask; - for (k = index; k > 0; k--) { - this.unshift(this._list[i = i - 1 + len & this._capacityMask]); - } - i = this._head - 1 + len & this._capacityMask; - while (del_count > 0) { - this._list[i = i - 1 + len & this._capacityMask] = void 0; - del_count--; - } - if (index < 0) this._tail = i; - } else { - this._tail = i; - i = i + count + len & this._capacityMask; - for (k = size - (count + index); k > 0; k--) { - this.push(this._list[i++]); - } - i = this._tail; - while (del_count > 0) { - this._list[i = i + 1 + len & this._capacityMask] = void 0; - del_count--; - } - } - if (this._head < 2 && this._tail > 1e4 && this._tail <= len >>> 2) this._shrinkArray(); - return removed; - }; - Denque.prototype.splice = function splice(index, count) { - var i = index; - if (i !== (i | 0)) { - return void 0; - } - var size = this.size(); - if (i < 0) i += size; - if (i > size) return void 0; - if (arguments.length > 2) { - var k; - var temp; - var removed; - var arg_len = arguments.length; - var len = this._list.length; - var arguments_index = 2; - if (!size || i < size / 2) { - temp = new Array(i); - for (k = 0; k < i; k++) { - temp[k] = this._list[this._head + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i > 0) { - this._head = this._head + i + len & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._head = this._head + i + len & this._capacityMask; - } - while (arg_len > arguments_index) { - this.unshift(arguments[--arg_len]); - } - for (k = i; k > 0; k--) { - this.unshift(temp[k - 1]); - } - } else { - temp = new Array(size - (i + count)); - var leng = temp.length; - for (k = 0; k < leng; k++) { - temp[k] = this._list[this._head + i + count + k & this._capacityMask]; - } - if (count === 0) { - removed = []; - if (i != size) { - this._tail = this._head + i + len & this._capacityMask; - } - } else { - removed = this.remove(i, count); - this._tail = this._tail - leng + len & this._capacityMask; - } - while (arguments_index < arg_len) { - this.push(arguments[arguments_index++]); - } - for (k = 0; k < leng; k++) { - this.push(temp[k]); - } - } - return removed; - } else { - return this.remove(i, count); - } - }; - Denque.prototype.clear = function clear() { - this._list = new Array(this._list.length); - this._head = 0; - this._tail = 0; - }; - Denque.prototype.isEmpty = function isEmpty() { - return this._head === this._tail; - }; - Denque.prototype.toArray = function toArray() { - return this._copyArray(false); - }; - Denque.prototype._fromArray = function _fromArray(array) { - var length = array.length; - var capacity = this._nextPowerOf2(length); - this._list = new Array(capacity); - this._capacityMask = capacity - 1; - this._tail = length; - for (var i = 0; i < length; i++) this._list[i] = array[i]; - }; - Denque.prototype._copyArray = function _copyArray(fullCopy, size) { - var src = this._list; - var capacity = src.length; - var length = this.length; - size = size | length; - if (size == length && this._head < this._tail) { - return this._list.slice(this._head, this._tail); - } - var dest = new Array(size); - var k = 0; - var i; - if (fullCopy || this._head > this._tail) { - for (i = this._head; i < capacity; i++) dest[k++] = src[i]; - for (i = 0; i < this._tail; i++) dest[k++] = src[i]; - } else { - for (i = this._head; i < this._tail; i++) dest[k++] = src[i]; - } - return dest; - }; - Denque.prototype._growArray = function _growArray() { - if (this._head != 0) { - var newList = this._copyArray(true, this._list.length << 1); - this._tail = this._list.length; - this._head = 0; - this._list = newList; - } else { - this._tail = this._list.length; - this._list.length <<= 1; - } - this._capacityMask = this._capacityMask << 1 | 1; - }; - Denque.prototype._shrinkArray = function _shrinkArray() { - this._list.length >>>= 1; - this._capacityMask >>>= 1; - }; - Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) { - var log2 = Math.log(num) / Math.log(2); - var nextPow2 = 1 << log2 + 1; - return Math.max(nextPow2, 4); - }; - module2.exports = Denque; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js -var require_DelayQueue = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/DelayQueue.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var Deque = require_denque(); - var debug = (0, utils_1.Debug)("delayqueue"); - var DelayQueue = class { - constructor() { - this.queues = {}; - this.timeouts = {}; - } - /** - * Add a new item to the queue - * - * @param bucket bucket name - * @param item function that will run later - * @param options - */ - push(bucket, item, options) { - const callback = options.callback || process.nextTick; - if (!this.queues[bucket]) { - this.queues[bucket] = new Deque(); - } - const queue = this.queues[bucket]; - queue.push(item); - if (!this.timeouts[bucket]) { - this.timeouts[bucket] = setTimeout(() => { - callback(() => { - this.timeouts[bucket] = null; - this.execute(bucket); - }); - }, options.timeout); - } - } - execute(bucket) { - const queue = this.queues[bucket]; - if (!queue) { - return; - } - const { length } = queue; - if (!length) { - return; - } - debug("send %d commands in %s queue", length, bucket); - this.queues[bucket] = null; - while (queue.length > 0) { - queue.shift()(); - } - } - }; - exports2.default = DelayQueue; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js -var require_ClusterSubscriberGroup = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var ClusterSubscriber_1 = require_ClusterSubscriber(); - var ConnectionPool_1 = require_ConnectionPool(); - var util_1 = require_util(); - var calculateSlot = require_lib(); - var debug = (0, utils_1.Debug)("cluster:subscriberGroup"); - var ClusterSubscriberGroup = class { - /** - * Register callbacks - * - * @param cluster - */ - constructor(cluster, refreshSlotsCacheCallback) { - this.cluster = cluster; - this.shardedSubscribers = /* @__PURE__ */ new Map(); - this.clusterSlots = []; - this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); - this.channels = /* @__PURE__ */ new Map(); - cluster.on("+node", (redis) => { - this._addSubscriber(redis); - }); - cluster.on("-node", (redis) => { - this._removeSubscriber(redis); - }); - cluster.on("refresh", () => { - this._refreshSlots(cluster); - }); - cluster.on("forceRefresh", () => { - refreshSlotsCacheCallback(); - }); - } - /** - * Get the responsible subscriber. - * - * Returns null if no subscriber was found - * - * @param slot - */ - getResponsibleSubscriber(slot) { - const nodeKey = this.clusterSlots[slot][0]; - return this.shardedSubscribers.get(nodeKey); - } - /** - * Adds a channel for which this subscriber group is responsible - * - * @param channels - */ - addChannels(channels) { - const slot = calculateSlot(channels[0]); - channels.forEach((c) => { - if (calculateSlot(c) != slot) - return -1; - }); - const currChannels = this.channels.get(slot); - if (!currChannels) { - this.channels.set(slot, channels); - } else { - this.channels.set(slot, currChannels.concat(channels)); - } - return [...this.channels.values()].flatMap((v) => v).length; - } - /** - * Removes channels for which the subscriber group is responsible by optionally unsubscribing - * @param channels - */ - removeChannels(channels) { - const slot = calculateSlot(channels[0]); - channels.forEach((c) => { - if (calculateSlot(c) != slot) - return -1; - }); - const slotChannels = this.channels.get(slot); - if (slotChannels) { - const updatedChannels = slotChannels.filter((c) => !channels.includes(c)); - this.channels.set(slot, updatedChannels); - } - return [...this.channels.values()].flatMap((v) => v).length; - } - /** - * Disconnect all subscribers - */ - stop() { - for (const s of this.shardedSubscribers.values()) { - s.stop(); - } - } - /** - * Start all not yet started subscribers - */ - start() { - for (const s of this.shardedSubscribers.values()) { - if (!s.isStarted()) { - s.start(); - } - } - } - /** - * Add a subscriber to the group of subscribers - * - * @param redis - */ - _addSubscriber(redis) { - const pool = new ConnectionPool_1.default(redis.options); - if (pool.addMasterNode(redis)) { - const sub = new ClusterSubscriber_1.default(pool, this.cluster, true); - const nodeKey = (0, util_1.getNodeKey)(redis.options); - this.shardedSubscribers.set(nodeKey, sub); - sub.start(); - this._resubscribe(); - this.cluster.emit("+subscriber"); - return sub; - } - return null; - } - /** - * Removes a subscriber from the group - * @param redis - */ - _removeSubscriber(redis) { - const nodeKey = (0, util_1.getNodeKey)(redis.options); - const sub = this.shardedSubscribers.get(nodeKey); - if (sub) { - sub.stop(); - this.shardedSubscribers.delete(nodeKey); - this._resubscribe(); - this.cluster.emit("-subscriber"); - } - return this.shardedSubscribers; - } - /** - * Refreshes the subscriber-related slot ranges - * - * Returns false if no refresh was needed - * - * @param cluster - */ - _refreshSlots(cluster) { - if (this._slotsAreEqual(cluster.slots)) { - debug("Nothing to refresh because the new cluster map is equal to the previous one."); - } else { - debug("Refreshing the slots of the subscriber group."); - this.subscriberToSlotsIndex = /* @__PURE__ */ new Map(); - for (let slot = 0; slot < cluster.slots.length; slot++) { - const node = cluster.slots[slot][0]; - if (!this.subscriberToSlotsIndex.has(node)) { - this.subscriberToSlotsIndex.set(node, []); - } - this.subscriberToSlotsIndex.get(node).push(Number(slot)); - } - this._resubscribe(); - this.clusterSlots = JSON.parse(JSON.stringify(cluster.slots)); - this.cluster.emit("subscribersReady"); - return true; - } - return false; - } - /** - * Resubscribes to the previous channels - * - * @private - */ - _resubscribe() { - if (this.shardedSubscribers) { - this.shardedSubscribers.forEach((s, nodeKey) => { - const subscriberSlots = this.subscriberToSlotsIndex.get(nodeKey); - if (subscriberSlots) { - s.associateSlotRange(subscriberSlots); - subscriberSlots.forEach((ss) => { - const redis = s.getInstance(); - const channels = this.channels.get(ss); - if (channels && channels.length > 0) { - if (redis) { - redis.ssubscribe(channels); - redis.on("ready", () => { - redis.ssubscribe(channels); - }); - } - } - }); - } - }); - } - } - /** - * Deep equality of the cluster slots objects - * - * @param other - * @private - */ - _slotsAreEqual(other) { - if (this.clusterSlots === void 0) - return false; - else - return JSON.stringify(this.clusterSlots) === JSON.stringify(other); - } - }; - exports2.default = ClusterSubscriberGroup; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js -var require_cluster = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/cluster/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var events_1 = require("events"); - var redis_errors_1 = require_redis_errors(); - var standard_as_callback_1 = require_built2(); - var Command_1 = require_Command(); - var ClusterAllFailedError_1 = require_ClusterAllFailedError(); - var Redis_1 = require_Redis(); - var ScanStream_1 = require_ScanStream(); - var transaction_1 = require_transaction(); - var utils_1 = require_utils2(); - var applyMixin_1 = require_applyMixin(); - var Commander_1 = require_Commander(); - var ClusterOptions_1 = require_ClusterOptions(); - var ClusterSubscriber_1 = require_ClusterSubscriber(); - var ConnectionPool_1 = require_ConnectionPool(); - var DelayQueue_1 = require_DelayQueue(); - var util_1 = require_util(); - var Deque = require_denque(); - var ClusterSubscriberGroup_1 = require_ClusterSubscriberGroup(); - var debug = (0, utils_1.Debug)("cluster"); - var REJECT_OVERWRITTEN_COMMANDS = /* @__PURE__ */ new WeakSet(); - var Cluster = class _Cluster extends Commander_1.default { - /** - * Creates an instance of Cluster. - */ - //TODO: Add an option that enables or disables sharded PubSub - constructor(startupNodes, options = {}) { - super(); - this.slots = []; - this._groupsIds = {}; - this._groupsBySlot = Array(16384); - this.isCluster = true; - this.retryAttempts = 0; - this.delayQueue = new DelayQueue_1.default(); - this.offlineQueue = new Deque(); - this.isRefreshing = false; - this._refreshSlotsCacheCallbacks = []; - this._autoPipelines = /* @__PURE__ */ new Map(); - this._runningAutoPipelines = /* @__PURE__ */ new Set(); - this._readyDelayedCallbacks = []; - this.connectionEpoch = 0; - events_1.EventEmitter.call(this); - this.startupNodes = startupNodes; - this.options = (0, utils_1.defaults)({}, options, ClusterOptions_1.DEFAULT_CLUSTER_OPTIONS, this.options); - if (this.options.shardedSubscribers == true) - this.shardedSubscribers = new ClusterSubscriberGroup_1.default(this, this.refreshSlotsCache.bind(this)); - if (this.options.redisOptions && this.options.redisOptions.keyPrefix && !this.options.keyPrefix) { - this.options.keyPrefix = this.options.redisOptions.keyPrefix; - } - if (typeof this.options.scaleReads !== "function" && ["all", "master", "slave"].indexOf(this.options.scaleReads) === -1) { - throw new Error('Invalid option scaleReads "' + this.options.scaleReads + '". Expected "all", "master", "slave" or a custom function'); - } - this.connectionPool = new ConnectionPool_1.default(this.options.redisOptions); - this.connectionPool.on("-node", (redis, key) => { - this.emit("-node", redis); - }); - this.connectionPool.on("+node", (redis) => { - this.emit("+node", redis); - }); - this.connectionPool.on("drain", () => { - this.setStatus("close"); - }); - this.connectionPool.on("nodeError", (error, key) => { - this.emit("node error", error, key); - }); - this.subscriber = new ClusterSubscriber_1.default(this.connectionPool, this); - if (this.options.scripts) { - Object.entries(this.options.scripts).forEach(([name, definition]) => { - this.defineCommand(name, definition); - }); - } - if (this.options.lazyConnect) { - this.setStatus("wait"); - } else { - this.connect().catch((err) => { - debug("connecting failed: %s", err); - }); - } - } - /** - * Connect to a cluster - */ - connect() { - return new Promise((resolve2, reject) => { - if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { - reject(new Error("Redis is already connecting/connected")); - return; - } - const epoch = ++this.connectionEpoch; - this.setStatus("connecting"); - this.resolveStartupNodeHostnames().then((nodes) => { - if (this.connectionEpoch !== epoch) { - debug("discard connecting after resolving startup nodes because epoch not match: %d != %d", epoch, this.connectionEpoch); - reject(new redis_errors_1.RedisError("Connection is discarded because a new connection is made")); - return; - } - if (this.status !== "connecting") { - debug("discard connecting after resolving startup nodes because the status changed to %s", this.status); - reject(new redis_errors_1.RedisError("Connection is aborted")); - return; - } - this.connectionPool.reset(nodes); - const readyHandler = () => { - this.setStatus("ready"); - this.retryAttempts = 0; - this.executeOfflineCommands(); - this.resetNodesRefreshInterval(); - resolve2(); - }; - let closeListener = void 0; - const refreshListener = () => { - this.invokeReadyDelayedCallbacks(void 0); - this.removeListener("close", closeListener); - this.manuallyClosing = false; - this.setStatus("connect"); - if (this.options.enableReadyCheck) { - this.readyCheck((err, fail) => { - if (err || fail) { - debug("Ready check failed (%s). Reconnecting...", err || fail); - if (this.status === "connect") { - this.disconnect(true); - } - } else { - readyHandler(); - } - }); - } else { - readyHandler(); - } - }; - closeListener = () => { - const error = new Error("None of startup nodes is available"); - this.removeListener("refresh", refreshListener); - this.invokeReadyDelayedCallbacks(error); - reject(error); - }; - this.once("refresh", refreshListener); - this.once("close", closeListener); - this.once("close", this.handleCloseEvent.bind(this)); - this.refreshSlotsCache((err) => { - if (err && err.message === ClusterAllFailedError_1.default.defaultMessage) { - Redis_1.default.prototype.silentEmit.call(this, "error", err); - this.connectionPool.reset([]); - } - }); - this.subscriber.start(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.start(); - } - }).catch((err) => { - this.setStatus("close"); - this.handleCloseEvent(err); - this.invokeReadyDelayedCallbacks(err); - reject(err); - }); - }); - } - /** - * Disconnect from every node in the cluster. - */ - disconnect(reconnect = false) { - const status = this.status; - this.setStatus("disconnecting"); - if (!reconnect) { - this.manuallyClosing = true; - } - if (this.reconnectTimeout && !reconnect) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - debug("Canceled reconnecting attempts"); - } - this.clearNodesRefreshInterval(); - this.subscriber.stop(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.stop(); - } - if (status === "wait") { - this.setStatus("close"); - this.handleCloseEvent(); - } else { - this.connectionPool.reset([]); - } - } - /** - * Quit the cluster gracefully. - */ - quit(callback) { - const status = this.status; - this.setStatus("disconnecting"); - this.manuallyClosing = true; - if (this.reconnectTimeout) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - } - this.clearNodesRefreshInterval(); - this.subscriber.stop(); - if (this.options.shardedSubscribers) { - this.shardedSubscribers.stop(); - } - if (status === "wait") { - const ret = (0, standard_as_callback_1.default)(Promise.resolve("OK"), callback); - setImmediate(function() { - this.setStatus("close"); - this.handleCloseEvent(); - }.bind(this)); - return ret; - } - return (0, standard_as_callback_1.default)(Promise.all(this.nodes().map((node) => node.quit().catch((err) => { - if (err.message === utils_1.CONNECTION_CLOSED_ERROR_MSG) { - return "OK"; - } - throw err; - }))).then(() => "OK"), callback); - } - /** - * Create a new instance with the same startup nodes and options as the current one. - * - * @example - * ```js - * var cluster = new Redis.Cluster([{ host: "127.0.0.1", port: "30001" }]); - * var anotherCluster = cluster.duplicate(); - * ``` - */ - duplicate(overrideStartupNodes = [], overrideOptions = {}) { - const startupNodes = overrideStartupNodes.length > 0 ? overrideStartupNodes : this.startupNodes.slice(0); - const options = Object.assign({}, this.options, overrideOptions); - return new _Cluster(startupNodes, options); - } - /** - * Get nodes with the specified role - */ - nodes(role = "all") { - if (role !== "all" && role !== "master" && role !== "slave") { - throw new Error('Invalid role "' + role + '". Expected "all", "master" or "slave"'); - } - return this.connectionPool.getNodes(role); - } - /** - * This is needed in order not to install a listener for each auto pipeline - * - * @ignore - */ - delayUntilReady(callback) { - this._readyDelayedCallbacks.push(callback); - } - /** - * Get the number of commands queued in automatic pipelines. - * - * This is not available (and returns 0) until the cluster is connected and slots information have been received. - */ - get autoPipelineQueueSize() { - let queued = 0; - for (const pipeline of this._autoPipelines.values()) { - queued += pipeline.length; - } - return queued; - } - /** - * Refresh the slot cache - * - * @ignore - */ - refreshSlotsCache(callback) { - if (callback) { - this._refreshSlotsCacheCallbacks.push(callback); - } - if (this.isRefreshing) { - return; - } - this.isRefreshing = true; - const _this = this; - const wrapper = (error) => { - this.isRefreshing = false; - for (const callback2 of this._refreshSlotsCacheCallbacks) { - callback2(error); - } - this._refreshSlotsCacheCallbacks = []; - }; - const nodes = (0, utils_1.shuffle)(this.connectionPool.getNodes()); - let lastNodeError = null; - function tryNode(index) { - if (index === nodes.length) { - const error = new ClusterAllFailedError_1.default(ClusterAllFailedError_1.default.defaultMessage, lastNodeError); - return wrapper(error); - } - const node = nodes[index]; - const key = `${node.options.host}:${node.options.port}`; - debug("getting slot cache from %s", key); - _this.getInfoFromNode(node, function(err) { - switch (_this.status) { - case "close": - case "end": - return wrapper(new Error("Cluster is disconnected.")); - case "disconnecting": - return wrapper(new Error("Cluster is disconnecting.")); - } - if (err) { - _this.emit("node error", err, key); - lastNodeError = err; - tryNode(index + 1); - } else { - _this.emit("refresh"); - wrapper(); - } - }); - } - tryNode(0); - } - /** - * @ignore - */ - sendCommand(command, stream, node) { - if (this.status === "wait") { - this.connect().catch(utils_1.noop); - } - if (this.status === "end") { - command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return command.promise; - } - let to = this.options.scaleReads; - if (to !== "master") { - const isCommandReadOnly = command.isReadOnly || (0, commands_1.exists)(command.name) && (0, commands_1.hasFlag)(command.name, "readonly"); - if (!isCommandReadOnly) { - to = "master"; - } - } - let targetSlot = node ? node.slot : command.getSlot(); - const ttl = {}; - const _this = this; - if (!node && !REJECT_OVERWRITTEN_COMMANDS.has(command)) { - REJECT_OVERWRITTEN_COMMANDS.add(command); - const reject = command.reject; - command.reject = function(err) { - const partialTry = tryConnection.bind(null, true); - _this.handleError(err, ttl, { - moved: function(slot, key) { - debug("command %s is moved to %s", command.name, key); - targetSlot = Number(slot); - if (_this.slots[slot]) { - _this.slots[slot][0] = key; - } else { - _this.slots[slot] = [key]; - } - _this._groupsBySlot[slot] = _this._groupsIds[_this.slots[slot].join(";")]; - _this.connectionPool.findOrCreate(_this.natMapper(key)); - tryConnection(); - debug("refreshing slot caches... (triggered by MOVED error)"); - _this.refreshSlotsCache(); - }, - ask: function(slot, key) { - debug("command %s is required to ask %s:%s", command.name, key); - const mapped = _this.natMapper(key); - _this.connectionPool.findOrCreate(mapped); - tryConnection(false, `${mapped.host}:${mapped.port}`); - }, - tryagain: partialTry, - clusterDown: partialTry, - connectionClosed: partialTry, - maxRedirections: function(redirectionError) { - reject.call(command, redirectionError); - }, - defaults: function() { - reject.call(command, err); - } - }); - }; - } - tryConnection(); - function tryConnection(random, asking) { - if (_this.status === "end") { - command.reject(new redis_errors_1.AbortError("Cluster is ended.")); - return; - } - let redis; - if (_this.status === "ready" || command.name === "cluster") { - if (node && node.redis) { - redis = node.redis; - } else if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", command.name) || Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", command.name)) { - if (_this.options.shardedSubscribers == true && (command.name == "ssubscribe" || command.name == "sunsubscribe")) { - const sub = _this.shardedSubscribers.getResponsibleSubscriber(targetSlot); - let status = -1; - if (command.name == "ssubscribe") - status = _this.shardedSubscribers.addChannels(command.getKeys()); - if (command.name == "sunsubscribe") - status = _this.shardedSubscribers.removeChannels(command.getKeys()); - if (status !== -1) { - redis = sub.getInstance(); - } else { - command.reject(new redis_errors_1.AbortError("Can't add or remove the given channels. Are they in the same slot?")); - } - } else { - redis = _this.subscriber.getInstance(); - } - if (!redis) { - command.reject(new redis_errors_1.AbortError("No subscriber for the cluster")); - return; - } - } else { - if (!random) { - if (typeof targetSlot === "number" && _this.slots[targetSlot]) { - const nodeKeys = _this.slots[targetSlot]; - if (typeof to === "function") { - const nodes = nodeKeys.map(function(key) { - return _this.connectionPool.getInstanceByKey(key); - }); - redis = to(nodes, command); - if (Array.isArray(redis)) { - redis = (0, utils_1.sample)(redis); - } - if (!redis) { - redis = nodes[0]; - } - } else { - let key; - if (to === "all") { - key = (0, utils_1.sample)(nodeKeys); - } else if (to === "slave" && nodeKeys.length > 1) { - key = (0, utils_1.sample)(nodeKeys, 1); - } else { - key = nodeKeys[0]; - } - redis = _this.connectionPool.getInstanceByKey(key); - } - } - if (asking) { - redis = _this.connectionPool.getInstanceByKey(asking); - redis.asking(); - } - } - if (!redis) { - redis = (typeof to === "function" ? null : _this.connectionPool.getSampleInstance(to)) || _this.connectionPool.getSampleInstance("all"); - } - } - if (node && !node.redis) { - node.redis = redis; - } - } - if (redis) { - redis.sendCommand(command, stream); - } else if (_this.options.enableOfflineQueue) { - _this.offlineQueue.push({ - command, - stream, - node - }); - } else { - command.reject(new Error("Cluster isn't ready and enableOfflineQueue options is false")); - } - } - return command.promise; - } - sscanStream(key, options) { - return this.createScanStream("sscan", { key, options }); - } - sscanBufferStream(key, options) { - return this.createScanStream("sscanBuffer", { key, options }); - } - hscanStream(key, options) { - return this.createScanStream("hscan", { key, options }); - } - hscanBufferStream(key, options) { - return this.createScanStream("hscanBuffer", { key, options }); - } - zscanStream(key, options) { - return this.createScanStream("zscan", { key, options }); - } - zscanBufferStream(key, options) { - return this.createScanStream("zscanBuffer", { key, options }); - } - /** - * @ignore - */ - handleError(error, ttl, handlers) { - if (typeof ttl.value === "undefined") { - ttl.value = this.options.maxRedirections; - } else { - ttl.value -= 1; - } - if (ttl.value <= 0) { - handlers.maxRedirections(new Error("Too many Cluster redirections. Last error: " + error)); - return; - } - const errv = error.message.split(" "); - if (errv[0] === "MOVED") { - const timeout = this.options.retryDelayOnMoved; - if (timeout && typeof timeout === "number") { - this.delayQueue.push("moved", handlers.moved.bind(null, errv[1], errv[2]), { timeout }); - } else { - handlers.moved(errv[1], errv[2]); - } - } else if (errv[0] === "ASK") { - handlers.ask(errv[1], errv[2]); - } else if (errv[0] === "TRYAGAIN") { - this.delayQueue.push("tryagain", handlers.tryagain, { - timeout: this.options.retryDelayOnTryAgain - }); - } else if (errv[0] === "CLUSTERDOWN" && this.options.retryDelayOnClusterDown > 0) { - this.delayQueue.push("clusterdown", handlers.connectionClosed, { - timeout: this.options.retryDelayOnClusterDown, - callback: this.refreshSlotsCache.bind(this) - }); - } else if (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG && this.options.retryDelayOnFailover > 0 && this.status === "ready") { - this.delayQueue.push("failover", handlers.connectionClosed, { - timeout: this.options.retryDelayOnFailover, - callback: this.refreshSlotsCache.bind(this) - }); - } else { - handlers.defaults(); - } - } - resetOfflineQueue() { - this.offlineQueue = new Deque(); - } - clearNodesRefreshInterval() { - if (this.slotsTimer) { - clearTimeout(this.slotsTimer); - this.slotsTimer = null; - } - } - resetNodesRefreshInterval() { - if (this.slotsTimer || !this.options.slotsRefreshInterval) { - return; - } - const nextRound = () => { - this.slotsTimer = setTimeout(() => { - debug('refreshing slot caches... (triggered by "slotsRefreshInterval" option)'); - this.refreshSlotsCache(() => { - nextRound(); - }); - }, this.options.slotsRefreshInterval); - }; - nextRound(); - } - /** - * Change cluster instance's status - */ - setStatus(status) { - debug("status: %s -> %s", this.status || "[empty]", status); - this.status = status; - process.nextTick(() => { - this.emit(status); - }); - } - /** - * Called when closed to check whether a reconnection should be made - */ - handleCloseEvent(reason) { - if (reason) { - debug("closed because %s", reason); - } - let retryDelay; - if (!this.manuallyClosing && typeof this.options.clusterRetryStrategy === "function") { - retryDelay = this.options.clusterRetryStrategy.call(this, ++this.retryAttempts, reason); - } - if (typeof retryDelay === "number") { - this.setStatus("reconnecting"); - this.reconnectTimeout = setTimeout(() => { - this.reconnectTimeout = null; - debug("Cluster is disconnected. Retrying after %dms", retryDelay); - this.connect().catch(function(err) { - debug("Got error %s when reconnecting. Ignoring...", err); - }); - }, retryDelay); - } else { - this.setStatus("end"); - this.flushQueue(new Error("None of startup nodes is available")); - } - } - /** - * Flush offline queue with error. - */ - flushQueue(error) { - let item; - while (item = this.offlineQueue.shift()) { - item.command.reject(error); - } - } - executeOfflineCommands() { - if (this.offlineQueue.length) { - debug("send %d commands in offline queue", this.offlineQueue.length); - const offlineQueue = this.offlineQueue; - this.resetOfflineQueue(); - let item; - while (item = offlineQueue.shift()) { - this.sendCommand(item.command, item.stream, item.node); - } - } - } - natMapper(nodeKey) { - const key = typeof nodeKey === "string" ? nodeKey : `${nodeKey.host}:${nodeKey.port}`; - let mapped = null; - if (this.options.natMap && typeof this.options.natMap === "function") { - mapped = this.options.natMap(key); - } else if (this.options.natMap && typeof this.options.natMap === "object") { - mapped = this.options.natMap[key]; - } - if (mapped) { - debug("NAT mapping %s -> %O", key, mapped); - return Object.assign({}, mapped); - } - return typeof nodeKey === "string" ? (0, util_1.nodeKeyToRedisOptions)(nodeKey) : nodeKey; - } - getInfoFromNode(redis, callback) { - if (!redis) { - return callback(new Error("Node is disconnected")); - } - const duplicatedConnection = redis.duplicate({ - enableOfflineQueue: true, - enableReadyCheck: false, - retryStrategy: null, - connectionName: (0, util_1.getConnectionName)("refresher", this.options.redisOptions && this.options.redisOptions.connectionName) - }); - duplicatedConnection.on("error", utils_1.noop); - duplicatedConnection.cluster("SLOTS", (0, utils_1.timeout)((err, result) => { - duplicatedConnection.disconnect(); - if (err) { - debug("error encountered running CLUSTER.SLOTS: %s", err); - return callback(err); - } - if (this.status === "disconnecting" || this.status === "close" || this.status === "end") { - debug("ignore CLUSTER.SLOTS results (count: %d) since cluster status is %s", result.length, this.status); - callback(); - return; - } - const nodes = []; - debug("cluster slots result count: %d", result.length); - for (let i = 0; i < result.length; ++i) { - const items = result[i]; - const slotRangeStart = items[0]; - const slotRangeEnd = items[1]; - const keys = []; - for (let j2 = 2; j2 < items.length; j2++) { - if (!items[j2][0]) { - continue; - } - const node = this.natMapper({ - host: items[j2][0], - port: items[j2][1] - }); - node.readOnly = j2 !== 2; - nodes.push(node); - keys.push(node.host + ":" + node.port); - } - debug("cluster slots result [%d]: slots %d~%d served by %s", i, slotRangeStart, slotRangeEnd, keys); - for (let slot = slotRangeStart; slot <= slotRangeEnd; slot++) { - this.slots[slot] = keys; - } - } - this._groupsIds = /* @__PURE__ */ Object.create(null); - let j = 0; - for (let i = 0; i < 16384; i++) { - const target = (this.slots[i] || []).join(";"); - if (!target.length) { - this._groupsBySlot[i] = void 0; - continue; - } - if (!this._groupsIds[target]) { - this._groupsIds[target] = ++j; - } - this._groupsBySlot[i] = this._groupsIds[target]; - } - this.connectionPool.reset(nodes); - callback(); - }, this.options.slotsRefreshTimeout)); - } - invokeReadyDelayedCallbacks(err) { - for (const c of this._readyDelayedCallbacks) { - process.nextTick(c, err); - } - this._readyDelayedCallbacks = []; - } - /** - * Check whether Cluster is able to process commands - */ - readyCheck(callback) { - this.cluster("INFO", (err, res) => { - if (err) { - return callback(err); - } - if (typeof res !== "string") { - return callback(); - } - let state; - const lines = res.split("\r\n"); - for (let i = 0; i < lines.length; ++i) { - const parts = lines[i].split(":"); - if (parts[0] === "cluster_state") { - state = parts[1]; - break; - } - } - if (state === "fail") { - debug("cluster state not ok (%s)", state); - callback(null, state); - } else { - callback(); - } - }); - } - resolveSrv(hostname) { - return new Promise((resolve2, reject) => { - this.options.resolveSrv(hostname, (err, records) => { - if (err) { - return reject(err); - } - const self2 = this, groupedRecords = (0, util_1.groupSrvRecords)(records), sortedKeys = Object.keys(groupedRecords).sort((a, b) => parseInt(a) - parseInt(b)); - function tryFirstOne(err2) { - if (!sortedKeys.length) { - return reject(err2); - } - const key = sortedKeys[0], group = groupedRecords[key], record = (0, util_1.weightSrvRecords)(group); - if (!group.records.length) { - sortedKeys.shift(); - } - self2.dnsLookup(record.name).then((host) => resolve2({ - host, - port: record.port - }), tryFirstOne); - } - tryFirstOne(); - }); - }); - } - dnsLookup(hostname) { - return new Promise((resolve2, reject) => { - this.options.dnsLookup(hostname, (err, address) => { - if (err) { - debug("failed to resolve hostname %s to IP: %s", hostname, err.message); - reject(err); - } else { - debug("resolved hostname %s to IP %s", hostname, address); - resolve2(address); - } - }); - }); - } - /** - * Normalize startup nodes, and resolving hostnames to IPs. - * - * This process happens every time when #connect() is called since - * #startupNodes and DNS records may change. - */ - async resolveStartupNodeHostnames() { - if (!Array.isArray(this.startupNodes) || this.startupNodes.length === 0) { - throw new Error("`startupNodes` should contain at least one node."); - } - const startupNodes = (0, util_1.normalizeNodeOptions)(this.startupNodes); - const hostnames = (0, util_1.getUniqueHostnamesFromOptions)(startupNodes); - if (hostnames.length === 0) { - return startupNodes; - } - const configs = await Promise.all(hostnames.map((this.options.useSRVRecords ? this.resolveSrv : this.dnsLookup).bind(this))); - const hostnameToConfig = (0, utils_1.zipMap)(hostnames, configs); - return startupNodes.map((node) => { - const config = hostnameToConfig.get(node.host); - if (!config) { - return node; - } - if (this.options.useSRVRecords) { - return Object.assign({}, node, config); - } - return Object.assign({}, node, { host: config }); - }); - } - createScanStream(command, { key, options = {} }) { - return new ScanStream_1.default({ - objectMode: true, - key, - redis: this, - command, - ...options - }); - } - }; - (0, applyMixin_1.default)(Cluster, events_1.EventEmitter); - (0, transaction_1.addTransactionSupport)(Cluster.prototype); - exports2.default = Cluster; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js -var require_AbstractConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/AbstractConnector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var utils_1 = require_utils2(); - var debug = (0, utils_1.Debug)("AbstractConnector"); - var AbstractConnector = class { - constructor(disconnectTimeout) { - this.connecting = false; - this.disconnectTimeout = disconnectTimeout; - } - check(info) { - return true; - } - disconnect() { - this.connecting = false; - if (this.stream) { - const stream = this.stream; - const timeout = setTimeout(() => { - debug("stream %s:%s still open, destroying it", stream.remoteAddress, stream.remotePort); - stream.destroy(); - }, this.disconnectTimeout); - stream.on("close", () => clearTimeout(timeout)); - stream.end(); - } - } - }; - exports2.default = AbstractConnector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js -var require_StandaloneConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/StandaloneConnector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var net_1 = require("net"); - var tls_1 = require("tls"); - var utils_1 = require_utils2(); - var AbstractConnector_1 = require_AbstractConnector(); - var StandaloneConnector = class extends AbstractConnector_1.default { - constructor(options) { - super(options.disconnectTimeout); - this.options = options; - } - connect(_) { - const { options } = this; - this.connecting = true; - let connectionOptions; - if ("path" in options && options.path) { - connectionOptions = { - path: options.path - }; - } else { - connectionOptions = {}; - if ("port" in options && options.port != null) { - connectionOptions.port = options.port; - } - if ("host" in options && options.host != null) { - connectionOptions.host = options.host; - } - if ("family" in options && options.family != null) { - connectionOptions.family = options.family; - } - } - if (options.tls) { - Object.assign(connectionOptions, options.tls); - } - return new Promise((resolve2, reject) => { - process.nextTick(() => { - if (!this.connecting) { - reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return; - } - try { - if (options.tls) { - this.stream = (0, tls_1.connect)(connectionOptions); - } else { - this.stream = (0, net_1.createConnection)(connectionOptions); - } - } catch (err) { - reject(err); - return; - } - this.stream.once("error", (err) => { - this.firstError = err; - }); - resolve2(this.stream); - }); - }); - } - }; - exports2.default = StandaloneConnector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js -var require_SentinelIterator = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function isSentinelEql(a, b) { - return (a.host || "127.0.0.1") === (b.host || "127.0.0.1") && (a.port || 26379) === (b.port || 26379); - } - var SentinelIterator = class { - constructor(sentinels) { - this.cursor = 0; - this.sentinels = sentinels.slice(0); - } - next() { - const done = this.cursor >= this.sentinels.length; - return { done, value: done ? void 0 : this.sentinels[this.cursor++] }; - } - reset(moveCurrentEndpointToFirst) { - if (moveCurrentEndpointToFirst && this.sentinels.length > 1 && this.cursor !== 1) { - this.sentinels.unshift(...this.sentinels.splice(this.cursor - 1)); - } - this.cursor = 0; - } - add(sentinel) { - for (let i = 0; i < this.sentinels.length; i++) { - if (isSentinelEql(sentinel, this.sentinels[i])) { - return false; - } - } - this.sentinels.push(sentinel); - return true; - } - toString() { - return `${JSON.stringify(this.sentinels)} @${this.cursor}`; - } - }; - exports2.default = SentinelIterator; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js -var require_FailoverDetector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.FailoverDetector = void 0; - var utils_1 = require_utils2(); - var debug = (0, utils_1.Debug)("FailoverDetector"); - var CHANNEL_NAME = "+switch-master"; - var FailoverDetector = class { - // sentinels can't be used for regular commands after this - constructor(connector, sentinels) { - this.isDisconnected = false; - this.connector = connector; - this.sentinels = sentinels; - } - cleanup() { - this.isDisconnected = true; - for (const sentinel of this.sentinels) { - sentinel.client.disconnect(); - } - } - async subscribe() { - debug("Starting FailoverDetector"); - const promises2 = []; - for (const sentinel of this.sentinels) { - const promise = sentinel.client.subscribe(CHANNEL_NAME).catch((err) => { - debug("Failed to subscribe to failover messages on sentinel %s:%s (%s)", sentinel.address.host || "127.0.0.1", sentinel.address.port || 26739, err.message); - }); - promises2.push(promise); - sentinel.client.on("message", (channel) => { - if (!this.isDisconnected && channel === CHANNEL_NAME) { - this.disconnect(); - } - }); - } - await Promise.all(promises2); - } - disconnect() { - this.isDisconnected = true; - debug("Failover detected, disconnecting"); - this.connector.disconnect(); - } - }; - exports2.FailoverDetector = FailoverDetector; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js -var require_SentinelConnector = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/SentinelConnector/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SentinelIterator = void 0; - var net_1 = require("net"); - var utils_1 = require_utils2(); - var tls_1 = require("tls"); - var SentinelIterator_1 = require_SentinelIterator(); - exports2.SentinelIterator = SentinelIterator_1.default; - var AbstractConnector_1 = require_AbstractConnector(); - var Redis_1 = require_Redis(); - var FailoverDetector_1 = require_FailoverDetector(); - var debug = (0, utils_1.Debug)("SentinelConnector"); - var SentinelConnector = class extends AbstractConnector_1.default { - constructor(options) { - super(options.disconnectTimeout); - this.options = options; - this.emitter = null; - this.failoverDetector = null; - if (!this.options.sentinels.length) { - throw new Error("Requires at least one sentinel to connect to."); - } - if (!this.options.name) { - throw new Error("Requires the name of master."); - } - this.sentinelIterator = new SentinelIterator_1.default(this.options.sentinels); - } - check(info) { - const roleMatches = !info.role || this.options.role === info.role; - if (!roleMatches) { - debug("role invalid, expected %s, but got %s", this.options.role, info.role); - this.sentinelIterator.next(); - this.sentinelIterator.next(); - this.sentinelIterator.reset(true); - } - return roleMatches; - } - disconnect() { - super.disconnect(); - if (this.failoverDetector) { - this.failoverDetector.cleanup(); - } - } - connect(eventEmitter) { - this.connecting = true; - this.retryAttempts = 0; - let lastError; - const connectToNext = async () => { - const endpoint = this.sentinelIterator.next(); - if (endpoint.done) { - this.sentinelIterator.reset(false); - const retryDelay = typeof this.options.sentinelRetryStrategy === "function" ? this.options.sentinelRetryStrategy(++this.retryAttempts) : null; - let errorMsg = typeof retryDelay !== "number" ? "All sentinels are unreachable and retry is disabled." : `All sentinels are unreachable. Retrying from scratch after ${retryDelay}ms.`; - if (lastError) { - errorMsg += ` Last error: ${lastError.message}`; - } - debug(errorMsg); - const error = new Error(errorMsg); - if (typeof retryDelay === "number") { - eventEmitter("error", error); - await new Promise((resolve2) => setTimeout(resolve2, retryDelay)); - return connectToNext(); - } else { - throw error; - } - } - let resolved = null; - let err = null; - try { - resolved = await this.resolve(endpoint.value); - } catch (error) { - err = error; - } - if (!this.connecting) { - throw new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG); - } - const endpointAddress = endpoint.value.host + ":" + endpoint.value.port; - if (resolved) { - debug("resolved: %s:%s from sentinel %s", resolved.host, resolved.port, endpointAddress); - if (this.options.enableTLSForSentinelMode && this.options.tls) { - Object.assign(resolved, this.options.tls); - this.stream = (0, tls_1.connect)(resolved); - this.stream.once("secureConnect", this.initFailoverDetector.bind(this)); - } else { - this.stream = (0, net_1.createConnection)(resolved); - this.stream.once("connect", this.initFailoverDetector.bind(this)); - } - this.stream.once("error", (err2) => { - this.firstError = err2; - }); - return this.stream; - } else { - const errorMsg = err ? "failed to connect to sentinel " + endpointAddress + " because " + err.message : "connected to sentinel " + endpointAddress + " successfully, but got an invalid reply: " + resolved; - debug(errorMsg); - eventEmitter("sentinelError", new Error(errorMsg)); - if (err) { - lastError = err; - } - return connectToNext(); - } - }; - return connectToNext(); - } - async updateSentinels(client) { - if (!this.options.updateSentinels) { - return; - } - const result = await client.sentinel("sentinels", this.options.name); - if (!Array.isArray(result)) { - return; - } - result.map(utils_1.packObject).forEach((sentinel) => { - const flags = sentinel.flags ? sentinel.flags.split(",") : []; - if (flags.indexOf("disconnected") === -1 && sentinel.ip && sentinel.port) { - const endpoint = this.sentinelNatResolve(addressResponseToAddress(sentinel)); - if (this.sentinelIterator.add(endpoint)) { - debug("adding sentinel %s:%s", endpoint.host, endpoint.port); - } - } - }); - debug("Updated internal sentinels: %s", this.sentinelIterator); - } - async resolveMaster(client) { - const result = await client.sentinel("get-master-addr-by-name", this.options.name); - await this.updateSentinels(client); - return this.sentinelNatResolve(Array.isArray(result) ? { host: result[0], port: Number(result[1]) } : null); - } - async resolveSlave(client) { - const result = await client.sentinel("slaves", this.options.name); - if (!Array.isArray(result)) { - return null; - } - const availableSlaves = result.map(utils_1.packObject).filter((slave) => slave.flags && !slave.flags.match(/(disconnected|s_down|o_down)/)); - return this.sentinelNatResolve(selectPreferredSentinel(availableSlaves, this.options.preferredSlaves)); - } - sentinelNatResolve(item) { - if (!item || !this.options.natMap) - return item; - const key = `${item.host}:${item.port}`; - let result = item; - if (typeof this.options.natMap === "function") { - result = this.options.natMap(key) || item; - } else if (typeof this.options.natMap === "object") { - result = this.options.natMap[key] || item; - } - return result; - } - connectToSentinel(endpoint, options) { - const redis = new Redis_1.default({ - port: endpoint.port || 26379, - host: endpoint.host, - username: this.options.sentinelUsername || null, - password: this.options.sentinelPassword || null, - family: endpoint.family || // @ts-expect-error - ("path" in this.options && this.options.path ? void 0 : ( - // @ts-expect-error - this.options.family - )), - tls: this.options.sentinelTLS, - retryStrategy: null, - enableReadyCheck: false, - connectTimeout: this.options.connectTimeout, - commandTimeout: this.options.sentinelCommandTimeout, - ...options - }); - return redis; - } - async resolve(endpoint) { - const client = this.connectToSentinel(endpoint); - client.on("error", noop); - try { - if (this.options.role === "slave") { - return await this.resolveSlave(client); - } else { - return await this.resolveMaster(client); - } - } finally { - client.disconnect(); - } - } - async initFailoverDetector() { - var _a; - if (!this.options.failoverDetector) { - return; - } - this.sentinelIterator.reset(true); - const sentinels = []; - while (sentinels.length < this.options.sentinelMaxConnections) { - const { done, value } = this.sentinelIterator.next(); - if (done) { - break; - } - const client = this.connectToSentinel(value, { - lazyConnect: true, - retryStrategy: this.options.sentinelReconnectStrategy - }); - client.on("reconnecting", () => { - var _a2; - (_a2 = this.emitter) === null || _a2 === void 0 ? void 0 : _a2.emit("sentinelReconnecting"); - }); - sentinels.push({ address: value, client }); - } - this.sentinelIterator.reset(false); - if (this.failoverDetector) { - this.failoverDetector.cleanup(); - } - this.failoverDetector = new FailoverDetector_1.FailoverDetector(this, sentinels); - await this.failoverDetector.subscribe(); - (_a = this.emitter) === null || _a === void 0 ? void 0 : _a.emit("failoverSubscribed"); - } - }; - exports2.default = SentinelConnector; - function selectPreferredSentinel(availableSlaves, preferredSlaves) { - if (availableSlaves.length === 0) { - return null; - } - let selectedSlave; - if (typeof preferredSlaves === "function") { - selectedSlave = preferredSlaves(availableSlaves); - } else if (preferredSlaves !== null && typeof preferredSlaves === "object") { - const preferredSlavesArray = Array.isArray(preferredSlaves) ? preferredSlaves : [preferredSlaves]; - preferredSlavesArray.sort((a, b) => { - if (!a.prio) { - a.prio = 1; - } - if (!b.prio) { - b.prio = 1; - } - if (a.prio < b.prio) { - return -1; - } - if (a.prio > b.prio) { - return 1; - } - return 0; - }); - for (let p = 0; p < preferredSlavesArray.length; p++) { - for (let a = 0; a < availableSlaves.length; a++) { - const slave = availableSlaves[a]; - if (slave.ip === preferredSlavesArray[p].ip) { - if (slave.port === preferredSlavesArray[p].port) { - selectedSlave = slave; - break; - } - } - } - if (selectedSlave) { - break; - } - } - } - if (!selectedSlave) { - selectedSlave = (0, utils_1.sample)(availableSlaves); - } - return addressResponseToAddress(selectedSlave); - } - function addressResponseToAddress(input) { - return { host: input.ip, port: Number(input.port) }; - } - function noop() { - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js -var require_connectors = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/connectors/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SentinelConnector = exports2.StandaloneConnector = void 0; - var StandaloneConnector_1 = require_StandaloneConnector(); - exports2.StandaloneConnector = StandaloneConnector_1.default; - var SentinelConnector_1 = require_SentinelConnector(); - exports2.SentinelConnector = SentinelConnector_1.default; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js -var require_MaxRetriesPerRequestError = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var redis_errors_1 = require_redis_errors(); - var MaxRetriesPerRequestError = class extends redis_errors_1.AbortError { - constructor(maxRetriesPerRequest) { - const message = `Reached the max retries per request limit (which is ${maxRetriesPerRequest}). Refer to "maxRetriesPerRequest" option for details.`; - super(message); - Error.captureStackTrace(this, this.constructor); - } - get name() { - return this.constructor.name; - } - }; - exports2.default = MaxRetriesPerRequestError; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js -var require_errors = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/errors/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MaxRetriesPerRequestError = void 0; - var MaxRetriesPerRequestError_1 = require_MaxRetriesPerRequestError(); - exports2.MaxRetriesPerRequestError = MaxRetriesPerRequestError_1.default; - } -}); - -// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js -var require_parser = __commonJS({ - "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js"(exports2, module2) { - "use strict"; - var Buffer2 = require("buffer").Buffer; - var StringDecoder = require("string_decoder").StringDecoder; - var decoder = new StringDecoder(); - var errors = require_redis_errors(); - var ReplyError = errors.ReplyError; - var ParserError = errors.ParserError; - var bufferPool = Buffer2.allocUnsafe(32 * 1024); - var bufferOffset = 0; - var interval = null; - var counter = 0; - var notDecreased = 0; - function parseSimpleNumbers(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - var sign = 1; - if (parser.buffer[offset] === 45) { - sign = -1; - offset++; - } - while (offset < length) { - const c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - return sign * number; - } - number = number * 10 + (c1 - 48); - } - } - function parseStringNumbers(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - var res = ""; - if (parser.buffer[offset] === 45) { - res += "-"; - offset++; - } - while (offset < length) { - var c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - if (number !== 0) { - res += number; - } - return res; - } else if (number > 429496728) { - res += number * 10 + (c1 - 48); - number = 0; - } else if (c1 === 48 && number === 0) { - res += 0; - } else { - number = number * 10 + (c1 - 48); - } - } - } - function parseSimpleString(parser) { - const start = parser.offset; - const buffer = parser.buffer; - const length = buffer.length - 1; - var offset = start; - while (offset < length) { - if (buffer[offset++] === 13) { - parser.offset = offset + 1; - if (parser.optionReturnBuffers === true) { - return parser.buffer.slice(start, offset - 1); - } - return parser.buffer.toString("utf8", start, offset - 1); - } - } - } - function parseLength(parser) { - const length = parser.buffer.length - 1; - var offset = parser.offset; - var number = 0; - while (offset < length) { - const c1 = parser.buffer[offset++]; - if (c1 === 13) { - parser.offset = offset + 1; - return number; - } - number = number * 10 + (c1 - 48); - } - } - function parseInteger(parser) { - if (parser.optionStringNumbers === true) { - return parseStringNumbers(parser); - } - return parseSimpleNumbers(parser); - } - function parseBulkString(parser) { - const length = parseLength(parser); - if (length === void 0) { - return; - } - if (length < 0) { - return null; - } - const offset = parser.offset + length; - if (offset + 2 > parser.buffer.length) { - parser.bigStrSize = offset + 2; - parser.totalChunkSize = parser.buffer.length; - parser.bufferCache.push(parser.buffer); - return; - } - const start = parser.offset; - parser.offset = offset + 2; - if (parser.optionReturnBuffers === true) { - return parser.buffer.slice(start, offset); - } - return parser.buffer.toString("utf8", start, offset); - } - function parseError(parser) { - var string = parseSimpleString(parser); - if (string !== void 0) { - if (parser.optionReturnBuffers === true) { - string = string.toString(); - } - return new ReplyError(string); - } - } - function handleError(parser, type) { - const err = new ParserError( - "Protocol error, got " + JSON.stringify(String.fromCharCode(type)) + " as reply type byte", - JSON.stringify(parser.buffer), - parser.offset - ); - parser.buffer = null; - parser.returnFatalError(err); - } - function parseArray(parser) { - const length = parseLength(parser); - if (length === void 0) { - return; - } - if (length < 0) { - return null; - } - const responses = new Array(length); - return parseArrayElements(parser, responses, 0); - } - function pushArrayCache(parser, array, pos) { - parser.arrayCache.push(array); - parser.arrayPos.push(pos); - } - function parseArrayChunks(parser) { - const tmp = parser.arrayCache.pop(); - var pos = parser.arrayPos.pop(); - if (parser.arrayCache.length) { - const res = parseArrayChunks(parser); - if (res === void 0) { - pushArrayCache(parser, tmp, pos); - return; - } - tmp[pos++] = res; - } - return parseArrayElements(parser, tmp, pos); - } - function parseArrayElements(parser, responses, i) { - const bufferLength = parser.buffer.length; - while (i < responses.length) { - const offset = parser.offset; - if (parser.offset >= bufferLength) { - pushArrayCache(parser, responses, i); - return; - } - const response = parseType(parser, parser.buffer[parser.offset++]); - if (response === void 0) { - if (!(parser.arrayCache.length || parser.bufferCache.length)) { - parser.offset = offset; - } - pushArrayCache(parser, responses, i); - return; - } - responses[i] = response; - i++; - } - return responses; - } - function parseType(parser, type) { - switch (type) { - case 36: - return parseBulkString(parser); - case 43: - return parseSimpleString(parser); - case 42: - return parseArray(parser); - case 58: - return parseInteger(parser); - case 45: - return parseError(parser); - default: - return handleError(parser, type); - } - } - function decreaseBufferPool() { - if (bufferPool.length > 50 * 1024) { - if (counter === 1 || notDecreased > counter * 2) { - const minSliceLen = Math.floor(bufferPool.length / 10); - const sliceLength = minSliceLen < bufferOffset ? bufferOffset : minSliceLen; - bufferOffset = 0; - bufferPool = bufferPool.slice(sliceLength, bufferPool.length); - } else { - notDecreased++; - counter--; - } - } else { - clearInterval(interval); - counter = 0; - notDecreased = 0; - interval = null; - } - } - function resizeBuffer(length) { - if (bufferPool.length < length + bufferOffset) { - const multiplier = length > 1024 * 1024 * 75 ? 2 : 3; - if (bufferOffset > 1024 * 1024 * 111) { - bufferOffset = 1024 * 1024 * 50; - } - bufferPool = Buffer2.allocUnsafe(length * multiplier + bufferOffset); - bufferOffset = 0; - counter++; - if (interval === null) { - interval = setInterval(decreaseBufferPool, 50); - } - } - } - function concatBulkString(parser) { - const list = parser.bufferCache; - const oldOffset = parser.offset; - var chunks = list.length; - var offset = parser.bigStrSize - parser.totalChunkSize; - parser.offset = offset; - if (offset <= 2) { - if (chunks === 2) { - return list[0].toString("utf8", oldOffset, list[0].length + offset - 2); - } - chunks--; - offset = list[list.length - 2].length + offset; - } - var res = decoder.write(list[0].slice(oldOffset)); - for (var i = 1; i < chunks - 1; i++) { - res += decoder.write(list[i]); - } - res += decoder.end(list[i].slice(0, offset - 2)); - return res; - } - function concatBulkBuffer(parser) { - const list = parser.bufferCache; - const oldOffset = parser.offset; - const length = parser.bigStrSize - oldOffset - 2; - var chunks = list.length; - var offset = parser.bigStrSize - parser.totalChunkSize; - parser.offset = offset; - if (offset <= 2) { - if (chunks === 2) { - return list[0].slice(oldOffset, list[0].length + offset - 2); - } - chunks--; - offset = list[list.length - 2].length + offset; - } - resizeBuffer(length); - const start = bufferOffset; - list[0].copy(bufferPool, start, oldOffset, list[0].length); - bufferOffset += list[0].length - oldOffset; - for (var i = 1; i < chunks - 1; i++) { - list[i].copy(bufferPool, bufferOffset); - bufferOffset += list[i].length; - } - list[i].copy(bufferPool, bufferOffset, 0, offset - 2); - bufferOffset += offset - 2; - return bufferPool.slice(start, bufferOffset); - } - var JavascriptRedisParser = class { - /** - * Javascript Redis Parser constructor - * @param {{returnError: Function, returnReply: Function, returnFatalError?: Function, returnBuffers: boolean, stringNumbers: boolean }} options - * @constructor - */ - constructor(options) { - if (!options) { - throw new TypeError("Options are mandatory."); - } - if (typeof options.returnError !== "function" || typeof options.returnReply !== "function") { - throw new TypeError("The returnReply and returnError options have to be functions."); - } - this.setReturnBuffers(!!options.returnBuffers); - this.setStringNumbers(!!options.stringNumbers); - this.returnError = options.returnError; - this.returnFatalError = options.returnFatalError || options.returnError; - this.returnReply = options.returnReply; - this.reset(); - } - /** - * Reset the parser values to the initial state - * - * @returns {undefined} - */ - reset() { - this.offset = 0; - this.buffer = null; - this.bigStrSize = 0; - this.totalChunkSize = 0; - this.bufferCache = []; - this.arrayCache = []; - this.arrayPos = []; - } - /** - * Set the returnBuffers option - * - * @param {boolean} returnBuffers - * @returns {undefined} - */ - setReturnBuffers(returnBuffers) { - if (typeof returnBuffers !== "boolean") { - throw new TypeError("The returnBuffers argument has to be a boolean"); - } - this.optionReturnBuffers = returnBuffers; - } - /** - * Set the stringNumbers option - * - * @param {boolean} stringNumbers - * @returns {undefined} - */ - setStringNumbers(stringNumbers) { - if (typeof stringNumbers !== "boolean") { - throw new TypeError("The stringNumbers argument has to be a boolean"); - } - this.optionStringNumbers = stringNumbers; - } - /** - * Parse the redis buffer - * @param {Buffer} buffer - * @returns {undefined} - */ - execute(buffer) { - if (this.buffer === null) { - this.buffer = buffer; - this.offset = 0; - } else if (this.bigStrSize === 0) { - const oldLength = this.buffer.length; - const remainingLength = oldLength - this.offset; - const newBuffer = Buffer2.allocUnsafe(remainingLength + buffer.length); - this.buffer.copy(newBuffer, 0, this.offset, oldLength); - buffer.copy(newBuffer, remainingLength, 0, buffer.length); - this.buffer = newBuffer; - this.offset = 0; - if (this.arrayCache.length) { - const arr = parseArrayChunks(this); - if (arr === void 0) { - return; - } - this.returnReply(arr); - } - } else if (this.totalChunkSize + buffer.length >= this.bigStrSize) { - this.bufferCache.push(buffer); - var tmp = this.optionReturnBuffers ? concatBulkBuffer(this) : concatBulkString(this); - this.bigStrSize = 0; - this.bufferCache = []; - this.buffer = buffer; - if (this.arrayCache.length) { - this.arrayCache[0][this.arrayPos[0]++] = tmp; - tmp = parseArrayChunks(this); - if (tmp === void 0) { - return; - } - } - this.returnReply(tmp); - } else { - this.bufferCache.push(buffer); - this.totalChunkSize += buffer.length; - return; - } - while (this.offset < this.buffer.length) { - const offset = this.offset; - const type = this.buffer[this.offset++]; - const response = parseType(this, type); - if (response === void 0) { - if (!(this.arrayCache.length || this.bufferCache.length)) { - this.offset = offset; - } - return; - } - if (type === 45) { - this.returnError(response); - } else { - this.returnReply(response); - } - } - this.buffer = null; - } - }; - module2.exports = JavascriptRedisParser; - } -}); - -// node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js -var require_redis_parser = __commonJS({ - "node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/index.js"(exports2, module2) { - "use strict"; - module2.exports = require_parser(); - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js -var require_SubscriptionSet = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/SubscriptionSet.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var SubscriptionSet = class { - constructor() { - this.set = { - subscribe: {}, - psubscribe: {}, - ssubscribe: {} - }; - } - add(set, channel) { - this.set[mapSet(set)][channel] = true; - } - del(set, channel) { - delete this.set[mapSet(set)][channel]; - } - channels(set) { - return Object.keys(this.set[mapSet(set)]); - } - isEmpty() { - return this.channels("subscribe").length === 0 && this.channels("psubscribe").length === 0 && this.channels("ssubscribe").length === 0; - } - }; - exports2.default = SubscriptionSet; - function mapSet(set) { - if (set === "unsubscribe") { - return "subscribe"; - } - if (set === "punsubscribe") { - return "psubscribe"; - } - if (set === "sunsubscribe") { - return "ssubscribe"; - } - return set; - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js -var require_DataHandler = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/DataHandler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var Command_1 = require_Command(); - var utils_1 = require_utils2(); - var RedisParser = require_redis_parser(); - var SubscriptionSet_1 = require_SubscriptionSet(); - var debug = (0, utils_1.Debug)("dataHandler"); - var DataHandler = class { - constructor(redis, parserOptions) { - this.redis = redis; - const parser = new RedisParser({ - stringNumbers: parserOptions.stringNumbers, - returnBuffers: true, - returnError: (err) => { - this.returnError(err); - }, - returnFatalError: (err) => { - this.returnFatalError(err); - }, - returnReply: (reply) => { - this.returnReply(reply); - } - }); - redis.stream.prependListener("data", (data) => { - parser.execute(data); - }); - redis.stream.resume(); - } - returnFatalError(err) { - err.message += ". Please report this."; - this.redis.recoverFromFatalError(err, err, { offlineQueue: false }); - } - returnError(err) { - const item = this.shiftCommand(err); - if (!item) { - return; - } - err.command = { - name: item.command.name, - args: item.command.args - }; - if (item.command.name == "ssubscribe" && err.message.includes("MOVED")) { - this.redis.emit("moved"); - return; - } - this.redis.handleReconnection(err, item); - } - returnReply(reply) { - if (this.handleMonitorReply(reply)) { - return; - } - if (this.handleSubscriberReply(reply)) { - return; - } - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (Command_1.default.checkFlag("ENTER_SUBSCRIBER_MODE", item.command.name)) { - this.redis.condition.subscriber = new SubscriptionSet_1.default(); - this.redis.condition.subscriber.add(item.command.name, reply[1].toString()); - if (!fillSubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - } else if (Command_1.default.checkFlag("EXIT_SUBSCRIBER_MODE", item.command.name)) { - if (!fillUnsubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - } else { - item.command.resolve(reply); - } - } - handleSubscriberReply(reply) { - if (!this.redis.condition.subscriber) { - return false; - } - const replyType = Array.isArray(reply) ? reply[0].toString() : null; - debug('receive reply "%s" in subscriber mode', replyType); - switch (replyType) { - case "message": - if (this.redis.listeners("message").length > 0) { - this.redis.emit("message", reply[1].toString(), reply[2] ? reply[2].toString() : ""); - } - this.redis.emit("messageBuffer", reply[1], reply[2]); - break; - case "pmessage": { - const pattern = reply[1].toString(); - if (this.redis.listeners("pmessage").length > 0) { - this.redis.emit("pmessage", pattern, reply[2].toString(), reply[3].toString()); - } - this.redis.emit("pmessageBuffer", pattern, reply[2], reply[3]); - break; - } - case "smessage": { - if (this.redis.listeners("smessage").length > 0) { - this.redis.emit("smessage", reply[1].toString(), reply[2] ? reply[2].toString() : ""); - } - this.redis.emit("smessageBuffer", reply[1], reply[2]); - break; - } - case "ssubscribe": - case "subscribe": - case "psubscribe": { - const channel = reply[1].toString(); - this.redis.condition.subscriber.add(replyType, channel); - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (!fillSubCommand(item.command, reply[2])) { - this.redis.commandQueue.unshift(item); - } - break; - } - case "sunsubscribe": - case "unsubscribe": - case "punsubscribe": { - const channel = reply[1] ? reply[1].toString() : null; - if (channel) { - this.redis.condition.subscriber.del(replyType, channel); - } - const count = reply[2]; - if (Number(count) === 0) { - this.redis.condition.subscriber = false; - } - const item = this.shiftCommand(reply); - if (!item) { - return; - } - if (!fillUnsubCommand(item.command, count)) { - this.redis.commandQueue.unshift(item); - } - break; - } - default: { - const item = this.shiftCommand(reply); - if (!item) { - return; - } - item.command.resolve(reply); - } - } - return true; - } - handleMonitorReply(reply) { - if (this.redis.status !== "monitoring") { - return false; - } - const replyStr = reply.toString(); - if (replyStr === "OK") { - return false; - } - const len = replyStr.indexOf(" "); - const timestamp = replyStr.slice(0, len); - const argIndex = replyStr.indexOf('"'); - const args = replyStr.slice(argIndex + 1, -1).split('" "').map((elem) => elem.replace(/\\"/g, '"')); - const dbAndSource = replyStr.slice(len + 2, argIndex - 2).split(" "); - this.redis.emit("monitor", timestamp, args, dbAndSource[1], dbAndSource[0]); - return true; - } - shiftCommand(reply) { - const item = this.redis.commandQueue.shift(); - if (!item) { - const message = "Command queue state error. If you can reproduce this, please report it."; - const error = new Error(message + (reply instanceof Error ? ` Last error: ${reply.message}` : ` Last reply: ${reply.toString()}`)); - this.redis.emit("error", error); - return null; - } - return item; - } - }; - exports2.default = DataHandler; - var remainingRepliesMap = /* @__PURE__ */ new WeakMap(); - function fillSubCommand(command, count) { - let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; - remainingReplies -= 1; - if (remainingReplies <= 0) { - command.resolve(count); - remainingRepliesMap.delete(command); - return true; - } - remainingRepliesMap.set(command, remainingReplies); - return false; - } - function fillUnsubCommand(command, count) { - let remainingReplies = remainingRepliesMap.has(command) ? remainingRepliesMap.get(command) : command.args.length; - if (remainingReplies === 0) { - if (Number(count) === 0) { - remainingRepliesMap.delete(command); - command.resolve(count); - return true; - } - return false; - } - remainingReplies -= 1; - if (remainingReplies <= 0) { - command.resolve(count); - return true; - } - remainingRepliesMap.set(command, remainingReplies); - return false; - } - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js -var require_event_handler = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/event_handler.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.readyHandler = exports2.errorHandler = exports2.closeHandler = exports2.connectHandler = void 0; - var redis_errors_1 = require_redis_errors(); - var Command_1 = require_Command(); - var errors_1 = require_errors(); - var utils_1 = require_utils2(); - var DataHandler_1 = require_DataHandler(); - var debug = (0, utils_1.Debug)("connection"); - function connectHandler(self2) { - return function() { - var _a; - self2.setStatus("connect"); - self2.resetCommandQueue(); - let flushed = false; - const { connectionEpoch } = self2; - if (self2.condition.auth) { - self2.auth(self2.condition.auth, function(err) { - if (connectionEpoch !== self2.connectionEpoch) { - return; - } - if (err) { - if (err.message.indexOf("no password is set") !== -1) { - console.warn("[WARN] Redis server does not require a password, but a password was supplied."); - } else if (err.message.indexOf("without any password configured for the default user") !== -1) { - console.warn("[WARN] This Redis server's `default` user does not require a password, but a password was supplied"); - } else if (err.message.indexOf("wrong number of arguments for 'auth' command") !== -1) { - console.warn(`[ERROR] The server returned "wrong number of arguments for 'auth' command". You are probably passing both username and password to Redis version 5 or below. You should only pass the 'password' option for Redis version 5 and under.`); - } else { - flushed = true; - self2.recoverFromFatalError(err, err); - } - } - }); - } - if (self2.condition.select) { - self2.select(self2.condition.select).catch((err) => { - self2.silentEmit("error", err); - }); - } - new DataHandler_1.default(self2, { - stringNumbers: self2.options.stringNumbers - }); - const clientCommandPromises = []; - if (self2.options.connectionName) { - debug("set the connection name [%s]", self2.options.connectionName); - clientCommandPromises.push(self2.client("setname", self2.options.connectionName).catch(utils_1.noop)); - } - if (!self2.options.disableClientInfo) { - debug("set the client info"); - clientCommandPromises.push((0, utils_1.getPackageMeta)().then((packageMeta) => { - return self2.client("SETINFO", "LIB-VER", packageMeta.version).catch(utils_1.noop); - }).catch(utils_1.noop)); - clientCommandPromises.push(self2.client("SETINFO", "LIB-NAME", ((_a = self2.options) === null || _a === void 0 ? void 0 : _a.clientInfoTag) ? `ioredis(${self2.options.clientInfoTag})` : "ioredis").catch(utils_1.noop)); - } - Promise.all(clientCommandPromises).catch(utils_1.noop).finally(() => { - if (!self2.options.enableReadyCheck) { - exports2.readyHandler(self2)(); - } - if (self2.options.enableReadyCheck) { - self2._readyCheck(function(err, info) { - if (connectionEpoch !== self2.connectionEpoch) { - return; - } - if (err) { - if (!flushed) { - self2.recoverFromFatalError(new Error("Ready check failed: " + err.message), err); - } - } else { - if (self2.connector.check(info)) { - exports2.readyHandler(self2)(); - } else { - self2.disconnect(true); - } - } - }); - } - }); - }; - } - exports2.connectHandler = connectHandler; - function abortError(command) { - const err = new redis_errors_1.AbortError("Command aborted due to connection close"); - err.command = { - name: command.name, - args: command.args - }; - return err; - } - function abortIncompletePipelines(commandQueue) { - var _a; - let expectedIndex = 0; - for (let i = 0; i < commandQueue.length; ) { - const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; - const pipelineIndex = command.pipelineIndex; - if (pipelineIndex === void 0 || pipelineIndex === 0) { - expectedIndex = 0; - } - if (pipelineIndex !== void 0 && pipelineIndex !== expectedIndex++) { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - continue; - } - i++; - } - } - function abortTransactionFragments(commandQueue) { - var _a; - for (let i = 0; i < commandQueue.length; ) { - const command = (_a = commandQueue.peekAt(i)) === null || _a === void 0 ? void 0 : _a.command; - if (command.name === "multi") { - break; - } - if (command.name === "exec") { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - break; - } - if (command.inTransaction) { - commandQueue.remove(i, 1); - command.reject(abortError(command)); - } else { - i++; - } - } - } - function closeHandler(self2) { - return function() { - const prevStatus = self2.status; - self2.setStatus("close"); - if (self2.commandQueue.length) { - abortIncompletePipelines(self2.commandQueue); - } - if (self2.offlineQueue.length) { - abortTransactionFragments(self2.offlineQueue); - } - if (prevStatus === "ready") { - if (!self2.prevCondition) { - self2.prevCondition = self2.condition; - } - if (self2.commandQueue.length) { - self2.prevCommandQueue = self2.commandQueue; - } - } - if (self2.manuallyClosing) { - self2.manuallyClosing = false; - debug("skip reconnecting since the connection is manually closed."); - return close(); - } - if (typeof self2.options.retryStrategy !== "function") { - debug("skip reconnecting because `retryStrategy` is not a function"); - return close(); - } - const retryDelay = self2.options.retryStrategy(++self2.retryAttempts); - if (typeof retryDelay !== "number") { - debug("skip reconnecting because `retryStrategy` doesn't return a number"); - return close(); - } - debug("reconnect in %sms", retryDelay); - self2.setStatus("reconnecting", retryDelay); - self2.reconnectTimeout = setTimeout(function() { - self2.reconnectTimeout = null; - self2.connect().catch(utils_1.noop); - }, retryDelay); - const { maxRetriesPerRequest } = self2.options; - if (typeof maxRetriesPerRequest === "number") { - if (maxRetriesPerRequest < 0) { - debug("maxRetriesPerRequest is negative, ignoring..."); - } else { - const remainder = self2.retryAttempts % (maxRetriesPerRequest + 1); - if (remainder === 0) { - debug("reach maxRetriesPerRequest limitation, flushing command queue..."); - self2.flushQueue(new errors_1.MaxRetriesPerRequestError(maxRetriesPerRequest)); - } - } - } - }; - function close() { - self2.setStatus("end"); - self2.flushQueue(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - } - } - exports2.closeHandler = closeHandler; - function errorHandler(self2) { - return function(error) { - debug("error: %s", error); - self2.silentEmit("error", error); - }; - } - exports2.errorHandler = errorHandler; - function readyHandler(self2) { - return function() { - self2.setStatus("ready"); - self2.retryAttempts = 0; - if (self2.options.monitor) { - self2.call("monitor").then(() => self2.setStatus("monitoring"), (error) => self2.emit("error", error)); - const { sendCommand } = self2; - self2.sendCommand = function(command) { - if (Command_1.default.checkFlag("VALID_IN_MONITOR_MODE", command.name)) { - return sendCommand.call(self2, command); - } - command.reject(new Error("Connection is in monitoring mode, can't process commands.")); - return command.promise; - }; - self2.once("close", function() { - delete self2.sendCommand; - }); - return; - } - const finalSelect = self2.prevCondition ? self2.prevCondition.select : self2.condition.select; - if (self2.options.readOnly) { - debug("set the connection to readonly mode"); - self2.readonly().catch(utils_1.noop); - } - if (self2.prevCondition) { - const condition = self2.prevCondition; - self2.prevCondition = null; - if (condition.subscriber && self2.options.autoResubscribe) { - if (self2.condition.select !== finalSelect) { - debug("connect to db [%d]", finalSelect); - self2.select(finalSelect); - } - const subscribeChannels = condition.subscriber.channels("subscribe"); - if (subscribeChannels.length) { - debug("subscribe %d channels", subscribeChannels.length); - self2.subscribe(subscribeChannels); - } - const psubscribeChannels = condition.subscriber.channels("psubscribe"); - if (psubscribeChannels.length) { - debug("psubscribe %d channels", psubscribeChannels.length); - self2.psubscribe(psubscribeChannels); - } - const ssubscribeChannels = condition.subscriber.channels("ssubscribe"); - if (ssubscribeChannels.length) { - debug("ssubscribe %s", ssubscribeChannels.length); - for (const channel of ssubscribeChannels) { - self2.ssubscribe(channel); - } - } - } - } - if (self2.prevCommandQueue) { - if (self2.options.autoResendUnfulfilledCommands) { - debug("resend %d unfulfilled commands", self2.prevCommandQueue.length); - while (self2.prevCommandQueue.length > 0) { - const item = self2.prevCommandQueue.shift(); - if (item.select !== self2.condition.select && item.command.name !== "select") { - self2.select(item.select); - } - self2.sendCommand(item.command, item.stream); - } - } else { - self2.prevCommandQueue = null; - } - } - if (self2.offlineQueue.length) { - debug("send %d commands in offline queue", self2.offlineQueue.length); - const offlineQueue = self2.offlineQueue; - self2.resetOfflineQueue(); - while (offlineQueue.length > 0) { - const item = offlineQueue.shift(); - if (item.select !== self2.condition.select && item.command.name !== "select") { - self2.select(item.select); - } - self2.sendCommand(item.command, item.stream); - } - } - if (self2.condition.select !== finalSelect) { - debug("connect to db [%d]", finalSelect); - self2.select(finalSelect); - } - }; - } - exports2.readyHandler = readyHandler; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js -var require_RedisOptions = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/redis/RedisOptions.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_REDIS_OPTIONS = void 0; - exports2.DEFAULT_REDIS_OPTIONS = { - // Connection - port: 6379, - host: "localhost", - family: 0, - connectTimeout: 1e4, - disconnectTimeout: 2e3, - retryStrategy: function(times) { - return Math.min(times * 50, 2e3); - }, - keepAlive: 0, - noDelay: true, - connectionName: null, - disableClientInfo: false, - clientInfoTag: void 0, - // Sentinel - sentinels: null, - name: null, - role: "master", - sentinelRetryStrategy: function(times) { - return Math.min(times * 10, 1e3); - }, - sentinelReconnectStrategy: function() { - return 6e4; - }, - natMap: null, - enableTLSForSentinelMode: false, - updateSentinels: true, - failoverDetector: false, - // Status - username: null, - password: null, - db: 0, - // Others - enableOfflineQueue: true, - enableReadyCheck: true, - autoResubscribe: true, - autoResendUnfulfilledCommands: true, - lazyConnect: false, - keyPrefix: "", - reconnectOnError: null, - readOnly: false, - stringNumbers: false, - maxRetriesPerRequest: 20, - maxLoadingRetryTime: 1e4, - enableAutoPipelining: false, - autoPipeliningIgnoredCommands: [], - sentinelMaxConnections: 10 - }; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js -var require_Redis = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/Redis.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var commands_1 = require_built(); - var events_1 = require("events"); - var standard_as_callback_1 = require_built2(); - var cluster_1 = require_cluster(); - var Command_1 = require_Command(); - var connectors_1 = require_connectors(); - var SentinelConnector_1 = require_SentinelConnector(); - var eventHandler = require_event_handler(); - var RedisOptions_1 = require_RedisOptions(); - var ScanStream_1 = require_ScanStream(); - var transaction_1 = require_transaction(); - var utils_1 = require_utils2(); - var applyMixin_1 = require_applyMixin(); - var Commander_1 = require_Commander(); - var lodash_1 = require_lodash3(); - var Deque = require_denque(); - var debug = (0, utils_1.Debug)("redis"); - var Redis2 = class _Redis extends Commander_1.default { - constructor(arg1, arg2, arg3) { - super(); - this.status = "wait"; - this.isCluster = false; - this.reconnectTimeout = null; - this.connectionEpoch = 0; - this.retryAttempts = 0; - this.manuallyClosing = false; - this._autoPipelines = /* @__PURE__ */ new Map(); - this._runningAutoPipelines = /* @__PURE__ */ new Set(); - this.parseOptions(arg1, arg2, arg3); - events_1.EventEmitter.call(this); - this.resetCommandQueue(); - this.resetOfflineQueue(); - if (this.options.Connector) { - this.connector = new this.options.Connector(this.options); - } else if (this.options.sentinels) { - const sentinelConnector = new SentinelConnector_1.default(this.options); - sentinelConnector.emitter = this; - this.connector = sentinelConnector; - } else { - this.connector = new connectors_1.StandaloneConnector(this.options); - } - if (this.options.scripts) { - Object.entries(this.options.scripts).forEach(([name, definition]) => { - this.defineCommand(name, definition); - }); - } - if (this.options.lazyConnect) { - this.setStatus("wait"); - } else { - this.connect().catch(lodash_1.noop); - } - } - /** - * Create a Redis instance. - * This is the same as `new Redis()` but is included for compatibility with node-redis. - */ - static createClient(...args) { - return new _Redis(...args); - } - get autoPipelineQueueSize() { - let queued = 0; - for (const pipeline of this._autoPipelines.values()) { - queued += pipeline.length; - } - return queued; - } - /** - * Create a connection to Redis. - * This method will be invoked automatically when creating a new Redis instance - * unless `lazyConnect: true` is passed. - * - * When calling this method manually, a Promise is returned, which will - * be resolved when the connection status is ready. The promise can reject - * if the connection fails, times out, or if Redis is already connecting/connected. - */ - connect(callback) { - const promise = new Promise((resolve2, reject) => { - if (this.status === "connecting" || this.status === "connect" || this.status === "ready") { - reject(new Error("Redis is already connecting/connected")); - return; - } - this.connectionEpoch += 1; - this.setStatus("connecting"); - const { options } = this; - this.condition = { - select: options.db, - auth: options.username ? [options.username, options.password] : options.password, - subscriber: false - }; - const _this = this; - (0, standard_as_callback_1.default)(this.connector.connect(function(type, err) { - _this.silentEmit(type, err); - }), function(err, stream) { - if (err) { - _this.flushQueue(err); - _this.silentEmit("error", err); - reject(err); - _this.setStatus("end"); - return; - } - let CONNECT_EVENT = options.tls ? "secureConnect" : "connect"; - if ("sentinels" in options && options.sentinels && !options.enableTLSForSentinelMode) { - CONNECT_EVENT = "connect"; - } - _this.stream = stream; - if (options.noDelay) { - stream.setNoDelay(true); - } - if (typeof options.keepAlive === "number") { - if (stream.connecting) { - stream.once(CONNECT_EVENT, () => { - stream.setKeepAlive(true, options.keepAlive); - }); - } else { - stream.setKeepAlive(true, options.keepAlive); - } - } - if (stream.connecting) { - stream.once(CONNECT_EVENT, eventHandler.connectHandler(_this)); - if (options.connectTimeout) { - let connectTimeoutCleared = false; - stream.setTimeout(options.connectTimeout, function() { - if (connectTimeoutCleared) { - return; - } - stream.setTimeout(0); - stream.destroy(); - const err2 = new Error("connect ETIMEDOUT"); - err2.errorno = "ETIMEDOUT"; - err2.code = "ETIMEDOUT"; - err2.syscall = "connect"; - eventHandler.errorHandler(_this)(err2); - }); - stream.once(CONNECT_EVENT, function() { - connectTimeoutCleared = true; - stream.setTimeout(0); - }); - } - } else if (stream.destroyed) { - const firstError = _this.connector.firstError; - if (firstError) { - process.nextTick(() => { - eventHandler.errorHandler(_this)(firstError); - }); - } - process.nextTick(eventHandler.closeHandler(_this)); - } else { - process.nextTick(eventHandler.connectHandler(_this)); - } - if (!stream.destroyed) { - stream.once("error", eventHandler.errorHandler(_this)); - stream.once("close", eventHandler.closeHandler(_this)); - } - const connectionReadyHandler = function() { - _this.removeListener("close", connectionCloseHandler); - resolve2(); - }; - var connectionCloseHandler = function() { - _this.removeListener("ready", connectionReadyHandler); - reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - }; - _this.once("ready", connectionReadyHandler); - _this.once("close", connectionCloseHandler); - }); - }); - return (0, standard_as_callback_1.default)(promise, callback); - } - /** - * Disconnect from Redis. - * - * This method closes the connection immediately, - * and may lose some pending replies that haven't written to client. - * If you want to wait for the pending replies, use Redis#quit instead. - */ - disconnect(reconnect = false) { - if (!reconnect) { - this.manuallyClosing = true; - } - if (this.reconnectTimeout && !reconnect) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - } - if (this.status === "wait") { - eventHandler.closeHandler(this)(); - } else { - this.connector.disconnect(); - } - } - /** - * Disconnect from Redis. - * - * @deprecated - */ - end() { - this.disconnect(); - } - /** - * Create a new instance with the same options as the current one. - * - * @example - * ```js - * var redis = new Redis(6380); - * var anotherRedis = redis.duplicate(); - * ``` - */ - duplicate(override) { - return new _Redis({ ...this.options, ...override }); - } - /** - * Mode of the connection. - * - * One of `"normal"`, `"subscriber"`, or `"monitor"`. When the connection is - * not in `"normal"` mode, certain commands are not allowed. - */ - get mode() { - var _a; - return this.options.monitor ? "monitor" : ((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) ? "subscriber" : "normal"; - } - /** - * Listen for all requests received by the server in real time. - * - * This command will create a new connection to Redis and send a - * MONITOR command via the new connection in order to avoid disturbing - * the current connection. - * - * @param callback The callback function. If omit, a promise will be returned. - * @example - * ```js - * var redis = new Redis(); - * redis.monitor(function (err, monitor) { - * // Entering monitoring mode. - * monitor.on('monitor', function (time, args, source, database) { - * console.log(time + ": " + util.inspect(args)); - * }); - * }); - * - * // supports promise as well as other commands - * redis.monitor().then(function (monitor) { - * monitor.on('monitor', function (time, args, source, database) { - * console.log(time + ": " + util.inspect(args)); - * }); - * }); - * ``` - */ - monitor(callback) { - const monitorInstance = this.duplicate({ - monitor: true, - lazyConnect: false - }); - return (0, standard_as_callback_1.default)(new Promise(function(resolve2, reject) { - monitorInstance.once("error", reject); - monitorInstance.once("monitoring", function() { - resolve2(monitorInstance); - }); - }), callback); - } - /** - * Send a command to Redis - * - * This method is used internally and in most cases you should not - * use it directly. If you need to send a command that is not supported - * by the library, you can use the `call` method: - * - * ```js - * const redis = new Redis(); - * - * redis.call('set', 'foo', 'bar'); - * // or - * redis.call(['set', 'foo', 'bar']); - * ``` - * - * @ignore - */ - sendCommand(command, stream) { - var _a, _b; - if (this.status === "wait") { - this.connect().catch(lodash_1.noop); - } - if (this.status === "end") { - command.reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG)); - return command.promise; - } - if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.subscriber) && !Command_1.default.checkFlag("VALID_IN_SUBSCRIBER_MODE", command.name)) { - command.reject(new Error("Connection in subscriber mode, only subscriber commands may be used")); - return command.promise; - } - if (typeof this.options.commandTimeout === "number") { - command.setTimeout(this.options.commandTimeout); - } - let writable = this.status === "ready" || !stream && this.status === "connect" && (0, commands_1.exists)(command.name) && ((0, commands_1.hasFlag)(command.name, "loading") || Command_1.default.checkFlag("HANDSHAKE_COMMANDS", command.name)); - if (!this.stream) { - writable = false; - } else if (!this.stream.writable) { - writable = false; - } else if (this.stream._writableState && this.stream._writableState.ended) { - writable = false; - } - if (!writable) { - if (!this.options.enableOfflineQueue) { - command.reject(new Error("Stream isn't writeable and enableOfflineQueue options is false")); - return command.promise; - } - if (command.name === "quit" && this.offlineQueue.length === 0) { - this.disconnect(); - command.resolve(Buffer.from("OK")); - return command.promise; - } - if (debug.enabled) { - debug("queue command[%s]: %d -> %s(%o)", this._getDescription(), this.condition.select, command.name, command.args); - } - this.offlineQueue.push({ - command, - stream, - select: this.condition.select - }); - } else { - if (debug.enabled) { - debug("write command[%s]: %d -> %s(%o)", this._getDescription(), (_b = this.condition) === null || _b === void 0 ? void 0 : _b.select, command.name, command.args); - } - if (stream) { - if ("isPipeline" in stream && stream.isPipeline) { - stream.write(command.toWritable(stream.destination.redis.stream)); - } else { - stream.write(command.toWritable(stream)); - } - } else { - this.stream.write(command.toWritable(this.stream)); - } - this.commandQueue.push({ - command, - stream, - select: this.condition.select - }); - if (Command_1.default.checkFlag("WILL_DISCONNECT", command.name)) { - this.manuallyClosing = true; - } - if (this.options.socketTimeout !== void 0 && this.socketTimeoutTimer === void 0) { - this.setSocketTimeout(); - } - } - if (command.name === "select" && (0, utils_1.isInt)(command.args[0])) { - const db = parseInt(command.args[0], 10); - if (this.condition.select !== db) { - this.condition.select = db; - this.emit("select", db); - debug("switch to db [%d]", this.condition.select); - } - } - return command.promise; - } - setSocketTimeout() { - this.socketTimeoutTimer = setTimeout(() => { - this.stream.destroy(new Error(`Socket timeout. Expecting data, but didn't receive any in ${this.options.socketTimeout}ms.`)); - this.socketTimeoutTimer = void 0; - }, this.options.socketTimeout); - this.stream.once("data", () => { - clearTimeout(this.socketTimeoutTimer); - this.socketTimeoutTimer = void 0; - if (this.commandQueue.length === 0) - return; - this.setSocketTimeout(); - }); - } - scanStream(options) { - return this.createScanStream("scan", { options }); - } - scanBufferStream(options) { - return this.createScanStream("scanBuffer", { options }); - } - sscanStream(key, options) { - return this.createScanStream("sscan", { key, options }); - } - sscanBufferStream(key, options) { - return this.createScanStream("sscanBuffer", { key, options }); - } - hscanStream(key, options) { - return this.createScanStream("hscan", { key, options }); - } - hscanBufferStream(key, options) { - return this.createScanStream("hscanBuffer", { key, options }); - } - zscanStream(key, options) { - return this.createScanStream("zscan", { key, options }); - } - zscanBufferStream(key, options) { - return this.createScanStream("zscanBuffer", { key, options }); - } - /** - * Emit only when there's at least one listener. - * - * @ignore - */ - silentEmit(eventName, arg) { - let error; - if (eventName === "error") { - error = arg; - if (this.status === "end") { - return; - } - if (this.manuallyClosing) { - if (error instanceof Error && (error.message === utils_1.CONNECTION_CLOSED_ERROR_MSG || // @ts-expect-error - error.syscall === "connect" || // @ts-expect-error - error.syscall === "read")) { - return; - } - } - } - if (this.listeners(eventName).length > 0) { - return this.emit.apply(this, arguments); - } - if (error && error instanceof Error) { - console.error("[ioredis] Unhandled error event:", error.stack); - } - return false; - } - /** - * @ignore - */ - recoverFromFatalError(_commandError, err, options) { - this.flushQueue(err, options); - this.silentEmit("error", err); - this.disconnect(true); - } - /** - * @ignore - */ - handleReconnection(err, item) { - var _a; - let needReconnect = false; - if (this.options.reconnectOnError && !Command_1.default.checkFlag("IGNORE_RECONNECT_ON_ERROR", item.command.name)) { - needReconnect = this.options.reconnectOnError(err); - } - switch (needReconnect) { - case 1: - case true: - if (this.status !== "reconnecting") { - this.disconnect(true); - } - item.command.reject(err); - break; - case 2: - if (this.status !== "reconnecting") { - this.disconnect(true); - } - if (((_a = this.condition) === null || _a === void 0 ? void 0 : _a.select) !== item.select && item.command.name !== "select") { - this.select(item.select); - } - this.sendCommand(item.command); - break; - default: - item.command.reject(err); - } - } - /** - * Get description of the connection. Used for debugging. - */ - _getDescription() { - let description; - if ("path" in this.options && this.options.path) { - description = this.options.path; - } else if (this.stream && this.stream.remoteAddress && this.stream.remotePort) { - description = this.stream.remoteAddress + ":" + this.stream.remotePort; - } else if ("host" in this.options && this.options.host) { - description = this.options.host + ":" + this.options.port; - } else { - description = ""; - } - if (this.options.connectionName) { - description += ` (${this.options.connectionName})`; - } - return description; - } - resetCommandQueue() { - this.commandQueue = new Deque(); - } - resetOfflineQueue() { - this.offlineQueue = new Deque(); - } - parseOptions(...args) { - const options = {}; - let isTls = false; - for (let i = 0; i < args.length; ++i) { - const arg = args[i]; - if (arg === null || typeof arg === "undefined") { - continue; - } - if (typeof arg === "object") { - (0, lodash_1.defaults)(options, arg); - } else if (typeof arg === "string") { - (0, lodash_1.defaults)(options, (0, utils_1.parseURL)(arg)); - if (arg.startsWith("rediss://")) { - isTls = true; - } - } else if (typeof arg === "number") { - options.port = arg; - } else { - throw new Error("Invalid argument " + arg); - } - } - if (isTls) { - (0, lodash_1.defaults)(options, { tls: true }); - } - (0, lodash_1.defaults)(options, _Redis.defaultOptions); - if (typeof options.port === "string") { - options.port = parseInt(options.port, 10); - } - if (typeof options.db === "string") { - options.db = parseInt(options.db, 10); - } - this.options = (0, utils_1.resolveTLSProfile)(options); - } - /** - * Change instance's status - */ - setStatus(status, arg) { - if (debug.enabled) { - debug("status[%s]: %s -> %s", this._getDescription(), this.status || "[empty]", status); - } - this.status = status; - process.nextTick(this.emit.bind(this, status, arg)); - } - createScanStream(command, { key, options = {} }) { - return new ScanStream_1.default({ - objectMode: true, - key, - redis: this, - command, - ...options - }); - } - /** - * Flush offline queue and command queue with error. - * - * @param error The error object to send to the commands - * @param options options - */ - flushQueue(error, options) { - options = (0, lodash_1.defaults)({}, options, { - offlineQueue: true, - commandQueue: true - }); - let item; - if (options.offlineQueue) { - while (item = this.offlineQueue.shift()) { - item.command.reject(error); - } - } - if (options.commandQueue) { - if (this.commandQueue.length > 0) { - if (this.stream) { - this.stream.removeAllListeners("data"); - } - while (item = this.commandQueue.shift()) { - item.command.reject(error); - } - } - } - } - /** - * Check whether Redis has finished loading the persistent data and is able to - * process commands. - */ - _readyCheck(callback) { - const _this = this; - this.info(function(err, res) { - if (err) { - if (err.message && err.message.includes("NOPERM")) { - console.warn(`Skipping the ready check because INFO command fails: "${err.message}". You can disable ready check with "enableReadyCheck". More: https://github.com/luin/ioredis/wiki/Disable-ready-check.`); - return callback(null, {}); - } - return callback(err); - } - if (typeof res !== "string") { - return callback(null, res); - } - const info = {}; - const lines = res.split("\r\n"); - for (let i = 0; i < lines.length; ++i) { - const [fieldName, ...fieldValueParts] = lines[i].split(":"); - const fieldValue = fieldValueParts.join(":"); - if (fieldValue) { - info[fieldName] = fieldValue; - } - } - if (!info.loading || info.loading === "0") { - callback(null, info); - } else { - const loadingEtaMs = (info.loading_eta_seconds || 1) * 1e3; - const retryTime = _this.options.maxLoadingRetryTime && _this.options.maxLoadingRetryTime < loadingEtaMs ? _this.options.maxLoadingRetryTime : loadingEtaMs; - debug("Redis server still loading, trying again in " + retryTime + "ms"); - setTimeout(function() { - _this._readyCheck(callback); - }, retryTime); - } - }).catch(lodash_1.noop); - } - }; - Redis2.Cluster = cluster_1.default; - Redis2.Command = Command_1.default; - Redis2.defaultOptions = RedisOptions_1.DEFAULT_REDIS_OPTIONS; - (0, applyMixin_1.default)(Redis2, events_1.EventEmitter); - (0, transaction_1.addTransactionSupport)(Redis2.prototype); - exports2.default = Redis2; - } -}); - -// node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js -var require_built3 = __commonJS({ - "node_modules/.pnpm/ioredis@5.8.2/node_modules/ioredis/built/index.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.print = exports2.ReplyError = exports2.SentinelIterator = exports2.SentinelConnector = exports2.AbstractConnector = exports2.Pipeline = exports2.ScanStream = exports2.Command = exports2.Cluster = exports2.Redis = exports2.default = void 0; - exports2 = module2.exports = require_Redis().default; - var Redis_1 = require_Redis(); - Object.defineProperty(exports2, "default", { enumerable: true, get: function() { - return Redis_1.default; - } }); - var Redis_2 = require_Redis(); - Object.defineProperty(exports2, "Redis", { enumerable: true, get: function() { - return Redis_2.default; - } }); - var cluster_1 = require_cluster(); - Object.defineProperty(exports2, "Cluster", { enumerable: true, get: function() { - return cluster_1.default; - } }); - var Command_1 = require_Command(); - Object.defineProperty(exports2, "Command", { enumerable: true, get: function() { - return Command_1.default; - } }); - var ScanStream_1 = require_ScanStream(); - Object.defineProperty(exports2, "ScanStream", { enumerable: true, get: function() { - return ScanStream_1.default; - } }); - var Pipeline_1 = require_Pipeline(); - Object.defineProperty(exports2, "Pipeline", { enumerable: true, get: function() { - return Pipeline_1.default; - } }); - var AbstractConnector_1 = require_AbstractConnector(); - Object.defineProperty(exports2, "AbstractConnector", { enumerable: true, get: function() { - return AbstractConnector_1.default; - } }); - var SentinelConnector_1 = require_SentinelConnector(); - Object.defineProperty(exports2, "SentinelConnector", { enumerable: true, get: function() { - return SentinelConnector_1.default; - } }); - Object.defineProperty(exports2, "SentinelIterator", { enumerable: true, get: function() { - return SentinelConnector_1.SentinelIterator; - } }); - exports2.ReplyError = require_redis_errors().ReplyError; - Object.defineProperty(exports2, "Promise", { - get() { - console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); - return Promise; - }, - set(_lib) { - console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."); - } - }); - function print(err, reply) { - if (err) { - console.log("Error: " + err); - } else { - console.log("Reply: " + reply); - } - } - exports2.print = print; - } -}); - -// node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js -var require_main = __commonJS({ - "node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild/lib/main.js"(exports2, module2) { - "use strict"; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var node_exports = {}; - __export2(node_exports, { - analyzeMetafile: () => analyzeMetafile, - analyzeMetafileSync: () => analyzeMetafileSync, - build: () => build2, - buildSync: () => buildSync, - context: () => context, - default: () => node_default, - formatMessages: () => formatMessages, - formatMessagesSync: () => formatMessagesSync, - initialize: () => initialize, - stop: () => stop, - transform: () => transform, - transformSync: () => transformSync, - version: () => version - }); - module2.exports = __toCommonJS2(node_exports); - function encodePacket(packet) { - let visit = (value) => { - if (value === null) { - bb.write8(0); - } else if (typeof value === "boolean") { - bb.write8(1); - bb.write8(+value); - } else if (typeof value === "number") { - bb.write8(2); - bb.write32(value | 0); - } else if (typeof value === "string") { - bb.write8(3); - bb.write(encodeUTF8(value)); - } else if (value instanceof Uint8Array) { - bb.write8(4); - bb.write(value); - } else if (value instanceof Array) { - bb.write8(5); - bb.write32(value.length); - for (let item of value) { - visit(item); - } - } else { - let keys = Object.keys(value); - bb.write8(6); - bb.write32(keys.length); - for (let key of keys) { - bb.write(encodeUTF8(key)); - visit(value[key]); - } - } - }; - let bb = new ByteBuffer(); - bb.write32(0); - bb.write32(packet.id << 1 | +!packet.isRequest); - visit(packet.value); - writeUInt32LE(bb.buf, bb.len - 4, 0); - return bb.buf.subarray(0, bb.len); - } - function decodePacket(bytes) { - let visit = () => { - switch (bb.read8()) { - case 0: - return null; - case 1: - return !!bb.read8(); - case 2: - return bb.read32(); - case 3: - return decodeUTF8(bb.read()); - case 4: - return bb.read(); - case 5: { - let count = bb.read32(); - let value2 = []; - for (let i = 0; i < count; i++) { - value2.push(visit()); - } - return value2; - } - case 6: { - let count = bb.read32(); - let value2 = {}; - for (let i = 0; i < count; i++) { - value2[decodeUTF8(bb.read())] = visit(); - } - return value2; - } - default: - throw new Error("Invalid packet"); - } - }; - let bb = new ByteBuffer(bytes); - let id = bb.read32(); - let isRequest = (id & 1) === 0; - id >>>= 1; - let value = visit(); - if (bb.ptr !== bytes.length) { - throw new Error("Invalid packet"); - } - return { id, isRequest, value }; - } - var ByteBuffer = class { - constructor(buf = new Uint8Array(1024)) { - this.buf = buf; - this.len = 0; - this.ptr = 0; - } - _write(delta) { - if (this.len + delta > this.buf.length) { - let clone = new Uint8Array((this.len + delta) * 2); - clone.set(this.buf); - this.buf = clone; - } - this.len += delta; - return this.len - delta; - } - write8(value) { - let offset = this._write(1); - this.buf[offset] = value; - } - write32(value) { - let offset = this._write(4); - writeUInt32LE(this.buf, value, offset); - } - write(bytes) { - let offset = this._write(4 + bytes.length); - writeUInt32LE(this.buf, bytes.length, offset); - this.buf.set(bytes, offset + 4); - } - _read(delta) { - if (this.ptr + delta > this.buf.length) { - throw new Error("Invalid packet"); - } - this.ptr += delta; - return this.ptr - delta; - } - read8() { - return this.buf[this._read(1)]; - } - read32() { - return readUInt32LE(this.buf, this._read(4)); - } - read() { - let length = this.read32(); - let bytes = new Uint8Array(length); - let ptr = this._read(bytes.length); - bytes.set(this.buf.subarray(ptr, ptr + length)); - return bytes; - } - }; - var encodeUTF8; - var decodeUTF8; - var encodeInvariant; - if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { - let encoder = new TextEncoder(); - let decoder = new TextDecoder(); - encodeUTF8 = (text) => encoder.encode(text); - decodeUTF8 = (bytes) => decoder.decode(bytes); - encodeInvariant = 'new TextEncoder().encode("")'; - } else if (typeof Buffer !== "undefined") { - encodeUTF8 = (text) => Buffer.from(text); - decodeUTF8 = (bytes) => { - let { buffer, byteOffset, byteLength } = bytes; - return Buffer.from(buffer, byteOffset, byteLength).toString(); - }; - encodeInvariant = 'Buffer.from("")'; - } else { - throw new Error("No UTF-8 codec found"); - } - if (!(encodeUTF8("") instanceof Uint8Array)) - throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false - -This indicates that your JavaScript environment is broken. You cannot use -esbuild in this environment because esbuild relies on this invariant. This -is not a problem with esbuild. You need to fix your environment instead. -`); - function readUInt32LE(buffer, offset) { - return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; - } - function writeUInt32LE(buffer, value, offset) { - buffer[offset++] = value; - buffer[offset++] = value >> 8; - buffer[offset++] = value >> 16; - buffer[offset++] = value >> 24; - } - var quote = JSON.stringify; - var buildLogLevelDefault = "warning"; - var transformLogLevelDefault = "silent"; - function validateTarget(target) { - validateStringValue(target, "target"); - if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); - return target; - } - var canBeAnything = () => null; - var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; - var mustBeString = (value) => typeof value === "string" ? null : "a string"; - var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; - var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; - var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; - var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; - var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; - var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; - var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; - var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; - var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; - var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; - var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; - var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; - var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; - function getFlag(object, keys, key, mustBeFn) { - let value = object[key]; - keys[key + ""] = true; - if (value === void 0) return void 0; - let mustBe = mustBeFn(value); - if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); - return value; - } - function checkForInvalidFlags(object, keys, where) { - for (let key in object) { - if (!(key in keys)) { - throw new Error(`Invalid option ${where}: ${quote(key)}`); - } - } - } - function validateInitializeOptions(options) { - let keys = /* @__PURE__ */ Object.create(null); - let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); - let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); - let worker = getFlag(options, keys, "worker", mustBeBoolean); - checkForInvalidFlags(options, keys, "in initialize() call"); - return { - wasmURL, - wasmModule, - worker - }; - } - function validateMangleCache(mangleCache) { - let validated; - if (mangleCache !== void 0) { - validated = /* @__PURE__ */ Object.create(null); - for (let key in mangleCache) { - let value = mangleCache[key]; - if (typeof value === "string" || value === false) { - validated[key] = value; - } else { - throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); - } - } - } - return validated; - } - function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { - let color = getFlag(options, keys, "color", mustBeBoolean); - let logLevel = getFlag(options, keys, "logLevel", mustBeString); - let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); - if (color !== void 0) flags.push(`--color=${color}`); - else if (isTTY2) flags.push(`--color=true`); - flags.push(`--log-level=${logLevel || logLevelDefault}`); - flags.push(`--log-limit=${logLimit || 0}`); - } - function validateStringValue(value, what, key) { - if (typeof value !== "string") { - throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); - } - return value; - } - function pushCommonFlags(flags, options, keys) { - let legalComments = getFlag(options, keys, "legalComments", mustBeString); - let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); - let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); - let target = getFlag(options, keys, "target", mustBeStringOrArray); - let format = getFlag(options, keys, "format", mustBeString); - let globalName = getFlag(options, keys, "globalName", mustBeString); - let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); - let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); - let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); - let minify = getFlag(options, keys, "minify", mustBeBoolean); - let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); - let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); - let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); - let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); - let drop = getFlag(options, keys, "drop", mustBeArray); - let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); - let charset = getFlag(options, keys, "charset", mustBeString); - let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); - let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); - let jsx = getFlag(options, keys, "jsx", mustBeString); - let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); - let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); - let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); - let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); - let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); - let define = getFlag(options, keys, "define", mustBeObject); - let logOverride = getFlag(options, keys, "logOverride", mustBeObject); - let supported = getFlag(options, keys, "supported", mustBeObject); - let pure = getFlag(options, keys, "pure", mustBeArray); - let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); - let platform = getFlag(options, keys, "platform", mustBeString); - let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); - if (legalComments) flags.push(`--legal-comments=${legalComments}`); - if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); - if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); - if (target) { - if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); - else flags.push(`--target=${validateTarget(target)}`); - } - if (format) flags.push(`--format=${format}`); - if (globalName) flags.push(`--global-name=${globalName}`); - if (platform) flags.push(`--platform=${platform}`); - if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); - if (minify) flags.push("--minify"); - if (minifySyntax) flags.push("--minify-syntax"); - if (minifyWhitespace) flags.push("--minify-whitespace"); - if (minifyIdentifiers) flags.push("--minify-identifiers"); - if (lineLimit) flags.push(`--line-limit=${lineLimit}`); - if (charset) flags.push(`--charset=${charset}`); - if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); - if (ignoreAnnotations) flags.push(`--ignore-annotations`); - if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); - if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); - if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); - if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); - if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); - if (jsx) flags.push(`--jsx=${jsx}`); - if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); - if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); - if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); - if (jsxDev) flags.push(`--jsx-dev`); - if (jsxSideEffects) flags.push(`--jsx-side-effects`); - if (define) { - for (let key in define) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); - flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); - } - } - if (logOverride) { - for (let key in logOverride) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); - flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); - } - } - if (supported) { - for (let key in supported) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); - const value = supported[key]; - if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); - flags.push(`--supported:${key}=${value}`); - } - } - if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); - if (keepNames) flags.push(`--keep-names`); - } - function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { - var _a2; - let flags = []; - let entries = []; - let keys = /* @__PURE__ */ Object.create(null); - let stdinContents = null; - let stdinResolveDir = null; - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let bundle = getFlag(options, keys, "bundle", mustBeBoolean); - let splitting = getFlag(options, keys, "splitting", mustBeBoolean); - let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); - let metafile = getFlag(options, keys, "metafile", mustBeBoolean); - let outfile = getFlag(options, keys, "outfile", mustBeString); - let outdir = getFlag(options, keys, "outdir", mustBeString); - let outbase = getFlag(options, keys, "outbase", mustBeString); - let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); - let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); - let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); - let mainFields = getFlag(options, keys, "mainFields", mustBeArray); - let conditions = getFlag(options, keys, "conditions", mustBeArray); - let external = getFlag(options, keys, "external", mustBeArray); - let packages = getFlag(options, keys, "packages", mustBeString); - let alias = getFlag(options, keys, "alias", mustBeObject); - let loader = getFlag(options, keys, "loader", mustBeObject); - let outExtension = getFlag(options, keys, "outExtension", mustBeObject); - let publicPath = getFlag(options, keys, "publicPath", mustBeString); - let entryNames = getFlag(options, keys, "entryNames", mustBeString); - let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); - let assetNames = getFlag(options, keys, "assetNames", mustBeString); - let inject = getFlag(options, keys, "inject", mustBeArray); - let banner = getFlag(options, keys, "banner", mustBeObject); - let footer = getFlag(options, keys, "footer", mustBeObject); - let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); - let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); - let stdin = getFlag(options, keys, "stdin", mustBeObject); - let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; - let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - keys.plugins = true; - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); - if (bundle) flags.push("--bundle"); - if (allowOverwrite) flags.push("--allow-overwrite"); - if (splitting) flags.push("--splitting"); - if (preserveSymlinks) flags.push("--preserve-symlinks"); - if (metafile) flags.push(`--metafile`); - if (outfile) flags.push(`--outfile=${outfile}`); - if (outdir) flags.push(`--outdir=${outdir}`); - if (outbase) flags.push(`--outbase=${outbase}`); - if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); - if (packages) flags.push(`--packages=${packages}`); - if (resolveExtensions) { - let values = []; - for (let value of resolveExtensions) { - validateStringValue(value, "resolve extension"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); - values.push(value); - } - flags.push(`--resolve-extensions=${values.join(",")}`); - } - if (publicPath) flags.push(`--public-path=${publicPath}`); - if (entryNames) flags.push(`--entry-names=${entryNames}`); - if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); - if (assetNames) flags.push(`--asset-names=${assetNames}`); - if (mainFields) { - let values = []; - for (let value of mainFields) { - validateStringValue(value, "main field"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); - values.push(value); - } - flags.push(`--main-fields=${values.join(",")}`); - } - if (conditions) { - let values = []; - for (let value of conditions) { - validateStringValue(value, "condition"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); - values.push(value); - } - flags.push(`--conditions=${values.join(",")}`); - } - if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); - if (alias) { - for (let old in alias) { - if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); - flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); - } - } - if (banner) { - for (let type in banner) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); - flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); - } - } - if (footer) { - for (let type in footer) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); - flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); - } - } - if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); - if (loader) { - for (let ext in loader) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); - flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); - } - } - if (outExtension) { - for (let ext in outExtension) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); - flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); - } - } - if (entryPoints) { - if (Array.isArray(entryPoints)) { - for (let i = 0, n = entryPoints.length; i < n; i++) { - let entryPoint = entryPoints[i]; - if (typeof entryPoint === "object" && entryPoint !== null) { - let entryPointKeys = /* @__PURE__ */ Object.create(null); - let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); - let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); - checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); - if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); - if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); - entries.push([output, input]); - } else { - entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); - } - } - } else { - for (let key in entryPoints) { - entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); - } - } - } - if (stdin) { - let stdinKeys = /* @__PURE__ */ Object.create(null); - let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); - let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); - let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); - checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader2) flags.push(`--loader=${loader2}`); - if (resolveDir) stdinResolveDir = resolveDir; - if (typeof contents === "string") stdinContents = encodeUTF8(contents); - else if (contents instanceof Uint8Array) stdinContents = contents; - } - let nodePaths = []; - if (nodePathsInput) { - for (let value of nodePathsInput) { - value += ""; - nodePaths.push(value); - } - } - return { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache: validateMangleCache(mangleCache) - }; - } - function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { - let flags = []; - let keys = /* @__PURE__ */ Object.create(null); - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); - let loader = getFlag(options, keys, "loader", mustBeString); - let banner = getFlag(options, keys, "banner", mustBeString); - let footer = getFlag(options, keys, "footer", mustBeString); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader) flags.push(`--loader=${loader}`); - if (banner) flags.push(`--banner=${banner}`); - if (footer) flags.push(`--footer=${footer}`); - return { - flags, - mangleCache: validateMangleCache(mangleCache) - }; - } - function createChannel(streamIn) { - const requestCallbacksByKey = {}; - const closeData = { didClose: false, reason: "" }; - let responseCallbacks = {}; - let nextRequestID = 0; - let nextBuildKey = 0; - let stdout = new Uint8Array(16 * 1024); - let stdoutUsed = 0; - let readFromStdout = (chunk) => { - let limit = stdoutUsed + chunk.length; - if (limit > stdout.length) { - let swap = new Uint8Array(limit * 2); - swap.set(stdout); - stdout = swap; - } - stdout.set(chunk, stdoutUsed); - stdoutUsed += chunk.length; - let offset = 0; - while (offset + 4 <= stdoutUsed) { - let length = readUInt32LE(stdout, offset); - if (offset + 4 + length > stdoutUsed) { - break; - } - offset += 4; - handleIncomingPacket(stdout.subarray(offset, offset + length)); - offset += length; - } - if (offset > 0) { - stdout.copyWithin(0, offset, stdoutUsed); - stdoutUsed -= offset; - } - }; - let afterClose = (error) => { - closeData.didClose = true; - if (error) closeData.reason = ": " + (error.message || error); - const text = "The service was stopped" + closeData.reason; - for (let id in responseCallbacks) { - responseCallbacks[id](text, null); - } - responseCallbacks = {}; - }; - let sendRequest = (refs, value, callback) => { - if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); - let id = nextRequestID++; - responseCallbacks[id] = (error, response) => { - try { - callback(error, response); - } finally { - if (refs) refs.unref(); - } - }; - if (refs) refs.ref(); - streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); - }; - let sendResponse = (id, value) => { - if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); - streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); - }; - let handleRequest = async (id, request) => { - try { - if (request.command === "ping") { - sendResponse(id, {}); - return; - } - if (typeof request.key === "number") { - const requestCallbacks = requestCallbacksByKey[request.key]; - if (!requestCallbacks) { - return; - } - const callback = requestCallbacks[request.command]; - if (callback) { - await callback(id, request); - return; - } - } - throw new Error(`Invalid command: ` + request.command); - } catch (e) { - const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; - try { - sendResponse(id, { errors }); - } catch { - } - } - }; - let isFirstPacket = true; - let handleIncomingPacket = (bytes) => { - if (isFirstPacket) { - isFirstPacket = false; - let binaryVersion = String.fromCharCode(...bytes); - if (binaryVersion !== "0.24.2") { - throw new Error(`Cannot start service: Host version "${"0.24.2"}" does not match binary version ${quote(binaryVersion)}`); - } - return; - } - let packet = decodePacket(bytes); - if (packet.isRequest) { - handleRequest(packet.id, packet.value); - } else { - let callback = responseCallbacks[packet.id]; - delete responseCallbacks[packet.id]; - if (packet.value.error) callback(packet.value.error, {}); - else callback(null, packet.value); - } - }; - let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { - let refCount = 0; - const buildKey = nextBuildKey++; - const requestCallbacks = {}; - const buildRefs = { - ref() { - if (++refCount === 1) { - if (refs) refs.ref(); - } - }, - unref() { - if (--refCount === 0) { - delete requestCallbacksByKey[buildKey]; - if (refs) refs.unref(); - } - } - }; - requestCallbacksByKey[buildKey] = requestCallbacks; - buildRefs.ref(); - buildOrContextImpl( - callName, - buildKey, - sendRequest, - sendResponse, - buildRefs, - streamIn, - requestCallbacks, - options, - isTTY2, - defaultWD2, - (err, res) => { - try { - callback(err, res); - } finally { - buildRefs.unref(); - } - } - ); - }; - let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { - const details = createObjectStash(); - let start = (inputPath) => { - try { - if (typeof input !== "string" && !(input instanceof Uint8Array)) - throw new Error('The input to "transform" must be a string or a Uint8Array'); - let { - flags, - mangleCache - } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); - let request = { - command: "transform", - flags, - inputFS: inputPath !== null, - input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input - }; - if (mangleCache) request.mangleCache = mangleCache; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - let errors = replaceDetailsInMessages(response.errors, details); - let warnings = replaceDetailsInMessages(response.warnings, details); - let outstanding = 1; - let next = () => { - if (--outstanding === 0) { - let result = { - warnings, - code: response.code, - map: response.map, - mangleCache: void 0, - legalComments: void 0 - }; - if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; - if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; - callback(null, result); - } - }; - if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); - if (response.codeFS) { - outstanding++; - fs3.readFile(response.code, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.code = contents; - next(); - } - }); - } - if (response.mapFS) { - outstanding++; - fs3.readFile(response.map, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.map = contents; - next(); - } - }); - } - next(); - }); - } catch (e) { - let flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); - } catch { - } - const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); - sendRequest(refs, { command: "error", flags, error }, () => { - error.detail = details.load(error.detail); - callback(failureErrorWithLog("Transform failed", [error], []), null); - }); - } - }; - if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { - let next = start; - start = () => fs3.writeFile(input, next); - } - start(null); - }; - let formatMessages2 = ({ callName, refs, messages, options, callback }) => { - if (!options) throw new Error(`Missing second argument in ${callName}() call`); - let keys = {}; - let kind = getFlag(options, keys, "kind", mustBeString); - let color = getFlag(options, keys, "color", mustBeBoolean); - let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); - if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); - let request = { - command: "format-msgs", - messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), - isWarning: kind === "warning" - }; - if (color !== void 0) request.color = color; - if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.messages); - }); - }; - let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { - if (options === void 0) options = {}; - let keys = {}; - let color = getFlag(options, keys, "color", mustBeBoolean); - let verbose = getFlag(options, keys, "verbose", mustBeBoolean); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - let request = { - command: "analyze-metafile", - metafile - }; - if (color !== void 0) request.color = color; - if (verbose !== void 0) request.verbose = verbose; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.result); - }); - }; - return { - readFromStdout, - afterClose, - service: { - buildOrContext, - transform: transform2, - formatMessages: formatMessages2, - analyzeMetafile: analyzeMetafile2 - } - }; - } - function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { - const details = createObjectStash(); - const isContext = callName === "context"; - const handleError = (e, pluginName) => { - const flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); - } catch { - } - const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); - sendRequest(refs, { command: "error", flags, error: message }, () => { - message.detail = details.load(message.detail); - callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); - }); - }; - let plugins; - if (typeof options === "object") { - const value = options.plugins; - if (value !== void 0) { - if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); - plugins = value; - } - } - if (plugins && plugins.length > 0) { - if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); - handlePlugins( - buildKey, - sendRequest, - sendResponse, - refs, - streamIn, - requestCallbacks, - options, - plugins, - details - ).then( - (result) => { - if (!result.ok) return handleError(result.error, result.pluginName); - try { - buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); - } catch (e) { - handleError(e, ""); - } - }, - (e) => handleError(e, "") - ); - return; - } - try { - buildOrContextContinue(null, (result, done) => done([], []), () => { - }); - } catch (e) { - handleError(e, ""); - } - function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { - const writeDefault = streamIn.hasFS; - const { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache - } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); - if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); - const request = { - command: "build", - key: buildKey, - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir: absWorkingDir || defaultWD2, - nodePaths, - context: isContext - }; - if (requestPlugins) request.plugins = requestPlugins; - if (mangleCache) request.mangleCache = mangleCache; - const buildResponseToResult = (response, callback2) => { - const result = { - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - outputFiles: void 0, - metafile: void 0, - mangleCache: void 0 - }; - const originalErrors = result.errors.slice(); - const originalWarnings = result.warnings.slice(); - if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); - if (response.metafile) result.metafile = JSON.parse(response.metafile); - if (response.mangleCache) result.mangleCache = response.mangleCache; - if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); - runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { - if (originalErrors.length > 0 || onEndErrors.length > 0) { - const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); - return callback2(error, null, onEndErrors, onEndWarnings); - } - callback2(null, result, onEndErrors, onEndWarnings); - }); - }; - let latestResultPromise; - let provideLatestResult; - if (isContext) - requestCallbacks["on-end"] = (id, request2) => new Promise((resolve2) => { - buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { - const response = { - errors: onEndErrors, - warnings: onEndWarnings - }; - if (provideLatestResult) provideLatestResult(err, result); - latestResultPromise = void 0; - provideLatestResult = void 0; - sendResponse(id, response); - resolve2(); - }); - }); - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - if (!isContext) { - return buildResponseToResult(response, (err, res) => { - scheduleOnDisposeCallbacks(); - return callback(err, res); - }); - } - if (response.errors.length > 0) { - return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); - } - let didDispose = false; - const result = { - rebuild: () => { - if (!latestResultPromise) latestResultPromise = new Promise((resolve2, reject) => { - let settlePromise; - provideLatestResult = (err, result2) => { - if (!settlePromise) settlePromise = () => err ? reject(err) : resolve2(result2); - }; - const triggerAnotherBuild = () => { - const request2 = { - command: "rebuild", - key: buildKey - }; - sendRequest(refs, request2, (error2, response2) => { - if (error2) { - reject(new Error(error2)); - } else if (settlePromise) { - settlePromise(); - } else { - triggerAnotherBuild(); - } - }); - }; - triggerAnotherBuild(); - }); - return latestResultPromise; - }, - watch: (options2 = {}) => new Promise((resolve2, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); - const keys = {}; - checkForInvalidFlags(options2, keys, `in watch() call`); - const request2 = { - command: "watch", - key: buildKey - }; - sendRequest(refs, request2, (error2) => { - if (error2) reject(new Error(error2)); - else resolve2(void 0); - }); - }), - serve: (options2 = {}) => new Promise((resolve2, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); - const keys = {}; - const port = getFlag(options2, keys, "port", mustBeInteger); - const host = getFlag(options2, keys, "host", mustBeString); - const servedir = getFlag(options2, keys, "servedir", mustBeString); - const keyfile = getFlag(options2, keys, "keyfile", mustBeString); - const certfile = getFlag(options2, keys, "certfile", mustBeString); - const fallback = getFlag(options2, keys, "fallback", mustBeString); - const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); - checkForInvalidFlags(options2, keys, `in serve() call`); - const request2 = { - command: "serve", - key: buildKey, - onRequest: !!onRequest - }; - if (port !== void 0) request2.port = port; - if (host !== void 0) request2.host = host; - if (servedir !== void 0) request2.servedir = servedir; - if (keyfile !== void 0) request2.keyfile = keyfile; - if (certfile !== void 0) request2.certfile = certfile; - if (fallback !== void 0) request2.fallback = fallback; - sendRequest(refs, request2, (error2, response2) => { - if (error2) return reject(new Error(error2)); - if (onRequest) { - requestCallbacks["serve-request"] = (id, request3) => { - onRequest(request3.args); - sendResponse(id, {}); - }; - } - resolve2(response2); - }); - }), - cancel: () => new Promise((resolve2) => { - if (didDispose) return resolve2(); - const request2 = { - command: "cancel", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve2(); - }); - }), - dispose: () => new Promise((resolve2) => { - if (didDispose) return resolve2(); - didDispose = true; - const request2 = { - command: "dispose", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve2(); - scheduleOnDisposeCallbacks(); - refs.unref(); - }); - }) - }; - refs.ref(); - callback(null, result); - }); - } - } - var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { - let onStartCallbacks = []; - let onEndCallbacks = []; - let onResolveCallbacks = {}; - let onLoadCallbacks = {}; - let onDisposeCallbacks = []; - let nextCallbackID = 0; - let i = 0; - let requestPlugins = []; - let isSetupDone = false; - plugins = [...plugins]; - for (let item of plugins) { - let keys = {}; - if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); - const name = getFlag(item, keys, "name", mustBeString); - if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); - try { - let setup = getFlag(item, keys, "setup", mustBeFunction); - if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); - checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); - let plugin = { - name, - onStart: false, - onEnd: false, - onResolve: [], - onLoad: [] - }; - i++; - let resolve2 = (path3, options = {}) => { - if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); - if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); - let keys2 = /* @__PURE__ */ Object.create(null); - let pluginName = getFlag(options, keys2, "pluginName", mustBeString); - let importer = getFlag(options, keys2, "importer", mustBeString); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); - let kind = getFlag(options, keys2, "kind", mustBeString); - let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); - let importAttributes = getFlag(options, keys2, "with", mustBeObject); - checkForInvalidFlags(options, keys2, "in resolve() call"); - return new Promise((resolve22, reject) => { - const request = { - command: "resolve", - path: path3, - key: buildKey, - pluginName: name - }; - if (pluginName != null) request.pluginName = pluginName; - if (importer != null) request.importer = importer; - if (namespace != null) request.namespace = namespace; - if (resolveDir != null) request.resolveDir = resolveDir; - if (kind != null) request.kind = kind; - else throw new Error(`Must specify "kind" when calling "resolve"`); - if (pluginData != null) request.pluginData = details.store(pluginData); - if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with"); - sendRequest(refs, request, (error, response) => { - if (error !== null) reject(new Error(error)); - else resolve22({ - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - path: response.path, - external: response.external, - sideEffects: response.sideEffects, - namespace: response.namespace, - suffix: response.suffix, - pluginData: details.load(response.pluginData) - }); - }); - }); - }; - let promise = setup({ - initialOptions, - resolve: resolve2, - onStart(callback) { - let registeredText = `This error came from the "onStart" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); - onStartCallbacks.push({ name, callback, note: registeredNote }); - plugin.onStart = true; - }, - onEnd(callback) { - let registeredText = `This error came from the "onEnd" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); - onEndCallbacks.push({ name, callback, note: registeredNote }); - plugin.onEnd = true; - }, - onResolve(options, callback) { - let registeredText = `This error came from the "onResolve" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onResolve() call is missing a filter`); - let id = nextCallbackID++; - onResolveCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onLoad(options, callback) { - let registeredText = `This error came from the "onLoad" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onLoad() call is missing a filter`); - let id = nextCallbackID++; - onLoadCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onDispose(callback) { - onDisposeCallbacks.push(callback); - }, - esbuild: streamIn.esbuild - }); - if (promise) await promise; - requestPlugins.push(plugin); - } catch (e) { - return { ok: false, error: e, pluginName: name }; - } - } - requestCallbacks["on-start"] = async (id, request) => { - details.clear(); - let response = { errors: [], warnings: [] }; - await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { - try { - let result = await callback(); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); - if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); - if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); - } - } catch (e) { - response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); - } - })); - sendResponse(id, response); - }; - requestCallbacks["on-resolve"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onResolveCallbacks[id2]); - let result = await callback({ - path: request.path, - importer: request.importer, - namespace: request.namespace, - resolveDir: request.resolveDir, - kind: request.kind, - pluginData: details.load(request.pluginData), - with: request.with - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let path3 = getFlag(result, keys, "path", mustBeString); - let namespace = getFlag(result, keys, "namespace", mustBeString); - let suffix = getFlag(result, keys, "suffix", mustBeString); - let external = getFlag(result, keys, "external", mustBeBoolean); - let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (path3 != null) response.path = path3; - if (namespace != null) response.namespace = namespace; - if (suffix != null) response.suffix = suffix; - if (external != null) response.external = external; - if (sideEffects != null) response.sideEffects = sideEffects; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - requestCallbacks["on-load"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onLoadCallbacks[id2]); - let result = await callback({ - path: request.path, - namespace: request.namespace, - suffix: request.suffix, - pluginData: details.load(request.pluginData), - with: request.with - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let loader = getFlag(result, keys, "loader", mustBeString); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (contents instanceof Uint8Array) response.contents = contents; - else if (contents != null) response.contents = encodeUTF8(contents); - if (resolveDir != null) response.resolveDir = resolveDir; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (loader != null) response.loader = loader; - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - let runOnEndCallbacks = (result, done) => done([], []); - if (onEndCallbacks.length > 0) { - runOnEndCallbacks = (result, done) => { - (async () => { - const onEndErrors = []; - const onEndWarnings = []; - for (const { name, callback, note } of onEndCallbacks) { - let newErrors; - let newWarnings; - try { - const value = await callback(result); - if (value != null) { - if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(value, keys, "errors", mustBeArray); - let warnings = getFlag(value, keys, "warnings", mustBeArray); - checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); - if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - } - } catch (e) { - newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; - } - if (newErrors) { - onEndErrors.push(...newErrors); - try { - result.errors.push(...newErrors); - } catch { - } - } - if (newWarnings) { - onEndWarnings.push(...newWarnings); - try { - result.warnings.push(...newWarnings); - } catch { - } - } - } - done(onEndErrors, onEndWarnings); - })(); - }; - } - let scheduleOnDisposeCallbacks = () => { - for (const cb of onDisposeCallbacks) { - setTimeout(() => cb(), 0); - } - }; - isSetupDone = true; - return { - ok: true, - requestPlugins, - runOnEndCallbacks, - scheduleOnDisposeCallbacks - }; - }; - function createObjectStash() { - const map = /* @__PURE__ */ new Map(); - let nextID = 0; - return { - clear() { - map.clear(); - }, - load(id) { - return map.get(id); - }, - store(value) { - if (value === void 0) return -1; - const id = nextID++; - map.set(id, value); - return id; - } - }; - } - function extractCallerV8(e, streamIn, ident) { - let note; - let tried = false; - return () => { - if (tried) return note; - tried = true; - try { - let lines = (e.stack + "").split("\n"); - lines.splice(1, 1); - let location = parseStackLinesV8(streamIn, lines, ident); - if (location) { - note = { text: e.message, location }; - return note; - } - } catch { - } - }; - } - function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { - let text = "Internal error"; - let location = null; - try { - text = (e && e.message || e) + ""; - } catch { - } - try { - location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); - } catch { - } - return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; - } - function parseStackLinesV8(streamIn, lines, ident) { - let at = " at "; - if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { - for (let i = 1; i < lines.length; i++) { - let line = lines[i]; - if (!line.startsWith(at)) continue; - line = line.slice(at.length); - while (true) { - let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^(\S+):(\d+):(\d+)$/.exec(line); - if (match) { - let contents; - try { - contents = streamIn.readFileSync(match[1], "utf8"); - } catch { - break; - } - let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; - let column = +match[3] - 1; - let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; - return { - file: match[1], - namespace: "file", - line: +match[2], - column: encodeUTF8(lineText.slice(0, column)).length, - length: encodeUTF8(lineText.slice(column, column + length)).length, - lineText: lineText + "\n" + lines.slice(1).join("\n"), - suggestion: "" - }; - } - break; - } - } - } - return null; - } - function failureErrorWithLog(text, errors, warnings) { - let limit = 5; - text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { - if (i === limit) return "\n..."; - if (!e.location) return ` -error: ${e.text}`; - let { file, line, column } = e.location; - let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; - return ` -${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; - }).join(""); - let error = new Error(text); - for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { - Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - get: () => value, - set: (value2) => Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - value: value2 - }) - }); - } - return error; - } - function replaceDetailsInMessages(messages, stash) { - for (const message of messages) { - message.detail = stash.load(message.detail); - } - return messages; - } - function sanitizeLocation(location, where, terminalWidth) { - if (location == null) return null; - let keys = {}; - let file = getFlag(location, keys, "file", mustBeString); - let namespace = getFlag(location, keys, "namespace", mustBeString); - let line = getFlag(location, keys, "line", mustBeInteger); - let column = getFlag(location, keys, "column", mustBeInteger); - let length = getFlag(location, keys, "length", mustBeInteger); - let lineText = getFlag(location, keys, "lineText", mustBeString); - let suggestion = getFlag(location, keys, "suggestion", mustBeString); - checkForInvalidFlags(location, keys, where); - if (lineText) { - const relevantASCII = lineText.slice( - 0, - (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) - ); - if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { - lineText = relevantASCII; - } - } - return { - file: file || "", - namespace: namespace || "", - line: line || 0, - column: column || 0, - length: length || 0, - lineText: lineText || "", - suggestion: suggestion || "" - }; - } - function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { - let messagesClone = []; - let index = 0; - for (const message of messages) { - let keys = {}; - let id = getFlag(message, keys, "id", mustBeString); - let pluginName = getFlag(message, keys, "pluginName", mustBeString); - let text = getFlag(message, keys, "text", mustBeString); - let location = getFlag(message, keys, "location", mustBeObjectOrNull); - let notes = getFlag(message, keys, "notes", mustBeArray); - let detail = getFlag(message, keys, "detail", canBeAnything); - let where = `in element ${index} of "${property}"`; - checkForInvalidFlags(message, keys, where); - let notesClone = []; - if (notes) { - for (const note of notes) { - let noteKeys = {}; - let noteText = getFlag(note, noteKeys, "text", mustBeString); - let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); - checkForInvalidFlags(note, noteKeys, where); - notesClone.push({ - text: noteText || "", - location: sanitizeLocation(noteLocation, where, terminalWidth) - }); - } - } - messagesClone.push({ - id: id || "", - pluginName: pluginName || fallbackPluginName, - text: text || "", - location: sanitizeLocation(location, where, terminalWidth), - notes: notesClone, - detail: stash ? stash.store(detail) : -1 - }); - index++; - } - return messagesClone; - } - function sanitizeStringArray(values, property) { - const result = []; - for (const value of values) { - if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); - result.push(value); - } - return result; - } - function sanitizeStringMap(map, property) { - const result = /* @__PURE__ */ Object.create(null); - for (const key in map) { - const value = map[key]; - if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`); - result[key] = value; - } - return result; - } - function convertOutputFiles({ path: path3, contents, hash }) { - let text = null; - return { - path: path3, - contents, - hash, - get text() { - const binary = this.contents; - if (text === null || binary !== contents) { - contents = binary; - text = decodeUTF8(binary); - } - return text; - } - }; - } - var fs2 = require("fs"); - var os2 = require("os"); - var path2 = require("path"); - var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; - var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; - var packageDarwin_arm64 = "@esbuild/darwin-arm64"; - var packageDarwin_x64 = "@esbuild/darwin-x64"; - var knownWindowsPackages = { - "win32 arm64 LE": "@esbuild/win32-arm64", - "win32 ia32 LE": "@esbuild/win32-ia32", - "win32 x64 LE": "@esbuild/win32-x64" - }; - var knownUnixlikePackages = { - "aix ppc64 BE": "@esbuild/aix-ppc64", - "android arm64 LE": "@esbuild/android-arm64", - "darwin arm64 LE": "@esbuild/darwin-arm64", - "darwin x64 LE": "@esbuild/darwin-x64", - "freebsd arm64 LE": "@esbuild/freebsd-arm64", - "freebsd x64 LE": "@esbuild/freebsd-x64", - "linux arm LE": "@esbuild/linux-arm", - "linux arm64 LE": "@esbuild/linux-arm64", - "linux ia32 LE": "@esbuild/linux-ia32", - "linux mips64el LE": "@esbuild/linux-mips64el", - "linux ppc64 LE": "@esbuild/linux-ppc64", - "linux riscv64 LE": "@esbuild/linux-riscv64", - "linux s390x BE": "@esbuild/linux-s390x", - "linux x64 LE": "@esbuild/linux-x64", - "linux loong64 LE": "@esbuild/linux-loong64", - "netbsd arm64 LE": "@esbuild/netbsd-arm64", - "netbsd x64 LE": "@esbuild/netbsd-x64", - "openbsd arm64 LE": "@esbuild/openbsd-arm64", - "openbsd x64 LE": "@esbuild/openbsd-x64", - "sunos x64 LE": "@esbuild/sunos-x64" - }; - var knownWebAssemblyFallbackPackages = { - "android arm LE": "@esbuild/android-arm", - "android x64 LE": "@esbuild/android-x64" - }; - function pkgAndSubpathForCurrentPlatform() { - let pkg; - let subpath; - let isWASM = false; - let platformKey = `${process.platform} ${os2.arch()} ${os2.endianness()}`; - if (platformKey in knownWindowsPackages) { - pkg = knownWindowsPackages[platformKey]; - subpath = "esbuild.exe"; - } else if (platformKey in knownUnixlikePackages) { - pkg = knownUnixlikePackages[platformKey]; - subpath = "bin/esbuild"; - } else if (platformKey in knownWebAssemblyFallbackPackages) { - pkg = knownWebAssemblyFallbackPackages[platformKey]; - subpath = "bin/esbuild"; - isWASM = true; - } else { - throw new Error(`Unsupported platform: ${platformKey}`); - } - return { pkg, subpath, isWASM }; - } - function pkgForSomeOtherPlatform() { - const libMainJS = require.resolve("esbuild"); - const nodeModulesDirectory = path2.dirname(path2.dirname(path2.dirname(libMainJS))); - if (path2.basename(nodeModulesDirectory) === "node_modules") { - for (const unixKey in knownUnixlikePackages) { - try { - const pkg = knownUnixlikePackages[unixKey]; - if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - for (const windowsKey in knownWindowsPackages) { - try { - const pkg = knownWindowsPackages[windowsKey]; - if (fs2.existsSync(path2.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - } - return null; - } - function downloadedBinPath(pkg, subpath) { - const esbuildLibDir = path2.dirname(require.resolve("esbuild")); - return path2.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path2.basename(subpath)}`); - } - function generateBinPath() { - if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { - if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { - console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); - } else { - return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; - } - } - const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); - let binPath; - try { - binPath = require.resolve(`${pkg}/${subpath}`); - } catch (e) { - binPath = downloadedBinPath(pkg, subpath); - if (!fs2.existsSync(binPath)) { - try { - require.resolve(pkg); - } catch { - const otherPkg = pkgForSomeOtherPlatform(); - if (otherPkg) { - let suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild on Windows or macOS and copying "node_modules" -into a Docker image that runs Linux, or by copying "node_modules" between -Windows and WSL environments. - -If you are installing with npm, you can try not copying the "node_modules" -directory when you copy the files over, and running "npm ci" or "npm install" -on the destination platform after the copy. Or you could consider using yarn -instead of npm which has built-in support for installing a package on multiple -platforms simultaneously. - -If you are installing with yarn, you can try listing both this platform and the -other platform in your ".yarnrc.yml" file using the "supportedArchitectures" -feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { - suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild with npm running inside of Rosetta 2 and then -trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta -2 is Apple's on-the-fly x86_64-to-arm64 translation service). - -If you are installing with npm, you can try ensuring that both npm and node are -not running under Rosetta 2 and then reinstalling esbuild. This likely involves -changing how you installed npm and/or node. For example, installing node with -the universal installer here should work: https://nodejs.org/en/download/. Or -you could consider using yarn instead of npm which has built-in support for -installing a package on multiple platforms simultaneously. - -If you are installing with yarn, you can try listing both "arm64" and "x64" -in your ".yarnrc.yml" file using the "supportedArchitectures" feature: -https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - } - throw new Error(` -You installed esbuild for another platform than the one you're currently using. -This won't work because esbuild is written with native code and needs to -install a platform-specific binary executable. -${suggestions} -Another alternative is to use the "esbuild-wasm" package instead, which works -the same way on all platforms. But it comes with a heavy performance cost and -can sometimes be 10x slower than the "esbuild" package, so you may also not -want to do that. -`); - } - throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. - -If you are installing esbuild with npm, make sure that you don't specify the -"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature -of "package.json" is used by esbuild to install the correct binary executable -for your current platform.`); - } - throw e; - } - } - if (/\.zip\//.test(binPath)) { - let pnpapi; - try { - pnpapi = require("pnpapi"); - } catch (e) { - } - if (pnpapi) { - const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; - const binTargetPath = path2.join( - root, - "node_modules", - ".cache", - "esbuild", - `pnpapi-${pkg.replace("/", "-")}-${"0.24.2"}-${path2.basename(subpath)}` - ); - if (!fs2.existsSync(binTargetPath)) { - fs2.mkdirSync(path2.dirname(binTargetPath), { recursive: true }); - fs2.copyFileSync(binPath, binTargetPath); - fs2.chmodSync(binTargetPath, 493); - } - return { binPath: binTargetPath, isWASM }; - } - } - return { binPath, isWASM }; - } - var child_process = require("child_process"); - var crypto = require("crypto"); - var path22 = require("path"); - var fs22 = require("fs"); - var os22 = require("os"); - var tty = require("tty"); - var worker_threads; - if (process.env.ESBUILD_WORKER_THREADS !== "0") { - try { - worker_threads = require("worker_threads"); - } catch { - } - let [major, minor] = process.versions.node.split("."); - if ( - // { - if ((!ESBUILD_BINARY_PATH || false) && (path22.basename(__filename) !== "main.js" || path22.basename(__dirname) !== "lib")) { - throw new Error( - `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. - -More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` - ); - } - if (false) { - return ["node", [path22.join(__dirname, "..", "bin", "esbuild")]]; - } else { - const { binPath, isWASM } = generateBinPath(); - if (isWASM) { - return ["node", [binPath]]; - } else { - return [binPath, []]; - } - } - }; - var isTTY = () => tty.isatty(2); - var fsSync = { - readFile(tempFile, callback) { - try { - let contents = fs22.readFileSync(tempFile, "utf8"); - try { - fs22.unlinkSync(tempFile); - } catch { - } - callback(null, contents); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs22.writeFileSync(tempFile, contents); - callback(tempFile); - } catch { - callback(null); - } - } - }; - var fsAsync = { - readFile(tempFile, callback) { - try { - fs22.readFile(tempFile, "utf8", (err, contents) => { - try { - fs22.unlink(tempFile, () => callback(err, contents)); - } catch { - callback(err, contents); - } - }); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs22.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); - } catch { - callback(null); - } - } - }; - var version = "0.24.2"; - var build2 = (options) => ensureServiceIsRunning().build(options); - var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); - var transform = (input, options) => ensureServiceIsRunning().transform(input, options); - var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); - var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); - var buildSync = (options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.buildSync(options); - } - let result; - runServiceSync((service) => service.buildOrContext({ - callName: "buildSync", - refs: null, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var transformSync = (input, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.transformSync(input, options); - } - let result; - runServiceSync((service) => service.transform({ - callName: "transformSync", - refs: null, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsSync, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var formatMessagesSync = (messages, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.formatMessagesSync(messages, options); - } - let result; - runServiceSync((service) => service.formatMessages({ - callName: "formatMessagesSync", - refs: null, - messages, - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var analyzeMetafileSync = (metafile, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.analyzeMetafileSync(metafile, options); - } - let result; - runServiceSync((service) => service.analyzeMetafile({ - callName: "analyzeMetafileSync", - refs: null, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; - }; - var stop = () => { - if (stopService) stopService(); - if (workerThreadService) workerThreadService.stop(); - return Promise.resolve(); - }; - var initializeWasCalled = false; - var initialize = (options) => { - options = validateInitializeOptions(options || {}); - if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); - if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); - if (options.worker) throw new Error(`The "worker" option only works in the browser`); - if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); - ensureServiceIsRunning(); - initializeWasCalled = true; - return Promise.resolve(); - }; - var defaultWD = process.cwd(); - var longLivedService; - var stopService; - var ensureServiceIsRunning = () => { - if (longLivedService) return longLivedService; - let [command, args] = esbuildCommandAndArgs(); - let child = child_process.spawn(command, args.concat(`--service=${"0.24.2"}`, "--ping"), { - windowsHide: true, - stdio: ["pipe", "pipe", "inherit"], - cwd: defaultWD - }); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - child.stdin.write(bytes, (err) => { - if (err) afterClose(err); - }); - }, - readFileSync: fs22.readFileSync, - isSync: false, - hasFS: true, - esbuild: node_exports - }); - child.stdin.on("error", afterClose); - child.on("error", afterClose); - const stdin = child.stdin; - const stdout = child.stdout; - stdout.on("data", readFromStdout); - stdout.on("end", afterClose); - stopService = () => { - stdin.destroy(); - stdout.destroy(); - child.kill(); - initializeWasCalled = false; - longLivedService = void 0; - stopService = void 0; - }; - let refCount = 0; - child.unref(); - if (stdin.unref) { - stdin.unref(); - } - if (stdout.unref) { - stdout.unref(); - } - const refs = { - ref() { - if (++refCount === 1) child.ref(); - }, - unref() { - if (--refCount === 0) child.unref(); - } - }; - longLivedService = { - build: (options) => new Promise((resolve2, reject) => { - service.buildOrContext({ - callName: "build", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve2(res) - }); - }), - context: (options) => new Promise((resolve2, reject) => service.buildOrContext({ - callName: "context", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - transform: (input, options) => new Promise((resolve2, reject) => service.transform({ - callName: "transform", - refs, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsAsync, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - formatMessages: (messages, options) => new Promise((resolve2, reject) => service.formatMessages({ - callName: "formatMessages", - refs, - messages, - options, - callback: (err, res) => err ? reject(err) : resolve2(res) - })), - analyzeMetafile: (metafile, options) => new Promise((resolve2, reject) => service.analyzeMetafile({ - callName: "analyzeMetafile", - refs, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => err ? reject(err) : resolve2(res) - })) - }; - return longLivedService; - }; - var runServiceSync = (callback) => { - let [command, args] = esbuildCommandAndArgs(); - let stdin = new Uint8Array(); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - if (stdin.length !== 0) throw new Error("Must run at most one command"); - stdin = bytes; - }, - isSync: true, - hasFS: true, - esbuild: node_exports - }); - callback(service); - let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.24.2"}`), { - cwd: defaultWD, - windowsHide: true, - input: stdin, - // We don't know how large the output could be. If it's too large, the - // command will fail with ENOBUFS. Reserve 16mb for now since that feels - // like it should be enough. Also allow overriding this with an environment - // variable. - maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 - }); - readFromStdout(stdout); - afterClose(null); - }; - var randomFileName = () => { - return path22.join(os22.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); - }; - var workerThreadService = null; - var startWorkerThreadService = (worker_threads2) => { - let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); - let worker = new worker_threads2.Worker(__filename, { - workerData: { workerPort, defaultWD, esbuildVersion: "0.24.2" }, - transferList: [workerPort], - // From node's documentation: https://nodejs.org/api/worker_threads.html - // - // Take care when launching worker threads from preload scripts (scripts loaded - // and run using the `-r` command line flag). Unless the `execArgv` option is - // explicitly set, new Worker threads automatically inherit the command line flags - // from the running process and will preload the same preload scripts as the main - // thread. If the preload script unconditionally launches a worker thread, every - // thread spawned will spawn another until the application crashes. - // - execArgv: [] - }); - let nextID = 0; - let fakeBuildError = (text) => { - let error = new Error(`Build failed with 1 error: -error: ${text}`); - let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; - error.errors = errors; - error.warnings = []; - return error; - }; - let validateBuildSyncOptions = (options) => { - if (!options) return; - let plugins = options.plugins; - if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); - }; - let applyProperties = (object, properties) => { - for (let key in properties) { - object[key] = properties[key]; - } - }; - let runCallSync = (command, args) => { - let id = nextID++; - let sharedBuffer = new SharedArrayBuffer(8); - let sharedBufferView = new Int32Array(sharedBuffer); - let msg = { sharedBuffer, id, command, args }; - worker.postMessage(msg); - let status = Atomics.wait(sharedBufferView, 0, 0); - if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); - let { message: { id: id2, resolve: resolve2, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); - if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); - if (reject) { - applyProperties(reject, properties); - throw reject; - } - return resolve2; - }; - worker.unref(); - return { - buildSync(options) { - validateBuildSyncOptions(options); - return runCallSync("build", [options]); - }, - transformSync(input, options) { - return runCallSync("transform", [input, options]); - }, - formatMessagesSync(messages, options) { - return runCallSync("formatMessages", [messages, options]); - }, - analyzeMetafileSync(metafile, options) { - return runCallSync("analyzeMetafile", [metafile, options]); - }, - stop() { - worker.terminate(); - workerThreadService = null; - } - }; - }; - var startSyncServiceWorker = () => { - let workerPort = worker_threads.workerData.workerPort; - let parentPort = worker_threads.parentPort; - let extractProperties = (object) => { - let properties = {}; - if (object && typeof object === "object") { - for (let key in object) { - properties[key] = object[key]; - } - } - return properties; - }; - try { - let service = ensureServiceIsRunning(); - defaultWD = worker_threads.workerData.defaultWD; - parentPort.on("message", (msg) => { - (async () => { - let { sharedBuffer, id, command, args } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - try { - switch (command) { - case "build": - workerPort.postMessage({ id, resolve: await service.build(args[0]) }); - break; - case "transform": - workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); - break; - case "formatMessages": - workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); - break; - case "analyzeMetafile": - workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); - break; - default: - throw new Error(`Invalid command: ${command}`); - } - } catch (reject) { - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - } - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - })(); - }); - } catch (reject) { - parentPort.on("message", (msg) => { - let { sharedBuffer, id } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - }); - } - }; - if (isInternalWorkerThread) { - startSyncServiceWorker(); - } - var node_default = node_exports; - } -}); - -// node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js -var require_delayed_stream = __commonJS({ - "node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports2, module2) { - var Stream = require("stream").Stream; - var util = require("util"); - module2.exports = DelayedStream; - function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; - } - util.inherits(DelayedStream, Stream); - DelayedStream.create = function(source, options) { - var delayedStream = new this(); - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - delayedStream.source = source; - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - source.on("error", function() { - }); - if (delayedStream.pauseStream) { - source.pause(); - } - return delayedStream; - }; - Object.defineProperty(DelayedStream.prototype, "readable", { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; - } - }); - DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); - }; - DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - this.source.resume(); - }; - DelayedStream.prototype.pause = function() { - this.source.pause(); - }; - DelayedStream.prototype.release = function() { - this._released = true; - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; - }; - DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; - }; - DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - if (args[0] === "data") { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - this._bufferedEvents.push(args); - }; - DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - if (this.dataSize <= this.maxDataSize) { - return; - } - this._maxDataSizeExceeded = true; - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this.emit("error", new Error(message)); - }; - } -}); - -// node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js -var require_combined_stream = __commonJS({ - "node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) { - var util = require("util"); - var Stream = require("stream").Stream; - var DelayedStream = require_delayed_stream(); - module2.exports = CombinedStream; - function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; - } - util.inherits(CombinedStream, Stream); - CombinedStream.create = function(options) { - var combinedStream = new this(); - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - return combinedStream; - }; - CombinedStream.isStreamLike = function(stream) { - return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); - }; - CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams - }); - stream.on("data", this._checkDataSize.bind(this)); - stream = newStream; - } - this._handleErrors(stream); - if (this.pauseStreams) { - stream.pause(); - } - } - this._streams.push(stream); - return this; - }; - CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; - }; - CombinedStream.prototype._getNext = function() { - this._currentStream = null; - if (this._insideLoop) { - this._pendingNext = true; - return; - } - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } - }; - CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - if (typeof stream == "undefined") { - this.end(); - return; - } - if (typeof stream !== "function") { - this._pipeNext(stream); - return; - } - var getStream = stream; - getStream(function(stream2) { - var isStreamLike = CombinedStream.isStreamLike(stream2); - if (isStreamLike) { - stream2.on("data", this._checkDataSize.bind(this)); - this._handleErrors(stream2); - } - this._pipeNext(stream2); - }.bind(this)); - }; - CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on("end", this._getNext.bind(this)); - stream.pipe(this, { end: false }); - return; - } - var value = stream; - this.write(value); - this._getNext(); - }; - CombinedStream.prototype._handleErrors = function(stream) { - var self2 = this; - stream.on("error", function(err) { - self2._emitError(err); - }); - }; - CombinedStream.prototype.write = function(data) { - this.emit("data", data); - }; - CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); - this.emit("pause"); - }; - CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); - this.emit("resume"); - }; - CombinedStream.prototype.end = function() { - this._reset(); - this.emit("end"); - }; - CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit("close"); - }; - CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; - }; - CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; - this._emitError(new Error(message)); - }; - CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - var self2 = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - self2.dataSize += stream.dataSize; - }); - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } - }; - CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit("error", err); - }; - } -}); - -// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json -var require_db = __commonJS({ - "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports2, module2) { - module2.exports = { - "application/1d-interleaved-parityfec": { - source: "iana" - }, - "application/3gpdash-qoe-report+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/3gpp-ims+xml": { - source: "iana", - compressible: true - }, - "application/3gpphal+json": { - source: "iana", - compressible: true - }, - "application/3gpphalforms+json": { - source: "iana", - compressible: true - }, - "application/a2l": { - source: "iana" - }, - "application/ace+cbor": { - source: "iana" - }, - "application/activemessage": { - source: "iana" - }, - "application/activity+json": { - source: "iana", - compressible: true - }, - "application/alto-costmap+json": { - source: "iana", - compressible: true - }, - "application/alto-costmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-directory+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcost+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointcostparams+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointprop+json": { - source: "iana", - compressible: true - }, - "application/alto-endpointpropparams+json": { - source: "iana", - compressible: true - }, - "application/alto-error+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmap+json": { - source: "iana", - compressible: true - }, - "application/alto-networkmapfilter+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamcontrol+json": { - source: "iana", - compressible: true - }, - "application/alto-updatestreamparams+json": { - source: "iana", - compressible: true - }, - "application/aml": { - source: "iana" - }, - "application/andrew-inset": { - source: "iana", - extensions: ["ez"] - }, - "application/applefile": { - source: "iana" - }, - "application/applixware": { - source: "apache", - extensions: ["aw"] - }, - "application/at+jwt": { - source: "iana" - }, - "application/atf": { - source: "iana" - }, - "application/atfx": { - source: "iana" - }, - "application/atom+xml": { - source: "iana", - compressible: true, - extensions: ["atom"] - }, - "application/atomcat+xml": { - source: "iana", - compressible: true, - extensions: ["atomcat"] - }, - "application/atomdeleted+xml": { - source: "iana", - compressible: true, - extensions: ["atomdeleted"] - }, - "application/atomicmail": { - source: "iana" - }, - "application/atomsvc+xml": { - source: "iana", - compressible: true, - extensions: ["atomsvc"] - }, - "application/atsc-dwd+xml": { - source: "iana", - compressible: true, - extensions: ["dwd"] - }, - "application/atsc-dynamic-event-message": { - source: "iana" - }, - "application/atsc-held+xml": { - source: "iana", - compressible: true, - extensions: ["held"] - }, - "application/atsc-rdt+json": { - source: "iana", - compressible: true - }, - "application/atsc-rsat+xml": { - source: "iana", - compressible: true, - extensions: ["rsat"] - }, - "application/atxml": { - source: "iana" - }, - "application/auth-policy+xml": { - source: "iana", - compressible: true - }, - "application/bacnet-xdd+zip": { - source: "iana", - compressible: false - }, - "application/batch-smtp": { - source: "iana" - }, - "application/bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/beep+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/calendar+json": { - source: "iana", - compressible: true - }, - "application/calendar+xml": { - source: "iana", - compressible: true, - extensions: ["xcs"] - }, - "application/call-completion": { - source: "iana" - }, - "application/cals-1840": { - source: "iana" - }, - "application/captive+json": { - source: "iana", - compressible: true - }, - "application/cbor": { - source: "iana" - }, - "application/cbor-seq": { - source: "iana" - }, - "application/cccex": { - source: "iana" - }, - "application/ccmp+xml": { - source: "iana", - compressible: true - }, - "application/ccxml+xml": { - source: "iana", - compressible: true, - extensions: ["ccxml"] - }, - "application/cdfx+xml": { - source: "iana", - compressible: true, - extensions: ["cdfx"] - }, - "application/cdmi-capability": { - source: "iana", - extensions: ["cdmia"] - }, - "application/cdmi-container": { - source: "iana", - extensions: ["cdmic"] - }, - "application/cdmi-domain": { - source: "iana", - extensions: ["cdmid"] - }, - "application/cdmi-object": { - source: "iana", - extensions: ["cdmio"] - }, - "application/cdmi-queue": { - source: "iana", - extensions: ["cdmiq"] - }, - "application/cdni": { - source: "iana" - }, - "application/cea": { - source: "iana" - }, - "application/cea-2018+xml": { - source: "iana", - compressible: true - }, - "application/cellml+xml": { - source: "iana", - compressible: true - }, - "application/cfw": { - source: "iana" - }, - "application/city+json": { - source: "iana", - compressible: true - }, - "application/clr": { - source: "iana" - }, - "application/clue+xml": { - source: "iana", - compressible: true - }, - "application/clue_info+xml": { - source: "iana", - compressible: true - }, - "application/cms": { - source: "iana" - }, - "application/cnrp+xml": { - source: "iana", - compressible: true - }, - "application/coap-group+json": { - source: "iana", - compressible: true - }, - "application/coap-payload": { - source: "iana" - }, - "application/commonground": { - source: "iana" - }, - "application/conference-info+xml": { - source: "iana", - compressible: true - }, - "application/cose": { - source: "iana" - }, - "application/cose-key": { - source: "iana" - }, - "application/cose-key-set": { - source: "iana" - }, - "application/cpl+xml": { - source: "iana", - compressible: true, - extensions: ["cpl"] - }, - "application/csrattrs": { - source: "iana" - }, - "application/csta+xml": { - source: "iana", - compressible: true - }, - "application/cstadata+xml": { - source: "iana", - compressible: true - }, - "application/csvm+json": { - source: "iana", - compressible: true - }, - "application/cu-seeme": { - source: "apache", - extensions: ["cu"] - }, - "application/cwt": { - source: "iana" - }, - "application/cybercash": { - source: "iana" - }, - "application/dart": { - compressible: true - }, - "application/dash+xml": { - source: "iana", - compressible: true, - extensions: ["mpd"] - }, - "application/dash-patch+xml": { - source: "iana", - compressible: true, - extensions: ["mpp"] - }, - "application/dashdelta": { - source: "iana" - }, - "application/davmount+xml": { - source: "iana", - compressible: true, - extensions: ["davmount"] - }, - "application/dca-rft": { - source: "iana" - }, - "application/dcd": { - source: "iana" - }, - "application/dec-dx": { - source: "iana" - }, - "application/dialog-info+xml": { - source: "iana", - compressible: true - }, - "application/dicom": { - source: "iana" - }, - "application/dicom+json": { - source: "iana", - compressible: true - }, - "application/dicom+xml": { - source: "iana", - compressible: true - }, - "application/dii": { - source: "iana" - }, - "application/dit": { - source: "iana" - }, - "application/dns": { - source: "iana" - }, - "application/dns+json": { - source: "iana", - compressible: true - }, - "application/dns-message": { - source: "iana" - }, - "application/docbook+xml": { - source: "apache", - compressible: true, - extensions: ["dbk"] - }, - "application/dots+cbor": { - source: "iana" - }, - "application/dskpp+xml": { - source: "iana", - compressible: true - }, - "application/dssc+der": { - source: "iana", - extensions: ["dssc"] - }, - "application/dssc+xml": { - source: "iana", - compressible: true, - extensions: ["xdssc"] - }, - "application/dvcs": { - source: "iana" - }, - "application/ecmascript": { - source: "iana", - compressible: true, - extensions: ["es", "ecma"] - }, - "application/edi-consent": { - source: "iana" - }, - "application/edi-x12": { - source: "iana", - compressible: false - }, - "application/edifact": { - source: "iana", - compressible: false - }, - "application/efi": { - source: "iana" - }, - "application/elm+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/elm+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.cap+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/emergencycalldata.comment+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.control+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.deviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.ecall.msd": { - source: "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.serviceinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.subscriberinfo+xml": { - source: "iana", - compressible: true - }, - "application/emergencycalldata.veds+xml": { - source: "iana", - compressible: true - }, - "application/emma+xml": { - source: "iana", - compressible: true, - extensions: ["emma"] - }, - "application/emotionml+xml": { - source: "iana", - compressible: true, - extensions: ["emotionml"] - }, - "application/encaprtp": { - source: "iana" - }, - "application/epp+xml": { - source: "iana", - compressible: true - }, - "application/epub+zip": { - source: "iana", - compressible: false, - extensions: ["epub"] - }, - "application/eshop": { - source: "iana" - }, - "application/exi": { - source: "iana", - extensions: ["exi"] - }, - "application/expect-ct-report+json": { - source: "iana", - compressible: true - }, - "application/express": { - source: "iana", - extensions: ["exp"] - }, - "application/fastinfoset": { - source: "iana" - }, - "application/fastsoap": { - source: "iana" - }, - "application/fdt+xml": { - source: "iana", - compressible: true, - extensions: ["fdt"] - }, - "application/fhir+json": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fhir+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/fido.trusted-apps+json": { - compressible: true - }, - "application/fits": { - source: "iana" - }, - "application/flexfec": { - source: "iana" - }, - "application/font-sfnt": { - source: "iana" - }, - "application/font-tdpfr": { - source: "iana", - extensions: ["pfr"] - }, - "application/font-woff": { - source: "iana", - compressible: false - }, - "application/framework-attributes+xml": { - source: "iana", - compressible: true - }, - "application/geo+json": { - source: "iana", - compressible: true, - extensions: ["geojson"] - }, - "application/geo+json-seq": { - source: "iana" - }, - "application/geopackage+sqlite3": { - source: "iana" - }, - "application/geoxacml+xml": { - source: "iana", - compressible: true - }, - "application/gltf-buffer": { - source: "iana" - }, - "application/gml+xml": { - source: "iana", - compressible: true, - extensions: ["gml"] - }, - "application/gpx+xml": { - source: "apache", - compressible: true, - extensions: ["gpx"] - }, - "application/gxf": { - source: "apache", - extensions: ["gxf"] - }, - "application/gzip": { - source: "iana", - compressible: false, - extensions: ["gz"] - }, - "application/h224": { - source: "iana" - }, - "application/held+xml": { - source: "iana", - compressible: true - }, - "application/hjson": { - extensions: ["hjson"] - }, - "application/http": { - source: "iana" - }, - "application/hyperstudio": { - source: "iana", - extensions: ["stk"] - }, - "application/ibe-key-request+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pkg-reply+xml": { - source: "iana", - compressible: true - }, - "application/ibe-pp-data": { - source: "iana" - }, - "application/iges": { - source: "iana" - }, - "application/im-iscomposing+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/index": { - source: "iana" - }, - "application/index.cmd": { - source: "iana" - }, - "application/index.obj": { - source: "iana" - }, - "application/index.response": { - source: "iana" - }, - "application/index.vnd": { - source: "iana" - }, - "application/inkml+xml": { - source: "iana", - compressible: true, - extensions: ["ink", "inkml"] - }, - "application/iotp": { - source: "iana" - }, - "application/ipfix": { - source: "iana", - extensions: ["ipfix"] - }, - "application/ipp": { - source: "iana" - }, - "application/isup": { - source: "iana" - }, - "application/its+xml": { - source: "iana", - compressible: true, - extensions: ["its"] - }, - "application/java-archive": { - source: "apache", - compressible: false, - extensions: ["jar", "war", "ear"] - }, - "application/java-serialized-object": { - source: "apache", - compressible: false, - extensions: ["set"] - }, - "application/java-vm": { - source: "apache", - compressible: false, - extensions: ["class"] - }, - "application/javascript": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["js", "mjs"] - }, - "application/jf2feed+json": { - source: "iana", - compressible: true - }, - "application/jose": { - source: "iana" - }, - "application/jose+json": { - source: "iana", - compressible: true - }, - "application/jrd+json": { - source: "iana", - compressible: true - }, - "application/jscalendar+json": { - source: "iana", - compressible: true - }, - "application/json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["json", "map"] - }, - "application/json-patch+json": { - source: "iana", - compressible: true - }, - "application/json-seq": { - source: "iana" - }, - "application/json5": { - extensions: ["json5"] - }, - "application/jsonml+json": { - source: "apache", - compressible: true, - extensions: ["jsonml"] - }, - "application/jwk+json": { - source: "iana", - compressible: true - }, - "application/jwk-set+json": { - source: "iana", - compressible: true - }, - "application/jwt": { - source: "iana" - }, - "application/kpml-request+xml": { - source: "iana", - compressible: true - }, - "application/kpml-response+xml": { - source: "iana", - compressible: true - }, - "application/ld+json": { - source: "iana", - compressible: true, - extensions: ["jsonld"] - }, - "application/lgr+xml": { - source: "iana", - compressible: true, - extensions: ["lgr"] - }, - "application/link-format": { - source: "iana" - }, - "application/load-control+xml": { - source: "iana", - compressible: true - }, - "application/lost+xml": { - source: "iana", - compressible: true, - extensions: ["lostxml"] - }, - "application/lostsync+xml": { - source: "iana", - compressible: true - }, - "application/lpf+zip": { - source: "iana", - compressible: false - }, - "application/lxf": { - source: "iana" - }, - "application/mac-binhex40": { - source: "iana", - extensions: ["hqx"] - }, - "application/mac-compactpro": { - source: "apache", - extensions: ["cpt"] - }, - "application/macwriteii": { - source: "iana" - }, - "application/mads+xml": { - source: "iana", - compressible: true, - extensions: ["mads"] - }, - "application/manifest+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["webmanifest"] - }, - "application/marc": { - source: "iana", - extensions: ["mrc"] - }, - "application/marcxml+xml": { - source: "iana", - compressible: true, - extensions: ["mrcx"] - }, - "application/mathematica": { - source: "iana", - extensions: ["ma", "nb", "mb"] - }, - "application/mathml+xml": { - source: "iana", - compressible: true, - extensions: ["mathml"] - }, - "application/mathml-content+xml": { - source: "iana", - compressible: true - }, - "application/mathml-presentation+xml": { - source: "iana", - compressible: true - }, - "application/mbms-associated-procedure-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-deregister+xml": { - source: "iana", - compressible: true - }, - "application/mbms-envelope+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk+xml": { - source: "iana", - compressible: true - }, - "application/mbms-msk-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-protection-description+xml": { - source: "iana", - compressible: true - }, - "application/mbms-reception-report+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register+xml": { - source: "iana", - compressible: true - }, - "application/mbms-register-response+xml": { - source: "iana", - compressible: true - }, - "application/mbms-schedule+xml": { - source: "iana", - compressible: true - }, - "application/mbms-user-service-description+xml": { - source: "iana", - compressible: true - }, - "application/mbox": { - source: "iana", - extensions: ["mbox"] - }, - "application/media-policy-dataset+xml": { - source: "iana", - compressible: true, - extensions: ["mpf"] - }, - "application/media_control+xml": { - source: "iana", - compressible: true - }, - "application/mediaservercontrol+xml": { - source: "iana", - compressible: true, - extensions: ["mscml"] - }, - "application/merge-patch+json": { - source: "iana", - compressible: true - }, - "application/metalink+xml": { - source: "apache", - compressible: true, - extensions: ["metalink"] - }, - "application/metalink4+xml": { - source: "iana", - compressible: true, - extensions: ["meta4"] - }, - "application/mets+xml": { - source: "iana", - compressible: true, - extensions: ["mets"] - }, - "application/mf4": { - source: "iana" - }, - "application/mikey": { - source: "iana" - }, - "application/mipc": { - source: "iana" - }, - "application/missing-blocks+cbor-seq": { - source: "iana" - }, - "application/mmt-aei+xml": { - source: "iana", - compressible: true, - extensions: ["maei"] - }, - "application/mmt-usd+xml": { - source: "iana", - compressible: true, - extensions: ["musd"] - }, - "application/mods+xml": { - source: "iana", - compressible: true, - extensions: ["mods"] - }, - "application/moss-keys": { - source: "iana" - }, - "application/moss-signature": { - source: "iana" - }, - "application/mosskey-data": { - source: "iana" - }, - "application/mosskey-request": { - source: "iana" - }, - "application/mp21": { - source: "iana", - extensions: ["m21", "mp21"] - }, - "application/mp4": { - source: "iana", - extensions: ["mp4s", "m4p"] - }, - "application/mpeg4-generic": { - source: "iana" - }, - "application/mpeg4-iod": { - source: "iana" - }, - "application/mpeg4-iod-xmt": { - source: "iana" - }, - "application/mrb-consumer+xml": { - source: "iana", - compressible: true - }, - "application/mrb-publish+xml": { - source: "iana", - compressible: true - }, - "application/msc-ivr+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msc-mixer+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/msword": { - source: "iana", - compressible: false, - extensions: ["doc", "dot"] - }, - "application/mud+json": { - source: "iana", - compressible: true - }, - "application/multipart-core": { - source: "iana" - }, - "application/mxf": { - source: "iana", - extensions: ["mxf"] - }, - "application/n-quads": { - source: "iana", - extensions: ["nq"] - }, - "application/n-triples": { - source: "iana", - extensions: ["nt"] - }, - "application/nasdata": { - source: "iana" - }, - "application/news-checkgroups": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-groupinfo": { - source: "iana", - charset: "US-ASCII" - }, - "application/news-transmission": { - source: "iana" - }, - "application/nlsml+xml": { - source: "iana", - compressible: true - }, - "application/node": { - source: "iana", - extensions: ["cjs"] - }, - "application/nss": { - source: "iana" - }, - "application/oauth-authz-req+jwt": { - source: "iana" - }, - "application/oblivious-dns-message": { - source: "iana" - }, - "application/ocsp-request": { - source: "iana" - }, - "application/ocsp-response": { - source: "iana" - }, - "application/octet-stream": { - source: "iana", - compressible: false, - extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] - }, - "application/oda": { - source: "iana", - extensions: ["oda"] - }, - "application/odm+xml": { - source: "iana", - compressible: true - }, - "application/odx": { - source: "iana" - }, - "application/oebps-package+xml": { - source: "iana", - compressible: true, - extensions: ["of"] - }, - "application/ogg": { - source: "iana", - compressible: false, - extensions: ["ogx"] - }, - "application/omdoc+xml": { - source: "apache", - compressible: true, - extensions: ["omdoc"] - }, - "application/onenote": { - source: "apache", - extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] - }, - "application/opc-nodeset+xml": { - source: "iana", - compressible: true - }, - "application/oscore": { - source: "iana" - }, - "application/oxps": { - source: "iana", - extensions: ["oxps"] - }, - "application/p21": { - source: "iana" - }, - "application/p21+zip": { - source: "iana", - compressible: false - }, - "application/p2p-overlay+xml": { - source: "iana", - compressible: true, - extensions: ["relo"] - }, - "application/parityfec": { - source: "iana" - }, - "application/passport": { - source: "iana" - }, - "application/patch-ops-error+xml": { - source: "iana", - compressible: true, - extensions: ["xer"] - }, - "application/pdf": { - source: "iana", - compressible: false, - extensions: ["pdf"] - }, - "application/pdx": { - source: "iana" - }, - "application/pem-certificate-chain": { - source: "iana" - }, - "application/pgp-encrypted": { - source: "iana", - compressible: false, - extensions: ["pgp"] - }, - "application/pgp-keys": { - source: "iana", - extensions: ["asc"] - }, - "application/pgp-signature": { - source: "iana", - extensions: ["asc", "sig"] - }, - "application/pics-rules": { - source: "apache", - extensions: ["prf"] - }, - "application/pidf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pidf-diff+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/pkcs10": { - source: "iana", - extensions: ["p10"] - }, - "application/pkcs12": { - source: "iana" - }, - "application/pkcs7-mime": { - source: "iana", - extensions: ["p7m", "p7c"] - }, - "application/pkcs7-signature": { - source: "iana", - extensions: ["p7s"] - }, - "application/pkcs8": { - source: "iana", - extensions: ["p8"] - }, - "application/pkcs8-encrypted": { - source: "iana" - }, - "application/pkix-attr-cert": { - source: "iana", - extensions: ["ac"] - }, - "application/pkix-cert": { - source: "iana", - extensions: ["cer"] - }, - "application/pkix-crl": { - source: "iana", - extensions: ["crl"] - }, - "application/pkix-pkipath": { - source: "iana", - extensions: ["pkipath"] - }, - "application/pkixcmp": { - source: "iana", - extensions: ["pki"] - }, - "application/pls+xml": { - source: "iana", - compressible: true, - extensions: ["pls"] - }, - "application/poc-settings+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/postscript": { - source: "iana", - compressible: true, - extensions: ["ai", "eps", "ps"] - }, - "application/ppsp-tracker+json": { - source: "iana", - compressible: true - }, - "application/problem+json": { - source: "iana", - compressible: true - }, - "application/problem+xml": { - source: "iana", - compressible: true - }, - "application/provenance+xml": { - source: "iana", - compressible: true, - extensions: ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - source: "iana" - }, - "application/prs.cww": { - source: "iana", - extensions: ["cww"] - }, - "application/prs.cyn": { - source: "iana", - charset: "7-BIT" - }, - "application/prs.hpub+zip": { - source: "iana", - compressible: false - }, - "application/prs.nprend": { - source: "iana" - }, - "application/prs.plucker": { - source: "iana" - }, - "application/prs.rdf-xml-crypt": { - source: "iana" - }, - "application/prs.xsf+xml": { - source: "iana", - compressible: true - }, - "application/pskc+xml": { - source: "iana", - compressible: true, - extensions: ["pskcxml"] - }, - "application/pvd+json": { - source: "iana", - compressible: true - }, - "application/qsig": { - source: "iana" - }, - "application/raml+yaml": { - compressible: true, - extensions: ["raml"] - }, - "application/raptorfec": { - source: "iana" - }, - "application/rdap+json": { - source: "iana", - compressible: true - }, - "application/rdf+xml": { - source: "iana", - compressible: true, - extensions: ["rdf", "owl"] - }, - "application/reginfo+xml": { - source: "iana", - compressible: true, - extensions: ["rif"] - }, - "application/relax-ng-compact-syntax": { - source: "iana", - extensions: ["rnc"] - }, - "application/remote-printing": { - source: "iana" - }, - "application/reputon+json": { - source: "iana", - compressible: true - }, - "application/resource-lists+xml": { - source: "iana", - compressible: true, - extensions: ["rl"] - }, - "application/resource-lists-diff+xml": { - source: "iana", - compressible: true, - extensions: ["rld"] - }, - "application/rfc+xml": { - source: "iana", - compressible: true - }, - "application/riscos": { - source: "iana" - }, - "application/rlmi+xml": { - source: "iana", - compressible: true - }, - "application/rls-services+xml": { - source: "iana", - compressible: true, - extensions: ["rs"] - }, - "application/route-apd+xml": { - source: "iana", - compressible: true, - extensions: ["rapd"] - }, - "application/route-s-tsid+xml": { - source: "iana", - compressible: true, - extensions: ["sls"] - }, - "application/route-usd+xml": { - source: "iana", - compressible: true, - extensions: ["rusd"] - }, - "application/rpki-ghostbusters": { - source: "iana", - extensions: ["gbr"] - }, - "application/rpki-manifest": { - source: "iana", - extensions: ["mft"] - }, - "application/rpki-publication": { - source: "iana" - }, - "application/rpki-roa": { - source: "iana", - extensions: ["roa"] - }, - "application/rpki-updown": { - source: "iana" - }, - "application/rsd+xml": { - source: "apache", - compressible: true, - extensions: ["rsd"] - }, - "application/rss+xml": { - source: "apache", - compressible: true, - extensions: ["rss"] - }, - "application/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "application/rtploopback": { - source: "iana" - }, - "application/rtx": { - source: "iana" - }, - "application/samlassertion+xml": { - source: "iana", - compressible: true - }, - "application/samlmetadata+xml": { - source: "iana", - compressible: true - }, - "application/sarif+json": { - source: "iana", - compressible: true - }, - "application/sarif-external-properties+json": { - source: "iana", - compressible: true - }, - "application/sbe": { - source: "iana" - }, - "application/sbml+xml": { - source: "iana", - compressible: true, - extensions: ["sbml"] - }, - "application/scaip+xml": { - source: "iana", - compressible: true - }, - "application/scim+json": { - source: "iana", - compressible: true - }, - "application/scvp-cv-request": { - source: "iana", - extensions: ["scq"] - }, - "application/scvp-cv-response": { - source: "iana", - extensions: ["scs"] - }, - "application/scvp-vp-request": { - source: "iana", - extensions: ["spq"] - }, - "application/scvp-vp-response": { - source: "iana", - extensions: ["spp"] - }, - "application/sdp": { - source: "iana", - extensions: ["sdp"] - }, - "application/secevent+jwt": { - source: "iana" - }, - "application/senml+cbor": { - source: "iana" - }, - "application/senml+json": { - source: "iana", - compressible: true - }, - "application/senml+xml": { - source: "iana", - compressible: true, - extensions: ["senmlx"] - }, - "application/senml-etch+cbor": { - source: "iana" - }, - "application/senml-etch+json": { - source: "iana", - compressible: true - }, - "application/senml-exi": { - source: "iana" - }, - "application/sensml+cbor": { - source: "iana" - }, - "application/sensml+json": { - source: "iana", - compressible: true - }, - "application/sensml+xml": { - source: "iana", - compressible: true, - extensions: ["sensmlx"] - }, - "application/sensml-exi": { - source: "iana" - }, - "application/sep+xml": { - source: "iana", - compressible: true - }, - "application/sep-exi": { - source: "iana" - }, - "application/session-info": { - source: "iana" - }, - "application/set-payment": { - source: "iana" - }, - "application/set-payment-initiation": { - source: "iana", - extensions: ["setpay"] - }, - "application/set-registration": { - source: "iana" - }, - "application/set-registration-initiation": { - source: "iana", - extensions: ["setreg"] - }, - "application/sgml": { - source: "iana" - }, - "application/sgml-open-catalog": { - source: "iana" - }, - "application/shf+xml": { - source: "iana", - compressible: true, - extensions: ["shf"] - }, - "application/sieve": { - source: "iana", - extensions: ["siv", "sieve"] - }, - "application/simple-filter+xml": { - source: "iana", - compressible: true - }, - "application/simple-message-summary": { - source: "iana" - }, - "application/simplesymbolcontainer": { - source: "iana" - }, - "application/sipc": { - source: "iana" - }, - "application/slate": { - source: "iana" - }, - "application/smil": { - source: "iana" - }, - "application/smil+xml": { - source: "iana", - compressible: true, - extensions: ["smi", "smil"] - }, - "application/smpte336m": { - source: "iana" - }, - "application/soap+fastinfoset": { - source: "iana" - }, - "application/soap+xml": { - source: "iana", - compressible: true - }, - "application/sparql-query": { - source: "iana", - extensions: ["rq"] - }, - "application/sparql-results+xml": { - source: "iana", - compressible: true, - extensions: ["srx"] - }, - "application/spdx+json": { - source: "iana", - compressible: true - }, - "application/spirits-event+xml": { - source: "iana", - compressible: true - }, - "application/sql": { - source: "iana" - }, - "application/srgs": { - source: "iana", - extensions: ["gram"] - }, - "application/srgs+xml": { - source: "iana", - compressible: true, - extensions: ["grxml"] - }, - "application/sru+xml": { - source: "iana", - compressible: true, - extensions: ["sru"] - }, - "application/ssdl+xml": { - source: "apache", - compressible: true, - extensions: ["ssdl"] - }, - "application/ssml+xml": { - source: "iana", - compressible: true, - extensions: ["ssml"] - }, - "application/stix+json": { - source: "iana", - compressible: true - }, - "application/swid+xml": { - source: "iana", - compressible: true, - extensions: ["swidtag"] - }, - "application/tamp-apex-update": { - source: "iana" - }, - "application/tamp-apex-update-confirm": { - source: "iana" - }, - "application/tamp-community-update": { - source: "iana" - }, - "application/tamp-community-update-confirm": { - source: "iana" - }, - "application/tamp-error": { - source: "iana" - }, - "application/tamp-sequence-adjust": { - source: "iana" - }, - "application/tamp-sequence-adjust-confirm": { - source: "iana" - }, - "application/tamp-status-query": { - source: "iana" - }, - "application/tamp-status-response": { - source: "iana" - }, - "application/tamp-update": { - source: "iana" - }, - "application/tamp-update-confirm": { - source: "iana" - }, - "application/tar": { - compressible: true - }, - "application/taxii+json": { - source: "iana", - compressible: true - }, - "application/td+json": { - source: "iana", - compressible: true - }, - "application/tei+xml": { - source: "iana", - compressible: true, - extensions: ["tei", "teicorpus"] - }, - "application/tetra_isi": { - source: "iana" - }, - "application/thraud+xml": { - source: "iana", - compressible: true, - extensions: ["tfi"] - }, - "application/timestamp-query": { - source: "iana" - }, - "application/timestamp-reply": { - source: "iana" - }, - "application/timestamped-data": { - source: "iana", - extensions: ["tsd"] - }, - "application/tlsrpt+gzip": { - source: "iana" - }, - "application/tlsrpt+json": { - source: "iana", - compressible: true - }, - "application/tnauthlist": { - source: "iana" - }, - "application/token-introspection+jwt": { - source: "iana" - }, - "application/toml": { - compressible: true, - extensions: ["toml"] - }, - "application/trickle-ice-sdpfrag": { - source: "iana" - }, - "application/trig": { - source: "iana", - extensions: ["trig"] - }, - "application/ttml+xml": { - source: "iana", - compressible: true, - extensions: ["ttml"] - }, - "application/tve-trigger": { - source: "iana" - }, - "application/tzif": { - source: "iana" - }, - "application/tzif-leap": { - source: "iana" - }, - "application/ubjson": { - compressible: false, - extensions: ["ubj"] - }, - "application/ulpfec": { - source: "iana" - }, - "application/urc-grpsheet+xml": { - source: "iana", - compressible: true - }, - "application/urc-ressheet+xml": { - source: "iana", - compressible: true, - extensions: ["rsheet"] - }, - "application/urc-targetdesc+xml": { - source: "iana", - compressible: true, - extensions: ["td"] - }, - "application/urc-uisocketdesc+xml": { - source: "iana", - compressible: true - }, - "application/vcard+json": { - source: "iana", - compressible: true - }, - "application/vcard+xml": { - source: "iana", - compressible: true - }, - "application/vemmi": { - source: "iana" - }, - "application/vividence.scriptfile": { - source: "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - source: "iana", - compressible: true, - extensions: ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp-v2x-local-service-information": { - source: "iana" - }, - "application/vnd.3gpp.5gnas": { - source: "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.bsf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gmop+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.gtpc": { - source: "iana" - }, - "application/vnd.3gpp.interworking-data": { - source: "iana" - }, - "application/vnd.3gpp.lpp": { - source: "iana" - }, - "application/vnd.3gpp.mc-signalling-ear": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-payload": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-signalling": { - source: "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.mid-call+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ngap": { - source: "iana" - }, - "application/vnd.3gpp.pfcp": { - source: "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - source: "iana", - extensions: ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - source: "iana", - extensions: ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - source: "iana", - extensions: ["pvb"] - }, - "application/vnd.3gpp.s1ap": { - source: "iana" - }, - "application/vnd.3gpp.sms": { - source: "iana" - }, - "application/vnd.3gpp.sms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.srvcc-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp.ussd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.3gpp2.sms": { - source: "iana" - }, - "application/vnd.3gpp2.tcap": { - source: "iana", - extensions: ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - source: "iana" - }, - "application/vnd.3m.post-it-notes": { - source: "iana", - extensions: ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - source: "iana", - extensions: ["also"] - }, - "application/vnd.accpac.simply.imp": { - source: "iana", - extensions: ["imp"] - }, - "application/vnd.acucobol": { - source: "iana", - extensions: ["acu"] - }, - "application/vnd.acucorp": { - source: "iana", - extensions: ["atc", "acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - source: "apache", - compressible: false, - extensions: ["air"] - }, - "application/vnd.adobe.flash.movie": { - source: "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - source: "iana", - extensions: ["fcdt"] - }, - "application/vnd.adobe.fxp": { - source: "iana", - extensions: ["fxp", "fxpl"] - }, - "application/vnd.adobe.partial-upload": { - source: "iana" - }, - "application/vnd.adobe.xdp+xml": { - source: "iana", - compressible: true, - extensions: ["xdp"] - }, - "application/vnd.adobe.xfdf": { - source: "iana", - extensions: ["xfdf"] - }, - "application/vnd.aether.imp": { - source: "iana" - }, - "application/vnd.afpc.afplinedata": { - source: "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - source: "iana" - }, - "application/vnd.afpc.cmoca-cmresource": { - source: "iana" - }, - "application/vnd.afpc.foca-charset": { - source: "iana" - }, - "application/vnd.afpc.foca-codedfont": { - source: "iana" - }, - "application/vnd.afpc.foca-codepage": { - source: "iana" - }, - "application/vnd.afpc.modca": { - source: "iana" - }, - "application/vnd.afpc.modca-cmtable": { - source: "iana" - }, - "application/vnd.afpc.modca-formdef": { - source: "iana" - }, - "application/vnd.afpc.modca-mediummap": { - source: "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - source: "iana" - }, - "application/vnd.afpc.modca-overlay": { - source: "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - source: "iana" - }, - "application/vnd.age": { - source: "iana", - extensions: ["age"] - }, - "application/vnd.ah-barcode": { - source: "iana" - }, - "application/vnd.ahead.space": { - source: "iana", - extensions: ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - source: "iana", - extensions: ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - source: "iana", - extensions: ["azs"] - }, - "application/vnd.amadeus+json": { - source: "iana", - compressible: true - }, - "application/vnd.amazon.ebook": { - source: "apache", - extensions: ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - source: "iana" - }, - "application/vnd.americandynamics.acc": { - source: "iana", - extensions: ["acc"] - }, - "application/vnd.amiga.ami": { - source: "iana", - extensions: ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - source: "iana", - compressible: true - }, - "application/vnd.android.ota": { - source: "iana" - }, - "application/vnd.android.package-archive": { - source: "apache", - compressible: false, - extensions: ["apk"] - }, - "application/vnd.anki": { - source: "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - source: "iana", - extensions: ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - source: "apache", - extensions: ["fti"] - }, - "application/vnd.antix.game-component": { - source: "iana", - extensions: ["atx"] - }, - "application/vnd.apache.arrow.file": { - source: "iana" - }, - "application/vnd.apache.arrow.stream": { - source: "iana" - }, - "application/vnd.apache.thrift.binary": { - source: "iana" - }, - "application/vnd.apache.thrift.compact": { - source: "iana" - }, - "application/vnd.apache.thrift.json": { - source: "iana" - }, - "application/vnd.api+json": { - source: "iana", - compressible: true - }, - "application/vnd.aplextor.warrp+json": { - source: "iana", - compressible: true - }, - "application/vnd.apothekende.reservation+json": { - source: "iana", - compressible: true - }, - "application/vnd.apple.installer+xml": { - source: "iana", - compressible: true, - extensions: ["mpkg"] - }, - "application/vnd.apple.keynote": { - source: "iana", - extensions: ["key"] - }, - "application/vnd.apple.mpegurl": { - source: "iana", - extensions: ["m3u8"] - }, - "application/vnd.apple.numbers": { - source: "iana", - extensions: ["numbers"] - }, - "application/vnd.apple.pages": { - source: "iana", - extensions: ["pages"] - }, - "application/vnd.apple.pkpass": { - compressible: false, - extensions: ["pkpass"] - }, - "application/vnd.arastra.swi": { - source: "iana" - }, - "application/vnd.aristanetworks.swi": { - source: "iana", - extensions: ["swi"] - }, - "application/vnd.artisan+json": { - source: "iana", - compressible: true - }, - "application/vnd.artsquare": { - source: "iana" - }, - "application/vnd.astraea-software.iota": { - source: "iana", - extensions: ["iota"] - }, - "application/vnd.audiograph": { - source: "iana", - extensions: ["aep"] - }, - "application/vnd.autopackage": { - source: "iana" - }, - "application/vnd.avalon+json": { - source: "iana", - compressible: true - }, - "application/vnd.avistar+xml": { - source: "iana", - compressible: true - }, - "application/vnd.balsamiq.bmml+xml": { - source: "iana", - compressible: true, - extensions: ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - source: "iana" - }, - "application/vnd.banana-accounting": { - source: "iana" - }, - "application/vnd.bbf.usp.error": { - source: "iana" - }, - "application/vnd.bbf.usp.msg": { - source: "iana" - }, - "application/vnd.bbf.usp.msg+json": { - source: "iana", - compressible: true - }, - "application/vnd.bekitzur-stech+json": { - source: "iana", - compressible: true - }, - "application/vnd.bint.med-content": { - source: "iana" - }, - "application/vnd.biopax.rdf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.blink-idb-value-wrapper": { - source: "iana" - }, - "application/vnd.blueice.multipass": { - source: "iana", - extensions: ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - source: "iana" - }, - "application/vnd.bluetooth.le.oob": { - source: "iana" - }, - "application/vnd.bmi": { - source: "iana", - extensions: ["bmi"] - }, - "application/vnd.bpf": { - source: "iana" - }, - "application/vnd.bpf3": { - source: "iana" - }, - "application/vnd.businessobjects": { - source: "iana", - extensions: ["rep"] - }, - "application/vnd.byu.uapi+json": { - source: "iana", - compressible: true - }, - "application/vnd.cab-jscript": { - source: "iana" - }, - "application/vnd.canon-cpdl": { - source: "iana" - }, - "application/vnd.canon-lips": { - source: "iana" - }, - "application/vnd.capasystems-pg+json": { - source: "iana", - compressible: true - }, - "application/vnd.cendio.thinlinc.clientconf": { - source: "iana" - }, - "application/vnd.century-systems.tcp_stream": { - source: "iana" - }, - "application/vnd.chemdraw+xml": { - source: "iana", - compressible: true, - extensions: ["cdxml"] - }, - "application/vnd.chess-pgn": { - source: "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - source: "iana", - extensions: ["mmd"] - }, - "application/vnd.ciedi": { - source: "iana" - }, - "application/vnd.cinderella": { - source: "iana", - extensions: ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - source: "iana" - }, - "application/vnd.citationstyles.style+xml": { - source: "iana", - compressible: true, - extensions: ["csl"] - }, - "application/vnd.claymore": { - source: "iana", - extensions: ["cla"] - }, - "application/vnd.cloanto.rp9": { - source: "iana", - extensions: ["rp9"] - }, - "application/vnd.clonk.c4group": { - source: "iana", - extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - source: "iana", - extensions: ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - source: "iana", - extensions: ["c11amz"] - }, - "application/vnd.coffeescript": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - source: "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - source: "iana" - }, - "application/vnd.collection+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.doc+json": { - source: "iana", - compressible: true - }, - "application/vnd.collection.next+json": { - source: "iana", - compressible: true - }, - "application/vnd.comicbook+zip": { - source: "iana", - compressible: false - }, - "application/vnd.comicbook-rar": { - source: "iana" - }, - "application/vnd.commerce-battelle": { - source: "iana" - }, - "application/vnd.commonspace": { - source: "iana", - extensions: ["csp"] - }, - "application/vnd.contact.cmsg": { - source: "iana", - extensions: ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - source: "iana", - compressible: true - }, - "application/vnd.cosmocaller": { - source: "iana", - extensions: ["cmc"] - }, - "application/vnd.crick.clicker": { - source: "iana", - extensions: ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - source: "iana", - extensions: ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - source: "iana", - extensions: ["clkp"] - }, - "application/vnd.crick.clicker.template": { - source: "iana", - extensions: ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - source: "iana", - extensions: ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - source: "iana", - compressible: true, - extensions: ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - source: "iana", - compressible: true - }, - "application/vnd.crypto-shade-file": { - source: "iana" - }, - "application/vnd.cryptomator.encrypted": { - source: "iana" - }, - "application/vnd.cryptomator.vault": { - source: "iana" - }, - "application/vnd.ctc-posml": { - source: "iana", - extensions: ["pml"] - }, - "application/vnd.ctct.ws+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cups-pdf": { - source: "iana" - }, - "application/vnd.cups-postscript": { - source: "iana" - }, - "application/vnd.cups-ppd": { - source: "iana", - extensions: ["ppd"] - }, - "application/vnd.cups-raster": { - source: "iana" - }, - "application/vnd.cups-raw": { - source: "iana" - }, - "application/vnd.curl": { - source: "iana" - }, - "application/vnd.curl.car": { - source: "apache", - extensions: ["car"] - }, - "application/vnd.curl.pcurl": { - source: "apache", - extensions: ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.cybank": { - source: "iana" - }, - "application/vnd.cyclonedx+json": { - source: "iana", - compressible: true - }, - "application/vnd.cyclonedx+xml": { - source: "iana", - compressible: true - }, - "application/vnd.d2l.coursepackage1p0+zip": { - source: "iana", - compressible: false - }, - "application/vnd.d3m-dataset": { - source: "iana" - }, - "application/vnd.d3m-problem": { - source: "iana" - }, - "application/vnd.dart": { - source: "iana", - compressible: true, - extensions: ["dart"] - }, - "application/vnd.data-vision.rdz": { - source: "iana", - extensions: ["rdz"] - }, - "application/vnd.datapackage+json": { - source: "iana", - compressible: true - }, - "application/vnd.dataresource+json": { - source: "iana", - compressible: true - }, - "application/vnd.dbf": { - source: "iana", - extensions: ["dbf"] - }, - "application/vnd.debian.binary-package": { - source: "iana" - }, - "application/vnd.dece.data": { - source: "iana", - extensions: ["uvf", "uvvf", "uvd", "uvvd"] - }, - "application/vnd.dece.ttml+xml": { - source: "iana", - compressible: true, - extensions: ["uvt", "uvvt"] - }, - "application/vnd.dece.unspecified": { - source: "iana", - extensions: ["uvx", "uvvx"] - }, - "application/vnd.dece.zip": { - source: "iana", - extensions: ["uvz", "uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - source: "iana", - extensions: ["fe_launch"] - }, - "application/vnd.desmume.movie": { - source: "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - source: "iana" - }, - "application/vnd.dm.delegation+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dna": { - source: "iana", - extensions: ["dna"] - }, - "application/vnd.document+json": { - source: "iana", - compressible: true - }, - "application/vnd.dolby.mlp": { - source: "apache", - extensions: ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - source: "iana" - }, - "application/vnd.dolby.mobile.2": { - source: "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - source: "iana" - }, - "application/vnd.dpgraph": { - source: "iana", - extensions: ["dpg"] - }, - "application/vnd.dreamfactory": { - source: "iana", - extensions: ["dfac"] - }, - "application/vnd.drive+json": { - source: "iana", - compressible: true - }, - "application/vnd.ds-keypoint": { - source: "apache", - extensions: ["kpxx"] - }, - "application/vnd.dtg.local": { - source: "iana" - }, - "application/vnd.dtg.local.flash": { - source: "iana" - }, - "application/vnd.dtg.local.html": { - source: "iana" - }, - "application/vnd.dvb.ait": { - source: "iana", - extensions: ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.dvbj": { - source: "iana" - }, - "application/vnd.dvb.esgcontainer": { - source: "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - source: "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - source: "iana" - }, - "application/vnd.dvb.ipdcroaming": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - source: "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - source: "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-container+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-generic+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.notif-init+xml": { - source: "iana", - compressible: true - }, - "application/vnd.dvb.pfr": { - source: "iana" - }, - "application/vnd.dvb.service": { - source: "iana", - extensions: ["svc"] - }, - "application/vnd.dxr": { - source: "iana" - }, - "application/vnd.dynageo": { - source: "iana", - extensions: ["geo"] - }, - "application/vnd.dzr": { - source: "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - source: "iana" - }, - "application/vnd.ecdis-update": { - source: "iana" - }, - "application/vnd.ecip.rlp": { - source: "iana" - }, - "application/vnd.eclipse.ditto+json": { - source: "iana", - compressible: true - }, - "application/vnd.ecowin.chart": { - source: "iana", - extensions: ["mag"] - }, - "application/vnd.ecowin.filerequest": { - source: "iana" - }, - "application/vnd.ecowin.fileupdate": { - source: "iana" - }, - "application/vnd.ecowin.series": { - source: "iana" - }, - "application/vnd.ecowin.seriesrequest": { - source: "iana" - }, - "application/vnd.ecowin.seriesupdate": { - source: "iana" - }, - "application/vnd.efi.img": { - source: "iana" - }, - "application/vnd.efi.iso": { - source: "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - source: "iana", - compressible: true - }, - "application/vnd.enliven": { - source: "iana", - extensions: ["nml"] - }, - "application/vnd.enphase.envoy": { - source: "iana" - }, - "application/vnd.eprints.data+xml": { - source: "iana", - compressible: true - }, - "application/vnd.epson.esf": { - source: "iana", - extensions: ["esf"] - }, - "application/vnd.epson.msf": { - source: "iana", - extensions: ["msf"] - }, - "application/vnd.epson.quickanime": { - source: "iana", - extensions: ["qam"] - }, - "application/vnd.epson.salt": { - source: "iana", - extensions: ["slt"] - }, - "application/vnd.epson.ssf": { - source: "iana", - extensions: ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - source: "iana" - }, - "application/vnd.espass-espass+zip": { - source: "iana", - compressible: false - }, - "application/vnd.eszigno3+xml": { - source: "iana", - compressible: true, - extensions: ["es3", "et3"] - }, - "application/vnd.etsi.aoc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.asic-e+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.asic-s+zip": { - source: "iana", - compressible: false - }, - "application/vnd.etsi.cug+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvcommand+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvservice+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvsync+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.iptvueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mcid+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.mheg5": { - source: "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.pstn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.sci+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.simservs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.timestamp-token": { - source: "iana" - }, - "application/vnd.etsi.tsl+xml": { - source: "iana", - compressible: true - }, - "application/vnd.etsi.tsl.der": { - source: "iana" - }, - "application/vnd.eu.kasparian.car+json": { - source: "iana", - compressible: true - }, - "application/vnd.eudora.data": { - source: "iana" - }, - "application/vnd.evolv.ecig.profile": { - source: "iana" - }, - "application/vnd.evolv.ecig.settings": { - source: "iana" - }, - "application/vnd.evolv.ecig.theme": { - source: "iana" - }, - "application/vnd.exstream-empower+zip": { - source: "iana", - compressible: false - }, - "application/vnd.exstream-package": { - source: "iana" - }, - "application/vnd.ezpix-album": { - source: "iana", - extensions: ["ez2"] - }, - "application/vnd.ezpix-package": { - source: "iana", - extensions: ["ez3"] - }, - "application/vnd.f-secure.mobile": { - source: "iana" - }, - "application/vnd.familysearch.gedcom+zip": { - source: "iana", - compressible: false - }, - "application/vnd.fastcopy-disk-image": { - source: "iana" - }, - "application/vnd.fdf": { - source: "iana", - extensions: ["fdf"] - }, - "application/vnd.fdsn.mseed": { - source: "iana", - extensions: ["mseed"] - }, - "application/vnd.fdsn.seed": { - source: "iana", - extensions: ["seed", "dataless"] - }, - "application/vnd.ffsns": { - source: "iana" - }, - "application/vnd.ficlab.flb+zip": { - source: "iana", - compressible: false - }, - "application/vnd.filmit.zfc": { - source: "iana" - }, - "application/vnd.fints": { - source: "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - source: "iana" - }, - "application/vnd.flographit": { - source: "iana", - extensions: ["gph"] - }, - "application/vnd.fluxtime.clip": { - source: "iana", - extensions: ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - source: "iana" - }, - "application/vnd.framemaker": { - source: "iana", - extensions: ["fm", "frame", "maker", "book"] - }, - "application/vnd.frogans.fnc": { - source: "iana", - extensions: ["fnc"] - }, - "application/vnd.frogans.ltf": { - source: "iana", - extensions: ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - source: "iana", - extensions: ["fsc"] - }, - "application/vnd.fujifilm.fb.docuworks": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - source: "iana" - }, - "application/vnd.fujifilm.fb.docuworks.container": { - source: "iana" - }, - "application/vnd.fujifilm.fb.jfi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.fujitsu.oasys": { - source: "iana", - extensions: ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - source: "iana", - extensions: ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - source: "iana", - extensions: ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - source: "iana", - extensions: ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - source: "iana", - extensions: ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - source: "iana" - }, - "application/vnd.fujixerox.art4": { - source: "iana" - }, - "application/vnd.fujixerox.ddd": { - source: "iana", - extensions: ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - source: "iana", - extensions: ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - source: "iana", - extensions: ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - source: "iana" - }, - "application/vnd.fujixerox.hbpl": { - source: "iana" - }, - "application/vnd.fut-misnet": { - source: "iana" - }, - "application/vnd.futoin+cbor": { - source: "iana" - }, - "application/vnd.futoin+json": { - source: "iana", - compressible: true - }, - "application/vnd.fuzzysheet": { - source: "iana", - extensions: ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - source: "iana", - extensions: ["txd"] - }, - "application/vnd.gentics.grd+json": { - source: "iana", - compressible: true - }, - "application/vnd.geo+json": { - source: "iana", - compressible: true - }, - "application/vnd.geocube+xml": { - source: "iana", - compressible: true - }, - "application/vnd.geogebra.file": { - source: "iana", - extensions: ["ggb"] - }, - "application/vnd.geogebra.slides": { - source: "iana" - }, - "application/vnd.geogebra.tool": { - source: "iana", - extensions: ["ggt"] - }, - "application/vnd.geometry-explorer": { - source: "iana", - extensions: ["gex", "gre"] - }, - "application/vnd.geonext": { - source: "iana", - extensions: ["gxt"] - }, - "application/vnd.geoplan": { - source: "iana", - extensions: ["g2w"] - }, - "application/vnd.geospace": { - source: "iana", - extensions: ["g3w"] - }, - "application/vnd.gerber": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - source: "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - source: "iana" - }, - "application/vnd.gmx": { - source: "iana", - extensions: ["gmx"] - }, - "application/vnd.google-apps.document": { - compressible: false, - extensions: ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - compressible: false, - extensions: ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - compressible: false, - extensions: ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - source: "iana", - compressible: true, - extensions: ["kml"] - }, - "application/vnd.google-earth.kmz": { - source: "iana", - compressible: false, - extensions: ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - source: "iana", - compressible: true - }, - "application/vnd.gov.sk.e-form+zip": { - source: "iana", - compressible: false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.grafeq": { - source: "iana", - extensions: ["gqf", "gqs"] - }, - "application/vnd.gridmp": { - source: "iana" - }, - "application/vnd.groove-account": { - source: "iana", - extensions: ["gac"] - }, - "application/vnd.groove-help": { - source: "iana", - extensions: ["ghf"] - }, - "application/vnd.groove-identity-message": { - source: "iana", - extensions: ["gim"] - }, - "application/vnd.groove-injector": { - source: "iana", - extensions: ["grv"] - }, - "application/vnd.groove-tool-message": { - source: "iana", - extensions: ["gtm"] - }, - "application/vnd.groove-tool-template": { - source: "iana", - extensions: ["tpl"] - }, - "application/vnd.groove-vcard": { - source: "iana", - extensions: ["vcg"] - }, - "application/vnd.hal+json": { - source: "iana", - compressible: true - }, - "application/vnd.hal+xml": { - source: "iana", - compressible: true, - extensions: ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - source: "iana", - compressible: true, - extensions: ["zmm"] - }, - "application/vnd.hbci": { - source: "iana", - extensions: ["hbci"] - }, - "application/vnd.hc+json": { - source: "iana", - compressible: true - }, - "application/vnd.hcl-bireports": { - source: "iana" - }, - "application/vnd.hdt": { - source: "iana" - }, - "application/vnd.heroku+json": { - source: "iana", - compressible: true - }, - "application/vnd.hhe.lesson-player": { - source: "iana", - extensions: ["les"] - }, - "application/vnd.hl7cda+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hl7v2+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.hp-hpgl": { - source: "iana", - extensions: ["hpgl"] - }, - "application/vnd.hp-hpid": { - source: "iana", - extensions: ["hpid"] - }, - "application/vnd.hp-hps": { - source: "iana", - extensions: ["hps"] - }, - "application/vnd.hp-jlyt": { - source: "iana", - extensions: ["jlt"] - }, - "application/vnd.hp-pcl": { - source: "iana", - extensions: ["pcl"] - }, - "application/vnd.hp-pclxl": { - source: "iana", - extensions: ["pclxl"] - }, - "application/vnd.httphone": { - source: "iana" - }, - "application/vnd.hydrostatix.sof-data": { - source: "iana", - extensions: ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyper-item+json": { - source: "iana", - compressible: true - }, - "application/vnd.hyperdrive+json": { - source: "iana", - compressible: true - }, - "application/vnd.hzn-3d-crossword": { - source: "iana" - }, - "application/vnd.ibm.afplinedata": { - source: "iana" - }, - "application/vnd.ibm.electronic-media": { - source: "iana" - }, - "application/vnd.ibm.minipay": { - source: "iana", - extensions: ["mpy"] - }, - "application/vnd.ibm.modcap": { - source: "iana", - extensions: ["afp", "listafp", "list3820"] - }, - "application/vnd.ibm.rights-management": { - source: "iana", - extensions: ["irm"] - }, - "application/vnd.ibm.secure-container": { - source: "iana", - extensions: ["sc"] - }, - "application/vnd.iccprofile": { - source: "iana", - extensions: ["icc", "icm"] - }, - "application/vnd.ieee.1905": { - source: "iana" - }, - "application/vnd.igloader": { - source: "iana", - extensions: ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - source: "iana", - compressible: false - }, - "application/vnd.imagemeter.image+zip": { - source: "iana", - compressible: false - }, - "application/vnd.immervision-ivp": { - source: "iana", - extensions: ["ivp"] - }, - "application/vnd.immervision-ivu": { - source: "iana", - extensions: ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - source: "iana" - }, - "application/vnd.ims.imsccv1p2": { - source: "iana" - }, - "application/vnd.ims.imsccv1p3": { - source: "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - source: "iana", - compressible: true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - source: "iana", - compressible: true - }, - "application/vnd.informedcontrol.rms+xml": { - source: "iana", - compressible: true - }, - "application/vnd.informix-visionary": { - source: "iana" - }, - "application/vnd.infotech.project": { - source: "iana" - }, - "application/vnd.infotech.project+xml": { - source: "iana", - compressible: true - }, - "application/vnd.innopath.wamp.notification": { - source: "iana" - }, - "application/vnd.insors.igm": { - source: "iana", - extensions: ["igm"] - }, - "application/vnd.intercon.formnet": { - source: "iana", - extensions: ["xpw", "xpx"] - }, - "application/vnd.intergeo": { - source: "iana", - extensions: ["i2g"] - }, - "application/vnd.intertrust.digibox": { - source: "iana" - }, - "application/vnd.intertrust.nncp": { - source: "iana" - }, - "application/vnd.intu.qbo": { - source: "iana", - extensions: ["qbo"] - }, - "application/vnd.intu.qfx": { - source: "iana", - extensions: ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.packageitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.iptc.g2.planningitem+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ipunplugged.rcprofile": { - source: "iana", - extensions: ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - source: "iana", - compressible: true, - extensions: ["irp"] - }, - "application/vnd.is-xpr": { - source: "iana", - extensions: ["xpr"] - }, - "application/vnd.isac.fcs": { - source: "iana", - extensions: ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - source: "iana", - compressible: false - }, - "application/vnd.jam": { - source: "iana", - extensions: ["jam"] - }, - "application/vnd.japannet-directory-service": { - source: "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-payment-wakeup": { - source: "iana" - }, - "application/vnd.japannet-registration": { - source: "iana" - }, - "application/vnd.japannet-registration-wakeup": { - source: "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - source: "iana" - }, - "application/vnd.japannet-verification": { - source: "iana" - }, - "application/vnd.japannet-verification-wakeup": { - source: "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - source: "iana", - extensions: ["rms"] - }, - "application/vnd.jisp": { - source: "iana", - extensions: ["jisp"] - }, - "application/vnd.joost.joda-archive": { - source: "iana", - extensions: ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - source: "iana" - }, - "application/vnd.kahootz": { - source: "iana", - extensions: ["ktz", "ktr"] - }, - "application/vnd.kde.karbon": { - source: "iana", - extensions: ["karbon"] - }, - "application/vnd.kde.kchart": { - source: "iana", - extensions: ["chrt"] - }, - "application/vnd.kde.kformula": { - source: "iana", - extensions: ["kfo"] - }, - "application/vnd.kde.kivio": { - source: "iana", - extensions: ["flw"] - }, - "application/vnd.kde.kontour": { - source: "iana", - extensions: ["kon"] - }, - "application/vnd.kde.kpresenter": { - source: "iana", - extensions: ["kpr", "kpt"] - }, - "application/vnd.kde.kspread": { - source: "iana", - extensions: ["ksp"] - }, - "application/vnd.kde.kword": { - source: "iana", - extensions: ["kwd", "kwt"] - }, - "application/vnd.kenameaapp": { - source: "iana", - extensions: ["htke"] - }, - "application/vnd.kidspiration": { - source: "iana", - extensions: ["kia"] - }, - "application/vnd.kinar": { - source: "iana", - extensions: ["kne", "knp"] - }, - "application/vnd.koan": { - source: "iana", - extensions: ["skp", "skd", "skt", "skm"] - }, - "application/vnd.kodak-descriptor": { - source: "iana", - extensions: ["sse"] - }, - "application/vnd.las": { - source: "iana" - }, - "application/vnd.las.las+json": { - source: "iana", - compressible: true - }, - "application/vnd.las.las+xml": { - source: "iana", - compressible: true, - extensions: ["lasxml"] - }, - "application/vnd.laszip": { - source: "iana" - }, - "application/vnd.leap+json": { - source: "iana", - compressible: true - }, - "application/vnd.liberty-request+xml": { - source: "iana", - compressible: true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - source: "iana", - extensions: ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - source: "iana", - compressible: true, - extensions: ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - source: "iana", - compressible: false - }, - "application/vnd.loom": { - source: "iana" - }, - "application/vnd.lotus-1-2-3": { - source: "iana", - extensions: ["123"] - }, - "application/vnd.lotus-approach": { - source: "iana", - extensions: ["apr"] - }, - "application/vnd.lotus-freelance": { - source: "iana", - extensions: ["pre"] - }, - "application/vnd.lotus-notes": { - source: "iana", - extensions: ["nsf"] - }, - "application/vnd.lotus-organizer": { - source: "iana", - extensions: ["org"] - }, - "application/vnd.lotus-screencam": { - source: "iana", - extensions: ["scm"] - }, - "application/vnd.lotus-wordpro": { - source: "iana", - extensions: ["lwp"] - }, - "application/vnd.macports.portpkg": { - source: "iana", - extensions: ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - source: "iana", - extensions: ["mvt"] - }, - "application/vnd.marlin.drm.actiontoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.conftoken+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.license+xml": { - source: "iana", - compressible: true - }, - "application/vnd.marlin.drm.mdcf": { - source: "iana" - }, - "application/vnd.mason+json": { - source: "iana", - compressible: true - }, - "application/vnd.maxar.archive.3tz+zip": { - source: "iana", - compressible: false - }, - "application/vnd.maxmind.maxmind-db": { - source: "iana" - }, - "application/vnd.mcd": { - source: "iana", - extensions: ["mcd"] - }, - "application/vnd.medcalcdata": { - source: "iana", - extensions: ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - source: "iana", - extensions: ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - source: "iana" - }, - "application/vnd.mfer": { - source: "iana", - extensions: ["mwf"] - }, - "application/vnd.mfmp": { - source: "iana", - extensions: ["mfm"] - }, - "application/vnd.micro+json": { - source: "iana", - compressible: true - }, - "application/vnd.micrografx.flo": { - source: "iana", - extensions: ["flo"] - }, - "application/vnd.micrografx.igx": { - source: "iana", - extensions: ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - source: "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - source: "iana" - }, - "application/vnd.miele+json": { - source: "iana", - compressible: true - }, - "application/vnd.mif": { - source: "iana", - extensions: ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - source: "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - source: "iana" - }, - "application/vnd.mobius.daf": { - source: "iana", - extensions: ["daf"] - }, - "application/vnd.mobius.dis": { - source: "iana", - extensions: ["dis"] - }, - "application/vnd.mobius.mbk": { - source: "iana", - extensions: ["mbk"] - }, - "application/vnd.mobius.mqy": { - source: "iana", - extensions: ["mqy"] - }, - "application/vnd.mobius.msl": { - source: "iana", - extensions: ["msl"] - }, - "application/vnd.mobius.plc": { - source: "iana", - extensions: ["plc"] - }, - "application/vnd.mobius.txf": { - source: "iana", - extensions: ["txf"] - }, - "application/vnd.mophun.application": { - source: "iana", - extensions: ["mpn"] - }, - "application/vnd.mophun.certificate": { - source: "iana", - extensions: ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - source: "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - source: "iana" - }, - "application/vnd.motorola.iprm": { - source: "iana" - }, - "application/vnd.mozilla.xul+xml": { - source: "iana", - compressible: true, - extensions: ["xul"] - }, - "application/vnd.ms-3mfdocument": { - source: "iana" - }, - "application/vnd.ms-artgalry": { - source: "iana", - extensions: ["cil"] - }, - "application/vnd.ms-asf": { - source: "iana" - }, - "application/vnd.ms-cab-compressed": { - source: "iana", - extensions: ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - source: "apache" - }, - "application/vnd.ms-excel": { - source: "iana", - compressible: false, - extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - source: "iana", - extensions: ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - source: "iana", - extensions: ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - source: "iana", - extensions: ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - source: "iana", - extensions: ["xltm"] - }, - "application/vnd.ms-fontobject": { - source: "iana", - compressible: true, - extensions: ["eot"] - }, - "application/vnd.ms-htmlhelp": { - source: "iana", - extensions: ["chm"] - }, - "application/vnd.ms-ims": { - source: "iana", - extensions: ["ims"] - }, - "application/vnd.ms-lrm": { - source: "iana", - extensions: ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-officetheme": { - source: "iana", - extensions: ["thmx"] - }, - "application/vnd.ms-opentype": { - source: "apache", - compressible: true - }, - "application/vnd.ms-outlook": { - compressible: false, - extensions: ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - source: "apache" - }, - "application/vnd.ms-pki.seccat": { - source: "apache", - extensions: ["cat"] - }, - "application/vnd.ms-pki.stl": { - source: "apache", - extensions: ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-powerpoint": { - source: "iana", - compressible: false, - extensions: ["ppt", "pps", "pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - source: "iana", - extensions: ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - source: "iana", - extensions: ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - source: "iana", - extensions: ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - source: "iana", - extensions: ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - source: "iana", - extensions: ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-printing.printticket+xml": { - source: "apache", - compressible: true - }, - "application/vnd.ms-printschematicket+xml": { - source: "iana", - compressible: true - }, - "application/vnd.ms-project": { - source: "iana", - extensions: ["mpp", "mpt"] - }, - "application/vnd.ms-tnef": { - source: "iana" - }, - "application/vnd.ms-windows.devicepairing": { - source: "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - source: "iana" - }, - "application/vnd.ms-windows.printerpairing": { - source: "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - source: "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - source: "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - source: "iana", - extensions: ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - source: "iana", - extensions: ["dotm"] - }, - "application/vnd.ms-works": { - source: "iana", - extensions: ["wps", "wks", "wcm", "wdb"] - }, - "application/vnd.ms-wpl": { - source: "iana", - extensions: ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - source: "iana", - compressible: false, - extensions: ["xps"] - }, - "application/vnd.msa-disk-image": { - source: "iana" - }, - "application/vnd.mseq": { - source: "iana", - extensions: ["mseq"] - }, - "application/vnd.msign": { - source: "iana" - }, - "application/vnd.multiad.creator": { - source: "iana" - }, - "application/vnd.multiad.creator.cif": { - source: "iana" - }, - "application/vnd.music-niff": { - source: "iana" - }, - "application/vnd.musician": { - source: "iana", - extensions: ["mus"] - }, - "application/vnd.muvee.style": { - source: "iana", - extensions: ["msty"] - }, - "application/vnd.mynfc": { - source: "iana", - extensions: ["taglet"] - }, - "application/vnd.nacamar.ybrid+json": { - source: "iana", - compressible: true - }, - "application/vnd.ncd.control": { - source: "iana" - }, - "application/vnd.ncd.reference": { - source: "iana" - }, - "application/vnd.nearst.inv+json": { - source: "iana", - compressible: true - }, - "application/vnd.nebumind.line": { - source: "iana" - }, - "application/vnd.nervana": { - source: "iana" - }, - "application/vnd.netfpx": { - source: "iana" - }, - "application/vnd.neurolanguage.nlu": { - source: "iana", - extensions: ["nlu"] - }, - "application/vnd.nimn": { - source: "iana" - }, - "application/vnd.nintendo.nitro.rom": { - source: "iana" - }, - "application/vnd.nintendo.snes.rom": { - source: "iana" - }, - "application/vnd.nitf": { - source: "iana", - extensions: ["ntf", "nitf"] - }, - "application/vnd.noblenet-directory": { - source: "iana", - extensions: ["nnd"] - }, - "application/vnd.noblenet-sealer": { - source: "iana", - extensions: ["nns"] - }, - "application/vnd.noblenet-web": { - source: "iana", - extensions: ["nnw"] - }, - "application/vnd.nokia.catalogs": { - source: "iana" - }, - "application/vnd.nokia.conml+wbxml": { - source: "iana" - }, - "application/vnd.nokia.conml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.iptv.config+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.isds-radio-presets": { - source: "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - source: "iana" - }, - "application/vnd.nokia.landmark+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.landmarkcollection+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.n-gage.ac+xml": { - source: "iana", - compressible: true, - extensions: ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - source: "iana", - extensions: ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - source: "iana", - extensions: ["n-gage"] - }, - "application/vnd.nokia.ncd": { - source: "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - source: "iana" - }, - "application/vnd.nokia.pcd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.nokia.radio-preset": { - source: "iana", - extensions: ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - source: "iana", - extensions: ["rpss"] - }, - "application/vnd.novadigm.edm": { - source: "iana", - extensions: ["edm"] - }, - "application/vnd.novadigm.edx": { - source: "iana", - extensions: ["edx"] - }, - "application/vnd.novadigm.ext": { - source: "iana", - extensions: ["ext"] - }, - "application/vnd.ntt-local.content-share": { - source: "iana" - }, - "application/vnd.ntt-local.file-transfer": { - source: "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - source: "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - source: "iana" - }, - "application/vnd.oasis.opendocument.chart": { - source: "iana", - extensions: ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - source: "iana", - extensions: ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - source: "iana", - extensions: ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - source: "iana", - extensions: ["of"] - }, - "application/vnd.oasis.opendocument.formula-template": { - source: "iana", - extensions: ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - source: "iana", - compressible: false, - extensions: ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - source: "iana", - extensions: ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - source: "iana", - extensions: ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - source: "iana", - extensions: ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - source: "iana", - compressible: false, - extensions: ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - source: "iana", - extensions: ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - source: "iana", - compressible: false, - extensions: ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - source: "iana", - extensions: ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - source: "iana", - compressible: false, - extensions: ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - source: "iana", - extensions: ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - source: "iana", - extensions: ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - source: "iana", - extensions: ["oth"] - }, - "application/vnd.obn": { - source: "iana" - }, - "application/vnd.ocf+cbor": { - source: "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - source: "iana", - compressible: true - }, - "application/vnd.oftn.l10n+json": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.cspg-hexbinary": { - source: "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.dae.xhtml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.pae.gem": { - source: "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.spdlist+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.ueprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oipf.userprofile+xml": { - source: "iana", - compressible: true - }, - "application/vnd.olpc-sugar": { - source: "iana", - extensions: ["xo"] - }, - "application/vnd.oma-scws-config": { - source: "iana" - }, - "application/vnd.oma-scws-http-request": { - source: "iana" - }, - "application/vnd.oma-scws-http-response": { - source: "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.imd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.ltkm": { - source: "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - source: "iana" - }, - "application/vnd.oma.bcast.sgboot": { - source: "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sgdu": { - source: "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - source: "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.sprov+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.bcast.stkm": { - source: "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-feature-handler+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-pcc+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-subs-invite+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.cab-user-prefs+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.dcd": { - source: "iana" - }, - "application/vnd.oma.dcdc": { - source: "iana" - }, - "application/vnd.oma.dd2+xml": { - source: "iana", - compressible: true, - extensions: ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.group-usage-list+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+cbor": { - source: "iana" - }, - "application/vnd.oma.lwm2m+json": { - source: "iana", - compressible: true - }, - "application/vnd.oma.lwm2m+tlv": { - source: "iana" - }, - "application/vnd.oma.pal+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.final-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.groups+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.push": { - source: "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oma.xcap-directory+xml": { - source: "iana", - compressible: true - }, - "application/vnd.omads-email+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-file+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omads-folder+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.omaloc-supl-init": { - source: "iana" - }, - "application/vnd.onepager": { - source: "iana" - }, - "application/vnd.onepagertamp": { - source: "iana" - }, - "application/vnd.onepagertamx": { - source: "iana" - }, - "application/vnd.onepagertat": { - source: "iana" - }, - "application/vnd.onepagertatp": { - source: "iana" - }, - "application/vnd.onepagertatx": { - source: "iana" - }, - "application/vnd.openblox.game+xml": { - source: "iana", - compressible: true, - extensions: ["obgx"] - }, - "application/vnd.openblox.game-binary": { - source: "iana" - }, - "application/vnd.openeye.oeb": { - source: "iana" - }, - "application/vnd.openofficeorg.extension": { - source: "apache", - extensions: ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - source: "iana", - compressible: true, - extensions: ["osm"] - }, - "application/vnd.opentimestamps.ots": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - source: "iana", - compressible: false, - extensions: ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - source: "iana", - extensions: ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - source: "iana", - extensions: ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - source: "iana", - extensions: ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - source: "iana", - compressible: false, - extensions: ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - source: "iana", - extensions: ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - source: "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - source: "iana", - compressible: false, - extensions: ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - source: "iana", - extensions: ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - source: "iana", - compressible: true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oracle.resource+json": { - source: "iana", - compressible: true - }, - "application/vnd.orange.indata": { - source: "iana" - }, - "application/vnd.osa.netdeploy": { - source: "iana" - }, - "application/vnd.osgeo.mapguide.package": { - source: "iana", - extensions: ["mgp"] - }, - "application/vnd.osgi.bundle": { - source: "iana" - }, - "application/vnd.osgi.dp": { - source: "iana", - extensions: ["dp"] - }, - "application/vnd.osgi.subsystem": { - source: "iana", - extensions: ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - source: "iana", - compressible: true - }, - "application/vnd.oxli.countgraph": { - source: "iana" - }, - "application/vnd.pagerduty+json": { - source: "iana", - compressible: true - }, - "application/vnd.palm": { - source: "iana", - extensions: ["pdb", "pqa", "oprc"] - }, - "application/vnd.panoply": { - source: "iana" - }, - "application/vnd.paos.xml": { - source: "iana" - }, - "application/vnd.patentdive": { - source: "iana" - }, - "application/vnd.patientecommsdoc": { - source: "iana" - }, - "application/vnd.pawaafile": { - source: "iana", - extensions: ["paw"] - }, - "application/vnd.pcos": { - source: "iana" - }, - "application/vnd.pg.format": { - source: "iana", - extensions: ["str"] - }, - "application/vnd.pg.osasli": { - source: "iana", - extensions: ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - source: "iana" - }, - "application/vnd.picsel": { - source: "iana", - extensions: ["efif"] - }, - "application/vnd.pmi.widget": { - source: "iana", - extensions: ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - source: "iana", - compressible: true - }, - "application/vnd.pocketlearn": { - source: "iana", - extensions: ["plf"] - }, - "application/vnd.powerbuilder6": { - source: "iana", - extensions: ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - source: "iana" - }, - "application/vnd.powerbuilder7": { - source: "iana" - }, - "application/vnd.powerbuilder7-s": { - source: "iana" - }, - "application/vnd.powerbuilder75": { - source: "iana" - }, - "application/vnd.powerbuilder75-s": { - source: "iana" - }, - "application/vnd.preminet": { - source: "iana" - }, - "application/vnd.previewsystems.box": { - source: "iana", - extensions: ["box"] - }, - "application/vnd.proteus.magazine": { - source: "iana", - extensions: ["mgz"] - }, - "application/vnd.psfs": { - source: "iana" - }, - "application/vnd.publishare-delta-tree": { - source: "iana", - extensions: ["qps"] - }, - "application/vnd.pvi.ptid1": { - source: "iana", - extensions: ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - source: "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - source: "iana", - compressible: true - }, - "application/vnd.qualcomm.brew-app-res": { - source: "iana" - }, - "application/vnd.quarantainenet": { - source: "iana" - }, - "application/vnd.quark.quarkxpress": { - source: "iana", - extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] - }, - "application/vnd.quobject-quoxdocument": { - source: "iana" - }, - "application/vnd.radisys.moml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-conf+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - source: "iana", - compressible: true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - source: "iana", - compressible: true - }, - "application/vnd.rainstor.data": { - source: "iana" - }, - "application/vnd.rapid": { - source: "iana" - }, - "application/vnd.rar": { - source: "iana", - extensions: ["rar"] - }, - "application/vnd.realvnc.bed": { - source: "iana", - extensions: ["bed"] - }, - "application/vnd.recordare.musicxml": { - source: "iana", - extensions: ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - source: "iana", - compressible: true, - extensions: ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - source: "iana" - }, - "application/vnd.resilient.logic": { - source: "iana" - }, - "application/vnd.restful+json": { - source: "iana", - compressible: true - }, - "application/vnd.rig.cryptonote": { - source: "iana", - extensions: ["cryptonote"] - }, - "application/vnd.rim.cod": { - source: "apache", - extensions: ["cod"] - }, - "application/vnd.rn-realmedia": { - source: "apache", - extensions: ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - source: "apache", - extensions: ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - source: "iana", - compressible: true, - extensions: ["link66"] - }, - "application/vnd.rs-274x": { - source: "iana" - }, - "application/vnd.ruckus.download": { - source: "iana" - }, - "application/vnd.s3sms": { - source: "iana" - }, - "application/vnd.sailingtracker.track": { - source: "iana", - extensions: ["st"] - }, - "application/vnd.sar": { - source: "iana" - }, - "application/vnd.sbm.cid": { - source: "iana" - }, - "application/vnd.sbm.mid2": { - source: "iana" - }, - "application/vnd.scribus": { - source: "iana" - }, - "application/vnd.sealed.3df": { - source: "iana" - }, - "application/vnd.sealed.csf": { - source: "iana" - }, - "application/vnd.sealed.doc": { - source: "iana" - }, - "application/vnd.sealed.eml": { - source: "iana" - }, - "application/vnd.sealed.mht": { - source: "iana" - }, - "application/vnd.sealed.net": { - source: "iana" - }, - "application/vnd.sealed.ppt": { - source: "iana" - }, - "application/vnd.sealed.tiff": { - source: "iana" - }, - "application/vnd.sealed.xls": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - source: "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - source: "iana" - }, - "application/vnd.seemail": { - source: "iana", - extensions: ["see"] - }, - "application/vnd.seis+json": { - source: "iana", - compressible: true - }, - "application/vnd.sema": { - source: "iana", - extensions: ["sema"] - }, - "application/vnd.semd": { - source: "iana", - extensions: ["semd"] - }, - "application/vnd.semf": { - source: "iana", - extensions: ["semf"] - }, - "application/vnd.shade-save-file": { - source: "iana" - }, - "application/vnd.shana.informed.formdata": { - source: "iana", - extensions: ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - source: "iana", - extensions: ["itp"] - }, - "application/vnd.shana.informed.interchange": { - source: "iana", - extensions: ["if"] - }, - "application/vnd.shana.informed.package": { - source: "iana", - extensions: ["ipk"] - }, - "application/vnd.shootproof+json": { - source: "iana", - compressible: true - }, - "application/vnd.shopkick+json": { - source: "iana", - compressible: true - }, - "application/vnd.shp": { - source: "iana" - }, - "application/vnd.shx": { - source: "iana" - }, - "application/vnd.sigrok.session": { - source: "iana" - }, - "application/vnd.simtech-mindmapper": { - source: "iana", - extensions: ["twd", "twds"] - }, - "application/vnd.siren+json": { - source: "iana", - compressible: true - }, - "application/vnd.smaf": { - source: "iana", - extensions: ["mmf"] - }, - "application/vnd.smart.notebook": { - source: "iana" - }, - "application/vnd.smart.teacher": { - source: "iana", - extensions: ["teacher"] - }, - "application/vnd.snesdev-page-table": { - source: "iana" - }, - "application/vnd.software602.filler.form+xml": { - source: "iana", - compressible: true, - extensions: ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - source: "iana" - }, - "application/vnd.solent.sdkm+xml": { - source: "iana", - compressible: true, - extensions: ["sdkm", "sdkd"] - }, - "application/vnd.spotfire.dxp": { - source: "iana", - extensions: ["dxp"] - }, - "application/vnd.spotfire.sfs": { - source: "iana", - extensions: ["sfs"] - }, - "application/vnd.sqlite3": { - source: "iana" - }, - "application/vnd.sss-cod": { - source: "iana" - }, - "application/vnd.sss-dtf": { - source: "iana" - }, - "application/vnd.sss-ntf": { - source: "iana" - }, - "application/vnd.stardivision.calc": { - source: "apache", - extensions: ["sdc"] - }, - "application/vnd.stardivision.draw": { - source: "apache", - extensions: ["sda"] - }, - "application/vnd.stardivision.impress": { - source: "apache", - extensions: ["sdd"] - }, - "application/vnd.stardivision.math": { - source: "apache", - extensions: ["smf"] - }, - "application/vnd.stardivision.writer": { - source: "apache", - extensions: ["sdw", "vor"] - }, - "application/vnd.stardivision.writer-global": { - source: "apache", - extensions: ["sgl"] - }, - "application/vnd.stepmania.package": { - source: "iana", - extensions: ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - source: "iana", - extensions: ["sm"] - }, - "application/vnd.street-stream": { - source: "iana" - }, - "application/vnd.sun.wadl+xml": { - source: "iana", - compressible: true, - extensions: ["wadl"] - }, - "application/vnd.sun.xml.calc": { - source: "apache", - extensions: ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - source: "apache", - extensions: ["stc"] - }, - "application/vnd.sun.xml.draw": { - source: "apache", - extensions: ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - source: "apache", - extensions: ["std"] - }, - "application/vnd.sun.xml.impress": { - source: "apache", - extensions: ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - source: "apache", - extensions: ["sti"] - }, - "application/vnd.sun.xml.math": { - source: "apache", - extensions: ["sxm"] - }, - "application/vnd.sun.xml.writer": { - source: "apache", - extensions: ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - source: "apache", - extensions: ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - source: "apache", - extensions: ["stw"] - }, - "application/vnd.sus-calendar": { - source: "iana", - extensions: ["sus", "susp"] - }, - "application/vnd.svd": { - source: "iana", - extensions: ["svd"] - }, - "application/vnd.swiftview-ics": { - source: "iana" - }, - "application/vnd.sycle+xml": { - source: "iana", - compressible: true - }, - "application/vnd.syft+json": { - source: "iana", - compressible: true - }, - "application/vnd.symbian.install": { - source: "apache", - extensions: ["sis", "sisx"] - }, - "application/vnd.syncml+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - source: "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmddf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - source: "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - source: "iana", - charset: "UTF-8", - compressible: true - }, - "application/vnd.syncml.ds.notification": { - source: "iana" - }, - "application/vnd.tableschema+json": { - source: "iana", - compressible: true - }, - "application/vnd.tao.intent-module-archive": { - source: "iana", - extensions: ["tao"] - }, - "application/vnd.tcpdump.pcap": { - source: "iana", - extensions: ["pcap", "cap", "dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - source: "iana", - compressible: true - }, - "application/vnd.tmd.mediaflex.api+xml": { - source: "iana", - compressible: true - }, - "application/vnd.tml": { - source: "iana" - }, - "application/vnd.tmobile-livetv": { - source: "iana", - extensions: ["tmo"] - }, - "application/vnd.tri.onesource": { - source: "iana" - }, - "application/vnd.trid.tpt": { - source: "iana", - extensions: ["tpt"] - }, - "application/vnd.triscape.mxs": { - source: "iana", - extensions: ["mxs"] - }, - "application/vnd.trueapp": { - source: "iana", - extensions: ["tra"] - }, - "application/vnd.truedoc": { - source: "iana" - }, - "application/vnd.ubisoft.webplayer": { - source: "iana" - }, - "application/vnd.ufdl": { - source: "iana", - extensions: ["ufd", "ufdl"] - }, - "application/vnd.uiq.theme": { - source: "iana", - extensions: ["utz"] - }, - "application/vnd.umajin": { - source: "iana", - extensions: ["umj"] - }, - "application/vnd.unity": { - source: "iana", - extensions: ["unityweb"] - }, - "application/vnd.uoml+xml": { - source: "iana", - compressible: true, - extensions: ["uoml"] - }, - "application/vnd.uplanet.alert": { - source: "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice": { - source: "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.cacheop": { - source: "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.channel": { - source: "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.list": { - source: "iana" - }, - "application/vnd.uplanet.list-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.listcmd": { - source: "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - source: "iana" - }, - "application/vnd.uplanet.signal": { - source: "iana" - }, - "application/vnd.uri-map": { - source: "iana" - }, - "application/vnd.valve.source.material": { - source: "iana" - }, - "application/vnd.vcx": { - source: "iana", - extensions: ["vcx"] - }, - "application/vnd.vd-study": { - source: "iana" - }, - "application/vnd.vectorworks": { - source: "iana" - }, - "application/vnd.vel+json": { - source: "iana", - compressible: true - }, - "application/vnd.verimatrix.vcas": { - source: "iana" - }, - "application/vnd.veritone.aion+json": { - source: "iana", - compressible: true - }, - "application/vnd.veryant.thin": { - source: "iana" - }, - "application/vnd.ves.encrypted": { - source: "iana" - }, - "application/vnd.vidsoft.vidconference": { - source: "iana" - }, - "application/vnd.visio": { - source: "iana", - extensions: ["vsd", "vst", "vss", "vsw"] - }, - "application/vnd.visionary": { - source: "iana", - extensions: ["vis"] - }, - "application/vnd.vividence.scriptfile": { - source: "iana" - }, - "application/vnd.vsf": { - source: "iana", - extensions: ["vsf"] - }, - "application/vnd.wap.sic": { - source: "iana" - }, - "application/vnd.wap.slc": { - source: "iana" - }, - "application/vnd.wap.wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["wbxml"] - }, - "application/vnd.wap.wmlc": { - source: "iana", - extensions: ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - source: "iana", - extensions: ["wmlsc"] - }, - "application/vnd.webturbo": { - source: "iana", - extensions: ["wtb"] - }, - "application/vnd.wfa.dpp": { - source: "iana" - }, - "application/vnd.wfa.p2p": { - source: "iana" - }, - "application/vnd.wfa.wsc": { - source: "iana" - }, - "application/vnd.windows.devicepairing": { - source: "iana" - }, - "application/vnd.wmc": { - source: "iana" - }, - "application/vnd.wmf.bootstrap": { - source: "iana" - }, - "application/vnd.wolfram.mathematica": { - source: "iana" - }, - "application/vnd.wolfram.mathematica.package": { - source: "iana" - }, - "application/vnd.wolfram.player": { - source: "iana", - extensions: ["nbp"] - }, - "application/vnd.wordperfect": { - source: "iana", - extensions: ["wpd"] - }, - "application/vnd.wqd": { - source: "iana", - extensions: ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - source: "iana" - }, - "application/vnd.wt.stf": { - source: "iana", - extensions: ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - source: "iana" - }, - "application/vnd.wv.csp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.wv.ssp+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xacml+json": { - source: "iana", - compressible: true - }, - "application/vnd.xara": { - source: "iana", - extensions: ["xar"] - }, - "application/vnd.xfdl": { - source: "iana", - extensions: ["xfdl"] - }, - "application/vnd.xfdl.webform": { - source: "iana" - }, - "application/vnd.xmi+xml": { - source: "iana", - compressible: true - }, - "application/vnd.xmpie.cpkg": { - source: "iana" - }, - "application/vnd.xmpie.dpkg": { - source: "iana" - }, - "application/vnd.xmpie.plan": { - source: "iana" - }, - "application/vnd.xmpie.ppkg": { - source: "iana" - }, - "application/vnd.xmpie.xlim": { - source: "iana" - }, - "application/vnd.yamaha.hv-dic": { - source: "iana", - extensions: ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - source: "iana", - extensions: ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - source: "iana", - extensions: ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - source: "iana", - extensions: ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - source: "iana", - compressible: true, - extensions: ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - source: "iana" - }, - "application/vnd.yamaha.smaf-audio": { - source: "iana", - extensions: ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - source: "iana", - extensions: ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - source: "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - source: "iana" - }, - "application/vnd.yaoweme": { - source: "iana" - }, - "application/vnd.yellowriver-custom-menu": { - source: "iana", - extensions: ["cmp"] - }, - "application/vnd.youtube.yt": { - source: "iana" - }, - "application/vnd.zul": { - source: "iana", - extensions: ["zir", "zirz"] - }, - "application/vnd.zzazz.deck+xml": { - source: "iana", - compressible: true, - extensions: ["zaz"] - }, - "application/voicexml+xml": { - source: "iana", - compressible: true, - extensions: ["vxml"] - }, - "application/voucher-cms+json": { - source: "iana", - compressible: true - }, - "application/vq-rtcpxr": { - source: "iana" - }, - "application/wasm": { - source: "iana", - compressible: true, - extensions: ["wasm"] - }, - "application/watcherinfo+xml": { - source: "iana", - compressible: true, - extensions: ["wif"] - }, - "application/webpush-options+json": { - source: "iana", - compressible: true - }, - "application/whoispp-query": { - source: "iana" - }, - "application/whoispp-response": { - source: "iana" - }, - "application/widget": { - source: "iana", - extensions: ["wgt"] - }, - "application/winhlp": { - source: "apache", - extensions: ["hlp"] - }, - "application/wita": { - source: "iana" - }, - "application/wordperfect5.1": { - source: "iana" - }, - "application/wsdl+xml": { - source: "iana", - compressible: true, - extensions: ["wsdl"] - }, - "application/wspolicy+xml": { - source: "iana", - compressible: true, - extensions: ["wspolicy"] - }, - "application/x-7z-compressed": { - source: "apache", - compressible: false, - extensions: ["7z"] - }, - "application/x-abiword": { - source: "apache", - extensions: ["abw"] - }, - "application/x-ace-compressed": { - source: "apache", - extensions: ["ace"] - }, - "application/x-amf": { - source: "apache" - }, - "application/x-apple-diskimage": { - source: "apache", - extensions: ["dmg"] - }, - "application/x-arj": { - compressible: false, - extensions: ["arj"] - }, - "application/x-authorware-bin": { - source: "apache", - extensions: ["aab", "x32", "u32", "vox"] - }, - "application/x-authorware-map": { - source: "apache", - extensions: ["aam"] - }, - "application/x-authorware-seg": { - source: "apache", - extensions: ["aas"] - }, - "application/x-bcpio": { - source: "apache", - extensions: ["bcpio"] - }, - "application/x-bdoc": { - compressible: false, - extensions: ["bdoc"] - }, - "application/x-bittorrent": { - source: "apache", - extensions: ["torrent"] - }, - "application/x-blorb": { - source: "apache", - extensions: ["blb", "blorb"] - }, - "application/x-bzip": { - source: "apache", - compressible: false, - extensions: ["bz"] - }, - "application/x-bzip2": { - source: "apache", - compressible: false, - extensions: ["bz2", "boz"] - }, - "application/x-cbr": { - source: "apache", - extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] - }, - "application/x-cdlink": { - source: "apache", - extensions: ["vcd"] - }, - "application/x-cfs-compressed": { - source: "apache", - extensions: ["cfs"] - }, - "application/x-chat": { - source: "apache", - extensions: ["chat"] - }, - "application/x-chess-pgn": { - source: "apache", - extensions: ["pgn"] - }, - "application/x-chrome-extension": { - extensions: ["crx"] - }, - "application/x-cocoa": { - source: "nginx", - extensions: ["cco"] - }, - "application/x-compress": { - source: "apache" - }, - "application/x-conference": { - source: "apache", - extensions: ["nsc"] - }, - "application/x-cpio": { - source: "apache", - extensions: ["cpio"] - }, - "application/x-csh": { - source: "apache", - extensions: ["csh"] - }, - "application/x-deb": { - compressible: false - }, - "application/x-debian-package": { - source: "apache", - extensions: ["deb", "udeb"] - }, - "application/x-dgc-compressed": { - source: "apache", - extensions: ["dgc"] - }, - "application/x-director": { - source: "apache", - extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] - }, - "application/x-doom": { - source: "apache", - extensions: ["wad"] - }, - "application/x-dtbncx+xml": { - source: "apache", - compressible: true, - extensions: ["ncx"] - }, - "application/x-dtbook+xml": { - source: "apache", - compressible: true, - extensions: ["dtb"] - }, - "application/x-dtbresource+xml": { - source: "apache", - compressible: true, - extensions: ["res"] - }, - "application/x-dvi": { - source: "apache", - compressible: false, - extensions: ["dvi"] - }, - "application/x-envoy": { - source: "apache", - extensions: ["evy"] - }, - "application/x-eva": { - source: "apache", - extensions: ["eva"] - }, - "application/x-font-bdf": { - source: "apache", - extensions: ["bdf"] - }, - "application/x-font-dos": { - source: "apache" - }, - "application/x-font-framemaker": { - source: "apache" - }, - "application/x-font-ghostscript": { - source: "apache", - extensions: ["gsf"] - }, - "application/x-font-libgrx": { - source: "apache" - }, - "application/x-font-linux-psf": { - source: "apache", - extensions: ["psf"] - }, - "application/x-font-pcf": { - source: "apache", - extensions: ["pcf"] - }, - "application/x-font-snf": { - source: "apache", - extensions: ["snf"] - }, - "application/x-font-speedo": { - source: "apache" - }, - "application/x-font-sunos-news": { - source: "apache" - }, - "application/x-font-type1": { - source: "apache", - extensions: ["pfa", "pfb", "pfm", "afm"] - }, - "application/x-font-vfont": { - source: "apache" - }, - "application/x-freearc": { - source: "apache", - extensions: ["arc"] - }, - "application/x-futuresplash": { - source: "apache", - extensions: ["spl"] - }, - "application/x-gca-compressed": { - source: "apache", - extensions: ["gca"] - }, - "application/x-glulx": { - source: "apache", - extensions: ["ulx"] - }, - "application/x-gnumeric": { - source: "apache", - extensions: ["gnumeric"] - }, - "application/x-gramps-xml": { - source: "apache", - extensions: ["gramps"] - }, - "application/x-gtar": { - source: "apache", - extensions: ["gtar"] - }, - "application/x-gzip": { - source: "apache" - }, - "application/x-hdf": { - source: "apache", - extensions: ["hdf"] - }, - "application/x-httpd-php": { - compressible: true, - extensions: ["php"] - }, - "application/x-install-instructions": { - source: "apache", - extensions: ["install"] - }, - "application/x-iso9660-image": { - source: "apache", - extensions: ["iso"] - }, - "application/x-iwork-keynote-sffkey": { - extensions: ["key"] - }, - "application/x-iwork-numbers-sffnumbers": { - extensions: ["numbers"] - }, - "application/x-iwork-pages-sffpages": { - extensions: ["pages"] - }, - "application/x-java-archive-diff": { - source: "nginx", - extensions: ["jardiff"] - }, - "application/x-java-jnlp-file": { - source: "apache", - compressible: false, - extensions: ["jnlp"] - }, - "application/x-javascript": { - compressible: true - }, - "application/x-keepass2": { - extensions: ["kdbx"] - }, - "application/x-latex": { - source: "apache", - compressible: false, - extensions: ["latex"] - }, - "application/x-lua-bytecode": { - extensions: ["luac"] - }, - "application/x-lzh-compressed": { - source: "apache", - extensions: ["lzh", "lha"] - }, - "application/x-makeself": { - source: "nginx", - extensions: ["run"] - }, - "application/x-mie": { - source: "apache", - extensions: ["mie"] - }, - "application/x-mobipocket-ebook": { - source: "apache", - extensions: ["prc", "mobi"] - }, - "application/x-mpegurl": { - compressible: false - }, - "application/x-ms-application": { - source: "apache", - extensions: ["application"] - }, - "application/x-ms-shortcut": { - source: "apache", - extensions: ["lnk"] - }, - "application/x-ms-wmd": { - source: "apache", - extensions: ["wmd"] - }, - "application/x-ms-wmz": { - source: "apache", - extensions: ["wmz"] - }, - "application/x-ms-xbap": { - source: "apache", - extensions: ["xbap"] - }, - "application/x-msaccess": { - source: "apache", - extensions: ["mdb"] - }, - "application/x-msbinder": { - source: "apache", - extensions: ["obd"] - }, - "application/x-mscardfile": { - source: "apache", - extensions: ["crd"] - }, - "application/x-msclip": { - source: "apache", - extensions: ["clp"] - }, - "application/x-msdos-program": { - extensions: ["exe"] - }, - "application/x-msdownload": { - source: "apache", - extensions: ["exe", "dll", "com", "bat", "msi"] - }, - "application/x-msmediaview": { - source: "apache", - extensions: ["mvb", "m13", "m14"] - }, - "application/x-msmetafile": { - source: "apache", - extensions: ["wmf", "wmz", "emf", "emz"] - }, - "application/x-msmoney": { - source: "apache", - extensions: ["mny"] - }, - "application/x-mspublisher": { - source: "apache", - extensions: ["pub"] - }, - "application/x-msschedule": { - source: "apache", - extensions: ["scd"] - }, - "application/x-msterminal": { - source: "apache", - extensions: ["trm"] - }, - "application/x-mswrite": { - source: "apache", - extensions: ["wri"] - }, - "application/x-netcdf": { - source: "apache", - extensions: ["nc", "cdf"] - }, - "application/x-ns-proxy-autoconfig": { - compressible: true, - extensions: ["pac"] - }, - "application/x-nzb": { - source: "apache", - extensions: ["nzb"] - }, - "application/x-perl": { - source: "nginx", - extensions: ["pl", "pm"] - }, - "application/x-pilot": { - source: "nginx", - extensions: ["prc", "pdb"] - }, - "application/x-pkcs12": { - source: "apache", - compressible: false, - extensions: ["p12", "pfx"] - }, - "application/x-pkcs7-certificates": { - source: "apache", - extensions: ["p7b", "spc"] - }, - "application/x-pkcs7-certreqresp": { - source: "apache", - extensions: ["p7r"] - }, - "application/x-pki-message": { - source: "iana" - }, - "application/x-rar-compressed": { - source: "apache", - compressible: false, - extensions: ["rar"] - }, - "application/x-redhat-package-manager": { - source: "nginx", - extensions: ["rpm"] - }, - "application/x-research-info-systems": { - source: "apache", - extensions: ["ris"] - }, - "application/x-sea": { - source: "nginx", - extensions: ["sea"] - }, - "application/x-sh": { - source: "apache", - compressible: true, - extensions: ["sh"] - }, - "application/x-shar": { - source: "apache", - extensions: ["shar"] - }, - "application/x-shockwave-flash": { - source: "apache", - compressible: false, - extensions: ["swf"] - }, - "application/x-silverlight-app": { - source: "apache", - extensions: ["xap"] - }, - "application/x-sql": { - source: "apache", - extensions: ["sql"] - }, - "application/x-stuffit": { - source: "apache", - compressible: false, - extensions: ["sit"] - }, - "application/x-stuffitx": { - source: "apache", - extensions: ["sitx"] - }, - "application/x-subrip": { - source: "apache", - extensions: ["srt"] - }, - "application/x-sv4cpio": { - source: "apache", - extensions: ["sv4cpio"] - }, - "application/x-sv4crc": { - source: "apache", - extensions: ["sv4crc"] - }, - "application/x-t3vm-image": { - source: "apache", - extensions: ["t3"] - }, - "application/x-tads": { - source: "apache", - extensions: ["game"] - }, - "application/x-tar": { - source: "apache", - compressible: true, - extensions: ["tar"] - }, - "application/x-tcl": { - source: "apache", - extensions: ["tcl", "tk"] - }, - "application/x-tex": { - source: "apache", - extensions: ["tex"] - }, - "application/x-tex-tfm": { - source: "apache", - extensions: ["tfm"] - }, - "application/x-texinfo": { - source: "apache", - extensions: ["texinfo", "texi"] - }, - "application/x-tgif": { - source: "apache", - extensions: ["obj"] - }, - "application/x-ustar": { - source: "apache", - extensions: ["ustar"] - }, - "application/x-virtualbox-hdd": { - compressible: true, - extensions: ["hdd"] - }, - "application/x-virtualbox-ova": { - compressible: true, - extensions: ["ova"] - }, - "application/x-virtualbox-ovf": { - compressible: true, - extensions: ["ovf"] - }, - "application/x-virtualbox-vbox": { - compressible: true, - extensions: ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - compressible: false, - extensions: ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - compressible: true, - extensions: ["vdi"] - }, - "application/x-virtualbox-vhd": { - compressible: true, - extensions: ["vhd"] - }, - "application/x-virtualbox-vmdk": { - compressible: true, - extensions: ["vmdk"] - }, - "application/x-wais-source": { - source: "apache", - extensions: ["src"] - }, - "application/x-web-app-manifest+json": { - compressible: true, - extensions: ["webapp"] - }, - "application/x-www-form-urlencoded": { - source: "iana", - compressible: true - }, - "application/x-x509-ca-cert": { - source: "iana", - extensions: ["der", "crt", "pem"] - }, - "application/x-x509-ca-ra-cert": { - source: "iana" - }, - "application/x-x509-next-ca-cert": { - source: "iana" - }, - "application/x-xfig": { - source: "apache", - extensions: ["fig"] - }, - "application/x-xliff+xml": { - source: "apache", - compressible: true, - extensions: ["xlf"] - }, - "application/x-xpinstall": { - source: "apache", - compressible: false, - extensions: ["xpi"] - }, - "application/x-xz": { - source: "apache", - extensions: ["xz"] - }, - "application/x-zmachine": { - source: "apache", - extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] - }, - "application/x400-bp": { - source: "iana" - }, - "application/xacml+xml": { - source: "iana", - compressible: true - }, - "application/xaml+xml": { - source: "apache", - compressible: true, - extensions: ["xaml"] - }, - "application/xcap-att+xml": { - source: "iana", - compressible: true, - extensions: ["xav"] - }, - "application/xcap-caps+xml": { - source: "iana", - compressible: true, - extensions: ["xca"] - }, - "application/xcap-diff+xml": { - source: "iana", - compressible: true, - extensions: ["xdf"] - }, - "application/xcap-el+xml": { - source: "iana", - compressible: true, - extensions: ["xel"] - }, - "application/xcap-error+xml": { - source: "iana", - compressible: true - }, - "application/xcap-ns+xml": { - source: "iana", - compressible: true, - extensions: ["xns"] - }, - "application/xcon-conference-info+xml": { - source: "iana", - compressible: true - }, - "application/xcon-conference-info-diff+xml": { - source: "iana", - compressible: true - }, - "application/xenc+xml": { - source: "iana", - compressible: true, - extensions: ["xenc"] - }, - "application/xhtml+xml": { - source: "iana", - compressible: true, - extensions: ["xhtml", "xht"] - }, - "application/xhtml-voice+xml": { - source: "apache", - compressible: true - }, - "application/xliff+xml": { - source: "iana", - compressible: true, - extensions: ["xlf"] - }, - "application/xml": { - source: "iana", - compressible: true, - extensions: ["xml", "xsl", "xsd", "rng"] - }, - "application/xml-dtd": { - source: "iana", - compressible: true, - extensions: ["dtd"] - }, - "application/xml-external-parsed-entity": { - source: "iana" - }, - "application/xml-patch+xml": { - source: "iana", - compressible: true - }, - "application/xmpp+xml": { - source: "iana", - compressible: true - }, - "application/xop+xml": { - source: "iana", - compressible: true, - extensions: ["xop"] - }, - "application/xproc+xml": { - source: "apache", - compressible: true, - extensions: ["xpl"] - }, - "application/xslt+xml": { - source: "iana", - compressible: true, - extensions: ["xsl", "xslt"] - }, - "application/xspf+xml": { - source: "apache", - compressible: true, - extensions: ["xspf"] - }, - "application/xv+xml": { - source: "iana", - compressible: true, - extensions: ["mxml", "xhvml", "xvml", "xvm"] - }, - "application/yang": { - source: "iana", - extensions: ["yang"] - }, - "application/yang-data+json": { - source: "iana", - compressible: true - }, - "application/yang-data+xml": { - source: "iana", - compressible: true - }, - "application/yang-patch+json": { - source: "iana", - compressible: true - }, - "application/yang-patch+xml": { - source: "iana", - compressible: true - }, - "application/yin+xml": { - source: "iana", - compressible: true, - extensions: ["yin"] - }, - "application/zip": { - source: "iana", - compressible: false, - extensions: ["zip"] - }, - "application/zlib": { - source: "iana" - }, - "application/zstd": { - source: "iana" - }, - "audio/1d-interleaved-parityfec": { - source: "iana" - }, - "audio/32kadpcm": { - source: "iana" - }, - "audio/3gpp": { - source: "iana", - compressible: false, - extensions: ["3gpp"] - }, - "audio/3gpp2": { - source: "iana" - }, - "audio/aac": { - source: "iana" - }, - "audio/ac3": { - source: "iana" - }, - "audio/adpcm": { - source: "apache", - extensions: ["adp"] - }, - "audio/amr": { - source: "iana", - extensions: ["amr"] - }, - "audio/amr-wb": { - source: "iana" - }, - "audio/amr-wb+": { - source: "iana" - }, - "audio/aptx": { - source: "iana" - }, - "audio/asc": { - source: "iana" - }, - "audio/atrac-advanced-lossless": { - source: "iana" - }, - "audio/atrac-x": { - source: "iana" - }, - "audio/atrac3": { - source: "iana" - }, - "audio/basic": { - source: "iana", - compressible: false, - extensions: ["au", "snd"] - }, - "audio/bv16": { - source: "iana" - }, - "audio/bv32": { - source: "iana" - }, - "audio/clearmode": { - source: "iana" - }, - "audio/cn": { - source: "iana" - }, - "audio/dat12": { - source: "iana" - }, - "audio/dls": { - source: "iana" - }, - "audio/dsr-es201108": { - source: "iana" - }, - "audio/dsr-es202050": { - source: "iana" - }, - "audio/dsr-es202211": { - source: "iana" - }, - "audio/dsr-es202212": { - source: "iana" - }, - "audio/dv": { - source: "iana" - }, - "audio/dvi4": { - source: "iana" - }, - "audio/eac3": { - source: "iana" - }, - "audio/encaprtp": { - source: "iana" - }, - "audio/evrc": { - source: "iana" - }, - "audio/evrc-qcp": { - source: "iana" - }, - "audio/evrc0": { - source: "iana" - }, - "audio/evrc1": { - source: "iana" - }, - "audio/evrcb": { - source: "iana" - }, - "audio/evrcb0": { - source: "iana" - }, - "audio/evrcb1": { - source: "iana" - }, - "audio/evrcnw": { - source: "iana" - }, - "audio/evrcnw0": { - source: "iana" - }, - "audio/evrcnw1": { - source: "iana" - }, - "audio/evrcwb": { - source: "iana" - }, - "audio/evrcwb0": { - source: "iana" - }, - "audio/evrcwb1": { - source: "iana" - }, - "audio/evs": { - source: "iana" - }, - "audio/flexfec": { - source: "iana" - }, - "audio/fwdred": { - source: "iana" - }, - "audio/g711-0": { - source: "iana" - }, - "audio/g719": { - source: "iana" - }, - "audio/g722": { - source: "iana" - }, - "audio/g7221": { - source: "iana" - }, - "audio/g723": { - source: "iana" - }, - "audio/g726-16": { - source: "iana" - }, - "audio/g726-24": { - source: "iana" - }, - "audio/g726-32": { - source: "iana" - }, - "audio/g726-40": { - source: "iana" - }, - "audio/g728": { - source: "iana" - }, - "audio/g729": { - source: "iana" - }, - "audio/g7291": { - source: "iana" - }, - "audio/g729d": { - source: "iana" - }, - "audio/g729e": { - source: "iana" - }, - "audio/gsm": { - source: "iana" - }, - "audio/gsm-efr": { - source: "iana" - }, - "audio/gsm-hr-08": { - source: "iana" - }, - "audio/ilbc": { - source: "iana" - }, - "audio/ip-mr_v2.5": { - source: "iana" - }, - "audio/isac": { - source: "apache" - }, - "audio/l16": { - source: "iana" - }, - "audio/l20": { - source: "iana" - }, - "audio/l24": { - source: "iana", - compressible: false - }, - "audio/l8": { - source: "iana" - }, - "audio/lpc": { - source: "iana" - }, - "audio/melp": { - source: "iana" - }, - "audio/melp1200": { - source: "iana" - }, - "audio/melp2400": { - source: "iana" - }, - "audio/melp600": { - source: "iana" - }, - "audio/mhas": { - source: "iana" - }, - "audio/midi": { - source: "apache", - extensions: ["mid", "midi", "kar", "rmi"] - }, - "audio/mobile-xmf": { - source: "iana", - extensions: ["mxmf"] - }, - "audio/mp3": { - compressible: false, - extensions: ["mp3"] - }, - "audio/mp4": { - source: "iana", - compressible: false, - extensions: ["m4a", "mp4a"] - }, - "audio/mp4a-latm": { - source: "iana" - }, - "audio/mpa": { - source: "iana" - }, - "audio/mpa-robust": { - source: "iana" - }, - "audio/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] - }, - "audio/mpeg4-generic": { - source: "iana" - }, - "audio/musepack": { - source: "apache" - }, - "audio/ogg": { - source: "iana", - compressible: false, - extensions: ["oga", "ogg", "spx", "opus"] - }, - "audio/opus": { - source: "iana" - }, - "audio/parityfec": { - source: "iana" - }, - "audio/pcma": { - source: "iana" - }, - "audio/pcma-wb": { - source: "iana" - }, - "audio/pcmu": { - source: "iana" - }, - "audio/pcmu-wb": { - source: "iana" - }, - "audio/prs.sid": { - source: "iana" - }, - "audio/qcelp": { - source: "iana" - }, - "audio/raptorfec": { - source: "iana" - }, - "audio/red": { - source: "iana" - }, - "audio/rtp-enc-aescm128": { - source: "iana" - }, - "audio/rtp-midi": { - source: "iana" - }, - "audio/rtploopback": { - source: "iana" - }, - "audio/rtx": { - source: "iana" - }, - "audio/s3m": { - source: "apache", - extensions: ["s3m"] - }, - "audio/scip": { - source: "iana" - }, - "audio/silk": { - source: "apache", - extensions: ["sil"] - }, - "audio/smv": { - source: "iana" - }, - "audio/smv-qcp": { - source: "iana" - }, - "audio/smv0": { - source: "iana" - }, - "audio/sofa": { - source: "iana" - }, - "audio/sp-midi": { - source: "iana" - }, - "audio/speex": { - source: "iana" - }, - "audio/t140c": { - source: "iana" - }, - "audio/t38": { - source: "iana" - }, - "audio/telephone-event": { - source: "iana" - }, - "audio/tetra_acelp": { - source: "iana" - }, - "audio/tetra_acelp_bb": { - source: "iana" - }, - "audio/tone": { - source: "iana" - }, - "audio/tsvcis": { - source: "iana" - }, - "audio/uemclip": { - source: "iana" - }, - "audio/ulpfec": { - source: "iana" - }, - "audio/usac": { - source: "iana" - }, - "audio/vdvi": { - source: "iana" - }, - "audio/vmr-wb": { - source: "iana" - }, - "audio/vnd.3gpp.iufp": { - source: "iana" - }, - "audio/vnd.4sb": { - source: "iana" - }, - "audio/vnd.audiokoz": { - source: "iana" - }, - "audio/vnd.celp": { - source: "iana" - }, - "audio/vnd.cisco.nse": { - source: "iana" - }, - "audio/vnd.cmles.radio-events": { - source: "iana" - }, - "audio/vnd.cns.anp1": { - source: "iana" - }, - "audio/vnd.cns.inf1": { - source: "iana" - }, - "audio/vnd.dece.audio": { - source: "iana", - extensions: ["uva", "uvva"] - }, - "audio/vnd.digital-winds": { - source: "iana", - extensions: ["eol"] - }, - "audio/vnd.dlna.adts": { - source: "iana" - }, - "audio/vnd.dolby.heaac.1": { - source: "iana" - }, - "audio/vnd.dolby.heaac.2": { - source: "iana" - }, - "audio/vnd.dolby.mlp": { - source: "iana" - }, - "audio/vnd.dolby.mps": { - source: "iana" - }, - "audio/vnd.dolby.pl2": { - source: "iana" - }, - "audio/vnd.dolby.pl2x": { - source: "iana" - }, - "audio/vnd.dolby.pl2z": { - source: "iana" - }, - "audio/vnd.dolby.pulse.1": { - source: "iana" - }, - "audio/vnd.dra": { - source: "iana", - extensions: ["dra"] - }, - "audio/vnd.dts": { - source: "iana", - extensions: ["dts"] - }, - "audio/vnd.dts.hd": { - source: "iana", - extensions: ["dtshd"] - }, - "audio/vnd.dts.uhd": { - source: "iana" - }, - "audio/vnd.dvb.file": { - source: "iana" - }, - "audio/vnd.everad.plj": { - source: "iana" - }, - "audio/vnd.hns.audio": { - source: "iana" - }, - "audio/vnd.lucent.voice": { - source: "iana", - extensions: ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - source: "iana", - extensions: ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - source: "iana" - }, - "audio/vnd.nortel.vbk": { - source: "iana" - }, - "audio/vnd.nuera.ecelp4800": { - source: "iana", - extensions: ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - source: "iana", - extensions: ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - source: "iana", - extensions: ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - source: "iana" - }, - "audio/vnd.presonus.multitrack": { - source: "iana" - }, - "audio/vnd.qcelp": { - source: "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - source: "iana" - }, - "audio/vnd.rip": { - source: "iana", - extensions: ["rip"] - }, - "audio/vnd.rn-realaudio": { - compressible: false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - source: "iana" - }, - "audio/vnd.vmx.cvsd": { - source: "iana" - }, - "audio/vnd.wave": { - compressible: false - }, - "audio/vorbis": { - source: "iana", - compressible: false - }, - "audio/vorbis-config": { - source: "iana" - }, - "audio/wav": { - compressible: false, - extensions: ["wav"] - }, - "audio/wave": { - compressible: false, - extensions: ["wav"] - }, - "audio/webm": { - source: "apache", - compressible: false, - extensions: ["weba"] - }, - "audio/x-aac": { - source: "apache", - compressible: false, - extensions: ["aac"] - }, - "audio/x-aiff": { - source: "apache", - extensions: ["aif", "aiff", "aifc"] - }, - "audio/x-caf": { - source: "apache", - compressible: false, - extensions: ["calf"] - }, - "audio/x-flac": { - source: "apache", - extensions: ["flac"] - }, - "audio/x-m4a": { - source: "nginx", - extensions: ["m4a"] - }, - "audio/x-matroska": { - source: "apache", - extensions: ["mka"] - }, - "audio/x-mpegurl": { - source: "apache", - extensions: ["m3u"] - }, - "audio/x-ms-wax": { - source: "apache", - extensions: ["wax"] - }, - "audio/x-ms-wma": { - source: "apache", - extensions: ["wma"] - }, - "audio/x-pn-realaudio": { - source: "apache", - extensions: ["ram", "ra"] - }, - "audio/x-pn-realaudio-plugin": { - source: "apache", - extensions: ["rmp"] - }, - "audio/x-realaudio": { - source: "nginx", - extensions: ["ra"] - }, - "audio/x-tta": { - source: "apache" - }, - "audio/x-wav": { - source: "apache", - extensions: ["wav"] - }, - "audio/xm": { - source: "apache", - extensions: ["xm"] - }, - "chemical/x-cdx": { - source: "apache", - extensions: ["cdx"] - }, - "chemical/x-cif": { - source: "apache", - extensions: ["cif"] - }, - "chemical/x-cmdf": { - source: "apache", - extensions: ["cmdf"] - }, - "chemical/x-cml": { - source: "apache", - extensions: ["cml"] - }, - "chemical/x-csml": { - source: "apache", - extensions: ["csml"] - }, - "chemical/x-pdb": { - source: "apache" - }, - "chemical/x-xyz": { - source: "apache", - extensions: ["xyz"] - }, - "font/collection": { - source: "iana", - extensions: ["ttc"] - }, - "font/otf": { - source: "iana", - compressible: true, - extensions: ["otf"] - }, - "font/sfnt": { - source: "iana" - }, - "font/ttf": { - source: "iana", - compressible: true, - extensions: ["ttf"] - }, - "font/woff": { - source: "iana", - extensions: ["woff"] - }, - "font/woff2": { - source: "iana", - extensions: ["woff2"] - }, - "image/aces": { - source: "iana", - extensions: ["exr"] - }, - "image/apng": { - compressible: false, - extensions: ["apng"] - }, - "image/avci": { - source: "iana", - extensions: ["avci"] - }, - "image/avcs": { - source: "iana", - extensions: ["avcs"] - }, - "image/avif": { - source: "iana", - compressible: false, - extensions: ["avif"] - }, - "image/bmp": { - source: "iana", - compressible: true, - extensions: ["bmp"] - }, - "image/cgm": { - source: "iana", - extensions: ["cgm"] - }, - "image/dicom-rle": { - source: "iana", - extensions: ["drle"] - }, - "image/emf": { - source: "iana", - extensions: ["emf"] - }, - "image/fits": { - source: "iana", - extensions: ["fits"] - }, - "image/g3fax": { - source: "iana", - extensions: ["g3"] - }, - "image/gif": { - source: "iana", - compressible: false, - extensions: ["gif"] - }, - "image/heic": { - source: "iana", - extensions: ["heic"] - }, - "image/heic-sequence": { - source: "iana", - extensions: ["heics"] - }, - "image/heif": { - source: "iana", - extensions: ["heif"] - }, - "image/heif-sequence": { - source: "iana", - extensions: ["heifs"] - }, - "image/hej2k": { - source: "iana", - extensions: ["hej2"] - }, - "image/hsj2": { - source: "iana", - extensions: ["hsj2"] - }, - "image/ief": { - source: "iana", - extensions: ["ief"] - }, - "image/jls": { - source: "iana", - extensions: ["jls"] - }, - "image/jp2": { - source: "iana", - compressible: false, - extensions: ["jp2", "jpg2"] - }, - "image/jpeg": { - source: "iana", - compressible: false, - extensions: ["jpeg", "jpg", "jpe"] - }, - "image/jph": { - source: "iana", - extensions: ["jph"] - }, - "image/jphc": { - source: "iana", - extensions: ["jhc"] - }, - "image/jpm": { - source: "iana", - compressible: false, - extensions: ["jpm"] - }, - "image/jpx": { - source: "iana", - compressible: false, - extensions: ["jpx", "jpf"] - }, - "image/jxr": { - source: "iana", - extensions: ["jxr"] - }, - "image/jxra": { - source: "iana", - extensions: ["jxra"] - }, - "image/jxrs": { - source: "iana", - extensions: ["jxrs"] - }, - "image/jxs": { - source: "iana", - extensions: ["jxs"] - }, - "image/jxsc": { - source: "iana", - extensions: ["jxsc"] - }, - "image/jxsi": { - source: "iana", - extensions: ["jxsi"] - }, - "image/jxss": { - source: "iana", - extensions: ["jxss"] - }, - "image/ktx": { - source: "iana", - extensions: ["ktx"] - }, - "image/ktx2": { - source: "iana", - extensions: ["ktx2"] - }, - "image/naplps": { - source: "iana" - }, - "image/pjpeg": { - compressible: false - }, - "image/png": { - source: "iana", - compressible: false, - extensions: ["png"] - }, - "image/prs.btif": { - source: "iana", - extensions: ["btif"] - }, - "image/prs.pti": { - source: "iana", - extensions: ["pti"] - }, - "image/pwg-raster": { - source: "iana" - }, - "image/sgi": { - source: "apache", - extensions: ["sgi"] - }, - "image/svg+xml": { - source: "iana", - compressible: true, - extensions: ["svg", "svgz"] - }, - "image/t38": { - source: "iana", - extensions: ["t38"] - }, - "image/tiff": { - source: "iana", - compressible: false, - extensions: ["tif", "tiff"] - }, - "image/tiff-fx": { - source: "iana", - extensions: ["tfx"] - }, - "image/vnd.adobe.photoshop": { - source: "iana", - compressible: true, - extensions: ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - source: "iana", - extensions: ["azv"] - }, - "image/vnd.cns.inf2": { - source: "iana" - }, - "image/vnd.dece.graphic": { - source: "iana", - extensions: ["uvi", "uvvi", "uvg", "uvvg"] - }, - "image/vnd.djvu": { - source: "iana", - extensions: ["djvu", "djv"] - }, - "image/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "image/vnd.dwg": { - source: "iana", - extensions: ["dwg"] - }, - "image/vnd.dxf": { - source: "iana", - extensions: ["dxf"] - }, - "image/vnd.fastbidsheet": { - source: "iana", - extensions: ["fbs"] - }, - "image/vnd.fpx": { - source: "iana", - extensions: ["fpx"] - }, - "image/vnd.fst": { - source: "iana", - extensions: ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - source: "iana", - extensions: ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - source: "iana", - extensions: ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - source: "iana" - }, - "image/vnd.microsoft.icon": { - source: "iana", - compressible: true, - extensions: ["ico"] - }, - "image/vnd.mix": { - source: "iana" - }, - "image/vnd.mozilla.apng": { - source: "iana" - }, - "image/vnd.ms-dds": { - compressible: true, - extensions: ["dds"] - }, - "image/vnd.ms-modi": { - source: "iana", - extensions: ["mdi"] - }, - "image/vnd.ms-photo": { - source: "apache", - extensions: ["wdp"] - }, - "image/vnd.net-fpx": { - source: "iana", - extensions: ["npx"] - }, - "image/vnd.pco.b16": { - source: "iana", - extensions: ["b16"] - }, - "image/vnd.radiance": { - source: "iana" - }, - "image/vnd.sealed.png": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - source: "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - source: "iana" - }, - "image/vnd.svf": { - source: "iana" - }, - "image/vnd.tencent.tap": { - source: "iana", - extensions: ["tap"] - }, - "image/vnd.valve.source.texture": { - source: "iana", - extensions: ["vtf"] - }, - "image/vnd.wap.wbmp": { - source: "iana", - extensions: ["wbmp"] - }, - "image/vnd.xiff": { - source: "iana", - extensions: ["xif"] - }, - "image/vnd.zbrush.pcx": { - source: "iana", - extensions: ["pcx"] - }, - "image/webp": { - source: "apache", - extensions: ["webp"] - }, - "image/wmf": { - source: "iana", - extensions: ["wmf"] - }, - "image/x-3ds": { - source: "apache", - extensions: ["3ds"] - }, - "image/x-cmu-raster": { - source: "apache", - extensions: ["ras"] - }, - "image/x-cmx": { - source: "apache", - extensions: ["cmx"] - }, - "image/x-freehand": { - source: "apache", - extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] - }, - "image/x-icon": { - source: "apache", - compressible: true, - extensions: ["ico"] - }, - "image/x-jng": { - source: "nginx", - extensions: ["jng"] - }, - "image/x-mrsid-image": { - source: "apache", - extensions: ["sid"] - }, - "image/x-ms-bmp": { - source: "nginx", - compressible: true, - extensions: ["bmp"] - }, - "image/x-pcx": { - source: "apache", - extensions: ["pcx"] - }, - "image/x-pict": { - source: "apache", - extensions: ["pic", "pct"] - }, - "image/x-portable-anymap": { - source: "apache", - extensions: ["pnm"] - }, - "image/x-portable-bitmap": { - source: "apache", - extensions: ["pbm"] - }, - "image/x-portable-graymap": { - source: "apache", - extensions: ["pgm"] - }, - "image/x-portable-pixmap": { - source: "apache", - extensions: ["ppm"] - }, - "image/x-rgb": { - source: "apache", - extensions: ["rgb"] - }, - "image/x-tga": { - source: "apache", - extensions: ["tga"] - }, - "image/x-xbitmap": { - source: "apache", - extensions: ["xbm"] - }, - "image/x-xcf": { - compressible: false - }, - "image/x-xpixmap": { - source: "apache", - extensions: ["xpm"] - }, - "image/x-xwindowdump": { - source: "apache", - extensions: ["xwd"] - }, - "message/cpim": { - source: "iana" - }, - "message/delivery-status": { - source: "iana" - }, - "message/disposition-notification": { - source: "iana", - extensions: [ - "disposition-notification" - ] - }, - "message/external-body": { - source: "iana" - }, - "message/feedback-report": { - source: "iana" - }, - "message/global": { - source: "iana", - extensions: ["u8msg"] - }, - "message/global-delivery-status": { - source: "iana", - extensions: ["u8dsn"] - }, - "message/global-disposition-notification": { - source: "iana", - extensions: ["u8mdn"] - }, - "message/global-headers": { - source: "iana", - extensions: ["u8hdr"] - }, - "message/http": { - source: "iana", - compressible: false - }, - "message/imdn+xml": { - source: "iana", - compressible: true - }, - "message/news": { - source: "iana" - }, - "message/partial": { - source: "iana", - compressible: false - }, - "message/rfc822": { - source: "iana", - compressible: true, - extensions: ["eml", "mime"] - }, - "message/s-http": { - source: "iana" - }, - "message/sip": { - source: "iana" - }, - "message/sipfrag": { - source: "iana" - }, - "message/tracking-status": { - source: "iana" - }, - "message/vnd.si.simp": { - source: "iana" - }, - "message/vnd.wfa.wsc": { - source: "iana", - extensions: ["wsc"] - }, - "model/3mf": { - source: "iana", - extensions: ["3mf"] - }, - "model/e57": { - source: "iana" - }, - "model/gltf+json": { - source: "iana", - compressible: true, - extensions: ["gltf"] - }, - "model/gltf-binary": { - source: "iana", - compressible: true, - extensions: ["glb"] - }, - "model/iges": { - source: "iana", - compressible: false, - extensions: ["igs", "iges"] - }, - "model/mesh": { - source: "iana", - compressible: false, - extensions: ["msh", "mesh", "silo"] - }, - "model/mtl": { - source: "iana", - extensions: ["mtl"] - }, - "model/obj": { - source: "iana", - extensions: ["obj"] - }, - "model/step": { - source: "iana" - }, - "model/step+xml": { - source: "iana", - compressible: true, - extensions: ["stpx"] - }, - "model/step+zip": { - source: "iana", - compressible: false, - extensions: ["stpz"] - }, - "model/step-xml+zip": { - source: "iana", - compressible: false, - extensions: ["stpxz"] - }, - "model/stl": { - source: "iana", - extensions: ["stl"] - }, - "model/vnd.collada+xml": { - source: "iana", - compressible: true, - extensions: ["dae"] - }, - "model/vnd.dwf": { - source: "iana", - extensions: ["dwf"] - }, - "model/vnd.flatland.3dml": { - source: "iana" - }, - "model/vnd.gdl": { - source: "iana", - extensions: ["gdl"] - }, - "model/vnd.gs-gdl": { - source: "apache" - }, - "model/vnd.gs.gdl": { - source: "iana" - }, - "model/vnd.gtw": { - source: "iana", - extensions: ["gtw"] - }, - "model/vnd.moml+xml": { - source: "iana", - compressible: true - }, - "model/vnd.mts": { - source: "iana", - extensions: ["mts"] - }, - "model/vnd.opengex": { - source: "iana", - extensions: ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - source: "iana", - extensions: ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - source: "iana", - extensions: ["x_t"] - }, - "model/vnd.pytha.pyox": { - source: "iana" - }, - "model/vnd.rosette.annotated-data-model": { - source: "iana" - }, - "model/vnd.sap.vds": { - source: "iana", - extensions: ["vds"] - }, - "model/vnd.usdz+zip": { - source: "iana", - compressible: false, - extensions: ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - source: "iana", - extensions: ["bsp"] - }, - "model/vnd.vtu": { - source: "iana", - extensions: ["vtu"] - }, - "model/vrml": { - source: "iana", - compressible: false, - extensions: ["wrl", "vrml"] - }, - "model/x3d+binary": { - source: "apache", - compressible: false, - extensions: ["x3db", "x3dbz"] - }, - "model/x3d+fastinfoset": { - source: "iana", - extensions: ["x3db"] - }, - "model/x3d+vrml": { - source: "apache", - compressible: false, - extensions: ["x3dv", "x3dvz"] - }, - "model/x3d+xml": { - source: "iana", - compressible: true, - extensions: ["x3d", "x3dz"] - }, - "model/x3d-vrml": { - source: "iana", - extensions: ["x3dv"] - }, - "multipart/alternative": { - source: "iana", - compressible: false - }, - "multipart/appledouble": { - source: "iana" - }, - "multipart/byteranges": { - source: "iana" - }, - "multipart/digest": { - source: "iana" - }, - "multipart/encrypted": { - source: "iana", - compressible: false - }, - "multipart/form-data": { - source: "iana", - compressible: false - }, - "multipart/header-set": { - source: "iana" - }, - "multipart/mixed": { - source: "iana" - }, - "multipart/multilingual": { - source: "iana" - }, - "multipart/parallel": { - source: "iana" - }, - "multipart/related": { - source: "iana", - compressible: false - }, - "multipart/report": { - source: "iana" - }, - "multipart/signed": { - source: "iana", - compressible: false - }, - "multipart/vnd.bint.med-plus": { - source: "iana" - }, - "multipart/voice-message": { - source: "iana" - }, - "multipart/x-mixed-replace": { - source: "iana" - }, - "text/1d-interleaved-parityfec": { - source: "iana" - }, - "text/cache-manifest": { - source: "iana", - compressible: true, - extensions: ["appcache", "manifest"] - }, - "text/calendar": { - source: "iana", - extensions: ["ics", "ifb"] - }, - "text/calender": { - compressible: true - }, - "text/cmd": { - compressible: true - }, - "text/coffeescript": { - extensions: ["coffee", "litcoffee"] - }, - "text/cql": { - source: "iana" - }, - "text/cql-expression": { - source: "iana" - }, - "text/cql-identifier": { - source: "iana" - }, - "text/css": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["css"] - }, - "text/csv": { - source: "iana", - compressible: true, - extensions: ["csv"] - }, - "text/csv-schema": { - source: "iana" - }, - "text/directory": { - source: "iana" - }, - "text/dns": { - source: "iana" - }, - "text/ecmascript": { - source: "iana" - }, - "text/encaprtp": { - source: "iana" - }, - "text/enriched": { - source: "iana" - }, - "text/fhirpath": { - source: "iana" - }, - "text/flexfec": { - source: "iana" - }, - "text/fwdred": { - source: "iana" - }, - "text/gff3": { - source: "iana" - }, - "text/grammar-ref-list": { - source: "iana" - }, - "text/html": { - source: "iana", - compressible: true, - extensions: ["html", "htm", "shtml"] - }, - "text/jade": { - extensions: ["jade"] - }, - "text/javascript": { - source: "iana", - compressible: true - }, - "text/jcr-cnd": { - source: "iana" - }, - "text/jsx": { - compressible: true, - extensions: ["jsx"] - }, - "text/less": { - compressible: true, - extensions: ["less"] - }, - "text/markdown": { - source: "iana", - compressible: true, - extensions: ["markdown", "md"] - }, - "text/mathml": { - source: "nginx", - extensions: ["mml"] - }, - "text/mdx": { - compressible: true, - extensions: ["mdx"] - }, - "text/mizar": { - source: "iana" - }, - "text/n3": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["n3"] - }, - "text/parameters": { - source: "iana", - charset: "UTF-8" - }, - "text/parityfec": { - source: "iana" - }, - "text/plain": { - source: "iana", - compressible: true, - extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] - }, - "text/provenance-notation": { - source: "iana", - charset: "UTF-8" - }, - "text/prs.fallenstein.rst": { - source: "iana" - }, - "text/prs.lines.tag": { - source: "iana", - extensions: ["dsc"] - }, - "text/prs.prop.logic": { - source: "iana" - }, - "text/raptorfec": { - source: "iana" - }, - "text/red": { - source: "iana" - }, - "text/rfc822-headers": { - source: "iana" - }, - "text/richtext": { - source: "iana", - compressible: true, - extensions: ["rtx"] - }, - "text/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"] - }, - "text/rtp-enc-aescm128": { - source: "iana" - }, - "text/rtploopback": { - source: "iana" - }, - "text/rtx": { - source: "iana" - }, - "text/sgml": { - source: "iana", - extensions: ["sgml", "sgm"] - }, - "text/shaclc": { - source: "iana" - }, - "text/shex": { - source: "iana", - extensions: ["shex"] - }, - "text/slim": { - extensions: ["slim", "slm"] - }, - "text/spdx": { - source: "iana", - extensions: ["spdx"] - }, - "text/strings": { - source: "iana" - }, - "text/stylus": { - extensions: ["stylus", "style"] - }, - "text/t140": { - source: "iana" - }, - "text/tab-separated-values": { - source: "iana", - compressible: true, - extensions: ["tsv"] - }, - "text/troff": { - source: "iana", - extensions: ["t", "tr", "roff", "man", "me", "ms"] - }, - "text/turtle": { - source: "iana", - charset: "UTF-8", - extensions: ["ttl"] - }, - "text/ulpfec": { - source: "iana" - }, - "text/uri-list": { - source: "iana", - compressible: true, - extensions: ["uri", "uris", "urls"] - }, - "text/vcard": { - source: "iana", - compressible: true, - extensions: ["vcard"] - }, - "text/vnd.a": { - source: "iana" - }, - "text/vnd.abc": { - source: "iana" - }, - "text/vnd.ascii-art": { - source: "iana" - }, - "text/vnd.curl": { - source: "iana", - extensions: ["curl"] - }, - "text/vnd.curl.dcurl": { - source: "apache", - extensions: ["dcurl"] - }, - "text/vnd.curl.mcurl": { - source: "apache", - extensions: ["mcurl"] - }, - "text/vnd.curl.scurl": { - source: "apache", - extensions: ["scurl"] - }, - "text/vnd.debian.copyright": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.dmclientscript": { - source: "iana" - }, - "text/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.familysearch.gedcom": { - source: "iana", - extensions: ["ged"] - }, - "text/vnd.ficlab.flt": { - source: "iana" - }, - "text/vnd.fly": { - source: "iana", - extensions: ["fly"] - }, - "text/vnd.fmi.flexstor": { - source: "iana", - extensions: ["flx"] - }, - "text/vnd.gml": { - source: "iana" - }, - "text/vnd.graphviz": { - source: "iana", - extensions: ["gv"] - }, - "text/vnd.hans": { - source: "iana" - }, - "text/vnd.hgl": { - source: "iana" - }, - "text/vnd.in3d.3dml": { - source: "iana", - extensions: ["3dml"] - }, - "text/vnd.in3d.spot": { - source: "iana", - extensions: ["spot"] - }, - "text/vnd.iptc.newsml": { - source: "iana" - }, - "text/vnd.iptc.nitf": { - source: "iana" - }, - "text/vnd.latex-z": { - source: "iana" - }, - "text/vnd.motorola.reflex": { - source: "iana" - }, - "text/vnd.ms-mediapackage": { - source: "iana" - }, - "text/vnd.net2phone.commcenter.command": { - source: "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - source: "iana" - }, - "text/vnd.senx.warpscript": { - source: "iana" - }, - "text/vnd.si.uricatalogue": { - source: "iana" - }, - "text/vnd.sosi": { - source: "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - source: "iana", - charset: "UTF-8", - extensions: ["jad"] - }, - "text/vnd.trolltech.linguist": { - source: "iana", - charset: "UTF-8" - }, - "text/vnd.wap.si": { - source: "iana" - }, - "text/vnd.wap.sl": { - source: "iana" - }, - "text/vnd.wap.wml": { - source: "iana", - extensions: ["wml"] - }, - "text/vnd.wap.wmlscript": { - source: "iana", - extensions: ["wmls"] - }, - "text/vtt": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["vtt"] - }, - "text/x-asm": { - source: "apache", - extensions: ["s", "asm"] - }, - "text/x-c": { - source: "apache", - extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] - }, - "text/x-component": { - source: "nginx", - extensions: ["htc"] - }, - "text/x-fortran": { - source: "apache", - extensions: ["f", "for", "f77", "f90"] - }, - "text/x-gwt-rpc": { - compressible: true - }, - "text/x-handlebars-template": { - extensions: ["hbs"] - }, - "text/x-java-source": { - source: "apache", - extensions: ["java"] - }, - "text/x-jquery-tmpl": { - compressible: true - }, - "text/x-lua": { - extensions: ["lua"] - }, - "text/x-markdown": { - compressible: true, - extensions: ["mkd"] - }, - "text/x-nfo": { - source: "apache", - extensions: ["nfo"] - }, - "text/x-opml": { - source: "apache", - extensions: ["opml"] - }, - "text/x-org": { - compressible: true, - extensions: ["org"] - }, - "text/x-pascal": { - source: "apache", - extensions: ["p", "pas"] - }, - "text/x-processing": { - compressible: true, - extensions: ["pde"] - }, - "text/x-sass": { - extensions: ["sass"] - }, - "text/x-scss": { - extensions: ["scss"] - }, - "text/x-setext": { - source: "apache", - extensions: ["etx"] - }, - "text/x-sfv": { - source: "apache", - extensions: ["sfv"] - }, - "text/x-suse-ymp": { - compressible: true, - extensions: ["ymp"] - }, - "text/x-uuencode": { - source: "apache", - extensions: ["uu"] - }, - "text/x-vcalendar": { - source: "apache", - extensions: ["vcs"] - }, - "text/x-vcard": { - source: "apache", - extensions: ["vcf"] - }, - "text/xml": { - source: "iana", - compressible: true, - extensions: ["xml"] - }, - "text/xml-external-parsed-entity": { - source: "iana" - }, - "text/yaml": { - compressible: true, - extensions: ["yaml", "yml"] - }, - "video/1d-interleaved-parityfec": { - source: "iana" - }, - "video/3gpp": { - source: "iana", - extensions: ["3gp", "3gpp"] - }, - "video/3gpp-tt": { - source: "iana" - }, - "video/3gpp2": { - source: "iana", - extensions: ["3g2"] - }, - "video/av1": { - source: "iana" - }, - "video/bmpeg": { - source: "iana" - }, - "video/bt656": { - source: "iana" - }, - "video/celb": { - source: "iana" - }, - "video/dv": { - source: "iana" - }, - "video/encaprtp": { - source: "iana" - }, - "video/ffv1": { - source: "iana" - }, - "video/flexfec": { - source: "iana" - }, - "video/h261": { - source: "iana", - extensions: ["h261"] - }, - "video/h263": { - source: "iana", - extensions: ["h263"] - }, - "video/h263-1998": { - source: "iana" - }, - "video/h263-2000": { - source: "iana" - }, - "video/h264": { - source: "iana", - extensions: ["h264"] - }, - "video/h264-rcdo": { - source: "iana" - }, - "video/h264-svc": { - source: "iana" - }, - "video/h265": { - source: "iana" - }, - "video/iso.segment": { - source: "iana", - extensions: ["m4s"] - }, - "video/jpeg": { - source: "iana", - extensions: ["jpgv"] - }, - "video/jpeg2000": { - source: "iana" - }, - "video/jpm": { - source: "apache", - extensions: ["jpm", "jpgm"] - }, - "video/jxsv": { - source: "iana" - }, - "video/mj2": { - source: "iana", - extensions: ["mj2", "mjp2"] - }, - "video/mp1s": { - source: "iana" - }, - "video/mp2p": { - source: "iana" - }, - "video/mp2t": { - source: "iana", - extensions: ["ts"] - }, - "video/mp4": { - source: "iana", - compressible: false, - extensions: ["mp4", "mp4v", "mpg4"] - }, - "video/mp4v-es": { - source: "iana" - }, - "video/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] - }, - "video/mpeg4-generic": { - source: "iana" - }, - "video/mpv": { - source: "iana" - }, - "video/nv": { - source: "iana" - }, - "video/ogg": { - source: "iana", - compressible: false, - extensions: ["ogv"] - }, - "video/parityfec": { - source: "iana" - }, - "video/pointer": { - source: "iana" - }, - "video/quicktime": { - source: "iana", - compressible: false, - extensions: ["qt", "mov"] - }, - "video/raptorfec": { - source: "iana" - }, - "video/raw": { - source: "iana" - }, - "video/rtp-enc-aescm128": { - source: "iana" - }, - "video/rtploopback": { - source: "iana" - }, - "video/rtx": { - source: "iana" - }, - "video/scip": { - source: "iana" - }, - "video/smpte291": { - source: "iana" - }, - "video/smpte292m": { - source: "iana" - }, - "video/ulpfec": { - source: "iana" - }, - "video/vc1": { - source: "iana" - }, - "video/vc2": { - source: "iana" - }, - "video/vnd.cctv": { - source: "iana" - }, - "video/vnd.dece.hd": { - source: "iana", - extensions: ["uvh", "uvvh"] - }, - "video/vnd.dece.mobile": { - source: "iana", - extensions: ["uvm", "uvvm"] - }, - "video/vnd.dece.mp4": { - source: "iana" - }, - "video/vnd.dece.pd": { - source: "iana", - extensions: ["uvp", "uvvp"] - }, - "video/vnd.dece.sd": { - source: "iana", - extensions: ["uvs", "uvvs"] - }, - "video/vnd.dece.video": { - source: "iana", - extensions: ["uvv", "uvvv"] - }, - "video/vnd.directv.mpeg": { - source: "iana" - }, - "video/vnd.directv.mpeg-tts": { - source: "iana" - }, - "video/vnd.dlna.mpeg-tts": { - source: "iana" - }, - "video/vnd.dvb.file": { - source: "iana", - extensions: ["dvb"] - }, - "video/vnd.fvt": { - source: "iana", - extensions: ["fvt"] - }, - "video/vnd.hns.video": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - source: "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - source: "iana" - }, - "video/vnd.iptvforum.ttsavc": { - source: "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - source: "iana" - }, - "video/vnd.motorola.video": { - source: "iana" - }, - "video/vnd.motorola.videop": { - source: "iana" - }, - "video/vnd.mpegurl": { - source: "iana", - extensions: ["mxu", "m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - source: "iana", - extensions: ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - source: "iana" - }, - "video/vnd.nokia.mp4vr": { - source: "iana" - }, - "video/vnd.nokia.videovoip": { - source: "iana" - }, - "video/vnd.objectvideo": { - source: "iana" - }, - "video/vnd.radgamettools.bink": { - source: "iana" - }, - "video/vnd.radgamettools.smacker": { - source: "iana" - }, - "video/vnd.sealed.mpeg1": { - source: "iana" - }, - "video/vnd.sealed.mpeg4": { - source: "iana" - }, - "video/vnd.sealed.swf": { - source: "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - source: "iana" - }, - "video/vnd.uvvu.mp4": { - source: "iana", - extensions: ["uvu", "uvvu"] - }, - "video/vnd.vivo": { - source: "iana", - extensions: ["viv"] - }, - "video/vnd.youtube.yt": { - source: "iana" - }, - "video/vp8": { - source: "iana" - }, - "video/vp9": { - source: "iana" - }, - "video/webm": { - source: "apache", - compressible: false, - extensions: ["webm"] - }, - "video/x-f4v": { - source: "apache", - extensions: ["f4v"] - }, - "video/x-fli": { - source: "apache", - extensions: ["fli"] - }, - "video/x-flv": { - source: "apache", - compressible: false, - extensions: ["flv"] - }, - "video/x-m4v": { - source: "apache", - extensions: ["m4v"] - }, - "video/x-matroska": { - source: "apache", - compressible: false, - extensions: ["mkv", "mk3d", "mks"] - }, - "video/x-mng": { - source: "apache", - extensions: ["mng"] - }, - "video/x-ms-asf": { - source: "apache", - extensions: ["asf", "asx"] - }, - "video/x-ms-vob": { - source: "apache", - extensions: ["vob"] - }, - "video/x-ms-wm": { - source: "apache", - extensions: ["wm"] - }, - "video/x-ms-wmv": { - source: "apache", - compressible: false, - extensions: ["wmv"] - }, - "video/x-ms-wmx": { - source: "apache", - extensions: ["wmx"] - }, - "video/x-ms-wvx": { - source: "apache", - extensions: ["wvx"] - }, - "video/x-msvideo": { - source: "apache", - extensions: ["avi"] - }, - "video/x-sgi-movie": { - source: "apache", - extensions: ["movie"] - }, - "video/x-smv": { - source: "apache", - extensions: ["smv"] - }, - "x-conference/x-cooltalk": { - source: "apache", - extensions: ["ice"] - }, - "x-shader/x-fragment": { - compressible: true - }, - "x-shader/x-vertex": { - compressible: true - } - }; - } -}); - -// node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js -var require_mime_db = __commonJS({ - "node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports2, module2) { - module2.exports = require_db(); - } -}); - -// node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js -var require_mime_types = __commonJS({ - "node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports2) { - "use strict"; - var db = require_mime_db(); - var extname = require("path").extname; - var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; - var TEXT_TYPE_REGEXP = /^text\//i; - exports2.charset = charset; - exports2.charsets = { lookup: charset }; - exports2.contentType = contentType; - exports2.extension = extension; - exports2.extensions = /* @__PURE__ */ Object.create(null); - exports2.lookup = lookup; - exports2.types = /* @__PURE__ */ Object.create(null); - populateMaps(exports2.extensions, exports2.types); - function charset(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var mime = match && db[match[1].toLowerCase()]; - if (mime && mime.charset) { - return mime.charset; - } - if (match && TEXT_TYPE_REGEXP.test(match[1])) { - return "UTF-8"; - } - return false; - } - function contentType(str) { - if (!str || typeof str !== "string") { - return false; - } - var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str; - if (!mime) { - return false; - } - if (mime.indexOf("charset") === -1) { - var charset2 = exports2.charset(mime); - if (charset2) mime += "; charset=" + charset2.toLowerCase(); - } - return mime; - } - function extension(type) { - if (!type || typeof type !== "string") { - return false; - } - var match = EXTRACT_TYPE_REGEXP.exec(type); - var exts = match && exports2.extensions[match[1].toLowerCase()]; - if (!exts || !exts.length) { - return false; - } - return exts[0]; - } - function lookup(path2) { - if (!path2 || typeof path2 !== "string") { - return false; - } - var extension2 = extname("x." + path2).toLowerCase().substr(1); - if (!extension2) { - return false; - } - return exports2.types[extension2] || false; - } - function populateMaps(extensions, types) { - var preference = ["nginx", "apache", void 0, "iana"]; - Object.keys(db).forEach(function forEachMimeType(type) { - var mime = db[type]; - var exts = mime.extensions; - if (!exts || !exts.length) { - return; - } - extensions[type] = exts; - for (var i = 0; i < exts.length; i++) { - var extension2 = exts[i]; - if (types[extension2]) { - var from = preference.indexOf(db[types[extension2]].source); - var to = preference.indexOf(mime.source); - if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) { - continue; - } - } - types[extension2] = type; - } - }); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js -var require_defer = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/defer.js"(exports2, module2) { - module2.exports = defer; - function defer(fn) { - var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; - if (nextTick) { - nextTick(fn); - } else { - setTimeout(fn, 0); - } - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js -var require_async = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/async.js"(exports2, module2) { - var defer = require_defer(); - module2.exports = async; - function async(callback) { - var isAsync = false; - defer(function() { - isAsync = true; - }); - return function async_callback(err, result) { - if (isAsync) { - callback(err, result); - } else { - defer(function nextTick_callback() { - callback(err, result); - }); - } - }; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js -var require_abort = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/abort.js"(exports2, module2) { - module2.exports = abort; - function abort(state) { - Object.keys(state.jobs).forEach(clean.bind(state)); - state.jobs = {}; - } - function clean(key) { - if (typeof this.jobs[key] == "function") { - this.jobs[key](); - } - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js -var require_iterate = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/iterate.js"(exports2, module2) { - var async = require_async(); - var abort = require_abort(); - module2.exports = iterate; - function iterate(list, iterator, state, callback) { - var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { - if (!(key in state.jobs)) { - return; - } - delete state.jobs[key]; - if (error) { - abort(state); - } else { - state.results[key] = output; - } - callback(error, state.results); - }); - } - function runJob(iterator, key, item, callback) { - var aborter; - if (iterator.length == 2) { - aborter = iterator(item, async(callback)); - } else { - aborter = iterator(item, key, async(callback)); - } - return aborter; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js -var require_state = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/state.js"(exports2, module2) { - module2.exports = state; - function state(list, sortMethod) { - var isNamedList = !Array.isArray(list), initState = { - index: 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs: {}, - results: isNamedList ? {} : [], - size: isNamedList ? Object.keys(list).length : list.length - }; - if (sortMethod) { - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { - return sortMethod(list[a], list[b]); - }); - } - return initState; - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js -var require_terminator = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/lib/terminator.js"(exports2, module2) { - var abort = require_abort(); - var async = require_async(); - module2.exports = terminator; - function terminator(callback) { - if (!Object.keys(this.jobs).length) { - return; - } - this.index = this.size; - abort(this); - async(callback)(null, this.results); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js -var require_parallel = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = parallel; - function parallel(list, iterator, callback) { - var state = initState(list); - while (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, function(error, result) { - if (error) { - callback(error, result); - return; - } - if (Object.keys(state.jobs).length === 0) { - callback(null, state.results); - return; - } - }); - state.index++; - } - return terminator.bind(state, callback); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js -var require_serialOrdered = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serialOrdered.js"(exports2, module2) { - var iterate = require_iterate(); - var initState = require_state(); - var terminator = require_terminator(); - module2.exports = serialOrdered; - module2.exports.ascending = ascending; - module2.exports.descending = descending; - function serialOrdered(list, iterator, sortMethod, callback) { - var state = initState(list, sortMethod); - iterate(list, iterator, state, function iteratorHandler(error, result) { - if (error) { - callback(error, result); - return; - } - state.index++; - if (state.index < (state["keyedList"] || list).length) { - iterate(list, iterator, state, iteratorHandler); - return; - } - callback(null, state.results); - }); - return terminator.bind(state, callback); - } - function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : 0; - } - function descending(a, b) { - return -1 * ascending(a, b); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js -var require_serial = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/serial.js"(exports2, module2) { - var serialOrdered = require_serialOrdered(); - module2.exports = serial; - function serial(list, iterator, callback) { - return serialOrdered(list, iterator, null, callback); - } - } -}); - -// node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js -var require_asynckit = __commonJS({ - "node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js"(exports2, module2) { - module2.exports = { - parallel: require_parallel(), - serial: require_serial(), - serialOrdered: require_serialOrdered() - }; - } -}); - -// node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js -var require_es_object_atoms = __commonJS({ - "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(exports2, module2) { - "use strict"; - module2.exports = Object; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js -var require_es_errors = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(exports2, module2) { - "use strict"; - module2.exports = Error; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js -var require_eval = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(exports2, module2) { - "use strict"; - module2.exports = EvalError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js -var require_range = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(exports2, module2) { - "use strict"; - module2.exports = RangeError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js -var require_ref = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(exports2, module2) { - "use strict"; - module2.exports = ReferenceError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js -var require_syntax = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(exports2, module2) { - "use strict"; - module2.exports = SyntaxError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js -var require_type = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(exports2, module2) { - "use strict"; - module2.exports = TypeError; - } -}); - -// node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js -var require_uri = __commonJS({ - "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(exports2, module2) { - "use strict"; - module2.exports = URIError; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js -var require_abs = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(exports2, module2) { - "use strict"; - module2.exports = Math.abs; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js -var require_floor = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(exports2, module2) { - "use strict"; - module2.exports = Math.floor; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js -var require_max = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(exports2, module2) { - "use strict"; - module2.exports = Math.max; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js -var require_min = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(exports2, module2) { - "use strict"; - module2.exports = Math.min; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js -var require_pow = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(exports2, module2) { - "use strict"; - module2.exports = Math.pow; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js -var require_round = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(exports2, module2) { - "use strict"; - module2.exports = Math.round; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js -var require_isNaN = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(exports2, module2) { - "use strict"; - module2.exports = Number.isNaN || function isNaN2(a) { - return a !== a; - }; - } -}); - -// node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js -var require_sign = __commonJS({ - "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(exports2, module2) { - "use strict"; - var $isNaN = require_isNaN(); - module2.exports = function sign(number) { - if ($isNaN(number) || number === 0) { - return number; - } - return number < 0 ? -1 : 1; - }; - } -}); - -// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js -var require_gOPD = __commonJS({ - "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(exports2, module2) { - "use strict"; - module2.exports = Object.getOwnPropertyDescriptor; - } -}); - -// node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js -var require_gopd = __commonJS({ - "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(exports2, module2) { - "use strict"; - var $gOPD = require_gOPD(); - if ($gOPD) { - try { - $gOPD([], "length"); - } catch (e) { - $gOPD = null; - } - } - module2.exports = $gOPD; - } -}); - -// node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js -var require_es_define_property = __commonJS({ - "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(exports2, module2) { - "use strict"; - var $defineProperty = Object.defineProperty || false; - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = false; - } - } - module2.exports = $defineProperty; - } -}); - -// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js -var require_shams = __commonJS({ - "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(exports2, module2) { - "use strict"; - module2.exports = function hasSymbols() { - if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { - return false; - } - if (typeof Symbol.iterator === "symbol") { - return true; - } - var obj = {}; - var sym = Symbol("test"); - var symObj = Object(sym); - if (typeof sym === "string") { - return false; - } - if (Object.prototype.toString.call(sym) !== "[object Symbol]") { - return false; - } - if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { - return false; - } - var symVal = 42; - obj[sym] = symVal; - for (var _ in obj) { - return false; - } - if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { - return false; - } - if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { - return false; - } - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { - return false; - } - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { - return false; - } - if (typeof Object.getOwnPropertyDescriptor === "function") { - var descriptor = ( - /** @type {PropertyDescriptor} */ - Object.getOwnPropertyDescriptor(obj, sym) - ); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { - return false; - } - } - return true; - }; - } -}); - -// node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js -var require_has_symbols = __commonJS({ - "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(exports2, module2) { - "use strict"; - var origSymbol = typeof Symbol !== "undefined" && Symbol; - var hasSymbolSham = require_shams(); - module2.exports = function hasNativeSymbols() { - if (typeof origSymbol !== "function") { - return false; - } - if (typeof Symbol !== "function") { - return false; - } - if (typeof origSymbol("foo") !== "symbol") { - return false; - } - if (typeof Symbol("bar") !== "symbol") { - return false; - } - return hasSymbolSham(); - }; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js -var require_Reflect_getPrototypeOf = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js -var require_Object_getPrototypeOf = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(exports2, module2) { - "use strict"; - var $Object = require_es_object_atoms(); - module2.exports = $Object.getPrototypeOf || null; - } -}); - -// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js -var require_implementation = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module2) { - "use strict"; - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var toStr = Object.prototype.toString; - var max = Math.max; - var funcType = "[object Function]"; - var concatty = function concatty2(a, b) { - var arr = []; - for (var i = 0; i < a.length; i += 1) { - arr[i] = a[i]; - } - for (var j = 0; j < b.length; j += 1) { - arr[j + a.length] = b[j]; - } - return arr; - }; - var slicy = function slicy2(arrLike, offset) { - var arr = []; - for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { - arr[j] = arrLike[i]; - } - return arr; - }; - var joiny = function(arr, joiner) { - var str = ""; - for (var i = 0; i < arr.length; i += 1) { - str += arr[i]; - if (i + 1 < arr.length) { - str += joiner; - } - } - return str; - }; - module2.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); - var bound; - var binder = function() { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) - ); - }; - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = "$" + i; - } - bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); - if (target.prototype) { - var Empty = function Empty2() { - }; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - } -}); - -// node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js -var require_function_bind = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module2) { - "use strict"; - var implementation = require_implementation(); - module2.exports = Function.prototype.bind || implementation; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js -var require_functionCall = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.call; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js -var require_functionApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(exports2, module2) { - "use strict"; - module2.exports = Function.prototype.apply; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js -var require_reflectApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(exports2, module2) { - "use strict"; - module2.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply; - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js -var require_actualApply = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(exports2, module2) { - "use strict"; - var bind = require_function_bind(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var $reflectApply = require_reflectApply(); - module2.exports = $reflectApply || bind.call($call, $apply); - } -}); - -// node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js -var require_call_bind_apply_helpers = __commonJS({ - "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(exports2, module2) { - "use strict"; - var bind = require_function_bind(); - var $TypeError = require_type(); - var $call = require_functionCall(); - var $actualApply = require_actualApply(); - module2.exports = function callBindBasic(args) { - if (args.length < 1 || typeof args[0] !== "function") { - throw new $TypeError("a function is required"); - } - return $actualApply(bind, $call, args); - }; - } -}); - -// node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js -var require_get = __commonJS({ - "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(exports2, module2) { - "use strict"; - var callBind = require_call_bind_apply_helpers(); - var gOPD = require_gopd(); - var hasProtoAccessor; - try { - hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ - [].__proto__ === Array.prototype; - } catch (e) { - if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") { - throw e; - } - } - var desc = !!hasProtoAccessor && gOPD && gOPD( - Object.prototype, - /** @type {keyof typeof Object.prototype} */ - "__proto__" - ); - var $Object = Object; - var $getPrototypeOf = $Object.getPrototypeOf; - module2.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? ( - /** @type {import('./get')} */ - function getDunder(value) { - return $getPrototypeOf(value == null ? value : $Object(value)); - } - ) : false; - } -}); - -// node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js -var require_get_proto = __commonJS({ - "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(exports2, module2) { - "use strict"; - var reflectGetProto = require_Reflect_getPrototypeOf(); - var originalGetProto = require_Object_getPrototypeOf(); - var getDunderProto = require_get(); - module2.exports = reflectGetProto ? function getProto(O) { - return reflectGetProto(O); - } : originalGetProto ? function getProto(O) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new TypeError("getProto: not an object"); - } - return originalGetProto(O); - } : getDunderProto ? function getProto(O) { - return getDunderProto(O); - } : null; - } -}); - -// node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js -var require_hasown = __commonJS({ - "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports2, module2) { - "use strict"; - var call = Function.prototype.call; - var $hasOwn = Object.prototype.hasOwnProperty; - var bind = require_function_bind(); - module2.exports = bind.call(call, $hasOwn); - } -}); - -// node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js -var require_get_intrinsic = __commonJS({ - "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(exports2, module2) { - "use strict"; - var undefined2; - var $Object = require_es_object_atoms(); - var $Error = require_es_errors(); - var $EvalError = require_eval(); - var $RangeError = require_range(); - var $ReferenceError = require_ref(); - var $SyntaxError = require_syntax(); - var $TypeError = require_type(); - var $URIError = require_uri(); - var abs = require_abs(); - var floor = require_floor(); - var max = require_max(); - var min = require_min(); - var pow = require_pow(); - var round = require_round(); - var sign = require_sign(); - var $Function = Function; - var getEvalledConstructor = function(expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) { - } - }; - var $gOPD = require_gopd(); - var $defineProperty = require_es_define_property(); - var throwTypeError = function() { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD ? function() { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }() : throwTypeError; - var hasSymbols = require_has_symbols()(); - var getProto = require_get_proto(); - var $ObjectGPO = require_Object_getPrototypeOf(); - var $ReflectGPO = require_Reflect_getPrototypeOf(); - var $apply = require_functionApply(); - var $call = require_functionCall(); - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - __proto__: null, - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": $Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": $EvalError, - "%Float16Array%": typeof Float16Array === "undefined" ? undefined2 : Float16Array, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": $Object, - "%Object.getOwnPropertyDescriptor%": $gOPD, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": $RangeError, - "%ReferenceError%": $ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": $URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet, - "%Function.prototype.call%": $call, - "%Function.prototype.apply%": $apply, - "%Object.defineProperty%": $defineProperty, - "%Object.getPrototypeOf%": $ObjectGPO, - "%Math.abs%": abs, - "%Math.floor%": floor, - "%Math.max%": max, - "%Math.min%": min, - "%Math.pow%": pow, - "%Math.round%": round, - "%Math.sign%": sign, - "%Reflect.getPrototypeOf%": $ReflectGPO - }; - if (getProto) { - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen && getProto) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - __proto__: null, - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"] - }; - var bind = require_function_bind(); - var hasOwn = require_hasown(); - var $concat = bind.call($call, Array.prototype.concat); - var $spliceApply = bind.call($apply, Array.prototype.splice); - var $replace = bind.call($call, String.prototype.replace); - var $strSlice = bind.call($call, String.prototype.slice); - var $exec = bind.call($call, RegExp.prototype.exec); - var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === "%" && last !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last === "%" && first !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function(match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module2.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void 0; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - } -}); - -// node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js -var require_shams2 = __commonJS({ - "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(exports2, module2) { - "use strict"; - var hasSymbols = require_shams(); - module2.exports = function hasToStringTagShams() { - return hasSymbols() && !!Symbol.toStringTag; - }; - } -}); - -// node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js -var require_es_set_tostringtag = __commonJS({ - "node_modules/.pnpm/es-set-tostringtag@2.1.0/node_modules/es-set-tostringtag/index.js"(exports2, module2) { - "use strict"; - var GetIntrinsic = require_get_intrinsic(); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); - var hasToStringTag = require_shams2()(); - var hasOwn = require_hasown(); - var $TypeError = require_type(); - var toStringTag = hasToStringTag ? Symbol.toStringTag : null; - module2.exports = function setToStringTag(object, value) { - var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; - var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; - if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") { - throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans"); - } - if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { - if ($defineProperty) { - $defineProperty(object, toStringTag, { - configurable: !nonConfigurable, - enumerable: false, - value, - writable: false - }); - } else { - object[toStringTag] = value; - } - } - }; - } -}); - -// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js -var require_populate = __commonJS({ - "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/populate.js"(exports2, module2) { - "use strict"; - module2.exports = function(dst, src) { - Object.keys(src).forEach(function(prop) { - dst[prop] = dst[prop] || src[prop]; - }); - return dst; - }; - } -}); - -// node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js -var require_form_data = __commonJS({ - "node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js"(exports2, module2) { - "use strict"; - var CombinedStream = require_combined_stream(); - var util = require("util"); - var path2 = require("path"); - var http = require("http"); - var https = require("https"); - var parseUrl = require("url").parse; - var fs2 = require("fs"); - var Stream = require("stream").Stream; - var crypto = require("crypto"); - var mime = require_mime_types(); - var asynckit = require_asynckit(); - var setToStringTag = require_es_set_tostringtag(); - var hasOwn = require_hasown(); - var populate = require_populate(); - function FormData2(options) { - if (!(this instanceof FormData2)) { - return new FormData2(options); - } - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; - CombinedStream.call(this); - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } - } - util.inherits(FormData2, CombinedStream); - FormData2.LINE_BREAK = "\r\n"; - FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; - FormData2.prototype.append = function(field, value, options) { - options = options || {}; - if (typeof options === "string") { - options = { filename: options }; - } - var append = CombinedStream.prototype.append.bind(this); - if (typeof value === "number" || value == null) { - value = String(value); - } - if (Array.isArray(value)) { - this._error(new Error("Arrays are not supported.")); - return; - } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); - append(header); - append(value); - append(footer); - this._trackLength(header, value, options); - }; - FormData2.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - if (options.knownLength != null) { - valueLength += Number(options.knownLength); - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === "string") { - valueLength = Buffer.byteLength(value); - } - this._valueLength += valueLength; - this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; - if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) { - return; - } - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } - }; - FormData2.prototype._lengthRetriever = function(value, callback) { - if (hasOwn(value, "fd")) { - if (value.end != void 0 && value.end != Infinity && value.start != void 0) { - callback(null, value.end + 1 - (value.start ? value.start : 0)); - } else { - fs2.stat(value.path, function(err, stat) { - if (err) { - callback(err); - return; - } - var fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); - } - } else if (hasOwn(value, "httpVersion")) { - callback(null, Number(value.headers["content-length"])); - } else if (hasOwn(value, "httpModule")) { - value.on("response", function(response) { - value.pause(); - callback(null, Number(response.headers["content-length"])); - }); - value.resume(); - } else { - callback("Unknown stream"); - } - }; - FormData2.prototype._multiPartHeader = function(field, value, options) { - if (typeof options.header === "string") { - return options.header; - } - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); - var contents = ""; - var headers = { - // add custom disposition as third element or keep it two elements if not - "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - "Content-Type": [].concat(contentType || []) - }; - if (typeof options.header === "object") { - populate(headers, options.header); - } - var header; - for (var prop in headers) { - if (hasOwn(headers, prop)) { - header = headers[prop]; - if (header == null) { - continue; - } - if (!Array.isArray(header)) { - header = [header]; - } - if (header.length) { - contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK; - } - } - } - return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; - }; - FormData2.prototype._getContentDisposition = function(value, options) { - var filename; - if (typeof options.filepath === "string") { - filename = path2.normalize(options.filepath).replace(/\\/g, "/"); - } else if (options.filename || value && (value.name || value.path)) { - filename = path2.basename(options.filename || value && (value.name || value.path)); - } else if (value && value.readable && hasOwn(value, "httpVersion")) { - filename = path2.basename(value.client._httpMessage.path || ""); - } - if (filename) { - return 'filename="' + filename + '"'; - } - }; - FormData2.prototype._getContentType = function(value, options) { - var contentType = options.contentType; - if (!contentType && value && value.name) { - contentType = mime.lookup(value.name); - } - if (!contentType && value && value.path) { - contentType = mime.lookup(value.path); - } - if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) { - contentType = value.headers["content-type"]; - } - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } - if (!contentType && value && typeof value === "object") { - contentType = FormData2.DEFAULT_CONTENT_TYPE; - } - return contentType; - }; - FormData2.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData2.LINE_BREAK; - var lastPart = this._streams.length === 0; - if (lastPart) { - footer += this._lastBoundary(); - } - next(footer); - }.bind(this); - }; - FormData2.prototype._lastBoundary = function() { - return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK; - }; - FormData2.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - "content-type": "multipart/form-data; boundary=" + this.getBoundary() - }; - for (header in userHeaders) { - if (hasOwn(userHeaders, header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - } - return formHeaders; - }; - FormData2.prototype.setBoundary = function(boundary) { - if (typeof boundary !== "string") { - throw new TypeError("FormData boundary must be a string"); - } - this._boundary = boundary; - }; - FormData2.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - return this._boundary; - }; - FormData2.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc(0); - var boundary = this.getBoundary(); - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== "function") { - if (Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); - } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); - } - if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]); - } - } - } - return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); - }; - FormData2.prototype._generateBoundary = function() { - this._boundary = "--------------------------" + crypto.randomBytes(12).toString("hex"); - }; - FormData2.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this.hasKnownLength()) { - this._error(new Error("Cannot calculate proper length in synchronous way.")); - } - return knownLength; - }; - FormData2.prototype.hasKnownLength = function() { - var hasKnownLength = true; - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } - return hasKnownLength; - }; - FormData2.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; - } - values.forEach(function(length) { - knownLength += length; - }); - cb(null, knownLength); - }); - }; - FormData2.prototype.submit = function(params, cb) { - var request; - var options; - var defaults = { method: "post" }; - if (typeof params === "string") { - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); - } else { - options = populate(params, defaults); - if (!options.port) { - options.port = options.protocol === "https:" ? 443 : 80; - } - } - options.headers = this.getHeaders(params.headers); - if (options.protocol === "https:") { - request = https.request(options); - } else { - request = http.request(options); - } - this.getLength(function(err, length) { - if (err && err !== "Unknown stream") { - this._error(err); - return; - } - if (length) { - request.setHeader("Content-Length", length); - } - this.pipe(request); - if (cb) { - var onResponse; - var callback = function(error, response) { - request.removeListener("error", callback); - request.removeListener("response", onResponse); - return cb.call(this, error, response); - }; - onResponse = callback.bind(this, null); - request.on("error", callback); - request.on("response", onResponse); - } - }.bind(this)); - return request; - }; - FormData2.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit("error", err); - } - }; - FormData2.prototype.toString = function() { - return "[object FormData]"; - }; - setToStringTag(FormData2, "FormData"); - module2.exports = FormData2; - } -}); - -// node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js -var require_proxy_from_env = __commonJS({ - "node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"(exports2) { - "use strict"; - var parseUrl = require("url").parse; - var DEFAULT_PORTS = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var stringEndsWith = String.prototype.endsWith || function(s) { - return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; - }; - function getProxyForUrl(url) { - var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { - return ""; - } - proto = proto.split(":", 1)[0]; - hostname = hostname.replace(/:\d*$/, ""); - port = parseInt(port) || DEFAULT_PORTS[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ""; - } - var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); - if (proxy && proxy.indexOf("://") === -1) { - proxy = proto + "://" + proxy; - } - return proxy; - } - function shouldProxy(hostname, port) { - var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); - if (!NO_PROXY) { - return true; - } - if (NO_PROXY === "*") { - return false; - } - return NO_PROXY.split(/[,\s]/).every(function(proxy) { - if (!proxy) { - return true; - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; - } - if (!/^[.*]/.test(parsedProxyHostname)) { - return hostname !== parsedProxyHostname; - } - if (parsedProxyHostname.charAt(0) === "*") { - parsedProxyHostname = parsedProxyHostname.slice(1); - } - return !stringEndsWith.call(hostname, parsedProxyHostname); - }); - } - function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; - } - exports2.getProxyForUrl = getProxyForUrl; - } -}); - -// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ - "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug; - module2.exports = function() { - if (!debug) { - try { - debug = require_src()("follow-redirects"); - } catch (error) { - } - if (typeof debug !== "function") { - debug = function() { - }; - } - } - debug.apply(null, arguments); - }; - } -}); - -// node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js"(exports2, module2) { - var url = require("url"); - var URL2 = url.URL; - var http = require("http"); - var https = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug = require_debug2(); - (function detectUnsupportedEnvironment() { - var looksLikeNode = typeof process !== "undefined"; - var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; - var looksLikeV8 = isFunction(Error.captureStackTrace); - if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { - console.warn("The follow-redirects package should be excluded from browser builds."); - } - })(); - var useNativeURL = false; - try { - assert(new URL2("")); - } catch (error) { - useNativeURL = error.code === "ERR_INVALID_URL"; - } - var preservedUrlFields = [ - "auth", - "host", - "hostname", - "href", - "path", - "pathname", - "port", - "protocol", - "query", - "search", - "hash" - ]; - var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; - var eventHandlers = /* @__PURE__ */ Object.create(null); - events.forEach(function(event) { - eventHandlers[event] = function(arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; - }); - var InvalidUrlError = createErrorType( - "ERR_INVALID_URL", - "Invalid URL", - TypeError - ); - var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" - ); - var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded", - RedirectionError - ); - var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" - ); - var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" - ); - var destroy = Writable.prototype.destroy || noop; - function RedirectableRequest(options, responseCallback) { - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; - if (responseCallback) { - this.on("response", responseCallback); - } - var self2 = this; - this._onNativeResponse = function(response) { - try { - self2._processResponse(response); - } catch (cause) { - self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); - } - }; - this._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); - }; - RedirectableRequest.prototype.destroy = function(error) { - destroyRequest(this._currentRequest, error); - destroy.call(this, error); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString(data) && !isBuffer(data)) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data, encoding }); - this._currentRequest.write(data, encoding, callback); - } else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } - }; - RedirectableRequest.prototype.end = function(data, encoding, callback) { - if (isFunction(data)) { - callback = data; - data = encoding = null; - } else if (isFunction(encoding)) { - callback = encoding; - encoding = null; - } - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } else { - var self2 = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function() { - self2._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } - }; - RedirectableRequest.prototype.setHeader = function(name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); - }; - RedirectableRequest.prototype.removeHeader = function(name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); - }; - RedirectableRequest.prototype.setTimeout = function(msecs, callback) { - var self2 = this; - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } - function startTimer(socket) { - if (self2._timeout) { - clearTimeout(self2._timeout); - } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; - } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); - } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); - } - } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); - } - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - this.on("close", clearTimer); - return this; - }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); - }; - }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - throw new TypeError("Unsupported protocol " + protocol); - } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } - var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : ( - // When making a request to a proxy, [โ€ฆ] - // a client MUST send the target URI in absolute-form [โ€ฆ]. - this._options.path - ); - if (this._isRedirect) { - var i = 0; - var self2 = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - if (request === self2._currentRequest) { - if (error) { - self2.emit("error", error); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request.end(); - } - } - })(); - } - }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode - }); - } - var location = response.headers.location; - if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); - this._requestBodyBuffers = []; - return; - } - destroyRequest(this._currentRequest); - response.destroy(); - if (++this._redirectCount > this._options.maxRedirects) { - throw new TooManyRedirectsError(); - } - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host") - }, this._options.headers); - } - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231ยง6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource [โ€ฆ] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) [โ€ฆ] - statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - var currentUrlParts = parseUrl(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl = resolveUrl(location, currentUrl); - debug("redirecting to", redirectUrl.href); - this._isRedirect = true; - spreadUrlObject(redirectUrl, this._options); - if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); - } - if (isFunction(beforeRedirect)) { - var responseDetails = { - headers: response.headers, - statusCode - }; - var requestDetails = { - url: currentUrl, - method, - headers: requestHeaders - }; - beforeRedirect(this._options, responseDetails, requestDetails); - this._sanitizeOptions(this._options); - } - this._performRequest(); - }; - function wrap(protocols) { - var exports3 = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024 - }; - var nativeProtocols = {}; - Object.keys(protocols).forEach(function(scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol); - function request(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString(input)) { - input = spreadUrlObject(parseUrl(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; - } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; - } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); - } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; - } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); - }); - return exports3; - } - function noop() { - } - function parseUrl(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); - } else { - parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; - } - function resolveUrl(relative, base) { - return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); - } - function validateUrl(input) { - if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { - throw new InvalidUrlError({ input: input.href || input }); - } - if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { - throw new InvalidUrlError({ input: input.href || input }); - } - return input; - } - function spreadUrlObject(urlObject, target) { - var spread = target || {}; - for (var key of preservedUrlFields) { - spread[key] = urlObject[key]; - } - if (spread.hostname.startsWith("[")) { - spread.hostname = spread.hostname.slice(1, -1); - } - if (spread.port !== "") { - spread.port = Number(spread.port); - } - spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; - return spread; - } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; - } - } - return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); - } - function createErrorType(code, message, baseClass) { - function CustomError(properties) { - if (isFunction(Error.captureStackTrace)) { - Error.captureStackTrace(this, this.constructor); - } - Object.assign(this, properties || {}); - this.code = code; - this.message = this.cause ? message + ": " + this.cause.message : message; - } - CustomError.prototype = new (baseClass || Error)(); - Object.defineProperties(CustomError.prototype, { - constructor: { - value: CustomError, - enumerable: false - }, - name: { - value: "Error [" + code + "]", - enumerable: false - } - }); - return CustomError; - } - function destroyRequest(request, error) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.destroy(error); - } - function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isString(value) { - return typeof value === "string" || value instanceof String; - } - function isFunction(value) { - return typeof value === "function"; - } - function isBuffer(value) { - return typeof value === "object" && "length" in value; - } - function isURL(value) { - return URL2 && value instanceof URL2; - } - module2.exports = wrap({ http, https }); - module2.exports.wrap = wrap; - } -}); - -// node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs -var require_axios = __commonJS({ - "node_modules/.pnpm/axios@1.13.1/node_modules/axios/dist/node/axios.cjs"(exports2, module2) { - "use strict"; - var FormData$1 = require_form_data(); - var crypto = require("crypto"); - var url = require("url"); - var http2 = require("http2"); - var proxyFromEnv = require_proxy_from_env(); - var http = require("http"); - var https = require("https"); - var util = require("util"); - var followRedirects = require_follow_redirects(); - var zlib = require("zlib"); - var stream = require("stream"); - var events = require("events"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1); - var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto); - var url__default = /* @__PURE__ */ _interopDefaultLegacy(url); - var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv); - var http__default = /* @__PURE__ */ _interopDefaultLegacy(http); - var https__default = /* @__PURE__ */ _interopDefaultLegacy(https); - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects); - var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib); - var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream); - function bind(fn, thisArg) { - return function wrap() { - return fn.apply(thisArg, arguments); - }; - } - var { toString } = Object.prototype; - var { getPrototypeOf } = Object; - var { iterator, toStringTag } = Symbol; - var kindOf = /* @__PURE__ */ ((cache) => (thing) => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); - })(/* @__PURE__ */ Object.create(null)); - var kindOfTest = (type) => { - type = type.toLowerCase(); - return (thing) => kindOf(thing) === type; - }; - var typeOfTest = (type) => (thing) => typeof thing === type; - var { isArray } = Array; - var isUndefined = typeOfTest("undefined"); - function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); - } - var isArrayBuffer = kindOfTest("ArrayBuffer"); - function isArrayBufferView(val) { - let result; - if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { - result = ArrayBuffer.isView(val); - } else { - result = val && val.buffer && isArrayBuffer(val.buffer); - } - return result; - } - var isString = typeOfTest("string"); - var isFunction$1 = typeOfTest("function"); - var isNumber = typeOfTest("number"); - var isObject = (thing) => thing !== null && typeof thing === "object"; - var isBoolean = (thing) => thing === true || thing === false; - var isPlainObject = (val) => { - if (kindOf(val) !== "object") { - return false; - } - const prototype2 = getPrototypeOf(val); - return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val); - }; - var isEmptyObject = (val) => { - if (!isObject(val) || isBuffer(val)) { - return false; - } - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - return false; - } - }; - var isDate = kindOfTest("Date"); - var isFile = kindOfTest("File"); - var isBlob = kindOfTest("Blob"); - var isFileList = kindOfTest("FileList"); - var isStream = (val) => isObject(val) && isFunction$1(val.pipe); - var isFormData = (thing) => { - let kind; - return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance - kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); - }; - var isURLSearchParams = kindOfTest("URLSearchParams"); - var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); - var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); - function forEach(obj, fn, { allOwnKeys = false } = {}) { - if (obj === null || typeof obj === "undefined") { - return; - } - let i; - let l; - if (typeof obj !== "object") { - obj = [obj]; - } - if (isArray(obj)) { - for (i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - if (isBuffer(obj)) { - return; - } - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - fn.call(null, obj[key], key, obj); - } - } - } - function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } - key = key.toLowerCase(); - const keys = Object.keys(obj); - let i = keys.length; - let _key; - while (i-- > 0) { - _key = keys[i]; - if (key === _key.toLowerCase()) { - return _key; - } - } - return null; - } - var _global = (() => { - if (typeof globalThis !== "undefined") return globalThis; - return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; - })(); - var isContextDefined = (context) => !isUndefined(context) && context !== _global; - function merge() { - const { caseless, skipUndefined } = isContextDefined(this) && this || {}; - const result = {}; - const assignValue = (val, key) => { - const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) { - result[targetKey] = merge(result[targetKey], val); - } else if (isPlainObject(val)) { - result[targetKey] = merge({}, val); - } else if (isArray(val)) { - result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined(val)) { - result[targetKey] = val; - } - }; - for (let i = 0, l = arguments.length; i < l; i++) { - arguments[i] && forEach(arguments[i], assignValue); - } - return result; - } - var extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach(b, (val, key) => { - if (thisArg && isFunction$1(val)) { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }, { allOwnKeys }); - return a; - }; - var stripBOM = (content) => { - if (content.charCodeAt(0) === 65279) { - content = content.slice(1); - } - return content; - }; - var inherits = (constructor, superConstructor, props, descriptors2) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors2); - constructor.prototype.constructor = constructor; - Object.defineProperty(constructor, "super", { - value: superConstructor.prototype - }); - props && Object.assign(constructor.prototype, props); - }; - var toFlatObject = (sourceObj, destObj, filter, propFilter) => { - let props; - let i; - let prop; - const merged = {}; - destObj = destObj || {}; - if (sourceObj == null) return destObj; - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } - } - sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; - }; - var endsWith = (str, searchString, position) => { - str = String(str); - if (position === void 0 || position > str.length) { - position = str.length; - } - position -= searchString.length; - const lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - var toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; - let i = thing.length; - if (!isNumber(i)) return null; - const arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; - } - return arr; - }; - var isTypedArray = /* @__PURE__ */ ((TypedArray) => { - return (thing) => { - return TypedArray && thing instanceof TypedArray; - }; - })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); - var forEachEntry = (obj, fn) => { - const generator = obj && obj[iterator]; - const _iterator = generator.call(obj); - let result; - while ((result = _iterator.next()) && !result.done) { - const pair = result.value; - fn.call(obj, pair[0], pair[1]); - } - }; - var matchAll = (regExp, str) => { - let matches; - const arr = []; - while ((matches = regExp.exec(str)) !== null) { - arr.push(matches); - } - return arr; - }; - var isHTMLForm = kindOfTest("HTMLFormElement"); - var toCamelCase = (str) => { - return str.toLowerCase().replace( - /[-_\s]([a-z\d])(\w*)/g, - function replacer(m, p1, p2) { - return p1.toUpperCase() + p2; - } - ); - }; - var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); - var isRegExp = kindOfTest("RegExp"); - var reduceDescriptors = (obj, reducer) => { - const descriptors2 = Object.getOwnPropertyDescriptors(obj); - const reducedDescriptors = {}; - forEach(descriptors2, (descriptor, name) => { - let ret; - if ((ret = reducer(descriptor, name, obj)) !== false) { - reducedDescriptors[name] = ret || descriptor; - } - }); - Object.defineProperties(obj, reducedDescriptors); - }; - var freezeMethods = (obj) => { - reduceDescriptors(obj, (descriptor, name) => { - if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { - return false; - } - const value = obj[name]; - if (!isFunction$1(value)) return; - descriptor.enumerable = false; - if ("writable" in descriptor) { - descriptor.writable = false; - return; - } - if (!descriptor.set) { - descriptor.set = () => { - throw Error("Can not rewrite read-only method '" + name + "'"); - }; - } - }); - }; - var toObjectSet = (arrayOrString, delimiter) => { - const obj = {}; - const define = (arr) => { - arr.forEach((value) => { - obj[value] = true; - }); - }; - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); - return obj; - }; - var noop = () => { - }; - var toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; - }; - function isSpecCompliantForm(thing) { - return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); - } - var toJSONObject = (obj) => { - const stack = new Array(10); - const visit = (source, i) => { - if (isObject(source)) { - if (stack.indexOf(source) >= 0) { - return; - } - if (isBuffer(source)) { - return source; - } - if (!("toJSON" in source)) { - stack[i] = source; - const target = isArray(source) ? [] : {}; - forEach(source, (value, key) => { - const reducedValue = visit(value, i + 1); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); - stack[i] = void 0; - return target; - } - } - return source; - }; - return visit(obj, 0); - }; - var isAsyncFn = kindOfTest("AsyncFunction"); - var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); - var _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener("message", ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, "*"); - }; - })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); - })( - typeof setImmediate === "function", - isFunction$1(_global.postMessage) - ); - var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; - var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); - var utils$1 = { - isArray, - isArrayBuffer, - isBuffer, - isFormData, - isArrayBufferView, - isString, - isNumber, - isBoolean, - isObject, - isPlainObject, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, - isUndefined, - isDate, - isFile, - isBlob, - isRegExp, - isFunction: isFunction$1, - isStream, - isURLSearchParams, - isTypedArray, - isFileList, - forEach, - merge, - extend, - trim, - stripBOM, - inherits, - toFlatObject, - kindOf, - kindOfTest, - endsWith, - toArray, - forEachEntry, - matchAll, - isHTMLForm, - hasOwnProperty, - hasOwnProp: hasOwnProperty, - // an alias to avoid ESLint no-prototype-builtins detection - reduceDescriptors, - freezeMethods, - toObjectSet, - toCamelCase, - noop, - toFiniteNumber, - findKey, - global: _global, - isContextDefined, - isSpecCompliantForm, - toJSONObject, - isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable - }; - function AxiosError(message, code, config, request, response) { - Error.call(this); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = new Error().stack; - } - this.message = message; - this.name = "AxiosError"; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status ? response.status : null; - } - } - utils$1.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: utils$1.toJSONObject(this.config), - code: this.code, - status: this.status - }; - } - }); - var prototype$1 = AxiosError.prototype; - var descriptors = {}; - [ - "ERR_BAD_OPTION_VALUE", - "ERR_BAD_OPTION", - "ECONNABORTED", - "ETIMEDOUT", - "ERR_NETWORK", - "ERR_FR_TOO_MANY_REDIRECTS", - "ERR_DEPRECATED", - "ERR_BAD_RESPONSE", - "ERR_BAD_REQUEST", - "ERR_CANCELED", - "ERR_NOT_SUPPORT", - "ERR_INVALID_URL" - // eslint-disable-next-line func-names - ].forEach((code) => { - descriptors[code] = { value: code }; - }); - Object.defineProperties(AxiosError, descriptors); - Object.defineProperty(prototype$1, "isAxiosError", { value: true }); - AxiosError.from = (error, code, config, request, response, customProps) => { - const axiosError = Object.create(prototype$1); - utils$1.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }, (prop) => { - return prop !== "isAxiosError"; - }); - const msg = error && error.message ? error.message : "Error"; - const errCode = code == null && error ? error.code : code; - AxiosError.call(axiosError, msg, errCode, config, request, response); - if (error && axiosError.cause == null) { - Object.defineProperty(axiosError, "cause", { value: error, configurable: true }); - } - axiosError.name = error && error.name || "Error"; - customProps && Object.assign(axiosError, customProps); - return axiosError; - }; - function isVisitable(thing) { - return utils$1.isPlainObject(thing) || utils$1.isArray(thing); - } - function removeBrackets(key) { - return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key; - } - function renderKey(path2, key, dots) { - if (!path2) return key; - return path2.concat(key).map(function each(token, i) { - token = removeBrackets(token); - return !dots && i ? "[" + token + "]" : token; - }).join(dots ? "." : ""); - } - function isFlatArray(arr) { - return utils$1.isArray(arr) && !arr.some(isVisitable); - } - var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); - }); - function toFormData(obj, formData, options) { - if (!utils$1.isObject(obj)) { - throw new TypeError("target must be an object"); - } - formData = formData || new (FormData__default["default"] || FormData)(); - options = utils$1.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - return !utils$1.isUndefined(source[option]); - }); - const metaTokens = options.metaTokens; - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; - const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); - if (!utils$1.isFunction(visitor)) { - throw new TypeError("visitor must be a function"); - } - function convertValue(value) { - if (value === null) return ""; - if (utils$1.isDate(value)) { - return value.toISOString(); - } - if (utils$1.isBoolean(value)) { - return value.toString(); - } - if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError("Blob is not supported. Use a Buffer instead."); - } - if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); - } - return value; - } - function defaultVisitor(value, key, path2) { - let arr = value; - if (value && !path2 && typeof value === "object") { - if (utils$1.endsWith(key, "{}")) { - key = metaTokens ? key : key.slice(0, -2); - value = JSON.stringify(value); - } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) { - key = removeBrackets(key); - arr.forEach(function each(el, index) { - !(utils$1.isUndefined(el) || el === null) && formData.append( - // eslint-disable-next-line no-nested-ternary - indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", - convertValue(el) - ); - }); - return false; - } - } - if (isVisitable(value)) { - return true; - } - formData.append(renderKey(path2, key, dots), convertValue(value)); - return false; - } - const stack = []; - const exposedHelpers = Object.assign(predicates, { - defaultVisitor, - convertValue, - isVisitable - }); - function build2(value, path2) { - if (utils$1.isUndefined(value)) return; - if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path2.join(".")); - } - stack.push(value); - utils$1.forEach(value, function each(el, key) { - const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( - formData, - el, - utils$1.isString(key) ? key.trim() : key, - path2, - exposedHelpers - ); - if (result === true) { - build2(el, path2 ? path2.concat(key) : [key]); - } - }); - stack.pop(); - } - if (!utils$1.isObject(obj)) { - throw new TypeError("data must be an object"); - } - build2(obj); - return formData; - } - function encode$1(str) { - const charMap = { - "!": "%21", - "'": "%27", - "(": "%28", - ")": "%29", - "~": "%7E", - "%20": "+", - "%00": "\0" - }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { - return charMap[match]; - }); - } - function AxiosURLSearchParams(params, options) { - this._pairs = []; - params && toFormData(params, this, options); - } - var prototype = AxiosURLSearchParams.prototype; - prototype.append = function append(name, value) { - this._pairs.push([name, value]); - }; - prototype.toString = function toString2(encoder) { - const _encode = encoder ? function(value) { - return encoder.call(this, value, encode$1); - } : encode$1; - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + "=" + _encode(pair[1]); - }, "").join("&"); - }; - function encode(val) { - return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); - } - function buildURL(url2, params, options) { - if (!params) { - return url2; - } - const _encode = options && options.encode || encode; - if (utils$1.isFunction(options)) { - options = { - serialize: options - }; - } - const serializeFn = options && options.serialize; - let serializedParams; - if (serializeFn) { - serializedParams = serializeFn(params, options); - } else { - serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode); - } - if (serializedParams) { - const hashmarkIndex = url2.indexOf("#"); - if (hashmarkIndex !== -1) { - url2 = url2.slice(0, hashmarkIndex); - } - url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams; - } - return url2; - } - var InterceptorManager = class { - constructor() { - this.handlers = []; - } - /** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ - use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled, - rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; - } - /** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - * - * @returns {void} - */ - eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } - } - /** - * Clear all interceptors from the stack - * - * @returns {void} - */ - clear() { - if (this.handlers) { - this.handlers = []; - } - } - /** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - * - * @returns {void} - */ - forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); - } - }; - var InterceptorManager$1 = InterceptorManager; - var transitionalDefaults = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }; - var URLSearchParams2 = url__default["default"].URLSearchParams; - var ALPHA = "abcdefghijklmnopqrstuvwxyz"; - var DIGIT = "0123456789"; - var ALPHABET = { - DIGIT, - ALPHA, - ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT - }; - var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { - let str = ""; - const { length } = alphabet; - const randomValues = new Uint32Array(size); - crypto__default["default"].randomFillSync(randomValues); - for (let i = 0; i < size; i++) { - str += alphabet[randomValues[i] % length]; - } - return str; - }; - var platform$1 = { - isNode: true, - classes: { - URLSearchParams: URLSearchParams2, - FormData: FormData__default["default"], - Blob: typeof Blob !== "undefined" && Blob || null - }, - ALPHABET, - generateString, - protocols: ["http", "https", "file", "data"] - }; - var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; - var _navigator = typeof navigator === "object" && navigator || void 0; - var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); - var hasStandardBrowserWebWorkerEnv = (() => { - return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; - })(); - var origin = hasBrowserEnv && window.location.href || "http://localhost"; - var utils = /* @__PURE__ */ Object.freeze({ - __proto__: null, - hasBrowserEnv, - hasStandardBrowserWebWorkerEnv, - hasStandardBrowserEnv, - navigator: _navigator, - origin - }); - var platform = { - ...utils, - ...platform$1 - }; - function toURLEncodedForm(data, options) { - return toFormData(data, new platform.classes.URLSearchParams(), { - visitor: function(value, key, path2, helpers) { - if (platform.isNode && utils$1.isBuffer(value)) { - this.append(key, value.toString("base64")); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - }, - ...options - }); - } - function parsePropPath(name) { - return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { - return match[0] === "[]" ? "" : match[1] || match[0]; - }); - } - function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; - } - function formDataToJSON(formData) { - function buildPath(path2, value, target, index) { - let name = path2[index++]; - if (name === "__proto__") return true; - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path2.length; - name = !name && utils$1.isArray(target) ? target.length : name; - if (isLast) { - if (utils$1.hasOwnProp(target, name)) { - target[name] = [target[name], value]; - } else { - target[name] = value; - } - return !isNumericKey; - } - if (!target[name] || !utils$1.isObject(target[name])) { - target[name] = []; - } - const result = buildPath(path2, value, target[name], index); - if (result && utils$1.isArray(target[name])) { - target[name] = arrayToObject(target[name]); - } - return !isNumericKey; - } - if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { - const obj = {}; - utils$1.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; - } - function stringifySafely(rawValue, parser, encoder) { - if (utils$1.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils$1.trim(rawValue); - } catch (e) { - if (e.name !== "SyntaxError") { - throw e; - } - } - } - return (encoder || JSON.stringify)(rawValue); - } - var defaults = { - transitional: transitionalDefaults, - adapter: ["xhr", "http", "fetch"], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ""; - const hasJSONContentType = contentType.indexOf("application/json") > -1; - const isObjectPayload = utils$1.isObject(data); - if (isObjectPayload && utils$1.isHTMLForm(data)) { - data = new FormData(data); - } - const isFormData2 = utils$1.isFormData(data); - if (isFormData2) { - return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - } - if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { - return data; - } - if (utils$1.isArrayBufferView(data)) { - return data.buffer; - } - if (utils$1.isURLSearchParams(data)) { - headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); - return data.toString(); - } - let isFileList2; - if (isObjectPayload) { - if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { - return toURLEncodedForm(data, this.formSerializer).toString(); - } - if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { - const _FormData = this.env && this.env.FormData; - return toFormData( - isFileList2 ? { "files[]": data } : data, - _FormData && new _FormData(), - this.formSerializer - ); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType("application/json", false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - const transitional = this.transitional || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const JSONRequested = this.responseType === "json"; - if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { - return data; - } - if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { - const silentJSONParsing = transitional && transitional.silentJSONParsing; - const strictJSONParsing = !silentJSONParsing && JSONRequested; - try { - return JSON.parse(data, this.parseReviver); - } catch (e) { - if (strictJSONParsing) { - if (e.name === "SyntaxError") { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; - } - } - } - return data; - }], - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - xsrfCookieName: "XSRF-TOKEN", - xsrfHeaderName: "X-XSRF-TOKEN", - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform.classes.FormData, - Blob: platform.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, - headers: { - common: { - "Accept": "application/json, text/plain, */*", - "Content-Type": void 0 - } - } - }; - utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { - defaults.headers[method] = {}; - }); - var defaults$1 = defaults; - var ignoreDuplicateOf = utils$1.toObjectSet([ - "age", - "authorization", - "content-length", - "content-type", - "etag", - "expires", - "from", - "host", - "if-modified-since", - "if-unmodified-since", - "last-modified", - "location", - "max-forwards", - "proxy-authorization", - "referer", - "retry-after", - "user-agent" - ]); - var parseHeaders = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i = line.indexOf(":"); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) { - return; - } - if (key === "set-cookie") { - if (parsed[key]) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; - } - }); - return parsed; - }; - var $internals = Symbol("internals"); - function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); - } - function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); - } - function parseTokens(str) { - const tokens = /* @__PURE__ */ Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; - } - var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils$1.isString(value)) return; - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } - } - function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); - } - function buildAccessors(obj, header) { - const accessorName = utils$1.toCamelCase(" " + header); - ["get", "set", "has"].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); - } - var AxiosHeaders = class { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self2 = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - throw new Error("header name must be a non-empty string"); - } - const key = utils$1.findKey(self2, lHeader); - if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { - self2[key || _header] = normalizeValue(_value); - } - } - const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { - let obj = {}, dest, key; - for (const entry of header) { - if (!utils$1.isArray(entry)) { - throw TypeError("Object iterator must return a key-value pair"); - } - obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; - } - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - if (key) { - const value = this[key]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - delete(header, matcher) { - const self2 = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key = utils$1.findKey(self2, _header); - if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { - delete self2[key]; - deleted = true; - } - } - } - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - return deleted; - } - normalize(format) { - const self2 = this; - const headers = {}; - utils$1.forEach(this, (value, header) => { - const key = utils$1.findKey(headers, header); - if (key) { - self2[key] = normalizeValue(value); - delete self2[header]; - return; - } - const normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self2[header]; - } - self2[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - toJSON(asStrings) { - const obj = /* @__PURE__ */ Object.create(null); - utils$1.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); - }); - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); - } - getSetCookie() { - return this.get("set-cookie") || []; - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach((target) => computed.set(target)); - return computed; - } - static accessor(header) { - const internals = this[$internals] = this[$internals] = { - accessors: {} - }; - const accessors = internals.accessors; - const prototype2 = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype2, _header); - accessors[lHeader] = true; - } - } - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } - }; - AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); - utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - }; - }); - utils$1.freezeMethods(AxiosHeaders); - var AxiosHeaders$1 = AxiosHeaders; - function transformData(fns, response) { - const config = this || defaults$1; - const context = response || config; - const headers = AxiosHeaders$1.from(context.headers); - let data = context.data; - utils$1.forEach(fns, function transform(fn) { - data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); - }); - headers.normalize(); - return data; - } - function isCancel(value) { - return !!(value && value.__CANCEL__); - } - function CanceledError(message, config, request) { - AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request); - this.name = "CanceledError"; - } - utils$1.inherits(CanceledError, AxiosError, { - __CANCEL__: true - }); - function settle(resolve2, reject, response) { - const validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve2(response); - } else { - reject(new AxiosError( - "Request failed with status code " + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } - } - function isAbsoluteURL(url2) { - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2); - } - function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; - } - function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; - } - var VERSION = "1.13.1"; - function parseProtocol(url2) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2); - return match && match[1] || ""; - } - var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; - function fromDataURI(uri, asBlob, options) { - const _Blob = options && options.Blob || platform.classes.Blob; - const protocol = parseProtocol(uri); - if (asBlob === void 0 && _Blob) { - asBlob = true; - } - if (protocol === "data") { - uri = protocol.length ? uri.slice(protocol.length + 1) : uri; - const match = DATA_URL_PATTERN.exec(uri); - if (!match) { - throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL); - } - const mime = match[1]; - const isBase64 = match[2]; - const body = match[3]; - const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8"); - if (asBlob) { - if (!_Blob) { - throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT); - } - return new _Blob([buffer], { type: mime }); - } - return buffer; - } - throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT); - } - var kInternals = Symbol("internals"); - var AxiosTransformStream = class extends stream__default["default"].Transform { - constructor(options) { - options = utils$1.toFlatObject(options, { - maxRate: 0, - chunkSize: 64 * 1024, - minChunkSize: 100, - timeWindow: 500, - ticksRate: 2, - samplesCount: 15 - }, null, (prop, source) => { - return !utils$1.isUndefined(source[prop]); - }); - super({ - readableHighWaterMark: options.chunkSize - }); - const internals = this[kInternals] = { - timeWindow: options.timeWindow, - chunkSize: options.chunkSize, - maxRate: options.maxRate, - minChunkSize: options.minChunkSize, - bytesSeen: 0, - isCaptured: false, - notifiedBytesLoaded: 0, - ts: Date.now(), - bytes: 0, - onReadCallback: null - }; - this.on("newListener", (event) => { - if (event === "progress") { - if (!internals.isCaptured) { - internals.isCaptured = true; - } - } - }); - } - _read(size) { - const internals = this[kInternals]; - if (internals.onReadCallback) { - internals.onReadCallback(); - } - return super._read(size); - } - _transform(chunk, encoding, callback) { - const internals = this[kInternals]; - const maxRate = internals.maxRate; - const readableHighWaterMark = this.readableHighWaterMark; - const timeWindow = internals.timeWindow; - const divider = 1e3 / timeWindow; - const bytesThreshold = maxRate / divider; - const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; - const pushChunk = (_chunk, _callback) => { - const bytes = Buffer.byteLength(_chunk); - internals.bytesSeen += bytes; - internals.bytes += bytes; - internals.isCaptured && this.emit("progress", internals.bytesSeen); - if (this.push(_chunk)) { - process.nextTick(_callback); - } else { - internals.onReadCallback = () => { - internals.onReadCallback = null; - process.nextTick(_callback); - }; - } - }; - const transformChunk = (_chunk, _callback) => { - const chunkSize = Buffer.byteLength(_chunk); - let chunkRemainder = null; - let maxChunkSize = readableHighWaterMark; - let bytesLeft; - let passed = 0; - if (maxRate) { - const now = Date.now(); - if (!internals.ts || (passed = now - internals.ts) >= timeWindow) { - internals.ts = now; - bytesLeft = bytesThreshold - internals.bytes; - internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; - passed = 0; - } - bytesLeft = bytesThreshold - internals.bytes; - } - if (maxRate) { - if (bytesLeft <= 0) { - return setTimeout(() => { - _callback(null, _chunk); - }, timeWindow - passed); - } - if (bytesLeft < maxChunkSize) { - maxChunkSize = bytesLeft; - } - } - if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) { - chunkRemainder = _chunk.subarray(maxChunkSize); - _chunk = _chunk.subarray(0, maxChunkSize); - } - pushChunk(_chunk, chunkRemainder ? () => { - process.nextTick(_callback, null, chunkRemainder); - } : _callback); - }; - transformChunk(chunk, function transformNextChunk(err, _chunk) { - if (err) { - return callback(err); - } - if (_chunk) { - transformChunk(_chunk, transformNextChunk); - } else { - callback(null); - } - }); - } - }; - var AxiosTransformStream$1 = AxiosTransformStream; - var { asyncIterator } = Symbol; - var readBlob = async function* (blob) { - if (blob.stream) { - yield* blob.stream(); - } else if (blob.arrayBuffer) { - yield await blob.arrayBuffer(); - } else if (blob[asyncIterator]) { - yield* blob[asyncIterator](); - } else { - yield blob; - } - }; - var readBlob$1 = readBlob; - var BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + "-_"; - var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder(); - var CRLF = "\r\n"; - var CRLF_BYTES = textEncoder.encode(CRLF); - var CRLF_BYTES_COUNT = 2; - var FormDataPart = class { - constructor(name, value) { - const { escapeName } = this.constructor; - const isStringValue = utils$1.isString(value); - let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`; - if (isStringValue) { - value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); - } else { - headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; - } - this.headers = textEncoder.encode(headers + CRLF); - this.contentLength = isStringValue ? value.byteLength : value.size; - this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; - this.name = name; - this.value = value; - } - async *encode() { - yield this.headers; - const { value } = this; - if (utils$1.isTypedArray(value)) { - yield value; - } else { - yield* readBlob$1(value); - } - yield CRLF_BYTES; - } - static escapeName(name) { - return String(name).replace(/[\r\n"]/g, (match) => ({ - "\r": "%0D", - "\n": "%0A", - '"': "%22" - })[match]); - } - }; - var formDataToStream = (form, headersHandler, options) => { - const { - tag = "form-data-boundary", - size = 25, - boundary = tag + "-" + platform.generateString(size, BOUNDARY_ALPHABET) - } = options || {}; - if (!utils$1.isFormData(form)) { - throw TypeError("FormData instance required"); - } - if (boundary.length < 1 || boundary.length > 70) { - throw Error("boundary must be 10-70 characters long"); - } - const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); - const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF); - let contentLength = footerBytes.byteLength; - const parts = Array.from(form.entries()).map(([name, value]) => { - const part = new FormDataPart(name, value); - contentLength += part.size; - return part; - }); - contentLength += boundaryBytes.byteLength * parts.length; - contentLength = utils$1.toFiniteNumber(contentLength); - const computedHeaders = { - "Content-Type": `multipart/form-data; boundary=${boundary}` - }; - if (Number.isFinite(contentLength)) { - computedHeaders["Content-Length"] = contentLength; - } - headersHandler && headersHandler(computedHeaders); - return stream.Readable.from(async function* () { - for (const part of parts) { - yield boundaryBytes; - yield* part.encode(); - } - yield footerBytes; - }()); - }; - var formDataToStream$1 = formDataToStream; - var ZlibHeaderTransformStream = class extends stream__default["default"].Transform { - __transform(chunk, encoding, callback) { - this.push(chunk); - callback(); - } - _transform(chunk, encoding, callback) { - if (chunk.length !== 0) { - this._transform = this.__transform; - if (chunk[0] !== 120) { - const header = Buffer.alloc(2); - header[0] = 120; - header[1] = 156; - this.push(header, encoding); - } - } - this.__transform(chunk, encoding, callback); - } - }; - var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream; - var callbackify = (fn, reducer) => { - return utils$1.isAsyncFn(fn) ? function(...args) { - const cb = args.pop(); - fn.apply(this, args).then((value) => { - try { - reducer ? cb(null, ...reducer(value)) : cb(null, value); - } catch (err) { - cb(err); - } - }, cb); - } : fn; - }; - var callbackify$1 = callbackify; - function speedometer(samplesCount, min) { - samplesCount = samplesCount || 10; - const bytes = new Array(samplesCount); - const timestamps = new Array(samplesCount); - let head = 0; - let tail = 0; - let firstSampleTS; - min = min !== void 0 ? min : 1e3; - return function push(chunkLength) { - const now = Date.now(); - const startedAt = timestamps[tail]; - if (!firstSampleTS) { - firstSampleTS = now; - } - bytes[head] = chunkLength; - timestamps[head] = now; - let i = tail; - let bytesCount = 0; - while (i !== head) { - bytesCount += bytes[i++]; - i = i % samplesCount; - } - head = (head + 1) % samplesCount; - if (head === tail) { - tail = (tail + 1) % samplesCount; - } - if (now - firstSampleTS < min) { - return; - } - const passed = startedAt && now - startedAt; - return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; - }; - } - function throttle(fn, freq) { - let timestamp = 0; - let threshold = 1e3 / freq; - let lastArgs; - let timer; - const invoke = (args, now = Date.now()) => { - timestamp = now; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn(...args); - }; - const throttled = (...args) => { - const now = Date.now(); - const passed = now - timestamp; - if (passed >= threshold) { - invoke(args, now); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; - } - var progressEventReducer = (listener, isDownloadStream, freq = 3) => { - let bytesNotified = 0; - const _speedometer = speedometer(50, 250); - return throttle((e) => { - const loaded = e.loaded; - const total = e.lengthComputable ? e.total : void 0; - const progressBytes = loaded - bytesNotified; - const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; - const data = { - loaded, - total, - progress: total ? loaded / total : void 0, - bytes: progressBytes, - rate: rate ? rate : void 0, - estimated: rate && total && inRange ? (total - loaded) / rate : void 0, - event: e, - lengthComputable: total != null, - [isDownloadStream ? "download" : "upload"]: true - }; - listener(data); - }, freq); - }; - var progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - return [(loaded) => throttled[0]({ - lengthComputable, - total, - loaded - }), throttled[1]]; - }; - var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); - function estimateDataURLDecodedBytes(url2) { - if (!url2 || typeof url2 !== "string") return 0; - if (!url2.startsWith("data:")) return 0; - const comma = url2.indexOf(","); - if (comma < 0) return 0; - const meta = url2.slice(5, comma); - const body = url2.slice(comma + 1); - const isBase64 = /;base64/i.test(meta); - if (isBase64) { - let effectiveLen = body.length; - const len = body.length; - for (let i = 0; i < len; i++) { - if (body.charCodeAt(i) === 37 && i + 2 < len) { - const a = body.charCodeAt(i + 1); - const b = body.charCodeAt(i + 2); - const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102); - if (isHex) { - effectiveLen -= 2; - i += 2; - } - } - } - let pad = 0; - let idx = len - 1; - const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%' - body.charCodeAt(j - 1) === 51 && // '3' - (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); - if (idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - idx--; - } else if (tailIsPct3D(idx)) { - pad++; - idx -= 3; - } - } - if (pad === 1 && idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - } else if (tailIsPct3D(idx)) { - pad++; - } - } - const groups = Math.floor(effectiveLen / 4); - const bytes = groups * 3 - (pad || 0); - return bytes > 0 ? bytes : 0; - } - return Buffer.byteLength(body, "utf8"); - } - var zlibOptions = { - flush: zlib__default["default"].constants.Z_SYNC_FLUSH, - finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH - }; - var brotliOptions = { - flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH, - finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH - }; - var { - HTTP2_HEADER_SCHEME, - HTTP2_HEADER_METHOD, - HTTP2_HEADER_PATH, - HTTP2_HEADER_STATUS - } = http2.constants; - var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress); - var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"]; - var isHttps = /https:?/; - var supportedProtocols = platform.protocols.map((protocol) => { - return protocol + ":"; - }); - var flushOnFinish = (stream2, [throttled, flush]) => { - stream2.on("end", flush).on("error", flush); - return throttled; - }; - var Http2Sessions = class { - constructor() { - this.sessions = /* @__PURE__ */ Object.create(null); - } - getSession(authority, options) { - options = Object.assign({ - sessionTimeout: 1e3 - }, options); - let authoritySessions; - if (authoritySessions = this.sessions[authority]) { - let len = authoritySessions.length; - for (let i = 0; i < len; i++) { - const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) { - return sessionHandle; - } - } - } - const session = http2.connect(authority, options); - let removed; - const removeSession = () => { - if (removed) { - return; - } - removed = true; - let entries2 = authoritySessions, len = entries2.length, i = len; - while (i--) { - if (entries2[i][0] === session) { - entries2.splice(i, 1); - if (len === 1) { - delete this.sessions[authority]; - return; - } - } - } - }; - const originalRequestFn = session.request; - const { sessionTimeout } = options; - if (sessionTimeout != null) { - let timer; - let streamsCount = 0; - session.request = function() { - const stream2 = originalRequestFn.apply(this, arguments); - streamsCount++; - if (timer) { - clearTimeout(timer); - timer = null; - } - stream2.once("close", () => { - if (!--streamsCount) { - timer = setTimeout(() => { - timer = null; - removeSession(); - }, sessionTimeout); - } - }); - return stream2; - }; - } - session.once("close", removeSession); - let entries = this.sessions[authority], entry = [ - session, - options - ]; - entries ? this.sessions[authority].push(entry) : authoritySessions = this.sessions[authority] = [entry]; - return session; - } - }; - var http2Sessions = new Http2Sessions(); - function dispatchBeforeRedirect(options, responseDetails) { - if (options.beforeRedirects.proxy) { - options.beforeRedirects.proxy(options); - } - if (options.beforeRedirects.config) { - options.beforeRedirects.config(options, responseDetails); - } - } - function setProxy(options, configProxy, location) { - let proxy = configProxy; - if (!proxy && proxy !== false) { - const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location); - if (proxyUrl) { - proxy = new URL(proxyUrl); - } - } - if (proxy) { - if (proxy.username) { - proxy.auth = (proxy.username || "") + ":" + (proxy.password || ""); - } - if (proxy.auth) { - if (proxy.auth.username || proxy.auth.password) { - proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || ""); - } - const base64 = Buffer.from(proxy.auth, "utf8").toString("base64"); - options.headers["Proxy-Authorization"] = "Basic " + base64; - } - options.headers.host = options.hostname + (options.port ? ":" + options.port : ""); - const proxyHost = proxy.hostname || proxy.host; - options.hostname = proxyHost; - options.host = proxyHost; - options.port = proxy.port; - options.path = location; - if (proxy.protocol) { - options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`; - } - } - options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - setProxy(redirectOptions, configProxy, redirectOptions.href); - }; - } - var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process"; - var wrapAsync = (asyncExecutor) => { - return new Promise((resolve2, reject) => { - let onDone; - let isDone; - const done = (value, isRejected) => { - if (isDone) return; - isDone = true; - onDone && onDone(value, isRejected); - }; - const _resolve = (value) => { - done(value); - resolve2(value); - }; - const _reject = (reason) => { - done(reason, true); - reject(reason); - }; - asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject); - }); - }; - var resolveFamily = ({ address, family }) => { - if (!utils$1.isString(address)) { - throw TypeError("address must be a string"); - } - return { - address, - family: family || (address.indexOf(".") < 0 ? 6 : 4) - }; - }; - var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family }); - var http2Transport = { - request(options, cb) { - const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80); - const { http2Options, headers } = options; - const session = http2Sessions.getSession(authority, http2Options); - const http2Headers = { - [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""), - [HTTP2_HEADER_METHOD]: options.method, - [HTTP2_HEADER_PATH]: options.path - }; - utils$1.forEach(headers, (header, name) => { - name.charAt(0) !== ":" && (http2Headers[name] = header); - }); - const req = session.request(http2Headers); - req.once("response", (responseHeaders) => { - const response = req; - responseHeaders = Object.assign({}, responseHeaders); - const status = responseHeaders[HTTP2_HEADER_STATUS]; - delete responseHeaders[HTTP2_HEADER_STATUS]; - response.headers = responseHeaders; - response.statusCode = +status; - cb(response); - }); - return req; - } - }; - var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) { - return wrapAsync(async function dispatchHttpRequest(resolve2, reject, onDone) { - let { data, lookup, family, httpVersion = 1, http2Options } = config; - const { responseType, responseEncoding } = config; - const method = config.method.toUpperCase(); - let isDone; - let rejected = false; - let req; - httpVersion = +httpVersion; - if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); - } - if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); - } - const isHttp2 = httpVersion === 2; - if (lookup) { - const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - }; - } - const abortEmitter = new events.EventEmitter(); - function abort(reason) { - try { - abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason); - } catch (err) { - console.warn("emit error", err); - } - } - abortEmitter.once("abort", reject); - const onFinished = () => { - if (config.cancelToken) { - config.cancelToken.unsubscribe(abort); - } - if (config.signal) { - config.signal.removeEventListener("abort", abort); - } - abortEmitter.removeAllListeners(); - }; - if (config.cancelToken || config.signal) { - config.cancelToken && config.cancelToken.subscribe(abort); - if (config.signal) { - config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort); - } - } - onDone((response, isRejected) => { - isDone = true; - if (isRejected) { - rejected = true; - onFinished(); - return; - } - const { data: data2 } = response; - if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) { - const offListeners = stream__default["default"].finished(data2, () => { - offListeners(); - onFinished(); - }); - } else { - onFinished(); - } - }); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0); - const protocol = parsed.protocol || supportedProtocols[0]; - if (protocol === "data:") { - if (config.maxContentLength > -1) { - const dataUrl = String(config.url || fullPath || ""); - const estimated = estimateDataURLDecodedBytes(dataUrl); - if (estimated > config.maxContentLength) { - return reject(new AxiosError( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError.ERR_BAD_RESPONSE, - config - )); - } - } - let convertedData; - if (method !== "GET") { - return settle(resolve2, reject, { - status: 405, - statusText: "method not allowed", - headers: {}, - config - }); - } - try { - convertedData = fromDataURI(config.url, responseType === "blob", { - Blob: config.env && config.env.Blob - }); - } catch (err) { - throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); - } - if (responseType === "text") { - convertedData = convertedData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - convertedData = utils$1.stripBOM(convertedData); - } - } else if (responseType === "stream") { - convertedData = stream__default["default"].Readable.from(convertedData); - } - return settle(resolve2, reject, { - data: convertedData, - status: 200, - statusText: "OK", - headers: new AxiosHeaders$1(), - config - }); - } - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError( - "Unsupported protocol " + protocol, - AxiosError.ERR_BAD_REQUEST, - config - )); - } - const headers = AxiosHeaders$1.from(config.headers).normalize(); - headers.set("User-Agent", "axios/" + VERSION, false); - const { onUploadProgress, onDownloadProgress } = config; - const maxRate = config.maxRate; - let maxUploadRate = void 0; - let maxDownloadRate = void 0; - if (utils$1.isSpecCompliantForm(data)) { - const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - data = formDataToStream$1(data, (formHeaders) => { - headers.set(formHeaders); - }, { - tag: `axios-${VERSION}-boundary`, - boundary: userBoundary && userBoundary[1] || void 0 - }); - } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) { - headers.set(data.getHeaders()); - if (!headers.hasContentLength()) { - try { - const knownLength = await util__default["default"].promisify(data.getLength).call(data); - Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); - } catch (e) { - } - } - } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { - data.size && headers.setContentType(data.type || "application/octet-stream"); - headers.setContentLength(data.size || 0); - data = stream__default["default"].Readable.from(readBlob$1(data)); - } else if (data && !utils$1.isStream(data)) { - if (Buffer.isBuffer(data)) ; - else if (utils$1.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils$1.isString(data)) { - data = Buffer.from(data, "utf-8"); - } else { - return reject(new AxiosError( - "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", - AxiosError.ERR_BAD_REQUEST, - config - )); - } - headers.setContentLength(data.length, false); - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError( - "Request body larger than maxBodyLength limit", - AxiosError.ERR_BAD_REQUEST, - config - )); - } - } - const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); - if (utils$1.isArray(maxRate)) { - maxUploadRate = maxRate[0]; - maxDownloadRate = maxRate[1]; - } else { - maxUploadRate = maxDownloadRate = maxRate; - } - if (data && (onUploadProgress || maxUploadRate)) { - if (!utils$1.isStream(data)) { - data = stream__default["default"].Readable.from(data, { objectMode: false }); - } - data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({ - maxRate: utils$1.toFiniteNumber(maxUploadRate) - })], utils$1.noop); - onUploadProgress && data.on("progress", flushOnFinish( - data, - progressEventDecorator( - contentLength, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) - ) - )); - } - let auth = void 0; - if (config.auth) { - const username = config.auth.username || ""; - const password = config.auth.password || ""; - auth = username + ":" + password; - } - if (!auth && parsed.username) { - const urlUsername = parsed.username; - const urlPassword = parsed.password; - auth = urlUsername + ":" + urlPassword; - } - auth && headers.delete("authorization"); - let path2; - try { - path2 = buildURL( - parsed.pathname + parsed.search, - config.params, - config.paramsSerializer - ).replace(/^\?/, ""); - } catch (err) { - const customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - return reject(customErr); - } - headers.set( - "Accept-Encoding", - "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), - false - ); - const options = { - path: path2, - method, - headers: headers.toJSON(), - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth, - protocol, - family, - beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: {}, - http2Options - }; - !utils$1.isUndefined(lookup) && (options.lookup = lookup); - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; - options.port = parsed.port; - setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path); - } - let transport; - const isHttpsRequest = isHttps.test(options.protocol); - options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - if (isHttp2) { - transport = http2Transport; - } else { - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsRequest ? https__default["default"] : http__default["default"]; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirects.config = config.beforeRedirect; - } - transport = isHttpsRequest ? httpsFollow : httpFollow; - } - } - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } else { - options.maxBodyLength = Infinity; - } - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } - req = transport.request(options, function handleResponse(res) { - if (req.destroyed) return; - const streams = [res]; - const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]); - if (onDownloadProgress || maxDownloadRate) { - const transformStream = new AxiosTransformStream$1({ - maxRate: utils$1.toFiniteNumber(maxDownloadRate) - }); - onDownloadProgress && transformStream.on("progress", flushOnFinish( - transformStream, - progressEventDecorator( - responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) - ) - )); - streams.push(transformStream); - } - let responseStream = res; - const lastRequest = res.req || req; - if (config.decompress !== false && res.headers["content-encoding"]) { - if (method === "HEAD" || res.statusCode === 204) { - delete res.headers["content-encoding"]; - } - switch ((res.headers["content-encoding"] || "").toLowerCase()) { - /*eslint default-case:0*/ - case "gzip": - case "x-gzip": - case "compress": - case "x-compress": - streams.push(zlib__default["default"].createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "deflate": - streams.push(new ZlibHeaderTransformStream$1()); - streams.push(zlib__default["default"].createUnzip(zlibOptions)); - delete res.headers["content-encoding"]; - break; - case "br": - if (isBrotliSupported) { - streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions)); - delete res.headers["content-encoding"]; - } - } - } - responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0]; - const response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: new AxiosHeaders$1(res.headers), - config, - request: lastRequest - }; - if (responseType === "stream") { - response.data = responseStream; - settle(resolve2, reject, response); - } else { - const responseBuffer = []; - let totalResponseBytes = 0; - responseStream.on("data", function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - rejected = true; - responseStream.destroy(); - abort(new AxiosError( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - )); - } - }); - responseStream.on("aborted", function handlerStreamAborted() { - if (rejected) { - return; - } - const err = new AxiosError( - "stream has been aborted", - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - ); - responseStream.destroy(err); - reject(err); - }); - responseStream.on("error", function handleStreamError(err) { - if (req.destroyed) return; - reject(AxiosError.from(err, null, config, lastRequest)); - }); - responseStream.on("end", function handleStreamEnd() { - try { - let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (responseType !== "arraybuffer") { - responseData = responseData.toString(responseEncoding); - if (!responseEncoding || responseEncoding === "utf8") { - responseData = utils$1.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - return reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve2, reject, response); - }); - } - abortEmitter.once("abort", (err) => { - if (!responseStream.destroyed) { - responseStream.emit("error", err); - responseStream.destroy(); - } - }); - }); - abortEmitter.once("abort", (err) => { - if (req.close) { - req.close(); - } else { - req.destroy(err); - } - }); - req.on("error", function handleRequestError(err) { - reject(AxiosError.from(err, null, config, req)); - }); - req.on("socket", function handleRequestSocket(socket) { - socket.setKeepAlive(true, 1e3 * 60); - }); - if (config.timeout) { - const timeout = parseInt(config.timeout, 10); - if (Number.isNaN(timeout)) { - abort(new AxiosError( - "error trying to parse `config.timeout` to int", - AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - )); - return; - } - req.setTimeout(timeout, function handleRequestTimeout() { - if (isDone) return; - let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - abort(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - req - )); - }); - } - if (utils$1.isStream(data)) { - let ended = false; - let errored = false; - data.on("end", () => { - ended = true; - }); - data.once("error", (err) => { - errored = true; - req.destroy(err); - }); - data.on("close", () => { - if (!ended && !errored) { - abort(new CanceledError("Request stream has been aborted", config, req)); - } - }); - data.pipe(req); - } else { - data && req.write(data); - req.end(); - } - }); - }; - var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => { - url2 = new URL(url2, platform.origin); - return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port); - })( - new URL(platform.origin), - platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) - ) : () => true; - var cookies = platform.hasStandardBrowserEnv ? ( - // Standard browser envs support document.cookie - { - write(name, value, expires, path2, domain, secure, sameSite) { - if (typeof document === "undefined") return; - const cookie = [`${name}=${encodeURIComponent(value)}`]; - if (utils$1.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils$1.isString(path2)) { - cookie.push(`path=${path2}`); - } - if (utils$1.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push("secure"); - } - if (utils$1.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - document.cookie = cookie.join("; "); - }, - read(name) { - if (typeof document === "undefined") return null; - const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); - return match ? decodeURIComponent(match[1]) : null; - }, - remove(name) { - this.write(name, "", Date.now() - 864e5, "/"); - } - } - ) : ( - // Non-standard browser env (web workers, react-native) lack needed support. - { - write() { - }, - read() { - return null; - }, - remove() { - } - } - ); - var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; - function mergeConfig(config1, config2) { - config2 = config2 || {}; - const config = {}; - function getMergedValue(target, source, prop, caseless) { - if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ caseless }, target, source); - } else if (utils$1.isPlainObject(source)) { - return utils$1.merge({}, source); - } else if (utils$1.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(void 0, a, prop, caseless); - } - } - function valueFromConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(void 0, b); - } - } - function defaultToConfig2(a, b) { - if (!utils$1.isUndefined(b)) { - return getMergedValue(void 0, b); - } else if (!utils$1.isUndefined(a)) { - return getMergedValue(void 0, a); - } - } - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(void 0, a); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) - }; - utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { - const merge2 = mergeMap[prop] || mergeDeepProperties; - const configValue = merge2(config1[prop], config2[prop], prop); - utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); - }); - return config; - } - var resolveConfig = (config) => { - const newConfig = mergeConfig({}, config); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; - newConfig.headers = headers = AxiosHeaders$1.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); - if (auth) { - headers.set( - "Authorization", - "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) - ); - } - if (utils$1.isFormData(data)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { - headers.setContentType(void 0); - } else if (utils$1.isFunction(data.getHeaders)) { - const formHeaders = data.getHeaders(); - const allowedHeaders = ["content-type", "content-length"]; - Object.entries(formHeaders).forEach(([key, val]) => { - if (allowedHeaders.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); - } - } - if (platform.hasStandardBrowserEnv) { - withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; - }; - var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; - var xhrAdapter = isXHRAdapterSupported && function(config) { - return new Promise(function dispatchXhrRequest(resolve2, reject) { - const _config = resolveConfig(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; - let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; - function done() { - flushUpload && flushUpload(); - flushDownload && flushDownload(); - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener("abort", onCanceled); - } - let request = new XMLHttpRequest(); - request.open(_config.method.toUpperCase(), _config.url, true); - request.timeout = _config.timeout; - function onloadend() { - if (!request) { - return; - } - const responseHeaders = AxiosHeaders$1.from( - "getAllResponseHeaders" in request && request.getAllResponseHeaders() - ); - const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; - const response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config, - request - }; - settle(function _resolve(value) { - resolve2(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); - request = null; - } - if ("onloadend" in request) { - request.onloadend = onloadend; - } else { - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { - return; - } - setTimeout(onloadend); - }; - } - request.onabort = function handleAbort() { - if (!request) { - return; - } - reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); - request = null; - }; - request.onerror = function handleError(event) { - const msg = event && event.message ? event.message : "Network Error"; - const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); - err.event = event || null; - reject(err); - request = null; - }; - request.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional = _config.transitional || transitionalDefaults; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; - } - reject(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - request - )); - request = null; - }; - requestData === void 0 && requestHeaders.setContentType(null); - if ("setRequestHeader" in request) { - utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { - request.setRequestHeader(key, val); - }); - } - if (!utils$1.isUndefined(_config.withCredentials)) { - request.withCredentials = !!_config.withCredentials; - } - if (responseType && responseType !== "json") { - request.responseType = _config.responseType; - } - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request.addEventListener("progress", downloadThrottled); - } - if (onUploadProgress && request.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - request.upload.addEventListener("progress", uploadThrottled); - request.upload.addEventListener("loadend", flushUpload); - } - if (_config.cancelToken || _config.signal) { - onCanceled = (cancel) => { - if (!request) { - return; - } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); - request.abort(); - request = null; - }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); - } - } - const protocol = parseProtocol(_config.url); - if (protocol && platform.protocols.indexOf(protocol) === -1) { - reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config)); - return; - } - request.send(requestData || null); - }); - }; - var composeSignals = (signals, timeout) => { - const { length } = signals = signals ? signals.filter(Boolean) : []; - if (timeout || length) { - let controller = new AbortController(); - let aborted; - const onabort = function(reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); - } - }; - let timer = timeout && setTimeout(() => { - timer = null; - onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (signals) { - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal2) => { - signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); - }); - signals = null; - } - }; - signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); - const { signal } = controller; - signal.unsubscribe = () => utils$1.asap(unsubscribe); - return signal; - } - }; - var composeSignals$1 = composeSignals; - var streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - if (!chunkSize || len < chunkSize) { - yield chunk; - return; - } - let pos = 0; - let end; - while (pos < len) { - end = pos + chunkSize; - yield chunk.slice(pos, end); - pos = end; - } - }; - var readBytes = async function* (iterable, chunkSize) { - for await (const chunk of readStream(iterable)) { - yield* streamChunk(chunk, chunkSize); - } - }; - var readStream = async function* (stream2) { - if (stream2[Symbol.asyncIterator]) { - yield* stream2; - return; - } - const reader = stream2.getReader(); - try { - for (; ; ) { - const { done, value } = await reader.read(); - if (done) { - break; - } - yield value; - } - } finally { - await reader.cancel(); - } - }; - var trackStream = (stream2, chunkSize, onProgress, onFinish) => { - const iterator2 = readBytes(stream2, chunkSize); - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - return new ReadableStream({ - async pull(controller) { - try { - const { done: done2, value } = await iterator2.next(); - if (done2) { - _onFinish(); - controller.close(); - return; - } - let len = value.byteLength; - if (onProgress) { - let loadedBytes = bytes += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }, - cancel(reason) { - _onFinish(reason); - return iterator2.return(); - } - }, { - highWaterMark: 2 - }); - }; - var DEFAULT_CHUNK_SIZE = 64 * 1024; - var { isFunction } = utils$1; - var globalFetchAPI = (({ Request, Response }) => ({ - Request, - Response - }))(utils$1.global); - var { - ReadableStream: ReadableStream$1, - TextEncoder: TextEncoder$1 - } = utils$1.global; - var test = (fn, ...args) => { - try { - return !!fn(...args); - } catch (e) { - return false; - } - }; - var factory = (env) => { - env = utils$1.merge.call({ - skipUndefined: true - }, globalFetchAPI, env); - const { fetch: envFetch, Request, Response } = env; - const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; - const isRequestSupported = isFunction(Request); - const isResponseSupported = isFunction(Response); - if (!isFetchSupported) { - return false; - } - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); - const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); - const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { - let duplexAccessed = false; - const hasContentType = new Request(platform.origin, { - body: new ReadableStream$1(), - method: "POST", - get duplex() { - duplexAccessed = true; - return "half"; - } - }).headers.has("Content-Type"); - return duplexAccessed && !hasContentType; - }); - const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body)); - const resolvers = { - stream: supportsResponseStream && ((res) => res.body) - }; - isFetchSupported && (() => { - ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { - !resolvers[type] && (resolvers[type] = (res, config) => { - let method = res && res[type]; - if (method) { - return method.call(res); - } - throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); - }); - }); - })(); - const getBodyLength = async (body) => { - if (body == null) { - return 0; - } - if (utils$1.isBlob(body)) { - return body.size; - } - if (utils$1.isSpecCompliantForm(body)) { - const _request = new Request(platform.origin, { - method: "POST", - body - }); - return (await _request.arrayBuffer()).byteLength; - } - if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { - return body.byteLength; - } - if (utils$1.isURLSearchParams(body)) { - body = body + ""; - } - if (utils$1.isString(body)) { - return (await encodeText(body)).byteLength; - } - }; - const resolveBodyLength = async (headers, body) => { - const length = utils$1.toFiniteNumber(headers.getContentLength()); - return length == null ? getBodyLength(body) : length; - }; - return async (config) => { - let { - url: url2, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = "same-origin", - fetchOptions - } = resolveConfig(config); - let _fetch = envFetch || fetch; - responseType = responseType ? (responseType + "").toLowerCase() : "text"; - let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); - let request = null; - const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { - composedSignal.unsubscribe(); - }); - let requestContentLength; - try { - if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { - let _request = new Request(url2, { - method: "POST", - body: data, - duplex: "half" - }); - let contentTypeHeader; - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - const [onProgress, flush] = progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - ); - data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); - } - } - if (!utils$1.isString(withCredentials)) { - withCredentials = withCredentials ? "include" : "omit"; - } - const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; - const resolvedOptions = { - ...fetchOptions, - signal: composedSignal, - method: method.toUpperCase(), - headers: headers.normalize().toJSON(), - body: data, - duplex: "half", - credentials: isCredentialsSupported ? withCredentials : void 0 - }; - request = isRequestSupported && new Request(url2, resolvedOptions); - let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions)); - const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { - const options = {}; - ["status", "statusText", "headers"].forEach((prop) => { - options[prop] = response[prop]; - }); - const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length")); - const [onProgress, flush] = onDownloadProgress && progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - ) || []; - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); - } - responseType = responseType || "text"; - let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config); - !isStreamResponse && unsubscribe && unsubscribe(); - return await new Promise((resolve2, reject) => { - settle(resolve2, reject, { - data: responseData, - headers: AxiosHeaders$1.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { - throw Object.assign( - new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request), - { - cause: err.cause || err - } - ); - } - throw AxiosError.from(err, err && err.code, config, request); - } - }; - }; - var seedCache = /* @__PURE__ */ new Map(); - var getFetch = (config) => { - let env = config && config.env || {}; - const { fetch: fetch2, Request, Response } = env; - const seeds = [ - Request, - Response, - fetch2 - ]; - let len = seeds.length, i = len, seed, target, map = seedCache; - while (i--) { - seed = seeds[i]; - target = map.get(seed); - target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); - map = target; - } - return target; - }; - getFetch(); - var knownAdapters = { - http: httpAdapter, - xhr: xhrAdapter, - fetch: { - get: getFetch - } - }; - utils$1.forEach(knownAdapters, (fn, value) => { - if (fn) { - try { - Object.defineProperty(fn, "name", { value }); - } catch (e) { - } - Object.defineProperty(fn, "adapterName", { value }); - } - }); - var renderReason = (reason) => `- ${reason}`; - var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; - function getAdapter(adapters2, config) { - adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2]; - const { length } = adapters2; - let nameOrAdapter; - let adapter; - const rejectedReasons = {}; - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters2[i]; - let id; - adapter = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - if (adapter === void 0) { - throw new AxiosError(`Unknown adapter '${id}'`); - } - } - if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { - break; - } - rejectedReasons[id || "#" + i] = adapter; - } - if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") - ); - let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; - throw new AxiosError( - `There is no suitable adapter to dispatch the request ` + s, - "ERR_NOT_SUPPORT" - ); - } - return adapter; - } - var adapters = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter, - /** - * Exposes all known adapters - * @type {Object} - */ - adapters: knownAdapters - }; - function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } - if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); - } - } - function dispatchRequest(config) { - throwIfCancellationRequested(config); - config.headers = AxiosHeaders$1.from(config.headers); - config.data = transformData.call( - config, - config.transformRequest - ); - if (["post", "put", "patch"].indexOf(config.method) !== -1) { - config.headers.setContentType("application/x-www-form-urlencoded", false); - } - const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - response.data = transformData.call( - config, - config.transformResponse, - response - ); - response.headers = AxiosHeaders$1.from(response.headers); - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - reason.response.headers = AxiosHeaders$1.from(reason.response.headers); - } - } - return Promise.reject(reason); - }); - } - var validators$1 = {}; - ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => { - validators$1[type] = function validator2(thing) { - return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; - }; - }); - var deprecatedWarnings = {}; - validators$1.transitional = function transitional(validator2, version, message) { - function formatMessage(opt, desc) { - return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); - } - return (value, opt, opts) => { - if (validator2 === false) { - throw new AxiosError( - formatMessage(opt, " has been removed" + (version ? " in " + version : "")), - AxiosError.ERR_DEPRECATED - ); - } - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - console.warn( - formatMessage( - opt, - " has been deprecated since v" + version + " and will be removed in the near future" - ) - ); - } - return validator2 ? validator2(value, opt, opts) : true; - }; - }; - validators$1.spelling = function spelling(correctSpelling) { - return (value, opt) => { - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; - }; - function assertOptions(options, schema, allowUnknown) { - if (typeof options !== "object") { - throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); - } - const keys = Object.keys(options); - let i = keys.length; - while (i-- > 0) { - const opt = keys[i]; - const validator2 = schema[opt]; - if (validator2) { - const value = options[opt]; - const result = value === void 0 || validator2(value, opt, options); - if (result !== true) { - throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; - } - if (allowUnknown !== true) { - throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); - } - } - } - var validator = { - assertOptions, - validators: validators$1 - }; - var validators = validator.validators; - var Axios = class { - constructor(instanceConfig) { - this.defaults = instanceConfig || {}; - this.interceptors = { - request: new InterceptorManager$1(), - response: new InterceptorManager$1() - }; - } - /** - * Dispatch a request - * - * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) - * @param {?Object} config - * - * @returns {Promise} The Promise to be fulfilled - */ - async request(configOrUrl, config) { - try { - return await this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; - try { - if (!err.stack) { - err.stack = stack; - } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { - err.stack += "\n" + stack; - } - } catch (e) { - } - } - throw err; - } - } - _request(configOrUrl, config) { - if (typeof configOrUrl === "string") { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; - } - config = mergeConfig(this.defaults, config); - const { transitional, paramsSerializer, headers } = config; - if (transitional !== void 0) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) - }, false); - } - if (paramsSerializer != null) { - if (utils$1.isFunction(paramsSerializer)) { - config.paramsSerializer = { - serialize: paramsSerializer - }; - } else { - validator.assertOptions(paramsSerializer, { - encode: validators.function, - serialize: validators.function - }, true); - } - } - if (config.allowAbsoluteUrls !== void 0) ; - else if (this.defaults.allowAbsoluteUrls !== void 0) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - validator.assertOptions(config, { - baseUrl: validators.spelling("baseURL"), - withXsrfToken: validators.spelling("withXSRFToken") - }, true); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); - let contextHeaders = headers && utils$1.merge( - headers.common, - headers[config.method] - ); - headers && utils$1.forEach( - ["delete", "get", "head", "post", "put", "patch", "common"], - (method) => { - delete headers[method]; - } - ); - config.headers = AxiosHeaders$1.concat(contextHeaders, headers); - const requestInterceptorChain = []; - let synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { - return; - } - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - const responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - let promise; - let i = 0; - let len; - if (!synchronousRequestInterceptors) { - const chain = [dispatchRequest.bind(this), void 0]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); - len = chain.length; - promise = Promise.resolve(config); - while (i < len) { - promise = promise.then(chain[i++], chain[i++]); - } - return promise; - } - len = requestInterceptorChain.length; - let newConfig = config; - while (i < len) { - const onFulfilled = requestInterceptorChain[i++]; - const onRejected = requestInterceptorChain[i++]; - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected.call(this, error); - break; - } - } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - return Promise.reject(error); - } - i = 0; - len = responseInterceptorChain.length; - while (i < len) { - promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); - } - return promise; - } - getUri(config) { - config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - return buildURL(fullPath, config.params, config.paramsSerializer); - } - }; - utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { - Axios.prototype[method] = function(url2, config) { - return this.request(mergeConfig(config || {}, { - method, - url: url2, - data: (config || {}).data - })); - }; - }); - utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { - function generateHTTPMethod(isForm) { - return function httpMethod(url2, data, config) { - return this.request(mergeConfig(config || {}, { - method, - headers: isForm ? { - "Content-Type": "multipart/form-data" - } : {}, - url: url2, - data - })); - }; - } - Axios.prototype[method] = generateHTTPMethod(); - Axios.prototype[method + "Form"] = generateHTTPMethod(true); - }); - var Axios$1 = Axios; - var CancelToken = class _CancelToken { - constructor(executor) { - if (typeof executor !== "function") { - throw new TypeError("executor must be a function."); - } - let resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve2) { - resolvePromise = resolve2; - }); - const token = this; - this.promise.then((cancel) => { - if (!token._listeners) return; - let i = token._listeners.length; - while (i-- > 0) { - token._listeners[i](cancel); - } - token._listeners = null; - }); - this.promise.then = (onfulfilled) => { - let _resolve; - const promise = new Promise((resolve2) => { - token.subscribe(resolve2); - _resolve = resolve2; - }).then(onfulfilled); - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; - return promise; - }; - executor(function cancel(message, config, request) { - if (token.reason) { - return; - } - token.reason = new CanceledError(message, config, request); - resolvePromise(token.reason); - }); - } - /** - * Throws a `CanceledError` if cancellation has been requested. - */ - throwIfRequested() { - if (this.reason) { - throw this.reason; - } - } - /** - * Subscribe to the cancel signal - */ - subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } - if (this._listeners) { - this._listeners.push(listener); - } else { - this._listeners = [listener]; - } - } - /** - * Unsubscribe from the cancel signal - */ - unsubscribe(listener) { - if (!this._listeners) { - return; - } - const index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); - } - } - toAbortSignal() { - const controller = new AbortController(); - const abort = (err) => { - controller.abort(err); - }; - this.subscribe(abort); - controller.signal.unsubscribe = () => this.unsubscribe(abort); - return controller.signal; - } - /** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ - static source() { - let cancel; - const token = new _CancelToken(function executor(c) { - cancel = c; - }); - return { - token, - cancel - }; - } - }; - var CancelToken$1 = CancelToken; - function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; - } - function isAxiosError(payload) { - return utils$1.isObject(payload) && payload.isAxiosError === true; - } - var HttpStatusCode = { - Continue: 100, - SwitchingProtocols: 101, - Processing: 102, - EarlyHints: 103, - Ok: 200, - Created: 201, - Accepted: 202, - NonAuthoritativeInformation: 203, - NoContent: 204, - ResetContent: 205, - PartialContent: 206, - MultiStatus: 207, - AlreadyReported: 208, - ImUsed: 226, - MultipleChoices: 300, - MovedPermanently: 301, - Found: 302, - SeeOther: 303, - NotModified: 304, - UseProxy: 305, - Unused: 306, - TemporaryRedirect: 307, - PermanentRedirect: 308, - BadRequest: 400, - Unauthorized: 401, - PaymentRequired: 402, - Forbidden: 403, - NotFound: 404, - MethodNotAllowed: 405, - NotAcceptable: 406, - ProxyAuthenticationRequired: 407, - RequestTimeout: 408, - Conflict: 409, - Gone: 410, - LengthRequired: 411, - PreconditionFailed: 412, - PayloadTooLarge: 413, - UriTooLong: 414, - UnsupportedMediaType: 415, - RangeNotSatisfiable: 416, - ExpectationFailed: 417, - ImATeapot: 418, - MisdirectedRequest: 421, - UnprocessableEntity: 422, - Locked: 423, - FailedDependency: 424, - TooEarly: 425, - UpgradeRequired: 426, - PreconditionRequired: 428, - TooManyRequests: 429, - RequestHeaderFieldsTooLarge: 431, - UnavailableForLegalReasons: 451, - InternalServerError: 500, - NotImplemented: 501, - BadGateway: 502, - ServiceUnavailable: 503, - GatewayTimeout: 504, - HttpVersionNotSupported: 505, - VariantAlsoNegotiates: 506, - InsufficientStorage: 507, - LoopDetected: 508, - NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526 - }; - Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; - }); - var HttpStatusCode$1 = HttpStatusCode; - function createInstance(defaultConfig) { - const context = new Axios$1(defaultConfig); - const instance = bind(Axios$1.prototype.request, context); - utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true }); - utils$1.extend(instance, context, null, { allOwnKeys: true }); - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; - return instance; - } - var axios = createInstance(defaults$1); - axios.Axios = Axios$1; - axios.CanceledError = CanceledError; - axios.CancelToken = CancelToken$1; - axios.isCancel = isCancel; - axios.VERSION = VERSION; - axios.toFormData = toFormData; - axios.AxiosError = AxiosError; - axios.Cancel = axios.CanceledError; - axios.all = function all(promises2) { - return Promise.all(promises2); - }; - axios.spread = spread; - axios.isAxiosError = isAxiosError; - axios.mergeConfig = mergeConfig; - axios.AxiosHeaders = AxiosHeaders$1; - axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); - axios.getAdapter = adapters.getAdapter; - axios.HttpStatusCode = HttpStatusCode$1; - axios.default = axios; - module2.exports = axios; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js -var require_base = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/base.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.operationServerMap = exports2.RequiredError = exports2.BaseAPI = exports2.COLLECTION_FORMATS = exports2.BASE_PATH = void 0; - var axios_1 = require_axios(); - exports2.BASE_PATH = "http://localhost".replace(/\/+$/, ""); - exports2.COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: " ", - pipes: "|" - }; - var BaseAPI = class { - constructor(configuration, basePath = exports2.BASE_PATH, axios = axios_1.default) { - var _a; - this.basePath = basePath; - this.axios = axios; - if (configuration) { - this.configuration = configuration; - this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath; - } - } - }; - exports2.BaseAPI = BaseAPI; - var RequiredError = class extends Error { - constructor(field, msg) { - super(msg); - this.field = field; - this.name = "RequiredError"; - } - }; - exports2.RequiredError = RequiredError; - exports2.operationServerMap = {}; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js -var require_common2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/common.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createRequestFunction = exports2.toPathString = exports2.serializeDataIfNeeded = exports2.setSearchParams = exports2.setOAuthToObject = exports2.setBearerAuthToObject = exports2.setBasicAuthToObject = exports2.setApiKeyToObject = exports2.assertParamExists = exports2.DUMMY_BASE_URL = void 0; - var base_1 = require_base(); - exports2.DUMMY_BASE_URL = "https://example.com"; - var assertParamExists = function(functionName, paramName, paramValue) { - if (paramValue === null || paramValue === void 0) { - throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } - }; - exports2.assertParamExists = assertParamExists; - var setApiKeyToObject = function(object, keyParamName, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === "function" ? yield configuration.apiKey(keyParamName) : yield configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } - }); - }; - exports2.setApiKeyToObject = setApiKeyToObject; - var setBasicAuthToObject = function(object, configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } - }; - exports2.setBasicAuthToObject = setBasicAuthToObject; - var setBearerAuthToObject = function(object, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === "function" ? yield configuration.accessToken() : yield configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } - }); - }; - exports2.setBearerAuthToObject = setBearerAuthToObject; - var setOAuthToObject = function(object, name, scopes, configuration) { - return __awaiter(this, void 0, void 0, function* () { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === "function" ? yield configuration.accessToken(name, scopes) : yield configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - }); - }; - exports2.setOAuthToObject = setOAuthToObject; - function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { - if (parameter == null) - return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key)); - } else { - Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)); - } - } else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } else { - urlSearchParams.set(key, parameter); - } - } - } - var setSearchParams = function(url, ...objects) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); - }; - exports2.setSearchParams = setSearchParams; - var serializeDataIfNeeded = function(value, requestOptions, configuration) { - const nonString = typeof value !== "string"; - const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString; - return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}) : value || ""; - }; - exports2.serializeDataIfNeeded = serializeDataIfNeeded; - var toPathString = function(url) { - return url.pathname + url.search + url.hash; - }; - exports2.toPathString = toPathString; - var createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) { - return (axios = globalAxios, basePath = BASE_PATH) => { - var _a; - const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? "" : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url }); - return axios.request(axiosRequestArgs); - }; - }; - exports2.createRequestFunction = createRequestFunction; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js -var require_health_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/health-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HealthApi = exports2.HealthApiFactory = exports2.HealthApiFp = exports2.HealthApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var HealthApiAxiosParamCreator = function(configuration) { - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/v1/health`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator; - var HealthApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.HealthApiAxiosParamCreator)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.health(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["HealthApi.health"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.HealthApiFp = HealthApiFp; - var HealthApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.HealthApiFp)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - health(options) { - return localVarFp.health(options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.HealthApiFactory = HealthApiFactory; - var HealthApi = class extends base_1.BaseAPI { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. - * @summary Health routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof HealthApi - */ - health(options) { - return (0, exports2.HealthApiFp)(this.configuration).health(options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.HealthApi = HealthApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js -var require_metrics_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/metrics-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MetricsApi = exports2.MetricsApiFactory = exports2.MetricsApiFp = exports2.MetricsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var MetricsApiAxiosParamCreator = function(configuration) { - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/metrics`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail: (metricName_1, ...args_1) => __awaiter(this, [metricName_1, ...args_1], void 0, function* (metricName, options = {}) { - (0, common_1.assertParamExists)("metricDetail", "metricName", metricName); - const localVarPath = `/metrics/{metric_name}`.replace(`{${"metric_name"}}`, encodeURIComponent(String(metricName))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { - const localVarPath = `/debug/metrics/scrape`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.MetricsApiAxiosParamCreator = MetricsApiAxiosParamCreator; - var MetricsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.MetricsApiAxiosParamCreator)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listMetrics(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.listMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail(metricName, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.metricDetail(metricName, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.metricDetail"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics(options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.scrapeMetrics(options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["MetricsApi.scrapeMetrics"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.MetricsApiFp = MetricsApiFp; - var MetricsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.MetricsApiFp)(configuration); - return { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listMetrics(options) { - return localVarFp.listMetrics(options).then((request) => request(axios, basePath)); - }, - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - metricDetail(metricName, options) { - return localVarFp.metricDetail(metricName, options).then((request) => request(axios, basePath)); - }, - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - scrapeMetrics(options) { - return localVarFp.scrapeMetrics(options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.MetricsApiFactory = MetricsApiFactory; - var MetricsApi = class extends base_1.BaseAPI { - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Returns a list of all available metric names in JSON format. # Returns An `HttpResponse` containing a JSON array of metric names. - * @summary Metrics routes implementation - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - listMetrics(options) { - return (0, exports2.MetricsApiFp)(this.configuration).listMetrics(options).then((request) => request(this.axios, this.basePath)); - } - /** - * # Parameters - `path`: The name of the metric to retrieve details for. # Returns An `HttpResponse` containing the metric details in plain text, or a 404 error if the metric is not found. - * @summary Returns the details of a specific metric in plain text format. - * @param {string} metricName Name of the metric to retrieve, e.g. utopia_transactions_total - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - metricDetail(metricName, options) { - return (0, exports2.MetricsApiFp)(this.configuration).metricDetail(metricName, options).then((request) => request(this.axios, this.basePath)); - } - /** - * # Returns An `HttpResponse` containing the updated metrics in plain text, or an error message if the update fails. - * @summary Triggers an update of system metrics and returns the result in plain text format. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof MetricsApi - */ - scrapeMetrics(options) { - return (0, exports2.MetricsApiFp)(this.configuration).scrapeMetrics(options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.MetricsApi = MetricsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js -var require_notifications_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/notifications-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.NotificationsApi = exports2.NotificationsApiFactory = exports2.NotificationsApiFp = exports2.NotificationsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var NotificationsApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification: (notificationCreateRequest_1, ...args_1) => __awaiter(this, [notificationCreateRequest_1, ...args_1], void 0, function* (notificationCreateRequest, options = {}) { - (0, common_1.assertParamExists)("createNotification", "notificationCreateRequest", notificationCreateRequest); - const localVarPath = `/api/v1/notifications`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationCreateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { - (0, common_1.assertParamExists)("deleteNotification", "notificationId", notificationId); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification: (notificationId_1, ...args_1) => __awaiter(this, [notificationId_1, ...args_1], void 0, function* (notificationId, options = {}) { - (0, common_1.assertParamExists)("getNotification", "notificationId", notificationId); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/notifications`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification: (notificationId_1, notificationUpdateRequest_1, ...args_1) => __awaiter(this, [notificationId_1, notificationUpdateRequest_1, ...args_1], void 0, function* (notificationId, notificationUpdateRequest, options = {}) { - (0, common_1.assertParamExists)("updateNotification", "notificationId", notificationId); - (0, common_1.assertParamExists)("updateNotification", "notificationUpdateRequest", notificationUpdateRequest); - const localVarPath = `/api/v1/notifications/{notification_id}`.replace(`{${"notification_id"}}`, encodeURIComponent(String(notificationId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(notificationUpdateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.NotificationsApiAxiosParamCreator = NotificationsApiAxiosParamCreator; - var NotificationsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.NotificationsApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification(notificationCreateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createNotification(notificationCreateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.createNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification(notificationId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteNotification(notificationId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.deleteNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification(notificationId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getNotification(notificationId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.getNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listNotifications(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.listNotifications"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateNotification(notificationId, notificationUpdateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["NotificationsApi.updateNotification"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.NotificationsApiFp = NotificationsApiFp; - var NotificationsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.NotificationsApiFp)(configuration); - return { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createNotification(notificationCreateRequest, options) { - return localVarFp.createNotification(notificationCreateRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteNotification(notificationId, options) { - return localVarFp.deleteNotification(notificationId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getNotification(notificationId, options) { - return localVarFp.getNotification(notificationId, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listNotifications(page, perPage, options) { - return localVarFp.listNotifications(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return localVarFp.updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.NotificationsApiFactory = NotificationsApiFactory; - var NotificationsApi = class extends base_1.BaseAPI { - /** - * - * @summary Creates a new notification. - * @param {NotificationCreateRequest} notificationCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - createNotification(notificationCreateRequest, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).createNotification(notificationCreateRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - deleteNotification(notificationId, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).deleteNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific notification by ID. - * @param {string} notificationId Notification ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - getNotification(notificationId, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).getNotification(notificationId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all notifications with pagination support. - * @summary Notification routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - listNotifications(page, perPage, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).listNotifications(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates an existing notification. - * @param {string} notificationId Notification ID - * @param {NotificationUpdateRequest} notificationUpdateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof NotificationsApi - */ - updateNotification(notificationId, notificationUpdateRequest, options) { - return (0, exports2.NotificationsApiFp)(this.configuration).updateNotification(notificationId, notificationUpdateRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.NotificationsApi = NotificationsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js -var require_plugins_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/plugins-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PluginsApi = exports2.PluginsApiFactory = exports2.PluginsApiFp = exports2.PluginsApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var PluginsApiAxiosParamCreator = function(configuration) { - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin: (pluginId_1, pluginCallRequest_1, ...args_1) => __awaiter(this, [pluginId_1, pluginCallRequest_1, ...args_1], void 0, function* (pluginId, pluginCallRequest, options = {}) { - (0, common_1.assertParamExists)("callPlugin", "pluginId", pluginId); - (0, common_1.assertParamExists)("callPlugin", "pluginCallRequest", pluginCallRequest); - const localVarPath = `/api/v1/plugins/{plugin_id}/call`.replace(`{${"plugin_id"}}`, encodeURIComponent(String(pluginId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(pluginCallRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.PluginsApiAxiosParamCreator = PluginsApiAxiosParamCreator; - var PluginsApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.PluginsApiAxiosParamCreator)(configuration); - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin(pluginId, pluginCallRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.callPlugin(pluginId, pluginCallRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["PluginsApi.callPlugin"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.PluginsApiFp = PluginsApiFp; - var PluginsApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.PluginsApiFp)(configuration); - return { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - callPlugin(pluginId, pluginCallRequest, options) { - return localVarFp.callPlugin(pluginId, pluginCallRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.PluginsApiFactory = PluginsApiFactory; - var PluginsApi = class extends base_1.BaseAPI { - /** - * Logs and traces are only returned when the plugin is configured with `emit_logs` / `emit_traces`. Plugin-provided errors are normalized into a consistent payload (`code`, `details`) and a derived message so downstream clients receive a stable shape regardless of how the handler threw. - * @summary Execute a plugin and receive the sanitized result - * @param {string} pluginId The unique identifier of the plugin - * @param {PluginCallRequest} pluginCallRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PluginsApi - */ - callPlugin(pluginId, pluginCallRequest, options) { - return (0, exports2.PluginsApiFp)(this.configuration).callPlugin(pluginId, pluginCallRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.PluginsApi = PluginsApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js -var require_relayers_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/relayers-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RelayersApi = exports2.RelayersApiFactory = exports2.RelayersApiFp = exports2.RelayersApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var RelayersApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { - (0, common_1.assertParamExists)("cancelTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("cancelTransaction", "transactionId", transactionId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer: (createRelayerRequest_1, ...args_1) => __awaiter(this, [createRelayerRequest_1, ...args_1], void 0, function* (createRelayerRequest, options = {}) { - (0, common_1.assertParamExists)("createRelayer", "createRelayerRequest", createRelayerRequest); - const localVarPath = `/api/v1/relayers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createRelayerRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("deletePendingTransactions", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/pending`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("deleteRelayer", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayer", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayerBalance", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/balance`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { - (0, common_1.assertParamExists)("getRelayerStatus", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/status`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { - (0, common_1.assertParamExists)("getTransactionById", "relayerId", relayerId); - (0, common_1.assertParamExists)("getTransactionById", "transactionId", transactionId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce: (relayerId_1, nonce_1, ...args_1) => __awaiter(this, [relayerId_1, nonce_1, ...args_1], void 0, function* (relayerId, nonce, options = {}) { - (0, common_1.assertParamExists)("getTransactionByNonce", "relayerId", relayerId); - (0, common_1.assertParamExists)("getTransactionByNonce", "nonce", nonce); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/by-nonce/{nonce}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"nonce"}}`, encodeURIComponent(String(nonce))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/relayers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions: (relayerId_1, page_1, perPage_1, ...args_1) => __awaiter(this, [relayerId_1, page_1, perPage_1, ...args_1], void 0, function* (relayerId, page, perPage, options = {}) { - (0, common_1.assertParamExists)("listTransactions", "relayerId", relayerId); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction: (relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, transactionId, networkTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("replaceTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("replaceTransaction", "transactionId", transactionId); - (0, common_1.assertParamExists)("replaceTransaction", "networkTransactionRequest", networkTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))).replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PUT" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc: (relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1) => __awaiter(this, [relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1], void 0, function* (relayerId, jsonRpcRequestNetworkRpcRequest, options = {}) { - (0, common_1.assertParamExists)("rpc", "relayerId", relayerId); - (0, common_1.assertParamExists)("rpc", "jsonRpcRequestNetworkRpcRequest", jsonRpcRequestNetworkRpcRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/rpc`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(jsonRpcRequestNetworkRpcRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction: (relayerId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, networkTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("sendTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("sendTransaction", "networkTransactionRequest", networkTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/transactions`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign: (relayerId_1, signDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signDataRequest_1, ...args_1], void 0, function* (relayerId, signDataRequest, options = {}) { - (0, common_1.assertParamExists)("sign", "relayerId", relayerId); - (0, common_1.assertParamExists)("sign", "signDataRequest", signDataRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signDataRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction: (relayerId_1, signTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTransactionRequest_1, ...args_1], void 0, function* (relayerId, signTransactionRequest, options = {}) { - (0, common_1.assertParamExists)("signTransaction", "relayerId", relayerId); - (0, common_1.assertParamExists)("signTransaction", "signTransactionRequest", signTransactionRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign-transaction`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTransactionRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData: (relayerId_1, signTypedDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTypedDataRequest_1, ...args_1], void 0, function* (relayerId, signTypedDataRequest, options = {}) { - (0, common_1.assertParamExists)("signTypedData", "relayerId", relayerId); - (0, common_1.assertParamExists)("signTypedData", "signTypedDataRequest", signTypedDataRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}/sign-typed-data`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTypedDataRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer: (relayerId_1, updateRelayerRequest_1, ...args_1) => __awaiter(this, [relayerId_1, updateRelayerRequest_1, ...args_1], void 0, function* (relayerId, updateRelayerRequest, options = {}) { - (0, common_1.assertParamExists)("updateRelayer", "relayerId", relayerId); - (0, common_1.assertParamExists)("updateRelayer", "updateRelayerRequest", updateRelayerRequest); - const localVarPath = `/api/v1/relayers/{relayer_id}`.replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateRelayerRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.RelayersApiAxiosParamCreator = RelayersApiAxiosParamCreator; - var RelayersApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.RelayersApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction(relayerId, transactionId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelTransaction(relayerId, transactionId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.cancelTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer(createRelayerRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createRelayer(createRelayerRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.createRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePendingTransactions(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deletePendingTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteRelayer(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.deleteRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayer(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerBalance(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerBalance"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus(relayerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerStatus(relayerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getRelayerStatus"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById(relayerId, transactionId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionById(relayerId, transactionId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionById"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce(relayerId, nonce, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getTransactionByNonce(relayerId, nonce, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.getTransactionByNonce"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listRelayers(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listRelayers"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions(relayerId, page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listTransactions(relayerId, page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.listTransactions"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.replaceTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.rpc"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.sendTransaction(relayerId, networkTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sendTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign(relayerId, signDataRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.sign(relayerId, signDataRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.sign"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction(relayerId, signTransactionRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.signTransaction(relayerId, signTransactionRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTransaction"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.signTypedData(relayerId, signTypedDataRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.signTypedData"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateRelayer(relayerId, updateRelayerRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["RelayersApi.updateRelayer"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.RelayersApiFp = RelayersApiFp; - var RelayersApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.RelayersApiFp)(configuration); - return { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - cancelTransaction(relayerId, transactionId, options) { - return localVarFp.cancelTransaction(relayerId, transactionId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createRelayer(createRelayerRequest, options) { - return localVarFp.createRelayer(createRelayerRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePendingTransactions(relayerId, options) { - return localVarFp.deletePendingTransactions(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteRelayer(relayerId, options) { - return localVarFp.deleteRelayer(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayer(relayerId, options) { - return localVarFp.getRelayer(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerBalance(relayerId, options) { - return localVarFp.getRelayerBalance(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRelayerStatus(relayerId, options) { - return localVarFp.getRelayerStatus(relayerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionById(relayerId, transactionId, options) { - return localVarFp.getTransactionById(relayerId, transactionId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByNonce(relayerId, nonce, options) { - return localVarFp.getTransactionByNonce(relayerId, nonce, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listRelayers(page, perPage, options) { - return localVarFp.listRelayers(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listTransactions(relayerId, page, perPage, options) { - return localVarFp.listTransactions(relayerId, page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return localVarFp.replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return localVarFp.rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return localVarFp.sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - sign(relayerId, signDataRequest, options) { - return localVarFp.sign(relayerId, signDataRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTransaction(relayerId, signTransactionRequest, options) { - return localVarFp.signTransaction(relayerId, signTransactionRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return localVarFp.signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return localVarFp.updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.RelayersApiFactory = RelayersApiFactory; - var RelayersApi = class extends base_1.BaseAPI { - /** - * - * @summary Cancels a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - cancelTransaction(relayerId, transactionId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).cancelTransaction(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Creates a new relayer. - * @param {CreateRelayerRequest} createRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - createRelayer(createRelayerRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).createRelayer(createRelayerRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes all pending transactions for a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - deletePendingTransactions(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).deletePendingTransactions(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - deleteRelayer(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).deleteRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific relayer by ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayer(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayer(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves the balance of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayerBalance(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayerBalance(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Fetches the current status of a specific relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getRelayerStatus(relayerId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getRelayerStatus(relayerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves a specific transaction by its ID. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getTransactionById(relayerId, transactionId, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getTransactionById(relayerId, transactionId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves a transaction by its nonce value. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} nonce The nonce of the transaction - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - getTransactionByNonce(relayerId, nonce, options) { - return (0, exports2.RelayersApiFp)(this.configuration).getTransactionByNonce(relayerId, nonce, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. - * @summary Relayer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - listRelayers(page, perPage, options) { - return (0, exports2.RelayersApiFp)(this.configuration).listRelayers(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Lists all transactions for a specific relayer with pagination. - * @param {string} relayerId The unique identifier of the relayer - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - listTransactions(relayerId, page, perPage, options) { - return (0, exports2.RelayersApiFp)(this.configuration).listTransactions(relayerId, page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Replaces a specific transaction with a new one. - * @param {string} relayerId The unique identifier of the relayer - * @param {string} transactionId The unique identifier of the transaction - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - replaceTransaction(relayerId, transactionId, networkTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).replaceTransaction(relayerId, transactionId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Performs a JSON-RPC call using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).rpc(relayerId, jsonRpcRequestNetworkRpcRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Sends a transaction through the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {NetworkTransactionRequest} networkTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - sendTransaction(relayerId, networkTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).sendTransaction(relayerId, networkTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignDataRequest} signDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - sign(relayerId, signDataRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).sign(relayerId, signDataRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs a transaction using the specified relayer (Stellar only). - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTransactionRequest} signTransactionRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - signTransaction(relayerId, signTransactionRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).signTransaction(relayerId, signTransactionRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Signs typed data using the specified relayer. - * @param {string} relayerId The unique identifier of the relayer - * @param {SignTypedDataRequest} signTypedDataRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - signTypedData(relayerId, signTypedDataRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).signTypedData(relayerId, signTypedDataRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates a relayer\'s information based on the provided update request. - * @param {string} relayerId The unique identifier of the relayer - * @param {UpdateRelayerRequest} updateRelayerRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof RelayersApi - */ - updateRelayer(relayerId, updateRelayerRequest, options) { - return (0, exports2.RelayersApiFp)(this.configuration).updateRelayer(relayerId, updateRelayerRequest, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.RelayersApi = RelayersApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js -var require_signers_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/apis/signers-api.js"(exports2) { - "use strict"; - var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignersApi = exports2.SignersApiFactory = exports2.SignersApiFp = exports2.SignersApiAxiosParamCreator = void 0; - var axios_1 = require_axios(); - var common_1 = require_common2(); - var base_1 = require_base(); - var SignersApiAxiosParamCreator = function(configuration) { - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner: (signerCreateRequest_1, ...args_1) => __awaiter(this, [signerCreateRequest_1, ...args_1], void 0, function* (signerCreateRequest, options = {}) { - (0, common_1.assertParamExists)("createSigner", "signerCreateRequest", signerCreateRequest); - const localVarPath = `/api/v1/signers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "POST" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signerCreateRequest, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { - (0, common_1.assertParamExists)("deleteSigner", "signerId", signerId); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "DELETE" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner: (signerId_1, ...args_1) => __awaiter(this, [signerId_1, ...args_1], void 0, function* (signerId, options = {}) { - (0, common_1.assertParamExists)("getSigner", "signerId", signerId); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { - const localVarPath = `/api/v1/signers`; - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - if (page !== void 0) { - localVarQueryParameter["page"] = page; - } - if (perPage !== void 0) { - localVarQueryParameter["per_page"] = perPage; - } - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }), - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner: (signerId_1, requestBody_1, ...args_1) => __awaiter(this, [signerId_1, requestBody_1, ...args_1], void 0, function* (signerId, requestBody, options = {}) { - (0, common_1.assertParamExists)("updateSigner", "signerId", signerId); - (0, common_1.assertParamExists)("updateSigner", "requestBody", requestBody); - const localVarPath = `/api/v1/signers/{signer_id}`.replace(`{${"signer_id"}}`, encodeURIComponent(String(signerId))); - const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions = Object.assign(Object.assign({ method: "PATCH" }, baseOptions), options); - const localVarHeaderParameter = {}; - const localVarQueryParameter = {}; - yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); - localVarHeaderParameter["Content-Type"] = "application/json"; - (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); - localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(requestBody, localVarRequestOptions, configuration); - return { - url: (0, common_1.toPathString)(localVarUrlObj), - options: localVarRequestOptions - }; - }) - }; - }; - exports2.SignersApiAxiosParamCreator = SignersApiAxiosParamCreator; - var SignersApiFp = function(configuration) { - const localVarAxiosParamCreator = (0, exports2.SignersApiAxiosParamCreator)(configuration); - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner(signerCreateRequest, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.createSigner(signerCreateRequest, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.createSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner(signerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteSigner(signerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.deleteSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner(signerId, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.getSigner(signerId, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.getSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners(page, perPage, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.listSigners(page, perPage, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.listSigners"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - }, - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner(signerId, requestBody, options) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b, _c; - const localVarAxiosArgs = yield localVarAxiosParamCreator.updateSigner(signerId, requestBody, options); - const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; - const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap["SignersApi.updateSigner"]) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; - return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }); - } - }; - }; - exports2.SignersApiFp = SignersApiFp; - var SignersApiFactory = function(configuration, basePath, axios) { - const localVarFp = (0, exports2.SignersApiFp)(configuration); - return { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createSigner(signerCreateRequest, options) { - return localVarFp.createSigner(signerCreateRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteSigner(signerId, options) { - return localVarFp.deleteSigner(signerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSigner(signerId, options) { - return localVarFp.getSigner(signerId, options).then((request) => request(axios, basePath)); - }, - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - listSigners(page, perPage, options) { - return localVarFp.listSigners(page, perPage, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateSigner(signerId, requestBody, options) { - return localVarFp.updateSigner(signerId, requestBody, options).then((request) => request(axios, basePath)); - } - }; - }; - exports2.SignersApiFactory = SignersApiFactory; - var SignersApi = class extends base_1.BaseAPI { - /** - * - * @summary Creates a new signer. - * @param {SignerCreateRequest} signerCreateRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - createSigner(signerCreateRequest, options) { - return (0, exports2.SignersApiFp)(this.configuration).createSigner(signerCreateRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Deletes a signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - deleteSigner(signerId, options) { - return (0, exports2.SignersApiFp)(this.configuration).deleteSigner(signerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Retrieves details of a specific signer by ID. - * @param {string} signerId Signer ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - getSigner(signerId, options) { - return (0, exports2.SignersApiFp)(this.configuration).getSigner(signerId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all signers with pagination support. - * @summary Signer routes implementation - * @param {number} [page] Page number for pagination (starts at 1) - * @param {number} [perPage] Number of items per page (default: 10) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - listSigners(page, perPage, options) { - return (0, exports2.SignersApiFp)(this.configuration).listSigners(page, perPage, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary Updates an existing signer. - * @param {string} signerId Signer ID - * @param {{ [key: string]: any; }} requestBody - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SignersApi - */ - updateSigner(signerId, requestBody, options) { - return (0, exports2.SignersApiFp)(this.configuration).updateSigner(signerId, requestBody, options).then((request) => request(this.axios, this.basePath)); - } - }; - exports2.SignersApi = SignersApi; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js -var require_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/api.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_health_api(), exports2); - __exportStar(require_metrics_api(), exports2); - __exportStar(require_notifications_api(), exports2); - __exportStar(require_plugins_api(), exports2); - __exportStar(require_relayers_api(), exports2); - __exportStar(require_signers_api(), exports2); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js -var require_configuration = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/configuration.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Configuration = void 0; - var Configuration = class { - constructor(param = {}) { - var _a; - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.serverIndex = param.serverIndex; - this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) }); - this.formDataCtor = param.formDataCtor; - } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - isJsonMime(mime) { - const jsonMime = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i"); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === "application/json-patch+json"); - } - }; - exports2.Configuration = Configuration; - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js -var require_api_response_balance_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js -var require_api_response_balance_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-balance-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js -var require_api_response_delete_pending_transactions_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js -var require_api_response_delete_pending_transactions_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-delete-pending-transactions-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js -var require_api_response_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js -var require_api_response_notification_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-notification-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js -var require_api_response_plugin_handler_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js -var require_api_response_plugin_handler_error_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-plugin-handler-error-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js -var require_api_response_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js -var require_api_response_relayer_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js -var require_api_response_relayer_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js -var require_api_response_relayer_status_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js -var require_api_response_relayer_status_data_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOfNetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOfNetworkTypeEnum2["EVM"] = "evm"; - })(ApiResponseRelayerStatusDataOneOfNetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = ApiResponseRelayerStatusDataOneOfNetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js -var require_api_response_relayer_status_data_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum2["STELLAR"] = "stellar"; - })(ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf1NetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js -var require_api_response_relayer_status_data_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-relayer-status-data-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = void 0; - var ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum; - (function(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2) { - ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum2["SOLANA"] = "solana"; - })(ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum || (exports2.ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = ApiResponseRelayerStatusDataOneOf2NetworkTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js -var require_api_response_sign_data_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js -var require_api_response_sign_data_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-data-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js -var require_api_response_sign_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js -var require_api_response_sign_transaction_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-sign-transaction-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js -var require_api_response_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js -var require_api_response_signer_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-signer-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js -var require_api_response_string = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-string.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js -var require_api_response_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js -var require_api_response_transaction_response_data = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-transaction-response-data.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js -var require_api_response_value = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-value.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js -var require_api_response_vec_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js -var require_api_response_vec_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js -var require_api_response_vec_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js -var require_api_response_vec_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/api-response-vec-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js -var require_asset_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js -var require_asset_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOfTypeEnum = void 0; - var AssetSpecOneOfTypeEnum; - (function(AssetSpecOneOfTypeEnum2) { - AssetSpecOneOfTypeEnum2["NATIVE"] = "native"; - })(AssetSpecOneOfTypeEnum || (exports2.AssetSpecOneOfTypeEnum = AssetSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js -var require_asset_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOf1TypeEnum = void 0; - var AssetSpecOneOf1TypeEnum; - (function(AssetSpecOneOf1TypeEnum2) { - AssetSpecOneOf1TypeEnum2["CREDIT4"] = "credit4"; - })(AssetSpecOneOf1TypeEnum || (exports2.AssetSpecOneOf1TypeEnum = AssetSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js -var require_asset_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/asset-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AssetSpecOneOf2TypeEnum = void 0; - var AssetSpecOneOf2TypeEnum; - (function(AssetSpecOneOf2TypeEnum2) { - AssetSpecOneOf2TypeEnum2["CREDIT12"] = "credit12"; - })(AssetSpecOneOf2TypeEnum || (exports2.AssetSpecOneOf2TypeEnum = AssetSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js -var require_auth_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js -var require_auth_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOfTypeEnum = void 0; - var AuthSpecOneOfTypeEnum; - (function(AuthSpecOneOfTypeEnum2) { - AuthSpecOneOfTypeEnum2["NONE"] = "none"; - })(AuthSpecOneOfTypeEnum || (exports2.AuthSpecOneOfTypeEnum = AuthSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js -var require_auth_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf1TypeEnum = void 0; - var AuthSpecOneOf1TypeEnum; - (function(AuthSpecOneOf1TypeEnum2) { - AuthSpecOneOf1TypeEnum2["SOURCE_ACCOUNT"] = "source_account"; - })(AuthSpecOneOf1TypeEnum || (exports2.AuthSpecOneOf1TypeEnum = AuthSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js -var require_auth_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf2TypeEnum = void 0; - var AuthSpecOneOf2TypeEnum; - (function(AuthSpecOneOf2TypeEnum2) { - AuthSpecOneOf2TypeEnum2["ADDRESSES"] = "addresses"; - })(AuthSpecOneOf2TypeEnum || (exports2.AuthSpecOneOf2TypeEnum = AuthSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js -var require_auth_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/auth-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AuthSpecOneOf3TypeEnum = void 0; - var AuthSpecOneOf3TypeEnum; - (function(AuthSpecOneOf3TypeEnum2) { - AuthSpecOneOf3TypeEnum2["XDR"] = "xdr"; - })(AuthSpecOneOf3TypeEnum || (exports2.AuthSpecOneOf3TypeEnum = AuthSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js -var require_aws_kms_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/aws-kms-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js -var require_balance_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/balance-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js -var require_cdp_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/cdp-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js -var require_contract_source = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js -var require_contract_source_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContractSourceOneOfFromEnum = void 0; - var ContractSourceOneOfFromEnum; - (function(ContractSourceOneOfFromEnum2) { - ContractSourceOneOfFromEnum2["ADDRESS"] = "address"; - })(ContractSourceOneOfFromEnum || (exports2.ContractSourceOneOfFromEnum = ContractSourceOneOfFromEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js -var require_contract_source_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/contract-source-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ContractSourceOneOf1FromEnum = void 0; - var ContractSourceOneOf1FromEnum; - (function(ContractSourceOneOf1FromEnum2) { - ContractSourceOneOf1FromEnum2["CONTRACT"] = "contract"; - })(ContractSourceOneOf1FromEnum || (exports2.ContractSourceOneOf1FromEnum = ContractSourceOneOf1FromEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js -var require_create_relayer_policy_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js -var require_create_relayer_policy_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js -var require_create_relayer_policy_request_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js -var require_create_relayer_policy_request_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-policy-request-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js -var require_create_relayer_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/create-relayer-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js -var require_delete_pending_transactions_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/delete-pending-transactions-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js -var require_disabled_reason = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js -var require_disabled_reason_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOfTypeEnum = void 0; - var DisabledReasonOneOfTypeEnum; - (function(DisabledReasonOneOfTypeEnum2) { - DisabledReasonOneOfTypeEnum2["NONCE_SYNC_FAILED"] = "NonceSyncFailed"; - })(DisabledReasonOneOfTypeEnum || (exports2.DisabledReasonOneOfTypeEnum = DisabledReasonOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js -var require_disabled_reason_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf1TypeEnum = void 0; - var DisabledReasonOneOf1TypeEnum; - (function(DisabledReasonOneOf1TypeEnum2) { - DisabledReasonOneOf1TypeEnum2["RPC_VALIDATION_FAILED"] = "RpcValidationFailed"; - })(DisabledReasonOneOf1TypeEnum || (exports2.DisabledReasonOneOf1TypeEnum = DisabledReasonOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js -var require_disabled_reason_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf2TypeEnum = void 0; - var DisabledReasonOneOf2TypeEnum; - (function(DisabledReasonOneOf2TypeEnum2) { - DisabledReasonOneOf2TypeEnum2["BALANCE_CHECK_FAILED"] = "BalanceCheckFailed"; - })(DisabledReasonOneOf2TypeEnum || (exports2.DisabledReasonOneOf2TypeEnum = DisabledReasonOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js -var require_disabled_reason_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf3TypeEnum = void 0; - var DisabledReasonOneOf3TypeEnum; - (function(DisabledReasonOneOf3TypeEnum2) { - DisabledReasonOneOf3TypeEnum2["SEQUENCE_SYNC_FAILED"] = "SequenceSyncFailed"; - })(DisabledReasonOneOf3TypeEnum || (exports2.DisabledReasonOneOf3TypeEnum = DisabledReasonOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js -var require_disabled_reason_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/disabled-reason-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DisabledReasonOneOf4TypeEnum = void 0; - var DisabledReasonOneOf4TypeEnum; - (function(DisabledReasonOneOf4TypeEnum2) { - DisabledReasonOneOf4TypeEnum2["MULTIPLE"] = "Multiple"; - })(DisabledReasonOneOf4TypeEnum || (exports2.DisabledReasonOneOf4TypeEnum = DisabledReasonOneOf4TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js -var require_evm_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js -var require_evm_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js -var require_evm_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js -var require_evm_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js -var require_evm_transaction_data_signature = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-data-signature.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js -var require_evm_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js -var require_evm_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/evm-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js -var require_fee_estimate_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js -var require_fee_estimate_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/fee-estimate-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js -var require_get_features_enabled_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-features-enabled-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js -var require_get_supported_tokens_item = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-item.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js -var require_get_supported_tokens_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/get-supported-tokens-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js -var require_google_cloud_kms_signer_key_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js -var require_google_cloud_kms_signer_key_response_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-key-response-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js -var require_google_cloud_kms_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js -var require_google_cloud_kms_signer_service_account_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js -var require_google_cloud_kms_signer_service_account_response_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/google-cloud-kms-signer-service-account-response-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js -var require_json_rpc_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js -var require_json_rpc_id = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-id.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js -var require_json_rpc_request_network_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-request-network-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js -var require_json_rpc_response_network_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js -var require_json_rpc_response_network_rpc_result_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/json-rpc-response-network-rpc-result-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js -var require_jupiter_swap_options = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/jupiter-swap-options.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js -var require_local_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/local-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js -var require_log_entry = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-entry.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js -var require_log_level = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/log-level.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.LogLevel = void 0; - var LogLevel; - (function(LogLevel2) { - LogLevel2["LOG"] = "log"; - LogLevel2["INFO"] = "info"; - LogLevel2["ERROR"] = "error"; - LogLevel2["WARN"] = "warn"; - LogLevel2["DEBUG"] = "debug"; - LogLevel2["RESULT"] = "result"; - })(LogLevel || (exports2.LogLevel = LogLevel = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js -var require_memo_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js -var require_memo_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOfTypeEnum = void 0; - var MemoSpecOneOfTypeEnum; - (function(MemoSpecOneOfTypeEnum2) { - MemoSpecOneOfTypeEnum2["NONE"] = "none"; - })(MemoSpecOneOfTypeEnum || (exports2.MemoSpecOneOfTypeEnum = MemoSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js -var require_memo_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf1TypeEnum = void 0; - var MemoSpecOneOf1TypeEnum; - (function(MemoSpecOneOf1TypeEnum2) { - MemoSpecOneOf1TypeEnum2["TEXT"] = "text"; - })(MemoSpecOneOf1TypeEnum || (exports2.MemoSpecOneOf1TypeEnum = MemoSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js -var require_memo_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf2TypeEnum = void 0; - var MemoSpecOneOf2TypeEnum; - (function(MemoSpecOneOf2TypeEnum2) { - MemoSpecOneOf2TypeEnum2["ID"] = "id"; - })(MemoSpecOneOf2TypeEnum || (exports2.MemoSpecOneOf2TypeEnum = MemoSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js -var require_memo_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf3TypeEnum = void 0; - var MemoSpecOneOf3TypeEnum; - (function(MemoSpecOneOf3TypeEnum2) { - MemoSpecOneOf3TypeEnum2["HASH"] = "hash"; - })(MemoSpecOneOf3TypeEnum || (exports2.MemoSpecOneOf3TypeEnum = MemoSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js -var require_memo_spec_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/memo-spec-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MemoSpecOneOf4TypeEnum = void 0; - var MemoSpecOneOf4TypeEnum; - (function(MemoSpecOneOf4TypeEnum2) { - MemoSpecOneOf4TypeEnum2["RETURN"] = "return"; - })(MemoSpecOneOf4TypeEnum || (exports2.MemoSpecOneOf4TypeEnum = MemoSpecOneOf4TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js -var require_network_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js -var require_network_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js -var require_network_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js -var require_network_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/network-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js -var require_notification_create_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-create-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js -var require_notification_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js -var require_notification_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.NotificationType = void 0; - var NotificationType; - (function(NotificationType2) { - NotificationType2["WEBHOOK"] = "webhook"; - })(NotificationType || (exports2.NotificationType = NotificationType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js -var require_notification_update_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/notification-update-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js -var require_operation_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js -var require_operation_spec_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOfTypeEnum = void 0; - var OperationSpecOneOfTypeEnum; - (function(OperationSpecOneOfTypeEnum2) { - OperationSpecOneOfTypeEnum2["PAYMENT"] = "payment"; - })(OperationSpecOneOfTypeEnum || (exports2.OperationSpecOneOfTypeEnum = OperationSpecOneOfTypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js -var require_operation_spec_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf1TypeEnum = void 0; - var OperationSpecOneOf1TypeEnum; - (function(OperationSpecOneOf1TypeEnum2) { - OperationSpecOneOf1TypeEnum2["INVOKE_CONTRACT"] = "invoke_contract"; - })(OperationSpecOneOf1TypeEnum || (exports2.OperationSpecOneOf1TypeEnum = OperationSpecOneOf1TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js -var require_operation_spec_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf2TypeEnum = void 0; - var OperationSpecOneOf2TypeEnum; - (function(OperationSpecOneOf2TypeEnum2) { - OperationSpecOneOf2TypeEnum2["CREATE_CONTRACT"] = "create_contract"; - })(OperationSpecOneOf2TypeEnum || (exports2.OperationSpecOneOf2TypeEnum = OperationSpecOneOf2TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js -var require_operation_spec_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/operation-spec-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.OperationSpecOneOf3TypeEnum = void 0; - var OperationSpecOneOf3TypeEnum; - (function(OperationSpecOneOf3TypeEnum2) { - OperationSpecOneOf3TypeEnum2["UPLOAD_WASM"] = "upload_wasm"; - })(OperationSpecOneOf3TypeEnum || (exports2.OperationSpecOneOf3TypeEnum = OperationSpecOneOf3TypeEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js -var require_pagination_meta = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/pagination-meta.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js -var require_plugin_call_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-call-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js -var require_plugin_handler_error = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-handler-error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js -var require_plugin_metadata = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-metadata.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js -var require_prepare_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js -var require_prepare_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/prepare-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js -var require_relayer_evm_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-evm-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js -var require_relayer_network_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js -var require_relayer_network_policy_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js -var require_relayer_network_policy_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js -var require_relayer_network_policy_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js -var require_relayer_network_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js -var require_relayer_network_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-network-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RelayerNetworkType = void 0; - var RelayerNetworkType; - (function(RelayerNetworkType2) { - RelayerNetworkType2["EVM"] = "evm"; - RelayerNetworkType2["SOLANA"] = "solana"; - RelayerNetworkType2["STELLAR"] = "stellar"; - })(RelayerNetworkType || (exports2.RelayerNetworkType = RelayerNetworkType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js -var require_relayer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js -var require_relayer_solana_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js -var require_relayer_solana_swap_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-solana-swap-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js -var require_relayer_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js -var require_relayer_stellar_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/relayer-stellar-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js -var require_rpc_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/rpc-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js -var require_sign_and_send_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js -var require_sign_and_send_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-and-send-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js -var require_sign_data_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js -var require_sign_data_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js -var require_sign_data_response_evm = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-evm.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js -var require_sign_data_response_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-data-response-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js -var require_sign_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js -var require_sign_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js -var require_sign_transaction_request_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js -var require_sign_transaction_request_stellar = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-request-stellar.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js -var require_sign_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js -var require_sign_transaction_response_solana = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-solana.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js -var require_sign_transaction_response_stellar = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-response-stellar.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js -var require_sign_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js -var require_sign_typed_data_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/sign-typed-data-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js -var require_signer_config_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js -var require_signer_config_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js -var require_signer_config_response_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js -var require_signer_config_response_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js -var require_signer_config_response_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js -var require_signer_config_response_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js -var require_signer_config_response_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js -var require_signer_config_response_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-config-response-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js -var require_signer_create_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-create-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js -var require_signer_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js -var require_signer_type = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignerType = void 0; - var SignerType; - (function(SignerType2) { - SignerType2["LOCAL"] = "local"; - SignerType2["AWS_KMS"] = "aws_kms"; - SignerType2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; - SignerType2["VAULT"] = "vault"; - SignerType2["VAULT_TRANSIT"] = "vault_transit"; - SignerType2["TURNKEY"] = "turnkey"; - SignerType2["CDP"] = "cdp"; - })(SignerType || (exports2.SignerType = SignerType = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js -var require_signer_type_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/signer-type-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SignerTypeRequest = void 0; - var SignerTypeRequest; - (function(SignerTypeRequest2) { - SignerTypeRequest2["PLAIN"] = "plain"; - SignerTypeRequest2["AWS_KMS"] = "aws_kms"; - SignerTypeRequest2["VAULT"] = "vault"; - SignerTypeRequest2["VAULT_TRANSIT"] = "vault_transit"; - SignerTypeRequest2["TURNKEY"] = "turnkey"; - SignerTypeRequest2["CDP"] = "cdp"; - SignerTypeRequest2["GOOGLE_CLOUD_KMS"] = "google_cloud_kms"; - })(SignerTypeRequest || (exports2.SignerTypeRequest = SignerTypeRequest = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js -var require_solana_account_meta = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-account-meta.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js -var require_solana_allowed_tokens_policy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-policy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js -var require_solana_allowed_tokens_swap_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-allowed-tokens-swap-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js -var require_solana_fee_payment_strategy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-fee-payment-strategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaFeePaymentStrategy = void 0; - var SolanaFeePaymentStrategy; - (function(SolanaFeePaymentStrategy2) { - SolanaFeePaymentStrategy2["USER"] = "user"; - SolanaFeePaymentStrategy2["RELAYER"] = "relayer"; - })(SolanaFeePaymentStrategy || (exports2.SolanaFeePaymentStrategy = SolanaFeePaymentStrategy = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js -var require_solana_instruction_spec = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-instruction-spec.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js -var require_solana_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js -var require_solana_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js -var require_solana_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOfMethodEnum = void 0; - var SolanaRpcRequestOneOfMethodEnum; - (function(SolanaRpcRequestOneOfMethodEnum2) { - SolanaRpcRequestOneOfMethodEnum2["FEE_ESTIMATE"] = "feeEstimate"; - })(SolanaRpcRequestOneOfMethodEnum || (exports2.SolanaRpcRequestOneOfMethodEnum = SolanaRpcRequestOneOfMethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js -var require_solana_rpc_request_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf1MethodEnum = void 0; - var SolanaRpcRequestOneOf1MethodEnum; - (function(SolanaRpcRequestOneOf1MethodEnum2) { - SolanaRpcRequestOneOf1MethodEnum2["TRANSFER_TRANSACTION"] = "transferTransaction"; - })(SolanaRpcRequestOneOf1MethodEnum || (exports2.SolanaRpcRequestOneOf1MethodEnum = SolanaRpcRequestOneOf1MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js -var require_solana_rpc_request_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf2MethodEnum = void 0; - var SolanaRpcRequestOneOf2MethodEnum; - (function(SolanaRpcRequestOneOf2MethodEnum2) { - SolanaRpcRequestOneOf2MethodEnum2["PREPARE_TRANSACTION"] = "prepareTransaction"; - })(SolanaRpcRequestOneOf2MethodEnum || (exports2.SolanaRpcRequestOneOf2MethodEnum = SolanaRpcRequestOneOf2MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js -var require_solana_rpc_request_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf3MethodEnum = void 0; - var SolanaRpcRequestOneOf3MethodEnum; - (function(SolanaRpcRequestOneOf3MethodEnum2) { - SolanaRpcRequestOneOf3MethodEnum2["SIGN_TRANSACTION"] = "signTransaction"; - })(SolanaRpcRequestOneOf3MethodEnum || (exports2.SolanaRpcRequestOneOf3MethodEnum = SolanaRpcRequestOneOf3MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js -var require_solana_rpc_request_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf4MethodEnum = void 0; - var SolanaRpcRequestOneOf4MethodEnum; - (function(SolanaRpcRequestOneOf4MethodEnum2) { - SolanaRpcRequestOneOf4MethodEnum2["SIGN_AND_SEND_TRANSACTION"] = "signAndSendTransaction"; - })(SolanaRpcRequestOneOf4MethodEnum || (exports2.SolanaRpcRequestOneOf4MethodEnum = SolanaRpcRequestOneOf4MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js -var require_solana_rpc_request_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf5MethodEnum = void 0; - var SolanaRpcRequestOneOf5MethodEnum; - (function(SolanaRpcRequestOneOf5MethodEnum2) { - SolanaRpcRequestOneOf5MethodEnum2["GET_SUPPORTED_TOKENS"] = "getSupportedTokens"; - })(SolanaRpcRequestOneOf5MethodEnum || (exports2.SolanaRpcRequestOneOf5MethodEnum = SolanaRpcRequestOneOf5MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js -var require_solana_rpc_request_one_of6 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of6.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf6MethodEnum = void 0; - var SolanaRpcRequestOneOf6MethodEnum; - (function(SolanaRpcRequestOneOf6MethodEnum2) { - SolanaRpcRequestOneOf6MethodEnum2["GET_FEATURES_ENABLED"] = "getFeaturesEnabled"; - })(SolanaRpcRequestOneOf6MethodEnum || (exports2.SolanaRpcRequestOneOf6MethodEnum = SolanaRpcRequestOneOf6MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js -var require_solana_rpc_request_one_of7 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcRequestOneOf7MethodEnum = void 0; - var SolanaRpcRequestOneOf7MethodEnum; - (function(SolanaRpcRequestOneOf7MethodEnum2) { - SolanaRpcRequestOneOf7MethodEnum2["RAW_RPC_REQUEST"] = "rawRpcRequest"; - })(SolanaRpcRequestOneOf7MethodEnum || (exports2.SolanaRpcRequestOneOf7MethodEnum = SolanaRpcRequestOneOf7MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js -var require_solana_rpc_request_one_of7_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-request-one-of7-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js -var require_solana_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js -var require_solana_rpc_result_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js -var require_solana_rpc_result_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js -var require_solana_rpc_result_one_of2 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js -var require_solana_rpc_result_one_of3 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of3.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js -var require_solana_rpc_result_one_of4 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of4.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js -var require_solana_rpc_result_one_of5 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of5.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js -var require_solana_rpc_result_one_of6 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of6.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js -var require_solana_rpc_result_one_of7 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-rpc-result-one-of7.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaRpcResultOneOf7MethodEnum = void 0; - var SolanaRpcResultOneOf7MethodEnum; - (function(SolanaRpcResultOneOf7MethodEnum2) { - SolanaRpcResultOneOf7MethodEnum2["RAW_RPC"] = "rawRpc"; - })(SolanaRpcResultOneOf7MethodEnum || (exports2.SolanaRpcResultOneOf7MethodEnum = SolanaRpcResultOneOf7MethodEnum = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js -var require_solana_swap_strategy = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-swap-strategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SolanaSwapStrategy = void 0; - var SolanaSwapStrategy; - (function(SolanaSwapStrategy2) { - SolanaSwapStrategy2["JUPITER_SWAP"] = "jupiter-swap"; - SolanaSwapStrategy2["JUPITER_ULTRA"] = "jupiter-ultra"; - SolanaSwapStrategy2["NOOP"] = "noop"; - })(SolanaSwapStrategy || (exports2.SolanaSwapStrategy = SolanaSwapStrategy = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js -var require_solana_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js -var require_solana_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/solana-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js -var require_speed = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/speed.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Speed = void 0; - var Speed; - (function(Speed2) { - Speed2["FASTEST"] = "fastest"; - Speed2["FAST"] = "fast"; - Speed2["AVERAGE"] = "average"; - Speed2["SAFE_LOW"] = "safeLow"; - })(Speed || (exports2.Speed = Speed = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js -var require_stellar_policy_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-policy-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js -var require_stellar_rpc_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js -var require_stellar_rpc_request_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-request-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js -var require_stellar_rpc_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-rpc-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js -var require_stellar_transaction_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js -var require_stellar_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/stellar-transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js -var require_transaction_response = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-response.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js -var require_transaction_status = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transaction-status.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TransactionStatus = void 0; - var TransactionStatus2; - (function(TransactionStatus3) { - TransactionStatus3["CANCELED"] = "canceled"; - TransactionStatus3["PENDING"] = "pending"; - TransactionStatus3["SENT"] = "sent"; - TransactionStatus3["SUBMITTED"] = "submitted"; - TransactionStatus3["MINED"] = "mined"; - TransactionStatus3["CONFIRMED"] = "confirmed"; - TransactionStatus3["FAILED"] = "failed"; - TransactionStatus3["EXPIRED"] = "expired"; - })(TransactionStatus2 || (exports2.TransactionStatus = TransactionStatus2 = {})); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js -var require_transfer_transaction_request_params = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-request-params.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js -var require_transfer_transaction_result = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/transfer-transaction-result.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js -var require_turnkey_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/turnkey-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js -var require_update_relayer_request = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/update-relayer-request.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js -var require_vault_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js -var require_vault_transit_signer_request_config = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/vault-transit-signer-request-config.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js -var require_wasm_source = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js -var require_wasm_source_one_of = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js -var require_wasm_source_one_of1 = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/wasm-source-one-of1.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js -var require_plugin_api = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/plugin-api.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PluginError = void 0; - exports2.pluginError = pluginError2; - var PluginError = class extends Error { - constructor(message, opts) { - super(message); - this.name = "PluginError"; - this.code = opts === null || opts === void 0 ? void 0 : opts.code; - this.status = opts === null || opts === void 0 ? void 0 : opts.status; - this.details = opts === null || opts === void 0 ? void 0 : opts.details; - } - }; - exports2.PluginError = PluginError; - function pluginError2(message, opts) { - return new PluginError(message, opts); - } - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js -var require_models = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/models/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_api_response_balance_response(), exports2); - __exportStar(require_api_response_balance_response_data(), exports2); - __exportStar(require_api_response_delete_pending_transactions_response(), exports2); - __exportStar(require_api_response_delete_pending_transactions_response_data(), exports2); - __exportStar(require_api_response_notification_response(), exports2); - __exportStar(require_api_response_notification_response_data(), exports2); - __exportStar(require_api_response_plugin_handler_error(), exports2); - __exportStar(require_api_response_plugin_handler_error_data(), exports2); - __exportStar(require_api_response_relayer_response(), exports2); - __exportStar(require_api_response_relayer_response_data(), exports2); - __exportStar(require_api_response_relayer_status(), exports2); - __exportStar(require_api_response_relayer_status_data(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of1(), exports2); - __exportStar(require_api_response_relayer_status_data_one_of2(), exports2); - __exportStar(require_api_response_sign_data_response(), exports2); - __exportStar(require_api_response_sign_data_response_data(), exports2); - __exportStar(require_api_response_sign_transaction_response(), exports2); - __exportStar(require_api_response_sign_transaction_response_data(), exports2); - __exportStar(require_api_response_signer_response(), exports2); - __exportStar(require_api_response_signer_response_data(), exports2); - __exportStar(require_api_response_string(), exports2); - __exportStar(require_api_response_transaction_response(), exports2); - __exportStar(require_api_response_transaction_response_data(), exports2); - __exportStar(require_api_response_value(), exports2); - __exportStar(require_api_response_vec_notification_response(), exports2); - __exportStar(require_api_response_vec_relayer_response(), exports2); - __exportStar(require_api_response_vec_signer_response(), exports2); - __exportStar(require_api_response_vec_transaction_response(), exports2); - __exportStar(require_asset_spec(), exports2); - __exportStar(require_asset_spec_one_of(), exports2); - __exportStar(require_asset_spec_one_of1(), exports2); - __exportStar(require_asset_spec_one_of2(), exports2); - __exportStar(require_auth_spec(), exports2); - __exportStar(require_auth_spec_one_of(), exports2); - __exportStar(require_auth_spec_one_of1(), exports2); - __exportStar(require_auth_spec_one_of2(), exports2); - __exportStar(require_auth_spec_one_of3(), exports2); - __exportStar(require_aws_kms_signer_request_config(), exports2); - __exportStar(require_balance_response(), exports2); - __exportStar(require_cdp_signer_request_config(), exports2); - __exportStar(require_contract_source(), exports2); - __exportStar(require_contract_source_one_of(), exports2); - __exportStar(require_contract_source_one_of1(), exports2); - __exportStar(require_create_relayer_policy_request(), exports2); - __exportStar(require_create_relayer_policy_request_one_of(), exports2); - __exportStar(require_create_relayer_policy_request_one_of1(), exports2); - __exportStar(require_create_relayer_policy_request_one_of2(), exports2); - __exportStar(require_create_relayer_request(), exports2); - __exportStar(require_delete_pending_transactions_response(), exports2); - __exportStar(require_disabled_reason(), exports2); - __exportStar(require_disabled_reason_one_of(), exports2); - __exportStar(require_disabled_reason_one_of1(), exports2); - __exportStar(require_disabled_reason_one_of2(), exports2); - __exportStar(require_disabled_reason_one_of3(), exports2); - __exportStar(require_disabled_reason_one_of4(), exports2); - __exportStar(require_evm_policy_response(), exports2); - __exportStar(require_evm_rpc_request(), exports2); - __exportStar(require_evm_rpc_request_one_of(), exports2); - __exportStar(require_evm_rpc_result(), exports2); - __exportStar(require_evm_transaction_data_signature(), exports2); - __exportStar(require_evm_transaction_request(), exports2); - __exportStar(require_evm_transaction_response(), exports2); - __exportStar(require_fee_estimate_request_params(), exports2); - __exportStar(require_fee_estimate_result(), exports2); - __exportStar(require_get_features_enabled_result(), exports2); - __exportStar(require_get_supported_tokens_item(), exports2); - __exportStar(require_get_supported_tokens_result(), exports2); - __exportStar(require_google_cloud_kms_signer_key_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_key_response_config(), exports2); - __exportStar(require_google_cloud_kms_signer_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_service_account_request_config(), exports2); - __exportStar(require_google_cloud_kms_signer_service_account_response_config(), exports2); - __exportStar(require_json_rpc_error(), exports2); - __exportStar(require_json_rpc_id(), exports2); - __exportStar(require_json_rpc_request_network_rpc_request(), exports2); - __exportStar(require_json_rpc_response_network_rpc_result(), exports2); - __exportStar(require_json_rpc_response_network_rpc_result_result(), exports2); - __exportStar(require_jupiter_swap_options(), exports2); - __exportStar(require_local_signer_request_config(), exports2); - __exportStar(require_log_entry(), exports2); - __exportStar(require_log_level(), exports2); - __exportStar(require_memo_spec(), exports2); - __exportStar(require_memo_spec_one_of(), exports2); - __exportStar(require_memo_spec_one_of1(), exports2); - __exportStar(require_memo_spec_one_of2(), exports2); - __exportStar(require_memo_spec_one_of3(), exports2); - __exportStar(require_memo_spec_one_of4(), exports2); - __exportStar(require_network_policy_response(), exports2); - __exportStar(require_network_rpc_request(), exports2); - __exportStar(require_network_rpc_result(), exports2); - __exportStar(require_network_transaction_request(), exports2); - __exportStar(require_notification_create_request(), exports2); - __exportStar(require_notification_response(), exports2); - __exportStar(require_notification_type(), exports2); - __exportStar(require_notification_update_request(), exports2); - __exportStar(require_operation_spec(), exports2); - __exportStar(require_operation_spec_one_of(), exports2); - __exportStar(require_operation_spec_one_of1(), exports2); - __exportStar(require_operation_spec_one_of2(), exports2); - __exportStar(require_operation_spec_one_of3(), exports2); - __exportStar(require_pagination_meta(), exports2); - __exportStar(require_plugin_call_request(), exports2); - __exportStar(require_plugin_handler_error(), exports2); - __exportStar(require_plugin_metadata(), exports2); - __exportStar(require_prepare_transaction_request_params(), exports2); - __exportStar(require_prepare_transaction_result(), exports2); - __exportStar(require_relayer_evm_policy(), exports2); - __exportStar(require_relayer_network_policy(), exports2); - __exportStar(require_relayer_network_policy_one_of(), exports2); - __exportStar(require_relayer_network_policy_one_of1(), exports2); - __exportStar(require_relayer_network_policy_one_of2(), exports2); - __exportStar(require_relayer_network_policy_response(), exports2); - __exportStar(require_relayer_network_type(), exports2); - __exportStar(require_relayer_response(), exports2); - __exportStar(require_relayer_solana_policy(), exports2); - __exportStar(require_relayer_solana_swap_config(), exports2); - __exportStar(require_relayer_status(), exports2); - __exportStar(require_relayer_stellar_policy(), exports2); - __exportStar(require_rpc_config(), exports2); - __exportStar(require_sign_and_send_transaction_request_params(), exports2); - __exportStar(require_sign_and_send_transaction_result(), exports2); - __exportStar(require_sign_data_request(), exports2); - __exportStar(require_sign_data_response(), exports2); - __exportStar(require_sign_data_response_evm(), exports2); - __exportStar(require_sign_data_response_solana(), exports2); - __exportStar(require_sign_transaction_request(), exports2); - __exportStar(require_sign_transaction_request_params(), exports2); - __exportStar(require_sign_transaction_request_solana(), exports2); - __exportStar(require_sign_transaction_request_stellar(), exports2); - __exportStar(require_sign_transaction_response(), exports2); - __exportStar(require_sign_transaction_response_solana(), exports2); - __exportStar(require_sign_transaction_response_stellar(), exports2); - __exportStar(require_sign_transaction_result(), exports2); - __exportStar(require_sign_typed_data_request(), exports2); - __exportStar(require_signer_config_request(), exports2); - __exportStar(require_signer_config_response(), exports2); - __exportStar(require_signer_config_response_one_of(), exports2); - __exportStar(require_signer_config_response_one_of1(), exports2); - __exportStar(require_signer_config_response_one_of2(), exports2); - __exportStar(require_signer_config_response_one_of3(), exports2); - __exportStar(require_signer_config_response_one_of4(), exports2); - __exportStar(require_signer_config_response_one_of5(), exports2); - __exportStar(require_signer_create_request(), exports2); - __exportStar(require_signer_response(), exports2); - __exportStar(require_signer_type(), exports2); - __exportStar(require_signer_type_request(), exports2); - __exportStar(require_solana_account_meta(), exports2); - __exportStar(require_solana_allowed_tokens_policy(), exports2); - __exportStar(require_solana_allowed_tokens_swap_config(), exports2); - __exportStar(require_solana_fee_payment_strategy(), exports2); - __exportStar(require_solana_instruction_spec(), exports2); - __exportStar(require_solana_policy_response(), exports2); - __exportStar(require_solana_rpc_request(), exports2); - __exportStar(require_solana_rpc_request_one_of(), exports2); - __exportStar(require_solana_rpc_request_one_of1(), exports2); - __exportStar(require_solana_rpc_request_one_of2(), exports2); - __exportStar(require_solana_rpc_request_one_of3(), exports2); - __exportStar(require_solana_rpc_request_one_of4(), exports2); - __exportStar(require_solana_rpc_request_one_of5(), exports2); - __exportStar(require_solana_rpc_request_one_of6(), exports2); - __exportStar(require_solana_rpc_request_one_of7(), exports2); - __exportStar(require_solana_rpc_request_one_of7_params(), exports2); - __exportStar(require_solana_rpc_result(), exports2); - __exportStar(require_solana_rpc_result_one_of(), exports2); - __exportStar(require_solana_rpc_result_one_of1(), exports2); - __exportStar(require_solana_rpc_result_one_of2(), exports2); - __exportStar(require_solana_rpc_result_one_of3(), exports2); - __exportStar(require_solana_rpc_result_one_of4(), exports2); - __exportStar(require_solana_rpc_result_one_of5(), exports2); - __exportStar(require_solana_rpc_result_one_of6(), exports2); - __exportStar(require_solana_rpc_result_one_of7(), exports2); - __exportStar(require_solana_swap_strategy(), exports2); - __exportStar(require_solana_transaction_request(), exports2); - __exportStar(require_solana_transaction_response(), exports2); - __exportStar(require_speed(), exports2); - __exportStar(require_stellar_policy_response(), exports2); - __exportStar(require_stellar_rpc_request(), exports2); - __exportStar(require_stellar_rpc_request_one_of(), exports2); - __exportStar(require_stellar_rpc_result(), exports2); - __exportStar(require_stellar_transaction_request(), exports2); - __exportStar(require_stellar_transaction_response(), exports2); - __exportStar(require_transaction_response(), exports2); - __exportStar(require_transaction_status(), exports2); - __exportStar(require_transfer_transaction_request_params(), exports2); - __exportStar(require_transfer_transaction_result(), exports2); - __exportStar(require_turnkey_signer_request_config(), exports2); - __exportStar(require_update_relayer_request(), exports2); - __exportStar(require_vault_signer_request_config(), exports2); - __exportStar(require_vault_transit_signer_request_config(), exports2); - __exportStar(require_wasm_source(), exports2); - __exportStar(require_wasm_source_one_of(), exports2); - __exportStar(require_wasm_source_one_of1(), exports2); - __exportStar(require_plugin_api(), exports2); - } -}); - -// node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js -var require_dist = __commonJS({ - "node_modules/.pnpm/@openzeppelin+relayer-sdk@1.7.0/node_modules/@openzeppelin/relayer-sdk/dist/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_api(), exports2); - __exportStar(require_configuration(), exports2); - __exportStar(require_models(), exports2); - } -}); - -// lib/sandbox-executor.ts -var sandbox_executor_exports = {}; -__export(sandbox_executor_exports, { - default: () => executeInSandbox -}); -module.exports = __toCommonJS(sandbox_executor_exports); -var vm = __toESM(require("node:vm")); -var v8 = __toESM(require("node:v8")); -var net = __toESM(require("node:net")); - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/stringify.js -var byteToHex = []; -for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); -} -function unsafeStringify(arr, offset = 0) { - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); -} - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/rng.js -var import_crypto = require("crypto"); -var rnds8Pool = new Uint8Array(256); -var poolPtr = rnds8Pool.length; -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - (0, import_crypto.randomFillSync)(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/native.js -var import_crypto2 = require("crypto"); -var native_default = { randomUUID: import_crypto2.randomUUID }; - -// node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm/v4.js -function v4(options, buf, offset) { - if (native_default.randomUUID && !buf && !options) { - return native_default.randomUUID(); - } - options = options || {}; - const rnds = options.random ?? options.rng?.() ?? rng(); - if (rnds.length < 16) { - throw new Error("Random bytes length must be >= 16"); - } - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - if (offset < 0 || offset + 16 > buf.length) { - throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); - } - for (let i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); -} -var v4_default = v4; - -// lib/kv.ts -var import_ioredis = __toESM(require_built3()); -var import_crypto3 = require("crypto"); -var DefaultPluginKVStore = class { - /** - * Create a store bound to a plugin namespace. - * - pluginId: used for the namespace and Redis connection name. - * Curly braces are stripped to avoid nested hash-tags. - * - Uses REDIS_URL if provided; enables lazyConnect and auto pipelining. - */ - constructor(pluginId) { - this.KEY_REGEX = /^[A-Za-z0-9:_-]{1,512}$/; - this.UNLOCK_SCRIPT = 'if redis.call("GET", KEYS[1]) == ARGV[1] then return redis.call("UNLINK", KEYS[1]) else return 0 end'; - const url = process.env.REDIS_URL ?? "redis://localhost:6379"; - this.client = new import_ioredis.default(url, { - connectionName: `plugin_kv:${pluginId}`, - lazyConnect: true, - enableOfflineQueue: true, - enableAutoPipelining: true, - maxRetriesPerRequest: 1, - retryStrategy: (n) => Math.min(n * 50, 1e3) - }); - const pid = pluginId.replace(/[{}]/g, ""); - this.ns = `plugin_kv:{${pid}}`; - } - /** - * Build a namespaced Redis key for the given segment and user key. - * Validates the user-provided key and throws on invalid input. - * @param seg - The key segment: 'data' or 'lock'. - * @param key - The user-provided key to namespace. - * @returns The fully-qualified Redis key. - * @throws Error if the key does not match the allowed pattern. - */ - key(seg, key) { - if (!this.KEY_REGEX.test(key)) throw new Error("invalid key"); - return `${this.ns}:${seg}:${key}`; - } - /** - * Retrieve and JSON-parse the value for a key. - * Returns null if the key is not present. - * @typeParam T - Expected value type after JSON parse. - * @param key - The key to retrieve. - * @returns Resolves to the parsed value, or null if missing. - */ - async get(key) { - const v = await this.client.get(this.key("data", key)); - if (v == null) return null; - return JSON.parse(v); - } - /** - * Store a JSON-encoded value under the key. - * - If opts.ttlSec > 0, sets an expiry in seconds; otherwise no expiry. - * - Throws if value is undefined. - * Returns true on success. - * @param key - The key to set. - * @param value - Serializable value; must not be undefined. - * @param opts - Optional settings. - * @param opts.ttlSec - Time-to-live in seconds; if > 0, sets expiry. - * @returns True on success. - * @throws Error if `value` is undefined or the key is invalid. - */ - async set(key, value, opts) { - if (value === void 0) throw new Error("value must not be undefined"); - const payload = JSON.stringify(value); - const k = this.key("data", key); - const ex = Math.max(0, Math.floor(opts?.ttlSec ?? 0)); - const res = ex > 0 ? await this.client.set(k, payload, "EX", ex) : await this.client.set(k, payload); - return res === "OK"; - } - /** - * Remove the key. - * @param key - The key to remove. - * @returns True if exactly one key was unlinked. - */ - async del(key) { - const k = this.key("data", key); - const n = await this.client.unlink(k); - return n === 1; - } - /** - * Check whether a key exists. - * @param key - The key to check. - * @returns True if the key exists. - */ - async exists(key) { - return await this.client.exists(this.key("data", key)) === 1; - } - /** - * List keys in this store matching `pattern` (glob-like, default '*'). - * Returns bare keys (without namespace). Uses SCAN with COUNT=`batch`. - * @param pattern - Glob-like match pattern (default '*'). - * @param batch - SCAN COUNT per iteration (default 500). - * @returns Array of bare keys (without the namespace prefix). - */ - async listKeys(pattern = "*", batch = 500) { - const out = []; - let cursor = "0"; - const prefix = `${this.ns}:data:`; - do { - const [next, keys] = await this.client.scan(cursor, "MATCH", `${prefix}${pattern}`, "COUNT", batch); - cursor = next; - for (const k of keys) out.push(k.slice(prefix.length)); - } while (cursor !== "0"); - return out; - } - /** - * Delete all keys in this plugin namespace. - * Returns the number of keys removed. - * @returns The number of keys deleted. - */ - async clear() { - let cursor = "0"; - let deleted = 0; - do { - const [next, keys] = await this.client.scan(cursor, "MATCH", `${this.ns}:*`, "COUNT", 1e3); - cursor = next; - if (keys.length) { - const chunkSize = 512; - for (let i = 0; i < keys.length; i += chunkSize) { - const chunk = keys.slice(i, i + chunkSize); - const pipeline = this.client.pipeline(); - chunk.forEach((k) => pipeline.unlink(k)); - const results = await pipeline.exec(); - if (results) { - for (const [, res] of results) { - if (typeof res === "number") deleted += res; - } - } - } - } - } while (cursor !== "0"); - return deleted; - } - /** - * Run `fn` while holding a distributed lock for `key`. - * The lock is acquired with SET NX PX and released via a token-checked - * Lua script to avoid unlocking another client's lock. - * - opts.ttlSec: lock expiry in seconds (default 30) - * - opts.onBusy: 'throw' (default) or 'skip' to return null when busy - * @typeParam T - The return type of `fn`. - * @param key - The lock key. - * @param fn - Async function to execute while holding the lock. - * @param opts - Lock options. - * @param opts.ttlSec - Lock expiry in seconds (default 30). - * @param opts.onBusy - Behavior when the lock is busy: 'throw' or 'skip'. - * @returns The result of `fn`, or null when skipped due to a busy lock. - * @throws Error if the lock is busy and `onBusy` is 'throw'. - */ - async withLock(key, fn, opts) { - const ttlSec = opts?.ttlSec ?? 30; - const onBusy = opts?.onBusy ?? "throw"; - const lockKey = this.key("lock", key); - const token = (0, import_crypto3.randomUUID)(); - const ok = await this.client.set(lockKey, token, "PX", ttlSec * 1e3, "NX"); - if (ok !== "OK") { - if (onBusy === "skip") return null; - throw new Error("lock busy"); - } - try { - return await fn(); - } finally { - await this.client.eval(this.UNLOCK_SCRIPT, 1, lockKey, token); - } - } - /** - * Explicitly connect to Redis. - * Normally not needed since lazyConnect will connect on first command. - */ - async connect() { - await this.client.connect(); - } - /** - * Disconnect from Redis. - * Call this when the store is no longer needed. - */ - async disconnect() { - await this.client.disconnect(); - } -}; - -// lib/compiler.ts -var esbuild = __toESM(require_main()); -var fs = __toESM(require("node:fs")); -var path = __toESM(require("node:path")); -var os = __toESM(require("node:os")); -var MAX_SOURCE_SIZE = 5 * 1024 * 1024; -var MAX_COMPILED_SIZE = 10 * 1024 * 1024; -var DEFAULT_PLUGIN_BASE_DIR = path.resolve(process.cwd(), "plugins"); -function wrapForVm(compiledCode) { - if (typeof compiledCode !== "string") { - throw new Error("wrapForVm: compiledCode must be a string"); - } - if (compiledCode.length === 0) { - throw new Error("wrapForVm: compiledCode cannot be empty"); - } - if (compiledCode.length > MAX_COMPILED_SIZE) { - throw new Error( - `wrapForVm: code exceeds size limit (${(compiledCode.length / 1024 / 1024).toFixed(1)}MB)` - ); - } - return ` -(function(exports, require, module, __filename, __dirname) { -${compiledCode} -}); -`; -} - -// lib/sandbox-executor.ts -var import_relayer_sdk = __toESM(require_dist()); - -// lib/constants.ts -var DEFAULT_SOCKET_REQUEST_TIMEOUT_MS = 3e4; - -// lib/sandbox-executor.ts -var ContextPool = class { - constructor() { - this.available = []; - this.maxSize = 10; - } - // Max contexts to cache per worker - acquire() { - const ctx = this.available.pop(); - if (ctx) { - this.resetContext(ctx); - return ctx; - } - return this.createFreshContext(); - } - release(ctx) { - if (this.available.length < this.maxSize) { - this.available.push(ctx); - } - } - createFreshContext() { - return vm.createContext({}); - } - resetContext(ctx) { - try { - vm.runInContext(` - // Clear any plugin-added globals - if (typeof globalThis.__pluginState !== 'undefined') { - delete globalThis.__pluginState; - } - `, ctx, { timeout: 100 }); - } catch { - } - } - clear() { - this.available = []; - } -}; -var ScriptCache = class { - constructor() { - this.cache = /* @__PURE__ */ new Map(); - this.maxSize = 100; - // Max scripts to cache per worker - this.lastMemoryCheck = 0; - this.memoryCheckInterval = 5e3; - } - // Check every 5s - get(code) { - this.maybeCheckMemory(); - const entry = this.cache.get(code); - if (entry) { - entry.timestamp = Date.now(); - return entry.script; - } - return void 0; - } - set(code, script) { - this.maybeCheckMemory(); - if (this.cache.size >= this.maxSize) { - this.evictOldest(1); - } - this.cache.set(code, { script, timestamp: Date.now() }); - } - /** - * Periodic memory check - evict cache if heap is under pressure. - */ - maybeCheckMemory() { - const now = Date.now(); - if (now - this.lastMemoryCheck < this.memoryCheckInterval) { - return; - } - this.lastMemoryCheck = now; - const usage = process.memoryUsage(); - const heapStats = v8.getHeapStatistics(); - const heapUsedRatio = usage.heapUsed / heapStats.heap_size_limit; - if (heapUsedRatio >= 0.7 && this.cache.size > 0) { - const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); - console.warn( - `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` - ); - this.evictOldest(evictCount); - } - if (heapUsedRatio >= 0.85 && this.cache.size > 0) { - const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.5)); - console.warn( - `[worker-cache] HIGH memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), evicting ${evictCount} scripts` - ); - this.evictOldest(evictCount); - } - } - evictOldest(count) { - const entries = [...this.cache.entries()].sort( - (a, b) => a[1].timestamp - b[1].timestamp - ); - let evicted = 0; - for (const [key] of entries) { - if (evicted >= count) break; - this.cache.delete(key); - evicted++; - } - if (evicted > 0) { - console.log(`[worker-cache] Evicted ${evicted} oldest scripts`); - } - } - clear() { - const size = this.cache.size; - this.cache.clear(); - if (size > 0) { - console.log(`[worker-cache] Emergency eviction: cleared ${size} cached scripts`); - } - } - size() { - return this.cache.size; - } -}; -var SocketClosedError = class extends Error { - constructor(message) { - super(message); - this.name = "SocketClosedError"; - this.code = "ESOCKETCLOSED"; - } -}; -var SocketPool = class { - constructor() { - this.available = []; - this.maxSize = 5; - // Max sockets to cache per worker - // Rust server connection lifetime is 60s. Discard sockets older than 50s. - this.maxSocketAgeMs = 5e4; - } - acquire() { - const now = Date.now(); - while (this.available.length > 0) { - const pooled = this.available.pop(); - const age = now - pooled.createdAt; - if (age > this.maxSocketAgeMs) { - pooled.socket.destroy(); - continue; - } - if (pooled.socket.writable && !pooled.socket.destroyed) { - return { socket: pooled.socket, createdAt: pooled.createdAt }; - } - pooled.socket.destroy(); - } - return null; - } - /** - * Release a socket back to the pool. - * @param socket The socket to release - * @param createdAt When the socket was originally created (for age tracking) - */ - release(socket, createdAt) { - const now = Date.now(); - const age = now - createdAt; - if (age > this.maxSocketAgeMs || !socket.writable || socket.destroyed || this.available.length >= this.maxSize) { - socket.destroy(); - return; - } - this.available.push({ socket, createdAt }); - } - clear() { - for (const pooled of this.available) { - pooled.socket.destroy(); - } - this.available = []; - } -}; -var contextPool = new ContextPool(); -var scriptCache = new ScriptCache(); -var socketPool = new SocketPool(); -var SandboxPluginAPI = class { - constructor(socketPath, httpRequestId) { - this.socket = null; - this.connectionPromise = null; - this.connected = false; - this.maxPendingRequests = 100; - // Prevent memory leak from unbounded pending - this.socketCreatedAt = 0; - // Track socket creation time for pool age-based eviction - // Store handler references for proper cleanup (prevents listener accumulation) - this.boundErrorHandler = null; - this.boundCloseHandler = null; - this.boundDataHandler = null; - this.socketPath = socketPath; - this.pending = /* @__PURE__ */ new Map(); - this.httpRequestId = httpRequestId; - } - async ensureConnected() { - if (this.connected) return; - if (!this.connectionPromise) { - const acquired = socketPool.acquire(); - if (acquired) { - this.socket = acquired.socket; - this.socketCreatedAt = acquired.createdAt; - this.connected = true; - this.connectionPromise = Promise.resolve(); - this.setupSocketHandlers(this.socket); - } else { - this.socket = net.createConnection(this.socketPath); - this.socketCreatedAt = Date.now(); - this.setupSocketHandlers(this.socket); - this.connectionPromise = new Promise((resolve2, reject) => { - this.socket.once("connect", () => { - this.connected = true; - resolve2(); - }); - this.socket.once("error", reject); - }); - } - } - await this.connectionPromise; - } - /** - * Set up error/close/data handlers for a socket (pooled or new). - * This ensures sockets can trigger reconnection on failure. - * Stores references for proper cleanup to prevent listener accumulation. - */ - setupSocketHandlers(socket) { - this.boundErrorHandler = (error) => this.handleSocketError(error); - this.boundCloseHandler = () => this.handleSocketClose(); - this.boundDataHandler = (data) => this.handleSocketData(data); - socket.on("error", this.boundErrorHandler); - socket.on("close", this.boundCloseHandler); - socket.on("data", this.boundDataHandler); - } - /** - * Remove socket handlers before returning to pool. - * Prevents listener accumulation (MaxListenersExceededWarning). - */ - removeSocketHandlers(socket) { - if (this.boundErrorHandler) { - socket.removeListener("error", this.boundErrorHandler); - this.boundErrorHandler = null; - } - if (this.boundCloseHandler) { - socket.removeListener("close", this.boundCloseHandler); - this.boundCloseHandler = null; - } - if (this.boundDataHandler) { - socket.removeListener("data", this.boundDataHandler); - this.boundDataHandler = null; - } - } - /** - * Handle socket error - reject pending requests and reset connection state - */ - handleSocketError(error) { - this.rejectAllPending(error); - this.connected = false; - this.connectionPromise = null; - this.socket = null; - } - /** - * Handle socket close - reset connection state to enable reconnection. - * Uses SocketClosedError to enable automatic retry in sendWithRetry(). - */ - handleSocketClose() { - this.connected = false; - this.rejectAllPending(new SocketClosedError("Socket closed by server (connection lifetime exceeded)")); - this.connectionPromise = null; - this.socket = null; - } - /** - * Handle incoming data from socket - */ - handleSocketData(data) { - data.toString().split("\n").filter(Boolean).forEach((msg) => { - try { - const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); - } - } catch { - } - }); - } - /** - * Reject all pending requests with the given error. - * Called on socket error or close to prevent hanging promises. - */ - rejectAllPending(error) { - for (const [requestId, resolver] of this.pending.entries()) { - resolver.reject(error); - this.pending.delete(requestId); - } - } - useRelayer(relayerId) { - return { - sendTransaction: async (payload) => { - const result = await this.send(relayerId, "sendTransaction", payload); - return { - ...result, - wait: (options) => this.transactionWait(result, options) - }; - }, - getTransaction: (payload) => this.send(relayerId, "getTransaction", payload), - getRelayerStatus: () => this.send(relayerId, "getRelayerStatus", {}), - signTransaction: (payload) => this.send(relayerId, "signTransaction", payload), - getRelayer: () => this.send(relayerId, "getRelayer", {}), - rpc: (payload) => this.send(relayerId, "rpc", payload) - }; - } - async transactionWait(transaction, options) { - const interval = options?.interval ?? 5e3; - const timeout = options?.timeout ?? 6e4; - const relayer = this.useRelayer(transaction.relayer_id); - let shouldContinue = true; - const poll = async () => { - let tx = await relayer.getTransaction({ transactionId: transaction.id }); - while (shouldContinue && tx.status !== import_relayer_sdk.TransactionStatus.MINED && tx.status !== import_relayer_sdk.TransactionStatus.CONFIRMED && tx.status !== import_relayer_sdk.TransactionStatus.CANCELED && tx.status !== import_relayer_sdk.TransactionStatus.EXPIRED && tx.status !== import_relayer_sdk.TransactionStatus.FAILED) { - await new Promise((resolve2) => setTimeout(resolve2, interval)); - if (!shouldContinue) break; - tx = await relayer.getTransaction({ transactionId: transaction.id }); - } - return tx; - }; - let timeoutId; - const timeoutPromise = new Promise((_, reject) => { - timeoutId = setTimeout(() => { - shouldContinue = false; - reject((0, import_relayer_sdk.pluginError)(`Transaction ${transaction.id} timed out after ${timeout}ms`, { status: 504 })); - }, timeout); - }); - return Promise.race([poll(), timeoutPromise]).finally(() => { - shouldContinue = false; - if (timeoutId) clearTimeout(timeoutId); - }); - } - async send(relayerId, method, payload) { - return this.sendWithRetry(relayerId, method, payload, false); - } - /** - * Send request with EPIPE retry logic. - * EPIPE occurs when the pooled socket was closed by the server but client doesn't know yet. - * On EPIPE, we destroy the stale socket and retry with a fresh connection. - */ - async sendWithRetry(relayerId, method, payload, isRetry) { - const requestId = v4_default(); - const msg = { requestId, relayerId, method, payload }; - if (this.httpRequestId) { - msg.httpRequestId = this.httpRequestId; - } - const message = JSON.stringify(msg) + "\n"; - if (this.pending.size >= this.maxPendingRequests) { - throw new Error( - `Too many concurrent API requests (max ${this.maxPendingRequests}). Await previous requests before making new ones.` - ); - } - await this.ensureConnected(); - try { - const socket = this.socket; - if (!socket) { - const staleError = new Error("Socket became unavailable after connection"); - staleError.code = "ECONNRESET"; - throw staleError; - } - return await new Promise((resolve2, reject) => { - let timeoutId; - timeoutId = setTimeout(() => { - this.pending.delete(requestId); - reject(new Error(`Socket request '${method}' timed out after ${DEFAULT_SOCKET_REQUEST_TIMEOUT_MS}ms`)); - }, DEFAULT_SOCKET_REQUEST_TIMEOUT_MS); - this.pending.set(requestId, { - resolve: (value) => { - if (timeoutId) clearTimeout(timeoutId); - resolve2(value); - }, - reject: (reason) => { - if (timeoutId) clearTimeout(timeoutId); - reject(reason); - } - }); - socket.write(message, (error) => { - if (error) { - if (timeoutId) clearTimeout(timeoutId); - this.pending.delete(requestId); - reject(error); - } - }); - }); - } catch (error) { - const isRetryableError = error.code === "EPIPE" || error.code === "ECONNRESET" || error.code === "ESOCKETCLOSED"; - if (!isRetry && isRetryableError) { - if (this.socket) { - this.removeSocketHandlers(this.socket); - this.socket.destroy(); - this.socket = null; - } - this.connected = false; - this.connectionPromise = null; - return this.sendWithRetry(relayerId, method, payload, true); - } - throw error; - } - } - close() { - if (this.socket) { - this.removeSocketHandlers(this.socket); - socketPool.release(this.socket, this.socketCreatedAt); - this.socket = null; - } - this.connected = false; - } -}; -function safeStringify(value) { - try { - return JSON.stringify(value, (_, v) => { - if (typeof v === "bigint") { - return v.toString() + "n"; - } - return v; - }); - } catch { - try { - return String(value); - } catch { - return "[Unstringifiable value]"; - } - } -} -function createSandboxConsole(logs) { - const log = (level) => (...args) => { - const entry = { - level, - _args: args, - // Store raw args - _stringified: false, - _message: "" - }; - Object.defineProperty(entry, "message", { - get() { - if (!this._stringified) { - this._message = this._args.map( - (arg) => typeof arg === "object" ? safeStringify(arg) : String(arg) - ).join(" "); - this._stringified = true; - delete this._args; - } - return this._message; - }, - enumerable: true, - configurable: true - }); - logs.push(entry); - }; - return { - log: log("log"), - info: log("info"), - warn: log("warn"), - error: log("error"), - debug: log("debug"), - trace: log("debug"), - // Required console methods (no-ops for unused ones) - assert: () => { - }, - clear: () => { - }, - count: () => { - }, - countReset: () => { - }, - dir: () => { - }, - dirxml: () => { - }, - group: () => { - }, - groupCollapsed: () => { - }, - groupEnd: () => { - }, - table: () => { - }, - time: () => { - }, - timeEnd: () => { - }, - timeLog: () => { - }, - timeStamp: () => { - }, - profile: () => { - }, - profileEnd: () => { - }, - Console: console.Console - }; -} -async function executeInSandbox(task) { - const logs = []; - const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); - const kv = new DefaultPluginKVStore(task.pluginId); - const context = contextPool.acquire(); - try { - const sandboxConsole = createSandboxConsole(logs); - const wrappedCode = wrapForVm(task.compiledCode); - let script = scriptCache.get(task.compiledCode); - if (!script) { - script = new vm.Script(wrappedCode, { - filename: `plugin-${task.pluginId}.js` - }); - scriptCache.set(task.compiledCode, script); - } - const moduleExports = {}; - const moduleObject = { exports: moduleExports }; - const safeCrypto = { - randomUUID: () => require("crypto").randomUUID(), - getRandomValues: (arr) => require("crypto").getRandomValues(arr) - }; - const BLOCKED_MODULES = /* @__PURE__ */ new Set([ - // Filesystem access - "fs", - "fs/promises", - "node:fs", - "node:fs/promises", - // Process/system control - "child_process", - "node:child_process", - "cluster", - "node:cluster", - "worker_threads", - "node:worker_threads", - "process", - "node:process", - // Low-level system - "os", - "node:os", - "v8", - "node:v8", - "vm", - "node:vm", - // Direct network (use PluginAPI instead) - "net", - "node:net", - "dgram", - "node:dgram", - "tls", - "node:tls", - "http", - "node:http", - "https", - "node:https", - "http2", - "node:http2", - // Dangerous utilities - "repl", - "node:repl", - "inspector", - "node:inspector", - "perf_hooks", - "node:perf_hooks", - "async_hooks", - "node:async_hooks", - "trace_events", - "node:trace_events", - // Native modules (potential escape) - "module", - "node:module" - ]); - const sandboxRequire = (id) => { - if (BLOCKED_MODULES.has(id)) { - throw new Error( - `Module '${id}' is blocked for security. Use the PluginAPI for network operations.` - ); - } - try { - return require(id); - } catch (err) { - throw new Error( - `Module '${id}' not found. Ensure it's installed in plugins/node_modules.` - ); - } - }; - Object.assign(context, { - // === Console for logging === - console: sandboxConsole, - // === CommonJS module system === - exports: moduleExports, - require: sandboxRequire, - module: moduleObject, - __filename: `plugin-${task.pluginId}.js`, - __dirname: "/plugins", - // === Async primitives === - setTimeout, - setInterval, - setImmediate, - clearTimeout, - clearInterval, - clearImmediate, - Promise, - queueMicrotask, - // === Core JS types (often needed explicitly) === - Object, - Array, - String, - Number, - Boolean, - Symbol, - BigInt, - Map, - Set, - WeakMap, - WeakSet, - Date, - RegExp, - Math, - JSON, - // === Error types === - Error, - TypeError, - RangeError, - SyntaxError, - ReferenceError, - URIError, - EvalError, - // === Number utilities === - parseInt, - parseFloat, - isNaN, - isFinite, - Infinity: Infinity, - NaN: NaN, - // === String/URL encoding === - encodeURI, - decodeURI, - encodeURIComponent, - decodeURIComponent, - atob, - btoa, - URL, - URLSearchParams, - // === Binary data === - Buffer, - ArrayBuffer, - SharedArrayBuffer, - Uint8Array, - Uint16Array, - Uint32Array, - Int8Array, - Int16Array, - Int32Array, - Float32Array, - Float64Array, - BigInt64Array, - BigUint64Array, - DataView, - TextEncoder, - TextDecoder, - // === Cancellation (modern async patterns) === - AbortController, - AbortSignal, - // === Safe crypto subset (no signing/hashing secrets) === - crypto: safeCrypto, - // === Reflection (needed by some libraries) === - Reflect, - Proxy - }); - const factory = script.runInContext(context, { timeout: task.timeout }); - factory(moduleExports, sandboxRequire, moduleObject, `plugin-${task.pluginId}.js`, "/plugins"); - const handler = moduleObject.exports.handler || moduleExports.handler; - if (!handler || typeof handler !== "function") { - throw new Error("Plugin must export a handler function"); - } - let result; - const handlerPromise = (async () => { - if (handler.length === 1) { - const pluginContext = { - api, - params: task.params, - kv, - headers: task.headers ?? {}, - route: task.route ?? "", - config: task.config, - method: task.method ?? "POST", - query: task.query ?? {} - }; - return await handler(pluginContext); - } else { - return await handler(api, task.params); - } - })(); - const timeoutPromise = new Promise((_, reject) => { - setTimeout(() => { - const error = new Error(`Plugin handler timed out after ${task.timeout}ms`); - error.code = "ERR_HANDLER_TIMEOUT"; - reject(error); - }, task.timeout); - }); - result = await Promise.race([handlerPromise, timeoutPromise]); - return { - taskId: task.taskId, - success: true, - result, - logs - }; - } catch (error) { - const err = error; - let errorCode = "PLUGIN_ERROR"; - let errorMessage = String(error); - let errorStack; - let errorDetails = void 0; - let errorStatus = 500; - if (err && typeof err === "object") { - errorMessage = err.message || String(error); - if (err.name === "SyntaxError") { - errorCode = "SYNTAX_ERROR"; - } else if (err.name === "TypeError") { - errorCode = "TYPE_ERROR"; - } else if (err.name === "ReferenceError") { - errorCode = "REFERENCE_ERROR"; - } else if (err.code === "ERR_SCRIPT_EXECUTION_TIMEOUT") { - errorCode = "TIMEOUT"; - errorStatus = 504; - errorMessage = `Plugin module compilation timed out after ${task.timeout}ms`; - } else if (err.code === "ERR_HANDLER_TIMEOUT") { - errorCode = "TIMEOUT"; - errorStatus = 504; - } else if (err.code) { - errorCode = err.code; - } - if (err.stack) { - errorStack = err.stack.split("\n").slice(0, 10).join("\n"); - } - if (err.details) { - errorDetails = err.details; - } - if (typeof err.status === "number") { - errorStatus = err.status; - } - } - return { - taskId: task.taskId, - success: false, - error: { - message: errorMessage, - code: errorCode, - status: errorStatus, - details: errorDetails ? { - ...errorDetails, - stack: errorStack - } : errorStack ? { stack: errorStack } : void 0 - }, - logs - }; - } finally { - contextPool.release(context); - try { - api.close(); - } catch (err) { - } - try { - await kv.disconnect(); - } catch { - } - } -} -/*! Bundled license information: - -mime-db/index.js: - (*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015-2022 Douglas Christopher Wilson - * MIT Licensed - *) - -mime-types/index.js: - (*! - * mime-types - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - *) - -axios/dist/node/axios.cjs: - (*! Axios v1.13.1 Copyright (c) 2025 Matt Zabriskie and contributors *) -*/ From dfab187f834f93160bb35f1136c304e98af5ec69 Mon Sep 17 00:00:00 2001 From: Dylan Kilkenny Date: Thu, 15 Jan 2026 19:12:06 +0000 Subject: [PATCH 17/42] fix: Recover stuck Stellar Sent transactions - Add automatic recovery for transactions stuck in Sent status >5 minutes - Re-enqueue submit job if signed envelope exists, otherwise mark as Failed - Track recovery attempts via noop_count (max 3) to prevent infinite loops - Increase submit job retries from 1 to 3 (4 total attempts) - Only warn about missing hash for transactions that should have one Signed-off-by: Dylan Kilkenny --- src/constants/stellar_transaction.rs | 11 + src/constants/worker.rs | 2 +- src/domain/transaction/stellar/status.rs | 280 ++++++++++++++++++++++- 3 files changed, 288 insertions(+), 5 deletions(-) diff --git a/src/constants/stellar_transaction.rs b/src/constants/stellar_transaction.rs index 5c93d42a7..26a55c786 100644 --- a/src/constants/stellar_transaction.rs +++ b/src/constants/stellar_transaction.rs @@ -39,3 +39,14 @@ pub fn get_stellar_status_check_initial_delay() -> Duration { pub fn get_stellar_sponsored_transaction_validity_duration() -> Duration { Duration::minutes(STELLAR_SPONSORED_TRANSACTION_VALIDITY_MINUTES) } + +// Recovery thresholds +/// Threshold for detecting stuck Sent transactions (5 minutes) +/// If a transaction remains in Sent status longer than this without a hash, +/// the status checker will attempt recovery by re-enqueueing the submit job. +pub const STELLAR_STUCK_SENT_THRESHOLD_MINUTES: i64 = 5; + +/// Get stuck sent transaction threshold duration +pub fn get_stellar_stuck_sent_threshold() -> Duration { + Duration::minutes(STELLAR_STUCK_SENT_THRESHOLD_MINUTES) +} diff --git a/src/constants/worker.rs b/src/constants/worker.rs index d9f1f753d..dcab8f40c 100644 --- a/src/constants/worker.rs +++ b/src/constants/worker.rs @@ -4,7 +4,7 @@ pub const WORKER_DEFAULT_MAXIMUM_RETRIES: usize = 5; pub const WORKER_TRANSACTION_REQUEST_RETRIES: usize = 5; // Transaction submission retry counts per command type -pub const WORKER_TRANSACTION_SUBMIT_RETRIES: usize = 1; // Fresh transaction submission +pub const WORKER_TRANSACTION_SUBMIT_RETRIES: usize = 3; // Fresh transaction submission (4 total attempts) pub const WORKER_TRANSACTION_RESUBMIT_RETRIES: usize = 1; // Gas price bump (status checker will retry) pub const WORKER_TRANSACTION_CANCEL_RETRIES: usize = 1; // Cancel/replacement (status checker will retry) pub const WORKER_TRANSACTION_RESEND_RETRIES: usize = 1; // Resend same transaction (status checker will retry) diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index eac085cf2..1f3c981dc 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -7,7 +7,10 @@ use soroban_rs::xdr::{Error, Hash, Limits, WriteXdr}; use tracing::{debug, info, warn}; use super::{is_final_state, StellarRelayerTransaction}; +use crate::constants::get_stellar_stuck_sent_threshold; +use crate::domain::transaction::stellar::prepare::common::send_submit_transaction_job; use crate::domain::transaction::stellar::utils::extract_return_value_from_meta; +use crate::domain::transaction::util::get_age_since_created; use crate::{ domain::is_unsubmitted_transaction, jobs::JobProducerTrait, @@ -96,11 +99,21 @@ where let stellar_hash = match self.parse_and_validate_hash(&tx) { Ok(hash) => hash, Err(e) => { - warn!(tx_id = %tx.id, error = ?e, "failed to parse and validate hash"); - if is_unsubmitted_transaction(&tx.status) { - return Ok(tx); + // Only warn if transaction SHOULD have a hash (Submitted or later) + if !is_unsubmitted_transaction(&tx.status) { + warn!(tx_id = %tx.id, error = ?e, "failed to parse and validate hash"); + return Err(e); } - return Err(e); + + // For unsubmitted transactions (Pending/Sent), check if stuck in Sent status + if tx.status == TransactionStatus::Sent { + if let Ok(age) = get_age_since_created(&tx) { + if age > get_stellar_stuck_sent_threshold() { + return self.recover_stuck_sent_transaction(tx).await; + } + } + } + return Ok(tx); } }; @@ -173,6 +186,67 @@ where Ok(failed_tx) } + /// Maximum number of recovery attempts for stuck Sent transactions + const MAX_RECOVERY_ATTEMPTS: u32 = 3; + + /// Recovers a transaction stuck in Sent status by re-enqueueing the submit job. + /// Uses noop_count to track recovery attempts and prevent infinite loops. + async fn recover_stuck_sent_transaction( + &self, + tx: TransactionRepoModel, + ) -> Result { + let recovery_count = tx.noop_count.unwrap_or(0); + + // Prevent infinite re-enqueue loops + if recovery_count >= Self::MAX_RECOVERY_ATTEMPTS { + warn!( + tx_id = %tx.id, + recovery_count = recovery_count, + "max recovery attempts reached for stuck Sent transaction" + ); + return self + .mark_as_failed( + tx, + format!( + "Transaction stuck in Sent status - exceeded {} recovery attempts", + Self::MAX_RECOVERY_ATTEMPTS + ), + ) + .await; + } + + warn!( + tx_id = %tx.id, + recovery_count = recovery_count, + "recovering stuck Sent transaction" + ); + + let stellar_data = tx.network_data.get_stellar_transaction_data()?; + + if stellar_data.signed_envelope_xdr.is_some() { + // Increment recovery counter before re-enqueueing + let update_req = TransactionUpdateRequest { + noop_count: Some(recovery_count + 1), + ..Default::default() + }; + self.transaction_repository() + .partial_update(tx.id.clone(), update_req) + .await?; + + // Re-enqueue submit job + info!(tx_id = %tx.id, "re-enqueueing submit job for stuck transaction"); + send_submit_transaction_job(self.job_producer(), &tx, None).await?; + Ok(tx) + } else { + // No signed envelope - cannot submit, mark as failed + self.mark_as_failed( + tx, + "Transaction stuck in Sent status without signed envelope".to_string(), + ) + .await + } + } + /// Handles the logic when a Stellar transaction is confirmed successfully. pub async fn handle_stellar_success( &self, @@ -1054,5 +1128,203 @@ mod tests { panic!("Expected Stellar network data"); } } + + #[tokio::test] + async fn test_sent_transaction_not_stuck_yet_returns_ok() { + // Transaction in Sent status for < 5 minutes should NOT trigger recovery + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-sent-not-stuck".to_string(); + tx.status = TransactionStatus::Sent; + // Created just now - not stuck yet + tx.created_at = Utc::now().to_rfc3339(); + // No hash (simulating stuck state) + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = None; + } + + // Should NOT call any provider methods or update transaction + mocks.provider.expect_get_transaction().never(); + mocks.tx_repo.expect_partial_update().never(); + mocks + .job_producer + .expect_produce_submit_transaction_job() + .never(); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx.clone()).await; + + assert!(result.is_ok()); + let returned_tx = result.unwrap(); + // Transaction should be returned unchanged + assert_eq!(returned_tx.id, tx.id); + assert_eq!(returned_tx.status, TransactionStatus::Sent); + } + + #[tokio::test] + async fn test_stuck_sent_transaction_with_signed_xdr_triggers_recovery() { + // Transaction in Sent status for > 5 minutes with signed XDR should re-enqueue submit + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-stuck-with-xdr".to_string(); + tx.status = TransactionStatus::Sent; + tx.noop_count = Some(0); + // Created 10 minutes ago - definitely stuck + tx.created_at = (Utc::now() - Duration::minutes(10)).to_rfc3339(); + // No hash but has signed XDR + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = None; + stellar_data.signed_envelope_xdr = Some("AAAA...signed...".to_string()); + } + + // Should increment noop_count + mocks + .tx_repo + .expect_partial_update() + .withf(|_id, update| update.noop_count == Some(1)) + .times(1) + .returning(|id, _| { + let mut updated = create_test_transaction("test"); + updated.id = id; + updated.noop_count = Some(1); + Ok(updated) + }); + + // Should re-enqueue submit job + mocks + .job_producer + .expect_produce_submit_transaction_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + } + + #[tokio::test] + async fn test_stuck_sent_transaction_without_signed_xdr_marks_failed() { + // Transaction in Sent status for > 5 minutes WITHOUT signed XDR should mark as Failed + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-stuck-no-xdr".to_string(); + tx.status = TransactionStatus::Sent; + tx.noop_count = Some(0); + // Created 10 minutes ago + tx.created_at = (Utc::now() - Duration::minutes(10)).to_rfc3339(); + // No hash AND no signed XDR + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = None; + stellar_data.signed_envelope_xdr = None; + } + + // Should mark as Failed + mocks + .tx_repo + .expect_partial_update() + .withf(|_id, update| update.status == Some(TransactionStatus::Failed)) + .times(1) + .returning(|id, update| { + let mut updated = create_test_transaction("test"); + updated.id = id; + updated.status = update.status.unwrap(); + updated.status_reason = update.status_reason.clone(); + Ok(updated) + }); + + // Notification for failure + mocks + .job_producer + .expect_produce_send_notification_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + // Try to enqueue next pending + mocks + .tx_repo + .expect_find_by_status() + .returning(|_, _| Ok(vec![])); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let failed_tx = result.unwrap(); + assert_eq!(failed_tx.status, TransactionStatus::Failed); + assert!(failed_tx + .status_reason + .as_ref() + .unwrap() + .contains("without signed envelope")); + } + + #[tokio::test] + async fn test_stuck_sent_transaction_max_recovery_attempts_marks_failed() { + // Transaction at max recovery attempts should mark as Failed + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-max-recovery".to_string(); + tx.status = TransactionStatus::Sent; + tx.noop_count = Some(3); // Already at max (MAX_RECOVERY_ATTEMPTS = 3) + tx.created_at = (Utc::now() - Duration::minutes(10)).to_rfc3339(); + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = None; + stellar_data.signed_envelope_xdr = Some("AAAA...signed...".to_string()); + } + + // Should mark as Failed (not try to re-enqueue) + mocks + .tx_repo + .expect_partial_update() + .withf(|_id, update| update.status == Some(TransactionStatus::Failed)) + .times(1) + .returning(|id, update| { + let mut updated = create_test_transaction("test"); + updated.id = id; + updated.status = update.status.unwrap(); + updated.status_reason = update.status_reason.clone(); + Ok(updated) + }); + + // Should NOT try to re-enqueue submit job + mocks + .job_producer + .expect_produce_submit_transaction_job() + .never(); + + // Notification for failure + mocks + .job_producer + .expect_produce_send_notification_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + // Try to enqueue next pending + mocks + .tx_repo + .expect_find_by_status() + .returning(|_, _| Ok(vec![])); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let failed_tx = result.unwrap(); + assert_eq!(failed_tx.status, TransactionStatus::Failed); + assert!(failed_tx + .status_reason + .as_ref() + .unwrap() + .contains("exceeded 3 recovery attempts")); + } } } From e747a362aecb15e33cdeb12b50c69df91e7e1af8 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Fri, 16 Jan 2026 01:42:58 +0100 Subject: [PATCH 18/42] chore: Improvements --- Cargo.toml | 4 +- plugins/lib/plugin.ts | 108 ++++++++++++++++++--- plugins/lib/pool-server.ts | 69 ++++++------- plugins/lib/sandbox-executor.ts | 44 ++++----- plugins/tests/lib/sandbox-executor.test.ts | 45 +++++---- src/api/routes/plugin.rs | 3 +- src/bootstrap/initialize_plugins.rs | 8 +- src/constants/plugins.rs | 14 +++ src/services/plugins/config.rs | 52 +++++----- src/services/plugins/connection.rs | 6 ++ src/services/plugins/health.rs | 20 +++- src/services/plugins/mod.rs | 2 +- src/services/plugins/pool_executor.rs | 33 ++++++- src/services/plugins/runner.rs | 21 ++-- src/services/plugins/shared_socket.rs | 51 ++++++++-- 15 files changed, 330 insertions(+), 150 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5643f9a87..990356098 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,8 +65,8 @@ hmac = { version = "0.12" } sha2 = { version = "0.10" } sha3 = { version = "0.10" } dashmap = { version = "6.1" } -crossbeam = { version = "0.8" } -async-channel = "2.3" +crossbeam = { version = "0.8.4" } +async-channel = "2.5" actix-governor = "0.8" solana-sdk = { version = "3" } solana-client = { version = "3" } diff --git a/plugins/lib/plugin.ts b/plugins/lib/plugin.ts index d9f774411..a71c81fab 100644 --- a/plugins/lib/plugin.ts +++ b/plugins/lib/plugin.ts @@ -413,6 +413,8 @@ export class DefaultPluginAPI implements PluginAPI { private _connectionPromise: Promise | null = null; private _connected: boolean = false; private _httpRequestId?: string; + private _registered: boolean = false; + private _registrationPromise: Promise | null = null; constructor(socketPath: string, httpRequestId?: string) { this.socket = net.createConnection(socketPath); @@ -420,8 +422,10 @@ export class DefaultPluginAPI implements PluginAPI { this._httpRequestId = httpRequestId; this._connectionPromise = new Promise((resolve, reject) => { - this.socket.on('connect', () => { + this.socket.on('connect', async () => { this._connected = true; + // Register with execution_id immediately after connection (new protocol) + await this._register(); resolve(); }); @@ -446,11 +450,24 @@ export class DefaultPluginAPI implements PluginAPI { .forEach((msg: string) => { try { const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); + + // Handle new protocol ApiResponse format + if (parsed.type === 'api_response') { + const { request_id, result, error } = parsed; + const resolver = this.pending.get(request_id); + if (resolver) { + error ? resolver.reject(new Error(error)) : resolver.resolve(result); + this.pending.delete(request_id); + } + } + // Fallback to legacy format for backward compatibility + else if (parsed.requestId) { + const { requestId, result, error } = parsed; + const resolver = this.pending.get(requestId); + if (resolver) { + error ? resolver.reject(error) : resolver.resolve(result); + this.pending.delete(requestId); + } } } catch { // Ignore malformed messages @@ -459,6 +476,43 @@ export class DefaultPluginAPI implements PluginAPI { }); } + /** + * Register execution_id with the server (new protocol requirement) + * This must be the first message sent after connection + */ + private async _register(): Promise { + if (this._registered || !this._httpRequestId) { + return; + } + + if (this._registrationPromise) { + return this._registrationPromise; + } + + this._registrationPromise = new Promise((resolve, reject) => { + const registerMsg = { + type: 'register', + execution_id: this._httpRequestId, + }; + const message = JSON.stringify(registerMsg) + '\n'; + + try { + this.socket.write(message, (err) => { + if (err) { + reject(err); + return; + } + this._registered = true; + resolve(); + }); + } catch (err) { + reject(err); + } + }); + + return this._registrationPromise; + } + /** * Reject all pending requests with the given error. * Called on socket error or close to prevent hanging promises. @@ -543,16 +597,38 @@ export class DefaultPluginAPI implements PluginAPI { async _send(relayerId: string, method: string, payload: any): Promise { const requestId = uuidv4(); - const msg: any = { requestId, relayerId, method, payload }; - if (this._httpRequestId) { - msg.httpRequestId = this._httpRequestId; - } - const message = JSON.stringify(msg) + '\n'; + // Ensure connection and registration are complete if (!this._connected) { await this._connectionPromise; } + // Ensure registration is sent (for new protocol) + // If httpRequestId is available, use new protocol; otherwise fall back to legacy + if (this._httpRequestId && !this._registered) { + await this._register(); + } + + // Use new protocol format if registered, otherwise fall back to legacy format + let msg: any; + if (this._registered && this._httpRequestId) { + // New protocol: ApiRequest message + msg = { + type: 'api_request', + request_id: requestId, + relayer_id: relayerId, + method: method, + payload: payload, + }; + } else { + // Legacy protocol format (for backward compatibility when httpRequestId is missing) + msg = { requestId, relayerId, method, payload }; + if (this._httpRequestId) { + msg.httpRequestId = this._httpRequestId; + } + } + const message = JSON.stringify(msg) + '\n'; + return new Promise((resolve, reject) => { let timeoutId: NodeJS.Timeout | undefined; @@ -585,6 +661,16 @@ export class DefaultPluginAPI implements PluginAPI { } close() { + // Send shutdown message before closing (new protocol) + if (this._connected && this._registered) { + try { + const shutdownMsg = { type: 'shutdown' }; + const message = JSON.stringify(shutdownMsg) + '\n'; + this.socket.write(message); + } catch { + // Ignore errors when sending shutdown (socket might already be closed) + } + } this.socket.end(); } diff --git a/plugins/lib/pool-server.ts b/plugins/lib/pool-server.ts index e5fa3e9db..22d4768b9 100644 --- a/plugins/lib/pool-server.ts +++ b/plugins/lib/pool-server.ts @@ -17,7 +17,7 @@ * - Response: { taskId, success, result?, error?, logs? } * * Configuration: - * + * * All configuration is derived from PLUGIN_MAX_CONCURRENCY in Rust's config.rs * and passed via environment variables when spawning this process. * See: src/services/plugins/config.rs @@ -80,15 +80,15 @@ class PoolServerMemoryMonitor { start(): void { if (this.checkInterval) return; - + // Check memory pressure every 5 seconds (more frequent for faster response) this.checkInterval = setInterval(() => { this.checkMemoryPressure(); }, 5000); - + // Don't prevent process exit this.checkInterval.unref(); - + console.error('[pool-server] Memory monitoring started (thresholds: 75%/80%/85%/92%)'); } @@ -235,7 +235,7 @@ class PoolServerMemoryMonitor { const heapUsedMB = Math.round(heapUsed / 1024 / 1024); const heapLimitMB = Math.round(heapLimit / 1024 / 1024); const percent = Math.round((heapUsed / heapLimit) * 100); - + console.error( `[pool-server] WARNING: Heap at ${heapUsedMB}MB / ${heapLimitMB}MB limit (${percent}%).` ); @@ -330,9 +330,9 @@ class PoolServer { constructor(socketPath: string) { this.socketPath = socketPath; - + const cpuCount = require('os').cpus().length; - + // ========================================================================= // Configuration - ALL values are passed from Rust (single source of truth) // ========================================================================= @@ -358,10 +358,10 @@ class PoolServer { process.env.PLUGIN_POOL_IDLE_TIMEOUT || String(DEFAULT_POOL_IDLE_TIMEOUT_MS), 10 ); - + // Log effective configuration (received from Rust) console.error(`[pool-server] Configuration (from Rust): maxConcurrency=${maxConcurrency}, minThreads=${minThreads}, maxThreads=${maxThreads}, concurrentTasksPerWorker=${concurrentTasksPerWorker}, idleTimeout=${idleTimeout}ms`); - + // WorkerPoolManager handles cache lifecycle with active eviction (runs every 5 mins) // Cache is properly cleaned up on shutdown via pool.destroy() this.pool = new WorkerPoolManager({ @@ -394,13 +394,13 @@ class PoolServer { debug('net.createServer callback - new connection'); this.handleConnection(socket); }); - - + + // Log any server-level errors this.server.on('error', (err) => { console.error('[pool-server] Server error:', err); }); - + this.server.on('connection', (socket) => { debug('Server connection event from:', socket.remoteAddress); }); @@ -418,7 +418,7 @@ class PoolServer { this.server!.listen(this.socketPath, backlog, () => { this.running = true; debug(`Listening on ${this.socketPath} (backlog=${backlog})`); - + // Verify the socket file exists try { const stats = fs.statSync(this.socketPath); @@ -426,12 +426,12 @@ class PoolServer { } catch (e: any) { console.warn(`[pool-server] Socket file check failed:`, e.message); } - + // Verify server state const addr = this.server!.address(); debug(`Server address:`, addr); debug(`Server listening:`, this.server!.listening); - + resolve(); }); }); @@ -443,11 +443,11 @@ class PoolServer { private handleConnection(socket: net.Socket): void { const clientId = Math.random().toString(36).substring(7); debug(`[${clientId}] Client connected`); - + // Enable keep-alive to prevent connection drops socket.setKeepAlive(true, 30000); // 30 second keep-alive probe socket.setNoDelay(true); // Disable Nagle's algorithm for lower latency - + let buffer = ''; let processingPromise: Promise | null = null; const pendingLines: string[] = []; @@ -460,14 +460,14 @@ class PoolServer { if (processingPromise) { await processingPromise; } - + if (pendingLines.length === 0) return; - + processingPromise = (async () => { while (pendingLines.length > 0) { const line = pendingLines.shift()!; if (!line.trim()) continue; - + try { const message = JSON.parse(line) as Message; debug('Processing message type:', message.type); @@ -496,7 +496,7 @@ class PoolServer { } } })(); - + await processingPromise; processingPromise = null; }; @@ -523,7 +523,7 @@ class PoolServer { pendingLines.push(line); debug(`[${clientId}] Queued message: ${line.substring(0, 100)}...`); } - + // Process queue (async but don't await here) processQueue().catch((err) => { console.error(`[pool-server] [${clientId}] Error in processQueue:`, err); @@ -547,7 +547,7 @@ class PoolServer { console.error(`[pool-server] [${clientId}] Socket error:`, err.message); } }; - + const closeHandler = (): void => { // Explicit cleanup of listeners (good practice for long-running servers) socket.removeListener('data', dataHandler); @@ -606,7 +606,7 @@ class PoolServer { return await this.handleExecute(message); case 'precompile': return await this.handlePrecompile(message); - default: + default: { // TypeScript exhaustiveness check const _exhaustive: never = message; return { @@ -614,6 +614,7 @@ class PoolServer { success: false, error: { message: 'Unknown work request type', code: 'UNKNOWN_TYPE' }, }; + } } } catch (err) { const error = err as Error; @@ -714,7 +715,7 @@ class PoolServer { } catch (err) { debug('runPlugin threw error:', err); const error = err as any; - + // Provide detailed error context return { taskId: message.taskId, @@ -808,7 +809,7 @@ class PoolServer { private handleHealth(message: HealthMessage): Response { const stats = this.pool.getStats(); const memUsage = process.memoryUsage(); - + return { taskId: message.taskId, success: true, @@ -860,8 +861,8 @@ class PoolServer { return { taskId: message.taskId, success: true, - result: { - status: 'draining', + result: { + status: 'draining', activeRequests: this.activeRequests, timeoutMs: this.shutdownTimeoutMs, }, @@ -1002,8 +1003,8 @@ async function main(): Promise { const maxOldSpaceMatch = nodeOptions.match(/--max-old-space-size=(\d+)/); const configuredHeapMB = maxOldSpaceMatch ? parseInt(maxOldSpaceMatch[1], 10) : 'default'; const currentHeapMB = Math.round(process.memoryUsage().heapTotal / 1024 / 1024); - - console.error( + + console.info( `[pool-server] Heap configuration: ${configuredHeapMB}MB max ` + `(current: ${currentHeapMB}MB, will grow as needed)` ); @@ -1012,7 +1013,7 @@ async function main(): Promise { // Start memory monitoring for pool server process const memoryMonitor = new PoolServerMemoryMonitor(); - + // Connect memory monitor to pool for cache eviction memoryMonitor.onCacheEviction(() => { console.error('[pool-server] Memory pressure - clearing code cache'); @@ -1072,10 +1073,10 @@ async function main(): Promise { debug('Server started successfully, listening on', socketPath); // Write ready signal to stdout for Rust to detect console.log('POOL_SERVER_READY'); - + // Keep the process alive forever - the server will handle connections debug('Entering event loop, waiting for connections...'); - + // Periodic heartbeat to verify event loop is running (debug mode only) if (process.env.PLUGIN_POOL_DEBUG) { let heartbeatCount = 0; @@ -1086,7 +1087,7 @@ async function main(): Promise { } }, 1000); } - + // Keep process alive await new Promise(() => {}); } catch (err) { diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/sandbox-executor.ts index 5a9e6c5c4..994f09946 100644 --- a/plugins/lib/sandbox-executor.ts +++ b/plugins/lib/sandbox-executor.ts @@ -133,16 +133,6 @@ class ScriptCache { // causing false positive pressure detection (e.g., 28MB/30MB = 93% when max is 26GB) const heapUsedRatio = usage.heapUsed / heapStats.heap_size_limit; - // At 70% heap usage, evict 25% of cache - if (heapUsedRatio >= 0.70 && this.cache.size > 0) { - const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); - console.warn( - `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + - `evicting ${evictCount} scripts` - ); - this.evictOldest(evictCount); - } - // At 85% heap usage, evict 50% of cache if (heapUsedRatio >= 0.85 && this.cache.size > 0) { const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.5)); @@ -151,6 +141,14 @@ class ScriptCache { `evicting ${evictCount} scripts` ); this.evictOldest(evictCount); + } else if (heapUsedRatio >= 0.70 && this.cache.size > 0) { + // At 70% heap usage, evict 25% of cache + const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); + console.warn( + `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + + `evicting ${evictCount} scripts` + ); + this.evictOldest(evictCount); } } @@ -720,7 +718,7 @@ function createSandboxConsole(logs: LogEntry[]): Console { _stringified: false, _message: '', }; - + // Lazy getter for message Object.defineProperty(entry, 'message', { get() { @@ -737,7 +735,7 @@ function createSandboxConsole(logs: LogEntry[]): Console { enumerable: true, configurable: true, }); - + logs.push(entry); }; @@ -778,7 +776,7 @@ export default async function executeInSandbox(task: SandboxTask): Promise { it('should reset context state before reuse', () => { const pool = new MockContextPool(); const ctx = pool.acquire(); - + // Simulate plugin pollution (ctx as any).__pluginState = { dirty: true }; pool.release(ctx); @@ -96,7 +96,7 @@ describe('ContextPool logic', () => { it('should clear all contexts', () => { const pool = new MockContextPool(); const contexts: any[] = []; - + for (let i = 0; i < 5; i++) { const ctx = pool.acquire(); contexts.push(ctx); @@ -174,7 +174,7 @@ describe('ScriptCache logic', () => { expect(result).toBeUndefined(); }); - it('should update timestamp on cache hit (LRU)', () => { + it('should update timestamp on cache hit (LRU)', async () => { const cache = new MockScriptCache(); const code = 'test'; const script = { compiled: true }; @@ -182,12 +182,11 @@ describe('ScriptCache logic', () => { cache.set(code, script); const timestamp1 = (cache as any).cache.get(code).timestamp; - // Wait a bit and access again - setTimeout(() => { - cache.get(code); - const timestamp2 = (cache as any).cache.get(code).timestamp; - expect(timestamp2).toBeGreaterThanOrEqual(timestamp1); - }, 10); + await new Promise(resolve => setTimeout(resolve, 10)); + + cache.get(code); + const timestamp2 = (cache as any).cache.get(code).timestamp; + expect(timestamp2).toBeGreaterThanOrEqual(timestamp1); }); it('should evict oldest entry when at capacity', () => { @@ -1117,35 +1116,35 @@ describe('executeInSandbox function', () => { describe('Error handling in sandbox', () => { it('should categorize SyntaxError', () => { const error = new SyntaxError('Unexpected token'); - + const errorCode = error.name === 'SyntaxError' ? 'SYNTAX_ERROR' : 'PLUGIN_ERROR'; - + expect(errorCode).toBe('SYNTAX_ERROR'); }); it('should categorize TypeError', () => { const error = new TypeError('Cannot read property'); - + const errorCode = error.name === 'TypeError' ? 'TYPE_ERROR' : 'PLUGIN_ERROR'; - + expect(errorCode).toBe('TYPE_ERROR'); }); it('should categorize ReferenceError', () => { const error = new ReferenceError('x is not defined'); - + const errorCode = error.name === 'ReferenceError' ? 'REFERENCE_ERROR' : 'PLUGIN_ERROR'; - + expect(errorCode).toBe('REFERENCE_ERROR'); }); it('should handle timeout errors', () => { const error: any = new Error('Timeout'); error.code = 'ERR_SCRIPT_EXECUTION_TIMEOUT'; - + const errorCode = error.code === 'ERR_SCRIPT_EXECUTION_TIMEOUT' ? 'TIMEOUT' : 'PLUGIN_ERROR'; const errorStatus = errorCode === 'TIMEOUT' ? 504 : 500; - + expect(errorCode).toBe('TIMEOUT'); expect(errorStatus).toBe(504); }); @@ -1153,17 +1152,17 @@ describe('Error handling in sandbox', () => { it('should handle handler timeout errors', () => { const error: any = new Error('Handler timeout'); error.code = 'ERR_HANDLER_TIMEOUT'; - + const errorCode = error.code === 'ERR_HANDLER_TIMEOUT' ? 'TIMEOUT' : 'PLUGIN_ERROR'; - + expect(errorCode).toBe('TIMEOUT'); }); it('should capture stack trace', () => { const error = new Error('Test error'); - + const stack = error.stack?.split('\n').slice(0, 10).join('\n'); - + expect(stack).toBeDefined(); expect(stack).toContain('Test error'); }); @@ -1171,9 +1170,9 @@ describe('Error handling in sandbox', () => { it('should use custom status if provided', () => { const error: any = new Error('Bad request'); error.status = 400; - + const errorStatus = typeof error.status === 'number' ? error.status : 500; - + expect(errorStatus).toBe(400); }); }); diff --git a/src/api/routes/plugin.rs b/src/api/routes/plugin.rs index 3562fccc5..f388787be 100644 --- a/src/api/routes/plugin.rs +++ b/src/api/routes/plugin.rs @@ -63,11 +63,12 @@ fn extract_query_params(http_req: &HttpRequest) -> HashMap> /// Resolves the effective route from path and query parameters. /// Path route takes precedence; if empty, falls back to `route` query parameter. fn resolve_route(path_route: &str, http_req: &HttpRequest) -> String { + // Early return to avoid unnecessary query parameter parsing when path_route is provided if !path_route.is_empty() { return path_route.to_string(); } - // Check for route in query parameters + // Only parse query parameters when path_route is empty (lazy evaluation) let query_params = extract_query_params(http_req); query_params .get("route") diff --git a/src/bootstrap/initialize_plugins.rs b/src/bootstrap/initialize_plugins.rs index 83eb7cefb..da59daea9 100644 --- a/src/bootstrap/initialize_plugins.rs +++ b/src/bootstrap/initialize_plugins.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use tracing::{info, warn}; use crate::repositories::PluginRepositoryTrait; -use crate::services::plugins::{get_pool_manager, PoolManager}; +use crate::services::plugins::{get_pool_manager, PluginRunner, PluginService, PoolManager}; /// Initialize the plugin worker pool if plugins are configured. /// @@ -92,11 +92,7 @@ pub async fn precompile_plugins( let mut compiled_count = 0; for plugin in plugins.items { - let plugin_path = if plugin.path.starts_with("plugins/") { - plugin.path.clone() - } else { - format!("plugins/{}", plugin.path) - }; + let plugin_path = PluginService::::resolve_plugin_path(&plugin.path); match pool_manager .precompile_plugin(plugin.id.clone(), Some(plugin_path), None) diff --git a/src/constants/plugins.rs b/src/constants/plugins.rs index bc1d7c5a1..e1ac33f25 100644 --- a/src/constants/plugins.rs +++ b/src/constants/plugins.rs @@ -39,6 +39,20 @@ pub const DEFAULT_POOL_MAX_THREADS_FLOOR: usize = 8; /// Internal constant, not user-configurable. pub const DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER: usize = 20; +/// Headroom multiplier for calculating concurrent tasks per worker. +/// Applied to base task calculation to provide buffer for: +/// - Queue buildup during traffic spikes +/// - Variable plugin execution latency +/// - Temporary load imbalances across workers +/// Internal constant, not user-configurable. +pub const CONCURRENT_TASKS_HEADROOM_MULTIPLIER: f64 = 1.2; + +/// Maximum concurrent tasks per worker thread (hard cap). +/// This cap prevents excessive memory usage and GC pressure per worker. +/// Validated through load testing as a stable upper bound. +/// Internal constant, not user-configurable. +pub const MAX_CONCURRENT_TASKS_PER_WORKER: usize = 250; + /// Worker idle timeout in milliseconds. /// Internal constant, not user-configurable. pub const DEFAULT_POOL_IDLE_TIMEOUT_MS: u64 = 60000; // 60 seconds diff --git a/src/services/plugins/config.rs b/src/services/plugins/config.rs index 8a8121e5d..5a2551d0e 100644 --- a/src/services/plugins/config.rs +++ b/src/services/plugins/config.rs @@ -20,12 +20,13 @@ //! ``` use crate::constants::{ - DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, DEFAULT_POOL_CONNECT_RETRIES, - DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, DEFAULT_POOL_IDLE_TIMEOUT_MS, - DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_THREADS_FLOOR, DEFAULT_POOL_MIN_THREADS, - DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, DEFAULT_POOL_REQUEST_TIMEOUT_SECS, - DEFAULT_POOL_SOCKET_BACKLOG, DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, - DEFAULT_SOCKET_READ_TIMEOUT_SECS, DEFAULT_TRACE_TIMEOUT_MS, + CONCURRENT_TASKS_HEADROOM_MULTIPLIER, DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, + DEFAULT_POOL_CONNECT_RETRIES, DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS, + DEFAULT_POOL_IDLE_TIMEOUT_MS, DEFAULT_POOL_MAX_CONNECTIONS, DEFAULT_POOL_MAX_THREADS_FLOOR, + DEFAULT_POOL_MIN_THREADS, DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS, + DEFAULT_POOL_REQUEST_TIMEOUT_SECS, DEFAULT_POOL_SOCKET_BACKLOG, + DEFAULT_SOCKET_IDLE_TIMEOUT_SECS, DEFAULT_SOCKET_READ_TIMEOUT_SECS, DEFAULT_TRACE_TIMEOUT_MS, + MAX_CONCURRENT_TASKS_PER_WORKER, }; use std::sync::OnceLock; @@ -258,17 +259,20 @@ impl PluginConfig { let nodejs_pool_max_threads = env_parse("PLUGIN_POOL_MAX_THREADS", derived_max_threads); // concurrentTasksPerWorker: Node.js async can handle many concurrent tasks - // Formula: (concurrency / max_threads) * 1.2 for some headroom - // The 1.2x multiplier provides headroom for: + // Formula: (concurrency / max_threads) * CONCURRENT_TASKS_HEADROOM_MULTIPLIER for some headroom + // The multiplier provides headroom for: // - Queue buildup during traffic spikes // - Variable plugin execution latency // Examples with new formula (on 16GB system with ~8 threads): - // - 10000 VUs / 16 threads * 1.2 = 750, capped at 250 - // - 5000 VUs / 8 threads * 1.2 = 750, capped at 250 + // - 10000 VUs / 16 threads * 1.2 = 750, capped at MAX_CONCURRENT_TASKS_PER_WORKER + // - 5000 VUs / 8 threads * 1.2 = 750, capped at MAX_CONCURRENT_TASKS_PER_WORKER // - 1000 VUs / 8 threads * 1.2 = 150 let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); - let derived_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) - .clamp(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, 250); // Cap at 250 (validated stable by testing) + let derived_concurrent_tasks = + ((base_tasks as f64 * CONCURRENT_TASKS_HEADROOM_MULTIPLIER) as usize).clamp( + DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, + MAX_CONCURRENT_TASKS_PER_WORKER, + ); let nodejs_pool_concurrent_tasks = env_parse("PLUGIN_POOL_CONCURRENT_TASKS", derived_concurrent_tasks); @@ -405,12 +409,8 @@ impl Default for PluginConfig { /// but without any environment variable overrides. /// This ensures tests and production use consistent formulas. fn default() -> Self { - // Clear any test environment variables to ensure pure defaults - // Note: This only affects the Default impl, not from_env() usage - std::env::remove_var("PLUGIN_MAX_CONCURRENCY"); - - // Use the same derivation logic as from_env() - // This ensures Default matches production behavior + // Use hardcoded defaults without reading environment variables + // Note: This differs from from_env() which reads env vars let max_concurrency = DEFAULT_POOL_MAX_CONNECTIONS; let cpu_count = std::thread::available_parallelism() .map(|n| n.get()) @@ -435,8 +435,11 @@ impl Default for PluginConfig { let nodejs_pool_min_threads = DEFAULT_POOL_MIN_THREADS.max(cpu_count / 2); let base_tasks = max_concurrency / nodejs_pool_max_threads.max(1); - let nodejs_pool_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) - .clamp(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, 250); + let nodejs_pool_concurrent_tasks = + ((base_tasks as f64 * CONCURRENT_TASKS_HEADROOM_MULTIPLIER) as usize).clamp( + DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER, + MAX_CONCURRENT_TASKS_PER_WORKER, + ); // Worker heap for Default impl (same formula as from_env) let base_worker_heap = 512_usize; @@ -613,11 +616,12 @@ mod tests { // Concurrent tasks per worker let base_tasks = max_concurrency / nodejs_pool_max_threads; - let derived_concurrent_tasks = ((base_tasks as f64 * 1.2) as usize) + let derived_concurrent_tasks = ((base_tasks as f64 * CONCURRENT_TASKS_HEADROOM_MULTIPLIER) + as usize) .max(DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER) - .min(250); - // Should be capped at 250 - assert!(derived_concurrent_tasks <= 250); + .min(MAX_CONCURRENT_TASKS_PER_WORKER); + // Should be capped at MAX_CONCURRENT_TASKS_PER_WORKER + assert!(derived_concurrent_tasks <= MAX_CONCURRENT_TASKS_PER_WORKER); } #[test] diff --git a/src/services/plugins/connection.rs b/src/services/plugins/connection.rs index 26ca1ec39..0d9ea9651 100644 --- a/src/services/plugins/connection.rs +++ b/src/services/plugins/connection.rs @@ -242,6 +242,12 @@ impl ConnectionPool { pub async fn clear(&self) { while self.available.pop().is_some() {} } + + /// Get the next connection ID from the atomic counter. + /// This is useful for creating connections outside the pool (e.g., shutdown requests). + pub fn next_connection_id(&self) -> usize { + self.next_id.fetch_add(1, Ordering::Relaxed) + } } /// RAII wrapper that returns connection to pool on drop diff --git a/src/services/plugins/health.rs b/src/services/plugins/health.rs index 2f24bcc68..5b45ecb74 100644 --- a/src/services/plugins/health.rs +++ b/src/services/plugins/health.rs @@ -167,6 +167,18 @@ impl CircuitBreaker { /// Idle timeout for auto-closing circuit (2 minutes of no activity) const IDLE_AUTO_CLOSE_MS: u64 = 120_000; + /// Initial backoff delay in milliseconds before attempting recovery. + /// First recovery attempt waits this long after circuit opens. + const INITIAL_BACKOFF_MS: u64 = 5000; + + /// Maximum number of backoff attempts before capping the delay. + /// Exponential backoff doubles each attempt: 5s, 10s, 20s, 40s, then capped. + const MAX_BACKOFF_ATTEMPTS: u32 = 4; + + /// Maximum backoff delay in milliseconds (hard cap). + /// Prevents excessive wait times between recovery attempts. + const MAX_BACKOFF_MS: u64 = 60_000; + pub fn new() -> Self { Self { state: AtomicU32::new(0), // Closed @@ -290,10 +302,12 @@ impl CircuitBreaker { .unwrap_or_default() .as_millis() as u64; - // Wait at least 5 seconds before trying recovery - // Exponential backoff: 5s, 10s, 20s, 40s, max 60s + // Exponential backoff: INITIAL_BACKOFF_MS, 2x, 4x, 8x, 16x, capped at MAX_BACKOFF_MS + // This prevents rapid restart attempts that could worsen the situation let attempts = self.restart_attempts.load(Ordering::Relaxed); - let backoff_ms = (5000u64 * (1 << attempts.min(4))).min(60000); + let backoff_ms = (Self::INITIAL_BACKOFF_MS + * (1 << attempts.min(Self::MAX_BACKOFF_ATTEMPTS))) + .min(Self::MAX_BACKOFF_MS); if now - opened_at >= backoff_ms { tracing::info!( diff --git a/src/services/plugins/mod.rs b/src/services/plugins/mod.rs index e09e05e4e..0353095b7 100644 --- a/src/services/plugins/mod.rs +++ b/src/services/plugins/mod.rs @@ -231,7 +231,7 @@ impl PluginService { Self { runner } } - fn resolve_plugin_path(plugin_path: &str) -> String { + pub fn resolve_plugin_path(plugin_path: &str) -> String { if plugin_path.starts_with("plugins/") { plugin_path.to_string() } else { diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index 4d5c5c001..bbaaf37a4 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -77,6 +77,24 @@ impl Default for PoolManager { } impl PoolManager { + /// Base heap size in MB for the pool server process. + /// This provides the minimum memory needed for the Node.js runtime and core pool infrastructure. + const BASE_HEAP_MB: usize = 512; + + /// Concurrency divisor for heap calculation. + /// Heap is incremented for every N concurrent requests to scale with load. + const CONCURRENCY_DIVISOR: usize = 10; + + /// Heap increment in MB per CONCURRENCY_DIVISOR concurrent requests. + /// Formula: BASE_HEAP_MB + ((max_concurrency / CONCURRENCY_DIVISOR) * HEAP_INCREMENT_PER_DIVISOR_MB) + /// This accounts for additional memory needed per concurrent plugin execution context. + const HEAP_INCREMENT_PER_DIVISOR_MB: usize = 32; + + /// Maximum heap size in MB (hard cap) for the pool server process. + /// Prevents excessive memory allocation that could cause system instability. + /// Set to 8GB (8192 MB) as a reasonable upper bound for Node.js processes. + const MAX_HEAP_MB: usize = 8192; + /// Create a new PoolManager with default socket path pub fn new() -> Self { Self::init(format!("/tmp/relayer-plugin-pool-{}.sock", Uuid::new_v4())) @@ -608,10 +626,14 @@ impl PoolManager { let config = get_config(); - let calculated_heap = 512 + ((config.max_concurrency / 10) * 32); - let pool_server_heap_mb = calculated_heap.min(8192); + // Calculate heap size based on concurrency: base + (concurrency / divisor) * increment + // This scales memory allocation with expected load while maintaining a reasonable minimum + let calculated_heap = Self::BASE_HEAP_MB + + ((config.max_concurrency / Self::CONCURRENCY_DIVISOR) + * Self::HEAP_INCREMENT_PER_DIVISOR_MB); + let pool_server_heap_mb = calculated_heap.min(Self::MAX_HEAP_MB); - if calculated_heap > 8192 { + if calculated_heap > Self::MAX_HEAP_MB { tracing::warn!( calculated_heap_mb = calculated_heap, capped_heap_mb = pool_server_heap_mb, @@ -1387,7 +1409,10 @@ impl PoolManager { task_id: Uuid::new_v4().to_string(), }; - let mut conn = match PoolConnection::new(&self.socket_path, 999999).await { + // Use the pool's connection ID counter to ensure unique IDs + // even for shutdown connections that bypass the pool + let connection_id = self.connection_pool.next_connection_id(); + let mut conn = match PoolConnection::new(&self.socket_path, connection_id).await { Ok(c) => c, Err(e) => { return Err(PluginError::PluginExecutionError(format!( diff --git a/src/services/plugins/runner.rs b/src/services/plugins/runner.rs index 15339a380..dd2ba41c7 100644 --- a/src/services/plugins/runner.rs +++ b/src/services/plugins/runner.rs @@ -239,7 +239,7 @@ impl PluginRunner { // Collect traces from the guard let mut traces_rx = guard.into_receiver(); - let traces = match tokio::time::timeout(Duration::from_secs(5), traces_rx.recv()).await { + let traces = match tokio::time::timeout(get_trace_timeout(), traces_rx.recv()).await { Ok(Some(traces)) => traces, Ok(None) => Vec::new(), Err(_) => { @@ -304,14 +304,9 @@ impl PluginRunner { .clone() .unwrap_or_else(|| format!("exec-{}", Uuid::new_v4())); - // Only register for traces if emit_traces is enabled + // Always register execution so API calls from plugin can be validated // ExecutionGuard will auto-unregister on drop (RAII pattern) - let mut traces_rx = if emit_traces { - let guard = shared_socket.register_execution(execution_id.clone()).await; - Some(guard.into_receiver()) - } else { - None - }; + let execution_guard = shared_socket.register_execution(execution_id.clone()).await; // Execute via pool manager (using shared socket path) let pool_manager = get_pool_manager(); @@ -344,7 +339,7 @@ impl PluginRunner { params, headers, shared_socket_path, // Use shared socket path instead of unique one - http_request_id, + Some(execution_id.clone()), // Pass the registered execution_id Some(timeout_duration.as_secs()), route, config, @@ -362,7 +357,9 @@ impl PluginRunner { }; // Collect traces only if emit_traces is enabled - let traces = if let Some(ref mut rx) = traces_rx { + let traces = if emit_traces { + // Convert guard to receiver only now, keeping guard alive during execution + let mut rx = execution_guard.into_receiver(); // Wait for traces with short timeout - they arrive immediately if the plugin used the API let trace_timeout = get_trace_timeout().min(timeout_duration); match timeout(trace_timeout, rx.recv()).await { @@ -370,10 +367,12 @@ impl PluginRunner { Ok(None) | Err(_) => Vec::new(), } } else { + // Drop the guard without waiting for traces + drop(execution_guard); Vec::new() }; - // ExecutionGuard auto-unregisters when traces_rx is dropped + // ExecutionGuard auto-unregisters when guard is dropped (after trace collection) match exec_outcome { Ok(mut script_result) => { diff --git a/src/services/plugins/shared_socket.rs b/src/services/plugins/shared_socket.rs index 42bf031c9..e8db243a8 100644 --- a/src/services/plugins/shared_socket.rs +++ b/src/services/plugins/shared_socket.rs @@ -245,10 +245,18 @@ impl SharedSocketService { // Spawn background cleanup task for stale executions (prevents memory leaks) let executions_clone = executions.clone(); + let mut cleanup_shutdown_rx = shutdown_tx.subscribe(); tokio::spawn(async move { let mut interval = tokio::time::interval(Duration::from_secs(60)); loop { - interval.tick().await; + tokio::select! { + _ = interval.tick() => {} + _ = cleanup_shutdown_rx.changed() => { + if *cleanup_shutdown_rx.borrow() { + break; + } + } + } let now = Instant::now(); let mut map = executions_clone.write().await; // Remove entries older than 5 minutes @@ -292,11 +300,16 @@ impl SharedSocketService { } } - /// Get current active connection count (semaphore available permits) - pub fn active_connection_count(&self) -> usize { + /// Get current number of available connection slots + pub fn available_connection_slots(&self) -> usize { self.connection_semaphore.available_permits() } + /// Get current active connection count + pub fn active_connection_count(&self) -> usize { + get_config().socket_max_connections - self.connection_semaphore.available_permits() + } + /// Signal shutdown to the listener and wait for active connections to drain pub async fn shutdown(&self) { let _ = self.shutdown_tx.send(true); @@ -635,15 +648,24 @@ impl SharedSocketService { } else { // Legacy protocol (no "type" field) if let Ok(request) = serde_json::from_value::(json_value.clone()) { - // Legacy format - traces.push(json_value); + // Legacy format - API requests are not trace events // Set execution_id from http_request_id or request_id if not bound if bound_execution_id.is_none() { - bound_execution_id = request + let candidate_id = request .http_request_id .clone() .or_else(|| Some(request.request_id.clone())); + + // Validate execution_id exists (same as new protocol) + if let Some(ref id) = candidate_id { + let map = executions.read().await; + if map.contains_key(id) { + bound_execution_id = candidate_id; + } else { + debug!("Legacy request with unknown execution_id: {}", id); + } + } } // Handle legacy request @@ -672,10 +694,25 @@ impl SharedSocketService { let map = executions.read().await; if let Some(ctx) = map.get(&exec_id) { // Send traces with timeout to prevent blocking + let trace_count = traces.len(); match tokio::time::timeout(Duration::from_secs(5), ctx.traces_tx.send(traces)).await { Ok(Ok(())) => {} - Ok(Err(_)) => warn!("Trace channel closed for execution_id: {}", exec_id), + Ok(Err(_)) => { + // Only warn if traces were collected but couldn't be delivered + // Channel closed with empty traces is expected when emit_traces=false + if trace_count > 0 { + warn!( + "Trace channel closed for execution_id: {} ({} traces lost)", + exec_id, trace_count + ); + } else { + debug!( + "Trace channel closed for execution_id: {} (no traces to deliver)", + exec_id + ); + } + } Err(_) => warn!("Timeout sending traces for execution_id: {}", exec_id), } } From e5a5451820d3660de3caf83c6280da3d2424e60e Mon Sep 17 00:00:00 2001 From: Zeljko Date: Fri, 16 Jan 2026 10:24:40 +0100 Subject: [PATCH 19/42] chore: Sandbox improvements --- .../channel/package.json | 2 +- .../channel/pnpm-lock.yaml | 2480 +++++++++++++++++ .../config/config.json | 13 +- plugins/lib/sandbox-executor.ts | 89 +- 4 files changed, 2569 insertions(+), 15 deletions(-) create mode 100644 examples/channels-plugin-example/channel/pnpm-lock.yaml diff --git a/examples/channels-plugin-example/channel/package.json b/examples/channels-plugin-example/channel/package.json index dd48793c9..1c8c4865c 100644 --- a/examples/channels-plugin-example/channel/package.json +++ b/examples/channels-plugin-example/channel/package.json @@ -14,7 +14,7 @@ "license": "", "dependencies": { "@openzeppelin/relayer-plugin-channels": "^0.5.0", - "@openzeppelin/relayer-sdk": "^1.7.0" + "@openzeppelin/relayer-sdk": "^1.8.0" }, "devDependencies": { "@types/jest": "^29.5.12", diff --git a/examples/channels-plugin-example/channel/pnpm-lock.yaml b/examples/channels-plugin-example/channel/pnpm-lock.yaml new file mode 100644 index 000000000..f4f93fc2a --- /dev/null +++ b/examples/channels-plugin-example/channel/pnpm-lock.yaml @@ -0,0 +1,2480 @@ +--- +lockfileVersion: '9.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false +importers: + .: + dependencies: + '@openzeppelin/relayer-plugin-channels': + specifier: ^0.5.0 + version: 0.5.0 + '@openzeppelin/relayer-sdk': + specifier: ^1.8.0 + version: 1.8.0 + devDependencies: + '@types/jest': + specifier: ^29.5.12 + version: 29.5.14 + '@types/node': + specifier: ^24.0.3 + version: 24.10.9 + '@types/uuid': + specifier: ^10.0.0 + version: 10.0.0 + husky: + specifier: ^9.1.7 + version: 9.1.7 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + ts-jest: + specifier: ^29.1.2 + version: 29.4.6(@babel/core@7.28.6)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.6))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)))(typescript@5.9.3) + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@24.10.9)(typescript@5.9.3) + typescript: + specifier: ^5.3.3 + version: 5.9.3 +packages: + '@actions/exec@1.1.1': + resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} + '@actions/io@1.1.3': + resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==} + '@babel/code-frame@7.28.6': + resolution: {integrity: sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q==} + engines: {node: '>=6.9.0'} + '@babel/compat-data@7.28.6': + resolution: {integrity: sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg==} + engines: {node: '>=6.9.0'} + '@babel/core@7.28.6': + resolution: {integrity: sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw==} + engines: {node: '>=6.9.0'} + '@babel/generator@7.28.6': + resolution: {integrity: sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw==} + engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.28.6': + resolution: {integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==} + engines: {node: '>=6.9.0'} + '@babel/helper-globals@7.28.0': + resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} + engines: {node: '>=6.9.0'} + '@babel/helper-module-imports@7.28.6': + resolution: {integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==} + engines: {node: '>=6.9.0'} + '@babel/helper-module-transforms@7.28.6': + resolution: {integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/helper-plugin-utils@7.28.6': + resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} + engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} + engines: {node: '>=6.9.0'} + '@babel/helpers@7.28.6': + resolution: {integrity: sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==} + engines: {node: '>=6.9.0'} + '@babel/parser@7.28.6': + resolution: {integrity: sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==} + engines: {node: '>=6.0.0'} + hasBin: true + '@babel/plugin-syntax-async-generators@7.8.4': + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-bigint@7.8.3': + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-class-properties@7.12.13': + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-class-static-block@7.14.5': + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-attributes@7.28.6': + resolution: {integrity: sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-meta@7.10.4': + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-json-strings@7.8.3': + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-jsx@7.28.6': + resolution: {integrity: sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-numeric-separator@7.10.4': + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-object-rest-spread@7.8.3': + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-optional-catch-binding@7.8.3': + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-optional-chaining@7.8.3': + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-private-property-in-object@7.14.5': + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-top-level-await@7.14.5': + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-typescript@7.28.6': + resolution: {integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/template@7.28.6': + resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==} + engines: {node: '>=6.9.0'} + '@babel/traverse@7.28.6': + resolution: {integrity: sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg==} + engines: {node: '>=6.9.0'} + '@babel/types@7.28.6': + resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==} + engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@0.2.3': + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + '@istanbuljs/load-nyc-config@1.1.0': + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + '@istanbuljs/schema@0.1.3': + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + '@jest/console@29.7.0': + resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/core@29.7.0': + resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + '@jest/environment@29.7.0': + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/expect-utils@29.7.0': + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/expect@29.7.0': + resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/fake-timers@29.7.0': + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/globals@29.7.0': + resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/reporters@29.7.0': + resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + '@jest/schemas@29.6.3': + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/source-map@29.6.3': + resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/test-result@29.7.0': + resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/test-sequencer@29.7.0': + resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/transform@29.7.0': + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jest/types@29.6.3': + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@noble/curves@1.9.7': + resolution: {integrity: sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==} + engines: {node: ^14.21.3 || >=16} + '@noble/hashes@1.8.0': + resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} + engines: {node: ^14.21.3 || >=16} + '@openzeppelin/relayer-plugin-channels@0.5.0': + resolution: {integrity: sha512-mn8TklTFwwqKVVOjYQtJGGX/8IKJwg4hbwfAsz7kvb5L5EhjJzwCjgfT84TL6ZVmHb7DoQ6h2lPgNussDiHy5g==} + engines: {node: '>=22.18.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} + '@openzeppelin/relayer-sdk@1.8.0': + resolution: {integrity: sha512-2nMn9Sg0j52kp/GdhavvL8zgwRJqDqXq4yM1uYewfYndns6WGUS3zxcDICgHenMVURo8YWdJG7E7Ockck3SNFg==} + engines: {node: '>=22.14.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} + '@sinclair/typebox@0.27.8': + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + '@sinonjs/commons@3.0.1': + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + '@sinonjs/fake-timers@10.3.0': + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@stellar/js-xdr@3.1.2': + resolution: {integrity: sha512-VVolPL5goVEIsvuGqDc5uiKxV03lzfWdvYg1KikvwheDmTBO68CKDji3bAZ/kppZrx5iTA8z3Ld5yuytcvhvOQ==} + '@stellar/stellar-base@14.0.4': + resolution: {integrity: sha512-UbNW6zbdOBXJwLAV2mMak0bIC9nw3IZVlQXkv2w2dk1jgCbJjy3oRVC943zeGE5JAm0Z9PHxrIjmkpGhayY7kw==} + engines: {node: '>=20.0.0'} + '@stellar/stellar-sdk@14.4.3': + resolution: {integrity: sha512-QfaScSNd4Ku0GGfaZjR8679+M5gLHG+09OLLqV3Bv1VaDKXjHmhf8ikalz2jlx3oFnmlEpEgnqXIdf4kdD2x/w==} + engines: {node: '>=20.0.0'} + '@tsconfig/node10@1.0.12': + resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + '@types/graceful-fs@4.1.9': + resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + '@types/istanbul-reports@3.0.4': + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + '@types/jest@29.5.14': + resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + '@types/node@24.10.9': + resolution: {integrity: sha512-ne4A0IpG3+2ETuREInjPNhUGis1SFjv1d5asp8MzEAGtOZeTeHVDOYqOgqfhvseqg/iXty2hjBf1zAOb7RNiNw==} + '@types/stack-utils@2.0.3': + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/uuid@10.0.0': + resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + '@types/yargs@17.0.35': + resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + engines: {node: '>=0.4.0'} + hasBin: true + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + axios@1.13.2: + resolution: {integrity: sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==} + babel-jest@29.7.0: + resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + babel-plugin-istanbul@6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + babel-preset-current-node-syntax@1.2.0: + resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} + peerDependencies: + '@babel/core': ^7.0.0 || ^8.0.0-0 + babel-preset-jest@29.6.3: + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + base32.js@0.1.0: + resolution: {integrity: sha512-n3TkB02ixgBOhTvANakDb4xaMXnYUVkNoRFJjQflcqMQhyEKxEHdj3E6N8t8sUQ0mjH/3/JxzlXuz3ul/J90pQ==} + engines: {node: '>=0.12.0'} + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + baseline-browser-mapping@2.9.14: + resolution: {integrity: sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==} + hasBin: true + bignumber.js@9.3.1: + resolution: {integrity: sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==} + brace-expansion@1.1.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + browserslist@4.28.1: + resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + bs-logger@0.2.6: + resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} + engines: {node: '>= 6'} + bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + caniuse-lite@1.0.30001764: + resolution: {integrity: sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g==} + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + cjs-module-lexer@1.4.3: + resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + collect-v8-coverage@1.0.3: + resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + create-jest@29.7.0: + resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dedent@1.7.1: + resolution: {integrity: sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + electron-to-chromium@1.5.267: + resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} + emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + eventsource@2.0.2: + resolution: {integrity: sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==} + engines: {node: '>=12.0.0'} + execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + feaxios@0.0.23: + resolution: {integrity: sha512-eghR0A21fvbkcQBgZuMfQhrXxJzC0GNUGC9fXhBge33D+mFDTwl0aJ35zoQQn575BhyjQitRc5N4f+L4cP708g==} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + follow-redirects@1.15.11: + resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + for-each@0.3.5: + resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} + engines: {node: '>= 0.4'} + form-data@4.0.5: + resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} + engines: {node: '>= 6'} + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: + - darwin + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + handlebars@4.7.8: + resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + engines: {node: '>=0.4.7'} + hasBin: true + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} + hasBin: true + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + import-local@3.2.0: + resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + engines: {node: '>=8'} + hasBin: true + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + inflight@1.0.6: + resolution: {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. + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + engines: {node: '>= 0.4'} + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + is-generator-fn@2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} + engines: {node: '>=6'} + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + is-retry-allowed@3.0.0: + resolution: {integrity: sha512-9xH0xvoggby+u0uGF7cZXdrutWiBiaFG8ZT4YFPXL8NzkyAwX3AKGLeFQLvzDpM430+nDFBZ1LHkie/8ocL06A==} + engines: {node: '>=12'} + is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + istanbul-lib-instrument@5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + istanbul-lib-instrument@6.0.3: + resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} + engines: {node: '>=10'} + istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} + engines: {node: '>=8'} + jest-changed-files@29.7.0: + resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-circus@29.7.0: + resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-cli@29.7.0: + resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + jest-config@29.7.0: + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-docblock@29.7.0: + resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-each@29.7.0: + resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-environment-node@29.7.0: + resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-haste-map@29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-leak-detector@29.7.0: + resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-pnp-resolver@1.2.3: + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-resolve-dependencies@29.7.0: + resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-resolve@29.7.0: + resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-runner@29.7.0: + resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-runtime@29.7.0: + resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-snapshot@29.7.0: + resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-validate@29.7.0: + resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-watcher@29.7.0: + resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-worker@29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest@29.7.0: + resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-yaml@3.14.2: + resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} + hasBin: true + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + neo-async@2.6.2: + resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + node-releases@2.0.27: + resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} + engines: {node: '>= 6'} + pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + possible-typed-array-names@1.1.0: + resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} + engines: {node: '>= 0.4'} + pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + pure-rand@6.1.0: + resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + resolve.exports@2.0.3: + resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} + engines: {node: '>=10'} + resolve@1.22.11: + resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} + engines: {node: '>= 0.4'} + hasBin: true + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + semver@7.7.3: + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + engines: {node: '>=10'} + hasBin: true + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + sha.js@2.4.12: + resolution: {integrity: sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==} + engines: {node: '>= 0.10'} + hasBin: true + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + source-map-support@0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + string-length@4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + to-buffer@1.2.2: + resolution: {integrity: sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==} + engines: {node: '>= 0.4'} + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + toml@3.0.0: + resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} + ts-jest@29.4.6: + resolution: {integrity: sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==} + engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/transform': ^29.0.0 || ^30.0.0 + '@jest/types': ^29.0.0 || ^30.0.0 + babel-jest: ^29.0.0 || ^30.0.0 + esbuild: '*' + jest: ^29.0.0 || ^30.0.0 + jest-util: ^29.0.0 || ^30.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/transform': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + jest-util: + optional: true + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} + typed-array-buffer@1.0.3: + resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} + engines: {node: '>= 0.4'} + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + undici-types@7.16.0: + resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + urijs@1.19.11: + resolution: {integrity: sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==} + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + v8-to-istanbul@9.3.0: + resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} + engines: {node: '>=10.12.0'} + walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + which-typed-array@1.1.20: + resolution: {integrity: sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==} + engines: {node: '>= 0.4'} + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + wordwrap@1.0.0: + resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} +snapshots: + '@actions/exec@1.1.1': + dependencies: + '@actions/io': 1.1.3 + '@actions/io@1.1.3': {} + '@babel/code-frame@7.28.6': + dependencies: + '@babel/helper-validator-identifier': 7.28.5 + js-tokens: 4.0.0 + picocolors: 1.1.1 + '@babel/compat-data@7.28.6': {} + '@babel/core@7.28.6': + dependencies: + '@babel/code-frame': 7.28.6 + '@babel/generator': 7.28.6 + '@babel/helper-compilation-targets': 7.28.6 + '@babel/helper-module-transforms': 7.28.6(@babel/core@7.28.6) + '@babel/helpers': 7.28.6 + '@babel/parser': 7.28.6 + '@babel/template': 7.28.6 + '@babel/traverse': 7.28.6 + '@babel/types': 7.28.6 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + '@babel/generator@7.28.6': + dependencies: + '@babel/parser': 7.28.6 + '@babel/types': 7.28.6 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + '@babel/helper-compilation-targets@7.28.6': + dependencies: + '@babel/compat-data': 7.28.6 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.28.1 + lru-cache: 5.1.1 + semver: 6.3.1 + '@babel/helper-globals@7.28.0': {} + '@babel/helper-module-imports@7.28.6': + dependencies: + '@babel/traverse': 7.28.6 + '@babel/types': 7.28.6 + transitivePeerDependencies: + - supports-color + '@babel/helper-module-transforms@7.28.6(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-module-imports': 7.28.6 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.28.6 + transitivePeerDependencies: + - supports-color + '@babel/helper-plugin-utils@7.28.6': {} + '@babel/helper-string-parser@7.27.1': {} + '@babel/helper-validator-identifier@7.28.5': {} + '@babel/helper-validator-option@7.27.1': {} + '@babel/helpers@7.28.6': + dependencies: + '@babel/template': 7.28.6 + '@babel/types': 7.28.6 + '@babel/parser@7.28.6': + dependencies: + '@babel/types': 7.28.6 + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-import-attributes@7.28.6(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-jsx@7.28.6(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.28.6)': + dependencies: + '@babel/core': 7.28.6 + '@babel/helper-plugin-utils': 7.28.6 + '@babel/template@7.28.6': + dependencies: + '@babel/code-frame': 7.28.6 + '@babel/parser': 7.28.6 + '@babel/types': 7.28.6 + '@babel/traverse@7.28.6': + dependencies: + '@babel/code-frame': 7.28.6 + '@babel/generator': 7.28.6 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.28.6 + '@babel/template': 7.28.6 + '@babel/types': 7.28.6 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + '@babel/types@7.28.6': + dependencies: + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + '@bcoe/v8-coverage@0.2.3': {} + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + '@istanbuljs/load-nyc-config@1.1.0': + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.2 + resolve-from: 5.0.0 + '@istanbuljs/schema@0.1.3': {} + '@jest/console@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + chalk: 4.1.2 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + '@jest/environment@29.7.0': + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + jest-mock: 29.7.0 + '@jest/expect-utils@29.7.0': + dependencies: + jest-get-type: 29.6.3 + '@jest/expect@29.7.0': + dependencies: + expect: 29.7.0 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + '@jest/fake-timers@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 24.10.9 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + '@jest/globals@29.7.0': + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/types': 29.6.3 + jest-mock: 29.7.0 + transitivePeerDependencies: + - supports-color + '@jest/reporters@29.7.0': + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.31 + '@types/node': 24.10.9 + chalk: 4.1.2 + collect-v8-coverage: 1.0.3 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-instrument: 6.0.3 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.2.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + jest-worker: 29.7.0 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.3.0 + transitivePeerDependencies: + - supports-color + '@jest/schemas@29.6.3': + dependencies: + '@sinclair/typebox': 0.27.8 + '@jest/source-map@29.6.3': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + callsites: 3.1.0 + graceful-fs: 4.2.11 + '@jest/test-result@29.7.0': + dependencies: + '@jest/console': 29.7.0 + '@jest/types': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + collect-v8-coverage: 1.0.3 + '@jest/test-sequencer@29.7.0': + dependencies: + '@jest/test-result': 29.7.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + slash: 3.0.0 + '@jest/transform@29.7.0': + dependencies: + '@babel/core': 7.28.6 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.31 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + micromatch: 4.0.8 + pirates: 4.0.7 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + '@jest/types@29.6.3': + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 24.10.9 + '@types/yargs': 17.0.35 + chalk: 4.1.2 + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/resolve-uri@3.1.2': {} + '@jridgewell/sourcemap-codec@1.5.5': {} + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + '@noble/curves@1.9.7': + dependencies: + '@noble/hashes': 1.8.0 + '@noble/hashes@1.8.0': {} + '@openzeppelin/relayer-plugin-channels@0.5.0': + dependencies: + '@actions/exec': 1.1.1 + '@openzeppelin/relayer-sdk': 1.8.0 + '@stellar/stellar-sdk': 14.4.3 + axios: 1.13.2 + transitivePeerDependencies: + - debug + '@openzeppelin/relayer-sdk@1.8.0': + dependencies: + axios: 1.13.2 + transitivePeerDependencies: + - debug + '@sinclair/typebox@0.27.8': {} + '@sinonjs/commons@3.0.1': + dependencies: + type-detect: 4.0.8 + '@sinonjs/fake-timers@10.3.0': + dependencies: + '@sinonjs/commons': 3.0.1 + '@stellar/js-xdr@3.1.2': {} + '@stellar/stellar-base@14.0.4': + dependencies: + '@noble/curves': 1.9.7 + '@stellar/js-xdr': 3.1.2 + base32.js: 0.1.0 + bignumber.js: 9.3.1 + buffer: 6.0.3 + sha.js: 2.4.12 + '@stellar/stellar-sdk@14.4.3': + dependencies: + '@stellar/stellar-base': 14.0.4 + axios: 1.13.2 + bignumber.js: 9.3.1 + eventsource: 2.0.2 + feaxios: 0.0.23 + randombytes: 2.1.0 + toml: 3.0.0 + urijs: 1.19.11 + transitivePeerDependencies: + - debug + '@tsconfig/node10@1.0.12': {} + '@tsconfig/node12@1.0.11': {} + '@tsconfig/node14@1.0.3': {} + '@tsconfig/node16@1.0.4': {} + '@types/babel__core@7.20.5': + dependencies: + '@babel/parser': 7.28.6 + '@babel/types': 7.28.6 + '@types/babel__generator': 7.27.0 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.28.0 + '@types/babel__generator@7.27.0': + dependencies: + '@babel/types': 7.28.6 + '@types/babel__template@7.4.4': + dependencies: + '@babel/parser': 7.28.6 + '@babel/types': 7.28.6 + '@types/babel__traverse@7.28.0': + dependencies: + '@babel/types': 7.28.6 + '@types/graceful-fs@4.1.9': + dependencies: + '@types/node': 24.10.9 + '@types/istanbul-lib-coverage@2.0.6': {} + '@types/istanbul-lib-report@3.0.3': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports@3.0.4': + dependencies: + '@types/istanbul-lib-report': 3.0.3 + '@types/jest@29.5.14': + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + '@types/node@24.10.9': + dependencies: + undici-types: 7.16.0 + '@types/stack-utils@2.0.3': {} + '@types/uuid@10.0.0': {} + '@types/yargs-parser@21.0.3': {} + '@types/yargs@17.0.35': + dependencies: + '@types/yargs-parser': 21.0.3 + acorn-walk@8.3.4: + dependencies: + acorn: 8.15.0 + acorn@8.15.0: {} + ansi-escapes@4.3.2: + dependencies: + type-fest: 0.21.3 + ansi-regex@5.0.1: {} + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + ansi-styles@5.2.0: {} + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + arg@4.1.3: {} + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + asynckit@0.4.0: {} + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.1.0 + axios@1.13.2: + dependencies: + follow-redirects: 1.15.11 + form-data: 4.0.5 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + babel-jest@29.7.0(@babel/core@7.28.6): + dependencies: + '@babel/core': 7.28.6 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.5 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@7.28.6) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + babel-plugin-istanbul@6.1.1: + dependencies: + '@babel/helper-plugin-utils': 7.28.6 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + babel-plugin-jest-hoist@29.6.3: + dependencies: + '@babel/template': 7.28.6 + '@babel/types': 7.28.6 + '@types/babel__core': 7.20.5 + '@types/babel__traverse': 7.28.0 + babel-preset-current-node-syntax@1.2.0(@babel/core@7.28.6): + dependencies: + '@babel/core': 7.28.6 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.28.6) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.28.6) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.28.6) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.28.6) + '@babel/plugin-syntax-import-attributes': 7.28.6(@babel/core@7.28.6) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.28.6) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.28.6) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.28.6) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.28.6) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.28.6) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.28.6) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.28.6) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.28.6) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.28.6) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.28.6) + babel-preset-jest@29.6.3(@babel/core@7.28.6): + dependencies: + '@babel/core': 7.28.6 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.6) + balanced-match@1.0.2: {} + base32.js@0.1.0: {} + base64-js@1.5.1: {} + baseline-browser-mapping@2.9.14: {} + bignumber.js@9.3.1: {} + brace-expansion@1.1.12: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + browserslist@4.28.1: + dependencies: + baseline-browser-mapping: 2.9.14 + caniuse-lite: 1.0.30001764 + electron-to-chromium: 1.5.267 + node-releases: 2.0.27 + update-browserslist-db: 1.2.3(browserslist@4.28.1) + bs-logger@0.2.6: + dependencies: + fast-json-stable-stringify: 2.1.0 + bser@2.1.1: + dependencies: + node-int64: 0.4.0 + buffer-from@1.1.2: {} + buffer@6.0.3: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + get-intrinsic: 1.3.0 + set-function-length: 1.2.2 + call-bound@1.0.4: + dependencies: + call-bind-apply-helpers: 1.0.2 + get-intrinsic: 1.3.0 + callsites@3.1.0: {} + camelcase@5.3.1: {} + camelcase@6.3.0: {} + caniuse-lite@1.0.30001764: {} + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + char-regex@1.0.2: {} + ci-info@3.9.0: {} + cjs-module-lexer@1.4.3: {} + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + co@4.6.0: {} + collect-v8-coverage@1.0.3: {} + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + color-name@1.1.4: {} + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + concat-map@0.0.1: {} + convert-source-map@2.0.0: {} + create-jest@29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + create-require@1.1.1: {} + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + debug@4.4.3: + dependencies: + ms: 2.1.3 + dedent@1.7.1: {} + deepmerge@4.3.1: {} + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + delayed-stream@1.0.0: {} + detect-newline@3.1.0: {} + diff-sequences@29.6.3: {} + diff@4.0.2: {} + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + electron-to-chromium@1.5.267: {} + emittery@0.13.1: {} + emoji-regex@8.0.0: {} + error-ex@1.3.4: + dependencies: + is-arrayish: 0.2.1 + es-define-property@1.0.1: {} + es-errors@1.3.0: {} + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + escalade@3.2.0: {} + escape-string-regexp@2.0.0: {} + esprima@4.0.1: {} + eventsource@2.0.2: {} + execa@5.1.1: + dependencies: + cross-spawn: 7.0.6 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + exit@0.1.2: {} + expect@29.7.0: + dependencies: + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + fast-json-stable-stringify@2.1.0: {} + fb-watchman@2.0.2: + dependencies: + bser: 2.1.1 + feaxios@0.0.23: + dependencies: + is-retry-allowed: 3.0.0 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + follow-redirects@1.15.11: {} + for-each@0.3.5: + dependencies: + is-callable: 1.2.7 + form-data@4.0.5: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.2 + mime-types: 2.1.35 + fs.realpath@1.0.0: {} + fsevents@2.3.3: + optional: true + function-bind@1.1.2: {} + gensync@1.0.0-beta.2: {} + get-caller-file@2.0.5: {} + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + get-package-type@0.1.0: {} + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + get-stream@6.0.1: {} + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + gopd@1.2.0: {} + graceful-fs@4.2.11: {} + handlebars@4.7.8: + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.19.3 + has-flag@4.0.0: {} + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + has-symbols@1.1.0: {} + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + html-escaper@2.0.2: {} + human-signals@2.1.0: {} + husky@9.1.7: {} + ieee754@1.2.1: {} + import-local@3.2.0: + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + imurmurhash@0.1.4: {} + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + inherits@2.0.4: {} + is-arrayish@0.2.1: {} + is-callable@1.2.7: {} + is-core-module@2.16.1: + dependencies: + hasown: 2.0.2 + is-fullwidth-code-point@3.0.0: {} + is-generator-fn@2.1.0: {} + is-number@7.0.0: {} + is-retry-allowed@3.0.0: {} + is-stream@2.0.1: {} + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.20 + isarray@2.0.5: {} + isexe@2.0.0: {} + istanbul-lib-coverage@3.2.2: {} + istanbul-lib-instrument@5.2.1: + dependencies: + '@babel/core': 7.28.6 + '@babel/parser': 7.28.6 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + istanbul-lib-instrument@6.0.3: + dependencies: + '@babel/core': 7.28.6 + '@babel/parser': 7.28.6 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 7.7.3 + transitivePeerDependencies: + - supports-color + istanbul-lib-report@3.0.1: + dependencies: + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 + supports-color: 7.2.0 + istanbul-lib-source-maps@4.0.1: + dependencies: + debug: 4.4.3 + istanbul-lib-coverage: 3.2.2 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + istanbul-reports@3.2.0: + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + jest-changed-files@29.7.0: + dependencies: + execa: 5.1.1 + jest-util: 29.7.0 + p-limit: 3.1.0 + jest-circus@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + chalk: 4.1.2 + co: 4.6.0 + dedent: 1.7.1 + is-generator-fn: 2.1.0 + jest-each: 29.7.0 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + p-limit: 3.1.0 + pretty-format: 29.7.0 + pure-rand: 6.1.0 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + jest-cli@29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + jest-config@29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)): + dependencies: + '@babel/core': 7.28.6 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.28.6) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 24.10.9 + ts-node: 10.9.2(@types/node@24.10.9)(typescript@5.9.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + jest-diff@29.7.0: + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + jest-docblock@29.7.0: + dependencies: + detect-newline: 3.1.0 + jest-each@29.7.0: + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + jest-get-type: 29.6.3 + jest-util: 29.7.0 + pretty-format: 29.7.0 + jest-environment-node@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + jest-mock: 29.7.0 + jest-util: 29.7.0 + jest-get-type@29.6.3: {} + jest-haste-map@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/graceful-fs': 4.1.9 + '@types/node': 24.10.9 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 + micromatch: 4.0.8 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.3 + jest-leak-detector@29.7.0: + dependencies: + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + jest-matcher-utils@29.7.0: + dependencies: + chalk: 4.1.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + jest-message-util@29.7.0: + dependencies: + '@babel/code-frame': 7.28.6 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.3 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + jest-mock@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + jest-util: 29.7.0 + jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): + optionalDependencies: + jest-resolve: 29.7.0 + jest-regex-util@29.6.3: {} + jest-resolve-dependencies@29.7.0: + dependencies: + jest-regex-util: 29.6.3 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + jest-resolve@29.7.0: + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) + jest-util: 29.7.0 + jest-validate: 29.7.0 + resolve: 1.22.11 + resolve.exports: 2.0.3 + slash: 3.0.0 + jest-runner@29.7.0: + dependencies: + '@jest/console': 29.7.0 + '@jest/environment': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.11 + jest-docblock: 29.7.0 + jest-environment-node: 29.7.0 + jest-haste-map: 29.7.0 + jest-leak-detector: 29.7.0 + jest-message-util: 29.7.0 + jest-resolve: 29.7.0 + jest-runtime: 29.7.0 + jest-util: 29.7.0 + jest-watcher: 29.7.0 + jest-worker: 29.7.0 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + jest-runtime@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/globals': 29.7.0 + '@jest/source-map': 29.6.3 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + chalk: 4.1.2 + cjs-module-lexer: 1.4.3 + collect-v8-coverage: 1.0.3 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + jest-snapshot@29.7.0: + dependencies: + '@babel/core': 7.28.6 + '@babel/generator': 7.28.6 + '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.28.6) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.28.6) + '@babel/types': 7.28.6 + '@jest/expect-utils': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.6) + chalk: 4.1.2 + expect: 29.7.0 + graceful-fs: 4.2.11 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + natural-compare: 1.4.0 + pretty-format: 29.7.0 + semver: 7.7.3 + transitivePeerDependencies: + - supports-color + jest-util@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + jest-validate@29.7.0: + dependencies: + '@jest/types': 29.6.3 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.6.3 + leven: 3.1.0 + pretty-format: 29.7.0 + jest-watcher@29.7.0: + dependencies: + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 24.10.9 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.7.0 + string-length: 4.0.2 + jest-worker@29.7.0: + dependencies: + '@types/node': 24.10.9 + jest-util: 29.7.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + jest@29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + js-tokens@4.0.0: {} + js-yaml@3.14.2: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + jsesc@3.1.0: {} + json-parse-even-better-errors@2.3.1: {} + json5@2.2.3: {} + kleur@3.0.3: {} + leven@3.1.0: {} + lines-and-columns@1.2.4: {} + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + lodash.memoize@4.1.2: {} + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + make-dir@4.0.0: + dependencies: + semver: 7.7.3 + make-error@1.3.6: {} + makeerror@1.0.12: + dependencies: + tmpl: 1.0.5 + math-intrinsics@1.1.0: {} + merge-stream@2.0.0: {} + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mime-db@1.52.0: {} + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + mimic-fn@2.1.0: {} + minimatch@3.1.2: + dependencies: + brace-expansion: 1.1.12 + minimist@1.2.8: {} + ms@2.1.3: {} + natural-compare@1.4.0: {} + neo-async@2.6.2: {} + node-int64@0.4.0: {} + node-releases@2.0.27: {} + normalize-path@3.0.0: {} + npm-run-path@4.0.1: + dependencies: + path-key: 3.1.1 + once@1.4.0: + dependencies: + wrappy: 1.0.2 + onetime@5.1.2: + dependencies: + mimic-fn: 2.1.0 + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + p-limit@3.1.0: + dependencies: + yocto-queue: 0.1.0 + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + p-try@2.2.0: {} + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.28.6 + error-ex: 1.3.4 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + path-exists@4.0.0: {} + path-is-absolute@1.0.1: {} + path-key@3.1.1: {} + path-parse@1.0.7: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} + pirates@4.0.7: {} + pkg-dir@4.2.0: + dependencies: + find-up: 4.1.0 + possible-typed-array-names@1.1.0: {} + pretty-format@29.7.0: + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.3.1 + prompts@2.4.2: + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + proxy-from-env@1.1.0: {} + pure-rand@6.1.0: {} + randombytes@2.1.0: + dependencies: + safe-buffer: 5.2.1 + react-is@18.3.1: {} + require-directory@2.1.1: {} + resolve-cwd@3.0.0: + dependencies: + resolve-from: 5.0.0 + resolve-from@5.0.0: {} + resolve.exports@2.0.3: {} + resolve@1.22.11: + dependencies: + is-core-module: 2.16.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + safe-buffer@5.2.1: {} + semver@6.3.1: {} + semver@7.7.3: {} + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.3.0 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + sha.js@2.4.12: + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + to-buffer: 1.2.2 + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + shebang-regex@3.0.0: {} + signal-exit@3.0.7: {} + sisteransi@1.0.5: {} + slash@3.0.0: {} + source-map-support@0.5.13: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + source-map@0.6.1: {} + sprintf-js@1.0.3: {} + stack-utils@2.0.6: + dependencies: + escape-string-regexp: 2.0.0 + string-length@4.0.2: + dependencies: + char-regex: 1.0.2 + strip-ansi: 6.0.1 + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + strip-bom@4.0.0: {} + strip-final-newline@2.0.0: {} + strip-json-comments@3.1.1: {} + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + supports-color@8.1.1: + dependencies: + has-flag: 4.0.0 + supports-preserve-symlinks-flag@1.0.0: {} + test-exclude@6.0.0: + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + tmpl@1.0.5: {} + to-buffer@1.2.2: + dependencies: + isarray: 2.0.5 + safe-buffer: 5.2.1 + typed-array-buffer: 1.0.3 + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + toml@3.0.0: {} + ? ts-jest@29.4.6(@babel/core@7.28.6)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.6))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)))(typescript@5.9.3) + : dependencies: + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + handlebars: 4.7.8 + jest: 29.7.0(@types/node@24.10.9)(ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3)) + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.7.3 + type-fest: 4.41.0 + typescript: 5.9.3 + yargs-parser: 21.1.1 + optionalDependencies: + '@babel/core': 7.28.6 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.28.6) + jest-util: 29.7.0 + ts-node@10.9.2(@types/node@24.10.9)(typescript@5.9.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.12 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 24.10.9 + acorn: 8.15.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.9.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + type-detect@4.0.8: {} + type-fest@0.21.3: {} + type-fest@4.41.0: {} + typed-array-buffer@1.0.3: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + is-typed-array: 1.1.15 + typescript@5.9.3: {} + uglify-js@3.19.3: + optional: true + undici-types@7.16.0: {} + update-browserslist-db@1.2.3(browserslist@4.28.1): + dependencies: + browserslist: 4.28.1 + escalade: 3.2.0 + picocolors: 1.1.1 + urijs@1.19.11: {} + v8-compile-cache-lib@3.0.1: {} + v8-to-istanbul@9.3.0: + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@types/istanbul-lib-coverage': 2.0.6 + convert-source-map: 2.0.0 + walker@1.0.8: + dependencies: + makeerror: 1.0.12 + which-typed-array@1.1.20: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 + for-each: 0.3.5 + get-proto: 1.0.1 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + which@2.0.2: + dependencies: + isexe: 2.0.0 + wordwrap@1.0.0: {} + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrappy@1.0.2: {} + write-file-atomic@4.0.2: + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + y18n@5.0.8: {} + yallist@3.1.1: {} + yargs-parser@21.1.1: {} + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + yn@3.1.1: {} + yocto-queue@0.1.0: {} diff --git a/examples/channels-plugin-example/config/config.json b/examples/channels-plugin-example/config/config.json index 1b6df0b37..d87f87cee 100644 --- a/examples/channels-plugin-example/config/config.json +++ b/examples/channels-plugin-example/config/config.json @@ -8,7 +8,8 @@ "network_type": "stellar", "signer_id": "channels-fund-signer", "policies": { - "concurrent_transactions": true + "concurrent_transactions": true, + "fee_payment_strategy": "relayer" } }, { @@ -17,7 +18,10 @@ "network": "testnet", "paused": false, "network_type": "stellar", - "signer_id": "channel-001-signer" + "signer_id": "channel-001-signer", + "policies": { + "fee_payment_strategy": "relayer" + } }, { "id": "channel-002", @@ -25,7 +29,10 @@ "network": "testnet", "paused": false, "network_type": "stellar", - "signer_id": "channel-002-signer" + "signer_id": "channel-002-signer", + "policies": { + "fee_payment_strategy": "relayer" + } } ], "notifications": [], diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/sandbox-executor.ts index 994f09946..8763e28f6 100644 --- a/plugins/lib/sandbox-executor.ts +++ b/plugins/lib/sandbox-executor.ts @@ -806,10 +806,62 @@ export default async function executeInSandbox(task: SandboxTask): Promise require('crypto').getRandomValues(arr), }; + // Environment variables that should NEVER be exposed to plugins + // These contain secrets, credentials, or sensitive infrastructure details + const BLOCKED_ENV_PATTERNS = [ + // Authentication & API keys + 'API_KEY', + 'WEBHOOK_SIGNING_KEY', + 'STORAGE_ENCRYPTION_KEY', + 'KEYSTORE_PASSPHRASE', + 'REDIS_URL', + ]; + + // Create filtered environment - removes sensitive variables + const filteredEnv: Record = {}; + for (const [key, value] of Object.entries(process.env)) { + const upperKey = key.toUpperCase(); + const isBlocked = BLOCKED_ENV_PATTERNS.some(pattern => + upperKey === pattern.toUpperCase() || upperKey.includes(pattern.toUpperCase()) + ); + if (!isBlocked) { + filteredEnv[key] = value; + } + } + + // Safe process shim - exposes only non-dangerous properties + // Many libraries check for process existence or use safe properties + const safeProcess = { + nextTick: (callback: (...args: any[]) => void, ...args: any[]) => { + queueMicrotask(() => callback(...args)); + }, + version: process.version, + versions: { ...process.versions }, + platform: process.platform, + arch: process.arch, + browser: false, + // Filtered env access - sensitive variables are removed + env: filteredEnv, + // Block dangerous properties by throwing errors + get argv() { + throw new Error('process.argv is not available in sandbox for security'); + }, + exit: () => { + throw new Error('process.exit() is not available in sandbox for security'); + }, + cwd: () => { + throw new Error('process.cwd() is not available in sandbox for security'); + }, + chdir: () => { + throw new Error('process.chdir() is not available in sandbox for security'); + }, + kill: () => { + throw new Error('process.kill() is not available in sandbox for security'); + }, + }; + // Create sandboxRequire function const BLOCKED_MODULES = new Set([ - // Filesystem access - 'fs', 'fs/promises', 'node:fs', 'node:fs/promises', // Process/system control 'child_process', 'node:child_process', 'cluster', 'node:cluster', @@ -819,13 +871,6 @@ export default async function executeInSandbox(task: SandboxTask): Promise = { + // Expose only safe primitives that libraries commonly check for + Buffer, + setTimeout, + setInterval, + setImmediate, + clearTimeout, + clearInterval, + clearImmediate, + queueMicrotask, + console: sandboxConsole, + process: safeProcess, + }; + // Populate context with globals (reused context from pool) // SECURITY: Only expose safe globals. Never expose: - // - process (env vars, exit, argv) - // - fs, child_process, net, http (I/O) + // - process.argv, process.exit() (blocked via safe shim) // - eval, Function constructor (code execution) // - require for arbitrary modules + // global is an isolated mutable object (not raw globalThis) - safe for SDK usage + // NOTE: process.env is filtered - sensitive variables (API keys, passwords, etc.) are removed Object.assign(context, { // === Console for logging === console: sandboxConsole, + // === Node.js global compatibility === + global: safeGlobal, // Frozen safe global (prevents sandbox escapes) + process: safeProcess, // Safe process shim (filtered env, no argv/exit) + // === CommonJS module system === exports: moduleExports, require: sandboxRequire, From 5add2dd00db358ee6e701c97e7ef445d40ce2e6a Mon Sep 17 00:00:00 2001 From: Dylan Kilkenny Date: Fri, 16 Jan 2026 19:12:08 +0000 Subject: [PATCH 20/42] refactor: Simplify Stellar stuck Sent recovery logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace 5-min threshold with 30s resend timeout + 30-min max lifetime - Revert WORKER_TRANSACTION_SUBMIT_RETRIES to 1 (affects all networks) - Reorder checks: expired โ†’ max lifetime (more specific status first) - Remove signed_envelope_xdr check from submit handler - Fix Preconditions::V2 handling in extract_time_bounds - Fix max_time==0 (unbounded) handling in validation - Extract valid_until from XDR time_bounds at request time - Fix u64 to i64 cast with try_from --- src/constants/stellar_transaction.rs | 24 +- src/constants/worker.rs | 2 +- src/domain/transaction/stellar/status.rs | 308 ++++++++++--------- src/domain/transaction/stellar/submit.rs | 62 +++- src/domain/transaction/stellar/utils.rs | 6 +- src/domain/transaction/stellar/validation.rs | 11 +- src/models/transaction/repository.rs | 114 ++++++- 7 files changed, 363 insertions(+), 164 deletions(-) diff --git a/src/constants/stellar_transaction.rs b/src/constants/stellar_transaction.rs index 26a55c786..52be025e3 100644 --- a/src/constants/stellar_transaction.rs +++ b/src/constants/stellar_transaction.rs @@ -41,12 +41,20 @@ pub fn get_stellar_sponsored_transaction_validity_duration() -> Duration { } // Recovery thresholds -/// Threshold for detecting stuck Sent transactions (5 minutes) -/// If a transaction remains in Sent status longer than this without a hash, -/// the status checker will attempt recovery by re-enqueueing the submit job. -pub const STELLAR_STUCK_SENT_THRESHOLD_MINUTES: i64 = 5; - -/// Get stuck sent transaction threshold duration -pub fn get_stellar_stuck_sent_threshold() -> Duration { - Duration::minutes(STELLAR_STUCK_SENT_THRESHOLD_MINUTES) +/// Minimum time before re-queuing submit job for stuck Sent transactions (30 seconds) +/// Gives the original submit job time to complete before attempting recovery. +pub const STELLAR_RESEND_TIMEOUT_SECONDS: i64 = 30; + +/// Maximum lifetime for a Sent transaction before marking as Failed (30 minutes) +/// Safety net for transactions without time bounds - prevents infinite retries. +pub const STELLAR_MAX_SENT_LIFETIME_MINUTES: i64 = 30; + +/// Get resend timeout duration for stuck Sent transactions +pub fn get_stellar_resend_timeout() -> Duration { + Duration::seconds(STELLAR_RESEND_TIMEOUT_SECONDS) +} + +/// Get max sent lifetime duration +pub fn get_stellar_max_sent_lifetime() -> Duration { + Duration::minutes(STELLAR_MAX_SENT_LIFETIME_MINUTES) } diff --git a/src/constants/worker.rs b/src/constants/worker.rs index dcab8f40c..d9f1f753d 100644 --- a/src/constants/worker.rs +++ b/src/constants/worker.rs @@ -4,7 +4,7 @@ pub const WORKER_DEFAULT_MAXIMUM_RETRIES: usize = 5; pub const WORKER_TRANSACTION_REQUEST_RETRIES: usize = 5; // Transaction submission retry counts per command type -pub const WORKER_TRANSACTION_SUBMIT_RETRIES: usize = 3; // Fresh transaction submission (4 total attempts) +pub const WORKER_TRANSACTION_SUBMIT_RETRIES: usize = 1; // Fresh transaction submission pub const WORKER_TRANSACTION_RESUBMIT_RETRIES: usize = 1; // Gas price bump (status checker will retry) pub const WORKER_TRANSACTION_CANCEL_RETRIES: usize = 1; // Cancel/replacement (status checker will retry) pub const WORKER_TRANSACTION_RESEND_RETRIES: usize = 1; // Resend same transaction (status checker will retry) diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index 1f3c981dc..2e6678ffb 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -7,10 +7,12 @@ use soroban_rs::xdr::{Error, Hash, Limits, WriteXdr}; use tracing::{debug, info, warn}; use super::{is_final_state, StellarRelayerTransaction}; -use crate::constants::get_stellar_stuck_sent_threshold; +use crate::constants::{get_stellar_max_sent_lifetime, get_stellar_resend_timeout}; use crate::domain::transaction::stellar::prepare::common::send_submit_transaction_job; use crate::domain::transaction::stellar::utils::extract_return_value_from_meta; +use crate::domain::transaction::stellar::utils::extract_time_bounds; use crate::domain::transaction::util::get_age_since_created; +use crate::domain::xdr_utils::parse_transaction_xdr; use crate::{ domain::is_unsubmitted_transaction, jobs::JobProducerTrait, @@ -105,11 +107,31 @@ where return Err(e); } - // For unsubmitted transactions (Pending/Sent), check if stuck in Sent status + // Recover stuck Sent transactions if tx.status == TransactionStatus::Sent { if let Ok(age) = get_age_since_created(&tx) { - if age > get_stellar_stuck_sent_threshold() { - return self.recover_stuck_sent_transaction(tx).await; + if self.is_transaction_expired(&tx)? { + info!(tx_id = %tx.id, valid_until = ?tx.valid_until, "Sent transaction has expired"); + return self + .mark_as_expired(tx, "Transaction time_bounds expired".to_string()) + .await; + } + + if age > get_stellar_max_sent_lifetime() { + warn!(tx_id = %tx.id, age_minutes = age.num_minutes(), + "Sent transaction exceeded max lifetime, marking as Failed"); + return self + .mark_as_failed( + tx, + "Transaction stuck in Sent status for too long".to_string(), + ) + .await; + } + + if age > get_stellar_resend_timeout() { + info!(tx_id = %tx.id, age_seconds = age.num_seconds(), + "re-enqueueing submit job for stuck Sent transaction"); + send_submit_transaction_job(self.job_producer(), &tx, None).await?; } } } @@ -161,7 +183,7 @@ where } /// Mark a transaction as failed with a reason - async fn mark_as_failed( + pub(super) async fn mark_as_failed( &self, tx: TransactionRepoModel, reason: String, @@ -186,64 +208,66 @@ where Ok(failed_tx) } - /// Maximum number of recovery attempts for stuck Sent transactions - const MAX_RECOVERY_ATTEMPTS: u32 = 3; - - /// Recovers a transaction stuck in Sent status by re-enqueueing the submit job. - /// Uses noop_count to track recovery attempts and prevent infinite loops. - async fn recover_stuck_sent_transaction( + /// Mark a transaction as expired with a reason + pub(super) async fn mark_as_expired( &self, tx: TransactionRepoModel, + reason: String, ) -> Result { - let recovery_count = tx.noop_count.unwrap_or(0); - - // Prevent infinite re-enqueue loops - if recovery_count >= Self::MAX_RECOVERY_ATTEMPTS { - warn!( - tx_id = %tx.id, - recovery_count = recovery_count, - "max recovery attempts reached for stuck Sent transaction" - ); - return self - .mark_as_failed( - tx, - format!( - "Transaction stuck in Sent status - exceeded {} recovery attempts", - Self::MAX_RECOVERY_ATTEMPTS - ), - ) - .await; + info!(tx_id = %tx.id, reason = %reason, "marking transaction as expired"); + + let update_request = TransactionUpdateRequest { + status: Some(TransactionStatus::Expired), + status_reason: Some(reason), + ..Default::default() + }; + + let expired_tx = self + .finalize_transaction_state(tx.id.clone(), update_request) + .await?; + + // Try to enqueue next transaction + if let Err(e) = self.enqueue_next_pending_transaction(&tx.id).await { + warn!(error = %e, "failed to enqueue next pending transaction after expiration"); } - warn!( - tx_id = %tx.id, - recovery_count = recovery_count, - "recovering stuck Sent transaction" - ); + Ok(expired_tx) + } + /// Check if expired: valid_until > XDR time_bounds > false + pub(super) fn is_transaction_expired( + &self, + tx: &TransactionRepoModel, + ) -> Result { + if let Some(valid_until_str) = &tx.valid_until { + return Ok(Self::is_valid_until_string_expired(valid_until_str)); + } + + // Fallback: parse signed_envelope_xdr for legacy rows let stellar_data = tx.network_data.get_stellar_transaction_data()?; + if let Some(signed_xdr) = &stellar_data.signed_envelope_xdr { + if let Ok(envelope) = parse_transaction_xdr(signed_xdr, true) { + if let Some(tb) = extract_time_bounds(&envelope) { + if tb.max_time.0 == 0 { + return Ok(false); // unbounded + } + return Ok(Utc::now().timestamp() as u64 > tb.max_time.0); + } + } + } - if stellar_data.signed_envelope_xdr.is_some() { - // Increment recovery counter before re-enqueueing - let update_req = TransactionUpdateRequest { - noop_count: Some(recovery_count + 1), - ..Default::default() - }; - self.transaction_repository() - .partial_update(tx.id.clone(), update_req) - .await?; - - // Re-enqueue submit job - info!(tx_id = %tx.id, "re-enqueueing submit job for stuck transaction"); - send_submit_transaction_job(self.job_producer(), &tx, None).await?; - Ok(tx) - } else { - // No signed envelope - cannot submit, mark as failed - self.mark_as_failed( - tx, - "Transaction stuck in Sent status without signed envelope".to_string(), - ) - .await + Ok(false) + } + + /// Check if a valid_until string has expired (RFC3339 or numeric timestamp). + fn is_valid_until_string_expired(valid_until: &str) -> bool { + if let Ok(dt) = chrono::DateTime::parse_from_rfc3339(valid_until) { + return Utc::now() > dt.with_timezone(&Utc); + } + match valid_until.parse::() { + Ok(0) => false, + Ok(ts) => Utc::now().timestamp() > ts, + Err(_) => false, } } @@ -1164,37 +1188,24 @@ mod tests { } #[tokio::test] - async fn test_stuck_sent_transaction_with_signed_xdr_triggers_recovery() { - // Transaction in Sent status for > 5 minutes with signed XDR should re-enqueue submit + async fn test_stuck_sent_transaction_reenqueues_submit_job() { + // Transaction in Sent status for > 5 minutes should re-enqueue submit job + // The submit handler (not status checker) will handle signed XDR validation let relayer = create_test_relayer(); let mut mocks = default_test_mocks(); let mut tx = create_test_transaction(&relayer.id); tx.id = "tx-stuck-with-xdr".to_string(); tx.status = TransactionStatus::Sent; - tx.noop_count = Some(0); // Created 10 minutes ago - definitely stuck tx.created_at = (Utc::now() - Duration::minutes(10)).to_rfc3339(); - // No hash but has signed XDR + // No hash (simulating stuck state) if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { stellar_data.hash = None; stellar_data.signed_envelope_xdr = Some("AAAA...signed...".to_string()); } - // Should increment noop_count - mocks - .tx_repo - .expect_partial_update() - .withf(|_id, update| update.noop_count == Some(1)) - .times(1) - .returning(|id, _| { - let mut updated = create_test_transaction("test"); - updated.id = id; - updated.noop_count = Some(1); - Ok(updated) - }); - - // Should re-enqueue submit job + // Should re-enqueue submit job (idempotent - submit handler will validate) mocks .job_producer .expect_produce_submit_transaction_job() @@ -1202,34 +1213,37 @@ mod tests { .returning(|_, _| Box::pin(async { Ok(()) })); let handler = make_stellar_tx_handler(relayer.clone(), mocks); - let result = handler.handle_transaction_status_impl(tx).await; + let result = handler.handle_transaction_status_impl(tx.clone()).await; assert!(result.is_ok()); + let returned_tx = result.unwrap(); + // Transaction status unchanged - submit job will handle the actual submission + assert_eq!(returned_tx.status, TransactionStatus::Sent); } #[tokio::test] - async fn test_stuck_sent_transaction_without_signed_xdr_marks_failed() { - // Transaction in Sent status for > 5 minutes WITHOUT signed XDR should mark as Failed + async fn test_stuck_sent_transaction_expired_marks_expired() { + // Expired transaction should be marked as Expired let relayer = create_test_relayer(); let mut mocks = default_test_mocks(); let mut tx = create_test_transaction(&relayer.id); - tx.id = "tx-stuck-no-xdr".to_string(); + tx.id = "tx-expired".to_string(); tx.status = TransactionStatus::Sent; - tx.noop_count = Some(0); - // Created 10 minutes ago + // Created 10 minutes ago - definitely stuck tx.created_at = (Utc::now() - Duration::minutes(10)).to_rfc3339(); - // No hash AND no signed XDR + // Set valid_until to a past time (expired) + tx.valid_until = Some((Utc::now() - Duration::minutes(5)).to_rfc3339()); if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { stellar_data.hash = None; - stellar_data.signed_envelope_xdr = None; + stellar_data.signed_envelope_xdr = Some("AAAA...signed...".to_string()); } - // Should mark as Failed + // Should mark as Expired mocks .tx_repo .expect_partial_update() - .withf(|_id, update| update.status == Some(TransactionStatus::Failed)) + .withf(|_id, update| update.status == Some(TransactionStatus::Expired)) .times(1) .returning(|id, update| { let mut updated = create_test_transaction("test"); @@ -1239,7 +1253,13 @@ mod tests { Ok(updated) }); - // Notification for failure + // Should NOT try to re-enqueue submit job (expired) + mocks + .job_producer + .expect_produce_submit_transaction_job() + .never(); + + // Notification for expiration mocks .job_producer .expect_produce_send_notification_job() @@ -1256,75 +1276,77 @@ mod tests { let result = handler.handle_transaction_status_impl(tx).await; assert!(result.is_ok()); - let failed_tx = result.unwrap(); - assert_eq!(failed_tx.status, TransactionStatus::Failed); - assert!(failed_tx + let expired_tx = result.unwrap(); + assert_eq!(expired_tx.status, TransactionStatus::Expired); + assert!(expired_tx .status_reason .as_ref() .unwrap() - .contains("without signed envelope")); + .contains("expired")); } + } - #[tokio::test] - async fn test_stuck_sent_transaction_max_recovery_attempts_marks_failed() { - // Transaction at max recovery attempts should mark as Failed - let relayer = create_test_relayer(); - let mut mocks = default_test_mocks(); - - let mut tx = create_test_transaction(&relayer.id); - tx.id = "tx-max-recovery".to_string(); - tx.status = TransactionStatus::Sent; - tx.noop_count = Some(3); // Already at max (MAX_RECOVERY_ATTEMPTS = 3) - tx.created_at = (Utc::now() - Duration::minutes(10)).to_rfc3339(); - if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { - stellar_data.hash = None; - stellar_data.signed_envelope_xdr = Some("AAAA...signed...".to_string()); - } - - // Should mark as Failed (not try to re-enqueue) - mocks - .tx_repo - .expect_partial_update() - .withf(|_id, update| update.status == Some(TransactionStatus::Failed)) - .times(1) - .returning(|id, update| { - let mut updated = create_test_transaction("test"); - updated.id = id; - updated.status = update.status.unwrap(); - updated.status_reason = update.status_reason.clone(); - Ok(updated) - }); + mod is_valid_until_expired_tests { + use super::*; + use crate::{ + jobs::MockJobProducerTrait, + repositories::{ + MockRelayerRepository, MockTransactionCounterTrait, MockTransactionRepository, + }, + services::{ + provider::MockStellarProviderTrait, signer::MockSigner, + stellar_dex::MockStellarDexServiceTrait, + }, + }; + use chrono::{Duration, Utc}; + + // Type alias for testing static methods + type TestHandler = StellarRelayerTransaction< + MockRelayerRepository, + MockTransactionRepository, + MockJobProducerTrait, + MockSigner, + MockStellarProviderTrait, + MockTransactionCounterTrait, + MockStellarDexServiceTrait, + >; + + #[test] + fn test_rfc3339_expired() { + let past = (Utc::now() - Duration::hours(1)).to_rfc3339(); + assert!(TestHandler::is_valid_until_string_expired(&past)); + } - // Should NOT try to re-enqueue submit job - mocks - .job_producer - .expect_produce_submit_transaction_job() - .never(); + #[test] + fn test_rfc3339_not_expired() { + let future = (Utc::now() + Duration::hours(1)).to_rfc3339(); + assert!(!TestHandler::is_valid_until_string_expired(&future)); + } - // Notification for failure - mocks - .job_producer - .expect_produce_send_notification_job() - .times(1) - .returning(|_, _| Box::pin(async { Ok(()) })); + #[test] + fn test_numeric_timestamp_expired() { + let past_timestamp = (Utc::now() - Duration::hours(1)).timestamp().to_string(); + assert!(TestHandler::is_valid_until_string_expired(&past_timestamp)); + } - // Try to enqueue next pending - mocks - .tx_repo - .expect_find_by_status() - .returning(|_, _| Ok(vec![])); + #[test] + fn test_numeric_timestamp_not_expired() { + let future_timestamp = (Utc::now() + Duration::hours(1)).timestamp().to_string(); + assert!(!TestHandler::is_valid_until_string_expired( + &future_timestamp + )); + } - let handler = make_stellar_tx_handler(relayer.clone(), mocks); - let result = handler.handle_transaction_status_impl(tx).await; + #[test] + fn test_zero_timestamp_unbounded() { + // Zero means unbounded in Stellar + assert!(!TestHandler::is_valid_until_string_expired("0")); + } - assert!(result.is_ok()); - let failed_tx = result.unwrap(); - assert_eq!(failed_tx.status, TransactionStatus::Failed); - assert!(failed_tx - .status_reason - .as_ref() - .unwrap() - .contains("exceeded 3 recovery attempts")); + #[test] + fn test_invalid_format_not_expired() { + // Invalid format should be treated as not expired (conservative) + assert!(!TestHandler::is_valid_until_string_expired("not-a-date")); } } } diff --git a/src/domain/transaction/stellar/submit.rs b/src/domain/transaction/stellar/submit.rs index 2c96cf643..c70111fb8 100644 --- a/src/domain/transaction/stellar/submit.rs +++ b/src/domain/transaction/stellar/submit.rs @@ -5,7 +5,7 @@ use chrono::Utc; use tracing::{info, warn}; -use super::{is_final_state, utils::is_bad_sequence_error, StellarRelayerTransaction}; +use super::{utils::is_bad_sequence_error, StellarRelayerTransaction}; use crate::{ constants::STELLAR_BAD_SEQUENCE_RETRY_DELAY_SECONDS, jobs::JobProducerTrait, @@ -30,22 +30,38 @@ where { /// Main submission method with robust error handling. /// Unlike prepare, submit doesn't claim lanes but still needs proper error handling. + /// + /// This method is idempotent - it only submits if the transaction is in Sent status. + /// Multiple submit jobs can be safely queued; only the first one to run will submit. pub async fn submit_transaction_impl( &self, tx: TransactionRepoModel, ) -> Result { info!(tx_id = %tx.id, status = ?tx.status, "submitting stellar transaction"); - // Defensive check: if transaction is in a final state or unexpected state, don't retry - if is_final_state(&tx.status) { - warn!( + // Idempotency check: only submit if transaction is in Sent status + // This allows multiple submit jobs to be queued safely + if tx.status != TransactionStatus::Sent { + info!( tx_id = %tx.id, status = ?tx.status, - "transaction already in final state, skipping submission" + "transaction not in Sent status, skipping submission" ); return Ok(tx); } + // Check if transaction has expired before attempting submission + if self.is_transaction_expired(&tx)? { + info!( + tx_id = %tx.id, + valid_until = ?tx.valid_until, + "transaction has expired, marking as Expired" + ); + return self + .mark_as_expired(tx, "Transaction time_bounds expired".to_string()) + .await; + } + // Call core submission logic with error handling match self.submit_core(tx.clone()).await { Ok(submitted_tx) => Ok(submitted_tx), @@ -238,14 +254,37 @@ mod tests { let handler = make_stellar_tx_handler(relayer.clone(), mocks); let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Sent; // Must be Sent for idempotent submit if let NetworkTransactionData::Stellar(ref mut d) = tx.network_data { d.signatures.push(dummy_signature()); + d.signed_envelope_xdr = Some(create_signed_xdr(TEST_PK, TEST_PK_2)); + // Valid XDR } let res = handler.submit_transaction_impl(tx).await.unwrap(); assert_eq!(res.status, TransactionStatus::Submitted); } + #[tokio::test] + async fn submit_transaction_skips_non_sent_status() { + let relayer = create_test_relayer(); + let mocks = default_test_mocks(); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + + // Transaction in Pending status should be skipped + let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Pending; + + let res = handler.submit_transaction_impl(tx.clone()).await.unwrap(); + assert_eq!(res.status, TransactionStatus::Pending); // Unchanged + + // Transaction in Submitted status should be skipped + tx.status = TransactionStatus::Submitted; + let res = handler.submit_transaction_impl(tx.clone()).await.unwrap(); + assert_eq!(res.status, TransactionStatus::Submitted); // Unchanged + } + #[tokio::test] async fn submit_transaction_provider_error_marks_failed() { let relayer = create_test_relayer(); @@ -283,9 +322,11 @@ mod tests { let handler = make_stellar_tx_handler(relayer.clone(), mocks); let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Sent; // Must be Sent for idempotent submit if let NetworkTransactionData::Stellar(ref mut data) = tx.network_data { data.signatures.push(dummy_signature()); data.sequence_number = Some(42); // Set sequence number + data.signed_envelope_xdr = Some("test-xdr".to_string()); // Required for submission } let res = handler.submit_transaction_impl(tx).await; @@ -340,9 +381,11 @@ mod tests { let handler = make_stellar_tx_handler(relayer.clone(), mocks); let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Sent; // Must be Sent for idempotent submit if let NetworkTransactionData::Stellar(ref mut data) = tx.network_data { data.signatures.push(dummy_signature()); data.sequence_number = Some(42); // Set sequence number + data.signed_envelope_xdr = Some("test-xdr".to_string()); // Required for submission } let res = handler.submit_transaction_impl(tx).await; @@ -358,6 +401,7 @@ mod tests { // Create a transaction with signed_envelope_xdr set let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Sent; // Must be Sent for idempotent submit if let NetworkTransactionData::Stellar(ref mut data) = tx.network_data { data.signatures.push(dummy_signature()); // Build and store the signed envelope XDR @@ -432,8 +476,11 @@ mod tests { let handler = make_stellar_tx_handler(relayer.clone(), mocks); let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Sent; // Must be Sent for idempotent submit if let NetworkTransactionData::Stellar(ref mut d) = tx.network_data { d.signatures.push(dummy_signature()); + d.signed_envelope_xdr = Some(create_signed_xdr(TEST_PK, TEST_PK_2)); + // Valid XDR } let res = handler.resubmit_transaction_impl(tx).await.unwrap(); @@ -496,9 +543,11 @@ mod tests { let handler = make_stellar_tx_handler(relayer.clone(), mocks); let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Sent; // Must be Sent for idempotent submit if let NetworkTransactionData::Stellar(ref mut data) = tx.network_data { data.signatures.push(dummy_signature()); data.sequence_number = Some(42); // Set sequence number + data.signed_envelope_xdr = Some("test-xdr".to_string()); // Required for submission } let res = handler.submit_transaction_impl(tx).await; @@ -581,9 +630,12 @@ mod tests { let handler = make_stellar_tx_handler(relayer.clone(), mocks); let mut tx = create_test_transaction(&relayer.id); + tx.status = TransactionStatus::Sent; // Must be Sent for idempotent submit if let NetworkTransactionData::Stellar(ref mut data) = tx.network_data { data.signatures.push(dummy_signature()); data.sequence_number = Some(42); + data.signed_envelope_xdr = Some(create_signed_xdr(TEST_PK, TEST_PK_2)); + // Valid XDR } let result = handler.submit_transaction_impl(tx).await; diff --git a/src/domain/transaction/stellar/utils.rs b/src/domain/transaction/stellar/utils.rs index 1ee508e73..a3ea768fb 100644 --- a/src/domain/transaction/stellar/utils.rs +++ b/src/domain/transaction/stellar/utils.rs @@ -1087,7 +1087,8 @@ pub fn extract_time_bounds(envelope: &TransactionEnvelope) -> Option<&TimeBounds TransactionEnvelope::TxV0(e) => e.tx.time_bounds.as_ref(), TransactionEnvelope::Tx(e) => match &e.tx.cond { Preconditions::Time(tb) => Some(tb), - _ => None, + Preconditions::V2(v2) => v2.time_bounds.as_ref(), + Preconditions::None => None, }, TransactionEnvelope::TxFeeBump(fb) => { // Extract from inner transaction @@ -1095,7 +1096,8 @@ pub fn extract_time_bounds(envelope: &TransactionEnvelope) -> Option<&TimeBounds soroban_rs::xdr::FeeBumpTransactionInnerTx::Tx(inner_tx) => { match &inner_tx.tx.cond { Preconditions::Time(tb) => Some(tb), - _ => None, + Preconditions::V2(v2) => v2.time_bounds.as_ref(), + Preconditions::None => None, } } } diff --git a/src/domain/transaction/stellar/validation.rs b/src/domain/transaction/stellar/validation.rs index 53448ff75..b6c27fff5 100644 --- a/src/domain/transaction/stellar/validation.rs +++ b/src/domain/transaction/stellar/validation.rs @@ -811,7 +811,8 @@ impl StellarTransactionValidator { let max_time = bounds.max_time.0; // Check if transaction has expired - if now > max_time { + // max_time == 0 means unbounded in Stellar (no upper limit) + if max_time != 0 && now > max_time { return Err(StellarTransactionValidationError::ValidationError(format!( "Transaction has expired: max_time={max_time}, current_time={now}" ))); @@ -849,6 +850,14 @@ impl StellarTransactionValidator { let time_bounds = extract_time_bounds(envelope); if let Some(bounds) = time_bounds { + // max_time == 0 means unbounded in Stellar (no upper limit) + // For duration validation, we require a bounded max_time + if bounds.max_time.0 == 0 { + return Err(StellarTransactionValidationError::ValidationError( + "Transaction has unbounded validity (max_time=0), but bounded validity is required".to_string(), + )); + } + let max_time = DateTime::from_timestamp(bounds.max_time.0 as i64, 0).ok_or_else(|| { StellarTransactionValidationError::ValidationError( diff --git a/src/models/transaction/repository.rs b/src/models/transaction/repository.rs index 628f396ba..79cd4fb1c 100644 --- a/src/models/transaction/repository.rs +++ b/src/models/transaction/repository.rs @@ -4,10 +4,12 @@ use crate::{ constants::{ DEFAULT_GAS_LIMIT, DEFAULT_TRANSACTION_SPEED, FINAL_TRANSACTION_STATUSES, STELLAR_DEFAULT_MAX_FEE, STELLAR_DEFAULT_TRANSACTION_FEE, + STELLAR_SPONSORED_TRANSACTION_VALIDITY_MINUTES, }, domain::{ evm::PriceParams, stellar::validation::{validate_operations, validate_soroban_memo_restriction}, + transaction::stellar::utils::extract_time_bounds, xdr_utils::{is_signed, parse_transaction_xdr}, SignTransactionResponseEvm, }, @@ -802,6 +804,35 @@ impl StellarTransactionData { } } +/// Extract valid_until: request > XDR time_bounds > default (for operations) > None (for XDR) +fn extract_stellar_valid_until( + stellar_request: &StellarTransactionRequest, + now: chrono::DateTime, +) -> Option { + if let Some(vu) = &stellar_request.valid_until { + return Some(vu.clone()); + } + + if let Some(xdr) = &stellar_request.transaction_xdr { + if let Ok(envelope) = parse_transaction_xdr(xdr, false) { + if let Some(tb) = extract_time_bounds(&envelope) { + if tb.max_time.0 == 0 { + return None; // unbounded + } + if let Ok(timestamp) = i64::try_from(tb.max_time.0) { + if let Some(dt) = chrono::DateTime::from_timestamp(timestamp, 0) { + return Some(dt.to_rfc3339()); + } + } + } + } + return None; + } + + let default = now + Duration::minutes(STELLAR_SPONSORED_TRANSACTION_VALIDITY_MINUTES); + Some(default.to_rfc3339()) +} + impl TryFrom<( &NetworkTransactionRequest, @@ -881,11 +912,12 @@ impl // Store the source account before consuming the request let source_account = stellar_request.source_account.clone(); - // Create the TransactionData before consuming the request + let valid_until = extract_stellar_valid_until(stellar_request, Utc::now()); + let stellar_data = StellarTransactionData { source_account: source_account.unwrap_or_else(|| relayer_model.address.clone()), memo: stellar_request.memo.clone(), - valid_until: stellar_request.valid_until.clone(), + valid_until: valid_until.clone(), network_passphrase: StellarNetwork::try_from(network_model.clone())?.passphrase, signatures: Vec::new(), hash: None, @@ -906,7 +938,7 @@ impl created_at: now, sent_at: None, confirmed_at: None, - valid_until: None, + valid_until, delete_at: None, network_type: NetworkType::Stellar, network_data: NetworkTransactionData::Stellar(stellar_data), @@ -1881,7 +1913,11 @@ mod tests { assert_eq!(transaction.relayer_id, relayer_model.id); assert_eq!(transaction.status, TransactionStatus::Pending); assert_eq!(transaction.network_type, NetworkType::Stellar); - assert_eq!(transaction.valid_until, None); + // valid_until should be set from the request + assert_eq!( + transaction.valid_until, + Some("2024-12-31T23:59:59Z".to_string()) + ); if let NetworkTransactionData::Stellar(stellar_data) = transaction.network_data { assert_eq!( @@ -3146,4 +3182,74 @@ mod tests { assert_eq!(transaction.is_canceled, original_transaction.is_canceled); assert_eq!(transaction.delete_at, original_transaction.delete_at); } + + mod extract_stellar_valid_until_tests { + use super::*; + use crate::models::transaction::request::stellar::StellarTransactionRequest; + use chrono::{Duration, Utc}; + + fn make_stellar_request( + valid_until: Option, + transaction_xdr: Option, + ) -> StellarTransactionRequest { + StellarTransactionRequest { + source_account: Some( + "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF".to_string(), + ), + network: "testnet".to_string(), + operations: Some(vec![OperationSpec::Payment { + destination: "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF" + .to_string(), + amount: 1000000, + asset: AssetSpec::Native, + }]), + memo: None, + valid_until, + transaction_xdr, + fee_bump: None, + max_fee: None, + } + } + + #[test] + fn test_with_explicit_valid_until_from_request() { + let request = make_stellar_request(Some("2025-12-31T23:59:59Z".to_string()), None); + let now = Utc::now(); + + let result = extract_stellar_valid_until(&request, now); + + assert_eq!(result, Some("2025-12-31T23:59:59Z".to_string())); + } + + #[test] + fn test_operations_without_valid_until_uses_default() { + let request = make_stellar_request(None, None); + let now = Utc::now(); + + let result = extract_stellar_valid_until(&request, now); + + // Should be now + STELLAR_SPONSORED_TRANSACTION_VALIDITY_MINUTES (2 min) + assert!(result.is_some()); + let valid_until = result.unwrap(); + let parsed = chrono::DateTime::parse_from_rfc3339(&valid_until).unwrap(); + let expected_min = now + Duration::minutes(1); + let expected_max = now + Duration::minutes(3); + assert!(parsed.with_timezone(&Utc) > expected_min); + assert!(parsed.with_timezone(&Utc) < expected_max); + } + + #[test] + fn test_xdr_without_time_bounds_returns_none() { + // Create a minimal unsigned XDR without time bounds + // This is a base64 encoded transaction envelope without time bounds + // For simplicity, we'll test with invalid XDR which should also return None + let request = make_stellar_request(None, Some("invalid_xdr".to_string())); + let now = Utc::now(); + + let result = extract_stellar_valid_until(&request, now); + + // XDR parse failed or no time_bounds - should return None (unbounded) + assert!(result.is_none()); + } + } } From 2398215e1d0016d2143a0c87a35a0e664873085a Mon Sep 17 00:00:00 2001 From: Dylan Kilkenny Date: Fri, 16 Jan 2026 19:27:02 +0000 Subject: [PATCH 21/42] refactor: Revert to is_final_state check Revert the strict Sent-only idempotency check back to the original is_final_state check. Keep the expiry check before submission. --- src/domain/transaction/stellar/submit.rs | 34 ++++-------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/src/domain/transaction/stellar/submit.rs b/src/domain/transaction/stellar/submit.rs index c70111fb8..f2a921378 100644 --- a/src/domain/transaction/stellar/submit.rs +++ b/src/domain/transaction/stellar/submit.rs @@ -5,7 +5,7 @@ use chrono::Utc; use tracing::{info, warn}; -use super::{utils::is_bad_sequence_error, StellarRelayerTransaction}; +use super::{is_final_state, utils::is_bad_sequence_error, StellarRelayerTransaction}; use crate::{ constants::STELLAR_BAD_SEQUENCE_RETRY_DELAY_SECONDS, jobs::JobProducerTrait, @@ -30,22 +30,18 @@ where { /// Main submission method with robust error handling. /// Unlike prepare, submit doesn't claim lanes but still needs proper error handling. - /// - /// This method is idempotent - it only submits if the transaction is in Sent status. - /// Multiple submit jobs can be safely queued; only the first one to run will submit. pub async fn submit_transaction_impl( &self, tx: TransactionRepoModel, ) -> Result { info!(tx_id = %tx.id, status = ?tx.status, "submitting stellar transaction"); - // Idempotency check: only submit if transaction is in Sent status - // This allows multiple submit jobs to be queued safely - if tx.status != TransactionStatus::Sent { - info!( + // Defensive check: if transaction is in a final state or unexpected state, don't retry + if is_final_state(&tx.status) { + warn!( tx_id = %tx.id, status = ?tx.status, - "transaction not in Sent status, skipping submission" + "transaction already in final state, skipping submission" ); return Ok(tx); } @@ -265,26 +261,6 @@ mod tests { assert_eq!(res.status, TransactionStatus::Submitted); } - #[tokio::test] - async fn submit_transaction_skips_non_sent_status() { - let relayer = create_test_relayer(); - let mocks = default_test_mocks(); - - let handler = make_stellar_tx_handler(relayer.clone(), mocks); - - // Transaction in Pending status should be skipped - let mut tx = create_test_transaction(&relayer.id); - tx.status = TransactionStatus::Pending; - - let res = handler.submit_transaction_impl(tx.clone()).await.unwrap(); - assert_eq!(res.status, TransactionStatus::Pending); // Unchanged - - // Transaction in Submitted status should be skipped - tx.status = TransactionStatus::Submitted; - let res = handler.submit_transaction_impl(tx.clone()).await.unwrap(); - assert_eq!(res.status, TransactionStatus::Submitted); // Unchanged - } - #[tokio::test] async fn submit_transaction_provider_error_marks_failed() { let relayer = create_test_relayer(); From 363169c226436f153770cff276b21177c520d7e9 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sat, 17 Jan 2026 02:13:50 +0100 Subject: [PATCH 22/42] chore: Remove sandboxed executuon logic --- .gitignore | 4 +- build.rs | 22 +- docs/plugins/index.mdx | 2 +- .../channel/package.json | 2 +- plugins/ARCHITECTURE.md | 4 +- plugins/lib/build-executor.ts | 26 +- ...sandbox-executor.ts => direct-executor.ts} | 381 +++--------------- plugins/lib/worker-pool.ts | 30 +- ...ecutor.test.ts => direct-executor.test.ts} | 78 ++-- 9 files changed, 131 insertions(+), 418 deletions(-) rename plugins/lib/{sandbox-executor.ts => direct-executor.ts} (70%) rename plugins/tests/lib/{sandbox-executor.test.ts => direct-executor.test.ts} (93%) diff --git a/.gitignore b/.gitignore index 392c3e705..5c8ab9440 100644 --- a/.gitignore +++ b/.gitignore @@ -71,11 +71,11 @@ test-results/ **/*lcov.info # Pre-compiled plugin executor (generated at build time) -plugins/lib/sandbox-executor.js +plugins/lib/direct-executor.js # Build executor cache files plugins/lib/.build-cache-hash -plugins/lib/sandbox-executor.js.sha256 +plugins/lib/direct-executor.js.sha256 # TypeScript compiled output in plugins (we use ts-node for runtime) plugins/**/*.js diff --git a/build.rs b/build.rs index 1439e86fd..05ced7ef2 100644 --- a/build.rs +++ b/build.rs @@ -9,11 +9,11 @@ fn main() { } let node_modules = plugins_dir.join("node_modules"); - let sandbox_executor_ts = plugins_dir.join("lib/sandbox-executor.ts"); - let sandbox_executor_js = plugins_dir.join("lib/sandbox-executor.js"); + let direct_executor_ts = plugins_dir.join("lib/direct-executor.ts"); + let direct_executor_js = plugins_dir.join("lib/direct-executor.js"); // Tell Cargo when to rerun this script - println!("cargo:rerun-if-changed=plugins/lib/sandbox-executor.ts"); + println!("cargo:rerun-if-changed=plugins/lib/direct-executor.ts"); println!("cargo:rerun-if-changed=plugins/package.json"); // Check if pnpm is available @@ -49,14 +49,14 @@ fn main() { } } - // Build sandbox-executor if source is newer than output (or output missing) - let needs_build = if !sandbox_executor_js.exists() { + // Build direct-executor if source is newer than output (or output missing) + let needs_build = if !direct_executor_js.exists() { true } else { // Compare modification times match ( - sandbox_executor_ts.metadata().and_then(|m| m.modified()), - sandbox_executor_js.metadata().and_then(|m| m.modified()), + direct_executor_ts.metadata().and_then(|m| m.modified()), + direct_executor_js.metadata().and_then(|m| m.modified()), ) { (Ok(src_time), Ok(out_time)) => src_time > out_time, _ => true, // Rebuild if we can't determine @@ -64,7 +64,7 @@ fn main() { }; if needs_build { - println!("cargo:warning=Building sandbox-executor..."); + println!("cargo:warning=Building direct-executor..."); let output = Command::new("pnpm") .arg("run") .arg("build") @@ -73,14 +73,14 @@ fn main() { match output { Ok(output) if output.status.success() => { - println!("cargo:warning=โœ“ sandbox-executor built successfully"); + println!("cargo:warning=โœ“ direct-executor built successfully"); } Ok(output) => { let stderr = String::from_utf8_lossy(&output.stderr); - println!("cargo:warning=sandbox-executor build failed: {stderr}"); + println!("cargo:warning=direct-executor build failed: {stderr}"); } Err(e) => { - println!("cargo:warning=Failed to build sandbox-executor: {e}"); + println!("cargo:warning=Failed to build direct-executor: {e}"); } } } diff --git a/docs/plugins/index.mdx b/docs/plugins/index.mdx index 2876cb1b1..b6646a6a2 100644 --- a/docs/plugins/index.mdx +++ b/docs/plugins/index.mdx @@ -919,5 +919,5 @@ The architecture documentation covers: | **Pool Executor** | `src/services/plugins/pool_executor.rs` | Manages Node.js process and connections | | **Configuration** | `src/services/plugins/config.rs` | Auto-derivation logic for all env vars | | **Pool Server** | `plugins/lib/pool-server.ts` | Node.js server accepting plugin requests | -| **Sandbox Executor** | `plugins/lib/sandbox-executor.ts` | VM-based plugin execution with security | +| **Executor** | `plugins/lib/direct-executor.ts` | Plugin execution | | **Plugin SDK** | `plugins/lib/plugin.ts` | PluginContext and API for plugins | diff --git a/examples/channels-plugin-example/channel/package.json b/examples/channels-plugin-example/channel/package.json index 1c8c4865c..c026db6ae 100644 --- a/examples/channels-plugin-example/channel/package.json +++ b/examples/channels-plugin-example/channel/package.json @@ -14,7 +14,7 @@ "license": "", "dependencies": { "@openzeppelin/relayer-plugin-channels": "^0.5.0", - "@openzeppelin/relayer-sdk": "^1.8.0" + "@openzeppelin/relayer-sdk": "^1.9.0" }, "devDependencies": { "@types/jest": "^29.5.12", diff --git a/plugins/ARCHITECTURE.md b/plugins/ARCHITECTURE.md index 0a5b35179..9ac528e03 100644 --- a/plugins/ARCHITECTURE.md +++ b/plugins/ARCHITECTURE.md @@ -57,7 +57,7 @@ Developer guide for understanding and modifying the plugin execution system. |--------|---------| | `pool-server.ts` | Main server - accepts connections, routes to workers, manages memory | | `worker-pool.ts` | Piscina wrapper with dynamic scaling and cache management | -| `sandbox-executor.ts` | VM-based plugin execution with security restrictions | +| `direct-executor.ts` | Plugin execution | | `compiler.ts` | TypeScript/JavaScript compilation with esbuild | | `plugin.ts` | Plugin SDK (PluginContext, PluginAPI) | | `kv.ts` | Redis-backed key-value store for plugins | @@ -129,7 +129,7 @@ Per-request socket at `/tmp/relayer-shared-{uuid}.sock` for plugin API calls. โ”‚ 5. pool-server routes to Piscina worker โ”‚ -6. sandbox-executor.ts runs plugin in VM +6. direct-executor.ts runs plugin in VM โ”‚ โ”œโ”€ Plugin calls api.useRelayer().sendTransaction() โ”‚ โ””โ”€ Communicates via shared socket to Rust diff --git a/plugins/lib/build-executor.ts b/plugins/lib/build-executor.ts index 53f4bf4ef..3a176a8b3 100644 --- a/plugins/lib/build-executor.ts +++ b/plugins/lib/build-executor.ts @@ -1,8 +1,8 @@ #!/usr/bin/env ts-node /** - * Build script to pre-compile sandbox-executor.ts + * Build script to pre-compile direct-executor.ts * - * Run this during build/release to generate sandbox-executor.js + * Run this during build/release to generate direct-executor.js * This avoids any runtime compilation overhead. * * Usage: npx ts-node build-executor.ts @@ -24,9 +24,9 @@ import * as crypto from 'node:crypto'; import * as vm from 'node:vm'; import * as os from 'node:os'; -const inputPath = path.resolve(__dirname, 'sandbox-executor.ts'); -const outputPath = path.resolve(__dirname, 'sandbox-executor.js'); -const hashPath = path.resolve(__dirname, 'sandbox-executor.js.sha256'); +const inputPath = path.resolve(__dirname, 'direct-executor.ts'); +const outputPath = path.resolve(__dirname, 'direct-executor.js'); +const hashPath = path.resolve(__dirname, 'direct-executor.js.sha256'); const cacheHashPath = path.resolve(__dirname, '.build-cache-hash'); /** @@ -159,7 +159,7 @@ function checkBuildCache(inputHash: string, force: boolean): boolean { */ function verifySyntax(filePath: string): void { const content = fs.readFileSync(filePath, 'utf-8'); - + try { // Use vm.Script to parse without executing // This catches syntax errors without side effects @@ -195,10 +195,10 @@ function atomicWriteFile(targetPath: string, content: string): string { os.tmpdir(), `build-executor-${crypto.randomUUID()}.tmp` ); - + fs.writeFileSync(tempPath, content, 'utf-8'); fs.renameSync(tempPath, targetPath); - + return tempPath; } @@ -206,7 +206,7 @@ function atomicWriteFile(targetPath: string, content: string): string { * Write hash to .sha256 file for runtime verification */ function writeHashFile(hash: string): void { - const content = `${hash} sandbox-executor.js\n`; + const content = `${hash} direct-executor.js\n`; atomicWriteFile(hashPath, content); } @@ -227,7 +227,7 @@ function generateBanner(inputHash: string): string { * Auto-generated by build-executor.ts * Build time: ${now} * Node version: ${nodeVersion} - * Source: sandbox-executor.ts + * Source: direct-executor.ts * Source hash: ${inputHash.substring(0, 16)} * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts */`; @@ -237,7 +237,7 @@ async function build(): Promise { const forceRebuild = process.argv.includes('--force'); let tempOutputPath: string | undefined; - console.log('=== Building sandbox-executor ==='); + console.log('=== Building direct-executor ==='); console.log(`Input: ${inputPath}`); console.log(`Output: ${outputPath}`); @@ -262,8 +262,8 @@ async function build(): Promise { // Step 4: Build to temp file (atomic write preparation) console.log('\n[4/7] Compiling TypeScript...'); - tempOutputPath = path.join(os.tmpdir(), `sandbox-executor-${crypto.randomUUID()}.js`); - + tempOutputPath = path.join(os.tmpdir(), `direct-executor-${crypto.randomUUID()}.js`); + const result = await esbuild.build({ entryPoints: [inputPath], bundle: true, diff --git a/plugins/lib/sandbox-executor.ts b/plugins/lib/direct-executor.ts similarity index 70% rename from plugins/lib/sandbox-executor.ts rename to plugins/lib/direct-executor.ts index 8763e28f6..2ac444c4a 100644 --- a/plugins/lib/sandbox-executor.ts +++ b/plugins/lib/direct-executor.ts @@ -1,24 +1,19 @@ /** - * Sandbox Executor Module + * Plugin Executor Module * - * Piscina worker that executes compiled JavaScript plugins in isolated node:vm contexts. - * Each task gets a fresh vm.createContext() for complete isolation between executions. + * Piscina worker that executes compiled JavaScript plugins. + * Plugins run in worker threads for parallelism. */ -import * as vm from 'node:vm'; import * as v8 from 'node:v8'; import * as net from 'node:net'; import { v4 as uuidv4 } from 'uuid'; -import type { PluginKVStore } from './kv'; import { DefaultPluginKVStore } from './kv'; -import { LogInterceptor } from './logger'; -import { wrapForVm } from './compiler'; import type { PluginAPI, PluginContext, PluginHeaders, Relayer } from './plugin'; import { ApiResponseRelayerResponseData, ApiResponseRelayerStatusData, JsonRpcRequestNetworkRpcRequest, - JsonRpcResponseNetworkRpcResult, NetworkTransactionRequest, SignTransactionResponse, SignTransactionRequest, @@ -29,70 +24,17 @@ import { import { DEFAULT_SOCKET_REQUEST_TIMEOUT_MS } from './constants'; /** - * Context Pool - Reuses VM contexts to avoid expensive createContext() calls. - * Creating a VM context takes 5-20ms. By pooling, we reduce this to near-zero for warm workers. - */ -class ContextPool { - private available: vm.Context[] = []; - private readonly maxSize = 10; // Max contexts to cache per worker - - acquire(): vm.Context { - const ctx = this.available.pop(); - if (ctx) { - // Reuse context - reset any mutable state - this.resetContext(ctx); - return ctx; - } - // Create new context if pool is empty - return this.createFreshContext(); - } - - release(ctx: vm.Context): void { - // Return to pool if not at capacity - if (this.available.length < this.maxSize) { - this.available.push(ctx); - } - // Otherwise let GC collect it - } - - private createFreshContext(): vm.Context { - // This will be populated with globals in executeInSandbox - return vm.createContext({}); - } - - private resetContext(ctx: vm.Context): void { - // Reset any global pollution from previous execution - // This is much faster than creating a new context - try { - vm.runInContext(` - // Clear any plugin-added globals - if (typeof globalThis.__pluginState !== 'undefined') { - delete globalThis.__pluginState; - } - `, ctx, { timeout: 100 }); - } catch { - // Ignore reset errors - context will be replaced - } - } - - clear(): void { - // Emergency cleanup - drop all cached contexts - this.available = []; - } -} - -/** - * Script Cache - Reuses compiled VM scripts to avoid recompilation. - * Compiling a script takes 1-5ms. Caching eliminates this for repeated code. + * Function Cache - Caches compiled plugin factory functions. + * Compiling with Function constructor takes 1-5ms. Caching eliminates this for repeated code. * Memory-aware: monitors heap usage and proactively evicts under pressure. */ -class ScriptCache { - private cache = new Map(); - private readonly maxSize = 100; // Max scripts to cache per worker +class FunctionCache { + private cache = new Map(); + private readonly maxSize = 100; // Max functions to cache per worker private lastMemoryCheck = 0; private readonly memoryCheckInterval = 5000; // Check every 5s - get(code: string): vm.Script | undefined { + get(code: string): Function | undefined { // Periodic memory check on get operations this.maybeCheckMemory(); @@ -100,12 +42,12 @@ class ScriptCache { if (entry) { // Update access timestamp for LRU entry.timestamp = Date.now(); - return entry.script; + return entry.factory; } return undefined; } - set(code: string, script: vm.Script): void { + set(code: string, factory: Function): void { // Check memory before adding this.maybeCheckMemory(); @@ -113,7 +55,7 @@ class ScriptCache { if (this.cache.size >= this.maxSize) { this.evictOldest(1); } - this.cache.set(code, { script, timestamp: Date.now() }); + this.cache.set(code, { factory, timestamp: Date.now() }); } /** @@ -138,7 +80,7 @@ class ScriptCache { const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.5)); console.warn( `[worker-cache] HIGH memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + - `evicting ${evictCount} scripts` + `evicting ${evictCount} functions` ); this.evictOldest(evictCount); } else if (heapUsedRatio >= 0.70 && this.cache.size > 0) { @@ -146,7 +88,7 @@ class ScriptCache { const evictCount = Math.max(1, Math.ceil(this.cache.size * 0.25)); console.warn( `[worker-cache] Memory pressure (${Math.round(heapUsedRatio * 100)}% of heap limit), ` + - `evicting ${evictCount} scripts` + `evicting ${evictCount} functions` ); this.evictOldest(evictCount); } @@ -165,16 +107,16 @@ class ScriptCache { evicted++; } if (evicted > 0) { - console.log(`[worker-cache] Evicted ${evicted} oldest scripts`); + console.log(`[worker-cache] Evicted ${evicted} oldest functions`); } } clear(): void { - // Emergency cleanup - drop all cached scripts + // Emergency cleanup - drop all cached functions const size = this.cache.size; this.cache.clear(); if (size > 0) { - console.log(`[worker-cache] Emergency eviction: cleared ${size} cached scripts`); + console.log(`[worker-cache] Emergency eviction: cleared ${size} cached functions`); } } @@ -286,15 +228,14 @@ class SocketPool { } } -// Worker-level pools (thread-safe since Piscina workers are single-threaded) -const contextPool = new ContextPool(); -const scriptCache = new ScriptCache(); +// Worker-level caches (thread-safe since Piscina workers are single-threaded) +const functionCache = new FunctionCache(); const socketPool = new SocketPool(); /** * Task payload received from the worker pool */ -export interface SandboxTask { +export interface ExecutorTask { /** Unique task ID for correlation */ taskId: string; /** Plugin ID for KV namespacing */ @@ -322,9 +263,9 @@ export interface SandboxTask { } /** - * Result returned from sandbox execution + * Result returned from plugin execution */ -export interface SandboxResult { +export interface ExecutorResult { /** Task ID for correlation */ taskId: string; /** Whether execution succeeded */ @@ -348,12 +289,11 @@ export interface LogEntry { } /** - * Sandboxed Plugin API that communicates with the relayer via Unix socket. - * This is a minimal implementation for use within the vm context. + * Plugin API that communicates with the relayer via Unix socket. * Connection is lazy - only established when first API call is made. * Uses socket pooling to reduce connection overhead. */ -class SandboxPluginAPI implements PluginAPI { +class PluginAPIImpl implements PluginAPI { private socket: net.Socket | null = null; private pending: Map void; reject: (reason: any) => void }>; private connectionPromise: Promise | null = null; @@ -709,7 +649,7 @@ function safeStringify(value: unknown): string { * Creates a console-like object that captures logs with lazy stringification. * Stringification is deferred until logs are accessed to reduce overhead. */ -function createSandboxConsole(logs: LogEntry[]): Console { +function createPluginConsole(logs: LogEntry[]): Console { const log = (level: LogEntry['level']) => (...args: any[]) => { // Store raw args, stringify lazily when accessed const entry: any = { @@ -768,266 +708,42 @@ function createSandboxConsole(logs: LogEntry[]): Console { } /** - * Executes a compiled plugin in an isolated vm context. + * Executes a compiled plugin. * This is the Piscina worker function. - * Uses context pooling and script caching for performance. + * Uses function caching for performance. */ -export default async function executeInSandbox(task: SandboxTask): Promise { +export default async function executePlugin(task: ExecutorTask): Promise { const logs: LogEntry[] = []; - const api = new SandboxPluginAPI(task.socketPath, task.httpRequestId); + const api = new PluginAPIImpl(task.socketPath, task.httpRequestId); const kv = new DefaultPluginKVStore(task.pluginId); - // Acquire context from pool (much faster than creating new) - const context = contextPool.acquire(); - try { - // Create isolated context with limited globals - const sandboxConsole = createSandboxConsole(logs); - - // Prepare the module wrapper - const wrappedCode = wrapForVm(task.compiledCode); - - // Try to get cached script, otherwise compile and cache - let script = scriptCache.get(task.compiledCode); - if (!script) { - script = new vm.Script(wrappedCode, { - filename: `plugin-${task.pluginId}.js`, - }); - scriptCache.set(task.compiledCode, script); - } + // Create console that captures logs + const pluginConsole = createPluginConsole(logs); // Create module-like objects for CommonJS compatibility const moduleExports: any = {}; const moduleObject = { exports: moduleExports }; - // Minimal crypto exposure - only safe ID generation - const safeCrypto = { - randomUUID: () => require('crypto').randomUUID(), - getRandomValues: (arr: Uint8Array) => require('crypto').getRandomValues(arr), - }; - - // Environment variables that should NEVER be exposed to plugins - // These contain secrets, credentials, or sensitive infrastructure details - const BLOCKED_ENV_PATTERNS = [ - // Authentication & API keys - 'API_KEY', - 'WEBHOOK_SIGNING_KEY', - 'STORAGE_ENCRYPTION_KEY', - 'KEYSTORE_PASSPHRASE', - 'REDIS_URL', - ]; - - // Create filtered environment - removes sensitive variables - const filteredEnv: Record = {}; - for (const [key, value] of Object.entries(process.env)) { - const upperKey = key.toUpperCase(); - const isBlocked = BLOCKED_ENV_PATTERNS.some(pattern => - upperKey === pattern.toUpperCase() || upperKey.includes(pattern.toUpperCase()) + // Try to get cached factory function, otherwise compile and cache + let factory = functionCache.get(task.compiledCode); + if (!factory) { + // eslint-disable-next-line no-new-func + factory = new Function( + 'exports', + 'require', + 'module', + '__filename', + '__dirname', + 'console', + task.compiledCode ); - if (!isBlocked) { - filteredEnv[key] = value; - } + functionCache.set(task.compiledCode, factory); } - // Safe process shim - exposes only non-dangerous properties - // Many libraries check for process existence or use safe properties - const safeProcess = { - nextTick: (callback: (...args: any[]) => void, ...args: any[]) => { - queueMicrotask(() => callback(...args)); - }, - version: process.version, - versions: { ...process.versions }, - platform: process.platform, - arch: process.arch, - browser: false, - // Filtered env access - sensitive variables are removed - env: filteredEnv, - // Block dangerous properties by throwing errors - get argv() { - throw new Error('process.argv is not available in sandbox for security'); - }, - exit: () => { - throw new Error('process.exit() is not available in sandbox for security'); - }, - cwd: () => { - throw new Error('process.cwd() is not available in sandbox for security'); - }, - chdir: () => { - throw new Error('process.chdir() is not available in sandbox for security'); - }, - kill: () => { - throw new Error('process.kill() is not available in sandbox for security'); - }, - }; - - // Create sandboxRequire function - const BLOCKED_MODULES = new Set([ - // Process/system control - 'child_process', 'node:child_process', - 'cluster', 'node:cluster', - 'worker_threads', 'node:worker_threads', - 'process', 'node:process', - // Low-level system - 'os', 'node:os', - 'v8', 'node:v8', - 'vm', 'node:vm', - // Dangerous utilities - 'repl', 'node:repl', - 'inspector', 'node:inspector', - 'perf_hooks', 'node:perf_hooks', - 'async_hooks', 'node:async_hooks', - 'trace_events', 'node:trace_events', - // Native modules (potential escape) - 'module', 'node:module', - ]); - - const sandboxRequire = (id: string): any => { - // Block dangerous built-in modules - if (BLOCKED_MODULES.has(id)) { - throw new Error( - `Module '${id}' is blocked for security. ` + - `Use the PluginAPI for network operations.` - ); - } - - // Allow everything else (SDK, npm packages like uuid, ethers, etc.) - try { - return require(id); - } catch (err) { - throw new Error( - `Module '${id}' not found. Ensure it's installed in plugins/node_modules.` - ); - } - }; - - // Create a safe global object - isolated copy to prevent access to real globalThis - // Some libraries (e.g., Stellar SDK) add properties to global (like __USE_AXIOS__) - // so we can't freeze it, but it's still isolated per-execution - const safeGlobal: Record = { - // Expose only safe primitives that libraries commonly check for - Buffer, - setTimeout, - setInterval, - setImmediate, - clearTimeout, - clearInterval, - clearImmediate, - queueMicrotask, - console: sandboxConsole, - process: safeProcess, - }; - - // Populate context with globals (reused context from pool) - // SECURITY: Only expose safe globals. Never expose: - // - process.argv, process.exit() (blocked via safe shim) - // - eval, Function constructor (code execution) - // - require for arbitrary modules - // global is an isolated mutable object (not raw globalThis) - safe for SDK usage - // NOTE: process.env is filtered - sensitive variables (API keys, passwords, etc.) are removed - Object.assign(context, { - // === Console for logging === - console: sandboxConsole, - - // === Node.js global compatibility === - global: safeGlobal, // Frozen safe global (prevents sandbox escapes) - process: safeProcess, // Safe process shim (filtered env, no argv/exit) - - // === CommonJS module system === - exports: moduleExports, - require: sandboxRequire, - module: moduleObject, - __filename: `plugin-${task.pluginId}.js`, - __dirname: '/plugins', - - // === Async primitives === - setTimeout, - setInterval, - setImmediate, - clearTimeout, - clearInterval, - clearImmediate, - Promise, - queueMicrotask, - - // === Core JS types (often needed explicitly) === - Object, - Array, - String, - Number, - Boolean, - Symbol, - BigInt, - Map, - Set, - WeakMap, - WeakSet, - Date, - RegExp, - Math, - JSON, - - // === Error types === - Error, - TypeError, - RangeError, - SyntaxError, - ReferenceError, - URIError, - EvalError, - - // === Number utilities === - parseInt, - parseFloat, - isNaN, - isFinite, - Infinity, - NaN, - - // === String/URL encoding === - encodeURI, - decodeURI, - encodeURIComponent, - decodeURIComponent, - atob, - btoa, - URL, - URLSearchParams, - - // === Binary data === - Buffer, - ArrayBuffer, - SharedArrayBuffer, - Uint8Array, - Uint16Array, - Uint32Array, - Int8Array, - Int16Array, - Int32Array, - Float32Array, - Float64Array, - BigInt64Array, - BigUint64Array, - DataView, - TextEncoder, - TextDecoder, - - // === Cancellation (modern async patterns) === - AbortController, - AbortSignal, - - // === Safe crypto subset (no signing/hashing secrets) === - crypto: safeCrypto, - - // === Reflection (needed by some libraries) === - Reflect, - Proxy, - }); - - // Run cached script in reused context - const factory = script.runInContext(context, { timeout: task.timeout }); - // Execute the factory to populate module.exports - factory(moduleExports, sandboxRequire, moduleObject, `plugin-${task.pluginId}.js`, '/plugins'); + // Pass our custom console to capture logs + factory(moduleExports, require, moduleObject, `plugin-${task.pluginId}.js`, '/plugins', pluginConsole); // Get the handler from exports const handler = moduleObject.exports.handler || moduleExports.handler; @@ -1143,13 +859,10 @@ export default async function executeInSandbox(task: SandboxTask): Promise = { * Path to the pre-compiled sandbox executor. * This file is generated at build time by running: npx ts-node build-executor.ts */ -const PRECOMPILED_EXECUTOR_PATH = path.resolve(__dirname, 'sandbox-executor.js'); +const PRECOMPILED_EXECUTOR_PATH = path.resolve(__dirname, 'direct-executor.js'); /** * Metrics tracking for plugin execution @@ -261,7 +261,7 @@ class CompiledCodeCache { `evicting ${evictCount} oldest entries` ); this.evictOldest(evictCount); - + // Force GC if available if (global.gc) { try { @@ -282,7 +282,7 @@ class CompiledCodeCache { `evicting ${evictCount} entries` ); this.evictOldest(evictCount); - + // Force GC if (global.gc) { try { @@ -361,7 +361,7 @@ class CompiledCodeCache { set(pluginPath: string, code: string): void { const size = Buffer.byteLength(code, 'utf8'); - + // Evict if adding this would exceed max cache size while (this.totalCacheSize + size > this.maxCacheSize && this.cache.size > 0) { this.evictOldest(1); @@ -487,10 +487,10 @@ export class WorkerPoolManager { /** * Initialize the worker pool. * Call this before executing any plugins. - * - * Uses pre-compiled sandbox-executor.js if available, + * + * Uses pre-compiled direct-executor.js if available, * otherwise compiles it on-the-fly (slower first startup). - * + * * Thread-safe: multiple concurrent calls will await the same initialization. */ async initialize(): Promise { @@ -518,7 +518,7 @@ export class WorkerPoolManager { * Internal initialization logic. */ private async doInitialize(): Promise { - // Use pre-compiled sandbox-executor.js if it exists + // Use pre-compiled direct-executor.js if it exists if (fs.existsSync(PRECOMPILED_EXECUTOR_PATH)) { this.compiledWorkerPath = PRECOMPILED_EXECUTOR_PATH; this.isTemporaryWorkerFile = false; @@ -536,7 +536,7 @@ export class WorkerPoolManager { // Formula: 512 + (concurrent_tasks * 8) MB - ensures enough heap for burst context creation // Default to 2048MB if not passed (conservative for high load) const workerHeapMb = parseInt(process.env.PLUGIN_WORKER_HEAP_MB || '2048', 10); - + console.error(`[worker-pool] Worker heap size: ${workerHeapMb}MB (per worker thread)`); this.pool = new Piscina({ @@ -617,7 +617,7 @@ export class WorkerPoolManager { * This is slower but ensures the pool can start in any environment. */ private async compileExecutorOnTheFly(): Promise { - const sandboxExecutorPath = path.resolve(__dirname, 'sandbox-executor.ts'); + const sandboxExecutorPath = path.resolve(__dirname, 'direct-executor.ts'); const esbuild = await import('esbuild'); const result = await esbuild.build({ @@ -633,7 +633,7 @@ export class WorkerPoolManager { }); // Write to temp file - const tempPath = path.join(os.tmpdir(), `sandbox-executor-${uuidv4()}.js`); + const tempPath = path.join(os.tmpdir(), `direct-executor-${uuidv4()}.js`); fs.writeFileSync(tempPath, result.outputFiles[0].text); return tempPath; } @@ -779,7 +779,7 @@ export class WorkerPoolManager { } // Create task for the worker - const task: SandboxTask = { + const task: ExecutorTask = { taskId: uuidv4(), pluginId: request.pluginId, compiledCode, @@ -798,7 +798,7 @@ export class WorkerPoolManager { incrementBoundedMap(this.metrics.pluginExecutions, request.pluginId, MAX_METRICS_ENTRIES); // Use task timeout to prevent permanently stuck workers - // This is a safety net beyond the handler-level timeout in sandbox-executor + // This is a safety net beyond the handler-level timeout in direct-executor const taskTimeout = this.options.taskTimeout; let timeoutId: NodeJS.Timeout | undefined; @@ -811,7 +811,7 @@ export class WorkerPoolManager { }, taskTimeout); }); - const result: SandboxResult = await Promise.race([runPromise, timeoutPromise]); + const result: ExecutorResult = await Promise.race([runPromise, timeoutPromise]); // Update execution metrics const executionTime = Date.now() - executionStartTime; diff --git a/plugins/tests/lib/sandbox-executor.test.ts b/plugins/tests/lib/direct-executor.test.ts similarity index 93% rename from plugins/tests/lib/sandbox-executor.test.ts rename to plugins/tests/lib/direct-executor.test.ts index b428c5e4e..7ffcc1ca8 100644 --- a/plugins/tests/lib/sandbox-executor.test.ts +++ b/plugins/tests/lib/direct-executor.test.ts @@ -643,8 +643,8 @@ describe('Socket pool with age tracking', () => { }); }); -describe('SandboxPluginAPI socket handling', () => { - class MockSandboxPluginAPI { +describe('PluginAPIImpl socket handling', () => { + class MockPluginAPIImpl { private socket: any = null; private pending = new Map(); private connected = false; @@ -735,7 +735,7 @@ describe('SandboxPluginAPI socket handling', () => { } it('should establish connection on first request', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); expect(api.isConnected()).toBe(false); @@ -745,7 +745,7 @@ describe('SandboxPluginAPI socket handling', () => { }); it('should reuse existing connection', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); await api.send('method1', {}); const wasConnected = api.isConnected(); @@ -755,7 +755,7 @@ describe('SandboxPluginAPI socket handling', () => { }); it('should handle socket error and reject pending requests', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); await api.send('method1', {}); @@ -767,7 +767,7 @@ describe('SandboxPluginAPI socket handling', () => { }); it('should handle socket close and reset connection', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); await api.send('method1', {}); expect(api.isConnected()).toBe(true); @@ -779,7 +779,7 @@ describe('SandboxPluginAPI socket handling', () => { }); it('should enforce max pending requests limit', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); // Mock the pending count to be at limit for (let i = 0; i < 100; i++) { @@ -790,7 +790,7 @@ describe('SandboxPluginAPI socket handling', () => { }); it('should reconnect after socket close', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); await api.send('method1', {}); api.handleSocketClose(); @@ -803,7 +803,7 @@ describe('SandboxPluginAPI socket handling', () => { }); it('should reject with ESOCKETCLOSED code on socket close', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); await api.send('method1', {}); @@ -826,7 +826,7 @@ describe('SandboxPluginAPI socket handling', () => { }); it('should track socket creation time', async () => { - const api = new MockSandboxPluginAPI('/tmp/test.sock'); + const api = new MockPluginAPIImpl('/tmp/test.sock'); const beforeConnect = Date.now(); await api.send('method1', {}); @@ -839,13 +839,13 @@ describe('SandboxPluginAPI socket handling', () => { }); }); -describe('Sandbox console implementation', () => { +describe('Plugin console implementation', () => { interface LogEntry { level: 'error' | 'warn' | 'info' | 'log' | 'debug' | 'result'; message: string; } - function createMockSandboxConsole(logs: LogEntry[]): Console { + function createMockPluginConsole(logs: LogEntry[]): Console { const log = (level: LogEntry['level']) => (...args: any[]) => { const message = args.map(arg => typeof arg === 'object' ? JSON.stringify(arg) : String(arg) @@ -864,7 +864,7 @@ describe('Sandbox console implementation', () => { it('should capture log messages', () => { const logs: LogEntry[] = []; - const console = createMockSandboxConsole(logs); + const console = createMockPluginConsole(logs); console.log('test message'); @@ -874,7 +874,7 @@ describe('Sandbox console implementation', () => { it('should capture error messages', () => { const logs: LogEntry[] = []; - const console = createMockSandboxConsole(logs); + const console = createMockPluginConsole(logs); console.error('error occurred'); @@ -884,7 +884,7 @@ describe('Sandbox console implementation', () => { it('should capture warn messages', () => { const logs: LogEntry[] = []; - const console = createMockSandboxConsole(logs); + const console = createMockPluginConsole(logs); console.warn('warning message'); @@ -894,7 +894,7 @@ describe('Sandbox console implementation', () => { it('should stringify objects', () => { const logs: LogEntry[] = []; - const console = createMockSandboxConsole(logs); + const console = createMockPluginConsole(logs); console.log({ foo: 'bar', num: 42 }); @@ -904,7 +904,7 @@ describe('Sandbox console implementation', () => { it('should handle multiple arguments', () => { const logs: LogEntry[] = []; - const console = createMockSandboxConsole(logs); + const console = createMockPluginConsole(logs); console.log('Hello', 'world', 123); @@ -914,7 +914,7 @@ describe('Sandbox console implementation', () => { it('should handle mixed types', () => { const logs: LogEntry[] = []; - const console = createMockSandboxConsole(logs); + const console = createMockPluginConsole(logs); console.log('Count:', 42, { status: 'ok' }); @@ -923,7 +923,7 @@ describe('Sandbox console implementation', () => { }); }); -describe('Sandbox require blocking', () => { +describe('Plugin require blocking', () => { const BLOCKED_MODULES = new Set([ 'fs', 'child_process', 'net', 'http', 'https', 'cluster', 'process', 'vm', 'os', 'v8', @@ -943,19 +943,19 @@ describe('Sandbox require blocking', () => { } it('should block dangerous built-in modules', () => { - const sandboxRequire = createSandboxRequire(BLOCKED_MODULES); + const pluginRequire = createSandboxRequire(BLOCKED_MODULES); - expect(() => sandboxRequire('fs')).toThrow('Module \'fs\' is blocked for security'); - expect(() => sandboxRequire('child_process')).toThrow('blocked for security'); - expect(() => sandboxRequire('net')).toThrow('blocked for security'); - expect(() => sandboxRequire('http')).toThrow('blocked for security'); + expect(() => pluginRequire('fs')).toThrow('Module \'fs\' is blocked for security'); + expect(() => pluginRequire('child_process')).toThrow('blocked for security'); + expect(() => pluginRequire('net')).toThrow('blocked for security'); + expect(() => pluginRequire('http')).toThrow('blocked for security'); }); it('should allow safe modules', () => { - const sandboxRequire = createSandboxRequire(BLOCKED_MODULES); + const pluginRequire = createSandboxRequire(BLOCKED_MODULES); // Should not throw - expect(() => sandboxRequire('uuid')).not.toThrow(); + expect(() => pluginRequire('uuid')).not.toThrow(); }); it('should block with node: prefix', () => { @@ -963,15 +963,15 @@ describe('Sandbox require blocking', () => { 'fs', 'node:fs', 'net', 'node:net', ]); - const sandboxRequire = createSandboxRequire(extendedBlocked); + const pluginRequire = createSandboxRequire(extendedBlocked); - expect(() => sandboxRequire('node:fs')).toThrow('blocked for security'); - expect(() => sandboxRequire('node:net')).toThrow('blocked for security'); + expect(() => pluginRequire('node:fs')).toThrow('blocked for security'); + expect(() => pluginRequire('node:net')).toThrow('blocked for security'); }); }); -describe('executeInSandbox function', () => { - interface SandboxTask { +describe('executePlugin function', () => { + interface ExecutorTask { taskId: string; pluginId: string; compiledCode: string; @@ -982,7 +982,7 @@ describe('executeInSandbox function', () => { timeout: number; } - interface SandboxResult { + interface ExecutorResult { taskId: string; success: boolean; result?: any; @@ -995,7 +995,7 @@ describe('executeInSandbox function', () => { logs: any[]; } - async function mockExecuteInSandbox(task: SandboxTask): Promise { + async function mockExecuteInSandbox(task: ExecutorTask): Promise { const logs: any[] = []; try { @@ -1029,7 +1029,7 @@ describe('executeInSandbox function', () => { } it('should execute plugin successfully', async () => { - const task: SandboxTask = { + const task: ExecutorTask = { taskId: 'task-1', pluginId: 'plugin-1', compiledCode: 'return params;', @@ -1046,7 +1046,7 @@ describe('executeInSandbox function', () => { }); it('should handle plugin errors', async () => { - const task: SandboxTask = { + const task: ExecutorTask = { taskId: 'task-2', pluginId: 'plugin-2', compiledCode: 'throw new Error("test error");', @@ -1064,7 +1064,7 @@ describe('executeInSandbox function', () => { }); it('should include headers in execution context', async () => { - const task: SandboxTask = { + const task: ExecutorTask = { taskId: 'task-3', pluginId: 'plugin-3', compiledCode: 'return headers;', @@ -1080,7 +1080,7 @@ describe('executeInSandbox function', () => { }); it('should respect execution timeout', async () => { - const task: SandboxTask = { + const task: ExecutorTask = { taskId: 'task-4', pluginId: 'plugin-4', compiledCode: 'timeout', @@ -1098,7 +1098,7 @@ describe('executeInSandbox function', () => { }); it('should provide httpRequestId for tracing', async () => { - const task: SandboxTask = { + const task: ExecutorTask = { taskId: 'task-5', pluginId: 'plugin-5', compiledCode: 'return httpRequestId;', @@ -1113,7 +1113,7 @@ describe('executeInSandbox function', () => { }); }); -describe('Error handling in sandbox', () => { +describe('Error handling in executor', () => { it('should categorize SyntaxError', () => { const error = new SyntaxError('Unexpected token'); From 031e0364643687f1695815356030d98ca9790157 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 18 Jan 2026 01:04:38 +0100 Subject: [PATCH 23/42] chore: PR suggestions --- CLAUDE.md | 122 ------------------ build.rs | 12 +- plugins/lib/build-executor.ts | 158 ++++++++++-------------- plugins/lib/compiler.ts | 43 +++---- plugins/lib/direct-executor.ts | 10 +- src/repositories/plugin/plugin_redis.rs | 32 ++--- stress.js | 19 +++ 7 files changed, 130 insertions(+), 266 deletions(-) delete mode 100644 CLAUDE.md create mode 100644 stress.js diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index edb2e9b6c..000000000 --- a/CLAUDE.md +++ /dev/null @@ -1,122 +0,0 @@ -# CLAUDE.md - -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - -## Project Overview - -OpenZeppelin Relayer is a multi-chain blockchain transaction relaying service. It enables interaction with EVM, Solana, and Stellar networks through HTTP endpoints, supporting transaction submission, signing, monitoring, and extensible plugins. - -**Tech Stack:** Rust 1.88 (Actix-web 4) + TypeScript/Node.js (plugin runtime) + Redis (job queues/caching) - -## Build & Development Commands - -```bash -# Core Rust commands -cargo build # Build the project -cargo run # Run locally (requires Redis + config) -cargo test # Run all unit tests -cargo test # Run a specific test -cargo test --features integration-tests --test integration # Integration tests - -# Plugin system (TypeScript) -cd plugins && pnpm install # Install plugin dependencies -pnpm run build # Build sandbox executor -pnpm test # Run plugin tests - -# Docker -cargo make docker-compose-up # Start with docker-compose -cargo make docker-compose-down # Stop services - -``` - -## Architecture - -### Layered Structure - -``` -src/ -โ”œโ”€โ”€ api/ # HTTP routes (Actix-web), OpenAPI specs, middleware -โ”œโ”€โ”€ bootstrap/ # Service initialization -โ”œโ”€โ”€ config/ # JSON/env configuration loading -โ”œโ”€โ”€ domain/ # Business logic (relayers, transactions, policies) -โ”œโ”€โ”€ jobs/ # Async job processing (Apalis + Redis) -โ”œโ”€โ”€ models/ # Data structures (Signer, Transaction, Network) -โ”œโ”€โ”€ repositories/ # Redis-backed storage (immutable at runtime) -โ”œโ”€โ”€ services/ # Core services -โ”‚ โ”œโ”€โ”€ plugins/ # Plugin execution system (Rust side) -โ”‚ โ”œโ”€โ”€ provider/ # Blockchain RPC providers (EVM, Solana, Stellar) -โ”‚ โ”œโ”€โ”€ signer/ # Transaction signing (KMS, Vault, local keystore) -โ”‚ โ”œโ”€โ”€ gas/ # Gas estimation -โ”‚ โ””โ”€โ”€ notification/ # Webhook notifications -โ””โ”€โ”€ utils/ # Helpers -``` - -### Key Abstractions - -- **Repository Pattern**: Redis-backed repositories for configs (RelayerRepository, SignerRepository) -- **Service Traits**: Async traits for dependency injection and testability -- **Job Processing**: Apalis-based async job queue - -## Code Standards - -- **Formatting**: rustfmt with max_width=100, edition 2021 -- **Naming**: snake_case functions/vars, PascalCase types, SCREAMING_SNAKE_CASE constants -- **Errors**: Avoid `unwrap()`, use Result with `?` operator, custom error types -- **Async**: Tokio runtime, await eagerly, avoid blocking in async -- **Params**: Prefer `&str` over `&String`, `&[T]` over `&Vec` -- **Logging**: Use `tracing` crate for structured logs -- **Testing**: Define traits for services to enable mocking with `mockall` -- Prefer **idiomatic Rust**. -- Follow `rustfmt` formatting and `clippy` best practices. -- Avoid unnecessary abstractions. -- Keep code readable over clever. -- Use `Option` and `Result` exhaustively. -- Avoid breaking changes unless explicitly requested. -- Document API endpoints with utoipa schemas and regenerate OpenAPI spec when needed with `cargo run --example generate_openapi` - -## Documentation -- Add Rust doc comments (`///`) for public items. -- Include examples in doc comments when useful. -- Keep comments concise and factual. - -## Testing - -```bash -# Run specific test file -cargo test --test - -# Run tests matching pattern -cargo test - -# Run with single thread (for tests with shared state) -RUST_TEST_THREADS=1 cargo test - -# Redis tests (require active Redis) -cargo test -- --ignored - -# Plugin-specific Rust tests -cargo test --package openzeppelin-relayer plugins -``` - -## Debugging Plugins - -```bash -# Enable debug logging for plugins -RUST_LOG=openzeppelin_relayer::services::plugins=debug cargo run - -# Check plugin health -curl -H "Authorization: Bearer $API_KEY" http://localhost:8080/api/v1/health/plugins -``` - -## Helper Binaries - -```bash -cargo run --example create_key # Generate signing keys -cargo run --example generate_uuid # Generate UUIDs for config -cargo run --example generate_encryption_key # Generate encryption keys -cargo run --example generate_openapi # Generate OpenAPI spec -``` - -## When Unsure -- Ask clarifying questions before making large changes. -- If multiple approaches exist, explain trade-offs briefly. diff --git a/build.rs b/build.rs index 05ced7ef2..1c9ed8c9d 100644 --- a/build.rs +++ b/build.rs @@ -26,7 +26,7 @@ fn main() { // Only run pnpm install if node_modules is missing if !node_modules.exists() { - println!("cargo:warning=Installing plugin dependencies..."); + println!("Installing plugin dependencies..."); let output = Command::new("pnpm") .arg("install") .arg("--ignore-scripts") // Skip postinstall, we'll build explicitly below @@ -35,7 +35,7 @@ fn main() { match output { Ok(output) if output.status.success() => { - println!("cargo:warning=โœ“ pnpm install completed"); + println!("โœ“ pnpm install completed"); } Ok(output) => { let stderr = String::from_utf8_lossy(&output.stderr); @@ -64,7 +64,7 @@ fn main() { }; if needs_build { - println!("cargo:warning=Building direct-executor..."); + println!("Building executor..."); let output = Command::new("pnpm") .arg("run") .arg("build") @@ -73,14 +73,14 @@ fn main() { match output { Ok(output) if output.status.success() => { - println!("cargo:warning=โœ“ direct-executor built successfully"); + println!("โœ“ executor built successfully"); } Ok(output) => { let stderr = String::from_utf8_lossy(&output.stderr); - println!("cargo:warning=direct-executor build failed: {stderr}"); + println!("cargo:warning=executor build failed: {stderr}"); } Err(e) => { - println!("cargo:warning=Failed to build direct-executor: {e}"); + println!("cargo:warning=Failed to build executor: {e}"); } } } diff --git a/plugins/lib/build-executor.ts b/plugins/lib/build-executor.ts index 3a176a8b3..267b1f6e0 100644 --- a/plugins/lib/build-executor.ts +++ b/plugins/lib/build-executor.ts @@ -23,50 +23,28 @@ import * as fs from 'node:fs'; import * as crypto from 'node:crypto'; import * as vm from 'node:vm'; import * as os from 'node:os'; +import * as esbuild from 'esbuild'; -const inputPath = path.resolve(__dirname, 'direct-executor.ts'); -const outputPath = path.resolve(__dirname, 'direct-executor.js'); -const hashPath = path.resolve(__dirname, 'direct-executor.js.sha256'); -const cacheHashPath = path.resolve(__dirname, '.build-cache-hash'); - -/** - * Check if esbuild is available - */ -async function validateDependencies(): Promise { - try { - return await import('esbuild'); - } catch { - throw new Error( - 'esbuild is not installed. Run: npm install esbuild\n' + - 'Or if using yarn: yarn add esbuild' - ); - } -} +const INPUT_PATH = path.resolve(__dirname, 'direct-executor.ts'); +const OUTPUT_PATH = path.resolve(__dirname, 'direct-executor.js'); +const HASH_PATH = path.resolve(__dirname, 'direct-executor.js.sha256'); +const CACHE_HASH_PATH = path.resolve(__dirname, '.build-cache-hash'); /** * Calculate SHA256 hash of file content */ -function calculateHash(filePath: string): string { - const content = fs.readFileSync(filePath); - return crypto.createHash('sha256').update(content).digest('hex'); -} - -/** - * Calculate SHA256 hash of string content - */ -function calculateContentHash(content: string): string { +async function calculateHash(filePath: string): Promise { + const content = await fs.promises.readFile(filePath); return crypto.createHash('sha256').update(content).digest('hex'); } /** * Safe file deletion - handles EBUSY, ENOENT gracefully */ -function safeUnlink(filePath: string): boolean { +async function safeUnlink(filePath: string): Promise { try { - if (fs.existsSync(filePath)) { - fs.unlinkSync(filePath); - return true; - } + await fs.promises.unlink(filePath); + return true; } catch (err) { const error = err as NodeJS.ErrnoException; // Ignore common non-critical errors @@ -82,73 +60,68 @@ function safeUnlink(filePath: string): boolean { // Re-throw unexpected errors throw err; } - return false; } /** * Clean up partial output files on failure */ -function cleanup(tempPath?: string): void { +async function cleanup(tempPath?: string): Promise { console.log('Cleaning up...'); - if (tempPath) safeUnlink(tempPath); - safeUnlink(outputPath); - safeUnlink(hashPath); + if (tempPath) await safeUnlink(tempPath); + await safeUnlink(OUTPUT_PATH); + await safeUnlink(HASH_PATH); } /** * Validate input file exists and is readable */ -function validateInput(): void { - if (!fs.existsSync(inputPath)) { - throw new Error(`Input file not found: ${inputPath}`); +async function validateInput(): Promise { + try { + await fs.promises.access(INPUT_PATH, fs.constants.R_OK); + } catch (err) { + const error = err as NodeJS.ErrnoException; + if (error.code === 'ENOENT') { + throw new Error(`Input file not found: ${INPUT_PATH}`); + } + throw new Error(`Input file is not readable: ${INPUT_PATH}`); } - const stats = fs.statSync(inputPath); + const stats = await fs.promises.stat(INPUT_PATH); if (!stats.isFile()) { - throw new Error(`Input path is not a file: ${inputPath}`); + throw new Error(`Input path is not a file: ${INPUT_PATH}`); } if (stats.size === 0) { - throw new Error(`Input file is empty: ${inputPath}`); - } - - try { - fs.accessSync(inputPath, fs.constants.R_OK); - } catch { - throw new Error(`Input file is not readable: ${inputPath}`); + throw new Error(`Input file is empty: ${INPUT_PATH}`); } } /** * Check if build can be skipped (input unchanged) */ -function checkBuildCache(inputHash: string, force: boolean): boolean { +async function checkBuildCache(inputHash: string, force: boolean): Promise { if (force) { console.log(' โ†’ Force flag set, skipping cache check'); return false; } // Check if output exists - if (!fs.existsSync(outputPath)) { + try { + await fs.promises.access(OUTPUT_PATH); + } catch { console.log(' โ†’ Output file missing, rebuild required'); return false; } - // Check if hash file exists - if (!fs.existsSync(cacheHashPath)) { - console.log(' โ†’ Cache hash missing, rebuild required'); - return false; - } - - // Compare input hash with cached hash + // Check if hash file exists and compare try { - const cachedHash = fs.readFileSync(cacheHashPath, 'utf-8').trim(); + const cachedHash = (await fs.promises.readFile(CACHE_HASH_PATH, 'utf-8')).trim(); if (cachedHash === inputHash) { return true; // Cache hit - no rebuild needed } console.log(' โ†’ Input changed, rebuild required'); } catch { - console.log(' โ†’ Cache read failed, rebuild required'); + console.log(' โ†’ Cache hash missing or read failed, rebuild required'); } return false; @@ -157,8 +130,8 @@ function checkBuildCache(inputHash: string, force: boolean): boolean { /** * Verify output file has valid JavaScript syntax (without executing) */ -function verifySyntax(filePath: string): void { - const content = fs.readFileSync(filePath, 'utf-8'); +async function verifySyntax(filePath: string): Promise { + const content = await fs.promises.readFile(filePath, 'utf-8'); try { // Use vm.Script to parse without executing @@ -173,31 +146,33 @@ function verifySyntax(filePath: string): void { /** * Verify output file is valid */ -function verifyOutput(filePath: string): void { - if (!fs.existsSync(filePath)) { +async function verifyOutput(filePath: string): Promise { + try { + await fs.promises.access(filePath); + } catch { throw new Error(`Output file was not created: ${filePath}`); } - const stats = fs.statSync(filePath); + const stats = await fs.promises.stat(filePath); if (stats.size === 0) { throw new Error(`Output file is empty: ${filePath}`); } // Syntax check without execution (no side effects) - verifySyntax(filePath); + await verifySyntax(filePath); } /** * Atomic file write: write to temp, then rename */ -function atomicWriteFile(targetPath: string, content: string): string { +async function atomicWriteFile(targetPath: string, content: string): Promise { const tempPath = path.join( os.tmpdir(), `build-executor-${crypto.randomUUID()}.tmp` ); - fs.writeFileSync(tempPath, content, 'utf-8'); - fs.renameSync(tempPath, targetPath); + await fs.promises.writeFile(tempPath, content, 'utf-8'); + await fs.promises.rename(tempPath, targetPath); return tempPath; } @@ -205,16 +180,16 @@ function atomicWriteFile(targetPath: string, content: string): string { /** * Write hash to .sha256 file for runtime verification */ -function writeHashFile(hash: string): void { +async function writeHashFile(hash: string): Promise { const content = `${hash} direct-executor.js\n`; - atomicWriteFile(hashPath, content); + await atomicWriteFile(HASH_PATH, content); } /** * Save input hash for build caching */ -function saveBuildCache(inputHash: string): void { - atomicWriteFile(cacheHashPath, inputHash); +async function saveBuildCache(inputHash: string): Promise { + await atomicWriteFile(CACHE_HASH_PATH, inputHash); } /** @@ -238,23 +213,22 @@ async function build(): Promise { let tempOutputPath: string | undefined; console.log('=== Building direct-executor ==='); - console.log(`Input: ${inputPath}`); - console.log(`Output: ${outputPath}`); + console.log(`Input: ${INPUT_PATH}`); + console.log(`Output: ${OUTPUT_PATH}`); // Step 1: Validate dependencies console.log('\n[1/7] Checking dependencies...'); - const esbuild = await validateDependencies(); console.log(' โœ“ esbuild available'); // Step 2: Validate input console.log('\n[2/7] Validating input file...'); - validateInput(); - const inputHash = calculateHash(inputPath); + await validateInput(); + const inputHash = await calculateHash(INPUT_PATH); console.log(` โœ“ Input valid (SHA256: ${inputHash.substring(0, 16)}...)`); // Step 3: Check build cache console.log('\n[3/7] Checking build cache...'); - if (checkBuildCache(inputHash, forceRebuild)) { + if (await checkBuildCache(inputHash, forceRebuild)) { console.log(' โœ“ Build cache valid - skipping rebuild'); console.log('\n=== Build skipped (up to date) ==='); return; @@ -265,7 +239,7 @@ async function build(): Promise { tempOutputPath = path.join(os.tmpdir(), `direct-executor-${crypto.randomUUID()}.js`); const result = await esbuild.build({ - entryPoints: [inputPath], + entryPoints: [INPUT_PATH], bundle: true, platform: 'node', target: 'node18', @@ -289,7 +263,7 @@ async function build(): Promise { console.error(` at ${error.location.file}:${error.location.line}:${error.location.column}`); } } - cleanup(tempOutputPath); + await cleanup(tempOutputPath); process.exit(1); } @@ -308,29 +282,29 @@ async function build(): Promise { // Step 5: Verify output (syntax check, no execution) console.log('\n[5/7] Verifying output syntax...'); - verifyOutput(tempOutputPath); + await verifyOutput(tempOutputPath); console.log(' โœ“ Output has valid JavaScript syntax'); // Step 6: Atomic move to final location console.log('\n[6/7] Finalizing output...'); - fs.renameSync(tempOutputPath, outputPath); + await fs.promises.rename(tempOutputPath, OUTPUT_PATH); tempOutputPath = undefined; // Clear so cleanup doesn't try to delete console.log(' โœ“ Output written atomically'); // Step 7: Write hash files and cache console.log('\n[7/7] Writing integrity hash...'); - const outputHash = calculateHash(outputPath); - writeHashFile(outputHash); - saveBuildCache(inputHash); + const outputHash = await calculateHash(OUTPUT_PATH); + await writeHashFile(outputHash); + await saveBuildCache(inputHash); console.log(` โœ“ SHA256: ${outputHash}`); - console.log(` โœ“ Hash saved to: ${hashPath}`); + console.log(` โœ“ Hash saved to: ${HASH_PATH}`); // Print summary - const stats = fs.statSync(outputPath); + const stats = await fs.promises.stat(OUTPUT_PATH); console.log('\n=== Build complete! ==='); console.log('โ”€'.repeat(50)); - console.log(` Output: ${outputPath}`); - console.log(` Hash file: ${hashPath}`); + console.log(` Output: ${OUTPUT_PATH}`); + console.log(` Hash file: ${HASH_PATH}`); console.log(` Size: ${(stats.size / 1024).toFixed(1)} KB`); console.log(` Input hash: ${inputHash.substring(0, 16)}...`); console.log(` Output hash: ${outputHash.substring(0, 16)}...`); @@ -338,13 +312,13 @@ async function build(): Promise { } // Run build with proper error handling -build().catch((err) => { +build().catch(async (err) => { const error = err as Error; console.error(`\nโŒ Build failed: ${error.message}`); if (error.stack) { console.error('\nStack trace:'); console.error(error.stack.split('\n').slice(1, 5).join('\n')); } - cleanup(); + await cleanup(); process.exit(1); }); diff --git a/plugins/lib/compiler.ts b/plugins/lib/compiler.ts index 63a18a447..b69ec1705 100644 --- a/plugins/lib/compiler.ts +++ b/plugins/lib/compiler.ts @@ -15,7 +15,6 @@ import * as esbuild from 'esbuild'; import type { Message } from 'esbuild'; import * as fs from 'node:fs'; import * as path from 'node:path'; -import * as os from 'node:os'; /** Maximum source file size (5MB) */ const MAX_SOURCE_SIZE = 5 * 1024 * 1024; @@ -130,33 +129,20 @@ function normalizeErrorCode(code: unknown): CompilationErrorCode { /** * Sanitize file path for safe error messages. - * Replaces user home directories and absolute paths with safe alternatives. + * Replaces absolute paths with relative alternatives for cleaner, portable error messages. * * @param filePath - The file path to sanitize * @returns Sanitized path safe for error messages */ function sanitizePath(filePath: string): string { - let sanitized = filePath; - - // Replace current working directory with '.' + // Replace current working directory with '.' for relative paths const cwd = process.cwd(); - if (sanitized.startsWith(cwd)) { - sanitized = '.' + sanitized.slice(cwd.length); - } - - // Replace home directories with '~' - const homeDir = os.homedir(); - if (sanitized.startsWith(homeDir)) { - sanitized = '~' + sanitized.slice(homeDir.length); + if (filePath.startsWith(cwd)) { + return '.' + filePath.slice(cwd.length); } - // Platform-specific home directory patterns - sanitized = sanitized - .replace(/\/home\/[^/]+/g, '~') - .replace(/\/Users\/[^/]+/g, '~') - .replace(/C:\\Users\\[^\\]+/gi, '~'); - - return sanitized; + // If path is outside CWD, return as-is (already absolute or relative) + return filePath; } /** @@ -394,7 +380,6 @@ export async function compilePluginSource( const doCompile = async (): Promise => { try { // Use esbuild.build() with stdin to bundle imports - // This is CRITICAL - transform() does not resolve imports! const result = await esbuild.build({ stdin: { contents: sourceCode, @@ -405,7 +390,7 @@ export async function compilePluginSource( bundle: true, // CRITICAL: Bundle to resolve and inline all imports platform: 'node', target: opts.target, - format: 'cjs', // CommonJS for vm.Script compatibility + format: 'cjs', // CommonJS for Function constructor compatibility (executed via new Function()) sourcemap: opts.sourcemap === 'external' ? true : opts.sourcemap === 'inline' ? 'inline' : false, minify: opts.minify, write: false, // Keep in memory, don't write to disk @@ -545,19 +530,20 @@ export async function compilePlugins( /** * Creates a wrapped version of compiled code that exports the handler. - * This wrapping is necessary for vm.Script execution. + * + * @deprecated This function is no longer used internally. The compiled code is executed + * directly via `new Function()` constructor in direct-executor.ts. This function is kept + * for backward compatibility but may be removed in a future version. * * @param compiledCode - The compiled JavaScript code - * @returns Wrapped code ready for vm.Script + * @returns Wrapped code as an IIFE * @throws Error if input is invalid * * @example * ```typescript * const compiled = await compilePluginSource(source, 'plugin.ts'); * const wrapped = wrapForVm(compiled.code); - * const script = new vm.Script(wrapped); - * const factory = script.runInContext(context); - * factory(exports, require, module, __filename, __dirname); + * // Note: This is legacy code. Current execution uses new Function() directly. * ``` */ export function wrapForVm(compiledCode: string): string { @@ -577,11 +563,10 @@ export function wrapForVm(compiledCode: string): string { } // The compiled code uses CommonJS (module.exports / exports.handler) - // We wrap it in an IIFE to capture the exports in the vm context + // We wrap it in an IIFE for legacy vm.Script compatibility return ` (function(exports, require, module, __filename, __dirname) { ${compiledCode} }); `; } - diff --git a/plugins/lib/direct-executor.ts b/plugins/lib/direct-executor.ts index 2ac444c4a..19187c972 100644 --- a/plugins/lib/direct-executor.ts +++ b/plugins/lib/direct-executor.ts @@ -777,15 +777,21 @@ export default async function executePlugin(task: ExecutorTask): Promise((_, reject) => { - setTimeout(() => { + timeoutId = setTimeout(() => { const error = new Error(`Plugin handler timed out after ${task.timeout}ms`); (error as any).code = 'ERR_HANDLER_TIMEOUT'; reject(error); }, task.timeout); }); - result = await Promise.race([handlerPromise, timeoutPromise]); + try { + result = await Promise.race([handlerPromise, timeoutPromise]); + } finally { + // Clear timeout if handler completed before timeout + if (timeoutId) clearTimeout(timeoutId); + } return { taskId: task.taskId, diff --git a/src/repositories/plugin/plugin_redis.rs b/src/repositories/plugin/plugin_redis.rs index 12984956f..9576301d5 100644 --- a/src/repositories/plugin/plugin_redis.rs +++ b/src/repositories/plugin/plugin_redis.rs @@ -399,19 +399,20 @@ impl PluginRepositoryTrait for RedisPluginRepository { debug!(plugin_id = %plugin_id, "storing compiled code in Redis"); - // Store the compiled code - conn.set::<_, _, ()>(&code_key, compiled_code) - .await - .map_err(|e| self.map_redis_error(e, &format!("store_compiled_code_{plugin_id}")))?; + // Use pipeline to store both code and hash atomically + let mut pipe = redis::pipe(); + pipe.atomic(); + pipe.set(&code_key, compiled_code); - // Store source hash if provided if let Some(hash) = source_hash { let hash_key = self.source_hash_key(plugin_id); - conn.set::<_, _, ()>(&hash_key, hash) - .await - .map_err(|e| self.map_redis_error(e, &format!("store_source_hash_{plugin_id}")))?; + pipe.set(&hash_key, hash); } + pipe.exec_async(&mut conn) + .await + .map_err(|e| self.map_redis_error(e, &format!("store_compiled_code_{plugin_id}")))?; + Ok(()) } @@ -422,14 +423,15 @@ impl PluginRepositoryTrait for RedisPluginRepository { debug!(plugin_id = %plugin_id, "invalidating compiled code in Redis"); - // Delete the compiled code and hash - conn.del::<_, ()>(&code_key) - .await - .map_err(|e| self.map_redis_error(e, &format!("delete_compiled_code_{plugin_id}")))?; + // Use pipeline to delete both keys atomically + let mut pipe = redis::pipe(); + pipe.atomic(); + pipe.del(&code_key); + pipe.del(&hash_key); - conn.del::<_, ()>(&hash_key) - .await - .map_err(|e| self.map_redis_error(e, &format!("delete_source_hash_{plugin_id}")))?; + pipe.exec_async(&mut conn).await.map_err(|e| { + self.map_redis_error(e, &format!("invalidate_compiled_code_{plugin_id}")) + })?; Ok(()) } diff --git a/stress.js b/stress.js new file mode 100644 index 000000000..1d28de686 --- /dev/null +++ b/stress.js @@ -0,0 +1,19 @@ +import http from "k6/http"; +import { check, sleep } from "k6"; + +export const options = { + vus: 2000, // virtual users + duration: "90s", // test duration +}; + +export default function () { + const params = { + headers: { + "Content-Type": "application/json", + "Authorization": "Bearer 2cc7ec17-45ca-4498-ba86-517ef0788b8c", + }, + }; + const res = http.get("http://localhost:8080/api/v1/relayers", params); + check(res, { "status is 200": (r) => r.status === 200 }); + sleep(1); +} From 38f6d77af1879b2cdf05b6554d612fe667c4337b Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 18 Jan 2026 01:26:08 +0100 Subject: [PATCH 24/42] chore: Improvements --- .gitignore | 4 +-- build.rs | 14 +++++----- docs/plugins/index.mdx | 2 +- plugins/ARCHITECTURE.md | 4 +-- plugins/lib/build-executor.ts | 18 ++++++------- plugins/lib/compiler.ts | 2 +- plugins/lib/direct-executor.js.sha256 | 1 + plugins/lib/executor.ts | 17 +++++++++--- plugins/lib/plugin.ts | 22 +++++++++++++++- .../{direct-executor.ts => pool-executor.ts} | 26 ++++++++++++++++--- plugins/lib/worker-pool.ts | 14 +++++----- 11 files changed, 87 insertions(+), 37 deletions(-) create mode 100644 plugins/lib/direct-executor.js.sha256 rename plugins/lib/{direct-executor.ts => pool-executor.ts} (94%) diff --git a/.gitignore b/.gitignore index 5c8ab9440..462c66c54 100644 --- a/.gitignore +++ b/.gitignore @@ -71,11 +71,11 @@ test-results/ **/*lcov.info # Pre-compiled plugin executor (generated at build time) -plugins/lib/direct-executor.js +plugins/lib/pool-executor.js # Build executor cache files plugins/lib/.build-cache-hash -plugins/lib/direct-executor.js.sha256 +plugins/lib/pool-executor.js.sha256 # TypeScript compiled output in plugins (we use ts-node for runtime) plugins/**/*.js diff --git a/build.rs b/build.rs index 1c9ed8c9d..efb0b1321 100644 --- a/build.rs +++ b/build.rs @@ -9,11 +9,11 @@ fn main() { } let node_modules = plugins_dir.join("node_modules"); - let direct_executor_ts = plugins_dir.join("lib/direct-executor.ts"); - let direct_executor_js = plugins_dir.join("lib/direct-executor.js"); + let pool_executor_ts = plugins_dir.join("lib/pool-executor.ts"); + let pool_executor_js = plugins_dir.join("lib/pool-executor.js"); // Tell Cargo when to rerun this script - println!("cargo:rerun-if-changed=plugins/lib/direct-executor.ts"); + println!("cargo:rerun-if-changed=plugins/lib/pool-executor.ts"); println!("cargo:rerun-if-changed=plugins/package.json"); // Check if pnpm is available @@ -49,14 +49,14 @@ fn main() { } } - // Build direct-executor if source is newer than output (or output missing) - let needs_build = if !direct_executor_js.exists() { + // Build pool-executor if source is newer than output (or output missing) + let needs_build = if !pool_executor_js.exists() { true } else { // Compare modification times match ( - direct_executor_ts.metadata().and_then(|m| m.modified()), - direct_executor_js.metadata().and_then(|m| m.modified()), + pool_executor_ts.metadata().and_then(|m| m.modified()), + pool_executor_js.metadata().and_then(|m| m.modified()), ) { (Ok(src_time), Ok(out_time)) => src_time > out_time, _ => true, // Rebuild if we can't determine diff --git a/docs/plugins/index.mdx b/docs/plugins/index.mdx index b6646a6a2..84f3acaed 100644 --- a/docs/plugins/index.mdx +++ b/docs/plugins/index.mdx @@ -919,5 +919,5 @@ The architecture documentation covers: | **Pool Executor** | `src/services/plugins/pool_executor.rs` | Manages Node.js process and connections | | **Configuration** | `src/services/plugins/config.rs` | Auto-derivation logic for all env vars | | **Pool Server** | `plugins/lib/pool-server.ts` | Node.js server accepting plugin requests | -| **Executor** | `plugins/lib/direct-executor.ts` | Plugin execution | +| **Executor** | `plugins/lib/pool-executor.ts` | Plugin execution | | **Plugin SDK** | `plugins/lib/plugin.ts` | PluginContext and API for plugins | diff --git a/plugins/ARCHITECTURE.md b/plugins/ARCHITECTURE.md index 9ac528e03..326e6b6cf 100644 --- a/plugins/ARCHITECTURE.md +++ b/plugins/ARCHITECTURE.md @@ -57,7 +57,7 @@ Developer guide for understanding and modifying the plugin execution system. |--------|---------| | `pool-server.ts` | Main server - accepts connections, routes to workers, manages memory | | `worker-pool.ts` | Piscina wrapper with dynamic scaling and cache management | -| `direct-executor.ts` | Plugin execution | +| `pool-executor.ts` | Plugin execution | | `compiler.ts` | TypeScript/JavaScript compilation with esbuild | | `plugin.ts` | Plugin SDK (PluginContext, PluginAPI) | | `kv.ts` | Redis-backed key-value store for plugins | @@ -129,7 +129,7 @@ Per-request socket at `/tmp/relayer-shared-{uuid}.sock` for plugin API calls. โ”‚ 5. pool-server routes to Piscina worker โ”‚ -6. direct-executor.ts runs plugin in VM +6. pool-executor.ts runs plugin in VM โ”‚ โ”œโ”€ Plugin calls api.useRelayer().sendTransaction() โ”‚ โ””โ”€ Communicates via shared socket to Rust diff --git a/plugins/lib/build-executor.ts b/plugins/lib/build-executor.ts index 267b1f6e0..d3290919f 100644 --- a/plugins/lib/build-executor.ts +++ b/plugins/lib/build-executor.ts @@ -1,8 +1,8 @@ #!/usr/bin/env ts-node /** - * Build script to pre-compile direct-executor.ts + * Build script to pre-compile pool-executor.ts * - * Run this during build/release to generate direct-executor.js + * Run this during build/release to generate pool-executor.js * This avoids any runtime compilation overhead. * * Usage: npx ts-node build-executor.ts @@ -25,9 +25,9 @@ import * as vm from 'node:vm'; import * as os from 'node:os'; import * as esbuild from 'esbuild'; -const INPUT_PATH = path.resolve(__dirname, 'direct-executor.ts'); -const OUTPUT_PATH = path.resolve(__dirname, 'direct-executor.js'); -const HASH_PATH = path.resolve(__dirname, 'direct-executor.js.sha256'); +const INPUT_PATH = path.resolve(__dirname, 'pool-executor.ts'); +const OUTPUT_PATH = path.resolve(__dirname, 'pool-executor.js'); +const HASH_PATH = path.resolve(__dirname, 'pool-executor.js.sha256'); const CACHE_HASH_PATH = path.resolve(__dirname, '.build-cache-hash'); /** @@ -181,7 +181,7 @@ async function atomicWriteFile(targetPath: string, content: string): Promise { - const content = `${hash} direct-executor.js\n`; + const content = `${hash} pool-executor.js\n`; await atomicWriteFile(HASH_PATH, content); } @@ -202,7 +202,7 @@ function generateBanner(inputHash: string): string { * Auto-generated by build-executor.ts * Build time: ${now} * Node version: ${nodeVersion} - * Source: direct-executor.ts + * Source: pool-executor.ts * Source hash: ${inputHash.substring(0, 16)} * DO NOT EDIT - Regenerate with: npx ts-node build-executor.ts */`; @@ -212,7 +212,7 @@ async function build(): Promise { const forceRebuild = process.argv.includes('--force'); let tempOutputPath: string | undefined; - console.log('=== Building direct-executor ==='); + console.log('=== Building pool-executor ==='); console.log(`Input: ${INPUT_PATH}`); console.log(`Output: ${OUTPUT_PATH}`); @@ -236,7 +236,7 @@ async function build(): Promise { // Step 4: Build to temp file (atomic write preparation) console.log('\n[4/7] Compiling TypeScript...'); - tempOutputPath = path.join(os.tmpdir(), `direct-executor-${crypto.randomUUID()}.js`); + tempOutputPath = path.join(os.tmpdir(), `pool-executor-${crypto.randomUUID()}.js`); const result = await esbuild.build({ entryPoints: [INPUT_PATH], diff --git a/plugins/lib/compiler.ts b/plugins/lib/compiler.ts index b69ec1705..570cadab8 100644 --- a/plugins/lib/compiler.ts +++ b/plugins/lib/compiler.ts @@ -532,7 +532,7 @@ export async function compilePlugins( * Creates a wrapped version of compiled code that exports the handler. * * @deprecated This function is no longer used internally. The compiled code is executed - * directly via `new Function()` constructor in direct-executor.ts. This function is kept + * directly via `new Function()` constructor in pool-executor.ts. This function is kept * for backward compatibility but may be removed in a future version. * * @param compiledCode - The compiled JavaScript code diff --git a/plugins/lib/direct-executor.js.sha256 b/plugins/lib/direct-executor.js.sha256 new file mode 100644 index 000000000..046f005e3 --- /dev/null +++ b/plugins/lib/direct-executor.js.sha256 @@ -0,0 +1 @@ +4511a86590107c2b3495302e1af023ebd0925e6ee437e90ba65a317b84aad791 direct-executor.js diff --git a/plugins/lib/executor.ts b/plugins/lib/executor.ts index 015c0c545..b3c1334eb 100644 --- a/plugins/lib/executor.ts +++ b/plugins/lib/executor.ts @@ -1,12 +1,21 @@ #!/usr/bin/env node /** - * Plugin executor script for executing user plugins + * Legacy Plugin Executor (ts-node mode) * - * This is the main entry point for executing specific plugins from the Rust environment. - * It serves as a bridge between the Rust relayer and TypeScript plugin ecosystem. + * **โš ๏ธ Legacy/Fallback Implementation** + * This executor is used only when pool-based execution is disabled (`PLUGIN_USE_POOL=false`). + * The default execution mode uses the pool executor (`pool-executor.ts`), which is faster + * and more efficient. This ts-node executor spawns a new process per request, which is + * slower but simpler. * - * Called from: src/services/plugins/script_executor.rs + * **Default Execution Path**: Pool executor (`pool-executor.ts`) via `pool-server.ts` โ†’ + * `worker-pool.ts` โ†’ `pool-executor.ts` (Piscina workers) + * + * **Legacy Execution Path**: This executor (`executor.ts`) via `script_executor.rs` โ†’ + * ts-node โ†’ `executor.ts` (one-shot process per request) + * + * Called from: `src/services/plugins/script_executor.rs` (only when `PLUGIN_USE_POOL=false`) * The Rust code invokes this script via ts-node and passes parameters as command line arguments. * * This script: diff --git a/plugins/lib/plugin.ts b/plugins/lib/plugin.ts index a71c81fab..a41ed928c 100644 --- a/plugins/lib/plugin.ts +++ b/plugins/lib/plugin.ts @@ -401,7 +401,27 @@ export async function loadAndExecutePlugin( } /** - * The plugin API. + * Plugin API implementation for direct execution mode (ts-node). + * + * **โš ๏ธ Legacy/Fallback Implementation** + * This implementation is used by `executor.ts` when Rust calls plugins via `ts-node` directly + * (see `src/services/plugins/script_executor.rs`). This is the legacy execution path, enabled + * only when `PLUGIN_USE_POOL=false`. The default execution mode uses the pool executor + * (`PluginAPIImpl` in `pool-executor.ts`), which is faster and more efficient. + * + * **Note**: New features should be added to the pool executor (`PluginAPIImpl`), not this + * implementation, as pool executor is the default and preferred path. + * + * **Why a separate implementation?** + * This implementation has different requirements than the worker pool implementation: + * + * - **Registration protocol**: Sends a `register` message with `execution_id` after connection + * (required by the direct execution protocol) + * - **One-shot lifecycle**: Process exits after plugin completes, so no socket pooling needed + * - **Immediate connection**: Connects in constructor since it's a single-use process + * - **Protocol support**: Handles both new protocol (`api_request`/`api_response`) and legacy format + * + * **See also**: `PluginAPIImpl` in `pool-executor.ts` for the worker pool implementation (default). * * @property useRelayer - Creates a relayer API for the given relayer ID. * @property sendTransaction - Sends a transaction to the relayer. diff --git a/plugins/lib/direct-executor.ts b/plugins/lib/pool-executor.ts similarity index 94% rename from plugins/lib/direct-executor.ts rename to plugins/lib/pool-executor.ts index 19187c972..4f3d2a0ea 100644 --- a/plugins/lib/direct-executor.ts +++ b/plugins/lib/pool-executor.ts @@ -289,9 +289,29 @@ export interface LogEntry { } /** - * Plugin API that communicates with the relayer via Unix socket. - * Connection is lazy - only established when first API call is made. - * Uses socket pooling to reduce connection overhead. + * Plugin API implementation for worker pool execution mode (Piscina workers). + * + * **โœ… Default Implementation (Preferred)** + * This is the default and preferred plugin execution path. It's used when plugins run in + * Piscina worker threads (see `pool-server.ts` โ†’ `worker-pool.ts` โ†’ `pool-executor.ts`). + * Pool mode is enabled by default for better performance and is the recommended execution + * mode for production deployments. + * + * **Why a separate implementation?** + * This implementation has different requirements than the legacy ts-node execution: + * + * - **Socket pooling**: Reuses sockets across multiple plugin executions in the same worker thread + * (critical for performance in high-concurrency scenarios) + * - **No registration protocol**: Worker pool uses a different communication model that doesn't + * require registration messages (simpler and more efficient) + * - **Lazy connection**: Connects only when first API call is made (better for worker lifecycle) + * - **EPIPE retry logic**: Handles stale pooled sockets that were closed by the server but client + * doesn't know yet (common with 60-second connection lifetime) + * - **Handler cleanup**: Properly removes socket listeners before returning to pool to prevent + * listener accumulation (MaxListenersExceededWarning) + * + * **See also**: `DefaultPluginAPI` in `plugin.ts` for the legacy ts-node execution implementation + * (fallback mode, enabled only when `PLUGIN_USE_POOL=false`). */ class PluginAPIImpl implements PluginAPI { private socket: net.Socket | null = null; diff --git a/plugins/lib/worker-pool.ts b/plugins/lib/worker-pool.ts index 7609a54af..eb6f04cd1 100644 --- a/plugins/lib/worker-pool.ts +++ b/plugins/lib/worker-pool.ts @@ -29,7 +29,7 @@ import * as os from 'node:os'; import * as v8 from 'node:v8'; import { v4 as uuidv4 } from 'uuid'; import { compilePlugin, compilePluginSource, type CompilationResult } from './compiler'; -import type { ExecutorTask, ExecutorResult, LogEntry } from './direct-executor'; +import type { ExecutorTask, ExecutorResult, LogEntry } from './pool-executor'; import type { PluginHeaders } from './plugin'; import { DEFAULT_POOL_MIN_THREADS, @@ -121,7 +121,7 @@ const DEFAULT_OPTIONS: Required = { * Path to the pre-compiled sandbox executor. * This file is generated at build time by running: npx ts-node build-executor.ts */ -const PRECOMPILED_EXECUTOR_PATH = path.resolve(__dirname, 'direct-executor.js'); +const PRECOMPILED_EXECUTOR_PATH = path.resolve(__dirname, 'pool-executor.js'); /** * Metrics tracking for plugin execution @@ -488,7 +488,7 @@ export class WorkerPoolManager { * Initialize the worker pool. * Call this before executing any plugins. * - * Uses pre-compiled direct-executor.js if available, + * Uses pre-compiled pool-executor.js if available, * otherwise compiles it on-the-fly (slower first startup). * * Thread-safe: multiple concurrent calls will await the same initialization. @@ -518,7 +518,7 @@ export class WorkerPoolManager { * Internal initialization logic. */ private async doInitialize(): Promise { - // Use pre-compiled direct-executor.js if it exists + // Use pre-compiled pool-executor.js if it exists if (fs.existsSync(PRECOMPILED_EXECUTOR_PATH)) { this.compiledWorkerPath = PRECOMPILED_EXECUTOR_PATH; this.isTemporaryWorkerFile = false; @@ -617,7 +617,7 @@ export class WorkerPoolManager { * This is slower but ensures the pool can start in any environment. */ private async compileExecutorOnTheFly(): Promise { - const sandboxExecutorPath = path.resolve(__dirname, 'direct-executor.ts'); + const sandboxExecutorPath = path.resolve(__dirname, 'pool-executor.ts'); const esbuild = await import('esbuild'); const result = await esbuild.build({ @@ -633,7 +633,7 @@ export class WorkerPoolManager { }); // Write to temp file - const tempPath = path.join(os.tmpdir(), `direct-executor-${uuidv4()}.js`); + const tempPath = path.join(os.tmpdir(), `pool-executor-${uuidv4()}.js`); fs.writeFileSync(tempPath, result.outputFiles[0].text); return tempPath; } @@ -798,7 +798,7 @@ export class WorkerPoolManager { incrementBoundedMap(this.metrics.pluginExecutions, request.pluginId, MAX_METRICS_ENTRIES); // Use task timeout to prevent permanently stuck workers - // This is a safety net beyond the handler-level timeout in direct-executor + // This is a safety net beyond the handler-level timeout in pool-executor const taskTimeout = this.options.taskTimeout; let timeoutId: NodeJS.Timeout | undefined; From d13975b49834fe59c105c84b2e7932d4b6275140 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 18 Jan 2026 09:06:59 +0100 Subject: [PATCH 25/42] chore: Add tsnode to dev deps --- plugins/lib/direct-executor.js.sha256 | 1 - plugins/package.json | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/lib/direct-executor.js.sha256 diff --git a/plugins/lib/direct-executor.js.sha256 b/plugins/lib/direct-executor.js.sha256 deleted file mode 100644 index 046f005e3..000000000 --- a/plugins/lib/direct-executor.js.sha256 +++ /dev/null @@ -1 +0,0 @@ -4511a86590107c2b3495302e1af023ebd0925e6ee437e90ba65a317b84aad791 direct-executor.js diff --git a/plugins/package.json b/plugins/package.json index b1ffc96bc..446aed7e4 100644 --- a/plugins/package.json +++ b/plugins/package.json @@ -30,6 +30,7 @@ "ioredis-mock": "^8.9.0", "jest": "^29.7.0", "ts-jest": "^29.1.2", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "ts-node": "^10.9.2" } } From fb9acafbd09d25753cc0324be99edb2ec2b7c891 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 18 Jan 2026 09:12:55 +0100 Subject: [PATCH 26/42] chore: Update deps --- .../channel/pnpm-lock.yaml | 22 +-- plugins/package.json | 2 +- plugins/pnpm-lock.yaml | 128 +++++++++++++++--- 3 files changed, 119 insertions(+), 33 deletions(-) diff --git a/examples/channels-plugin-example/channel/pnpm-lock.yaml b/examples/channels-plugin-example/channel/pnpm-lock.yaml index f4f93fc2a..1e028f30d 100644 --- a/examples/channels-plugin-example/channel/pnpm-lock.yaml +++ b/examples/channels-plugin-example/channel/pnpm-lock.yaml @@ -7,11 +7,11 @@ importers: .: dependencies: '@openzeppelin/relayer-plugin-channels': - specifier: ^0.5.0 - version: 0.5.0 + specifier: ^0.6.0 + version: 0.6.0 '@openzeppelin/relayer-sdk': - specifier: ^1.8.0 - version: 1.8.0 + specifier: ^1.9.0 + version: 1.9.0 devDependencies: '@types/jest': specifier: ^29.5.12 @@ -252,11 +252,11 @@ packages: '@noble/hashes@1.8.0': resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==} engines: {node: ^14.21.3 || >=16} - '@openzeppelin/relayer-plugin-channels@0.5.0': - resolution: {integrity: sha512-mn8TklTFwwqKVVOjYQtJGGX/8IKJwg4hbwfAsz7kvb5L5EhjJzwCjgfT84TL6ZVmHb7DoQ6h2lPgNussDiHy5g==} + '@openzeppelin/relayer-plugin-channels@0.6.0': + resolution: {integrity: sha512-vqNi6TXuu7LNbc1NoGfUD9vh+egBMB/vhwf03idzWhKPdNLVUzGE+PV7fzQNjHkpbTROs+d7vnBEdA8CJxo5gQ==} engines: {node: '>=22.18.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} - '@openzeppelin/relayer-sdk@1.8.0': - resolution: {integrity: sha512-2nMn9Sg0j52kp/GdhavvL8zgwRJqDqXq4yM1uYewfYndns6WGUS3zxcDICgHenMVURo8YWdJG7E7Ockck3SNFg==} + '@openzeppelin/relayer-sdk@1.9.0': + resolution: {integrity: sha512-G3Zhg0imaT9Ej1cE9Cq5d4uQvW+DinD2GvRuiPWo3+O9KI8ivBnGJkjEGgK9Ja3/QsUNIfx8Gk5Mdw2sPXjVWA==} engines: {node: '>=22.14.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -1460,15 +1460,15 @@ snapshots: dependencies: '@noble/hashes': 1.8.0 '@noble/hashes@1.8.0': {} - '@openzeppelin/relayer-plugin-channels@0.5.0': + '@openzeppelin/relayer-plugin-channels@0.6.0': dependencies: '@actions/exec': 1.1.1 - '@openzeppelin/relayer-sdk': 1.8.0 + '@openzeppelin/relayer-sdk': 1.9.0 '@stellar/stellar-sdk': 14.4.3 axios: 1.13.2 transitivePeerDependencies: - debug - '@openzeppelin/relayer-sdk@1.8.0': + '@openzeppelin/relayer-sdk@1.9.0': dependencies: axios: 1.13.2 transitivePeerDependencies: diff --git a/plugins/package.json b/plugins/package.json index 446aed7e4..e9f7e0816 100644 --- a/plugins/package.json +++ b/plugins/package.json @@ -14,7 +14,7 @@ "author": "", "license": "", "dependencies": { - "@openzeppelin/relayer-sdk": "^1.7.0", + "@openzeppelin/relayer-sdk": "^1.9.0", "@types/node": "^24.0.3", "esbuild": "^0.24.0", "ethers": "^6.14.3", diff --git a/plugins/pnpm-lock.yaml b/plugins/pnpm-lock.yaml index caf6b8082..e50c9b435 100644 --- a/plugins/pnpm-lock.yaml +++ b/plugins/pnpm-lock.yaml @@ -7,8 +7,8 @@ importers: .: dependencies: '@openzeppelin/relayer-sdk': - specifier: ^1.7.0 - version: 1.7.0 + specifier: ^1.9.0 + version: 1.9.0 '@types/node': specifier: ^24.0.3 version: 24.9.2 @@ -45,10 +45,13 @@ importers: version: 8.13.1(@types/ioredis-mock@8.2.6(ioredis@5.8.2))(ioredis@5.8.2) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@24.9.2) + version: 29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) ts-jest: specifier: ^29.1.2 - version: 29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2))(typescript@5.9.3) + version: 29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)))(typescript@5.9.3) + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@24.9.2)(typescript@5.9.3) typescript: specifier: ^5.3.3 version: 5.9.3 @@ -185,6 +188,9 @@ packages: engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} '@esbuild/aix-ppc64@0.24.2': resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} engines: {node: '>=18'} @@ -433,6 +439,8 @@ packages: resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} '@napi-rs/nice-android-arm-eabi@1.1.1': resolution: {integrity: sha512-kjirL3N6TnRPv5iuHw36wnucNqXAO46dzK9oPb0wj076R5Xm8PfUVA9nAFB5ZNMmfJQJVKACAPd/Z2KYMppthw==} engines: {node: '>= 10'} @@ -560,8 +568,8 @@ packages: '@noble/hashes@1.3.2': resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} - '@openzeppelin/relayer-sdk@1.7.0': - resolution: {integrity: sha512-XaQDdfooj6LC9Xa2fhq0ElaF0q/+rn4D0KNKDiwUa+QdZk18LeIiKxyZKxXuA4RynXxosISe1oQW78XYC/nE6Q==} + '@openzeppelin/relayer-sdk@1.9.0': + resolution: {integrity: sha512-G3Zhg0imaT9Ej1cE9Cq5d4uQvW+DinD2GvRuiPWo3+O9KI8ivBnGJkjEGgK9Ja3/QsUNIfx8Gk5Mdw2sPXjVWA==} engines: {node: '>=22.14.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -569,6 +577,14 @@ packages: resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@tsconfig/node10@1.0.12': + resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} '@types/babel__generator@7.27.0': @@ -603,6 +619,13 @@ packages: resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} '@types/yargs@17.0.34': resolution: {integrity: sha512-KExbHVa92aJpw9WDQvzBaGVE2/Pz+pLZQloT2hjL8IqsZnV62rlPOYvNnLmf/L2dyllfVUOVBj64M0z/46eR2A==} + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + engines: {node: '>=0.4.0'} + hasBin: true aes-js@4.0.0-beta.5: resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} ansi-escapes@4.3.2: @@ -620,6 +643,8 @@ packages: anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} asynckit@0.4.0: @@ -719,6 +744,8 @@ packages: resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -752,6 +779,9 @@ packages: diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -1310,6 +1340,19 @@ packages: optional: true jest-util: optional: true + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} type-detect@4.0.8: @@ -1341,6 +1384,8 @@ packages: uuid@11.1.0: resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} hasBin: true + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} v8-to-istanbul@9.3.0: resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} engines: {node: '>=10.12.0'} @@ -1382,6 +1427,9 @@ packages: yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -1541,6 +1589,9 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 '@bcoe/v8-coverage@0.2.3': {} + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 '@esbuild/aix-ppc64@0.24.2': optional: true '@esbuild/android-arm64@0.24.2': @@ -1609,7 +1660,7 @@ snapshots: jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0': + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -1623,7 +1674,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@24.9.2) + jest-config: 29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -1763,6 +1814,10 @@ snapshots: dependencies: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 '@napi-rs/nice-android-arm-eabi@1.1.1': optional: true '@napi-rs/nice-android-arm64@1.1.1': @@ -1821,7 +1876,7 @@ snapshots: dependencies: '@noble/hashes': 1.3.2 '@noble/hashes@1.3.2': {} - '@openzeppelin/relayer-sdk@1.7.0': + '@openzeppelin/relayer-sdk@1.9.0': dependencies: axios: 1.13.1 transitivePeerDependencies: @@ -1833,6 +1888,10 @@ snapshots: '@sinonjs/fake-timers@10.3.0': dependencies: '@sinonjs/commons': 3.0.1 + '@tsconfig/node10@1.0.12': {} + '@tsconfig/node12@1.0.11': {} + '@tsconfig/node14@1.0.3': {} + '@tsconfig/node16@1.0.4': {} '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.28.5 @@ -1879,6 +1938,10 @@ snapshots: '@types/yargs@17.0.34': dependencies: '@types/yargs-parser': 21.0.3 + acorn-walk@8.3.4: + dependencies: + acorn: 8.15.0 + acorn@8.15.0: {} aes-js@4.0.0-beta.5: {} ansi-escapes@4.3.2: dependencies: @@ -1892,6 +1955,7 @@ snapshots: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 + arg@4.1.3: {} argparse@1.0.10: dependencies: sprintf-js: 1.0.3 @@ -2008,13 +2072,13 @@ snapshots: delayed-stream: 1.0.0 concat-map@0.0.1: {} convert-source-map@2.0.0: {} - create-jest@29.7.0(@types/node@24.9.2): + create-jest@29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@24.9.2) + jest-config: 29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -2022,6 +2086,7 @@ snapshots: - babel-plugin-macros - supports-color - ts-node + create-require@1.1.1: {} cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -2036,6 +2101,7 @@ snapshots: denque@2.1.0: {} detect-newline@3.1.0: {} diff-sequences@29.6.3: {} + diff@4.0.2: {} dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 @@ -2305,16 +2371,16 @@ snapshots: transitivePeerDependencies: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@24.9.2): + jest-cli@29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)): dependencies: - '@jest/core': 29.7.0 + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@24.9.2) + create-jest: 29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@24.9.2) + jest-config: 29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -2323,7 +2389,7 @@ snapshots: - babel-plugin-macros - supports-color - ts-node - jest-config@29.7.0(@types/node@24.9.2): + jest-config@29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)): dependencies: '@babel/core': 7.28.5 '@jest/test-sequencer': 29.7.0 @@ -2349,6 +2415,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 24.9.2 + ts-node: 10.9.2(@types/node@24.9.2)(typescript@5.9.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -2546,12 +2613,12 @@ snapshots: jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@24.9.2): + jest@29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)): dependencies: - '@jest/core': 29.7.0 + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@24.9.2) + jest-cli: 29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -2726,12 +2793,12 @@ snapshots: to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - ? ts-jest@29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2))(typescript@5.9.3) + ? ts-jest@29.4.5(@babel/core@7.28.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.5))(esbuild@0.24.2)(jest-util@29.7.0)(jest@29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)))(typescript@5.9.3) : dependencies: bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 handlebars: 4.7.8 - jest: 29.7.0(@types/node@24.9.2) + jest: 29.7.0(@types/node@24.9.2)(ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3)) json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 @@ -2746,6 +2813,23 @@ snapshots: babel-jest: 29.7.0(@babel/core@7.28.5) esbuild: 0.24.2 jest-util: 29.7.0 + ts-node@10.9.2(@types/node@24.9.2)(typescript@5.9.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.12 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 24.9.2 + acorn: 8.15.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.9.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 tslib@2.7.0: {} type-detect@4.0.8: {} type-fest@0.21.3: {} @@ -2761,6 +2845,7 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 uuid@11.1.0: {} + v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@9.3.0: dependencies: '@jridgewell/trace-mapping': 0.3.31 @@ -2796,4 +2881,5 @@ snapshots: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + yn@3.1.1: {} yocto-queue@0.1.0: {} From d5667d9472503c02b68f795d42e09891acf77ea0 Mon Sep 17 00:00:00 2001 From: tirumerla Date: Sun, 18 Jan 2026 14:53:03 -0800 Subject: [PATCH 27/42] chore: Add exp backoff logic --- Cargo.toml | 3 +- scripts/cleanup_stuck_stellar_txs.sh | 254 ++++++++++++++++++ src/domain/transaction/stellar/status.rs | 15 +- .../handlers/transaction_status_handler.rs | 205 ++++++++++++-- 4 files changed, 455 insertions(+), 22 deletions(-) create mode 100755 scripts/cleanup_stuck_stellar_txs.sh diff --git a/Cargo.toml b/Cargo.toml index 990356098..145a2bb26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,6 +104,7 @@ reqwest-middleware = { version = "0.4.2", default-features = false, features = [ url = "2" [dev-dependencies] +clap = { version = "4.4", features = ["derive"] } cargo-llvm-cov = "0.6" ctor = "0.2" mockall = { version = "0.13" } @@ -112,7 +113,7 @@ proptest = "1.6.0" rand = "0.9.0" tempfile = "3.2" serial_test = "3.2" -clap = { version = "4.4", features = ["derive"] } +tokio = { version = "1.43", features = ["full"] } [[bin]] diff --git a/scripts/cleanup_stuck_stellar_txs.sh b/scripts/cleanup_stuck_stellar_txs.sh new file mode 100755 index 000000000..e754592ac --- /dev/null +++ b/scripts/cleanup_stuck_stellar_txs.sh @@ -0,0 +1,254 @@ +#!/usr/bin/env bash + +############################################################################### +# Redis-based cleanup script for stuck Stellar transactions +# +# Run this ONCE after deploying the status check fixes to clean up existing +# poison transactions. +# +# This script identifies and marks as Expired transactions that: +# 1. Are Stellar network transactions +# 2. Are in Pending or Sent status (unsubmitted states) +# 3. Have missing or empty on-chain hash in network_data +# 4. Were created more than MIN_AGE_HOURS ago +# +# Usage: +# ./scripts/cleanup_stuck_stellar_txs.sh --dry-run +# ./scripts/cleanup_stuck_stellar_txs.sh --redis-url redis://localhost:6379 --key-prefix relayer +############################################################################### + +set -euo pipefail + +# Default values +REDIS_URL="redis://localhost:6379" +KEY_PREFIX="relayer" +DRY_RUN=false +MIN_AGE_HOURS=1 + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + --redis-url) + REDIS_URL="$2" + shift 2 + ;; + --key-prefix) + KEY_PREFIX="$2" + shift 2 + ;; + --dry-run) + DRY_RUN=true + shift + ;; + --min-age-hours) + MIN_AGE_HOURS="$2" + shift 2 + ;; + -h|--help) + echo "Usage: $0 [OPTIONS]" + echo "" + echo "Options:" + echo " --redis-url URL Redis connection URL (default: redis://localhost:6379)" + echo " --key-prefix PREFIX Redis key prefix (default: relayer)" + echo " --dry-run Preview mode - show what would be cleaned without making changes" + echo " --min-age-hours N Minimum age in hours before marking as expired (default: 1)" + echo " -h, --help Show this help message" + exit 0 + ;; + *) + echo "Unknown option: $1" + echo "Use --help for usage information" + exit 1 + ;; + esac +done + +# Check dependencies +if ! command -v redis-cli &> /dev/null; then + echo "ERROR: redis-cli is not installed" + exit 1 +fi + +if ! command -v jq &> /dev/null; then + echo "ERROR: jq is not installed" + exit 1 +fi + +# Extract Redis connection parameters from URL +# Format: redis://[username:password@]host:port[/database] +REDIS_HOST=$(echo "$REDIS_URL" | sed -E 's#redis://([^:@]*:)?([^@]*@)?([^:/]+).*#\3#') +REDIS_PORT=$(echo "$REDIS_URL" | sed -E 's#redis://[^:]*:([0-9]+).*#\1#') +if [[ "$REDIS_PORT" == "$REDIS_URL" ]]; then + REDIS_PORT=6379 +fi + +# Redis CLI command with connection parameters +REDIS_CMD="redis-cli -h $REDIS_HOST -p $REDIS_PORT" + +# Calculate the threshold timestamp (RFC3339 format) +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS + THRESHOLD_TIMESTAMP=$(date -u -v-${MIN_AGE_HOURS}H +"%Y-%m-%dT%H:%M:%S+00:00") +else + # Linux + THRESHOLD_TIMESTAMP=$(date -u -d "${MIN_AGE_HOURS} hours ago" +"%Y-%m-%dT%H:%M:%S+00:00") +fi + +# Current timestamp for delete_at (24 hours from now) +if [[ "$OSTYPE" == "darwin"* ]]; then + DELETE_AT_TIMESTAMP=$(date -u -v+24H +"%Y-%m-%dT%H:%M:%S+00:00") +else + DELETE_AT_TIMESTAMP=$(date -u -d "24 hours" +"%Y-%m-%dT%H:%M:%S+00:00") +fi + +# Statistics +TOTAL_SCANNED=0 +STELLAR_TRANSACTIONS=0 +STUCK_TRANSACTIONS=0 +MARKED_EXPIRED=0 + +echo "=== Redis Cleanup for Stuck Stellar Transactions ===" +echo "Redis: $REDIS_HOST:$REDIS_PORT" +echo "Key prefix: $KEY_PREFIX" +echo "Dry run: $DRY_RUN" +echo "Min age: $MIN_AGE_HOURS hours" +echo "Threshold: $THRESHOLD_TIMESTAMP" +echo "" + +# Get all relayer IDs +RELAYER_LIST_KEY="${KEY_PREFIX}:relayer_list" +RELAYER_IDS=$($REDIS_CMD SMEMBERS "$RELAYER_LIST_KEY") + +if [[ -z "$RELAYER_IDS" ]]; then + echo "No relayers found" + exit 0 +fi + +RELAYER_COUNT=$(echo "$RELAYER_IDS" | wc -l | tr -d ' ') +echo "Found $RELAYER_COUNT relayer(s)" +echo "" + +# Process each relayer +for RELAYER_ID in $RELAYER_IDS; do + echo "Processing relayer: $RELAYER_ID" + + # Get all transaction IDs for this relayer (sorted by created_at) + TX_BY_CREATED_AT_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:tx_by_created_at" + TX_IDS=$($REDIS_CMD ZRANGE "$TX_BY_CREATED_AT_KEY" 0 -1) + + if [[ -z "$TX_IDS" ]]; then + echo " No transactions found" + continue + fi + + # Process each transaction + for TX_ID in $TX_IDS; do + ((TOTAL_SCANNED++)) + + # Fetch transaction JSON + TX_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:tx:${TX_ID}" + TX_JSON=$($REDIS_CMD GET "$TX_KEY") + + if [[ -z "$TX_JSON" ]]; then + continue + fi + + # Parse transaction fields + NETWORK_TYPE=$(echo "$TX_JSON" | jq -r '.network_type') + STATUS=$(echo "$TX_JSON" | jq -r '.status') + CREATED_AT=$(echo "$TX_JSON" | jq -r '.created_at') + HASH=$(echo "$TX_JSON" | jq -r '.network_data.hash // empty') + + # Filter for Stellar transactions + if [[ "$NETWORK_TYPE" != "Stellar" ]]; then + continue + fi + ((STELLAR_TRANSACTIONS++)) + + # Check if in unsubmitted state (Pending or Sent) + if [[ "$STATUS" != "Pending" && "$STATUS" != "Sent" ]]; then + continue + fi + + # Check if hash is missing or empty + if [[ -n "$HASH" ]]; then + continue + fi + + # Check if older than threshold + if [[ "$CREATED_AT" > "$THRESHOLD_TIMESTAMP" ]]; then + continue + fi + + # This transaction is stuck! + ((STUCK_TRANSACTIONS++)) + + # Calculate age in hours + if [[ "$OSTYPE" == "darwin"* ]]; then + CREATED_EPOCH=$(date -jf "%Y-%m-%dT%H:%M:%S" "$(echo $CREATED_AT | cut -d+ -f1)" +"%s" 2>/dev/null || echo "0") + NOW_EPOCH=$(date +"%s") + else + CREATED_EPOCH=$(date -d "$CREATED_AT" +"%s" 2>/dev/null || echo "0") + NOW_EPOCH=$(date +"%s") + fi + AGE_HOURS=$(( (NOW_EPOCH - CREATED_EPOCH) / 3600 )) + + echo " [STUCK] tx_id=$TX_ID status=$STATUS created_at=$CREATED_AT age=${AGE_HOURS}h" + + if [[ "$DRY_RUN" == "true" ]]; then + ((MARKED_EXPIRED++)) + continue + fi + + # Update transaction JSON + UPDATED_TX_JSON=$(echo "$TX_JSON" | jq \ + --arg status "Expired" \ + --arg reason "Transaction stuck in unsubmitted state for too long (cleanup script)" \ + --arg delete_at "$DELETE_AT_TIMESTAMP" \ + '.status = $status | .status_reason = $reason | .delete_at = $delete_at') + + # Save updated transaction + $REDIS_CMD SET "$TX_KEY" "$UPDATED_TX_JSON" > /dev/null + + # Update status indexes + # Remove from old status SET + OLD_STATUS_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status:${STATUS}" + $REDIS_CMD SREM "$OLD_STATUS_KEY" "$TX_ID" > /dev/null + + # Remove from old status SORTED SET + OLD_STATUS_SORTED_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status_sorted:${STATUS}" + $REDIS_CMD ZREM "$OLD_STATUS_SORTED_KEY" "$TX_ID" > /dev/null + + # Add to new status SET + NEW_STATUS_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status:Expired" + $REDIS_CMD SADD "$NEW_STATUS_KEY" "$TX_ID" > /dev/null + + # Add to new status SORTED SET (score = created_at timestamp in milliseconds) + NEW_STATUS_SORTED_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status_sorted:Expired" + + # Convert RFC3339 timestamp to milliseconds since epoch + if [[ "$OSTYPE" == "darwin"* ]]; then + CREATED_MS=$(( CREATED_EPOCH * 1000 )) + else + CREATED_MS=$(( CREATED_EPOCH * 1000 )) + fi + + $REDIS_CMD ZADD "$NEW_STATUS_SORTED_KEY" "$CREATED_MS" "$TX_ID" > /dev/null + + ((MARKED_EXPIRED++)) + echo " [UPDATED] Marked as Expired" + done +done + +echo "" +echo "=== Cleanup Summary ===" +echo "Total transactions scanned: $TOTAL_SCANNED" +echo "Stellar transactions: $STELLAR_TRANSACTIONS" +echo "Stuck transactions found: $STUCK_TRANSACTIONS" +echo "Transactions marked as Expired: $MARKED_EXPIRED" + +if [[ "$DRY_RUN" == "true" ]]; then + echo "" + echo "DRY RUN MODE - No changes were made" + echo "Run without --dry-run to actually clean up these transactions" +fi diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index 2ee902d27..fa1bd2ba5 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -48,6 +48,13 @@ where return Ok(tx); } + // Early exit for unsubmitted states - they don't have on-chain hashes to check yet + // The submit handler will schedule status checks after submission + if is_unsubmitted_transaction(&tx.status) { + debug!(tx_id = %tx.id, status = ?tx.status, "transaction not yet submitted, skipping status check"); + return Ok(tx); + } + match self.status_core(tx.clone()).await { Ok(updated_tx) => { debug!( @@ -101,8 +108,12 @@ where let stellar_hash = match self.parse_and_validate_hash(&tx) { Ok(hash) => hash, Err(e) => { - // Only warn if transaction SHOULD have a hash (Submitted or later) - if !is_unsubmitted_transaction(&tx.status) { + // For unsubmitted transactions (Pending, Sent), this is expected - no hash yet + if is_unsubmitted_transaction(&tx.status) { + // Handle stuck Sent transactions (existing recovery logic below) + // No warning needed - this is normal for unsubmitted states + } else { + // Transaction SHOULD have a hash (Submitted or later) - this is an error warn!(tx_id = %tx.id, error = ?e, "failed to parse and validate hash"); return Err(e); } diff --git a/src/jobs/handlers/transaction_status_handler.rs b/src/jobs/handlers/transaction_status_handler.rs index 470852ed2..ba8f8fa8f 100644 --- a/src/jobs/handlers/transaction_status_handler.rs +++ b/src/jobs/handlers/transaction_status_handler.rs @@ -9,15 +9,37 @@ use apalis::prelude::{Attempt, Data, *}; use eyre::Result; use tracing::{debug, instrument}; -use std::sync::Arc; +use std::{sync::Arc, time::Duration}; use crate::{ domain::{get_relayer_transaction, get_transaction_by_id, is_final_state, Transaction}, - jobs::{Job, TransactionStatusCheck}, + jobs::{job_producer::JobProducerTrait, Job, TransactionStatusCheck}, models::{DefaultAppState, TransactionRepoModel}, observability::request_id::set_request_id, + utils::calculate_scheduled_timestamp, }; +// Status check backoff schedule +const STATUS_CHECK_BACKOFF_SCHEDULE: &[(u32, u64)] = &[ + (0, 5), // First retry: 5 seconds + (1, 10), // Second retry: 10 seconds + (2, 20), // Third retry: 20 seconds + (3, 30), // Fourth retry: 30 seconds + (4, 45), // Fifth retry: 45 seconds +]; +const STATUS_CHECK_MAX_BACKOFF_SECONDS: u64 = 60; // Max: 60 seconds + +/// Calculates exponential backoff delay for status checks based on retry count +fn calculate_status_check_backoff(retry_count: u32) -> Duration { + let seconds = STATUS_CHECK_BACKOFF_SCHEDULE + .iter() + .find(|(count, _)| *count == retry_count) + .map(|(_, delay)| *delay) + .unwrap_or(STATUS_CHECK_MAX_BACKOFF_SECONDS); + + Duration::from_secs(seconds) +} + #[cfg(test)] use crate::models::NetworkType; @@ -47,18 +69,22 @@ pub async fn transaction_status_handler( job.data.transaction_id ); - let result = handle_request(job.data, state).await; + let result = handle_request(job.data.clone(), state.clone()).await; - handle_status_check_result(result) + handle_status_check_result(result, &job, &state) } -/// Handles status check results with special retry logic. +/// Handles status check results with exponential backoff retry logic. /// /// # Retry Strategy /// - If transaction is in final state โ†’ Job completes successfully -/// - If error occurred โ†’ Retry (let handle_result decide) -/// - If transaction still not final โ†’ Retry to keep checking -fn handle_status_check_result(result: Result) -> Result<(), Error> { +/// - If error occurred โ†’ Retry with backoff (let Apalis handle retry) +/// - If transaction still not final โ†’ Schedule next check with exponential backoff +fn handle_status_check_result( + result: Result, + job: &Job, + state: &Data>, +) -> Result<(), Error> { match result { Ok(updated_tx) => { // Check if transaction reached final state @@ -70,24 +96,59 @@ fn handle_status_check_result(result: Result) -> Result<() ); Ok(()) } else { - // Transaction still processing, retry status check + // Transaction still processing, schedule retry with backoff + + // Extract retry count from metadata + let retry_count = job + .data + .metadata + .as_ref() + .and_then(|m| m.get("retry_count")) + .and_then(|c| c.parse::().ok()) + .unwrap_or(0); + + let delay = calculate_status_check_backoff(retry_count); + debug!( tx_id = %updated_tx.id, status = ?updated_tx.status, - "transaction status: {:?} - not in final state, retrying status check", - updated_tx.status + retry_count = retry_count, + next_check_delay_secs = delay.as_secs(), + "transaction not in final state, scheduling retry with backoff" ); - Err(Error::Failed(Arc::new( - format!( - "transaction status: {:?} - not in final state, retrying status check", - updated_tx.status - ) - .into(), - ))) + + // Schedule next status check with backoff + let mut metadata = job.data.metadata.clone().unwrap_or_default(); + metadata.insert("retry_count".to_string(), (retry_count + 1).to_string()); + + let next_check = TransactionStatusCheck { + transaction_id: updated_tx.id.clone(), + relayer_id: updated_tx.relayer_id.clone(), + network_type: job.data.network_type, + metadata: Some(metadata), + }; + + let scheduled_at = calculate_scheduled_timestamp(delay.as_secs() as i64); + + // Schedule the job asynchronously + tokio::spawn({ + let job_producer = state.job_producer.clone(); + async move { + if let Err(e) = job_producer + .produce_check_transaction_status_job(next_check, Some(scheduled_at)) + .await + { + tracing::warn!(error = ?e, "failed to schedule next status check with backoff"); + } + } + }); + + // Complete this job successfully (next check is scheduled) + Ok(()) } } Err(e) => { - // Error occurred, retry + // Error occurred, retry immediately Err(Error::Failed(Arc::new(format!("{e}").into()))) } } @@ -102,6 +163,18 @@ async fn handle_request( let transaction = get_transaction_by_id(status_request.transaction_id.clone(), &state).await?; + // Avoid scheduling status checks for unsubmitted transactions + // No on-chain hashes yet - submit handler will check after submission + use crate::domain::is_unsubmitted_transaction; + if is_unsubmitted_transaction(&transaction.status) { + debug!( + tx_id = %transaction.id, + status = ?transaction.status, + "skipping status check for unsubmitted transaction" + ); + return Ok(transaction); + } + let updated_transaction = relayer_transaction .handle_transaction_status(transaction) .await?; @@ -150,6 +223,8 @@ mod tests { assert_eq!(job_metadata.get("last_status").unwrap(), "pending"); } + // Legacy tests for old immediate-retry behavior + #[cfg(ignore)] mod handle_status_check_result_tests { use super::*; @@ -324,4 +399,96 @@ mod tests { } } } + + /// Tests for exponential backoff calculation + mod backoff_tests { + use super::*; + + #[test] + fn test_calculate_status_check_backoff() { + // Test the backoff schedule + assert_eq!(calculate_status_check_backoff(0), Duration::from_secs(5)); + assert_eq!(calculate_status_check_backoff(1), Duration::from_secs(10)); + assert_eq!(calculate_status_check_backoff(2), Duration::from_secs(20)); + assert_eq!(calculate_status_check_backoff(3), Duration::from_secs(30)); + assert_eq!(calculate_status_check_backoff(4), Duration::from_secs(45)); + + // Test max backoff for higher retry counts + assert_eq!(calculate_status_check_backoff(5), Duration::from_secs(60)); + assert_eq!(calculate_status_check_backoff(10), Duration::from_secs(60)); + assert_eq!(calculate_status_check_backoff(100), Duration::from_secs(60)); + } + + #[test] + fn test_status_check_with_retry_metadata() { + let mut metadata = HashMap::new(); + metadata.insert("retry_count".to_string(), "3".to_string()); + + let check_job = TransactionStatusCheck::new("tx123", "relayer-1", NetworkType::Stellar) + .with_metadata(metadata.clone()); + + assert!(check_job.metadata.is_some()); + let job_metadata = check_job.metadata.unwrap(); + assert_eq!(job_metadata.get("retry_count").unwrap(), "3"); + + // Verify the backoff calculation for this retry count + let backoff = calculate_status_check_backoff(3); + assert_eq!(backoff, Duration::from_secs(30)); + } + + #[test] + fn test_retry_count_parsing_from_metadata() { + // Test parsing valid retry count + let mut metadata = HashMap::new(); + metadata.insert("retry_count".to_string(), "2".to_string()); + + let retry_count: u32 = metadata + .get("retry_count") + .and_then(|c| c.parse().ok()) + .unwrap_or(0); + + assert_eq!(retry_count, 2); + + // Test parsing invalid retry count (should default to 0) + let mut invalid_metadata = HashMap::new(); + invalid_metadata.insert("retry_count".to_string(), "invalid".to_string()); + + let retry_count: u32 = invalid_metadata + .get("retry_count") + .and_then(|c| c.parse().ok()) + .unwrap_or(0); + + assert_eq!(retry_count, 0); + + // Test missing retry count (should default to 0) + let empty_metadata: HashMap = HashMap::new(); + let retry_count: u32 = empty_metadata + .get("retry_count") + .and_then(|c| c.parse().ok()) + .unwrap_or(0); + + assert_eq!(retry_count, 0); + } + + #[test] + fn test_backoff_schedule_progression() { + // Verify backoff increases exponentially + let backoffs: Vec = (0..6) + .map(|i| calculate_status_check_backoff(i).as_secs()) + .collect(); + + // Each step should be >= previous (except max) + for i in 0..backoffs.len() - 1 { + assert!( + backoffs[i + 1] >= backoffs[i], + "Backoff should increase or stay at max: {} -> {}", + backoffs[i], + backoffs[i + 1] + ); + } + + // Verify we reach max and stay there + assert_eq!(backoffs[5], STATUS_CHECK_MAX_BACKOFF_SECONDS); + } + } } From f671e85bb5ddd9847eebc793f88af01afc9c617a Mon Sep 17 00:00:00 2001 From: Zeljko Date: Sun, 18 Jan 2026 23:59:17 +0100 Subject: [PATCH 28/42] fix: Stellar status improvements --- src/constants/stellar_transaction.rs | 18 +- src/domain/transaction/stellar/status.rs | 363 ++++++++++++++++++++--- src/domain/transaction/stellar/submit.rs | 35 +-- 3 files changed, 350 insertions(+), 66 deletions(-) diff --git a/src/constants/stellar_transaction.rs b/src/constants/stellar_transaction.rs index 52be025e3..c343e8523 100644 --- a/src/constants/stellar_transaction.rs +++ b/src/constants/stellar_transaction.rs @@ -21,9 +21,10 @@ pub const STELLAR_HORIZON_TESTNET_URL: &str = "https://horizon-testnet.stellar.o /// Set to 2s for faster detection of transaction state changes pub const STELLAR_STATUS_CHECK_INITIAL_DELAY_SECONDS: i64 = 2; -// Other delays -/// Default delay (in seconds) for retrying transaction after bad sequence error -pub const STELLAR_BAD_SEQUENCE_RETRY_DELAY_SECONDS: i64 = 2; +/// Minimum age before triggering Pending status recovery (in seconds) +/// Only schedule a recovery job if Pending transaction without hash exceeds this age +/// This prevents scheduling a job on every status check +pub const STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS: i64 = 10; // Transaction validity /// Default transaction validity duration (in minutes) for sponsored transactions @@ -47,7 +48,11 @@ pub const STELLAR_RESEND_TIMEOUT_SECONDS: i64 = 30; /// Maximum lifetime for a Sent transaction before marking as Failed (30 minutes) /// Safety net for transactions without time bounds - prevents infinite retries. -pub const STELLAR_MAX_SENT_LIFETIME_MINUTES: i64 = 30; +pub const STELLAR_MAX_SENT_LIFETIME_MINUTES: i64 = 15; + +/// Maximum lifetime for a Pending transaction before marking as Failed (30 minutes) +/// Safety net for transactions stuck in Pending state - prevents infinite retries. +pub const STELLAR_MAX_PENDING_LIFETIME_MINUTES: i64 = 15; /// Get resend timeout duration for stuck Sent transactions pub fn get_stellar_resend_timeout() -> Duration { @@ -58,3 +63,8 @@ pub fn get_stellar_resend_timeout() -> Duration { pub fn get_stellar_max_sent_lifetime() -> Duration { Duration::minutes(STELLAR_MAX_SENT_LIFETIME_MINUTES) } + +/// Get max pending lifetime duration +pub fn get_stellar_max_pending_lifetime() -> Duration { + Duration::minutes(STELLAR_MAX_PENDING_LIFETIME_MINUTES) +} diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index 2e6678ffb..e4d70a3f8 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -2,20 +2,23 @@ //! It includes methods for checking transaction status with robust error handling, //! ensuring proper transaction state management and lane cleanup. -use chrono::Utc; +use chrono::{DateTime, Utc}; use soroban_rs::xdr::{Error, Hash, Limits, WriteXdr}; use tracing::{debug, info, warn}; use super::{is_final_state, StellarRelayerTransaction}; -use crate::constants::{get_stellar_max_sent_lifetime, get_stellar_resend_timeout}; +use crate::constants::{ + get_stellar_max_pending_lifetime, get_stellar_max_sent_lifetime, get_stellar_resend_timeout, +}; +use crate::domain::is_unsubmitted_transaction; use crate::domain::transaction::stellar::prepare::common::send_submit_transaction_job; use crate::domain::transaction::stellar::utils::extract_return_value_from_meta; use crate::domain::transaction::stellar::utils::extract_time_bounds; use crate::domain::transaction::util::get_age_since_created; use crate::domain::xdr_utils::parse_transaction_xdr; use crate::{ - domain::is_unsubmitted_transaction, - jobs::JobProducerTrait, + constants::STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS, + jobs::{JobProducerTrait, TransactionRequest}, models::{ NetworkTransactionData, RelayerRepoModel, TransactionError, TransactionRepoModel, TransactionStatus, TransactionUpdateRequest, @@ -98,42 +101,24 @@ where &self, tx: TransactionRepoModel, ) -> Result { + // Early check for Pending transactions - avoid unnecessary hash parsing + if tx.status == TransactionStatus::Pending { + return self.handle_pending_state(tx).await; + } + let stellar_hash = match self.parse_and_validate_hash(&tx) { Ok(hash) => hash, Err(e) => { - // Only warn if transaction SHOULD have a hash (Submitted or later) + warn!(tx_id = %tx.id, error = ?e, "failed to parse and validate hash"); if !is_unsubmitted_transaction(&tx.status) { - warn!(tx_id = %tx.id, error = ?e, "failed to parse and validate hash"); - return Err(e); + info!(tx_id = %tx.id, status = ?tx.status, "transaction is not unsubmitted, marking as failed due to hash validation error"); + return self + .mark_as_failed(tx, format!("Failed to parse and validate hash: {e}")) + .await; } - // Recover stuck Sent transactions if tx.status == TransactionStatus::Sent { - if let Ok(age) = get_age_since_created(&tx) { - if self.is_transaction_expired(&tx)? { - info!(tx_id = %tx.id, valid_until = ?tx.valid_until, "Sent transaction has expired"); - return self - .mark_as_expired(tx, "Transaction time_bounds expired".to_string()) - .await; - } - - if age > get_stellar_max_sent_lifetime() { - warn!(tx_id = %tx.id, age_minutes = age.num_minutes(), - "Sent transaction exceeded max lifetime, marking as Failed"); - return self - .mark_as_failed( - tx, - "Transaction stuck in Sent status for too long".to_string(), - ) - .await; - } - - if age > get_stellar_resend_timeout() { - info!(tx_id = %tx.id, age_seconds = age.num_seconds(), - "re-enqueueing submit job for stuck Sent transaction"); - send_submit_transaction_job(self.job_producer(), &tx, None).await?; - } - } + return self.handle_sent_state(tx).await; } return Ok(tx); } @@ -353,6 +338,115 @@ where Ok(updated_tx) } + /// Handles Sent transactions that failed hash parsing. + /// Checks for expiration, max lifetime, and re-enqueues submit job if needed. + async fn handle_sent_state( + &self, + tx: TransactionRepoModel, + ) -> Result { + let age = get_age_since_created(&tx)?; + + // Check if transaction has expired + if self.is_transaction_expired(&tx)? { + info!(tx_id = %tx.id, valid_until = ?tx.valid_until, "Sent transaction has expired"); + return self + .mark_as_expired(tx, "Transaction time_bounds expired".to_string()) + .await; + } + + // Check if transaction exceeded max lifetime + if age > get_stellar_max_sent_lifetime() { + warn!(tx_id = %tx.id, age_minutes = age.num_minutes(), + "Sent transaction exceeded max lifetime, marking as Failed"); + return self + .mark_as_failed( + tx, + "Transaction stuck in Sent status for too long".to_string(), + ) + .await; + } + + // Re-enqueue submit job if transaction exceeded resend timeout + if age > get_stellar_resend_timeout() { + info!(tx_id = %tx.id, age_seconds = age.num_seconds(), + "re-enqueueing submit job for stuck Sent transaction"); + send_submit_transaction_job(self.job_producer(), &tx, None).await?; + } + + Ok(tx) + } + + /// Handles pending transactions without a hash (e.g., reset after bad sequence error). + /// Schedules a recovery job if the transaction is old enough to prevent it from being stuck. + async fn handle_pending_state( + &self, + tx: TransactionRepoModel, + ) -> Result { + // Check transaction age to determine if recovery is needed + let age = self.get_time_since_created_at(&tx)?; + + // Check if transaction exceeded max lifetime + if age > get_stellar_max_pending_lifetime() { + warn!(tx_id = %tx.id, age_minutes = age.num_minutes(), + "Pending transaction exceeded max lifetime, marking as Failed"); + return self + .mark_as_failed( + tx, + "Transaction stuck in Pending status for too long".to_string(), + ) + .await; + } + + // Only schedule recovery job if transaction exceeds recovery trigger timeout + // This prevents scheduling a job on every status check + if age.num_seconds() >= STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS { + info!( + tx_id = %tx.id, + age_seconds = age.num_seconds(), + "pending transaction without hash may be stuck, scheduling recovery job" + ); + + let transaction_request = TransactionRequest::new(tx.id.clone(), tx.relayer_id.clone()); + if let Err(e) = self + .job_producer() + .produce_transaction_request_job(transaction_request, None) + .await + { + warn!( + tx_id = %tx.id, + error = %e, + "failed to schedule recovery job for pending transaction" + ); + } + } else { + debug!( + tx_id = %tx.id, + age_seconds = age.num_seconds(), + "pending transaction without hash too young for recovery check" + ); + } + + Ok(tx) + } + + /// Get time since transaction was created. + /// Returns an error if created_at is missing or invalid. + fn get_time_since_created_at( + &self, + tx: &TransactionRepoModel, + ) -> Result { + match DateTime::parse_from_rfc3339(&tx.created_at) { + Ok(dt) => Ok(Utc::now().signed_duration_since(dt.with_timezone(&Utc))), + Err(e) => { + warn!(tx_id = %tx.id, ts = %tx.created_at, error = %e, "failed to parse created_at timestamp"); + Err(TransactionError::UnexpectedError(format!( + "Invalid created_at timestamp for transaction {}: {}", + tx.id, e + ))) + } + } + } + /// Handles the logic when a Stellar transaction is still pending or in an unknown state. pub async fn handle_stellar_pending( &self, @@ -785,8 +879,8 @@ mod tests { .status_reason .as_ref() .unwrap() - .contains("Validation error"), - "Expected validation error in status_reason, got: {:?}", + .contains("Failed to parse and validate hash"), + "Expected hash validation error in status_reason, got: {:?}", updated_tx.status_reason ); } @@ -1286,6 +1380,205 @@ mod tests { } } + mod handle_pending_state_tests { + use super::*; + use crate::constants::get_stellar_max_pending_lifetime; + use crate::constants::STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS; + + #[tokio::test] + async fn test_pending_exceeds_max_lifetime_marks_failed() { + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-pending-old".to_string(); + tx.status = TransactionStatus::Pending; + // Created more than max lifetime ago (16 minutes > 15 minutes) + tx.created_at = + (Utc::now() - get_stellar_max_pending_lifetime() - Duration::minutes(1)) + .to_rfc3339(); + + // Should mark as Failed + mocks + .tx_repo + .expect_partial_update() + .withf(|_id, update| update.status == Some(TransactionStatus::Failed)) + .times(1) + .returning(|id, update| { + let mut updated = create_test_transaction("test"); + updated.id = id; + updated.status = update.status.unwrap(); + updated.status_reason = update.status_reason.clone(); + Ok(updated) + }); + + // Notification for failure + mocks + .job_producer + .expect_produce_send_notification_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + // Try to enqueue next pending + mocks + .tx_repo + .expect_find_by_status() + .returning(|_, _| Ok(vec![])); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let failed_tx = result.unwrap(); + assert_eq!(failed_tx.status, TransactionStatus::Failed); + assert!(failed_tx + .status_reason + .as_ref() + .unwrap() + .contains("stuck in Pending status for too long")); + } + + #[tokio::test] + async fn test_pending_triggers_recovery_job_when_old_enough() { + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-pending-recovery".to_string(); + tx.status = TransactionStatus::Pending; + // Created more than recovery trigger seconds ago + tx.created_at = (Utc::now() + - Duration::seconds(STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS + 5)) + .to_rfc3339(); + + // Should schedule recovery job + mocks + .job_producer + .expect_produce_transaction_request_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let tx_result = result.unwrap(); + assert_eq!(tx_result.status, TransactionStatus::Pending); + } + + #[tokio::test] + async fn test_pending_too_young_does_not_schedule_recovery() { + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-pending-young".to_string(); + tx.status = TransactionStatus::Pending; + // Created less than recovery trigger seconds ago + tx.created_at = (Utc::now() + - Duration::seconds(STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS - 5)) + .to_rfc3339(); + + // Should NOT schedule recovery job + mocks + .job_producer + .expect_produce_transaction_request_job() + .never(); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let tx_result = result.unwrap(); + assert_eq!(tx_result.status, TransactionStatus::Pending); + } + + #[tokio::test] + async fn test_sent_without_hash_handles_stuck_recovery() { + use crate::constants::get_stellar_resend_timeout; + + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-sent-no-hash".to_string(); + tx.status = TransactionStatus::Sent; + // Created more than resend timeout ago (31 seconds > 30 seconds) + tx.created_at = + (Utc::now() - get_stellar_resend_timeout() - Duration::seconds(1)).to_rfc3339(); + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = None; // No hash + } + + // Should handle stuck Sent transaction and re-enqueue submit job + mocks + .job_producer + .expect_produce_submit_transaction_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let tx_result = result.unwrap(); + assert_eq!(tx_result.status, TransactionStatus::Sent); + } + + #[tokio::test] + async fn test_submitted_without_hash_marks_failed() { + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-submitted-no-hash".to_string(); + tx.status = TransactionStatus::Submitted; + tx.created_at = (Utc::now() - Duration::minutes(1)).to_rfc3339(); + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = None; // No hash + } + + // Should mark as Failed + mocks + .tx_repo + .expect_partial_update() + .withf(|_id, update| update.status == Some(TransactionStatus::Failed)) + .times(1) + .returning(|id, update| { + let mut updated = create_test_transaction("test"); + updated.id = id; + updated.status = update.status.unwrap(); + updated.status_reason = update.status_reason.clone(); + Ok(updated) + }); + + // Notification for failure + mocks + .job_producer + .expect_produce_send_notification_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + // Try to enqueue next pending + mocks + .tx_repo + .expect_find_by_status() + .returning(|_, _| Ok(vec![])); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let failed_tx = result.unwrap(); + assert_eq!(failed_tx.status, TransactionStatus::Failed); + assert!(failed_tx + .status_reason + .as_ref() + .unwrap() + .contains("Failed to parse and validate hash")); + } + } + mod is_valid_until_expired_tests { use super::*; use crate::{ diff --git a/src/domain/transaction/stellar/submit.rs b/src/domain/transaction/stellar/submit.rs index f2a921378..d64256d9e 100644 --- a/src/domain/transaction/stellar/submit.rs +++ b/src/domain/transaction/stellar/submit.rs @@ -7,7 +7,6 @@ use tracing::{info, warn}; use super::{is_final_state, utils::is_bad_sequence_error, StellarRelayerTransaction}; use crate::{ - constants::STELLAR_BAD_SEQUENCE_RETRY_DELAY_SECONDS, jobs::JobProducerTrait, models::{ NetworkTransactionData, RelayerRepoModel, TransactionError, TransactionRepoModel, @@ -15,7 +14,6 @@ use crate::{ }, repositories::{Repository, TransactionCounterTrait, TransactionRepository}, services::{provider::StellarProviderTrait, signer::Signer}, - utils::calculate_scheduled_timestamp, }; impl StellarRelayerTransaction @@ -137,28 +135,15 @@ where } } - // Reset the transaction and re-enqueue it - info!("bad sequence error detected, resetting and re-enqueueing"); - // Reset the transaction to pending state + // Status check will handle resubmission when it detects a pending transaction without hash + info!("bad sequence error detected, resetting transaction to pending state"); match self.reset_transaction_for_retry(tx.clone()).await { Ok(reset_tx) => { - // Re-enqueue the transaction to go through the pipeline again - if let Err(e) = self - .send_transaction_request_job( - &reset_tx, - Some(calculate_scheduled_timestamp( - STELLAR_BAD_SEQUENCE_RETRY_DELAY_SECONDS, - )), - ) - .await - { - warn!(error = %e, "failed to re-enqueue transaction after reset"); - } else { - info!("transaction reset and re-enqueued for retry through pipeline"); - } - - // Return success since we're handling the retry + info!("transaction reset to pending, status check will handle resubmission"); + // Return success since we've reset the transaction + // Status check job (scheduled with delay) will detect pending without hash + // and schedule a recovery job to go through the pipeline again return Ok(reset_tx); } Err(reset_error) => { @@ -597,12 +582,8 @@ mod tests { Ok::<_, RepositoryError>(tx) }); - // Mock produce_transaction_request_job for re-enqueue - mocks - .job_producer - .expect_produce_transaction_request_job() - .times(1) - .returning(|_, _| Box::pin(async { Ok(()) })); + // Note: Status check will handle resubmission when it detects a pending transaction without hash + // We don't schedule the job here - it will be scheduled by status check when the transaction is old enough let handler = make_stellar_tx_handler(relayer.clone(), mocks); let mut tx = create_test_transaction(&relayer.id); From 15d0a1756012f75d017e721bd03e885ad2c1d07a Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 19 Jan 2026 00:12:34 +0100 Subject: [PATCH 29/42] Revert "chore: Add exp backoff logic" This reverts commit d5667d9472503c02b68f795d42e09891acf77ea0. --- Cargo.toml | 3 +- scripts/cleanup_stuck_stellar_txs.sh | 254 ------------------ src/domain/transaction/stellar/status.rs | 15 +- .../handlers/transaction_status_handler.rs | 205 ++------------ 4 files changed, 22 insertions(+), 455 deletions(-) delete mode 100755 scripts/cleanup_stuck_stellar_txs.sh diff --git a/Cargo.toml b/Cargo.toml index 145a2bb26..990356098 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,6 @@ reqwest-middleware = { version = "0.4.2", default-features = false, features = [ url = "2" [dev-dependencies] -clap = { version = "4.4", features = ["derive"] } cargo-llvm-cov = "0.6" ctor = "0.2" mockall = { version = "0.13" } @@ -113,7 +112,7 @@ proptest = "1.6.0" rand = "0.9.0" tempfile = "3.2" serial_test = "3.2" -tokio = { version = "1.43", features = ["full"] } +clap = { version = "4.4", features = ["derive"] } [[bin]] diff --git a/scripts/cleanup_stuck_stellar_txs.sh b/scripts/cleanup_stuck_stellar_txs.sh deleted file mode 100755 index e754592ac..000000000 --- a/scripts/cleanup_stuck_stellar_txs.sh +++ /dev/null @@ -1,254 +0,0 @@ -#!/usr/bin/env bash - -############################################################################### -# Redis-based cleanup script for stuck Stellar transactions -# -# Run this ONCE after deploying the status check fixes to clean up existing -# poison transactions. -# -# This script identifies and marks as Expired transactions that: -# 1. Are Stellar network transactions -# 2. Are in Pending or Sent status (unsubmitted states) -# 3. Have missing or empty on-chain hash in network_data -# 4. Were created more than MIN_AGE_HOURS ago -# -# Usage: -# ./scripts/cleanup_stuck_stellar_txs.sh --dry-run -# ./scripts/cleanup_stuck_stellar_txs.sh --redis-url redis://localhost:6379 --key-prefix relayer -############################################################################### - -set -euo pipefail - -# Default values -REDIS_URL="redis://localhost:6379" -KEY_PREFIX="relayer" -DRY_RUN=false -MIN_AGE_HOURS=1 - -# Parse command line arguments -while [[ $# -gt 0 ]]; do - case $1 in - --redis-url) - REDIS_URL="$2" - shift 2 - ;; - --key-prefix) - KEY_PREFIX="$2" - shift 2 - ;; - --dry-run) - DRY_RUN=true - shift - ;; - --min-age-hours) - MIN_AGE_HOURS="$2" - shift 2 - ;; - -h|--help) - echo "Usage: $0 [OPTIONS]" - echo "" - echo "Options:" - echo " --redis-url URL Redis connection URL (default: redis://localhost:6379)" - echo " --key-prefix PREFIX Redis key prefix (default: relayer)" - echo " --dry-run Preview mode - show what would be cleaned without making changes" - echo " --min-age-hours N Minimum age in hours before marking as expired (default: 1)" - echo " -h, --help Show this help message" - exit 0 - ;; - *) - echo "Unknown option: $1" - echo "Use --help for usage information" - exit 1 - ;; - esac -done - -# Check dependencies -if ! command -v redis-cli &> /dev/null; then - echo "ERROR: redis-cli is not installed" - exit 1 -fi - -if ! command -v jq &> /dev/null; then - echo "ERROR: jq is not installed" - exit 1 -fi - -# Extract Redis connection parameters from URL -# Format: redis://[username:password@]host:port[/database] -REDIS_HOST=$(echo "$REDIS_URL" | sed -E 's#redis://([^:@]*:)?([^@]*@)?([^:/]+).*#\3#') -REDIS_PORT=$(echo "$REDIS_URL" | sed -E 's#redis://[^:]*:([0-9]+).*#\1#') -if [[ "$REDIS_PORT" == "$REDIS_URL" ]]; then - REDIS_PORT=6379 -fi - -# Redis CLI command with connection parameters -REDIS_CMD="redis-cli -h $REDIS_HOST -p $REDIS_PORT" - -# Calculate the threshold timestamp (RFC3339 format) -if [[ "$OSTYPE" == "darwin"* ]]; then - # macOS - THRESHOLD_TIMESTAMP=$(date -u -v-${MIN_AGE_HOURS}H +"%Y-%m-%dT%H:%M:%S+00:00") -else - # Linux - THRESHOLD_TIMESTAMP=$(date -u -d "${MIN_AGE_HOURS} hours ago" +"%Y-%m-%dT%H:%M:%S+00:00") -fi - -# Current timestamp for delete_at (24 hours from now) -if [[ "$OSTYPE" == "darwin"* ]]; then - DELETE_AT_TIMESTAMP=$(date -u -v+24H +"%Y-%m-%dT%H:%M:%S+00:00") -else - DELETE_AT_TIMESTAMP=$(date -u -d "24 hours" +"%Y-%m-%dT%H:%M:%S+00:00") -fi - -# Statistics -TOTAL_SCANNED=0 -STELLAR_TRANSACTIONS=0 -STUCK_TRANSACTIONS=0 -MARKED_EXPIRED=0 - -echo "=== Redis Cleanup for Stuck Stellar Transactions ===" -echo "Redis: $REDIS_HOST:$REDIS_PORT" -echo "Key prefix: $KEY_PREFIX" -echo "Dry run: $DRY_RUN" -echo "Min age: $MIN_AGE_HOURS hours" -echo "Threshold: $THRESHOLD_TIMESTAMP" -echo "" - -# Get all relayer IDs -RELAYER_LIST_KEY="${KEY_PREFIX}:relayer_list" -RELAYER_IDS=$($REDIS_CMD SMEMBERS "$RELAYER_LIST_KEY") - -if [[ -z "$RELAYER_IDS" ]]; then - echo "No relayers found" - exit 0 -fi - -RELAYER_COUNT=$(echo "$RELAYER_IDS" | wc -l | tr -d ' ') -echo "Found $RELAYER_COUNT relayer(s)" -echo "" - -# Process each relayer -for RELAYER_ID in $RELAYER_IDS; do - echo "Processing relayer: $RELAYER_ID" - - # Get all transaction IDs for this relayer (sorted by created_at) - TX_BY_CREATED_AT_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:tx_by_created_at" - TX_IDS=$($REDIS_CMD ZRANGE "$TX_BY_CREATED_AT_KEY" 0 -1) - - if [[ -z "$TX_IDS" ]]; then - echo " No transactions found" - continue - fi - - # Process each transaction - for TX_ID in $TX_IDS; do - ((TOTAL_SCANNED++)) - - # Fetch transaction JSON - TX_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:tx:${TX_ID}" - TX_JSON=$($REDIS_CMD GET "$TX_KEY") - - if [[ -z "$TX_JSON" ]]; then - continue - fi - - # Parse transaction fields - NETWORK_TYPE=$(echo "$TX_JSON" | jq -r '.network_type') - STATUS=$(echo "$TX_JSON" | jq -r '.status') - CREATED_AT=$(echo "$TX_JSON" | jq -r '.created_at') - HASH=$(echo "$TX_JSON" | jq -r '.network_data.hash // empty') - - # Filter for Stellar transactions - if [[ "$NETWORK_TYPE" != "Stellar" ]]; then - continue - fi - ((STELLAR_TRANSACTIONS++)) - - # Check if in unsubmitted state (Pending or Sent) - if [[ "$STATUS" != "Pending" && "$STATUS" != "Sent" ]]; then - continue - fi - - # Check if hash is missing or empty - if [[ -n "$HASH" ]]; then - continue - fi - - # Check if older than threshold - if [[ "$CREATED_AT" > "$THRESHOLD_TIMESTAMP" ]]; then - continue - fi - - # This transaction is stuck! - ((STUCK_TRANSACTIONS++)) - - # Calculate age in hours - if [[ "$OSTYPE" == "darwin"* ]]; then - CREATED_EPOCH=$(date -jf "%Y-%m-%dT%H:%M:%S" "$(echo $CREATED_AT | cut -d+ -f1)" +"%s" 2>/dev/null || echo "0") - NOW_EPOCH=$(date +"%s") - else - CREATED_EPOCH=$(date -d "$CREATED_AT" +"%s" 2>/dev/null || echo "0") - NOW_EPOCH=$(date +"%s") - fi - AGE_HOURS=$(( (NOW_EPOCH - CREATED_EPOCH) / 3600 )) - - echo " [STUCK] tx_id=$TX_ID status=$STATUS created_at=$CREATED_AT age=${AGE_HOURS}h" - - if [[ "$DRY_RUN" == "true" ]]; then - ((MARKED_EXPIRED++)) - continue - fi - - # Update transaction JSON - UPDATED_TX_JSON=$(echo "$TX_JSON" | jq \ - --arg status "Expired" \ - --arg reason "Transaction stuck in unsubmitted state for too long (cleanup script)" \ - --arg delete_at "$DELETE_AT_TIMESTAMP" \ - '.status = $status | .status_reason = $reason | .delete_at = $delete_at') - - # Save updated transaction - $REDIS_CMD SET "$TX_KEY" "$UPDATED_TX_JSON" > /dev/null - - # Update status indexes - # Remove from old status SET - OLD_STATUS_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status:${STATUS}" - $REDIS_CMD SREM "$OLD_STATUS_KEY" "$TX_ID" > /dev/null - - # Remove from old status SORTED SET - OLD_STATUS_SORTED_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status_sorted:${STATUS}" - $REDIS_CMD ZREM "$OLD_STATUS_SORTED_KEY" "$TX_ID" > /dev/null - - # Add to new status SET - NEW_STATUS_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status:Expired" - $REDIS_CMD SADD "$NEW_STATUS_KEY" "$TX_ID" > /dev/null - - # Add to new status SORTED SET (score = created_at timestamp in milliseconds) - NEW_STATUS_SORTED_KEY="${KEY_PREFIX}:relayer:${RELAYER_ID}:status_sorted:Expired" - - # Convert RFC3339 timestamp to milliseconds since epoch - if [[ "$OSTYPE" == "darwin"* ]]; then - CREATED_MS=$(( CREATED_EPOCH * 1000 )) - else - CREATED_MS=$(( CREATED_EPOCH * 1000 )) - fi - - $REDIS_CMD ZADD "$NEW_STATUS_SORTED_KEY" "$CREATED_MS" "$TX_ID" > /dev/null - - ((MARKED_EXPIRED++)) - echo " [UPDATED] Marked as Expired" - done -done - -echo "" -echo "=== Cleanup Summary ===" -echo "Total transactions scanned: $TOTAL_SCANNED" -echo "Stellar transactions: $STELLAR_TRANSACTIONS" -echo "Stuck transactions found: $STUCK_TRANSACTIONS" -echo "Transactions marked as Expired: $MARKED_EXPIRED" - -if [[ "$DRY_RUN" == "true" ]]; then - echo "" - echo "DRY RUN MODE - No changes were made" - echo "Run without --dry-run to actually clean up these transactions" -fi diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index fa1bd2ba5..2ee902d27 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -48,13 +48,6 @@ where return Ok(tx); } - // Early exit for unsubmitted states - they don't have on-chain hashes to check yet - // The submit handler will schedule status checks after submission - if is_unsubmitted_transaction(&tx.status) { - debug!(tx_id = %tx.id, status = ?tx.status, "transaction not yet submitted, skipping status check"); - return Ok(tx); - } - match self.status_core(tx.clone()).await { Ok(updated_tx) => { debug!( @@ -108,12 +101,8 @@ where let stellar_hash = match self.parse_and_validate_hash(&tx) { Ok(hash) => hash, Err(e) => { - // For unsubmitted transactions (Pending, Sent), this is expected - no hash yet - if is_unsubmitted_transaction(&tx.status) { - // Handle stuck Sent transactions (existing recovery logic below) - // No warning needed - this is normal for unsubmitted states - } else { - // Transaction SHOULD have a hash (Submitted or later) - this is an error + // Only warn if transaction SHOULD have a hash (Submitted or later) + if !is_unsubmitted_transaction(&tx.status) { warn!(tx_id = %tx.id, error = ?e, "failed to parse and validate hash"); return Err(e); } diff --git a/src/jobs/handlers/transaction_status_handler.rs b/src/jobs/handlers/transaction_status_handler.rs index ba8f8fa8f..470852ed2 100644 --- a/src/jobs/handlers/transaction_status_handler.rs +++ b/src/jobs/handlers/transaction_status_handler.rs @@ -9,37 +9,15 @@ use apalis::prelude::{Attempt, Data, *}; use eyre::Result; use tracing::{debug, instrument}; -use std::{sync::Arc, time::Duration}; +use std::sync::Arc; use crate::{ domain::{get_relayer_transaction, get_transaction_by_id, is_final_state, Transaction}, - jobs::{job_producer::JobProducerTrait, Job, TransactionStatusCheck}, + jobs::{Job, TransactionStatusCheck}, models::{DefaultAppState, TransactionRepoModel}, observability::request_id::set_request_id, - utils::calculate_scheduled_timestamp, }; -// Status check backoff schedule -const STATUS_CHECK_BACKOFF_SCHEDULE: &[(u32, u64)] = &[ - (0, 5), // First retry: 5 seconds - (1, 10), // Second retry: 10 seconds - (2, 20), // Third retry: 20 seconds - (3, 30), // Fourth retry: 30 seconds - (4, 45), // Fifth retry: 45 seconds -]; -const STATUS_CHECK_MAX_BACKOFF_SECONDS: u64 = 60; // Max: 60 seconds - -/// Calculates exponential backoff delay for status checks based on retry count -fn calculate_status_check_backoff(retry_count: u32) -> Duration { - let seconds = STATUS_CHECK_BACKOFF_SCHEDULE - .iter() - .find(|(count, _)| *count == retry_count) - .map(|(_, delay)| *delay) - .unwrap_or(STATUS_CHECK_MAX_BACKOFF_SECONDS); - - Duration::from_secs(seconds) -} - #[cfg(test)] use crate::models::NetworkType; @@ -69,22 +47,18 @@ pub async fn transaction_status_handler( job.data.transaction_id ); - let result = handle_request(job.data.clone(), state.clone()).await; + let result = handle_request(job.data, state).await; - handle_status_check_result(result, &job, &state) + handle_status_check_result(result) } -/// Handles status check results with exponential backoff retry logic. +/// Handles status check results with special retry logic. /// /// # Retry Strategy /// - If transaction is in final state โ†’ Job completes successfully -/// - If error occurred โ†’ Retry with backoff (let Apalis handle retry) -/// - If transaction still not final โ†’ Schedule next check with exponential backoff -fn handle_status_check_result( - result: Result, - job: &Job, - state: &Data>, -) -> Result<(), Error> { +/// - If error occurred โ†’ Retry (let handle_result decide) +/// - If transaction still not final โ†’ Retry to keep checking +fn handle_status_check_result(result: Result) -> Result<(), Error> { match result { Ok(updated_tx) => { // Check if transaction reached final state @@ -96,59 +70,24 @@ fn handle_status_check_result( ); Ok(()) } else { - // Transaction still processing, schedule retry with backoff - - // Extract retry count from metadata - let retry_count = job - .data - .metadata - .as_ref() - .and_then(|m| m.get("retry_count")) - .and_then(|c| c.parse::().ok()) - .unwrap_or(0); - - let delay = calculate_status_check_backoff(retry_count); - + // Transaction still processing, retry status check debug!( tx_id = %updated_tx.id, status = ?updated_tx.status, - retry_count = retry_count, - next_check_delay_secs = delay.as_secs(), - "transaction not in final state, scheduling retry with backoff" + "transaction status: {:?} - not in final state, retrying status check", + updated_tx.status ); - - // Schedule next status check with backoff - let mut metadata = job.data.metadata.clone().unwrap_or_default(); - metadata.insert("retry_count".to_string(), (retry_count + 1).to_string()); - - let next_check = TransactionStatusCheck { - transaction_id: updated_tx.id.clone(), - relayer_id: updated_tx.relayer_id.clone(), - network_type: job.data.network_type, - metadata: Some(metadata), - }; - - let scheduled_at = calculate_scheduled_timestamp(delay.as_secs() as i64); - - // Schedule the job asynchronously - tokio::spawn({ - let job_producer = state.job_producer.clone(); - async move { - if let Err(e) = job_producer - .produce_check_transaction_status_job(next_check, Some(scheduled_at)) - .await - { - tracing::warn!(error = ?e, "failed to schedule next status check with backoff"); - } - } - }); - - // Complete this job successfully (next check is scheduled) - Ok(()) + Err(Error::Failed(Arc::new( + format!( + "transaction status: {:?} - not in final state, retrying status check", + updated_tx.status + ) + .into(), + ))) } } Err(e) => { - // Error occurred, retry immediately + // Error occurred, retry Err(Error::Failed(Arc::new(format!("{e}").into()))) } } @@ -163,18 +102,6 @@ async fn handle_request( let transaction = get_transaction_by_id(status_request.transaction_id.clone(), &state).await?; - // Avoid scheduling status checks for unsubmitted transactions - // No on-chain hashes yet - submit handler will check after submission - use crate::domain::is_unsubmitted_transaction; - if is_unsubmitted_transaction(&transaction.status) { - debug!( - tx_id = %transaction.id, - status = ?transaction.status, - "skipping status check for unsubmitted transaction" - ); - return Ok(transaction); - } - let updated_transaction = relayer_transaction .handle_transaction_status(transaction) .await?; @@ -223,8 +150,6 @@ mod tests { assert_eq!(job_metadata.get("last_status").unwrap(), "pending"); } - // Legacy tests for old immediate-retry behavior - #[cfg(ignore)] mod handle_status_check_result_tests { use super::*; @@ -399,96 +324,4 @@ mod tests { } } } - - /// Tests for exponential backoff calculation - mod backoff_tests { - use super::*; - - #[test] - fn test_calculate_status_check_backoff() { - // Test the backoff schedule - assert_eq!(calculate_status_check_backoff(0), Duration::from_secs(5)); - assert_eq!(calculate_status_check_backoff(1), Duration::from_secs(10)); - assert_eq!(calculate_status_check_backoff(2), Duration::from_secs(20)); - assert_eq!(calculate_status_check_backoff(3), Duration::from_secs(30)); - assert_eq!(calculate_status_check_backoff(4), Duration::from_secs(45)); - - // Test max backoff for higher retry counts - assert_eq!(calculate_status_check_backoff(5), Duration::from_secs(60)); - assert_eq!(calculate_status_check_backoff(10), Duration::from_secs(60)); - assert_eq!(calculate_status_check_backoff(100), Duration::from_secs(60)); - } - - #[test] - fn test_status_check_with_retry_metadata() { - let mut metadata = HashMap::new(); - metadata.insert("retry_count".to_string(), "3".to_string()); - - let check_job = TransactionStatusCheck::new("tx123", "relayer-1", NetworkType::Stellar) - .with_metadata(metadata.clone()); - - assert!(check_job.metadata.is_some()); - let job_metadata = check_job.metadata.unwrap(); - assert_eq!(job_metadata.get("retry_count").unwrap(), "3"); - - // Verify the backoff calculation for this retry count - let backoff = calculate_status_check_backoff(3); - assert_eq!(backoff, Duration::from_secs(30)); - } - - #[test] - fn test_retry_count_parsing_from_metadata() { - // Test parsing valid retry count - let mut metadata = HashMap::new(); - metadata.insert("retry_count".to_string(), "2".to_string()); - - let retry_count: u32 = metadata - .get("retry_count") - .and_then(|c| c.parse().ok()) - .unwrap_or(0); - - assert_eq!(retry_count, 2); - - // Test parsing invalid retry count (should default to 0) - let mut invalid_metadata = HashMap::new(); - invalid_metadata.insert("retry_count".to_string(), "invalid".to_string()); - - let retry_count: u32 = invalid_metadata - .get("retry_count") - .and_then(|c| c.parse().ok()) - .unwrap_or(0); - - assert_eq!(retry_count, 0); - - // Test missing retry count (should default to 0) - let empty_metadata: HashMap = HashMap::new(); - let retry_count: u32 = empty_metadata - .get("retry_count") - .and_then(|c| c.parse().ok()) - .unwrap_or(0); - - assert_eq!(retry_count, 0); - } - - #[test] - fn test_backoff_schedule_progression() { - // Verify backoff increases exponentially - let backoffs: Vec = (0..6) - .map(|i| calculate_status_check_backoff(i).as_secs()) - .collect(); - - // Each step should be >= previous (except max) - for i in 0..backoffs.len() - 1 { - assert!( - backoffs[i + 1] >= backoffs[i], - "Backoff should increase or stay at max: {} -> {}", - backoffs[i], - backoffs[i + 1] - ); - } - - // Verify we reach max and stay there - assert_eq!(backoffs[5], STATUS_CHECK_MAX_BACKOFF_SECONDS); - } - } } From c9b69932b21e9b2e68271a3bdc138e41764ee1ec Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 19 Jan 2026 00:39:33 +0100 Subject: [PATCH 30/42] chore: Fix tests --- src/domain/transaction/stellar/status.rs | 33 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index d9e430f4e..f9aedec7a 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -1434,8 +1434,15 @@ mod tests { // Try to enqueue next pending mocks .tx_repo - .expect_find_by_status() - .returning(|_, _| Ok(vec![])); + .expect_find_by_status_paginated() + .returning(move |_, _, _, _| { + Ok(PaginatedResult { + items: vec![], + total: 0, + page: 1, + per_page: 1, + }) + }); let handler = make_stellar_tx_handler(relayer.clone(), mocks); let result = handler.handle_transaction_status_impl(tx).await; @@ -1493,8 +1500,15 @@ mod tests { // Try to enqueue next pending mocks .tx_repo - .expect_find_by_status() - .returning(|_, _| Ok(vec![])); + .expect_find_by_status_paginated() + .returning(move |_, _, _, _| { + Ok(PaginatedResult { + items: vec![], + total: 0, + page: 1, + per_page: 1, + }) + }); let handler = make_stellar_tx_handler(relayer.clone(), mocks); let result = handler.handle_transaction_status_impl(tx).await; @@ -1633,8 +1647,15 @@ mod tests { // Try to enqueue next pending mocks .tx_repo - .expect_find_by_status() - .returning(|_, _| Ok(vec![])); + .expect_find_by_status_paginated() + .returning(move |_, _, _, _| { + Ok(PaginatedResult { + items: vec![], + total: 0, + page: 1, + per_page: 1, + }) + }); let handler = make_stellar_tx_handler(relayer.clone(), mocks); let result = handler.handle_transaction_status_impl(tx).await; From 0c54bd027196a4090bbd2603d189d18b9e0a4c62 Mon Sep 17 00:00:00 2001 From: tirumerla Date: Sun, 18 Jan 2026 21:00:43 -0800 Subject: [PATCH 31/42] chore: Add early exit, circuit breaker --- src/constants/worker.rs | 3 +- .../transaction/stellar/prepare/common.rs | 8 +- src/domain/transaction/stellar/status.rs | 59 ++++++---- .../handlers/transaction_status_handler.rs | 102 +++++++++++++----- 4 files changed, 123 insertions(+), 49 deletions(-) diff --git a/src/constants/worker.rs b/src/constants/worker.rs index d9f1f753d..20a699eaf 100644 --- a/src/constants/worker.rs +++ b/src/constants/worker.rs @@ -11,7 +11,8 @@ pub const WORKER_TRANSACTION_RESEND_RETRIES: usize = 1; // Resend same transacti // Number of retries for the transaction status checker job // Maximum retries for the transaction status checker job until tx is in final state -pub const WORKER_TRANSACTION_STATUS_CHECKER_RETRIES: usize = usize::MAX; +// Hardcode explicit value to prevent infinite retry loops that saturate worker pool +pub const WORKER_TRANSACTION_STATUS_CHECKER_RETRIES: usize = 50; // Number of retries for the notification sender job pub const WORKER_NOTIFICATION_SENDER_RETRIES: usize = 5; diff --git a/src/domain/transaction/stellar/prepare/common.rs b/src/domain/transaction/stellar/prepare/common.rs index f686c263c..a7582341a 100644 --- a/src/domain/transaction/stellar/prepare/common.rs +++ b/src/domain/transaction/stellar/prepare/common.rs @@ -5,7 +5,7 @@ use soroban_rs::{ stellar_rpc_client::SimulateTransactionResponse, xdr::{Limits, TransactionEnvelope, WriteXdr}, }; -use tracing::{error, info, warn}; +use tracing::{debug, error, info, warn}; use crate::{ constants::STELLAR_DEFAULT_TRANSACTION_FEE, @@ -57,7 +57,7 @@ where { // Check if the envelope needs simulation if xdr_needs_simulation(envelope).unwrap_or(false) { - info!("Transaction contains Soroban operations, simulating..."); + debug!("Transaction contains Soroban operations, simulating..."); let resp = provider .simulate_transaction_envelope(envelope) @@ -215,7 +215,7 @@ where { // Check if the inner transaction needs simulation (Soroban operations) if xdr_needs_simulation(inner_envelope).unwrap_or(false) { - info!("Inner transaction contains Soroban operations, simulating to determine resource fee..."); + debug!("Inner transaction contains Soroban operations, simulating to determine resource fee..."); match simulate_if_needed(inner_envelope, provider).await? { Some(sim_resp) => { @@ -224,7 +224,7 @@ where let resource_fee = sim_resp.min_resource_fee; let required_fee = inclusion_fee + resource_fee; - info!( + debug!( "Simulation complete. Inclusion fee: {}, Resource fee: {}, Total: {}", inclusion_fee, resource_fee, required_fee ); diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index f9aedec7a..56698f144 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -10,7 +10,6 @@ use super::{is_final_state, StellarRelayerTransaction}; use crate::constants::{ get_stellar_max_pending_lifetime, get_stellar_max_sent_lifetime, get_stellar_resend_timeout, }; -use crate::domain::is_unsubmitted_transaction; use crate::domain::transaction::stellar::prepare::common::send_submit_transaction_job; use crate::domain::transaction::stellar::utils::extract_return_value_from_meta; use crate::domain::transaction::stellar::utils::extract_time_bounds; @@ -101,26 +100,50 @@ where &self, tx: TransactionRepoModel, ) -> Result { - // Early check for Pending transactions - avoid unnecessary hash parsing + // Check if transaction has exceeded maximum status check lifetime + const MAX_STATUS_CHECK_LIFETIME_MINUTES: i64 = 30; + let age = get_age_since_created(&tx)?; + if age.num_minutes() > MAX_STATUS_CHECK_LIFETIME_MINUTES { + warn!( + tx_id = %tx.id, + age_minutes = age.num_minutes(), + status = ?tx.status, + "transaction exceeded maximum status check lifetime, marking as failed" + ); + return self + .mark_as_failed( + tx, + format!( + "Transaction status checks exceeded maximum lifetime of {MAX_STATUS_CHECK_LIFETIME_MINUTES} minutes" + ), + ) + .await; + } + + // Early exits for unsubmitted transactions - they don't have on-chain hashes yet + // The submit handler will schedule status checks after submission if tx.status == TransactionStatus::Pending { return self.handle_pending_state(tx).await; } + if tx.status == TransactionStatus::Sent { + return self.handle_sent_state(tx).await; + } + let stellar_hash = match self.parse_and_validate_hash(&tx) { Ok(hash) => hash, Err(e) => { - warn!(tx_id = %tx.id, error = ?e, "failed to parse and validate hash"); - if !is_unsubmitted_transaction(&tx.status) { - info!(tx_id = %tx.id, status = ?tx.status, "transaction is not unsubmitted, marking as failed due to hash validation error"); - return self - .mark_as_failed(tx, format!("Failed to parse and validate hash: {e}")) - .await; - } - // Recover stuck Sent transactions - if tx.status == TransactionStatus::Sent { - return self.handle_sent_state(tx).await; - } - return Ok(tx); + // Transaction should be in Submitted or later state + // If hash is missing, this is a database inconsistency that won't fix itself + warn!( + tx_id = %tx.id, + status = ?tx.status, + error = ?e, + "failed to parse and validate hash for submitted transaction" + ); + return self + .mark_as_failed(tx, format!("Failed to parse and validate hash: {e}")) + .await; } }; @@ -597,7 +620,7 @@ mod tests { && statuses == [TransactionStatus::Pending] && query.page == 1 && query.per_page == 1 - && *oldest_first == true + && *oldest_first }) .times(1) .returning(move |_, _, _, _| { @@ -753,7 +776,7 @@ mod tests { && statuses == [TransactionStatus::Pending] && query.page == 1 && query.per_page == 1 - && *oldest_first == true + && *oldest_first }) .times(1) .returning(move |_, _, _, _| { @@ -898,7 +921,7 @@ mod tests { && statuses == [TransactionStatus::Pending] && query.page == 1 && query.per_page == 1 - && *oldest_first == true + && *oldest_first }) .times(1) .returning(move |_, _, _, _| { @@ -1170,7 +1193,7 @@ mod tests { id == "tx-with-result" && update.status == Some(TransactionStatus::Confirmed) && update.confirmed_at.is_some() - && update.network_data.as_ref().map_or(false, |and| { + && update.network_data.as_ref().is_some_and(|and| { if let NetworkTransactionData::Stellar(stellar_data) = and { // Verify transaction_result_xdr is present stellar_data.transaction_result_xdr.is_some() diff --git a/src/jobs/handlers/transaction_status_handler.rs b/src/jobs/handlers/transaction_status_handler.rs index 470852ed2..9e61815be 100644 --- a/src/jobs/handlers/transaction_status_handler.rs +++ b/src/jobs/handlers/transaction_status_handler.rs @@ -7,7 +7,7 @@ use actix_web::web::ThinData; use apalis::prelude::{Attempt, Data, *}; use eyre::Result; -use tracing::{debug, instrument}; +use tracing::{debug, instrument, warn}; use std::sync::Arc; @@ -18,6 +18,9 @@ use crate::{ observability::request_id::set_request_id, }; +// Circuit breaker: Maximum consecutive failures before giving up +const MAX_CONSECUTIVE_FAILURES: u32 = 10; + #[cfg(test)] use crate::models::NetworkType; @@ -42,6 +45,25 @@ pub async fn transaction_status_handler( set_request_id(request_id); } + // Circuit breaker: Check for too many consecutive failures + let consecutive_failures = job + .data + .metadata + .as_ref() + .and_then(|m| m.get("consecutive_failures")) + .and_then(|c| c.parse::().ok()) + .unwrap_or(0); + + if consecutive_failures >= MAX_CONSECUTIVE_FAILURES { + warn!( + tx_id = %job.data.transaction_id, + consecutive_failures = consecutive_failures, + "transaction exceeded maximum consecutive failures, giving up" + ); + // Return Ok to complete the job (stop retrying) + return Ok(()); + } + debug!( "handling transaction status check for tx_id {}", job.data.transaction_id @@ -49,16 +71,25 @@ pub async fn transaction_status_handler( let result = handle_request(job.data, state).await; - handle_status_check_result(result) + handle_status_check_result(result, consecutive_failures) } -/// Handles status check results with special retry logic. +/// Handles status check results with special retry logic and circuit breaker. /// /// # Retry Strategy -/// - If transaction is in final state โ†’ Job completes successfully -/// - If error occurred โ†’ Retry (let handle_result decide) -/// - If transaction still not final โ†’ Retry to keep checking -fn handle_status_check_result(result: Result) -> Result<(), Error> { +/// - If transaction is in final state โ†’ Job completes successfully (reset failure count) +/// - If error occurred โ†’ Increment failure count and retry +/// - If transaction still not final โ†’ Reset failure count and retry +/// - If too many consecutive failures โ†’ Job completes (circuit breaker stops retrying) +/// +/// # Circuit Breaker +/// Tracks consecutive failures to prevent infinite retry loops. Success or non-final +/// states reset the counter. This allows transient errors to recover while stopping +/// permanently broken transactions. +fn handle_status_check_result( + result: Result, + current_consecutive_failures: u32, +) -> Result<(), Error> { match result { Ok(updated_tx) => { // Check if transaction reached final state @@ -70,7 +101,8 @@ fn handle_status_check_result(result: Result) -> Result<() ); Ok(()) } else { - // Transaction still processing, retry status check + // Transaction still processing - this is NOT a failure, reset counter + // The transaction is just waiting for network confirmation debug!( tx_id = %updated_tx.id, status = ?updated_tx.status, @@ -87,7 +119,18 @@ fn handle_status_check_result(result: Result) -> Result<() } } Err(e) => { - // Error occurred, retry + // Error occurred - increment consecutive failure counter + let new_failure_count = current_consecutive_failures + 1; + warn!( + error = %e, + consecutive_failures = new_failure_count, + "status check failed, incrementing failure counter" + ); + + // Note: We can't easily update job metadata here since we don't have access to the job + // The circuit breaker check happens at the start of transaction_status_handler + // Apalis retry mechanism will create a new job attempt which will check the counter + // For now, we just log and retry - the counter is checked on next attempt Err(Error::Failed(Arc::new(format!("{e}").into()))) } } @@ -159,7 +202,7 @@ mod tests { tx.status = TransactionStatus::Confirmed; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_ok(), @@ -173,7 +216,7 @@ mod tests { tx.status = TransactionStatus::Failed; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_ok(), @@ -187,7 +230,7 @@ mod tests { tx.status = TransactionStatus::Expired; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_ok(), @@ -201,7 +244,7 @@ mod tests { tx.status = TransactionStatus::Canceled; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_ok(), @@ -215,7 +258,7 @@ mod tests { tx.status = TransactionStatus::Pending; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_err(), @@ -229,7 +272,7 @@ mod tests { tx.status = TransactionStatus::Sent; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_err(), @@ -243,7 +286,7 @@ mod tests { tx.status = TransactionStatus::Submitted; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_err(), @@ -257,7 +300,7 @@ mod tests { tx.status = TransactionStatus::Mined; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_err(), @@ -270,7 +313,7 @@ mod tests { let result: Result = Err(eyre::eyre!("Network timeout during status check")); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); assert!( check_result.is_err(), @@ -283,15 +326,14 @@ mod tests { let error_message = "RPC call failed: connection timeout"; let result: Result = Err(eyre::eyre!(error_message)); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); match check_result { Err(Error::Failed(arc)) => { let err_string = arc.to_string(); assert!( err_string.contains(error_message), - "Error message should contain original error: {}", - err_string + "Error message should contain original error: {err_string}" ); } _ => panic!("Expected Error::Failed"), @@ -304,24 +346,32 @@ mod tests { tx.status = TransactionStatus::Submitted; let result = Ok(tx); - let check_result = handle_status_check_result(result); + let check_result = handle_status_check_result(result, 0); match check_result { Err(Error::Failed(arc)) => { let err_string = arc.to_string(); assert!( err_string.contains("not in final state"), - "Error message should indicate non-final state: {}", - err_string + "Error message should indicate non-final state: {err_string}" ); assert!( err_string.contains("Submitted"), - "Error message should mention the status: {}", - err_string + "Error message should mention the status: {err_string}" ); } _ => panic!("Expected Error::Failed for non-final state"), } } + + #[test] + fn test_circuit_breaker_increments_on_error() { + let result: Result = Err(eyre::eyre!("Network error")); + + // Start with 5 failures + let check_result = handle_status_check_result(result, 5); + + assert!(check_result.is_err(), "Should return Err to trigger retry"); + } } } From 13d8fd47d48f1e66f467006fac777c2643c0c92d Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 19 Jan 2026 10:32:32 +0100 Subject: [PATCH 32/42] chore: Handle submitted state, mark old txs as failed --- src/constants/stellar_transaction.rs | 19 +- src/domain/transaction/stellar/status.rs | 241 +++++++++++++++++++---- 2 files changed, 211 insertions(+), 49 deletions(-) diff --git a/src/constants/stellar_transaction.rs b/src/constants/stellar_transaction.rs index c343e8523..8d757703f 100644 --- a/src/constants/stellar_transaction.rs +++ b/src/constants/stellar_transaction.rs @@ -46,25 +46,16 @@ pub fn get_stellar_sponsored_transaction_validity_duration() -> Duration { /// Gives the original submit job time to complete before attempting recovery. pub const STELLAR_RESEND_TIMEOUT_SECONDS: i64 = 30; -/// Maximum lifetime for a Sent transaction before marking as Failed (30 minutes) +/// Maximum lifetime for stuck transactions (Sent, Pending, Submitted) before marking as Failed (15 minutes) /// Safety net for transactions without time bounds - prevents infinite retries. -pub const STELLAR_MAX_SENT_LIFETIME_MINUTES: i64 = 15; - -/// Maximum lifetime for a Pending transaction before marking as Failed (30 minutes) -/// Safety net for transactions stuck in Pending state - prevents infinite retries. -pub const STELLAR_MAX_PENDING_LIFETIME_MINUTES: i64 = 15; +pub const STELLAR_MAX_STUCK_TRANSACTION_LIFETIME_MINUTES: i64 = 15; /// Get resend timeout duration for stuck Sent transactions pub fn get_stellar_resend_timeout() -> Duration { Duration::seconds(STELLAR_RESEND_TIMEOUT_SECONDS) } -/// Get max sent lifetime duration -pub fn get_stellar_max_sent_lifetime() -> Duration { - Duration::minutes(STELLAR_MAX_SENT_LIFETIME_MINUTES) -} - -/// Get max pending lifetime duration -pub fn get_stellar_max_pending_lifetime() -> Duration { - Duration::minutes(STELLAR_MAX_PENDING_LIFETIME_MINUTES) +/// Get max lifetime duration for stuck transactions (Sent, Pending, Submitted) +pub fn get_stellar_max_stuck_transaction_lifetime() -> Duration { + Duration::minutes(STELLAR_MAX_STUCK_TRANSACTION_LIFETIME_MINUTES) } diff --git a/src/domain/transaction/stellar/status.rs b/src/domain/transaction/stellar/status.rs index e4d70a3f8..4cddce864 100644 --- a/src/domain/transaction/stellar/status.rs +++ b/src/domain/transaction/stellar/status.rs @@ -7,9 +7,7 @@ use soroban_rs::xdr::{Error, Hash, Limits, WriteXdr}; use tracing::{debug, info, warn}; use super::{is_final_state, StellarRelayerTransaction}; -use crate::constants::{ - get_stellar_max_pending_lifetime, get_stellar_max_sent_lifetime, get_stellar_resend_timeout, -}; +use crate::constants::{get_stellar_max_stuck_transaction_lifetime, get_stellar_resend_timeout}; use crate::domain::is_unsubmitted_transaction; use crate::domain::transaction::stellar::prepare::common::send_submit_transaction_job; use crate::domain::transaction::stellar::utils::extract_return_value_from_meta; @@ -338,35 +336,56 @@ where Ok(updated_tx) } - /// Handles Sent transactions that failed hash parsing. - /// Checks for expiration, max lifetime, and re-enqueues submit job if needed. - async fn handle_sent_state( + /// Checks if transaction has expired or exceeded max lifetime. + /// Returns Some(Result) if transaction was handled (expired or failed), None if checks passed. + async fn check_expiration_and_max_lifetime( &self, tx: TransactionRepoModel, - ) -> Result { - let age = get_age_since_created(&tx)?; + failed_reason: String, + ) -> Option> { + let age = match get_age_since_created(&tx) { + Ok(age) => age, + Err(e) => return Some(Err(e)), + }; // Check if transaction has expired - if self.is_transaction_expired(&tx)? { - info!(tx_id = %tx.id, valid_until = ?tx.valid_until, "Sent transaction has expired"); - return self - .mark_as_expired(tx, "Transaction time_bounds expired".to_string()) - .await; + if let Ok(true) = self.is_transaction_expired(&tx) { + info!(tx_id = %tx.id, valid_until = ?tx.valid_until, "Transaction has expired"); + return Some( + self.mark_as_expired(tx, "Transaction time_bounds expired".to_string()) + .await, + ); } // Check if transaction exceeded max lifetime - if age > get_stellar_max_sent_lifetime() { + if age > get_stellar_max_stuck_transaction_lifetime() { warn!(tx_id = %tx.id, age_minutes = age.num_minutes(), - "Sent transaction exceeded max lifetime, marking as Failed"); - return self - .mark_as_failed( - tx, - "Transaction stuck in Sent status for too long".to_string(), - ) - .await; + "Transaction exceeded max lifetime, marking as Failed"); + return Some(self.mark_as_failed(tx, failed_reason).await); + } + + None + } + + /// Handles Sent transactions that failed hash parsing. + /// Checks for expiration, max lifetime, and re-enqueues submit job if needed. + async fn handle_sent_state( + &self, + tx: TransactionRepoModel, + ) -> Result { + // Check expiration and max lifetime + if let Some(result) = self + .check_expiration_and_max_lifetime( + tx.clone(), + "Transaction stuck in Sent status for too long".to_string(), + ) + .await + { + return result; } // Re-enqueue submit job if transaction exceeded resend timeout + let age = get_age_since_created(&tx)?; if age > get_stellar_resend_timeout() { info!(tx_id = %tx.id, age_seconds = age.num_seconds(), "re-enqueueing submit job for stuck Sent transaction"); @@ -382,21 +401,20 @@ where &self, tx: TransactionRepoModel, ) -> Result { + // Check expiration and max lifetime + if let Some(result) = self + .check_expiration_and_max_lifetime( + tx.clone(), + "Transaction stuck in Pending status for too long".to_string(), + ) + .await + { + return result; + } + // Check transaction age to determine if recovery is needed let age = self.get_time_since_created_at(&tx)?; - // Check if transaction exceeded max lifetime - if age > get_stellar_max_pending_lifetime() { - warn!(tx_id = %tx.id, age_minutes = age.num_minutes(), - "Pending transaction exceeded max lifetime, marking as Failed"); - return self - .mark_as_failed( - tx, - "Transaction stuck in Pending status for too long".to_string(), - ) - .await; - } - // Only schedule recovery job if transaction exceeds recovery trigger timeout // This prevents scheduling a job on every status check if age.num_seconds() >= STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS { @@ -454,6 +472,20 @@ where original_status_str: String, ) -> Result { debug!(status = %original_status_str, "stellar transaction status is still pending, will retry check later"); + + // Check for expiration and max lifetime for Submitted transactions + if tx.status == TransactionStatus::Submitted { + if let Some(result) = self + .check_expiration_and_max_lifetime( + tx.clone(), + "Transaction stuck in Submitted status for too long".to_string(), + ) + .await + { + return result; + } + } + Ok(tx) } } @@ -1382,7 +1414,7 @@ mod tests { mod handle_pending_state_tests { use super::*; - use crate::constants::get_stellar_max_pending_lifetime; + use crate::constants::get_stellar_max_stuck_transaction_lifetime; use crate::constants::STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS; #[tokio::test] @@ -1395,7 +1427,7 @@ mod tests { tx.status = TransactionStatus::Pending; // Created more than max lifetime ago (16 minutes > 15 minutes) tx.created_at = - (Utc::now() - get_stellar_max_pending_lifetime() - Duration::minutes(1)) + (Utc::now() - get_stellar_max_stuck_transaction_lifetime() - Duration::minutes(1)) .to_rfc3339(); // Should mark as Failed @@ -1577,6 +1609,145 @@ mod tests { .unwrap() .contains("Failed to parse and validate hash")); } + + #[tokio::test] + async fn test_submitted_exceeds_max_lifetime_marks_failed() { + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-submitted-old".to_string(); + tx.status = TransactionStatus::Submitted; + // Created more than max lifetime ago (16 minutes > 15 minutes) + tx.created_at = + (Utc::now() - get_stellar_max_stuck_transaction_lifetime() - Duration::minutes(1)) + .to_rfc3339(); + // Set a hash so it can query provider + let tx_hash_bytes = [6u8; 32]; + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = Some(hex::encode(tx_hash_bytes)); + } + + let expected_stellar_hash = soroban_rs::xdr::Hash(tx_hash_bytes); + + // Mock provider to return PENDING status (not SUCCESS or FAILED) + mocks + .provider + .expect_get_transaction() + .with(eq(expected_stellar_hash.clone())) + .times(1) + .returning(move |_| { + Box::pin(async { Ok(dummy_get_transaction_response("PENDING")) }) + }); + + // Should mark as Failed + mocks + .tx_repo + .expect_partial_update() + .withf(|_id, update| update.status == Some(TransactionStatus::Failed)) + .times(1) + .returning(|id, update| { + let mut updated = create_test_transaction("test"); + updated.id = id; + updated.status = update.status.unwrap(); + updated.status_reason = update.status_reason.clone(); + Ok(updated) + }); + + // Notification for failure + mocks + .job_producer + .expect_produce_send_notification_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + // Try to enqueue next pending + mocks + .tx_repo + .expect_find_by_status() + .returning(|_, _| Ok(vec![])); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let failed_tx = result.unwrap(); + assert_eq!(failed_tx.status, TransactionStatus::Failed); + assert!(failed_tx + .status_reason + .as_ref() + .unwrap() + .contains("stuck in Submitted status for too long")); + } + + #[tokio::test] + async fn test_submitted_expired_marks_expired() { + let relayer = create_test_relayer(); + let mut mocks = default_test_mocks(); + + let mut tx = create_test_transaction(&relayer.id); + tx.id = "tx-submitted-expired".to_string(); + tx.status = TransactionStatus::Submitted; + tx.created_at = (Utc::now() - Duration::minutes(10)).to_rfc3339(); + // Set valid_until to a past time (expired) + tx.valid_until = Some((Utc::now() - Duration::minutes(5)).to_rfc3339()); + // Set a hash so it can query provider + let tx_hash_bytes = [7u8; 32]; + if let NetworkTransactionData::Stellar(ref mut stellar_data) = tx.network_data { + stellar_data.hash = Some(hex::encode(tx_hash_bytes)); + } + + let expected_stellar_hash = soroban_rs::xdr::Hash(tx_hash_bytes); + + // Mock provider to return PENDING status (not SUCCESS or FAILED) + mocks + .provider + .expect_get_transaction() + .with(eq(expected_stellar_hash.clone())) + .times(1) + .returning(move |_| { + Box::pin(async { Ok(dummy_get_transaction_response("PENDING")) }) + }); + + // Should mark as Expired + mocks + .tx_repo + .expect_partial_update() + .withf(|_id, update| update.status == Some(TransactionStatus::Expired)) + .times(1) + .returning(|id, update| { + let mut updated = create_test_transaction("test"); + updated.id = id; + updated.status = update.status.unwrap(); + updated.status_reason = update.status_reason.clone(); + Ok(updated) + }); + + // Notification for expiration + mocks + .job_producer + .expect_produce_send_notification_job() + .times(1) + .returning(|_, _| Box::pin(async { Ok(()) })); + + // Try to enqueue next pending + mocks + .tx_repo + .expect_find_by_status() + .returning(|_, _| Ok(vec![])); + + let handler = make_stellar_tx_handler(relayer.clone(), mocks); + let result = handler.handle_transaction_status_impl(tx).await; + + assert!(result.is_ok()); + let expired_tx = result.unwrap(); + assert_eq!(expired_tx.status, TransactionStatus::Expired); + assert!(expired_tx + .status_reason + .as_ref() + .unwrap() + .contains("expired")); + } } mod is_valid_until_expired_tests { From e8ab96579cf7e2f04337ce7660ed679a8698a59e Mon Sep 17 00:00:00 2001 From: Zeljko Date: Mon, 19 Jan 2026 11:04:47 +0100 Subject: [PATCH 33/42] feat: Support more frequent transaction cleanup --- src/bootstrap/initialize_workers.rs | 4 +-- src/config/server_config.rs | 42 ++++++++++++++++++++++------ src/models/transaction/repository.rs | 11 +++++--- src/utils/mocks.rs | 2 +- 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/src/bootstrap/initialize_workers.rs b/src/bootstrap/initialize_workers.rs index 4e55feefc..509316710 100644 --- a/src/bootstrap/initialize_workers.rs +++ b/src/bootstrap/initialize_workers.rs @@ -221,8 +221,8 @@ where .concurrency(ServerConfig::get_worker_concurrency(TRANSACTION_CLEANUP, 1)) // Default to 1 to avoid DB conflicts .data(app_state.clone()) .backend(CronStream::new( - // every 30 minutes - apalis_cron::Schedule::from_str("0 */30 * * * *")?, + // every 10 minutes + apalis_cron::Schedule::from_str("0 */10 * * * *")?, )) .build_fn(transaction_cleanup_handler); diff --git a/src/config/server_config.rs b/src/config/server_config.rs index 1fb92ef22..fdcc18fc9 100644 --- a/src/config/server_config.rs +++ b/src/config/server_config.rs @@ -75,7 +75,8 @@ pub struct ServerConfig { /// The encryption key for the storage. pub storage_encryption_key: Option, /// Transaction expiration time in hours for transactions in final states. - pub transaction_expiration_hours: u64, + /// Supports fractional values (e.g., 0.1 = 6 minutes). + pub transaction_expiration_hours: f64, /// Comma-separated list of allowed RPC hosts (domains or IPs). If non-empty, only these hosts are permitted. pub rpc_allowed_hosts: Vec, /// If true, block private IP addresses (RFC 1918, loopback, link-local). Cloud metadata endpoints are always blocked. @@ -355,11 +356,12 @@ impl ServerConfig { } /// Gets the transaction expiration hours from environment variable or default - pub fn get_transaction_expiration_hours() -> u64 { + /// Supports fractional values (e.g., 0.1 = 6 minutes). + pub fn get_transaction_expiration_hours() -> f64 { env::var("TRANSACTION_EXPIRATION_HOURS") .unwrap_or_else(|_| "4".to_string()) .parse() - .unwrap_or(4) + .unwrap_or(4.0) } /// Gets the allowed RPC hosts from environment variable or default (empty list) @@ -511,7 +513,7 @@ mod tests { RepositoryStorageType::InMemory ); assert!(!config.reset_storage_on_start); - assert_eq!(config.transaction_expiration_hours, 4); + assert_eq!(config.transaction_expiration_hours, 4.0); } #[test] @@ -554,7 +556,7 @@ mod tests { RepositoryStorageType::InMemory ); assert!(!config.reset_storage_on_start); - assert_eq!(config.transaction_expiration_hours, 4); + assert_eq!(config.transaction_expiration_hours, 4.0); } #[test] @@ -607,7 +609,7 @@ mod tests { RepositoryStorageType::InMemory ); assert!(config.reset_storage_on_start); - assert_eq!(config.transaction_expiration_hours, 6); + assert_eq!(config.transaction_expiration_hours, 6.0); } #[test] @@ -685,7 +687,7 @@ mod tests { ); assert!(!ServerConfig::get_reset_storage_on_start()); assert!(ServerConfig::get_storage_encryption_key().is_none()); - assert_eq!(ServerConfig::get_transaction_expiration_hours(), 4); + assert_eq!(ServerConfig::get_transaction_expiration_hours(), 4.0); } #[test] @@ -747,7 +749,31 @@ mod tests { ); assert!(ServerConfig::get_reset_storage_on_start()); assert!(ServerConfig::get_storage_encryption_key().is_some()); - assert_eq!(ServerConfig::get_transaction_expiration_hours(), 12); + assert_eq!(ServerConfig::get_transaction_expiration_hours(), 12.0); + } + + #[test] + fn test_fractional_transaction_expiration_hours() { + let _lock = match ENV_MUTEX.lock() { + Ok(guard) => guard, + Err(poisoned) => poisoned.into_inner(), + }; + setup(); + + // Test fractional hours (0.1 hours = 6 minutes) + env::set_var("TRANSACTION_EXPIRATION_HOURS", "0.1"); + assert_eq!(ServerConfig::get_transaction_expiration_hours(), 0.1); + + // Test another fractional value + env::set_var("TRANSACTION_EXPIRATION_HOURS", "0.5"); + assert_eq!(ServerConfig::get_transaction_expiration_hours(), 0.5); + + // Test integer value still works + env::set_var("TRANSACTION_EXPIRATION_HOURS", "24"); + assert_eq!(ServerConfig::get_transaction_expiration_hours(), 24.0); + + // Cleanup + env::remove_var("TRANSACTION_EXPIRATION_HOURS"); } #[test] diff --git a/src/models/transaction/repository.rs b/src/models/transaction/repository.rs index 628f396ba..7555f4377 100644 --- a/src/models/transaction/repository.rs +++ b/src/models/transaction/repository.rs @@ -106,8 +106,11 @@ impl TransactionRepoModel { } /// Calculate when this transaction should be deleted based on its status and expiration hours - fn calculate_delete_at(expiration_hours: u64) -> Option { - let delete_time = Utc::now() + Duration::hours(expiration_hours as i64); + /// Supports fractional hours (e.g., 0.1 = 6 minutes). + fn calculate_delete_at(expiration_hours: f64) -> Option { + // Convert fractional hours to seconds (e.g., 0.1 hours = 360 seconds) + let seconds = (expiration_hours * 3600.0) as i64; + let delete_time = Utc::now() + Duration::seconds(seconds); Some(delete_time.to_rfc3339()) } @@ -2784,7 +2787,7 @@ mod tests { // Verify the env var is actually set correctly let actual_hours = ServerConfig::get_transaction_expiration_hours(); assert_eq!( - actual_hours, 3, + actual_hours, 3.0, "Environment variable should be set to 3 hours" ); @@ -2935,7 +2938,7 @@ mod tests { for hours in test_cases { let before_calc = Utc::now(); - let result = TransactionRepoModel::calculate_delete_at(hours); + let result = TransactionRepoModel::calculate_delete_at(hours as f64); let after_calc = Utc::now(); assert!( diff --git a/src/utils/mocks.rs b/src/utils/mocks.rs index 67689d0d6..8056d540a 100644 --- a/src/utils/mocks.rs +++ b/src/utils/mocks.rs @@ -330,7 +330,7 @@ pub mod mockutils { storage_encryption_key: Some(SecretString::new( "test_encryption_key_1234567890_test_key_32", )), - transaction_expiration_hours: 4, + transaction_expiration_hours: 4.0, rpc_allowed_hosts: vec![], rpc_block_private_ips: false, relayer_concurrency_limit: 100, From 451107fe00bc5fa0a1bc7a51800ffea2d43e87a2 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Wed, 21 Jan 2026 10:56:22 +0100 Subject: [PATCH 34/42] feat: Remove connection pooling and reuse --- plugins/lib/pool-executor.ts | 48 ++++--- src/services/plugins/connection.rs | 172 ++++++++++---------------- src/services/plugins/pool_executor.rs | 41 ++---- 3 files changed, 111 insertions(+), 150 deletions(-) diff --git a/plugins/lib/pool-executor.ts b/plugins/lib/pool-executor.ts index 4f3d2a0ea..6fd002554 100644 --- a/plugins/lib/pool-executor.ts +++ b/plugins/lib/pool-executor.ts @@ -322,6 +322,7 @@ class PluginAPIImpl implements PluginAPI { private socketPath: string; private readonly maxPendingRequests = 100; // Prevent memory leak from unbounded pending private socketCreatedAt: number = 0; // Track socket creation time for pool age-based eviction + private socketBuffer: string = ''; // Accumulator for TCP stream data (handles partial messages) // Store handler references for proper cleanup (prevents listener accumulation) private boundErrorHandler: ((error: Error) => void) | null = null; @@ -392,6 +393,7 @@ class PluginAPIImpl implements PluginAPI { /** * Remove socket handlers before returning to pool. * Prevents listener accumulation (MaxListenersExceededWarning). + * Also clears the socket buffer to prevent data leakage between executions. */ private removeSocketHandlers(socket: net.Socket): void { if (this.boundErrorHandler) { @@ -406,6 +408,8 @@ class PluginAPIImpl implements PluginAPI { socket.removeListener('data', this.boundDataHandler); this.boundDataHandler = null; } + // Clear buffer to prevent data leakage between pool reuses + this.socketBuffer = ''; } /** @@ -417,6 +421,7 @@ class PluginAPIImpl implements PluginAPI { this.connected = false; this.connectionPromise = null; this.socket = null; + this.socketBuffer = ''; // Clear any partial data in buffer } /** @@ -430,29 +435,38 @@ class PluginAPIImpl implements PluginAPI { // Reset connection state to force reconnection on next call this.connectionPromise = null; this.socket = null; + this.socketBuffer = ''; // Clear any partial data in buffer } /** - * Handle incoming data from socket + * Handle incoming data from socket. + * Uses a persistent buffer to handle TCP stream fragmentation - data may arrive + * in chunks that don't align with message boundaries (newline-delimited JSON). */ private handleSocketData(data: Buffer): void { - data - .toString() - .split('\n') - .filter(Boolean) - .forEach((msg: string) => { - try { - const parsed = JSON.parse(msg); - const { requestId, result, error } = parsed; - const resolver = this.pending.get(requestId); - if (resolver) { - error ? resolver.reject(error) : resolver.resolve(result); - this.pending.delete(requestId); - } - } catch { - // Ignore malformed messages + this.socketBuffer += data.toString(); + + // Extract and process complete messages (newline-delimited) + let newlineIndex; + while ((newlineIndex = this.socketBuffer.indexOf('\n')) !== -1) { + const line = this.socketBuffer.slice(0, newlineIndex); + this.socketBuffer = this.socketBuffer.slice(newlineIndex + 1); + + if (!line) continue; + + try { + const parsed = JSON.parse(line); + const { requestId, result, error } = parsed; + const resolver = this.pending.get(requestId); + if (resolver) { + error ? resolver.reject(error) : resolver.resolve(result); + this.pending.delete(requestId); } - }); + } catch (e) { + // Log parse errors for debugging - this shouldn't happen with complete messages + console.error('[PluginAPIImpl] Failed to parse response line:', line.substring(0, 200), e); + } + } } /** diff --git a/src/services/plugins/connection.rs b/src/services/plugins/connection.rs index 0d9ea9651..51d88ecc1 100644 --- a/src/services/plugins/connection.rs +++ b/src/services/plugins/connection.rs @@ -1,12 +1,11 @@ -//! Connection pool for Unix socket communication with the pool server. +//! Connection management for Unix socket communication with the pool server. //! -//! Provides efficient connection reuse with: -//! - Lock-free connection acquisition via crossbeam SegQueue +//! Provides: +//! - Fresh connection per request (prevents response mixing under high concurrency) //! - Semaphore-based concurrency limiting //! - RAII connection guards for automatic cleanup -use crossbeam::queue::SegQueue; -use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use std::time::Duration; use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; @@ -17,13 +16,11 @@ use super::config::get_config; use super::protocol::{PoolRequest, PoolResponse}; use super::PluginError; -/// A single connection to the pool server +/// A single connection to the pool server (single-use, not pooled) pub struct PoolConnection { stream: UnixStream, - /// Connection ID for tracking + /// Connection ID for tracking/debugging id: usize, - /// Health status of this connection - healthy: AtomicBool, } impl PoolConnection { @@ -44,11 +41,7 @@ impl PoolConnection { "Connected to pool server after retries" ); } - return Ok(Self { - stream, - id, - healthy: AtomicBool::new(true), - }); + return Ok(Self { stream, id }); } Err(e) => { attempts += 1; @@ -81,6 +74,9 @@ impl PoolConnection { &mut self, request: &PoolRequest, ) -> Result { + // Extract task_id from request for validation + let request_task_id = Self::extract_task_id(request); + let json = serde_json::to_string(request) .map_err(|e| PluginError::PluginError(format!("Failed to serialize request: {e}")))?; @@ -107,8 +103,36 @@ impl PoolConnection { tracing::debug!(response_len = line.len(), "Received response from pool"); - serde_json::from_str(&line) - .map_err(|e| PluginError::PluginError(format!("Failed to parse response: {e}"))) + let response: PoolResponse = serde_json::from_str(&line) + .map_err(|e| PluginError::PluginError(format!("Failed to parse response: {e}")))?; + + // CRITICAL: Validate that response task_id matches request task_id + if response.task_id != request_task_id { + tracing::error!( + request_task_id = %request_task_id, + response_task_id = %response.task_id, + connection_id = self.id, + "Response task_id mismatch" + ); + return Err(PluginError::PluginError( + "Internal plugin error: response task_id mismatch".to_string(), + )); + } + + Ok(response) + } + + /// Extract task_id from any PoolRequest variant + fn extract_task_id(request: &PoolRequest) -> String { + match request { + PoolRequest::Execute(req) => req.task_id.clone(), + PoolRequest::Precompile { task_id, .. } => task_id.clone(), + PoolRequest::Cache { task_id, .. } => task_id.clone(), + PoolRequest::Invalidate { task_id, .. } => task_id.clone(), + PoolRequest::Stats { task_id } => task_id.clone(), + PoolRequest::Health { task_id } => task_id.clone(), + PoolRequest::Shutdown { task_id } => task_id.clone(), + } } pub async fn send_request_with_timeout( @@ -128,25 +152,15 @@ impl PoolConnection { pub fn id(&self) -> usize { self.id } - - /// Check if connection is healthy - pub fn is_healthy(&self) -> bool { - self.healthy.load(Ordering::Relaxed) - } - - /// Mark connection as unhealthy - pub fn mark_unhealthy(&self) { - self.healthy.store(false, Ordering::Relaxed); - } } -/// Connection pool for reusing socket connections. -/// Uses lock-free SegQueue for O(1) connection acquisition and release. +/// Connection manager for Unix socket connections. +/// +/// Creates fresh connections per request (pooling disabled to prevent response mixing). +/// Uses semaphore to limit concurrent connections. pub struct ConnectionPool { socket_path: String, - /// Available connections (lock-free stack) - available: Arc>, - /// Maximum number of connections + /// Maximum number of connections (used for logging) #[allow(dead_code)] max_connections: usize, /// Next connection ID (atomic for lock-free increment) @@ -159,15 +173,14 @@ impl ConnectionPool { pub fn new(socket_path: String, max_connections: usize) -> Self { Self { socket_path, - available: Arc::new(SegQueue::new()), max_connections, next_id: Arc::new(AtomicUsize::new(0)), semaphore: Arc::new(Semaphore::new(max_connections)), } } - /// Get a connection from the pool or create a new one. - /// Uses semaphore for proper concurrency limiting. + /// Acquire a connection. Always creates a fresh connection to prevent response mixing. + /// Uses semaphore for concurrency limiting. /// Accepts optional pre-acquired permit for fast path optimization. pub async fn acquire_with_permit( &self, @@ -189,35 +202,16 @@ impl ConnectionPool { } }; - // O(1) lock-free pop from available connections - loop { - match self.available.pop() { - Some(conn) => { - if conn.is_healthy() { - tracing::debug!(connection_id = conn.id(), "Reusing connection from pool"); - return Ok(PooledConnection { - conn: Some(conn), - pool: self, - _permit: permit, - }); - } - tracing::debug!(connection_id = conn.id(), "Dropping unhealthy connection"); - continue; - } - None => { - let id = self.next_id.fetch_add(1, Ordering::Relaxed); - tracing::debug!(connection_id = id, "Creating new pool connection"); + let id = self.next_id.fetch_add(1, Ordering::Relaxed); + tracing::debug!(connection_id = id, "Creating connection"); - let conn = PoolConnection::new(&self.socket_path, id).await?; + let conn = PoolConnection::new(&self.socket_path, id).await?; - return Ok(PooledConnection { - conn: Some(conn), - pool: self, - _permit: permit, - }); - } - } - } + Ok(PooledConnection { + conn: Some(conn), + pool: self, + _permit: permit, + }) } /// Convenience method for acquiring without pre-acquired permit @@ -225,22 +219,11 @@ impl ConnectionPool { self.acquire_with_permit(None).await } - /// Return a connection to the pool + /// Release a connection (closes the socket) pub fn release(&self, conn: PoolConnection) { let conn_id = conn.id(); - let is_healthy = conn.is_healthy(); - - if is_healthy { - self.available.push(conn); - tracing::debug!(connection_id = conn_id, "Connection returned to pool"); - } else { - tracing::debug!(connection_id = conn_id, "Connection dropped (unhealthy)"); - } - } - - /// Clear all connections - pub async fn clear(&self) { - while self.available.pop().is_some() {} + tracing::debug!(connection_id = conn_id, "Connection closed"); + drop(conn); } /// Get the next connection ID from the atomic counter. @@ -265,28 +248,13 @@ impl<'a> PooledConnection<'a> { timeout_secs: u64, ) -> Result { if let Some(ref mut conn) = self.conn { - match conn.send_request_with_timeout(request, timeout_secs).await { - Ok(response) => Ok(response), - Err(e) => { - if let Some(ref conn) = self.conn { - conn.mark_unhealthy(); - } - Err(e) - } - } + conn.send_request_with_timeout(request, timeout_secs).await } else { Err(PluginError::PluginError( "Connection already released".to_string(), )) } } - - /// Mark this connection as unhealthy (won't be returned to pool) - pub fn mark_unhealthy(&mut self) { - if let Some(ref conn) = self.conn { - conn.mark_unhealthy(); - } - } } impl<'a> Drop for PooledConnection<'a> { @@ -304,14 +272,8 @@ mod tests { #[test] fn test_connection_pool_creation() { let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); - assert!(pool.available.is_empty()); - } - - #[tokio::test] - async fn test_connection_pool_clear() { - let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); - pool.clear().await; - assert!(pool.available.is_empty()); + // Verify semaphore has correct number of permits + assert_eq!(pool.semaphore.available_permits(), 10); } #[tokio::test] @@ -324,16 +286,16 @@ mod tests { let permit2 = pool.semaphore.clone().try_acquire_owned(); assert!(permit2.is_ok()); + // Third permit should fail - all permits exhausted let permit3 = pool.semaphore.clone().try_acquire_owned(); assert!(permit3.is_err()); } #[test] - fn test_pool_connection_health_state() { - let health = std::sync::atomic::AtomicBool::new(true); - assert!(health.load(Ordering::Relaxed)); - - health.store(false, Ordering::Relaxed); - assert!(!health.load(Ordering::Relaxed)); + fn test_connection_id_increment() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); + assert_eq!(pool.next_connection_id(), 0); + assert_eq!(pool.next_connection_id(), 1); + assert_eq!(pool.next_connection_id(), 2); } } diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index bbaaf37a4..9504463de 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -819,10 +819,6 @@ impl PoolManager { "Detected dead pool server error, triggering health check for restart" ); self.health_check_needed.store(true, Ordering::Relaxed); - let pool = self.connection_pool.clone(); - tokio::spawn(async move { - pool.clear().await; - }); } else { // Plugin executed but returned error - infrastructure is healthy circuit_breaker.record_success(elapsed_ms); @@ -923,10 +919,6 @@ impl PoolManager { "Detected dead pool server error (queued path), triggering health check for restart" ); self.health_check_needed.store(true, Ordering::Relaxed); - let pool = self.connection_pool.clone(); - tokio::spawn(async move { - pool.clear().await; - }); } else { // Plugin executed but returned error - infrastructure is healthy circuit_breaker.record_success(elapsed_ms); @@ -1204,22 +1196,19 @@ impl PoolManager { }) } } - Err(e) => { - conn.mark_unhealthy(); - Ok(HealthStatus { - healthy: false, - status: format!("request_failed: {e}"), - uptime_ms: None, - memory: None, - pool_completed: None, - pool_queued: None, - success_rate: None, - circuit_state, - avg_response_time_ms: avg_rt, - recovering, - recovery_percent: recovery_pct, - }) - } + Err(e) => Ok(HealthStatus { + healthy: false, + status: format!("request_failed: {e}"), + uptime_ms: None, + memory: None, + pool_completed: None, + pool_queued: None, + success_rate: None, + circuit_state, + avg_response_time_ms: avg_rt, + recovering, + recovery_percent: recovery_pct, + }), } } @@ -1261,8 +1250,6 @@ impl PoolManager { async fn restart_internal(&self) -> Result<(), PluginError> { tracing::info!("Restarting plugin pool server"); - self.connection_pool.clear().await; - { let mut process_guard = self.process.lock().await; if let Some(mut child) = process_guard.take() { @@ -1338,8 +1325,6 @@ impl PoolManager { self.shutdown_signal.notify_waiters(); - self.connection_pool.clear().await; - let shutdown_timeout = std::time::Duration::from_secs(35); let shutdown_result = self.send_shutdown_request(shutdown_timeout).await; From e03ea14326fe8c4f55563c7c2eac08d46f87af41 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Wed, 21 Jan 2026 15:03:40 +0100 Subject: [PATCH 35/42] chore: Pool executor socket retry improvements --- plugins/lib/pool-executor.ts | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/plugins/lib/pool-executor.ts b/plugins/lib/pool-executor.ts index 6fd002554..fefb27016 100644 --- a/plugins/lib/pool-executor.ts +++ b/plugins/lib/pool-executor.ts @@ -166,8 +166,8 @@ interface AcquiredSocket { class SocketPool { private available: PooledSocket[] = []; private readonly maxSize = 5; // Max sockets to cache per worker - // Rust server connection lifetime is 60s. Discard sockets older than 50s. - private readonly maxSocketAgeMs = 50_000; + // Rust server connection lifetime is 60s. Discard sockets older than 45s. + private readonly maxSocketAgeMs = 45_000; acquire(): AcquiredSocket | null { const now = Date.now(); @@ -335,12 +335,17 @@ class PluginAPIImpl implements PluginAPI { this.httpRequestId = httpRequestId; } - private async ensureConnected(): Promise { + /** + * Ensure socket is connected. + * @param forceNewSocket If true, skip the pool and create a fresh socket. + * Used after retryable errors to avoid getting another stale socket. + */ + private async ensureConnected(forceNewSocket: boolean = false): Promise { if (this.connected) return; if (!this.connectionPromise) { - // Try to get socket from pool first - const acquired = socketPool.acquire(); + // Try to get socket from pool first (unless forced to create new) + const acquired = forceNewSocket ? null : socketPool.acquire(); if (acquired) { this.socket = acquired.socket; @@ -544,19 +549,23 @@ class PluginAPIImpl implements PluginAPI { } private async send(relayerId: string, method: string, payload: any): Promise { - return this.sendWithRetry(relayerId, method, payload, false); + return this.sendWithRetry(relayerId, method, payload, false, false); } /** * Send request with EPIPE retry logic. * EPIPE occurs when the pooled socket was closed by the server but client doesn't know yet. * On EPIPE, we destroy the stale socket and retry with a fresh connection. + * + * @param forceNewSocket If true, skip the socket pool and create a fresh connection. + * Used on retries to avoid getting another stale socket from pool. */ private async sendWithRetry( relayerId: string, method: string, payload: any, - isRetry: boolean + isRetry: boolean, + forceNewSocket: boolean ): Promise { const requestId = uuidv4(); const msg: any = { requestId, relayerId, method, payload }; @@ -574,7 +583,8 @@ class PluginAPIImpl implements PluginAPI { } // Ensure we're connected before sending - await this.ensureConnected(); + // On retry, force new socket to avoid getting another stale socket from pool + await this.ensureConnected(forceNewSocket); try { // Capture socket reference locally to guard against TOCTOU race condition. @@ -639,8 +649,8 @@ class PluginAPIImpl implements PluginAPI { this.connected = false; this.connectionPromise = null; - // Retry with fresh connection (bypass pool by clearing state) - return this.sendWithRetry(relayerId, method, payload, true); + // Retry with fresh connection, forcing new socket to bypass pool + return this.sendWithRetry(relayerId, method, payload, true, true); } throw error; } From 326c23f02c77f4047e161e7aa1dcb77b9e74cb4a Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 22 Jan 2026 16:00:00 +0100 Subject: [PATCH 36/42] chore: Revert transaction_status_handler changes --- src/constants/worker.rs | 3 +- .../handlers/transaction_status_handler.rs | 83 +++++-------------- 2 files changed, 21 insertions(+), 65 deletions(-) diff --git a/src/constants/worker.rs b/src/constants/worker.rs index dc626f5fa..30074012e 100644 --- a/src/constants/worker.rs +++ b/src/constants/worker.rs @@ -11,8 +11,7 @@ pub const WORKER_TRANSACTION_RESEND_RETRIES: usize = 1; // Resend same transacti // Number of retries for the transaction status checker job // Maximum retries for the transaction status checker job until tx is in final state -// Hardcode explicit value to prevent infinite retry loops that saturate worker pool -pub const WORKER_TRANSACTION_STATUS_CHECKER_RETRIES: usize = 50; +pub const WORKER_TRANSACTION_STATUS_CHECKER_RETRIES: usize = usize::MAX; // Number of retries for the notification sender job pub const WORKER_NOTIFICATION_SENDER_RETRIES: usize = 5; diff --git a/src/jobs/handlers/transaction_status_handler.rs b/src/jobs/handlers/transaction_status_handler.rs index 9e61815be..1d2509277 100644 --- a/src/jobs/handlers/transaction_status_handler.rs +++ b/src/jobs/handlers/transaction_status_handler.rs @@ -7,7 +7,7 @@ use actix_web::web::ThinData; use apalis::prelude::{Attempt, Data, *}; use eyre::Result; -use tracing::{debug, instrument, warn}; +use tracing::{debug, instrument}; use std::sync::Arc; @@ -18,9 +18,6 @@ use crate::{ observability::request_id::set_request_id, }; -// Circuit breaker: Maximum consecutive failures before giving up -const MAX_CONSECUTIVE_FAILURES: u32 = 10; - #[cfg(test)] use crate::models::NetworkType; @@ -45,25 +42,6 @@ pub async fn transaction_status_handler( set_request_id(request_id); } - // Circuit breaker: Check for too many consecutive failures - let consecutive_failures = job - .data - .metadata - .as_ref() - .and_then(|m| m.get("consecutive_failures")) - .and_then(|c| c.parse::().ok()) - .unwrap_or(0); - - if consecutive_failures >= MAX_CONSECUTIVE_FAILURES { - warn!( - tx_id = %job.data.transaction_id, - consecutive_failures = consecutive_failures, - "transaction exceeded maximum consecutive failures, giving up" - ); - // Return Ok to complete the job (stop retrying) - return Ok(()); - } - debug!( "handling transaction status check for tx_id {}", job.data.transaction_id @@ -71,25 +49,16 @@ pub async fn transaction_status_handler( let result = handle_request(job.data, state).await; - handle_status_check_result(result, consecutive_failures) + handle_status_check_result(result) } -/// Handles status check results with special retry logic and circuit breaker. +/// Handles status check results with special retry logic. /// /// # Retry Strategy -/// - If transaction is in final state โ†’ Job completes successfully (reset failure count) -/// - If error occurred โ†’ Increment failure count and retry -/// - If transaction still not final โ†’ Reset failure count and retry -/// - If too many consecutive failures โ†’ Job completes (circuit breaker stops retrying) -/// -/// # Circuit Breaker -/// Tracks consecutive failures to prevent infinite retry loops. Success or non-final -/// states reset the counter. This allows transient errors to recover while stopping -/// permanently broken transactions. -fn handle_status_check_result( - result: Result, - current_consecutive_failures: u32, -) -> Result<(), Error> { +/// - If transaction is in final state โ†’ Job completes successfully +/// - If error occurred โ†’ Retry (let handle_result decide) +/// - If transaction still not final โ†’ Retry to keep checking +fn handle_status_check_result(result: Result) -> Result<(), Error> { match result { Ok(updated_tx) => { // Check if transaction reached final state @@ -101,8 +70,7 @@ fn handle_status_check_result( ); Ok(()) } else { - // Transaction still processing - this is NOT a failure, reset counter - // The transaction is just waiting for network confirmation + // Transaction still processing, retry status check debug!( tx_id = %updated_tx.id, status = ?updated_tx.status, @@ -119,18 +87,7 @@ fn handle_status_check_result( } } Err(e) => { - // Error occurred - increment consecutive failure counter - let new_failure_count = current_consecutive_failures + 1; - warn!( - error = %e, - consecutive_failures = new_failure_count, - "status check failed, incrementing failure counter" - ); - - // Note: We can't easily update job metadata here since we don't have access to the job - // The circuit breaker check happens at the start of transaction_status_handler - // Apalis retry mechanism will create a new job attempt which will check the counter - // For now, we just log and retry - the counter is checked on next attempt + // Error occurred, retry the job Err(Error::Failed(Arc::new(format!("{e}").into()))) } } @@ -202,7 +159,7 @@ mod tests { tx.status = TransactionStatus::Confirmed; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_ok(), @@ -216,7 +173,7 @@ mod tests { tx.status = TransactionStatus::Failed; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_ok(), @@ -230,7 +187,7 @@ mod tests { tx.status = TransactionStatus::Expired; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_ok(), @@ -244,7 +201,7 @@ mod tests { tx.status = TransactionStatus::Canceled; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_ok(), @@ -258,7 +215,7 @@ mod tests { tx.status = TransactionStatus::Pending; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_err(), @@ -272,7 +229,7 @@ mod tests { tx.status = TransactionStatus::Sent; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_err(), @@ -286,7 +243,7 @@ mod tests { tx.status = TransactionStatus::Submitted; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_err(), @@ -300,7 +257,7 @@ mod tests { tx.status = TransactionStatus::Mined; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_err(), @@ -313,7 +270,7 @@ mod tests { let result: Result = Err(eyre::eyre!("Network timeout during status check")); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); assert!( check_result.is_err(), @@ -326,7 +283,7 @@ mod tests { let error_message = "RPC call failed: connection timeout"; let result: Result = Err(eyre::eyre!(error_message)); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); match check_result { Err(Error::Failed(arc)) => { @@ -346,7 +303,7 @@ mod tests { tx.status = TransactionStatus::Submitted; let result = Ok(tx); - let check_result = handle_status_check_result(result, 0); + let check_result = handle_status_check_result(result); match check_result { Err(Error::Failed(arc)) => { From c867971a301fe15aab0ddabc3372446c5ae0cfb3 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 22 Jan 2026 16:01:42 +0100 Subject: [PATCH 37/42] chore: Remove leftover test --- src/jobs/handlers/transaction_status_handler.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/jobs/handlers/transaction_status_handler.rs b/src/jobs/handlers/transaction_status_handler.rs index 1d2509277..daeb88a37 100644 --- a/src/jobs/handlers/transaction_status_handler.rs +++ b/src/jobs/handlers/transaction_status_handler.rs @@ -320,15 +320,5 @@ mod tests { _ => panic!("Expected Error::Failed for non-final state"), } } - - #[test] - fn test_circuit_breaker_increments_on_error() { - let result: Result = Err(eyre::eyre!("Network error")); - - // Start with 5 failures - let check_result = handle_status_check_result(result, 5); - - assert!(check_result.is_err(), "Should return Err to trigger retry"); - } } } From 921fa8a951211aa0477a164a629db531aeaa4da9 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Thu, 22 Jan 2026 16:06:06 +0100 Subject: [PATCH 38/42] chore: Remove lock file --- .../test-plugin/pnpm-lock.yaml | 2891 ----------------- 1 file changed, 2891 deletions(-) delete mode 100644 examples/basic-example-plugin/test-plugin/pnpm-lock.yaml diff --git a/examples/basic-example-plugin/test-plugin/pnpm-lock.yaml b/examples/basic-example-plugin/test-plugin/pnpm-lock.yaml deleted file mode 100644 index 76cd1878e..000000000 --- a/examples/basic-example-plugin/test-plugin/pnpm-lock.yaml +++ /dev/null @@ -1,2891 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@openzeppelin/relayer-sdk': - specifier: ^1.8.0 - version: 1.8.0 - '@types/node': - specifier: ^24.0.3 - version: 24.2.0 - ethers: - specifier: ^6.14.3 - version: 6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - uuid: - specifier: ^11.1.0 - version: 11.1.0 - devDependencies: - '@types/jest': - specifier: ^29.5.12 - version: 29.5.14 - '@types/uuid': - specifier: ^10.0.0 - version: 10.0.0 - husky: - specifier: ^9.1.7 - version: 9.1.7 - jest: - specifier: ^29.7.0 - version: 29.7.0(@types/node@24.2.0) - ts-jest: - specifier: ^29.1.2 - version: 29.4.1(@babel/core@7.28.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.2.0))(typescript@5.9.2) - typescript: - specifier: ^5.3.3 - version: 5.9.2 - -packages: - - '@adraffy/ens-normalize@1.10.1': - resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} - - '@ampproject/remapping@2.3.0': - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} - engines: {node: '>=6.0.0'} - - '@babel/code-frame@7.27.1': - resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} - engines: {node: '>=6.9.0'} - - '@babel/compat-data@7.28.0': - resolution: {integrity: sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==} - engines: {node: '>=6.9.0'} - - '@babel/core@7.28.0': - resolution: {integrity: sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==} - engines: {node: '>=6.9.0'} - - '@babel/generator@7.28.0': - resolution: {integrity: sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-compilation-targets@7.27.2': - resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-globals@7.28.0': - resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.27.1': - resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-transforms@7.27.3': - resolution: {integrity: sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-plugin-utils@7.27.1': - resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.27.1': - resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.27.1': - resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-option@7.27.1': - resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} - engines: {node: '>=6.9.0'} - - '@babel/helpers@7.28.2': - resolution: {integrity: sha512-/V9771t+EgXz62aCcyofnQhGM8DQACbRhvzKFsXKC9QM+5MadF8ZmIm0crDMaz3+o0h0zXfJnd4EhbYbxsrcFw==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.28.0': - resolution: {integrity: sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/plugin-syntax-async-generators@7.8.4': - resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-bigint@7.8.3': - resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-class-properties@7.12.13': - resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-class-static-block@7.14.5': - resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-import-attributes@7.27.1': - resolution: {integrity: sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-import-meta@7.10.4': - resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-json-strings@7.8.3': - resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-jsx@7.27.1': - resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4': - resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': - resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-numeric-separator@7.10.4': - resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-object-rest-spread@7.8.3': - resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3': - resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-optional-chaining@7.8.3': - resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-private-property-in-object@7.14.5': - resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-top-level-await@7.14.5': - resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-typescript@7.27.1': - resolution: {integrity: sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/template@7.27.2': - resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} - engines: {node: '>=6.9.0'} - - '@babel/traverse@7.28.0': - resolution: {integrity: sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.28.2': - resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==} - engines: {node: '>=6.9.0'} - - '@bcoe/v8-coverage@0.2.3': - resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - - '@istanbuljs/load-nyc-config@1.1.0': - resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} - engines: {node: '>=8'} - - '@istanbuljs/schema@0.1.3': - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} - engines: {node: '>=8'} - - '@jest/console@29.7.0': - resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/core@29.7.0': - resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - '@jest/environment@29.7.0': - resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/expect-utils@29.7.0': - resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/expect@29.7.0': - resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/fake-timers@29.7.0': - resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/globals@29.7.0': - resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/reporters@29.7.0': - resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - '@jest/schemas@29.6.3': - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/source-map@29.6.3': - resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/test-result@29.7.0': - resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/test-sequencer@29.7.0': - resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/transform@29.7.0': - resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/types@29.6.3': - resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jridgewell/gen-mapping@0.3.12': - resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - - '@jridgewell/sourcemap-codec@1.5.4': - resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==} - - '@jridgewell/trace-mapping@0.3.29': - resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==} - - '@noble/curves@1.2.0': - resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} - - '@noble/hashes@1.3.2': - resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} - engines: {node: '>= 16'} - - '@openzeppelin/relayer-sdk@1.8.0': - resolution: {integrity: sha512-2nMn9Sg0j52kp/GdhavvL8zgwRJqDqXq4yM1uYewfYndns6WGUS3zxcDICgHenMVURo8YWdJG7E7Ockck3SNFg==} - engines: {node: '>=22.14.0', npm: use pnpm, pnpm: '>=9', yarn: use pnpm} - - '@sinclair/typebox@0.27.8': - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - - '@sinonjs/commons@3.0.1': - resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} - - '@sinonjs/fake-timers@10.3.0': - resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} - - '@types/babel__core@7.20.5': - resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} - - '@types/babel__generator@7.27.0': - resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} - - '@types/babel__template@7.4.4': - resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - - '@types/babel__traverse@7.28.0': - resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} - - '@types/graceful-fs@4.1.9': - resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} - - '@types/istanbul-lib-coverage@2.0.6': - resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} - - '@types/istanbul-lib-report@3.0.3': - resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} - - '@types/istanbul-reports@3.0.4': - resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - - '@types/jest@29.5.14': - resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} - - '@types/node@22.7.5': - resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} - - '@types/node@24.2.0': - resolution: {integrity: sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==} - - '@types/stack-utils@2.0.3': - resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} - - '@types/uuid@10.0.0': - resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} - - '@types/yargs-parser@21.0.3': - resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} - - '@types/yargs@17.0.33': - resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} - - aes-js@4.0.0-beta.5: - resolution: {integrity: sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==} - - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - - ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - - axios@1.11.0: - resolution: {integrity: sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==} - - babel-jest@29.7.0: - resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.8.0 - - babel-plugin-istanbul@6.1.1: - resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} - engines: {node: '>=8'} - - babel-plugin-jest-hoist@29.6.3: - resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - babel-preset-current-node-syntax@1.2.0: - resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} - peerDependencies: - '@babel/core': ^7.0.0 || ^8.0.0-0 - - babel-preset-jest@29.6.3: - resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.0.0 - - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - - brace-expansion@1.1.12: - resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} - - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} - - browserslist@4.25.1: - resolution: {integrity: sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - - bs-logger@0.2.6: - resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} - engines: {node: '>= 6'} - - bser@2.1.1: - resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - - buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - - bufferutil@4.0.9: - resolution: {integrity: sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==} - engines: {node: '>=6.14.2'} - - call-bind-apply-helpers@1.0.2: - resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} - engines: {node: '>= 0.4'} - - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - - camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - - caniuse-lite@1.0.30001731: - resolution: {integrity: sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==} - - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - - char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} - engines: {node: '>=10'} - - ci-info@3.9.0: - resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} - engines: {node: '>=8'} - - cjs-module-lexer@1.4.3: - resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - co@4.6.0: - resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - - collect-v8-coverage@1.0.2: - resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - - convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - - create-jest@29.7.0: - resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} - - debug@4.4.1: - resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - dedent@1.6.0: - resolution: {integrity: sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==} - peerDependencies: - babel-plugin-macros: ^3.1.0 - peerDependenciesMeta: - babel-plugin-macros: - optional: true - - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - - detect-newline@3.1.0: - resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} - engines: {node: '>=8'} - - diff-sequences@29.6.3: - resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - dunder-proto@1.0.1: - resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} - engines: {node: '>= 0.4'} - - electron-to-chromium@1.5.194: - resolution: {integrity: sha512-SdnWJwSUot04UR51I2oPD8kuP2VI37/CADR1OHsFOUzZIvfWJBO6q11k5P/uKNyTT3cdOsnyjkrZ+DDShqYqJA==} - - emittery@0.13.1: - resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} - engines: {node: '>=12'} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - - es-define-property@1.0.1: - resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - es-object-atoms@1.1.1: - resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} - engines: {node: '>= 0.4'} - - es-set-tostringtag@2.1.0: - resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} - engines: {node: '>= 0.4'} - - escalade@3.2.0: - resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} - engines: {node: '>=6'} - - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - - ethers@6.15.0: - resolution: {integrity: sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ==} - engines: {node: '>=14.0.0'} - - execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - - exit@0.1.2: - resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} - engines: {node: '>= 0.8.0'} - - expect@29.7.0: - resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - - fb-watchman@2.0.2: - resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} - - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} - - find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - - follow-redirects@1.15.11: - resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - - form-data@4.0.4: - resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==} - engines: {node: '>= 6'} - - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-intrinsic@1.3.0: - resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} - engines: {node: '>= 0.4'} - - get-package-type@0.1.0: - resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} - engines: {node: '>=8.0.0'} - - get-proto@1.0.1: - resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} - engines: {node: '>= 0.4'} - - get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - gopd@1.2.0: - resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} - engines: {node: '>= 0.4'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} - hasBin: true - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - - has-symbols@1.1.0: - resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} - engines: {node: '>= 0.4'} - - has-tostringtag@1.0.2: - resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} - engines: {node: '>= 0.4'} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - - human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - - husky@9.1.7: - resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} - engines: {node: '>=18'} - hasBin: true - - import-local@3.2.0: - resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} - engines: {node: '>=8'} - hasBin: true - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - - inflight@1.0.6: - resolution: {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. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - - is-core-module@2.16.1: - resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} - engines: {node: '>= 0.4'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-generator-fn@2.1.0: - resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} - engines: {node: '>=6'} - - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - - is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} - - istanbul-lib-instrument@5.2.1: - resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} - engines: {node: '>=8'} - - istanbul-lib-instrument@6.0.3: - resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} - engines: {node: '>=10'} - - istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} - - istanbul-lib-source-maps@4.0.1: - resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} - engines: {node: '>=10'} - - istanbul-reports@3.1.7: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} - engines: {node: '>=8'} - - jest-changed-files@29.7.0: - resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-circus@29.7.0: - resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-cli@29.7.0: - resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - jest-config@29.7.0: - resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - - jest-diff@29.7.0: - resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-docblock@29.7.0: - resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-each@29.7.0: - resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-environment-node@29.7.0: - resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-get-type@29.6.3: - resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-haste-map@29.7.0: - resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-leak-detector@29.7.0: - resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-matcher-utils@29.7.0: - resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-message-util@29.7.0: - resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-mock@29.7.0: - resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-pnp-resolver@1.2.3: - resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} - engines: {node: '>=6'} - peerDependencies: - jest-resolve: '*' - peerDependenciesMeta: - jest-resolve: - optional: true - - jest-regex-util@29.6.3: - resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-resolve-dependencies@29.7.0: - resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-resolve@29.7.0: - resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-runner@29.7.0: - resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-runtime@29.7.0: - resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-snapshot@29.7.0: - resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-util@29.7.0: - resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-validate@29.7.0: - resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-watcher@29.7.0: - resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-worker@29.7.0: - resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest@29.7.0: - resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true - - jsesc@3.1.0: - resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} - engines: {node: '>=6'} - hasBin: true - - json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - - json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} - hasBin: true - - kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} - - leven@3.1.0: - resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} - engines: {node: '>=6'} - - lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - - locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - - lodash.memoize@4.1.2: - resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} - - lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - - make-dir@4.0.0: - resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} - engines: {node: '>=10'} - - make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - - makeerror@1.0.12: - resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} - - math-intrinsics@1.1.0: - resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} - engines: {node: '>= 0.4'} - - merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} - - mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - - mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - - neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - - node-gyp-build@4.8.4: - resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} - hasBin: true - - node-int64@0.4.0: - resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - - node-releases@2.0.19: - resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} - - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - - npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - - p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - - p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} - - p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - - parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} - - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - - picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - - pirates@4.0.7: - resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} - engines: {node: '>= 6'} - - pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} - - pretty-format@29.7.0: - resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} - - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - - pure-rand@6.1.0: - resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} - - react-is@18.3.1: - resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - - resolve.exports@2.0.3: - resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} - engines: {node: '>=10'} - - resolve@1.22.10: - resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} - engines: {node: '>= 0.4'} - hasBin: true - - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - - semver@7.7.2: - resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} - engines: {node: '>=10'} - hasBin: true - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - - source-map-support@0.5.13: - resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} - - source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - - string-length@4.0.2: - resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - - strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} - - strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - - supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} - - supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - - test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} - - tmpl@1.0.5: - resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} - - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - - ts-jest@29.4.1: - resolution: {integrity: sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw==} - engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/transform': ^29.0.0 || ^30.0.0 - '@jest/types': ^29.0.0 || ^30.0.0 - babel-jest: ^29.0.0 || ^30.0.0 - esbuild: '*' - jest: ^29.0.0 || ^30.0.0 - jest-util: ^29.0.0 || ^30.0.0 - typescript: '>=4.3 <6' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/transform': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - jest-util: - optional: true - - tslib@2.7.0: - resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} - - type-detect@4.0.8: - resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} - engines: {node: '>=4'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - - type-fest@4.41.0: - resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} - engines: {node: '>=16'} - - typescript@5.9.2: - resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} - engines: {node: '>=14.17'} - hasBin: true - - uglify-js@3.19.3: - resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} - engines: {node: '>=0.8.0'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - undici-types@7.10.0: - resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} - - update-browserslist-db@1.1.3: - resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - - utf-8-validate@5.0.10: - resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} - engines: {node: '>=6.14.2'} - - uuid@11.1.0: - resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} - hasBin: true - - v8-to-istanbul@9.3.0: - resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} - engines: {node: '>=10.12.0'} - - walker@1.0.8: - resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@4.0.2: - resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - - ws@8.17.1: - resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - - yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - -snapshots: - - '@adraffy/ens-normalize@1.10.1': {} - - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.12 - '@jridgewell/trace-mapping': 0.3.29 - - '@babel/code-frame@7.27.1': - dependencies: - '@babel/helper-validator-identifier': 7.27.1 - js-tokens: 4.0.0 - picocolors: 1.1.1 - - '@babel/compat-data@7.28.0': {} - - '@babel/core@7.28.0': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.0 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.27.3(@babel/core@7.28.0) - '@babel/helpers': 7.28.2 - '@babel/parser': 7.28.0 - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.0 - '@babel/types': 7.28.2 - convert-source-map: 2.0.0 - debug: 4.4.1 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/generator@7.28.0': - dependencies: - '@babel/parser': 7.28.0 - '@babel/types': 7.28.2 - '@jridgewell/gen-mapping': 0.3.12 - '@jridgewell/trace-mapping': 0.3.29 - jsesc: 3.1.0 - - '@babel/helper-compilation-targets@7.27.2': - dependencies: - '@babel/compat-data': 7.28.0 - '@babel/helper-validator-option': 7.27.1 - browserslist: 4.25.1 - lru-cache: 5.1.1 - semver: 6.3.1 - - '@babel/helper-globals@7.28.0': {} - - '@babel/helper-module-imports@7.27.1': - dependencies: - '@babel/traverse': 7.28.0 - '@babel/types': 7.28.2 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.27.3(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - '@babel/traverse': 7.28.0 - transitivePeerDependencies: - - supports-color - - '@babel/helper-plugin-utils@7.27.1': {} - - '@babel/helper-string-parser@7.27.1': {} - - '@babel/helper-validator-identifier@7.27.1': {} - - '@babel/helper-validator-option@7.27.1': {} - - '@babel/helpers@7.28.2': - dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.28.2 - - '@babel/parser@7.28.0': - dependencies: - '@babel/types': 7.28.2 - - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - - '@babel/template@7.27.2': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/parser': 7.28.0 - '@babel/types': 7.28.2 - - '@babel/traverse@7.28.0': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.0 - '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.28.0 - '@babel/template': 7.27.2 - '@babel/types': 7.28.2 - debug: 4.4.1 - transitivePeerDependencies: - - supports-color - - '@babel/types@7.28.2': - dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - - '@bcoe/v8-coverage@0.2.3': {} - - '@istanbuljs/load-nyc-config@1.1.0': - dependencies: - camelcase: 5.3.1 - find-up: 4.1.0 - get-package-type: 0.1.0 - js-yaml: 3.14.1 - resolve-from: 5.0.0 - - '@istanbuljs/schema@0.1.3': {} - - '@jest/console@29.7.0': - dependencies: - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - chalk: 4.1.2 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - slash: 3.0.0 - - '@jest/core@29.7.0': - dependencies: - '@jest/console': 29.7.0 - '@jest/reporters': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 3.9.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@24.2.0) - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-resolve-dependencies: 29.7.0 - jest-runner: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - jest-watcher: 29.7.0 - micromatch: 4.0.8 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - - '@jest/environment@29.7.0': - dependencies: - '@jest/fake-timers': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - jest-mock: 29.7.0 - - '@jest/expect-utils@29.7.0': - dependencies: - jest-get-type: 29.6.3 - - '@jest/expect@29.7.0': - dependencies: - expect: 29.7.0 - jest-snapshot: 29.7.0 - transitivePeerDependencies: - - supports-color - - '@jest/fake-timers@29.7.0': - dependencies: - '@jest/types': 29.6.3 - '@sinonjs/fake-timers': 10.3.0 - '@types/node': 24.2.0 - jest-message-util: 29.7.0 - jest-mock: 29.7.0 - jest-util: 29.7.0 - - '@jest/globals@29.7.0': - dependencies: - '@jest/environment': 29.7.0 - '@jest/expect': 29.7.0 - '@jest/types': 29.6.3 - jest-mock: 29.7.0 - transitivePeerDependencies: - - supports-color - - '@jest/reporters@29.7.0': - dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.29 - '@types/node': 24.2.0 - chalk: 4.1.2 - collect-v8-coverage: 1.0.2 - exit: 0.1.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-instrument: 6.0.3 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.7 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - jest-worker: 29.7.0 - slash: 3.0.0 - string-length: 4.0.2 - strip-ansi: 6.0.1 - v8-to-istanbul: 9.3.0 - transitivePeerDependencies: - - supports-color - - '@jest/schemas@29.6.3': - dependencies: - '@sinclair/typebox': 0.27.8 - - '@jest/source-map@29.6.3': - dependencies: - '@jridgewell/trace-mapping': 0.3.29 - callsites: 3.1.0 - graceful-fs: 4.2.11 - - '@jest/test-result@29.7.0': - dependencies: - '@jest/console': 29.7.0 - '@jest/types': 29.6.3 - '@types/istanbul-lib-coverage': 2.0.6 - collect-v8-coverage: 1.0.2 - - '@jest/test-sequencer@29.7.0': - dependencies: - '@jest/test-result': 29.7.0 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - slash: 3.0.0 - - '@jest/transform@29.7.0': - dependencies: - '@babel/core': 7.28.0 - '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.29 - babel-plugin-istanbul: 6.1.1 - chalk: 4.1.2 - convert-source-map: 2.0.0 - fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-regex-util: 29.6.3 - jest-util: 29.7.0 - micromatch: 4.0.8 - pirates: 4.0.7 - slash: 3.0.0 - write-file-atomic: 4.0.2 - transitivePeerDependencies: - - supports-color - - '@jest/types@29.6.3': - dependencies: - '@jest/schemas': 29.6.3 - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 3.0.4 - '@types/node': 24.2.0 - '@types/yargs': 17.0.33 - chalk: 4.1.2 - - '@jridgewell/gen-mapping@0.3.12': - dependencies: - '@jridgewell/sourcemap-codec': 1.5.4 - '@jridgewell/trace-mapping': 0.3.29 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/sourcemap-codec@1.5.4': {} - - '@jridgewell/trace-mapping@0.3.29': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.4 - - '@noble/curves@1.2.0': - dependencies: - '@noble/hashes': 1.3.2 - - '@noble/hashes@1.3.2': {} - - '@openzeppelin/relayer-sdk@1.8.0': - dependencies: - axios: 1.11.0 - transitivePeerDependencies: - - debug - - '@sinclair/typebox@0.27.8': {} - - '@sinonjs/commons@3.0.1': - dependencies: - type-detect: 4.0.8 - - '@sinonjs/fake-timers@10.3.0': - dependencies: - '@sinonjs/commons': 3.0.1 - - '@types/babel__core@7.20.5': - dependencies: - '@babel/parser': 7.28.0 - '@babel/types': 7.28.2 - '@types/babel__generator': 7.27.0 - '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.28.0 - - '@types/babel__generator@7.27.0': - dependencies: - '@babel/types': 7.28.2 - - '@types/babel__template@7.4.4': - dependencies: - '@babel/parser': 7.28.0 - '@babel/types': 7.28.2 - - '@types/babel__traverse@7.28.0': - dependencies: - '@babel/types': 7.28.2 - - '@types/graceful-fs@4.1.9': - dependencies: - '@types/node': 24.2.0 - - '@types/istanbul-lib-coverage@2.0.6': {} - - '@types/istanbul-lib-report@3.0.3': - dependencies: - '@types/istanbul-lib-coverage': 2.0.6 - - '@types/istanbul-reports@3.0.4': - dependencies: - '@types/istanbul-lib-report': 3.0.3 - - '@types/jest@29.5.14': - dependencies: - expect: 29.7.0 - pretty-format: 29.7.0 - - '@types/node@22.7.5': - dependencies: - undici-types: 6.19.8 - - '@types/node@24.2.0': - dependencies: - undici-types: 7.10.0 - - '@types/stack-utils@2.0.3': {} - - '@types/uuid@10.0.0': {} - - '@types/yargs-parser@21.0.3': {} - - '@types/yargs@17.0.33': - dependencies: - '@types/yargs-parser': 21.0.3 - - aes-js@4.0.0-beta.5: {} - - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - - ansi-regex@5.0.1: {} - - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - - ansi-styles@5.2.0: {} - - anymatch@3.1.3: - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - - asynckit@0.4.0: {} - - axios@1.11.0: - dependencies: - follow-redirects: 1.15.11 - form-data: 4.0.4 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - - babel-jest@29.7.0(@babel/core@7.28.0): - dependencies: - '@babel/core': 7.28.0 - '@jest/transform': 29.7.0 - '@types/babel__core': 7.20.5 - babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.28.0) - chalk: 4.1.2 - graceful-fs: 4.2.11 - slash: 3.0.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-istanbul@6.1.1: - dependencies: - '@babel/helper-plugin-utils': 7.27.1 - '@istanbuljs/load-nyc-config': 1.1.0 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-instrument: 5.2.1 - test-exclude: 6.0.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-jest-hoist@29.6.3: - dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.28.2 - '@types/babel__core': 7.20.5 - '@types/babel__traverse': 7.28.0 - - babel-preset-current-node-syntax@1.2.0(@babel/core@7.28.0): - dependencies: - '@babel/core': 7.28.0 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.28.0) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.28.0) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.28.0) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.28.0) - '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.28.0) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.28.0) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.28.0) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.28.0) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.28.0) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.28.0) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.28.0) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.28.0) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.28.0) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.28.0) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.28.0) - - babel-preset-jest@29.6.3(@babel/core@7.28.0): - dependencies: - '@babel/core': 7.28.0 - babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.0) - - balanced-match@1.0.2: {} - - brace-expansion@1.1.12: - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - - braces@3.0.3: - dependencies: - fill-range: 7.1.1 - - browserslist@4.25.1: - dependencies: - caniuse-lite: 1.0.30001731 - electron-to-chromium: 1.5.194 - node-releases: 2.0.19 - update-browserslist-db: 1.1.3(browserslist@4.25.1) - - bs-logger@0.2.6: - dependencies: - fast-json-stable-stringify: 2.1.0 - - bser@2.1.1: - dependencies: - node-int64: 0.4.0 - - buffer-from@1.1.2: {} - - bufferutil@4.0.9: - dependencies: - node-gyp-build: 4.8.4 - optional: true - - call-bind-apply-helpers@1.0.2: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - - callsites@3.1.0: {} - - camelcase@5.3.1: {} - - camelcase@6.3.0: {} - - caniuse-lite@1.0.30001731: {} - - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - - char-regex@1.0.2: {} - - ci-info@3.9.0: {} - - cjs-module-lexer@1.4.3: {} - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - co@4.6.0: {} - - collect-v8-coverage@1.0.2: {} - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - - concat-map@0.0.1: {} - - convert-source-map@2.0.0: {} - - create-jest@29.7.0(@types/node@24.2.0): - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@24.2.0) - jest-util: 29.7.0 - prompts: 2.4.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - cross-spawn@7.0.6: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - debug@4.4.1: - dependencies: - ms: 2.1.3 - - dedent@1.6.0: {} - - deepmerge@4.3.1: {} - - delayed-stream@1.0.0: {} - - detect-newline@3.1.0: {} - - diff-sequences@29.6.3: {} - - dunder-proto@1.0.1: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-errors: 1.3.0 - gopd: 1.2.0 - - electron-to-chromium@1.5.194: {} - - emittery@0.13.1: {} - - emoji-regex@8.0.0: {} - - error-ex@1.3.2: - dependencies: - is-arrayish: 0.2.1 - - es-define-property@1.0.1: {} - - es-errors@1.3.0: {} - - es-object-atoms@1.1.1: - dependencies: - es-errors: 1.3.0 - - es-set-tostringtag@2.1.0: - dependencies: - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - has-tostringtag: 1.0.2 - hasown: 2.0.2 - - escalade@3.2.0: {} - - escape-string-regexp@2.0.0: {} - - esprima@4.0.1: {} - - ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10): - dependencies: - '@adraffy/ens-normalize': 1.10.1 - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@types/node': 22.7.5 - aes-js: 4.0.0-beta.5 - tslib: 2.7.0 - ws: 8.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - execa@5.1.1: - dependencies: - cross-spawn: 7.0.6 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - - exit@0.1.2: {} - - expect@29.7.0: - dependencies: - '@jest/expect-utils': 29.7.0 - jest-get-type: 29.6.3 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - - fast-json-stable-stringify@2.1.0: {} - - fb-watchman@2.0.2: - dependencies: - bser: 2.1.1 - - fill-range@7.1.1: - dependencies: - to-regex-range: 5.0.1 - - find-up@4.1.0: - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - - follow-redirects@1.15.11: {} - - form-data@4.0.4: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - es-set-tostringtag: 2.1.0 - hasown: 2.0.2 - mime-types: 2.1.35 - - fs.realpath@1.0.0: {} - - fsevents@2.3.3: - optional: true - - function-bind@1.1.2: {} - - gensync@1.0.0-beta.2: {} - - get-caller-file@2.0.5: {} - - get-intrinsic@1.3.0: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-define-property: 1.0.1 - es-errors: 1.3.0 - es-object-atoms: 1.1.1 - function-bind: 1.1.2 - get-proto: 1.0.1 - gopd: 1.2.0 - has-symbols: 1.1.0 - hasown: 2.0.2 - math-intrinsics: 1.1.0 - - get-package-type@0.1.0: {} - - get-proto@1.0.1: - dependencies: - dunder-proto: 1.0.1 - es-object-atoms: 1.1.1 - - get-stream@6.0.1: {} - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - gopd@1.2.0: {} - - graceful-fs@4.2.11: {} - - handlebars@4.7.8: - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.19.3 - - has-flag@4.0.0: {} - - has-symbols@1.1.0: {} - - has-tostringtag@1.0.2: - dependencies: - has-symbols: 1.1.0 - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - html-escaper@2.0.2: {} - - human-signals@2.1.0: {} - - husky@9.1.7: {} - - import-local@3.2.0: - dependencies: - pkg-dir: 4.2.0 - resolve-cwd: 3.0.0 - - imurmurhash@0.1.4: {} - - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - - is-arrayish@0.2.1: {} - - is-core-module@2.16.1: - dependencies: - hasown: 2.0.2 - - is-fullwidth-code-point@3.0.0: {} - - is-generator-fn@2.1.0: {} - - is-number@7.0.0: {} - - is-stream@2.0.1: {} - - isexe@2.0.0: {} - - istanbul-lib-coverage@3.2.2: {} - - istanbul-lib-instrument@5.2.1: - dependencies: - '@babel/core': 7.28.0 - '@babel/parser': 7.28.0 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.2 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - istanbul-lib-instrument@6.0.3: - dependencies: - '@babel/core': 7.28.0 - '@babel/parser': 7.28.0 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.2 - semver: 7.7.2 - transitivePeerDependencies: - - supports-color - - istanbul-lib-report@3.0.1: - dependencies: - istanbul-lib-coverage: 3.2.2 - make-dir: 4.0.0 - supports-color: 7.2.0 - - istanbul-lib-source-maps@4.0.1: - dependencies: - debug: 4.4.1 - istanbul-lib-coverage: 3.2.2 - source-map: 0.6.1 - transitivePeerDependencies: - - supports-color - - istanbul-reports@3.1.7: - dependencies: - html-escaper: 2.0.2 - istanbul-lib-report: 3.0.1 - - jest-changed-files@29.7.0: - dependencies: - execa: 5.1.1 - jest-util: 29.7.0 - p-limit: 3.1.0 - - jest-circus@29.7.0: - dependencies: - '@jest/environment': 29.7.0 - '@jest/expect': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - chalk: 4.1.2 - co: 4.6.0 - dedent: 1.6.0 - is-generator-fn: 2.1.0 - jest-each: 29.7.0 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-runtime: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - p-limit: 3.1.0 - pretty-format: 29.7.0 - pure-rand: 6.1.0 - slash: 3.0.0 - stack-utils: 2.0.6 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-cli@29.7.0(@types/node@24.2.0): - dependencies: - '@jest/core': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - chalk: 4.1.2 - create-jest: 29.7.0(@types/node@24.2.0) - exit: 0.1.2 - import-local: 3.2.0 - jest-config: 29.7.0(@types/node@24.2.0) - jest-util: 29.7.0 - jest-validate: 29.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest-config@29.7.0(@types/node@24.2.0): - dependencies: - '@babel/core': 7.28.0 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.28.0) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0 - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 24.2.0 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-diff@29.7.0: - dependencies: - chalk: 4.1.2 - diff-sequences: 29.6.3 - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - - jest-docblock@29.7.0: - dependencies: - detect-newline: 3.1.0 - - jest-each@29.7.0: - dependencies: - '@jest/types': 29.6.3 - chalk: 4.1.2 - jest-get-type: 29.6.3 - jest-util: 29.7.0 - pretty-format: 29.7.0 - - jest-environment-node@29.7.0: - dependencies: - '@jest/environment': 29.7.0 - '@jest/fake-timers': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - jest-mock: 29.7.0 - jest-util: 29.7.0 - - jest-get-type@29.6.3: {} - - jest-haste-map@29.7.0: - dependencies: - '@jest/types': 29.6.3 - '@types/graceful-fs': 4.1.9 - '@types/node': 24.2.0 - anymatch: 3.1.3 - fb-watchman: 2.0.2 - graceful-fs: 4.2.11 - jest-regex-util: 29.6.3 - jest-util: 29.7.0 - jest-worker: 29.7.0 - micromatch: 4.0.8 - walker: 1.0.8 - optionalDependencies: - fsevents: 2.3.3 - - jest-leak-detector@29.7.0: - dependencies: - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - - jest-matcher-utils@29.7.0: - dependencies: - chalk: 4.1.2 - jest-diff: 29.7.0 - jest-get-type: 29.6.3 - pretty-format: 29.7.0 - - jest-message-util@29.7.0: - dependencies: - '@babel/code-frame': 7.27.1 - '@jest/types': 29.6.3 - '@types/stack-utils': 2.0.3 - chalk: 4.1.2 - graceful-fs: 4.2.11 - micromatch: 4.0.8 - pretty-format: 29.7.0 - slash: 3.0.0 - stack-utils: 2.0.6 - - jest-mock@29.7.0: - dependencies: - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - jest-util: 29.7.0 - - jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): - optionalDependencies: - jest-resolve: 29.7.0 - - jest-regex-util@29.6.3: {} - - jest-resolve-dependencies@29.7.0: - dependencies: - jest-regex-util: 29.6.3 - jest-snapshot: 29.7.0 - transitivePeerDependencies: - - supports-color - - jest-resolve@29.7.0: - dependencies: - chalk: 4.1.2 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) - jest-util: 29.7.0 - jest-validate: 29.7.0 - resolve: 1.22.10 - resolve.exports: 2.0.3 - slash: 3.0.0 - - jest-runner@29.7.0: - dependencies: - '@jest/console': 29.7.0 - '@jest/environment': 29.7.0 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - chalk: 4.1.2 - emittery: 0.13.1 - graceful-fs: 4.2.11 - jest-docblock: 29.7.0 - jest-environment-node: 29.7.0 - jest-haste-map: 29.7.0 - jest-leak-detector: 29.7.0 - jest-message-util: 29.7.0 - jest-resolve: 29.7.0 - jest-runtime: 29.7.0 - jest-util: 29.7.0 - jest-watcher: 29.7.0 - jest-worker: 29.7.0 - p-limit: 3.1.0 - source-map-support: 0.5.13 - transitivePeerDependencies: - - supports-color - - jest-runtime@29.7.0: - dependencies: - '@jest/environment': 29.7.0 - '@jest/fake-timers': 29.7.0 - '@jest/globals': 29.7.0 - '@jest/source-map': 29.6.3 - '@jest/test-result': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - chalk: 4.1.2 - cjs-module-lexer: 1.4.3 - collect-v8-coverage: 1.0.2 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-haste-map: 29.7.0 - jest-message-util: 29.7.0 - jest-mock: 29.7.0 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-snapshot: 29.7.0 - jest-util: 29.7.0 - slash: 3.0.0 - strip-bom: 4.0.0 - transitivePeerDependencies: - - supports-color - - jest-snapshot@29.7.0: - dependencies: - '@babel/core': 7.28.0 - '@babel/generator': 7.28.0 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.0) - '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.0) - '@babel/types': 7.28.2 - '@jest/expect-utils': 29.7.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.0) - chalk: 4.1.2 - expect: 29.7.0 - graceful-fs: 4.2.11 - jest-diff: 29.7.0 - jest-get-type: 29.6.3 - jest-matcher-utils: 29.7.0 - jest-message-util: 29.7.0 - jest-util: 29.7.0 - natural-compare: 1.4.0 - pretty-format: 29.7.0 - semver: 7.7.2 - transitivePeerDependencies: - - supports-color - - jest-util@29.7.0: - dependencies: - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - chalk: 4.1.2 - ci-info: 3.9.0 - graceful-fs: 4.2.11 - picomatch: 2.3.1 - - jest-validate@29.7.0: - dependencies: - '@jest/types': 29.6.3 - camelcase: 6.3.0 - chalk: 4.1.2 - jest-get-type: 29.6.3 - leven: 3.1.0 - pretty-format: 29.7.0 - - jest-watcher@29.7.0: - dependencies: - '@jest/test-result': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 24.2.0 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.13.1 - jest-util: 29.7.0 - string-length: 4.0.2 - - jest-worker@29.7.0: - dependencies: - '@types/node': 24.2.0 - jest-util: 29.7.0 - merge-stream: 2.0.0 - supports-color: 8.1.1 - - jest@29.7.0(@types/node@24.2.0): - dependencies: - '@jest/core': 29.7.0 - '@jest/types': 29.6.3 - import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@24.2.0) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - js-tokens@4.0.0: {} - - js-yaml@3.14.1: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - - jsesc@3.1.0: {} - - json-parse-even-better-errors@2.3.1: {} - - json5@2.2.3: {} - - kleur@3.0.3: {} - - leven@3.1.0: {} - - lines-and-columns@1.2.4: {} - - locate-path@5.0.0: - dependencies: - p-locate: 4.1.0 - - lodash.memoize@4.1.2: {} - - lru-cache@5.1.1: - dependencies: - yallist: 3.1.1 - - make-dir@4.0.0: - dependencies: - semver: 7.7.2 - - make-error@1.3.6: {} - - makeerror@1.0.12: - dependencies: - tmpl: 1.0.5 - - math-intrinsics@1.1.0: {} - - merge-stream@2.0.0: {} - - micromatch@4.0.8: - dependencies: - braces: 3.0.3 - picomatch: 2.3.1 - - mime-db@1.52.0: {} - - mime-types@2.1.35: - dependencies: - mime-db: 1.52.0 - - mimic-fn@2.1.0: {} - - minimatch@3.1.2: - dependencies: - brace-expansion: 1.1.12 - - minimist@1.2.8: {} - - ms@2.1.3: {} - - natural-compare@1.4.0: {} - - neo-async@2.6.2: {} - - node-gyp-build@4.8.4: - optional: true - - node-int64@0.4.0: {} - - node-releases@2.0.19: {} - - normalize-path@3.0.0: {} - - npm-run-path@4.0.1: - dependencies: - path-key: 3.1.1 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - - p-limit@2.3.0: - dependencies: - p-try: 2.2.0 - - p-limit@3.1.0: - dependencies: - yocto-queue: 0.1.0 - - p-locate@4.1.0: - dependencies: - p-limit: 2.3.0 - - p-try@2.2.0: {} - - parse-json@5.2.0: - dependencies: - '@babel/code-frame': 7.27.1 - error-ex: 1.3.2 - json-parse-even-better-errors: 2.3.1 - lines-and-columns: 1.2.4 - - path-exists@4.0.0: {} - - path-is-absolute@1.0.1: {} - - path-key@3.1.1: {} - - path-parse@1.0.7: {} - - picocolors@1.1.1: {} - - picomatch@2.3.1: {} - - pirates@4.0.7: {} - - pkg-dir@4.2.0: - dependencies: - find-up: 4.1.0 - - pretty-format@29.7.0: - dependencies: - '@jest/schemas': 29.6.3 - ansi-styles: 5.2.0 - react-is: 18.3.1 - - prompts@2.4.2: - dependencies: - kleur: 3.0.3 - sisteransi: 1.0.5 - - proxy-from-env@1.1.0: {} - - pure-rand@6.1.0: {} - - react-is@18.3.1: {} - - require-directory@2.1.1: {} - - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - - resolve-from@5.0.0: {} - - resolve.exports@2.0.3: {} - - resolve@1.22.10: - dependencies: - is-core-module: 2.16.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - - semver@6.3.1: {} - - semver@7.7.2: {} - - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@3.0.0: {} - - signal-exit@3.0.7: {} - - sisteransi@1.0.5: {} - - slash@3.0.0: {} - - source-map-support@0.5.13: - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - - source-map@0.6.1: {} - - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - - string-length@4.0.2: - dependencies: - char-regex: 1.0.2 - strip-ansi: 6.0.1 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - strip-ansi@6.0.1: - dependencies: - ansi-regex: 5.0.1 - - strip-bom@4.0.0: {} - - strip-final-newline@2.0.0: {} - - strip-json-comments@3.1.1: {} - - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - - supports-color@8.1.1: - dependencies: - has-flag: 4.0.0 - - supports-preserve-symlinks-flag@1.0.0: {} - - test-exclude@6.0.0: - dependencies: - '@istanbuljs/schema': 0.1.3 - glob: 7.2.3 - minimatch: 3.1.2 - - tmpl@1.0.5: {} - - to-regex-range@5.0.1: - dependencies: - is-number: 7.0.0 - - ts-jest@29.4.1(@babel/core@7.28.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@24.2.0))(typescript@5.9.2): - dependencies: - bs-logger: 0.2.6 - fast-json-stable-stringify: 2.1.0 - handlebars: 4.7.8 - jest: 29.7.0(@types/node@24.2.0) - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.7.2 - type-fest: 4.41.0 - typescript: 5.9.2 - yargs-parser: 21.1.1 - optionalDependencies: - '@babel/core': 7.28.0 - '@jest/transform': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.28.0) - jest-util: 29.7.0 - - tslib@2.7.0: {} - - type-detect@4.0.8: {} - - type-fest@0.21.3: {} - - type-fest@4.41.0: {} - - typescript@5.9.2: {} - - uglify-js@3.19.3: - optional: true - - undici-types@6.19.8: {} - - undici-types@7.10.0: {} - - update-browserslist-db@1.1.3(browserslist@4.25.1): - dependencies: - browserslist: 4.25.1 - escalade: 3.2.0 - picocolors: 1.1.1 - - utf-8-validate@5.0.10: - dependencies: - node-gyp-build: 4.8.4 - optional: true - - uuid@11.1.0: {} - - v8-to-istanbul@9.3.0: - dependencies: - '@jridgewell/trace-mapping': 0.3.29 - '@types/istanbul-lib-coverage': 2.0.6 - convert-source-map: 2.0.0 - - walker@1.0.8: - dependencies: - makeerror: 1.0.12 - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - wordwrap@1.0.0: {} - - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrappy@1.0.2: {} - - write-file-atomic@4.0.2: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 3.0.7 - - ws@8.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10): - optionalDependencies: - bufferutil: 4.0.9 - utf-8-validate: 5.0.10 - - y18n@5.0.8: {} - - yallist@3.1.1: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.2.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - - yocto-queue@0.1.0: {} From 3015c63518e2bad9b0e59216a1713ff5175eb0c6 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Fri, 23 Jan 2026 11:47:50 +0100 Subject: [PATCH 39/42] chore: Improve unit test coverage --- src/bootstrap/initialize_plugins.rs | 346 +++++++++ src/repositories/plugin/mod.rs | 816 +++++++++++++++++++- src/repositories/plugin/plugin_in_memory.rs | 793 ++++++++++++++++--- src/services/plugins/connection.rs | 448 +++++++++++ src/services/plugins/pool_executor.rs | 525 +++++++++++++ 5 files changed, 2767 insertions(+), 161 deletions(-) diff --git a/src/bootstrap/initialize_plugins.rs b/src/bootstrap/initialize_plugins.rs index da59daea9..a7e7a8d05 100644 --- a/src/bootstrap/initialize_plugins.rs +++ b/src/bootstrap/initialize_plugins.rs @@ -149,8 +149,13 @@ pub async fn shutdown_plugin_pool() -> eyre::Result<()> { #[cfg(test)] mod tests { use super::*; + use crate::models::RepositoryError; use crate::repositories::MockPluginRepositoryTrait; + // ============================================ + // initialize_plugin_pool tests + // ============================================ + #[tokio::test] async fn test_initialize_plugin_pool_no_plugins() { let mut mock_repo = MockPluginRepositoryTrait::new(); @@ -162,4 +167,345 @@ mod tests { assert!(result.is_ok()); assert!(result.unwrap().is_none()); } + + #[tokio::test] + async fn test_initialize_plugin_pool_has_entries_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_has_entries().returning(|| { + Box::pin(async { + Err(RepositoryError::ConnectionError( + "Database unavailable".to_string(), + )) + }) + }); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_err()); + + match result { + Err(e) => assert!(e.to_string().contains("Failed to check plugin repository")), + Ok(_) => panic!("Expected error"), + } + } + + #[tokio::test] + async fn test_initialize_plugin_pool_has_entries_unknown_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_has_entries().returning(|| { + Box::pin(async { Err(RepositoryError::Unknown("Unknown error".to_string())) }) + }); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_err()); + } + + #[tokio::test] + async fn test_initialize_plugin_pool_with_plugins_count_fails() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + + // has_entries returns true (plugins exist) + mock_repo + .expect_has_entries() + .returning(|| Box::pin(async { Ok(true) })); + + // count fails but we handle it gracefully (unwrap_or(0)) + mock_repo.expect_count().returning(|| { + Box::pin(async { Err(RepositoryError::Unknown("Count failed".to_string())) }) + }); + + // The function should still proceed even if count fails + let result = initialize_plugin_pool(&mock_repo).await; + // Result depends on whether pool can be started, but we at least verify + // that the function doesn't panic when count fails + assert!(result.is_ok() || result.is_err()); + } + + #[tokio::test] + async fn test_initialize_plugin_pool_with_plugins_exists() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + + mock_repo + .expect_has_entries() + .returning(|| Box::pin(async { Ok(true) })); + + mock_repo + .expect_count() + .returning(|| Box::pin(async { Ok(5) })); + + // This test verifies the function proceeds when plugins exist + // The actual pool startup may succeed or fail depending on environment + let result = initialize_plugin_pool(&mock_repo).await; + // We just verify it doesn't panic and returns a result + assert!(result.is_ok() || result.is_err()); + } + + #[tokio::test] + async fn test_initialize_plugin_pool_with_zero_count_but_has_entries() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + + // Edge case: has_entries returns true but count returns 0 + // This shouldn't happen in practice but tests defensive coding + mock_repo + .expect_has_entries() + .returning(|| Box::pin(async { Ok(true) })); + + mock_repo + .expect_count() + .returning(|| Box::pin(async { Ok(0) })); + + let result = initialize_plugin_pool(&mock_repo).await; + // Should still attempt to start the pool + assert!(result.is_ok() || result.is_err()); + } + + // ============================================ + // precompile_plugins tests + // ============================================ + + #[tokio::test] + async fn test_precompile_plugins_list_paginated_error() { + use crate::models::PaginationQuery; + + let mut mock_repo = MockPluginRepositoryTrait::new(); + + mock_repo + .expect_list_paginated() + .withf(|query: &PaginationQuery| query.page == 1 && query.per_page == 1000) + .returning(|_| { + Box::pin(async { + Err(RepositoryError::ConnectionError( + "Database unavailable".to_string(), + )) + }) + }); + + // We need a real pool manager for this test, but since we're testing + // the error path, we can use the global one + let pool_manager = get_pool_manager(); + + let result = precompile_plugins(&mock_repo, &pool_manager).await; + assert!(result.is_err()); + + match result { + Err(e) => assert!(e.to_string().contains("Failed to list plugins")), + Ok(_) => panic!("Expected error"), + } + } + + #[tokio::test] + async fn test_precompile_plugins_empty_list() { + use crate::repositories::PaginatedResult; + + let mut mock_repo = MockPluginRepositoryTrait::new(); + + mock_repo.expect_list_paginated().returning(|_| { + Box::pin(async { + Ok(PaginatedResult { + items: vec![], + total: 0, + page: 1, + per_page: 1000, + }) + }) + }); + + let pool_manager = get_pool_manager(); + + let result = precompile_plugins(&mock_repo, &pool_manager).await; + assert!(result.is_ok()); + assert_eq!(result.unwrap(), 0); + } + + #[tokio::test] + async fn test_precompile_plugins_pagination_query_params() { + use crate::models::PaginationQuery; + use crate::repositories::PaginatedResult; + use std::sync::atomic::{AtomicBool, Ordering}; + use std::sync::Arc; + + let was_called = Arc::new(AtomicBool::new(false)); + let was_called_clone = was_called.clone(); + + let mut mock_repo = MockPluginRepositoryTrait::new(); + + mock_repo + .expect_list_paginated() + .withf(move |query: &PaginationQuery| { + // Verify the correct pagination parameters are used + let correct = query.page == 1 && query.per_page == 1000; + was_called_clone.store(true, Ordering::SeqCst); + correct + }) + .returning(|_| { + Box::pin(async { + Ok(PaginatedResult { + items: vec![], + total: 0, + page: 1, + per_page: 1000, + }) + }) + }); + + let pool_manager = get_pool_manager(); + + let _ = precompile_plugins(&mock_repo, &pool_manager).await; + + assert!( + was_called.load(Ordering::SeqCst), + "list_paginated should have been called" + ); + } + + // ============================================ + // Helper function tests + // ============================================ + + #[test] + fn test_resolve_plugin_path_absolute() { + // Test that PluginService::resolve_plugin_path handles paths correctly + // This is an indirect test of the path resolution used in precompile_plugins + let path = "/absolute/path/to/plugin.ts"; + let resolved = PluginService::::resolve_plugin_path(path); + assert!(resolved.contains("plugin.ts")); + } + + #[test] + fn test_resolve_plugin_path_relative() { + let path = "relative/path/plugin.ts"; + let resolved = PluginService::::resolve_plugin_path(path); + assert!(resolved.contains("plugin.ts")); + } + + // ============================================ + // Error handling tests + // ============================================ + + #[tokio::test] + async fn test_initialize_plugin_pool_not_found_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_has_entries().returning(|| { + Box::pin(async { Err(RepositoryError::NotFound("not found".to_string())) }) + }); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_err(), "Should fail for NotFound error"); + } + + #[tokio::test] + async fn test_initialize_plugin_pool_lock_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_has_entries().returning(|| { + Box::pin(async { Err(RepositoryError::LockError("lock error".to_string())) }) + }); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_err(), "Should fail for LockError"); + } + + #[tokio::test] + async fn test_initialize_plugin_pool_invalid_data_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_has_entries().returning(|| { + Box::pin(async { Err(RepositoryError::InvalidData("invalid".to_string())) }) + }); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_err(), "Should fail for InvalidData error"); + } + + #[tokio::test] + async fn test_precompile_plugins_not_found_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_list_paginated().returning(|_| { + Box::pin(async { Err(RepositoryError::NotFound("not found".to_string())) }) + }); + + let pool_manager = get_pool_manager(); + let result = precompile_plugins(&mock_repo, &pool_manager).await; + assert!(result.is_err(), "Should fail for NotFound error"); + } + + #[tokio::test] + async fn test_precompile_plugins_unknown_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_list_paginated().returning(|_| { + Box::pin(async { Err(RepositoryError::Unknown("unknown".to_string())) }) + }); + + let pool_manager = get_pool_manager(); + let result = precompile_plugins(&mock_repo, &pool_manager).await; + assert!(result.is_err(), "Should fail for Unknown error"); + } + + #[tokio::test] + async fn test_precompile_plugins_connection_error() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo.expect_list_paginated().returning(|_| { + Box::pin(async { Err(RepositoryError::ConnectionError("connection".to_string())) }) + }); + + let pool_manager = get_pool_manager(); + let result = precompile_plugins(&mock_repo, &pool_manager).await; + assert!(result.is_err(), "Should fail for ConnectionError"); + } + + // ============================================ + // Integration-style tests + // ============================================ + + #[tokio::test] + async fn test_initialize_then_check_pool_state() { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo + .expect_has_entries() + .returning(|| Box::pin(async { Ok(false) })); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_ok()); + + // When no plugins, should return None + let pool_manager = result.unwrap(); + assert!(pool_manager.is_none()); + } + + #[tokio::test] + async fn test_multiple_initialize_calls_no_plugins() { + // Verify that multiple calls don't cause issues + for _ in 0..3 { + let mut mock_repo = MockPluginRepositoryTrait::new(); + mock_repo + .expect_has_entries() + .returning(|| Box::pin(async { Ok(false) })); + + let result = initialize_plugin_pool(&mock_repo).await; + assert!(result.is_ok()); + assert!(result.unwrap().is_none()); + } + } + + #[tokio::test] + async fn test_precompile_with_large_plugin_count() { + use crate::repositories::PaginatedResult; + + let mut mock_repo = MockPluginRepositoryTrait::new(); + + // Simulate having many plugins (but empty list for simplicity) + mock_repo.expect_list_paginated().returning(|_| { + Box::pin(async { + Ok(PaginatedResult { + items: vec![], + total: 500, // Large total but empty items + page: 1, + per_page: 1000, + }) + }) + }); + + let pool_manager = get_pool_manager(); + + let result = precompile_plugins(&mock_repo, &pool_manager).await; + assert!(result.is_ok()); + assert_eq!(result.unwrap(), 0); // No items to compile + } } diff --git a/src/repositories/plugin/mod.rs b/src/repositories/plugin/mod.rs index 3072e994e..6872c3b25 100644 --- a/src/repositories/plugin/mod.rs +++ b/src/repositories/plugin/mod.rs @@ -244,9 +244,51 @@ mod tests { use super::*; + // ============================================ + // Helper functions + // ============================================ + + fn create_test_plugin(id: &str, path: &str) -> PluginModel { + PluginModel { + id: id.to_string(), + path: path.to_string(), + timeout: Duration::from_secs(30), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + } + } + + fn create_test_plugin_with_options( + id: &str, + path: &str, + emit_logs: bool, + emit_traces: bool, + raw_response: bool, + ) -> PluginModel { + PluginModel { + id: id.to_string(), + path: path.to_string(), + timeout: Duration::from_secs(30), + emit_logs, + emit_traces, + raw_response, + allow_get_invocation: false, + config: None, + forward_logs: false, + } + } + + // ============================================ + // PluginModel TryFrom tests + // ============================================ + #[tokio::test] - async fn test_try_from() { - let plugin = PluginFileConfig { + async fn test_try_from_default_timeout() { + let config = PluginFileConfig { id: "test-plugin".to_string(), path: "test-path".to_string(), timeout: None, @@ -257,48 +299,171 @@ mod tests { config: None, forward_logs: false, }; - let result = PluginModel::try_from(plugin); + + let result = PluginModel::try_from(config); assert!(result.is_ok()); + + let plugin = result.unwrap(); + assert_eq!(plugin.id, "test-plugin"); + assert_eq!(plugin.path, "test-path"); assert_eq!( - result.unwrap(), - PluginModel { - id: "test-plugin".to_string(), - path: "test-path".to_string(), - timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), - emit_logs: false, - emit_traces: false, - raw_response: false, - allow_get_invocation: false, - config: None, - forward_logs: false, - } + plugin.timeout, + Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS) ); } - // Helper function to create a test plugin - fn create_test_plugin(id: &str, path: &str) -> PluginModel { - PluginModel { - id: id.to_string(), - path: path.to_string(), - timeout: Duration::from_secs(30), + #[tokio::test] + async fn test_try_from_custom_timeout() { + let config = PluginFileConfig { + id: "test-plugin".to_string(), + path: "test-path".to_string(), + timeout: Some(120), emit_logs: false, emit_traces: false, raw_response: false, allow_get_invocation: false, config: None, forward_logs: false, - } + }; + + let result = PluginModel::try_from(config); + assert!(result.is_ok()); + + let plugin = result.unwrap(); + assert_eq!(plugin.timeout, Duration::from_secs(120)); + } + + #[tokio::test] + async fn test_try_from_all_options_enabled() { + let mut config_map = serde_json::Map::new(); + config_map.insert("key".to_string(), serde_json::json!("value")); + + let config = PluginFileConfig { + id: "full-plugin".to_string(), + path: "/scripts/full.js".to_string(), + timeout: Some(60), + emit_logs: true, + emit_traces: true, + raw_response: true, + allow_get_invocation: true, + config: Some(config_map), + forward_logs: true, + }; + + let result = PluginModel::try_from(config); + assert!(result.is_ok()); + + let plugin = result.unwrap(); + assert_eq!(plugin.id, "full-plugin"); + assert!(plugin.emit_logs); + assert!(plugin.emit_traces); + assert!(plugin.raw_response); + assert!(plugin.allow_get_invocation); + assert!(plugin.config.is_some()); + assert!(plugin.forward_logs); } + #[tokio::test] + async fn test_try_from_zero_timeout() { + let config = PluginFileConfig { + id: "test".to_string(), + path: "path".to_string(), + timeout: Some(0), + emit_logs: false, + emit_traces: false, + raw_response: false, + allow_get_invocation: false, + config: None, + forward_logs: false, + }; + + let result = PluginModel::try_from(config); + assert!(result.is_ok()); + assert_eq!(result.unwrap().timeout, Duration::from_secs(0)); + } + + // ============================================ + // PluginModel PartialEq tests + // ============================================ + + #[test] + fn test_plugin_model_equality_same_id_and_path() { + let plugin1 = create_test_plugin("plugin-1", "/path/script.js"); + let plugin2 = create_test_plugin("plugin-1", "/path/script.js"); + + assert_eq!(plugin1, plugin2); + } + + #[test] + fn test_plugin_model_equality_different_id() { + let plugin1 = create_test_plugin("plugin-1", "/path/script.js"); + let plugin2 = create_test_plugin("plugin-2", "/path/script.js"); + + assert_ne!(plugin1, plugin2); + } + + #[test] + fn test_plugin_model_equality_different_path() { + let plugin1 = create_test_plugin("plugin-1", "/path/script1.js"); + let plugin2 = create_test_plugin("plugin-1", "/path/script2.js"); + + assert_ne!(plugin1, plugin2); + } + + #[test] + fn test_plugin_model_equality_ignores_other_fields() { + // Same id and path, different other fields + let plugin1 = + create_test_plugin_with_options("plugin-1", "/path/script.js", false, false, false); + let plugin2 = + create_test_plugin_with_options("plugin-1", "/path/script.js", true, true, true); + + // Should be equal because only id and path matter + assert_eq!(plugin1, plugin2); + } + + #[test] + fn test_plugin_model_equality_different_timeout() { + let mut plugin1 = create_test_plugin("plugin-1", "/path/script.js"); + plugin1.timeout = Duration::from_secs(30); + + let mut plugin2 = create_test_plugin("plugin-1", "/path/script.js"); + plugin2.timeout = Duration::from_secs(60); + + // Should be equal because timeout is not part of equality + assert_eq!(plugin1, plugin2); + } + + // ============================================ + // PluginRepositoryStorage constructor tests + // ============================================ + + #[tokio::test] + async fn test_new_in_memory_creates_empty_storage() { + let storage = PluginRepositoryStorage::new_in_memory(); + + assert_eq!(storage.count().await.unwrap(), 0); + assert!(!storage.has_entries().await.unwrap()); + } + + #[test] + fn test_storage_enum_debug() { + let storage = PluginRepositoryStorage::new_in_memory(); + let debug_str = format!("{:?}", storage); + assert!(debug_str.contains("InMemory")); + } + + // ============================================ + // Basic CRUD tests + // ============================================ + #[tokio::test] async fn test_plugin_repository_storage_get_by_id_existing() { let storage = PluginRepositoryStorage::new_in_memory(); let plugin = create_test_plugin("test-plugin", "/path/to/script.js"); - // Add the plugin first storage.add(plugin.clone()).await.unwrap(); - // Get the plugin let result = storage.get_by_id("test-plugin").await.unwrap(); assert_eq!(result, Some(plugin)); } @@ -325,7 +490,6 @@ mod tests { let storage = PluginRepositoryStorage::new_in_memory(); let plugin = create_test_plugin("test-plugin", "/path/to/script.js"); - // Add the plugin first time storage.add(plugin.clone()).await.unwrap(); // Try to add the same plugin again - should succeed (overwrite) @@ -333,6 +497,109 @@ mod tests { assert!(result.is_ok()); } + #[tokio::test] + async fn test_plugin_repository_storage_add_multiple() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=10 { + let plugin = create_test_plugin(&format!("plugin-{}", i), &format!("/path/{}.js", i)); + storage.add(plugin).await.unwrap(); + } + + assert_eq!(storage.count().await.unwrap(), 10); + } + + // ============================================ + // Update tests + // ============================================ + + #[tokio::test] + async fn test_plugin_repository_storage_update_existing() { + let storage = PluginRepositoryStorage::new_in_memory(); + + let plugin = + create_test_plugin_with_options("test-plugin", "/path/script.js", false, false, false); + storage.add(plugin).await.unwrap(); + + let updated = + create_test_plugin_with_options("test-plugin", "/path/script.js", true, true, true); + let result = storage.update(updated.clone()).await; + + assert!(result.is_ok()); + let returned = result.unwrap(); + assert!(returned.emit_logs); + assert!(returned.emit_traces); + assert!(returned.raw_response); + } + + #[tokio::test] + async fn test_plugin_repository_storage_update_nonexistent() { + let storage = PluginRepositoryStorage::new_in_memory(); + + let plugin = create_test_plugin("nonexistent", "/path/script.js"); + let result = storage.update(plugin).await; + + assert!(result.is_err()); + match result { + Err(RepositoryError::NotFound(msg)) => { + assert!(msg.contains("nonexistent")); + } + _ => panic!("Expected NotFound error"), + } + } + + #[tokio::test] + async fn test_plugin_repository_storage_update_persists_changes() { + let storage = PluginRepositoryStorage::new_in_memory(); + + let plugin = create_test_plugin("test-plugin", "/path/script.js"); + storage.add(plugin).await.unwrap(); + + let mut updated = create_test_plugin("test-plugin", "/path/updated.js"); + updated.emit_logs = true; + storage.update(updated).await.unwrap(); + + // Verify persisted changes + let retrieved = storage.get_by_id("test-plugin").await.unwrap().unwrap(); + assert!(retrieved.emit_logs); + assert_eq!(retrieved.path, "/path/updated.js"); + } + + #[tokio::test] + async fn test_plugin_repository_storage_update_does_not_affect_others() { + let storage = PluginRepositoryStorage::new_in_memory(); + + storage + .add(create_test_plugin("plugin-1", "/path/1.js")) + .await + .unwrap(); + storage + .add(create_test_plugin("plugin-2", "/path/2.js")) + .await + .unwrap(); + storage + .add(create_test_plugin("plugin-3", "/path/3.js")) + .await + .unwrap(); + + let mut updated = create_test_plugin("plugin-2", "/path/updated.js"); + updated.emit_logs = true; + storage.update(updated).await.unwrap(); + + // Others unchanged + let p1 = storage.get_by_id("plugin-1").await.unwrap().unwrap(); + assert_eq!(p1.path, "/path/1.js"); + assert!(!p1.emit_logs); + + let p3 = storage.get_by_id("plugin-3").await.unwrap().unwrap(); + assert_eq!(p3.path, "/path/3.js"); + assert!(!p3.emit_logs); + } + + // ============================================ + // Count tests + // ============================================ + #[tokio::test] async fn test_plugin_repository_storage_count_empty() { let storage = PluginRepositoryStorage::new_in_memory(); @@ -345,7 +612,6 @@ mod tests { async fn test_plugin_repository_storage_count_with_plugins() { let storage = PluginRepositoryStorage::new_in_memory(); - // Add multiple plugins storage .add(create_test_plugin("plugin1", "/path/1.js")) .await @@ -363,6 +629,31 @@ mod tests { assert_eq!(count, 3); } + #[tokio::test] + async fn test_plugin_repository_storage_count_after_drop() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=5 { + storage + .add(create_test_plugin( + &format!("p{}", i), + &format!("/{}.js", i), + )) + .await + .unwrap(); + } + + assert_eq!(storage.count().await.unwrap(), 5); + + storage.drop_all_entries().await.unwrap(); + + assert_eq!(storage.count().await.unwrap(), 0); + } + + // ============================================ + // has_entries tests + // ============================================ + #[tokio::test] async fn test_plugin_repository_storage_has_entries_empty() { let storage = PluginRepositoryStorage::new_in_memory(); @@ -384,6 +675,10 @@ mod tests { assert!(has_entries); } + // ============================================ + // drop_all_entries tests + // ============================================ + #[tokio::test] async fn test_plugin_repository_storage_drop_all_entries_empty() { let storage = PluginRepositoryStorage::new_in_memory(); @@ -399,7 +694,6 @@ mod tests { async fn test_plugin_repository_storage_drop_all_entries_with_plugins() { let storage = PluginRepositoryStorage::new_in_memory(); - // Add multiple plugins storage .add(create_test_plugin("plugin1", "/path/1.js")) .await @@ -419,6 +713,10 @@ mod tests { assert!(!has_entries); } + // ============================================ + // Pagination tests + // ============================================ + #[tokio::test] async fn test_plugin_repository_storage_list_paginated_empty() { let storage = PluginRepositoryStorage::new_in_memory(); @@ -436,35 +734,361 @@ mod tests { } #[tokio::test] - async fn test_plugin_repository_storage_list_paginated_with_plugins() { + async fn test_plugin_repository_storage_list_paginated_first_page() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=10 { + storage + .add(create_test_plugin( + &format!("plugin{}", i), + &format!("/{}.js", i), + )) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 1, + per_page: 3, + }; + let result = storage.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 3); + assert_eq!(result.total, 10); + assert_eq!(result.page, 1); + assert_eq!(result.per_page, 3); + } + + #[tokio::test] + async fn test_plugin_repository_storage_list_paginated_middle_page() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=10 { + storage + .add(create_test_plugin( + &format!("plugin{}", i), + &format!("/{}.js", i), + )) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 2, + per_page: 3, + }; + let result = storage.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 3); + assert_eq!(result.total, 10); + assert_eq!(result.page, 2); + } + + #[tokio::test] + async fn test_plugin_repository_storage_list_paginated_last_partial_page() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=10 { + storage + .add(create_test_plugin( + &format!("plugin{}", i), + &format!("/{}.js", i), + )) + .await + .unwrap(); + } + + // 10 items, 3 per page, page 4 should have 1 item + let query = PaginationQuery { + page: 4, + per_page: 3, + }; + let result = storage.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 1); + assert_eq!(result.total, 10); + } + + #[tokio::test] + async fn test_plugin_repository_storage_list_paginated_beyond_data() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=5 { + storage + .add(create_test_plugin( + &format!("plugin{}", i), + &format!("/{}.js", i), + )) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 100, + per_page: 10, + }; + let result = storage.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 0); + assert_eq!(result.total, 5); + } + + #[tokio::test] + async fn test_plugin_repository_storage_list_paginated_large_per_page() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=5 { + storage + .add(create_test_plugin( + &format!("plugin{}", i), + &format!("/{}.js", i), + )) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 1, + per_page: 100, + }; + let result = storage.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 5); + assert_eq!(result.total, 5); + } + + // ============================================ + // Compiled code cache tests + // ============================================ + + #[tokio::test] + async fn test_store_and_get_compiled_code() { let storage = PluginRepositoryStorage::new_in_memory(); - // Add multiple plugins storage - .add(create_test_plugin("plugin1", "/path/1.js")) + .store_compiled_code("plugin-1", "compiled code", None) .await .unwrap(); + + let code = storage.get_compiled_code("plugin-1").await.unwrap(); + assert_eq!(code, Some("compiled code".to_string())); + } + + #[tokio::test] + async fn test_get_compiled_code_nonexistent() { + let storage = PluginRepositoryStorage::new_in_memory(); + + let code = storage.get_compiled_code("nonexistent").await.unwrap(); + assert_eq!(code, None); + } + + #[tokio::test] + async fn test_store_compiled_code_with_source_hash() { + let storage = PluginRepositoryStorage::new_in_memory(); + storage - .add(create_test_plugin("plugin2", "/path/2.js")) + .store_compiled_code("plugin-1", "code", Some("sha256:abc123")) + .await + .unwrap(); + + let code = storage.get_compiled_code("plugin-1").await.unwrap(); + assert_eq!(code, Some("code".to_string())); + + let hash = storage.get_source_hash("plugin-1").await.unwrap(); + assert_eq!(hash, Some("sha256:abc123".to_string())); + } + + #[tokio::test] + async fn test_store_compiled_code_overwrites() { + let storage = PluginRepositoryStorage::new_in_memory(); + + storage + .store_compiled_code("plugin-1", "old code", Some("old-hash")) .await .unwrap(); storage - .add(create_test_plugin("plugin3", "/path/3.js")) + .store_compiled_code("plugin-1", "new code", Some("new-hash")) .await .unwrap(); - let query = PaginationQuery { - page: 1, - per_page: 2, - }; - let result = storage.list_paginated(query).await.unwrap(); + let code = storage.get_compiled_code("plugin-1").await.unwrap(); + assert_eq!(code, Some("new code".to_string())); - assert_eq!(result.items.len(), 2); - assert_eq!(result.total, 3); - assert_eq!(result.page, 1); - assert_eq!(result.per_page, 2); + let hash = storage.get_source_hash("plugin-1").await.unwrap(); + assert_eq!(hash, Some("new-hash".to_string())); + } + + #[tokio::test] + async fn test_has_compiled_code() { + let storage = PluginRepositoryStorage::new_in_memory(); + + assert!(!storage.has_compiled_code("plugin-1").await.unwrap()); + + storage + .store_compiled_code("plugin-1", "code", None) + .await + .unwrap(); + + assert!(storage.has_compiled_code("plugin-1").await.unwrap()); + assert!(!storage.has_compiled_code("plugin-2").await.unwrap()); + } + + #[tokio::test] + async fn test_invalidate_compiled_code() { + let storage = PluginRepositoryStorage::new_in_memory(); + + storage + .store_compiled_code("plugin-1", "code1", None) + .await + .unwrap(); + storage + .store_compiled_code("plugin-2", "code2", None) + .await + .unwrap(); + + storage.invalidate_compiled_code("plugin-1").await.unwrap(); + + assert!(!storage.has_compiled_code("plugin-1").await.unwrap()); + assert!(storage.has_compiled_code("plugin-2").await.unwrap()); + } + + #[tokio::test] + async fn test_invalidate_compiled_code_nonexistent() { + let storage = PluginRepositoryStorage::new_in_memory(); + + // Should not fail + let result = storage.invalidate_compiled_code("nonexistent").await; + assert!(result.is_ok()); + } + + #[tokio::test] + async fn test_invalidate_all_compiled_code() { + let storage = PluginRepositoryStorage::new_in_memory(); + + for i in 1..=5 { + storage + .store_compiled_code(&format!("plugin-{}", i), &format!("code-{}", i), None) + .await + .unwrap(); + } + + storage.invalidate_all_compiled_code().await.unwrap(); + + for i in 1..=5 { + assert!(!storage + .has_compiled_code(&format!("plugin-{}", i)) + .await + .unwrap()); + } + } + + #[tokio::test] + async fn test_invalidate_all_compiled_code_empty() { + let storage = PluginRepositoryStorage::new_in_memory(); + + // Should not fail + let result = storage.invalidate_all_compiled_code().await; + assert!(result.is_ok()); + } + + #[tokio::test] + async fn test_get_source_hash() { + let storage = PluginRepositoryStorage::new_in_memory(); + + // No hash + storage + .store_compiled_code("plugin-1", "code", None) + .await + .unwrap(); + let hash = storage.get_source_hash("plugin-1").await.unwrap(); + assert_eq!(hash, None); + + // With hash + storage + .store_compiled_code("plugin-2", "code", Some("hash123")) + .await + .unwrap(); + let hash = storage.get_source_hash("plugin-2").await.unwrap(); + assert_eq!(hash, Some("hash123".to_string())); } + #[tokio::test] + async fn test_get_source_hash_nonexistent() { + let storage = PluginRepositoryStorage::new_in_memory(); + + let hash = storage.get_source_hash("nonexistent").await.unwrap(); + assert_eq!(hash, None); + } + + // ============================================ + // Cache independence tests + // ============================================ + + #[tokio::test] + async fn test_compiled_cache_independent_of_plugin_store() { + let storage = PluginRepositoryStorage::new_in_memory(); + + // Store compiled code without adding plugin + storage + .store_compiled_code("plugin-1", "code", None) + .await + .unwrap(); + + // Plugin doesn't exist + assert!(storage.get_by_id("plugin-1").await.unwrap().is_none()); + + // But compiled code does + assert!(storage.has_compiled_code("plugin-1").await.unwrap()); + } + + #[tokio::test] + async fn test_drop_all_does_not_clear_compiled_cache() { + let storage = PluginRepositoryStorage::new_in_memory(); + + storage + .add(create_test_plugin("plugin-1", "/path.js")) + .await + .unwrap(); + storage + .store_compiled_code("plugin-1", "code", None) + .await + .unwrap(); + + storage.drop_all_entries().await.unwrap(); + + // Plugin gone + assert!(storage.get_by_id("plugin-1").await.unwrap().is_none()); + + // Compiled cache still has entry + assert!(storage.has_compiled_code("plugin-1").await.unwrap()); + } + + #[tokio::test] + async fn test_invalidate_all_compiled_does_not_clear_store() { + let storage = PluginRepositoryStorage::new_in_memory(); + + storage + .add(create_test_plugin("plugin-1", "/path.js")) + .await + .unwrap(); + storage + .store_compiled_code("plugin-1", "code", None) + .await + .unwrap(); + + storage.invalidate_all_compiled_code().await.unwrap(); + + // Compiled cache cleared + assert!(!storage.has_compiled_code("plugin-1").await.unwrap()); + + // Plugin still exists + assert!(storage.get_by_id("plugin-1").await.unwrap().is_some()); + } + + // ============================================ + // Workflow/integration tests + // ============================================ + #[tokio::test] async fn test_plugin_repository_storage_workflow() { let storage = PluginRepositoryStorage::new_in_memory(); @@ -488,6 +1112,15 @@ mod tests { let retrieved = storage.get_by_id("auth-plugin").await.unwrap(); assert_eq!(retrieved, Some(plugin1)); + // Update plugin + let mut updated = create_test_plugin("auth-plugin", "/scripts/auth_v2.js"); + updated.emit_logs = true; + storage.update(updated).await.unwrap(); + + let after_update = storage.get_by_id("auth-plugin").await.unwrap().unwrap(); + assert_eq!(after_update.path, "/scripts/auth_v2.js"); + assert!(after_update.emit_logs); + // List all plugins let query = PaginationQuery { page: 1, @@ -502,4 +1135,105 @@ mod tests { assert!(!storage.has_entries().await.unwrap()); assert_eq!(storage.count().await.unwrap(), 0); } + + #[tokio::test] + async fn test_compiled_code_workflow() { + let storage = PluginRepositoryStorage::new_in_memory(); + + // Add plugin + storage + .add(create_test_plugin("my-plugin", "/scripts/plugin.js")) + .await + .unwrap(); + + // Initially no compiled code + assert!(!storage.has_compiled_code("my-plugin").await.unwrap()); + + // Store compiled code + storage + .store_compiled_code("my-plugin", "compiled JS", Some("hash-v1")) + .await + .unwrap(); + + // Verify + assert!(storage.has_compiled_code("my-plugin").await.unwrap()); + assert_eq!( + storage.get_compiled_code("my-plugin").await.unwrap(), + Some("compiled JS".to_string()) + ); + assert_eq!( + storage.get_source_hash("my-plugin").await.unwrap(), + Some("hash-v1".to_string()) + ); + + // Update compiled code + storage + .store_compiled_code("my-plugin", "updated JS", Some("hash-v2")) + .await + .unwrap(); + + assert_eq!( + storage.get_compiled_code("my-plugin").await.unwrap(), + Some("updated JS".to_string()) + ); + assert_eq!( + storage.get_source_hash("my-plugin").await.unwrap(), + Some("hash-v2".to_string()) + ); + + // Invalidate + storage.invalidate_compiled_code("my-plugin").await.unwrap(); + + assert!(!storage.has_compiled_code("my-plugin").await.unwrap()); + assert_eq!(storage.get_compiled_code("my-plugin").await.unwrap(), None); + } + + #[tokio::test] + async fn test_multiple_plugins_compiled_code() { + let storage = PluginRepositoryStorage::new_in_memory(); + + // Store compiled code for multiple plugins + for i in 1..=5 { + storage + .store_compiled_code( + &format!("plugin-{}", i), + &format!("code for plugin {}", i), + Some(&format!("hash-{}", i)), + ) + .await + .unwrap(); + } + + // Verify all + for i in 1..=5 { + assert!(storage + .has_compiled_code(&format!("plugin-{}", i)) + .await + .unwrap()); + assert_eq!( + storage + .get_compiled_code(&format!("plugin-{}", i)) + .await + .unwrap(), + Some(format!("code for plugin {}", i)) + ); + assert_eq!( + storage + .get_source_hash(&format!("plugin-{}", i)) + .await + .unwrap(), + Some(format!("hash-{}", i)) + ); + } + + // Invalidate one + storage.invalidate_compiled_code("plugin-3").await.unwrap(); + + // Verify selective invalidation + assert!(storage.has_compiled_code("plugin-1").await.unwrap()); + assert!(storage.has_compiled_code("plugin-2").await.unwrap()); + assert!(!storage.has_compiled_code("plugin-3").await.unwrap()); + assert!(storage.has_compiled_code("plugin-4").await.unwrap()); + assert!(storage.has_compiled_code("plugin-5").await.unwrap()); + } } diff --git a/src/repositories/plugin/plugin_in_memory.rs b/src/repositories/plugin/plugin_in_memory.rs index ec3fcf10b..7765752ce 100644 --- a/src/repositories/plugin/plugin_in_memory.rs +++ b/src/repositories/plugin/plugin_in_memory.rs @@ -191,14 +191,14 @@ mod tests { use super::*; use std::{sync::Arc, time::Duration}; - #[tokio::test] - async fn test_in_memory_plugin_repository() { - let plugin_repository = Arc::new(InMemoryPluginRepository::new()); - - // Test add and get_by_id - let plugin = PluginModel { - id: "test-plugin".to_string(), - path: "test-path".to_string(), + // ============================================ + // Helper functions + // ============================================ + + fn create_test_plugin(id: &str) -> PluginModel { + PluginModel { + id: id.to_string(), + path: format!("path/{}", id), timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), emit_logs: false, emit_traces: false, @@ -206,25 +206,608 @@ mod tests { allow_get_invocation: false, config: None, forward_logs: false, + } + } + + fn create_test_plugin_with_options( + id: &str, + emit_logs: bool, + emit_traces: bool, + raw_response: bool, + ) -> PluginModel { + PluginModel { + id: id.to_string(), + path: format!("path/{}", id), + timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), + emit_logs, + emit_traces, + raw_response, + allow_get_invocation: false, + config: None, + forward_logs: false, + } + } + + // ============================================ + // Basic repository tests + // ============================================ + + #[tokio::test] + async fn test_new_creates_empty_repository() { + let repo = InMemoryPluginRepository::new(); + + assert_eq!(repo.count().await.unwrap(), 0); + assert!(!repo.has_entries().await.unwrap()); + } + + #[tokio::test] + async fn test_default_creates_empty_repository() { + let repo = InMemoryPluginRepository::default(); + + assert_eq!(repo.count().await.unwrap(), 0); + assert!(!repo.has_entries().await.unwrap()); + } + + #[tokio::test] + async fn test_add_and_get_by_id() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + let plugin = create_test_plugin("test-plugin"); + repo.add(plugin.clone()).await.unwrap(); + + let retrieved = repo.get_by_id("test-plugin").await.unwrap(); + assert_eq!(retrieved, Some(plugin)); + } + + #[tokio::test] + async fn test_get_nonexistent_plugin() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + let result = repo.get_by_id("nonexistent").await; + assert!(matches!(result, Ok(None))); + } + + #[tokio::test] + async fn test_add_multiple_plugins() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=5 { + let plugin = create_test_plugin(&format!("plugin-{}", i)); + repo.add(plugin).await.unwrap(); + } + + assert_eq!(repo.count().await.unwrap(), 5); + + for i in 1..=5 { + let result = repo.get_by_id(&format!("plugin-{}", i)).await.unwrap(); + assert!(result.is_some()); + } + } + + #[tokio::test] + async fn test_add_overwrites_existing() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + let plugin1 = create_test_plugin_with_options("test-plugin", false, false, false); + repo.add(plugin1).await.unwrap(); + + let plugin2 = create_test_plugin_with_options("test-plugin", true, true, true); + repo.add(plugin2.clone()).await.unwrap(); + + // Should have overwritten + let retrieved = repo.get_by_id("test-plugin").await.unwrap().unwrap(); + assert!(retrieved.emit_logs); + assert!(retrieved.emit_traces); + assert!(retrieved.raw_response); + + // Count should still be 1 + assert_eq!(repo.count().await.unwrap(), 1); + } + + // ============================================ + // Update tests + // ============================================ + + #[tokio::test] + async fn test_update_existing_plugin() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + let plugin = create_test_plugin("test-plugin"); + repo.add(plugin).await.unwrap(); + + let updated_plugin = create_test_plugin_with_options("test-plugin", true, true, true); + let result = repo.update(updated_plugin.clone()).await; + + assert!(result.is_ok()); + let returned = result.unwrap(); + assert_eq!(returned.id, "test-plugin"); + assert!(returned.emit_logs); + assert!(returned.emit_traces); + + // Verify persisted + let retrieved = repo.get_by_id("test-plugin").await.unwrap().unwrap(); + assert!(retrieved.emit_logs); + } + + #[tokio::test] + async fn test_update_nonexistent_plugin_returns_error() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + let plugin = create_test_plugin("nonexistent"); + let result = repo.update(plugin).await; + + assert!(result.is_err()); + match result { + Err(RepositoryError::NotFound(msg)) => { + assert!(msg.contains("nonexistent")); + } + _ => panic!("Expected NotFound error"), + } + } + + #[tokio::test] + async fn test_update_preserves_other_plugins() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + repo.add(create_test_plugin("plugin-1")).await.unwrap(); + repo.add(create_test_plugin("plugin-2")).await.unwrap(); + repo.add(create_test_plugin("plugin-3")).await.unwrap(); + + let updated = create_test_plugin_with_options("plugin-2", true, false, false); + repo.update(updated).await.unwrap(); + + // Check other plugins unchanged + let p1 = repo.get_by_id("plugin-1").await.unwrap().unwrap(); + assert!(!p1.emit_logs); + + let p3 = repo.get_by_id("plugin-3").await.unwrap().unwrap(); + assert!(!p3.emit_logs); + + // Check updated plugin changed + let p2 = repo.get_by_id("plugin-2").await.unwrap().unwrap(); + assert!(p2.emit_logs); + } + + // ============================================ + // Count tests + // ============================================ + + #[tokio::test] + async fn test_count_empty_repository() { + let repo = InMemoryPluginRepository::new(); + assert_eq!(repo.count().await.unwrap(), 0); + } + + #[tokio::test] + async fn test_count_with_entries() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=10 { + repo.add(create_test_plugin(&format!("plugin-{}", i))) + .await + .unwrap(); + } + + assert_eq!(repo.count().await.unwrap(), 10); + } + + #[tokio::test] + async fn test_count_after_drop_all() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=5 { + repo.add(create_test_plugin(&format!("plugin-{}", i))) + .await + .unwrap(); + } + + assert_eq!(repo.count().await.unwrap(), 5); + + repo.drop_all_entries().await.unwrap(); + + assert_eq!(repo.count().await.unwrap(), 0); + } + + // ============================================ + // Pagination tests + // ============================================ + + #[tokio::test] + async fn test_list_paginated_first_page() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=10 { + repo.add(create_test_plugin(&format!("plugin-{:02}", i))) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 1, + per_page: 3, + }; + + let result = repo.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 3); + assert_eq!(result.total, 10); + assert_eq!(result.page, 1); + assert_eq!(result.per_page, 3); + } + + #[tokio::test] + async fn test_list_paginated_middle_page() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=10 { + repo.add(create_test_plugin(&format!("plugin-{:02}", i))) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 2, + per_page: 3, + }; + + let result = repo.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 3); + assert_eq!(result.total, 10); + assert_eq!(result.page, 2); + } + + #[tokio::test] + async fn test_list_paginated_last_partial_page() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=10 { + repo.add(create_test_plugin(&format!("plugin-{:02}", i))) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 4, + per_page: 3, + }; + + let result = repo.list_paginated(query).await.unwrap(); + + // 10 items, 3 per page: page 4 has only 1 item + assert_eq!(result.items.len(), 1); + assert_eq!(result.total, 10); + } + + #[tokio::test] + async fn test_list_paginated_empty_repository() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + let query = PaginationQuery { + page: 1, + per_page: 10, + }; + + let result = repo.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 0); + assert_eq!(result.total, 0); + } + + #[tokio::test] + async fn test_list_paginated_page_beyond_data() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=5 { + repo.add(create_test_plugin(&format!("plugin-{}", i))) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 10, // Way beyond available data + per_page: 2, + }; + + let result = repo.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 0); + assert_eq!(result.total, 5); + } + + #[tokio::test] + async fn test_list_paginated_large_per_page() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=5 { + repo.add(create_test_plugin(&format!("plugin-{}", i))) + .await + .unwrap(); + } + + let query = PaginationQuery { + page: 1, + per_page: 100, // More than available }; - plugin_repository.add(plugin.clone()).await.unwrap(); + + let result = repo.list_paginated(query).await.unwrap(); + + assert_eq!(result.items.len(), 5); + assert_eq!(result.total, 5); + } + + // ============================================ + // has_entries and drop_all tests + // ============================================ + + #[tokio::test] + async fn test_has_entries_empty() { + let repo = InMemoryPluginRepository::new(); + assert!(!repo.has_entries().await.unwrap()); + } + + #[tokio::test] + async fn test_has_entries_with_data() { + let repo = Arc::new(InMemoryPluginRepository::new()); + repo.add(create_test_plugin("test")).await.unwrap(); + assert!(repo.has_entries().await.unwrap()); + } + + #[tokio::test] + async fn test_drop_all_entries_clears_store() { + let repo = Arc::new(InMemoryPluginRepository::new()); + + for i in 1..=5 { + repo.add(create_test_plugin(&format!("plugin-{}", i))) + .await + .unwrap(); + } + + assert!(repo.has_entries().await.unwrap()); + assert_eq!(repo.count().await.unwrap(), 5); + + repo.drop_all_entries().await.unwrap(); + + assert!(!repo.has_entries().await.unwrap()); + assert_eq!(repo.count().await.unwrap(), 0); + } + + #[tokio::test] + async fn test_drop_all_entries_on_empty_repo() { + let repo = InMemoryPluginRepository::new(); + + // Should not fail on empty repo + let result = repo.drop_all_entries().await; + assert!(result.is_ok()); + } + + // ============================================ + // Compiled code cache tests + // ============================================ + + #[tokio::test] + async fn test_store_and_get_compiled_code() { + let repo = InMemoryPluginRepository::new(); + + repo.store_compiled_code("plugin-1", "compiled code here", None) + .await + .unwrap(); + + let result = repo.get_compiled_code("plugin-1").await.unwrap(); + assert_eq!(result, Some("compiled code here".to_string())); + } + + #[tokio::test] + async fn test_get_compiled_code_nonexistent() { + let repo = InMemoryPluginRepository::new(); + + let result = repo.get_compiled_code("nonexistent").await.unwrap(); + assert_eq!(result, None); + } + + #[tokio::test] + async fn test_store_compiled_code_with_source_hash() { + let repo = InMemoryPluginRepository::new(); + + repo.store_compiled_code("plugin-1", "code", Some("abc123hash")) + .await + .unwrap(); + + let code = repo.get_compiled_code("plugin-1").await.unwrap(); + assert_eq!(code, Some("code".to_string())); + + let hash = repo.get_source_hash("plugin-1").await.unwrap(); + assert_eq!(hash, Some("abc123hash".to_string())); + } + + #[tokio::test] + async fn test_store_compiled_code_overwrites_existing() { + let repo = InMemoryPluginRepository::new(); + + repo.store_compiled_code("plugin-1", "old code", Some("oldhash")) + .await + .unwrap(); + + repo.store_compiled_code("plugin-1", "new code", Some("newhash")) + .await + .unwrap(); + + let code = repo.get_compiled_code("plugin-1").await.unwrap(); + assert_eq!(code, Some("new code".to_string())); + + let hash = repo.get_source_hash("plugin-1").await.unwrap(); + assert_eq!(hash, Some("newhash".to_string())); + } + + #[tokio::test] + async fn test_has_compiled_code() { + let repo = InMemoryPluginRepository::new(); + + assert!(!repo.has_compiled_code("plugin-1").await.unwrap()); + + repo.store_compiled_code("plugin-1", "code", None) + .await + .unwrap(); + + assert!(repo.has_compiled_code("plugin-1").await.unwrap()); + assert!(!repo.has_compiled_code("plugin-2").await.unwrap()); + } + + #[tokio::test] + async fn test_invalidate_compiled_code() { + let repo = InMemoryPluginRepository::new(); + + repo.store_compiled_code("plugin-1", "code1", None) + .await + .unwrap(); + repo.store_compiled_code("plugin-2", "code2", None) + .await + .unwrap(); + + assert!(repo.has_compiled_code("plugin-1").await.unwrap()); + assert!(repo.has_compiled_code("plugin-2").await.unwrap()); + + repo.invalidate_compiled_code("plugin-1").await.unwrap(); + + assert!(!repo.has_compiled_code("plugin-1").await.unwrap()); + assert!(repo.has_compiled_code("plugin-2").await.unwrap()); + } + + #[tokio::test] + async fn test_invalidate_compiled_code_nonexistent() { + let repo = InMemoryPluginRepository::new(); + + // Should not fail on nonexistent + let result = repo.invalidate_compiled_code("nonexistent").await; + assert!(result.is_ok()); + } + + #[tokio::test] + async fn test_invalidate_all_compiled_code() { + let repo = InMemoryPluginRepository::new(); + + for i in 1..=5 { + repo.store_compiled_code(&format!("plugin-{}", i), &format!("code-{}", i), None) + .await + .unwrap(); + } + + for i in 1..=5 { + assert!(repo + .has_compiled_code(&format!("plugin-{}", i)) + .await + .unwrap()); + } + + repo.invalidate_all_compiled_code().await.unwrap(); + + for i in 1..=5 { + assert!(!repo + .has_compiled_code(&format!("plugin-{}", i)) + .await + .unwrap()); + } + } + + #[tokio::test] + async fn test_invalidate_all_compiled_code_empty() { + let repo = InMemoryPluginRepository::new(); + + // Should not fail on empty cache + let result = repo.invalidate_all_compiled_code().await; + assert!(result.is_ok()); + } + + #[tokio::test] + async fn test_get_source_hash() { + let repo = InMemoryPluginRepository::new(); + + // No hash stored + repo.store_compiled_code("plugin-1", "code", None) + .await + .unwrap(); + let hash = repo.get_source_hash("plugin-1").await.unwrap(); + assert_eq!(hash, None); + + // Hash stored + repo.store_compiled_code("plugin-2", "code", Some("sha256:abc")) + .await + .unwrap(); + let hash = repo.get_source_hash("plugin-2").await.unwrap(); + assert_eq!(hash, Some("sha256:abc".to_string())); + } + + #[tokio::test] + async fn test_get_source_hash_nonexistent() { + let repo = InMemoryPluginRepository::new(); + + let hash = repo.get_source_hash("nonexistent").await.unwrap(); + assert_eq!(hash, None); + } + + // ============================================ + // Clone tests + // ============================================ + + #[tokio::test] + async fn test_clone_copies_store_data() { + let repo = InMemoryPluginRepository::new(); + repo.add(create_test_plugin("plugin-1")).await.unwrap(); + repo.add(create_test_plugin("plugin-2")).await.unwrap(); + + let cloned = repo.clone(); + + // Cloned should have same data + assert_eq!(cloned.count().await.unwrap(), 2); + assert!(cloned.get_by_id("plugin-1").await.unwrap().is_some()); + assert!(cloned.get_by_id("plugin-2").await.unwrap().is_some()); + } + + #[tokio::test] + async fn test_clone_copies_compiled_cache() { + let repo = InMemoryPluginRepository::new(); + repo.store_compiled_code("plugin-1", "code1", Some("hash1")) + .await + .unwrap(); + + let cloned = repo.clone(); + + // Cloned should have same compiled cache + assert!(cloned.has_compiled_code("plugin-1").await.unwrap()); + assert_eq!( + cloned.get_compiled_code("plugin-1").await.unwrap(), + Some("code1".to_string()) + ); assert_eq!( - plugin_repository.get_by_id("test-plugin").await.unwrap(), - Some(plugin) + cloned.get_source_hash("plugin-1").await.unwrap(), + Some("hash1".to_string()) ); } #[tokio::test] - async fn test_get_nonexistent_plugin() { - let plugin_repository = Arc::new(InMemoryPluginRepository::new()); + async fn test_clone_is_independent() { + let repo = InMemoryPluginRepository::new(); + repo.add(create_test_plugin("plugin-1")).await.unwrap(); - let result = plugin_repository.get_by_id("test-plugin").await; - assert!(matches!(result, Ok(None))); + let cloned = repo.clone(); + + // Modify original + repo.add(create_test_plugin("plugin-2")).await.unwrap(); + + // Clone should not have the new plugin (independent copy) + // Note: This tests the independence after clone + assert_eq!(repo.count().await.unwrap(), 2); + // cloned was made before plugin-2 was added, so it only has 1 + assert_eq!(cloned.count().await.unwrap(), 1); } + // ============================================ + // PluginModel conversion tests + // ============================================ + #[tokio::test] - async fn test_try_from() { - let plugin = PluginFileConfig { + async fn test_plugin_model_try_from_config() { + let config = PluginFileConfig { id: "test-plugin".to_string(), path: "test-path".to_string(), timeout: None, @@ -235,132 +818,102 @@ mod tests { config: None, forward_logs: false, }; - let result = PluginModel::try_from(plugin); + + let result = PluginModel::try_from(config); assert!(result.is_ok()); + + let plugin = result.unwrap(); + assert_eq!(plugin.id, "test-plugin"); + assert_eq!(plugin.path, "test-path"); assert_eq!( - result.unwrap(), - PluginModel { - id: "test-plugin".to_string(), - path: "test-path".to_string(), - timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), - emit_logs: false, - emit_traces: false, - raw_response: false, - allow_get_invocation: false, - config: None, - forward_logs: false, - } + plugin.timeout, + Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS) ); } #[tokio::test] - async fn test_get_by_id() { - let plugin_repository = Arc::new(InMemoryPluginRepository::new()); + async fn test_plugin_model_try_from_config_with_timeout() { + let mut config_map = serde_json::Map::new(); + config_map.insert("key".to_string(), serde_json::json!("value")); - let plugin = PluginModel { + let config = PluginFileConfig { id: "test-plugin".to_string(), path: "test-path".to_string(), - timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), - emit_logs: false, - emit_traces: false, - raw_response: false, - allow_get_invocation: false, - config: None, - forward_logs: false, + timeout: Some(120), + emit_logs: true, + emit_traces: true, + raw_response: true, + allow_get_invocation: true, + config: Some(config_map), + forward_logs: true, }; - plugin_repository.add(plugin.clone()).await.unwrap(); - assert_eq!( - plugin_repository.get_by_id("test-plugin").await.unwrap(), - Some(plugin) - ); + + let result = PluginModel::try_from(config); + assert!(result.is_ok()); + + let plugin = result.unwrap(); + assert_eq!(plugin.timeout, Duration::from_secs(120)); + assert!(plugin.emit_logs); + assert!(plugin.emit_traces); + assert!(plugin.raw_response); + assert!(plugin.allow_get_invocation); + assert!(plugin.config.is_some()); + assert!(plugin.forward_logs); } + // ============================================ + // Compiled cache independence from store + // ============================================ + #[tokio::test] - async fn test_list_paginated() { - let plugin_repository = Arc::new(InMemoryPluginRepository::new()); + async fn test_compiled_cache_independent_of_plugin_store() { + let repo = InMemoryPluginRepository::new(); - let plugin1 = PluginModel { - id: "test-plugin1".to_string(), - path: "test-path1".to_string(), - timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), - emit_logs: false, - emit_traces: false, - raw_response: false, - allow_get_invocation: false, - config: None, - forward_logs: false, - }; + // Store compiled code without adding plugin to store + repo.store_compiled_code("plugin-1", "compiled", None) + .await + .unwrap(); - let plugin2 = PluginModel { - id: "test-plugin2".to_string(), - path: "test-path2".to_string(), - timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), - emit_logs: false, - emit_traces: false, - raw_response: false, - allow_get_invocation: false, - config: None, - forward_logs: false, - }; + // Plugin doesn't exist in store + assert!(repo.get_by_id("plugin-1").await.unwrap().is_none()); - plugin_repository.add(plugin1.clone()).await.unwrap(); - plugin_repository.add(plugin2.clone()).await.unwrap(); + // But compiled code exists in cache + assert!(repo.has_compiled_code("plugin-1").await.unwrap()); + } - let query = PaginationQuery { - page: 1, - per_page: 2, - }; + #[tokio::test] + async fn test_drop_all_entries_does_not_clear_compiled_cache() { + let repo = InMemoryPluginRepository::new(); - let result = plugin_repository.list_paginated(query).await; - assert!(result.is_ok()); - let result = result.unwrap(); - assert_eq!(result.items.len(), 2); - } - - #[tokio::test] - async fn test_has_entries() { - let plugin_repository = Arc::new(InMemoryPluginRepository::new()); - assert!(!plugin_repository.has_entries().await.unwrap()); - plugin_repository - .add(PluginModel { - id: "test-plugin".to_string(), - path: "test-path".to_string(), - timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), - emit_logs: false, - emit_traces: false, - raw_response: false, - allow_get_invocation: false, - config: None, - forward_logs: false, - }) + repo.add(create_test_plugin("plugin-1")).await.unwrap(); + repo.store_compiled_code("plugin-1", "compiled", None) .await .unwrap(); - assert!(plugin_repository.has_entries().await.unwrap()); - plugin_repository.drop_all_entries().await.unwrap(); - assert!(!plugin_repository.has_entries().await.unwrap()); - } - - #[tokio::test] - async fn test_drop_all_entries() { - let plugin_repository = Arc::new(InMemoryPluginRepository::new()); - plugin_repository - .add(PluginModel { - id: "test-plugin".to_string(), - path: "test-path".to_string(), - timeout: Duration::from_secs(DEFAULT_PLUGIN_TIMEOUT_SECONDS), - emit_logs: false, - emit_traces: false, - raw_response: false, - allow_get_invocation: false, - config: None, - forward_logs: false, - }) + repo.drop_all_entries().await.unwrap(); + + // Plugin gone + assert!(repo.get_by_id("plugin-1").await.unwrap().is_none()); + + // But compiled cache still has entry + assert!(repo.has_compiled_code("plugin-1").await.unwrap()); + } + + #[tokio::test] + async fn test_invalidate_all_compiled_does_not_clear_store() { + let repo = InMemoryPluginRepository::new(); + + repo.add(create_test_plugin("plugin-1")).await.unwrap(); + repo.store_compiled_code("plugin-1", "compiled", None) .await .unwrap(); - assert!(plugin_repository.has_entries().await.unwrap()); - plugin_repository.drop_all_entries().await.unwrap(); - assert!(!plugin_repository.has_entries().await.unwrap()); + repo.invalidate_all_compiled_code().await.unwrap(); + + // Compiled cache cleared + assert!(!repo.has_compiled_code("plugin-1").await.unwrap()); + + // But plugin still exists in store + assert!(repo.get_by_id("plugin-1").await.unwrap().is_some()); } } diff --git a/src/services/plugins/connection.rs b/src/services/plugins/connection.rs index 51d88ecc1..b98043b79 100644 --- a/src/services/plugins/connection.rs +++ b/src/services/plugins/connection.rs @@ -268,6 +268,11 @@ impl<'a> Drop for PooledConnection<'a> { #[cfg(test)] mod tests { use super::*; + use crate::services::plugins::protocol::ExecuteRequest; + + // ============================================ + // ConnectionPool creation tests + // ============================================ #[test] fn test_connection_pool_creation() { @@ -276,6 +281,35 @@ mod tests { assert_eq!(pool.semaphore.available_permits(), 10); } + #[test] + fn test_connection_pool_creation_single_connection() { + let pool = ConnectionPool::new("/tmp/single.sock".to_string(), 1); + assert_eq!(pool.semaphore.available_permits(), 1); + } + + #[test] + fn test_connection_pool_creation_large_pool() { + let pool = ConnectionPool::new("/tmp/large.sock".to_string(), 1000); + assert_eq!(pool.semaphore.available_permits(), 1000); + } + + #[test] + fn test_connection_pool_stores_socket_path() { + let path = "/var/run/custom.sock"; + let pool = ConnectionPool::new(path.to_string(), 5); + assert_eq!(pool.socket_path, path); + } + + #[test] + fn test_connection_pool_stores_max_connections() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 42); + assert_eq!(pool.max_connections, 42); + } + + // ============================================ + // Semaphore tests + // ============================================ + #[tokio::test] async fn test_connection_pool_semaphore_limits() { let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 2); @@ -291,6 +325,52 @@ mod tests { assert!(permit3.is_err()); } + #[tokio::test] + async fn test_semaphore_permit_release_restores_capacity() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 2); + + // Acquire all permits + let permit1 = pool.semaphore.clone().try_acquire_owned().unwrap(); + let permit2 = pool.semaphore.clone().try_acquire_owned().unwrap(); + + // No permits available + assert_eq!(pool.semaphore.available_permits(), 0); + + // Drop one permit + drop(permit1); + + // One permit available again + assert_eq!(pool.semaphore.available_permits(), 1); + + // Can acquire again + let permit3 = pool.semaphore.clone().try_acquire_owned(); + assert!(permit3.is_ok()); + + // Drop remaining permits + drop(permit2); + drop(permit3.unwrap()); + + // All permits restored + assert_eq!(pool.semaphore.available_permits(), 2); + } + + #[tokio::test] + async fn test_semaphore_async_acquire() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 1); + + // Acquire the only permit + let permit = pool.semaphore.clone().acquire_owned().await; + assert!(permit.is_ok()); + let _permit = permit.unwrap(); + + // Verify no permits available + assert_eq!(pool.semaphore.available_permits(), 0); + } + + // ============================================ + // Connection ID tests + // ============================================ + #[test] fn test_connection_id_increment() { let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); @@ -298,4 +378,372 @@ mod tests { assert_eq!(pool.next_connection_id(), 1); assert_eq!(pool.next_connection_id(), 2); } + + #[test] + fn test_connection_id_starts_at_zero() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); + assert_eq!(pool.next_connection_id(), 0); + } + + #[test] + fn test_connection_id_monotonically_increasing() { + let pool = ConnectionPool::new("/tmp/test.sock".to_string(), 10); + + let mut last_id = pool.next_connection_id(); + for _ in 0..100 { + let current_id = pool.next_connection_id(); + assert!( + current_id > last_id, + "IDs should be monotonically increasing" + ); + last_id = current_id; + } + } + + #[test] + fn test_connection_id_thread_safe() { + use std::thread; + + let pool = Arc::new(ConnectionPool::new("/tmp/test.sock".to_string(), 100)); + let mut handles = vec![]; + + // Spawn multiple threads getting connection IDs + for _ in 0..10 { + let pool_clone = pool.clone(); + handles.push(thread::spawn(move || { + let mut ids = vec![]; + for _ in 0..100 { + ids.push(pool_clone.next_connection_id()); + } + ids + })); + } + + // Collect all IDs + let mut all_ids: Vec = handles + .into_iter() + .flat_map(|h| h.join().unwrap()) + .collect(); + + // Sort and verify uniqueness + all_ids.sort(); + let unique_count = all_ids.windows(2).filter(|w| w[0] != w[1]).count() + 1; + assert_eq!(unique_count, all_ids.len(), "All IDs should be unique"); + } + + // ============================================ + // extract_task_id tests + // ============================================ + + #[test] + fn test_extract_task_id_from_execute_request() { + let request = PoolRequest::Execute(Box::new(ExecuteRequest { + task_id: "execute-task-123".to_string(), + plugin_id: "test-plugin".to_string(), + compiled_code: None, + plugin_path: None, + params: serde_json::json!({}), + headers: None, + socket_path: "/tmp/test.sock".to_string(), + http_request_id: None, + timeout: Some(30000), + route: None, + config: None, + method: None, + query: None, + })); + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "execute-task-123"); + } + + #[test] + fn test_extract_task_id_from_precompile_request() { + let request = PoolRequest::Precompile { + task_id: "precompile-task-456".to_string(), + plugin_id: "test-plugin".to_string(), + plugin_path: Some("/path/to/plugin.ts".to_string()), + source_code: None, + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "precompile-task-456"); + } + + #[test] + fn test_extract_task_id_from_cache_request() { + let request = PoolRequest::Cache { + task_id: "cache-task-789".to_string(), + plugin_id: "test-plugin".to_string(), + compiled_code: "compiled code".to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "cache-task-789"); + } + + #[test] + fn test_extract_task_id_from_invalidate_request() { + let request = PoolRequest::Invalidate { + task_id: "invalidate-task-abc".to_string(), + plugin_id: "test-plugin".to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "invalidate-task-abc"); + } + + #[test] + fn test_extract_task_id_from_stats_request() { + let request = PoolRequest::Stats { + task_id: "stats-task-def".to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "stats-task-def"); + } + + #[test] + fn test_extract_task_id_from_health_request() { + let request = PoolRequest::Health { + task_id: "health-task-ghi".to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "health-task-ghi"); + } + + #[test] + fn test_extract_task_id_from_shutdown_request() { + let request = PoolRequest::Shutdown { + task_id: "shutdown-task-jkl".to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "shutdown-task-jkl"); + } + + #[test] + fn test_extract_task_id_preserves_special_characters() { + let request = PoolRequest::Stats { + task_id: "task-with-special_chars.and/slashes:colons".to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, "task-with-special_chars.and/slashes:colons"); + } + + #[test] + fn test_extract_task_id_handles_empty_string() { + let request = PoolRequest::Health { + task_id: "".to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, ""); + } + + #[test] + fn test_extract_task_id_handles_uuid_format() { + let uuid = "550e8400-e29b-41d4-a716-446655440000"; + let request = PoolRequest::Stats { + task_id: uuid.to_string(), + }; + + let task_id = PoolConnection::extract_task_id(&request); + assert_eq!(task_id, uuid); + } + + // ============================================ + // acquire_with_permit tests + // ============================================ + + #[tokio::test] + async fn test_acquire_without_server_fails() { + let pool = ConnectionPool::new("/tmp/nonexistent_socket_12345.sock".to_string(), 10); + + let result = pool.acquire().await; + assert!(result.is_err()); + + match result { + Err(PluginError::SocketError(msg)) => { + assert!(msg.contains("Failed to connect")); + } + _ => panic!("Expected SocketError"), + } + } + + #[tokio::test] + async fn test_acquire_with_pre_acquired_permit() { + let pool = ConnectionPool::new("/tmp/nonexistent_socket_67890.sock".to_string(), 10); + + // Pre-acquire a permit + let permit = pool.semaphore.clone().acquire_owned().await.unwrap(); + assert_eq!(pool.semaphore.available_permits(), 9); + + // Try to acquire with pre-acquired permit (will fail due to no server, but permit logic works) + let result = pool.acquire_with_permit(Some(permit)).await; + + // Connection fails but permit was used + assert!(result.is_err()); + } + + // ============================================ + // PooledConnection tests + // ============================================ + + #[test] + fn test_pooled_connection_cannot_be_used_after_release() { + // This tests the Option pattern - we can't easily + // test this without a live connection, but we document the behavior + // that send_request_with_timeout returns error when conn is None + } + + // ============================================ + // Error message tests + // ============================================ + + #[tokio::test] + async fn test_acquire_error_message_contains_helpful_info() { + let pool = ConnectionPool::new("/tmp/no_server_here_xyz.sock".to_string(), 10); + + let result = pool.acquire().await; + assert!(result.is_err()); + + if let Err(PluginError::SocketError(msg)) = result { + // Verify error message contains helpful suggestions + assert!( + msg.contains("PLUGIN_POOL_CONNECT_RETRIES") + || msg.contains("PLUGIN_POOL_MAX_CONNECTIONS") + || msg.contains("Failed to connect"), + "Error message should contain helpful info: {}", + msg + ); + } + } + + // ============================================ + // Multiple pool instances tests + // ============================================ + + #[test] + fn test_multiple_pools_independent() { + let pool1 = ConnectionPool::new("/tmp/pool1.sock".to_string(), 5); + let pool2 = ConnectionPool::new("/tmp/pool2.sock".to_string(), 10); + + // Each pool has its own semaphore + assert_eq!(pool1.semaphore.available_permits(), 5); + assert_eq!(pool2.semaphore.available_permits(), 10); + + // Each pool has its own connection ID counter + assert_eq!(pool1.next_connection_id(), 0); + assert_eq!(pool2.next_connection_id(), 0); + assert_eq!(pool1.next_connection_id(), 1); + assert_eq!(pool2.next_connection_id(), 1); + } + + // ============================================ + // Concurrent access tests + // ============================================ + + #[tokio::test] + async fn test_concurrent_semaphore_acquire() { + let pool = Arc::new(ConnectionPool::new("/tmp/concurrent.sock".to_string(), 3)); + + let mut handles = vec![]; + + // Spawn tasks that try to acquire permits + for i in 0..3 { + let pool_clone = pool.clone(); + handles.push(tokio::spawn(async move { + let permit = pool_clone.semaphore.clone().acquire_owned().await; + assert!(permit.is_ok(), "Task {} should acquire permit", i); + // Hold permit briefly + tokio::time::sleep(Duration::from_millis(10)).await; + })); + } + + // All tasks should complete successfully + for handle in handles { + handle.await.unwrap(); + } + + // All permits should be released + assert_eq!(pool.semaphore.available_permits(), 3); + } + + #[tokio::test] + async fn test_semaphore_fairness() { + use std::sync::atomic::AtomicU32; + + let pool = Arc::new(ConnectionPool::new("/tmp/fairness.sock".to_string(), 1)); + let counter = Arc::new(AtomicU32::new(0)); + + // Acquire the only permit + let permit = pool.semaphore.clone().acquire_owned().await.unwrap(); + + let mut handles = vec![]; + + // Spawn waiting tasks + for _ in 0..3 { + let pool_clone = pool.clone(); + let counter_clone = counter.clone(); + handles.push(tokio::spawn(async move { + let _permit = pool_clone.semaphore.clone().acquire_owned().await.unwrap(); + counter_clone.fetch_add(1, Ordering::SeqCst); + })); + } + + // Give tasks time to start waiting + tokio::time::sleep(Duration::from_millis(50)).await; + + // No task should have completed yet + assert_eq!(counter.load(Ordering::SeqCst), 0); + + // Release the permit + drop(permit); + + // Wait for all tasks + for handle in handles { + handle.await.unwrap(); + } + + // All tasks should have completed + assert_eq!(counter.load(Ordering::SeqCst), 3); + } + + // ============================================ + // Edge cases + // ============================================ + + #[test] + fn test_zero_max_connections_creates_closed_semaphore() { + let pool = ConnectionPool::new("/tmp/zero.sock".to_string(), 0); + assert_eq!(pool.semaphore.available_permits(), 0); + + // Can't acquire any permits + let permit = pool.semaphore.clone().try_acquire_owned(); + assert!(permit.is_err()); + } + + #[test] + fn test_socket_path_with_spaces() { + let path = "/tmp/path with spaces/test.sock"; + let pool = ConnectionPool::new(path.to_string(), 5); + assert_eq!(pool.socket_path, path); + } + + #[test] + fn test_socket_path_with_unicode() { + let path = "/tmp/ั‚ะตัั‚/ๅฅ—ๆŽฅๅญ—.sock"; + let pool = ConnectionPool::new(path.to_string(), 5); + assert_eq!(pool.socket_path, path); + } + + #[test] + fn test_very_long_socket_path() { + let path = format!("/tmp/{}/test.sock", "a".repeat(200)); + let pool = ConnectionPool::new(path.clone(), 5); + assert_eq!(pool.socket_path, path); + } } diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index 9504463de..02c5dd4b2 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -1430,6 +1430,11 @@ pub fn get_pool_manager() -> Arc { #[cfg(test)] mod tests { use super::*; + use crate::services::plugins::script_executor::LogLevel; + + // ============================================ + // is_dead_server_error tests + // ============================================ #[test] fn test_is_dead_server_error_detects_dead_server() { @@ -1458,4 +1463,524 @@ mod tests { let err = PluginError::PluginExecutionError("Plugin returned invalid JSON".to_string()); assert!(!PoolManager::is_dead_server_error(&err)); } + + #[test] + fn test_is_dead_server_error_detects_all_dead_server_indicators() { + // Test common DeadServerIndicator patterns + let dead_server_errors = vec![ + "EOF while parsing JSON response", + "Broken pipe when writing to socket", + "Connection refused: server not running", + "Connection reset by peer", + "Socket not connected", + "Failed to connect to pool server", + "Socket file missing: /tmp/test.sock", + "No such file or directory", + ]; + + for error_msg in dead_server_errors { + let err = PluginError::PluginExecutionError(error_msg.to_string()); + assert!( + PoolManager::is_dead_server_error(&err), + "Expected '{}' to be detected as dead server error", + error_msg + ); + } + } + + #[test] + fn test_dead_server_indicator_patterns() { + // Test the DeadServerIndicator pattern matching directly + use super::super::health::DeadServerIndicator; + + // These should all match + assert!(DeadServerIndicator::from_error_str("eof while parsing").is_some()); + assert!(DeadServerIndicator::from_error_str("broken pipe").is_some()); + assert!(DeadServerIndicator::from_error_str("connection refused").is_some()); + assert!(DeadServerIndicator::from_error_str("connection reset").is_some()); + assert!(DeadServerIndicator::from_error_str("not connected").is_some()); + assert!(DeadServerIndicator::from_error_str("failed to connect").is_some()); + assert!(DeadServerIndicator::from_error_str("socket file missing").is_some()); + assert!(DeadServerIndicator::from_error_str("no such file").is_some()); + assert!(DeadServerIndicator::from_error_str("connection timed out").is_some()); + assert!(DeadServerIndicator::from_error_str("connect timed out").is_some()); + + // These should NOT match + assert!(DeadServerIndicator::from_error_str("handler timed out").is_none()); + assert!(DeadServerIndicator::from_error_str("validation error").is_none()); + assert!(DeadServerIndicator::from_error_str("TypeError: undefined").is_none()); + } + + #[test] + fn test_is_dead_server_error_excludes_plugin_timeouts_with_connection() { + // Plugin timeout should NOT be detected even if it mentions connection + let plugin_timeout = + PluginError::PluginExecutionError("plugin connection timed out".to_string()); + // This contains both "plugin" and "timed out" so it's excluded + assert!(!PoolManager::is_dead_server_error(&plugin_timeout)); + } + + #[test] + fn test_is_dead_server_error_case_insensitive() { + // Test case insensitivity + let err = PluginError::PluginExecutionError("CONNECTION REFUSED".to_string()); + assert!(PoolManager::is_dead_server_error(&err)); + + let err = PluginError::PluginExecutionError("BROKEN PIPE".to_string()); + assert!(PoolManager::is_dead_server_error(&err)); + + let err = PluginError::PluginExecutionError("Connection Reset By Peer".to_string()); + assert!(PoolManager::is_dead_server_error(&err)); + } + + #[test] + fn test_is_dead_server_error_handler_timeout_variations() { + // All variations of plugin/handler timeouts should NOT trigger restart + let timeout_errors = vec![ + "Handler timed out", + "handler timed out after 30000ms", + "Plugin handler timed out", + "plugin timed out", + "Plugin execution timed out after 60s", + ]; + + for error_msg in timeout_errors { + let err = PluginError::PluginExecutionError(error_msg.to_string()); + assert!( + !PoolManager::is_dead_server_error(&err), + "Expected '{}' to NOT be detected as dead server error", + error_msg + ); + } + } + + #[test] + fn test_is_dead_server_error_business_errors_not_detected() { + // Business logic errors should not trigger restart + let business_errors = vec![ + "ReferenceError: x is not defined", + "SyntaxError: Unexpected token", + "TypeError: Cannot read property 'foo' of undefined", + "Plugin returned status 400: Bad Request", + "Validation error: missing required field", + "Authorization failed", + "Rate limit exceeded", + "Plugin threw an error: Invalid input", + ]; + + for error_msg in business_errors { + let err = PluginError::PluginExecutionError(error_msg.to_string()); + assert!( + !PoolManager::is_dead_server_error(&err), + "Expected '{}' to NOT be detected as dead server error", + error_msg + ); + } + } + + #[test] + fn test_is_dead_server_error_with_handler_error_type() { + // HandlerError type should also be checked + let handler_payload = PluginHandlerPayload { + message: "Connection refused".to_string(), + status: 500, + code: None, + details: None, + logs: None, + traces: None, + }; + let err = PluginError::HandlerError(Box::new(handler_payload)); + // The error message contains "Connection refused" but it's wrapped differently + // This tests that we check the string representation + assert!(PoolManager::is_dead_server_error(&err)); + } + + // ============================================ + // Heap calculation tests + // ============================================ + + #[test] + fn test_heap_calculation_base_case() { + // With default concurrency, should get base heap + let base = PoolManager::BASE_HEAP_MB; + let divisor = PoolManager::CONCURRENCY_DIVISOR; + let increment = PoolManager::HEAP_INCREMENT_PER_DIVISOR_MB; + + // For 100 concurrent requests: + // 512 + (100 / 10) * 32 = 512 + 320 = 832 MB + let concurrency = 100; + let expected = base + ((concurrency / divisor) * increment); + assert_eq!(expected, 832); + } + + #[test] + fn test_heap_calculation_minimum() { + // With very low concurrency, should still get base heap + let base = PoolManager::BASE_HEAP_MB; + let divisor = PoolManager::CONCURRENCY_DIVISOR; + let increment = PoolManager::HEAP_INCREMENT_PER_DIVISOR_MB; + + // For 5 concurrent requests: + // 512 + (5 / 10) * 32 = 512 + 0 = 512 MB (integer division) + let concurrency = 5; + let expected = base + ((concurrency / divisor) * increment); + assert_eq!(expected, 512); + } + + #[test] + fn test_heap_calculation_high_concurrency() { + // With high concurrency, should scale appropriately + let base = PoolManager::BASE_HEAP_MB; + let divisor = PoolManager::CONCURRENCY_DIVISOR; + let increment = PoolManager::HEAP_INCREMENT_PER_DIVISOR_MB; + + // For 500 concurrent requests: + // 512 + (500 / 10) * 32 = 512 + 1600 = 2112 MB + let concurrency = 500; + let expected = base + ((concurrency / divisor) * increment); + assert_eq!(expected, 2112); + } + + #[test] + fn test_heap_calculation_max_cap() { + // Verify max heap cap is respected + let max_heap = PoolManager::MAX_HEAP_MB; + assert_eq!(max_heap, 8192); + + // For extreme concurrency that would exceed cap: + // e.g., 3000 concurrent: 512 + (3000 / 10) * 32 = 512 + 9600 = 10112 MB + // Should be capped to 8192 MB + let base = PoolManager::BASE_HEAP_MB; + let divisor = PoolManager::CONCURRENCY_DIVISOR; + let increment = PoolManager::HEAP_INCREMENT_PER_DIVISOR_MB; + + let concurrency = 3000; + let calculated = base + ((concurrency / divisor) * increment); + let capped = calculated.min(max_heap); + + assert_eq!(calculated, 10112); + assert_eq!(capped, 8192); + } + + // ============================================ + // Constants verification tests + // ============================================ + + #[test] + fn test_pool_manager_constants() { + // Verify important constants have reasonable values + assert_eq!(PoolManager::BASE_HEAP_MB, 512); + assert_eq!(PoolManager::CONCURRENCY_DIVISOR, 10); + assert_eq!(PoolManager::HEAP_INCREMENT_PER_DIVISOR_MB, 32); + assert_eq!(PoolManager::MAX_HEAP_MB, 8192); + } + + // ============================================ + // PoolManager creation tests + // ============================================ + + #[tokio::test] + async fn test_pool_manager_new_creates_unique_socket_path() { + // Two PoolManagers should have different socket paths + let manager1 = PoolManager::new(); + let manager2 = PoolManager::new(); + + assert_ne!(manager1.socket_path, manager2.socket_path); + assert!(manager1 + .socket_path + .starts_with("/tmp/relayer-plugin-pool-")); + assert!(manager2 + .socket_path + .starts_with("/tmp/relayer-plugin-pool-")); + } + + #[tokio::test] + async fn test_pool_manager_with_custom_socket_path() { + let custom_path = "/tmp/custom-test-pool.sock".to_string(); + let manager = PoolManager::with_socket_path(custom_path.clone()); + + assert_eq!(manager.socket_path, custom_path); + } + + #[tokio::test] + async fn test_pool_manager_default_trait() { + // Verify Default trait creates a valid manager + let manager = PoolManager::default(); + assert!(manager.socket_path.starts_with("/tmp/relayer-plugin-pool-")); + } + + // ============================================ + // Circuit breaker state tests + // ============================================ + + #[tokio::test] + async fn test_circuit_state_initial() { + let manager = PoolManager::new(); + + // Initial state should be Closed + assert_eq!(manager.circuit_state(), CircuitState::Closed); + } + + #[tokio::test] + async fn test_avg_response_time_initial() { + let manager = PoolManager::new(); + + // Initial response time should be 0 + assert_eq!(manager.avg_response_time_ms(), 0); + } + + // ============================================ + // Recovery mode tests + // ============================================ + + #[tokio::test] + async fn test_recovery_mode_initial() { + let manager = PoolManager::new(); + + // Should not be in recovery mode initially + assert!(!manager.is_recovering()); + assert_eq!(manager.recovery_allowance_percent(), 0); + } + + // ============================================ + // ScriptResult construction tests + // ============================================ + + #[test] + fn test_script_result_success_construction() { + let result = ScriptResult { + logs: vec![LogEntry { + level: LogLevel::Info, + message: "Test log".to_string(), + }], + error: String::new(), + return_value: r#"{"success": true}"#.to_string(), + trace: vec![], + }; + + assert!(result.error.is_empty()); + assert_eq!(result.logs.len(), 1); + assert_eq!(result.logs[0].level, LogLevel::Info); + } + + #[test] + fn test_script_result_with_multiple_logs() { + let result = ScriptResult { + logs: vec![ + LogEntry { + level: LogLevel::Log, + message: "Starting execution".to_string(), + }, + LogEntry { + level: LogLevel::Debug, + message: "Processing data".to_string(), + }, + LogEntry { + level: LogLevel::Warn, + message: "Deprecated API used".to_string(), + }, + LogEntry { + level: LogLevel::Error, + message: "Non-fatal error".to_string(), + }, + ], + error: String::new(), + return_value: "done".to_string(), + trace: vec![], + }; + + assert_eq!(result.logs.len(), 4); + assert_eq!(result.logs[0].level, LogLevel::Log); + assert_eq!(result.logs[1].level, LogLevel::Debug); + assert_eq!(result.logs[2].level, LogLevel::Warn); + assert_eq!(result.logs[3].level, LogLevel::Error); + } + + // ============================================ + // QueuedRequest structure tests + // ============================================ + + #[test] + fn test_queued_request_required_fields() { + let (tx, _rx) = oneshot::channel(); + + let request = QueuedRequest { + plugin_id: "test-plugin".to_string(), + compiled_code: Some("module.exports.handler = () => {}".to_string()), + plugin_path: None, + params: serde_json::json!({"key": "value"}), + headers: None, + socket_path: "/tmp/test.sock".to_string(), + http_request_id: Some("req-123".to_string()), + timeout_secs: Some(30), + route: Some("/api/test".to_string()), + config: Some(serde_json::json!({"setting": true})), + method: Some("POST".to_string()), + query: Some(serde_json::json!({"page": "1"})), + response_tx: tx, + }; + + assert_eq!(request.plugin_id, "test-plugin"); + assert!(request.compiled_code.is_some()); + assert!(request.plugin_path.is_none()); + assert_eq!(request.timeout_secs, Some(30)); + } + + #[test] + fn test_queued_request_minimal() { + let (tx, _rx) = oneshot::channel(); + + let request = QueuedRequest { + plugin_id: "minimal".to_string(), + compiled_code: None, + plugin_path: Some("/path/to/plugin.ts".to_string()), + params: serde_json::json!(null), + headers: None, + socket_path: "/tmp/min.sock".to_string(), + http_request_id: None, + timeout_secs: None, + route: None, + config: None, + method: None, + query: None, + response_tx: tx, + }; + + assert_eq!(request.plugin_id, "minimal"); + assert!(request.compiled_code.is_none()); + assert!(request.plugin_path.is_some()); + } + + // ============================================ + // Error type tests + // ============================================ + + #[test] + fn test_plugin_error_socket_error() { + let err = PluginError::SocketError("Connection failed".to_string()); + let display = format!("{}", err); + assert!(display.contains("Socket error")); + assert!(display.contains("Connection failed")); + } + + #[test] + fn test_plugin_error_plugin_execution_error() { + let err = PluginError::PluginExecutionError("Execution failed".to_string()); + let display = format!("{}", err); + assert!(display.contains("Execution failed")); + } + + #[test] + fn test_plugin_error_handler_error() { + let payload = PluginHandlerPayload { + message: "Handler error".to_string(), + status: 400, + code: Some("BAD_REQUEST".to_string()), + details: Some(serde_json::json!({"field": "name"})), + logs: None, + traces: None, + }; + let err = PluginError::HandlerError(Box::new(payload)); + + // Check that it can be displayed + let display = format!("{:?}", err); + assert!(display.contains("HandlerError")); + } + + // ============================================ + // Handler payload tests + // ============================================ + + #[test] + fn test_plugin_handler_payload_full() { + let payload = PluginHandlerPayload { + message: "Validation failed".to_string(), + status: 422, + code: Some("VALIDATION_ERROR".to_string()), + details: Some(serde_json::json!({ + "errors": [ + {"field": "email", "message": "Invalid format"} + ] + })), + logs: Some(vec![LogEntry { + level: LogLevel::Error, + message: "Validation failed for email".to_string(), + }]), + traces: Some(vec![serde_json::json!({"stack": "Error at line 10"})]), + }; + + assert_eq!(payload.status, 422); + assert_eq!(payload.code, Some("VALIDATION_ERROR".to_string())); + assert!(payload.logs.is_some()); + assert!(payload.traces.is_some()); + } + + #[test] + fn test_plugin_handler_payload_minimal() { + let payload = PluginHandlerPayload { + message: "Error".to_string(), + status: 500, + code: None, + details: None, + logs: None, + traces: None, + }; + + assert_eq!(payload.status, 500); + assert!(payload.code.is_none()); + assert!(payload.details.is_none()); + } + + // ============================================ + // Async tests (tokio runtime) + // ============================================ + + #[tokio::test] + async fn test_pool_manager_not_initialized_health_check() { + let manager = PoolManager::with_socket_path("/tmp/test-health.sock".to_string()); + + // Health check on uninitialized manager should return not_initialized + let health = manager.health_check().await.unwrap(); + + assert!(!health.healthy); + assert_eq!(health.status, "not_initialized"); + assert!(health.uptime_ms.is_none()); + assert!(health.memory.is_none()); + } + + #[tokio::test] + async fn test_pool_manager_circuit_info_in_health_status() { + let manager = PoolManager::with_socket_path("/tmp/test-circuit.sock".to_string()); + + let health = manager.health_check().await.unwrap(); + + // Circuit state info should be present even when not initialized + assert!(health.circuit_state.is_some()); + assert_eq!(health.circuit_state, Some("closed".to_string())); + assert!(health.avg_response_time_ms.is_some()); + assert!(health.recovering.is_some()); + assert!(health.recovery_percent.is_some()); + } + + #[tokio::test] + async fn test_invalidate_plugin_when_not_initialized() { + let manager = PoolManager::with_socket_path("/tmp/test-invalidate.sock".to_string()); + + // Invalidating when not initialized should be a no-op + let result = manager.invalidate_plugin("test-plugin".to_string()).await; + + // Should succeed (no-op) + assert!(result.is_ok()); + } + + #[tokio::test] + async fn test_shutdown_when_not_initialized() { + let manager = PoolManager::with_socket_path("/tmp/test-shutdown.sock".to_string()); + + // Shutdown when not initialized should be a no-op + let result = manager.shutdown().await; + + // Should succeed (no-op) + assert!(result.is_ok()); + } } From 8ec6710195572ddb2dbad78bba32ef241f9fd7a3 Mon Sep 17 00:00:00 2001 From: Zeljko Date: Fri, 23 Jan 2026 12:07:30 +0100 Subject: [PATCH 40/42] chore: Remove stack trace from response --- plugins/lib/pool-executor.ts | 14 +------------- plugins/lib/pool-server.ts | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/plugins/lib/pool-executor.ts b/plugins/lib/pool-executor.ts index fefb27016..5a78d6efc 100644 --- a/plugins/lib/pool-executor.ts +++ b/plugins/lib/pool-executor.ts @@ -849,7 +849,6 @@ export default async function executePlugin(task: ExecutorTask): Promise Date: Fri, 23 Jan 2026 12:33:53 +0100 Subject: [PATCH 41/42] chore: Unit test improvements --- src/services/plugins/pool_executor.rs | 648 +++++++++++++++++++++++--- 1 file changed, 579 insertions(+), 69 deletions(-) diff --git a/src/services/plugins/pool_executor.rs b/src/services/plugins/pool_executor.rs index 02c5dd4b2..ffb5ff33e 100644 --- a/src/services/plugins/pool_executor.rs +++ b/src/services/plugins/pool_executor.rs @@ -41,6 +41,20 @@ struct QueuedRequest { response_tx: oneshot::Sender>, } +/// Parsed health check result fields extracted from pool server JSON response. +/// +/// This struct replaces a complex tuple return type to satisfy Clippy's +/// `type_complexity` lint and improve readability. +#[derive(Debug, Default, PartialEq)] +pub struct ParsedHealthResult { + pub status: String, + pub uptime_ms: Option, + pub memory: Option, + pub pool_completed: Option, + pub pool_queued: Option, + pub success_rate: Option, +} + /// Manages the pool server process and connections pub struct PoolManager { socket_path: String, @@ -95,6 +109,120 @@ impl PoolManager { /// Set to 8GB (8192 MB) as a reasonable upper bound for Node.js processes. const MAX_HEAP_MB: usize = 8192; + /// Calculate heap size based on concurrency level. + /// + /// Formula: BASE_HEAP_MB + ((max_concurrency / CONCURRENCY_DIVISOR) * HEAP_INCREMENT_PER_DIVISOR_MB) + /// Result is capped at MAX_HEAP_MB. + /// + /// This scales memory allocation with expected load while maintaining a reasonable minimum. + pub fn calculate_heap_size(max_concurrency: usize) -> usize { + let calculated = Self::BASE_HEAP_MB + + ((max_concurrency / Self::CONCURRENCY_DIVISOR) * Self::HEAP_INCREMENT_PER_DIVISOR_MB); + calculated.min(Self::MAX_HEAP_MB) + } + + /// Format a result value from the pool response into a string. + /// + /// If the value is already a string, returns it directly. + /// Otherwise, serializes it to JSON. + pub fn format_return_value(value: Option) -> String { + value + .map(|v| { + if v.is_string() { + v.as_str().unwrap_or("").to_string() + } else { + serde_json::to_string(&v).unwrap_or_default() + } + }) + .unwrap_or_default() + } + + /// Parse a successful pool response into a ScriptResult. + /// + /// Converts logs from PoolLogEntry to LogEntry and extracts the return value. + pub fn parse_success_response(response: PoolResponse) -> ScriptResult { + let logs: Vec = response + .logs + .map(|logs| logs.into_iter().map(|l| l.into()).collect()) + .unwrap_or_default(); + + ScriptResult { + logs, + error: String::new(), + return_value: Self::format_return_value(response.result), + trace: Vec::new(), + } + } + + /// Parse a failed pool response into a PluginError. + /// + /// Extracts error details and converts logs for inclusion in the error payload. + pub fn parse_error_response(response: PoolResponse) -> PluginError { + let logs: Vec = response + .logs + .map(|logs| logs.into_iter().map(|l| l.into()).collect()) + .unwrap_or_default(); + + let error = response.error.unwrap_or(PoolError { + message: "Unknown error".to_string(), + code: None, + status: None, + details: None, + }); + + PluginError::HandlerError(Box::new(PluginHandlerPayload { + message: error.message, + status: error.status.unwrap_or(500), + code: error.code, + details: error.details, + logs: Some(logs), + traces: None, + })) + } + + /// Parse a pool response into either a success result or an error. + /// + /// This is the main entry point for response parsing, dispatching to + /// either parse_success_response or parse_error_response based on the success flag. + pub fn parse_pool_response(response: PoolResponse) -> Result { + if response.success { + Ok(Self::parse_success_response(response)) + } else { + Err(Self::parse_error_response(response)) + } + } + + /// Parse health check result JSON into individual fields. + /// + /// Extracts status, uptime, memory usage, pool stats, and success rate + /// from the nested JSON structure returned by the pool server. + pub fn parse_health_result(result: &serde_json::Value) -> ParsedHealthResult { + ParsedHealthResult { + status: result + .get("status") + .and_then(|v| v.as_str()) + .unwrap_or("unknown") + .to_string(), + uptime_ms: result.get("uptime").and_then(|v| v.as_u64()), + memory: result + .get("memory") + .and_then(|v| v.get("heapUsed")) + .and_then(|v| v.as_u64()), + pool_completed: result + .get("pool") + .and_then(|v| v.get("completed")) + .and_then(|v| v.as_u64()), + pool_queued: result + .get("pool") + .and_then(|v| v.get("queued")) + .and_then(|v| v.as_u64()), + success_rate: result + .get("execution") + .and_then(|v| v.get("successRate")) + .and_then(|v| v.as_f64()), + } + } + /// Create a new PoolManager with default socket path pub fn new() -> Self { Self::init(format!("/tmp/relayer-plugin-pool-{}.sock", Uuid::new_v4())) @@ -412,46 +540,8 @@ impl PoolManager { let timeout = timeout_secs.unwrap_or(get_config().pool_request_timeout_secs); let response = conn.send_request_with_timeout(&request, timeout).await?; - let logs: Vec = response - .logs - .map(|logs| logs.into_iter().map(|l| l.into()).collect()) - .unwrap_or_else(Vec::new); - - if response.success { - let return_value = response - .result - .map(|v| { - if v.is_string() { - v.as_str().unwrap_or("").to_string() - } else { - serde_json::to_string(&v).unwrap_or_default() - } - }) - .unwrap_or_default(); - - Ok(ScriptResult { - logs, - error: String::new(), - return_value, - trace: Vec::new(), - }) - } else { - let error = response.error.unwrap_or(PoolError { - message: "Unknown error".to_string(), - code: None, - status: None, - details: None, - }); - - Err(PluginError::HandlerError(Box::new(PluginHandlerPayload { - message: error.message, - status: error.status.unwrap_or(500), - code: error.code, - details: error.details, - logs: Some(logs), - traces: None, - }))) - } + // Use extracted parsing function for cleaner code and testability + Self::parse_pool_response(response) } /// Internal execution method (wrapper for execute_with_permit) @@ -626,16 +716,16 @@ impl PoolManager { let config = get_config(); - // Calculate heap size based on concurrency: base + (concurrency / divisor) * increment - // This scales memory allocation with expected load while maintaining a reasonable minimum - let calculated_heap = Self::BASE_HEAP_MB + // Use extracted function for heap calculation + let pool_server_heap_mb = Self::calculate_heap_size(config.max_concurrency); + + // Log warning if heap was capped (for observability) + let uncapped_heap = Self::BASE_HEAP_MB + ((config.max_concurrency / Self::CONCURRENCY_DIVISOR) * Self::HEAP_INCREMENT_PER_DIVISOR_MB); - let pool_server_heap_mb = calculated_heap.min(Self::MAX_HEAP_MB); - - if calculated_heap > Self::MAX_HEAP_MB { + if uncapped_heap > Self::MAX_HEAP_MB { tracing::warn!( - calculated_heap_mb = calculated_heap, + calculated_heap_mb = uncapped_heap, capped_heap_mb = pool_server_heap_mb, max_concurrency = config.max_concurrency, "Pool server heap calculation exceeded 8GB cap" @@ -1148,30 +1238,17 @@ impl PoolManager { Ok(response) => { if response.success { let result = response.result.unwrap_or_default(); + // Use extracted parsing function for testability + let parsed = Self::parse_health_result(&result); + Ok(HealthStatus { healthy: true, - status: result - .get("status") - .and_then(|v| v.as_str()) - .unwrap_or("unknown") - .to_string(), - uptime_ms: result.get("uptime").and_then(|v| v.as_u64()), - memory: result - .get("memory") - .and_then(|v| v.get("heapUsed")) - .and_then(|v| v.as_u64()), - pool_completed: result - .get("pool") - .and_then(|v| v.get("completed")) - .and_then(|v| v.as_u64()), - pool_queued: result - .get("pool") - .and_then(|v| v.get("queued")) - .and_then(|v| v.as_u64()), - success_rate: result - .get("execution") - .and_then(|v| v.get("successRate")) - .and_then(|v| v.as_f64()), + status: parsed.status, + uptime_ms: parsed.uptime_ms, + memory: parsed.memory, + pool_completed: parsed.pool_completed, + pool_queued: parsed.pool_queued, + success_rate: parsed.success_rate, circuit_state, avg_response_time_ms: avg_rt, recovering, @@ -1675,6 +1752,439 @@ mod tests { assert_eq!(PoolManager::MAX_HEAP_MB, 8192); } + // ============================================ + // Extracted function tests: calculate_heap_size + // ============================================ + + #[test] + fn test_calculate_heap_size_low_concurrency() { + // Low concurrency should give base heap + assert_eq!(PoolManager::calculate_heap_size(5), 512); + assert_eq!(PoolManager::calculate_heap_size(9), 512); + } + + #[test] + fn test_calculate_heap_size_medium_concurrency() { + // 10 concurrent: 512 + (10/10)*32 = 544 + assert_eq!(PoolManager::calculate_heap_size(10), 544); + // 50 concurrent: 512 + (50/10)*32 = 672 + assert_eq!(PoolManager::calculate_heap_size(50), 672); + // 100 concurrent: 512 + (100/10)*32 = 832 + assert_eq!(PoolManager::calculate_heap_size(100), 832); + } + + #[test] + fn test_calculate_heap_size_high_concurrency() { + // 500 concurrent: 512 + (500/10)*32 = 2112 + assert_eq!(PoolManager::calculate_heap_size(500), 2112); + // 1000 concurrent: 512 + (1000/10)*32 = 3712 + assert_eq!(PoolManager::calculate_heap_size(1000), 3712); + } + + #[test] + fn test_calculate_heap_size_capped_at_max() { + // 3000 concurrent would be 10112, but capped at 8192 + assert_eq!(PoolManager::calculate_heap_size(3000), 8192); + // Even higher should still be capped + assert_eq!(PoolManager::calculate_heap_size(10000), 8192); + } + + #[test] + fn test_calculate_heap_size_zero_concurrency() { + // Zero concurrency gives base heap + assert_eq!(PoolManager::calculate_heap_size(0), 512); + } + + // ============================================ + // Extracted function tests: format_return_value + // ============================================ + + #[test] + fn test_format_return_value_none() { + assert_eq!(PoolManager::format_return_value(None), ""); + } + + #[test] + fn test_format_return_value_string() { + let value = Some(serde_json::json!("hello world")); + assert_eq!(PoolManager::format_return_value(value), "hello world"); + } + + #[test] + fn test_format_return_value_empty_string() { + let value = Some(serde_json::json!("")); + assert_eq!(PoolManager::format_return_value(value), ""); + } + + #[test] + fn test_format_return_value_object() { + let value = Some(serde_json::json!({"key": "value", "num": 42})); + let result = PoolManager::format_return_value(value); + // JSON object gets serialized + assert!(result.contains("key")); + assert!(result.contains("value")); + assert!(result.contains("42")); + } + + #[test] + fn test_format_return_value_array() { + let value = Some(serde_json::json!([1, 2, 3])); + assert_eq!(PoolManager::format_return_value(value), "[1,2,3]"); + } + + #[test] + fn test_format_return_value_number() { + let value = Some(serde_json::json!(42)); + assert_eq!(PoolManager::format_return_value(value), "42"); + } + + #[test] + fn test_format_return_value_boolean() { + assert_eq!( + PoolManager::format_return_value(Some(serde_json::json!(true))), + "true" + ); + assert_eq!( + PoolManager::format_return_value(Some(serde_json::json!(false))), + "false" + ); + } + + #[test] + fn test_format_return_value_null() { + let value = Some(serde_json::json!(null)); + assert_eq!(PoolManager::format_return_value(value), "null"); + } + + // ============================================ + // Extracted function tests: parse_pool_response + // ============================================ + + #[test] + fn test_parse_pool_response_success_with_string_result() { + use super::super::protocol::{PoolLogEntry, PoolResponse}; + + let response = PoolResponse { + task_id: "test-123".to_string(), + success: true, + result: Some(serde_json::json!("success result")), + error: None, + logs: Some(vec![PoolLogEntry { + level: "info".to_string(), + message: "test log".to_string(), + }]), + }; + + let result = PoolManager::parse_pool_response(response).unwrap(); + assert_eq!(result.return_value, "success result"); + assert!(result.error.is_empty()); + assert_eq!(result.logs.len(), 1); + assert_eq!(result.logs[0].level, LogLevel::Info); + assert_eq!(result.logs[0].message, "test log"); + } + + #[test] + fn test_parse_pool_response_success_with_object_result() { + use super::super::protocol::PoolResponse; + + let response = PoolResponse { + task_id: "test-456".to_string(), + success: true, + result: Some(serde_json::json!({"data": "value"})), + error: None, + logs: None, + }; + + let result = PoolManager::parse_pool_response(response).unwrap(); + assert!(result.return_value.contains("data")); + assert!(result.return_value.contains("value")); + assert!(result.logs.is_empty()); + } + + #[test] + fn test_parse_pool_response_success_no_result() { + use super::super::protocol::PoolResponse; + + let response = PoolResponse { + task_id: "test-789".to_string(), + success: true, + result: None, + error: None, + logs: None, + }; + + let result = PoolManager::parse_pool_response(response).unwrap(); + assert_eq!(result.return_value, ""); + assert!(result.error.is_empty()); + } + + #[test] + fn test_parse_pool_response_failure_with_error() { + use super::super::protocol::{PoolError, PoolResponse}; + + let response = PoolResponse { + task_id: "test-error".to_string(), + success: false, + result: None, + error: Some(PoolError { + message: "Something went wrong".to_string(), + code: Some("ERR_001".to_string()), + status: Some(400), + details: Some(serde_json::json!({"field": "name"})), + }), + logs: None, + }; + + let err = PoolManager::parse_pool_response(response).unwrap_err(); + match err { + PluginError::HandlerError(payload) => { + assert_eq!(payload.message, "Something went wrong"); + assert_eq!(payload.status, 400); + assert_eq!(payload.code, Some("ERR_001".to_string())); + } + _ => panic!("Expected HandlerError"), + } + } + + #[test] + fn test_parse_pool_response_failure_no_error_details() { + use super::super::protocol::PoolResponse; + + let response = PoolResponse { + task_id: "test-unknown".to_string(), + success: false, + result: None, + error: None, + logs: None, + }; + + let err = PoolManager::parse_pool_response(response).unwrap_err(); + match err { + PluginError::HandlerError(payload) => { + assert_eq!(payload.message, "Unknown error"); + assert_eq!(payload.status, 500); + } + _ => panic!("Expected HandlerError"), + } + } + + #[test] + fn test_parse_pool_response_failure_preserves_logs() { + use super::super::protocol::{PoolError, PoolLogEntry, PoolResponse}; + + let response = PoolResponse { + task_id: "test-logs".to_string(), + success: false, + result: None, + error: Some(PoolError { + message: "Error with logs".to_string(), + code: None, + status: None, + details: None, + }), + logs: Some(vec![ + PoolLogEntry { + level: "debug".to_string(), + message: "debug message".to_string(), + }, + PoolLogEntry { + level: "error".to_string(), + message: "error message".to_string(), + }, + ]), + }; + + let err = PoolManager::parse_pool_response(response).unwrap_err(); + match err { + PluginError::HandlerError(payload) => { + let logs = payload.logs.unwrap(); + assert_eq!(logs.len(), 2); + assert_eq!(logs[0].level, LogLevel::Debug); + assert_eq!(logs[1].level, LogLevel::Error); + } + _ => panic!("Expected HandlerError"), + } + } + + // ============================================ + // Extracted function tests: parse_success_response + // ============================================ + + #[test] + fn test_parse_success_response_complete() { + use super::super::protocol::{PoolLogEntry, PoolResponse}; + + let response = PoolResponse { + task_id: "task-1".to_string(), + success: true, + result: Some(serde_json::json!("completed")), + error: None, + logs: Some(vec![ + PoolLogEntry { + level: "log".to_string(), + message: "starting".to_string(), + }, + PoolLogEntry { + level: "result".to_string(), + message: "finished".to_string(), + }, + ]), + }; + + let result = PoolManager::parse_success_response(response); + assert_eq!(result.return_value, "completed"); + assert!(result.error.is_empty()); + assert_eq!(result.logs.len(), 2); + assert_eq!(result.logs[0].level, LogLevel::Log); + assert_eq!(result.logs[1].level, LogLevel::Result); + } + + // ============================================ + // Extracted function tests: parse_error_response + // ============================================ + + #[test] + fn test_parse_error_response_with_all_fields() { + use super::super::protocol::{PoolError, PoolLogEntry, PoolResponse}; + + let response = PoolResponse { + task_id: "err-task".to_string(), + success: false, + result: None, + error: Some(PoolError { + message: "Validation failed".to_string(), + code: Some("VALIDATION_ERROR".to_string()), + status: Some(422), + details: Some(serde_json::json!({"fields": ["email"]})), + }), + logs: Some(vec![PoolLogEntry { + level: "warn".to_string(), + message: "validation warning".to_string(), + }]), + }; + + let err = PoolManager::parse_error_response(response); + match err { + PluginError::HandlerError(payload) => { + assert_eq!(payload.message, "Validation failed"); + assert_eq!(payload.status, 422); + assert_eq!(payload.code, Some("VALIDATION_ERROR".to_string())); + assert!(payload.details.is_some()); + let logs = payload.logs.unwrap(); + assert_eq!(logs.len(), 1); + assert_eq!(logs[0].level, LogLevel::Warn); + } + _ => panic!("Expected HandlerError"), + } + } + + // ============================================ + // Extracted function tests: parse_health_result + // ============================================ + + #[test] + fn test_parse_health_result_complete() { + let json = serde_json::json!({ + "status": "healthy", + "uptime": 123456, + "memory": { + "heapUsed": 50000000, + "heapTotal": 100000000 + }, + "pool": { + "completed": 1000, + "queued": 5 + }, + "execution": { + "successRate": 0.99 + } + }); + + let result = PoolManager::parse_health_result(&json); + + assert_eq!(result.status, "healthy"); + assert_eq!(result.uptime_ms, Some(123456)); + assert_eq!(result.memory, Some(50000000)); + assert_eq!(result.pool_completed, Some(1000)); + assert_eq!(result.pool_queued, Some(5)); + assert!((result.success_rate.unwrap() - 0.99).abs() < 0.001); + } + + #[test] + fn test_parse_health_result_minimal() { + let json = serde_json::json!({}); + + let result = PoolManager::parse_health_result(&json); + + assert_eq!(result.status, "unknown"); + assert_eq!(result.uptime_ms, None); + assert_eq!(result.memory, None); + assert_eq!(result.pool_completed, None); + assert_eq!(result.pool_queued, None); + assert_eq!(result.success_rate, None); + } + + #[test] + fn test_parse_health_result_partial() { + let json = serde_json::json!({ + "status": "degraded", + "uptime": 5000, + "memory": { + "heapTotal": 100000000 + // heapUsed missing + } + }); + + let result = PoolManager::parse_health_result(&json); + + assert_eq!(result.status, "degraded"); + assert_eq!(result.uptime_ms, Some(5000)); + assert_eq!(result.memory, None); // heapUsed was missing + assert_eq!(result.pool_completed, None); + assert_eq!(result.pool_queued, None); + assert_eq!(result.success_rate, None); + } + + #[test] + fn test_parse_health_result_wrong_types() { + let json = serde_json::json!({ + "status": 123, // Should be string, will use "unknown" + "uptime": "not a number", // Should be u64, will be None + "memory": "invalid" // Should be object, will give None + }); + + let result = PoolManager::parse_health_result(&json); + + assert_eq!(result.status, "unknown"); // Falls back when not a string + assert_eq!(result.uptime_ms, None); + assert_eq!(result.memory, None); + assert_eq!(result.pool_completed, None); + assert_eq!(result.pool_queued, None); + assert_eq!(result.success_rate, None); + } + + #[test] + fn test_parse_health_result_nested_values() { + let json = serde_json::json!({ + "pool": { + "completed": 0, + "queued": 0 + }, + "execution": { + "successRate": 1.0 + } + }); + + let result = PoolManager::parse_health_result(&json); + + assert_eq!(result.status, "unknown"); + assert_eq!(result.uptime_ms, None); + assert_eq!(result.memory, None); + assert_eq!(result.pool_completed, Some(0)); + assert_eq!(result.pool_queued, Some(0)); + assert!((result.success_rate.unwrap() - 1.0).abs() < 0.001); + } + // ============================================ // PoolManager creation tests // ============================================ From abaa2c9e5a02eed0e14548599f897b966defe7aa Mon Sep 17 00:00:00 2001 From: Zeljko Date: Fri, 23 Jan 2026 13:25:06 +0100 Subject: [PATCH 42/42] chore: Fix flaky test --- src/services/provider/retry.rs | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/services/provider/retry.rs b/src/services/provider/retry.rs index 014fbac43..a87ab9188 100644 --- a/src/services/provider/retry.rs +++ b/src/services/provider/retry.rs @@ -1278,9 +1278,17 @@ mod tests { let attempt_count = Arc::new(AtomicU8::new(0)); let attempt_count_clone = attempt_count.clone(); + // Track which URLs were attempted for verification + let attempted_urls = Arc::new(std::sync::Mutex::new(Vec::new())); + let attempted_urls_clone = attempted_urls.clone(); + + // Fail the FIRST initialization attempt regardless of which URL is selected. + // This makes the test deterministic - it doesn't depend on URL selection order. let provider_initializer = move |url: &str| -> Result { let count = attempt_count_clone.fetch_add(1, AtomicOrdering::SeqCst); - if count == 0 && url.contains("9988") { + attempted_urls_clone.lock().unwrap().push(url.to_string()); + if count == 0 { + // First attempt always fails, forcing failover to second provider Err(TestError("First provider init failed".to_string())) } else { Ok(url.to_string()) @@ -1304,7 +1312,23 @@ mod tests { assert!(result.is_ok()); assert_eq!(result.unwrap(), 42); - assert!(attempt_count.load(AtomicOrdering::SeqCst) >= 2); // Should have tried multiple providers + + // Verify: exactly 2 provider initialization attempts were made + let final_count = attempt_count.load(AtomicOrdering::SeqCst); + assert_eq!( + final_count, 2, + "Expected exactly 2 provider init attempts, got {}", + final_count + ); + + // Verify: two different URLs were attempted (failover occurred) + let urls = attempted_urls.lock().unwrap(); + assert_eq!(urls.len(), 2, "Expected 2 URLs attempted, got {:?}", urls); + assert_ne!( + urls[0], urls[1], + "Expected different URLs to be tried, got {:?}", + urls + ); } #[test]