diff --git a/CHANGELOG.md b/CHANGELOG.md index f32336c12c..d86f62b0b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# Web3API 0.0.1-prealpha.29 +## Feature +* Web3API Interfaces are now fully supported in the tool-chain. +* GraphQL schema comments are now retained, and will show up in the build folder. +* `@web3api/parse`: Reference types definitions are now differentiated from the root definitions the reference. + +## Bugs +* `@web3api/cli`: Fix MacOS specific issue w/ PATH not being retained. +* The `config` property in `web3api.build.yaml` is now optional. + # Web3API 0.0.1-prealpha.28 ## Bugs * Fixed API template project diff --git a/VERSION b/VERSION index c2db2c0cdb..63f77f7fd3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.1-prealpha.28 +0.0.1-prealpha.29 diff --git a/package.json b/package.json index 1b36126690..cded213ed9 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "scripts": { "reset": "yarn clean && yarn && yarn build", - "clean": "npx rimraf ./**/node_modules ./**/build ./**/coverage", + "clean": "npx rimraf ./**/node_modules ./**/build ./**/coverage ./**/.w3", "build": "lerna run build --no-private --ignore @web3api/cli* --ignore @web3api/react && lerna run build --scope @web3api/client-js --scope @web3api/react && lerna run build --scope @web3api/cli", "lint": "lerna run lint", "lint:fix": "lerna run lint -- --fix", diff --git a/packages/apis/console/README.md b/packages/apis/console/README.md index 3b2cca7259..5872533075 100644 --- a/packages/apis/console/README.md +++ b/packages/apis/console/README.md @@ -1,13 +1,13 @@ # Console Web3API -Calls log on logger plugin at uri `w3://w3/logger`. Default logger logs to console, but can be overridden with redirect to custom logger web3api implementation. +Calls log on logger plugin at uri `w3://ens/logger.core.web3api.eth`. Default logger logs to console, but can be overridden with redirect to custom logger web3api implementation. -### Log levels +### Log Methods -- DEBUG -- INFO -- WARN -- ERROR +- debug +- info +- warn +- error ## Example diff --git a/packages/apis/console/recipes/e2e.json b/packages/apis/console/recipes/e2e.json index d603cfacf5..86c0957d4b 100644 --- a/packages/apis/console/recipes/e2e.json +++ b/packages/apis/console/recipes/e2e.json @@ -1,6 +1,6 @@ [ { - "api": "ens/console.eth", + "api": "ens/testnet/console.eth", "constants": "./constants.json" }, { diff --git a/packages/apis/console/src/query/index.ts b/packages/apis/console/src/query/index.ts index ab2aaa398a..bd13f2b7e6 100644 --- a/packages/apis/console/src/query/index.ts +++ b/packages/apis/console/src/query/index.ts @@ -1,29 +1,29 @@ -import { Input_info, Logger_Query, Logger_LogLevel } from "./w3"; +import { Input_info, Logger_Query, Logger_Logger_LogLevel } from "./w3"; export function debug(input: Input_info): bool { return Logger_Query.log({ message: input.message, - level: Logger_LogLevel.DEBUG + level: Logger_Logger_LogLevel.DEBUG }); } export function info(input: Input_info): bool { return Logger_Query.log({ message: input.message, - level: Logger_LogLevel.INFO + level: Logger_Logger_LogLevel.INFO }); } export function warn(input: Input_info): bool { return Logger_Query.log({ message: input.message, - level: Logger_LogLevel.WARN + level: Logger_Logger_LogLevel.WARN }); } export function error(input: Input_info): bool { return Logger_Query.log({ message: input.message, - level: Logger_LogLevel.ERROR + level: Logger_Logger_LogLevel.ERROR }); } diff --git a/packages/apis/console/src/query/schema.graphql b/packages/apis/console/src/query/schema.graphql index c1d913f6fe..e5b5e90c84 100644 --- a/packages/apis/console/src/query/schema.graphql +++ b/packages/apis/console/src/query/schema.graphql @@ -1,4 +1,4 @@ -#import { Query, LogLevel } into Logger from "w3://w3/logger" +#import { Query } into Logger from "w3://ens/js-logger.web3api.eth" type Query { debug( diff --git a/packages/apis/console/web3api.yaml b/packages/apis/console/web3api.yaml index 26e902703a..3e5e30387b 100644 --- a/packages/apis/console/web3api.yaml +++ b/packages/apis/console/web3api.yaml @@ -7,6 +7,3 @@ query: module: language: wasm/assemblyscript file: ./src/query/index.ts -import_redirects: - - uri: w3://w3/logger - schema: ../../core-apis/logger/schema.graphql diff --git a/packages/cli/lang/en.json b/packages/cli/lang/en.json index f80d825989..2aad6eaa43 100644 --- a/packages/cli/lang/en.json +++ b/packages/cli/lang/en.json @@ -97,7 +97,9 @@ "lib_compiler_compileWarning": "Warnings while compiling Web3API", "lib_compiler_failedSchemaReturn": "Schema composer failed to return a combined schema.", "lib_compiler_noModulesToBuild": "No modules to build declared.", - "lib_compiler_missingDefinition": "Missing schema definition for the module {name}", + "lib_compiler_missingSchema": "Missing schema definition for the module {name}", + "lib_compiler_missingModule": "Missing module definition for the module {name}", + "lib_compiler_noInterfaceModule": "Interfaces cannot have implementation modules, see module {name}", "lib_compiler_step": "Compiling WASM module", "lib_compiler_noNodeModules": "could not locate {folder} in parent directories of web3api manifest", "lib_compiler_noInit": "WASM module is missing the _w3_init export. This should never happen...", @@ -126,6 +128,7 @@ "lib_helpers_parameters_unexpectedValue": "Unexpected value provided for one or more of {options}. See --help for more information.", "lib_publishers_ipfsPublisher_urlMalformed": "IPFS URL Malformed", "lib_project_invalid_build_language": "Unrecognized build language {language}. No default manifest found at {defaultPath}", + "lib_project_language_not_found": "Build language not found. Please include the `language` property in the manifest file.", "lib_watcher_alreadyWatching": "Watcher session is already in progress. Directory: {dir}", "lib_docker_invalidImageId": "Invalid docker image ID returned: {imageId}" } \ No newline at end of file diff --git a/packages/cli/lang/es.json b/packages/cli/lang/es.json index ff8a6bac61..615e219291 100644 --- a/packages/cli/lang/es.json +++ b/packages/cli/lang/es.json @@ -97,7 +97,9 @@ "lib_compiler_compileWarning": "Warnings while compiling Web3API", "lib_compiler_failedSchemaReturn": "Schema composer failed to return a combined schema.", "lib_compiler_noModulesToBuild": "No modules to build declared.", - "lib_compiler_missingDefinition": "Missing schema definition for the module {name}", + "lib_compiler_missingSchema": "Missing schema definition for the module {name}", + "lib_compiler_missingModule": "Missing module definition for the module {name}", + "lib_compiler_noInterfaceModule": "Interfaces cannot have implementation modules, see module {name}", "lib_compiler_step": "Compiling WASM module", "lib_compiler_noNodeModules": "could not locate {folder} in parent directories of web3api manifest", "lib_compiler_noInit": "WASM module is missing the _w3_init export. This should never happen...", @@ -126,6 +128,7 @@ "lib_helpers_parameters_unexpectedValue": "Unexpected value provided for one or more of {options}. See --help for more information.", "lib_publishers_ipfsPublisher_urlMalformed": "IPFS URL Malformed", "lib_project_invalid_build_language": "Unrecognized build language {language}. No default manifest found at {defaultPath}", + "lib_project_language_not_found": "Build language not found. Please include the `language` property in the manifest file.", "lib_watcher_alreadyWatching": "Watcher session is already in progress. Directory: {dir}", "lib_docker_invalidImageId": "Invalid docker image ID returned: {imageId}" } \ No newline at end of file diff --git a/packages/cli/src/__tests__/e2e/build.spec.ts b/packages/cli/src/__tests__/e2e/build.spec.ts index 073ec1e3a6..5eff45a6e8 100644 --- a/packages/cli/src/__tests__/e2e/build.spec.ts +++ b/packages/cli/src/__tests__/e2e/build.spec.ts @@ -137,17 +137,4 @@ ${HELP}`); expect(sanitizedOutput).toContain("Manifest written to ./build/web3api.yaml"); expect(sanitizedOutput).toContain(manifestPath); }); - - test("Errors when dockerfile config property is missing", async () => { - const { exitCode: code, stdout: output } = await runCLI({ - args: ["build", "web3api.wrong-config.yaml", "-v"], - cwd: projectRoot - }, w3Cli); - - const sanitizedOutput = clearStyle(output); - - expect(code).toEqual(1); - expect(sanitizedOutput).toContain("Validation errors encountered while sanitizing BuildManifest"); - expect(sanitizedOutput).toContain("instance.config requires property \"include\""); - }); }); diff --git a/packages/cli/src/__tests__/project/sample.ts b/packages/cli/src/__tests__/project/sample.ts index 22fe295a81..aace49459c 100644 --- a/packages/cli/src/__tests__/project/sample.ts +++ b/packages/cli/src/__tests__/project/sample.ts @@ -195,7 +195,9 @@ type Ethereum_TxReceipt @imported( blockHash: String! confirmations: UInt32! cumulativeGasUsed: BigInt! + effectiveGasPrice: BigInt! byzantium: Boolean! + type: UInt32! status: UInt32 } @@ -370,7 +372,7 @@ type Ethereum_TxResponse @imported( from: String! nonce: UInt32! gasLimit: BigInt! - gasPrice: BigInt! + gasPrice: BigInt data: String! value: BigInt! chainId: UInt32! @@ -413,7 +415,9 @@ type Ethereum_TxReceipt @imported( blockHash: String! confirmations: UInt32! cumulativeGasUsed: BigInt! + effectiveGasPrice: BigInt! byzantium: Boolean! + type: UInt32! status: UInt32 } @@ -729,7 +733,9 @@ type Ethereum_TxReceipt @imported( blockHash: String! confirmations: UInt32! cumulativeGasUsed: BigInt! + effectiveGasPrice: BigInt! byzantium: Boolean! + type: UInt32! status: UInt32 } @@ -769,7 +775,7 @@ type Ethereum_TxResponse @imported( from: String! nonce: UInt32! gasLimit: BigInt! - gasPrice: BigInt! + gasPrice: BigInt data: String! value: BigInt! chainId: UInt32! diff --git a/packages/cli/src/commands/create.ts b/packages/cli/src/commands/create.ts index 4aba28e14a..e3836683ad 100644 --- a/packages/cli/src/commands/create.ts +++ b/packages/cli/src/commands/create.ts @@ -16,7 +16,7 @@ const createPluginStr = intlMsg.commands_create_options_createPlugin(); const pathStr = intlMsg.commands_create_options_o_path(); export const supportedLangs: { [key: string]: string[] } = { - api: ["assemblyscript"], + api: ["assemblyscript", "interface"], app: ["react"], plugin: ["typescript"], }; diff --git a/packages/cli/src/commands/query.ts b/packages/cli/src/commands/query.ts index a6635f3540..eb0c80d74e 100644 --- a/packages/cli/src/commands/query.ts +++ b/packages/cli/src/commands/query.ts @@ -6,7 +6,7 @@ import chalk from "chalk"; import { GluegunToolbox } from "gluegun"; import gql from "graphql-tag"; import path from "path"; -import { UriRedirect, Web3ApiClient } from "@web3api/client-js"; +import { PluginRegistration, Web3ApiClient } from "@web3api/client-js"; import { ensPlugin } from "@web3api/ens-plugin-js"; import { ethereumPlugin } from "@web3api/ethereum-plugin-js"; import { ipfsPlugin } from "@web3api/ipfs-plugin-js"; @@ -79,10 +79,10 @@ export default { // TODO: move this into its own package, since it's being used everywhere? // maybe have it exported from test-env. - const redirects: UriRedirect[] = [ + const plugins: PluginRegistration[] = [ { - from: "w3://ens/ethereum.web3api.eth", - to: ethereumPlugin({ + uri: "w3://ens/ethereum.web3api.eth", + plugin: ethereumPlugin({ networks: { testnet: { provider: ethereumProvider, @@ -95,15 +95,15 @@ export default { }), }, { - from: "w3://ens/ipfs.web3api.eth", - to: ipfsPlugin({ + uri: "w3://ens/ipfs.web3api.eth", + plugin: ipfsPlugin({ provider: ipfsProvider, fallbackProviders: ["https://ipfs.io"], }), }, { - from: "w3://ens/ens.web3api.eth", - to: ensPlugin({ + uri: "w3://ens/ens.web3api.eth", + plugin: ensPlugin({ addresses: { testnet: ensAddress, }, @@ -111,7 +111,7 @@ export default { }, ]; - const client = new Web3ApiClient({ redirects }); + const client = new Web3ApiClient({ plugins }); const recipe = JSON.parse(filesystem.read(recipePath) as string); const dir = path.dirname(recipePath); diff --git a/packages/cli/src/lib/Compiler.ts b/packages/cli/src/lib/Compiler.ts index ac06684257..4ea0dd5768 100644 --- a/packages/cli/src/lib/Compiler.ts +++ b/packages/cli/src/lib/Compiler.ts @@ -110,114 +110,160 @@ export class Compiler { const { outputDir, project } = this._config; const buildQuery = modulesToBuild.indexOf("query") > -1; const buildMutation = modulesToBuild.indexOf("mutation") > -1; + const isInterface = !!web3apiManifest.interface; + + this._validateBuildConfig( + web3apiManifest, + composerOutput, + buildQuery, + buildMutation, + isInterface + ); - const throwMissingSchema = (moduleName: string) => { - const missingSchemaMessage = intlMsg.lib_compiler_missingDefinition({ - name: `"${moduleName}"`, - }); - throw Error(missingSchemaMessage); - }; + if (isInterface) { + // Output the schema & manifest files + writeFileSync( + `${outputDir}/schema.graphql`, + composerOutput.combined.schema, + "utf-8" + ); - if (buildQuery && (!composerOutput.query || !composerOutput.query.schema)) { - throwMissingSchema("query"); - } + const outputWeb3ApiManifest = Object.assign({}, web3apiManifest); - if ( - buildMutation && - (!composerOutput.mutation || !composerOutput.mutation.schema) - ) { - throwMissingSchema("mutation"); - } + if (buildQuery) { + const queryManifest = outputWeb3ApiManifest as Required< + typeof outputWeb3ApiManifest + >; + queryManifest.modules.query = { + schema: "./schema.graphql", + }; + } - const queryDirectory = web3apiManifest.modules.query - ? this._getGenerationDirectory(web3apiManifest.modules.query.module) - : undefined; - const mutationDirectory = web3apiManifest.modules.mutation - ? this._getGenerationDirectory(web3apiManifest.modules.mutation.module) - : undefined; + if (buildMutation) { + const mutationManifest = outputWeb3ApiManifest as Required< + typeof outputWeb3ApiManifest + >; + mutationManifest.modules.mutation = { + schema: "./schema.graphql", + }; + } - if ( - queryDirectory && - mutationDirectory && - queryDirectory === mutationDirectory - ) { - throw Error( - intlMsg.lib_compiler_dup_code_folder({ directory: queryDirectory }) + await outputManifest( + outputWeb3ApiManifest, + `${outputDir}/web3api.yaml`, + project.quiet ); - } + } else { + const queryModule = web3apiManifest.modules.query?.module as string; + const queryDirectory = web3apiManifest.modules.query + ? this._getGenerationDirectory(queryModule) + : undefined; + const mutationModule = web3apiManifest.modules.mutation?.module as string; + const mutationDirectory = web3apiManifest.modules.mutation + ? this._getGenerationDirectory(mutationModule) + : undefined; + + if ( + queryDirectory && + mutationDirectory && + queryDirectory === mutationDirectory + ) { + throw Error( + intlMsg.lib_compiler_dup_code_folder({ directory: queryDirectory }) + ); + } - this._generateCode( - buildQuery - ? { - typeInfo: composerOutput.query?.typeInfo as TypeInfo, - outputDirAbs: queryDirectory as string, - } - : undefined, - buildMutation - ? { - typeInfo: composerOutput.mutation?.typeInfo as TypeInfo, - outputDirAbs: mutationDirectory as string, - } - : undefined - ); + this._generateCode( + buildQuery + ? { + typeInfo: composerOutput.query?.typeInfo as TypeInfo, + outputDirAbs: queryDirectory as string, + } + : undefined, + buildMutation + ? { + typeInfo: composerOutput.mutation?.typeInfo as TypeInfo, + outputDirAbs: mutationDirectory as string, + } + : undefined + ); - // Build the sources - const dockerImageId = await this._buildSourcesInDocker(); + // Build the sources + const dockerImageId = await this._buildSourcesInDocker(); - // Validate the WASM exports - await Promise.all( - modulesToBuild.map((module) => this._validateExports(module, outputDir)) - ); + // Validate the WASM exports + await Promise.all( + modulesToBuild.map((module) => this._validateExports(module, outputDir)) + ); - // Output the schema & manifest files - writeFileSync( - `${outputDir}/schema.graphql`, - composerOutput.combined.schema, - "utf-8" - ); + // Output the schema & manifest files + writeFileSync( + `${outputDir}/schema.graphql`, + composerOutput.combined.schema, + "utf-8" + ); - const outputWeb3ApiManifest = Object.assign({}, web3apiManifest); + const outputWeb3ApiManifest = Object.assign({}, web3apiManifest); - if (buildQuery) { - const queryManifest = outputWeb3ApiManifest as Required< - typeof outputWeb3ApiManifest - >; - queryManifest.modules.query = { - module: "./query.wasm", - schema: "./schema.graphql", - }; - } + if (buildQuery) { + const queryManifest = outputWeb3ApiManifest as Required< + typeof outputWeb3ApiManifest + >; + queryManifest.modules.query = { + module: "./query.wasm", + schema: "./schema.graphql", + }; + } - if (buildMutation) { - const mutationManifest = outputWeb3ApiManifest as Required< - typeof outputWeb3ApiManifest - >; - mutationManifest.modules.mutation = { - module: "./mutation.wasm", - schema: "./schema.graphql", + if (buildMutation) { + const mutationManifest = outputWeb3ApiManifest as Required< + typeof outputWeb3ApiManifest + >; + mutationManifest.modules.mutation = { + module: "./mutation.wasm", + schema: "./schema.graphql", + }; + } + + outputWeb3ApiManifest.build = "./web3api.build.yaml"; + + await outputManifest( + outputWeb3ApiManifest, + `${outputDir}/web3api.yaml`, + project.quiet + ); + + const outputBuildManifest: BuildManifest = { + format: "0.0.1-prealpha.2", + docker: { + buildImageId: dockerImageId, + }, }; + + await outputManifest( + outputBuildManifest, + `${outputDir}/web3api.build.yaml`, + project.quiet + ); } + } - outputWeb3ApiManifest.build = "./web3api.build.yaml"; + private _determineModulesToBuild( + manifest: Web3ApiManifest + ): InvokableModules[] { + const manifestMutation = manifest.modules.mutation; + const manifestQuery = manifest.modules.query; + const modulesToBuild: InvokableModules[] = []; - await outputManifest( - outputWeb3ApiManifest, - `${outputDir}/web3api.yaml`, - project.quiet - ); + if (manifestMutation) { + modulesToBuild.push("mutation"); + } - const outputBuildManifest: BuildManifest = { - format: "0.0.1-prealpha.2", - docker: { - buildImageId: dockerImageId, - }, - }; + if (manifestQuery) { + modulesToBuild.push("query"); + } - await outputManifest( - outputBuildManifest, - `${outputDir}/web3api.build.yaml`, - project.quiet - ); + return modulesToBuild; } private _getGenerationDirectory(entryPoint: string): string { @@ -306,6 +352,74 @@ export class Compiler { return dockerImageId; } + private _cleanDir(dir: string) { + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir); + } + + fsExtra.emptyDirSync(dir); + } + + private _validateBuildConfig( + web3apiManifest: Web3ApiManifest, + composerOutput: ComposerOutput, + buildQuery: boolean, + buildMutation: boolean, + isInterface: boolean + ) { + const throwMissingSchema = (moduleName: string) => { + const missingSchemaMessage = intlMsg.lib_compiler_missingSchema({ + name: `"${moduleName}"`, + }); + throw Error(missingSchemaMessage); + }; + + if (buildQuery && (!composerOutput.query || !composerOutput.query.schema)) { + throwMissingSchema("query"); + } + + if ( + buildMutation && + (!composerOutput.mutation || !composerOutput.mutation.schema) + ) { + throwMissingSchema("mutation"); + } + + const throwMissingModule = (moduleName: string) => { + const missingModuleMessage = intlMsg.lib_compiler_missingModule({ + name: `"${moduleName}"`, + }); + throw Error(missingModuleMessage); + }; + + if (buildQuery && !isInterface && !web3apiManifest.modules.query?.module) { + throwMissingModule("query"); + } + + if ( + buildMutation && + !isInterface && + !web3apiManifest.modules.mutation?.module + ) { + throwMissingModule("mutation"); + } + + const throwNoInterfaceModule = (moduleName: string) => { + const noInterfaceModule = intlMsg.lib_compiler_noInterfaceModule({ + name: `"${moduleName}"`, + }); + throw Error(noInterfaceModule); + }; + + if (isInterface && web3apiManifest.modules.query?.module) { + throwNoInterfaceModule("query"); + } + + if (isInterface && web3apiManifest.modules.mutation?.module) { + throwNoInterfaceModule("mutation"); + } + } + private async _validateExports( moduleName: InvokableModules, buildDir: string @@ -342,30 +456,4 @@ export class Compiler { ); } } - - private _determineModulesToBuild( - manifest: Web3ApiManifest - ): InvokableModules[] { - const manifestMutation = manifest.modules.mutation; - const manifestQuery = manifest.modules.query; - const modulesToBuild: InvokableModules[] = []; - - if (manifestMutation) { - modulesToBuild.push("mutation"); - } - - if (manifestQuery) { - modulesToBuild.push("query"); - } - - return modulesToBuild; - } - - private _cleanDir(dir: string) { - if (!fs.existsSync(dir)) { - fs.mkdirSync(dir); - } - - fsExtra.emptyDirSync(dir); - } } diff --git a/packages/cli/src/lib/Project.ts b/packages/cli/src/lib/Project.ts index 4ccf889d4e..53f4d79858 100644 --- a/packages/cli/src/lib/Project.ts +++ b/packages/cli/src/lib/Project.ts @@ -78,7 +78,7 @@ export class Project { name: string; }[] = []; - if (web3apiManifest.modules.mutation) { + if (web3apiManifest.modules.mutation?.module) { web3apiModules.push({ dir: path .dirname(web3apiManifest.modules.mutation.module) @@ -86,7 +86,7 @@ export class Project { name: "mutation", }); } - if (web3apiManifest.modules.query) { + if (web3apiManifest.modules.query?.module) { web3apiModules.push({ dir: path .dirname(web3apiManifest.modules.query.module) @@ -191,6 +191,10 @@ export class Project { const language = (await this.getWeb3ApiManifest()).language; + if (!language) { + throw Error(intlMsg.lib_project_language_not_found()); + } + const defaultPath = `${__dirname}/build-envs/${language}/web3api.build.yaml`; if (!fs.existsSync(defaultPath)) { diff --git a/packages/cli/src/lib/SchemaComposer.ts b/packages/cli/src/lib/SchemaComposer.ts index badc94bd84..f31028c0c9 100644 --- a/packages/cli/src/lib/SchemaComposer.ts +++ b/packages/cli/src/lib/SchemaComposer.ts @@ -4,10 +4,10 @@ import { Project } from "./Project"; import { - Web3ApiManifest, Uri, Web3ApiClient, - UriRedirect, + PluginRegistration, + Web3ApiManifest, } from "@web3api/client-js"; import { composeSchema, @@ -38,12 +38,12 @@ export class SchemaComposer { constructor(private _config: SchemaConfig) { const { ensAddress, ethProvider, ipfsProvider } = this._config; - const redirects: UriRedirect[] = []; + const plugins: PluginRegistration[] = []; if (ensAddress) { - redirects.push({ - from: "w3://ens/ens.web3api.eth", - to: ensPlugin({ + plugins.push({ + uri: "w3://ens/ens.web3api.eth", + plugin: ensPlugin({ addresses: { testnet: ensAddress, }, @@ -52,9 +52,9 @@ export class SchemaComposer { } if (ethProvider) { - redirects.push({ - from: "w3://ens/ethereum.web3api.eth", - to: ethereumPlugin({ + plugins.push({ + uri: "w3://ens/ethereum.web3api.eth", + plugin: ethereumPlugin({ networks: { testnet: { provider: ethProvider, @@ -65,16 +65,16 @@ export class SchemaComposer { } if (ipfsProvider) { - redirects.push({ - from: "w3://ens/ipfs.web3api.eth", - to: ipfsPlugin({ + plugins.push({ + uri: "w3://ens/ipfs.web3api.eth", + plugin: ipfsPlugin({ provider: ipfsProvider, fallbackProviders: ["https://ipfs.io"], }), }); } - this._client = new Web3ApiClient({ redirects }); + this._client = new Web3ApiClient({ plugins }); } public async getComposedSchemas( diff --git a/packages/cli/src/lib/helpers/command.ts b/packages/cli/src/lib/helpers/command.ts index 6f5322717d..8f2e79dead 100644 --- a/packages/cli/src/lib/helpers/command.ts +++ b/packages/cli/src/lib/helpers/command.ts @@ -30,6 +30,16 @@ export async function runCommand( } }; - exec(command, { cwd: __dirname, env }, callback); + exec( + command, + { + cwd: __dirname, + env: { + ...process.env, + ...env, + }, + }, + callback + ); }); } diff --git a/packages/cli/src/lib/helpers/manifest.ts b/packages/cli/src/lib/helpers/manifest.ts index 5cd4c82e9b..daae688fa4 100644 --- a/packages/cli/src/lib/helpers/manifest.ts +++ b/packages/cli/src/lib/helpers/manifest.ts @@ -68,18 +68,12 @@ export async function loadBuildManifest( } // Load the custom json-schema extension if it exists - let configSchemaPath = path.join( + const configSchemaPath = path.join( path.dirname(manifestPath), "/web3api.build.ext.json" ); let extSchema: JsonSchema | undefined = undefined; - if (!fs.existsSync(configSchemaPath)) { - configSchemaPath = project.getCachePath( - "build/env/web3api.build.ext.json" - ); - } - if (fs.existsSync(configSchemaPath)) { extSchema = JSON.parse( fs.readFileSync(configSchemaPath, "utf-8") diff --git a/packages/core-apis/api-resolver/web3api.yaml b/packages/core-apis/api-resolver/web3api.yaml deleted file mode 100644 index 1366a48216..0000000000 --- a/packages/core-apis/api-resolver/web3api.yaml +++ /dev/null @@ -1,7 +0,0 @@ -description: Web3API Resolver Standard -format: 0.0.1-prealpha.1 -repository: https://github.com/web3-api/monorepo -abstract: true -query: - schema: - file: ./query.graphql diff --git a/packages/core-apis/logger/web3api.yaml b/packages/core-apis/logger/web3api.yaml deleted file mode 100644 index a782c3e2e3..0000000000 --- a/packages/core-apis/logger/web3api.yaml +++ /dev/null @@ -1,7 +0,0 @@ -description: Web3API Logger Standard -format: 0.0.1-prealpha.1 -repository: https://github.com/web3-api/monorepo -abstract: true -query: - schema: - file: ./query.graphql diff --git a/packages/core-apis/README.md b/packages/core-interfaces/README.md similarity index 100% rename from packages/core-apis/README.md rename to packages/core-interfaces/README.md diff --git a/packages/core-interfaces/logger/.gitignore b/packages/core-interfaces/logger/.gitignore new file mode 100644 index 0000000000..e3fbd98336 --- /dev/null +++ b/packages/core-interfaces/logger/.gitignore @@ -0,0 +1,2 @@ +build +node_modules diff --git a/packages/core-interfaces/logger/.nvmrc b/packages/core-interfaces/logger/.nvmrc new file mode 100644 index 0000000000..158c00641a --- /dev/null +++ b/packages/core-interfaces/logger/.nvmrc @@ -0,0 +1 @@ +v14.16.0 diff --git a/packages/core-interfaces/logger/README.md b/packages/core-interfaces/logger/README.md new file mode 100644 index 0000000000..218f331fff --- /dev/null +++ b/packages/core-interfaces/logger/README.md @@ -0,0 +1,13 @@ +# Web3API Logger Interface + +# How To Run + +## Install Dependencies +`nvm install && nvm use` +`yarn` + +## Start Test Environment +`yarn test:env:up` + +## Build & Deploy Web3API +`yarn deploy` \ No newline at end of file diff --git a/packages/core-interfaces/logger/package.json b/packages/core-interfaces/logger/package.json new file mode 100644 index 0000000000..ac694e4a13 --- /dev/null +++ b/packages/core-interfaces/logger/package.json @@ -0,0 +1,17 @@ +{ + "name": "logger-interface", + "description": "Web3API Logger Interface", + "private": true, + "version": "0.0.1-prealpha.28", + "scripts": { + "build": "yarn build:web3api", + "build:web3api": "npx w3 build", + "test:env:up": "npx w3 test-env up", + "test:env:down": "npx w3 test-env down", + "deploy": "yarn deploy:web3api", + "deploy:web3api": "npx w3 build --ipfs http://localhost:5001" + }, + "devDependencies": { + "@web3api/cli": "0.0.1-prealpha.28" + } +} diff --git a/packages/core-apis/logger/schema.graphql b/packages/core-interfaces/logger/src/query.graphql similarity index 100% rename from packages/core-apis/logger/schema.graphql rename to packages/core-interfaces/logger/src/query.graphql diff --git a/packages/core-interfaces/logger/web3api.yaml b/packages/core-interfaces/logger/web3api.yaml new file mode 100644 index 0000000000..a147deb3f1 --- /dev/null +++ b/packages/core-interfaces/logger/web3api.yaml @@ -0,0 +1,6 @@ +format: 0.0.1-prealpha.3 +repository: https://github.com/web3-api/monorepo +interface: true +modules: + query: + schema: ./src/query.graphql diff --git a/packages/core-interfaces/uri-resolver/.gitignore b/packages/core-interfaces/uri-resolver/.gitignore new file mode 100644 index 0000000000..e3fbd98336 --- /dev/null +++ b/packages/core-interfaces/uri-resolver/.gitignore @@ -0,0 +1,2 @@ +build +node_modules diff --git a/packages/core-interfaces/uri-resolver/.nvmrc b/packages/core-interfaces/uri-resolver/.nvmrc new file mode 100644 index 0000000000..158c00641a --- /dev/null +++ b/packages/core-interfaces/uri-resolver/.nvmrc @@ -0,0 +1 @@ +v14.16.0 diff --git a/packages/core-interfaces/uri-resolver/README.md b/packages/core-interfaces/uri-resolver/README.md new file mode 100644 index 0000000000..299a44873b --- /dev/null +++ b/packages/core-interfaces/uri-resolver/README.md @@ -0,0 +1,13 @@ +# URI Resolver Interface + +# How To Run + +## Install Dependencies +`nvm install && nvm use` +`yarn` + +## Start Test Environment +`yarn test:env:up` + +## Build & Deploy Web3API +`yarn deploy` \ No newline at end of file diff --git a/packages/core-interfaces/uri-resolver/package.json b/packages/core-interfaces/uri-resolver/package.json new file mode 100644 index 0000000000..e4decc9047 --- /dev/null +++ b/packages/core-interfaces/uri-resolver/package.json @@ -0,0 +1,17 @@ +{ + "name": "uri-resolver-interface", + "description": "URI Resolver Interface", + "private": true, + "version": "0.0.1-prealpha.28", + "scripts": { + "build": "yarn build:web3api", + "build:web3api": "npx w3 build", + "test:env:up": "npx w3 test-env up", + "test:env:down": "npx w3 test-env down", + "deploy": "yarn deploy:web3api", + "deploy:web3api": "npx w3 build --ipfs http://localhost:5001" + }, + "devDependencies": { + "@web3api/cli": "0.0.1-prealpha.28" + } +} diff --git a/packages/core-apis/api-resolver/schema.graphql b/packages/core-interfaces/uri-resolver/src/query.graphql similarity index 100% rename from packages/core-apis/api-resolver/schema.graphql rename to packages/core-interfaces/uri-resolver/src/query.graphql diff --git a/packages/core-interfaces/uri-resolver/web3api.yaml b/packages/core-interfaces/uri-resolver/web3api.yaml new file mode 100644 index 0000000000..69e4bdfbd4 --- /dev/null +++ b/packages/core-interfaces/uri-resolver/web3api.yaml @@ -0,0 +1,5 @@ +format: 0.0.1-prealpha.3 +interface: true +modules: + query: + schema: ./src/query.graphql diff --git a/packages/js/client/src/Web3ApiClient.ts b/packages/js/client/src/Web3ApiClient.ts index 629a1b852b..8ae890a75d 100644 --- a/packages/js/client/src/Web3ApiClient.ts +++ b/packages/js/client/src/Web3ApiClient.ts @@ -1,4 +1,4 @@ -import { getDefaultRedirects } from "./default-redirects"; +import { getDefaultClientConfig } from "./default-client-config"; import { PluginWeb3Api } from "./plugin/PluginWeb3Api"; import { WasmWeb3Api } from "./wasm/WasmWeb3Api"; @@ -13,16 +13,23 @@ import { QueryApiResult, Uri, UriRedirect, + InterfaceImplementations, + PluginRegistration, resolveUri, InvokeApiOptions, InvokeApiResult, Web3ApiManifest, sanitizeUriRedirects, + sanitizeInterfaceImplementations, + sanitizePluginRegistrations, + getImplementations, } from "@web3api/core-js"; import { Tracer } from "@web3api/tracing-js"; export interface ClientConfig { redirects?: UriRedirect[]; + plugins?: PluginRegistration[]; + interfaces?: InterfaceImplementations[]; tracingEnabled?: boolean; } @@ -32,36 +39,50 @@ export class Web3ApiClient implements Client { // and handle cases where the are multiple jumps. For exmaple, if // A => B => C, then the cache should have A => C, and B => C. private _apiCache: ApiCache = new Map(); - private _config: ClientConfig = {}; + private _config: Required> = { + redirects: [], + plugins: [], + interfaces: [], + tracingEnabled: false, + }; constructor(config?: ClientConfig) { try { - if (!config) { - this._config = { - redirects: [], - tracingEnabled: false, - }; - } - this.tracingEnabled(!!config?.tracingEnabled); Tracer.startSpan("Web3ApiClient: constructor"); if (config) { this._config = { - ...config, redirects: config.redirects ? sanitizeUriRedirects(config.redirects) : [], + plugins: config.plugins + ? sanitizePluginRegistrations(config.plugins) + : [], + interfaces: config.interfaces + ? sanitizeInterfaceImplementations(config.interfaces) + : [], + tracingEnabled: !!config.tracingEnabled, }; } - if (!this._config.redirects) { - this._config.redirects = []; + // Add the default config + const defaultClientConfig = getDefaultClientConfig(); + + if (defaultClientConfig.redirects) { + this._config.redirects.push(...defaultClientConfig.redirects); + } + + if (defaultClientConfig.plugins) { + this._config.plugins.push(...defaultClientConfig.plugins); + } + + if (defaultClientConfig.interfaces) { + this._config.interfaces.push(...defaultClientConfig.interfaces); } - // Add all default redirects - this._config.redirects.push(...getDefaultRedirects()); + this.requirePluginsToUseNonInterfaceUris(); Tracer.setAttribute("config", this._config); } catch (error) { @@ -86,16 +107,45 @@ export class Web3ApiClient implements Client { return this._config.redirects || []; } + public plugins(): readonly PluginRegistration[] { + return this._config.plugins || []; + } + + public interfaces(): readonly InterfaceImplementations[] { + return this._config.interfaces || []; + } + public async query< TData extends Record = Record, TVariables extends Record = Record >( options: QueryApiOptions + ): Promise>; + public async query< + TData extends Record = Record, + TVariables extends Record = Record + >(options: QueryApiOptions): Promise>; + public async query< + TData extends Record = Record, + TVariables extends Record = Record + >( + options: QueryApiOptions ): Promise> { + let typedOptions: QueryApiOptions; + + if (typeof options.uri === "string") { + typedOptions = { + ...options, + uri: new Uri(options.uri), + }; + } else { + typedOptions = options as QueryApiOptions; + } + const run = Tracer.traceFunc( "Web3ApiClient: query", async ( - options: QueryApiOptions + options: QueryApiOptions ): Promise> => { const { uri, query, variables } = options; @@ -104,11 +154,7 @@ export class Web3ApiClient implements Client { typeof query === "string" ? createQueryDocument(query) : query; // Parse the query to understand what's being invoked - const queryInvocations = parseQuery( - new Uri(uri), - queryDocument, - variables - ); + const queryInvocations = parseQuery(uri, queryDocument, variables); // Execute all invocations in parallel const parallelInvocations: Promise<{ @@ -120,7 +166,7 @@ export class Web3ApiClient implements Client { parallelInvocations.push( this.invoke({ ...queryInvocations[invocationName], - uri: queryInvocations[invocationName].uri.uri, + uri: queryInvocations[invocationName].uri, decode: true, }).then((result) => ({ name: invocationName, @@ -152,7 +198,7 @@ export class Web3ApiClient implements Client { } ); - return await run(options).catch((error) => { + return await run(typedOptions).catch((error) => { if (error.length) { return { errors: error }; } else { @@ -163,31 +209,45 @@ export class Web3ApiClient implements Client { public async invoke( options: InvokeApiOptions + ): Promise>; + public async invoke( + options: InvokeApiOptions + ): Promise>; + public async invoke( + options: InvokeApiOptions ): Promise> { + let typedOptions: InvokeApiOptions; + + if (typeof options.uri === "string") { + typedOptions = { + ...options, + uri: new Uri(options.uri), + }; + } else { + typedOptions = options as InvokeApiOptions; + } + const run = Tracer.traceFunc( "Web3ApiClient: invoke", async ( - options: InvokeApiOptions + options: InvokeApiOptions ): Promise> => { - const uri = new Uri(options.uri); - const api = await this.loadWeb3Api(uri); + const api = await this.loadWeb3Api(options.uri); - const result = (await api.invoke( - { - ...options, - uri, - }, - this - )) as TData; + const result = (await api.invoke(options, this)) as TData; return result; } ); - return run(options); + return run(typedOptions); } - public async loadWeb3Api(uri: Uri): Promise { + public async loadWeb3Api(uri: string): Promise; + public async loadWeb3Api(uri: Uri): Promise; + public async loadWeb3Api(uri: string | Uri): Promise { + const typedUri = typeof uri === "string" ? new Uri(uri) : uri; + const run = Tracer.traceFunc( "Web3ApiClient: loadWeb3Api", async (uri: Uri): Promise => { @@ -197,9 +257,12 @@ export class Web3ApiClient implements Client { api = await resolveUri( uri, this, + this.redirects(), + this.plugins(), + this.interfaces(), (uri: Uri, plugin: PluginPackage) => new PluginWeb3Api(uri, plugin), - (uri: Uri, manifest: Web3ApiManifest, apiResolver: Uri) => - new WasmWeb3Api(uri, manifest, apiResolver) + (uri: Uri, manifest: Web3ApiManifest, uriResolver: Uri) => + new WasmWeb3Api(uri, manifest, uriResolver) ); if (!api) { @@ -213,6 +276,72 @@ export class Web3ApiClient implements Client { } ); - return run(uri); + return run(typedUri); + } + + public getImplementations( + uri: string, + filters?: { applyRedirects: boolean } + ): string[]; + public getImplementations( + uri: Uri, + filters?: { applyRedirects: boolean } + ): Uri[]; + public getImplementations( + uri: string | Uri, + filters: { applyRedirects: boolean } = { applyRedirects: false } + ): (string | Uri)[] { + const isUriTypeString = typeof uri === "string"; + + const typedUri: Uri = isUriTypeString + ? new Uri(uri as string) + : (uri as Uri); + + const getImplementationsWithoutRedirects = Tracer.traceFunc( + "Web3ApiClient: getImplementations - getImplementationsWithoutRedirects", + (uri: Uri): (string | Uri)[] => { + const interfaceImplementations = this.interfaces().find((x) => + Uri.equals(x.interface, uri) + ); + + if (!interfaceImplementations) { + throw Error(`Interface: ${uri} has no implementations registered`); + } + + return isUriTypeString + ? interfaceImplementations.implementations.map((x) => x.uri) + : interfaceImplementations.implementations; + } + ); + + const getImplementationsWithRedirects = Tracer.traceFunc( + "Web3ApiClient: getImplementations - getImplementationsWithRedirects", + (uri: Uri): (string | Uri)[] => { + return isUriTypeString + ? getImplementations(uri, this.redirects(), this.interfaces()).map( + (x) => x.uri + ) + : getImplementations(uri, this.redirects(), this.interfaces()); + } + ); + + return filters.applyRedirects + ? getImplementationsWithRedirects(typedUri) + : getImplementationsWithoutRedirects(typedUri); + } + + private requirePluginsToUseNonInterfaceUris(): void { + const pluginUris = this.plugins().map((x) => x.uri.uri); + const interfaceUris = this.interfaces().map((x) => x.interface.uri); + + const pluginsWithInterfaceUris = pluginUris.filter((plugin) => + interfaceUris.includes(plugin) + ); + + if (pluginsWithInterfaceUris.length) { + throw Error( + `Plugins can't use interfaces for their URI. Invalid plugins: ${pluginsWithInterfaceUris}` + ); + } } } diff --git a/packages/js/client/src/__tests__/Web3ApiClient.spec.ts b/packages/js/client/src/__tests__/Web3ApiClient.spec.ts index 202064bac8..199d94422e 100644 --- a/packages/js/client/src/__tests__/Web3ApiClient.spec.ts +++ b/packages/js/client/src/__tests__/Web3ApiClient.spec.ts @@ -1,5 +1,8 @@ import { - createWeb3ApiClient + ClientConfig, + createWeb3ApiClient, + Plugin, + Uri } from "../"; import { buildAndDeployApi, @@ -7,6 +10,9 @@ import { stopTestEnvironment } from "@web3api/test-env-js"; import { GetPathToTestApis } from "@web3api/test-cases"; +import { Web3ApiClient } from "../Web3ApiClient"; +import { getDefaultClientConfig } from "../default-client-config"; +import { coreInterfaceUris } from '@web3api/core-js'; jest.setTimeout(200000); @@ -26,7 +32,7 @@ describe("Web3ApiClient", () => { await stopTestEnvironment(); }); - const getClient = async () => { + const getClient = async (config?: ClientConfig) => { return createWeb3ApiClient({ ethereum: { networks: { @@ -41,8 +47,386 @@ describe("Web3ApiClient", () => { testnet: ensAddress } } - }) + }, config); } + + it("default client config", () => { + const client = new Web3ApiClient(); + + expect(client.redirects()).toStrictEqual([]); + expect( + client.plugins().map(x => x.uri) + ).toStrictEqual([ + new Uri("w3://ens/ipfs.web3api.eth"), + new Uri("w3://ens/ens.web3api.eth"), + new Uri("w3://ens/ethereum.web3api.eth"), + new Uri("w3://ens/js-logger.web3api.eth"), + new Uri("w3://ens/uts46.web3api.eth"), + new Uri("w3://ens/sha3.web3api.eth"), + ]); + expect( + client.interfaces() + ).toStrictEqual([ + { + interface: coreInterfaceUris.uriResolver, + implementations: [ + new Uri("w3://ens/ipfs.web3api.eth"), + new Uri("w3://ens/ens.web3api.eth") + ] + }, + { + interface: coreInterfaceUris.logger, + implementations: [ + new Uri("w3://ens/js-logger.web3api.eth") + ] + }]); + }); + + it("redirect registration", () => { + const implementation1Uri = "w3://ens/some-implementation1.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + + const client = new Web3ApiClient({ + redirects: [ + { + from: implementation1Uri, + to: implementation2Uri + } + ] + }); + + const redirects = client.redirects(); + + expect(redirects).toEqual([ + { + from: new Uri(implementation1Uri), + to: new Uri(implementation2Uri), + } + ]); + }); + + it("plugin registration - with default plugins", () => { + const implementationUri = "w3://ens/some-implementation.eth"; + const defaultPlugins = [ + "w3://ens/ipfs.web3api.eth", + "w3://ens/ens.web3api.eth", + "w3://ens/ethereum.web3api.eth", + "w3://ens/js-logger.web3api.eth", + "w3://ens/uts46.web3api.eth", + "w3://ens/sha3.web3api.eth", + ]; + + const client = new Web3ApiClient({ + plugins: [ + { + uri: implementationUri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: "", + implements: [], + } + } + } + ] + }); + + const pluginUris = client.plugins().map(x => x.uri.uri); + + expect(pluginUris).toEqual([implementationUri].concat(defaultPlugins)); + }); + + it("interface registration", () => { + const interfaceUri = "w3://ens/some-interface1.eth"; + const implementation1Uri = "w3://ens/some-implementation1.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + + const client = new Web3ApiClient({ + interfaces: [ + { + interface: interfaceUri, + implementations: [ + implementation1Uri, + implementation2Uri + ] + } + ] + }); + + const interfaces = client.interfaces(); + + + const defaultClientConfig = getDefaultClientConfig(); + + expect(interfaces).toEqual([ + { + interface: new Uri(interfaceUri), + implementations: [ + new Uri(implementation1Uri), + new Uri(implementation2Uri) + ] + } + ].concat(defaultClientConfig.interfaces ?? [])); + + const implementations = client.getImplementations(interfaceUri); + + expect(implementations).toEqual([ + implementation1Uri, + implementation2Uri + ]); + }); + + it("get all implementations of interface", async () => { + + const interface1Uri = "w3://ens/some-interface1.eth"; + const interface2Uri = "w3://ens/some-interface2.eth"; + const interface3Uri = "w3://ens/some-interface3.eth"; + + const implementation1Uri = "w3://ens/some-implementation.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + const implementation3Uri = "w3://ens/some-implementation3.eth"; + const implementation4Uri = "w3://ens/some-implementation4.eth"; + + const client = await getClient({ + redirects: [ + { + from: interface1Uri, + to: interface2Uri + }, + { + from: implementation1Uri, + to: implementation2Uri + }, + { + from: implementation2Uri, + to: implementation3Uri + } + ], + plugins: [ + { + uri: implementation4Uri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: "", + implements: [], + } + } + } + ], + interfaces: [ + { + interface: interface1Uri, + implementations: [ + implementation1Uri, + implementation2Uri + ] + }, + { + interface: interface2Uri, + implementations: [ + implementation3Uri + ] + }, + { + interface: interface3Uri, + implementations: [ + implementation3Uri, + implementation4Uri + ] + } + ] + }); + + const implementations1 = client.getImplementations(interface1Uri, { applyRedirects: true }); + const implementations2 = client.getImplementations(interface2Uri, { applyRedirects: true }); + const implementations3 = client.getImplementations(interface3Uri, { applyRedirects: true }); + + expect(implementations1).toEqual([ + implementation1Uri, + implementation2Uri, + implementation3Uri + ]); + + expect(implementations2).toEqual([ + implementation1Uri, + implementation2Uri, + implementation3Uri + ]); + + expect(implementations3).toEqual([ + implementation3Uri, + implementation4Uri + ]); + }); + + it("plugins should not get registered with an interface uri (without default plugins)", () => { + const interface1Uri = "w3://ens/some-interface1.eth"; + const interface2Uri = "w3://ens/some-interface2.eth"; + const interface3Uri = "w3://ens/some-interface3.eth"; + + const implementationUri = "w3://ens/some-implementation.eth"; + + expect(() => { + new Web3ApiClient({ + plugins: [ + { + uri: interface1Uri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: "", + implements: [], + } + } + }, + { + uri: interface2Uri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: "", + implements: [], + } + } + } + ], + interfaces: [ + { + interface: interface1Uri, + implementations: [ + implementationUri + ] + }, + { + interface: interface2Uri, + implementations: [ + implementationUri + ] + }, + { + interface: interface3Uri, + implementations: [ + implementationUri + ] + } + ] + }); + }).toThrow(`Plugins can't use interfaces for their URI. Invalid plugins: ${[interface1Uri, interface2Uri]}`); + }); + + it("plugins should not get registered with an interface uri (with default plugins)", async () => { + const interfaceUri = "w3://ens/some-interface.eth"; + + const implementationUri = "w3://ens/some-implementation.eth"; + + await expect(async () => { + await getClient({ + plugins: [ + { + uri: interfaceUri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: "", + implements: [], + } + } + } + ], + interfaces: [ + { + interface: interfaceUri, + implementations: [ + implementationUri + ] + } + ] + }); + }) + .rejects + .toThrow(`Plugins can't use interfaces for their URI. Invalid plugins: ${[interfaceUri]}`); + }); + + it("get implementations - do not return plugins that are not explicitly registered", () => { + const interfaceUri = "w3://ens/some-interface.eth"; + + const implementation1Uri = "w3://ens/some-implementation1.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + + const client = new Web3ApiClient({ + plugins: [ + { + uri: implementation1Uri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: '', + implements: [new Uri(interfaceUri)], + } + } + } + ], + interfaces: [ + { + interface: interfaceUri, + implementations: [ + implementation2Uri + ] + } + ] + }); + + const getImplementationsResult = client.getImplementations( + new Uri(interfaceUri), + { applyRedirects: true } + ); + + expect(getImplementationsResult).toEqual([ + new Uri(implementation2Uri) + ]); + }); + + it("get implementations - return implementations for plugins which don't have interface stated in manifest", () => { + const interfaceUri = "w3://ens/some-interface.eth"; + + const implementation1Uri = "w3://ens/some-implementation1.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + + const client = new Web3ApiClient({ + plugins: [ + { + uri: implementation1Uri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: '', + implements: [], + } + } + } + ], + interfaces: [ + { + interface: interfaceUri, + implementations: [ + implementation1Uri, + implementation2Uri + ] + } + ] + }); + + const getImplementationsResult = client.getImplementations( + new Uri(interfaceUri), + { applyRedirects: true } + ); + + expect(getImplementationsResult).toEqual([ + new Uri(implementation1Uri), + new Uri(implementation2Uri) + ]); + }); it("simple-storage", async () => { const api = await buildAndDeployApi( @@ -104,7 +488,7 @@ describe("Web3ApiClient", () => { expect(set.data).toBeTruthy(); expect(set.data?.setData.indexOf("0x")).toBeGreaterThan(-1); - const get = await client.query<{ + const getWithStringType = await client.query<{ getData: number; secondGetData: number; thirdGetData: number; @@ -134,11 +518,47 @@ describe("Web3ApiClient", () => { `, }); - expect(get.errors).toBeFalsy(); - expect(get.data).toBeTruthy(); - expect(get.data?.getData).toBe(55); - expect(get.data?.secondGetData).toBe(55); - expect(get.data?.thirdGetData).toBe(55); + expect(getWithStringType.errors).toBeFalsy(); + expect(getWithStringType.data).toBeTruthy(); + expect(getWithStringType.data?.getData).toBe(55); + expect(getWithStringType.data?.secondGetData).toBe(55); + expect(getWithStringType.data?.thirdGetData).toBe(55); + + const getWithUriType = await client.query<{ + getData: number; + secondGetData: number; + thirdGetData: number; + }>({ + uri: new Uri(ensUri), + query: ` + query { + getData( + address: "${address}" + connection: { + networkNameOrChainId: "testnet" + } + ) + secondGetData: getData( + address: "${address}" + connection: { + networkNameOrChainId: "testnet" + } + ) + thirdGetData: getData( + address: "${address}" + connection: { + networkNameOrChainId: "testnet" + } + ) + } + `, + }); + + expect(getWithUriType.errors).toBeFalsy(); + expect(getWithUriType.data).toBeTruthy(); + expect(getWithUriType.data?.getData).toBe(55); + expect(getWithUriType.data?.secondGetData).toBe(55); + expect(getWithUriType.data?.thirdGetData).toBe(55); }); it("object-types", async () => { @@ -899,4 +1319,169 @@ describe("Web3ApiClient", () => { /Property must be of type 'array'. Found 'map'./ ); }); + + it("loadWeb3Api - pass string or Uri", async () => { + const implementationUri = "w3://ens/some-implementation.eth"; + const schemaStr = "test-schema"; + + const client = new Web3ApiClient({ + plugins: [ + { + uri: implementationUri, + plugin: { + factory: () => ({} as Plugin), + manifest: { + schema: schemaStr, + implements: [], + } + } + } + ] + }); + + const apiWhenString = await client.loadWeb3Api(implementationUri); + const apiWhenUri = await client.loadWeb3Api(new Uri(implementationUri)); + + const schemaWhenString = await apiWhenString.getSchema(client); + const schemaWhenUri = await apiWhenUri.getSchema(client); + + expect(schemaWhenString).toEqual(schemaStr); + expect(schemaWhenUri).toEqual(schemaStr); + }); + + it("getImplementations - pass string or Uri", async () => { + const oldInterfaceUri = "ens/old.eth"; + const newInterfaceUri = "ens/new.eth"; + + const implementation1Uri = "w3://ens/some-implementation1.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + + const client = new Web3ApiClient({ + redirects: [ + { + from: oldInterfaceUri, + to: newInterfaceUri + } + ], + interfaces: [ + { + interface: oldInterfaceUri, + implementations: [ + implementation1Uri, + ] + }, + { + interface: newInterfaceUri, + implementations: [ + implementation2Uri, + ] + } + ] + }); + + let result = client.getImplementations(oldInterfaceUri); + expect(result).toEqual([implementation1Uri]); + + result = client.getImplementations(oldInterfaceUri, { applyRedirects: true }); + expect(result).toEqual([implementation1Uri, implementation2Uri]); + + let result2 = client.getImplementations(new Uri(oldInterfaceUri)); + expect(result2).toEqual([new Uri(implementation1Uri)]); + + result2 = client.getImplementations(new Uri(oldInterfaceUri), { applyRedirects: true }); + expect(result2).toEqual([new Uri(implementation1Uri), new Uri(implementation2Uri)]); + }); + + it("e2e interface implementations", async () => { + let interfaceApi = await buildAndDeployApi( + `${GetPathToTestApis()}/implementations/test-interface`, + ipfsProvider, + ensAddress + ); + const interfaceUri = `w3://ens/testnet/${interfaceApi.ensDomain}`; + + const implementationApi = await buildAndDeployApi( + `${GetPathToTestApis()}/implementations/test-api`, + ipfsProvider, + ensAddress + ); + const implementationUri = `w3://ens/testnet/${implementationApi.ensDomain}`; + + const client = await getClient({ + interfaces: [ + { + interface: interfaceUri, + implementations: [ + implementationUri + ] + } + ] + }); + + expect( + client.getImplementations(interfaceUri) + ) + .toEqual([implementationUri]); + + const query = await client.query<{ + queryMethod: string; + abstractQueryMethod: string; + }>({ + uri: implementationUri, + query: ` + query { + queryMethod( + arg: $argument1 + ) + abstractQueryMethod( + arg: $argument2 + ) + } + `, + variables: { + argument1: { + uint8: 1, + str: "Test String 1" + }, + argument2: { + str: "Test String 2" + } + } + }); + + expect(query.errors).toBeFalsy(); + expect(query.data).toBeTruthy(); + expect(query.data?.queryMethod).toEqual({ + uint8: 1, + str: "Test String 1" + }); + + expect(query.data?.abstractQueryMethod).toBe("Test String 2"); + + const mutation = await client.query<{ + mutationMethod: string; + abstractMutationMethod: string; + }>({ + uri: implementationUri, + query: ` + mutation { + mutationMethod( + arg: $argument1 + ) + abstractMutationMethod( + arg: $argument2 + ) + } + `, + variables: { + argument1: 1, + argument2: 2 + } + }); + + expect(mutation.errors).toBeFalsy(); + expect(mutation.data).toBeTruthy(); + expect(mutation.data?.mutationMethod).toBe(1); + expect(mutation.data?.abstractMutationMethod).toBe(2); + }); }); diff --git a/packages/js/client/src/createWeb3ApiClient.ts b/packages/js/client/src/createWeb3ApiClient.ts index 2981aa8f88..58950d0895 100644 --- a/packages/js/client/src/createWeb3ApiClient.ts +++ b/packages/js/client/src/createWeb3ApiClient.ts @@ -4,7 +4,7 @@ import { Web3ApiClient, ClientConfig } from "./Web3ApiClient"; import { PluginConfigs, modules, uris } from "./pluginConfigs"; -import { UriRedirect } from "@web3api/core-js"; +import { PluginRegistration } from "@web3api/core-js"; import { Tracer } from "@web3api/tracing-js"; export { PluginConfigs }; @@ -12,12 +12,12 @@ export { PluginConfigs }; export const createWeb3ApiClient = Tracer.traceFunc( "createWeb3ApiClient", async ( - plugins: PluginConfigs, + pluginConfigs: PluginConfigs, config?: ClientConfig ): Promise => { - const redirects: UriRedirect[] = []; + const plugins: PluginRegistration[] = []; - for (const plugin of Object.keys(plugins)) { + for (const plugin of Object.keys(pluginConfigs)) { let pluginModule: any; if (!modules[plugin]) { @@ -50,7 +50,7 @@ export const createWeb3ApiClient = Tracer.traceFunc( } const pluginPackage = pluginFactory( - (plugins as Record)[plugin] + (pluginConfigs as Record)[plugin] ); if ( @@ -64,22 +64,19 @@ export const createWeb3ApiClient = Tracer.traceFunc( ); } - redirects.push({ - from: uris[plugin], - to: pluginPackage, + plugins.push({ + uri: uris[plugin], + plugin: pluginPackage, }); } if (config) { return new Web3ApiClient({ ...config, - redirects: [ - ...redirects, - ...(config.redirects ? config.redirects : []), - ], + plugins: [...plugins, ...(config.plugins ? config.plugins : [])], }); } else { - return new Web3ApiClient({ redirects }); + return new Web3ApiClient({ plugins }); } } ); diff --git a/packages/js/client/src/default-client-config.ts b/packages/js/client/src/default-client-config.ts new file mode 100644 index 0000000000..584ed9025c --- /dev/null +++ b/packages/js/client/src/default-client-config.ts @@ -0,0 +1,67 @@ +import { ClientConfig } from "."; + +import { Uri, coreInterfaceUris } from "@web3api/core-js"; +import { ipfsPlugin } from "@web3api/ipfs-plugin-js"; +import { ethereumPlugin } from "@web3api/ethereum-plugin-js"; +import { ensPlugin } from "@web3api/ens-plugin-js"; +import { uts46Plugin } from "@web3api/uts46-plugin-js"; +import { sha3Plugin } from "@web3api/sha3-plugin-js"; +import { loggerPlugin } from "@web3api/logger-plugin-js"; +import { Tracer } from "@web3api/tracing-js"; + +export const getDefaultClientConfig = Tracer.traceFunc( + "client-js: getDefaultClientConfig", + (): ClientConfig => { + return { + redirects: [], + plugins: [ + // IPFS is required for downloading Web3API packages + { + uri: new Uri("w3://ens/ipfs.web3api.eth"), + plugin: ipfsPlugin({ provider: "https://ipfs.io" }), + }, + // ENS is required for resolving domain to IPFS hashes + { + uri: new Uri("w3://ens/ens.web3api.eth"), + plugin: ensPlugin({}), + }, + { + uri: new Uri("w3://ens/ethereum.web3api.eth"), + plugin: ethereumPlugin({ + networks: { + mainnet: { + provider: + "https://mainnet.infura.io/v3/b00b2c2cc09c487685e9fb061256d6a6", + }, + }, + }), + }, + { + uri: new Uri("w3://ens/js-logger.web3api.eth"), + plugin: loggerPlugin(), + }, + { + uri: new Uri("w3://ens/uts46.web3api.eth"), + plugin: uts46Plugin(), + }, + { + uri: new Uri("w3://ens/sha3.web3api.eth"), + plugin: sha3Plugin(), + }, + ], + interfaces: [ + { + interface: coreInterfaceUris.uriResolver, + implementations: [ + new Uri("w3://ens/ipfs.web3api.eth"), + new Uri("w3://ens/ens.web3api.eth"), + ], + }, + { + interface: coreInterfaceUris.logger, + implementations: [new Uri("w3://ens/js-logger.web3api.eth")], + }, + ], + }; + } +); diff --git a/packages/js/client/src/default-redirects.ts b/packages/js/client/src/default-redirects.ts deleted file mode 100644 index 7ce02df8bf..0000000000 --- a/packages/js/client/src/default-redirects.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Uri, UriRedirect } from "@web3api/core-js"; -import { ipfsPlugin } from "@web3api/ipfs-plugin-js"; -import { ethereumPlugin } from "@web3api/ethereum-plugin-js"; -import { ensPlugin } from "@web3api/ens-plugin-js"; -import { loggerPlugin } from "@web3api/logger-plugin-js"; -import { sha3Plugin } from "@web3api/sha3-plugin-js"; -import { uts46Plugin } from "@web3api/uts46-plugin-js"; -import { Tracer } from "@web3api/tracing-js"; - -export const getDefaultRedirects = Tracer.traceFunc( - "client-js: getDefaultRedirects", - (): UriRedirect[] => { - return [ - // IPFS is required for downloading Web3API packages - { - from: new Uri("w3://ens/ipfs.web3api.eth"), - to: ipfsPlugin({ provider: "https://ipfs.io" }), - }, - // ENS is required for resolving domain to IPFS hashes - { - from: new Uri("w3://ens/ens.web3api.eth"), - to: ensPlugin({}), - }, - { - from: new Uri("w3://ens/ethereum.web3api.eth"), - to: ethereumPlugin({ - networks: { - mainnet: { - provider: - "https://mainnet.infura.io/v3/b00b2c2cc09c487685e9fb061256d6a6", - }, - }, - }), - }, - { - from: new Uri("w3://ens/uts46.web3api.eth"), - to: uts46Plugin(), - }, - { - from: new Uri("w3://ens/sha3.web3api.eth"), - to: sha3Plugin(), - }, - { - from: new Uri("w3://w3/logger"), - to: loggerPlugin(), - }, - ]; - } -); diff --git a/packages/js/client/src/wasm/WasmWeb3Api.ts b/packages/js/client/src/wasm/WasmWeb3Api.ts index 6b12633ebe..0f5f3c24bf 100644 --- a/packages/js/client/src/wasm/WasmWeb3Api.ts +++ b/packages/js/client/src/wasm/WasmWeb3Api.ts @@ -17,7 +17,7 @@ import { Web3ApiManifest, Uri, Client, - ApiResolver, + UriResolver, InvokableModules, } from "@web3api/core-js"; import * as MsgPack from "@msgpack/msgpack"; @@ -43,7 +43,7 @@ export class WasmWeb3Api extends Api { constructor( private _uri: Uri, private _manifest: Web3ApiManifest, - private _apiResolver: Uri + private _uriResolver: Uri ) { super(); @@ -51,7 +51,7 @@ export class WasmWeb3Api extends Api { Tracer.setAttribute("input", { uri: this._uri, manifest: this._manifest, - apiResolver: this._apiResolver, + uriResolver: this._uriResolver, }); Tracer.endSpan(); } @@ -343,9 +343,9 @@ export class WasmWeb3Api extends Api { throw Error(`WasmWeb3Api: No module was found.`); } - const { data, error } = await ApiResolver.Query.getFile( + const { data, error } = await UriResolver.Query.getFile( client, - this._apiResolver, + this._uriResolver, this.combinePaths(this._uri.path, module.schema) ); @@ -398,14 +398,20 @@ export class WasmWeb3Api extends Api { ); } - const { data, error } = await ApiResolver.Query.getFile( + if (!moduleManifest.module) { + throw Error( + `Package manifest module ${module} does not contain a definition for module"` + ); + } + + const { data, error } = await UriResolver.Query.getFile( client, - this._apiResolver, + this._uriResolver, this.combinePaths(this._uri.path, moduleManifest.module) ); if (error) { - throw Error(`ApiResolver.Query.getFile Failed: ${error}`); + throw Error(`UriResolver.Query.getFile Failed: ${error}`); } // If nothing is returned, the module was not found diff --git a/packages/js/core/scripts/manifest/migrate-ts.mustache b/packages/js/core/scripts/manifest/migrate-ts.mustache index 7b12b49e21..3a55ddf133 100644 --- a/packages/js/core/scripts/manifest/migrate-ts.mustache +++ b/packages/js/core/scripts/manifest/migrate-ts.mustache @@ -25,7 +25,7 @@ type Migrator = { export const migrators: Migrator = { {{#prevFormats}} - "{{version}}": migrate_{{tsVersion}}_to_{{#latest}}{{tsVersion}}{{/latest}} + "{{version}}": migrate_{{tsVersion}}_to_{{#latest}}{{tsVersion}}{{/latest}}, {{/prevFormats}} }; diff --git a/packages/js/core/src/__tests__/InterfaceImplementations.spec.ts b/packages/js/core/src/__tests__/InterfaceImplementations.spec.ts new file mode 100644 index 0000000000..0b4bd442b0 --- /dev/null +++ b/packages/js/core/src/__tests__/InterfaceImplementations.spec.ts @@ -0,0 +1,26 @@ +import { Uri } from "../"; +import { sanitizeInterfaceImplementations } from "../types"; + +describe("sanitizeInterfaceImplementations", () => { + it("Returns empty array if empty array passed", () => { + const interfaces = sanitizeInterfaceImplementations([]); + + expect(interfaces).toEqual([]); + }); + + it("Returns interfaces from interfaces definitions", () => { + const interfaces = sanitizeInterfaceImplementations([ + { + interface: "w3://w3/interface", + implementations: ["w3://w3/api1", "w3://w3/api2"] + } + ]); + + expect(interfaces).toEqual([ + { + interface: new Uri("w3://w3/interface"), + implementations: [new Uri("w3://w3/api1"), new Uri("w3://w3/api2")] + } + ]); + }); +}); diff --git a/packages/js/core/src/__tests__/Plugin.spec.ts b/packages/js/core/src/__tests__/Plugin.spec.ts index fb391338de..ba0b601c0a 100644 --- a/packages/js/core/src/__tests__/Plugin.spec.ts +++ b/packages/js/core/src/__tests__/Plugin.spec.ts @@ -3,7 +3,7 @@ import { Plugin, PluginModules, PluginManifest, - Uri + Uri, } from ".."; const testPluginManifest: PluginManifest = { @@ -16,8 +16,7 @@ const testPluginManifest: PluginManifest = { testMutation: Boolean! } `, - imported: [new Uri("host/path")], - implemented: [new Uri("host2/path2")], + implements: [new Uri("host2/path2")], }; class TestPlugin extends Plugin { @@ -43,7 +42,7 @@ describe("Plugin", () => { it("sanity", () => { const modules = plugin.getModules({} as Client); - expect(testPluginManifest.implemented.length).toBe(1); + expect(testPluginManifest.implements.length).toBe(1); expect(modules.mutation).toBeTruthy(); expect(modules.mutation?.testMutation).toBeTruthy(); }); diff --git a/packages/js/core/src/__tests__/PluginRegistrations.spec.ts b/packages/js/core/src/__tests__/PluginRegistrations.spec.ts new file mode 100644 index 0000000000..fbce4568f5 --- /dev/null +++ b/packages/js/core/src/__tests__/PluginRegistrations.spec.ts @@ -0,0 +1,26 @@ +import { Uri } from "../"; +import { PluginPackage, sanitizePluginRegistrations } from "../types"; + +describe("sanitizePluginRegistrations", () => { + it("Returns empty array if empty array passed", () => { + const plugins = sanitizePluginRegistrations([]); + + expect(plugins).toEqual([]); + }); + + it("Returns plugins from plugins definitions", () => { + const plugins = sanitizePluginRegistrations([ + { + uri: "w3://w3/api", + plugin: {} as PluginPackage, + } + ]); + + expect(plugins).toEqual([ + { + uri: new Uri("w3://w3/api"), + plugin: {} as PluginPackage + } + ]); + }); +}); diff --git a/packages/js/core/src/__tests__/UriRedirect.spec.ts b/packages/js/core/src/__tests__/UriRedirect.spec.ts index c822454da7..70651123e8 100644 --- a/packages/js/core/src/__tests__/UriRedirect.spec.ts +++ b/packages/js/core/src/__tests__/UriRedirect.spec.ts @@ -1,5 +1,4 @@ import { Uri } from "../"; -import { PluginPackage } from "../types"; import { sanitizeUriRedirects } from "../types/UriRedirect"; describe("sanitizeUriRedirects", () => { @@ -14,10 +13,6 @@ describe("sanitizeUriRedirects", () => { { from: "w3://w3/api", to: "w3://w3/api" - }, - { - from: "w3://w3/api", - to: {} as PluginPackage, } ]); @@ -25,10 +20,6 @@ describe("sanitizeUriRedirects", () => { { from: new Uri("w3://w3/api"), to: new Uri("w3://w3/api") - }, - { - from: new Uri("w3://w3/api"), - to: {} as PluginPackage, } ]); }); diff --git a/packages/js/core/src/__tests__/apply-redirects.spec.ts b/packages/js/core/src/__tests__/apply-redirects.spec.ts new file mode 100644 index 0000000000..cd051e2371 --- /dev/null +++ b/packages/js/core/src/__tests__/apply-redirects.spec.ts @@ -0,0 +1,53 @@ +import { + Uri, + applyRedirects +} from "../"; + +describe("applyRedirects", () => { + + it("works with the typical use case", () => { + const uri1 = "w3://ens/some-uri1.eth"; + const uri2 = "w3://ens/some-uri2.eth"; + + const redirectedUri = applyRedirects(new Uri(uri1), [ + { + from: new Uri(uri1), + to: new Uri(uri2) + } + ]); + + expect(Uri.equals(redirectedUri, new Uri(uri2))).toBeTruthy(); + }); + + it("works with the redirect stack overrides", () => { + const uri1 = "w3://ens/some-uri1.eth"; + const uri2 = "w3://ens/some-uri2.eth"; + const uri3 = "w3://ens/some-uri3.eth"; + + const redirectedUri = applyRedirects(new Uri(uri1), [ + { + from: new Uri(uri1), + to: new Uri(uri2) + }, + { + from: new Uri(uri1), + to: new Uri(uri3) + } + ]); + + expect(Uri.equals(redirectedUri, new Uri(uri2))).toBeTruthy(); + }); + + it("can not redirect to self", () => { + const uri = "w3://ens/some-uri.eth"; + + expect(() => { + applyRedirects(new Uri(uri), [ + { + from: new Uri(uri), + to: new Uri(uri) + } + ]); + }).toThrow(/Infinite loop while resolving URI/); + }); +}); diff --git a/packages/js/core/src/__tests__/get-implementations.spec.ts b/packages/js/core/src/__tests__/get-implementations.spec.ts index 72f4688855..7faabdaf4e 100644 --- a/packages/js/core/src/__tests__/get-implementations.spec.ts +++ b/packages/js/core/src/__tests__/get-implementations.spec.ts @@ -2,66 +2,120 @@ import { getImplementations, Uri, UriRedirect, - Plugin, } from "../"; +import { InterfaceImplementations } from "../types"; describe("getImplementations", () => { - it("works in the typical case", () => { - const implementations: UriRedirect[] = [ + + it("works with complex redirects", () => { + const interface1Uri = "w3://ens/some-interface1.eth"; + const interface2Uri = "w3://ens/some-interface2.eth"; + const interface3Uri = "w3://ens/some-interface3.eth"; + + const implementation1Uri = "w3://ens/some-implementation.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + const implementation3Uri = "w3://ens/some-implementation3.eth"; + + const redirects: UriRedirect[] = [ { - from: new Uri("authority/some-abstract-interface"), - to: new Uri("one/1"), + from: new Uri(interface1Uri), + to: new Uri(interface2Uri) }, { - from: new Uri("authority/some-abstract-interface"), - to: { - factory: () => ({} as Plugin), - manifest: { - schema: "", - implemented: [new Uri("authority/some-abstract-interface")], - imported: [], - }, - }, + from: new Uri(implementation1Uri), + to: new Uri(implementation2Uri) }, { - from: new Uri("something/else"), - to: { - factory: () => ({} as Plugin), - manifest: { - schema: "", - implemented: [new Uri("authority/some-abstract-interface")], - imported: [new Uri("something/else-2")], - }, - }, - }, + from: new Uri(implementation2Uri), + to: new Uri(implementation3Uri) + } ]; - const others: UriRedirect[] = [ + const interfaces: InterfaceImplementations[] = [ { - from: new Uri("some-other/other"), - to: new Uri("other/other"), + interface: new Uri(interface1Uri), + implementations: [ + new Uri(implementation1Uri), + new Uri(implementation2Uri) + ] }, { - from: new Uri("some-other/other1"), - to: { - factory: () => ({} as Plugin), - manifest: { - schema: "", - implemented: [], - imported: [], - }, - }, + interface: new Uri(interface2Uri), + implementations: [ + new Uri(implementation3Uri) + ] }, + { + interface: new Uri(interface3Uri), + implementations: [ + new Uri(implementation3Uri) + ] + } ]; - const result = getImplementations( - new Uri("authority/some-abstract-interface"), - [...implementations, ...others] - ); + const getImplementationsResult1 = getImplementations( + new Uri(interface1Uri), + redirects, + interfaces + ); + const getImplementationsResult2 = getImplementations( + new Uri(interface2Uri), + redirects, + interfaces + ); + const getImplementationsResult3 = getImplementations( + new Uri(interface3Uri), + redirects, + interfaces + ); + + expect(getImplementationsResult1).toEqual([ + new Uri(implementation1Uri), + new Uri(implementation2Uri), + new Uri(implementation3Uri) + ]); + + expect(getImplementationsResult2).toEqual([ + new Uri(implementation1Uri), + new Uri(implementation2Uri), + new Uri(implementation3Uri) + ]); + + expect(getImplementationsResult3).toEqual([ + new Uri(implementation3Uri) + ]); + }); + + it("interface implementations are not redirected", () => { + const interface1Uri = "w3://ens/some-interface1.eth"; + + const implementation1Uri = "w3://ens/some-implementation.eth"; + const implementation2Uri = "w3://ens/some-implementation2.eth"; + + const redirects: UriRedirect[] = [ + { + from: new Uri(implementation1Uri), + to: new Uri(implementation2Uri) + } + ]; + + const interfaces: InterfaceImplementations[] = [ + { + interface: new Uri(interface1Uri), + implementations: [ + new Uri(implementation1Uri) + ] + } + ]; - const values = implementations.map((item) => - Uri.isUri(item.to) ? item.to : item.from - ); - expect(result).toMatchObject(values); + const getImplementationsResult = getImplementations( + new Uri(interface1Uri), + redirects, + interfaces + ); + + expect(getImplementationsResult).toEqual([ + new Uri(implementation1Uri) + ]); }); }); diff --git a/packages/js/core/src/__tests__/resolve-uri.spec.ts b/packages/js/core/src/__tests__/resolve-uri.spec.ts index d0a141b5ef..a107575b52 100644 --- a/packages/js/core/src/__tests__/resolve-uri.spec.ts +++ b/packages/js/core/src/__tests__/resolve-uri.spec.ts @@ -1,6 +1,6 @@ import { Api, - ApiResolver, + UriResolver, Client, InvokeApiOptions, InvokeApiResult, @@ -14,17 +14,17 @@ import { UriRedirect, resolveUri, } from "../"; +import { coreInterfaceUris } from "../interfaces"; +import { InterfaceImplementations, PluginRegistration } from "../types"; describe("resolveUri", () => { const client = ( - redirects: UriRedirect[], - apis: Record + apis: Record, ): Client => ({ - redirects: () => redirects, query: < TData extends Record = Record, TVariables extends Record = Record, - >(_options: QueryApiOptions): Promise> => { + >(_options: QueryApiOptions): Promise> => { return Promise.resolve({ data: ({ foo: "foo", @@ -32,10 +32,14 @@ describe("resolveUri", () => { }); }, invoke: ( - options: InvokeApiOptions + options: InvokeApiOptions ): Promise> => { + let uri = options.uri; + if (Uri.isUri(uri)) { + uri = uri.uri; + } return Promise.resolve({ - data: apis[options.uri]?.[options.module]?.[options.method]( + data: apis[uri]?.[options.module]?.[options.method]( options.input as Record, {} as Client ) as TData, @@ -55,13 +59,13 @@ describe("resolveUri", () => { }; }; - const createApi = (uri: Uri, manifest: Web3ApiManifest, apiResolver: Uri): Api => { + const createApi = (uri: Uri, manifest: Web3ApiManifest, uriResolver: Uri): Api => { return { invoke: () => Promise.resolve({ uri, manifest, - apiResolver, + uriResolver, } as InvokeApiResult), getSchema: (_client: Client): Promise => Promise.resolve("") @@ -89,7 +93,7 @@ describe("resolveUri", () => { ) => { return { manifest: - input.authority === "ipfs" ? "format: 0.0.1-prealpha.2\ndog: cat" : undefined, + input.authority === "ipfs" ? "format: 0.0.1-prealpha.3\ndog: cat" : undefined, }; }, }, @@ -103,32 +107,34 @@ describe("resolveUri", () => { ) => { return { manifest: - input.authority === "my" ? "format: 0.0.1-prealpha.2" : undefined, + input.authority === "my" ? "format: 0.0.1-prealpha.3" : undefined, }; }, }, }; - const redirects: UriRedirect[] = [ + const plugins: PluginRegistration[] = [ { - from: new Uri("w3/api-resolver"), - to: new Uri("ens/ens"), - }, - { - from: new Uri("w3/api-resolver"), - to: new Uri("ens/ipfs"), - }, - { - from: new Uri("ens/my-plugin"), - to: { + uri: new Uri("ens/my-plugin"), + plugin: { factory: () => ({} as Plugin), manifest: { schema: "", - implemented: [new Uri("w3/api-resolver")], - imported: [], + implements: [coreInterfaceUris.uriResolver], }, }, }, + ] + + const interfaces: InterfaceImplementations[] = [ + { + interface: coreInterfaceUris.uriResolver, + implementations: [ + new Uri("ens/ens"), + new Uri("ens/ipfs"), + new Uri("ens/my-plugin") + ] + }, ]; const apis: Record = { @@ -141,17 +147,20 @@ describe("resolveUri", () => { const api = new Uri("w3://ens/ens"); const file = new Uri("w3/some-file"); const path = "w3/some-path"; - const query = ApiResolver.Query; + const query = UriResolver.Query; const uri = new Uri("w3/some-uri"); - expect(query.tryResolveUri(client(redirects, apis), api, uri)).toBeDefined(); - expect(query.getFile(client(redirects, apis), file, path)).toBeDefined(); + expect(query.tryResolveUri(client(apis), api, uri)).toBeDefined(); + expect(query.getFile(client(apis), file, path)).toBeDefined(); }); it("works in the typical case", async () => { const result = await resolveUri( new Uri("ens/test.eth"), - client(redirects, apis), + client(apis), + [], + plugins, + interfaces, createPluginApi, createApi, true @@ -165,16 +174,19 @@ describe("resolveUri", () => { expect(apiIdentity).toMatchObject({ uri: new Uri("ipfs/QmHash"), manifest: { - format: "0.0.1-prealpha.2" + format: "0.0.1-prealpha.3" }, - apiResolver: new Uri("ens/ipfs"), + uriResolver: new Uri("ens/ipfs"), }); }); - it("uses a plugin that implements api-resolver", async () => { + it("uses a plugin that implements uri-resolver", async () => { const result = await resolveUri( new Uri("my/something-different"), - client(redirects, apis), + client(apis), + [], + plugins, + interfaces, createPluginApi, createApi, true @@ -188,16 +200,19 @@ describe("resolveUri", () => { expect(apiIdentity).toMatchObject({ uri: new Uri("my/something-different"), manifest: { - format: "0.0.1-prealpha.2" + format: "0.0.1-prealpha.3" }, - apiResolver: new Uri("ens/my-plugin"), + uriResolver: new Uri("ens/my-plugin"), }); }); - it("works when direct query a Web3API that implements the api-resolver", async () => { + it("works when direct query a Web3API that implements the uri-resolver", async () => { const result = await resolveUri( new Uri("ens/ens"), - client(redirects, apis), + client(apis), + [], + plugins, + interfaces, createPluginApi, createApi, true @@ -211,17 +226,20 @@ describe("resolveUri", () => { expect(apiIdentity).toMatchObject({ uri: new Uri("ipfs/QmHash"), manifest: { - format: "0.0.1-prealpha.2", + format: "0.0.1-prealpha.3", dog: "cat" }, - apiResolver: new Uri("ens/ipfs"), + uriResolver: new Uri("ens/ipfs"), }); }); - it("works when direct query a plugin Web3API that implements the api-resolver", async () => { + it("works when direct query a plugin Web3API that implements the uri-resolver", async () => { const result = await resolveUri( new Uri("my/something-different"), - client(redirects, apis), + client(apis), + [], + plugins, + interfaces, createPluginApi, createApi, true @@ -235,15 +253,14 @@ describe("resolveUri", () => { expect(apiIdentity).toMatchObject({ uri: new Uri("my/something-different"), manifest: { - format: "0.0.1-prealpha.2" + format: "0.0.1-prealpha.3" }, - apiResolver: new Uri("ens/my-plugin"), + uriResolver: new Uri("ens/my-plugin"), }); }); it("throws when circular redirect loops are found", async () => { const circular: UriRedirect[] = [ - ...redirects, { from: new Uri("some/api"), to: new Uri("ens/api"), @@ -258,7 +275,10 @@ describe("resolveUri", () => { return resolveUri( new Uri("some/api"), - client(circular, apis), + client(apis), + circular, + plugins, + interfaces, createPluginApi, createApi, true @@ -269,7 +289,6 @@ describe("resolveUri", () => { it("throws when redirect missing the from property", async () => { const missingFromProperty: UriRedirect[] = [ - ...redirects, { from: new Uri("some/api"), to: new Uri("ens/api"), @@ -284,7 +303,10 @@ describe("resolveUri", () => { return resolveUri( new Uri("some/api"), - client(missingFromProperty, apis), + client(apis), + missingFromProperty, + plugins, + interfaces, createPluginApi, createApi, true @@ -293,17 +315,16 @@ describe("resolveUri", () => { ); }); - it("works when a Web3API redirects to a Plugin", async () => { - const uriToPlugin: UriRedirect[] = [ - ...redirects, + it("works when a Web3API registers a Plugin", async () => { + const pluginRegistrations: PluginRegistration[] = [ + ...plugins, { - from: new Uri("some/api"), - to: { + uri: new Uri("some/api"), + plugin: { factory: () => ({} as Plugin), manifest: { schema: "", - implemented: [new Uri("w3/api-resolver")], - imported: [], + implements: [coreInterfaceUris.uriResolver], }, }, }, @@ -311,7 +332,10 @@ describe("resolveUri", () => { const result = await resolveUri( new Uri("some/api"), - client(uriToPlugin, apis), + client(apis), + [], + pluginRegistrations, + interfaces, createPluginApi, createApi, true @@ -346,10 +370,13 @@ describe("resolveUri", () => { await resolveUri( uri, - client(redirects, { + client({ ...apis, "w3://ens/ipfs": faultyIpfsApi }), + [], + plugins, + interfaces, createPluginApi, createApi, true diff --git a/packages/js/core/src/algorithms/apply-redirects.ts b/packages/js/core/src/algorithms/apply-redirects.ts new file mode 100644 index 0000000000..336139a1ff --- /dev/null +++ b/packages/js/core/src/algorithms/apply-redirects.ts @@ -0,0 +1,51 @@ +import { Uri, UriRedirect } from "../types"; + +import { Tracer } from "@web3api/tracing-js"; + +export const applyRedirects = Tracer.traceFunc( + "core: applyRedirects", + (uri: Uri, redirects: readonly UriRedirect[]): Uri => { + // Keep track of past redirects (from -> to) to find the final uri + const redirectFromToMap: Record = {}; + + const throwError = (message: string) => { + throw Error( + `${message}\nResolution Stack: ${JSON.stringify( + redirectFromToMap, + null, + 2 + )}` + ); + }; + + for (const redirect of redirects) { + if (!redirect.from) { + throwError( + `Redirect missing the from property.\nEncountered while resolving ${uri.uri}` + ); + } + + if (redirectFromToMap[redirect.from.uri]) { + continue; + } + + redirectFromToMap[redirect.from.uri] = redirect.to; + } + + let finalUri = uri; + + const visitedUris: Record = {}; + + while (redirectFromToMap[finalUri.uri]) { + visitedUris[finalUri.uri] = true; + + finalUri = redirectFromToMap[finalUri.uri]; + + if (visitedUris[finalUri.uri]) { + throwError(`Infinite loop while resolving URI "${uri}".`); + } + } + + return finalUri; + } +); diff --git a/packages/js/core/src/algorithms/find-plugin-package.ts b/packages/js/core/src/algorithms/find-plugin-package.ts new file mode 100644 index 0000000000..900a9df41c --- /dev/null +++ b/packages/js/core/src/algorithms/find-plugin-package.ts @@ -0,0 +1,15 @@ +import { Uri, PluginPackage, PluginRegistration } from "../types"; + +import { Tracer } from "@web3api/tracing-js"; + +export const findPluginPackage = Tracer.traceFunc( + "core: findPluginPackage", + ( + uri: Uri, + plugins: readonly PluginRegistration[] + ): PluginPackage | undefined => { + const pluginRedirect = plugins.find((x) => Uri.equals(x.uri, uri)); + + return pluginRedirect?.plugin as PluginPackage | undefined; + } +); diff --git a/packages/js/core/src/algorithms/get-implementations.ts b/packages/js/core/src/algorithms/get-implementations.ts index 7d4ea586fe..289e038ed4 100644 --- a/packages/js/core/src/algorithms/get-implementations.ts +++ b/packages/js/core/src/algorithms/get-implementations.ts @@ -1,10 +1,15 @@ -import { Uri, UriRedirect } from "../types"; +import { Uri, UriRedirect, InterfaceImplementations } from "../types"; +import { applyRedirects } from "./apply-redirects"; import { Tracer } from "@web3api/tracing-js"; export const getImplementations = Tracer.traceFunc( "core: getImplementations", - (abstractApi: Uri, redirects: readonly UriRedirect[]): Uri[] => { + ( + apiInterfaceUri: Uri, + redirects: readonly UriRedirect[], + interfaces: readonly InterfaceImplementations[] + ): Uri[] => { const result: Uri[] = []; const addUniqueResult = (uri: Uri) => { @@ -14,24 +19,33 @@ export const getImplementations = Tracer.traceFunc( } }; - for (const redirect of redirects) { - // Plugin implemented check - if (!Uri.isUri(redirect.to)) { - const { implemented } = redirect.to.manifest; - const implementedApi = - implemented.findIndex((uri) => Uri.equals(uri, abstractApi)) > -1; + const addAllImplementationsFromImplementationsArray = ( + implementationsArray: readonly InterfaceImplementations[], + apiInterfaceUri: Uri + ) => { + for (const interfaceImplementations of implementationsArray) { + const fullyResolvedUri = applyRedirects( + interfaceImplementations.interface, + redirects + ); - if (implementedApi) { - addUniqueResult(redirect.from); + if (Uri.equals(fullyResolvedUri, apiInterfaceUri)) { + for (const implementation of interfaceImplementations.implementations) { + addUniqueResult(implementation); + } } } - // Explicit check - else if (Uri.isUri(redirect.from)) { - if (Uri.equals(redirect.from, abstractApi)) { - addUniqueResult(redirect.to); - } - } - } + }; + + const finalRedirectedApiInterface = applyRedirects( + apiInterfaceUri, + redirects + ); + + addAllImplementationsFromImplementationsArray( + interfaces, + finalRedirectedApiInterface + ); return result; } diff --git a/packages/js/core/src/algorithms/index.ts b/packages/js/core/src/algorithms/index.ts index efa8ed2fab..7c3c240d99 100644 --- a/packages/js/core/src/algorithms/index.ts +++ b/packages/js/core/src/algorithms/index.ts @@ -1,4 +1,6 @@ +export * from "./apply-redirects"; export * from "./filter-results"; +export * from "./find-plugin-package"; export * from "./get-implementations"; export * from "./parse-query"; export * from "./resolve-uri"; diff --git a/packages/js/core/src/algorithms/resolve-uri.ts b/packages/js/core/src/algorithms/resolve-uri.ts index 92a690f75c..d4bb9f6a7c 100644 --- a/packages/js/core/src/algorithms/resolve-uri.ts +++ b/packages/js/core/src/algorithms/resolve-uri.ts @@ -1,7 +1,17 @@ -import { Api, Client, Uri, PluginPackage } from "../types"; +import { + Api, + Client, + Uri, + PluginPackage, + InterfaceImplementations, + PluginRegistration, + UriRedirect, +} from "../types"; import { Web3ApiManifest, deserializeWeb3ApiManifest } from "../manifest"; -import * as ApiResolver from "../apis/api-resolver"; +import { applyRedirects } from "./apply-redirects"; +import { findPluginPackage } from "./find-plugin-package"; import { getImplementations } from "./get-implementations"; +import { coreInterfaceUris, UriResolver } from "../interfaces"; import { Tracer } from "@web3api/tracing-js"; @@ -10,154 +20,138 @@ export const resolveUri = Tracer.traceFunc( async ( uri: Uri, client: Client, + redirects: readonly UriRedirect[], + plugins: readonly PluginRegistration[], + interfaces: readonly InterfaceImplementations[], createPluginApi: (uri: Uri, plugin: PluginPackage) => Api, - createApi: (uri: Uri, manifest: Web3ApiManifest, apiResolver: Uri) => Api, + createApi: (uri: Uri, manifest: Web3ApiManifest, uriResolver: Uri) => Api, noValidate?: boolean ): Promise => { - let resolvedUri = uri; - - // Keep track of past URIs to avoid infinite loops - let uriHistory: { uri: string; source: string }[] = [ - { - uri: resolvedUri.uri, - source: "ROOT", - }, - ]; - - const trackUriRedirect = (uri: string, source: string) => { - const dupIdx = uriHistory.findIndex((item) => item.uri === uri); - uriHistory.push({ - uri, - source, - }); - if (dupIdx > -1) { - throw Error( - `Infinite loop while resolving URI "${uri}".\nResolution Stack: ${JSON.stringify( - uriHistory, - null, - 2 - )}` - ); - } - }; - - const resetUriHistory = () => { - uriHistory = [ - { - uri: resolvedUri.uri, - source: "ROOT", - }, - ]; - }; - - const redirects = client.redirects(); - - // Iterate through all redirects. If anything matches - // apply the redirect, and restart the process over again. - // If the redirect `to` is a Plugin, return a PluginWeb3Api instance. - for (let i = 0; i < redirects.length; ++i) { - const redirect = redirects[i]; - const from = redirect.from; - - if (!from) { - throw Error( - `Redirect missing the from property.\nEncountered while resolving ${uri.uri}` - ); - } - - // Determine what type of comparison to use - const tryRedirect = (testUri: Uri): Uri | PluginPackage => - Uri.equals(testUri, from) ? redirect.to : testUri; - - const uriOrPlugin = tryRedirect(resolvedUri); - - // If we've redirected to another URI - if (Uri.isUri(uriOrPlugin)) { - if (uriOrPlugin.uri !== resolvedUri.uri) { - trackUriRedirect(uriOrPlugin.uri, redirect.from.uri); - - Tracer.addEvent("client-redirect", { - from: redirect.from.uri, - to: redirect.to, - }); - - // Restart the iteration over again - i = -1; - resolvedUri = uriOrPlugin; - } - } else { - // We've found a plugin, return an instance of it - return Tracer.traceFunc( - "resolveUri: createPluginApi", - (uri: Uri, plugin: PluginPackage) => createPluginApi(uri, plugin) - )(resolvedUri, uriOrPlugin); - } + const finalRedirectedUri = applyRedirects(uri, redirects); + + const plugin = findPluginPackage(finalRedirectedUri, plugins); + + if (plugin) { + return Tracer.traceFunc( + "resolveUri: createPluginApi", + (uri: Uri, plugin: PluginPackage) => createPluginApi(uri, plugin) + )(finalRedirectedUri, plugin); } // The final URI has been resolved, let's now resolve the Web3API package const uriResolverImplementations = getImplementations( - new Uri("w3/api-resolver"), - redirects + coreInterfaceUris.uriResolver, + redirects, + interfaces ); - // Clear the history of URI redirects, so we can now - // track api-resolver driven redirects - resetUriHistory(); - - // Iterate through all api-resolver implementations, - // iteratively resolving the URI until we reach the Web3API manifest - for (let i = 0; i < uriResolverImplementations.length; ++i) { - const uriResolver = uriResolverImplementations[i]; + return await resolveUriWithUriResolvers( + finalRedirectedUri, + uriResolverImplementations, + client, + createApi, + noValidate + ); + } +); - const { data } = await ApiResolver.Query.tryResolveUri( - client, - uriResolver, - resolvedUri +const resolveUriWithUriResolvers = async ( + uri: Uri, + uriResolverImplementationUris: Uri[], + client: Client, + createApi: (uri: Uri, manifest: Web3ApiManifest, uriResolver: Uri) => Api, + noValidate?: boolean +): Promise => { + let resolvedUri = uri; + + // Keep track of past URIs to avoid infinite loops + const uriHistory: { uri: string; source: string }[] = [ + { + uri: resolvedUri.uri, + source: "ROOT", + }, + ]; + + const trackUriRedirect = (uri: string, source: string) => { + const dupIdx = uriHistory.findIndex((item) => item.uri === uri); + uriHistory.push({ + uri, + source, + }); + if (dupIdx > -1) { + throw Error( + `Infinite loop while resolving URI "${uri}".\nResolution Stack: ${JSON.stringify( + uriHistory, + null, + 2 + )}` ); - - // If nothing was returned, the URI is not supported - if (!data || (!data.uri && !data.manifest)) { - Tracer.addEvent("continue", uriResolver.uri); - continue; - } - - const newUri = data.uri; - const manifestStr = data.manifest; - - if (newUri) { - // Use the new URI, and reset our index - const convertedUri = new Uri(newUri); - trackUriRedirect(convertedUri.uri, uriResolver.uri); - - Tracer.addEvent("api-resolver-redirect", { - from: resolvedUri.uri, - to: convertedUri.uri, - }); - - // Restart the iteration over again - i = -1; - resolvedUri = convertedUri; - continue; - } else if (manifestStr) { - // We've found our manifest at the current URI resolver - // meaning the URI resolver can also be used as an API resolver - const manifest = deserializeWeb3ApiManifest(manifestStr, { - noValidate, - }); - - return Tracer.traceFunc( - "resolveUri: createApi", - (uri: Uri, manifest: Web3ApiManifest, apiResolver: Uri) => - createApi(uri, manifest, apiResolver) - )(resolvedUri, manifest, uriResolver); - } } + }; - // We've failed to resolve the URI - throw Error( - `No Web3API found at URI: ${uri.uri}` + - `\nResolution Path: ${JSON.stringify(uriHistory, null, 2)}` + - `\nResolvers Used: ${uriResolverImplementations}` + const tryResolveUriWithUriResolver = async ( + uri: Uri, + uriResolver: Uri + ): Promise => { + const { data } = await UriResolver.Query.tryResolveUri( + client, + uriResolver, + uri ); + + // If nothing was returned, the URI is not supported + if (!data || (!data.uri && !data.manifest)) { + Tracer.addEvent("continue", uriResolver.uri); + return undefined; + } + + return data; + }; + + // Iterate through all uri-resolver implementations, + // iteratively resolving the URI until we reach the Web3API manifest + for (let i = 0; i < uriResolverImplementationUris.length; ++i) { + const uriResolver = uriResolverImplementationUris[i]; + + const result = await tryResolveUriWithUriResolver(resolvedUri, uriResolver); + + if (!result) { + continue; + } + + if (result.uri) { + // Use the new URI, and reset our index + const convertedUri = new Uri(result.uri); + trackUriRedirect(convertedUri.uri, uriResolver.uri); + + Tracer.addEvent("uri-resolver-redirect", { + from: resolvedUri.uri, + to: convertedUri.uri, + }); + + // Restart the iteration over again + i = -1; + resolvedUri = convertedUri; + continue; + } else if (result.manifest) { + // We've found our manifest at the current URI resolver + // meaning the URI resolver can also be used as an API resolver + const manifest = deserializeWeb3ApiManifest(result.manifest, { + noValidate, + }); + + return Tracer.traceFunc( + "resolveUri: createApi", + (uri: Uri, manifest: Web3ApiManifest, uriResolver: Uri) => + createApi(uri, manifest, uriResolver) + )(resolvedUri, manifest, uriResolver); + } } -); + + // We've failed to resolve the URI + throw Error( + `No Web3API found at URI: ${resolvedUri.uri}` + + `\nResolution Path: ${JSON.stringify(uriHistory, null, 2)}` + + `\nResolvers Used: ${uriResolverImplementationUris}` + ); +}; diff --git a/packages/js/core/src/apis/index.ts b/packages/js/core/src/apis/index.ts deleted file mode 100644 index 08399cc82b..0000000000 --- a/packages/js/core/src/apis/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as ApiResolver from "./api-resolver"; -export { ApiResolver }; diff --git a/packages/js/core/src/index.ts b/packages/js/core/src/index.ts index a9b255d330..d11c4b6eaf 100644 --- a/packages/js/core/src/index.ts +++ b/packages/js/core/src/index.ts @@ -1,4 +1,4 @@ export * from "./types"; export * from "./algorithms"; -export * from "./apis"; +export * from "./interfaces"; export * from "./manifest"; diff --git a/packages/js/core/src/interfaces/core-interface-uris.ts b/packages/js/core/src/interfaces/core-interface-uris.ts new file mode 100644 index 0000000000..c1e9f25ff4 --- /dev/null +++ b/packages/js/core/src/interfaces/core-interface-uris.ts @@ -0,0 +1,6 @@ +import { Uri } from "../"; + +export const coreInterfaceUris = { + uriResolver: new Uri("w3://ens/uri-resolver.core.web3api.eth"), + logger: new Uri("w3://ens/logger.core.web3api.eth"), +}; diff --git a/packages/js/core/src/interfaces/index.ts b/packages/js/core/src/interfaces/index.ts new file mode 100644 index 0000000000..6f5e6e96ae --- /dev/null +++ b/packages/js/core/src/interfaces/index.ts @@ -0,0 +1,4 @@ +import * as UriResolver from "./uri-resolver"; + +export { UriResolver }; +export * from "./core-interface-uris"; diff --git a/packages/js/core/src/apis/api-resolver.ts b/packages/js/core/src/interfaces/uri-resolver.ts similarity index 89% rename from packages/js/core/src/apis/api-resolver.ts rename to packages/js/core/src/interfaces/uri-resolver.ts index a48f42412b..2e60dffc60 100644 --- a/packages/js/core/src/apis/api-resolver.ts +++ b/packages/js/core/src/interfaces/uri-resolver.ts @@ -3,7 +3,7 @@ import { Uri, Client, InvokeApiResult } from "../"; import { Tracer } from "@web3api/tracing-js"; -interface MaybeUriOrManifest { +export interface MaybeUriOrManifest { uri?: string; manifest?: string; } @@ -11,7 +11,7 @@ interface MaybeUriOrManifest { // eslint-disable-next-line @typescript-eslint/naming-convention export const Query = { tryResolveUri: Tracer.traceFunc( - "core: api-resolver: tryResolveUri", + "core: uri-resolver: tryResolveUri", async ( client: Client, api: Uri, @@ -29,7 +29,7 @@ export const Query = { } ), getFile: Tracer.traceFunc( - "core: api-resolver: getFile", + "core: uri-resolver: getFile", async ( client: Client, api: Uri, diff --git a/packages/js/core/src/manifest/formats/web3api/0.0.1-prealpha.3.ts b/packages/js/core/src/manifest/formats/web3api/0.0.1-prealpha.3.ts new file mode 100644 index 0000000000..85fb6f215e --- /dev/null +++ b/packages/js/core/src/manifest/formats/web3api/0.0.1-prealpha.3.ts @@ -0,0 +1,33 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +/* tslint:disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface Web3ApiManifest { + format: "0.0.1-prealpha.3"; + repository?: string; + build?: string; + language?: string; + interface?: boolean; + modules: { + mutation?: { + schema: string; + module?: string; + }; + query?: { + schema: string; + module?: string; + }; + }; + import_redirects?: + | [] + | [ + { + uri: string; + schema: string; + } + ]; +} diff --git a/packages/js/core/src/manifest/formats/web3api/index.ts b/packages/js/core/src/manifest/formats/web3api/index.ts index 5a34f09e12..3153950981 100644 --- a/packages/js/core/src/manifest/formats/web3api/index.ts +++ b/packages/js/core/src/manifest/formats/web3api/index.ts @@ -11,24 +11,30 @@ import { import { Web3ApiManifest as Web3ApiManifest0_0_1_prealpha_2 } from "./0.0.1-prealpha.2"; +import { + Web3ApiManifest as Web3ApiManifest0_0_1_prealpha_3 +} from "./0.0.1-prealpha.3"; export { Web3ApiManifest0_0_1_prealpha_1, Web3ApiManifest0_0_1_prealpha_2, + Web3ApiManifest0_0_1_prealpha_3, }; export enum Web3ApiManifestFormats { "0.0.1-prealpha.1" = "0.0.1-prealpha.1", "0.0.1-prealpha.2" = "0.0.1-prealpha.2", + "0.0.1-prealpha.3" = "0.0.1-prealpha.3", } export type AnyWeb3ApiManifest = | Web3ApiManifest0_0_1_prealpha_1 | Web3ApiManifest0_0_1_prealpha_2 + | Web3ApiManifest0_0_1_prealpha_3 -export type Web3ApiManifest = Web3ApiManifest0_0_1_prealpha_2; +export type Web3ApiManifest = Web3ApiManifest0_0_1_prealpha_3; -export const latestWeb3ApiManifestFormat = Web3ApiManifestFormats["0.0.1-prealpha.2"] +export const latestWeb3ApiManifestFormat = Web3ApiManifestFormats["0.0.1-prealpha.3"] export { migrateWeb3ApiManifest } from "./migrate"; diff --git a/packages/js/core/src/manifest/formats/web3api/migrate.ts b/packages/js/core/src/manifest/formats/web3api/migrate.ts index 848a4e2943..402b0ad069 100644 --- a/packages/js/core/src/manifest/formats/web3api/migrate.ts +++ b/packages/js/core/src/manifest/formats/web3api/migrate.ts @@ -12,8 +12,11 @@ import { } from "."; import { - migrate as migrate_0_0_1_prealpha_1_to_0_0_1_prealpha_2 -} from "./migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.2"; + migrate as migrate_0_0_1_prealpha_1_to_0_0_1_prealpha_3 +} from "./migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.3"; +import { + migrate as migrate_0_0_1_prealpha_2_to_0_0_1_prealpha_3 +} from "./migrators/0.0.1-prealpha.2_to_0.0.1-prealpha.3"; import { Tracer } from "@web3api/tracing-js"; @@ -22,7 +25,8 @@ type Migrator = { }; export const migrators: Migrator = { - "0.0.1-prealpha.1": migrate_0_0_1_prealpha_1_to_0_0_1_prealpha_2 + "0.0.1-prealpha.1": migrate_0_0_1_prealpha_1_to_0_0_1_prealpha_3, + "0.0.1-prealpha.2": migrate_0_0_1_prealpha_2_to_0_0_1_prealpha_3, }; export const migrateWeb3ApiManifest = Tracer.traceFunc( diff --git a/packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.2.ts b/packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.3.ts similarity index 95% rename from packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.2.ts rename to packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.3.ts index ada0d27cbe..a5bc819f7f 100644 --- a/packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.2.ts +++ b/packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.1_to_0.0.1-prealpha.3.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { Web3ApiManifest as OldManifest } from "../0.0.1-prealpha.1"; -import { Web3ApiManifest as NewManifest } from "../0.0.1-prealpha.2"; +import { Web3ApiManifest as NewManifest } from "../0.0.1-prealpha.3"; export function migrate(old: OldManifest): NewManifest { const module = old.mutation || old.query; @@ -13,7 +13,7 @@ export function migrate(old: OldManifest): NewManifest { const language = module.module.language; return { - format: "0.0.1-prealpha.2", + format: "0.0.1-prealpha.3", repository: old.repository, language, modules: { diff --git a/packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.2_to_0.0.1-prealpha.3.ts b/packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.2_to_0.0.1-prealpha.3.ts new file mode 100644 index 0000000000..f7545a80c8 --- /dev/null +++ b/packages/js/core/src/manifest/formats/web3api/migrators/0.0.1-prealpha.2_to_0.0.1-prealpha.3.ts @@ -0,0 +1,11 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +import { Web3ApiManifest as OldManifest } from "../0.0.1-prealpha.2"; +import { Web3ApiManifest as NewManifest } from "../0.0.1-prealpha.3"; + +export function migrate(old: OldManifest): NewManifest { + return { + ...old, + format: "0.0.1-prealpha.3", + }; +} diff --git a/packages/js/core/src/manifest/formats/web3api/validate.ts b/packages/js/core/src/manifest/formats/web3api/validate.ts index d1ffb780b1..ec1afe777d 100644 --- a/packages/js/core/src/manifest/formats/web3api/validate.ts +++ b/packages/js/core/src/manifest/formats/web3api/validate.ts @@ -12,6 +12,7 @@ import * as Validators from "../../validators"; import schema_0_0_1_prealpha_1 from "@web3api/manifest-schemas/formats/web3api/0.0.1-prealpha.1.json"; import schema_0_0_1_prealpha_2 from "@web3api/manifest-schemas/formats/web3api/0.0.1-prealpha.2.json"; +import schema_0_0_1_prealpha_3 from "@web3api/manifest-schemas/formats/web3api/0.0.1-prealpha.3.json"; import { Tracer } from "@web3api/tracing-js" import { @@ -28,6 +29,7 @@ type Web3ApiManifestSchemas = { const schemas: Web3ApiManifestSchemas = { "0.0.1-prealpha.1": schema_0_0_1_prealpha_1, "0.0.1-prealpha.2": schema_0_0_1_prealpha_2, + "0.0.1-prealpha.3": schema_0_0_1_prealpha_3, }; const validator = new Validator(); diff --git a/packages/js/core/src/types/Client.ts b/packages/js/core/src/types/Client.ts index aacd8aca9c..efb89745be 100644 --- a/packages/js/core/src/types/Client.ts +++ b/packages/js/core/src/types/Client.ts @@ -1,5 +1,3 @@ -import { Uri, UriRedirect, QueryHandler, InvokeHandler } from "./"; +import { QueryHandler, InvokeHandler } from "./"; -export interface Client extends QueryHandler, InvokeHandler { - redirects: () => readonly UriRedirect[]; -} +export interface Client extends QueryHandler, InvokeHandler {} diff --git a/packages/js/core/src/types/InterfaceImplementations.ts b/packages/js/core/src/types/InterfaceImplementations.ts new file mode 100644 index 0000000000..9b02aaddfd --- /dev/null +++ b/packages/js/core/src/types/InterfaceImplementations.ts @@ -0,0 +1,31 @@ +import { Uri } from "."; + +import { Tracer } from "@web3api/tracing-js"; + +export interface InterfaceImplementations { + interface: TUri; + implementations: TUri[]; +} + +export const sanitizeInterfaceImplementations = Tracer.traceFunc( + "core: sanitizeInterfaceImplementations", + ( + input: InterfaceImplementations[] + ): InterfaceImplementations[] => { + const output: InterfaceImplementations[] = []; + for (const definition of input) { + const interfaceUri = new Uri(definition.interface); + + const implementations = definition.implementations.map((x) => + typeof x === "string" ? new Uri(x) : x + ); + + output.push({ + interface: interfaceUri, + implementations: implementations, + }); + } + + return output; + } +); diff --git a/packages/js/core/src/types/Invoke.ts b/packages/js/core/src/types/Invoke.ts index 9d77c016b3..9eff620292 100644 --- a/packages/js/core/src/types/Invoke.ts +++ b/packages/js/core/src/types/Invoke.ts @@ -56,4 +56,8 @@ export interface InvokeHandler { invoke( options: InvokeApiOptions ): Promise>; + + invoke( + options: InvokeApiOptions + ): Promise>; } diff --git a/packages/js/core/src/types/Plugin.ts b/packages/js/core/src/types/Plugin.ts index 89f08e64a3..c533828af4 100644 --- a/packages/js/core/src/types/Plugin.ts +++ b/packages/js/core/src/types/Plugin.ts @@ -5,11 +5,8 @@ export interface PluginManifest { /** The API's schema */ schema: string; - /** All API dependencies imported by this plugin. */ - imported: Uri[]; - - /** All abstract APIs implemented by this plugin. */ - implemented: Uri[]; + /** All interface schemas implemented by this plugin. */ + implements: Uri[]; } /** diff --git a/packages/js/core/src/types/PluginRegistration.ts b/packages/js/core/src/types/PluginRegistration.ts new file mode 100644 index 0000000000..c9888ff881 --- /dev/null +++ b/packages/js/core/src/types/PluginRegistration.ts @@ -0,0 +1,25 @@ +import { PluginPackage, Uri } from "."; + +import { Tracer } from "@web3api/tracing-js"; + +export interface PluginRegistration { + uri: TUri; + plugin: PluginPackage; +} + +export const sanitizePluginRegistrations = Tracer.traceFunc( + "core: sanitizePluginRegistrations", + (input: PluginRegistration[]): PluginRegistration[] => { + const output: PluginRegistration[] = []; + for (const definition of input) { + const uri = new Uri(definition.uri); + + output.push({ + uri, + plugin: definition.plugin, + }); + } + + return output; + } +); diff --git a/packages/js/core/src/types/Query.ts b/packages/js/core/src/types/Query.ts index 0c149c35ea..20e8aa60ea 100644 --- a/packages/js/core/src/types/Query.ts +++ b/packages/js/core/src/types/Query.ts @@ -85,4 +85,11 @@ export interface QueryHandler { >( options: QueryApiOptions ): Promise>; + + query< + TData extends Record = Record, + TVariables extends Record = Record + >( + options: QueryApiOptions + ): Promise>; } diff --git a/packages/js/core/src/types/UriRedirect.ts b/packages/js/core/src/types/UriRedirect.ts index 7df74b9f09..013aee6796 100644 --- a/packages/js/core/src/types/UriRedirect.ts +++ b/packages/js/core/src/types/UriRedirect.ts @@ -1,20 +1,15 @@ -import { PluginPackage, Uri } from "."; +import { Uri } from "."; import { Tracer } from "@web3api/tracing-js"; export interface UriRedirect { - /** Redirect from this URI */ from: TUri; - - /** The destination URI, or plugin, that will now handle the invocation. */ - // TODO: currently UriRedirects are used for: plugins, implementations, and redirects. This is either elegant, or confusing... - // Should look at what it looks like to seperate these. - to: TUri | PluginPackage; + to: TUri; } export const sanitizeUriRedirects = Tracer.traceFunc( "core: sanitizeUriRedirects", - (input: UriRedirect[]): UriRedirect[] => { + (input: UriRedirect[]): UriRedirect[] => { const output: UriRedirect[] = []; for (const definition of input) { const from = new Uri(definition.from); diff --git a/packages/js/core/src/types/index.ts b/packages/js/core/src/types/index.ts index a1b8371f88..9f5fec5dac 100644 --- a/packages/js/core/src/types/index.ts +++ b/packages/js/core/src/types/index.ts @@ -6,3 +6,5 @@ export * from "./Query"; export * from "./Invoke"; export * from "./Uri"; export * from "./UriRedirect"; +export * from "./InterfaceImplementations"; +export * from "./PluginRegistration"; diff --git a/packages/js/os/package.json b/packages/js/os/package.json index 6384108c7a..56a6a79848 100644 --- a/packages/js/os/package.json +++ b/packages/js/os/package.json @@ -12,13 +12,11 @@ "build" ], "scripts": { - "build": "rimraf ./build && tsc --project tsconfig.build.json", + "build": "rimraf ./build && tsc --project ./tsconfig.build.json", "lint": "eslint --color --ext .ts src/" }, - "dependencies": { - "@types/node": "12.7.11" - }, "devDependencies": { + "@types/node": "12.7.11", "rimraf": "3.0.2", "typescript": "4.0.7" }, diff --git a/packages/js/plugins/ens/schema.graphql b/packages/js/plugins/ens/schema.graphql index c1d9733fa9..95d45e220d 100644 --- a/packages/js/plugins/ens/schema.graphql +++ b/packages/js/plugins/ens/schema.graphql @@ -1,20 +1,72 @@ -# TODO: should import and "implements" the api-resolver core-api schema -# https://github.com/Web3-API/monorepo/issues/75 +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar UInt64 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Int64 +scalar Bytes +scalar BigInt -type Query { +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT +### Web3API Header END ### + +type Query implements UriResolver_Query @imports( + types: [ + "UriResolver_Query", + "UriResolver_MaybeUriOrManifest" + ] +) { tryResolveUri( authority: String! path: String! - ): ApiResolver_MaybeUriOrManifest + ): UriResolver_MaybeUriOrManifest getFile( path: String! ): Bytes } -# TODO: should get replaced with an import -# https://github.com/Web3-API/monorepo/issues/75 -type ApiResolver_MaybeUriOrManifest { +### Imported Queries START ### + +type UriResolver_Query @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "Query" +) { + tryResolveUri( + authority: String! + path: String! + ): UriResolver_MaybeUriOrManifest + + getFile( + path: String! + ): Bytes +} + +### Imported Queries END ### + +### Imported Objects START ### + +type UriResolver_MaybeUriOrManifest @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "MaybeUriOrManifest" +) { uri: String manifest: String } + +### Imported Objects END ### diff --git a/packages/js/plugins/ens/src/manifest.ts b/packages/js/plugins/ens/src/manifest.ts index d5eec16222..23bb91eefa 100644 --- a/packages/js/plugins/ens/src/manifest.ts +++ b/packages/js/plugins/ens/src/manifest.ts @@ -1,29 +1,80 @@ -import { PluginManifest, Uri } from "@web3api/core-js"; +import { PluginManifest, coreInterfaceUris } from "@web3api/core-js"; export const manifest: PluginManifest = { // TODO: use the schema.graphql // https://github.com/web3-api/monorepo/issues/101 - schema: ` -# TODO: should import and "implements" the api-resolver core-api schema -# https://github.com/Web3-API/monorepo/issues/75 + schema: `### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar UInt64 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Int64 +scalar Bytes +scalar BigInt -type Query { +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT +### Web3API Header END ### + +type Query implements UriResolver_Query @imports( + types: [ + "UriResolver_Query", + "UriResolver_MaybeUriOrManifest" + ] +) { + tryResolveUri( + authority: String! + path: String! + ): UriResolver_MaybeUriOrManifest + + getFile( + path: String! + ): Bytes +} + +### Imported Queries START ### + +type UriResolver_Query @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "Query" +) { tryResolveUri( authority: String! path: String! - ): ApiResolver_MaybeUriOrManifest + ): UriResolver_MaybeUriOrManifest getFile( path: String! ): Bytes } -# TODO: should get replaced with an import -# https://github.com/Web3-API/monorepo/issues/75 -type ApiResolver_MaybeUriOrManifest { +### Imported Queries END ### + +### Imported Objects START ### + +type UriResolver_MaybeUriOrManifest @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "MaybeUriOrManifest" +) { uri: String manifest: String -}`, - implemented: [new Uri("w3/api-resolver")], - imported: [new Uri("ens/ethereum.web3api.eth")], +} + +### Imported Objects END ### +`, + implements: [coreInterfaceUris.uriResolver], }; diff --git a/packages/js/plugins/ens/src/resolvers.ts b/packages/js/plugins/ens/src/resolvers.ts index 96cf18a4f5..0882e7b9b3 100644 --- a/packages/js/plugins/ens/src/resolvers.ts +++ b/packages/js/plugins/ens/src/resolvers.ts @@ -3,7 +3,7 @@ import { EnsPlugin } from "./"; import { Client, PluginModule } from "@web3api/core-js"; export const query = (ens: EnsPlugin, client: Client): PluginModule => ({ - // w3/api-resolver + // uri-resolver.core.web3api.eth tryResolveUri: async (input: { authority: string; path: string }) => { if (input.authority !== "ens") { return null; diff --git a/packages/js/plugins/ethereum/schema.graphql b/packages/js/plugins/ethereum/schema.graphql index 85fd016f68..f1bb82a883 100644 --- a/packages/js/plugins/ethereum/schema.graphql +++ b/packages/js/plugins/ethereum/schema.graphql @@ -37,7 +37,9 @@ type TxReceipt { blockHash: String! confirmations: UInt32! cumulativeGasUsed: BigInt! + effectiveGasPrice: BigInt! byzantium: Boolean! + type: UInt32! status: UInt32 } @@ -47,7 +49,7 @@ type TxResponse { from: String! nonce: UInt32! gasLimit: BigInt! - gasPrice: BigInt! + gasPrice: BigInt data: String! value: BigInt! chainId: UInt32! diff --git a/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts b/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts index 088c12f3de..0207c6f790 100644 --- a/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts +++ b/packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts @@ -37,10 +37,10 @@ describe("Ethereum Plugin", () => { registrarAddress = data.registrarAddress client = new Web3ApiClient({ - redirects: [ + plugins: [ { - from: "w3://ens/ethereum.web3api.eth", - to: ethereumPlugin({ + uri: "w3://ens/ethereum.web3api.eth", + plugin: ethereumPlugin({ networks: { testnet: { provider: ethereum @@ -50,15 +50,15 @@ describe("Ethereum Plugin", () => { }), }, { - from: "w3://ens/ipfs.web3api.eth", - to: ipfsPlugin({ + uri: "w3://ens/ipfs.web3api.eth", + plugin: ipfsPlugin({ provider: ipfs, fallbackProviders: ["https://ipfs.io"] }) }, { - from: "w3://ens/ens.web3api.eth", - to: ensPlugin({ + uri: "w3://ens/ens.web3api.eth", + plugin: ensPlugin({ addresses: { testnet: ensAddress } @@ -152,7 +152,7 @@ describe("Ethereum Plugin", () => { expect(response.errors).toBeUndefined(); expect(response.data?.callContractStatic).toBeDefined(); expect(response.data?.callContractStatic.error).toBeTruthy(); - expect(response.data?.callContractStatic.result).toBe("processing response error"); + expect(response.data?.callContractStatic.result).toBe("missing revert data in call exception"); }); it("encodeParams", async () => { @@ -351,8 +351,8 @@ describe("Ethereum Plugin", () => { `, }); - expect(awaitResponse.data?.awaitTransaction).toBeDefined() expect(awaitResponse.errors).toBeUndefined() + expect(awaitResponse.data?.awaitTransaction).toBeDefined() expect(awaitResponse.data?.awaitTransaction.transactionHash).toBeDefined() }); diff --git a/packages/js/plugins/ethereum/src/manifest.ts b/packages/js/plugins/ethereum/src/manifest.ts index 662075aeed..c4ebac3260 100644 --- a/packages/js/plugins/ethereum/src/manifest.ts +++ b/packages/js/plugins/ethereum/src/manifest.ts @@ -43,7 +43,9 @@ type TxReceipt { blockHash: String! confirmations: UInt32! cumulativeGasUsed: BigInt! + effectiveGasPrice: BigInt! byzantium: Boolean! + type: UInt32! status: UInt32 } @@ -53,7 +55,7 @@ type TxResponse { from: String! nonce: UInt32! gasLimit: BigInt! - gasPrice: BigInt! + gasPrice: BigInt data: String! value: BigInt! chainId: UInt32! @@ -245,6 +247,5 @@ type Mutation { connection: Connection ): String }`, - implemented: [], - imported: [], + implements: [], }; diff --git a/packages/js/plugins/ethereum/src/mapping.ts b/packages/js/plugins/ethereum/src/mapping.ts index 800a52c525..8cd5a8fe9d 100644 --- a/packages/js/plugins/ethereum/src/mapping.ts +++ b/packages/js/plugins/ethereum/src/mapping.ts @@ -5,7 +5,7 @@ import { ethers } from "ethers"; export const toTxReceipt = ( receipt: ethers.providers.TransactionReceipt ): TxReceipt => ({ - to: receipt.to, + to: receipt.to || "", from: receipt.from, contractAddress: receipt.contractAddress, transactionIndex: receipt.transactionIndex, @@ -18,7 +18,9 @@ export const toTxReceipt = ( blockHash: receipt.blockHash, confirmations: receipt.confirmations, cumulativeGasUsed: receipt.cumulativeGasUsed.toString(), + effectiveGasPrice: receipt.effectiveGasPrice?.toString() || "0", byzantium: receipt.byzantium, + type: receipt.type, status: receipt.status, }); @@ -40,6 +42,8 @@ export const fromTxReceipt = ( cumulativeGasUsed: ethers.BigNumber.from(receipt.cumulativeGasUsed), byzantium: receipt.byzantium, status: receipt.status, + effectiveGasPrice: ethers.BigNumber.from(receipt.effectiveGasPrice), + type: receipt.type, }); export const toTxResponse = ( @@ -50,7 +54,7 @@ export const toTxResponse = ( from: response.from, nonce: response.nonce, gasLimit: response.gasLimit.toString(), - gasPrice: response.gasPrice.toString(), + gasPrice: response.gasPrice?.toString(), data: response.data, value: response.value.toString(), chainId: response.chainId, diff --git a/packages/js/plugins/ethereum/src/types.ts b/packages/js/plugins/ethereum/src/types.ts index 882b5c9330..d1b47b08a2 100644 --- a/packages/js/plugins/ethereum/src/types.ts +++ b/packages/js/plugins/ethereum/src/types.ts @@ -23,7 +23,9 @@ export interface TxReceipt { blockHash: string; confirmations: UInt32; cumulativeGasUsed: BigInt; + effectiveGasPrice: BigInt; byzantium: boolean; + type: UInt32; status?: UInt32; } @@ -33,7 +35,7 @@ export interface TxResponse { from: string; nonce: UInt32; gasLimit: BigInt; - gasPrice: BigInt; + gasPrice?: BigInt; data: string; value: BigInt; chainId: UInt32; diff --git a/packages/js/plugins/graph-node/src/manifest.ts b/packages/js/plugins/graph-node/src/manifest.ts index 4a0aa8f7b8..2530c6c50e 100644 --- a/packages/js/plugins/graph-node/src/manifest.ts +++ b/packages/js/plugins/graph-node/src/manifest.ts @@ -12,6 +12,5 @@ type Query { """TODO: support JSON type as base type?""" """I think this would be helpful for dynamic data""" }`, - implemented: [], - imported: [], + implements: [], }; diff --git a/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts b/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts index 557c5ed868..8d66ddab36 100644 --- a/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts +++ b/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts @@ -9,6 +9,18 @@ const defaultReplyHeaders = { } describe("e2e tests for HttpPlugin", () => { + let web3ApiClient: Web3ApiClient; + + beforeEach(() => { + web3ApiClient = new Web3ApiClient({ + plugins: [ + { + uri: "w3://ens/http.web3api.eth", + plugin: httpPlugin(), + }, + ] + }); + }); describe("get method", () => { @@ -18,15 +30,6 @@ describe("e2e tests for HttpPlugin", () => { .get("/api") .reply(200, '{data: "test-response"}') - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ get: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` @@ -55,16 +58,6 @@ describe("e2e tests for HttpPlugin", () => { .get("/api") .reply(200, '{data: "test-response"}') - - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ get: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` @@ -94,15 +87,6 @@ describe("e2e tests for HttpPlugin", () => { .query({ query: "foo" }) .reply(200, '{data: "test-response"}', { 'X-Response-Header': "resp-foo" }) - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ get: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` @@ -137,16 +121,6 @@ describe("e2e tests for HttpPlugin", () => { .get("/api") .reply(404) - - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ get: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` @@ -175,16 +149,6 @@ describe("e2e tests for HttpPlugin", () => { .post("/api", "{data: 'test-request'}") .reply(200, '{data: "test-response"}') - - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ post: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` @@ -214,16 +178,6 @@ describe("e2e tests for HttpPlugin", () => { .post("/api", "{data: 'test-request'}") .reply(200, '{data: "test-response"}') - - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ post: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` @@ -254,15 +208,6 @@ describe("e2e tests for HttpPlugin", () => { .query({ query: "foo" }) .reply(200, '{data: "test-response"}', { 'X-Response-Header': "resp-foo" }) - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ post: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` @@ -298,16 +243,6 @@ describe("e2e tests for HttpPlugin", () => { .post("/api") .reply(404) - - const web3ApiClient = new Web3ApiClient({ - redirects: [ - { - from: "w3://ens/http.web3api.eth", - to: httpPlugin(), - }, - ] - }) - const response = await web3ApiClient.query<{ get: Response }>({ uri: "w3://ens/http.web3api.eth", query: ` diff --git a/packages/js/plugins/http/src/manifest.ts b/packages/js/plugins/http/src/manifest.ts index d54fe1aa11..39d6002248 100644 --- a/packages/js/plugins/http/src/manifest.ts +++ b/packages/js/plugins/http/src/manifest.ts @@ -43,6 +43,5 @@ type Mutation { post(url: String!, request: Request): Response } `, - implemented: [], - imported: [], + implements: [], }; diff --git a/packages/js/plugins/ipfs/schema.graphql b/packages/js/plugins/ipfs/schema.graphql index 36fdbc678b..16c7447c63 100644 --- a/packages/js/plugins/ipfs/schema.graphql +++ b/packages/js/plugins/ipfs/schema.graphql @@ -1,7 +1,34 @@ -# TODO: should import and "implements" the api-resolver core-api schema -# https://github.com/Web3-API/monorepo/issues/75 +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar UInt64 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Int64 +scalar Bytes +scalar BigInt -type Query { +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT +### Web3API Header END ### + +type Query implements UriResolver_Query @imports( + types: [ + "UriResolver_Query", + "UriResolver_MaybeUriOrManifest" + ] +) { catFile( cid: String! options: Options @@ -15,7 +42,7 @@ type Query { tryResolveUri( authority: String! path: String! - ): ApiResolver_MaybeUriOrManifest + ): UriResolver_MaybeUriOrManifest getFile( path: String! @@ -42,9 +69,34 @@ type Options { provider: String } -# TODO: should get replaced with an import -# https://github.com/Web3-API/monorepo/issues/75 -type ApiResolver_MaybeUriOrManifest { +### Imported Queries START ### + +type UriResolver_Query @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "Query" +) { + tryResolveUri( + authority: String! + path: String! + ): UriResolver_MaybeUriOrManifest + + getFile( + path: String! + ): Bytes +} + +### Imported Queries END ### + +### Imported Objects START ### + +type UriResolver_MaybeUriOrManifest @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "MaybeUriOrManifest" +) { uri: String manifest: String } + +### Imported Objects END ### diff --git a/packages/js/plugins/ipfs/src/manifest.ts b/packages/js/plugins/ipfs/src/manifest.ts index 7f6ca20cb7..d6a60062e9 100644 --- a/packages/js/plugins/ipfs/src/manifest.ts +++ b/packages/js/plugins/ipfs/src/manifest.ts @@ -1,13 +1,39 @@ -import { PluginManifest, Uri } from "@web3api/core-js"; +import { PluginManifest, coreInterfaceUris } from "@web3api/core-js"; export const manifest: PluginManifest = { // TODO: use the schema.graphql // https://github.com/web3-api/monorepo/issues/101 - schema: ` -# TODO: should import and "implements" the api-resolver core-api schema -# https://github.com/Web3-API/monorepo/issues/75 + schema: `### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar UInt64 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Int64 +scalar Bytes +scalar BigInt -type Query { +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT +### Web3API Header END ### + +type Query implements UriResolver_Query @imports( + types: [ + "UriResolver_Query", + "UriResolver_MaybeUriOrManifest" + ] +) { catFile( cid: String! options: Options @@ -21,7 +47,7 @@ type Query { tryResolveUri( authority: String! path: String! - ): ApiResolver_MaybeUriOrManifest + ): UriResolver_MaybeUriOrManifest getFile( path: String! @@ -48,12 +74,36 @@ type Options { provider: String } -# TODO: should get replaced with an import -# https://github.com/Web3-API/monorepo/issues/75 -type ApiResolver_MaybeUriOrManifest { +### Imported Queries START ### + +type UriResolver_Query @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "Query" +) { + tryResolveUri( + authority: String! + path: String! + ): UriResolver_MaybeUriOrManifest + + getFile( + path: String! + ): Bytes +} + +### Imported Queries END ### + +### Imported Objects START ### + +type UriResolver_MaybeUriOrManifest @imported( + uri: "w3://ens/uri-resolver.core.web3api.eth", + namespace: "UriResolver", + nativeType: "MaybeUriOrManifest" +) { uri: String manifest: String -}`, - implemented: [new Uri("w3/api-resolver")], - imported: [], +} + +### Imported Objects END ###`, + implements: [coreInterfaceUris.uriResolver], }; diff --git a/packages/js/plugins/ipfs/src/resolvers.ts b/packages/js/plugins/ipfs/src/resolvers.ts index b2461f9fbd..f71f937489 100644 --- a/packages/js/plugins/ipfs/src/resolvers.ts +++ b/packages/js/plugins/ipfs/src/resolvers.ts @@ -22,7 +22,7 @@ export const query = (ipfs: IpfsPlugin): PluginModule => ({ }): Promise => { return await ipfs.resolve(input.cid, input.options); }, - // w3/api-resolver + // uri-resolver.core.web3api.eth tryResolveUri: async (input: { authority: string; path: string }) => { if (input.authority !== "ipfs") { return null; diff --git a/packages/js/plugins/logger/README.md b/packages/js/plugins/logger/README.md index 0941619ec4..2d165a2cb3 100644 --- a/packages/js/plugins/logger/README.md +++ b/packages/js/plugins/logger/README.md @@ -1,6 +1,6 @@ # Consoler Logger Plugin -Console Logger plugin implements the `w3://w3/logger` core Web3API interface. By default it logs all events using the Javascript `console` module. Different logging mechanisms can be set using the `LoggerConfig`. +Console Logger plugin implements the `w3://ens/logger.core.web3api.eth` core Web3API interface. By default it logs all events using the Javascript `console` module. Different logging mechanisms can be set using the `LoggerConfig`. ## Log levels @@ -15,17 +15,21 @@ Console Logger plugin implements the `w3://w3/logger` core Web3API interface. By import { loggerPlugin, LogLevel } from "@web3api/logger-plugin-js"; const client = new Web3ApiClient({ - redirects: { - from: "w3://w3/logger", + plugins: [{ + from: "w3://ens/js-logger.web3api.eth", to: loggerPlugin() - } + }], + interfaces: [{ + interface: "w3://ens/logger.core.web3api.eth", + implementations: ["w3://ens/js-logger.web3api.eth"], + }] }); // For custom logging logic, initialize the logger like so: // loggerPlugin((level: LogLevel, message: string) => { ... }) const response = await client.query<{ log: boolean }>({ - uri: "w3://w3/logger", + uri: "w3://ens/js-logger.web3api.eth", query: ` query { log( diff --git a/packages/js/plugins/logger/schema.graphql b/packages/js/plugins/logger/schema.graphql new file mode 100644 index 0000000000..cd411b5e8e --- /dev/null +++ b/packages/js/plugins/logger/schema.graphql @@ -0,0 +1,66 @@ +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar UInt64 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Int64 +scalar Bytes +scalar BigInt + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT +### Web3API Header END ### + +type Query implements Logger_Query @imports( + types: [ + "Logger_Query", + "Logger_LogLevel" + ] +) { + log( + level: Logger_LogLevel! + message: String! + ): Boolean! +} + +### Imported Queries START ### + +type Logger_Query @imported( + uri: "w3://ens/logger.core.web3api.eth", + namespace: "Logger", + nativeType: "Query" +) { + log( + level: Logger_LogLevel! + message: String! + ): Boolean! +} + +### Imported Queries END ### + +### Imported Objects START ### + +enum Logger_LogLevel @imported( + uri: "w3://ens/logger.core.web3api.eth", + namespace: "Logger", + nativeType: "LogLevel" +) { + DEBUG + INFO + WARN + ERROR +} + +### Imported Objects END ### diff --git a/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts b/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts index 42758efb21..d35c2be0f1 100644 --- a/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts +++ b/packages/js/plugins/logger/src/__tests__/e2e/e2e.spec.ts @@ -7,7 +7,7 @@ describe("log method", () => { const web3ApiClient = new Web3ApiClient() const response = await web3ApiClient.query<{ log: boolean }>({ - uri: "w3://w3/logger", + uri: "w3://ens/js-logger.web3api.eth", query: ` query { log( diff --git a/packages/js/plugins/logger/src/manifest.ts b/packages/js/plugins/logger/src/manifest.ts index 7db59fc2d9..88434d9cea 100644 --- a/packages/js/plugins/logger/src/manifest.ts +++ b/packages/js/plugins/logger/src/manifest.ts @@ -1,26 +1,74 @@ -import { PluginManifest, Uri } from "@web3api/core-js"; +import { PluginManifest, coreInterfaceUris } from "@web3api/core-js"; export const manifest: PluginManifest = { // TODO: use the schema.graphql // https://github.com/web3-api/monorepo/issues/101 - schema: ` -# TODO: should import and "implements" the logger core-api schema -# https://github.com/Web3-API/monorepo/issues/75 - -enum LogLevel { - DEBUG, - INFO, - WARN, - ERROR, + schema: `### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar UInt64 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Int64 +scalar Bytes +scalar BigInt + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT +### Web3API Header END ### + +type Query implements Logger_Query @imports( + types: [ + "Logger_Query", + "Logger_LogLevel" + ] +) { + log( + level: Logger_LogLevel! + message: String! + ): Boolean! } -type Query { +### Imported Queries START ### + +type Logger_Query @imported( + uri: "w3://ens/logger.core.web3api.eth", + namespace: "Logger", + nativeType: "Query" +) { log( - level: LogLevel! + level: Logger_LogLevel! message: String! ): Boolean! } + +### Imported Queries END ### + +### Imported Objects START ### + +enum Logger_LogLevel @imported( + uri: "w3://ens/logger.core.web3api.eth", + namespace: "Logger", + nativeType: "LogLevel" +) { + DEBUG + INFO + WARN + ERROR +} + +### Imported Objects END ### `, - implemented: [new Uri("w3/logger")], - imported: [], + implements: [coreInterfaceUris.logger], }; diff --git a/packages/js/plugins/sha3/src/__tests__/index.test.ts b/packages/js/plugins/sha3/src/__tests__/index.test.ts index 92abd6f067..972e916b7d 100644 --- a/packages/js/plugins/sha3/src/__tests__/index.test.ts +++ b/packages/js/plugins/sha3/src/__tests__/index.test.ts @@ -20,10 +20,10 @@ describe("js-sha3 algorithms returned values match the plugin's", () => { beforeAll(() => { client = new Web3ApiClient({ - redirects: [ + plugins: [ { - from: "w3://ens/sha3.web3api.eth", - to: sha3Plugin(), + uri: "w3://ens/sha3.web3api.eth", + plugin: sha3Plugin(), }, ] }) diff --git a/packages/js/plugins/sha3/src/manifest.ts b/packages/js/plugins/sha3/src/manifest.ts index 390a9c7890..68bb67187d 100644 --- a/packages/js/plugins/sha3/src/manifest.ts +++ b/packages/js/plugins/sha3/src/manifest.ts @@ -20,6 +20,5 @@ export const manifest: PluginManifest = { shake_128(message: String!, outputBits: Int!): String! shake_256(message: String!, outputBits: Int!): String! }`, - implemented: [], - imported: [], + implements: [], }; diff --git a/packages/js/plugins/uts46/src/__tests__/index.test.ts b/packages/js/plugins/uts46/src/__tests__/index.test.ts index ff18f46723..92e29b6369 100644 --- a/packages/js/plugins/uts46/src/__tests__/index.test.ts +++ b/packages/js/plugins/uts46/src/__tests__/index.test.ts @@ -9,10 +9,10 @@ describe("IDNA UTS #46", () => { beforeAll(() => { client = new Web3ApiClient({ - redirects: [ + plugins: [ { - from: "w3://ens/uts46.web3api.eth", - to: uts46Plugin(), + uri: "w3://ens/uts46.web3api.eth", + plugin: uts46Plugin(), }, ], }); diff --git a/packages/js/plugins/uts46/src/manifest.ts b/packages/js/plugins/uts46/src/manifest.ts index e07aac2518..62892b3ad7 100644 --- a/packages/js/plugins/uts46/src/manifest.ts +++ b/packages/js/plugins/uts46/src/manifest.ts @@ -8,6 +8,5 @@ export const manifest: PluginManifest = { toUnicode(value: String!): String! convert(value: String!): String! }`, - implemented: [], - imported: [], + implements: [], }; diff --git a/packages/js/react/package.json b/packages/js/react/package.json index 2d2e6f140d..c66171134a 100644 --- a/packages/js/react/package.json +++ b/packages/js/react/package.json @@ -25,8 +25,8 @@ "@web3api/core-js": "0.0.1-prealpha.28" }, "devDependencies": { - "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^5.1.0", + "@testing-library/react": "11.2.5", + "@testing-library/react-hooks": "5.1.0", "@types/jest": "26.0.8", "@web3api/cli": "0.0.1-prealpha.28", "@web3api/ens-plugin-js": "0.0.1-prealpha.28", diff --git a/packages/js/react/src/__tests__/dapp/SimpleStorage.tsx b/packages/js/react/src/__tests__/dapp/SimpleStorage.tsx index 3ea6d6a33b..c5f3db85a5 100644 --- a/packages/js/react/src/__tests__/dapp/SimpleStorage.tsx +++ b/packages/js/react/src/__tests__/dapp/SimpleStorage.tsx @@ -1,5 +1,5 @@ import { useWeb3ApiQuery, Web3ApiProvider, useWeb3ApiClient, createWeb3ApiProvider } from "@web3api/react"; -import { UriRedirect } from "@web3api/client-js"; +import { PluginRegistration } from "@web3api/client-js"; import React from "react"; const SimpleStorage = ({ uri }: { uri: string }) => { @@ -65,9 +65,9 @@ const SimpleStorage = ({ uri }: { uri: string }) => {
{currentStorage?.getData}
{ - client1.redirects().length > client2.redirects().length - ? 'Provider Redirects are correct' - : 'Provider Redirects are not correct' + client1.plugins().length > client2.plugins().length + ? 'Provider plugin counts are correct' + : 'Provider plugin counts are not correct' }
@@ -79,14 +79,14 @@ const SimpleStorage = ({ uri }: { uri: string }) => { const CustomProvider = createWeb3ApiProvider("custom"); export const SimpleStorageContainer = ({ - redirects, + plugins, ensUri, }: { - redirects: UriRedirect[]; + plugins: PluginRegistration[]; ensUri: string; }) => ( - + diff --git a/packages/js/react/src/__tests__/integration.spec.tsx b/packages/js/react/src/__tests__/integration.spec.tsx index 7958f062a4..226eb6ba72 100644 --- a/packages/js/react/src/__tests__/integration.spec.tsx +++ b/packages/js/react/src/__tests__/integration.spec.tsx @@ -1,16 +1,14 @@ import { createWeb3ApiProvider } from ".."; import { SimpleStorageContainer } from "./dapp/SimpleStorage"; -import { createRedirects } from "./redirects"; +import { createPlugins } from "./plugins"; -import { - UriRedirect -} from "@web3api/core-js"; import { initTestEnvironment, stopTestEnvironment, buildAndDeployApi } from "@web3api/test-env-js"; import { GetPathToTestApis } from "@web3api/test-cases"; +import { PluginRegistration } from "@web3api/core-js"; import React from "react"; import { render, fireEvent, screen, waitFor } from "@testing-library/react"; @@ -18,7 +16,7 @@ import { render, fireEvent, screen, waitFor } from "@testing-library/react"; jest.setTimeout(360000); describe("Web3API React Integration", () => { - let redirects: UriRedirect[]; + let plugins: PluginRegistration[]; let ensUri: string; let api: { ensDomain: string; @@ -32,7 +30,7 @@ describe("Web3API React Integration", () => { ensAddress, } = await initTestEnvironment(); - redirects = createRedirects(ensAddress, ethereum, ipfs); + plugins = createPlugins(ensAddress, ethereum, ipfs); api = await buildAndDeployApi( `${GetPathToTestApis()}/simple-storage`, @@ -47,7 +45,7 @@ describe("Web3API React Integration", () => { }); it("Deploys, read and write on Smart Contract ", async () => { - render(); + render(); fireEvent.click(screen.getByText("Deploy")); await waitFor(() => screen.getByText(/0x/), { timeout: 15000 }); @@ -64,7 +62,7 @@ describe("Web3API React Integration", () => { expect(screen.getByText("5")).toBeTruthy(); // check for provider redirects - expect(screen.getByText("Provider Redirects are correct")).toBeTruthy(); + expect(screen.getByText("Provider plugin counts are correct")).toBeTruthy(); }); it("Should throw error because two providers with same key has been rendered ", () => { diff --git a/packages/js/react/src/__tests__/redirects.ts b/packages/js/react/src/__tests__/plugins.ts similarity index 65% rename from packages/js/react/src/__tests__/redirects.ts rename to packages/js/react/src/__tests__/plugins.ts index d4e76cf0d2..37f3f4ebca 100644 --- a/packages/js/react/src/__tests__/redirects.ts +++ b/packages/js/react/src/__tests__/plugins.ts @@ -1,17 +1,17 @@ -import { UriRedirect } from "@web3api/core-js"; +import { PluginRegistration } from "@web3api/core-js"; import { plugin as ensPlugin } from "@web3api/ens-plugin-js"; import { plugin as ethereumPlugin } from "@web3api/ethereum-plugin-js"; import { plugin as ipfsPlugin } from "@web3api/ipfs-plugin-js"; -export function createRedirects( +export function createPlugins( ensAddress: string, ethereumProvider: string, ipfsProvider: string -): UriRedirect[] { +): PluginRegistration[] { return [ { - from: "w3://ens/ethereum.web3api.eth", - to: ethereumPlugin({ + uri: "w3://ens/ethereum.web3api.eth", + plugin: ethereumPlugin({ networks: { testnet: { provider: ethereumProvider, @@ -20,15 +20,15 @@ export function createRedirects( }), }, { - from: "w3://ens/ipfs.web3api.eth", - to: ipfsPlugin({ + uri: "w3://ens/ipfs.web3api.eth", + plugin: ipfsPlugin({ provider: ipfsProvider, fallbackProviders: ["https://ipfs.io"], }), }, { - from: "w3://ens/ens.web3api.eth", - to: ensPlugin({ + uri: "w3://ens/ens.web3api.eth", + plugin: ensPlugin({ addresses: { testnet: ensAddress, }, diff --git a/packages/js/react/src/__tests__/useWeb3ApiClient.spec.tsx b/packages/js/react/src/__tests__/useWeb3ApiClient.spec.tsx index 634056afc3..3958612d5a 100644 --- a/packages/js/react/src/__tests__/useWeb3ApiClient.spec.tsx +++ b/packages/js/react/src/__tests__/useWeb3ApiClient.spec.tsx @@ -4,9 +4,9 @@ import { createWeb3ApiProvider, useWeb3ApiClient } from ".."; -import { createRedirects } from "./redirects"; +import { createPlugins } from "./plugins"; -import { UriRedirect } from "@web3api/core-js"; +import { PluginRegistration } from "@web3api/core-js"; import { initTestEnvironment, stopTestEnvironment @@ -21,7 +21,7 @@ import { jest.setTimeout(360000); describe("useWeb3ApiClient hook", () => { - let redirects: UriRedirect[]; + let plugins: PluginRegistration[]; let WrapperProvider: RenderHookOptions; beforeAll(async () => { @@ -31,12 +31,12 @@ describe("useWeb3ApiClient hook", () => { ensAddress } = await initTestEnvironment(); - redirects = createRedirects(ensAddress, ethereum, ipfs); + plugins = createPlugins(ensAddress, ethereum, ipfs); WrapperProvider = { wrapper: Web3ApiProvider, initialProps: { - redirects, + plugins, }, }; }); @@ -57,11 +57,11 @@ describe("useWeb3ApiClient hook", () => { return result; } - it("Should return client with redirects", async () => { + it("Should return client with plugins", async () => { const client = getClient(); expect(client).toBeTruthy(); - expect(client.redirects().length).toBeGreaterThan(0); + expect(client.plugins().length).toBeGreaterThan(0); }); it("Should throw error because there's no provider with expected key ", async () => { diff --git a/packages/js/react/src/__tests__/useWeb3ApiQuery.spec.tsx b/packages/js/react/src/__tests__/useWeb3ApiQuery.spec.tsx index d9fa39c64b..064ed1b3cd 100644 --- a/packages/js/react/src/__tests__/useWeb3ApiQuery.spec.tsx +++ b/packages/js/react/src/__tests__/useWeb3ApiQuery.spec.tsx @@ -6,9 +6,9 @@ import { import { UseWeb3ApiQueryProps } from "../query" -import { createRedirects } from "./redirects"; +import { createPlugins } from "./plugins"; -import { UriRedirect } from "@web3api/core-js"; +import { PluginRegistration } from "@web3api/core-js"; import { initTestEnvironment, stopTestEnvironment, @@ -27,7 +27,7 @@ jest.setTimeout(360000); describe("useWeb3ApiQuery hook", () => { let uri: string; - let redirects: UriRedirect[]; + let plugins: PluginRegistration[]; let WrapperProvider: RenderHookOptions; beforeAll(async () => { @@ -44,11 +44,11 @@ describe("useWeb3ApiQuery hook", () => { ); uri = `ens/testnet/${ensDomain}`; - redirects = createRedirects(ensAddress, ethereum, ipfs); + plugins = createPlugins(ensAddress, ethereum, ipfs); WrapperProvider = { wrapper: Web3ApiProvider, initialProps: { - redirects, + plugins, }, }; }); diff --git a/packages/js/react/src/provider.tsx b/packages/js/react/src/provider.tsx index 821c4e9a1f..4fb0782161 100644 --- a/packages/js/react/src/provider.tsx +++ b/packages/js/react/src/provider.tsx @@ -32,7 +32,7 @@ export function createWeb3ApiProvider( ClientContext: React.createContext({} as Web3ApiClient) }; - return ({ redirects, children }) => { + return ({ redirects, plugins, interfaces, children }) => { const [clientCreated, setClientCreated] = React.useState(false); @@ -46,7 +46,7 @@ export function createWeb3ApiProvider( } // Instantiate the client - PROVIDERS[name].client = new Web3ApiClient({ redirects }); + PROVIDERS[name].client = new Web3ApiClient({ redirects, plugins, interfaces }); setClientCreated(true); diff --git a/packages/manifest-schemas/formats/web3api/0.0.1-prealpha.3.json b/packages/manifest-schemas/formats/web3api/0.0.1-prealpha.3.json new file mode 100644 index 0000000000..5bacd6fc55 --- /dev/null +++ b/packages/manifest-schemas/formats/web3api/0.0.1-prealpha.3.json @@ -0,0 +1,90 @@ +{ + "id": "Web3ApiManifest", + "type": "object", + "additionalProperties": false, + "required": [ + "format", + "modules" + ], + "properties": { + "format": { + "type": "string", + "const": "0.0.1-prealpha.3" + }, + "repository": { + "type": "string" + }, + "build": { + "type": "string", + "format": "file" + }, + "language": { + "type": "string", + "format": "wasmLanguage" + }, + "interface": { + "type": "boolean" + }, + "modules": { + "type": "object", + "additionalProperties": false, + "properties": { + "mutation": { + "type": "object", + "additionalProperties": false, + "properties": { + "schema": { + "type": "string", + "format": "file" + }, + "module": { + "type": "string", + "format": "file" + } + }, + "required": [ + "schema" + ] + }, + "query": { + "type": "object", + "additionalProperties": false, + "properties": { + "schema": { + "type": "string", + "format": "file" + }, + "module": { + "type": "string", + "format": "file" + } + }, + "required": [ + "schema" + ] + } + } + }, + "import_redirects": { + "type": "array", + "items": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "uri": { + "type": "string" + }, + "schema": { + "type": "string" + } + }, + "required": [ + "uri", + "schema" + ] + } + ] + } + } +} diff --git a/packages/schema/bind/package.json b/packages/schema/bind/package.json index c14f818322..5196b2686e 100644 --- a/packages/schema/bind/package.json +++ b/packages/schema/bind/package.json @@ -27,7 +27,6 @@ "devDependencies": { "@types/jest": "26.0.8", "@types/mustache": "4.0.1", - "@web3api/os-js": "0.0.1-prealpha.25", "@web3api/test-cases": "0.0.1-prealpha.28", "copyfiles": "2.4.1", "jest": "26.6.3", diff --git a/packages/schema/compose/src/resolve.ts b/packages/schema/compose/src/resolve.ts index 5ea83e5c88..4b0b24c7ed 100644 --- a/packages/schema/compose/src/resolve.ts +++ b/packages/schema/compose/src/resolve.ts @@ -24,8 +24,6 @@ import { visitQueryDefinition, ImportedQueryDefinition, DefinitionKind, - PropertyDefinition, - populatePropertyType, visitImportedQueryDefinition, visitImportedObjectDefinition, ImportedEnumDefinition, @@ -35,8 +33,16 @@ import { GenericDefinition, isKind, header, + InterfaceImplementedDefinition, + ObjectRef, + EnumRef, } from "@web3api/schema-parse"; +type ImplementationWithInterfaces = { + typeName: string; + interfaces: string[]; +}; + export async function resolveImportsAndParseSchemas( schema: string, schemaPath: string, @@ -44,7 +50,7 @@ export async function resolveImportsAndParseSchemas( resolvers: SchemaResolvers ): Promise { const importKeywordCapture = /^[#]*["{3}]*import[ \n\t]/gm; - const externalImportCapture = /[#]*["{3}]*import[ \n\t]*{([a-zA-Z0-9_, \n\t]+)}[ \n\t]*into[ \n\t]*(\w+?)[ \n\t]*from[ \n\t]*[\"'`]([a-zA-Z0-9_~.:\/]+?)[\"'`]/g; + const externalImportCapture = /[#]*["{3}]*import[ \n\t]*{([a-zA-Z0-9_, \n\t]+)}[ \n\t]*into[ \n\t]*(\w+?)[ \n\t]*from[ \n\t]*[\"'`]([\-a-zA-Z0-9_~.:\/]+?)[\"'`]/g; const localImportCapture = /[#]*["{3}]*import[ \n\t]*{([a-zA-Z0-9_, \n\t]+)}[ \n\t]*from[ \n\t]*[\"'`]([a-zA-Z0-9_~\-:.\/]+?)[\"'`]/g; const keywords = [...schema.matchAll(importKeywordCapture)]; @@ -59,6 +65,13 @@ export async function resolveImportsAndParseSchemas( ); } + const interfaceCapture = /type[ \n\t]*[a-zA-Z0-9_]+[ \n\t]+implements ([a-zA-Z0-9_&\n\t ]*){/g; + const implementInterfaceStatments = [...schema.matchAll(interfaceCapture)]; + + const implementationsWithInterfaces = parseInterfaces( + implementInterfaceStatments + ); + const externalImportsToResolve: ExternalImport[] = parseExternalImports( externalImportStatements, mutation @@ -97,8 +110,13 @@ export async function resolveImportsAndParseSchemas( // Add the @imports directive newSchema = addQueryImportsDirective(newSchema, externalImports, mutation); - // Parse the newly formed schema, and combine it with the subTypeInfo - return parseSchema(header + newSchema + renderSchema(subTypeInfo, false)); + //Combine the new schema with the subTypeInfo + newSchema = header + newSchema + renderSchema(subTypeInfo, false); + + newSchema = resolveInterfaces(newSchema, implementationsWithInterfaces); + + // Parse the newly formed schema + return parseSchema(newSchema); } interface Namespaced { @@ -127,18 +145,18 @@ const extractObjectImportDependencies = ( uri: string ): TypeInfoTransforms => { const findImport = ( - def: GenericDefinition, + type: string, namespaceType: string, rootTypes: EnumOrObject[], importedTypes: ImportedEnumOrObject[], kind: DefinitionKind ): ImportedEnumOrObject & Namespaced => { // Find this type's ObjectDefinition in the root type info - let idx = rootTypes.findIndex((obj) => obj.type === def.type); + let idx = rootTypes.findIndex((obj) => obj.type === type); let obj = undefined; if (idx === -1) { - idx = importedTypes.findIndex((obj) => obj.type === def.type); + idx = importedTypes.findIndex((obj) => obj.type === type); } else { obj = rootTypes[idx]; } @@ -146,7 +164,7 @@ const extractObjectImportDependencies = ( if (idx === -1) { throw Error( `extractObjectImportDependencies: Cannot find the dependent type within the root type info.\n` + - `Type: ${def.type}\nTypeInfo: ${JSON.stringify( + `Type: ${type}\nTypeInfo: ${JSON.stringify( rootTypeInfo )}\n${namespace}\n${JSON.stringify(Object.keys(importsFound))}` ); @@ -164,23 +182,25 @@ const extractObjectImportDependencies = ( kind, uri, namespace, - nativeType: def.type, + nativeType: type, }; }; return { enter: { - ObjectDefinition: (def: ObjectDefinition & Namespaced) => { + ObjectRef: (def: ObjectRef & Namespaced) => { if (def.__namespaced) { return def; } - const namespaceType = appendNamespace(namespace, def.type); + const type = def.type; + + const namespaceType = appendNamespace(namespace, type); if (!importsFound[namespaceType]) { // Find the import const importFound = findImport( - def, + type, namespaceType, rootTypeInfo.objectTypes, rootTypeInfo.importedObjectTypes, @@ -198,18 +218,49 @@ const extractObjectImportDependencies = ( namespace, uri ), - leave: { - PropertyDefinition: (def: PropertyDefinition) => { - populatePropertyType(def); - return def; - }, - }, }); } return def; }, - EnumDefinition: (def: EnumDefinition & Namespaced) => { + InterfaceImplementedDefinition: ( + def: InterfaceImplementedDefinition & Namespaced + ) => { + if (def.__namespaced) { + return def; + } + + const type = def.type; + + const namespaceType = appendNamespace(namespace, type); + + if (!importsFound[namespaceType]) { + // Find the import + const importFound = findImport( + type, + namespaceType, + rootTypeInfo.objectTypes, + rootTypeInfo.importedObjectTypes, + DefinitionKind.ImportedObject + ) as ImportedObjectDefinition; + + // Keep track of it + importsFound[importFound.type] = importFound; + + // Traverse this newly added object + visitObjectDefinition(importFound, { + ...extractObjectImportDependencies( + importsFound, + rootTypeInfo, + namespace, + uri + ), + }); + } + + return def; + }, + EnumRef: (def: EnumRef & Namespaced) => { if (def.__namespaced) { return def; } @@ -218,7 +269,7 @@ const extractObjectImportDependencies = ( if (!importsFound[namespaceType]) { // Find the import const importFound = findImport( - def, + def.type, namespaceType, rootTypeInfo.enumTypes, rootTypeInfo.importedEnumTypes, @@ -237,7 +288,7 @@ const extractObjectImportDependencies = ( const namespaceTypes = (namespace: string): TypeInfoTransforms => ({ enter: { - ObjectDefinition: (def: ObjectDefinition & Namespaced) => { + ObjectRef: (def: ObjectRef & Namespaced) => { if (def.__namespaced) { return def; } @@ -248,7 +299,9 @@ const namespaceTypes = (namespace: string): TypeInfoTransforms => ({ __namespaced: true, }; }, - EnumDefinition: (def: EnumDefinition & Namespaced) => { + InterfaceImplementedDefinition: ( + def: InterfaceImplementedDefinition & Namespaced + ) => { if (def.__namespaced) { return def; } @@ -259,11 +312,16 @@ const namespaceTypes = (namespace: string): TypeInfoTransforms => ({ __namespaced: true, }; }, - }, - leave: { - PropertyDefinition: (def: PropertyDefinition) => { - populatePropertyType(def); - return def; + EnumRef: (def: EnumRef & Namespaced) => { + if (def.__namespaced) { + return def; + } + + return { + ...def, + type: appendNamespace(namespace, def.type), + __namespaced: true, + }; }, }, }); @@ -283,13 +341,16 @@ function addQueryImportsDirective( // Append the @imports(...) directive to the query type const typeCapture = mutation - ? /type[ \n\t]*Mutation[ \n\t]*{/g - : /type[ \n\t]*Query[ \n\t]*{/g; + ? /type[ \n\t]*Mutation[ \n\t]*([^{]*)[ \n\t]*{/g + : /type[ \n\t]*Query[ \n\t]*([^{]*)[ \n\t]*{/g; const importedTypes = `${externalImports .map((type) => `\"${type}\"`) .join(",\n ")}`; - const replacementQueryStr = `type ${mutation ? "Mutation" : "Query"} @imports( + + const replacementQueryStr = `type ${ + mutation ? "Mutation" : "Query" + } $1@imports( types: [ ${importedTypes} ] @@ -298,6 +359,108 @@ function addQueryImportsDirective( return schema.replace(typeCapture, replacementQueryStr); } +function parseInterfaces( + implementInterfaceStatments: RegExpMatchArray[] +): ImplementationWithInterfaces[] { + const implementationsWithInterfaces: ImplementationWithInterfaces[] = []; + + for (const implementMatch of implementInterfaceStatments) { + const implementStr = implementMatch[1].trim(); + const typeCapture = /type[ \n\t]*([a-zA-Z0-9_]+)[ \n\t]*/g; + + const typeNameMatches = typeCapture.exec(implementMatch[0]); + + if (!typeNameMatches) { + continue; + } + + const typeName = typeNameMatches[1]; + + const interfaces = [ + ...implementStr.matchAll(/([a-zA-Z0-9_]+)(&\s*\d+)*/g), + ].map((x) => x[0]); + + implementationsWithInterfaces.push({ + typeName, + interfaces, + }); + } + + return implementationsWithInterfaces; +} + +function resolveInterfaces( + schema: string, + implementationsWithInterfaces: ImplementationWithInterfaces[] +): string { + const removeComments = (body: string) => { + const bodyWithoutComments = body.replace(/"""[^"]*"""[ \n\t]*/g, ""); + return bodyWithoutComments; + }; + + if (!implementationsWithInterfaces.length) { + return schema; + } + + const getAllUniqueInterfaces = (): string[] => { + const allIntefaces = implementationsWithInterfaces + .map((x) => x.interfaces) + .reduce((acc, x) => acc.concat(x), []); + + return [...new Set(allIntefaces)]; + }; + + const allInterfaces = getAllUniqueInterfaces(); + const interfacesWithBodies: { name: string; body: string }[] = []; + + const typeCapture = /type[ \n\t]*([a-zA-Z0-9_]+)[a-zA-Z0-9_,.:@"&!/\(\)\[\] \n\t]+{([a-zA-Z0-9_,.:@"&!\(\)\[\] \n\t]*)}/g; + const typeMatches = [...schema.matchAll(typeCapture)]; + + for (const interfaceName of allInterfaces) { + const match = typeMatches.find((x) => x[1] === interfaceName); + if (!match) { + continue; + } + + let body = match[2]; + if (!body) { + continue; + } + + body = removeComments(body); + + interfacesWithBodies.push({ + name: interfaceName, + body: body, + }); + } + + for (const implementationWithInterfaces of implementationsWithInterfaces) { + const implementationTypeCapture = new RegExp( + `(type[ \\n\\t]*${implementationWithInterfaces.typeName}[a-zA-Z0-9_,.:@"&!\\(\\)\\[\\] \\n\\t]*{)([a-zA-Z0-9_,.:@"&!\\(\\)\\[\\] \\n\\t]*)}` + ); + + const bodiesOfInterfaces = implementationWithInterfaces.interfaces.map( + (interfaceName) => { + return interfacesWithBodies + .find((iwb) => iwb.name === interfaceName) + ?.body.trim(); + } + ); + + const bodiesOfInterfacesStr = bodiesOfInterfaces + .filter((x) => x) + .reduce((acc: string, x: string) => acc + "\n" + x, ""); + + schema = schema.replace( + implementationTypeCapture, + `$1$2${bodiesOfInterfacesStr}}` + ); + } + + return schema; +} + async function resolveExternalImports( importsToResolve: ExternalImport[], resolveSchema: SchemaResolver, @@ -572,10 +735,10 @@ async function resolveLocalImports( visitorFunc(type, { enter: { - ObjectDefinition: (def: ObjectDefinition) => { + ObjectRef: (def: ObjectRef) => { return findImport(def, localTypeInfo.objectTypes); }, - EnumDefinition: (def: EnumDefinition) => { + EnumRef: (def: EnumRef) => { return findImport(def, localTypeInfo.enumTypes); }, }, diff --git a/packages/schema/compose/src/templates/schema.mustache.ts b/packages/schema/compose/src/templates/schema.mustache.ts index 66102af1c1..2dc4e890cf 100644 --- a/packages/schema/compose/src/templates/schema.mustache.ts +++ b/packages/schema/compose/src/templates/schema.mustache.ts @@ -1,16 +1,28 @@ const template = ` {{#typeInfo}} -{{#queryTypes}} -type {{type}} {{#imports.length}}@imports( +{{#queryTypes}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} +type {{type}}{{#interfaces.length}} implements{{#interfaces}} {{type}}{{^last}} &{{/last}}{{/interfaces}}{{/interfaces.length}}{{#imports.length}} @imports( types: [ {{#imports}} "{{type}}"{{^last}},{{/last}} {{/imports}} ] -) {{/imports.length}}{ - {{#methods}} +){{/imports.length}} { + {{#methods}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} {{name}}{{#arguments.length}}( - {{#arguments}} + {{#arguments}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} {{name}}: {{toGraphQLType}} {{/arguments}} ){{/arguments.length}}: {{#return}}{{toGraphQLType}}{{/return}} @@ -21,15 +33,27 @@ type {{type}} {{#imports.length}}@imports( } {{/queryTypes}} -{{#objectTypes}} -type {{type}} { - {{#properties}} +{{#objectTypes}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} +type {{type}}{{#interfaces.length}} implements{{#interfaces}} {{type}}{{^last}} &{{/last}}{{/interfaces}}{{/interfaces.length}} { + {{#properties}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} {{name}}: {{toGraphQLType}} {{/properties}} } {{/objectTypes}} -{{#enumTypes}} +{{#enumTypes}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} enum {{type}} { {{#constants}} {{.}} @@ -39,15 +63,27 @@ enum {{type}} { {{/enumTypes}} ### Imported Queries START ### -{{#importedQueryTypes}} -type {{type}} @imported( +{{#importedQueryTypes}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} +type {{type}}{{#interfaces.length}} implements{{#interfaces}} {{type}}{{^last}} &{{/last}}{{/interfaces}}{{/interfaces.length}} @imported( uri: "{{uri}}", namespace: "{{namespace}}", nativeType: "{{nativeType}}" ) { - {{#methods}} + {{#methods}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} {{name}}( - {{#arguments}} + {{#arguments}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} {{name}}: {{toGraphQLType}} {{/arguments}} ): {{#return}}{{toGraphQLType}}{{/return}} @@ -62,20 +98,32 @@ type {{type}} @imported( ### Imported Objects START ### -{{#importedObjectTypes}} -type {{type}} @imported( +{{#importedObjectTypes}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} +type {{type}}{{#interfaces.length}} implements{{#interfaces}} {{type}}{{^last}} &{{/last}}{{/interfaces}}{{/interfaces.length}} @imported( uri: "{{uri}}", namespace: "{{namespace}}", nativeType: "{{nativeType}}" ) { - {{#properties}} + {{#properties}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} {{name}}: {{toGraphQLType}} {{/properties}} } {{/importedObjectTypes}} -{{#importedEnumTypes}} +{{#importedEnumTypes}}{{#comment}} +""" +{{comment}} +""" +{{/comment}} enum {{type}} @imported( namespace: "{{namespace}}", uri: "{{uri}}", diff --git a/packages/schema/parse/package.json b/packages/schema/parse/package.json index 7dde03f723..b28e824d25 100644 --- a/packages/schema/parse/package.json +++ b/packages/schema/parse/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "graphql": "15.5.0", - "graphql-schema-cycles": "1.1.2" + "graphql-schema-cycles": "1.1.3" }, "devDependencies": { "@types/deep-equal": "1.0.1", diff --git a/packages/schema/parse/src/__tests__/validate-directives.spec.ts b/packages/schema/parse/src/__tests__/validate-directives.spec.ts index e6c4ef6439..879fa13652 100644 --- a/packages/schema/parse/src/__tests__/validate-directives.spec.ts +++ b/packages/schema/parse/src/__tests__/validate-directives.spec.ts @@ -72,7 +72,7 @@ describe("Web3API Schema Directives Validation", () => { it("supportedDirectives", () => { expect(() => parseSchema(supportedDirectivesSchema, { validators: [ - directiveValidators.supportedDirectives + directiveValidators.getSupportedDirectivesValidator ] })).toThrow( /Found the following usages of unsupported directives:\n@unknown,\n@anotherUnknown/gm @@ -82,7 +82,7 @@ describe("Web3API Schema Directives Validation", () => { it("importsDirective: Query Object Only", () => { expect(() => parseSchema(importsDirectiveSchema1, { validators: [ - directiveValidators.importsDirective + directiveValidators.getImportsDirectiveValidator ] })).toThrow( /@imports directive should only be used on QUERY or MUTATION type definitions, but it is being used on the following ObjectTypeDefinitions:\nObject/gm @@ -92,7 +92,7 @@ describe("Web3API Schema Directives Validation", () => { it("importsDirective: Improper Placement", () => { expect(() => parseSchema(importsDirectiveSchema2, { validators: [ - directiveValidators.importsDirective + directiveValidators.getImportsDirectiveValidator ] })).toThrow( /@imports directive should only be used on QUERY or MUTATION type definitions, but it is being used in the following location: definitions -> 0 -> fields -> 0 -> directives -> 0/gm @@ -102,7 +102,7 @@ describe("Web3API Schema Directives Validation", () => { it("importsDirective: Incorrect Arguments", () => { expect(() => parseSchema(importsDirectiveSchema3, { validators: [ - directiveValidators.importsDirective + directiveValidators.getImportsDirectiveValidator ] })).toThrow( /@imports directive requires argument 'types' of type \[String!\]!/ @@ -112,7 +112,7 @@ describe("Web3API Schema Directives Validation", () => { it("importedDirective: Incorrect Arguments", () => { expect(() => parseSchema(importedDirectiveSchema1, { validators: [ - directiveValidators.importedDirective + directiveValidators.getImportedDirectiveValidator ] })).toThrow( /@imported directive is missing the following arguments:\n- uri/gm @@ -122,7 +122,7 @@ describe("Web3API Schema Directives Validation", () => { it("importedDirective: Improper Placement", () => { expect(() => parseSchema(importedDirectiveSchema2, { validators: [ - directiveValidators.importedDirective + directiveValidators.getImportedDirectiveValidator ] })).toThrow( /@imported directive should only be used on object or enum type definitions, but it is being used in the following location: definitions -> 0 -> fields -> 0 -> directives -> 0/gm diff --git a/packages/schema/parse/src/__tests__/validate-types.spec.ts b/packages/schema/parse/src/__tests__/validate-types.spec.ts index f24dfe5ca3..201e5902eb 100644 --- a/packages/schema/parse/src/__tests__/validate-types.spec.ts +++ b/packages/schema/parse/src/__tests__/validate-types.spec.ts @@ -220,7 +220,7 @@ type B { describe("Web3API Schema Type Validation", () => { it("typeDefinitions", () => { const exec = (schema: string) => () => parseSchema(schema, { - validators: [typeValidators.typeDefinitions] + validators: [typeValidators.getTypeDefinitionsValidator] }); expect(exec(typeDefinitions1)).toThrow( @@ -246,7 +246,7 @@ describe("Web3API Schema Type Validation", () => { it("propertyTypes", () => { const exec = (schema: string) => () => parseSchema(schema, { - validators: [typeValidators.propertyTypes] + validators: [typeValidators.getPropertyTypesValidator] }); expect(exec(propertyTypes1)).toThrow( @@ -280,7 +280,7 @@ describe("Web3API Schema Type Validation", () => { it("Circular type definitions", () => { const exec = (schema: string) => () => parseSchema(schema, { - validators: [typeValidators.circularDefinitions] + validators: [typeValidators.getCircularDefinitionsValidator] }) expect(exec(circularTypes1)).toThrow( diff --git a/packages/schema/parse/src/extract/enum-types.ts b/packages/schema/parse/src/extract/enum-types.ts index 830dd42380..da2a9401e4 100644 --- a/packages/schema/parse/src/extract/enum-types.ts +++ b/packages/schema/parse/src/extract/enum-types.ts @@ -1,11 +1,6 @@ import { TypeInfo, EnumDefinition, createEnumDefinition } from "../typeInfo"; -import { - DirectiveNode, - DocumentNode, - EnumTypeDefinitionNode, - visit, -} from "graphql"; +import { ASTVisitor, DirectiveNode, EnumTypeDefinitionNode } from "graphql"; const visitorEnter = (enumTypes: EnumDefinition[]) => ({ EnumTypeDefinition: (node: EnumTypeDefinitionNode) => { @@ -29,16 +24,12 @@ const visitorEnter = (enumTypes: EnumDefinition[]) => ({ const enumType = createEnumDefinition({ type: node.name.value, constants, + comment: node.description?.value, }); enumTypes.push(enumType); }, }); -export function extractEnumTypes( - astNode: DocumentNode, - typeInfo: TypeInfo -): void { - visit(astNode, { - enter: visitorEnter(typeInfo.enumTypes), - }); -} +export const getEnumTypesVisitor = (typeInfo: TypeInfo): ASTVisitor => ({ + enter: visitorEnter(typeInfo.enumTypes), +}); diff --git a/packages/schema/parse/src/extract/imported-enum-types.ts b/packages/schema/parse/src/extract/imported-enum-types.ts index 7a8ba17dfd..25e827dabf 100644 --- a/packages/schema/parse/src/extract/imported-enum-types.ts +++ b/packages/schema/parse/src/extract/imported-enum-types.ts @@ -5,7 +5,7 @@ import { } from "../typeInfo"; import { extractImportedDefinition } from "./imported-types-utils"; -import { DocumentNode, EnumTypeDefinitionNode, visit } from "graphql"; +import { ASTVisitor, EnumTypeDefinitionNode } from "graphql"; const visitorEnter = (importedEnumTypes: ImportedEnumDefinition[]) => ({ EnumTypeDefinition: (node: EnumTypeDefinitionNode) => { @@ -28,16 +28,14 @@ const visitorEnter = (importedEnumTypes: ImportedEnumDefinition[]) => ({ uri: imported.uri, namespace: imported.namespace, nativeType: imported.nativeType, + comment: node.description?.value, }); importedEnumTypes.push(enumType); }, }); -export function extractImportedEnumTypes( - astNode: DocumentNode, +export const getImportedEnumTypesVisitor = ( typeInfo: TypeInfo -): void { - visit(astNode, { - enter: visitorEnter(typeInfo.importedEnumTypes), - }); -} +): ASTVisitor => ({ + enter: visitorEnter(typeInfo.importedEnumTypes), +}); diff --git a/packages/schema/parse/src/extract/imported-object-types.ts b/packages/schema/parse/src/extract/imported-object-types.ts index 3aece5b83e..de74b058a6 100644 --- a/packages/schema/parse/src/extract/imported-object-types.ts +++ b/packages/schema/parse/src/extract/imported-object-types.ts @@ -2,6 +2,7 @@ import { TypeInfo, ImportedObjectDefinition, createImportedObjectDefinition, + createInterfaceImplementedDefinition, } from "../typeInfo"; import { extractFieldDefinition, @@ -10,22 +11,19 @@ import { State, } from "./object-types-utils"; import { extractImportedDefinition } from "./imported-types-utils"; -import { Blackboard } from "./Blackboard"; import { - DocumentNode, ObjectTypeDefinitionNode, NonNullTypeNode, NamedTypeNode, ListTypeNode, FieldDefinitionNode, - visit, + ASTVisitor, } from "graphql"; const visitorEnter = ( importedObjectTypes: ImportedObjectDefinition[], - state: State, - blackboard: Blackboard + state: State ) => ({ ObjectTypeDefinition: (node: ObjectTypeDefinitionNode) => { const imported = extractImportedDefinition(node); @@ -39,6 +37,10 @@ const visitorEnter = ( uri: imported.uri, namespace: imported.namespace, nativeType: imported.nativeType, + interfaces: node.interfaces?.map((x) => + createInterfaceImplementedDefinition({ type: x.name.value }) + ), + comment: node.description?.value, }); importedObjectTypes.push(importedType); state.currentType = importedType; @@ -47,7 +49,7 @@ const visitorEnter = ( state.nonNullType = true; }, NamedType: (node: NamedTypeNode) => { - extractNamedType(node, state, blackboard); + extractNamedType(node, state); }, ListType: (_node: ListTypeNode) => { extractListType(state); @@ -69,15 +71,13 @@ const visitorLeave = (state: State) => ({ }, }); -export function extractImportedObjectTypes( - astNode: DocumentNode, - typeInfo: TypeInfo, - blackboard: Blackboard -): void { +export const getImportedObjectTypesVisitor = ( + typeInfo: TypeInfo +): ASTVisitor => { const state: State = {}; - visit(astNode, { - enter: visitorEnter(typeInfo.importedObjectTypes, state, blackboard), + return { + enter: visitorEnter(typeInfo.importedObjectTypes, state), leave: visitorLeave(state), - }); -} + }; +}; diff --git a/packages/schema/parse/src/extract/imported-query-types.ts b/packages/schema/parse/src/extract/imported-query-types.ts index 74f516af2f..cb0cf3c5bf 100644 --- a/packages/schema/parse/src/extract/imported-query-types.ts +++ b/packages/schema/parse/src/extract/imported-query-types.ts @@ -4,6 +4,7 @@ import { createImportedQueryDefinition, createMethodDefinition, createPropertyDefinition, + createInterfaceImplementedDefinition, } from "../typeInfo"; import { extractInputValueDefinition, @@ -12,23 +13,20 @@ import { State, } from "./query-types-utils"; import { extractImportedDefinition } from "./imported-types-utils"; -import { Blackboard } from "./Blackboard"; import { - DocumentNode, ObjectTypeDefinitionNode, NonNullTypeNode, NamedTypeNode, ListTypeNode, FieldDefinitionNode, InputValueDefinitionNode, - visit, + ASTVisitor, } from "graphql"; const visitorEnter = ( importedQueryTypes: ImportedQueryDefinition[], - state: State, - blackboard: Blackboard + state: State ) => ({ ObjectTypeDefinition: (node: ObjectTypeDefinitionNode) => { const imported = extractImportedDefinition(node, true); @@ -42,6 +40,10 @@ const visitorEnter = ( uri: imported.uri, namespace: imported.namespace, nativeType: imported.nativeType, + interfaces: node.interfaces?.map((x) => + createInterfaceImplementedDefinition({ type: x.name.value }) + ), + comment: node.description?.value, }); importedQueryTypes.push(importedType); state.currentImport = importedType; @@ -68,6 +70,7 @@ const visitorEnter = ( type: importDef.nativeType, name: node.name.value, return: returnType, + comment: node.description?.value, }); importDef.methods.push(method); state.currentMethod = method; @@ -80,7 +83,7 @@ const visitorEnter = ( state.nonNullType = true; }, NamedType: (node: NamedTypeNode) => { - extractNamedType(node, state, blackboard); + extractNamedType(node, state); }, ListType: (_node: ListTypeNode) => { extractListType(state); @@ -103,15 +106,13 @@ const visitorLeave = (state: State) => ({ }, }); -export function extractImportedQueryTypes( - astNode: DocumentNode, - typeInfo: TypeInfo, - blackboard: Blackboard -): void { +export const getImportedQueryTypesVisitor = ( + typeInfo: TypeInfo +): ASTVisitor => { const state: State = {}; - visit(astNode, { - enter: visitorEnter(typeInfo.importedQueryTypes, state, blackboard), + return { + enter: visitorEnter(typeInfo.importedQueryTypes, state), leave: visitorLeave(state), - }); -} + }; +}; diff --git a/packages/schema/parse/src/extract/index.ts b/packages/schema/parse/src/extract/index.ts index c62d1b7c49..c71fdb261a 100644 --- a/packages/schema/parse/src/extract/index.ts +++ b/packages/schema/parse/src/extract/index.ts @@ -1,25 +1,20 @@ import { TypeInfo } from "../typeInfo"; -import { extractEnumTypes } from "./enum-types"; -import { extractObjectTypes } from "./object-types"; -import { extractQueryTypes } from "./query-types"; -import { extractImportedObjectTypes } from "./imported-object-types"; -import { extractImportedQueryTypes } from "./imported-query-types"; -import { extractImportedEnumTypes } from "./imported-enum-types"; -import { Blackboard } from "./Blackboard"; +import { getEnumTypesVisitor } from "./enum-types"; +import { getObjectTypesVisitor } from "./object-types"; +import { getQueryTypesVisitor } from "./query-types"; +import { getImportedObjectTypesVisitor } from "./imported-object-types"; +import { getImportedQueryTypesVisitor } from "./imported-query-types"; +import { getImportedEnumTypesVisitor } from "./imported-enum-types"; -import { DocumentNode } from "graphql"; +import { ASTVisitor } from "graphql"; -export type SchemaExtractor = ( - astNode: DocumentNode, - typeInfo: TypeInfo, - blackboard: Blackboard -) => void; +export type SchemaExtractorBuilder = (typeInfo: TypeInfo) => ASTVisitor; -export const extractors: SchemaExtractor[] = [ - extractEnumTypes, - extractImportedEnumTypes, - extractObjectTypes, - extractImportedObjectTypes, - extractQueryTypes, - extractImportedQueryTypes, +export const extractors: SchemaExtractorBuilder[] = [ + getEnumTypesVisitor, + getImportedEnumTypesVisitor, + getObjectTypesVisitor, + getImportedObjectTypesVisitor, + getQueryTypesVisitor, + getImportedQueryTypesVisitor, ]; diff --git a/packages/schema/parse/src/extract/object-types-utils.ts b/packages/schema/parse/src/extract/object-types-utils.ts index eba85465a1..4dad1062c2 100644 --- a/packages/schema/parse/src/extract/object-types-utils.ts +++ b/packages/schema/parse/src/extract/object-types-utils.ts @@ -5,7 +5,6 @@ import { PropertyDefinition, } from "../typeInfo"; import { setPropertyType } from "./property-utils"; -import { Blackboard } from "./Blackboard"; import { FieldDefinitionNode, NamedTypeNode } from "graphql"; @@ -34,17 +33,14 @@ export function extractFieldDefinition( const property = createPropertyDefinition({ type: "N/A", name: node.name.value, + comment: node.description?.value, }); state.currentProperty = property; importDef.properties.push(property); } -export function extractNamedType( - node: NamedTypeNode, - state: State, - blackboard: Blackboard -): void { +export function extractNamedType(node: NamedTypeNode, state: State): void { const property = state.currentProperty; if (!property) { @@ -66,15 +62,10 @@ export function extractNamedType( ); } - setPropertyType( - property, - property.name, - { - type: node.name.value, - required: state.nonNullType, - }, - blackboard - ); + setPropertyType(property, property.name, { + type: node.name.value, + required: state.nonNullType, + }); state.nonNullType = false; } diff --git a/packages/schema/parse/src/extract/object-types.ts b/packages/schema/parse/src/extract/object-types.ts index 300737f4e4..05a0cf84a7 100644 --- a/packages/schema/parse/src/extract/object-types.ts +++ b/packages/schema/parse/src/extract/object-types.ts @@ -2,6 +2,7 @@ import { TypeInfo, ObjectDefinition, createObjectDefinition, + createInterfaceImplementedDefinition, } from "../typeInfo"; import { extractFieldDefinition, @@ -9,24 +10,18 @@ import { extractNamedType, State, } from "./object-types-utils"; -import { Blackboard } from "./Blackboard"; import { - DocumentNode, ObjectTypeDefinitionNode, NonNullTypeNode, NamedTypeNode, ListTypeNode, FieldDefinitionNode, - visit, DirectiveNode, + ASTVisitor, } from "graphql"; -const visitorEnter = ( - objectTypes: ObjectDefinition[], - state: State, - blackboard: Blackboard -) => ({ +const visitorEnter = (objectTypes: ObjectDefinition[], state: State) => ({ ObjectTypeDefinition: (node: ObjectTypeDefinitionNode) => { // Skip non-custom types if (node.name.value === "Query" || node.name.value === "Mutation") { @@ -44,7 +39,13 @@ const visitorEnter = ( } // Create a new TypeDefinition - const type = createObjectDefinition({ type: node.name.value }); + const type = createObjectDefinition({ + type: node.name.value, + interfaces: node.interfaces?.map((x) => + createInterfaceImplementedDefinition({ type: x.name.value }) + ), + comment: node.description?.value, + }); objectTypes.push(type); state.currentType = type; }, @@ -52,7 +53,7 @@ const visitorEnter = ( state.nonNullType = true; }, NamedType: (node: NamedTypeNode) => { - extractNamedType(node, state, blackboard); + extractNamedType(node, state); }, ListType: (_node: ListTypeNode) => { extractListType(state); @@ -74,15 +75,11 @@ const visitorLeave = (state: State) => ({ }, }); -export function extractObjectTypes( - astNode: DocumentNode, - typeInfo: TypeInfo, - blackboard: Blackboard -): void { +export const getObjectTypesVisitor = (typeInfo: TypeInfo): ASTVisitor => { const state: State = {}; - visit(astNode, { - enter: visitorEnter(typeInfo.objectTypes, state, blackboard), + return { + enter: visitorEnter(typeInfo.objectTypes, state), leave: visitorLeave(state), - }); -} + }; +}; diff --git a/packages/schema/parse/src/extract/property-utils.ts b/packages/schema/parse/src/extract/property-utils.ts index fac41cc407..f38db4e547 100644 --- a/packages/schema/parse/src/extract/property-utils.ts +++ b/packages/schema/parse/src/extract/property-utils.ts @@ -1,17 +1,14 @@ import { - createEnumDefinition, - createObjectDefinition, createScalarDefinition, + createUnresolvedObjectOrEnumRef, isScalarType, PropertyDefinition, } from "../typeInfo"; -import { Blackboard } from "./Blackboard"; export function setPropertyType( property: PropertyDefinition, name: string, - type: { type: string; required: boolean | undefined }, - blackboard: Blackboard + type: { type: string; required: boolean | undefined } ): void { if (isScalarType(type.type)) { property.scalar = createScalarDefinition({ @@ -22,32 +19,9 @@ export function setPropertyType( return; } - // The type is not a known scalar, check to see if it's - // apart of the custom types defined inside the schema (objects, enums) - const customTypes = blackboard.getCustomTypes(); - const idx = customTypes.findIndex( - (customType) => customType.name === type.type - ); - - if (idx === -1) { - throw new Error(`Unsupported type ${type.type}`); - } - - const customType = customTypes[idx]; - - if (customType.type === "enum") { - property.enum = createEnumDefinition({ - name: name, - type: type.type, - required: type.required, - }); - } else if (customType.type === "object") { - property.object = createObjectDefinition({ - name: name, - type: type.type, - required: type.required, - }); - } else { - throw new Error(`Unimplemented custom type ${customType}`); - } + property.unresolvedObjectOrEnum = createUnresolvedObjectOrEnumRef({ + name: name, + type: type.type, + required: type.required, + }); } diff --git a/packages/schema/parse/src/extract/query-types-utils.ts b/packages/schema/parse/src/extract/query-types-utils.ts index 14db1c2f57..71fa7a16c1 100644 --- a/packages/schema/parse/src/extract/query-types-utils.ts +++ b/packages/schema/parse/src/extract/query-types-utils.ts @@ -7,7 +7,6 @@ import { createArrayDefinition, } from "../typeInfo"; import { setPropertyType } from "./property-utils"; -import { Blackboard } from "./Blackboard"; import { InputValueDefinitionNode, NamedTypeNode } from "graphql"; @@ -20,11 +19,7 @@ export interface State { currentImport?: ImportedQueryDefinition; } -export function extractNamedType( - node: NamedTypeNode, - state: State, - blackboard: Blackboard -): void { +export function extractNamedType(node: NamedTypeNode, state: State): void { const argument = state.currentArgument; const method = state.currentMethod; @@ -41,15 +36,10 @@ export function extractNamedType( } // Argument value - setPropertyType( - argument, - argument.name, - { - type: node.name.value, - required: state.nonNullType, - }, - blackboard - ); + setPropertyType(argument, argument.name, { + type: node.name.value, + required: state.nonNullType, + }); state.nonNullType = false; } else if (method) { @@ -69,15 +59,10 @@ export function extractNamedType( ); } - setPropertyType( - state.currentReturn, - method.name, - { - type: node.name.value, - required: state.nonNullType, - }, - blackboard - ); + setPropertyType(state.currentReturn, method.name, { + type: node.name.value, + required: state.nonNullType, + }); state.nonNullType = false; } @@ -131,6 +116,7 @@ export function extractInputValueDefinition( const argument = createPropertyDefinition({ type: "N/A", name: node.name.value, + comment: node.description?.value, }); method.arguments.push(argument); state.currentArgument = argument; diff --git a/packages/schema/parse/src/extract/query-types.ts b/packages/schema/parse/src/extract/query-types.ts index 7e53123824..4653e032c6 100644 --- a/packages/schema/parse/src/extract/query-types.ts +++ b/packages/schema/parse/src/extract/query-types.ts @@ -4,6 +4,7 @@ import { createQueryDefinition, createMethodDefinition, createPropertyDefinition, + createInterfaceImplementedDefinition, } from "../typeInfo"; import { extractInputValueDefinition, @@ -11,27 +12,21 @@ import { extractNamedType, State, } from "./query-types-utils"; -import { Blackboard } from "./Blackboard"; import { - DocumentNode, ObjectTypeDefinitionNode, NonNullTypeNode, NamedTypeNode, ListTypeNode, FieldDefinitionNode, InputValueDefinitionNode, - visit, DirectiveNode, ArgumentNode, ValueNode, + ASTVisitor, } from "graphql"; -const visitorEnter = ( - queryTypes: QueryDefinition[], - state: State, - blackboard: Blackboard -) => ({ +const visitorEnter = (queryTypes: QueryDefinition[], state: State) => ({ ObjectTypeDefinition: (node: ObjectTypeDefinitionNode) => { const nodeName = node.name.value; @@ -39,58 +34,15 @@ const visitorEnter = ( return; } - // Look for the imports directive, and gather imported types - const imports: { type: string }[] = []; - - if (node.directives) { - const importsIndex = node.directives.findIndex( - (dir: DirectiveNode) => dir.name.value === "imports" - ); - - if (importsIndex !== -1) { - const importsDir = node.directives[importsIndex]; - - if (!importsDir.arguments) { - throw Error( - `@imports directive is incomplete, missing arguments. See type ${nodeName}.` - ); - } - - const typesIndex = importsDir.arguments.findIndex( - (arg: ArgumentNode) => arg.name.value === "types" - ); - - if (typesIndex === -1) { - throw Error( - `@imports directive missing required argument "types". See type ${nodeName}.` - ); - } - - const typesArg = importsDir.arguments[typesIndex]; - - if (typesArg.value.kind !== "ListValue") { - throw Error( - `@imports directive's types argument must be a List type. See type ${nodeName}.` - ); - } - - const listValue = typesArg.value; - - listValue.values.forEach((value: ValueNode) => { - if (value.kind !== "StringValue") { - throw Error( - `@imports directive's types list must only contain strings. See type ${nodeName}.` - ); - } - - imports.push({ type: value.value }); - }); - } - } + const imports = parseImportsDirective(nodeName, node); const query = createQueryDefinition({ type: nodeName, imports, + interfaces: node.interfaces?.map((x) => + createInterfaceImplementedDefinition({ type: x.name.value }) + ), + comment: node.description?.value, }); queryTypes.push(query); state.currentQuery = query; @@ -111,6 +63,7 @@ const visitorEnter = ( type: query.type, name: node.name.value, return: returnType, + comment: node.description?.value, }); query.methods.push(method); state.currentMethod = method; @@ -123,13 +76,71 @@ const visitorEnter = ( state.nonNullType = true; }, NamedType: (node: NamedTypeNode) => { - extractNamedType(node, state, blackboard); + extractNamedType(node, state); }, ListType: (_node: ListTypeNode) => { extractListType(state); }, }); +const parseImportsDirective = ( + nodeName: string, + node: ObjectTypeDefinitionNode +): { type: string }[] => { + // Look for the imports directive, and gather imported types + const imports: { type: string }[] = []; + + if (!node.directives) { + return imports; + } + + const importsIndex = node.directives.findIndex( + (dir: DirectiveNode) => dir.name.value === "imports" + ); + + if (importsIndex !== -1) { + const importsDir = node.directives[importsIndex]; + + if (!importsDir.arguments) { + throw Error( + `@imports directive is incomplete, missing arguments. See type ${nodeName}.` + ); + } + + const typesIndex = importsDir.arguments.findIndex( + (arg: ArgumentNode) => arg.name.value === "types" + ); + + if (typesIndex === -1) { + throw Error( + `@imports directive missing required argument "types". See type ${nodeName}.` + ); + } + + const typesArg = importsDir.arguments[typesIndex]; + + if (typesArg.value.kind !== "ListValue") { + throw Error( + `@imports directive's types argument must be a List type. See type ${nodeName}.` + ); + } + + const listValue = typesArg.value; + + listValue.values.forEach((value: ValueNode) => { + if (value.kind !== "StringValue") { + throw Error( + `@imports directive's types list must only contain strings. See type ${nodeName}.` + ); + } + + imports.push({ type: value.value }); + }); + } + + return imports; +}; + const visitorLeave = (state: State) => ({ ObjectTypeDefinition: (_node: ObjectTypeDefinitionNode) => { state.currentQuery = undefined; @@ -146,15 +157,11 @@ const visitorLeave = (state: State) => ({ }, }); -export function extractQueryTypes( - astNode: DocumentNode, - typeInfo: TypeInfo, - blackboard: Blackboard -): void { +export const getQueryTypesVisitor = (typeInfo: TypeInfo): ASTVisitor => { const state: State = {}; - visit(astNode, { - enter: visitorEnter(typeInfo.queryTypes, state, blackboard), + return { + enter: visitorEnter(typeInfo.queryTypes, state), leave: visitorLeave(state), - }); -} + }; +}; diff --git a/packages/schema/parse/src/index.ts b/packages/schema/parse/src/index.ts index bf15b8c585..ec86967b7d 100644 --- a/packages/schema/parse/src/index.ts +++ b/packages/schema/parse/src/index.ts @@ -1,20 +1,19 @@ import { TypeInfo, createTypeInfo } from "./typeInfo"; -import { extractors, SchemaExtractor } from "./extract"; +import { extractors, SchemaExtractorBuilder } from "./extract"; import { TypeInfoTransforms, transformTypeInfo } from "./transform"; import { finalizePropertyDef } from "./transform/finalizePropertyDef"; -import { validators, SchemaValidator } from "./validate"; -import { Blackboard } from "./extract/Blackboard"; +import { SchemaValidatorBuilder, validators } from "./validate"; -import { parse } from "graphql"; +import { DocumentNode, parse, visit, visitInParallel } from "graphql"; export * from "./typeInfo"; export * from "./transform"; export * from "./header"; interface ParserOptions { - extractors?: SchemaExtractor[]; + extractors?: SchemaExtractorBuilder[]; transforms?: TypeInfoTransforms[]; - validators?: SchemaValidator[]; + validators?: SchemaValidatorBuilder[]; noValidate?: boolean; } @@ -27,34 +26,17 @@ export function parseSchema( // Validate GraphQL Schema if (!options.noValidate) { const validates = options.validators || validators; - const errors: Error[] = []; - - for (const validate of validates) { - try { - validate(astNode); - } catch (e) { - errors.push(e); - } - } - - if (errors.length) { - throw errors; - } + validate(astNode, validates); } - // Create a blackboard for shared metadata - const blackboard = new Blackboard(astNode); - // Extract & Build TypeInfo let info = createTypeInfo(); - const extracts = options.extractors || extractors; - for (const extract of extracts) { - extract(astNode, info, blackboard); - } + const extracts = options.extractors || extractors; + extract(astNode, info, extracts); // Finalize & Transform TypeInfo - info = transformTypeInfo(info, finalizePropertyDef); + info = transformTypeInfo(info, finalizePropertyDef(info)); if (options && options.transforms) { for (const transform of options.transforms) { @@ -64,3 +46,32 @@ export function parseSchema( return info; } + +const validate = ( + astNode: DocumentNode, + validators: SchemaValidatorBuilder[] +) => { + const allValidators = validators.map((getValidator) => getValidator()); + const allVisitors = allValidators.map((x) => x.visitor); + const allDisplayValidationMessages = allValidators.map( + (x) => x.displayValidationMessagesIfExist + ); + + visit(astNode, visitInParallel(allVisitors)); + + for (const displayValidationMessagesIfExist of allDisplayValidationMessages) { + if (displayValidationMessagesIfExist) { + displayValidationMessagesIfExist(astNode); + } + } +}; + +const extract = ( + astNode: DocumentNode, + typeInfo: TypeInfo, + extractors: SchemaExtractorBuilder[] +) => { + const allVisitors = extractors.map((getVisitor) => getVisitor(typeInfo)); + + visit(astNode, visitInParallel(allVisitors)); +}; diff --git a/packages/schema/parse/src/transform/addFirstLast.ts b/packages/schema/parse/src/transform/addFirstLast.ts index 619a55638b..144201423d 100644 --- a/packages/schema/parse/src/transform/addFirstLast.ts +++ b/packages/schema/parse/src/transform/addFirstLast.ts @@ -19,6 +19,7 @@ export const addFirstLast: TypeInfoTransforms = { ObjectDefinition: (def: ObjectDefinition) => ({ ...def, properties: setFirstLast(def.properties), + interfaces: setFirstLast(def.interfaces), }), MethodDefinition: (def: MethodDefinition) => ({ ...def, @@ -28,6 +29,7 @@ export const addFirstLast: TypeInfoTransforms = { ...def, methods: setFirstLast(def.methods), imports: setFirstLast(def.imports), + interfaces: setFirstLast(def.interfaces), }), ImportedQueryDefinition: (def: ImportedQueryDefinition) => ({ ...def, diff --git a/packages/schema/parse/src/transform/finalizePropertyDef.ts b/packages/schema/parse/src/transform/finalizePropertyDef.ts index f638799cfd..561195db9a 100644 --- a/packages/schema/parse/src/transform/finalizePropertyDef.ts +++ b/packages/schema/parse/src/transform/finalizePropertyDef.ts @@ -1,25 +1,35 @@ import { TypeInfoTransforms } from "."; import { ArrayDefinition, + createEnumRef, + createObjectRef, GenericDefinition, PropertyDefinition, + TypeInfo, } from "../typeInfo"; -export const finalizePropertyDef: TypeInfoTransforms = { - enter: { - // eslint-disable-next-line @typescript-eslint/naming-convention - PropertyDefinition: (def: PropertyDefinition): PropertyDefinition => { - populatePropertyType(def); - return def; +export const finalizePropertyDef = (typeInfo: TypeInfo): TypeInfoTransforms => { + return { + enter: { + // eslint-disable-next-line @typescript-eslint/naming-convention + PropertyDefinition: (def: PropertyDefinition): PropertyDefinition => { + populatePropertyType(def, typeInfo); + return def; + }, }, - }, + }; }; -export function populatePropertyType(property: PropertyDefinition): void { +export function populatePropertyType( + property: PropertyDefinition, + typeInfo: TypeInfo +): void { let propertyType: GenericDefinition | undefined; if (property.array) { - populateArrayType(property.array); + populateArrayType(property.array, typeInfo); propertyType = property.array; + } else if (property.unresolvedObjectOrEnum) { + propertyType = resolveObjectOrEnumKind(property, typeInfo); } else if (property.scalar) { propertyType = property.scalar; } else if (property.object) { @@ -34,18 +44,19 @@ export function populatePropertyType(property: PropertyDefinition): void { property.required = propertyType.required; } -function populateArrayType(array: ArrayDefinition) { +function populateArrayType(array: ArrayDefinition, typeInfo: TypeInfo) { let baseTypeFound = false; let currentArray = array; while (!baseTypeFound) { if (currentArray.array) { currentArray = currentArray.array; - populateArrayType(currentArray); + populateArrayType(currentArray, typeInfo); } else if ( currentArray.scalar || currentArray.object || - currentArray.enum + currentArray.enum || + currentArray.unresolvedObjectOrEnum ) { baseTypeFound = true; } else { @@ -61,6 +72,8 @@ function populateArrayType(array: ArrayDefinition) { if (array.array) { array.item = array.array; + } else if (array.unresolvedObjectOrEnum) { + array.item = resolveObjectOrEnumKind(array, typeInfo); } else if (array.scalar) { array.item = array.scalar; } else if (array.enum) { @@ -75,3 +88,61 @@ function populateArrayType(array: ArrayDefinition) { array.type = "[" + array.item.type + "]"; } + +function resolveObjectOrEnumKind( + property: PropertyDefinition, + typeInfo: TypeInfo +): GenericDefinition { + if (!property.unresolvedObjectOrEnum) { + throw Error("Type reference is undefined, this should never happen."); + } + + // Check to see if the type is a part of the custom types defined inside the schema (objects, enums) + let customType: GenericDefinition | undefined = typeInfo.objectTypes.find( + (type) => type.type === property.unresolvedObjectOrEnum!.type + ); + + customType = customType + ? customType + : typeInfo.importedObjectTypes.find( + (type) => type.type === property.unresolvedObjectOrEnum!.type + ); + + if (!customType) { + customType = typeInfo.enumTypes.find( + (type) => type.type === property.unresolvedObjectOrEnum!.type + ); + + customType = customType + ? customType + : typeInfo.importedEnumTypes.find( + (type) => type.type === property.unresolvedObjectOrEnum!.type + ); + + if (!customType) { + throw new Error( + `Unsupported type ${property.unresolvedObjectOrEnum.type}` + ); + } + + property.enum = createEnumRef({ + name: property.unresolvedObjectOrEnum.name, + required: property.unresolvedObjectOrEnum.required ?? undefined, + type: property.unresolvedObjectOrEnum.type, + }); + + property.unresolvedObjectOrEnum = null; + + return property.enum; + } else { + property.object = createObjectRef({ + name: property.unresolvedObjectOrEnum.name, + required: property.unresolvedObjectOrEnum.required ?? undefined, + type: property.unresolvedObjectOrEnum.type, + }); + + property.unresolvedObjectOrEnum = null; + + return property.object; + } +} diff --git a/packages/schema/parse/src/transform/index.ts b/packages/schema/parse/src/transform/index.ts index 93e88b429a..c07e85b3bb 100644 --- a/packages/schema/parse/src/transform/index.ts +++ b/packages/schema/parse/src/transform/index.ts @@ -16,6 +16,9 @@ import { isKind, EnumDefinition, ImportedEnumDefinition, + InterfaceImplementedDefinition, + EnumRef, + ObjectRef, } from "../typeInfo"; export * from "./finalizePropertyDef"; @@ -32,9 +35,11 @@ export interface TypeInfoTransformer { TypeInfo?: (typeInfo: TypeInfo) => TypeInfo; GenericDefinition?: (def: GenericDefinition) => GenericDefinition; ObjectDefinition?: (def: ObjectDefinition) => ObjectDefinition; + ObjectRef?: (def: ObjectRef) => ObjectRef; AnyDefinition?: (def: AnyDefinition) => AnyDefinition; ScalarDefinition?: (def: ScalarDefinition) => ScalarDefinition; EnumDefinition?: (def: EnumDefinition) => EnumDefinition; + EnumRef?: (def: EnumRef) => EnumRef; PropertyDefinition?: (def: PropertyDefinition) => PropertyDefinition; ArrayDefinition?: (def: ArrayDefinition) => ArrayDefinition; MethodDefinition?: (def: MethodDefinition) => MethodDefinition; @@ -48,6 +53,9 @@ export interface TypeInfoTransformer { ImportedObjectDefinition?: ( def: ImportedObjectDefinition ) => ImportedObjectDefinition; + InterfaceImplementedDefinition?: ( + def: InterfaceImplementedDefinition + ) => InterfaceImplementedDefinition; } export function transformTypeInfo( @@ -120,6 +128,33 @@ export function visitObjectDefinition( ); } + for (let i = 0; i < result.interfaces.length; ++i) { + result.interfaces[i] = visitInterfaceImplementedDefinition( + result.interfaces[i], + transforms + ); + } + + return transformType(result, transforms.leave); +} + +export function visitObjectRef( + def: ObjectRef, + transforms: TypeInfoTransforms +): ObjectRef { + let result = Object.assign({}, def); + result = transformType(result, transforms.enter); + + return transformType(result, transforms.leave); +} + +export function visitInterfaceImplementedDefinition( + def: InterfaceImplementedDefinition, + transforms: TypeInfoTransforms +): InterfaceImplementedDefinition { + let result = Object.assign({}, def); + result = transformType(result, transforms.enter); + return transformType(result, transforms.leave); } @@ -139,11 +174,11 @@ export function visitAnyDefinition( } if (result.object) { - result.object = visitObjectDefinition(result.object, transforms); + result.object = visitObjectRef(result.object, transforms); } if (result.enum) { - result.enum = visitEnumDefinition(result.enum, transforms); + result.enum = visitEnumRef(result.enum, transforms); } return result; @@ -167,6 +202,15 @@ export function visitEnumDefinition( return transformType(result, transforms.leave); } +export function visitEnumRef( + def: EnumRef, + transforms: TypeInfoTransforms +): EnumRef { + let result = Object.assign({}, def); + result = transformType(result, transforms.enter); + return transformType(result, transforms.leave); +} + export function visitArrayDefinition( def: ArrayDefinition, transforms: TypeInfoTransforms @@ -271,9 +315,11 @@ export function transformType( const { GenericDefinition, ObjectDefinition, + ObjectRef, AnyDefinition, ScalarDefinition, EnumDefinition, + EnumRef, ArrayDefinition, PropertyDefinition, MethodDefinition, @@ -281,6 +327,7 @@ export function transformType( ImportedEnumDefinition, ImportedQueryDefinition, ImportedObjectDefinition, + InterfaceImplementedDefinition, } = transform; if (GenericDefinition && isKind(result, DefinitionKind.Generic)) { @@ -289,6 +336,9 @@ export function transformType( if (ObjectDefinition && isKind(result, DefinitionKind.Object)) { result = Object.assign(result, ObjectDefinition(result as any)); } + if (ObjectRef && isKind(result, DefinitionKind.ObjectRef)) { + result = Object.assign(result, ObjectRef(result as any)); + } if (AnyDefinition && isKind(result, DefinitionKind.Any)) { result = Object.assign(result, AnyDefinition(result as any)); } @@ -298,6 +348,9 @@ export function transformType( if (EnumDefinition && isKind(result, DefinitionKind.Enum)) { result = Object.assign(result, EnumDefinition(result as any)); } + if (EnumRef && isKind(result, DefinitionKind.EnumRef)) { + result = Object.assign(result, EnumRef(result as any)); + } if (ArrayDefinition && isKind(result, DefinitionKind.Array)) { result = Object.assign(result, ArrayDefinition(result as any)); } @@ -322,6 +375,15 @@ export function transformType( ) { result = Object.assign(result, ImportedObjectDefinition(result as any)); } + if ( + InterfaceImplementedDefinition && + isKind(result, DefinitionKind.InterfaceImplemented) + ) { + result = Object.assign( + result, + InterfaceImplementedDefinition(result as any) + ); + } return result; } diff --git a/packages/schema/parse/src/transform/toGraphQLType.ts b/packages/schema/parse/src/transform/toGraphQLType.ts index d8ddb8454a..9e87e524ef 100644 --- a/packages/schema/parse/src/transform/toGraphQLType.ts +++ b/packages/schema/parse/src/transform/toGraphQLType.ts @@ -30,10 +30,12 @@ function anyToGraphQL(any: AnyDefinition, prefixed: boolean): string { function toGraphQL(def: GenericDefinition, prefixed = false): string { switch (def.kind) { case DefinitionKind.Object: + case DefinitionKind.ObjectRef: case DefinitionKind.Scalar: case DefinitionKind.ImportedObject: return applyRequired(def.type, def.required); case DefinitionKind.Enum: + case DefinitionKind.EnumRef: case DefinitionKind.ImportedEnum: if (prefixed) { return applyRequired(`Enum_${def.type}`, def.required); diff --git a/packages/schema/parse/src/typeInfo/definitions.ts b/packages/schema/parse/src/typeInfo/definitions.ts index d35c6f6672..312c2119e4 100644 --- a/packages/schema/parse/src/typeInfo/definitions.ts +++ b/packages/schema/parse/src/typeInfo/definitions.ts @@ -15,12 +15,19 @@ export enum DefinitionKind { ImportedQuery = 1 << 8, ImportedEnum = 1 << 9, ImportedObject = (1 << 10) | DefinitionKind.Object, + InterfaceImplemented = 1 << 11, + UnresolvedObjectOrEnum = 1 << 12, + ObjectRef = 1 << 13, + EnumRef = 1 << 14, } export function isKind(type: GenericDefinition, kind: DefinitionKind): boolean { return (type.kind & kind) === kind; } +export type WithComment = { + comment?: string; +}; export interface GenericDefinition { type: string; name: string | null; @@ -40,27 +47,45 @@ export function createGenericDefinition(args: { }; } -export interface ObjectDefinition extends GenericDefinition { +export interface ObjectDefinition extends GenericDefinition, WithComment { properties: PropertyDefinition[]; + interfaces: InterfaceImplementedDefinition[]; } export function createObjectDefinition(args: { type: string; name?: string | null; required?: boolean; properties?: PropertyDefinition[]; + interfaces?: InterfaceImplementedDefinition[]; + comment?: string; }): ObjectDefinition { return { ...createGenericDefinition(args), properties: args.properties ? args.properties : [], + interfaces: args.interfaces ? args.interfaces : [], + comment: args.comment, kind: DefinitionKind.Object, }; } +export type ObjectRef = GenericDefinition; +export function createObjectRef(args: { + type: string; + name?: string | null; + required?: boolean; +}): ObjectRef { + return { + ...createGenericDefinition(args), + kind: DefinitionKind.ObjectRef, + }; +} + export interface AnyDefinition extends GenericDefinition { array: ArrayDefinition | null; scalar: ScalarDefinition | null; - object: ObjectDefinition | null; - enum: EnumDefinition | null; + object: ObjectRef | null; + enum: EnumRef | null; + unresolvedObjectOrEnum: UnresolvedObjectOrEnumRef | null; } export function createAnyDefinition(args: { type: string; @@ -68,8 +93,8 @@ export function createAnyDefinition(args: { required?: boolean; array?: ArrayDefinition; scalar?: ScalarDefinition; - object?: ObjectDefinition; - enum?: EnumDefinition; + object?: ObjectRef; + enum?: EnumRef; }): AnyDefinition { return { ...createGenericDefinition(args), @@ -77,6 +102,7 @@ export function createAnyDefinition(args: { scalar: args.scalar ? args.scalar : null, object: args.object ? args.object : null, enum: args.enum ? args.enum : null, + unresolvedObjectOrEnum: null, kind: DefinitionKind.Any, }; } @@ -101,7 +127,7 @@ export function createScalarDefinition(args: { }; } -export interface EnumDefinition extends GenericDefinition { +export interface EnumDefinition extends GenericDefinition, WithComment { constants: string[]; } export function createEnumDefinition(args: { @@ -109,12 +135,39 @@ export function createEnumDefinition(args: { name?: string | null; required?: boolean; constants?: string[]; + comment?: string; }): EnumDefinition { return { ...createGenericDefinition(args), type: args.type, kind: DefinitionKind.Enum, constants: args.constants ? args.constants : [], + comment: args.comment, + }; +} + +export type EnumRef = GenericDefinition; +export function createEnumRef(args: { + type: string; + name?: string | null; + required?: boolean; +}): EnumRef { + return { + ...createGenericDefinition(args), + kind: DefinitionKind.EnumRef, + }; +} + +export type UnresolvedObjectOrEnumRef = GenericDefinition; +export function createUnresolvedObjectOrEnumRef(args: { + type: string; + name?: string | null; + required?: boolean; +}): UnresolvedObjectOrEnumRef { + return { + ...createGenericDefinition(args), + type: args.type, + kind: DefinitionKind.UnresolvedObjectOrEnum, }; } @@ -139,12 +192,12 @@ export function createArrayDefinition(args: { ? (args.item as ScalarDefinition) : undefined, object: - args.item && isKind(args.item, DefinitionKind.Object) - ? (args.item as ObjectDefinition) + args.item && isKind(args.item, DefinitionKind.ObjectRef) + ? (args.item as ObjectRef) : undefined, enum: - args.item && isKind(args.item, DefinitionKind.Enum) - ? (args.item as EnumDefinition) + args.item && isKind(args.item, DefinitionKind.EnumRef) + ? (args.item as EnumRef) : undefined, }), item: args.item ? args.item : null, @@ -152,27 +205,46 @@ export function createArrayDefinition(args: { }; } -export type PropertyDefinition = AnyDefinition; +export type PropertyDefinition = AnyDefinition & WithComment; export function createPropertyDefinition(args: { type: string; name?: string | null; required?: boolean; array?: ArrayDefinition; scalar?: ScalarDefinition; - object?: ObjectDefinition; - enum?: EnumDefinition; + object?: ObjectRef; + enum?: EnumRef; + comment?: string; }): PropertyDefinition { return { ...createAnyDefinition(args), + comment: args.comment, kind: DefinitionKind.Property, }; } +export type InterfaceImplementedDefinition = GenericDefinition; +export function createInterfaceImplementedDefinition(args: { + type: string; + name?: string | null; + required?: boolean; + array?: ArrayDefinition; + scalar?: ScalarDefinition; + object?: ObjectDefinition; + enum?: EnumDefinition; +}): InterfaceImplementedDefinition { + return { + ...createAnyDefinition(args), + kind: DefinitionKind.InterfaceImplemented, + }; +} + export function createArrayPropertyDefinition(args: { type: string; name?: string | null; required?: boolean; item?: GenericDefinition; + comment?: string; }): PropertyDefinition { return createPropertyDefinition({ ...args, @@ -184,6 +256,7 @@ export function createScalarPropertyDefinition(args: { type: string; name?: string | null; required?: boolean; + comment?: string; }): PropertyDefinition { return createPropertyDefinition({ ...args, @@ -196,10 +269,11 @@ export function createEnumPropertyDefinition(args: { name?: string | null; required?: boolean; constants?: string[]; + comment?: string; }): PropertyDefinition { return createPropertyDefinition({ ...args, - enum: createEnumDefinition(args), + enum: createEnumRef(args), }); } @@ -208,14 +282,15 @@ export function createObjectPropertyDefinition(args: { name?: string | null; required?: boolean; properties?: PropertyDefinition[]; + comment?: string; }): PropertyDefinition { return createPropertyDefinition({ ...args, - object: createObjectDefinition(args), + object: createObjectRef(args), }); } -export interface MethodDefinition extends GenericDefinition { +export interface MethodDefinition extends GenericDefinition, WithComment { type: OperationType; arguments: PropertyDefinition[]; return: PropertyDefinition; @@ -225,6 +300,7 @@ export function createMethodDefinition(args: { name: string; arguments?: PropertyDefinition[]; return: PropertyDefinition; + comment?: string; }): MethodDefinition { const lowercase = args.type.toLowerCase(); if (!isOperationType(lowercase)) { @@ -238,19 +314,23 @@ export function createMethodDefinition(args: { required: true, arguments: args.arguments ? args.arguments : [], return: args.return, + comment: args.comment, kind: DefinitionKind.Method, }; } -export interface QueryDefinition extends GenericDefinition { +export interface QueryDefinition extends GenericDefinition, WithComment { type: QueryType; methods: MethodDefinition[]; imports: { type: string }[]; + interfaces: InterfaceImplementedDefinition[]; } export function createQueryDefinition(args: { type: string; imports?: { type: string }[]; + interfaces?: InterfaceImplementedDefinition[]; required?: boolean; + comment?: string; }): QueryDefinition { if (!isQueryType(args.type)) { throw Error( @@ -263,6 +343,8 @@ export function createQueryDefinition(args: { type: args.type, methods: [], imports: args.imports ? args.imports : [], + interfaces: args.interfaces ? args.interfaces : [], + comment: args.comment, kind: DefinitionKind.Query, }; } @@ -275,7 +357,8 @@ export interface ImportedDefinition { export interface ImportedEnumDefinition extends EnumDefinition, - ImportedDefinition {} + ImportedDefinition, + WithComment {} export function createImportedEnumDefinition(args: { type: string; constants: string[]; @@ -284,19 +367,22 @@ export function createImportedEnumDefinition(args: { uri: string; namespace: string; nativeType: string; + comment?: string; }): ImportedEnumDefinition { return { ...createEnumDefinition(args), uri: args.uri, namespace: args.namespace, nativeType: args.nativeType, + comment: args.comment, kind: DefinitionKind.ImportedEnum, }; } export interface ImportedQueryDefinition extends GenericDefinition, - ImportedDefinition { + ImportedDefinition, + WithComment { methods: MethodDefinition[]; } export function createImportedQueryDefinition(args: { @@ -305,6 +391,8 @@ export function createImportedQueryDefinition(args: { uri: string; namespace: string; nativeType: string; + interfaces?: InterfaceImplementedDefinition[]; + comment?: string; }): ImportedQueryDefinition { if (!isQueryType(args.nativeType)) { throw Error( @@ -318,13 +406,15 @@ export function createImportedQueryDefinition(args: { uri: args.uri, namespace: args.namespace, nativeType: args.nativeType, + comment: args.comment, kind: DefinitionKind.ImportedQuery, }; } export interface ImportedObjectDefinition extends ObjectDefinition, - ImportedDefinition {} + ImportedDefinition, + WithComment {} export function createImportedObjectDefinition(args: { type: string; name?: string; @@ -332,12 +422,15 @@ export function createImportedObjectDefinition(args: { uri: string; namespace: string; nativeType: string; + interfaces?: InterfaceImplementedDefinition[]; + comment?: string; }): ImportedObjectDefinition { return { ...createObjectDefinition(args), uri: args.uri, namespace: args.namespace, nativeType: args.nativeType, + comment: args.comment, kind: DefinitionKind.ImportedObject, }; } diff --git a/packages/schema/parse/src/validate/SchemaValidator.ts b/packages/schema/parse/src/validate/SchemaValidator.ts new file mode 100644 index 0000000000..1a9aab9285 --- /dev/null +++ b/packages/schema/parse/src/validate/SchemaValidator.ts @@ -0,0 +1,6 @@ +import { ASTVisitor, DocumentNode } from "graphql"; + +export type SchemaValidator = { + visitor: ASTVisitor; + displayValidationMessagesIfExist?: (documentNode: DocumentNode) => void; +}; diff --git a/packages/schema/parse/src/validate/directives.ts b/packages/schema/parse/src/validate/directives.ts index 33a51cda23..f338b82486 100644 --- a/packages/schema/parse/src/validate/directives.ts +++ b/packages/schema/parse/src/validate/directives.ts @@ -1,43 +1,41 @@ import { ImportedDefinition } from "../typeInfo"; +import { SchemaValidator } from "./SchemaValidator"; -import { - visit, - DirectiveNode, - DocumentNode, - ASTNode, - ObjectTypeDefinitionNode, -} from "graphql"; +import { DirectiveNode, ASTNode, ObjectTypeDefinitionNode } from "graphql"; -export function supportedDirectives(astNode: DocumentNode): void { +export const getSupportedDirectivesValidator = (): SchemaValidator => { const supportedDirectives = ["imported", "imports"]; const unsupportedUsages: string[] = []; - visit(astNode, { - enter: { - Directive: (node: DirectiveNode) => { - const name = node.name.value; + return { + visitor: { + enter: { + Directive: (node: DirectiveNode) => { + const name = node.name.value; - if (!supportedDirectives.includes(name)) { - unsupportedUsages.push(name); - } + if (!supportedDirectives.includes(name)) { + unsupportedUsages.push(name); + } + }, }, }, - }); - - if (unsupportedUsages.length) { - throw new Error( - `Found the following usages of unsupported directives:${unsupportedUsages.map( - (u) => `\n@${u}` - )}` - ); - } -} + displayValidationMessagesIfExist: () => { + if (unsupportedUsages.length) { + throw new Error( + `Found the following usages of unsupported directives:${unsupportedUsages.map( + (u) => `\n@${u}` + )}` + ); + } + }, + }; +}; -export function importsDirective(astNode: DocumentNode): void { - let lastNodeVisited = ""; +export const getImportsDirectiveValidator = (): SchemaValidator => { + let isInsideObjectTypeDefinition = false; const ObjectTypeDefinition = (node: ObjectTypeDefinitionNode) => { - lastNodeVisited = node.kind; + isInsideObjectTypeDefinition = true; const badUsageLocations: string[] = []; const importsAllowedObjectTypes = ["Query", "Mutation"]; @@ -73,7 +71,7 @@ export function importsDirective(astNode: DocumentNode): void { return; } - if (lastNodeVisited !== "ObjectTypeDefinition") { + if (!isInsideObjectTypeDefinition) { throw new Error( `@imports directive should only be used on QUERY or MUTATION type definitions, ` + `but it is being used in the following location: ${path.join(" -> ")}` @@ -120,28 +118,32 @@ export function importsDirective(astNode: DocumentNode): void { } }; - visit(astNode, { - enter: ( - node: ASTNode, - key: string | number | undefined, - parent: ASTNode | undefined, - path: ReadonlyArray - ) => { - if (node.kind === "ObjectTypeDefinition") { - ObjectTypeDefinition(node as ObjectTypeDefinitionNode); - } else if (node.kind === "Directive") { - Directive(node as DirectiveNode, key, parent, path); - } - - if (node.kind !== "Name") { - lastNodeVisited = node.kind; - } + return { + visitor: { + enter: ( + node: ASTNode, + key: string | number | undefined, + parent: ASTNode | undefined, + path: ReadonlyArray + ) => { + if (node.kind === "ObjectTypeDefinition") { + ObjectTypeDefinition(node as ObjectTypeDefinitionNode); + } else if (node.kind === "Directive") { + Directive(node as DirectiveNode, key, parent, path); + } else if ( + node.kind !== "NamedType" && + node.kind !== "Name" && + node.kind !== "StringValue" + ) { + isInsideObjectTypeDefinition = false; + } + }, }, - }); -} + }; +}; -export function importedDirective(astNode: ASTNode): void { - let lastNodeVisited = ""; +export const getImportedDirectiveValidator = (): SchemaValidator => { + let isInsideObjectOrEnumTypeDefinition = false; const Directive = ( node: DirectiveNode, @@ -153,10 +155,7 @@ export function importedDirective(astNode: ASTNode): void { return; } - if ( - lastNodeVisited !== "ObjectTypeDefinition" && - lastNodeVisited !== "EnumTypeDefinition" - ) { + if (!isInsideObjectOrEnumTypeDefinition) { throw new Error( `@imported directive should only be used on object or enum type definitions, ` + `but it is being used in the following location: ${path.join(" -> ")}` @@ -198,20 +197,29 @@ export function importedDirective(astNode: ASTNode): void { } }; - visit(astNode, { - enter: ( - node: ASTNode, - key: string | number | undefined, - parent: ASTNode | undefined, - path: ReadonlyArray - ) => { - if (node.kind === "Directive") { - Directive(node as DirectiveNode, key, parent, path); - } - - if (node.kind !== "Name") { - lastNodeVisited = node.kind; - } + return { + visitor: { + enter: ( + node: ASTNode, + key: string | number | undefined, + parent: ASTNode | undefined, + path: ReadonlyArray + ) => { + if (node.kind === "Directive") { + Directive(node as DirectiveNode, key, parent, path); + } else if ( + node.kind === "ObjectTypeDefinition" || + node.kind === "EnumTypeDefinition" + ) { + isInsideObjectOrEnumTypeDefinition = true; + } else if ( + node.kind !== "NamedType" && + node.kind !== "Name" && + node.kind !== "StringValue" + ) { + isInsideObjectOrEnumTypeDefinition = false; + } + }, }, - }); -} + }; +}; diff --git a/packages/schema/parse/src/validate/index.ts b/packages/schema/parse/src/validate/index.ts index 4974a91d86..235fd7d63c 100644 --- a/packages/schema/parse/src/validate/index.ts +++ b/packages/schema/parse/src/validate/index.ts @@ -1,17 +1,16 @@ import * as directiveValidators from "./directives"; import * as typeValidators from "./types"; +import { SchemaValidator } from "./SchemaValidator"; -import { DocumentNode } from "graphql"; +export type SchemaValidatorBuilder = () => SchemaValidator; -export type SchemaValidator = (astNode: DocumentNode) => void; - -export const validators: SchemaValidator[] = [ - directiveValidators.supportedDirectives, - directiveValidators.importedDirective, - directiveValidators.importsDirective, - typeValidators.typeDefinitions, - typeValidators.propertyTypes, - typeValidators.circularDefinitions, +export const validators: SchemaValidatorBuilder[] = [ + directiveValidators.getSupportedDirectivesValidator, + directiveValidators.getImportedDirectiveValidator, + directiveValidators.getImportsDirectiveValidator, + typeValidators.getTypeDefinitionsValidator, + typeValidators.getPropertyTypesValidator, + typeValidators.getCircularDefinitionsValidator, ]; export { directiveValidators, typeValidators }; diff --git a/packages/schema/parse/src/validate/types.ts b/packages/schema/parse/src/validate/types.ts index 0c0274548f..d4412e7e30 100644 --- a/packages/schema/parse/src/validate/types.ts +++ b/packages/schema/parse/src/validate/types.ts @@ -4,68 +4,84 @@ import { isQueryType, queryTypeNames, } from "../typeInfo"; +import { SchemaValidator } from "./SchemaValidator"; -import { DocumentNode, StringValueNode, visit } from "graphql"; +import { + DirectiveNode, + DocumentNode, + EnumTypeDefinitionNode, + FieldDefinitionNode, + InputObjectTypeDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + NamedTypeNode, + ObjectTypeDefinitionNode, + ScalarTypeDefinitionNode, + StringValueNode, + UnionTypeDefinitionNode, +} from "graphql"; import { getSchemaCycles } from "graphql-schema-cycles"; -export function typeDefinitions(astNode: DocumentNode): void { +export const getTypeDefinitionsValidator = (): SchemaValidator => { const objectTypes: Record = {}; - visit(astNode, { - enter: { - // No Interfaces - InterfaceTypeDefinition: (node) => { - throw Error( - "Interface type definitions are not supported.\n" + - `Found: interface ${node.name.value} { ... }\n` + - `Please Use: type ${node.name.value} { ... }` - ); - }, - // No Inputs - InputObjectTypeDefinition: (node) => { - throw Error( - "Input type definitions are not supported.\n" + - `Found: input ${node.name.value} { ... }\n` + - `Please Use: type ${node.name.value} { ... }` - ); - }, - ObjectTypeDefinition: (node) => { - // No Subscriptions - if (node.name.value === "Subscription") { + return { + visitor: { + enter: { + // No Interfaces + InterfaceTypeDefinition: (node: InterfaceTypeDefinitionNode) => { throw Error( - "Subscriptions are not yet supported. Please use Query or Mutation." + "Interface type definitions are not supported.\n" + + `Found: interface ${node.name.value} { ... }\n` + + `Please Use: type ${node.name.value} { ... }` ); - } - - // No duplicates - if (objectTypes[node.name.value]) { + }, + // No Inputs + InputObjectTypeDefinition: (node: InputObjectTypeDefinitionNode) => { throw Error( - `Duplicate object type definition found: ${node.name.value}` + "Input type definitions are not supported.\n" + + `Found: input ${node.name.value} { ... }\n` + + `Please Use: type ${node.name.value} { ... }` ); - } + }, + ObjectTypeDefinition: (node: ObjectTypeDefinitionNode) => { + // No Subscriptions + if (node.name.value === "Subscription") { + throw Error( + "Subscriptions are not yet supported. Please use Query or Mutation." + ); + } - objectTypes[node.name.value] = true; - }, - // No New Scalars - ScalarTypeDefinition: (node) => { - if (!isScalarType(node.name.value)) { + // No duplicates + if (objectTypes[node.name.value]) { + throw Error( + `Duplicate object type definition found: ${node.name.value}` + ); + } + + objectTypes[node.name.value] = true; + }, + // No New Scalars + ScalarTypeDefinition: (node: ScalarTypeDefinitionNode) => { + if (!isScalarType(node.name.value)) { + throw Error( + `Custom scalar types are not supported. Supported scalars: ${scalarTypeNames}` + ); + } + }, + // No Unions + UnionTypeDefinition: (node: UnionTypeDefinitionNode) => { throw Error( - `Custom scalar types are not supported. Supported scalars: ${scalarTypeNames}` + "Union type definitions are not supported.\n" + + `Found: union ${node.name.value}` ); - } - }, - // No Unions - UnionTypeDefinition: (node) => { - throw Error( - "Union type definitions are not supported.\n" + - `Found: union ${node.name.value}` - ); + }, }, }, - }); -} + }; +}; -export function propertyTypes(astNode: DocumentNode): void { +export const getPropertyTypesValidator = (): SchemaValidator => { let currentObject: string | undefined; let currentImportType: string | undefined; let currentField: string | undefined; @@ -77,108 +93,116 @@ export function propertyTypes(astNode: DocumentNode): void { type: string; }[] = []; - visit(astNode, { - enter: { - ObjectTypeDefinition: (node) => { - currentObject = node.name.value; - objectTypes[node.name.value] = true; - }, - EnumTypeDefinition: (node) => { - enumTypes[node.name.value] = true; - }, - Directive: (node) => { - if (node.name.value === "imported") { - // save the imported native type name - if (node.arguments) { - const nativeType = node.arguments.find( - (arg) => arg.name.value === "nativeType" - ); + return { + visitor: { + enter: { + ObjectTypeDefinition: (node: ObjectTypeDefinitionNode) => { + currentObject = node.name.value; + objectTypes[node.name.value] = true; + }, + EnumTypeDefinition: (node: EnumTypeDefinitionNode) => { + enumTypes[node.name.value] = true; + }, + Directive: (node: DirectiveNode) => { + if (node.name.value === "imported") { + // save the imported native type name + if (node.arguments) { + const nativeType = node.arguments.find( + (arg) => arg.name.value === "nativeType" + ); - if (nativeType) { - currentImportType = (nativeType.value as StringValueNode).value; + if (nativeType) { + currentImportType = (nativeType.value as StringValueNode).value; + } } } - } - }, - FieldDefinition: (node) => { - currentField = node.name.value; + }, + FieldDefinition: (node: FieldDefinitionNode) => { + currentField = node.name.value; + }, + NamedType: (node: NamedTypeNode) => { + if (currentObject && currentField) { + fieldTypes.push({ + object: currentObject, + field: currentField, + type: node.name.value, + }); + } + }, + InputValueDefinition: (node: InputValueDefinitionNode) => { + const typeName = currentImportType + ? currentImportType + : currentObject; + if (typeName && !isQueryType(typeName)) { + // Arguments not supported on non-query types + throw Error( + `Methods can only be defined on query types (${queryTypeNames.join( + ", " + )}).\n` + + `Found: type ${typeName} { ${currentField}(${node.name.value}) }` + ); + } + }, }, - NamedType: (node) => { - if (currentObject && currentField) { - fieldTypes.push({ - object: currentObject, - field: currentField, - type: node.name.value, - }); - } + leave: { + ObjectTypeDefinition: () => { + currentObject = undefined; + currentImportType = undefined; + }, + FieldDefinition: () => { + currentField = undefined; + }, }, - InputValueDefinition: (node) => { - const typeName = currentImportType ? currentImportType : currentObject; - if (typeName && !isQueryType(typeName)) { - // Arguments not supported on non-query types + }, + displayValidationMessagesIfExist: () => { + // Ensure all property types are either a + // supported scalar, enum or an object type definition + for (const field of fieldTypes) { + if ( + !isScalarType(field.type) && + !objectTypes[field.type] && + !enumTypes[field.type] + ) { throw Error( - `Methods can only be defined on query types (${queryTypeNames.join( - ", " - )}).\n` + - `Found: type ${typeName} { ${currentField}(${node.name.value}) }` + `Unknown property type found: type ${field.object} { ${field.field}: ${field.type} }` ); } - }, + } }, - leave: { - ObjectTypeDefinition: () => { - currentObject = undefined; - currentImportType = undefined; - }, - FieldDefinition: () => { - currentField = undefined; - }, - }, - }); - - // Ensure all property types are either a - // supported scalar, enum or an object type definition - for (const field of fieldTypes) { - if ( - !isScalarType(field.type) && - !objectTypes[field.type] && - !enumTypes[field.type] - ) { - throw Error( - `Unknown property type found: type ${field.object} { ${field.field}: ${field.type} }` - ); - } - } -} + }; +}; -export function circularDefinitions(astNode: DocumentNode): void { +export function getCircularDefinitionsValidator(): SchemaValidator { const operationTypes: string[] = []; const operationTypeNames = ["Mutation", "Subscription", "Query"]; - visit(astNode, { - enter: { - ObjectTypeDefinition: (node) => { - const isOperationType = operationTypeNames.some( - (name) => - node.name.value === name || node.name.value.endsWith(`_${name}`) - ); - if (isOperationType) { - operationTypes.push(node.name.value); - } + return { + visitor: { + enter: { + ObjectTypeDefinition: (node: ObjectTypeDefinitionNode) => { + const isOperationType = operationTypeNames.some( + (name) => + node.name.value === name || node.name.value.endsWith(`_${name}`) + ); + if (isOperationType) { + operationTypes.push(node.name.value); + } + }, }, }, - }); - - const { cycleStrings, foundCycle } = getSchemaCycles(astNode, { - ignoreTypeNames: operationTypes, - allowOnNullableFields: true, - }); + displayValidationMessagesIfExist: (documentNode: DocumentNode) => { + const { cycleStrings, foundCycle } = getSchemaCycles(documentNode, { + ignoreTypeNames: operationTypes, + allowOnNullableFields: true, + }); - if (foundCycle) { - throw Error( - `Graphql cycles are not supported. \nFound: ${cycleStrings.map( - (cycle) => `\n- ${cycle}` - )}` - ); - } + if (foundCycle) { + throw Error( + `Graphql cycles are not supported. \nFound: ${cycleStrings.map( + (cycle) => `\n- ${cycle}` + )}` + ); + } + }, + }; } diff --git a/packages/templates/api/assemblyscript/package.json b/packages/templates/api/assemblyscript/package.json index 25c4d291cc..48e1525a0f 100644 --- a/packages/templates/api/assemblyscript/package.json +++ b/packages/templates/api/assemblyscript/package.json @@ -20,7 +20,6 @@ "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1", "ethers": "5.0.7", - "js-yaml": "3.14.0", "solc": "0.8.3" } } diff --git a/packages/templates/api/interface/.gitignore b/packages/templates/api/interface/.gitignore new file mode 100644 index 0000000000..1e8f0fdefe --- /dev/null +++ b/packages/templates/api/interface/.gitignore @@ -0,0 +1,3 @@ +build +node_modules +w3 diff --git a/packages/templates/api/interface/.nvmrc b/packages/templates/api/interface/.nvmrc new file mode 100644 index 0000000000..158c00641a --- /dev/null +++ b/packages/templates/api/interface/.nvmrc @@ -0,0 +1 @@ +v14.16.0 diff --git a/packages/templates/api/interface/README.md b/packages/templates/api/interface/README.md new file mode 100644 index 0000000000..6aa16eebc6 --- /dev/null +++ b/packages/templates/api/interface/README.md @@ -0,0 +1,13 @@ +# Web3API Interface Example + +# How To Run + +## Install Dependencies +`nvm install && nvm use` +`yarn` + +## Start Test Environment +`yarn test:env:up` + +## Build & Deploy Web3API +`yarn deploy` \ No newline at end of file diff --git a/packages/templates/api/interface/package.json b/packages/templates/api/interface/package.json new file mode 100644 index 0000000000..6febf5a7dd --- /dev/null +++ b/packages/templates/api/interface/package.json @@ -0,0 +1,17 @@ +{ + "name": "templates-api-interface", + "description": "Web3API Interface Example", + "private": true, + "version": "0.0.1-prealpha.28", + "scripts": { + "build": "yarn build:web3api", + "build:web3api": "npx w3 build", + "test:env:up": "npx w3 test-env up", + "test:env:down": "npx w3 test-env down", + "deploy": "yarn deploy:web3api", + "deploy:web3api": "npx w3 build --ipfs http://localhost:5001" + }, + "devDependencies": { + "@web3api/cli": "0.0.1-prealpha.28" + } +} diff --git a/packages/templates/api/interface/query.graphql b/packages/templates/api/interface/query.graphql new file mode 100644 index 0000000000..3f7b824e13 --- /dev/null +++ b/packages/templates/api/interface/query.graphql @@ -0,0 +1,5 @@ +type Query { + methodToImplement( + arg: String + ): String +} \ No newline at end of file diff --git a/packages/templates/api/interface/web3api.yaml b/packages/templates/api/interface/web3api.yaml new file mode 100644 index 0000000000..a147deb3f1 --- /dev/null +++ b/packages/templates/api/interface/web3api.yaml @@ -0,0 +1,6 @@ +format: 0.0.1-prealpha.3 +repository: https://github.com/web3-api/monorepo +interface: true +modules: + query: + schema: ./src/query.graphql diff --git a/packages/templates/app/react/package.json b/packages/templates/app/react/package.json index 3b5f534416..df811cecf0 100644 --- a/packages/templates/app/react/package.json +++ b/packages/templates/app/react/package.json @@ -10,23 +10,23 @@ ] }, "dependencies": { - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^7.1.2", - "@types/node": "12.7.11", - "@types/react": "^16.9.0", - "@types/react-dom": "^16.9.0", - "@types/react-lottie": "^1.2.5", "@web3api/client-js": "0.0.1-prealpha.28", "@web3api/react": "0.0.1-prealpha.28", "http-proxy": "1.18.1", "http-proxy-middleware": "1.0.6", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-lottie": "^1.2.3", + "react": "16.13.1", + "react-dom": "16.13.1", + "react-lottie": "1.2.3", "react-scripts": "3.4.1", "stream-array": "1.1.2", "typescript": "4.0.7" }, + "devDependencies": { + "@types/node": "12.7.11", + "@types/react": "16.9.0", + "@types/react-dom": "16.9.0", + "@types/react-lottie": "1.2.5" + }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", diff --git a/packages/templates/app/react/public/thread.js b/packages/templates/app/react/public/thread.js index 48505ecd27..4f62de1c56 100644 --- a/packages/templates/app/react/public/thread.js +++ b/packages/templates/app/react/public/thread.js @@ -97,182 +97,182 @@ return /******/ (function(modules) { // webpackBootstrap /******/ ({ /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs": -/*!***********************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs ***! - \***********************************************************************************************************/ +/*!******************************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs ***! + \******************************************************************************************************************/ /*! exports provided: CachedKeyDecoder */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CachedKeyDecoder\", function() { return CachedKeyDecoder; });\n/* harmony import */ var _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/utf8.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs\");\n\nvar DEFAULT_MAX_KEY_LENGTH = 16;\nvar DEFAULT_MAX_LENGTH_PER_KEY = 16;\nvar CachedKeyDecoder = /** @class */ (function () {\n function CachedKeyDecoder(maxKeyLength, maxLengthPerKey) {\n if (maxKeyLength === void 0) { maxKeyLength = DEFAULT_MAX_KEY_LENGTH; }\n if (maxLengthPerKey === void 0) { maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY; }\n this.maxKeyLength = maxKeyLength;\n this.maxLengthPerKey = maxLengthPerKey;\n this.hit = 0;\n this.miss = 0;\n // avoid `new Array(N)` to create a non-sparse array for performance.\n this.caches = [];\n for (var i = 0; i < this.maxKeyLength; i++) {\n this.caches.push([]);\n }\n }\n CachedKeyDecoder.prototype.canBeCached = function (byteLength) {\n return byteLength > 0 && byteLength <= this.maxKeyLength;\n };\n CachedKeyDecoder.prototype.get = function (bytes, inputOffset, byteLength) {\n var records = this.caches[byteLength - 1];\n var recordsLength = records.length;\n FIND_CHUNK: for (var i = 0; i < recordsLength; i++) {\n var record = records[i];\n var recordBytes = record.bytes;\n for (var j = 0; j < byteLength; j++) {\n if (recordBytes[j] !== bytes[inputOffset + j]) {\n continue FIND_CHUNK;\n }\n }\n return record.value;\n }\n return null;\n };\n CachedKeyDecoder.prototype.store = function (bytes, value) {\n var records = this.caches[bytes.length - 1];\n var record = { bytes: bytes, value: value };\n if (records.length >= this.maxLengthPerKey) {\n // `records` are full!\n // Set `record` to a randomized position.\n records[(Math.random() * records.length) | 0] = record;\n }\n else {\n records.push(record);\n }\n };\n CachedKeyDecoder.prototype.decode = function (bytes, inputOffset, byteLength) {\n var cachedValue = this.get(bytes, inputOffset, byteLength);\n if (cachedValue != null) {\n this.hit++;\n return cachedValue;\n }\n this.miss++;\n var value = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8DecodeJs\"])(bytes, inputOffset, byteLength);\n // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer.\n var slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength);\n this.store(slicedCopyOfBytes, value);\n return value;\n };\n return CachedKeyDecoder;\n}());\n\n//# sourceMappingURL=CachedKeyDecoder.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CachedKeyDecoder\", function() { return CachedKeyDecoder; });\n/* harmony import */ var _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/utf8.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs\");\n\nvar DEFAULT_MAX_KEY_LENGTH = 16;\nvar DEFAULT_MAX_LENGTH_PER_KEY = 16;\nvar CachedKeyDecoder = /** @class */ (function () {\n function CachedKeyDecoder(maxKeyLength, maxLengthPerKey) {\n if (maxKeyLength === void 0) { maxKeyLength = DEFAULT_MAX_KEY_LENGTH; }\n if (maxLengthPerKey === void 0) { maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY; }\n this.maxKeyLength = maxKeyLength;\n this.maxLengthPerKey = maxLengthPerKey;\n this.hit = 0;\n this.miss = 0;\n // avoid `new Array(N)` to create a non-sparse array for performance.\n this.caches = [];\n for (var i = 0; i < this.maxKeyLength; i++) {\n this.caches.push([]);\n }\n }\n CachedKeyDecoder.prototype.canBeCached = function (byteLength) {\n return byteLength > 0 && byteLength <= this.maxKeyLength;\n };\n CachedKeyDecoder.prototype.get = function (bytes, inputOffset, byteLength) {\n var records = this.caches[byteLength - 1];\n var recordsLength = records.length;\n FIND_CHUNK: for (var i = 0; i < recordsLength; i++) {\n var record = records[i];\n var recordBytes = record.bytes;\n for (var j = 0; j < byteLength; j++) {\n if (recordBytes[j] !== bytes[inputOffset + j]) {\n continue FIND_CHUNK;\n }\n }\n return record.value;\n }\n return null;\n };\n CachedKeyDecoder.prototype.store = function (bytes, value) {\n var records = this.caches[bytes.length - 1];\n var record = { bytes: bytes, value: value };\n if (records.length >= this.maxLengthPerKey) {\n // `records` are full!\n // Set `record` to a randomized position.\n records[(Math.random() * records.length) | 0] = record;\n }\n else {\n records.push(record);\n }\n };\n CachedKeyDecoder.prototype.decode = function (bytes, inputOffset, byteLength) {\n var cachedValue = this.get(bytes, inputOffset, byteLength);\n if (cachedValue != null) {\n this.hit++;\n return cachedValue;\n }\n this.miss++;\n var value = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8DecodeJs\"])(bytes, inputOffset, byteLength);\n // Ensure to copy a slice of bytes because the byte may be NodeJS Buffer and Buffer#slice() returns a reference to its internal ArrayBuffer.\n var slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength);\n this.store(slicedCopyOfBytes, value);\n return value;\n };\n return CachedKeyDecoder;\n}());\n\n//# sourceMappingURL=CachedKeyDecoder.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs": -/*!**************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs ***! - \**************************************************************************************************/ +/*!*********************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs ***! + \*********************************************************************************************************/ /*! exports provided: DataViewIndexOutOfBoundsError, Decoder */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataViewIndexOutOfBoundsError\", function() { return DataViewIndexOutOfBoundsError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Decoder\", function() { return Decoder; });\n/* harmony import */ var _utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/prettyByte.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs\");\n/* harmony import */ var _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ExtensionCodec.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs\");\n/* harmony import */ var _utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/int.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs\");\n/* harmony import */ var _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/utf8.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs\");\n/* harmony import */ var _utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/typedArrays.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs\");\n/* harmony import */ var _CachedKeyDecoder_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CachedKeyDecoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __asyncValues = (undefined && undefined.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\n\n\n\n\n\n\nvar isValidMapKeyType = function (key) {\n var keyType = typeof key;\n return keyType === \"string\" || keyType === \"number\";\n};\nvar HEAD_BYTE_REQUIRED = -1;\nvar EMPTY_VIEW = new DataView(new ArrayBuffer(0));\nvar EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);\n// IE11: Hack to support IE11.\n// IE11: Drop this hack and just use RangeError when IE11 is obsolete.\nvar DataViewIndexOutOfBoundsError = (function () {\n try {\n // IE11: The spec says it should throw RangeError,\n // IE11: but in IE11 it throws TypeError.\n EMPTY_VIEW.getInt8(0);\n }\n catch (e) {\n return e.constructor;\n }\n throw new Error(\"never reached\");\n})();\nvar MORE_DATA = new DataViewIndexOutOfBoundsError(\"Insufficient data\");\nvar DEFAULT_MAX_LENGTH = 4294967295; // uint32_max\nvar sharedCachedKeyDecoder = new _CachedKeyDecoder_mjs__WEBPACK_IMPORTED_MODULE_5__[\"CachedKeyDecoder\"]();\nvar Decoder = /** @class */ (function () {\n function Decoder(extensionCodec, context, maxStrLength, maxBinLength, maxArrayLength, maxMapLength, maxExtLength, keyDecoder) {\n if (extensionCodec === void 0) { extensionCodec = _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__[\"ExtensionCodec\"].defaultCodec; }\n if (context === void 0) { context = undefined; }\n if (maxStrLength === void 0) { maxStrLength = DEFAULT_MAX_LENGTH; }\n if (maxBinLength === void 0) { maxBinLength = DEFAULT_MAX_LENGTH; }\n if (maxArrayLength === void 0) { maxArrayLength = DEFAULT_MAX_LENGTH; }\n if (maxMapLength === void 0) { maxMapLength = DEFAULT_MAX_LENGTH; }\n if (maxExtLength === void 0) { maxExtLength = DEFAULT_MAX_LENGTH; }\n if (keyDecoder === void 0) { keyDecoder = sharedCachedKeyDecoder; }\n this.extensionCodec = extensionCodec;\n this.context = context;\n this.maxStrLength = maxStrLength;\n this.maxBinLength = maxBinLength;\n this.maxArrayLength = maxArrayLength;\n this.maxMapLength = maxMapLength;\n this.maxExtLength = maxExtLength;\n this.keyDecoder = keyDecoder;\n this.totalPos = 0;\n this.pos = 0;\n this.view = EMPTY_VIEW;\n this.bytes = EMPTY_BYTES;\n this.headByte = HEAD_BYTE_REQUIRED;\n this.stack = [];\n }\n Decoder.prototype.reinitializeState = function () {\n this.totalPos = 0;\n this.headByte = HEAD_BYTE_REQUIRED;\n };\n Decoder.prototype.setBuffer = function (buffer) {\n this.bytes = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__[\"ensureUint8Array\"])(buffer);\n this.view = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__[\"createDataView\"])(this.bytes);\n this.pos = 0;\n };\n Decoder.prototype.appendBuffer = function (buffer) {\n if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining()) {\n this.setBuffer(buffer);\n }\n else {\n // retried because data is insufficient\n var remainingData = this.bytes.subarray(this.pos);\n var newData = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__[\"ensureUint8Array\"])(buffer);\n var concated = new Uint8Array(remainingData.length + newData.length);\n concated.set(remainingData);\n concated.set(newData, remainingData.length);\n this.setBuffer(concated);\n }\n };\n Decoder.prototype.hasRemaining = function (size) {\n if (size === void 0) { size = 1; }\n return this.view.byteLength - this.pos >= size;\n };\n Decoder.prototype.createExtraByteError = function (posToShow) {\n var _a = this, view = _a.view, pos = _a.pos;\n return new RangeError(\"Extra \" + (view.byteLength - pos) + \" of \" + view.byteLength + \" byte(s) found at buffer[\" + posToShow + \"]\");\n };\n Decoder.prototype.decode = function (buffer) {\n this.reinitializeState();\n this.setBuffer(buffer);\n var object = this.doDecodeSync();\n if (this.hasRemaining()) {\n throw this.createExtraByteError(this.pos);\n }\n return object;\n };\n Decoder.prototype.decodeAsync = function (stream) {\n var stream_1, stream_1_1;\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function () {\n var decoded, object, buffer, e_1_1, _b, headByte, pos, totalPos;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n decoded = false;\n _c.label = 1;\n case 1:\n _c.trys.push([1, 6, 7, 12]);\n stream_1 = __asyncValues(stream);\n _c.label = 2;\n case 2: return [4 /*yield*/, stream_1.next()];\n case 3:\n if (!(stream_1_1 = _c.sent(), !stream_1_1.done)) return [3 /*break*/, 5];\n buffer = stream_1_1.value;\n if (decoded) {\n throw this.createExtraByteError(this.totalPos);\n }\n this.appendBuffer(buffer);\n try {\n object = this.doDecodeSync();\n decoded = true;\n }\n catch (e) {\n if (!(e instanceof DataViewIndexOutOfBoundsError)) {\n throw e; // rethrow\n }\n // fallthrough\n }\n this.totalPos += this.pos;\n _c.label = 4;\n case 4: return [3 /*break*/, 2];\n case 5: return [3 /*break*/, 12];\n case 6:\n e_1_1 = _c.sent();\n e_1 = { error: e_1_1 };\n return [3 /*break*/, 12];\n case 7:\n _c.trys.push([7, , 10, 11]);\n if (!(stream_1_1 && !stream_1_1.done && (_a = stream_1.return))) return [3 /*break*/, 9];\n return [4 /*yield*/, _a.call(stream_1)];\n case 8:\n _c.sent();\n _c.label = 9;\n case 9: return [3 /*break*/, 11];\n case 10:\n if (e_1) throw e_1.error;\n return [7 /*endfinally*/];\n case 11: return [7 /*endfinally*/];\n case 12:\n if (decoded) {\n if (this.hasRemaining()) {\n throw this.createExtraByteError(this.totalPos);\n }\n return [2 /*return*/, object];\n }\n _b = this, headByte = _b.headByte, pos = _b.pos, totalPos = _b.totalPos;\n throw new RangeError(\"Insufficient data in parsing \" + Object(_utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__[\"prettyByte\"])(headByte) + \" at \" + totalPos + \" (\" + pos + \" in the current buffer)\");\n }\n });\n });\n };\n Decoder.prototype.decodeArrayStream = function (stream) {\n return this.decodeMultiAsync(stream, true);\n };\n Decoder.prototype.decodeStream = function (stream) {\n return this.decodeMultiAsync(stream, false);\n };\n Decoder.prototype.decodeMultiAsync = function (stream, isArray) {\n return __asyncGenerator(this, arguments, function decodeMultiAsync_1() {\n var isArrayHeaderRequired, arrayItemsLeft, stream_2, stream_2_1, buffer, e_2, e_3_1;\n var e_3, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n isArrayHeaderRequired = isArray;\n arrayItemsLeft = -1;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 13, 14, 19]);\n stream_2 = __asyncValues(stream);\n _b.label = 2;\n case 2: return [4 /*yield*/, __await(stream_2.next())];\n case 3:\n if (!(stream_2_1 = _b.sent(), !stream_2_1.done)) return [3 /*break*/, 12];\n buffer = stream_2_1.value;\n if (isArray && arrayItemsLeft === 0) {\n throw this.createExtraByteError(this.totalPos);\n }\n this.appendBuffer(buffer);\n if (isArrayHeaderRequired) {\n arrayItemsLeft = this.readArraySize();\n isArrayHeaderRequired = false;\n this.complete();\n }\n _b.label = 4;\n case 4:\n _b.trys.push([4, 9, , 10]);\n _b.label = 5;\n case 5:\n if (false) {}\n return [4 /*yield*/, __await(this.doDecodeSync())];\n case 6: return [4 /*yield*/, _b.sent()];\n case 7:\n _b.sent();\n if (--arrayItemsLeft === 0) {\n return [3 /*break*/, 8];\n }\n return [3 /*break*/, 5];\n case 8: return [3 /*break*/, 10];\n case 9:\n e_2 = _b.sent();\n if (!(e_2 instanceof DataViewIndexOutOfBoundsError)) {\n throw e_2; // rethrow\n }\n return [3 /*break*/, 10];\n case 10:\n this.totalPos += this.pos;\n _b.label = 11;\n case 11: return [3 /*break*/, 2];\n case 12: return [3 /*break*/, 19];\n case 13:\n e_3_1 = _b.sent();\n e_3 = { error: e_3_1 };\n return [3 /*break*/, 19];\n case 14:\n _b.trys.push([14, , 17, 18]);\n if (!(stream_2_1 && !stream_2_1.done && (_a = stream_2.return))) return [3 /*break*/, 16];\n return [4 /*yield*/, __await(_a.call(stream_2))];\n case 15:\n _b.sent();\n _b.label = 16;\n case 16: return [3 /*break*/, 18];\n case 17:\n if (e_3) throw e_3.error;\n return [7 /*endfinally*/];\n case 18: return [7 /*endfinally*/];\n case 19: return [2 /*return*/];\n }\n });\n });\n };\n Decoder.prototype.doDecodeSync = function () {\n DECODE: while (true) {\n var headByte = this.readHeadByte();\n var object = void 0;\n if (headByte >= 0xe0) {\n // negative fixint (111x xxxx) 0xe0 - 0xff\n object = headByte - 0x100;\n }\n else if (headByte < 0xc0) {\n if (headByte < 0x80) {\n // positive fixint (0xxx xxxx) 0x00 - 0x7f\n object = headByte;\n }\n else if (headByte < 0x90) {\n // fixmap (1000 xxxx) 0x80 - 0x8f\n var size = headByte - 0x80;\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte < 0xa0) {\n // fixarray (1001 xxxx) 0x90 - 0x9f\n var size = headByte - 0x90;\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else {\n // fixstr (101x xxxx) 0xa0 - 0xbf\n var byteLength = headByte - 0xa0;\n object = this.decodeUtf8String(byteLength, 0);\n }\n }\n else if (headByte === 0xc0) {\n // nil\n object = null;\n }\n else if (headByte === 0xc2) {\n // false\n object = false;\n }\n else if (headByte === 0xc3) {\n // true\n object = true;\n }\n else if (headByte === 0xca) {\n // float 32\n object = this.readF32();\n }\n else if (headByte === 0xcb) {\n // float 64\n object = this.readF64();\n }\n else if (headByte === 0xcc) {\n // uint 8\n object = this.readU8();\n }\n else if (headByte === 0xcd) {\n // uint 16\n object = this.readU16();\n }\n else if (headByte === 0xce) {\n // uint 32\n object = this.readU32();\n }\n else if (headByte === 0xcf) {\n // uint 64\n object = this.readU64();\n }\n else if (headByte === 0xd0) {\n // int 8\n object = this.readI8();\n }\n else if (headByte === 0xd1) {\n // int 16\n object = this.readI16();\n }\n else if (headByte === 0xd2) {\n // int 32\n object = this.readI32();\n }\n else if (headByte === 0xd3) {\n // int 64\n object = this.readI64();\n }\n else if (headByte === 0xd9) {\n // str 8\n var byteLength = this.lookU8();\n object = this.decodeUtf8String(byteLength, 1);\n }\n else if (headByte === 0xda) {\n // str 16\n var byteLength = this.lookU16();\n object = this.decodeUtf8String(byteLength, 2);\n }\n else if (headByte === 0xdb) {\n // str 32\n var byteLength = this.lookU32();\n object = this.decodeUtf8String(byteLength, 4);\n }\n else if (headByte === 0xdc) {\n // array 16\n var size = this.readU16();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else if (headByte === 0xdd) {\n // array 32\n var size = this.readU32();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else if (headByte === 0xde) {\n // map 16\n var size = this.readU16();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte === 0xdf) {\n // map 32\n var size = this.readU32();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte === 0xc4) {\n // bin 8\n var size = this.lookU8();\n object = this.decodeBinary(size, 1);\n }\n else if (headByte === 0xc5) {\n // bin 16\n var size = this.lookU16();\n object = this.decodeBinary(size, 2);\n }\n else if (headByte === 0xc6) {\n // bin 32\n var size = this.lookU32();\n object = this.decodeBinary(size, 4);\n }\n else if (headByte === 0xd4) {\n // fixext 1\n object = this.decodeExtension(1, 0);\n }\n else if (headByte === 0xd5) {\n // fixext 2\n object = this.decodeExtension(2, 0);\n }\n else if (headByte === 0xd6) {\n // fixext 4\n object = this.decodeExtension(4, 0);\n }\n else if (headByte === 0xd7) {\n // fixext 8\n object = this.decodeExtension(8, 0);\n }\n else if (headByte === 0xd8) {\n // fixext 16\n object = this.decodeExtension(16, 0);\n }\n else if (headByte === 0xc7) {\n // ext 8\n var size = this.lookU8();\n object = this.decodeExtension(size, 1);\n }\n else if (headByte === 0xc8) {\n // ext 16\n var size = this.lookU16();\n object = this.decodeExtension(size, 2);\n }\n else if (headByte === 0xc9) {\n // ext 32\n var size = this.lookU32();\n object = this.decodeExtension(size, 4);\n }\n else {\n throw new Error(\"Unrecognized type byte: \" + Object(_utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__[\"prettyByte\"])(headByte));\n }\n this.complete();\n var stack = this.stack;\n while (stack.length > 0) {\n // arrays and maps\n var state = stack[stack.length - 1];\n if (state.type === 0 /* ARRAY */) {\n state.array[state.position] = object;\n state.position++;\n if (state.position === state.size) {\n stack.pop();\n object = state.array;\n }\n else {\n continue DECODE;\n }\n }\n else if (state.type === 1 /* MAP_KEY */) {\n if (!isValidMapKeyType(object)) {\n throw new Error(\"The type of key must be string or number but \" + typeof object);\n }\n state.key = object;\n state.type = 2 /* MAP_VALUE */;\n continue DECODE;\n }\n else {\n // it must be `state.type === State.MAP_VALUE` here\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n state.map[state.key] = object;\n state.readCount++;\n if (state.readCount === state.size) {\n stack.pop();\n object = state.map;\n }\n else {\n state.key = null;\n state.type = 1 /* MAP_KEY */;\n continue DECODE;\n }\n }\n }\n return object;\n }\n };\n Decoder.prototype.readHeadByte = function () {\n if (this.headByte === HEAD_BYTE_REQUIRED) {\n this.headByte = this.readU8();\n // console.log(\"headByte\", prettyByte(this.headByte));\n }\n return this.headByte;\n };\n Decoder.prototype.complete = function () {\n this.headByte = HEAD_BYTE_REQUIRED;\n };\n Decoder.prototype.readArraySize = function () {\n var headByte = this.readHeadByte();\n switch (headByte) {\n case 0xdc:\n return this.readU16();\n case 0xdd:\n return this.readU32();\n default: {\n if (headByte < 0xa0) {\n return headByte - 0x90;\n }\n else {\n throw new Error(\"Unrecognized array type byte: \" + Object(_utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__[\"prettyByte\"])(headByte));\n }\n }\n }\n };\n Decoder.prototype.pushMapState = function (size) {\n if (size > this.maxMapLength) {\n throw new Error(\"Max length exceeded: map length (\" + size + \") > maxMapLengthLength (\" + this.maxMapLength + \")\");\n }\n this.stack.push({\n type: 1 /* MAP_KEY */,\n size: size,\n key: null,\n readCount: 0,\n map: {},\n });\n };\n Decoder.prototype.pushArrayState = function (size) {\n if (size > this.maxArrayLength) {\n throw new Error(\"Max length exceeded: array length (\" + size + \") > maxArrayLength (\" + this.maxArrayLength + \")\");\n }\n this.stack.push({\n type: 0 /* ARRAY */,\n size: size,\n array: new Array(size),\n position: 0,\n });\n };\n Decoder.prototype.decodeUtf8String = function (byteLength, headerOffset) {\n var _a;\n if (byteLength > this.maxStrLength) {\n throw new Error(\"Max length exceeded: UTF-8 byte length (\" + byteLength + \") > maxStrLength (\" + this.maxStrLength + \")\");\n }\n if (this.bytes.byteLength < this.pos + headerOffset + byteLength) {\n throw MORE_DATA;\n }\n var offset = this.pos + headerOffset;\n var object;\n if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) {\n object = this.keyDecoder.decode(this.bytes, offset, byteLength);\n }\n else if (byteLength > _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TEXT_DECODER_THRESHOLD\"]) {\n object = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__[\"utf8DecodeTD\"])(this.bytes, offset, byteLength);\n }\n else {\n object = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__[\"utf8DecodeJs\"])(this.bytes, offset, byteLength);\n }\n this.pos += headerOffset + byteLength;\n return object;\n };\n Decoder.prototype.stateIsMapKey = function () {\n if (this.stack.length > 0) {\n var state = this.stack[this.stack.length - 1];\n return state.type === 1 /* MAP_KEY */;\n }\n return false;\n };\n Decoder.prototype.decodeBinary = function (byteLength, headOffset) {\n if (byteLength > this.maxBinLength) {\n throw new Error(\"Max length exceeded: bin length (\" + byteLength + \") > maxBinLength (\" + this.maxBinLength + \")\");\n }\n if (!this.hasRemaining(byteLength + headOffset)) {\n throw MORE_DATA;\n }\n var offset = this.pos + headOffset;\n var object = this.bytes.subarray(offset, offset + byteLength);\n this.pos += headOffset + byteLength;\n return object;\n };\n Decoder.prototype.decodeExtension = function (size, headOffset) {\n if (size > this.maxExtLength) {\n throw new Error(\"Max length exceeded: ext length (\" + size + \") > maxExtLength (\" + this.maxExtLength + \")\");\n }\n var extType = this.view.getInt8(this.pos + headOffset);\n var data = this.decodeBinary(size, headOffset + 1 /* extType */);\n return this.extensionCodec.decode(data, extType, this.context);\n };\n Decoder.prototype.lookU8 = function () {\n return this.view.getUint8(this.pos);\n };\n Decoder.prototype.lookU16 = function () {\n return this.view.getUint16(this.pos);\n };\n Decoder.prototype.lookU32 = function () {\n return this.view.getUint32(this.pos);\n };\n Decoder.prototype.readU8 = function () {\n var value = this.view.getUint8(this.pos);\n this.pos++;\n return value;\n };\n Decoder.prototype.readI8 = function () {\n var value = this.view.getInt8(this.pos);\n this.pos++;\n return value;\n };\n Decoder.prototype.readU16 = function () {\n var value = this.view.getUint16(this.pos);\n this.pos += 2;\n return value;\n };\n Decoder.prototype.readI16 = function () {\n var value = this.view.getInt16(this.pos);\n this.pos += 2;\n return value;\n };\n Decoder.prototype.readU32 = function () {\n var value = this.view.getUint32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readI32 = function () {\n var value = this.view.getInt32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readU64 = function () {\n var value = Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getUint64\"])(this.view, this.pos);\n this.pos += 8;\n return value;\n };\n Decoder.prototype.readI64 = function () {\n var value = Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getInt64\"])(this.view, this.pos);\n this.pos += 8;\n return value;\n };\n Decoder.prototype.readF32 = function () {\n var value = this.view.getFloat32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readF64 = function () {\n var value = this.view.getFloat64(this.pos);\n this.pos += 8;\n return value;\n };\n return Decoder;\n}());\n\n//# sourceMappingURL=Decoder.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DataViewIndexOutOfBoundsError\", function() { return DataViewIndexOutOfBoundsError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Decoder\", function() { return Decoder; });\n/* harmony import */ var _utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/prettyByte.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs\");\n/* harmony import */ var _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ExtensionCodec.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs\");\n/* harmony import */ var _utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/int.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs\");\n/* harmony import */ var _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/utf8.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs\");\n/* harmony import */ var _utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/typedArrays.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs\");\n/* harmony import */ var _CachedKeyDecoder_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CachedKeyDecoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/CachedKeyDecoder.mjs\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __asyncValues = (undefined && undefined.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\n\n\n\n\n\n\nvar isValidMapKeyType = function (key) {\n var keyType = typeof key;\n return keyType === \"string\" || keyType === \"number\";\n};\nvar HEAD_BYTE_REQUIRED = -1;\nvar EMPTY_VIEW = new DataView(new ArrayBuffer(0));\nvar EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);\n// IE11: Hack to support IE11.\n// IE11: Drop this hack and just use RangeError when IE11 is obsolete.\nvar DataViewIndexOutOfBoundsError = (function () {\n try {\n // IE11: The spec says it should throw RangeError,\n // IE11: but in IE11 it throws TypeError.\n EMPTY_VIEW.getInt8(0);\n }\n catch (e) {\n return e.constructor;\n }\n throw new Error(\"never reached\");\n})();\nvar MORE_DATA = new DataViewIndexOutOfBoundsError(\"Insufficient data\");\nvar DEFAULT_MAX_LENGTH = 4294967295; // uint32_max\nvar sharedCachedKeyDecoder = new _CachedKeyDecoder_mjs__WEBPACK_IMPORTED_MODULE_5__[\"CachedKeyDecoder\"]();\nvar Decoder = /** @class */ (function () {\n function Decoder(extensionCodec, context, maxStrLength, maxBinLength, maxArrayLength, maxMapLength, maxExtLength, keyDecoder) {\n if (extensionCodec === void 0) { extensionCodec = _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__[\"ExtensionCodec\"].defaultCodec; }\n if (context === void 0) { context = undefined; }\n if (maxStrLength === void 0) { maxStrLength = DEFAULT_MAX_LENGTH; }\n if (maxBinLength === void 0) { maxBinLength = DEFAULT_MAX_LENGTH; }\n if (maxArrayLength === void 0) { maxArrayLength = DEFAULT_MAX_LENGTH; }\n if (maxMapLength === void 0) { maxMapLength = DEFAULT_MAX_LENGTH; }\n if (maxExtLength === void 0) { maxExtLength = DEFAULT_MAX_LENGTH; }\n if (keyDecoder === void 0) { keyDecoder = sharedCachedKeyDecoder; }\n this.extensionCodec = extensionCodec;\n this.context = context;\n this.maxStrLength = maxStrLength;\n this.maxBinLength = maxBinLength;\n this.maxArrayLength = maxArrayLength;\n this.maxMapLength = maxMapLength;\n this.maxExtLength = maxExtLength;\n this.keyDecoder = keyDecoder;\n this.totalPos = 0;\n this.pos = 0;\n this.view = EMPTY_VIEW;\n this.bytes = EMPTY_BYTES;\n this.headByte = HEAD_BYTE_REQUIRED;\n this.stack = [];\n }\n Decoder.prototype.reinitializeState = function () {\n this.totalPos = 0;\n this.headByte = HEAD_BYTE_REQUIRED;\n };\n Decoder.prototype.setBuffer = function (buffer) {\n this.bytes = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__[\"ensureUint8Array\"])(buffer);\n this.view = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__[\"createDataView\"])(this.bytes);\n this.pos = 0;\n };\n Decoder.prototype.appendBuffer = function (buffer) {\n if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining()) {\n this.setBuffer(buffer);\n }\n else {\n // retried because data is insufficient\n var remainingData = this.bytes.subarray(this.pos);\n var newData = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_4__[\"ensureUint8Array\"])(buffer);\n var concated = new Uint8Array(remainingData.length + newData.length);\n concated.set(remainingData);\n concated.set(newData, remainingData.length);\n this.setBuffer(concated);\n }\n };\n Decoder.prototype.hasRemaining = function (size) {\n if (size === void 0) { size = 1; }\n return this.view.byteLength - this.pos >= size;\n };\n Decoder.prototype.createExtraByteError = function (posToShow) {\n var _a = this, view = _a.view, pos = _a.pos;\n return new RangeError(\"Extra \" + (view.byteLength - pos) + \" of \" + view.byteLength + \" byte(s) found at buffer[\" + posToShow + \"]\");\n };\n Decoder.prototype.decode = function (buffer) {\n this.reinitializeState();\n this.setBuffer(buffer);\n var object = this.doDecodeSync();\n if (this.hasRemaining()) {\n throw this.createExtraByteError(this.pos);\n }\n return object;\n };\n Decoder.prototype.decodeAsync = function (stream) {\n var stream_1, stream_1_1;\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function () {\n var decoded, object, buffer, e_1_1, _b, headByte, pos, totalPos;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n decoded = false;\n _c.label = 1;\n case 1:\n _c.trys.push([1, 6, 7, 12]);\n stream_1 = __asyncValues(stream);\n _c.label = 2;\n case 2: return [4 /*yield*/, stream_1.next()];\n case 3:\n if (!(stream_1_1 = _c.sent(), !stream_1_1.done)) return [3 /*break*/, 5];\n buffer = stream_1_1.value;\n if (decoded) {\n throw this.createExtraByteError(this.totalPos);\n }\n this.appendBuffer(buffer);\n try {\n object = this.doDecodeSync();\n decoded = true;\n }\n catch (e) {\n if (!(e instanceof DataViewIndexOutOfBoundsError)) {\n throw e; // rethrow\n }\n // fallthrough\n }\n this.totalPos += this.pos;\n _c.label = 4;\n case 4: return [3 /*break*/, 2];\n case 5: return [3 /*break*/, 12];\n case 6:\n e_1_1 = _c.sent();\n e_1 = { error: e_1_1 };\n return [3 /*break*/, 12];\n case 7:\n _c.trys.push([7, , 10, 11]);\n if (!(stream_1_1 && !stream_1_1.done && (_a = stream_1.return))) return [3 /*break*/, 9];\n return [4 /*yield*/, _a.call(stream_1)];\n case 8:\n _c.sent();\n _c.label = 9;\n case 9: return [3 /*break*/, 11];\n case 10:\n if (e_1) throw e_1.error;\n return [7 /*endfinally*/];\n case 11: return [7 /*endfinally*/];\n case 12:\n if (decoded) {\n if (this.hasRemaining()) {\n throw this.createExtraByteError(this.totalPos);\n }\n return [2 /*return*/, object];\n }\n _b = this, headByte = _b.headByte, pos = _b.pos, totalPos = _b.totalPos;\n throw new RangeError(\"Insufficient data in parsing \" + Object(_utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__[\"prettyByte\"])(headByte) + \" at \" + totalPos + \" (\" + pos + \" in the current buffer)\");\n }\n });\n });\n };\n Decoder.prototype.decodeArrayStream = function (stream) {\n return this.decodeMultiAsync(stream, true);\n };\n Decoder.prototype.decodeStream = function (stream) {\n return this.decodeMultiAsync(stream, false);\n };\n Decoder.prototype.decodeMultiAsync = function (stream, isArray) {\n return __asyncGenerator(this, arguments, function decodeMultiAsync_1() {\n var isArrayHeaderRequired, arrayItemsLeft, stream_2, stream_2_1, buffer, e_2, e_3_1;\n var e_3, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n isArrayHeaderRequired = isArray;\n arrayItemsLeft = -1;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 13, 14, 19]);\n stream_2 = __asyncValues(stream);\n _b.label = 2;\n case 2: return [4 /*yield*/, __await(stream_2.next())];\n case 3:\n if (!(stream_2_1 = _b.sent(), !stream_2_1.done)) return [3 /*break*/, 12];\n buffer = stream_2_1.value;\n if (isArray && arrayItemsLeft === 0) {\n throw this.createExtraByteError(this.totalPos);\n }\n this.appendBuffer(buffer);\n if (isArrayHeaderRequired) {\n arrayItemsLeft = this.readArraySize();\n isArrayHeaderRequired = false;\n this.complete();\n }\n _b.label = 4;\n case 4:\n _b.trys.push([4, 9, , 10]);\n _b.label = 5;\n case 5:\n if (false) {}\n return [4 /*yield*/, __await(this.doDecodeSync())];\n case 6: return [4 /*yield*/, _b.sent()];\n case 7:\n _b.sent();\n if (--arrayItemsLeft === 0) {\n return [3 /*break*/, 8];\n }\n return [3 /*break*/, 5];\n case 8: return [3 /*break*/, 10];\n case 9:\n e_2 = _b.sent();\n if (!(e_2 instanceof DataViewIndexOutOfBoundsError)) {\n throw e_2; // rethrow\n }\n return [3 /*break*/, 10];\n case 10:\n this.totalPos += this.pos;\n _b.label = 11;\n case 11: return [3 /*break*/, 2];\n case 12: return [3 /*break*/, 19];\n case 13:\n e_3_1 = _b.sent();\n e_3 = { error: e_3_1 };\n return [3 /*break*/, 19];\n case 14:\n _b.trys.push([14, , 17, 18]);\n if (!(stream_2_1 && !stream_2_1.done && (_a = stream_2.return))) return [3 /*break*/, 16];\n return [4 /*yield*/, __await(_a.call(stream_2))];\n case 15:\n _b.sent();\n _b.label = 16;\n case 16: return [3 /*break*/, 18];\n case 17:\n if (e_3) throw e_3.error;\n return [7 /*endfinally*/];\n case 18: return [7 /*endfinally*/];\n case 19: return [2 /*return*/];\n }\n });\n });\n };\n Decoder.prototype.doDecodeSync = function () {\n DECODE: while (true) {\n var headByte = this.readHeadByte();\n var object = void 0;\n if (headByte >= 0xe0) {\n // negative fixint (111x xxxx) 0xe0 - 0xff\n object = headByte - 0x100;\n }\n else if (headByte < 0xc0) {\n if (headByte < 0x80) {\n // positive fixint (0xxx xxxx) 0x00 - 0x7f\n object = headByte;\n }\n else if (headByte < 0x90) {\n // fixmap (1000 xxxx) 0x80 - 0x8f\n var size = headByte - 0x80;\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte < 0xa0) {\n // fixarray (1001 xxxx) 0x90 - 0x9f\n var size = headByte - 0x90;\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else {\n // fixstr (101x xxxx) 0xa0 - 0xbf\n var byteLength = headByte - 0xa0;\n object = this.decodeUtf8String(byteLength, 0);\n }\n }\n else if (headByte === 0xc0) {\n // nil\n object = null;\n }\n else if (headByte === 0xc2) {\n // false\n object = false;\n }\n else if (headByte === 0xc3) {\n // true\n object = true;\n }\n else if (headByte === 0xca) {\n // float 32\n object = this.readF32();\n }\n else if (headByte === 0xcb) {\n // float 64\n object = this.readF64();\n }\n else if (headByte === 0xcc) {\n // uint 8\n object = this.readU8();\n }\n else if (headByte === 0xcd) {\n // uint 16\n object = this.readU16();\n }\n else if (headByte === 0xce) {\n // uint 32\n object = this.readU32();\n }\n else if (headByte === 0xcf) {\n // uint 64\n object = this.readU64();\n }\n else if (headByte === 0xd0) {\n // int 8\n object = this.readI8();\n }\n else if (headByte === 0xd1) {\n // int 16\n object = this.readI16();\n }\n else if (headByte === 0xd2) {\n // int 32\n object = this.readI32();\n }\n else if (headByte === 0xd3) {\n // int 64\n object = this.readI64();\n }\n else if (headByte === 0xd9) {\n // str 8\n var byteLength = this.lookU8();\n object = this.decodeUtf8String(byteLength, 1);\n }\n else if (headByte === 0xda) {\n // str 16\n var byteLength = this.lookU16();\n object = this.decodeUtf8String(byteLength, 2);\n }\n else if (headByte === 0xdb) {\n // str 32\n var byteLength = this.lookU32();\n object = this.decodeUtf8String(byteLength, 4);\n }\n else if (headByte === 0xdc) {\n // array 16\n var size = this.readU16();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else if (headByte === 0xdd) {\n // array 32\n var size = this.readU32();\n if (size !== 0) {\n this.pushArrayState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = [];\n }\n }\n else if (headByte === 0xde) {\n // map 16\n var size = this.readU16();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte === 0xdf) {\n // map 32\n var size = this.readU32();\n if (size !== 0) {\n this.pushMapState(size);\n this.complete();\n continue DECODE;\n }\n else {\n object = {};\n }\n }\n else if (headByte === 0xc4) {\n // bin 8\n var size = this.lookU8();\n object = this.decodeBinary(size, 1);\n }\n else if (headByte === 0xc5) {\n // bin 16\n var size = this.lookU16();\n object = this.decodeBinary(size, 2);\n }\n else if (headByte === 0xc6) {\n // bin 32\n var size = this.lookU32();\n object = this.decodeBinary(size, 4);\n }\n else if (headByte === 0xd4) {\n // fixext 1\n object = this.decodeExtension(1, 0);\n }\n else if (headByte === 0xd5) {\n // fixext 2\n object = this.decodeExtension(2, 0);\n }\n else if (headByte === 0xd6) {\n // fixext 4\n object = this.decodeExtension(4, 0);\n }\n else if (headByte === 0xd7) {\n // fixext 8\n object = this.decodeExtension(8, 0);\n }\n else if (headByte === 0xd8) {\n // fixext 16\n object = this.decodeExtension(16, 0);\n }\n else if (headByte === 0xc7) {\n // ext 8\n var size = this.lookU8();\n object = this.decodeExtension(size, 1);\n }\n else if (headByte === 0xc8) {\n // ext 16\n var size = this.lookU16();\n object = this.decodeExtension(size, 2);\n }\n else if (headByte === 0xc9) {\n // ext 32\n var size = this.lookU32();\n object = this.decodeExtension(size, 4);\n }\n else {\n throw new Error(\"Unrecognized type byte: \" + Object(_utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__[\"prettyByte\"])(headByte));\n }\n this.complete();\n var stack = this.stack;\n while (stack.length > 0) {\n // arrays and maps\n var state = stack[stack.length - 1];\n if (state.type === 0 /* ARRAY */) {\n state.array[state.position] = object;\n state.position++;\n if (state.position === state.size) {\n stack.pop();\n object = state.array;\n }\n else {\n continue DECODE;\n }\n }\n else if (state.type === 1 /* MAP_KEY */) {\n if (!isValidMapKeyType(object)) {\n throw new Error(\"The type of key must be string or number but \" + typeof object);\n }\n state.key = object;\n state.type = 2 /* MAP_VALUE */;\n continue DECODE;\n }\n else {\n // it must be `state.type === State.MAP_VALUE` here\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n state.map[state.key] = object;\n state.readCount++;\n if (state.readCount === state.size) {\n stack.pop();\n object = state.map;\n }\n else {\n state.key = null;\n state.type = 1 /* MAP_KEY */;\n continue DECODE;\n }\n }\n }\n return object;\n }\n };\n Decoder.prototype.readHeadByte = function () {\n if (this.headByte === HEAD_BYTE_REQUIRED) {\n this.headByte = this.readU8();\n // console.log(\"headByte\", prettyByte(this.headByte));\n }\n return this.headByte;\n };\n Decoder.prototype.complete = function () {\n this.headByte = HEAD_BYTE_REQUIRED;\n };\n Decoder.prototype.readArraySize = function () {\n var headByte = this.readHeadByte();\n switch (headByte) {\n case 0xdc:\n return this.readU16();\n case 0xdd:\n return this.readU32();\n default: {\n if (headByte < 0xa0) {\n return headByte - 0x90;\n }\n else {\n throw new Error(\"Unrecognized array type byte: \" + Object(_utils_prettyByte_mjs__WEBPACK_IMPORTED_MODULE_0__[\"prettyByte\"])(headByte));\n }\n }\n }\n };\n Decoder.prototype.pushMapState = function (size) {\n if (size > this.maxMapLength) {\n throw new Error(\"Max length exceeded: map length (\" + size + \") > maxMapLengthLength (\" + this.maxMapLength + \")\");\n }\n this.stack.push({\n type: 1 /* MAP_KEY */,\n size: size,\n key: null,\n readCount: 0,\n map: {},\n });\n };\n Decoder.prototype.pushArrayState = function (size) {\n if (size > this.maxArrayLength) {\n throw new Error(\"Max length exceeded: array length (\" + size + \") > maxArrayLength (\" + this.maxArrayLength + \")\");\n }\n this.stack.push({\n type: 0 /* ARRAY */,\n size: size,\n array: new Array(size),\n position: 0,\n });\n };\n Decoder.prototype.decodeUtf8String = function (byteLength, headerOffset) {\n var _a;\n if (byteLength > this.maxStrLength) {\n throw new Error(\"Max length exceeded: UTF-8 byte length (\" + byteLength + \") > maxStrLength (\" + this.maxStrLength + \")\");\n }\n if (this.bytes.byteLength < this.pos + headerOffset + byteLength) {\n throw MORE_DATA;\n }\n var offset = this.pos + headerOffset;\n var object;\n if (this.stateIsMapKey() && ((_a = this.keyDecoder) === null || _a === void 0 ? void 0 : _a.canBeCached(byteLength))) {\n object = this.keyDecoder.decode(this.bytes, offset, byteLength);\n }\n else if (byteLength > _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TEXT_DECODER_THRESHOLD\"]) {\n object = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__[\"utf8DecodeTD\"])(this.bytes, offset, byteLength);\n }\n else {\n object = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_3__[\"utf8DecodeJs\"])(this.bytes, offset, byteLength);\n }\n this.pos += headerOffset + byteLength;\n return object;\n };\n Decoder.prototype.stateIsMapKey = function () {\n if (this.stack.length > 0) {\n var state = this.stack[this.stack.length - 1];\n return state.type === 1 /* MAP_KEY */;\n }\n return false;\n };\n Decoder.prototype.decodeBinary = function (byteLength, headOffset) {\n if (byteLength > this.maxBinLength) {\n throw new Error(\"Max length exceeded: bin length (\" + byteLength + \") > maxBinLength (\" + this.maxBinLength + \")\");\n }\n if (!this.hasRemaining(byteLength + headOffset)) {\n throw MORE_DATA;\n }\n var offset = this.pos + headOffset;\n var object = this.bytes.subarray(offset, offset + byteLength);\n this.pos += headOffset + byteLength;\n return object;\n };\n Decoder.prototype.decodeExtension = function (size, headOffset) {\n if (size > this.maxExtLength) {\n throw new Error(\"Max length exceeded: ext length (\" + size + \") > maxExtLength (\" + this.maxExtLength + \")\");\n }\n var extType = this.view.getInt8(this.pos + headOffset);\n var data = this.decodeBinary(size, headOffset + 1 /* extType */);\n return this.extensionCodec.decode(data, extType, this.context);\n };\n Decoder.prototype.lookU8 = function () {\n return this.view.getUint8(this.pos);\n };\n Decoder.prototype.lookU16 = function () {\n return this.view.getUint16(this.pos);\n };\n Decoder.prototype.lookU32 = function () {\n return this.view.getUint32(this.pos);\n };\n Decoder.prototype.readU8 = function () {\n var value = this.view.getUint8(this.pos);\n this.pos++;\n return value;\n };\n Decoder.prototype.readI8 = function () {\n var value = this.view.getInt8(this.pos);\n this.pos++;\n return value;\n };\n Decoder.prototype.readU16 = function () {\n var value = this.view.getUint16(this.pos);\n this.pos += 2;\n return value;\n };\n Decoder.prototype.readI16 = function () {\n var value = this.view.getInt16(this.pos);\n this.pos += 2;\n return value;\n };\n Decoder.prototype.readU32 = function () {\n var value = this.view.getUint32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readI32 = function () {\n var value = this.view.getInt32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readU64 = function () {\n var value = Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getUint64\"])(this.view, this.pos);\n this.pos += 8;\n return value;\n };\n Decoder.prototype.readI64 = function () {\n var value = Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getInt64\"])(this.view, this.pos);\n this.pos += 8;\n return value;\n };\n Decoder.prototype.readF32 = function () {\n var value = this.view.getFloat32(this.pos);\n this.pos += 4;\n return value;\n };\n Decoder.prototype.readF64 = function () {\n var value = this.view.getFloat64(this.pos);\n this.pos += 8;\n return value;\n };\n return Decoder;\n}());\n\n//# sourceMappingURL=Decoder.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs": -/*!**************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs ***! - \**************************************************************************************************/ +/*!*********************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs ***! + \*********************************************************************************************************/ /*! exports provided: DEFAULT_MAX_DEPTH, DEFAULT_INITIAL_BUFFER_SIZE, Encoder */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_MAX_DEPTH\", function() { return DEFAULT_MAX_DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_INITIAL_BUFFER_SIZE\", function() { return DEFAULT_INITIAL_BUFFER_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Encoder\", function() { return Encoder; });\n/* harmony import */ var _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/utf8.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs\");\n/* harmony import */ var _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ExtensionCodec.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs\");\n/* harmony import */ var _utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/int.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs\");\n/* harmony import */ var _utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/typedArrays.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs\");\n\n\n\n\nvar DEFAULT_MAX_DEPTH = 100;\nvar DEFAULT_INITIAL_BUFFER_SIZE = 2048;\nvar Encoder = /** @class */ (function () {\n function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32, ignoreUndefined, forceIntegerToFloat) {\n if (extensionCodec === void 0) { extensionCodec = _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__[\"ExtensionCodec\"].defaultCodec; }\n if (context === void 0) { context = undefined; }\n if (maxDepth === void 0) { maxDepth = DEFAULT_MAX_DEPTH; }\n if (initialBufferSize === void 0) { initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE; }\n if (sortKeys === void 0) { sortKeys = false; }\n if (forceFloat32 === void 0) { forceFloat32 = false; }\n if (ignoreUndefined === void 0) { ignoreUndefined = false; }\n if (forceIntegerToFloat === void 0) { forceIntegerToFloat = false; }\n this.extensionCodec = extensionCodec;\n this.context = context;\n this.maxDepth = maxDepth;\n this.initialBufferSize = initialBufferSize;\n this.sortKeys = sortKeys;\n this.forceFloat32 = forceFloat32;\n this.ignoreUndefined = ignoreUndefined;\n this.forceIntegerToFloat = forceIntegerToFloat;\n this.pos = 0;\n this.view = new DataView(new ArrayBuffer(this.initialBufferSize));\n this.bytes = new Uint8Array(this.view.buffer);\n }\n Encoder.prototype.getUint8Array = function () {\n return this.bytes.subarray(0, this.pos);\n };\n Encoder.prototype.reinitializeState = function () {\n this.pos = 0;\n };\n Encoder.prototype.encode = function (object) {\n this.reinitializeState();\n this.doEncode(object, 1);\n return this.getUint8Array();\n };\n Encoder.prototype.doEncode = function (object, depth) {\n if (depth > this.maxDepth) {\n throw new Error(\"Too deep objects in depth \" + depth);\n }\n if (object == null) {\n this.encodeNil();\n }\n else if (typeof object === \"boolean\") {\n this.encodeBoolean(object);\n }\n else if (typeof object === \"number\") {\n this.encodeNumber(object);\n }\n else if (typeof object === \"string\") {\n this.encodeString(object);\n }\n else {\n this.encodeObject(object, depth);\n }\n };\n Encoder.prototype.ensureBufferSizeToWrite = function (sizeToWrite) {\n var requiredSize = this.pos + sizeToWrite;\n if (this.view.byteLength < requiredSize) {\n this.resizeBuffer(requiredSize * 2);\n }\n };\n Encoder.prototype.resizeBuffer = function (newSize) {\n var newBuffer = new ArrayBuffer(newSize);\n var newBytes = new Uint8Array(newBuffer);\n var newView = new DataView(newBuffer);\n newBytes.set(this.bytes);\n this.view = newView;\n this.bytes = newBytes;\n };\n Encoder.prototype.encodeNil = function () {\n this.writeU8(0xc0);\n };\n Encoder.prototype.encodeBoolean = function (object) {\n if (object === false) {\n this.writeU8(0xc2);\n }\n else {\n this.writeU8(0xc3);\n }\n };\n Encoder.prototype.encodeNumber = function (object) {\n if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) {\n if (object >= 0) {\n if (object < 0x80) {\n // positive fixint\n this.writeU8(object);\n }\n else if (object < 0x100) {\n // uint 8\n this.writeU8(0xcc);\n this.writeU8(object);\n }\n else if (object < 0x10000) {\n // uint 16\n this.writeU8(0xcd);\n this.writeU16(object);\n }\n else if (object < 0x100000000) {\n // uint 32\n this.writeU8(0xce);\n this.writeU32(object);\n }\n else {\n // uint 64\n this.writeU8(0xcf);\n this.writeU64(object);\n }\n }\n else {\n if (object >= -0x20) {\n // nagative fixint\n this.writeU8(0xe0 | (object + 0x20));\n }\n else if (object >= -0x80) {\n // int 8\n this.writeU8(0xd0);\n this.writeI8(object);\n }\n else if (object >= -0x8000) {\n // int 16\n this.writeU8(0xd1);\n this.writeI16(object);\n }\n else if (object >= -0x80000000) {\n // int 32\n this.writeU8(0xd2);\n this.writeI32(object);\n }\n else {\n // int 64\n this.writeU8(0xd3);\n this.writeI64(object);\n }\n }\n }\n else {\n // non-integer numbers\n if (this.forceFloat32) {\n // float 32\n this.writeU8(0xca);\n this.writeF32(object);\n }\n else {\n // float 64\n this.writeU8(0xcb);\n this.writeF64(object);\n }\n }\n };\n Encoder.prototype.writeStringHeader = function (byteLength) {\n if (byteLength < 32) {\n // fixstr\n this.writeU8(0xa0 + byteLength);\n }\n else if (byteLength < 0x100) {\n // str 8\n this.writeU8(0xd9);\n this.writeU8(byteLength);\n }\n else if (byteLength < 0x10000) {\n // str 16\n this.writeU8(0xda);\n this.writeU16(byteLength);\n }\n else if (byteLength < 0x100000000) {\n // str 32\n this.writeU8(0xdb);\n this.writeU32(byteLength);\n }\n else {\n throw new Error(\"Too long string: \" + byteLength + \" bytes in UTF-8\");\n }\n };\n Encoder.prototype.encodeString = function (object) {\n var maxHeaderSize = 1 + 4;\n var strLength = object.length;\n if (strLength > _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"TEXT_ENCODER_THRESHOLD\"]) {\n var byteLength = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8Count\"])(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8EncodeTE\"])(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n else {\n var byteLength = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8Count\"])(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8EncodeJs\"])(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n };\n Encoder.prototype.encodeObject = function (object, depth) {\n // try to encode objects with custom codec first of non-primitives\n var ext = this.extensionCodec.tryToEncode(object, this.context);\n if (ext != null) {\n this.encodeExtension(ext);\n }\n else if (Array.isArray(object)) {\n this.encodeArray(object, depth);\n }\n else if (ArrayBuffer.isView(object)) {\n this.encodeBinary(object);\n }\n else if (typeof object === \"object\") {\n this.encodeMap(object, depth);\n }\n else {\n // symbol, function and other special object come here unless extensionCodec handles them.\n throw new Error(\"Unrecognized object: \" + Object.prototype.toString.apply(object));\n }\n };\n Encoder.prototype.encodeBinary = function (object) {\n var size = object.byteLength;\n if (size < 0x100) {\n // bin 8\n this.writeU8(0xc4);\n this.writeU8(size);\n }\n else if (size < 0x10000) {\n // bin 16\n this.writeU8(0xc5);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // bin 32\n this.writeU8(0xc6);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large binary: \" + size);\n }\n var bytes = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_3__[\"ensureUint8Array\"])(object);\n this.writeU8a(bytes);\n };\n Encoder.prototype.encodeArray = function (object, depth) {\n var size = object.length;\n if (size < 16) {\n // fixarray\n this.writeU8(0x90 + size);\n }\n else if (size < 0x10000) {\n // array 16\n this.writeU8(0xdc);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // array 32\n this.writeU8(0xdd);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large array: \" + size);\n }\n for (var _i = 0, object_1 = object; _i < object_1.length; _i++) {\n var item = object_1[_i];\n this.doEncode(item, depth + 1);\n }\n };\n Encoder.prototype.countWithoutUndefined = function (object, keys) {\n var count = 0;\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (object[key] !== undefined) {\n count++;\n }\n }\n return count;\n };\n Encoder.prototype.encodeMap = function (object, depth) {\n var keys = Object.keys(object);\n if (this.sortKeys) {\n keys.sort();\n }\n var size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length;\n if (size < 16) {\n // fixmap\n this.writeU8(0x80 + size);\n }\n else if (size < 0x10000) {\n // map 16\n this.writeU8(0xde);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // map 32\n this.writeU8(0xdf);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large map object: \" + size);\n }\n for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {\n var key = keys_2[_i];\n var value = object[key];\n if (!(this.ignoreUndefined && value === undefined)) {\n this.encodeString(key);\n this.doEncode(value, depth + 1);\n }\n }\n };\n Encoder.prototype.encodeExtension = function (ext) {\n var size = ext.data.length;\n if (size === 1) {\n // fixext 1\n this.writeU8(0xd4);\n }\n else if (size === 2) {\n // fixext 2\n this.writeU8(0xd5);\n }\n else if (size === 4) {\n // fixext 4\n this.writeU8(0xd6);\n }\n else if (size === 8) {\n // fixext 8\n this.writeU8(0xd7);\n }\n else if (size === 16) {\n // fixext 16\n this.writeU8(0xd8);\n }\n else if (size < 0x100) {\n // ext 8\n this.writeU8(0xc7);\n this.writeU8(size);\n }\n else if (size < 0x10000) {\n // ext 16\n this.writeU8(0xc8);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // ext 32\n this.writeU8(0xc9);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large extension object: \" + size);\n }\n this.writeI8(ext.type);\n this.writeU8a(ext.data);\n };\n Encoder.prototype.writeU8 = function (value) {\n this.ensureBufferSizeToWrite(1);\n this.view.setUint8(this.pos, value);\n this.pos++;\n };\n Encoder.prototype.writeU8a = function (values) {\n var size = values.length;\n this.ensureBufferSizeToWrite(size);\n this.bytes.set(values, this.pos);\n this.pos += size;\n };\n Encoder.prototype.writeI8 = function (value) {\n this.ensureBufferSizeToWrite(1);\n this.view.setInt8(this.pos, value);\n this.pos++;\n };\n Encoder.prototype.writeU16 = function (value) {\n this.ensureBufferSizeToWrite(2);\n this.view.setUint16(this.pos, value);\n this.pos += 2;\n };\n Encoder.prototype.writeI16 = function (value) {\n this.ensureBufferSizeToWrite(2);\n this.view.setInt16(this.pos, value);\n this.pos += 2;\n };\n Encoder.prototype.writeU32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setUint32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeI32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setInt32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeF32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setFloat32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeF64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n this.view.setFloat64(this.pos, value);\n this.pos += 8;\n };\n Encoder.prototype.writeU64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"setUint64\"])(this.view, this.pos, value);\n this.pos += 8;\n };\n Encoder.prototype.writeI64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"setInt64\"])(this.view, this.pos, value);\n this.pos += 8;\n };\n return Encoder;\n}());\n\n//# sourceMappingURL=Encoder.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_MAX_DEPTH\", function() { return DEFAULT_MAX_DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_INITIAL_BUFFER_SIZE\", function() { return DEFAULT_INITIAL_BUFFER_SIZE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Encoder\", function() { return Encoder; });\n/* harmony import */ var _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/utf8.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs\");\n/* harmony import */ var _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ExtensionCodec.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs\");\n/* harmony import */ var _utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/int.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs\");\n/* harmony import */ var _utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/typedArrays.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs\");\n\n\n\n\nvar DEFAULT_MAX_DEPTH = 100;\nvar DEFAULT_INITIAL_BUFFER_SIZE = 2048;\nvar Encoder = /** @class */ (function () {\n function Encoder(extensionCodec, context, maxDepth, initialBufferSize, sortKeys, forceFloat32, ignoreUndefined, forceIntegerToFloat) {\n if (extensionCodec === void 0) { extensionCodec = _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_1__[\"ExtensionCodec\"].defaultCodec; }\n if (context === void 0) { context = undefined; }\n if (maxDepth === void 0) { maxDepth = DEFAULT_MAX_DEPTH; }\n if (initialBufferSize === void 0) { initialBufferSize = DEFAULT_INITIAL_BUFFER_SIZE; }\n if (sortKeys === void 0) { sortKeys = false; }\n if (forceFloat32 === void 0) { forceFloat32 = false; }\n if (ignoreUndefined === void 0) { ignoreUndefined = false; }\n if (forceIntegerToFloat === void 0) { forceIntegerToFloat = false; }\n this.extensionCodec = extensionCodec;\n this.context = context;\n this.maxDepth = maxDepth;\n this.initialBufferSize = initialBufferSize;\n this.sortKeys = sortKeys;\n this.forceFloat32 = forceFloat32;\n this.ignoreUndefined = ignoreUndefined;\n this.forceIntegerToFloat = forceIntegerToFloat;\n this.pos = 0;\n this.view = new DataView(new ArrayBuffer(this.initialBufferSize));\n this.bytes = new Uint8Array(this.view.buffer);\n }\n Encoder.prototype.getUint8Array = function () {\n return this.bytes.subarray(0, this.pos);\n };\n Encoder.prototype.reinitializeState = function () {\n this.pos = 0;\n };\n Encoder.prototype.encode = function (object) {\n this.reinitializeState();\n this.doEncode(object, 1);\n return this.getUint8Array();\n };\n Encoder.prototype.doEncode = function (object, depth) {\n if (depth > this.maxDepth) {\n throw new Error(\"Too deep objects in depth \" + depth);\n }\n if (object == null) {\n this.encodeNil();\n }\n else if (typeof object === \"boolean\") {\n this.encodeBoolean(object);\n }\n else if (typeof object === \"number\") {\n this.encodeNumber(object);\n }\n else if (typeof object === \"string\") {\n this.encodeString(object);\n }\n else {\n this.encodeObject(object, depth);\n }\n };\n Encoder.prototype.ensureBufferSizeToWrite = function (sizeToWrite) {\n var requiredSize = this.pos + sizeToWrite;\n if (this.view.byteLength < requiredSize) {\n this.resizeBuffer(requiredSize * 2);\n }\n };\n Encoder.prototype.resizeBuffer = function (newSize) {\n var newBuffer = new ArrayBuffer(newSize);\n var newBytes = new Uint8Array(newBuffer);\n var newView = new DataView(newBuffer);\n newBytes.set(this.bytes);\n this.view = newView;\n this.bytes = newBytes;\n };\n Encoder.prototype.encodeNil = function () {\n this.writeU8(0xc0);\n };\n Encoder.prototype.encodeBoolean = function (object) {\n if (object === false) {\n this.writeU8(0xc2);\n }\n else {\n this.writeU8(0xc3);\n }\n };\n Encoder.prototype.encodeNumber = function (object) {\n if (Number.isSafeInteger(object) && !this.forceIntegerToFloat) {\n if (object >= 0) {\n if (object < 0x80) {\n // positive fixint\n this.writeU8(object);\n }\n else if (object < 0x100) {\n // uint 8\n this.writeU8(0xcc);\n this.writeU8(object);\n }\n else if (object < 0x10000) {\n // uint 16\n this.writeU8(0xcd);\n this.writeU16(object);\n }\n else if (object < 0x100000000) {\n // uint 32\n this.writeU8(0xce);\n this.writeU32(object);\n }\n else {\n // uint 64\n this.writeU8(0xcf);\n this.writeU64(object);\n }\n }\n else {\n if (object >= -0x20) {\n // nagative fixint\n this.writeU8(0xe0 | (object + 0x20));\n }\n else if (object >= -0x80) {\n // int 8\n this.writeU8(0xd0);\n this.writeI8(object);\n }\n else if (object >= -0x8000) {\n // int 16\n this.writeU8(0xd1);\n this.writeI16(object);\n }\n else if (object >= -0x80000000) {\n // int 32\n this.writeU8(0xd2);\n this.writeI32(object);\n }\n else {\n // int 64\n this.writeU8(0xd3);\n this.writeI64(object);\n }\n }\n }\n else {\n // non-integer numbers\n if (this.forceFloat32) {\n // float 32\n this.writeU8(0xca);\n this.writeF32(object);\n }\n else {\n // float 64\n this.writeU8(0xcb);\n this.writeF64(object);\n }\n }\n };\n Encoder.prototype.writeStringHeader = function (byteLength) {\n if (byteLength < 32) {\n // fixstr\n this.writeU8(0xa0 + byteLength);\n }\n else if (byteLength < 0x100) {\n // str 8\n this.writeU8(0xd9);\n this.writeU8(byteLength);\n }\n else if (byteLength < 0x10000) {\n // str 16\n this.writeU8(0xda);\n this.writeU16(byteLength);\n }\n else if (byteLength < 0x100000000) {\n // str 32\n this.writeU8(0xdb);\n this.writeU32(byteLength);\n }\n else {\n throw new Error(\"Too long string: \" + byteLength + \" bytes in UTF-8\");\n }\n };\n Encoder.prototype.encodeString = function (object) {\n var maxHeaderSize = 1 + 4;\n var strLength = object.length;\n if (strLength > _utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"TEXT_ENCODER_THRESHOLD\"]) {\n var byteLength = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8Count\"])(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8EncodeTE\"])(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n else {\n var byteLength = Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8Count\"])(object);\n this.ensureBufferSizeToWrite(maxHeaderSize + byteLength);\n this.writeStringHeader(byteLength);\n Object(_utils_utf8_mjs__WEBPACK_IMPORTED_MODULE_0__[\"utf8EncodeJs\"])(object, this.bytes, this.pos);\n this.pos += byteLength;\n }\n };\n Encoder.prototype.encodeObject = function (object, depth) {\n // try to encode objects with custom codec first of non-primitives\n var ext = this.extensionCodec.tryToEncode(object, this.context);\n if (ext != null) {\n this.encodeExtension(ext);\n }\n else if (Array.isArray(object)) {\n this.encodeArray(object, depth);\n }\n else if (ArrayBuffer.isView(object)) {\n this.encodeBinary(object);\n }\n else if (typeof object === \"object\") {\n this.encodeMap(object, depth);\n }\n else {\n // symbol, function and other special object come here unless extensionCodec handles them.\n throw new Error(\"Unrecognized object: \" + Object.prototype.toString.apply(object));\n }\n };\n Encoder.prototype.encodeBinary = function (object) {\n var size = object.byteLength;\n if (size < 0x100) {\n // bin 8\n this.writeU8(0xc4);\n this.writeU8(size);\n }\n else if (size < 0x10000) {\n // bin 16\n this.writeU8(0xc5);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // bin 32\n this.writeU8(0xc6);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large binary: \" + size);\n }\n var bytes = Object(_utils_typedArrays_mjs__WEBPACK_IMPORTED_MODULE_3__[\"ensureUint8Array\"])(object);\n this.writeU8a(bytes);\n };\n Encoder.prototype.encodeArray = function (object, depth) {\n var size = object.length;\n if (size < 16) {\n // fixarray\n this.writeU8(0x90 + size);\n }\n else if (size < 0x10000) {\n // array 16\n this.writeU8(0xdc);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // array 32\n this.writeU8(0xdd);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large array: \" + size);\n }\n for (var _i = 0, object_1 = object; _i < object_1.length; _i++) {\n var item = object_1[_i];\n this.doEncode(item, depth + 1);\n }\n };\n Encoder.prototype.countWithoutUndefined = function (object, keys) {\n var count = 0;\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (object[key] !== undefined) {\n count++;\n }\n }\n return count;\n };\n Encoder.prototype.encodeMap = function (object, depth) {\n var keys = Object.keys(object);\n if (this.sortKeys) {\n keys.sort();\n }\n var size = this.ignoreUndefined ? this.countWithoutUndefined(object, keys) : keys.length;\n if (size < 16) {\n // fixmap\n this.writeU8(0x80 + size);\n }\n else if (size < 0x10000) {\n // map 16\n this.writeU8(0xde);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // map 32\n this.writeU8(0xdf);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large map object: \" + size);\n }\n for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {\n var key = keys_2[_i];\n var value = object[key];\n if (!(this.ignoreUndefined && value === undefined)) {\n this.encodeString(key);\n this.doEncode(value, depth + 1);\n }\n }\n };\n Encoder.prototype.encodeExtension = function (ext) {\n var size = ext.data.length;\n if (size === 1) {\n // fixext 1\n this.writeU8(0xd4);\n }\n else if (size === 2) {\n // fixext 2\n this.writeU8(0xd5);\n }\n else if (size === 4) {\n // fixext 4\n this.writeU8(0xd6);\n }\n else if (size === 8) {\n // fixext 8\n this.writeU8(0xd7);\n }\n else if (size === 16) {\n // fixext 16\n this.writeU8(0xd8);\n }\n else if (size < 0x100) {\n // ext 8\n this.writeU8(0xc7);\n this.writeU8(size);\n }\n else if (size < 0x10000) {\n // ext 16\n this.writeU8(0xc8);\n this.writeU16(size);\n }\n else if (size < 0x100000000) {\n // ext 32\n this.writeU8(0xc9);\n this.writeU32(size);\n }\n else {\n throw new Error(\"Too large extension object: \" + size);\n }\n this.writeI8(ext.type);\n this.writeU8a(ext.data);\n };\n Encoder.prototype.writeU8 = function (value) {\n this.ensureBufferSizeToWrite(1);\n this.view.setUint8(this.pos, value);\n this.pos++;\n };\n Encoder.prototype.writeU8a = function (values) {\n var size = values.length;\n this.ensureBufferSizeToWrite(size);\n this.bytes.set(values, this.pos);\n this.pos += size;\n };\n Encoder.prototype.writeI8 = function (value) {\n this.ensureBufferSizeToWrite(1);\n this.view.setInt8(this.pos, value);\n this.pos++;\n };\n Encoder.prototype.writeU16 = function (value) {\n this.ensureBufferSizeToWrite(2);\n this.view.setUint16(this.pos, value);\n this.pos += 2;\n };\n Encoder.prototype.writeI16 = function (value) {\n this.ensureBufferSizeToWrite(2);\n this.view.setInt16(this.pos, value);\n this.pos += 2;\n };\n Encoder.prototype.writeU32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setUint32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeI32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setInt32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeF32 = function (value) {\n this.ensureBufferSizeToWrite(4);\n this.view.setFloat32(this.pos, value);\n this.pos += 4;\n };\n Encoder.prototype.writeF64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n this.view.setFloat64(this.pos, value);\n this.pos += 8;\n };\n Encoder.prototype.writeU64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"setUint64\"])(this.view, this.pos, value);\n this.pos += 8;\n };\n Encoder.prototype.writeI64 = function (value) {\n this.ensureBufferSizeToWrite(8);\n Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_2__[\"setInt64\"])(this.view, this.pos, value);\n this.pos += 8;\n };\n return Encoder;\n}());\n\n//# sourceMappingURL=Encoder.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs": -/*!**************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs ***! - \**************************************************************************************************/ +/*!*********************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs ***! + \*********************************************************************************************************/ /*! exports provided: ExtData */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtData\", function() { return ExtData; });\n/**\n * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.\n */\nvar ExtData = /** @class */ (function () {\n function ExtData(type, data) {\n this.type = type;\n this.data = data;\n }\n return ExtData;\n}());\n\n//# sourceMappingURL=ExtData.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtData\", function() { return ExtData; });\n/**\n * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.\n */\nvar ExtData = /** @class */ (function () {\n function ExtData(type, data) {\n this.type = type;\n this.data = data;\n }\n return ExtData;\n}());\n\n//# sourceMappingURL=ExtData.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs": -/*!*********************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs ***! - \*********************************************************************************************************/ +/*!****************************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs ***! + \****************************************************************************************************************/ /*! exports provided: ExtensionCodec */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtensionCodec\", function() { return ExtensionCodec; });\n/* harmony import */ var _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ExtData.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs\");\n/* harmony import */ var _timestamp_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timestamp.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs\");\n// ExtensionCodec to handle MessagePack extensions\n\n\nvar ExtensionCodec = /** @class */ (function () {\n function ExtensionCodec() {\n // built-in extensions\n this.builtInEncoders = [];\n this.builtInDecoders = [];\n // custom extensions\n this.encoders = [];\n this.decoders = [];\n this.register(_timestamp_mjs__WEBPACK_IMPORTED_MODULE_1__[\"timestampExtension\"]);\n }\n ExtensionCodec.prototype.register = function (_a) {\n var type = _a.type, encode = _a.encode, decode = _a.decode;\n if (type >= 0) {\n // custom extensions\n this.encoders[type] = encode;\n this.decoders[type] = decode;\n }\n else {\n // built-in extensions\n var index = 1 + type;\n this.builtInEncoders[index] = encode;\n this.builtInDecoders[index] = decode;\n }\n };\n ExtensionCodec.prototype.tryToEncode = function (object, context) {\n // built-in extensions\n for (var i = 0; i < this.builtInEncoders.length; i++) {\n var encoder = this.builtInEncoders[i];\n if (encoder != null) {\n var data = encoder(object, context);\n if (data != null) {\n var type = -1 - i;\n return new _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"](type, data);\n }\n }\n }\n // custom extensions\n for (var i = 0; i < this.encoders.length; i++) {\n var encoder = this.encoders[i];\n if (encoder != null) {\n var data = encoder(object, context);\n if (data != null) {\n var type = i;\n return new _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"](type, data);\n }\n }\n }\n if (object instanceof _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"]) {\n // to keep ExtData as is\n return object;\n }\n return null;\n };\n ExtensionCodec.prototype.decode = function (data, type, context) {\n var decoder = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];\n if (decoder) {\n return decoder(data, type, context);\n }\n else {\n // decode() does not fail, returns ExtData instead.\n return new _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"](type, data);\n }\n };\n ExtensionCodec.defaultCodec = new ExtensionCodec();\n return ExtensionCodec;\n}());\n\n//# sourceMappingURL=ExtensionCodec.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExtensionCodec\", function() { return ExtensionCodec; });\n/* harmony import */ var _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ExtData.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs\");\n/* harmony import */ var _timestamp_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timestamp.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs\");\n// ExtensionCodec to handle MessagePack extensions\n\n\nvar ExtensionCodec = /** @class */ (function () {\n function ExtensionCodec() {\n // built-in extensions\n this.builtInEncoders = [];\n this.builtInDecoders = [];\n // custom extensions\n this.encoders = [];\n this.decoders = [];\n this.register(_timestamp_mjs__WEBPACK_IMPORTED_MODULE_1__[\"timestampExtension\"]);\n }\n ExtensionCodec.prototype.register = function (_a) {\n var type = _a.type, encode = _a.encode, decode = _a.decode;\n if (type >= 0) {\n // custom extensions\n this.encoders[type] = encode;\n this.decoders[type] = decode;\n }\n else {\n // built-in extensions\n var index = 1 + type;\n this.builtInEncoders[index] = encode;\n this.builtInDecoders[index] = decode;\n }\n };\n ExtensionCodec.prototype.tryToEncode = function (object, context) {\n // built-in extensions\n for (var i = 0; i < this.builtInEncoders.length; i++) {\n var encoder = this.builtInEncoders[i];\n if (encoder != null) {\n var data = encoder(object, context);\n if (data != null) {\n var type = -1 - i;\n return new _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"](type, data);\n }\n }\n }\n // custom extensions\n for (var i = 0; i < this.encoders.length; i++) {\n var encoder = this.encoders[i];\n if (encoder != null) {\n var data = encoder(object, context);\n if (data != null) {\n var type = i;\n return new _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"](type, data);\n }\n }\n }\n if (object instanceof _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"]) {\n // to keep ExtData as is\n return object;\n }\n return null;\n };\n ExtensionCodec.prototype.decode = function (data, type, context) {\n var decoder = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];\n if (decoder) {\n return decoder(data, type, context);\n }\n else {\n // decode() does not fail, returns ExtData instead.\n return new _ExtData_mjs__WEBPACK_IMPORTED_MODULE_0__[\"ExtData\"](type, data);\n }\n };\n ExtensionCodec.defaultCodec = new ExtensionCodec();\n return ExtensionCodec;\n}());\n\n//# sourceMappingURL=ExtensionCodec.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs": -/*!*************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs ***! - \*************************************************************************************************/ +/*!********************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs ***! + \********************************************************************************************************/ /*! exports provided: defaultDecodeOptions, decode */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultDecodeOptions\", function() { return defaultDecodeOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decode\", function() { return decode; });\n/* harmony import */ var _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Decoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs\");\n\nvar defaultDecodeOptions = {};\n/**\n * It decodes a MessagePack-encoded buffer.\n *\n * This is a synchronous decoding function. See other variants for asynchronous decoding: `decodeAsync()`, `decodeStream()`, `decodeArrayStream()`.\n */\nfunction decode(buffer, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n var decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decode(buffer);\n}\n//# sourceMappingURL=decode.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultDecodeOptions\", function() { return defaultDecodeOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decode\", function() { return decode; });\n/* harmony import */ var _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Decoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs\");\n\nvar defaultDecodeOptions = {};\n/**\n * It decodes a MessagePack-encoded buffer.\n *\n * This is a synchronous decoding function. See other variants for asynchronous decoding: `decodeAsync()`, `decodeStream()`, `decodeArrayStream()`.\n */\nfunction decode(buffer, options) {\n if (options === void 0) { options = defaultDecodeOptions; }\n var decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decode(buffer);\n}\n//# sourceMappingURL=decode.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs": -/*!******************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs ***! - \******************************************************************************************************/ +/*!*************************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs ***! + \*************************************************************************************************************/ /*! exports provided: decodeAsync, decodeArrayStream, decodeStream */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeAsync\", function() { return decodeAsync; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeArrayStream\", function() { return decodeArrayStream; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeStream\", function() { return decodeStream; });\n/* harmony import */ var _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Decoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs\");\n/* harmony import */ var _decode_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decode.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs\");\n/* harmony import */ var _utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/stream.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\nfunction decodeAsync(streamLike, options) {\n if (options === void 0) { options = _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"defaultDecodeOptions\"]; }\n return __awaiter(this, void 0, void 0, function () {\n var stream, decoder;\n return __generator(this, function (_a) {\n stream = Object(_utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__[\"ensureAsyncIterabe\"])(streamLike);\n decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return [2 /*return*/, decoder.decodeAsync(stream)];\n });\n });\n}\nfunction decodeArrayStream(streamLike, options) {\n if (options === void 0) { options = _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"defaultDecodeOptions\"]; }\n var stream = Object(_utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__[\"ensureAsyncIterabe\"])(streamLike);\n var decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decodeArrayStream(stream);\n}\nfunction decodeStream(streamLike, options) {\n if (options === void 0) { options = _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"defaultDecodeOptions\"]; }\n var stream = Object(_utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__[\"ensureAsyncIterabe\"])(streamLike);\n var decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decodeStream(stream);\n}\n//# sourceMappingURL=decodeAsync.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeAsync\", function() { return decodeAsync; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeArrayStream\", function() { return decodeArrayStream; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeStream\", function() { return decodeStream; });\n/* harmony import */ var _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Decoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs\");\n/* harmony import */ var _decode_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decode.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs\");\n/* harmony import */ var _utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/stream.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\nfunction decodeAsync(streamLike, options) {\n if (options === void 0) { options = _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"defaultDecodeOptions\"]; }\n return __awaiter(this, void 0, void 0, function () {\n var stream, decoder;\n return __generator(this, function (_a) {\n stream = Object(_utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__[\"ensureAsyncIterabe\"])(streamLike);\n decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return [2 /*return*/, decoder.decodeAsync(stream)];\n });\n });\n}\nfunction decodeArrayStream(streamLike, options) {\n if (options === void 0) { options = _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"defaultDecodeOptions\"]; }\n var stream = Object(_utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__[\"ensureAsyncIterabe\"])(streamLike);\n var decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decodeArrayStream(stream);\n}\nfunction decodeStream(streamLike, options) {\n if (options === void 0) { options = _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"defaultDecodeOptions\"]; }\n var stream = Object(_utils_stream_mjs__WEBPACK_IMPORTED_MODULE_2__[\"ensureAsyncIterabe\"])(streamLike);\n var decoder = new _Decoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Decoder\"](options.extensionCodec, options.context, options.maxStrLength, options.maxBinLength, options.maxArrayLength, options.maxMapLength, options.maxExtLength);\n return decoder.decodeStream(stream);\n}\n//# sourceMappingURL=decodeAsync.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs": -/*!*************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs ***! - \*************************************************************************************************/ +/*!********************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs ***! + \********************************************************************************************************/ /*! exports provided: encode */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encode\", function() { return encode; });\n/* harmony import */ var _Encoder_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Encoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs\");\n\nvar defaultEncodeOptions = {};\n/**\n * It encodes `value` in the MessagePack format and\n * returns a byte buffer.\n *\n * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`.\n */\nfunction encode(value, options) {\n if (options === void 0) { options = defaultEncodeOptions; }\n var encoder = new _Encoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Encoder\"](options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat);\n return encoder.encode(value);\n}\n//# sourceMappingURL=encode.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encode\", function() { return encode; });\n/* harmony import */ var _Encoder_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Encoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs\");\n\nvar defaultEncodeOptions = {};\n/**\n * It encodes `value` in the MessagePack format and\n * returns a byte buffer.\n *\n * The returned buffer is a slice of a larger `ArrayBuffer`, so you have to use its `#byteOffset` and `#byteLength` in order to convert it to another typed arrays including NodeJS `Buffer`.\n */\nfunction encode(value, options) {\n if (options === void 0) { options = defaultEncodeOptions; }\n var encoder = new _Encoder_mjs__WEBPACK_IMPORTED_MODULE_0__[\"Encoder\"](options.extensionCodec, options.context, options.maxDepth, options.initialBufferSize, options.sortKeys, options.forceFloat32, options.ignoreUndefined, options.forceIntegerToFloat);\n return encoder.encode(value);\n}\n//# sourceMappingURL=encode.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs": -/*!************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs ***! - \************************************************************************************************/ +/*!*******************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs ***! + \*******************************************************************************************************/ /*! exports provided: encode, decode, decodeAsync, decodeArrayStream, decodeStream, Decoder, Encoder, ExtensionCodec, ExtData, EXT_TIMESTAMP, encodeDateToTimeSpec, encodeTimeSpecToTimestamp, decodeTimestampToTimeSpec, encodeTimestampExtension, decodeTimestampExtension */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _encode_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./encode.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encode\", function() { return _encode_mjs__WEBPACK_IMPORTED_MODULE_0__[\"encode\"]; });\n\n/* harmony import */ var _decode_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decode.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decode\", function() { return _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"decode\"]; });\n\n/* harmony import */ var _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./decodeAsync.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeAsync\", function() { return _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__[\"decodeAsync\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeArrayStream\", function() { return _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__[\"decodeArrayStream\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeStream\", function() { return _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__[\"decodeStream\"]; });\n\n/* harmony import */ var _Decoder_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Decoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Decoder\", function() { return _Decoder_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Decoder\"]; });\n\n/* harmony import */ var _Encoder_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Encoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Encoder\", function() { return _Encoder_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Encoder\"]; });\n\n/* harmony import */ var _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ExtensionCodec.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ExtensionCodec\", function() { return _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_5__[\"ExtensionCodec\"]; });\n\n/* harmony import */ var _ExtData_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ExtData.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ExtData\", function() { return _ExtData_mjs__WEBPACK_IMPORTED_MODULE_6__[\"ExtData\"]; });\n\n/* harmony import */ var _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./timestamp.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EXT_TIMESTAMP\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"EXT_TIMESTAMP\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encodeDateToTimeSpec\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"encodeDateToTimeSpec\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encodeTimeSpecToTimestamp\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"encodeTimeSpecToTimestamp\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampToTimeSpec\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"decodeTimestampToTimeSpec\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encodeTimestampExtension\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"encodeTimestampExtension\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampExtension\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"decodeTimestampExtension\"]; });\n\n// Main Functions:\n\n\n\n\n\n\n\n\n\n\n// Utilitiies for Extension Types:\n\n\n\n\n\n\n//# sourceMappingURL=index.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _encode_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./encode.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/encode.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encode\", function() { return _encode_mjs__WEBPACK_IMPORTED_MODULE_0__[\"encode\"]; });\n\n/* harmony import */ var _decode_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decode.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/decode.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decode\", function() { return _decode_mjs__WEBPACK_IMPORTED_MODULE_1__[\"decode\"]; });\n\n/* harmony import */ var _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./decodeAsync.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/decodeAsync.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeAsync\", function() { return _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__[\"decodeAsync\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeArrayStream\", function() { return _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__[\"decodeArrayStream\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeStream\", function() { return _decodeAsync_mjs__WEBPACK_IMPORTED_MODULE_2__[\"decodeStream\"]; });\n\n/* harmony import */ var _Decoder_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Decoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Decoder.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Decoder\", function() { return _Decoder_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Decoder\"]; });\n\n/* harmony import */ var _Encoder_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Encoder.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/Encoder.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Encoder\", function() { return _Encoder_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Encoder\"]; });\n\n/* harmony import */ var _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ExtensionCodec.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtensionCodec.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ExtensionCodec\", function() { return _ExtensionCodec_mjs__WEBPACK_IMPORTED_MODULE_5__[\"ExtensionCodec\"]; });\n\n/* harmony import */ var _ExtData_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ExtData.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/ExtData.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ExtData\", function() { return _ExtData_mjs__WEBPACK_IMPORTED_MODULE_6__[\"ExtData\"]; });\n\n/* harmony import */ var _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./timestamp.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EXT_TIMESTAMP\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"EXT_TIMESTAMP\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encodeDateToTimeSpec\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"encodeDateToTimeSpec\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encodeTimeSpecToTimestamp\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"encodeTimeSpecToTimestamp\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampToTimeSpec\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"decodeTimestampToTimeSpec\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"encodeTimestampExtension\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"encodeTimestampExtension\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampExtension\", function() { return _timestamp_mjs__WEBPACK_IMPORTED_MODULE_7__[\"decodeTimestampExtension\"]; });\n\n// Main Functions:\n\n\n\n\n\n\n\n\n\n\n// Utilitiies for Extension Types:\n\n\n\n\n\n\n//# sourceMappingURL=index.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs": -/*!****************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs ***! - \****************************************************************************************************/ +/*!***********************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs ***! + \***********************************************************************************************************/ /*! exports provided: EXT_TIMESTAMP, encodeTimeSpecToTimestamp, encodeDateToTimeSpec, encodeTimestampExtension, decodeTimestampToTimeSpec, decodeTimestampExtension, timestampExtension */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EXT_TIMESTAMP\", function() { return EXT_TIMESTAMP; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodeTimeSpecToTimestamp\", function() { return encodeTimeSpecToTimestamp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodeDateToTimeSpec\", function() { return encodeDateToTimeSpec; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodeTimestampExtension\", function() { return encodeTimestampExtension; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampToTimeSpec\", function() { return decodeTimestampToTimeSpec; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampExtension\", function() { return decodeTimestampExtension; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timestampExtension\", function() { return timestampExtension; });\n/* harmony import */ var _utils_int_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/int.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs\");\n// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type\n\nvar EXT_TIMESTAMP = -1;\nvar TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int\nvar TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int\nfunction encodeTimeSpecToTimestamp(_a) {\n var sec = _a.sec, nsec = _a.nsec;\n if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {\n // Here sec >= 0 && nsec >= 0\n if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {\n // timestamp 32 = { sec32 (unsigned) }\n var rv = new Uint8Array(4);\n var view = new DataView(rv.buffer);\n view.setUint32(0, sec);\n return rv;\n }\n else {\n // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) }\n var secHigh = sec / 0x100000000;\n var secLow = sec & 0xffffffff;\n var rv = new Uint8Array(8);\n var view = new DataView(rv.buffer);\n // nsec30 | secHigh2\n view.setUint32(0, (nsec << 2) | (secHigh & 0x3));\n // secLow32\n view.setUint32(4, secLow);\n return rv;\n }\n }\n else {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n var rv = new Uint8Array(12);\n var view = new DataView(rv.buffer);\n view.setUint32(0, nsec);\n Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_0__[\"setInt64\"])(view, 4, sec);\n return rv;\n }\n}\nfunction encodeDateToTimeSpec(date) {\n var msec = date.getTime();\n var sec = Math.floor(msec / 1e3);\n var nsec = (msec - sec * 1e3) * 1e6;\n // Normalizes { sec, nsec } to ensure nsec is unsigned.\n var nsecInSec = Math.floor(nsec / 1e9);\n return {\n sec: sec + nsecInSec,\n nsec: nsec - nsecInSec * 1e9,\n };\n}\nfunction encodeTimestampExtension(object) {\n if (object instanceof Date) {\n var timeSpec = encodeDateToTimeSpec(object);\n return encodeTimeSpecToTimestamp(timeSpec);\n }\n else {\n return null;\n }\n}\nfunction decodeTimestampToTimeSpec(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n // data may be 32, 64, or 96 bits\n switch (data.byteLength) {\n case 4: {\n // timestamp 32 = { sec32 }\n var sec = view.getUint32(0);\n var nsec = 0;\n return { sec: sec, nsec: nsec };\n }\n case 8: {\n // timestamp 64 = { nsec30, sec34 }\n var nsec30AndSecHigh2 = view.getUint32(0);\n var secLow32 = view.getUint32(4);\n var sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32;\n var nsec = nsec30AndSecHigh2 >>> 2;\n return { sec: sec, nsec: nsec };\n }\n case 12: {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n var sec = Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_0__[\"getInt64\"])(view, 4);\n var nsec = view.getUint32(0);\n return { sec: sec, nsec: nsec };\n }\n default:\n throw new Error(\"Unrecognized data size for timestamp: \" + data.length);\n }\n}\nfunction decodeTimestampExtension(data) {\n var timeSpec = decodeTimestampToTimeSpec(data);\n return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);\n}\nvar timestampExtension = {\n type: EXT_TIMESTAMP,\n encode: encodeTimestampExtension,\n decode: decodeTimestampExtension,\n};\n//# sourceMappingURL=timestamp.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EXT_TIMESTAMP\", function() { return EXT_TIMESTAMP; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodeTimeSpecToTimestamp\", function() { return encodeTimeSpecToTimestamp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodeDateToTimeSpec\", function() { return encodeDateToTimeSpec; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodeTimestampExtension\", function() { return encodeTimestampExtension; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampToTimeSpec\", function() { return decodeTimestampToTimeSpec; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeTimestampExtension\", function() { return decodeTimestampExtension; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timestampExtension\", function() { return timestampExtension; });\n/* harmony import */ var _utils_int_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/int.mjs */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs\");\n// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type\n\nvar EXT_TIMESTAMP = -1;\nvar TIMESTAMP32_MAX_SEC = 0x100000000 - 1; // 32-bit unsigned int\nvar TIMESTAMP64_MAX_SEC = 0x400000000 - 1; // 34-bit unsigned int\nfunction encodeTimeSpecToTimestamp(_a) {\n var sec = _a.sec, nsec = _a.nsec;\n if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {\n // Here sec >= 0 && nsec >= 0\n if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {\n // timestamp 32 = { sec32 (unsigned) }\n var rv = new Uint8Array(4);\n var view = new DataView(rv.buffer);\n view.setUint32(0, sec);\n return rv;\n }\n else {\n // timestamp 64 = { nsec30 (unsigned), sec34 (unsigned) }\n var secHigh = sec / 0x100000000;\n var secLow = sec & 0xffffffff;\n var rv = new Uint8Array(8);\n var view = new DataView(rv.buffer);\n // nsec30 | secHigh2\n view.setUint32(0, (nsec << 2) | (secHigh & 0x3));\n // secLow32\n view.setUint32(4, secLow);\n return rv;\n }\n }\n else {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n var rv = new Uint8Array(12);\n var view = new DataView(rv.buffer);\n view.setUint32(0, nsec);\n Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_0__[\"setInt64\"])(view, 4, sec);\n return rv;\n }\n}\nfunction encodeDateToTimeSpec(date) {\n var msec = date.getTime();\n var sec = Math.floor(msec / 1e3);\n var nsec = (msec - sec * 1e3) * 1e6;\n // Normalizes { sec, nsec } to ensure nsec is unsigned.\n var nsecInSec = Math.floor(nsec / 1e9);\n return {\n sec: sec + nsecInSec,\n nsec: nsec - nsecInSec * 1e9,\n };\n}\nfunction encodeTimestampExtension(object) {\n if (object instanceof Date) {\n var timeSpec = encodeDateToTimeSpec(object);\n return encodeTimeSpecToTimestamp(timeSpec);\n }\n else {\n return null;\n }\n}\nfunction decodeTimestampToTimeSpec(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n // data may be 32, 64, or 96 bits\n switch (data.byteLength) {\n case 4: {\n // timestamp 32 = { sec32 }\n var sec = view.getUint32(0);\n var nsec = 0;\n return { sec: sec, nsec: nsec };\n }\n case 8: {\n // timestamp 64 = { nsec30, sec34 }\n var nsec30AndSecHigh2 = view.getUint32(0);\n var secLow32 = view.getUint32(4);\n var sec = (nsec30AndSecHigh2 & 0x3) * 0x100000000 + secLow32;\n var nsec = nsec30AndSecHigh2 >>> 2;\n return { sec: sec, nsec: nsec };\n }\n case 12: {\n // timestamp 96 = { nsec32 (unsigned), sec64 (signed) }\n var sec = Object(_utils_int_mjs__WEBPACK_IMPORTED_MODULE_0__[\"getInt64\"])(view, 4);\n var nsec = view.getUint32(0);\n return { sec: sec, nsec: nsec };\n }\n default:\n throw new Error(\"Unrecognized data size for timestamp: \" + data.length);\n }\n}\nfunction decodeTimestampExtension(data) {\n var timeSpec = decodeTimestampToTimeSpec(data);\n return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);\n}\nvar timestampExtension = {\n type: EXT_TIMESTAMP,\n encode: encodeTimestampExtension,\n decode: decodeTimestampExtension,\n};\n//# sourceMappingURL=timestamp.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/timestamp.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs": -/*!****************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs ***! - \****************************************************************************************************/ +/*!***********************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs ***! + \***********************************************************************************************************/ /*! exports provided: setUint64, setInt64, getInt64, getUint64 */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setUint64\", function() { return setUint64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setInt64\", function() { return setInt64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getInt64\", function() { return getInt64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getUint64\", function() { return getUint64; });\n// DataView extension to handle int64 / uint64,\n// where the actual range is 53-bits integer (a.k.a. safe integer)\nfunction setUint64(view, offset, value) {\n var high = value / 4294967296;\n var low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\nfunction setInt64(view, offset, value) {\n var high = Math.floor(value / 4294967296);\n var low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\nfunction getInt64(view, offset) {\n var high = view.getInt32(offset);\n var low = view.getUint32(offset + 4);\n return high * 4294967296 + low;\n}\nfunction getUint64(view, offset) {\n var high = view.getUint32(offset);\n var low = view.getUint32(offset + 4);\n return high * 4294967296 + low;\n}\n//# sourceMappingURL=int.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setUint64\", function() { return setUint64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setInt64\", function() { return setInt64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getInt64\", function() { return getInt64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getUint64\", function() { return getUint64; });\n// DataView extension to handle int64 / uint64,\n// where the actual range is 53-bits integer (a.k.a. safe integer)\nfunction setUint64(view, offset, value) {\n var high = value / 4294967296;\n var low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\nfunction setInt64(view, offset, value) {\n var high = Math.floor(value / 4294967296);\n var low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}\nfunction getInt64(view, offset) {\n var high = view.getInt32(offset);\n var low = view.getUint32(offset + 4);\n return high * 4294967296 + low;\n}\nfunction getUint64(view, offset) {\n var high = view.getUint32(offset);\n var low = view.getUint32(offset + 4);\n return high * 4294967296 + low;\n}\n//# sourceMappingURL=int.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/int.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs": -/*!***********************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs ***! - \***********************************************************************************************************/ +/*!******************************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs ***! + \******************************************************************************************************************/ /*! exports provided: prettyByte */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prettyByte\", function() { return prettyByte; });\nfunction prettyByte(byte) {\n return (byte < 0 ? \"-\" : \"\") + \"0x\" + Math.abs(byte).toString(16).padStart(2, \"0\");\n}\n//# sourceMappingURL=prettyByte.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prettyByte\", function() { return prettyByte; });\nfunction prettyByte(byte) {\n return (byte < 0 ? \"-\" : \"\") + \"0x\" + Math.abs(byte).toString(16).padStart(2, \"0\");\n}\n//# sourceMappingURL=prettyByte.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/prettyByte.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs": -/*!*******************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs ***! - \*******************************************************************************************************/ +/*!**************************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs ***! + \**************************************************************************************************************/ /*! exports provided: isAsyncIterable, asyncIterableFromStream, ensureAsyncIterabe */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAsyncIterable\", function() { return isAsyncIterable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"asyncIterableFromStream\", function() { return asyncIterableFromStream; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ensureAsyncIterabe\", function() { return ensureAsyncIterabe; });\n// utility for whatwg streams\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nfunction isAsyncIterable(object) {\n return object[Symbol.asyncIterator] != null;\n}\nfunction assertNonNull(value) {\n if (value == null) {\n throw new Error(\"Assertion Failure: value must not be null nor undefined\");\n }\n}\nfunction asyncIterableFromStream(stream) {\n return __asyncGenerator(this, arguments, function asyncIterableFromStream_1() {\n var reader, _a, done, value;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = stream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (false) {}\n return [4 /*yield*/, __await(reader.read())];\n case 3:\n _a = _b.sent(), done = _a.done, value = _a.value;\n if (!done) return [3 /*break*/, 5];\n return [4 /*yield*/, __await(void 0)];\n case 4: return [2 /*return*/, _b.sent()];\n case 5:\n assertNonNull(value);\n return [4 /*yield*/, __await(value)];\n case 6: return [4 /*yield*/, _b.sent()];\n case 7:\n _b.sent();\n return [3 /*break*/, 2];\n case 8: return [3 /*break*/, 10];\n case 9:\n reader.releaseLock();\n return [7 /*endfinally*/];\n case 10: return [2 /*return*/];\n }\n });\n });\n}\nfunction ensureAsyncIterabe(streamLike) {\n if (isAsyncIterable(streamLike)) {\n return streamLike;\n }\n else {\n return asyncIterableFromStream(streamLike);\n }\n}\n//# sourceMappingURL=stream.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAsyncIterable\", function() { return isAsyncIterable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"asyncIterableFromStream\", function() { return asyncIterableFromStream; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ensureAsyncIterabe\", function() { return ensureAsyncIterabe; });\n// utility for whatwg streams\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nfunction isAsyncIterable(object) {\n return object[Symbol.asyncIterator] != null;\n}\nfunction assertNonNull(value) {\n if (value == null) {\n throw new Error(\"Assertion Failure: value must not be null nor undefined\");\n }\n}\nfunction asyncIterableFromStream(stream) {\n return __asyncGenerator(this, arguments, function asyncIterableFromStream_1() {\n var reader, _a, done, value;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = stream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (false) {}\n return [4 /*yield*/, __await(reader.read())];\n case 3:\n _a = _b.sent(), done = _a.done, value = _a.value;\n if (!done) return [3 /*break*/, 5];\n return [4 /*yield*/, __await(void 0)];\n case 4: return [2 /*return*/, _b.sent()];\n case 5:\n assertNonNull(value);\n return [4 /*yield*/, __await(value)];\n case 6: return [4 /*yield*/, _b.sent()];\n case 7:\n _b.sent();\n return [3 /*break*/, 2];\n case 8: return [3 /*break*/, 10];\n case 9:\n reader.releaseLock();\n return [7 /*endfinally*/];\n case 10: return [2 /*return*/];\n }\n });\n });\n}\nfunction ensureAsyncIterabe(streamLike) {\n if (isAsyncIterable(streamLike)) {\n return streamLike;\n }\n else {\n return asyncIterableFromStream(streamLike);\n }\n}\n//# sourceMappingURL=stream.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/stream.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs": -/*!************************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs ***! - \************************************************************************************************************/ +/*!*******************************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs ***! + \*******************************************************************************************************************/ /*! exports provided: ensureUint8Array, createDataView */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ensureUint8Array\", function() { return ensureUint8Array; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createDataView\", function() { return createDataView; });\nfunction ensureUint8Array(buffer) {\n if (buffer instanceof Uint8Array) {\n return buffer;\n }\n else if (ArrayBuffer.isView(buffer)) {\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n }\n else if (buffer instanceof ArrayBuffer) {\n return new Uint8Array(buffer);\n }\n else {\n // ArrayLike\n return Uint8Array.from(buffer);\n }\n}\nfunction createDataView(buffer) {\n if (buffer instanceof ArrayBuffer) {\n return new DataView(buffer);\n }\n var bufferView = ensureUint8Array(buffer);\n return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n}\n//# sourceMappingURL=typedArrays.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ensureUint8Array\", function() { return ensureUint8Array; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createDataView\", function() { return createDataView; });\nfunction ensureUint8Array(buffer) {\n if (buffer instanceof Uint8Array) {\n return buffer;\n }\n else if (ArrayBuffer.isView(buffer)) {\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n }\n else if (buffer instanceof ArrayBuffer) {\n return new Uint8Array(buffer);\n }\n else {\n // ArrayLike\n return Uint8Array.from(buffer);\n }\n}\nfunction createDataView(buffer) {\n if (buffer instanceof ArrayBuffer) {\n return new DataView(buffer);\n }\n var bufferView = ensureUint8Array(buffer);\n return new DataView(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n}\n//# sourceMappingURL=typedArrays.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/typedArrays.mjs?"); /***/ }), /***/ "../../../node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs": -/*!*****************************************************************************************************!*\ - !*** /home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs ***! - \*****************************************************************************************************/ +/*!************************************************************************************************************!*\ + !*** /home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs ***! + \************************************************************************************************************/ /*! exports provided: utf8Count, utf8EncodeJs, TEXT_ENCODER_THRESHOLD, utf8EncodeTE, utf8DecodeJs, TEXT_DECODER_THRESHOLD, utf8DecodeTD */ /***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8Count\", function() { return utf8Count; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8EncodeJs\", function() { return utf8EncodeJs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_ENCODER_THRESHOLD\", function() { return TEXT_ENCODER_THRESHOLD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8EncodeTE\", function() { return utf8EncodeTE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8DecodeJs\", function() { return utf8DecodeJs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_DECODER_THRESHOLD\", function() { return TEXT_DECODER_THRESHOLD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8DecodeTD\", function() { return utf8DecodeTD; });\nvar TEXT_ENCODING_AVAILABLE = typeof process !== \"undefined\" &&\n process.env.TEXT_ENCODING !== \"never\" &&\n typeof TextEncoder !== \"undefined\" &&\n typeof TextDecoder !== \"undefined\";\nvar STR_SIZE_MAX = 4294967295; // uint32_max\nfunction utf8Count(str) {\n var strLength = str.length;\n var byteLength = 0;\n var pos = 0;\n while (pos < strLength) {\n var value = str.charCodeAt(pos++);\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n byteLength++;\n continue;\n }\n else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n byteLength += 2;\n }\n else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n var extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n byteLength += 3;\n }\n else {\n // 4-byte\n byteLength += 4;\n }\n }\n }\n return byteLength;\n}\nfunction utf8EncodeJs(str, output, outputOffset) {\n var strLength = str.length;\n var offset = outputOffset;\n var pos = 0;\n while (pos < strLength) {\n var value = str.charCodeAt(pos++);\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n output[offset++] = value;\n continue;\n }\n else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n output[offset++] = ((value >> 6) & 0x1f) | 0xc0;\n }\n else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n var extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n output[offset++] = ((value >> 12) & 0x0f) | 0xe0;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n else {\n // 4-byte\n output[offset++] = ((value >> 18) & 0x07) | 0xf0;\n output[offset++] = ((value >> 12) & 0x3f) | 0x80;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n }\n output[offset++] = (value & 0x3f) | 0x80;\n }\n}\nvar sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined;\nvar TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? STR_SIZE_MAX\n : typeof process !== \"undefined\" && process.env.TEXT_ENCODING !== \"force\"\n ? 200\n : 0;\nfunction utf8EncodeTEencode(str, output, outputOffset) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n output.set(sharedTextEncoder.encode(str), outputOffset);\n}\nfunction utf8EncodeTEencodeInto(str, output, outputOffset) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n sharedTextEncoder.encodeInto(str, output.subarray(outputOffset));\n}\nvar utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode;\nvar CHUNK_SIZE = 4096;\nfunction utf8DecodeJs(bytes, inputOffset, byteLength) {\n var offset = inputOffset;\n var end = offset + byteLength;\n var units = [];\n var result = \"\";\n while (offset < end) {\n var byte1 = bytes[offset++];\n if ((byte1 & 0x80) === 0) {\n // 1 byte\n units.push(byte1);\n }\n else if ((byte1 & 0xe0) === 0xc0) {\n // 2 bytes\n var byte2 = bytes[offset++] & 0x3f;\n units.push(((byte1 & 0x1f) << 6) | byte2);\n }\n else if ((byte1 & 0xf0) === 0xe0) {\n // 3 bytes\n var byte2 = bytes[offset++] & 0x3f;\n var byte3 = bytes[offset++] & 0x3f;\n units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);\n }\n else if ((byte1 & 0xf8) === 0xf0) {\n // 4 bytes\n var byte2 = bytes[offset++] & 0x3f;\n var byte3 = bytes[offset++] & 0x3f;\n var byte4 = bytes[offset++] & 0x3f;\n var unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;\n if (unit > 0xffff) {\n unit -= 0x10000;\n units.push(((unit >>> 10) & 0x3ff) | 0xd800);\n unit = 0xdc00 | (unit & 0x3ff);\n }\n units.push(unit);\n }\n else {\n units.push(byte1);\n }\n if (units.length >= CHUNK_SIZE) {\n result += String.fromCharCode.apply(String, units);\n units.length = 0;\n }\n }\n if (units.length > 0) {\n result += String.fromCharCode.apply(String, units);\n }\n return result;\n}\nvar sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null;\nvar TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? STR_SIZE_MAX\n : typeof process !== \"undefined\" && process.env.TEXT_DECODER !== \"force\"\n ? 200\n : 0;\nfunction utf8DecodeTD(bytes, inputOffset, byteLength) {\n var stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return sharedTextDecoder.decode(stringBytes);\n}\n//# sourceMappingURL=utf8.mjs.map\n\n//# sourceURL=webpack:////home/runner/work/monorepo/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8Count\", function() { return utf8Count; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8EncodeJs\", function() { return utf8EncodeJs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_ENCODER_THRESHOLD\", function() { return TEXT_ENCODER_THRESHOLD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8EncodeTE\", function() { return utf8EncodeTE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8DecodeJs\", function() { return utf8DecodeJs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_DECODER_THRESHOLD\", function() { return TEXT_DECODER_THRESHOLD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"utf8DecodeTD\", function() { return utf8DecodeTD; });\nvar TEXT_ENCODING_AVAILABLE = typeof process !== \"undefined\" &&\n process.env.TEXT_ENCODING !== \"never\" &&\n typeof TextEncoder !== \"undefined\" &&\n typeof TextDecoder !== \"undefined\";\nvar STR_SIZE_MAX = 4294967295; // uint32_max\nfunction utf8Count(str) {\n var strLength = str.length;\n var byteLength = 0;\n var pos = 0;\n while (pos < strLength) {\n var value = str.charCodeAt(pos++);\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n byteLength++;\n continue;\n }\n else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n byteLength += 2;\n }\n else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n var extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n byteLength += 3;\n }\n else {\n // 4-byte\n byteLength += 4;\n }\n }\n }\n return byteLength;\n}\nfunction utf8EncodeJs(str, output, outputOffset) {\n var strLength = str.length;\n var offset = outputOffset;\n var pos = 0;\n while (pos < strLength) {\n var value = str.charCodeAt(pos++);\n if ((value & 0xffffff80) === 0) {\n // 1-byte\n output[offset++] = value;\n continue;\n }\n else if ((value & 0xfffff800) === 0) {\n // 2-bytes\n output[offset++] = ((value >> 6) & 0x1f) | 0xc0;\n }\n else {\n // handle surrogate pair\n if (value >= 0xd800 && value <= 0xdbff) {\n // high surrogate\n if (pos < strLength) {\n var extra = str.charCodeAt(pos);\n if ((extra & 0xfc00) === 0xdc00) {\n ++pos;\n value = ((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000;\n }\n }\n }\n if ((value & 0xffff0000) === 0) {\n // 3-byte\n output[offset++] = ((value >> 12) & 0x0f) | 0xe0;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n else {\n // 4-byte\n output[offset++] = ((value >> 18) & 0x07) | 0xf0;\n output[offset++] = ((value >> 12) & 0x3f) | 0x80;\n output[offset++] = ((value >> 6) & 0x3f) | 0x80;\n }\n }\n output[offset++] = (value & 0x3f) | 0x80;\n }\n}\nvar sharedTextEncoder = TEXT_ENCODING_AVAILABLE ? new TextEncoder() : undefined;\nvar TEXT_ENCODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? STR_SIZE_MAX\n : typeof process !== \"undefined\" && process.env.TEXT_ENCODING !== \"force\"\n ? 200\n : 0;\nfunction utf8EncodeTEencode(str, output, outputOffset) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n output.set(sharedTextEncoder.encode(str), outputOffset);\n}\nfunction utf8EncodeTEencodeInto(str, output, outputOffset) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n sharedTextEncoder.encodeInto(str, output.subarray(outputOffset));\n}\nvar utf8EncodeTE = (sharedTextEncoder === null || sharedTextEncoder === void 0 ? void 0 : sharedTextEncoder.encodeInto) ? utf8EncodeTEencodeInto : utf8EncodeTEencode;\nvar CHUNK_SIZE = 4096;\nfunction utf8DecodeJs(bytes, inputOffset, byteLength) {\n var offset = inputOffset;\n var end = offset + byteLength;\n var units = [];\n var result = \"\";\n while (offset < end) {\n var byte1 = bytes[offset++];\n if ((byte1 & 0x80) === 0) {\n // 1 byte\n units.push(byte1);\n }\n else if ((byte1 & 0xe0) === 0xc0) {\n // 2 bytes\n var byte2 = bytes[offset++] & 0x3f;\n units.push(((byte1 & 0x1f) << 6) | byte2);\n }\n else if ((byte1 & 0xf0) === 0xe0) {\n // 3 bytes\n var byte2 = bytes[offset++] & 0x3f;\n var byte3 = bytes[offset++] & 0x3f;\n units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);\n }\n else if ((byte1 & 0xf8) === 0xf0) {\n // 4 bytes\n var byte2 = bytes[offset++] & 0x3f;\n var byte3 = bytes[offset++] & 0x3f;\n var byte4 = bytes[offset++] & 0x3f;\n var unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;\n if (unit > 0xffff) {\n unit -= 0x10000;\n units.push(((unit >>> 10) & 0x3ff) | 0xd800);\n unit = 0xdc00 | (unit & 0x3ff);\n }\n units.push(unit);\n }\n else {\n units.push(byte1);\n }\n if (units.length >= CHUNK_SIZE) {\n result += String.fromCharCode.apply(String, units);\n units.length = 0;\n }\n }\n if (units.length > 0) {\n result += String.fromCharCode.apply(String, units);\n }\n return result;\n}\nvar sharedTextDecoder = TEXT_ENCODING_AVAILABLE ? new TextDecoder() : null;\nvar TEXT_DECODER_THRESHOLD = !TEXT_ENCODING_AVAILABLE\n ? STR_SIZE_MAX\n : typeof process !== \"undefined\" && process.env.TEXT_DECODER !== \"force\"\n ? 200\n : 0;\nfunction utf8DecodeTD(bytes, inputOffset, byteLength) {\n var stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return sharedTextDecoder.decode(stringBytes);\n}\n//# sourceMappingURL=utf8.mjs.map\n\n//# sourceURL=webpack:////home/jelli/Dev/Repos/w3/web3-api/monorepo/node_modules/@msgpack/msgpack/dist.es5+esm/utils/utf8.mjs?"); /***/ }), @@ -284,7 +284,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable no-constant-condition */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar types_1 = __webpack_require__(/*! ./types */ \"./src/wasm/types.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./src/wasm/utils.ts\");\nvar msgpack_1 = __webpack_require__(/*! @msgpack/msgpack */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs\");\nvar state = {\n invoke: {},\n subinvoke: {},\n};\nvar abort = function (message) {\n dispatchAction({\n type: \"Abort\",\n message: message,\n });\n};\nvar dispatchAction = function (action) {\n // @ts-ignore webworker postMessage\n postMessage(action);\n};\nvar imports = function (memory) { return ({\n w3: {\n __w3_subinvoke: function (uriPtr, uriLen, modulePtr, moduleLen, methodPtr, methodLen, inputPtr, inputLen) {\n if (state.threadId === undefined ||\n state.threadMutexes === undefined ||\n state.transfer === undefined) {\n abort(\"__w3_subinvoke: thread uninitialized.\\nthreadId: \" + state.threadId + \"\\nthreadMutexes: \" + state.threadMutexes);\n return false;\n }\n // Reset our state\n state.subinvoke.result = undefined;\n state.subinvoke.error = undefined;\n var uri = utils_1.readString(memory.buffer, uriPtr, uriLen);\n var module = utils_1.readString(memory.buffer, modulePtr, moduleLen);\n var method = utils_1.readString(memory.buffer, methodPtr, methodLen);\n var input = utils_1.readBytes(memory.buffer, inputPtr, inputLen);\n // Reset our thread's status\n Atomics.store(state.threadMutexes, state.threadId, 0);\n dispatchAction({\n type: \"SubInvoke\",\n uri: uri,\n module: module,\n method: method,\n input: input,\n });\n // Pause the thread\n Atomics.wait(state.threadMutexes, state.threadId, 0);\n // Get the code & reset to 0\n var status = Atomics.exchange(state.threadMutexes, state.threadId, 0);\n if (status === types_1.ThreadWakeStatus.SUBINVOKE_ERROR ||\n status === types_1.ThreadWakeStatus.SUBINVOKE_RESULT) {\n var transferStatus = status;\n var numBytes = Atomics.load(state.transfer, 0);\n var data = new Uint8Array(numBytes);\n var progress = 0;\n while (true) {\n var newLength = progress + numBytes;\n if (data.byteLength < newLength) {\n data = new Uint8Array(data, 0, newLength);\n }\n for (var i = 1; i <= numBytes; ++i) {\n data[progress + (i - 1)] = Atomics.load(state.transfer, i);\n }\n progress += numBytes;\n dispatchAction({ type: \"TransferComplete\" });\n // If the main thread hasn't said we're done yet, wait\n // for another chunk of data\n if (transferStatus !== types_1.ThreadWakeStatus.SUBINVOKE_DONE) {\n Atomics.wait(state.threadMutexes, state.threadId, 0);\n transferStatus = Atomics.exchange(state.threadMutexes, state.threadId, 0);\n numBytes = Atomics.load(state.transfer, 0);\n }\n else {\n break;\n }\n }\n // Transfer is complete, copy result to desired location\n if (status === types_1.ThreadWakeStatus.SUBINVOKE_ERROR) {\n var decoder = new TextDecoder();\n state.subinvoke.error = decoder.decode(data);\n return false;\n }\n else if (status === types_1.ThreadWakeStatus.SUBINVOKE_RESULT) {\n state.subinvoke.result = data.buffer;\n return true;\n }\n }\n else {\n abort(\"__w3_subinvoke: Unknown wake status \" + status);\n return false;\n }\n return false;\n },\n // Give WASM the size of the result\n __w3_subinvoke_result_len: function () {\n if (!state.subinvoke.result) {\n abort(\"__w3_subinvoke_result_len: subinvoke.result is not set\");\n return 0;\n }\n return state.subinvoke.result.byteLength;\n },\n // Copy the subinvoke result into WASM\n __w3_subinvoke_result: function (ptr) {\n if (!state.subinvoke.result) {\n abort(\"__w3_subinvoke_result: subinvoke.result is not set\");\n return;\n }\n utils_1.writeBytes(state.subinvoke.result, memory.buffer, ptr);\n },\n // Give WASM the size of the error\n __w3_subinvoke_error_len: function () {\n if (!state.subinvoke.error) {\n abort(\"__w3_subinvoke_error_len: subinvoke.error is not set\");\n return 0;\n }\n return state.subinvoke.error.length;\n },\n // Copy the subinvoke error into WASM\n __w3_subinvoke_error: function (ptr) {\n if (!state.subinvoke.error) {\n abort(\"__w3_subinvoke_error: subinvoke.error is not set\");\n return;\n }\n utils_1.writeString(state.subinvoke.error, memory.buffer, ptr);\n },\n // Copy the invocation's method & args into WASM\n __w3_invoke_args: function (methodPtr, argsPtr) {\n if (!state.method) {\n abort(\"__w3_invoke_args: method is not set\");\n return;\n }\n if (!state.args) {\n abort(\"__w3_invoke_args: args is not set\");\n return;\n }\n utils_1.writeString(state.method, memory.buffer, methodPtr);\n utils_1.writeBytes(state.args, memory.buffer, argsPtr);\n },\n // Store the invocation's result\n __w3_invoke_result: function (ptr, len) {\n state.invoke.result = utils_1.readBytes(memory.buffer, ptr, len);\n },\n // Store the invocation's error\n __w3_invoke_error: function (ptr, len) {\n state.invoke.error = utils_1.readString(memory.buffer, ptr, len);\n },\n __w3_abort: function (msgPtr, msgLen, filePtr, fileLen, line, column) {\n var msg = utils_1.readString(memory.buffer, msgPtr, msgLen);\n var file = utils_1.readString(memory.buffer, filePtr, fileLen);\n abort(\"__w3_abort: \" + msg + \"\\nFile: \" + file + \"\\nLocation: [\" + line + \",\" + column + \"]\");\n },\n },\n env: {\n memory: memory,\n },\n}); };\n// @ts-ignore\naddEventListener(\"message\", function (input) {\n var data = input.data;\n // Store thread mutexes & ID, used for pausing the thread's execution\n state.threadMutexes = new Int32Array(data.threadMutexesBuffer, 0, types_1.maxThreads);\n state.threadId = data.threadId;\n // Store transfer buffer\n state.transfer = new Uint8Array(data.transferBuffer, 0, types_1.maxTransferBytes);\n // Store the method we're invoking\n state.method = data.method;\n if (data.input instanceof ArrayBuffer) {\n // No need to serialize\n state.args = data.input;\n }\n else {\n // We must serialize the input object into msgpack\n state.args = msgpack_1.encode(data.input);\n }\n var module = new WebAssembly.Module(data.wasm);\n var memory = new WebAssembly.Memory({ initial: 1 });\n var source = new WebAssembly.Instance(module, imports(memory));\n var exports = source.exports;\n var hasExport = function (name, exports) {\n if (!exports[name]) {\n abort(\"A required export was not found: \" + name);\n return false;\n }\n return true;\n };\n // Make sure _w3_init exists\n if (!hasExport(\"_w3_init\", exports)) {\n return;\n }\n // Initialize the Web3Api module\n exports._w3_init();\n // Make sure _w3_invoke exists\n if (!hasExport(\"_w3_invoke\", exports)) {\n return;\n }\n var result = exports._w3_invoke(state.method.length, state.args.byteLength);\n if (result) {\n if (!state.invoke.result) {\n abort(\"Invoke result is missing.\");\n return;\n }\n // __w3_invoke_result has already been called\n dispatchAction({\n type: \"LogQueryResult\",\n result: state.invoke.result,\n });\n }\n else {\n if (!state.invoke.error) {\n abort(\"Invoke error is missing.\");\n return;\n }\n // __w3_invoke_error has already been called\n dispatchAction({\n type: \"LogQueryError\",\n error: state.invoke.error,\n });\n }\n});\n\n\n//# sourceURL=webpack:///./src/wasm/thread.ts?"); +eval("\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable no-constant-condition */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar types_1 = __webpack_require__(/*! ./types */ \"./src/wasm/types.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./src/wasm/utils.ts\");\nvar MsgPack = __importStar(__webpack_require__(/*! @msgpack/msgpack */ \"../../../node_modules/@msgpack/msgpack/dist.es5+esm/index.mjs\"));\nvar state = {\n invoke: {},\n subinvoke: {},\n};\nvar abort = function (message) {\n dispatchAction({\n type: \"Abort\",\n message: message,\n });\n};\nvar dispatchAction = function (action) {\n // @ts-ignore webworker postMessage\n postMessage(action);\n};\nvar imports = function (memory) { return ({\n w3: {\n __w3_subinvoke: function (uriPtr, uriLen, modulePtr, moduleLen, methodPtr, methodLen, inputPtr, inputLen) {\n if (state.threadId === undefined ||\n state.threadMutexes === undefined ||\n state.transfer === undefined) {\n abort(\"__w3_subinvoke: thread uninitialized.\\nthreadId: \" + state.threadId + \"\\nthreadMutexes: \" + state.threadMutexes);\n return false;\n }\n // Reset our state\n state.subinvoke.result = undefined;\n state.subinvoke.error = undefined;\n var uri = utils_1.readString(memory.buffer, uriPtr, uriLen);\n var module = utils_1.readString(memory.buffer, modulePtr, moduleLen);\n var method = utils_1.readString(memory.buffer, methodPtr, methodLen);\n var input = utils_1.readBytes(memory.buffer, inputPtr, inputLen);\n // Reset our thread's status\n Atomics.store(state.threadMutexes, state.threadId, 0);\n dispatchAction({\n type: \"SubInvoke\",\n uri: uri,\n module: module,\n method: method,\n input: input,\n });\n // Pause the thread\n Atomics.wait(state.threadMutexes, state.threadId, 0);\n // Get the code & reset to 0\n var status = Atomics.exchange(state.threadMutexes, state.threadId, 0);\n if (status === types_1.ThreadWakeStatus.SUBINVOKE_ERROR ||\n status === types_1.ThreadWakeStatus.SUBINVOKE_RESULT) {\n var transferStatus = status;\n var numBytes = Atomics.load(state.transfer, 0);\n var data = new Uint8Array(numBytes);\n var progress = 0;\n while (true) {\n var newLength = progress + numBytes;\n if (data.byteLength < newLength) {\n var buf = new Uint8Array(newLength);\n buf.set(data);\n data = buf;\n }\n for (var i = 1; i <= numBytes; ++i) {\n data[progress + (i - 1)] = Atomics.load(state.transfer, i);\n }\n progress += numBytes;\n dispatchAction({ type: \"TransferComplete\" });\n // If the main thread hasn't said we're done yet, wait\n // for another chunk of data\n if (transferStatus !== types_1.ThreadWakeStatus.SUBINVOKE_DONE) {\n Atomics.wait(state.threadMutexes, state.threadId, 0);\n transferStatus = Atomics.exchange(state.threadMutexes, state.threadId, 0);\n numBytes = Atomics.load(state.transfer, 0);\n }\n else {\n break;\n }\n }\n // Transfer is complete, copy result to desired location\n if (status === types_1.ThreadWakeStatus.SUBINVOKE_ERROR) {\n var decoder = new TextDecoder();\n state.subinvoke.error = decoder.decode(data);\n return false;\n }\n else if (status === types_1.ThreadWakeStatus.SUBINVOKE_RESULT) {\n state.subinvoke.result = data.buffer;\n return true;\n }\n }\n else {\n abort(\"__w3_subinvoke: Unknown wake status \" + status);\n return false;\n }\n return false;\n },\n // Give WASM the size of the result\n __w3_subinvoke_result_len: function () {\n if (!state.subinvoke.result) {\n abort(\"__w3_subinvoke_result_len: subinvoke.result is not set\");\n return 0;\n }\n return state.subinvoke.result.byteLength;\n },\n // Copy the subinvoke result into WASM\n __w3_subinvoke_result: function (ptr) {\n if (!state.subinvoke.result) {\n abort(\"__w3_subinvoke_result: subinvoke.result is not set\");\n return;\n }\n utils_1.writeBytes(state.subinvoke.result, memory.buffer, ptr);\n },\n // Give WASM the size of the error\n __w3_subinvoke_error_len: function () {\n if (!state.subinvoke.error) {\n abort(\"__w3_subinvoke_error_len: subinvoke.error is not set\");\n return 0;\n }\n return state.subinvoke.error.length;\n },\n // Copy the subinvoke error into WASM\n __w3_subinvoke_error: function (ptr) {\n if (!state.subinvoke.error) {\n abort(\"__w3_subinvoke_error: subinvoke.error is not set\");\n return;\n }\n utils_1.writeString(state.subinvoke.error, memory.buffer, ptr);\n },\n // Copy the invocation's method & args into WASM\n __w3_invoke_args: function (methodPtr, argsPtr) {\n if (!state.method) {\n abort(\"__w3_invoke_args: method is not set\");\n return;\n }\n if (!state.args) {\n abort(\"__w3_invoke_args: args is not set\");\n return;\n }\n utils_1.writeString(state.method, memory.buffer, methodPtr);\n utils_1.writeBytes(state.args, memory.buffer, argsPtr);\n },\n // Store the invocation's result\n __w3_invoke_result: function (ptr, len) {\n state.invoke.result = utils_1.readBytes(memory.buffer, ptr, len);\n },\n // Store the invocation's error\n __w3_invoke_error: function (ptr, len) {\n state.invoke.error = utils_1.readString(memory.buffer, ptr, len);\n },\n __w3_abort: function (msgPtr, msgLen, filePtr, fileLen, line, column) {\n var msg = utils_1.readString(memory.buffer, msgPtr, msgLen);\n var file = utils_1.readString(memory.buffer, filePtr, fileLen);\n abort(\"__w3_abort: \" + msg + \"\\nFile: \" + file + \"\\nLocation: [\" + line + \",\" + column + \"]\");\n },\n },\n env: {\n memory: memory,\n },\n}); };\n// @ts-ignore\naddEventListener(\"message\", function (input) {\n var data = input.data;\n // Store thread mutexes & ID, used for pausing the thread's execution\n state.threadMutexes = new Int32Array(data.threadMutexesBuffer, 0, types_1.maxThreads);\n state.threadId = data.threadId;\n // Store transfer buffer\n state.transfer = new Uint8Array(data.transferBuffer, 0, types_1.maxTransferBytes);\n // Store the method we're invoking\n state.method = data.method;\n if (data.input instanceof ArrayBuffer) {\n // No need to serialize\n state.args = data.input;\n }\n else {\n // We must serialize the input object into msgpack\n state.args = MsgPack.encode(data.input, { ignoreUndefined: true });\n }\n var module = new WebAssembly.Module(data.wasm);\n var memory = new WebAssembly.Memory({ initial: 1 });\n var source = new WebAssembly.Instance(module, imports(memory));\n var exports = source.exports;\n var hasExport = function (name, exports) {\n if (!exports[name]) {\n abort(\"A required export was not found: \" + name);\n return false;\n }\n return true;\n };\n // Make sure _w3_init exists\n if (!hasExport(\"_w3_init\", exports)) {\n return;\n }\n // Initialize the Web3Api module\n exports._w3_init();\n // Make sure _w3_invoke exists\n if (!hasExport(\"_w3_invoke\", exports)) {\n return;\n }\n var result = exports._w3_invoke(state.method.length, state.args.byteLength);\n if (result) {\n if (!state.invoke.result) {\n abort(\"Invoke result is missing.\");\n return;\n }\n // __w3_invoke_result has already been called\n dispatchAction({\n type: \"LogQueryResult\",\n result: state.invoke.result,\n });\n }\n else {\n if (!state.invoke.error) {\n abort(\"Invoke error is missing.\");\n return;\n }\n // __w3_invoke_error has already been called\n dispatchAction({\n type: \"LogQueryError\",\n error: state.invoke.error,\n });\n }\n});\n\n\n//# sourceURL=webpack:///./src/wasm/thread.ts?"); /***/ }), @@ -308,7 +308,7 @@ eval("\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-dis /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sleep = exports.readString = exports.readBytes = exports.writeBytes = exports.writeString = void 0;\nfunction memcpy(src, srcOffset, dst, dstOffset, length) {\n src = (src.subarray || src.slice ? src : src.buffer);\n dst = (dst.subarray || dst.slice ? dst : dst.buffer);\n src = srcOffset\n ? src.subarray\n ? src.subarray(srcOffset, length && srcOffset + length)\n : src.slice(srcOffset, length && srcOffset + length)\n : src;\n if (dst.set) {\n dst.set(src, dstOffset);\n }\n else {\n for (var i = 0; i < src.length; i++) {\n dst[i + dstOffset] = src[i];\n }\n }\n return dst;\n}\nfunction writeString(str, dst, dstOffset) {\n var encoder = new TextEncoder();\n var strBuffer = encoder.encode(str);\n var view = new Uint8Array(dst);\n return memcpy(strBuffer, 0, view, dstOffset, strBuffer.byteLength);\n}\nexports.writeString = writeString;\nfunction writeBytes(bytes, dst, dstOffset) {\n var bytesView = new Uint8Array(bytes);\n var dstView = new Uint8Array(dst);\n return memcpy(bytesView, 0, dstView, dstOffset, bytesView.byteLength);\n}\nexports.writeBytes = writeBytes;\nfunction readBytes(from, offset, length) {\n var buffer = new ArrayBuffer(length);\n writeBytes(from.slice(offset, offset + length), buffer, 0);\n return buffer;\n}\nexports.readBytes = readBytes;\nfunction readString(from, offset, length) {\n var buffer = readBytes(from, offset, length);\n var decoder = new TextDecoder();\n return decoder.decode(buffer);\n}\nexports.readString = readString;\nfunction sleep(ms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, ms); })];\n });\n });\n}\nexports.sleep = sleep;\n\n\n//# sourceURL=webpack:///./src/wasm/utils.ts?"); +eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sleep = exports.readString = exports.readBytes = exports.writeBytes = exports.writeString = void 0;\nfunction memcpy(src, srcOffset, dst, dstOffset, length) {\n src = (src.subarray || src.slice ? src : src.buffer);\n dst = (dst.subarray || dst.slice ? dst : dst.buffer);\n src = srcOffset\n ? src.subarray\n ? src.subarray(srcOffset, length && srcOffset + length)\n : src.slice(srcOffset, length && srcOffset + length)\n : src;\n if (dst.set) {\n dst.set(src, dstOffset);\n }\n else {\n for (var i = 0; i < src.length; i++) {\n dst[i + dstOffset] = src[i];\n }\n }\n return dst;\n}\nfunction writeString(str, dst, dstOffset) {\n var encoder = new TextEncoder();\n var strBuffer = encoder.encode(str);\n var view = new Uint8Array(dst);\n return memcpy(strBuffer, 0, view, dstOffset, strBuffer.byteLength);\n}\nexports.writeString = writeString;\nfunction writeBytes(bytes, dst, dstOffset) {\n var bytesView = new Uint8Array(bytes);\n var dstView = new Uint8Array(dst);\n return memcpy(bytesView, 0, dstView, dstOffset, bytesView.byteLength);\n}\nexports.writeBytes = writeBytes;\nfunction readBytes(from, offset, length) {\n var buffer = new ArrayBuffer(length);\n writeBytes(from.slice(offset, offset + length), buffer, 0);\n return buffer;\n}\nexports.readBytes = readBytes;\nfunction readString(from, offset, length) {\n var buffer = readBytes(from, offset, length);\n var decoder = new TextDecoder();\n return decoder.decode(buffer);\n}\nexports.readString = readString;\nfunction sleep(ms) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) {\n return setTimeout(function () {\n resolve();\n }, ms);\n })];\n });\n });\n}\nexports.sleep = sleep;\n\n\n//# sourceURL=webpack:///./src/wasm/utils.ts?"); /***/ }) diff --git a/packages/templates/plugin/typescript/src/manifest.ts b/packages/templates/plugin/typescript/src/manifest.ts index 27e1525e2f..ebcc8802cd 100644 --- a/packages/templates/plugin/typescript/src/manifest.ts +++ b/packages/templates/plugin/typescript/src/manifest.ts @@ -11,6 +11,5 @@ type Query { type Mutation { sampleMutation(data: Bytes!): Boolean! }`, - implemented: [], - imported: [], + implements: [], }; diff --git a/packages/test-cases/cases/apis/bigint-type/package.json b/packages/test-cases/cases/apis/bigint-type/package.json index f38ee3ac24..1aac86145a 100644 --- a/packages/test-cases/cases/apis/bigint-type/package.json +++ b/packages/test-cases/cases/apis/bigint-type/package.json @@ -2,7 +2,7 @@ "name": "test-case-bigint-type", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/apis/bytes-type/package.json b/packages/test-cases/cases/apis/bytes-type/package.json index 29a40eb3ba..46657c49b8 100644 --- a/packages/test-cases/cases/apis/bytes-type/package.json +++ b/packages/test-cases/cases/apis/bytes-type/package.json @@ -2,7 +2,7 @@ "name": "test-case-bytes-type", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/apis/enum-types/package.json b/packages/test-cases/cases/apis/enum-types/package.json index 0b670d5cdb..ed6b0f1f29 100644 --- a/packages/test-cases/cases/apis/enum-types/package.json +++ b/packages/test-cases/cases/apis/enum-types/package.json @@ -2,7 +2,7 @@ "name": "test-case-enum-types", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/apis/implementations/test-api/mutation/index.ts b/packages/test-cases/cases/apis/implementations/test-api/mutation/index.ts new file mode 100644 index 0000000000..103f9254e1 --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-api/mutation/index.ts @@ -0,0 +1,9 @@ +import { Input_mutationMethod, Input_abstractMutationMethod } from "./w3"; + +export function mutationMethod(input: Input_mutationMethod): u8 { + return input.arg; +} + +export function abstractMutationMethod(input: Input_abstractMutationMethod): u8 { + return input.arg; +} diff --git a/packages/test-cases/cases/apis/implementations/test-api/mutation/schema.graphql b/packages/test-cases/cases/apis/implementations/test-api/mutation/schema.graphql new file mode 100644 index 0000000000..33c51914d6 --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-api/mutation/schema.graphql @@ -0,0 +1,7 @@ +#import { Mutation } into Interface from "w3://ens/interface.eth" + +type Mutation implements Interface_Mutation { + mutationMethod( + arg: UInt8! + ): UInt8! +} diff --git a/packages/test-cases/cases/apis/implementations/test-api/package.json b/packages/test-cases/cases/apis/implementations/test-api/package.json new file mode 100644 index 0000000000..dcb7920151 --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-api/package.json @@ -0,0 +1,8 @@ +{ + "name": "test-case-implementation", + "private": true, + "dependencies": { + "@web3api/wasm-as": "0.0.1-prealpha.28", + "assemblyscript": "0.19.1" + } +} \ No newline at end of file diff --git a/packages/test-cases/cases/apis/implementations/test-api/query/index.ts b/packages/test-cases/cases/apis/implementations/test-api/query/index.ts new file mode 100644 index 0000000000..5a725e8abf --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-api/query/index.ts @@ -0,0 +1,9 @@ +import { Input_queryMethod, Input_abstractQueryMethod, ImplementationType } from "./w3"; + +export function queryMethod(input: Input_queryMethod): ImplementationType { + return input.arg; +} + +export function abstractQueryMethod(input: Input_abstractQueryMethod): String { + return input.arg.str; +} diff --git a/packages/test-cases/cases/apis/implementations/test-api/query/schema.graphql b/packages/test-cases/cases/apis/implementations/test-api/query/schema.graphql new file mode 100644 index 0000000000..72567bd200 --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-api/query/schema.graphql @@ -0,0 +1,11 @@ +#import { Query, InterfaceType } into Interface from "w3://ens/interface.eth" + +type Query implements Interface_Query { + queryMethod( + arg: ImplementationType! + ): ImplementationType! +} + +type ImplementationType implements Interface_InterfaceType { + str: String! +} \ No newline at end of file diff --git a/packages/test-cases/cases/apis/implementations/test-api/web3api.yaml b/packages/test-cases/cases/apis/implementations/test-api/web3api.yaml new file mode 100644 index 0000000000..991899e89d --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-api/web3api.yaml @@ -0,0 +1,16 @@ +format: 0.0.1-prealpha.1 +mutation: + schema: + file: ./mutation/schema.graphql + module: + language: wasm/assemblyscript + file: ./mutation/index.ts +query: + schema: + file: ./query/schema.graphql + module: + language: wasm/assemblyscript + file: ./query/index.ts +import_redirects: + - uri: w3://ens/interface.eth + schema: ../test-interface/build/schema.graphql \ No newline at end of file diff --git a/packages/test-cases/cases/apis/implementations/test-interface/mutation/schema.graphql b/packages/test-cases/cases/apis/implementations/test-interface/mutation/schema.graphql new file mode 100644 index 0000000000..778d28638e --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-interface/mutation/schema.graphql @@ -0,0 +1,5 @@ +type Mutation { + abstractMutationMethod( + arg: UInt8! + ): UInt8! +} diff --git a/packages/test-cases/cases/apis/implementations/test-interface/query/schema.graphql b/packages/test-cases/cases/apis/implementations/test-interface/query/schema.graphql new file mode 100644 index 0000000000..c0a4af4da9 --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-interface/query/schema.graphql @@ -0,0 +1,13 @@ +type Query { + abstractQueryMethod( + arg: Argument! + ): String! +} + +type Argument { + str: String! +} + +type InterfaceType { + uint8: UInt8! +} \ No newline at end of file diff --git a/packages/test-cases/cases/apis/implementations/test-interface/web3api.yaml b/packages/test-cases/cases/apis/implementations/test-interface/web3api.yaml new file mode 100644 index 0000000000..49b631439d --- /dev/null +++ b/packages/test-cases/cases/apis/implementations/test-interface/web3api.yaml @@ -0,0 +1,7 @@ +format: 0.0.1-prealpha.3 +interface: true +modules: + mutation: + schema: ./mutation/schema.graphql + query: + schema: ./query/schema.graphql diff --git a/packages/test-cases/cases/apis/invalid-types/package.json b/packages/test-cases/cases/apis/invalid-types/package.json index 71351fa679..0d63e92bda 100644 --- a/packages/test-cases/cases/apis/invalid-types/package.json +++ b/packages/test-cases/cases/apis/invalid-types/package.json @@ -2,7 +2,7 @@ "name": "test-case-invalid-types", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/apis/large-types/package.json b/packages/test-cases/cases/apis/large-types/package.json index ca04dbaa09..36bba1803e 100644 --- a/packages/test-cases/cases/apis/large-types/package.json +++ b/packages/test-cases/cases/apis/large-types/package.json @@ -2,7 +2,7 @@ "name": "test-case-large-types", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/apis/number-types/package.json b/packages/test-cases/cases/apis/number-types/package.json index 545453b230..e65c0a43d5 100644 --- a/packages/test-cases/cases/apis/number-types/package.json +++ b/packages/test-cases/cases/apis/number-types/package.json @@ -2,7 +2,7 @@ "name": "test-case-number-types", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/apis/object-types/package.json b/packages/test-cases/cases/apis/object-types/package.json index 70851c337d..cfb55b2d34 100644 --- a/packages/test-cases/cases/apis/object-types/package.json +++ b/packages/test-cases/cases/apis/object-types/package.json @@ -2,7 +2,7 @@ "name": "test-case-object-types", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/apis/simple-storage/package.json b/packages/test-cases/cases/apis/simple-storage/package.json index 91227ac967..dd56a33214 100644 --- a/packages/test-cases/cases/apis/simple-storage/package.json +++ b/packages/test-cases/cases/apis/simple-storage/package.json @@ -2,7 +2,7 @@ "name": "test-case-simple-storage", "private": true, "dependencies": { - "@web3api/wasm-as": "0.0.1-prealpha.25", + "@web3api/wasm-as": "0.0.1-prealpha.28", "assemblyscript": "0.19.1" } } \ No newline at end of file diff --git a/packages/test-cases/cases/compose/local-imports/output/mutation.ts b/packages/test-cases/cases/compose/local-imports/output/mutation.ts index 54bbb333db..c81ff723f3 100644 --- a/packages/test-cases/cases/compose/local-imports/output/mutation.ts +++ b/packages/test-cases/cases/compose/local-imports/output/mutation.ts @@ -9,7 +9,8 @@ import { createObjectDefinition, createEnumDefinition, TypeInfo, - createEnumPropertyDefinition + createEnumPropertyDefinition, + createObjectRef } from "@web3api/schema-parse"; export const typeInfo: TypeInfo = { @@ -171,7 +172,7 @@ export const typeInfo: TypeInfo = { name: "objectArray", type: "[ArrayObject]", required: false, - item: createObjectDefinition({ + item: createObjectRef({ name: "objectArray", type: "ArrayObject", required: false diff --git a/packages/test-cases/cases/compose/local-imports/output/query.ts b/packages/test-cases/cases/compose/local-imports/output/query.ts index 99bd8d4e1e..d183beca43 100644 --- a/packages/test-cases/cases/compose/local-imports/output/query.ts +++ b/packages/test-cases/cases/compose/local-imports/output/query.ts @@ -9,7 +9,8 @@ import { createObjectDefinition, createEnumDefinition, TypeInfo, - createEnumPropertyDefinition + createEnumPropertyDefinition, + createObjectRef } from "@web3api/schema-parse"; export const typeInfo: TypeInfo = { @@ -90,7 +91,7 @@ export const typeInfo: TypeInfo = { name: "objectArray", type: "[ArrayObject]", required: false, - item: createObjectDefinition({ + item: createObjectRef({ name: "objectArray", type: "ArrayObject", required: false diff --git a/packages/test-cases/cases/compose/local-imports/output/schema.ts b/packages/test-cases/cases/compose/local-imports/output/schema.ts index 4010fda75c..fa1be8df32 100644 --- a/packages/test-cases/cases/compose/local-imports/output/schema.ts +++ b/packages/test-cases/cases/compose/local-imports/output/schema.ts @@ -9,7 +9,8 @@ import { createObjectDefinition, createEnumDefinition, TypeInfo, - createEnumPropertyDefinition + createEnumPropertyDefinition, + createObjectRef } from "@web3api/schema-parse"; export const typeInfo: TypeInfo = { @@ -247,7 +248,7 @@ export const typeInfo: TypeInfo = { name: "objectArray", type: "[ArrayObject]", required: false, - item: createObjectDefinition({ + item: createObjectRef({ name: "objectArray", type: "ArrayObject", required: false diff --git a/packages/test-cases/cases/compose/sanity/imports-ext/interface.eth/schema.graphql b/packages/test-cases/cases/compose/sanity/imports-ext/interface.eth/schema.graphql new file mode 100644 index 0000000000..5de2655256 --- /dev/null +++ b/packages/test-cases/cases/compose/sanity/imports-ext/interface.eth/schema.graphql @@ -0,0 +1,103 @@ +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar UInt64 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Int64 +scalar Bytes +scalar BigInt + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT + +### Web3API Header END ### + +""" +Mutation comment +""" +type Mutation { + abstractMutationMethod( + arg: UInt8! + ): String! +} + +""" +Query comment +""" +type Query { +""" +abstractQueryMethod comment +""" + abstractQueryMethod( +""" +arg comment +""" + arg: QueryInterfaceArgument! + ): InterfaceObject2! +} + +""" +QueryInterfaceArgument comment +""" +type QueryInterfaceArgument implements NestedQueryInterfaceArgument { + str: String! +""" +uint8 comment +""" + uint8: UInt8! +} + +""" +NestedQueryInterfaceArgument comment +""" +type NestedQueryInterfaceArgument { + uint8: UInt8! +} + +""" +InterfaceObject1 comment +""" +type InterfaceObject1 { + str: String! +""" +InterfaceObject1_uint8 comment +""" + uint8: UInt8! +} + +""" +InterfaceObject2 comment +""" +type InterfaceObject2 implements NestedInterfaceObject { + str2: String! + object: Object +} + +""" +NestedInterfaceObject comment +""" +type NestedInterfaceObject { +""" +object comment +""" + object: Object +} + +""" +Object comment +""" +type Object { + uint8: UInt8! +} \ No newline at end of file diff --git a/packages/test-cases/cases/compose/sanity/imports-ext/test.eth/schema.graphql b/packages/test-cases/cases/compose/sanity/imports-ext/test.eth/schema.graphql index a0acfe625c..68d08be3e2 100644 --- a/packages/test-cases/cases/compose/sanity/imports-ext/test.eth/schema.graphql +++ b/packages/test-cases/cases/compose/sanity/imports-ext/test.eth/schema.graphql @@ -29,6 +29,9 @@ enum CustomEnum { BYTES } +""" +Query comment +""" type Query { method1( str: String! @@ -38,11 +41,20 @@ type Query { uArrayArray: [[UInt]]! ): String! +""" +method2 comment +""" method2( +""" +arg comment +""" arg: [String!]! ): [Int64!]! } +""" +Mutation comment +""" type Mutation @imports( types: [ "Imported_NestedObjectType", @@ -72,6 +84,9 @@ type Mutation @imports( ): Imported_NestedObjectType } +""" +CustomType comment +""" type CustomType { str: String! optStr: String @@ -105,6 +120,9 @@ type CustomType { enum: CustomEnum! optEnum: CustomEnum importedEnum: Imported_Enum! +""" +optImportedEnum comment +""" optImportedEnum: Imported_Enum } @@ -116,6 +134,9 @@ type ObjectType { prop: String! } +""" +Imported_NestedObjectType comment +""" type Imported_NestedObjectType @imported( uri: "imported.eth", namespace: "Imported", @@ -132,6 +153,9 @@ type Imported_ObjectType @imported( prop: String! } +""" +Imported_Enum comment +""" enum Imported_Enum @imported( namespace: "Imported", uri: "imported.eth", diff --git a/packages/test-cases/cases/compose/sanity/imports-local/common.graphql b/packages/test-cases/cases/compose/sanity/imports-local/common.graphql index effe4156ad..e5fe04ad93 100644 --- a/packages/test-cases/cases/compose/sanity/imports-local/common.graphql +++ b/packages/test-cases/cases/compose/sanity/imports-local/common.graphql @@ -1,13 +1,25 @@ +""" +CommonType comment +""" type CommonType { prop: UInt8! nestedObject: NestedType! +""" +objectArray comment +""" objectArray: [[ArrayObject]]! } +""" +NestedType comment +""" type NestedType { prop: String! } +""" +ArrayObject comment +""" type ArrayObject { prop: String! } diff --git a/packages/test-cases/cases/compose/sanity/input/mutation.graphql b/packages/test-cases/cases/compose/sanity/input/mutation.graphql index f2bcbb0577..2977645326 100644 --- a/packages/test-cases/cases/compose/sanity/input/mutation.graphql +++ b/packages/test-cases/cases/compose/sanity/input/mutation.graphql @@ -1,13 +1,33 @@ #import { Query, Mutation, CustomType } into Namespace from "test.eth" #import { Mutation } into JustMutation from "just.mutation.eth" +#import { InterfaceObject1, InterfaceObject2, Mutation } into Interface from "interface.eth" #import { CommonType } from "../imports-local/common.graphql" -type Mutation { +""" +Mutation comment +""" +type Mutation implements Interface_Mutation { +""" +method1 comment +""" method1( +""" +str comment +""" str: String! +""" +optStr comment +""" optStr: String u: UInt! +""" +uArrayArray comment +""" uArrayArray: [[UInt]]! +""" +implObject comment +""" + implObject: LocalImplementationObject! ): String! method2( @@ -15,8 +35,18 @@ type Mutation { ): [Int64!]! } +""" +CustomMutationType multi-line comment +line 2 +""" type CustomMutationType { +""" +str comment +""" str: String! +""" +optStr comment +""" optStr: String u: UInt! optU: UInt @@ -29,11 +59,35 @@ type CustomMutationType { uArray: [UInt!]! uOptArray: [UInt!] optStrOptArray: [String] +""" +crazyArray comment +""" crazyArray: [[[[UInt64!]]!]] commonType: CommonType! +""" +customType comment +""" customType: Namespace_CustomType! } type AnotherMutationType { prop: String } + +""" +ImplementationObject comment +""" +type ImplementationObject implements Interface_InterfaceObject1 & Interface_InterfaceObject2 { +""" +anotherProp comment +""" + anotherProp: String +} + +type LocalImplementationObject implements LocalInterfaceObject { + uint8: UInt8! +} + +type LocalInterfaceObject { + str: String! +} \ No newline at end of file diff --git a/packages/test-cases/cases/compose/sanity/input/query.graphql b/packages/test-cases/cases/compose/sanity/input/query.graphql index 402f8662e2..3682858376 100644 --- a/packages/test-cases/cases/compose/sanity/input/query.graphql +++ b/packages/test-cases/cases/compose/sanity/input/query.graphql @@ -1,19 +1,35 @@ #import { Query, CustomType } into Namespace from "test.eth" +#import { Query } into Interface from "interface.eth" #import { CommonType } from "../imports-local/common.graphql" -type Query { +""" +Query comment +""" +type Query implements Interface_Query { +""" +method1 comment +""" method1( str: String! optStr: String u: UInt! +""" +uArrayArray comment +""" uArrayArray: [[UInt]]! ): String! +""" +method2 comment +""" method2( arg: [String!]! ): [Int64!]! } +""" +CustomQueryType comment +""" type CustomQueryType { str: String! optStr: String @@ -30,6 +46,9 @@ type CustomQueryType { optStrOptArray: [String] crazyArray: [[[[UInt64!]]!]] commonType: CommonType! +""" +customType comment +""" customType: Namespace_CustomType! } diff --git a/packages/test-cases/cases/compose/sanity/output/mutation.graphql b/packages/test-cases/cases/compose/sanity/output/mutation.graphql index ea8da2590e..f1cba44ecb 100644 --- a/packages/test-cases/cases/compose/sanity/output/mutation.graphql +++ b/packages/test-cases/cases/compose/sanity/output/mutation.graphql @@ -23,7 +23,10 @@ directive @imports( ) on OBJECT ### Web3API Header END ### -type Mutation @imports( +""" +Mutation comment +""" +type Mutation implements Interface_Mutation @imports( types: [ "Namespace_Query", "Namespace_Mutation", @@ -34,23 +37,58 @@ type Mutation @imports( "Namespace_CustomType", "Namespace_CustomEnum", "Namespace_Imported_Enum", - "JustMutation_Mutation" + "JustMutation_Mutation", + "Interface_InterfaceObject1", + "Interface_InterfaceObject2", + "Interface_Object", + "Interface_NestedInterfaceObject", + "Interface_Mutation" ] ) { +""" +method1 comment +""" method1( +""" +str comment +""" str: String! +""" +optStr comment +""" optStr: String u: UInt! +""" +uArrayArray comment +""" uArrayArray: [[UInt]]! +""" +implObject comment +""" + implObject: LocalImplementationObject! ): String! method2( arg: [String!]! ): [Int64!]! + + abstractMutationMethod( + arg: UInt8! + ): String! } +""" +CustomMutationType multi-line comment +line 2 +""" type CustomMutationType { +""" +str comment +""" str: String! +""" +optStr comment +""" optStr: String u: UInt! optU: UInt @@ -63,8 +101,14 @@ type CustomMutationType { uArray: [UInt!]! uOptArray: [UInt!] optStrOptArray: [String] +""" +crazyArray comment +""" crazyArray: [[[[UInt64!]]!]] commonType: CommonType! +""" +customType comment +""" customType: Namespace_CustomType! } @@ -72,22 +116,60 @@ type AnotherMutationType { prop: String } +""" +ImplementationObject comment +""" +type ImplementationObject implements Interface_InterfaceObject1 & Interface_InterfaceObject2 { +""" +anotherProp comment +""" + anotherProp: String + str: String! + uint8: UInt8! + str2: String! + object: Interface_Object +} + +type LocalImplementationObject implements LocalInterfaceObject { + uint8: UInt8! + str: String! +} + +type LocalInterfaceObject { + str: String! +} + +""" +CommonType comment +""" type CommonType { prop: UInt8! nestedObject: NestedType! +""" +objectArray comment +""" objectArray: [[ArrayObject]]! } +""" +NestedType comment +""" type NestedType { prop: String! } +""" +ArrayObject comment +""" type ArrayObject { prop: String! } ### Imported Queries START ### +""" +Query comment +""" type Namespace_Query @imported( uri: "test.eth", namespace: "Namespace", @@ -101,11 +183,20 @@ type Namespace_Query @imported( uArrayArray: [[UInt]]! ): String! +""" +method2 comment +""" method2( +""" +arg comment +""" arg: [String!]! ): [Int64!]! } +""" +Mutation comment +""" type Namespace_Mutation @imported( uri: "test.eth", namespace: "Namespace", @@ -144,6 +235,19 @@ type JustMutation_Mutation @imported( ): [Int64!]! } +""" +Mutation comment +""" +type Interface_Mutation @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "Mutation" +) { + abstractMutationMethod( + arg: UInt8! + ): String! +} + ### Imported Queries END ### ### Imported Objects START ### @@ -164,6 +268,9 @@ type Namespace_ObjectType @imported( prop: String! } +""" +Imported_NestedObjectType comment +""" type Namespace_Imported_NestedObjectType @imported( uri: "test.eth", namespace: "Namespace", @@ -180,6 +287,9 @@ type Namespace_Imported_ObjectType @imported( prop: String! } +""" +CustomType comment +""" type Namespace_CustomType @imported( uri: "test.eth", namespace: "Namespace", @@ -217,9 +327,64 @@ type Namespace_CustomType @imported( enum: Namespace_CustomEnum! optEnum: Namespace_CustomEnum importedEnum: Namespace_Imported_Enum! +""" +optImportedEnum comment +""" optImportedEnum: Namespace_Imported_Enum } +""" +InterfaceObject1 comment +""" +type Interface_InterfaceObject1 @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject1" +) { + str: String! +""" +InterfaceObject1_uint8 comment +""" + uint8: UInt8! +} + +""" +InterfaceObject2 comment +""" +type Interface_InterfaceObject2 implements Interface_NestedInterfaceObject @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject2" +) { + str2: String! + object: Interface_Object +} + +""" +Object comment +""" +type Interface_Object @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "Object" +) { + uint8: UInt8! +} + +""" +NestedInterfaceObject comment +""" +type Interface_NestedInterfaceObject @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedInterfaceObject" +) { +""" +object comment +""" + object: Interface_Object +} + enum Namespace_CustomEnum @imported( namespace: "Namespace", uri: "test.eth", @@ -229,6 +394,9 @@ enum Namespace_CustomEnum @imported( BYTES } +""" +Imported_Enum comment +""" enum Namespace_Imported_Enum @imported( namespace: "Namespace", uri: "test.eth", diff --git a/packages/test-cases/cases/compose/sanity/output/mutation.ts b/packages/test-cases/cases/compose/sanity/output/mutation.ts index dd7948a912..7931155955 100644 --- a/packages/test-cases/cases/compose/sanity/output/mutation.ts +++ b/packages/test-cases/cases/compose/sanity/output/mutation.ts @@ -11,14 +11,16 @@ import { createEnumPropertyDefinition, createImportedQueryDefinition, createImportedObjectDefinition, - createImportedEnumDefinition + createImportedEnumDefinition, + createInterfaceImplementedDefinition, + createObjectRef } from "@web3api/schema-parse"; export const typeInfo: TypeInfo = { enumTypes: [], queryTypes: [ { - ...createQueryDefinition({ type: "Mutation" }), + ...createQueryDefinition({ type: "Mutation", comment: "Mutation comment" }), imports: [ { type: "Namespace_Query" }, { type: "Namespace_Mutation" }, @@ -30,6 +32,14 @@ export const typeInfo: TypeInfo = { { type: "Namespace_CustomEnum" }, { type: "Namespace_Imported_Enum" }, { type: "JustMutation_Mutation" }, + { type: "Interface_InterfaceObject1" }, + { type: "Interface_InterfaceObject2" }, + { type: "Interface_Object" }, + { type: "Interface_NestedInterfaceObject" }, + { type: "Interface_Mutation" }, + ], + interfaces: [ + createInterfaceImplementedDefinition({type: "Interface_Mutation"}) ], methods: [ { @@ -40,18 +50,21 @@ export const typeInfo: TypeInfo = { name: "method1", type: "String", required: true - }) + }), + comment: "method1 comment" }), arguments: [ createScalarPropertyDefinition({ name: "str", required: true, - type: "String" + type: "String", + comment: "str comment" }), createScalarPropertyDefinition({ name: "optStr", required: false, - type: "String" + type: "String", + comment: "optStr comment" }), createScalarPropertyDefinition({ name: "u", @@ -71,8 +84,15 @@ export const typeInfo: TypeInfo = { required: false, type: "UInt" }) - }) - }) + }), + comment: "uArrayArray comment" + }), + createObjectPropertyDefinition({ + name: "implObject", + required: true, + type: "LocalImplementationObject", + comment: "implObject comment" + }), ] }, { @@ -102,16 +122,34 @@ export const typeInfo: TypeInfo = { }) }) ] - } + }, + { + ...createMethodDefinition({ + type: "mutation", + name: "abstractMutationMethod", + return: createScalarPropertyDefinition({ + name: "abstractMutationMethod", + type: "String", + required: true + }) + }), + arguments: [ + createScalarPropertyDefinition({ + name: "arg", + required: true, + type: "UInt8" + }) + ] + }, ] } ], objectTypes: [ { - ...createObjectDefinition({ type: "CustomMutationType" }), + ...createObjectDefinition({ type: "CustomMutationType", comment: "CustomMutationType multi-line comment\nline 2" }), properties: [ - createScalarPropertyDefinition({ name: "str", type: "String", required: true }), - createScalarPropertyDefinition({ name: "optStr", type: "String", required: false }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true, comment: "str comment" }), + createScalarPropertyDefinition({ name: "optStr", type: "String", required: false, comment: "optStr comment" }), createScalarPropertyDefinition({ name: "u", type: "UInt", required: true }), createScalarPropertyDefinition({ name: "optU", type: "UInt", required: false }), createScalarPropertyDefinition({ name: "u8", type: "UInt8", required: true }), @@ -142,6 +180,7 @@ export const typeInfo: TypeInfo = { name: "crazyArray", type: "[[[[UInt64]]]]", required: false, + comment: "crazyArray comment", item: createArrayDefinition({ name: "crazyArray", type: "[[[UInt64]]]", @@ -168,6 +207,7 @@ export const typeInfo: TypeInfo = { name: "customType", type: "Namespace_CustomType", required: true, + comment: "customType comment" }) ], }, @@ -176,7 +216,44 @@ export const typeInfo: TypeInfo = { properties: [createScalarPropertyDefinition({ name: "prop", type: "String" })], }, { - ...createObjectDefinition({ type: "CommonType" }), + ...createObjectDefinition({ + type: "ImplementationObject", + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_InterfaceObject1" }), + createInterfaceImplementedDefinition({ type: "Interface_InterfaceObject2" }) + ], + comment: "ImplementationObject comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "anotherProp", type: "String", required: false, comment: "anotherProp comment" }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + createScalarPropertyDefinition({ name: "str2", type: "String", required: true }), + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false }), + ] + }, + { + ...createObjectDefinition({ + type: "LocalImplementationObject", + interfaces: [ + createInterfaceImplementedDefinition({ type: "LocalInterfaceObject" }), + ] + }), + properties: [ + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + ] + }, + { + ...createObjectDefinition({ + type: "LocalInterfaceObject", + }), + properties: [ + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + ] + }, + { + ...createObjectDefinition({ type: "CommonType", comment: "CommonType comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "UInt8", required: true }), createObjectPropertyDefinition({ name: "nestedObject", type: "NestedType", required: true }), @@ -184,11 +261,12 @@ export const typeInfo: TypeInfo = { name: "objectArray", type: "[[ArrayObject]]", required: true, + comment: "objectArray comment", item: createArrayDefinition({ name: "objectArray", type: "[ArrayObject]", required: false, - item: createObjectDefinition({ + item: createObjectRef({ name: "objectArray", type: "ArrayObject", required: false @@ -199,7 +277,8 @@ export const typeInfo: TypeInfo = { }, { ...createObjectDefinition({ - type: "NestedType" + type: "NestedType", + comment: "NestedType comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "String", required: true }), @@ -207,7 +286,8 @@ export const typeInfo: TypeInfo = { }, { ...createObjectDefinition({ - type: "ArrayObject" + type: "ArrayObject", + comment: "ArrayObject comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "String", required: true }), @@ -220,7 +300,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "Query", - type: "Namespace_Query" + type: "Namespace_Query", + comment: "Query comment" }), methods: [ { @@ -275,6 +356,7 @@ export const typeInfo: TypeInfo = { ...createMethodDefinition({ type: "query", name: "method2", + comment: "method2 comment", return: createArrayPropertyDefinition({ name: "method2", type: "[Int64]", @@ -291,6 +373,7 @@ export const typeInfo: TypeInfo = { name: "arg", required: true, type: "[String]", + comment: "arg comment", item: createScalarDefinition({ name: "arg", required: true, @@ -306,7 +389,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "Mutation", - type: "Namespace_Mutation" + type: "Namespace_Mutation", + comment: "Mutation comment" }), methods: [ { @@ -405,7 +489,7 @@ export const typeInfo: TypeInfo = { name: "localObjectArray", required: false, type: "[Namespace_NestedObjectType]", - item: createObjectDefinition({ + item: createObjectRef({ name: "localObjectArray", required: true, type: "Namespace_NestedObjectType" @@ -433,7 +517,7 @@ export const typeInfo: TypeInfo = { name: "localObjectArray", required: false, type: "[Namespace_Imported_NestedObjectType]", - item: createObjectDefinition({ + item: createObjectRef({ name: "localObjectArray", required: true, type: "Namespace_Imported_NestedObjectType" @@ -481,6 +565,35 @@ export const typeInfo: TypeInfo = { }, ] }, + { + ...createImportedQueryDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "Mutation", + type: "Interface_Mutation", + comment: "Mutation comment" + }), + methods: [ + { + ...createMethodDefinition({ + type: "mutation", + name: "abstractMutationMethod", + return: createScalarPropertyDefinition({ + name: "abstractMutationMethod", + type: "String", + required: true + }) + }), + arguments: [ + createScalarPropertyDefinition({ + name: "arg", + required: true, + type: "UInt8" + }), + ] + }, + ] + }, ], importedObjectTypes: [ { @@ -506,7 +619,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "Imported_NestedObjectType", - type: "Namespace_Imported_NestedObjectType" + type: "Namespace_Imported_NestedObjectType", + comment: "Imported_NestedObjectType comment" }), properties: [createObjectPropertyDefinition({ name: "nestedObject", type: "Namespace_Imported_ObjectType", required: true })], }, @@ -524,7 +638,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "CustomType", - type: "Namespace_CustomType" + type: "Namespace_CustomType", + comment: "CustomType comment" }), properties: [ createScalarPropertyDefinition({ name: "str", type: "String", required: true }), @@ -648,7 +763,7 @@ export const typeInfo: TypeInfo = { name: "optNestedObjectArray", type: "[Namespace_NestedObjectType]", required: true, - item: createObjectDefinition({ + item: createObjectRef({ name: "optNestedObjectArray", type: "Namespace_NestedObjectType", required: false @@ -663,7 +778,7 @@ export const typeInfo: TypeInfo = { name: "optImportedNestedObjectArray", type: "[Namespace_Imported_NestedObjectType]", required: true, - item: createObjectDefinition({ + item: createObjectRef({ name: "optImportedNestedObjectArray", type: "Namespace_Imported_NestedObjectType", required: false @@ -687,10 +802,64 @@ export const typeInfo: TypeInfo = { createEnumPropertyDefinition({ name: "optImportedEnum", type: "Namespace_Imported_Enum", - required: false + required: false, + comment: "optImportedEnum comment" }), ] }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject1", + type: "Interface_InterfaceObject1", + comment: "InterfaceObject1 comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true, comment: "InterfaceObject1_uint8 comment" }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject2", + type: "Interface_InterfaceObject2", + comment: "InterfaceObject2 comment" + }), + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_NestedInterfaceObject" }) + ], + properties: [ + createScalarPropertyDefinition({ name: "str2", type: "String", required: true }), + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "Object", + type: "Interface_Object", + comment: "Object comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedInterfaceObject", + type: "Interface_NestedInterfaceObject", + comment: "NestedInterfaceObject comment" + }), + properties: [ + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false, comment: "object comment" }), + ] + }, ], importedEnumTypes: [ { @@ -714,7 +883,8 @@ export const typeInfo: TypeInfo = { constants: [ "STRING", "BYTES" - ] + ], + comment: "Imported_Enum comment" }) } ], diff --git a/packages/test-cases/cases/compose/sanity/output/query.graphql b/packages/test-cases/cases/compose/sanity/output/query.graphql index 7e48e47f80..80913ffcae 100644 --- a/packages/test-cases/cases/compose/sanity/output/query.graphql +++ b/packages/test-cases/cases/compose/sanity/output/query.graphql @@ -23,7 +23,10 @@ directive @imports( ) on OBJECT ### Web3API Header END ### -type Query @imports( +""" +Query comment +""" +type Query implements Interface_Query @imports( types: [ "Namespace_Query", "Namespace_CustomType", @@ -32,21 +35,43 @@ type Query @imports( "Namespace_Imported_NestedObjectType", "Namespace_Imported_ObjectType", "Namespace_CustomEnum", - "Namespace_Imported_Enum" + "Namespace_Imported_Enum", + "Interface_Query", + "Interface_QueryInterfaceArgument", + "Interface_NestedQueryInterfaceArgument", + "Interface_InterfaceObject2", + "Interface_Object", + "Interface_NestedInterfaceObject" ] ) { +""" +method1 comment +""" method1( str: String! optStr: String u: UInt! +""" +uArrayArray comment +""" uArrayArray: [[UInt]]! ): String! +""" +method2 comment +""" method2( arg: [String!]! ): [Int64!]! + + abstractQueryMethod( + arg: Interface_QueryInterfaceArgument! + ): Interface_InterfaceObject2! } +""" +CustomQueryType comment +""" type CustomQueryType { str: String! optStr: String @@ -63,6 +88,9 @@ type CustomQueryType { optStrOptArray: [String] crazyArray: [[[[UInt64!]]!]] commonType: CommonType! +""" +customType comment +""" customType: Namespace_CustomType! } @@ -70,22 +98,37 @@ type AnotherQueryType { prop: String } +""" +CommonType comment +""" type CommonType { prop: UInt8! nestedObject: NestedType! +""" +objectArray comment +""" objectArray: [[ArrayObject]]! } +""" +NestedType comment +""" type NestedType { prop: String! } +""" +ArrayObject comment +""" type ArrayObject { prop: String! } ### Imported Queries START ### +""" +Query comment +""" type Namespace_Query @imported( uri: "test.eth", namespace: "Namespace", @@ -99,15 +142,43 @@ type Namespace_Query @imported( uArrayArray: [[UInt]]! ): String! +""" +method2 comment +""" method2( +""" +arg comment +""" arg: [String!]! ): [Int64!]! } +""" +Query comment +""" +type Interface_Query @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "Query" +) { +""" +abstractQueryMethod comment +""" + abstractQueryMethod( +""" +arg comment +""" + arg: Interface_QueryInterfaceArgument! + ): Interface_InterfaceObject2! +} + ### Imported Queries END ### ### Imported Objects START ### +""" +CustomType comment +""" type Namespace_CustomType @imported( uri: "test.eth", namespace: "Namespace", @@ -145,6 +216,9 @@ type Namespace_CustomType @imported( enum: Namespace_CustomEnum! optEnum: Namespace_CustomEnum importedEnum: Namespace_Imported_Enum! +""" +optImportedEnum comment +""" optImportedEnum: Namespace_Imported_Enum } @@ -164,6 +238,9 @@ type Namespace_NestedObjectType @imported( nestedObject: Namespace_ObjectType! } +""" +Imported_NestedObjectType comment +""" type Namespace_Imported_NestedObjectType @imported( uri: "test.eth", namespace: "Namespace", @@ -180,6 +257,69 @@ type Namespace_Imported_ObjectType @imported( prop: String! } +""" +QueryInterfaceArgument comment +""" +type Interface_QueryInterfaceArgument implements Interface_NestedQueryInterfaceArgument @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "QueryInterfaceArgument" +) { + str: String! +""" +uint8 comment +""" + uint8: UInt8! +} + +""" +NestedQueryInterfaceArgument comment +""" +type Interface_NestedQueryInterfaceArgument @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedQueryInterfaceArgument" +) { + uint8: UInt8! +} + +""" +InterfaceObject2 comment +""" +type Interface_InterfaceObject2 implements Interface_NestedInterfaceObject @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject2" +) { + str2: String! + object: Interface_Object +} + +""" +Object comment +""" +type Interface_Object @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "Object" +) { + uint8: UInt8! +} + +""" +NestedInterfaceObject comment +""" +type Interface_NestedInterfaceObject @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedInterfaceObject" +) { +""" +object comment +""" + object: Interface_Object +} + enum Namespace_CustomEnum @imported( namespace: "Namespace", uri: "test.eth", @@ -189,6 +329,9 @@ enum Namespace_CustomEnum @imported( BYTES } +""" +Imported_Enum comment +""" enum Namespace_Imported_Enum @imported( namespace: "Namespace", uri: "test.eth", diff --git a/packages/test-cases/cases/compose/sanity/output/query.ts b/packages/test-cases/cases/compose/sanity/output/query.ts index 9f91dbfe63..46772118f1 100644 --- a/packages/test-cases/cases/compose/sanity/output/query.ts +++ b/packages/test-cases/cases/compose/sanity/output/query.ts @@ -11,13 +11,15 @@ import { createEnumPropertyDefinition, createImportedQueryDefinition, createImportedObjectDefinition, - createImportedEnumDefinition + createImportedEnumDefinition, + createInterfaceImplementedDefinition, + createObjectRef } from "@web3api/schema-parse"; export const typeInfo: TypeInfo = { objectTypes: [ { - ...createObjectDefinition({ type: "CustomQueryType" }), + ...createObjectDefinition({ type: "CustomQueryType", comment: "CustomQueryType comment" }), properties: [ createScalarPropertyDefinition({ name: "str", type: "String", required: true }), createScalarPropertyDefinition({ name: "optStr", type: "String", required: false }), @@ -77,6 +79,7 @@ export const typeInfo: TypeInfo = { name: "customType", type: "Namespace_CustomType", required: true, + comment: "customType comment" }) ], }, @@ -85,7 +88,7 @@ export const typeInfo: TypeInfo = { properties: [createScalarPropertyDefinition({ name: "prop", type: "String" })], }, { - ...createObjectDefinition({ type: "CommonType" }), + ...createObjectDefinition({ type: "CommonType", comment: "CommonType comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "UInt8", required: true }), createObjectPropertyDefinition({ name: "nestedObject", type: "NestedType", required: true }), @@ -93,11 +96,12 @@ export const typeInfo: TypeInfo = { name: "objectArray", type: "[[ArrayObject]]", required: true, + comment: "objectArray comment", item: createArrayDefinition({ name: "objectArray", type: "[ArrayObject]", required: false, - item: createObjectDefinition({ + item: createObjectRef({ name: "objectArray", type: "ArrayObject", required: false @@ -108,7 +112,8 @@ export const typeInfo: TypeInfo = { }, { ...createObjectDefinition({ - type: "NestedType" + type: "NestedType", + comment: "NestedType comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "String", required: true }), @@ -116,7 +121,8 @@ export const typeInfo: TypeInfo = { }, { ...createObjectDefinition({ - type: "ArrayObject" + type: "ArrayObject", + comment: "ArrayObject comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "String", required: true }), @@ -125,7 +131,7 @@ export const typeInfo: TypeInfo = { ], queryTypes: [ { - ...createQueryDefinition({ type: "Query" }), + ...createQueryDefinition({ type: "Query", comment: "Query comment" }), imports: [ { type: "Namespace_Query" }, { type: "Namespace_CustomType" }, @@ -135,6 +141,15 @@ export const typeInfo: TypeInfo = { { type: "Namespace_Imported_ObjectType" }, { type: "Namespace_CustomEnum" }, { type: "Namespace_Imported_Enum" }, + { type: "Interface_Query" }, + { type: "Interface_QueryInterfaceArgument" }, + { type: "Interface_NestedQueryInterfaceArgument" }, + { type: "Interface_InterfaceObject2" }, + { type: "Interface_Object" }, + { type: "Interface_NestedInterfaceObject" }, + ], + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_Query" }), ], methods: [ { @@ -145,7 +160,8 @@ export const typeInfo: TypeInfo = { name: "method1", type: "String", required: true - }) + }), + comment: "method1 comment" }), arguments: [ createScalarPropertyDefinition({ @@ -167,6 +183,7 @@ export const typeInfo: TypeInfo = { name: "uArrayArray", required: true, type: "[[UInt]]", + comment: "uArrayArray comment", item: createArrayDefinition({ name: "uArrayArray", required: false, @@ -184,6 +201,7 @@ export const typeInfo: TypeInfo = { ...createMethodDefinition({ type: "query", name: "method2", + comment: "method2 comment", return: createArrayPropertyDefinition({ name: "method2", type: "[Int64]", @@ -207,6 +225,24 @@ export const typeInfo: TypeInfo = { }) }) ] + }, + { + ...createMethodDefinition({ + type: "query", + name: "abstractQueryMethod", + return: createObjectPropertyDefinition({ + name: "abstractQueryMethod", + type: "Interface_InterfaceObject2", + required: true + }) + }), + arguments: [ + createObjectPropertyDefinition({ + name: "arg", + required: true, + type: "Interface_QueryInterfaceArgument" + }) + ] } ] } @@ -218,7 +254,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "CustomType", - type: "Namespace_CustomType" + type: "Namespace_CustomType", + comment: "CustomType comment" }), properties: [ createScalarPropertyDefinition({ name: "str", type: "String", required: true }), @@ -342,7 +379,7 @@ export const typeInfo: TypeInfo = { name: "optNestedObjectArray", type: "[Namespace_NestedObjectType]", required: true, - item: createObjectDefinition({ + item: createObjectRef({ name: "optNestedObjectArray", type: "Namespace_NestedObjectType", required: false @@ -357,7 +394,7 @@ export const typeInfo: TypeInfo = { name: "optImportedNestedObjectArray", type: "[Namespace_Imported_NestedObjectType]", required: true, - item: createObjectDefinition({ + item: createObjectRef({ name: "optImportedNestedObjectArray", type: "Namespace_Imported_NestedObjectType", required: false @@ -381,7 +418,8 @@ export const typeInfo: TypeInfo = { createEnumPropertyDefinition({ name: "optImportedEnum", type: "Namespace_Imported_Enum", - required: false + required: false, + comment: "optImportedEnum comment" }), ] }, @@ -408,7 +446,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "Imported_NestedObjectType", - type: "Namespace_Imported_NestedObjectType" + type: "Namespace_Imported_NestedObjectType", + comment: "Imported_NestedObjectType comment" }), properties: [createObjectPropertyDefinition({ name: "nestedObject", type: "Namespace_Imported_ObjectType", required: true })], }, @@ -421,6 +460,74 @@ export const typeInfo: TypeInfo = { }), properties: [createScalarPropertyDefinition({ name: "prop", type: "String", required: true })], }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "QueryInterfaceArgument", + type: "Interface_QueryInterfaceArgument", + comment: "QueryInterfaceArgument comment" + }), + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_NestedQueryInterfaceArgument" }) + ], + properties: [ + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true, comment: "uint8 comment" }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedQueryInterfaceArgument", + type: "Interface_NestedQueryInterfaceArgument", + comment: "NestedQueryInterfaceArgument comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject2", + type: "Interface_InterfaceObject2", + comment: "InterfaceObject2 comment" + }), + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_NestedInterfaceObject" }) + ], + properties: [ + createScalarPropertyDefinition({ name: "str2", type: "String", required: true }), + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "Object", + type: "Interface_Object", + comment: "Object comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedInterfaceObject", + type: "Interface_NestedInterfaceObject", + comment: "NestedInterfaceObject comment" + }), + properties: [ + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false, comment: "object comment" }), + ] + }, ], importedQueryTypes: [ { @@ -428,7 +535,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "Query", - type: "Namespace_Query" + type: "Namespace_Query", + comment: "Query comment" }), methods: [ { @@ -483,6 +591,7 @@ export const typeInfo: TypeInfo = { ...createMethodDefinition({ type: "query", name: "method2", + comment: "method2 comment", return: createArrayPropertyDefinition({ name: "method2", type: "[Int64]", @@ -499,6 +608,7 @@ export const typeInfo: TypeInfo = { name: "arg", required: true, type: "[String]", + comment: "arg comment", item: createScalarDefinition({ name: "arg", required: true, @@ -506,9 +616,40 @@ export const typeInfo: TypeInfo = { }) }) ] - } + }, + ], + }, + { + ...createImportedQueryDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "Query", + type: "Interface_Query", + comment: "Query comment" + }), + methods: [ + { + ...createMethodDefinition({ + type: "query", + name: "abstractQueryMethod", + comment: "abstractQueryMethod comment", + return: createObjectPropertyDefinition({ + name: "abstractQueryMethod", + type: "Interface_InterfaceObject2", + required: true + }) + }), + arguments: [ + createObjectPropertyDefinition({ + name: "arg", + required: true, + type: "Interface_QueryInterfaceArgument", + comment: "arg comment" + }), + ] + }, ] - } + }, ], importedEnumTypes: [ { @@ -532,7 +673,8 @@ export const typeInfo: TypeInfo = { constants: [ "STRING", "BYTES" - ] + ], + comment: "Imported_Enum comment" }) } ], diff --git a/packages/test-cases/cases/compose/sanity/output/schema.graphql b/packages/test-cases/cases/compose/sanity/output/schema.graphql index c31c41d2da..87169827e4 100644 --- a/packages/test-cases/cases/compose/sanity/output/schema.graphql +++ b/packages/test-cases/cases/compose/sanity/output/schema.graphql @@ -23,7 +23,10 @@ directive @imports( ) on OBJECT ### Web3API Header END ### -type Query @imports( +""" +Query comment +""" +type Query implements Interface_Query @imports( types: [ "Namespace_Query", "Namespace_CustomType", @@ -32,22 +35,44 @@ type Query @imports( "Namespace_Imported_NestedObjectType", "Namespace_Imported_ObjectType", "Namespace_CustomEnum", - "Namespace_Imported_Enum" + "Namespace_Imported_Enum", + "Interface_Query", + "Interface_QueryInterfaceArgument", + "Interface_NestedQueryInterfaceArgument", + "Interface_InterfaceObject2", + "Interface_Object", + "Interface_NestedInterfaceObject" ] ) { +""" +method1 comment +""" method1( str: String! optStr: String u: UInt! +""" +uArrayArray comment +""" uArrayArray: [[UInt]]! ): String! +""" +method2 comment +""" method2( arg: [String!]! ): [Int64!]! + + abstractQueryMethod( + arg: Interface_QueryInterfaceArgument! + ): Interface_InterfaceObject2! } -type Mutation @imports( +""" +Mutation comment +""" +type Mutation implements Interface_Mutation @imports( types: [ "Namespace_Query", "Namespace_Mutation", @@ -58,21 +83,49 @@ type Mutation @imports( "Namespace_CustomType", "Namespace_CustomEnum", "Namespace_Imported_Enum", - "JustMutation_Mutation" + "JustMutation_Mutation", + "Interface_InterfaceObject1", + "Interface_InterfaceObject2", + "Interface_Object", + "Interface_NestedInterfaceObject", + "Interface_Mutation" ] ) { +""" +method1 comment +""" method1( +""" +str comment +""" str: String! +""" +optStr comment +""" optStr: String u: UInt! +""" +uArrayArray comment +""" uArrayArray: [[UInt]]! +""" +implObject comment +""" + implObject: LocalImplementationObject! ): String! method2( arg: [String!]! ): [Int64!]! + + abstractMutationMethod( + arg: UInt8! + ): String! } +""" +CustomQueryType comment +""" type CustomQueryType { str: String! optStr: String @@ -89,6 +142,9 @@ type CustomQueryType { optStrOptArray: [String] crazyArray: [[[[UInt64!]]!]] commonType: CommonType! +""" +customType comment +""" customType: Namespace_CustomType! } @@ -96,22 +152,44 @@ type AnotherQueryType { prop: String } +""" +CommonType comment +""" type CommonType { prop: UInt8! nestedObject: NestedType! +""" +objectArray comment +""" objectArray: [[ArrayObject]]! } +""" +NestedType comment +""" type NestedType { prop: String! } +""" +ArrayObject comment +""" type ArrayObject { prop: String! } +""" +CustomMutationType multi-line comment +line 2 +""" type CustomMutationType { +""" +str comment +""" str: String! +""" +optStr comment +""" optStr: String u: UInt! optU: UInt @@ -124,8 +202,14 @@ type CustomMutationType { uArray: [UInt!]! uOptArray: [UInt!] optStrOptArray: [String] +""" +crazyArray comment +""" crazyArray: [[[[UInt64!]]!]] commonType: CommonType! +""" +customType comment +""" customType: Namespace_CustomType! } @@ -133,8 +217,34 @@ type AnotherMutationType { prop: String } +""" +ImplementationObject comment +""" +type ImplementationObject implements Interface_InterfaceObject1 & Interface_InterfaceObject2 { +""" +anotherProp comment +""" + anotherProp: String + str: String! + uint8: UInt8! + str2: String! + object: Interface_Object +} + +type LocalImplementationObject implements LocalInterfaceObject { + uint8: UInt8! + str: String! +} + +type LocalInterfaceObject { + str: String! +} + ### Imported Queries START ### +""" +Query comment +""" type Namespace_Query @imported( uri: "test.eth", namespace: "Namespace", @@ -148,11 +258,39 @@ type Namespace_Query @imported( uArrayArray: [[UInt]]! ): String! +""" +method2 comment +""" method2( +""" +arg comment +""" arg: [String!]! ): [Int64!]! } +""" +Query comment +""" +type Interface_Query @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "Query" +) { +""" +abstractQueryMethod comment +""" + abstractQueryMethod( +""" +arg comment +""" + arg: Interface_QueryInterfaceArgument! + ): Interface_InterfaceObject2! +} + +""" +Mutation comment +""" type Namespace_Mutation @imported( uri: "test.eth", namespace: "Namespace", @@ -191,10 +329,26 @@ type JustMutation_Mutation @imported( ): [Int64!]! } +""" +Mutation comment +""" +type Interface_Mutation @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "Mutation" +) { + abstractMutationMethod( + arg: UInt8! + ): String! +} + ### Imported Queries END ### ### Imported Objects START ### +""" +CustomType comment +""" type Namespace_CustomType @imported( uri: "test.eth", namespace: "Namespace", @@ -232,6 +386,9 @@ type Namespace_CustomType @imported( enum: Namespace_CustomEnum! optEnum: Namespace_CustomEnum importedEnum: Namespace_Imported_Enum! +""" +optImportedEnum comment +""" optImportedEnum: Namespace_Imported_Enum } @@ -251,6 +408,9 @@ type Namespace_NestedObjectType @imported( nestedObject: Namespace_ObjectType! } +""" +Imported_NestedObjectType comment +""" type Namespace_Imported_NestedObjectType @imported( uri: "test.eth", namespace: "Namespace", @@ -267,6 +427,84 @@ type Namespace_Imported_ObjectType @imported( prop: String! } +""" +QueryInterfaceArgument comment +""" +type Interface_QueryInterfaceArgument implements Interface_NestedQueryInterfaceArgument @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "QueryInterfaceArgument" +) { + str: String! +""" +uint8 comment +""" + uint8: UInt8! +} + +""" +NestedQueryInterfaceArgument comment +""" +type Interface_NestedQueryInterfaceArgument @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedQueryInterfaceArgument" +) { + uint8: UInt8! +} + +""" +InterfaceObject2 comment +""" +type Interface_InterfaceObject2 implements Interface_NestedInterfaceObject @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject2" +) { + str2: String! + object: Interface_Object +} + +""" +Object comment +""" +type Interface_Object @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "Object" +) { + uint8: UInt8! +} + +""" +NestedInterfaceObject comment +""" +type Interface_NestedInterfaceObject @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedInterfaceObject" +) { +""" +object comment +""" + object: Interface_Object +} + +""" +InterfaceObject1 comment +""" +type Interface_InterfaceObject1 @imported( + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject1" +) { + str: String! +""" +InterfaceObject1_uint8 comment +""" + uint8: UInt8! +} + enum Namespace_CustomEnum @imported( namespace: "Namespace", uri: "test.eth", @@ -276,6 +514,9 @@ enum Namespace_CustomEnum @imported( BYTES } +""" +Imported_Enum comment +""" enum Namespace_Imported_Enum @imported( namespace: "Namespace", uri: "test.eth", diff --git a/packages/test-cases/cases/compose/sanity/output/schema.ts b/packages/test-cases/cases/compose/sanity/output/schema.ts index d3e0967980..512d8afa42 100644 --- a/packages/test-cases/cases/compose/sanity/output/schema.ts +++ b/packages/test-cases/cases/compose/sanity/output/schema.ts @@ -11,14 +11,16 @@ import { createEnumPropertyDefinition, createImportedQueryDefinition, createImportedObjectDefinition, - createImportedEnumDefinition + createImportedEnumDefinition, + createInterfaceImplementedDefinition, + createObjectRef } from "@web3api/schema-parse"; export const typeInfo: TypeInfo = { enumTypes: [], queryTypes: [ { - ...createQueryDefinition({ type: "Query" }), + ...createQueryDefinition({ type: "Query", comment: "Query comment" }), imports: [ { type: "Namespace_Query" }, { type: "Namespace_CustomType" }, @@ -28,12 +30,22 @@ export const typeInfo: TypeInfo = { { type: "Namespace_Imported_ObjectType" }, { type: "Namespace_CustomEnum" }, { type: "Namespace_Imported_Enum" }, + { type: "Interface_Query" }, + { type: "Interface_QueryInterfaceArgument" }, + { type: "Interface_NestedQueryInterfaceArgument" }, + { type: "Interface_InterfaceObject2" }, + { type: "Interface_Object" }, + { type: "Interface_NestedInterfaceObject" }, + ], + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_Query" }) ], methods: [ { ...createMethodDefinition({ type: "query", name: "method1", + comment: "method1 comment", return: createScalarPropertyDefinition({ name: "method1", type: "String", @@ -60,6 +72,7 @@ export const typeInfo: TypeInfo = { name: "uArrayArray", required: true, type: "[[UInt]]", + comment: "uArrayArray comment", item: createArrayDefinition({ name: "uArrayArray", required: false, @@ -77,6 +90,7 @@ export const typeInfo: TypeInfo = { ...createMethodDefinition({ type: "query", name: "method2", + comment: "method2 comment", return: createArrayPropertyDefinition({ name: "method2", type: "[Int64]", @@ -100,11 +114,29 @@ export const typeInfo: TypeInfo = { }) }) ] + }, + { + ...createMethodDefinition({ + type: "query", + name: "abstractQueryMethod", + return: createObjectPropertyDefinition({ + name: "abstractQueryMethod", + type: "Interface_InterfaceObject2", + required: true + }) + }), + arguments: [ + createObjectPropertyDefinition({ + name: "arg", + required: true, + type: "Interface_QueryInterfaceArgument" + }) + ] } ] }, { - ...createQueryDefinition({ type: "Mutation" }), + ...createQueryDefinition({ type: "Mutation", comment: "Mutation comment" }), imports: [ { type: "Namespace_Query" }, { type: "Namespace_Mutation" }, @@ -116,12 +148,18 @@ export const typeInfo: TypeInfo = { { type: "Namespace_CustomEnum" }, { type: "Namespace_Imported_Enum" }, { type: "JustMutation_Mutation" }, + { type: "Interface_InterfaceObject1" }, + { type: "Interface_InterfaceObject2" }, + { type: "Interface_Object" }, + { type: "Interface_NestedInterfaceObject" }, + { type: "Interface_Mutation" }, ], methods: [ { ...createMethodDefinition({ type: "mutation", name: "method1", + comment: "method1 comment", return: createScalarPropertyDefinition({ name: "method1", type: "String", @@ -132,12 +170,14 @@ export const typeInfo: TypeInfo = { createScalarPropertyDefinition({ name: "str", required: true, - type: "String" + type: "String", + comment: "str comment" }), createScalarPropertyDefinition({ name: "optStr", required: false, - type: "String" + type: "String", + comment: "optStr comment" }), createScalarPropertyDefinition({ name: "u", @@ -148,6 +188,7 @@ export const typeInfo: TypeInfo = { name: "uArrayArray", required: true, type: "[[UInt]]", + comment: "uArrayArray comment", item: createArrayDefinition({ name: "uArrayArray", required: false, @@ -158,7 +199,13 @@ export const typeInfo: TypeInfo = { type: "UInt" }) }) - }) + }), + createObjectPropertyDefinition({ + name: "implObject", + required: true, + type: "LocalImplementationObject", + comment: "implObject comment" + }), ] }, { @@ -188,13 +235,34 @@ export const typeInfo: TypeInfo = { }) }) ] - } + }, + { + ...createMethodDefinition({ + type: "mutation", + name: "abstractMutationMethod", + return: createScalarPropertyDefinition({ + name: "abstractMutationMethod", + type: "String", + required: true + }) + }), + arguments: [ + createScalarPropertyDefinition({ + name: "arg", + required: true, + type: "UInt8" + }) + ] + }, + ], + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_Mutation" }) ] } ], objectTypes: [ { - ...createObjectDefinition({ type: "CustomQueryType" }), + ...createObjectDefinition({ type: "CustomQueryType", comment: "CustomQueryType comment" }), properties: [ createScalarPropertyDefinition({ name: "str", type: "String", required: true }), createScalarPropertyDefinition({ name: "optStr", type: "String", required: false }), @@ -254,6 +322,7 @@ export const typeInfo: TypeInfo = { name: "customType", type: "Namespace_CustomType", required: true, + comment: "customType comment" }) ], }, @@ -262,7 +331,7 @@ export const typeInfo: TypeInfo = { properties: [createScalarPropertyDefinition({ name: "prop", type: "String" })], }, { - ...createObjectDefinition({ type: "CommonType" }), + ...createObjectDefinition({ type: "CommonType", comment: "CommonType comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "UInt8", required: true }), createObjectPropertyDefinition({ name: "nestedObject", type: "NestedType", required: true }), @@ -270,11 +339,12 @@ export const typeInfo: TypeInfo = { name: "objectArray", type: "[[ArrayObject]]", required: true, + comment: "objectArray comment", item: createArrayDefinition({ name: "objectArray", type: "[ArrayObject]", required: false, - item: createObjectDefinition({ + item: createObjectRef({ name: "objectArray", type: "ArrayObject", required: false @@ -285,7 +355,8 @@ export const typeInfo: TypeInfo = { }, { ...createObjectDefinition({ - type: "NestedType" + type: "NestedType", + comment: "NestedType comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "String", required: true }), @@ -293,17 +364,18 @@ export const typeInfo: TypeInfo = { }, { ...createObjectDefinition({ - type: "ArrayObject" + type: "ArrayObject", + comment: "ArrayObject comment" }), properties: [ createScalarPropertyDefinition({ name: "prop", type: "String", required: true }), ], }, { - ...createObjectDefinition({ type: "CustomMutationType" }), + ...createObjectDefinition({ type: "CustomMutationType", comment: "CustomMutationType multi-line comment\nline 2" }), properties: [ - createScalarPropertyDefinition({ name: "str", type: "String", required: true }), - createScalarPropertyDefinition({ name: "optStr", type: "String", required: false }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true, comment: "str comment" }), + createScalarPropertyDefinition({ name: "optStr", type: "String", required: false, comment: "optStr comment" }), createScalarPropertyDefinition({ name: "u", type: "UInt", required: true }), createScalarPropertyDefinition({ name: "optU", type: "UInt", required: false }), createScalarPropertyDefinition({ name: "u8", type: "UInt8", required: true }), @@ -334,6 +406,7 @@ export const typeInfo: TypeInfo = { name: "crazyArray", type: "[[[[UInt64]]]]", required: false, + comment: "crazyArray comment", item: createArrayDefinition({ name: "crazyArray", type: "[[[UInt64]]]", @@ -360,6 +433,7 @@ export const typeInfo: TypeInfo = { name: "customType", type: "Namespace_CustomType", required: true, + comment: "customType comment" }) ], }, @@ -367,6 +441,43 @@ export const typeInfo: TypeInfo = { ...createObjectDefinition({ type: "AnotherMutationType" }), properties: [createScalarPropertyDefinition({ name: "prop", type: "String" })], }, + { + ...createObjectDefinition({ + type: "ImplementationObject", + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_InterfaceObject1" }), + createInterfaceImplementedDefinition({ type: "Interface_InterfaceObject2" }) + ], + comment: "ImplementationObject comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "anotherProp", type: "String", required: false, comment: "anotherProp comment" }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + createScalarPropertyDefinition({ name: "str2", type: "String", required: true }), + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false }), + ] + }, + { + ...createObjectDefinition({ + type: "LocalImplementationObject", + interfaces: [ + createInterfaceImplementedDefinition({ type: "LocalInterfaceObject" }), + ] + }), + properties: [ + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + ] + }, + { + ...createObjectDefinition({ + type: "LocalInterfaceObject", + }), + properties: [ + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + ] + }, ], importedQueryTypes: [ { @@ -374,7 +485,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "Query", - type: "Namespace_Query" + type: "Namespace_Query", + comment: "Query comment" }), methods: [ { @@ -429,6 +541,7 @@ export const typeInfo: TypeInfo = { ...createMethodDefinition({ type: "query", name: "method2", + comment: "method2 comment", return: createArrayPropertyDefinition({ name: "method2", type: "[Int64]", @@ -445,6 +558,7 @@ export const typeInfo: TypeInfo = { name: "arg", required: true, type: "[String]", + comment: "arg comment", item: createScalarDefinition({ name: "arg", required: true, @@ -455,12 +569,44 @@ export const typeInfo: TypeInfo = { } ] }, + { + ...createImportedQueryDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "Query", + type: "Interface_Query", + comment: "Query comment" + }), + methods: [ + { + ...createMethodDefinition({ + type: "query", + name: "abstractQueryMethod", + comment: "abstractQueryMethod comment", + return: createObjectPropertyDefinition({ + name: "abstractQueryMethod", + type: "Interface_InterfaceObject2", + required: true + }) + }), + arguments: [ + createObjectPropertyDefinition({ + name: "arg", + required: true, + type: "Interface_QueryInterfaceArgument", + comment: "arg comment" + }), + ] + }, + ] + }, { ...createImportedQueryDefinition({ uri: "test.eth", namespace: "Namespace", nativeType: "Mutation", - type: "Namespace_Mutation" + type: "Namespace_Mutation", + comment: "Mutation comment" }), methods: [ { @@ -559,7 +705,7 @@ export const typeInfo: TypeInfo = { name: "localObjectArray", required: false, type: "[Namespace_NestedObjectType]", - item: createObjectDefinition({ + item: createObjectRef({ name: "localObjectArray", required: true, type: "Namespace_NestedObjectType" @@ -587,7 +733,7 @@ export const typeInfo: TypeInfo = { name: "localObjectArray", required: false, type: "[Namespace_Imported_NestedObjectType]", - item: createObjectDefinition({ + item: createObjectRef({ name: "localObjectArray", required: true, type: "Namespace_Imported_NestedObjectType" @@ -635,6 +781,35 @@ export const typeInfo: TypeInfo = { }, ] }, + { + ...createImportedQueryDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "Mutation", + type: "Interface_Mutation", + comment: "Mutation comment" + }), + methods: [ + { + ...createMethodDefinition({ + type: "mutation", + name: "abstractMutationMethod", + return: createScalarPropertyDefinition({ + name: "abstractMutationMethod", + type: "String", + required: true + }) + }), + arguments: [ + createScalarPropertyDefinition({ + name: "arg", + required: true, + type: "UInt8" + }), + ] + }, + ] + }, ], importedObjectTypes: [ { @@ -642,7 +817,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "CustomType", - type: "Namespace_CustomType" + type: "Namespace_CustomType", + comment: "CustomType comment" }), properties: [ createScalarPropertyDefinition({ name: "str", type: "String", required: true }), @@ -766,7 +942,7 @@ export const typeInfo: TypeInfo = { name: "optNestedObjectArray", type: "[Namespace_NestedObjectType]", required: true, - item: createObjectDefinition({ + item: createObjectRef({ name: "optNestedObjectArray", type: "Namespace_NestedObjectType", required: false @@ -781,7 +957,7 @@ export const typeInfo: TypeInfo = { name: "optImportedNestedObjectArray", type: "[Namespace_Imported_NestedObjectType]", required: true, - item: createObjectDefinition({ + item: createObjectRef({ name: "optImportedNestedObjectArray", type: "Namespace_Imported_NestedObjectType", required: false @@ -805,7 +981,8 @@ export const typeInfo: TypeInfo = { createEnumPropertyDefinition({ name: "optImportedEnum", type: "Namespace_Imported_Enum", - required: false + required: false, + comment: "optImportedEnum comment" }), ] }, @@ -832,7 +1009,8 @@ export const typeInfo: TypeInfo = { uri: "test.eth", namespace: "Namespace", nativeType: "Imported_NestedObjectType", - type: "Namespace_Imported_NestedObjectType" + type: "Namespace_Imported_NestedObjectType", + comment: "Imported_NestedObjectType comment" }), properties: [createObjectPropertyDefinition({ name: "nestedObject", type: "Namespace_Imported_ObjectType", required: true })], }, @@ -845,6 +1023,87 @@ export const typeInfo: TypeInfo = { }), properties: [createScalarPropertyDefinition({ name: "prop", type: "String", required: true })], }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "QueryInterfaceArgument", + type: "Interface_QueryInterfaceArgument", + comment: "QueryInterfaceArgument comment" + }), + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_NestedQueryInterfaceArgument" }) + ], + properties: [ + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true , comment: "uint8 comment"}), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedQueryInterfaceArgument", + type: "Interface_NestedQueryInterfaceArgument", + comment: "NestedQueryInterfaceArgument comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject2", + type: "Interface_InterfaceObject2", + comment: "InterfaceObject2 comment" + }), + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_NestedInterfaceObject" }) + ], + properties: [ + createScalarPropertyDefinition({ name: "str2", type: "String", required: true }), + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "Object", + type: "Interface_Object", + comment: "Object comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "NestedInterfaceObject", + type: "Interface_NestedInterfaceObject", + comment: "NestedInterfaceObject comment" + }), + properties: [ + createObjectPropertyDefinition({ name: "object", type: "Interface_Object", required: false, comment: "object comment" }), + ] + }, + { + ...createImportedObjectDefinition({ + uri: "interface.eth", + namespace: "Interface", + nativeType: "InterfaceObject1", + type: "Interface_InterfaceObject1", + comment: "InterfaceObject1 comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true, comment: "InterfaceObject1_uint8 comment"}), + ] + }, ], importedEnumTypes: [ { @@ -868,7 +1127,8 @@ export const typeInfo: TypeInfo = { constants: [ "STRING", "BYTES" - ] + ], + comment: "Imported_Enum comment" }) } ], diff --git a/packages/test-cases/cases/parse/sanity/input.graphql b/packages/test-cases/cases/parse/sanity/input.graphql index a11f8a124f..bb73a3c73d 100644 --- a/packages/test-cases/cases/parse/sanity/input.graphql +++ b/packages/test-cases/cases/parse/sanity/input.graphql @@ -21,13 +21,26 @@ directive @imports( types: [String!]! ) on OBJECT +""" +CustomEnum comment +""" enum CustomEnum { TEXT BINARY } +""" +CustomType multi-line comment +line 2 +""" type CustomType { +""" +str comment +""" str: String! +""" +optStr comment +""" optStr: String u: UInt! optU: UInt @@ -61,43 +74,105 @@ type CustomType { optEnumArray: [CustomEnum] } +""" +AnotherType comment +""" type AnotherType { +""" +prop comment +""" prop: String } +""" +UserObject comment +""" type UserObject { fieldA: String fieldB: Int! } -type Query @imports( - types: [ "TestImport_Query" ] +""" +ImplementationObject comment +""" +type ImplementationObject implements Interface_Object & Interface_Object2 { +""" +anotherProp comment +""" + anotherProp: String + str: String! + uint8: UInt8! + str2: String! +} + +""" +Query comment +""" +type Query implements Interface_Query @imports( + types: [ "TestImport_Query", "Interface_Query" ] ) { +""" +queryMethod comment +""" queryMethod( +""" +arg comment +""" arg: String! ): [Int]! - +""" +userObjectMethod comment +""" userObjectMethod( +""" +userObject comment +""" userObject: UserObject +""" +arrayObject comment +""" arrayObject: [UserObject!]! ): UserObject! - +""" +enumMethod comment +""" enumMethod( +""" +enum comment +""" enum: CustomEnum, +""" +arrayEnum comment +""" arrayEnum: [CustomEnum!]! ): CustomEnum! +""" +abstractMethod comment +""" + abstractMethod( + arg: UInt8! + ): String! } +""" +TestImport_Query comment +""" type TestImport_Query @imported( uri: "testimport.uri.eth", namespace: "TestImport", nativeType: "Query" ) { +""" +importedMethod comment +""" importedMethod( str: String! optStr: String u: UInt! optU: UInt +""" +uArrayArray comment +""" uArrayArray: [[UInt]]! ): String! @@ -115,34 +190,61 @@ type TestImport_Query @imported( ): TestImport_Enum! } +""" +TestImport_Mutation comment +""" type TestImport_Mutation @imported( uri: "testimport.uri.eth", namespace: "TestImport", nativeType: "Mutation" ) { +""" +importedMethod comment +""" importedMethod( +""" +str comment +""" str: String! ): String! } +""" +TestImport_Object comment +""" type TestImport_Object @imported( uri: "testimport.uri.eth", namespace: "TestImport", nativeType: "Object" ) { +""" +prop comment +""" prop: String! +""" +nested comment +""" nested: TestImport_NestedObject! } +""" +TestImport_NestedObject comment +""" type TestImport_NestedObject @imported( uri: "testimport.uri.eth", namespace: "TestImport", nativeType: "NestedObject" ) { +""" +foo comment +""" foo: [String!]! circular: TestImport_Object } +""" +TestImport_Enum comment +""" enum TestImport_Enum @imported( namespace: "TestImport", uri: "testimport.uri.eth", @@ -151,3 +253,42 @@ enum TestImport_Enum @imported( TEXT BYTES } + +""" +Interface_Query comment +""" +type Interface_Query @imported( + uri: "interface.uri.eth", + namespace: "Interface", + nativeType: "Query" +) { +""" +abstractMethod comment +""" + abstractMethod( + arg: UInt8! + ): String! +} + +""" +Interface_Object comment +""" +type Interface_Object @imported( + uri: "interface.uri.eth", + namespace: "Interface", + nativeType: "Object" +) { + str: String! + uint8: UInt8! +} + +""" +Interface_Object2 comment +""" +type Interface_Object2 @imported( + uri: "interface.uri.eth", + namespace: "Interface", + nativeType: "Object2" +) { + str2: String! +} diff --git a/packages/test-cases/cases/parse/sanity/output.ts b/packages/test-cases/cases/parse/sanity/output.ts index 593be356d1..7ea0d3f830 100644 --- a/packages/test-cases/cases/parse/sanity/output.ts +++ b/packages/test-cases/cases/parse/sanity/output.ts @@ -12,16 +12,19 @@ import { createImportedQueryDefinition, createEnumDefinition, createEnumPropertyDefinition, - createImportedEnumDefinition + createImportedEnumDefinition, + createInterfaceImplementedDefinition, + createObjectRef, + createEnumRef } from "../../../../schema/parse/src/typeInfo"; export const output: TypeInfo = { objectTypes: [ { - ...createObjectDefinition({ type: "CustomType" }), + ...createObjectDefinition({ type: "CustomType", comment: "CustomType multi-line comment\nline 2" }), properties: [ - createScalarPropertyDefinition({ name: "str", type: "String", required: true }), - createScalarPropertyDefinition({ name: "optStr", type: "String", required: false }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true, comment: "str comment" }), + createScalarPropertyDefinition({ name: "optStr", type: "String", required: false, comment: "optStr comment" }), createScalarPropertyDefinition({ name: "u", type: "UInt", required: true }), createScalarPropertyDefinition({ name: "optU", type: "UInt", required: false }), createScalarPropertyDefinition({ name: "u8", type: "UInt8", required: true }), @@ -123,7 +126,7 @@ export const output: TypeInfo = { name: "objectArray", type: "[UserObject]", required: true, - item: createObjectDefinition({ name: "objectArray", type: "UserObject", required: true }) + item: createObjectRef({ name: "objectArray", type: "UserObject", required: true }) }), createArrayPropertyDefinition({ name: "objectArrayArray", @@ -133,7 +136,7 @@ export const output: TypeInfo = { name: "objectArrayArray", type: "[UserObject]", required: true, - item: createObjectDefinition({ name: "objectArrayArray", type: "UserObject", required: true }) + item: createObjectRef({ name: "objectArrayArray", type: "UserObject", required: true }) }) }), createObjectPropertyDefinition({ @@ -158,7 +161,7 @@ export const output: TypeInfo = { name: "enumArray", type: "[CustomEnum]", required: true, - item: createEnumDefinition({ + item: createEnumRef({ name: "enumArray", type: "CustomEnum", required: true, @@ -168,7 +171,7 @@ export const output: TypeInfo = { name: "optEnumArray", type: "[CustomEnum]", required: false, - item: createEnumDefinition({ + item: createEnumRef({ name: "optEnumArray", type: "CustomEnum", required: false @@ -177,21 +180,38 @@ export const output: TypeInfo = { ], }, { - ...createObjectDefinition({ type: "AnotherType" }), - properties: [createScalarPropertyDefinition({ name: "prop", type: "String" })], + ...createObjectDefinition({ type: "AnotherType", comment: "AnotherType comment" }), + properties: [createScalarPropertyDefinition({ name: "prop", type: "String", comment: "prop comment" })], }, { - ...createObjectDefinition({ type: "UserObject" }), + ...createObjectDefinition({ type: "UserObject", comment: "UserObject comment" }), properties: [ createScalarPropertyDefinition({ name: "fieldA", type: "String", required: false }), createScalarPropertyDefinition({ name: "fieldB", type: "Int", required: true }), ], }, + { + ...createObjectDefinition({ + type: "ImplementationObject", + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_Object" }), + createInterfaceImplementedDefinition({ type: "Interface_Object2" }) + ], + comment: "ImplementationObject comment" + }), + properties: [ + createScalarPropertyDefinition({ name: "anotherProp", type: "String", required: false, comment: "anotherProp comment" }), + createScalarPropertyDefinition({ name: "str", type: "String", required: true }), + createScalarPropertyDefinition({ name: "uint8", type: "UInt8", required: true }), + createScalarPropertyDefinition({ name: "str2", type: "String", required: true }), + ], + }, ], enumTypes: [ createEnumDefinition({ type: "CustomEnum", - constants: ["TEXT", "BINARY"] + constants: ["TEXT", "BINARY"], + comment: "CustomEnum comment" }) ], importedEnumTypes: [ @@ -200,14 +220,19 @@ export const output: TypeInfo = { uri: "testimport.uri.eth", namespace: "TestImport", nativeType: "Enum", - constants: ["TEXT", "BYTES"] + constants: ["TEXT", "BYTES"], + comment: "TestImport_Enum comment" }) ], queryTypes: [ { ...createQueryDefinition({ type: "Query", - imports: [{ type: "TestImport_Query" }] + imports: [{ type: "TestImport_Query" }, { type: "Interface_Query" }], + interfaces: [ + createInterfaceImplementedDefinition({ type: "Interface_Query" }), + ], + comment: "Query comment" }), methods: [ { @@ -219,9 +244,10 @@ export const output: TypeInfo = { type: "[Int]", required: true, item: createScalarDefinition({ name: "queryMethod", type: "Int", required: false }), - }) + }), + comment: "queryMethod comment" }), - arguments: [createScalarPropertyDefinition({ name: "arg", type: "String", required: true })], + arguments: [createScalarPropertyDefinition({ name: "arg", type: "String", required: true, comment: "arg comment" })], }, { ...createMethodDefinition({ @@ -232,14 +258,18 @@ export const output: TypeInfo = { type: "UserObject", required: true }), + comment: "userObjectMethod comment" }), arguments: [ - createObjectPropertyDefinition({ name: "userObject", type: "UserObject" }), - createArrayPropertyDefinition({ name: "arrayObject", type: "[UserObject]", required: true, item: createObjectDefinition({ - type: "UserObject", - name: "arrayObject", - required: true - })}), + createObjectPropertyDefinition({ name: "userObject", type: "UserObject", comment: "userObject comment" }), + createArrayPropertyDefinition({ + name: "arrayObject", type: "[UserObject]", required: true, comment: "arrayObject comment", + item: createObjectRef({ + type: "UserObject", + name: "arrayObject", + required: true + }) + }), ], }, { @@ -251,14 +281,37 @@ export const output: TypeInfo = { type: "CustomEnum", required: true }), + comment: "enumMethod comment" }), arguments: [ - createEnumPropertyDefinition({ name: "enum", type: "CustomEnum" }), - createArrayPropertyDefinition({ name: "arrayEnum", type: "[CustomEnum]", required: true, item: createEnumDefinition({ - type: "CustomEnum", - name: "arrayEnum", + createEnumPropertyDefinition({ name: "enum", type: "CustomEnum", comment: "enum comment" }), + createArrayPropertyDefinition({ + name: "arrayEnum", type: "[CustomEnum]", required: true, comment: "arrayEnum comment", + item: createEnumRef({ + type: "CustomEnum", + name: "arrayEnum", + required: true + }) + }) + ], + }, + { + ...createMethodDefinition({ + type: "query", + name: "abstractMethod", + return: createScalarPropertyDefinition({ + name: "abstractMethod", + type: "String", required: true - })}), + }), + comment: "abstractMethod comment" + }), + arguments: [ + createScalarPropertyDefinition({ + name: "arg", + type: "UInt8", + required: true + }), ], }, ], @@ -270,11 +323,12 @@ export const output: TypeInfo = { uri: "testimport.uri.eth", namespace: "TestImport", type: "TestImport_Object", - nativeType: "Object" + nativeType: "Object", + comment: "TestImport_Object comment" }), properties: [ - createScalarPropertyDefinition({ name: "prop", type: "String", required: true }), - createObjectPropertyDefinition({ name: "nested", type: "TestImport_NestedObject", required: true }) + createScalarPropertyDefinition({ name: "prop", type: "String", required: true, comment: "prop comment" }), + createObjectPropertyDefinition({ name: "nested", type: "TestImport_NestedObject", required: true, comment: "nested comment" }) ], }, { @@ -282,13 +336,15 @@ export const output: TypeInfo = { uri: "testimport.uri.eth", namespace: "TestImport", type: "TestImport_NestedObject", - nativeType: "NestedObject" + nativeType: "NestedObject", + comment: "TestImport_NestedObject comment" }), properties: [ createArrayPropertyDefinition({ name: "foo", type: "[String]", required: true, + comment: "foo comment", item: createScalarDefinition({ name: "foo", type: "String", @@ -301,7 +357,44 @@ export const output: TypeInfo = { required: false, }) ], - } + }, + { + ...createImportedObjectDefinition({ + uri: "interface.uri.eth", + namespace: "Interface", + type: "Interface_Object", + nativeType: "Object", + comment: "Interface_Object comment" + }), + properties: [ + createScalarPropertyDefinition({ + name: "str", + type: "String", + required: true + }), + createScalarPropertyDefinition({ + name: "uint8", + type: "UInt8", + required: true, + }) + ], + }, + { + ...createImportedObjectDefinition({ + uri: "interface.uri.eth", + namespace: "Interface", + type: "Interface_Object2", + nativeType: "Object2", + comment: "Interface_Object2 comment" + }), + properties: [ + createScalarPropertyDefinition({ + name: "str2", + type: "String", + required: true + }) + ], + }, ], importedQueryTypes: [ { @@ -309,7 +402,8 @@ export const output: TypeInfo = { uri: "testimport.uri.eth", namespace: "TestImport", type: "TestImport_Query", - nativeType: "Query" + nativeType: "Query", + comment: "TestImport_Query comment" }), methods: [ { @@ -321,6 +415,7 @@ export const output: TypeInfo = { type: "String", required: true }), + comment: "importedMethod comment" }), arguments: [ createScalarPropertyDefinition({ name: "str", type: "String", required: true }), @@ -331,6 +426,7 @@ export const output: TypeInfo = { name: "uArrayArray", type: "[[UInt]]", required: true, + comment: "uArrayArray comment", item: createArrayDefinition({ name: "uArrayArray", type: "[UInt]", @@ -375,7 +471,7 @@ export const output: TypeInfo = { required: true }), object: { - ...createObjectDefinition({ + ...createObjectRef({ name: "importedObjectMethod", type: "TestImport_Object", required: true @@ -391,7 +487,7 @@ export const output: TypeInfo = { required: true }), object: { - ...createObjectDefinition({ + ...createObjectRef({ name: "importedObject", type: "TestImport_Object", required: true @@ -434,7 +530,8 @@ export const output: TypeInfo = { uri: "testimport.uri.eth", namespace: "TestImport", type: "TestImport_Mutation", - nativeType: "Mutation" + nativeType: "Mutation", + comment: "TestImport_Mutation comment" }), methods: [ { @@ -446,8 +543,33 @@ export const output: TypeInfo = { type: "String", required: true }), + comment: "importedMethod comment" + }), + arguments: [createScalarPropertyDefinition({ name: "str", type: "String", required: true, comment: "str comment" })], + }, + ], + }, + { + ...createImportedQueryDefinition({ + uri: "interface.uri.eth", + namespace: "Interface", + type: "Interface_Query", + nativeType: "Query", + comment: "Interface_Query comment" + }), + methods: [ + { + ...createMethodDefinition({ + type: "query", + name: "abstractMethod", + return: createScalarPropertyDefinition({ + name: "abstractMethod", + type: "String", + required: true + }), + comment: "abstractMethod comment" }), - arguments: [createScalarPropertyDefinition({ name: "str", type: "String", required: true })], + arguments: [createScalarPropertyDefinition({ name: "arg", type: "UInt8", required: true })], }, ], }, diff --git a/yarn.lock b/yarn.lock index 4a098a959f..1f59651d55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,10 +17,10 @@ resolved "https://registry.yarnpkg.com/@as-pect/assembly/-/assembly-5.0.1.tgz#052bb0082db81ec11c4756312ab182ec6eda3025" integrity sha512-8tkBALZa8jjUmBoz67gRyl8X501IWzkyRl7rxIcJq6HycudlmL8zfxtZL4x70gtvK4nDcb885FmrnnknH5L+hQ== -"@as-pect/assembly@^6.0.0", "@as-pect/assembly@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@as-pect/assembly/-/assembly-6.1.0.tgz#17a9a872a8cc3a003e449d2bc29566b7d4d1bc82" - integrity sha512-N8bxUjIOfT6rK1HEA6tpe8Mb9pR2lG4QzgkD8PwS9gzsnE9XoQyGN8MDI5VH9tmgQZlmNUZRXkbn7JnExWSzqQ== +"@as-pect/assembly@^6.0.0", "@as-pect/assembly@^6.2.0": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@as-pect/assembly/-/assembly-6.2.0.tgz#29a0efa173df321354b76d92228e46944159ba95" + integrity sha512-jYr1jdlr0xNndIhOpTMBaPHmlhD/c3PcVCzow8wIkzLxgcSOzhBkqjip+LWPWGsiFK1vsZ8ZUaMTeK3fcnXQhw== "@as-pect/cli@5.0.1": version "5.0.1" @@ -58,14 +58,14 @@ chalk "^4.1.0" long "^4.0.0" -"@as-pect/core@^6.0.0", "@as-pect/core@^6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@as-pect/core/-/core-6.1.1.tgz#4b52b78df8084829d5f6ef08291b5855beec4fb2" - integrity sha512-hjP2JLIK87sS3zz6RaIeFG12lq6itA/RgYTMoG2KqhoVWiE+WOm6vXy9LUJRoeDUiS8pq+MHpr4ERUkNFxMNqg== +"@as-pect/core@^6.0.0", "@as-pect/core@^6.2.1": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@as-pect/core/-/core-6.2.1.tgz#fa1f3658e337506c19df7944f75a8ba7b13aed97" + integrity sha512-JnvUb55OhGP7CYUnYtsLXttUb+FGv+6kEN9NleTbIMvU73NFJzyTCGjoZuayPNpfiUzOF96j91XuMHuinJ8BAg== dependencies: - "@as-pect/assembly" "^6.1.0" - "@as-pect/snapshots" "^6.1.0" - chalk "^4.1.0" + "@as-pect/assembly" "^6.2.0" + "@as-pect/snapshots" "^6.2.1" + chalk "^4.1.1" long "^4.0.0" "@as-pect/csv-reporter@^5.0.1": @@ -76,11 +76,11 @@ "@as-pect/core" "^5.0.1" "@as-pect/csv-reporter@^6.0.0": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@as-pect/csv-reporter/-/csv-reporter-6.1.1.tgz#d90be23be425d915dc3ee3cb7d466d1c5e8d13f1" - integrity sha512-pVfUbSw6BJ98P9OL8hynE7rtcBKtBvLKd3o8h8244S005babw2ZsD+84TrQVC58NWY7FLC/9faXtEJLn0bDClg== + version "6.2.1" + resolved "https://registry.yarnpkg.com/@as-pect/csv-reporter/-/csv-reporter-6.2.1.tgz#fe7e23ac2d811e2519006ccc82f5245adcaad526" + integrity sha512-jy8ka8dEP4UY/pK/OIjHFUqs4j2Hvw3r6no6XfX1AkOd9CRLlt/JIDddlzwEqCGEfF83GSBQfQ1At86FkE7RtA== dependencies: - "@as-pect/core" "^6.1.1" + "@as-pect/core" "^6.2.1" "@as-pect/json-reporter@^5.0.1": version "5.0.1" @@ -90,11 +90,11 @@ "@as-pect/core" "^5.0.1" "@as-pect/json-reporter@^6.0.0": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@as-pect/json-reporter/-/json-reporter-6.1.1.tgz#63dcf4eb8cedea4ce0e0d2be3296fbbe1667bfa2" - integrity sha512-9eTQPA8uu7dliMKli076x5Jq+azVu6ymVq+J+ZPdfnan3djNDJ4uPUdmIFVBFoYOjg03eLwwPkjYKGbQGotk/g== + version "6.2.1" + resolved "https://registry.yarnpkg.com/@as-pect/json-reporter/-/json-reporter-6.2.1.tgz#a77c3257aed8e5b1e5175509fb1046c1f94851cf" + integrity sha512-vsTYOiqB42+WPpec0M3apm9P2SjstUe6MfXepDvVIu2DCZzt1rkEuIIXro13LLQCnOzwXgHO/00sn+uPEjsmSQ== dependencies: - "@as-pect/core" "^6.1.1" + "@as-pect/core" "^6.2.1" "@as-pect/snapshots@^5.0.1": version "5.0.1" @@ -104,10 +104,10 @@ diff "^5.0.0" nearley "^2.20.1" -"@as-pect/snapshots@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@as-pect/snapshots/-/snapshots-6.1.0.tgz#bd5f7ba4ff0ae3df4ff5991de9410f0302875a28" - integrity sha512-8N5T5lDHl11SrwX3O0C+wayYmfzdVbPEt7vdLyig3FT4/suBLP6jBf3FGbYMhNwxio1iNraSrY/PsfGJc3M8pQ== +"@as-pect/snapshots@^6.2.1": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@as-pect/snapshots/-/snapshots-6.2.1.tgz#237ed3b958e85b3e527a0e9f43292813b6dbf789" + integrity sha512-a6xcOUaXMrR3f1n6vgGxMJxUUd6MIVm5vlQ3nZ2hDEMz1PFyEQ04OvGqqUIYHhKAeXIvD3iwz02cI8Wh9lDK7Q== dependencies: diff "^5.0.0" nearley "^2.20.1" @@ -143,10 +143,10 @@ dependencies: "@babel/highlight" "^7.14.5" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.14.5", "@babel/compat-data@^7.9.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.5.tgz#8ef4c18e58e801c5c95d3c1c0f2874a2680fadea" - integrity sha512-kixrYn4JwfAVPa0f2yfzc2AWti6WRRyO3XjWW5PJAvtE11qhSayrrcrEnee05KAtNaPC+EwehE8Qt1UedEVB8w== +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.14.5", "@babel/compat-data@^7.14.7", "@babel/compat-data@^7.9.0": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08" + integrity sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw== "@babel/core@7.4.4": version "7.4.4" @@ -191,16 +191,16 @@ source-map "^0.5.0" "@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.7.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.5.tgz#d281f46a9905f07d1b3bf71ead54d9c7d89cb1e3" - integrity sha512-RN/AwP2DJmQTZSfiDaD+JQQ/J99KsIpOCfBE5pL+5jJSt7nI3nYGoAXZu+ffYSQ029NLs2DstZb+eR81uuARgg== + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab" + integrity sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA== dependencies: "@babel/code-frame" "^7.14.5" "@babel/generator" "^7.14.5" "@babel/helper-compilation-targets" "^7.14.5" "@babel/helper-module-transforms" "^7.14.5" - "@babel/helpers" "^7.14.5" - "@babel/parser" "^7.14.5" + "@babel/helpers" "^7.14.6" + "@babel/parser" "^7.14.6" "@babel/template" "^7.14.5" "@babel/traverse" "^7.14.5" "@babel/types" "^7.14.5" @@ -245,10 +245,10 @@ browserslist "^4.16.6" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.5.tgz#8842ec495516dd1ed8f6c572be92ba78b1e9beef" - integrity sha512-Uq9z2e7ZtcnDMirRqAGLRaLwJn+Lrh388v5ETrR3pALJnElVh2zqQmdbz4W2RUJYohAPh2mtyPUgyMHMzXMncQ== +"@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.14.6", "@babel/helper-create-class-features-plugin@^7.8.3": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.6.tgz#f114469b6c06f8b5c59c6c4e74621f5085362542" + integrity sha512-Z6gsfGofTxH/+LQXqYEK45kxmcensbzmk/oi8DmaQytlQCgqNZt9XQF8iqlI/SeXWVjaMNxvYvzaYw+kh42mDg== dependencies: "@babel/helper-annotate-as-pure" "^7.14.5" "@babel/helper-function-name" "^7.14.5" @@ -310,9 +310,9 @@ "@babel/types" "^7.14.5" "@babel/helper-member-expression-to-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.5.tgz#d5c70e4ad13b402c95156c7a53568f504e2fb7b8" - integrity sha512-UxUeEYPrqH1Q/k0yRku1JE7dyfyehNwT6SVkMHvYvPDv4+uu627VXBckVj891BO8ruKBkiDoGnZf4qPDD8abDQ== + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz#97e56244beb94211fe277bd818e3a329c66f7970" + integrity sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA== dependencies: "@babel/types" "^7.14.5" @@ -409,10 +409,10 @@ "@babel/traverse" "^7.14.5" "@babel/types" "^7.14.5" -"@babel/helpers@^7.14.5", "@babel/helpers@^7.4.4", "@babel/helpers@^7.9.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.5.tgz#4870f8d9a6fdbbd65e5674a3558b4ff7fef0d9b2" - integrity sha512-xtcWOuN9VL6nApgVHtq3PPcQv5qFBJzoSZzJ/2c0QK/IP/gxVcoWSNQwFEGvmbQsuS9rhYqjILDGGXcTkA705Q== +"@babel/helpers@^7.14.6", "@babel/helpers@^7.4.4", "@babel/helpers@^7.9.0": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.6.tgz#5b58306b95f1b47e2a0199434fa8658fa6c21635" + integrity sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA== dependencies: "@babel/template" "^7.14.5" "@babel/traverse" "^7.14.5" @@ -427,10 +427,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.5", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.7.0", "@babel/parser@^7.9.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.5.tgz#4cd2f346261061b2518873ffecdf1612cb032829" - integrity sha512-TM8C+xtH/9n1qzX+JNHi7AN2zHMTiPUtspO0ZdHflW8KaskkALhMmuMHb4bCmNdv9VAPzJX3/bXqkVLnAvsPfg== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.7.0", "@babel/parser@^7.9.0": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" + integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.14.5": version "7.14.5" @@ -441,10 +441,10 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" "@babel/plugin-proposal-optional-chaining" "^7.14.5" -"@babel/plugin-proposal-async-generator-functions@^7.14.5", "@babel/plugin-proposal-async-generator-functions@^7.2.0", "@babel/plugin-proposal-async-generator-functions@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.5.tgz#4024990e3dd74181f4f426ea657769ff49a2df39" - integrity sha512-tbD/CG3l43FIXxmu4a7RBe4zH7MLJ+S/lFowPFO7HetS2hyOZ/0nnnznegDuzFzfkyQYTxqdTH/hKmuBngaDAA== +"@babel/plugin-proposal-async-generator-functions@^7.14.7", "@babel/plugin-proposal-async-generator-functions@^7.2.0", "@babel/plugin-proposal-async-generator-functions@^7.8.3": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.7.tgz#784a48c3d8ed073f65adcf30b57bcbf6c8119ace" + integrity sha512-RK8Wj7lXLY3bqei69/cc25gwS5puEc3dknoFPFbqfy3XxYQBQFvu4ioWpafMBAB+L9NyptQK4nMOa5Xz16og8Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-remap-async-to-generator" "^7.14.5" @@ -548,12 +548,12 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.14.5", "@babel/plugin-proposal-object-rest-spread@^7.4.4", "@babel/plugin-proposal-object-rest-spread@^7.9.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.5.tgz#e581d5ccdfa187ea6ed73f56c6a21c1580b90fbf" - integrity sha512-VzMyY6PWNPPT3pxc5hi9LloKNr4SSrVCg7Yr6aZpW4Ym07r7KqSU/QXYwjXLVxqwSv0t/XSXkFoKBPUkZ8vb2A== +"@babel/plugin-proposal-object-rest-spread@^7.14.7", "@babel/plugin-proposal-object-rest-spread@^7.4.4", "@babel/plugin-proposal-object-rest-spread@^7.9.0": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz#5920a2b3df7f7901df0205974c0641b13fd9d363" + integrity sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g== dependencies: - "@babel/compat-data" "^7.14.5" + "@babel/compat-data" "^7.14.7" "@babel/helper-compilation-targets" "^7.14.5" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" @@ -809,10 +809,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-destructuring@^7.14.5", "@babel/plugin-transform-destructuring@^7.4.4", "@babel/plugin-transform-destructuring@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.5.tgz#d32ad19ff1a6da1e861dc62720d80d9776e3bf35" - integrity sha512-wU9tYisEbRMxqDezKUqC9GleLycCRoUsai9ddlsq54r8QRLaeEhc+d+9DqCG+kV9W2GgQjTZESPTpn5bAFMDww== +"@babel/plugin-transform-destructuring@^7.14.7", "@babel/plugin-transform-destructuring@^7.4.4", "@babel/plugin-transform-destructuring@^7.8.3": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" + integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" @@ -914,10 +914,10 @@ "@babel/helper-module-transforms" "^7.14.5" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.14.5", "@babel/plugin-transform-named-capturing-groups-regex@^7.4.4", "@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.5.tgz#d537e8ee083ee6f6aa4f4eef9d2081d555746e4c" - integrity sha512-+Xe5+6MWFo311U8SchgeX5c1+lJM+eZDBZgD+tvXu9VVQPXwwVzeManMMjYX6xw2HczngfOSZjoFYKwdeB/Jvw== +"@babel/plugin-transform-named-capturing-groups-regex@^7.14.7", "@babel/plugin-transform-named-capturing-groups-regex@^7.4.4", "@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.7.tgz#60c06892acf9df231e256c24464bfecb0908fd4e" + integrity sha512-DTNOTaS7TkW97xsDMrp7nycUVh6sn/eq22VaxWfEdzuEbRsiaOU0pqU7DlyUGHVsbQbSghvjKRpEl+nUCKGQSg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.14.5" @@ -1066,10 +1066,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-spread@^7.14.5", "@babel/plugin-transform-spread@^7.2.0", "@babel/plugin-transform-spread@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.5.tgz#bd269fb4119754d2ce7f4cc39a96b4f71baae356" - integrity sha512-/3iqoQdiWergnShZYl0xACb4ADeYCJ7X/RgmwtXshn6cIvautRPAFzhd58frQlokLO6Jb4/3JXvmm6WNTPtiTw== +"@babel/plugin-transform-spread@^7.14.6", "@babel/plugin-transform-spread@^7.2.0", "@babel/plugin-transform-spread@^7.8.3": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" + integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" @@ -1096,11 +1096,11 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-transform-typescript@^7.9.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.14.5.tgz#5b41b59072f765bd1ec1d0b694e08c7df0f6f8a0" - integrity sha512-cFD5PKp4b8/KkwQ7h71FdPXFvz1RgwTFF9akRZwFldb9G0AHf7CgoPx96c4Q/ZVjh6V81tqQwW5YiHws16OzPg== + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.14.6.tgz#6e9c2d98da2507ebe0a883b100cde3c7279df36c" + integrity sha512-XlTdBq7Awr4FYIzqhmYY80WN0V0azF74DMPyFqVHBvf81ZUgc4X7ZOpx6O8eLDK6iM5cCQzeyJw0ynTaefixRA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.14.6" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript" "^7.14.5" @@ -1248,16 +1248,16 @@ semver "^5.5.0" "@babel/preset-env@^7.4.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.14.5.tgz#c0c84e763661fd0e74292c3d511cb33b0c668997" - integrity sha512-ci6TsS0bjrdPpWGnQ+m4f+JSSzDKlckqKIJJt9UZ/+g7Zz9k0N8lYU8IeLg/01o2h8LyNZDMLGgRLDTxpudLsA== + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.14.7.tgz#5c70b22d4c2d893b03d8c886a5c17422502b932a" + integrity sha512-itOGqCKLsSUl0Y+1nSfhbuuOlTs0MJk2Iv7iSH+XT/mR8U1zRLO7NjWlYXB47yhK4J/7j+HYty/EhFZDYKa/VA== dependencies: - "@babel/compat-data" "^7.14.5" + "@babel/compat-data" "^7.14.7" "@babel/helper-compilation-targets" "^7.14.5" "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-async-generator-functions" "^7.14.5" + "@babel/plugin-proposal-async-generator-functions" "^7.14.7" "@babel/plugin-proposal-class-properties" "^7.14.5" "@babel/plugin-proposal-class-static-block" "^7.14.5" "@babel/plugin-proposal-dynamic-import" "^7.14.5" @@ -1266,7 +1266,7 @@ "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" "@babel/plugin-proposal-numeric-separator" "^7.14.5" - "@babel/plugin-proposal-object-rest-spread" "^7.14.5" + "@babel/plugin-proposal-object-rest-spread" "^7.14.7" "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" "@babel/plugin-proposal-optional-chaining" "^7.14.5" "@babel/plugin-proposal-private-methods" "^7.14.5" @@ -1292,7 +1292,7 @@ "@babel/plugin-transform-block-scoping" "^7.14.5" "@babel/plugin-transform-classes" "^7.14.5" "@babel/plugin-transform-computed-properties" "^7.14.5" - "@babel/plugin-transform-destructuring" "^7.14.5" + "@babel/plugin-transform-destructuring" "^7.14.7" "@babel/plugin-transform-dotall-regex" "^7.14.5" "@babel/plugin-transform-duplicate-keys" "^7.14.5" "@babel/plugin-transform-exponentiation-operator" "^7.14.5" @@ -1304,7 +1304,7 @@ "@babel/plugin-transform-modules-commonjs" "^7.14.5" "@babel/plugin-transform-modules-systemjs" "^7.14.5" "@babel/plugin-transform-modules-umd" "^7.14.5" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.5" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.7" "@babel/plugin-transform-new-target" "^7.14.5" "@babel/plugin-transform-object-super" "^7.14.5" "@babel/plugin-transform-parameters" "^7.14.5" @@ -1312,7 +1312,7 @@ "@babel/plugin-transform-regenerator" "^7.14.5" "@babel/plugin-transform-reserved-words" "^7.14.5" "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.14.5" + "@babel/plugin-transform-spread" "^7.14.6" "@babel/plugin-transform-sticky-regex" "^7.14.5" "@babel/plugin-transform-template-literals" "^7.14.5" "@babel/plugin-transform-typeof-symbol" "^7.14.5" @@ -1323,7 +1323,7 @@ babel-plugin-polyfill-corejs2 "^0.2.2" babel-plugin-polyfill-corejs3 "^0.2.2" babel-plugin-polyfill-regenerator "^0.2.2" - core-js-compat "^3.14.0" + core-js-compat "^3.15.0" semver "^6.3.0" "@babel/preset-modules@^0.1.3", "@babel/preset-modules@^0.1.4": @@ -1370,11 +1370,11 @@ "@babel/plugin-transform-typescript" "^7.9.0" "@babel/runtime-corejs3@^7.10.2", "@babel/runtime-corejs3@^7.12.1": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.14.5.tgz#0d9bf00d59c0b73185c462c323efffd0f4c37283" - integrity sha512-cBbwXj3F2xjnQJ0ERaFRLjxhUSBYsQPXJ7CERz/ecx6q6hzQ99eTflAPFC3ks4q/IG4CWupNVdflc4jlFBJVsg== + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.14.7.tgz#0ef292bbce40ca00f874c9724ef175a12476465c" + integrity sha512-Wvzcw4mBYbTagyBVZpAJWI06auSIj033T/yNE0Zn1xcup83MieCddZA7ls3kme17L4NOGBrQ09Q+nKB41RLWBA== dependencies: - core-js-pure "^3.14.0" + core-js-pure "^3.15.0" regenerator-runtime "^0.13.4" "@babel/runtime@7.4.4": @@ -1392,9 +1392,9 @@ regenerator-runtime "^0.13.4" "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.5.tgz#665450911c6031af38f81db530f387ec04cd9a98" - integrity sha512-121rumjddw9c3NCQ55KGkyE1h/nzWhU/owjhw0l4mQrkzz4x9SGS1X8gFLraHwX7td3Yo4QTL+qj0NcIzN87BA== + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" + integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== dependencies: regenerator-runtime "^0.13.4" @@ -1408,16 +1408,16 @@ "@babel/types" "^7.14.5" "@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.5", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.7.0", "@babel/traverse@^7.9.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.5.tgz#c111b0f58afab4fea3d3385a406f692748c59870" - integrity sha512-G3BiS15vevepdmFqmUc9X+64y0viZYygubAMO8SvBmKARuF6CPSZtH4Ng9vi/lrWlZFGe3FWdXNy835akH8Glg== + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753" + integrity sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ== dependencies: "@babel/code-frame" "^7.14.5" "@babel/generator" "^7.14.5" "@babel/helper-function-name" "^7.14.5" "@babel/helper-hoist-variables" "^7.14.5" "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/parser" "^7.14.5" + "@babel/parser" "^7.14.7" "@babel/types" "^7.14.5" debug "^4.1.0" globals "^11.1.0" @@ -1531,44 +1531,44 @@ "@ethersproject/properties" ">=5.0.0-beta.131" "@ethersproject/strings" ">=5.0.0-beta.130" -"@ethersproject/abi@^5.0.0", "@ethersproject/abi@^5.3.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.3.1.tgz#69a1a496729d3a83521675a57cbe21f3cc27241c" - integrity sha512-F98FWTJG7nWWAQ4DcV6R0cSlrj67MWK3ylahuFbzkumem5cLWg1p7fZ3vIdRoS1c7TEf55Lvyx0w7ICR47IImw== - dependencies: - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/abstract-provider@^5.0.0", "@ethersproject/abstract-provider@^5.0.3", "@ethersproject/abstract-provider@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.3.0.tgz#f4c0ae4a4cef9f204d7781de805fd44b72756c81" - integrity sha512-1+MLhGP1GwxBDBNwMWVmhCsvKwh4gK7oIfOrmlmePNeskg1NhIrYssraJBieaFNHUYfKEd/1DjiVZMw8Qu5Cxw== - dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/networks" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/web" "^5.3.0" - -"@ethersproject/abstract-signer@^5.0.0", "@ethersproject/abstract-signer@^5.0.3", "@ethersproject/abstract-signer@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.3.0.tgz#05172b653e15b535ed5854ef5f6a72f4b441052d" - integrity sha512-w8IFwOYqiPrtvosPuArZ3+QPR2nmdVTRrVY8uJYL3NNfMmQfTy3V3l2wbzX47UUlNbPJY+gKvzJAyvK1onZxJg== - dependencies: - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" +"@ethersproject/abi@^5.0.0", "@ethersproject/abi@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.4.0.tgz#a6d63bdb3672f738398846d4279fa6b6c9818242" + integrity sha512-9gU2H+/yK1j2eVMdzm6xvHSnMxk8waIHQGYCZg5uvAyH0rsAzxkModzBSpbAkAuhKFEovC2S9hM4nPuLym8IZw== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/abstract-provider@^5.0.0", "@ethersproject/abstract-provider@^5.0.3", "@ethersproject/abstract-provider@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz#415331031b0f678388971e1987305244edc04e1d" + integrity sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" + +"@ethersproject/abstract-signer@^5.0.0", "@ethersproject/abstract-signer@^5.0.3", "@ethersproject/abstract-signer@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz#cd5f50b93141ee9f9f49feb4075a0b3eafb57d65" + integrity sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" "@ethersproject/address@5.0.7": version "5.0.7" @@ -1581,156 +1581,156 @@ "@ethersproject/logger" "^5.0.5" "@ethersproject/rlp" "^5.0.3" -"@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.0", "@ethersproject/address@^5.0.3", "@ethersproject/address@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.3.0.tgz#e53b69eacebf332e8175de814c5e6507d6932518" - integrity sha512-29TgjzEBK+gUEUAOfWCG7s9IxLNLCqvr+oDSk6L9TXD0VLvZJKhJV479tKQqheVA81OeGxfpdxYtUVH8hqlCvA== +"@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.0", "@ethersproject/address@^5.0.3", "@ethersproject/address@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3" + integrity sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q== dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/rlp" "^5.3.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" -"@ethersproject/base64@^5.0.0", "@ethersproject/base64@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.3.0.tgz#b831fb35418b42ad24d943c557259062b8640824" - integrity sha512-JIqgtOmgKcbc2sjGWTXyXktqUhvFUDte8fPVsAaOrcPiJf6YotNF+nsrOYGC9pbHBEGSuSBp3QR0varkO8JHEw== +"@ethersproject/base64@^5.0.0", "@ethersproject/base64@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a" + integrity sha512-CjQw6E17QDSSC5jiM9YpF7N1aSCHmYGMt9bWD8PWv6YPMxjsys2/Q8xLrROKI3IWJ7sFfZ8B3flKDTM5wlWuZQ== dependencies: - "@ethersproject/bytes" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" -"@ethersproject/basex@^5.0.3", "@ethersproject/basex@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.3.0.tgz#02dea3ab8559ae625c6d548bc11773432255c916" - integrity sha512-8J4nS6t/SOnoCgr3DF5WCSRLC5YwTKYpZWJqeyYQLX+86TwPhtzvHXacODzcDII9tWKhVg6g0Bka8JCBWXsCiQ== +"@ethersproject/basex@^5.0.3", "@ethersproject/basex@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6" + integrity sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/properties" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/properties" "^5.4.0" -"@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.0", "@ethersproject/bignumber@^5.0.10", "@ethersproject/bignumber@^5.0.6", "@ethersproject/bignumber@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.3.0.tgz#74ab2ec9c3bda4e344920565720a6ee9c794e9db" - integrity sha512-5xguJ+Q1/zRMgHgDCaqAexx/8DwDVLRemw2i6uR8KyGjwGdXI8f32QZZ1cKGucBN6ekJvpUpHy6XAuQnTv0mPA== +"@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.0", "@ethersproject/bignumber@^5.0.10", "@ethersproject/bignumber@^5.0.6", "@ethersproject/bignumber@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.0.tgz#be8dea298c0ec71208ee60f0b245be0761217ad9" + integrity sha512-OXUu9f9hO3vGRIPxU40cignXZVaYyfx6j9NNMjebKdnaCL3anCLSSy8/b8d03vY6dh7duCC0kW72GEC4tZer2w== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" bn.js "^4.11.9" -"@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.0", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.3.0.tgz#473e0da7f831d535b2002be05e6f4ca3729a1bc9" - integrity sha512-rqLJjdVqCcn7glPer7Fxh87PRqlnRScVAoxcIP3PmOUNApMWJ6yRdOFfo2KvPAdO7Le3yEI1o0YW+Yvr7XCYvw== +"@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.0", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e" + integrity sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA== dependencies: - "@ethersproject/logger" "^5.3.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.0", "@ethersproject/constants@^5.0.3", "@ethersproject/constants@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.3.0.tgz#a5d6d86c0eec2c64c3024479609493b9afb3fc77" - integrity sha512-4y1feNOwEpgjAfiCFWOHznvv6qUF/H6uI0UKp8xdhftb+H+FbKflXg1pOgH5qs4Sr7EYBL+zPyPb+YD5g1aEyw== +"@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.0", "@ethersproject/constants@^5.0.3", "@ethersproject/constants@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a" + integrity sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q== dependencies: - "@ethersproject/bignumber" "^5.3.0" + "@ethersproject/bignumber" "^5.4.0" "@ethersproject/contracts@^5.0.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.3.0.tgz#ad699a3abaae30bfb6422cf31813a663b2d4099c" - integrity sha512-eDyQ8ltykvyQqnGZxb/c1e0OnEtzqXhNNC4BX8nhYBCaoBrYYuK/1fLmyEvc5+XUMoxNhwpYkoSSwvPLci7/Zg== - dependencies: - "@ethersproject/abi" "^5.3.0" - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - -"@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.0", "@ethersproject/hash@^5.0.3", "@ethersproject/hash@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.3.0.tgz#f65e3bf3db3282df4da676db6cfa049535dd3643" - integrity sha512-gAFZSjUPQ32CIfoKSMtMEQ+IO0kQxqhwz9fCIFt2DtAq2u4pWt8mL9Z5P0r6KkLcQU8LE9FmuPPyd+JvBzmr1w== - dependencies: - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/hdnode@^5.0.0", "@ethersproject/hdnode@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.3.0.tgz#26fed65ffd5c25463fddff13f5fb4e5617553c94" - integrity sha512-zLmmtLNoDMGoYRdjOab01Zqkvp+TmZyCGDAMQF1Bs3yZyBs/kzTNi1qJjR1jVUcPP5CWGtjFwY8iNG8oNV9J8g== - dependencies: - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/basex" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/pbkdf2" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" - "@ethersproject/signing-key" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/wordlists" "^5.3.0" - -"@ethersproject/json-wallets@^5.0.0", "@ethersproject/json-wallets@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.3.0.tgz#7b1a5ff500c12aa8597ae82c8939837b0449376e" - integrity sha512-/xwbqaIb5grUIGNmeEaz8GdcpmDr++X8WT4Jqcclnxow8PXCUHFeDxjf3O+nSuoqOYG/Ds0+BI5xuQKbva6Xkw== - dependencies: - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/hdnode" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/pbkdf2" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/random" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.0.tgz#e05fe6bd33acc98741e27d553889ec5920078abb" + integrity sha512-hkO3L3IhS1Z3ZtHtaAG/T87nQ7KiPV+/qnvutag35I0IkiQ8G3ZpCQ9NNOpSCzn4pWSW4CfzmtE02FcqnLI+hw== + dependencies: + "@ethersproject/abi" "^5.4.0" + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + +"@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.0", "@ethersproject/hash@^5.0.3", "@ethersproject/hash@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0" + integrity sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/hdnode@^5.0.0", "@ethersproject/hdnode@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac" + integrity sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/json-wallets@^5.0.0", "@ethersproject/json-wallets@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95" + integrity sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ== + dependencies: + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/pbkdf2" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.0", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.3.0.tgz#fb5cd36bdfd6fa02e2ea84964078a9fc6bd731be" - integrity sha512-Gv2YqgIUmRbYVNIibafT0qGaeGYLIA/EdWHJ7JcVxVSs2vyxafGxOJ5VpSBHWeOIsE6OOaCelYowhuuTicgdFQ== +"@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.0", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318" + integrity sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A== dependencies: - "@ethersproject/bytes" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" js-sha3 "0.5.7" -"@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.3.0.tgz#7a69fa1d4ca0d4b7138da1627eb152f763d84dd0" - integrity sha512-8bwJ2gxJGkZZnpQSq5uSiZSJjyVTWmlGft4oH8vxHdvO1Asy4TwVepAhPgxIQIMxXZFUNMych1YjIV4oQ4I7dA== +"@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.0.tgz#f39adadf62ad610c420bcd156fd41270e91b3ca9" + integrity sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ== -"@ethersproject/networks@^5.0.0", "@ethersproject/networks@^5.0.3", "@ethersproject/networks@^5.3.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.3.1.tgz#78fe08324cee289ce239acf8c746121934b2ef61" - integrity sha512-6uQKHkYChlsfeiZhQ8IHIqGE/sQsf25o9ZxAYpMxi15dLPzz3IxOEF5KiSD32aHwsjXVBKBSlo+teAXLlYJybw== +"@ethersproject/networks@^5.0.0", "@ethersproject/networks@^5.0.3", "@ethersproject/networks@^5.4.0": + version "5.4.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.1.tgz#2ce83b8e42aa85216e5d277a7952d97b6ce8d852" + integrity sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig== dependencies: - "@ethersproject/logger" "^5.3.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/pbkdf2@^5.0.0", "@ethersproject/pbkdf2@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.3.0.tgz#8adbb41489c3c9f319cc44bc7d3e6095fd468dc8" - integrity sha512-Q9ChVU6gBFiex0FSdtzo4b0SAKz3ZYcYVFLrEWHL0FnHvNk3J3WgAtRNtBQGQYn/T5wkoTdZttMbfBkFlaiWcA== +"@ethersproject/pbkdf2@^5.0.0", "@ethersproject/pbkdf2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c" + integrity sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" -"@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.3.0.tgz#feef4c4babeb7c10a6b3449575016f4ad2c092b2" - integrity sha512-PaHxJyM5/bfusk6vr3yP//JMnm4UEojpzuWGTmtL5X4uNhNnFNvlYilZLyDr4I9cTkIbipCMsAuIcXWsmdRnEw== +"@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.0.tgz#38ba20539b44dcc5d5f80c45ad902017dcdbefe7" + integrity sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A== dependencies: - "@ethersproject/logger" "^5.3.0" + "@ethersproject/logger" "^5.4.0" "@ethersproject/providers@5.0.7": version "5.0.7" @@ -1758,153 +1758,153 @@ ws "7.2.3" "@ethersproject/providers@^5.0.0": - version "5.3.1" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.3.1.tgz#a12c6370e8cbc0968c9744641b8ef90b0dd5ec2b" - integrity sha512-HC63vENTrur6/JKEhcQbA8PRDj1FAesdpX98IW+xAAo3EAkf70ou5fMIA3KCGzJDLNTeYA4C2Bonz849tVLekg== - dependencies: - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/basex" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/networks" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/random" "^5.3.0" - "@ethersproject/rlp" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/web" "^5.3.0" + version "5.4.1" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.1.tgz#654267b563b833046b9c9647647cfc8267cb93b4" + integrity sha512-p06eiFKz8nu/5Ju0kIX024gzEQIgE5pvvGrBCngpyVjpuLtUIWT3097Agw4mTn9/dEA0FMcfByzFqacBMSgCVg== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/basex" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/networks" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/web" "^5.4.0" bech32 "1.1.4" ws "7.4.6" -"@ethersproject/random@^5.0.0", "@ethersproject/random@^5.0.3", "@ethersproject/random@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.3.0.tgz#7c46bf36e50cb0d0550bc8c666af8e1d4496dc1a" - integrity sha512-A5SL/4inutSwt3Fh2OD0x2gz+x6GHmuUnIPkR7zAiTidMD2N8F6tZdMF1hlQKWVCcVMWhEQg8mWijhEzm6BBYw== +"@ethersproject/random@^5.0.0", "@ethersproject/random@^5.0.3", "@ethersproject/random@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16" + integrity sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/rlp@^5.0.0", "@ethersproject/rlp@^5.0.3", "@ethersproject/rlp@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.3.0.tgz#7cb93a7b5dfa69163894153c9d4b0d936f333188" - integrity sha512-oI0joYpsRanl9guDubaW+1NbcpK0vJ3F/6Wpcanzcnqq+oaW9O5E98liwkEDPcb16BUTLIJ+ZF8GPIHYxJ/5Pw== +"@ethersproject/rlp@^5.0.0", "@ethersproject/rlp@^5.0.3", "@ethersproject/rlp@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931" + integrity sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" -"@ethersproject/sha2@^5.0.0", "@ethersproject/sha2@^5.0.3", "@ethersproject/sha2@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.3.0.tgz#209f9a1649f7d2452dcd5e5b94af43b7f3f42366" - integrity sha512-r5ftlwKcocYEuFz2JbeKOT5SAsCV4m1RJDsTOEfQ5L67ZC7NFDK5i7maPdn1bx4nPhylF9VAwxSrQ1esmwzylg== +"@ethersproject/sha2@^5.0.0", "@ethersproject/sha2@^5.0.3", "@ethersproject/sha2@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371" + integrity sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" hash.js "1.1.7" -"@ethersproject/signing-key@^5.0.0", "@ethersproject/signing-key@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.3.0.tgz#a96c88f8173e1abedfa35de32d3e5db7c48e5259" - integrity sha512-+DX/GwHAd0ok1bgedV1cKO0zfK7P/9aEyNoaYiRsGHpCecN7mhLqcdoUiUzE7Uz86LBsxm5ssK0qA1kBB47fbQ== +"@ethersproject/signing-key@^5.0.0", "@ethersproject/signing-key@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec" + integrity sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A== dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" bn.js "^4.11.9" elliptic "6.5.4" hash.js "1.1.7" "@ethersproject/solidity@^5.0.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.3.0.tgz#2a0b00b4aaaef99a080ddea13acab1fa35cd4a93" - integrity sha512-uLRBaNUiISHbut94XKewJgQh6UmydWTBp71I7I21pkjVXfZO2dJ5EOo3jCnumJc01M4LOm79dlNNmF3oGIvweQ== - dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/sha2" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.0", "@ethersproject/strings@^5.0.3", "@ethersproject/strings@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.3.0.tgz#a6b640aab56a18e0909f657da798eef890968ff0" - integrity sha512-j/AzIGZ503cvhuF2ldRSjB0BrKzpsBMtCieDtn4TYMMZMQ9zScJn9wLzTQl/bRNvJbBE6TOspK0r8/Ngae/f2Q== - dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - -"@ethersproject/transactions@^5.0.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.0.3", "@ethersproject/transactions@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.3.0.tgz#49b86f2bafa4d0bdf8e596578fc795ee47c50458" - integrity sha512-cdfK8VVyW2oEBCXhURG0WQ6AICL/r6Gmjh0e4Bvbv6MCn/GBd8FeBH3rtl7ho+AW50csMKeGv3m3K1HSHB2jMQ== - dependencies: - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/rlp" "^5.3.0" - "@ethersproject/signing-key" "^5.3.0" + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec" + integrity sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ== + dependencies: + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/sha2" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.0", "@ethersproject/strings@^5.0.3", "@ethersproject/strings@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a" + integrity sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + +"@ethersproject/transactions@^5.0.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.0.3", "@ethersproject/transactions@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0" + integrity sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ== + dependencies: + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/rlp" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" "@ethersproject/units@^5.0.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.3.0.tgz#c4d1493532ad3d4ddf6e2bc4f8c94a2db933a8f5" - integrity sha512-BkfccZGwfJ6Ob+AelpIrgAzuNhrN2VLp3AILnkqTOv+yBdsc83V4AYf25XC/u0rHnWl6f4POaietPwlMqP2vUg== + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe" + integrity sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg== dependencies: - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/constants" "^5.3.0" - "@ethersproject/logger" "^5.3.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/constants" "^5.4.0" + "@ethersproject/logger" "^5.4.0" "@ethersproject/wallet@^5.0.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.3.0.tgz#91946b470bd279e39ade58866f21f92749d062af" - integrity sha512-boYBLydG6671p9QoG6EinNnNzbm7DNOjVT20eV8J6HQEq4aUaGiA2CytF2vK+2rOEWbzhZqoNDt6AlkE1LlsTg== - dependencies: - "@ethersproject/abstract-provider" "^5.3.0" - "@ethersproject/abstract-signer" "^5.3.0" - "@ethersproject/address" "^5.3.0" - "@ethersproject/bignumber" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/hdnode" "^5.3.0" - "@ethersproject/json-wallets" "^5.3.0" - "@ethersproject/keccak256" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/random" "^5.3.0" - "@ethersproject/signing-key" "^5.3.0" - "@ethersproject/transactions" "^5.3.0" - "@ethersproject/wordlists" "^5.3.0" - -"@ethersproject/web@^5.0.0", "@ethersproject/web@^5.0.4", "@ethersproject/web@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.3.0.tgz#7959c403f6476c61515008d8f92da51c553a8ee1" - integrity sha512-Ni6/DHnY6k/TD41LEkv0RQDx4jqWz5e/RZvrSecsxGYycF+MFy2z++T/yGc2peRunLOTIFwEksgEGGlbwfYmhQ== - dependencies: - "@ethersproject/base64" "^5.3.0" - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" - -"@ethersproject/wordlists@^5.0.0", "@ethersproject/wordlists@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.3.0.tgz#45a0205f5178c1de33d316cb2ab7ed5eac3c06c5" - integrity sha512-JcwumCZcsUxgWpiFU/BRy6b4KlTRdOmYvOKZcAw/3sdF93/pZyPW5Od2hFkHS8oWp4xS06YQ+qHqQhdcxdHafQ== - dependencies: - "@ethersproject/bytes" "^5.3.0" - "@ethersproject/hash" "^5.3.0" - "@ethersproject/logger" "^5.3.0" - "@ethersproject/properties" "^5.3.0" - "@ethersproject/strings" "^5.3.0" + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353" + integrity sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ== + dependencies: + "@ethersproject/abstract-provider" "^5.4.0" + "@ethersproject/abstract-signer" "^5.4.0" + "@ethersproject/address" "^5.4.0" + "@ethersproject/bignumber" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/hdnode" "^5.4.0" + "@ethersproject/json-wallets" "^5.4.0" + "@ethersproject/keccak256" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/random" "^5.4.0" + "@ethersproject/signing-key" "^5.4.0" + "@ethersproject/transactions" "^5.4.0" + "@ethersproject/wordlists" "^5.4.0" + +"@ethersproject/web@^5.0.0", "@ethersproject/web@^5.0.4", "@ethersproject/web@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f" + integrity sha512-1bUusGmcoRLYgMn6c1BLk1tOKUIFuTg8j+6N8lYlbMpDesnle+i3pGSagGNvwjaiLo4Y5gBibwctpPRmjrh4Og== + dependencies: + "@ethersproject/base64" "^5.4.0" + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" + +"@ethersproject/wordlists@^5.0.0", "@ethersproject/wordlists@^5.4.0": + version "5.4.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7" + integrity sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA== + dependencies: + "@ethersproject/bytes" "^5.4.0" + "@ethersproject/hash" "^5.4.0" + "@ethersproject/logger" "^5.4.0" + "@ethersproject/properties" "^5.4.0" + "@ethersproject/strings" "^5.4.0" "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" @@ -3170,10 +3170,10 @@ is-plain-object "^5.0.0" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^7.3.2": - version "7.3.2" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-7.3.2.tgz#065ce49b338043ec7f741316ce06afd4d459d944" - integrity sha512-oJhK/yhl9Gt430OrZOzAl2wJqR0No9445vmZ9Ey8GjUZUpwuu/vmEFP0TDhDXdpGDoxD6/EIFHJEcY8nHXpDTA== +"@octokit/openapi-types@^8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-8.2.1.tgz#102e752a7378ff8d21057c70fd16f1c83856d8c5" + integrity sha512-BJz6kWuL3n+y+qM8Pv+UGbSxH6wxKf/SBs5yzGufMHwDefsa+Iq7ZGy1BINMD2z9SkXlIzk1qiu988rMuGXEMg== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -3260,11 +3260,11 @@ "@types/node" ">= 8" "@octokit/types@^6.0.3", "@octokit/types@^6.16.1": - version "6.16.4" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.16.4.tgz#d24f5e1bacd2fe96d61854b5bda0e88cf8288dfe" - integrity sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A== + version "6.18.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.18.1.tgz#a6db178536e649fd5d67a7b747754bcc43940be4" + integrity sha512-5YsddjO1U+xC8ZYKV8yZYebW55PCc7qiEEeZ+wZRr6qyclynzfyD65KZ5FdtIeP0/cANyFaD7hV69qElf1nMsQ== dependencies: - "@octokit/openapi-types" "^7.3.2" + "@octokit/openapi-types" "^8.2.1" "@opentelemetry/api-metrics@0.20.0": version "0.20.0" @@ -3401,11 +3401,6 @@ "@opentelemetry/semantic-conventions" "0.20.0" "@opentelemetry/tracing" "0.20.0" -"@sheerun/mutationobserver-shim@^0.3.2": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz#5405ee8e444ed212db44e79351f0c70a582aae25" - integrity sha512-DetpxZw1fzPD5xUBrIAoplLChO2VB8DlL5Gg+I1IR9b2wPqYIca2WSUxL5g1vLeR4MsQq1NeWriXAVffV+U1Fw== - "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -3535,7 +3530,7 @@ dependencies: defer-to-connect "^1.0.1" -"@testing-library/dom@*", "@testing-library/dom@^7.28.1": +"@testing-library/dom@^7.28.1": version "7.31.2" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a" integrity sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ== @@ -3549,23 +3544,10 @@ lz-string "^1.4.4" pretty-format "^26.6.2" -"@testing-library/dom@^6.15.0": - version "6.16.0" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-6.16.0.tgz#04ada27ed74ad4c0f0d984a1245bb29b1fd90ba9" - integrity sha512-lBD88ssxqEfz0wFL6MeUyyWZfV/2cjEZZV3YRpb2IoJRej/4f1jB0TzqIOznTpfR1r34CNesrubxwIlAQ8zgPA== - dependencies: - "@babel/runtime" "^7.8.4" - "@sheerun/mutationobserver-shim" "^0.3.2" - "@types/testing-library__dom" "^6.12.1" - aria-query "^4.0.2" - dom-accessibility-api "^0.3.0" - pretty-format "^25.1.0" - wait-for-expect "^3.0.2" - -"@testing-library/react-hooks@^5.1.0": - version "5.1.3" - resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-5.1.3.tgz#f722cc526025be2c16966a9a081edf47a2528721" - integrity sha512-UdEUtlQapQ579NEcXDAUE275u+KUsPtxW7NmFrNt0bE6lW8lqNCyxDK0RSuECmNZ/S0/fgP00W9RWRhVKO/hRg== +"@testing-library/react-hooks@5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-5.1.0.tgz#6014b7536d0e9427a1e73ce1d073c49a6af5fb3b" + integrity sha512-ChRyyA14e0CeVkWGp24v8q/IiWUqH+B8daRx4lGZme4dsudmMNWz+Qo2Q2NzbD2O5rAVXh2hSbS/KTKeqHYhkw== dependencies: "@babel/runtime" "^7.12.5" "@types/react" ">=16.9.0" @@ -3574,28 +3556,14 @@ filter-console "^0.1.1" react-error-boundary "^3.1.0" -"@testing-library/react@^11.2.5": - version "11.2.7" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-11.2.7.tgz#b29e2e95c6765c815786c0bc1d5aed9cb2bf7818" - integrity sha512-tzRNp7pzd5QmbtXNG/mhdcl7Awfu/Iz1RaVHY75zTdOkmHCuzMhRL83gWHSgOAcjS3CCbyfwUHMZgRJb4kAfpA== +"@testing-library/react@11.2.5": + version "11.2.5" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-11.2.5.tgz#ae1c36a66c7790ddb6662c416c27863d87818eb9" + integrity sha512-yEx7oIa/UWLe2F2dqK0FtMF9sJWNXD+2PPtp39BvE0Kh9MJ9Kl0HrZAgEuhUJR+Lx8Di6Xz+rKwSdEPY2UV8ZQ== dependencies: "@babel/runtime" "^7.12.5" "@testing-library/dom" "^7.28.1" -"@testing-library/react@^9.3.2": - version "9.5.0" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-9.5.0.tgz#71531655a7890b61e77a1b39452fbedf0472ca5e" - integrity sha512-di1b+D0p+rfeboHO5W7gTVeZDIK5+maEgstrZbWZSSvxDyfDRkkyBE1AJR5Psd6doNldluXlCWqXriUfqu/9Qg== - dependencies: - "@babel/runtime" "^7.8.4" - "@testing-library/dom" "^6.15.0" - "@types/testing-library__react" "^9.1.2" - -"@testing-library/user-event@^7.1.2": - version "7.2.1" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-7.2.1.tgz#2ad4e844175a3738cb9e7064be5ea070b8863a1c" - integrity sha512-oZ0Ib5I4Z2pUEcoo95cT1cr6slco9WY7yiPpG+RGNkj8YcYgJnM7pXmYmorNOReh8MIGcKSqXyeGjxnr8YiZbA== - "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -3613,14 +3581,14 @@ multimatch "^5.0.0" "@types/aria-query@^4.2.0": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.1.tgz#78b5433344e2f92e8b306c06a5622c50c245bf6b" - integrity sha512-S6oPal772qJZHoRZLFc/XoZW2gFvwXusYUmXPXkgxJLuEk2vOt7jc4Yo6z/vtI0EBkbPBVrJJ0B+prLIKiWqHg== + version "4.2.2" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" + integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.0", "@types/babel__core@^7.1.7": - version "7.1.14" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" - integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== + version "7.1.15" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.15.tgz#2ccfb1ad55a02c83f8e0ad327cbc332f55eb1024" + integrity sha512-bxlMKPDbY8x5h6HBwVzEOk2C8fb6SLfYQ5Jw3uBYuYF1lfWk/kbLd81la82vrIkBb0l+JdmrZaDikPrNxpS/Ew== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -3629,24 +3597,24 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.2.tgz#f3d71178e187858f7c45e30380f8f1b7415a12d8" - integrity sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ== + version "7.6.3" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5" + integrity sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA== dependencies: "@babel/types" "^7.0.0" "@types/babel__template@*": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.0.tgz#0c888dd70b3ee9eebb6e4f200e809da0076262be" - integrity sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A== + version "7.4.1" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" + integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.11.1" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.11.1.tgz#654f6c4f67568e24c23b367e947098c6206fa639" - integrity sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw== + version "7.14.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.1.tgz#46c2f9501a7a8f0596ddfd365e08c15285a47cce" + integrity sha512-DomsDK/nX3XXHs6jlQ8/YYE6jZAuhmoGAFfcYi1h1jbBNGS7Efdx74FKLTO3HCCyLqQyLlNbql87xqa7C3M/FQ== dependencies: "@babel/types" "^7.3.0" @@ -3678,22 +3646,22 @@ integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== "@types/eslint@^7.2.0": - version "7.2.13" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.13.tgz#e0ca7219ba5ded402062ad6f926d491ebb29dd53" - integrity sha512-LKmQCWAlnVHvvXq4oasNUMTJJb2GwSyTY8+1C7OH5ILR8mPLaljv1jxL1bXW3xB3jFbQxTKxJAvI8PyjB09aBg== + version "7.2.14" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.14.tgz#088661518db0c3c23089ab45900b99dd9214b92a" + integrity sha512-pESyhSbUOskqrGcaN+bCXIQDyT5zTaRWfj5ZjjSlMatgGjIn3QQPfocAu4WSabUR7CGyLZ2CQaZyISOEX7/saw== dependencies: "@types/estree" "*" "@types/json-schema" "*" "@types/estree@*": - version "0.0.48" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.48.tgz#18dc8091b285df90db2f25aa7d906cfc394b7f74" - integrity sha512-LfZwXoGUDo0C3me81HXgkBg5CTQYb6xzEl+fNmbO4JdRiSKQ8A0GD1OBBvKAIsbCUgoyAty7m99GqqMQe784ew== + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== "@types/glob@*", "@types/glob@^7.1.1": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" - integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== + version "7.1.4" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.4.tgz#ea59e21d2ee5c517914cb4bc8e4153b99e566672" + integrity sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA== dependencies: "@types/minimatch" "*" "@types/node" "*" @@ -3706,9 +3674,9 @@ "@types/node" "*" "@types/http-proxy@^1.17.4": - version "1.17.6" - resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.6.tgz#62dc3fade227d6ac2862c8f19ee0da9da9fd8616" - integrity sha512-+qsjqR75S/ib0ig0R9WN+CDoZeOBU6F2XLewgC4KVgdXiNHiKKHFEMRHOrs5PbYE97D5vataw5wPj4KLYfUkuQ== + version "1.17.7" + resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.7.tgz#30ea85cc2c868368352a37f0d0d3581e24834c6f" + integrity sha512-9hdj6iXH64tHSLTY+Vt2eYOGzSogC+JQ2H7bdPWkuh7KXP5qLllWx++t+K9Wk556c3dkDdPws/SpMRi0sdCT1w== dependencies: "@types/node" "*" @@ -3753,29 +3721,24 @@ integrity sha512-M5qhhfuTt4fwHGqqANNQilp3Htb5cHwBxlMHDUw/TYRVkEp3s3IIFSH3Fe9HIAeEtnO4p3SSowLmCVavdRYfpw== "@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" - integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + version "7.0.8" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818" + integrity sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg== "@types/lodash@^4.14.168": - version "4.14.170" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.170.tgz#0d67711d4bf7f4ca5147e9091b847479b87925d6" - integrity sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q== + version "4.14.171" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.171.tgz#f01b3a5fe3499e34b622c362a46a609fdb23573b" + integrity sha512-7eQ2xYLLI/LsicL2nejW9Wyko3lcpN6O/z0ZLHrEQsg280zIdCv1t/0m6UtBjUHokCGBQ3gYTbHzDkZ1xOBwwg== "@types/minimatch@*", "@types/minimatch@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" - integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" + integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/minimist@^1.2.0": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256" - integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== + version "1.2.2" + resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" + integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/mustache@4.0.1": version "4.0.1" @@ -3791,9 +3754,9 @@ form-data "^3.0.0" "@types/node@*", "@types/node@>= 8": - version "15.12.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.2.tgz#1f2b42c4be7156ff4a6f914b2fb03d05fa84e38d" - integrity sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww== + version "16.0.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.1.tgz#70cedfda26af7a2ca073fdcc9beb2fff4aa693f8" + integrity sha512-hBOx4SUlEPKwRi6PrXuTGw1z6lz0fjsibcWCM378YxsSu/6+C30L6CR49zIBKHiwNWCYIcOLjg4OHKZaFeLAug== "@types/node@12.6.9": version "12.6.9" @@ -3806,14 +3769,14 @@ integrity sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw== "@types/node@^12.12.6": - version "12.20.15" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.15.tgz#10ee6a6a3f971966fddfa3f6e89ef7a73ec622df" - integrity sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg== + version "12.20.16" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.16.tgz#1acf34f6456208f495dac0434dd540488d17f991" + integrity sha512-6CLxw83vQf6DKqXxMPwl8qpF8I7THFZuIwLt4TnNsumxkp1VsRZWT8txQxncT/Rl2UojTsFzWgDG4FRMwafrlA== "@types/normalize-package-data@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" - integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" + integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== "@types/parse-json@^4.0.0": version "4.0.0" @@ -3828,35 +3791,35 @@ "@types/node" "*" "@types/prettier@^2.0.0", "@types/prettier@^2.1.5": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.0.tgz#2e8332cc7363f887d32ec5496b207d26ba8052bb" - integrity sha512-hkc1DATxFLQo4VxPDpMH1gCkPpBbpOoJ/4nhuXw4n63/0R6bCpQECj4+K226UJ4JO/eJQz+1mC2I7JsWanAdQw== + version "2.3.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" + integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== "@types/prop-types@*": - version "15.7.3" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" - integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + version "15.7.4" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" + integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== "@types/q@^1.5.1": - version "1.5.4" - resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" - integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== + version "1.5.5" + resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.5.tgz#75a2a8e7d8ab4b230414505d92335d1dcb53a6df" + integrity sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ== -"@types/react-dom@*", "@types/react-dom@>=16.9.0": - version "17.0.7" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.7.tgz#b8ee15ead9e5d6c2c858b44949fdf2ebe5212232" - integrity sha512-Wd5xvZRlccOrCTej8jZkoFZuZRKHzanDDv1xglI33oBNFMWrqOSzrvWFw7ngSiZjrpJAzPKFtX7JvuXpkNmQHA== +"@types/react-dom@16.9.0": + version "16.9.0" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.0.tgz#ba6ddb00bf5de700b0eb91daa452081ffccbfdea" + integrity sha512-OL2lk7LYGjxn4b0efW3Pvf2KBVP0y1v3wip1Bp7nA79NkOpElH98q3WdCEdDj93b2b0zaeBG9DvriuKjIK5xDA== dependencies: "@types/react" "*" -"@types/react-dom@^16.9.0": - version "16.9.13" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.13.tgz#5898f0ee68fe200685e6b61d3d7d8828692814d0" - integrity sha512-34Hr3XnmUSJbUVDxIw/e7dhQn2BJZhJmlAaPyPwfTQyuVS9mV/CeyghFcXyvkJXxI7notQJz8mF8FeCVvloJrA== +"@types/react-dom@>=16.9.0": + version "17.0.9" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.9.tgz#441a981da9d7be117042e1a6fd3dac4b30f55add" + integrity sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg== dependencies: - "@types/react" "^16" + "@types/react" "*" -"@types/react-lottie@^1.2.5": +"@types/react-lottie@1.2.5": version "1.2.5" resolved "https://registry.yarnpkg.com/@types/react-lottie/-/react-lottie-1.2.5.tgz#659322961de534227ba354109342cad967d98841" integrity sha512-g5c7r0VN8g0hLsFEtR71ZFDWDp6niY4D/7llcAcLjV3LpaoyANmaQ9jispskWpkAUP+NYQcFllMtoGIWUM6VRw== @@ -3871,22 +3834,21 @@ "@types/react" "*" "@types/react@*", "@types/react@>=16.9.0": - version "17.0.11" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.11.tgz#67fcd0ddbf5a0b083a0f94e926c7d63f3b836451" - integrity sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA== + version "17.0.14" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.14.tgz#f0629761ca02945c4e8fea99b8177f4c5c61fb0f" + integrity sha512-0WwKHUbWuQWOce61UexYuWTGuGY/8JvtUe/dtQ6lR4sZ3UiylHotJeWpf3ArP9+DSGUoLY3wbU59VyMrJps5VQ== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" csstype "^3.0.2" -"@types/react@^16", "@types/react@^16.9.0": - version "16.14.8" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.8.tgz#4aee3ab004cb98451917c9b7ada3c7d7e52db3fe" - integrity sha512-QN0/Qhmx+l4moe7WJuTxNiTsjBwlBGHqKGvInSQCBdo7Qio0VtOqwsC0Wq7q3PbJlB0cR4Y4CVo1OOe6BOsOmA== +"@types/react@16.9.0": + version "16.9.0" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.0.tgz#27434f16d889a335eb4626d1f1e67eda54039e5b" + integrity sha512-eOct1hyZI9YZf/eqNlYu7jxA9qyTw1EGXruAJhHhBDBpc00W0C1vwlnh+hkOf7UFZkNK+UxnFBpwAZe3d7XJhQ== dependencies: "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" + csstype "^2.2.0" "@types/rimraf@3.0.0": version "3.0.0" @@ -3897,21 +3859,21 @@ "@types/node" "*" "@types/scheduler@*": - version "0.16.1" - resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" - integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== "@types/secp256k1@^4.0.1": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.2.tgz#20c29a87149d980f64464e56539bf4810fdb5d1d" - integrity sha512-QMg+9v0bbNJ2peLuHRWxzmy0HRJIG6gFZNhaRSp7S3ggSbCCxiqQB2/ybvhXyhHOCequpNkrx7OavNhrWOsW0A== + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== dependencies: "@types/node" "*" "@types/semver@^7.3.4": - version "7.3.6" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.6.tgz#e9831776f4512a7ba6da53e71c26e5fb67882d63" - integrity sha512-0caWDWmpCp0uifxFh+FaqK3CuZ2SkRR/ZRxAV5+zNdC3QVUi6wyOJnefhPvtNt8NQWXB5OA93BUvZsXpWat2Xw== + version "7.3.7" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.7.tgz#b9eb89d7dfa70d5d1ce525bc1411a35347f533a3" + integrity sha512-4g1jrL98mdOIwSOUh6LTlB0Cs9I0dQPwINUhBg7C6pN4HLr8GS8xsksJxilW6S6dQHVi2K/o+lQuQcg7LroCnw== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -3919,32 +3881,9 @@ integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== "@types/stack-utils@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" - integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== - -"@types/testing-library__dom@*": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@types/testing-library__dom/-/testing-library__dom-7.5.0.tgz#e0a00dd766983b1d6e9d10d33e708005ce6ad13e" - integrity sha512-mj1aH4cj3XUpMEgVpognma5kHVtbm6U6cHZmEFzCRiXPvKkuHrFr3+yXdGLXvfFRBaQIVshPGHI+hGTOJlhS/g== - dependencies: - "@testing-library/dom" "*" - -"@types/testing-library__dom@^6.12.1": - version "6.14.0" - resolved "https://registry.yarnpkg.com/@types/testing-library__dom/-/testing-library__dom-6.14.0.tgz#1aede831cb4ed4a398448df5a2c54b54a365644e" - integrity sha512-sMl7OSv0AvMOqn1UJ6j1unPMIHRXen0Ita1ujnMX912rrOcawe4f7wu0Zt9GIQhBhJvH2BaibqFgQ3lP+Pj2hA== - dependencies: - pretty-format "^24.3.0" - -"@types/testing-library__react@^9.1.2": - version "9.1.3" - resolved "https://registry.yarnpkg.com/@types/testing-library__react/-/testing-library__react-9.1.3.tgz#35eca61cc6ea923543796f16034882a1603d7302" - integrity sha512-iCdNPKU3IsYwRK9JieSYAiX0+aYDXOGAmrC/3/M7AqqSDKnWWVv07X+Zk1uFSL7cMTUYzv4lQRfohucEocn5/w== - dependencies: - "@types/react-dom" "*" - "@types/testing-library__dom" "*" - pretty-format "^25.1.0" + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" + integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/uuid@3.4.3": version "3.4.3" @@ -3954,21 +3893,21 @@ "@types/node" "*" "@types/yargs-parser@*": - version "20.2.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" - integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== + version "20.2.1" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" + integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== "@types/yargs@^13.0.0": - version "13.0.11" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.11.tgz#def2f0c93e4bdf2c61d7e34899b17e34be28d3b1" - integrity sha512-NRqD6T4gktUrDi1o1wLH3EKC1o2caCr7/wR87ODcbVITQF106OM3sFN92ysZ++wqelOd1CTzatnOBRDYYG6wGQ== + version "13.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.12.tgz#d895a88c703b78af0465a9de88aa92c61430b092" + integrity sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ== dependencies: "@types/yargs-parser" "*" "@types/yargs@^15.0.0": - version "15.0.13" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.13.tgz#34f7fec8b389d7f3c1fd08026a5763e072d3c6dc" - integrity sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ== + version "15.0.14" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.14.tgz#26d821ddb89e70492160b66d10a0eb6df8f6fb06" + integrity sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ== dependencies: "@types/yargs-parser" "*" @@ -4578,9 +4517,9 @@ acorn@^7.1.1, acorn@^7.4.0: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.2.4: - version "8.4.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.0.tgz#af53266e698d7cffa416714b503066a82221be60" - integrity sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w== + version "8.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" + integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA== address@1.1.2, address@^1.0.1: version "1.1.2" @@ -4660,9 +4599,9 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.6.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.0.tgz#60cc45d9c46a477d80d92c48076d972c342e5720" - integrity sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ== + version "8.6.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.1.tgz#ae65764bf1edde8cd861281cda5057852364a295" + integrity sha512-42VLtQUOLefAvKFAQIxIZDaThq6om/PrfP0CYk3/vn+y4BMNkKnbli8ON2QCiHov4KkzOSJ/xSoBJdayiiYvVQ== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -4775,7 +4714,7 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -anymatch@^3.0.3, anymatch@~3.1.1: +anymatch@^3.0.3, anymatch@~3.1.1, anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== @@ -4877,7 +4816,7 @@ aria-query@^3.0.0: ast-types-flow "0.0.7" commander "^2.11.0" -aria-query@^4.0.2, aria-query@^4.2.2: +aria-query@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== @@ -5445,12 +5384,12 @@ babel-plugin-polyfill-corejs2@^0.2.2: semver "^6.1.1" babel-plugin-polyfill-corejs3@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.2.tgz#7424a1682ee44baec817327710b1b094e5f8f7f5" - integrity sha512-l1Cf8PKk12eEk5QP/NQ6TH8A1pee6wWDJ96WjxrMXFLHLOBFzYM4moG80HFgduVhTqAFez4alnZKEhP/bYHg0A== + version "0.2.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.3.tgz#72add68cf08a8bf139ba6e6dfc0b1d504098e57b" + integrity sha512-rCOFzEIJpJEAU14XCcV/erIf/wZQMmMT5l5vXOpL5uoznyOGfDIjPj6FVytMvtzaKSTSVKouOCTPJ5OMUZH30g== dependencies: "@babel/helper-define-polyfill-provider" "^0.2.2" - core-js-compat "^3.9.1" + core-js-compat "^3.14.0" babel-plugin-polyfill-regenerator@^0.2.2: version "0.2.2" @@ -5963,9 +5902,9 @@ bl@^4.0.0: readable-stream "^3.4.0" blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= + version "1.1.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702" + integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== blob-to-it@^1.0.1: version "1.0.2" @@ -6505,9 +6444,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219: - version "1.0.30001237" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001237.tgz#4b7783661515b8e7151fc6376cfd97f0e427b9e5" - integrity sha512-pDHgRndit6p1NR2GhzMbQ6CkRrp4VKuSsqbcLeOQppYPKOYkKT/6ZvZDvKJUqcmtyWIAHuZq3SVS2vc1egCZzw== + version "1.0.30001243" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001243.tgz#d9250155c91e872186671c523f3ae50cfc94a3aa" + integrity sha512-vNxw9mkTBtkmLFnJRv/2rhs1yufpDfCkBZexG3Y0xdOH2Z/eE/85E4Dl5j1YUN34nZVsSp6vVRFQRrez9wJMRA== capture-exit@^2.0.0: version "2.0.0" @@ -6570,7 +6509,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== @@ -6588,7 +6527,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chokidar@3.5.1, chokidar@^3.3.0, chokidar@^3.4.1: +chokidar@3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== @@ -6622,6 +6561,21 @@ chokidar@^2.0.4, chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" +chokidar@^3.3.0, chokidar@^3.4.1: + version "3.5.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.1.1, chownr@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -6649,9 +6603,9 @@ cids@^0.7.1: multihashes "~0.4.15" cids@^1.0.0, cids@^1.1.4: - version "1.1.6" - resolved "https://registry.yarnpkg.com/cids/-/cids-1.1.6.tgz#ac7aea7dbcabaa64ca242b5d970d596a5c34d006" - integrity sha512-5P+Jas2bVpjiHibp/SOwKY+v7JhAjTChaAZN+vCIrsWXn/JZV0frX22Vp5zZgEyJRPco79pX+yNQ2S3LkRukHQ== + version "1.1.7" + resolved "https://registry.yarnpkg.com/cids/-/cids-1.1.7.tgz#06aee89b9b5d615a7def86f2308a72bb642b7c7e" + integrity sha512-dlh+K0hMwFAFFjWQ2ZzxOhgGVNVREPdmk8cqHFui2U4sOodcemLMxdE5Ujga4cDcDQhWfldEPThkfu6KWBt1eA== dependencies: multibase "^4.0.1" multicodec "^3.0.1" @@ -7190,7 +7144,7 @@ conventional-recommended-bump@^5.0.0: meow "^4.0.0" q "^1.5.1" -convert-source-map@1.7.0, convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: +convert-source-map@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== @@ -7202,6 +7156,13 @@ convert-source-map@^0.3.3: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-0.3.5.tgz#f1d802950af7dd2631a1febe0596550c86ab3190" integrity sha1-8dgClQr33SYxof6+BZZVDIarMZA= +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== + dependencies: + safe-buffer "~5.1.1" + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -7247,18 +7208,18 @@ copyfiles@2.4.1: untildify "^4.0.0" yargs "^16.1.0" -core-js-compat@^3.0.0, core-js-compat@^3.14.0, core-js-compat@^3.6.2, core-js-compat@^3.9.1: - version "3.14.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.14.0.tgz#b574dabf29184681d5b16357bd33d104df3d29a5" - integrity sha512-R4NS2eupxtiJU+VwgkF9WTpnSfZW4pogwKHd8bclWU2sp93Pr5S1uYJI84cMOubJRou7bcfL0vmwtLslWN5p3A== +core-js-compat@^3.0.0, core-js-compat@^3.14.0, core-js-compat@^3.15.0, core-js-compat@^3.6.2: + version "3.15.2" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.15.2.tgz#47272fbb479880de14b4e6081f71f3492f5bd3cb" + integrity sha512-Wp+BJVvwopjI+A1EFqm2dwUmWYXrvucmtIB2LgXn/Rb+gWPKYxtmb4GKHGKG/KGF1eK9jfjzT38DITbTOCX/SQ== dependencies: browserslist "^4.16.6" semver "7.0.0" -core-js-pure@^3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.14.0.tgz#72bcfacba74a65ffce04bf94ae91d966e80ee553" - integrity sha512-YVh+LN2FgNU0odThzm61BsdkwrbrchumFq3oztnE9vTKC4KS2fvnPmcx8t6jnqAyOTCTF4ZSiuK8Qhh7SNcL4g== +core-js-pure@^3.15.0: + version "3.15.2" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.15.2.tgz#c8e0874822705f3385d3197af9348f7c9ae2e3ce" + integrity sha512-D42L7RYh1J2grW8ttxoY1+17Y4wXZeKe7uyplAI3FkNQyI5OgBIAjUfFiTPfL1rs0qLpxaabITNbjKl1Sp82tA== core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: version "2.6.12" @@ -7266,9 +7227,9 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.5.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.14.0.tgz#62322b98c71cc2018b027971a69419e2425c2a6c" - integrity sha512-3s+ed8er9ahK+zJpp9ZtuVcDoFzHNiZsPbNAAE4KXgrRHbjSqqNN6xGSXq6bq7TZIbKj4NLrLb6bJ5i+vSVjHA== + version "3.15.2" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.15.2.tgz#740660d2ff55ef34ce664d7e2455119c5bdd3d61" + integrity sha512-tKs41J7NJVuaya8DxIOCnl8QuPHx5/ZVbFo1oKgVl1qHFBBrDctzQGtuLjPpRdNTWmKPH6oEvgN/MUID+l485Q== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -7633,6 +7594,11 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" +csstype@^2.2.0: + version "2.6.17" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.17.tgz#4cf30eb87e1d1a005d8b6510f95292413f6a1c0e" + integrity sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A== + csstype@^3.0.2: version "3.0.8" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" @@ -7715,9 +7681,9 @@ debug@3.1.0, debug@=3.1.0: ms "2.0.0" debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== dependencies: ms "2.1.2" @@ -7752,9 +7718,9 @@ decimal.js-light@^2.5.0: integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== decimal.js@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3" - integrity sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw== + version "10.3.1" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" + integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== decode-uri-component@^0.2.0: version "0.2.0" @@ -8043,11 +8009,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.3.0.tgz#511e5993dd673b97c87ea47dba0e3892f7e0c983" - integrity sha512-PzwHEmsRP3IGY4gv/Ug+rMeaTIyTJvadCb+ujYXYeIylbHJezIyNToe8KfEgHTCEYyC+/bUghYOGg8yMGlZ6vA== - dom-accessibility-api@^0.5.6: version "0.5.6" resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.6.tgz#3f5d43b52c7a3bd68b5fb63fa47b4e4c1fdf65a9" @@ -8218,9 +8179,9 @@ electron-fetch@^1.7.2: encoding "^0.1.13" electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.723: - version "1.3.752" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.752.tgz#0728587f1b9b970ec9ffad932496429aef750d09" - integrity sha512-2Tg+7jSl3oPxgsBsWKh5H83QazTkmWG/cnNwJplmyZc7KcN61+I10oUgaXSVk/NwfvN3BdkKDR4FYuRBQQ2v0A== + version "1.3.769" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.769.tgz#73ad7e3f2d435810b6f8b29617ec344c782fcbed" + integrity sha512-B+3hW8D76/uoTPSobWI3D/CFn2S4jPn88dVJ+BkD88Lz6LijQpL+hfdzIFJGTQK4KdE0XwmNbjUQFH1OQVwKdQ== elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: version "6.5.4" @@ -9301,16 +9262,15 @@ fast-glob@^2.0.2, fast-glob@^2.2.6: micromatch "^3.1.10" fast-glob@^3.1.1, fast-glob@^3.2.5: - version "3.2.5" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" - integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== + version "3.2.6" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.6.tgz#434dd9529845176ea049acc9343e8282765c6e1a" + integrity sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" @@ -9333,9 +9293,9 @@ fastest-levenshtein@^1.0.12: integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== fastq@^1.6.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" - integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + version "1.11.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.1.tgz#5d8175aae17db61947f8b162cfc7f63264d22807" + integrity sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw== dependencies: reusify "^1.0.4" @@ -9531,9 +9491,9 @@ flatted@^2.0.0: integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== flatted@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" - integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== + version "3.2.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.0.tgz#da07fb8808050aba6fdeac2294542e5043583f05" + integrity sha512-XprP7lDrVT+kE2c2YlfiV+IfS9zxukiIOvNamPNsImNhXadSsQEbosItdL9bUQlCZXR13SvPk20BjWSWLA7m4A== flatten@^1.0.2: version "1.0.3" @@ -9778,7 +9738,7 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.1.2, fsevents@~2.3.1: +fsevents@^2.1.2, fsevents@~2.3.1, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -9953,9 +9913,9 @@ git-up@^4.0.0: parse-url "^5.0.0" git-url-parse@^11.1.2: - version "11.4.4" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.4.4.tgz#5d747debc2469c17bc385719f7d0427802d83d77" - integrity sha512-Y4o9o7vQngQDIU9IjyCmRJBin5iYjI5u9ZITnddRZpD7dcCFQj2sL2XuMNbLRE4b4B/4ENPsp2Q8P44fjAZ0Pw== + version "11.5.0" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.5.0.tgz#acaaf65239cb1536185b19165a24bbc754b3f764" + integrity sha512-TZYSMDeM37r71Lqg1mbnMlOqlHd7BSij9qN7XwTkRqSAYFMihGLGhfHwgqQob3GUhEneKnV4nskN9rbQw2KGxA== dependencies: git-up "^4.0.0" @@ -9974,7 +9934,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: +glob-parent@^5.0.0, glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -10067,9 +10027,9 @@ globby@8.0.2: slash "^1.0.0" globby@^11.0.1: - version "11.0.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" - integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== + version "11.0.4" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" + integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" @@ -10187,10 +10147,10 @@ graphql-json-transform@^1.1.0-alpha.0: resolved "https://registry.yarnpkg.com/graphql-json-transform/-/graphql-json-transform-1.1.0-alpha.0.tgz#fb0c88d24840067e6c55ac64bbc8d4e5de245d2d" integrity sha512-I6lR/lYEezSz4iru0f7a/wR8Rzi3pCafk7S0bX2b/WQOtK0vKabxLShGBXIslsi0arMehIjvOPHJl7MpOUqj0w== -graphql-schema-cycles@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/graphql-schema-cycles/-/graphql-schema-cycles-1.1.2.tgz#925d65d774d296238620aaedc391f26a9e46eb33" - integrity sha512-0I1pOOZZ8MhcNvhvYVRBIGnco8Q4EWfRYJ8vBuGEajuEuSXhC340Tasx7so1jjSphk+48kaoXy2+LNaTnEaSjA== +graphql-schema-cycles@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/graphql-schema-cycles/-/graphql-schema-cycles-1.1.3.tgz#80c148e2d1bb9f741372b7b54dff950aa2f9c0d2" + integrity sha512-0hQZNUeHlwaoTT6apNWLSeO/gJv/+AbZO1JOPqafMlZUmq+fN+KN3ifjoxIt6kxYSlOOpsEWLf0GWEOMdMwTdg== dependencies: graphql "15.5.0" graphql-json-transform "^1.1.0-alpha.0" @@ -12629,9 +12589,9 @@ js-yaml@^4.1.0: argparse "^2.0.1" jsbi@^3.1.1: - version "3.1.4" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.4.tgz#9654dd02207a66a4911b4e4bb74265bc2cbc9dd0" - integrity sha512-52QRRFSsi9impURE8ZUbzAMCLjPm4THO7H2fcuIvaaeFTbSysvkodbQQXIVsNgq/ypDbq6dJiuGKL0vZ/i9hUg== + version "3.1.5" + resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.1.5.tgz#70c2aaa2f75e1dc7604fed45298061ca23724046" + integrity sha512-w2BY0VOYC1ahe+w6Qhl4SFoPvPsZ9NPHY4bwass+LCgU7RK3PBoVQlQ3G1s7vI8W3CYyJiEXcbKF7FIM/L8q3Q== jsbn@~0.1.0: version "0.1.1" @@ -12842,7 +12802,7 @@ json3@^3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA== -json5@2.x, json5@^2.1.0, json5@^2.1.2: +json5@2.x, json5@^2.1.0, json5@^2.1.2, json5@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== @@ -13733,7 +13693,7 @@ micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" -micromatch@^4.0.0, micromatch@^4.0.2: +micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -14097,12 +14057,12 @@ multicodec@^2.0.0, multicodec@^2.0.1: varint "^6.0.0" multicodec@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-3.0.1.tgz#94e043847ee11fcce92487609ac9010429a95e31" - integrity sha512-Y6j3wiPojvkF/z6KFIGt84KdJdP2oILEdzc/3YbD3qQ3EerhqtYlfsZTPPNVoCCxNZZdzIpCKrdYFSav17sIrQ== + version "3.1.0" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-3.1.0.tgz#bc96faee2118d1ff114a3ee9e870a030a3b65743" + integrity sha512-f6d4DhbQ9a8WiJ/wpbKgeJSeR0/juP/1wnjbKdZ0KAWDkC/z7Lb3xOegMUG+uTcfwSYf6j1eTvFf8HDgqPRGmQ== dependencies: - uint8arrays "^2.1.3" - varint "^5.0.2" + uint8arrays "^2.1.5" + varint "^6.0.0" multihashes@^0.4.15, multihashes@~0.4.15, multihashes@~0.4.19: version "0.4.21" @@ -14497,20 +14457,15 @@ normalize-url@1.9.1: query-string "^4.1.0" sort-keys "^1.0.0" -normalize-url@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" - integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== - -normalize-url@^4.1.0: +normalize-url@4.5.1, normalize-url@^4.1.0: version "4.5.1" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== -normalize-url@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.0.1.tgz#a4f27f58cf8c7b287b440b8a8201f42d0b00d256" - integrity sha512-VU4pzAuh7Kip71XEmO9aNREYAdMHFGTVj/i+CaTImS8x0i1d3jUZkXhqluy/PRgjPLMgsLQulYY3PJ/aSbSjpQ== +normalize-url@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" + integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== npm-bundled@^1.0.1: version "1.1.2" @@ -15198,12 +15153,12 @@ parse-path@^4.0.0: query-string "^6.13.8" parse-url@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-5.0.3.tgz#c158560f14cb1560917e0b7fd8b01adc1e9d3cab" - integrity sha512-nrLCVMJpqo12X8uUJT4GJPd5AFaTOrGx/QpJy3HNcVtq0AZSstVIsnxS5fqNPuoqMUs3MyfBoOP6Zvu2Arok5A== + version "5.0.7" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-5.0.7.tgz#2ca3c32816f1a092c35e1f2afe63bb7924dde261" + integrity sha512-CgbjyWT6aOh2oNSUS0cioYQsGysj9hQ2IdbOfeNwq5KOaKM7dOw/yTupiI0cnJhaDHJEIGybPkQz7LF9WNIhyw== dependencies: is-ssh "^1.3.0" - normalize-url "^6.0.1" + normalize-url "4.5.1" parse-path "^4.0.0" protocols "^1.4.0" @@ -16137,9 +16092,9 @@ prettier@2.2.1: integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== prettier@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" - integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== + version "2.3.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" + integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== pretty-bytes@^5.1.0: version "5.6.0" @@ -16154,7 +16109,7 @@ pretty-error@^2.1.1: lodash "^4.17.20" renderkid "^2.0.4" -pretty-format@^24.3.0, pretty-format@^24.9.0: +pretty-format@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== @@ -16164,7 +16119,7 @@ pretty-format@^24.3.0, pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-format@^25.1.0, pretty-format@^25.2.1, pretty-format@^25.5.0: +pretty-format@^25.2.1, pretty-format@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== @@ -16580,10 +16535,10 @@ react-dev-utils@^10.2.1: strip-ansi "6.0.0" text-table "0.2.0" -react-dom@^16.13.1: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89" - integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw== +react-dom@16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f" + integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -16612,7 +16567,7 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -react-lottie@^1.2.3: +react-lottie@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/react-lottie/-/react-lottie-1.2.3.tgz#8544b96939e088658072eea5e12d912cdaa3acc1" integrity sha512-qLCERxUr8M+4mm1LU0Ruxw5Y5Fn/OmYkGfnA+JDM/dZb3oKwVAJCjwnjkj9TMHtzR2U6sMEUD3ZZ1RaHagM7kA== @@ -16680,10 +16635,10 @@ react-scripts@3.4.1: optionalDependencies: fsevents "2.1.2" -react@^16.13.1: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" - integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== +react@16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" + integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -16871,6 +16826,13 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + realpath-native@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" @@ -17000,9 +16962,9 @@ regexpp@^2.0.1: integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== regexpp@^3.0.0, regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== regexpu-core@^2.0.0: version "2.0.0" @@ -18145,9 +18107,9 @@ stream-shift@^1.0.0: integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== stream-to-it@^0.2.0, stream-to-it@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/stream-to-it/-/stream-to-it-0.2.3.tgz#b9320ceb26a51b313de81036d4354d9b657f4d2d" - integrity sha512-xaK9EjPtLox5rrC7YLSBXSanTtUJN/lzJlMFvy9VaROmnyvy0U/X6m2uMhXPJRn3g3M9uOSIzTszW7BPiWSg9w== + version "0.2.4" + resolved "https://registry.yarnpkg.com/stream-to-it/-/stream-to-it-0.2.4.tgz#d2fd7bfbd4a899b4c0d6a7e6a533723af5749bd0" + integrity sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ== dependencies: get-iterator "^1.0.2" @@ -18948,12 +18910,11 @@ ts-pnp@^1.1.6: integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== tsconfig-paths@^3.9.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" - integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== + version "3.10.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz#79ae67a68c15289fdf5c51cb74f397522d795ed7" + integrity sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q== dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.1" + json5 "^2.2.0" minimist "^1.2.0" strip-bom "^3.0.0" @@ -19076,9 +19037,9 @@ typescript@4.0.7: integrity sha512-yi7M4y74SWvYbnazbn8/bmJmX4Zlej39ZOqwG/8dut/MYoSQ119GY9ZFbbGsD4PFZYWxqik/XsP3vk3+W5H3og== typescript@^4.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw== + version "4.3.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" + integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== uglify-js@^2.8.29: version "2.8.29" @@ -19091,9 +19052,9 @@ uglify-js@^2.8.29: uglify-to-browserify "~1.0.0" uglify-js@^3.1.4: - version "3.13.9" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.9.tgz#4d8d21dcd497f29cfd8e9378b9df123ad025999b" - integrity sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g== + version "3.13.10" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.13.10.tgz#a6bd0d28d38f592c3adb6b180ea6e07e1e540a8d" + integrity sha512-57H3ACYFXeo1IaZ1w02sfA71wI60MGco/IQFjOqK+WtKoprh7Go2/yvd2HPtoJILO2Or84ncLccI4xoHMTSbGg== uglify-to-browserify@~1.0.0: version "1.0.2" @@ -19122,7 +19083,7 @@ uint8arrays@1.1.0, uint8arrays@^1.0.0, uint8arrays@^1.1.0: multibase "^3.0.0" web-encoding "^1.0.2" -uint8arrays@^2.0.5, uint8arrays@^2.1.3: +uint8arrays@^2.0.5, uint8arrays@^2.1.3, uint8arrays@^2.1.5: version "2.1.5" resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-2.1.5.tgz#9e6e6377a9463d5eba4620a3f0450f7eb389a351" integrity sha512-CSR7AO+4AHUeSOnZ/NBNCElDeWfRh9bXtOck27083kc7SznmmHIhNEkEOCQOn0wvrIMjS3IH0TNLR16vuc46mA== @@ -19545,11 +19506,6 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" -wait-for-expect@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-3.0.2.tgz#d2f14b2f7b778c9b82144109c8fa89ceaadaa463" - integrity sha512-cfS1+DZxuav1aBYbaO/kE06EOS8yRw7qOFoD3XtjTkYvCvh3zUvNST8DXK/nPaeqIzIv3P3kL3lRJn8iwOiSag== - walker@^1.0.7, walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" @@ -19830,9 +19786,9 @@ web3-utils@1.2.11: utf8 "3.0.0" web3-utils@^1.0.0-beta.31: - version "1.3.6" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.6.tgz#390bc9fa3a7179746963cfaca55bb80ac4d8dc10" - integrity sha512-hHatFaQpkQgjGVER17gNx8u1qMyaXFZtM0y0XLGH1bzsjMPlkMPLRcYOrZ00rOPfTEuYFOdrpGOqZXVmGrMZRg== + version "1.4.0" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.4.0.tgz#e8cb381c81b242dc1d4ecb397200356d404410e6" + integrity sha512-b8mEhwh/J928Xk+SQFjtqrR2EGPhpknWLcIt9aCpVPVRXiqjUGo/kpOHKz0azu9c6/onEJ9tWXZt0cVjmH0N5Q== dependencies: bn.js "^4.11.9" eth-lib "0.2.8" @@ -20123,9 +20079,9 @@ whatwg-url@^7.0.0: webidl-conversions "^4.0.2" whatwg-url@^8.0.0, whatwg-url@^8.5.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.6.0.tgz#27c0205a4902084b872aecb97cf0f2a7a3011f4c" - integrity sha512-os0KkeeqUOl7ccdDT1qqUcS4KH4tcBTSKK5Nl5WKb2lyxInIZ/CpjkqKa1Ss12mjfdcRX9mHmPPs7/SxG1Hbdw== + version "8.7.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" + integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== dependencies: lodash "^4.7.0" tr46 "^2.1.0" @@ -20496,7 +20452,7 @@ ws@7.3.1: resolved "https://registry.yarnpkg.com/ws/-/ws-7.3.1.tgz#d0547bf67f7ce4f12a72dfe31262c68d7dc551c8" integrity sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA== -ws@7.4.6, ws@^7.4.5: +ws@7.4.6: version "7.4.6" resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== @@ -20524,6 +20480,11 @@ ws@^6.1.2, ws@^6.2.1: dependencies: async-limiter "~1.0.0" +ws@^7.4.5: + version "7.5.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.2.tgz#09cc8fea3bec1bc5ed44ef51b42f945be36900f6" + integrity sha512-lkF7AWRicoB9mAgjeKbGqVUekLnSNO4VjKVnuPHpQeOxZOErX6BPXwJk70nFslRCEEA8EVW7ZjKwXaP9N+1sKQ== + xhr-request-promise@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" @@ -20637,9 +20598,9 @@ yargs-parser@18.x, yargs-parser@^18.1.2: decamelize "^1.2.0" yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.7" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" - integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs-parser@^11.1.1: version "11.1.1" @@ -20658,9 +20619,9 @@ yargs-parser@^13.1.0, yargs-parser@^13.1.2: decamelize "^1.2.0" yargs-parser@^15.0.1: - version "15.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.1.tgz#54786af40b820dcb2fb8025b11b4d659d76323b3" - integrity sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw== + version "15.0.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.3.tgz#316e263d5febe8b38eef61ac092b33dfcc9b1115" + integrity sha512-/MVEVjTXy/cGAjdtQf8dW3V9b97bPN7rNn8ETj6BmAQL7ibC7O1Q9SPJbGjgh3SlwoBNXMzj/ZGIj8mBgl12YA== dependencies: camelcase "^5.0.0" decamelize "^1.2.0"